feat(logging): aggregate recent service logs in dashboard

This commit is contained in:
sam committed 2026-10-09 09:57:57 +11:00
1 parent 81384939a2
commit 542bd88040
43 files changed
+1646 -555

No files matched your search

+6
View File
@@ -49,6 +49,7 @@ import (
"github.com/samcharles93/archie-core/internal/infrastructure/eventbus/nats"
"github.com/samcharles93/archie-core/internal/infrastructure/extension"
"github.com/samcharles93/archie-core/internal/infrastructure/kitrun"
"github.com/samcharles93/archie-core/internal/infrastructure/logrpc"
"github.com/samcharles93/archie-core/internal/infrastructure/messagingrpc"
"github.com/samcharles93/archie-core/internal/infrastructure/modelcatalog"
"github.com/samcharles93/archie-core/internal/infrastructure/staterpc"
@@ -582,6 +583,11 @@ func (b *boot) registerNATSRPC() error {
}
b.addCleanup(unsubscribe)
stopLogs, err := logrpc.RegisterDaemon(coreConn, b.logFeed, log)
if err != nil {
return fmt.Errorf("register daemon logs: %w", err)
}
b.addCleanup(stopLogs)
unsubscribeSystemLogs, err := subscribeSystemLogs(coreConn, b.taskLogs, log)
if err != nil {
log.Error("system log subscribe failed", "err", err)
+5
View File
@@ -292,6 +292,11 @@ func subscribeSystemLogs(nc *natsio.Conn, taskLogs *logging.TaskRegistry, log *s
}
// The NATS callback has no context of its own; the write is an append to
// an already-open sink, so there is nothing to cancel.
if entry.Fields == nil {
entry.Fields = map[string]any{}
}
entry.Fields["service"] = presence.Agent
entry.Fields["task_id"] = taskID
taskLogs.Write(context.Background(), taskID, entry)
})
if err != nil {
+16
View File
@@ -2,9 +2,13 @@ package archiegateway
import (
"context"
"fmt"
"slices"
"github.com/samcharles93/archie-core/internal/domain/presence"
"github.com/samcharles93/archie-core/internal/infrastructure/gatewayrpc"
"github.com/samcharles93/archie-core/internal/infrastructure/logrpc"
"github.com/samcharles93/archie-core/internal/logging"
"github.com/samcharles93/archie-core/internal/skill"
)
@@ -21,6 +25,7 @@ func (b *server) setSkillList(entries []skill.CatalogEntry) {
// channels, so channel reload is left unset and answers Unavailable.
func (b *server) chatCatalog() gatewayrpc.Catalog {
return gatewayrpc.Catalog{
Logs: b.recentLogs,
Skills: b.skillEntries,
Curators: b.curatorStates,
}
@@ -86,3 +91,14 @@ func skillSource(entry skill.CatalogEntry, workDir, sharedDir string) string {
return "user-global skills"
}
}
func (b *server) recentLogs(ctx context.Context, service string, q logging.Query) (logging.Result, error) {
switch service {
case "", presence.Gateway:
return b.logFeed.Read(q)
case presence.Daemon:
return logrpc.ReadDaemon(ctx, b.taskActionsConn, q)
default:
return logging.Result{}, fmt.Errorf("unknown log service %q", service)
}
}
+3 -1
View File
@@ -33,6 +33,7 @@ import (
"github.com/samcharles93/archie-core/internal/infrastructure/secretengine"
"github.com/samcharles93/archie-core/internal/infrastructure/staterpc"
"github.com/samcharles93/archie-core/internal/infrastructure/taskactions"
"github.com/samcharles93/archie-core/internal/logging"
"github.com/samcharles93/archie-core/internal/plugin"
"github.com/samcharles93/archie-core/internal/ratelimit"
"github.com/samcharles93/archie-core/internal/releaseupdate"
@@ -72,6 +73,7 @@ type server struct {
catalog *modelcatalog.Catalog
chatPool *pgxpool.Pool
chatSessionStore gateway.SessionStore
logFeed *logging.Feed
taskActionsConn *natsio.Conn
bus *events.Bus
@@ -165,7 +167,7 @@ func (b *server) loadConfig(cfgPath, overlayPath string) error {
b.catalog = modelcatalog.NewCatalog(cfgPath)
b.cfgHolder = config.NewHolder(b.cfg)
logs := servicekit.Logging(b.cfg, "gateway")
b.log = logs.Log
b.log, b.logFeed = logs.Log, logs.Feed
b.addCleanup(func() { _ = logs.Closer.Close() })
b.secrets = secret.NewRegistry()
return nil
+5 -3
View File
@@ -21,6 +21,7 @@ import (
"github.com/samcharles93/archie-core/internal/infrastructure/messagingrpc"
"github.com/samcharles93/archie-core/internal/infrastructure/secretengine"
"github.com/samcharles93/archie-core/internal/infrastructure/staterpc"
"github.com/samcharles93/archie-core/internal/logging"
"github.com/samcharles93/archie-core/internal/releaseupdate"
"github.com/samcharles93/archie-core/internal/secret"
)
@@ -29,6 +30,7 @@ import (
func Run(ctx context.Context, o Options) error {
log := slog.Default().With("service", "archie-messaging")
log, feed := servicekit.Diagnostics(log, presence.Messaging)
cfg, err := Resolve(o, log)
if err != nil {
return fmt.Errorf("resolve messaging options: %w", err)
@@ -110,11 +112,11 @@ func Run(ctx context.Context, o Options) error {
if err != nil {
return err
}
return serve(ctx, cfg.Options, srv, log)
return serve(ctx, cfg.Options, srv, log, feed)
}
// serve runs srv and serves MessagingService over it until ctx is cancelled.
func serve(ctx context.Context, o Options, srv *Service, log *slog.Logger) error {
func serve(ctx context.Context, o Options, srv *Service, log *slog.Logger, feed *logging.Feed) error {
opts, err := messagingrpc.ServerOptions(o.Listen, o.Token)
if err != nil {
return err
@@ -124,7 +126,7 @@ func serve(ctx context.Context, o Options, srv *Service, log *slog.Logger) error
return fmt.Errorf("listen messaging (%s): %w", o.Listen, err)
}
server := grpc.NewServer(opts...)
messagingrpc.RegisterServer(server, srv)
messagingrpc.RegisterServer(server, srv, feed)
go func() {
if err := server.Serve(listener); err != nil {
log.Error("messaging gRPC server stopped", "err", err)
+23 -18
View File
@@ -58,6 +58,7 @@ type projection struct {
trustForwardedHeaders bool
gateway ServiceTarget
state ServiceTarget
messaging ServiceTarget
harness ServiceTarget
capture CaptureOptions
}
@@ -67,6 +68,7 @@ func project(cfg config.Config) projection {
listen: cfg.Web.Listen,
trustForwardedHeaders: cfg.Web.TrustForwardedHeaders,
gateway: ServiceTarget{Target: cfg.Services.Get(config.ServiceNameGateway).Target, Token: cfg.Services.Get(config.ServiceNameGateway).TargetToken},
messaging: ServiceTarget{Target: cfg.Services.Get(config.ServiceNameMessaging).Target, Token: cfg.Services.Get(config.ServiceNameMessaging).TargetToken},
state: ServiceTarget{Target: cfg.Services.Get(config.ServiceNameState).Target, Token: cfg.Services.Get(config.ServiceNameState).TargetToken},
harness: ServiceTarget{Target: cfg.Services.Get(config.ServiceNameHarness).Target, Token: cfg.Services.Get(config.ServiceNameHarness).TargetToken},
capture: CaptureOptions{
@@ -87,6 +89,9 @@ func withEnvTokens(o Options) Options {
if o.State.Token == "" {
o.State.Token = os.Getenv("STATE_STORE_TOKEN")
}
if o.Messaging.Token == "" {
o.Messaging.Token = os.Getenv("MESSAGING_TOKEN")
}
if o.Harness.Token == "" {
o.Harness.Token = os.Getenv("HARNESS_TOKEN")
}
@@ -102,24 +107,10 @@ func merge(o Options, p projection) Options {
trust := p.trustForwardedHeaders
o.TrustForwardedHeaders = &trust
}
if o.Gateway.Target == "" {
o.Gateway.Target = p.gateway.Target
}
if o.Gateway.Token == "" {
o.Gateway.Token = p.gateway.Token
}
if o.State.Target == "" {
o.State.Target = p.state.Target
}
if o.State.Token == "" {
o.State.Token = p.state.Token
}
if o.Harness.Target == "" {
o.Harness.Target = p.harness.Target
}
if o.Harness.Token == "" {
o.Harness.Token = p.harness.Token
}
o.Gateway = mergeTarget(o.Gateway, p.gateway)
o.Messaging = mergeTarget(o.Messaging, p.messaging)
o.State = mergeTarget(o.State, p.state)
o.Harness = mergeTarget(o.Harness, p.harness)
if o.Capture.Retention <= 0 {
o.Capture.Retention = p.capture.Retention
}
@@ -139,6 +130,10 @@ func merge(o Options, p projection) Options {
}
func withDefaults(o Options) Options {
if o.Messaging.Target == "" {
spec, _ := config.LookupService(config.ServiceNameMessaging)
o.Messaging.Target = spec.Target
}
// "off" disables the daemon's dashboard but means the default listener here.
if o.Listen == "" || o.Listen == "off" {
o.Listen = defaultListen
@@ -187,3 +182,13 @@ func (o Options) validate() error {
}
return nil
}
func mergeTarget(o, p ServiceTarget) ServiceTarget {
if o.Target == "" {
o.Target = p.Target
}
if o.Token == "" {
o.Token = p.Token
}
return o
}
+32
View File
@@ -0,0 +1,32 @@
package archieui
import (
"context"
"github.com/samcharles93/archie-core/internal/domain/presence"
"github.com/samcharles93/archie-core/internal/infrastructure/gatewayrpc"
"github.com/samcharles93/archie-core/internal/infrastructure/messagingrpc"
"github.com/samcharles93/archie-core/internal/infrastructure/staterpc"
"github.com/samcharles93/archie-core/internal/logging"
"github.com/samcharles93/archie-core/internal/webui"
)
func wireServiceLogs(opts Options, srv *webui.Server, tasks *staterpc.Client, chat *gatewayrpc.Client, feed *logging.Feed) (func(), error) {
srv.LogFeed = feed
srv.LogSources = map[string]webui.LogSource{
presence.UI: func(_ context.Context, q logging.Query) (logging.Result, error) { return feed.Read(q) },
presence.StateStore: tasks.RecentLogs,
presence.Gateway: func(ctx context.Context, q logging.Query) (logging.Result, error) {
return chat.RecentLogs(ctx, presence.Gateway, q)
},
presence.Daemon: func(ctx context.Context, q logging.Query) (logging.Result, error) {
return chat.RecentLogs(ctx, presence.Daemon, q)
},
}
messaging, closeMessaging, dialErr := messagingrpc.Dial(opts.Messaging.Target, opts.Messaging.Token)
if dialErr != nil {
return nil, dialErr
}
srv.LogSources[presence.Messaging] = messaging.RecentLogs
return closeMessaging, nil
}
+3 -2
View File
@@ -67,8 +67,9 @@ type Options struct {
Capture CaptureOptions
// Gateway and State are the two remote contracts the dashboard consumes.
Gateway ServiceTarget
State ServiceTarget
Gateway ServiceTarget
State ServiceTarget
Messaging ServiceTarget
// Harness is the daemon's session contract. Optional: empty leaves the
// setup terminal unwired, and /api/harness reports terminal:false rather
// than offering a control that would fail.
+7 -11
View File
@@ -48,11 +48,11 @@ func buildAccessChain(ctx context.Context, store *staterpc.Client, log *slog.Log
// on shutdown.
func Run(ctx context.Context, options Options) error {
log := slog.New(slog.NewJSONHandler(os.Stderr, nil)).With("component", "ui")
log, feed := servicekit.Diagnostics(log, presence.UI)
opts, err := Resolve(options, log)
if err != nil {
return err
}
var cleanups []func()
defer func() {
for _, cleanup := range slices.Backward(cleanups) {
@@ -69,12 +69,10 @@ func Run(ctx context.Context, options Options) error {
return err
}
cleanups = append(cleanups, closeGateway)
chain, err := buildAccessChain(ctx, tasks, log)
if err != nil {
return err
}
provider, err := signInProvider(opts)
if err != nil {
return err
@@ -84,7 +82,6 @@ func Run(ctx context.Context, options Options) error {
if err != nil {
return err
}
srv := compose(ctx, deps{
Options: opts,
Log: log,
@@ -100,20 +97,20 @@ func Run(ctx context.Context, options Options) error {
Principals: tasks,
Denials: tasks,
})
stopLogs, err := wireServiceLogs(opts, srv, tasks, chat, feed)
if err != nil {
return err
}
cleanups = append(cleanups, stopLogs)
if err := wireHarness(opts, srv, &cleanups); err != nil {
return err
}
// Live activity has no in-process bus in this process: the pump reads
// events back out of the State Store over the same cursor SSE catch-up
// uses. Backgrounded so priming past a large events table cannot delay the
// listener.
// Priming event history must not delay the listener.
go pumpEvents(ctx, srv, opts.EventPollInterval, log)
go presence.Run(ctx, presence.UI, servicekit.Build(), tasks, srv.Health, log)
liveCtx, stopLive := context.WithCancel(ctx)
defer stopLive()
go srv.RunLive(liveCtx)
listener, err := (&net.ListenConfig{}).Listen(ctx, "tcp", opts.Listen)
if err != nil {
return fmt.Errorf("listen for ui: %w", err)
@@ -131,7 +128,6 @@ func Run(ctx context.Context, options Options) error {
attrs = append(attrs, "token_file", opts.TokenFile)
}
log.Info("archie-ui running", attrs...)
return serve(ctx, listener, srv.Handler(), opts)
}
+6
View File
@@ -58,3 +58,9 @@ func Logging(cfg config.Config, component string) Logs {
}
return Logs{Log: log, Feed: feed, TaskLogs: taskLogs, Closer: closer}
}
// Diagnostics captures a service's stderr log for its recent-log contract.
func Diagnostics(log *slog.Logger, service string) (*slog.Logger, *logging.Feed) {
feed := logging.NewFeed(1000)
return slog.New(logging.NewFeedHandler(log.Handler(), feed)).With("service", service), feed
}
+4 -3
View File
@@ -20,8 +20,9 @@ import (
// server is the State Store process: the one owner of the task and
// control-plane tables.
type server struct {
cfg config.Config
log *slog.Logger
cfg config.Config
log *slog.Logger
logFeed *logging.Feed
// stderrLog keeps an offline command off cfg.Log.File: a diagnosis must
// not create, append to or rotate the deployment's log.
stderrLog bool
@@ -57,7 +58,7 @@ func (b *server) loadConfig(_ context.Context, cfgPath, overlayPath string) erro
return nil
}
logs := servicekit.Logging(b.cfg, "state-store")
b.log, b.taskLogs = logs.Log, logs.TaskLogs
b.log, b.taskLogs, b.logFeed = logs.Log, logs.TaskLogs, logs.Feed
b.addCleanup(func() { _ = logs.Closer.Close() })
return nil
}
+2 -1
View File
@@ -266,7 +266,8 @@ func (b *server) openStateStore(ctx context.Context) error {
// degrades that group rather than aborting boot.
func (b *server) stateStoreDeps(grants *staterpc.TaskGrants) staterpc.Deps {
deps := staterpc.Deps{
Tasks: b.st, Log: b.log, Grants: grants,
LogFeed: b.logFeed,
Tasks: b.st, Log: b.log, Grants: grants,
// The same root archied dispatches as (servicekit.IdentityNames).
RootIdentity: identity.StableID(servicekit.IdentityNames(b.cfg)[0]),
}
+187 -75
View File
@@ -7,6 +7,7 @@
package gatewayv1
import (
v1 "github.com/samcharles93/archie-core/internal/contracts/logging/v1"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
@@ -3730,12 +3731,108 @@ func (*ReloadChannelResponse) Descriptor() ([]byte, []int) {
return file_gateway_v1_chat_proto_rawDescGZIP(), []int{62}
}
type RecentLogsRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Query *v1.LogQuery `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
Service string `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RecentLogsRequest) Reset() {
*x = RecentLogsRequest{}
mi := &file_gateway_v1_chat_proto_msgTypes[63]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RecentLogsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RecentLogsRequest) ProtoMessage() {}
func (x *RecentLogsRequest) ProtoReflect() protoreflect.Message {
mi := &file_gateway_v1_chat_proto_msgTypes[63]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RecentLogsRequest.ProtoReflect.Descriptor instead.
func (*RecentLogsRequest) Descriptor() ([]byte, []int) {
return file_gateway_v1_chat_proto_rawDescGZIP(), []int{63}
}
func (x *RecentLogsRequest) GetQuery() *v1.LogQuery {
if x != nil {
return x.Query
}
return nil
}
func (x *RecentLogsRequest) GetService() string {
if x != nil {
return x.Service
}
return ""
}
type RecentLogsResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Snapshot *v1.LogSnapshot `protobuf:"bytes,1,opt,name=snapshot,proto3" json:"snapshot,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RecentLogsResponse) Reset() {
*x = RecentLogsResponse{}
mi := &file_gateway_v1_chat_proto_msgTypes[64]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RecentLogsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RecentLogsResponse) ProtoMessage() {}
func (x *RecentLogsResponse) ProtoReflect() protoreflect.Message {
mi := &file_gateway_v1_chat_proto_msgTypes[64]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RecentLogsResponse.ProtoReflect.Descriptor instead.
func (*RecentLogsResponse) Descriptor() ([]byte, []int) {
return file_gateway_v1_chat_proto_rawDescGZIP(), []int{64}
}
func (x *RecentLogsResponse) GetSnapshot() *v1.LogSnapshot {
if x != nil {
return x.Snapshot
}
return nil
}
var File_gateway_v1_chat_proto protoreflect.FileDescriptor
const file_gateway_v1_chat_proto_rawDesc = "" +
"\n" +
"\x15gateway/v1/chat.proto\x12\n" +
"gateway.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xfb\x02\n" +
"gateway.v1\x1a\x18logging/v1/logging.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xfb\x02\n" +
"\aSession\x12\x1d\n" +
"\n" +
"session_id\x18\x01 \x01(\tR\tsessionId\x12\x1a\n" +
@@ -4028,8 +4125,15 @@ const file_gateway_v1_chat_proto_rawDesc = "" +
"\x14ReloadChannelRequest\x12\x1d\n" +
"\n" +
"channel_id\x18\x01 \x01(\tR\tchannelId\"\x17\n" +
"\x15ReloadChannelResponse2\xfa\x10\n" +
"\vChatService\x12E\n" +
"\x15ReloadChannelResponse\"Y\n" +
"\x11RecentLogsRequest\x12*\n" +
"\x05query\x18\x01 \x01(\v2\x14.logging.v1.LogQueryR\x05query\x12\x18\n" +
"\aservice\x18\x02 \x01(\tR\aservice\"I\n" +
"\x12RecentLogsResponse\x123\n" +
"\bsnapshot\x18\x01 \x01(\v2\x17.logging.v1.LogSnapshotR\bsnapshot2\xc7\x11\n" +
"\vChatService\x12K\n" +
"\n" +
"RecentLogs\x12\x1d.gateway.v1.RecentLogsRequest\x1a\x1e.gateway.v1.RecentLogsResponse\x12E\n" +
"\bSnapshot\x12\x1b.gateway.v1.SnapshotRequest\x1a\x1c.gateway.v1.SnapshotResponse\x12K\n" +
"\n" +
"GetSession\x12\x1d.gateway.v1.GetSessionRequest\x1a\x1e.gateway.v1.GetSessionResponse\x12W\n" +
@@ -4075,7 +4179,7 @@ func file_gateway_v1_chat_proto_rawDescGZIP() []byte {
return file_gateway_v1_chat_proto_rawDescData
}
var file_gateway_v1_chat_proto_msgTypes = make([]protoimpl.MessageInfo, 65)
var file_gateway_v1_chat_proto_msgTypes = make([]protoimpl.MessageInfo, 67)
var file_gateway_v1_chat_proto_goTypes = []any{
(*Session)(nil), // 0: gateway.v1.Session
(*Message)(nil), // 1: gateway.v1.Message
@@ -4140,21 +4244,25 @@ var file_gateway_v1_chat_proto_goTypes = []any{
(*CuratorAction)(nil), // 60: gateway.v1.CuratorAction
(*ReloadChannelRequest)(nil), // 61: gateway.v1.ReloadChannelRequest
(*ReloadChannelResponse)(nil), // 62: gateway.v1.ReloadChannelResponse
nil, // 63: gateway.v1.SnapshotResponse.ModelsByProviderEntry
nil, // 64: gateway.v1.SnapshotResponse.ActivePersonasEntry
(*timestamppb.Timestamp)(nil), // 65: google.protobuf.Timestamp
(*RecentLogsRequest)(nil), // 63: gateway.v1.RecentLogsRequest
(*RecentLogsResponse)(nil), // 64: gateway.v1.RecentLogsResponse
nil, // 65: gateway.v1.SnapshotResponse.ModelsByProviderEntry
nil, // 66: gateway.v1.SnapshotResponse.ActivePersonasEntry
(*timestamppb.Timestamp)(nil), // 67: google.protobuf.Timestamp
(*v1.LogQuery)(nil), // 68: logging.v1.LogQuery
(*v1.LogSnapshot)(nil), // 69: logging.v1.LogSnapshot
}
var file_gateway_v1_chat_proto_depIdxs = []int32{
65, // 0: gateway.v1.Session.created_at:type_name -> google.protobuf.Timestamp
65, // 1: gateway.v1.Session.last_active_at:type_name -> google.protobuf.Timestamp
65, // 2: gateway.v1.Message.at:type_name -> google.protobuf.Timestamp
67, // 0: gateway.v1.Session.created_at:type_name -> google.protobuf.Timestamp
67, // 1: gateway.v1.Session.last_active_at:type_name -> google.protobuf.Timestamp
67, // 2: gateway.v1.Message.at:type_name -> google.protobuf.Timestamp
3, // 3: gateway.v1.Message.media:type_name -> gateway.v1.Media
2, // 4: gateway.v1.Turn.tool_calls:type_name -> gateway.v1.ToolCall
65, // 5: gateway.v1.Turn.created_at:type_name -> google.protobuf.Timestamp
65, // 6: gateway.v1.Turn.updated_at:type_name -> google.protobuf.Timestamp
67, // 5: gateway.v1.Turn.created_at:type_name -> google.protobuf.Timestamp
67, // 6: gateway.v1.Turn.updated_at:type_name -> google.protobuf.Timestamp
0, // 7: gateway.v1.SnapshotResponse.sessions:type_name -> gateway.v1.Session
63, // 8: gateway.v1.SnapshotResponse.models_by_provider:type_name -> gateway.v1.SnapshotResponse.ModelsByProviderEntry
64, // 9: gateway.v1.SnapshotResponse.active_personas:type_name -> gateway.v1.SnapshotResponse.ActivePersonasEntry
65, // 8: gateway.v1.SnapshotResponse.models_by_provider:type_name -> gateway.v1.SnapshotResponse.ModelsByProviderEntry
66, // 9: gateway.v1.SnapshotResponse.active_personas:type_name -> gateway.v1.SnapshotResponse.ActivePersonasEntry
0, // 10: gateway.v1.GetSessionResponse.session:type_name -> gateway.v1.Session
1, // 11: gateway.v1.RecentMessagesResponse.messages:type_name -> gateway.v1.Message
4, // 12: gateway.v1.RecentTurnsResponse.turns:type_name -> gateway.v1.Turn
@@ -4173,67 +4281,71 @@ var file_gateway_v1_chat_proto_depIdxs = []int32{
1, // 25: gateway.v1.SearchMessagesResponse.messages:type_name -> gateway.v1.Message
56, // 26: gateway.v1.ListSkillsResponse.skills:type_name -> gateway.v1.Skill
59, // 27: gateway.v1.CuratorHealthResponse.curators:type_name -> gateway.v1.Curator
65, // 28: gateway.v1.Curator.last_run_at:type_name -> google.protobuf.Timestamp
67, // 28: gateway.v1.Curator.last_run_at:type_name -> google.protobuf.Timestamp
60, // 29: gateway.v1.Curator.recent_actions:type_name -> gateway.v1.CuratorAction
65, // 30: gateway.v1.CuratorAction.at:type_name -> google.protobuf.Timestamp
5, // 31: gateway.v1.SnapshotResponse.ModelsByProviderEntry.value:type_name -> gateway.v1.StringList
6, // 32: gateway.v1.ChatService.Snapshot:input_type -> gateway.v1.SnapshotRequest
8, // 33: gateway.v1.ChatService.GetSession:input_type -> gateway.v1.GetSessionRequest
10, // 34: gateway.v1.ChatService.RecentMessages:input_type -> gateway.v1.RecentMessagesRequest
12, // 35: gateway.v1.ChatService.RecentTurns:input_type -> gateway.v1.RecentTurnsRequest
14, // 36: gateway.v1.ChatService.Route:input_type -> gateway.v1.RouteRequest
16, // 37: gateway.v1.ChatService.Stream:input_type -> gateway.v1.StreamRequest
19, // 38: gateway.v1.ChatService.Answer:input_type -> gateway.v1.AnswerRequest
22, // 39: gateway.v1.ChatService.Cancel:input_type -> gateway.v1.CancelRequest
24, // 40: gateway.v1.ChatService.StopTasks:input_type -> gateway.v1.StopTasksRequest
26, // 41: gateway.v1.ChatService.SetPersona:input_type -> gateway.v1.SetPersonaRequest
28, // 42: gateway.v1.ChatService.ApplyTaskAction:input_type -> gateway.v1.ApplyTaskActionRequest
30, // 43: gateway.v1.ChatService.ApplyOperatorTaskAction:input_type -> gateway.v1.ApplyOperatorTaskActionRequest
33, // 44: gateway.v1.ChatService.SaveSession:input_type -> gateway.v1.SaveSessionRequest
34, // 45: gateway.v1.ChatService.GetSessionsByChannel:input_type -> gateway.v1.GetSessionsByChannelRequest
42, // 46: gateway.v1.ChatService.DeleteSession:input_type -> gateway.v1.DeleteSessionRequest
43, // 47: gateway.v1.ChatService.TouchSession:input_type -> gateway.v1.TouchSessionRequest
44, // 48: gateway.v1.ChatService.ListSessions:input_type -> gateway.v1.ListSessionsRequest
45, // 49: gateway.v1.ChatService.SaveMessage:input_type -> gateway.v1.SaveMessageRequest
46, // 50: gateway.v1.ChatService.DeleteRecentMessages:input_type -> gateway.v1.DeleteRecentMessagesRequest
48, // 51: gateway.v1.ChatService.MessageCount:input_type -> gateway.v1.MessageCountRequest
50, // 52: gateway.v1.ChatService.SaveMessages:input_type -> gateway.v1.SaveMessagesRequest
51, // 53: gateway.v1.ChatService.ReplaceMessages:input_type -> gateway.v1.ReplaceMessagesRequest
52, // 54: gateway.v1.ChatService.SearchMessages:input_type -> gateway.v1.SearchMessagesRequest
54, // 55: gateway.v1.ChatService.ListSkills:input_type -> gateway.v1.ListSkillsRequest
57, // 56: gateway.v1.ChatService.CuratorHealth:input_type -> gateway.v1.CuratorHealthRequest
61, // 57: gateway.v1.ChatService.ReloadChannel:input_type -> gateway.v1.ReloadChannelRequest
7, // 58: gateway.v1.ChatService.Snapshot:output_type -> gateway.v1.SnapshotResponse
9, // 59: gateway.v1.ChatService.GetSession:output_type -> gateway.v1.GetSessionResponse
11, // 60: gateway.v1.ChatService.RecentMessages:output_type -> gateway.v1.RecentMessagesResponse
13, // 61: gateway.v1.ChatService.RecentTurns:output_type -> gateway.v1.RecentTurnsResponse
15, // 62: gateway.v1.ChatService.Route:output_type -> gateway.v1.RouteResponse
21, // 63: gateway.v1.ChatService.Stream:output_type -> gateway.v1.StreamResponse
20, // 64: gateway.v1.ChatService.Answer:output_type -> gateway.v1.AnswerResponse
23, // 65: gateway.v1.ChatService.Cancel:output_type -> gateway.v1.CancelResponse
25, // 66: gateway.v1.ChatService.StopTasks:output_type -> gateway.v1.StopTasksResponse
27, // 67: gateway.v1.ChatService.SetPersona:output_type -> gateway.v1.SetPersonaResponse
29, // 68: gateway.v1.ChatService.ApplyTaskAction:output_type -> gateway.v1.ApplyTaskActionResponse
31, // 69: gateway.v1.ChatService.ApplyOperatorTaskAction:output_type -> gateway.v1.ApplyOperatorTaskActionResponse
32, // 70: gateway.v1.ChatService.SaveSession:output_type -> gateway.v1.SaveSessionResponse
35, // 71: gateway.v1.ChatService.GetSessionsByChannel:output_type -> gateway.v1.GetSessionsByChannelResponse
37, // 72: gateway.v1.ChatService.DeleteSession:output_type -> gateway.v1.DeleteSessionResponse
38, // 73: gateway.v1.ChatService.TouchSession:output_type -> gateway.v1.TouchSessionResponse
36, // 74: gateway.v1.ChatService.ListSessions:output_type -> gateway.v1.ListSessionsResponse
39, // 75: gateway.v1.ChatService.SaveMessage:output_type -> gateway.v1.SaveMessageResponse
47, // 76: gateway.v1.ChatService.DeleteRecentMessages:output_type -> gateway.v1.DeleteRecentMessagesResponse
49, // 77: gateway.v1.ChatService.MessageCount:output_type -> gateway.v1.MessageCountResponse
40, // 78: gateway.v1.ChatService.SaveMessages:output_type -> gateway.v1.SaveMessagesResponse
41, // 79: gateway.v1.ChatService.ReplaceMessages:output_type -> gateway.v1.ReplaceMessagesResponse
53, // 80: gateway.v1.ChatService.SearchMessages:output_type -> gateway.v1.SearchMessagesResponse
55, // 81: gateway.v1.ChatService.ListSkills:output_type -> gateway.v1.ListSkillsResponse
58, // 82: gateway.v1.ChatService.CuratorHealth:output_type -> gateway.v1.CuratorHealthResponse
62, // 83: gateway.v1.ChatService.ReloadChannel:output_type -> gateway.v1.ReloadChannelResponse
58, // [58:84] is the sub-list for method output_type
32, // [32:58] is the sub-list for method input_type
32, // [32:32] is the sub-list for extension type_name
32, // [32:32] is the sub-list for extension extendee
0, // [0:32] is the sub-list for field type_name
67, // 30: gateway.v1.CuratorAction.at:type_name -> google.protobuf.Timestamp
68, // 31: gateway.v1.RecentLogsRequest.query:type_name -> logging.v1.LogQuery
69, // 32: gateway.v1.RecentLogsResponse.snapshot:type_name -> logging.v1.LogSnapshot
5, // 33: gateway.v1.SnapshotResponse.ModelsByProviderEntry.value:type_name -> gateway.v1.StringList
63, // 34: gateway.v1.ChatService.RecentLogs:input_type -> gateway.v1.RecentLogsRequest
6, // 35: gateway.v1.ChatService.Snapshot:input_type -> gateway.v1.SnapshotRequest
8, // 36: gateway.v1.ChatService.GetSession:input_type -> gateway.v1.GetSessionRequest
10, // 37: gateway.v1.ChatService.RecentMessages:input_type -> gateway.v1.RecentMessagesRequest
12, // 38: gateway.v1.ChatService.RecentTurns:input_type -> gateway.v1.RecentTurnsRequest
14, // 39: gateway.v1.ChatService.Route:input_type -> gateway.v1.RouteRequest
16, // 40: gateway.v1.ChatService.Stream:input_type -> gateway.v1.StreamRequest
19, // 41: gateway.v1.ChatService.Answer:input_type -> gateway.v1.AnswerRequest
22, // 42: gateway.v1.ChatService.Cancel:input_type -> gateway.v1.CancelRequest
24, // 43: gateway.v1.ChatService.StopTasks:input_type -> gateway.v1.StopTasksRequest
26, // 44: gateway.v1.ChatService.SetPersona:input_type -> gateway.v1.SetPersonaRequest
28, // 45: gateway.v1.ChatService.ApplyTaskAction:input_type -> gateway.v1.ApplyTaskActionRequest
30, // 46: gateway.v1.ChatService.ApplyOperatorTaskAction:input_type -> gateway.v1.ApplyOperatorTaskActionRequest
33, // 47: gateway.v1.ChatService.SaveSession:input_type -> gateway.v1.SaveSessionRequest
34, // 48: gateway.v1.ChatService.GetSessionsByChannel:input_type -> gateway.v1.GetSessionsByChannelRequest
42, // 49: gateway.v1.ChatService.DeleteSession:input_type -> gateway.v1.DeleteSessionRequest
43, // 50: gateway.v1.ChatService.TouchSession:input_type -> gateway.v1.TouchSessionRequest
44, // 51: gateway.v1.ChatService.ListSessions:input_type -> gateway.v1.ListSessionsRequest
45, // 52: gateway.v1.ChatService.SaveMessage:input_type -> gateway.v1.SaveMessageRequest
46, // 53: gateway.v1.ChatService.DeleteRecentMessages:input_type -> gateway.v1.DeleteRecentMessagesRequest
48, // 54: gateway.v1.ChatService.MessageCount:input_type -> gateway.v1.MessageCountRequest
50, // 55: gateway.v1.ChatService.SaveMessages:input_type -> gateway.v1.SaveMessagesRequest
51, // 56: gateway.v1.ChatService.ReplaceMessages:input_type -> gateway.v1.ReplaceMessagesRequest
52, // 57: gateway.v1.ChatService.SearchMessages:input_type -> gateway.v1.SearchMessagesRequest
54, // 58: gateway.v1.ChatService.ListSkills:input_type -> gateway.v1.ListSkillsRequest
57, // 59: gateway.v1.ChatService.CuratorHealth:input_type -> gateway.v1.CuratorHealthRequest
61, // 60: gateway.v1.ChatService.ReloadChannel:input_type -> gateway.v1.ReloadChannelRequest
64, // 61: gateway.v1.ChatService.RecentLogs:output_type -> gateway.v1.RecentLogsResponse
7, // 62: gateway.v1.ChatService.Snapshot:output_type -> gateway.v1.SnapshotResponse
9, // 63: gateway.v1.ChatService.GetSession:output_type -> gateway.v1.GetSessionResponse
11, // 64: gateway.v1.ChatService.RecentMessages:output_type -> gateway.v1.RecentMessagesResponse
13, // 65: gateway.v1.ChatService.RecentTurns:output_type -> gateway.v1.RecentTurnsResponse
15, // 66: gateway.v1.ChatService.Route:output_type -> gateway.v1.RouteResponse
21, // 67: gateway.v1.ChatService.Stream:output_type -> gateway.v1.StreamResponse
20, // 68: gateway.v1.ChatService.Answer:output_type -> gateway.v1.AnswerResponse
23, // 69: gateway.v1.ChatService.Cancel:output_type -> gateway.v1.CancelResponse
25, // 70: gateway.v1.ChatService.StopTasks:output_type -> gateway.v1.StopTasksResponse
27, // 71: gateway.v1.ChatService.SetPersona:output_type -> gateway.v1.SetPersonaResponse
29, // 72: gateway.v1.ChatService.ApplyTaskAction:output_type -> gateway.v1.ApplyTaskActionResponse
31, // 73: gateway.v1.ChatService.ApplyOperatorTaskAction:output_type -> gateway.v1.ApplyOperatorTaskActionResponse
32, // 74: gateway.v1.ChatService.SaveSession:output_type -> gateway.v1.SaveSessionResponse
35, // 75: gateway.v1.ChatService.GetSessionsByChannel:output_type -> gateway.v1.GetSessionsByChannelResponse
37, // 76: gateway.v1.ChatService.DeleteSession:output_type -> gateway.v1.DeleteSessionResponse
38, // 77: gateway.v1.ChatService.TouchSession:output_type -> gateway.v1.TouchSessionResponse
36, // 78: gateway.v1.ChatService.ListSessions:output_type -> gateway.v1.ListSessionsResponse
39, // 79: gateway.v1.ChatService.SaveMessage:output_type -> gateway.v1.SaveMessageResponse
47, // 80: gateway.v1.ChatService.DeleteRecentMessages:output_type -> gateway.v1.DeleteRecentMessagesResponse
49, // 81: gateway.v1.ChatService.MessageCount:output_type -> gateway.v1.MessageCountResponse
40, // 82: gateway.v1.ChatService.SaveMessages:output_type -> gateway.v1.SaveMessagesResponse
41, // 83: gateway.v1.ChatService.ReplaceMessages:output_type -> gateway.v1.ReplaceMessagesResponse
53, // 84: gateway.v1.ChatService.SearchMessages:output_type -> gateway.v1.SearchMessagesResponse
55, // 85: gateway.v1.ChatService.ListSkills:output_type -> gateway.v1.ListSkillsResponse
58, // 86: gateway.v1.ChatService.CuratorHealth:output_type -> gateway.v1.CuratorHealthResponse
62, // 87: gateway.v1.ChatService.ReloadChannel:output_type -> gateway.v1.ReloadChannelResponse
61, // [61:88] is the sub-list for method output_type
34, // [34:61] is the sub-list for method input_type
34, // [34:34] is the sub-list for extension type_name
34, // [34:34] is the sub-list for extension extendee
0, // [0:34] is the sub-list for field type_name
}
func init() { file_gateway_v1_chat_proto_init() }
@@ -4249,7 +4361,7 @@ func file_gateway_v1_chat_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_gateway_v1_chat_proto_rawDesc), len(file_gateway_v1_chat_proto_rawDesc)),
NumEnums: 0,
NumMessages: 65,
NumMessages: 67,
NumExtensions: 0,
NumServices: 1,
},
@@ -19,6 +19,7 @@ import (
const _ = grpc.SupportPackageIsVersion9
const (
ChatService_RecentLogs_FullMethodName = "/gateway.v1.ChatService/RecentLogs"
ChatService_Snapshot_FullMethodName = "/gateway.v1.ChatService/Snapshot"
ChatService_GetSession_FullMethodName = "/gateway.v1.ChatService/GetSession"
ChatService_RecentMessages_FullMethodName = "/gateway.v1.ChatService/RecentMessages"
@@ -51,6 +52,7 @@ const (
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ChatServiceClient interface {
RecentLogs(ctx context.Context, in *RecentLogsRequest, opts ...grpc.CallOption) (*RecentLogsResponse, error)
Snapshot(ctx context.Context, in *SnapshotRequest, opts ...grpc.CallOption) (*SnapshotResponse, error)
GetSession(ctx context.Context, in *GetSessionRequest, opts ...grpc.CallOption) (*GetSessionResponse, error)
RecentMessages(ctx context.Context, in *RecentMessagesRequest, opts ...grpc.CallOption) (*RecentMessagesResponse, error)
@@ -87,6 +89,16 @@ func NewChatServiceClient(cc grpc.ClientConnInterface) ChatServiceClient {
return &chatServiceClient{cc}
}
func (c *chatServiceClient) RecentLogs(ctx context.Context, in *RecentLogsRequest, opts ...grpc.CallOption) (*RecentLogsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RecentLogsResponse)
err := c.cc.Invoke(ctx, ChatService_RecentLogs_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *chatServiceClient) Snapshot(ctx context.Context, in *SnapshotRequest, opts ...grpc.CallOption) (*SnapshotResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SnapshotResponse)
@@ -360,6 +372,7 @@ func (c *chatServiceClient) ReloadChannel(ctx context.Context, in *ReloadChannel
// All implementations must embed UnimplementedChatServiceServer
// for forward compatibility.
type ChatServiceServer interface {
RecentLogs(context.Context, *RecentLogsRequest) (*RecentLogsResponse, error)
Snapshot(context.Context, *SnapshotRequest) (*SnapshotResponse, error)
GetSession(context.Context, *GetSessionRequest) (*GetSessionResponse, error)
RecentMessages(context.Context, *RecentMessagesRequest) (*RecentMessagesResponse, error)
@@ -396,6 +409,9 @@ type ChatServiceServer interface {
// pointer dereference when methods are called.
type UnimplementedChatServiceServer struct{}
func (UnimplementedChatServiceServer) RecentLogs(context.Context, *RecentLogsRequest) (*RecentLogsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method RecentLogs not implemented")
}
func (UnimplementedChatServiceServer) Snapshot(context.Context, *SnapshotRequest) (*SnapshotResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Snapshot not implemented")
}
@@ -495,6 +511,24 @@ func RegisterChatServiceServer(s grpc.ServiceRegistrar, srv ChatServiceServer) {
s.RegisterService(&ChatService_ServiceDesc, srv)
}
func _ChatService_RecentLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RecentLogsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ChatServiceServer).RecentLogs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ChatService_RecentLogs_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ChatServiceServer).RecentLogs(ctx, req.(*RecentLogsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ChatService_Snapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SnapshotRequest)
if err := dec(in); err != nil {
@@ -963,6 +997,10 @@ var ChatService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "gateway.v1.ChatService",
HandlerType: (*ChatServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "RecentLogs",
Handler: _ChatService_RecentLogs_Handler,
},
{
MethodName: "Snapshot",
Handler: _ChatService_Snapshot_Handler,
+209
View File
@@ -0,0 +1,209 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc (unknown)
// source: logging/v1/logging.proto
package loggingv1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type LogQuery struct {
state protoimpl.MessageState `protogen:"open.v1"`
Limit int32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
Levels []string `protobuf:"bytes,2,rep,name=levels,proto3" json:"levels,omitempty"`
Component string `protobuf:"bytes,3,opt,name=component,proto3" json:"component,omitempty"`
Contains string `protobuf:"bytes,4,opt,name=contains,proto3" json:"contains,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *LogQuery) Reset() {
*x = LogQuery{}
mi := &file_logging_v1_logging_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *LogQuery) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LogQuery) ProtoMessage() {}
func (x *LogQuery) ProtoReflect() protoreflect.Message {
mi := &file_logging_v1_logging_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LogQuery.ProtoReflect.Descriptor instead.
func (*LogQuery) Descriptor() ([]byte, []int) {
return file_logging_v1_logging_proto_rawDescGZIP(), []int{0}
}
func (x *LogQuery) GetLimit() int32 {
if x != nil {
return x.Limit
}
return 0
}
func (x *LogQuery) GetLevels() []string {
if x != nil {
return x.Levels
}
return nil
}
func (x *LogQuery) GetComponent() string {
if x != nil {
return x.Component
}
return ""
}
func (x *LogQuery) GetContains() string {
if x != nil {
return x.Contains
}
return ""
}
type LogSnapshot struct {
state protoimpl.MessageState `protogen:"open.v1"`
EntriesJson []byte `protobuf:"bytes,1,opt,name=entries_json,json=entriesJson,proto3" json:"entries_json,omitempty"`
Truncated bool `protobuf:"varint,2,opt,name=truncated,proto3" json:"truncated,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *LogSnapshot) Reset() {
*x = LogSnapshot{}
mi := &file_logging_v1_logging_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *LogSnapshot) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LogSnapshot) ProtoMessage() {}
func (x *LogSnapshot) ProtoReflect() protoreflect.Message {
mi := &file_logging_v1_logging_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LogSnapshot.ProtoReflect.Descriptor instead.
func (*LogSnapshot) Descriptor() ([]byte, []int) {
return file_logging_v1_logging_proto_rawDescGZIP(), []int{1}
}
func (x *LogSnapshot) GetEntriesJson() []byte {
if x != nil {
return x.EntriesJson
}
return nil
}
func (x *LogSnapshot) GetTruncated() bool {
if x != nil {
return x.Truncated
}
return false
}
var File_logging_v1_logging_proto protoreflect.FileDescriptor
const file_logging_v1_logging_proto_rawDesc = "" +
"\n" +
"\x18logging/v1/logging.proto\x12\n" +
"logging.v1\"r\n" +
"\bLogQuery\x12\x14\n" +
"\x05limit\x18\x01 \x01(\x05R\x05limit\x12\x16\n" +
"\x06levels\x18\x02 \x03(\tR\x06levels\x12\x1c\n" +
"\tcomponent\x18\x03 \x01(\tR\tcomponent\x12\x1a\n" +
"\bcontains\x18\x04 \x01(\tR\bcontains\"N\n" +
"\vLogSnapshot\x12!\n" +
"\fentries_json\x18\x01 \x01(\fR\ventriesJson\x12\x1c\n" +
"\ttruncated\x18\x02 \x01(\bR\ttruncatedB\xb4\x01\n" +
"\x0ecom.logging.v1B\fLoggingProtoP\x01ZKgithub.com/samcharles93/archie-core/internal/contracts/logging/v1;loggingv1\xa2\x02\x03LXX\xaa\x02\n" +
"Logging.V1\xca\x02\n" +
"Logging\\V1\xe2\x02\x16Logging\\V1\\GPBMetadata\xea\x02\vLogging::V1b\x06proto3"
var (
file_logging_v1_logging_proto_rawDescOnce sync.Once
file_logging_v1_logging_proto_rawDescData []byte
)
func file_logging_v1_logging_proto_rawDescGZIP() []byte {
file_logging_v1_logging_proto_rawDescOnce.Do(func() {
file_logging_v1_logging_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_logging_v1_logging_proto_rawDesc), len(file_logging_v1_logging_proto_rawDesc)))
})
return file_logging_v1_logging_proto_rawDescData
}
var file_logging_v1_logging_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_logging_v1_logging_proto_goTypes = []any{
(*LogQuery)(nil), // 0: logging.v1.LogQuery
(*LogSnapshot)(nil), // 1: logging.v1.LogSnapshot
}
var file_logging_v1_logging_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_logging_v1_logging_proto_init() }
func file_logging_v1_logging_proto_init() {
if File_logging_v1_logging_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_logging_v1_logging_proto_rawDesc), len(file_logging_v1_logging_proto_rawDesc)),
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_logging_v1_logging_proto_goTypes,
DependencyIndexes: file_logging_v1_logging_proto_depIdxs,
MessageInfos: file_logging_v1_logging_proto_msgTypes,
}.Build()
File_logging_v1_logging_proto = out.File
file_logging_v1_logging_proto_goTypes = nil
file_logging_v1_logging_proto_depIdxs = nil
}
+117 -14
View File
@@ -7,6 +7,7 @@
package messagingv1
import (
v1 "github.com/samcharles93/archie-core/internal/contracts/logging/v1"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@@ -119,17 +120,111 @@ func (*DeliverResponse) Descriptor() ([]byte, []int) {
return file_messaging_v1_messaging_proto_rawDescGZIP(), []int{1}
}
type RecentLogsRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Query *v1.LogQuery `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RecentLogsRequest) Reset() {
*x = RecentLogsRequest{}
mi := &file_messaging_v1_messaging_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RecentLogsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RecentLogsRequest) ProtoMessage() {}
func (x *RecentLogsRequest) ProtoReflect() protoreflect.Message {
mi := &file_messaging_v1_messaging_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RecentLogsRequest.ProtoReflect.Descriptor instead.
func (*RecentLogsRequest) Descriptor() ([]byte, []int) {
return file_messaging_v1_messaging_proto_rawDescGZIP(), []int{2}
}
func (x *RecentLogsRequest) GetQuery() *v1.LogQuery {
if x != nil {
return x.Query
}
return nil
}
type RecentLogsResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Snapshot *v1.LogSnapshot `protobuf:"bytes,1,opt,name=snapshot,proto3" json:"snapshot,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RecentLogsResponse) Reset() {
*x = RecentLogsResponse{}
mi := &file_messaging_v1_messaging_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RecentLogsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RecentLogsResponse) ProtoMessage() {}
func (x *RecentLogsResponse) ProtoReflect() protoreflect.Message {
mi := &file_messaging_v1_messaging_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RecentLogsResponse.ProtoReflect.Descriptor instead.
func (*RecentLogsResponse) Descriptor() ([]byte, []int) {
return file_messaging_v1_messaging_proto_rawDescGZIP(), []int{3}
}
func (x *RecentLogsResponse) GetSnapshot() *v1.LogSnapshot {
if x != nil {
return x.Snapshot
}
return nil
}
var File_messaging_v1_messaging_proto protoreflect.FileDescriptor
const file_messaging_v1_messaging_proto_rawDesc = "" +
"\n" +
"\x1cmessaging/v1/messaging.proto\x12\fmessaging.v1\"W\n" +
"\x1cmessaging/v1/messaging.proto\x12\fmessaging.v1\x1a\x18logging/v1/logging.proto\"W\n" +
"\x0eDeliverRequest\x12\x18\n" +
"\achannel\x18\x01 \x01(\tR\achannel\x12\x17\n" +
"\achat_id\x18\x02 \x01(\tR\x06chatId\x12\x12\n" +
"\x04text\x18\x03 \x01(\tR\x04text\"\x11\n" +
"\x0fDeliverResponse2Z\n" +
"\x10MessagingService\x12F\n" +
"\x0fDeliverResponse\"?\n" +
"\x11RecentLogsRequest\x12*\n" +
"\x05query\x18\x01 \x01(\v2\x14.logging.v1.LogQueryR\x05query\"I\n" +
"\x12RecentLogsResponse\x123\n" +
"\bsnapshot\x18\x01 \x01(\v2\x17.logging.v1.LogSnapshotR\bsnapshot2\xab\x01\n" +
"\x10MessagingService\x12O\n" +
"\n" +
"RecentLogs\x12\x1f.messaging.v1.RecentLogsRequest\x1a .messaging.v1.RecentLogsResponse\x12F\n" +
"\aDeliver\x12\x1c.messaging.v1.DeliverRequest\x1a\x1d.messaging.v1.DeliverResponseB\xc4\x01\n" +
"\x10com.messaging.v1B\x0eMessagingProtoP\x01ZOgithub.com/samcharles93/archie-core/internal/contracts/messaging/v1;messagingv1\xa2\x02\x03MXX\xaa\x02\fMessaging.V1\xca\x02\fMessaging\\V1\xe2\x02\x18Messaging\\V1\\GPBMetadata\xea\x02\rMessaging::V1b\x06proto3"
@@ -145,19 +240,27 @@ func file_messaging_v1_messaging_proto_rawDescGZIP() []byte {
return file_messaging_v1_messaging_proto_rawDescData
}
var file_messaging_v1_messaging_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_messaging_v1_messaging_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_messaging_v1_messaging_proto_goTypes = []any{
(*DeliverRequest)(nil), // 0: messaging.v1.DeliverRequest
(*DeliverResponse)(nil), // 1: messaging.v1.DeliverResponse
(*DeliverRequest)(nil), // 0: messaging.v1.DeliverRequest
(*DeliverResponse)(nil), // 1: messaging.v1.DeliverResponse
(*RecentLogsRequest)(nil), // 2: messaging.v1.RecentLogsRequest
(*RecentLogsResponse)(nil), // 3: messaging.v1.RecentLogsResponse
(*v1.LogQuery)(nil), // 4: logging.v1.LogQuery
(*v1.LogSnapshot)(nil), // 5: logging.v1.LogSnapshot
}
var file_messaging_v1_messaging_proto_depIdxs = []int32{
0, // 0: messaging.v1.MessagingService.Deliver:input_type -> messaging.v1.DeliverRequest
1, // 1: messaging.v1.MessagingService.Deliver:output_type -> messaging.v1.DeliverResponse
1, // [1:2] is the sub-list for method output_type
0, // [0:1] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
4, // 0: messaging.v1.RecentLogsRequest.query:type_name -> logging.v1.LogQuery
5, // 1: messaging.v1.RecentLogsResponse.snapshot:type_name -> logging.v1.LogSnapshot
2, // 2: messaging.v1.MessagingService.RecentLogs:input_type -> messaging.v1.RecentLogsRequest
0, // 3: messaging.v1.MessagingService.Deliver:input_type -> messaging.v1.DeliverRequest
3, // 4: messaging.v1.MessagingService.RecentLogs:output_type -> messaging.v1.RecentLogsResponse
1, // 5: messaging.v1.MessagingService.Deliver:output_type -> messaging.v1.DeliverResponse
4, // [4:6] is the sub-list for method output_type
2, // [2:4] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_messaging_v1_messaging_proto_init() }
@@ -171,7 +274,7 @@ func file_messaging_v1_messaging_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_messaging_v1_messaging_proto_rawDesc), len(file_messaging_v1_messaging_proto_rawDesc)),
NumEnums: 0,
NumMessages: 2,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
@@ -19,7 +19,8 @@ import (
const _ = grpc.SupportPackageIsVersion9
const (
MessagingService_Deliver_FullMethodName = "/messaging.v1.MessagingService/Deliver"
MessagingService_RecentLogs_FullMethodName = "/messaging.v1.MessagingService/RecentLogs"
MessagingService_Deliver_FullMethodName = "/messaging.v1.MessagingService/Deliver"
)
// MessagingServiceClient is the client API for MessagingService service.
@@ -30,6 +31,7 @@ const (
// the chat channel transports. Other services send outbound messages through
// it rather than holding channel credentials themselves.
type MessagingServiceClient interface {
RecentLogs(ctx context.Context, in *RecentLogsRequest, opts ...grpc.CallOption) (*RecentLogsResponse, error)
// Deliver sends text to one chat on one channel. FAILED_PRECONDITION means
// the channel is not running or cannot send; the caller may retry later.
Deliver(ctx context.Context, in *DeliverRequest, opts ...grpc.CallOption) (*DeliverResponse, error)
@@ -43,6 +45,16 @@ func NewMessagingServiceClient(cc grpc.ClientConnInterface) MessagingServiceClie
return &messagingServiceClient{cc}
}
func (c *messagingServiceClient) RecentLogs(ctx context.Context, in *RecentLogsRequest, opts ...grpc.CallOption) (*RecentLogsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RecentLogsResponse)
err := c.cc.Invoke(ctx, MessagingService_RecentLogs_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *messagingServiceClient) Deliver(ctx context.Context, in *DeliverRequest, opts ...grpc.CallOption) (*DeliverResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DeliverResponse)
@@ -61,6 +73,7 @@ func (c *messagingServiceClient) Deliver(ctx context.Context, in *DeliverRequest
// the chat channel transports. Other services send outbound messages through
// it rather than holding channel credentials themselves.
type MessagingServiceServer interface {
RecentLogs(context.Context, *RecentLogsRequest) (*RecentLogsResponse, error)
// Deliver sends text to one chat on one channel. FAILED_PRECONDITION means
// the channel is not running or cannot send; the caller may retry later.
Deliver(context.Context, *DeliverRequest) (*DeliverResponse, error)
@@ -74,6 +87,9 @@ type MessagingServiceServer interface {
// pointer dereference when methods are called.
type UnimplementedMessagingServiceServer struct{}
func (UnimplementedMessagingServiceServer) RecentLogs(context.Context, *RecentLogsRequest) (*RecentLogsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method RecentLogs not implemented")
}
func (UnimplementedMessagingServiceServer) Deliver(context.Context, *DeliverRequest) (*DeliverResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Deliver not implemented")
}
@@ -98,6 +114,24 @@ func RegisterMessagingServiceServer(s grpc.ServiceRegistrar, srv MessagingServic
s.RegisterService(&MessagingService_ServiceDesc, srv)
}
func _MessagingService_RecentLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RecentLogsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MessagingServiceServer).RecentLogs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: MessagingService_RecentLogs_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MessagingServiceServer).RecentLogs(ctx, req.(*RecentLogsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _MessagingService_Deliver_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeliverRequest)
if err := dec(in); err != nil {
@@ -123,6 +157,10 @@ var MessagingService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "messaging.v1.MessagingService",
HandlerType: (*MessagingServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "RecentLogs",
Handler: _MessagingService_RecentLogs_Handler,
},
{
MethodName: "Deliver",
Handler: _MessagingService_Deliver_Handler,
+397 -294
View File
@@ -7,6 +7,7 @@
package statev1
import (
v1 "github.com/samcharles93/archie-core/internal/contracts/logging/v1"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
@@ -15279,11 +15280,99 @@ func (*AssignAgentResponse) Descriptor() ([]byte, []int) {
return file_state_v1_state_proto_rawDescGZIP(), []int{282}
}
type RecentLogsRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Query *v1.LogQuery `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RecentLogsRequest) Reset() {
*x = RecentLogsRequest{}
mi := &file_state_v1_state_proto_msgTypes[283]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RecentLogsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RecentLogsRequest) ProtoMessage() {}
func (x *RecentLogsRequest) ProtoReflect() protoreflect.Message {
mi := &file_state_v1_state_proto_msgTypes[283]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RecentLogsRequest.ProtoReflect.Descriptor instead.
func (*RecentLogsRequest) Descriptor() ([]byte, []int) {
return file_state_v1_state_proto_rawDescGZIP(), []int{283}
}
func (x *RecentLogsRequest) GetQuery() *v1.LogQuery {
if x != nil {
return x.Query
}
return nil
}
type RecentLogsResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Snapshot *v1.LogSnapshot `protobuf:"bytes,1,opt,name=snapshot,proto3" json:"snapshot,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RecentLogsResponse) Reset() {
*x = RecentLogsResponse{}
mi := &file_state_v1_state_proto_msgTypes[284]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RecentLogsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RecentLogsResponse) ProtoMessage() {}
func (x *RecentLogsResponse) ProtoReflect() protoreflect.Message {
mi := &file_state_v1_state_proto_msgTypes[284]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RecentLogsResponse.ProtoReflect.Descriptor instead.
func (*RecentLogsResponse) Descriptor() ([]byte, []int) {
return file_state_v1_state_proto_rawDescGZIP(), []int{284}
}
func (x *RecentLogsResponse) GetSnapshot() *v1.LogSnapshot {
if x != nil {
return x.Snapshot
}
return nil
}
var File_state_v1_state_proto protoreflect.FileDescriptor
const file_state_v1_state_proto_rawDesc = "" +
"\n" +
"\x14state/v1/state.proto\x12\bstate.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"t\n" +
"\x14state/v1/state.proto\x12\bstate.v1\x1a\x18logging/v1/logging.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"t\n" +
"\x18RegisterTaskGrantRequest\x12\x17\n" +
"\atask_id\x18\x01 \x01(\x03R\x06taskId\x12\x14\n" +
"\x05token\x18\x02 \x01(\tR\x05token\x12)\n" +
@@ -16276,8 +16365,14 @@ const file_state_v1_state_proto_rawDesc = "" +
"\x06org_id\x18\x01 \x01(\tR\x05orgId\x12\x1f\n" +
"\videntity_id\x18\x02 \x01(\tR\n" +
"identityId\"\x15\n" +
"\x13AssignAgentResponse2\x91R\n" +
"\x11StateStoreService\x12S\n" +
"\x13AssignAgentResponse\"?\n" +
"\x11RecentLogsRequest\x12*\n" +
"\x05query\x18\x01 \x01(\v2\x14.logging.v1.LogQueryR\x05query\"I\n" +
"\x12RecentLogsResponse\x123\n" +
"\bsnapshot\x18\x01 \x01(\v2\x17.logging.v1.LogSnapshotR\bsnapshot2\xdaR\n" +
"\x11StateStoreService\x12G\n" +
"\n" +
"RecentLogs\x12\x1b.state.v1.RecentLogsRequest\x1a\x1c.state.v1.RecentLogsResponse\x12S\n" +
"\x0eInstallPackage\x12\x1f.state.v1.InstallPackageRequest\x1a .state.v1.InstallPackageResponse\x12P\n" +
"\rListCatalogue\x12\x1e.state.v1.ListCatalogueRequest\x1a\x1f.state.v1.ListCatalogueResponse\x12e\n" +
"\x14InstallFromCatalogue\x12%.state.v1.InstallFromCatalogueRequest\x1a&.state.v1.InstallFromCatalogueResponse\x12b\n" +
@@ -16422,7 +16517,7 @@ func file_state_v1_state_proto_rawDescGZIP() []byte {
return file_state_v1_state_proto_rawDescData
}
var file_state_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 285)
var file_state_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 287)
var file_state_v1_state_proto_goTypes = []any{
(*RegisterTaskGrantRequest)(nil), // 0: state.v1.RegisterTaskGrantRequest
(*RegisterTaskGrantResponse)(nil), // 1: state.v1.RegisterTaskGrantResponse
@@ -16707,13 +16802,17 @@ var file_state_v1_state_proto_goTypes = []any{
(*RemoveMembershipResponse)(nil), // 280: state.v1.RemoveMembershipResponse
(*AssignAgentRequest)(nil), // 281: state.v1.AssignAgentRequest
(*AssignAgentResponse)(nil), // 282: state.v1.AssignAgentResponse
nil, // 283: state.v1.EventType.SchemaEntry
nil, // 284: state.v1.StatusCountsResponse.CountsEntry
(*timestamppb.Timestamp)(nil), // 285: google.protobuf.Timestamp
(*RecentLogsRequest)(nil), // 283: state.v1.RecentLogsRequest
(*RecentLogsResponse)(nil), // 284: state.v1.RecentLogsResponse
nil, // 285: state.v1.EventType.SchemaEntry
nil, // 286: state.v1.StatusCountsResponse.CountsEntry
(*timestamppb.Timestamp)(nil), // 287: google.protobuf.Timestamp
(*v1.LogQuery)(nil), // 288: logging.v1.LogQuery
(*v1.LogSnapshot)(nil), // 289: logging.v1.LogSnapshot
}
var file_state_v1_state_proto_depIdxs = []int32{
285, // 0: state.v1.Identity.created_at:type_name -> google.protobuf.Timestamp
285, // 1: state.v1.Identity.updated_at:type_name -> google.protobuf.Timestamp
287, // 0: state.v1.Identity.created_at:type_name -> google.protobuf.Timestamp
287, // 1: state.v1.Identity.updated_at:type_name -> google.protobuf.Timestamp
6, // 2: state.v1.ListIdentitiesResponse.identities:type_name -> state.v1.Identity
6, // 3: state.v1.GetIdentityResponse.identity:type_name -> state.v1.Identity
7, // 4: state.v1.CreateIdentityRequest.audit:type_name -> state.v1.IdentityAudit
@@ -16729,37 +16828,37 @@ var file_state_v1_state_proto_depIdxs = []int32{
6, // 14: state.v1.ResolveIdentitySubjectResponse.identity:type_name -> state.v1.Identity
7, // 15: state.v1.BindIdentitySubjectRequest.audit:type_name -> state.v1.IdentityAudit
6, // 16: state.v1.BindIdentitySubjectResponse.identity:type_name -> state.v1.Identity
285, // 17: state.v1.PersonalToken.created_at:type_name -> google.protobuf.Timestamp
287, // 17: state.v1.PersonalToken.created_at:type_name -> google.protobuf.Timestamp
26, // 18: state.v1.ListPersonalTokensResponse.tokens:type_name -> state.v1.PersonalToken
285, // 19: state.v1.Task.created_at:type_name -> google.protobuf.Timestamp
285, // 20: state.v1.Task.updated_at:type_name -> google.protobuf.Timestamp
285, // 21: state.v1.Event.at:type_name -> google.protobuf.Timestamp
285, // 22: state.v1.CapturedEvent.received_at:type_name -> google.protobuf.Timestamp
287, // 19: state.v1.Task.created_at:type_name -> google.protobuf.Timestamp
287, // 20: state.v1.Task.updated_at:type_name -> google.protobuf.Timestamp
287, // 21: state.v1.Event.at:type_name -> google.protobuf.Timestamp
287, // 22: state.v1.CapturedEvent.received_at:type_name -> google.protobuf.Timestamp
36, // 23: state.v1.EventType.header_conditions:type_name -> state.v1.EventTypeHeaderCondition
37, // 24: state.v1.EventType.payload_conditions:type_name -> state.v1.EventTypePayloadCondition
283, // 25: state.v1.EventType.schema:type_name -> state.v1.EventType.SchemaEntry
285, // 26: state.v1.EventType.created_at:type_name -> google.protobuf.Timestamp
285, // 27: state.v1.EventType.updated_at:type_name -> google.protobuf.Timestamp
285, // 25: state.v1.EventType.schema:type_name -> state.v1.EventType.SchemaEntry
287, // 26: state.v1.EventType.created_at:type_name -> google.protobuf.Timestamp
287, // 27: state.v1.EventType.updated_at:type_name -> google.protobuf.Timestamp
39, // 28: state.v1.Mapping.fields:type_name -> state.v1.MappingField
285, // 29: state.v1.Mapping.created_at:type_name -> google.protobuf.Timestamp
285, // 30: state.v1.Mapping.updated_at:type_name -> google.protobuf.Timestamp
285, // 31: state.v1.Mapping.last_matched_at:type_name -> google.protobuf.Timestamp
287, // 29: state.v1.Mapping.created_at:type_name -> google.protobuf.Timestamp
287, // 30: state.v1.Mapping.updated_at:type_name -> google.protobuf.Timestamp
287, // 31: state.v1.Mapping.last_matched_at:type_name -> google.protobuf.Timestamp
41, // 32: state.v1.Binding.matcher:type_name -> state.v1.BindingMatcher
285, // 33: state.v1.Binding.created_at:type_name -> google.protobuf.Timestamp
285, // 34: state.v1.Binding.updated_at:type_name -> google.protobuf.Timestamp
285, // 35: state.v1.Source.created_at:type_name -> google.protobuf.Timestamp
285, // 36: state.v1.Source.updated_at:type_name -> google.protobuf.Timestamp
287, // 33: state.v1.Binding.created_at:type_name -> google.protobuf.Timestamp
287, // 34: state.v1.Binding.updated_at:type_name -> google.protobuf.Timestamp
287, // 35: state.v1.Source.created_at:type_name -> google.protobuf.Timestamp
287, // 36: state.v1.Source.updated_at:type_name -> google.protobuf.Timestamp
33, // 37: state.v1.ActiveTasksByOriginResponse.tasks:type_name -> state.v1.Task
33, // 38: state.v1.EnqueueChatTaskResponse.task:type_name -> state.v1.Task
33, // 39: state.v1.ClaimNextResponse.task:type_name -> state.v1.Task
33, // 40: state.v1.ClaimByIssueResponse.task:type_name -> state.v1.Task
34, // 41: state.v1.StartStepResponse.event:type_name -> state.v1.Event
34, // 42: state.v1.FinishStepResponse.event:type_name -> state.v1.Event
285, // 43: state.v1.StepExecution.started_at:type_name -> google.protobuf.Timestamp
285, // 44: state.v1.StepExecution.finished_at:type_name -> google.protobuf.Timestamp
287, // 43: state.v1.StepExecution.started_at:type_name -> google.protobuf.Timestamp
287, // 44: state.v1.StepExecution.finished_at:type_name -> google.protobuf.Timestamp
65, // 45: state.v1.ListStepsResponse.steps:type_name -> state.v1.StepExecution
285, // 46: state.v1.HarnessSecret.expires_at:type_name -> google.protobuf.Timestamp
285, // 47: state.v1.HarnessSecret.updated_at:type_name -> google.protobuf.Timestamp
287, // 46: state.v1.HarnessSecret.expires_at:type_name -> google.protobuf.Timestamp
287, // 47: state.v1.HarnessSecret.updated_at:type_name -> google.protobuf.Timestamp
68, // 48: state.v1.GetHarnessSecretResponse.secret:type_name -> state.v1.HarnessSecret
68, // 49: state.v1.PutHarnessSecretRequest.secret:type_name -> state.v1.HarnessSecret
33, // 50: state.v1.UpdateRequest.task:type_name -> state.v1.Task
@@ -16768,35 +16867,35 @@ var file_state_v1_state_proto_depIdxs = []int32{
33, // 53: state.v1.OpenTaskByPRResponse.task:type_name -> state.v1.Task
33, // 54: state.v1.TaskByIDResponse.task:type_name -> state.v1.Task
33, // 55: state.v1.OpenPRsResponse.tasks:type_name -> state.v1.Task
285, // 56: state.v1.TasksRequest.after_updated_at:type_name -> google.protobuf.Timestamp
287, // 56: state.v1.TasksRequest.after_updated_at:type_name -> google.protobuf.Timestamp
33, // 57: state.v1.TasksResponse.tasks:type_name -> state.v1.Task
284, // 58: state.v1.StatusCountsResponse.counts:type_name -> state.v1.StatusCountsResponse.CountsEntry
286, // 58: state.v1.StatusCountsResponse.counts:type_name -> state.v1.StatusCountsResponse.CountsEntry
34, // 59: state.v1.InsertEventRequest.event:type_name -> state.v1.Event
34, // 60: state.v1.EventsSinceResponse.events:type_name -> state.v1.Event
34, // 61: state.v1.TaskEventsResponse.events:type_name -> state.v1.Event
44, // 62: state.v1.WorkflowStatsResponse.stats:type_name -> state.v1.WorkflowStat
45, // 63: state.v1.StageStatsResponse.stats:type_name -> state.v1.StageStat
46, // 64: state.v1.TokensByDayResponse.tokens:type_name -> state.v1.DayTokens
285, // 65: state.v1.ConfigSnapshot.published_at:type_name -> google.protobuf.Timestamp
287, // 65: state.v1.ConfigSnapshot.published_at:type_name -> google.protobuf.Timestamp
119, // 66: state.v1.PutConfigSnapshotRequest.snapshot:type_name -> state.v1.ConfigSnapshot
119, // 67: state.v1.GetConfigSnapshotResponse.snapshot:type_name -> state.v1.ConfigSnapshot
285, // 68: state.v1.ChannelStatus.observed_at:type_name -> google.protobuf.Timestamp
287, // 68: state.v1.ChannelStatus.observed_at:type_name -> google.protobuf.Timestamp
124, // 69: state.v1.PutChannelStatusRequest.channels:type_name -> state.v1.ChannelStatus
124, // 70: state.v1.ListChannelStatusResponse.channels:type_name -> state.v1.ChannelStatus
285, // 71: state.v1.ApplyStatus.reported_at:type_name -> google.protobuf.Timestamp
287, // 71: state.v1.ApplyStatus.reported_at:type_name -> google.protobuf.Timestamp
129, // 72: state.v1.PutApplyStatusRequest.status:type_name -> state.v1.ApplyStatus
129, // 73: state.v1.ListApplyStatusResponse.statuses:type_name -> state.v1.ApplyStatus
285, // 74: state.v1.Presence.started_at:type_name -> google.protobuf.Timestamp
285, // 75: state.v1.Presence.reported_at:type_name -> google.protobuf.Timestamp
287, // 74: state.v1.Presence.started_at:type_name -> google.protobuf.Timestamp
287, // 75: state.v1.Presence.reported_at:type_name -> google.protobuf.Timestamp
134, // 76: state.v1.Presence.checks:type_name -> state.v1.DependencyCheck
285, // 77: state.v1.RecordCaptureRefusalRequest.refused_at:type_name -> google.protobuf.Timestamp
285, // 78: state.v1.ListCaptureRefusalsRequest.since:type_name -> google.protobuf.Timestamp
287, // 77: state.v1.RecordCaptureRefusalRequest.refused_at:type_name -> google.protobuf.Timestamp
287, // 78: state.v1.ListCaptureRefusalsRequest.since:type_name -> google.protobuf.Timestamp
139, // 79: state.v1.ListCaptureRefusalsResponse.sources:type_name -> state.v1.CaptureRefusals
135, // 80: state.v1.PutPresenceRequest.presence:type_name -> state.v1.Presence
135, // 81: state.v1.ListPresenceResponse.presences:type_name -> state.v1.Presence
285, // 82: state.v1.TaskLogEntry.time:type_name -> google.protobuf.Timestamp
285, // 83: state.v1.ReadTaskLogRequest.since:type_name -> google.protobuf.Timestamp
285, // 84: state.v1.ReadTaskLogRequest.until:type_name -> google.protobuf.Timestamp
287, // 82: state.v1.TaskLogEntry.time:type_name -> google.protobuf.Timestamp
287, // 83: state.v1.ReadTaskLogRequest.since:type_name -> google.protobuf.Timestamp
287, // 84: state.v1.ReadTaskLogRequest.until:type_name -> google.protobuf.Timestamp
145, // 85: state.v1.ReadTaskLogResponse.entries:type_name -> state.v1.TaskLogEntry
35, // 86: state.v1.InsertCaptureRequest.capture:type_name -> state.v1.CapturedEvent
35, // 87: state.v1.StreamCapturesResponse.capture:type_name -> state.v1.CapturedEvent
@@ -16815,7 +16914,7 @@ var file_state_v1_state_proto_depIdxs = []int32{
43, // 100: state.v1.GetSourceResponse.source:type_name -> state.v1.Source
43, // 101: state.v1.ListSourcesResponse.sources:type_name -> state.v1.Source
42, // 102: state.v1.ArmedBindingsForSourceResponse.bindings:type_name -> state.v1.Binding
285, // 103: state.v1.Dispatch.dispatched_at:type_name -> google.protobuf.Timestamp
287, // 103: state.v1.Dispatch.dispatched_at:type_name -> google.protobuf.Timestamp
213, // 104: state.v1.ListDispatchesResponse.dispatches:type_name -> state.v1.Dispatch
35, // 105: state.v1.StreamUndispatchedCapturesResponse.capture:type_name -> state.v1.CapturedEvent
33, // 106: state.v1.EnqueueBindingTaskResponse.task:type_name -> state.v1.Task
@@ -16833,7 +16932,7 @@ var file_state_v1_state_proto_depIdxs = []int32{
248, // 118: state.v1.ListPoliciesResponse.policies:type_name -> state.v1.AccessPolicy
248, // 119: state.v1.PutPolicyRequest.policy:type_name -> state.v1.AccessPolicy
248, // 120: state.v1.DeletePolicyRequest.policy:type_name -> state.v1.AccessPolicy
285, // 121: state.v1.AccessDenial.at:type_name -> google.protobuf.Timestamp
287, // 121: state.v1.AccessDenial.at:type_name -> google.protobuf.Timestamp
257, // 122: state.v1.RecordDenialRequest.denial:type_name -> state.v1.AccessDenial
257, // 123: state.v1.ListDenialsResponse.denials:type_name -> state.v1.AccessDenial
262, // 124: state.v1.ListOrgsResponse.orgs:type_name -> state.v1.Org
@@ -16842,257 +16941,261 @@ var file_state_v1_state_proto_depIdxs = []int32{
263, // 127: state.v1.ListWorkspacesResponse.workspaces:type_name -> state.v1.Workspace
263, // 128: state.v1.CreateWorkspaceResponse.workspace:type_name -> state.v1.Workspace
264, // 129: state.v1.ListMembersResponse.members:type_name -> state.v1.Member
229, // 130: state.v1.StateStoreService.InstallPackage:input_type -> state.v1.InstallPackageRequest
232, // 131: state.v1.StateStoreService.ListCatalogue:input_type -> state.v1.ListCatalogueRequest
234, // 132: state.v1.StateStoreService.InstallFromCatalogue:input_type -> state.v1.InstallFromCatalogueRequest
236, // 133: state.v1.StateStoreService.GetInstalledPackage:input_type -> state.v1.GetInstalledPackageRequest
238, // 134: state.v1.StateStoreService.ListInstalledPackages:input_type -> state.v1.ListInstalledPackagesRequest
240, // 135: state.v1.StateStoreService.AcceptPackageAuthority:input_type -> state.v1.AcceptPackageAuthorityRequest
242, // 136: state.v1.StateStoreService.RemoveInstalledPackage:input_type -> state.v1.RemoveInstalledPackageRequest
0, // 137: state.v1.StateStoreService.RegisterTaskGrant:input_type -> state.v1.RegisterTaskGrantRequest
2, // 138: state.v1.StateStoreService.RevokeTaskGrant:input_type -> state.v1.RevokeTaskGrantRequest
4, // 139: state.v1.StateStoreService.ResolveTaskGrant:input_type -> state.v1.ResolveTaskGrantRequest
8, // 140: state.v1.StateStoreService.ListIdentities:input_type -> state.v1.ListIdentitiesRequest
10, // 141: state.v1.StateStoreService.GetIdentity:input_type -> state.v1.GetIdentityRequest
12, // 142: state.v1.StateStoreService.CreateIdentity:input_type -> state.v1.CreateIdentityRequest
13, // 143: state.v1.StateStoreService.RenameIdentity:input_type -> state.v1.RenameIdentityRequest
14, // 144: state.v1.StateStoreService.SuspendIdentity:input_type -> state.v1.SuspendIdentityRequest
15, // 145: state.v1.StateStoreService.ReactivateIdentity:input_type -> state.v1.ReactivateIdentityRequest
16, // 146: state.v1.StateStoreService.RetireIdentity:input_type -> state.v1.RetireIdentityRequest
22, // 147: state.v1.StateStoreService.ResolveIdentitySubject:input_type -> state.v1.ResolveIdentitySubjectRequest
24, // 148: state.v1.StateStoreService.BindIdentitySubject:input_type -> state.v1.BindIdentitySubjectRequest
27, // 149: state.v1.StateStoreService.AddPersonalToken:input_type -> state.v1.AddPersonalTokenRequest
29, // 150: state.v1.StateStoreService.ListPersonalTokens:input_type -> state.v1.ListPersonalTokensRequest
31, // 151: state.v1.StateStoreService.RevokePersonalToken:input_type -> state.v1.RevokePersonalTokenRequest
47, // 152: state.v1.StateStoreService.EnqueueIssue:input_type -> state.v1.EnqueueIssueRequest
51, // 153: state.v1.StateStoreService.EnqueueChatTask:input_type -> state.v1.EnqueueChatTaskRequest
49, // 154: state.v1.StateStoreService.ActiveTasksByOrigin:input_type -> state.v1.ActiveTasksByOriginRequest
53, // 155: state.v1.StateStoreService.ClaimNext:input_type -> state.v1.ClaimNextRequest
55, // 156: state.v1.StateStoreService.ClaimByIssue:input_type -> state.v1.ClaimByIssueRequest
57, // 157: state.v1.StateStoreService.Transition:input_type -> state.v1.TransitionRequest
73, // 158: state.v1.StateStoreService.Update:input_type -> state.v1.UpdateRequest
59, // 159: state.v1.StateStoreService.StartStep:input_type -> state.v1.StartStepRequest
61, // 160: state.v1.StateStoreService.FinishStep:input_type -> state.v1.FinishStepRequest
63, // 161: state.v1.StateStoreService.CancelExecution:input_type -> state.v1.CancelExecutionRequest
66, // 162: state.v1.StateStoreService.ListSteps:input_type -> state.v1.ListStepsRequest
69, // 163: state.v1.StateStoreService.GetHarnessSecret:input_type -> state.v1.GetHarnessSecretRequest
71, // 164: state.v1.StateStoreService.PutHarnessSecret:input_type -> state.v1.PutHarnessSecretRequest
75, // 165: state.v1.StateStoreService.Requeue:input_type -> state.v1.RequeueRequest
77, // 166: state.v1.StateStoreService.ParkTask:input_type -> state.v1.ParkTaskRequest
79, // 167: state.v1.StateStoreService.RecoverStale:input_type -> state.v1.RecoverStaleRequest
81, // 168: state.v1.StateStoreService.ArchiveTask:input_type -> state.v1.ArchiveTaskRequest
83, // 169: state.v1.StateStoreService.RetryTask:input_type -> state.v1.RetryTaskRequest
85, // 170: state.v1.StateStoreService.RespondReviewGate:input_type -> state.v1.RespondReviewGateRequest
87, // 171: state.v1.StateStoreService.BeginRemediation:input_type -> state.v1.BeginRemediationRequest
89, // 172: state.v1.StateStoreService.UpdateReviewPayload:input_type -> state.v1.UpdateReviewPayloadRequest
91, // 173: state.v1.StateStoreService.SetReviewCursors:input_type -> state.v1.SetReviewCursorsRequest
93, // 174: state.v1.StateStoreService.TaskByIssue:input_type -> state.v1.TaskByIssueRequest
95, // 175: state.v1.StateStoreService.OpenTaskByPR:input_type -> state.v1.OpenTaskByPRRequest
97, // 176: state.v1.StateStoreService.TaskByID:input_type -> state.v1.TaskByIDRequest
99, // 177: state.v1.StateStoreService.OpenPRs:input_type -> state.v1.OpenPRsRequest
101, // 178: state.v1.StateStoreService.ClearTerminalTasks:input_type -> state.v1.ClearTerminalTasksRequest
103, // 179: state.v1.StateStoreService.Tasks:input_type -> state.v1.TasksRequest
105, // 180: state.v1.StateStoreService.StatusCounts:input_type -> state.v1.StatusCountsRequest
107, // 181: state.v1.StateStoreService.InsertEvent:input_type -> state.v1.InsertEventRequest
109, // 182: state.v1.StateStoreService.EventsSince:input_type -> state.v1.EventsSinceRequest
111, // 183: state.v1.StateStoreService.TaskEvents:input_type -> state.v1.TaskEventsRequest
113, // 184: state.v1.StateStoreService.WorkflowStats:input_type -> state.v1.WorkflowStatsRequest
115, // 185: state.v1.StateStoreService.StageStats:input_type -> state.v1.StageStatsRequest
117, // 186: state.v1.StateStoreService.TokensByDay:input_type -> state.v1.TokensByDayRequest
120, // 187: state.v1.StateStoreService.PutConfigSnapshot:input_type -> state.v1.PutConfigSnapshotRequest
122, // 188: state.v1.StateStoreService.GetConfigSnapshot:input_type -> state.v1.GetConfigSnapshotRequest
125, // 189: state.v1.StateStoreService.PutChannelStatus:input_type -> state.v1.PutChannelStatusRequest
127, // 190: state.v1.StateStoreService.ListChannelStatus:input_type -> state.v1.ListChannelStatusRequest
130, // 191: state.v1.StateStoreService.PutApplyStatus:input_type -> state.v1.PutApplyStatusRequest
132, // 192: state.v1.StateStoreService.ListApplyStatus:input_type -> state.v1.ListApplyStatusRequest
141, // 193: state.v1.StateStoreService.PutPresence:input_type -> state.v1.PutPresenceRequest
136, // 194: state.v1.StateStoreService.RecordCaptureRefusal:input_type -> state.v1.RecordCaptureRefusalRequest
138, // 195: state.v1.StateStoreService.ListCaptureRefusals:input_type -> state.v1.ListCaptureRefusalsRequest
143, // 196: state.v1.StateStoreService.ListPresence:input_type -> state.v1.ListPresenceRequest
146, // 197: state.v1.StateStoreService.ReadTaskLog:input_type -> state.v1.ReadTaskLogRequest
148, // 198: state.v1.StateStoreService.StreamTaskLogContent:input_type -> state.v1.StreamTaskLogContentRequest
150, // 199: state.v1.StateStoreService.InsertCapture:input_type -> state.v1.InsertCaptureRequest
152, // 200: state.v1.StateStoreService.StreamCaptures:input_type -> state.v1.StreamCapturesRequest
154, // 201: state.v1.StateStoreService.InsertMapping:input_type -> state.v1.InsertMappingRequest
156, // 202: state.v1.StateStoreService.GetMapping:input_type -> state.v1.GetMappingRequest
158, // 203: state.v1.StateStoreService.ListMappings:input_type -> state.v1.ListMappingsRequest
160, // 204: state.v1.StateStoreService.UpdateMapping:input_type -> state.v1.UpdateMappingRequest
162, // 205: state.v1.StateStoreService.DeleteMapping:input_type -> state.v1.DeleteMappingRequest
164, // 206: state.v1.StateStoreService.RecordMappingMatch:input_type -> state.v1.RecordMappingMatchRequest
166, // 207: state.v1.StateStoreService.InsertEventType:input_type -> state.v1.InsertEventTypeRequest
168, // 208: state.v1.StateStoreService.UpdateEventType:input_type -> state.v1.UpdateEventTypeRequest
170, // 209: state.v1.StateStoreService.DeleteEventType:input_type -> state.v1.DeleteEventTypeRequest
172, // 210: state.v1.StateStoreService.ListEventTypes:input_type -> state.v1.ListEventTypesRequest
174, // 211: state.v1.StateStoreService.InsertBinding:input_type -> state.v1.InsertBindingRequest
176, // 212: state.v1.StateStoreService.GetBinding:input_type -> state.v1.GetBindingRequest
178, // 213: state.v1.StateStoreService.ListBindings:input_type -> state.v1.ListBindingsRequest
212, // 214: state.v1.StateStoreService.ListDispatches:input_type -> state.v1.ListDispatchesRequest
180, // 215: state.v1.StateStoreService.UpdateBinding:input_type -> state.v1.UpdateBindingRequest
182, // 216: state.v1.StateStoreService.DeleteBinding:input_type -> state.v1.DeleteBindingRequest
184, // 217: state.v1.StateStoreService.ApproveBinding:input_type -> state.v1.ApproveBindingRequest
192, // 218: state.v1.StateStoreService.PauseBinding:input_type -> state.v1.PauseBindingRequest
194, // 219: state.v1.StateStoreService.ResumeBinding:input_type -> state.v1.ResumeBindingRequest
196, // 220: state.v1.StateStoreService.InsertSource:input_type -> state.v1.InsertSourceRequest
198, // 221: state.v1.StateStoreService.GetSource:input_type -> state.v1.GetSourceRequest
200, // 222: state.v1.StateStoreService.ListSources:input_type -> state.v1.ListSourcesRequest
202, // 223: state.v1.StateStoreService.SetSourceSigning:input_type -> state.v1.SetSourceSigningRequest
204, // 224: state.v1.StateStoreService.SetSourceSecret:input_type -> state.v1.SetSourceSecretRequest
186, // 225: state.v1.StateStoreService.SetSourceName:input_type -> state.v1.SetSourceNameRequest
188, // 226: state.v1.StateStoreService.SetSourceDeliveryHeader:input_type -> state.v1.SetSourceDeliveryHeaderRequest
190, // 227: state.v1.StateStoreService.DeleteSource:input_type -> state.v1.DeleteSourceRequest
206, // 228: state.v1.StateStoreService.ArmedBindingsForSource:input_type -> state.v1.ArmedBindingsForSourceRequest
208, // 229: state.v1.StateStoreService.RecordDispatch:input_type -> state.v1.RecordDispatchRequest
210, // 230: state.v1.StateStoreService.SetDispatchTask:input_type -> state.v1.SetDispatchTaskRequest
215, // 231: state.v1.StateStoreService.RecordPlaybookDispatch:input_type -> state.v1.RecordPlaybookDispatchRequest
217, // 232: state.v1.StateStoreService.DeletePlaybookDispatches:input_type -> state.v1.DeletePlaybookDispatchesRequest
219, // 233: state.v1.StateStoreService.StreamUndispatchedCaptures:input_type -> state.v1.StreamUndispatchedCapturesRequest
221, // 234: state.v1.StateStoreService.EnqueueBindingTask:input_type -> state.v1.EnqueueBindingTaskRequest
223, // 235: state.v1.StateStoreService.EnqueueCallTask:input_type -> state.v1.EnqueueCallTaskRequest
225, // 236: state.v1.StateStoreService.WorkflowCallStatus:input_type -> state.v1.WorkflowCallStatusRequest
244, // 237: state.v1.StateStoreService.GetPrincipal:input_type -> state.v1.GetPrincipalRequest
249, // 238: state.v1.StateStoreService.ListPolicies:input_type -> state.v1.ListPoliciesRequest
251, // 239: state.v1.StateStoreService.PutPolicy:input_type -> state.v1.PutPolicyRequest
253, // 240: state.v1.StateStoreService.DeletePolicy:input_type -> state.v1.DeletePolicyRequest
255, // 241: state.v1.StateStoreService.EnsureShippedOrgPolicies:input_type -> state.v1.EnsureShippedOrgPoliciesRequest
258, // 242: state.v1.StateStoreService.RecordDenial:input_type -> state.v1.RecordDenialRequest
260, // 243: state.v1.StateStoreService.ListDenials:input_type -> state.v1.ListDenialsRequest
265, // 244: state.v1.StateStoreService.ListOrgs:input_type -> state.v1.ListOrgsRequest
267, // 245: state.v1.StateStoreService.GetOrg:input_type -> state.v1.GetOrgRequest
269, // 246: state.v1.StateStoreService.CreateOrg:input_type -> state.v1.CreateOrgRequest
271, // 247: state.v1.StateStoreService.ListWorkspaces:input_type -> state.v1.ListWorkspacesRequest
273, // 248: state.v1.StateStoreService.CreateWorkspace:input_type -> state.v1.CreateWorkspaceRequest
275, // 249: state.v1.StateStoreService.ListMembers:input_type -> state.v1.ListMembersRequest
277, // 250: state.v1.StateStoreService.SetMembership:input_type -> state.v1.SetMembershipRequest
279, // 251: state.v1.StateStoreService.RemoveMembership:input_type -> state.v1.RemoveMembershipRequest
281, // 252: state.v1.StateStoreService.AssignAgent:input_type -> state.v1.AssignAgentRequest
230, // 253: state.v1.StateStoreService.InstallPackage:output_type -> state.v1.InstallPackageResponse
233, // 254: state.v1.StateStoreService.ListCatalogue:output_type -> state.v1.ListCatalogueResponse
235, // 255: state.v1.StateStoreService.InstallFromCatalogue:output_type -> state.v1.InstallFromCatalogueResponse
237, // 256: state.v1.StateStoreService.GetInstalledPackage:output_type -> state.v1.GetInstalledPackageResponse
239, // 257: state.v1.StateStoreService.ListInstalledPackages:output_type -> state.v1.ListInstalledPackagesResponse
241, // 258: state.v1.StateStoreService.AcceptPackageAuthority:output_type -> state.v1.AcceptPackageAuthorityResponse
243, // 259: state.v1.StateStoreService.RemoveInstalledPackage:output_type -> state.v1.RemoveInstalledPackageResponse
1, // 260: state.v1.StateStoreService.RegisterTaskGrant:output_type -> state.v1.RegisterTaskGrantResponse
3, // 261: state.v1.StateStoreService.RevokeTaskGrant:output_type -> state.v1.RevokeTaskGrantResponse
5, // 262: state.v1.StateStoreService.ResolveTaskGrant:output_type -> state.v1.ResolveTaskGrantResponse
9, // 263: state.v1.StateStoreService.ListIdentities:output_type -> state.v1.ListIdentitiesResponse
11, // 264: state.v1.StateStoreService.GetIdentity:output_type -> state.v1.GetIdentityResponse
17, // 265: state.v1.StateStoreService.CreateIdentity:output_type -> state.v1.CreateIdentityResponse
18, // 266: state.v1.StateStoreService.RenameIdentity:output_type -> state.v1.RenameIdentityResponse
19, // 267: state.v1.StateStoreService.SuspendIdentity:output_type -> state.v1.SuspendIdentityResponse
20, // 268: state.v1.StateStoreService.ReactivateIdentity:output_type -> state.v1.ReactivateIdentityResponse
21, // 269: state.v1.StateStoreService.RetireIdentity:output_type -> state.v1.RetireIdentityResponse
23, // 270: state.v1.StateStoreService.ResolveIdentitySubject:output_type -> state.v1.ResolveIdentitySubjectResponse
25, // 271: state.v1.StateStoreService.BindIdentitySubject:output_type -> state.v1.BindIdentitySubjectResponse
28, // 272: state.v1.StateStoreService.AddPersonalToken:output_type -> state.v1.AddPersonalTokenResponse
30, // 273: state.v1.StateStoreService.ListPersonalTokens:output_type -> state.v1.ListPersonalTokensResponse
32, // 274: state.v1.StateStoreService.RevokePersonalToken:output_type -> state.v1.RevokePersonalTokenResponse
48, // 275: state.v1.StateStoreService.EnqueueIssue:output_type -> state.v1.EnqueueIssueResponse
52, // 276: state.v1.StateStoreService.EnqueueChatTask:output_type -> state.v1.EnqueueChatTaskResponse
50, // 277: state.v1.StateStoreService.ActiveTasksByOrigin:output_type -> state.v1.ActiveTasksByOriginResponse
54, // 278: state.v1.StateStoreService.ClaimNext:output_type -> state.v1.ClaimNextResponse
56, // 279: state.v1.StateStoreService.ClaimByIssue:output_type -> state.v1.ClaimByIssueResponse
58, // 280: state.v1.StateStoreService.Transition:output_type -> state.v1.TransitionResponse
74, // 281: state.v1.StateStoreService.Update:output_type -> state.v1.UpdateResponse
60, // 282: state.v1.StateStoreService.StartStep:output_type -> state.v1.StartStepResponse
62, // 283: state.v1.StateStoreService.FinishStep:output_type -> state.v1.FinishStepResponse
64, // 284: state.v1.StateStoreService.CancelExecution:output_type -> state.v1.CancelExecutionResponse
67, // 285: state.v1.StateStoreService.ListSteps:output_type -> state.v1.ListStepsResponse
70, // 286: state.v1.StateStoreService.GetHarnessSecret:output_type -> state.v1.GetHarnessSecretResponse
72, // 287: state.v1.StateStoreService.PutHarnessSecret:output_type -> state.v1.PutHarnessSecretResponse
76, // 288: state.v1.StateStoreService.Requeue:output_type -> state.v1.RequeueResponse
78, // 289: state.v1.StateStoreService.ParkTask:output_type -> state.v1.ParkTaskResponse
80, // 290: state.v1.StateStoreService.RecoverStale:output_type -> state.v1.RecoverStaleResponse
82, // 291: state.v1.StateStoreService.ArchiveTask:output_type -> state.v1.ArchiveTaskResponse
84, // 292: state.v1.StateStoreService.RetryTask:output_type -> state.v1.RetryTaskResponse
86, // 293: state.v1.StateStoreService.RespondReviewGate:output_type -> state.v1.RespondReviewGateResponse
88, // 294: state.v1.StateStoreService.BeginRemediation:output_type -> state.v1.BeginRemediationResponse
90, // 295: state.v1.StateStoreService.UpdateReviewPayload:output_type -> state.v1.UpdateReviewPayloadResponse
92, // 296: state.v1.StateStoreService.SetReviewCursors:output_type -> state.v1.SetReviewCursorsResponse
94, // 297: state.v1.StateStoreService.TaskByIssue:output_type -> state.v1.TaskByIssueResponse
96, // 298: state.v1.StateStoreService.OpenTaskByPR:output_type -> state.v1.OpenTaskByPRResponse
98, // 299: state.v1.StateStoreService.TaskByID:output_type -> state.v1.TaskByIDResponse
100, // 300: state.v1.StateStoreService.OpenPRs:output_type -> state.v1.OpenPRsResponse
102, // 301: state.v1.StateStoreService.ClearTerminalTasks:output_type -> state.v1.ClearTerminalTasksResponse
104, // 302: state.v1.StateStoreService.Tasks:output_type -> state.v1.TasksResponse
106, // 303: state.v1.StateStoreService.StatusCounts:output_type -> state.v1.StatusCountsResponse
108, // 304: state.v1.StateStoreService.InsertEvent:output_type -> state.v1.InsertEventResponse
110, // 305: state.v1.StateStoreService.EventsSince:output_type -> state.v1.EventsSinceResponse
112, // 306: state.v1.StateStoreService.TaskEvents:output_type -> state.v1.TaskEventsResponse
114, // 307: state.v1.StateStoreService.WorkflowStats:output_type -> state.v1.WorkflowStatsResponse
116, // 308: state.v1.StateStoreService.StageStats:output_type -> state.v1.StageStatsResponse
118, // 309: state.v1.StateStoreService.TokensByDay:output_type -> state.v1.TokensByDayResponse
121, // 310: state.v1.StateStoreService.PutConfigSnapshot:output_type -> state.v1.PutConfigSnapshotResponse
123, // 311: state.v1.StateStoreService.GetConfigSnapshot:output_type -> state.v1.GetConfigSnapshotResponse
126, // 312: state.v1.StateStoreService.PutChannelStatus:output_type -> state.v1.PutChannelStatusResponse
128, // 313: state.v1.StateStoreService.ListChannelStatus:output_type -> state.v1.ListChannelStatusResponse
131, // 314: state.v1.StateStoreService.PutApplyStatus:output_type -> state.v1.PutApplyStatusResponse
133, // 315: state.v1.StateStoreService.ListApplyStatus:output_type -> state.v1.ListApplyStatusResponse
142, // 316: state.v1.StateStoreService.PutPresence:output_type -> state.v1.PutPresenceResponse
137, // 317: state.v1.StateStoreService.RecordCaptureRefusal:output_type -> state.v1.RecordCaptureRefusalResponse
140, // 318: state.v1.StateStoreService.ListCaptureRefusals:output_type -> state.v1.ListCaptureRefusalsResponse
144, // 319: state.v1.StateStoreService.ListPresence:output_type -> state.v1.ListPresenceResponse
147, // 320: state.v1.StateStoreService.ReadTaskLog:output_type -> state.v1.ReadTaskLogResponse
149, // 321: state.v1.StateStoreService.StreamTaskLogContent:output_type -> state.v1.StreamTaskLogContentResponse
151, // 322: state.v1.StateStoreService.InsertCapture:output_type -> state.v1.InsertCaptureResponse
153, // 323: state.v1.StateStoreService.StreamCaptures:output_type -> state.v1.StreamCapturesResponse
155, // 324: state.v1.StateStoreService.InsertMapping:output_type -> state.v1.InsertMappingResponse
157, // 325: state.v1.StateStoreService.GetMapping:output_type -> state.v1.GetMappingResponse
159, // 326: state.v1.StateStoreService.ListMappings:output_type -> state.v1.ListMappingsResponse
161, // 327: state.v1.StateStoreService.UpdateMapping:output_type -> state.v1.UpdateMappingResponse
163, // 328: state.v1.StateStoreService.DeleteMapping:output_type -> state.v1.DeleteMappingResponse
165, // 329: state.v1.StateStoreService.RecordMappingMatch:output_type -> state.v1.RecordMappingMatchResponse
167, // 330: state.v1.StateStoreService.InsertEventType:output_type -> state.v1.InsertEventTypeResponse
169, // 331: state.v1.StateStoreService.UpdateEventType:output_type -> state.v1.UpdateEventTypeResponse
171, // 332: state.v1.StateStoreService.DeleteEventType:output_type -> state.v1.DeleteEventTypeResponse
173, // 333: state.v1.StateStoreService.ListEventTypes:output_type -> state.v1.ListEventTypesResponse
175, // 334: state.v1.StateStoreService.InsertBinding:output_type -> state.v1.InsertBindingResponse
177, // 335: state.v1.StateStoreService.GetBinding:output_type -> state.v1.GetBindingResponse
179, // 336: state.v1.StateStoreService.ListBindings:output_type -> state.v1.ListBindingsResponse
214, // 337: state.v1.StateStoreService.ListDispatches:output_type -> state.v1.ListDispatchesResponse
181, // 338: state.v1.StateStoreService.UpdateBinding:output_type -> state.v1.UpdateBindingResponse
183, // 339: state.v1.StateStoreService.DeleteBinding:output_type -> state.v1.DeleteBindingResponse
185, // 340: state.v1.StateStoreService.ApproveBinding:output_type -> state.v1.ApproveBindingResponse
193, // 341: state.v1.StateStoreService.PauseBinding:output_type -> state.v1.PauseBindingResponse
195, // 342: state.v1.StateStoreService.ResumeBinding:output_type -> state.v1.ResumeBindingResponse
197, // 343: state.v1.StateStoreService.InsertSource:output_type -> state.v1.InsertSourceResponse
199, // 344: state.v1.StateStoreService.GetSource:output_type -> state.v1.GetSourceResponse
201, // 345: state.v1.StateStoreService.ListSources:output_type -> state.v1.ListSourcesResponse
203, // 346: state.v1.StateStoreService.SetSourceSigning:output_type -> state.v1.SetSourceSigningResponse
205, // 347: state.v1.StateStoreService.SetSourceSecret:output_type -> state.v1.SetSourceSecretResponse
187, // 348: state.v1.StateStoreService.SetSourceName:output_type -> state.v1.SetSourceNameResponse
189, // 349: state.v1.StateStoreService.SetSourceDeliveryHeader:output_type -> state.v1.SetSourceDeliveryHeaderResponse
191, // 350: state.v1.StateStoreService.DeleteSource:output_type -> state.v1.DeleteSourceResponse
207, // 351: state.v1.StateStoreService.ArmedBindingsForSource:output_type -> state.v1.ArmedBindingsForSourceResponse
209, // 352: state.v1.StateStoreService.RecordDispatch:output_type -> state.v1.RecordDispatchResponse
211, // 353: state.v1.StateStoreService.SetDispatchTask:output_type -> state.v1.SetDispatchTaskResponse
216, // 354: state.v1.StateStoreService.RecordPlaybookDispatch:output_type -> state.v1.RecordPlaybookDispatchResponse
218, // 355: state.v1.StateStoreService.DeletePlaybookDispatches:output_type -> state.v1.DeletePlaybookDispatchesResponse
220, // 356: state.v1.StateStoreService.StreamUndispatchedCaptures:output_type -> state.v1.StreamUndispatchedCapturesResponse
222, // 357: state.v1.StateStoreService.EnqueueBindingTask:output_type -> state.v1.EnqueueBindingTaskResponse
224, // 358: state.v1.StateStoreService.EnqueueCallTask:output_type -> state.v1.EnqueueCallTaskResponse
226, // 359: state.v1.StateStoreService.WorkflowCallStatus:output_type -> state.v1.WorkflowCallStatusResponse
247, // 360: state.v1.StateStoreService.GetPrincipal:output_type -> state.v1.GetPrincipalResponse
250, // 361: state.v1.StateStoreService.ListPolicies:output_type -> state.v1.ListPoliciesResponse
252, // 362: state.v1.StateStoreService.PutPolicy:output_type -> state.v1.PutPolicyResponse
254, // 363: state.v1.StateStoreService.DeletePolicy:output_type -> state.v1.DeletePolicyResponse
256, // 364: state.v1.StateStoreService.EnsureShippedOrgPolicies:output_type -> state.v1.EnsureShippedOrgPoliciesResponse
259, // 365: state.v1.StateStoreService.RecordDenial:output_type -> state.v1.RecordDenialResponse
261, // 366: state.v1.StateStoreService.ListDenials:output_type -> state.v1.ListDenialsResponse
266, // 367: state.v1.StateStoreService.ListOrgs:output_type -> state.v1.ListOrgsResponse
268, // 368: state.v1.StateStoreService.GetOrg:output_type -> state.v1.GetOrgResponse
270, // 369: state.v1.StateStoreService.CreateOrg:output_type -> state.v1.CreateOrgResponse
272, // 370: state.v1.StateStoreService.ListWorkspaces:output_type -> state.v1.ListWorkspacesResponse
274, // 371: state.v1.StateStoreService.CreateWorkspace:output_type -> state.v1.CreateWorkspaceResponse
276, // 372: state.v1.StateStoreService.ListMembers:output_type -> state.v1.ListMembersResponse
278, // 373: state.v1.StateStoreService.SetMembership:output_type -> state.v1.SetMembershipResponse
280, // 374: state.v1.StateStoreService.RemoveMembership:output_type -> state.v1.RemoveMembershipResponse
282, // 375: state.v1.StateStoreService.AssignAgent:output_type -> state.v1.AssignAgentResponse
253, // [253:376] is the sub-list for method output_type
130, // [130:253] is the sub-list for method input_type
130, // [130:130] is the sub-list for extension type_name
130, // [130:130] is the sub-list for extension extendee
0, // [0:130] is the sub-list for field type_name
288, // 130: state.v1.RecentLogsRequest.query:type_name -> logging.v1.LogQuery
289, // 131: state.v1.RecentLogsResponse.snapshot:type_name -> logging.v1.LogSnapshot
283, // 132: state.v1.StateStoreService.RecentLogs:input_type -> state.v1.RecentLogsRequest
229, // 133: state.v1.StateStoreService.InstallPackage:input_type -> state.v1.InstallPackageRequest
232, // 134: state.v1.StateStoreService.ListCatalogue:input_type -> state.v1.ListCatalogueRequest
234, // 135: state.v1.StateStoreService.InstallFromCatalogue:input_type -> state.v1.InstallFromCatalogueRequest
236, // 136: state.v1.StateStoreService.GetInstalledPackage:input_type -> state.v1.GetInstalledPackageRequest
238, // 137: state.v1.StateStoreService.ListInstalledPackages:input_type -> state.v1.ListInstalledPackagesRequest
240, // 138: state.v1.StateStoreService.AcceptPackageAuthority:input_type -> state.v1.AcceptPackageAuthorityRequest
242, // 139: state.v1.StateStoreService.RemoveInstalledPackage:input_type -> state.v1.RemoveInstalledPackageRequest
0, // 140: state.v1.StateStoreService.RegisterTaskGrant:input_type -> state.v1.RegisterTaskGrantRequest
2, // 141: state.v1.StateStoreService.RevokeTaskGrant:input_type -> state.v1.RevokeTaskGrantRequest
4, // 142: state.v1.StateStoreService.ResolveTaskGrant:input_type -> state.v1.ResolveTaskGrantRequest
8, // 143: state.v1.StateStoreService.ListIdentities:input_type -> state.v1.ListIdentitiesRequest
10, // 144: state.v1.StateStoreService.GetIdentity:input_type -> state.v1.GetIdentityRequest
12, // 145: state.v1.StateStoreService.CreateIdentity:input_type -> state.v1.CreateIdentityRequest
13, // 146: state.v1.StateStoreService.RenameIdentity:input_type -> state.v1.RenameIdentityRequest
14, // 147: state.v1.StateStoreService.SuspendIdentity:input_type -> state.v1.SuspendIdentityRequest
15, // 148: state.v1.StateStoreService.ReactivateIdentity:input_type -> state.v1.ReactivateIdentityRequest
16, // 149: state.v1.StateStoreService.RetireIdentity:input_type -> state.v1.RetireIdentityRequest
22, // 150: state.v1.StateStoreService.ResolveIdentitySubject:input_type -> state.v1.ResolveIdentitySubjectRequest
24, // 151: state.v1.StateStoreService.BindIdentitySubject:input_type -> state.v1.BindIdentitySubjectRequest
27, // 152: state.v1.StateStoreService.AddPersonalToken:input_type -> state.v1.AddPersonalTokenRequest
29, // 153: state.v1.StateStoreService.ListPersonalTokens:input_type -> state.v1.ListPersonalTokensRequest
31, // 154: state.v1.StateStoreService.RevokePersonalToken:input_type -> state.v1.RevokePersonalTokenRequest
47, // 155: state.v1.StateStoreService.EnqueueIssue:input_type -> state.v1.EnqueueIssueRequest
51, // 156: state.v1.StateStoreService.EnqueueChatTask:input_type -> state.v1.EnqueueChatTaskRequest
49, // 157: state.v1.StateStoreService.ActiveTasksByOrigin:input_type -> state.v1.ActiveTasksByOriginRequest
53, // 158: state.v1.StateStoreService.ClaimNext:input_type -> state.v1.ClaimNextRequest
55, // 159: state.v1.StateStoreService.ClaimByIssue:input_type -> state.v1.ClaimByIssueRequest
57, // 160: state.v1.StateStoreService.Transition:input_type -> state.v1.TransitionRequest
73, // 161: state.v1.StateStoreService.Update:input_type -> state.v1.UpdateRequest
59, // 162: state.v1.StateStoreService.StartStep:input_type -> state.v1.StartStepRequest
61, // 163: state.v1.StateStoreService.FinishStep:input_type -> state.v1.FinishStepRequest
63, // 164: state.v1.StateStoreService.CancelExecution:input_type -> state.v1.CancelExecutionRequest
66, // 165: state.v1.StateStoreService.ListSteps:input_type -> state.v1.ListStepsRequest
69, // 166: state.v1.StateStoreService.GetHarnessSecret:input_type -> state.v1.GetHarnessSecretRequest
71, // 167: state.v1.StateStoreService.PutHarnessSecret:input_type -> state.v1.PutHarnessSecretRequest
75, // 168: state.v1.StateStoreService.Requeue:input_type -> state.v1.RequeueRequest
77, // 169: state.v1.StateStoreService.ParkTask:input_type -> state.v1.ParkTaskRequest
79, // 170: state.v1.StateStoreService.RecoverStale:input_type -> state.v1.RecoverStaleRequest
81, // 171: state.v1.StateStoreService.ArchiveTask:input_type -> state.v1.ArchiveTaskRequest
83, // 172: state.v1.StateStoreService.RetryTask:input_type -> state.v1.RetryTaskRequest
85, // 173: state.v1.StateStoreService.RespondReviewGate:input_type -> state.v1.RespondReviewGateRequest
87, // 174: state.v1.StateStoreService.BeginRemediation:input_type -> state.v1.BeginRemediationRequest
89, // 175: state.v1.StateStoreService.UpdateReviewPayload:input_type -> state.v1.UpdateReviewPayloadRequest
91, // 176: state.v1.StateStoreService.SetReviewCursors:input_type -> state.v1.SetReviewCursorsRequest
93, // 177: state.v1.StateStoreService.TaskByIssue:input_type -> state.v1.TaskByIssueRequest
95, // 178: state.v1.StateStoreService.OpenTaskByPR:input_type -> state.v1.OpenTaskByPRRequest
97, // 179: state.v1.StateStoreService.TaskByID:input_type -> state.v1.TaskByIDRequest
99, // 180: state.v1.StateStoreService.OpenPRs:input_type -> state.v1.OpenPRsRequest
101, // 181: state.v1.StateStoreService.ClearTerminalTasks:input_type -> state.v1.ClearTerminalTasksRequest
103, // 182: state.v1.StateStoreService.Tasks:input_type -> state.v1.TasksRequest
105, // 183: state.v1.StateStoreService.StatusCounts:input_type -> state.v1.StatusCountsRequest
107, // 184: state.v1.StateStoreService.InsertEvent:input_type -> state.v1.InsertEventRequest
109, // 185: state.v1.StateStoreService.EventsSince:input_type -> state.v1.EventsSinceRequest
111, // 186: state.v1.StateStoreService.TaskEvents:input_type -> state.v1.TaskEventsRequest
113, // 187: state.v1.StateStoreService.WorkflowStats:input_type -> state.v1.WorkflowStatsRequest
115, // 188: state.v1.StateStoreService.StageStats:input_type -> state.v1.StageStatsRequest
117, // 189: state.v1.StateStoreService.TokensByDay:input_type -> state.v1.TokensByDayRequest
120, // 190: state.v1.StateStoreService.PutConfigSnapshot:input_type -> state.v1.PutConfigSnapshotRequest
122, // 191: state.v1.StateStoreService.GetConfigSnapshot:input_type -> state.v1.GetConfigSnapshotRequest
125, // 192: state.v1.StateStoreService.PutChannelStatus:input_type -> state.v1.PutChannelStatusRequest
127, // 193: state.v1.StateStoreService.ListChannelStatus:input_type -> state.v1.ListChannelStatusRequest
130, // 194: state.v1.StateStoreService.PutApplyStatus:input_type -> state.v1.PutApplyStatusRequest
132, // 195: state.v1.StateStoreService.ListApplyStatus:input_type -> state.v1.ListApplyStatusRequest
141, // 196: state.v1.StateStoreService.PutPresence:input_type -> state.v1.PutPresenceRequest
136, // 197: state.v1.StateStoreService.RecordCaptureRefusal:input_type -> state.v1.RecordCaptureRefusalRequest
138, // 198: state.v1.StateStoreService.ListCaptureRefusals:input_type -> state.v1.ListCaptureRefusalsRequest
143, // 199: state.v1.StateStoreService.ListPresence:input_type -> state.v1.ListPresenceRequest
146, // 200: state.v1.StateStoreService.ReadTaskLog:input_type -> state.v1.ReadTaskLogRequest
148, // 201: state.v1.StateStoreService.StreamTaskLogContent:input_type -> state.v1.StreamTaskLogContentRequest
150, // 202: state.v1.StateStoreService.InsertCapture:input_type -> state.v1.InsertCaptureRequest
152, // 203: state.v1.StateStoreService.StreamCaptures:input_type -> state.v1.StreamCapturesRequest
154, // 204: state.v1.StateStoreService.InsertMapping:input_type -> state.v1.InsertMappingRequest
156, // 205: state.v1.StateStoreService.GetMapping:input_type -> state.v1.GetMappingRequest
158, // 206: state.v1.StateStoreService.ListMappings:input_type -> state.v1.ListMappingsRequest
160, // 207: state.v1.StateStoreService.UpdateMapping:input_type -> state.v1.UpdateMappingRequest
162, // 208: state.v1.StateStoreService.DeleteMapping:input_type -> state.v1.DeleteMappingRequest
164, // 209: state.v1.StateStoreService.RecordMappingMatch:input_type -> state.v1.RecordMappingMatchRequest
166, // 210: state.v1.StateStoreService.InsertEventType:input_type -> state.v1.InsertEventTypeRequest
168, // 211: state.v1.StateStoreService.UpdateEventType:input_type -> state.v1.UpdateEventTypeRequest
170, // 212: state.v1.StateStoreService.DeleteEventType:input_type -> state.v1.DeleteEventTypeRequest
172, // 213: state.v1.StateStoreService.ListEventTypes:input_type -> state.v1.ListEventTypesRequest
174, // 214: state.v1.StateStoreService.InsertBinding:input_type -> state.v1.InsertBindingRequest
176, // 215: state.v1.StateStoreService.GetBinding:input_type -> state.v1.GetBindingRequest
178, // 216: state.v1.StateStoreService.ListBindings:input_type -> state.v1.ListBindingsRequest
212, // 217: state.v1.StateStoreService.ListDispatches:input_type -> state.v1.ListDispatchesRequest
180, // 218: state.v1.StateStoreService.UpdateBinding:input_type -> state.v1.UpdateBindingRequest
182, // 219: state.v1.StateStoreService.DeleteBinding:input_type -> state.v1.DeleteBindingRequest
184, // 220: state.v1.StateStoreService.ApproveBinding:input_type -> state.v1.ApproveBindingRequest
192, // 221: state.v1.StateStoreService.PauseBinding:input_type -> state.v1.PauseBindingRequest
194, // 222: state.v1.StateStoreService.ResumeBinding:input_type -> state.v1.ResumeBindingRequest
196, // 223: state.v1.StateStoreService.InsertSource:input_type -> state.v1.InsertSourceRequest
198, // 224: state.v1.StateStoreService.GetSource:input_type -> state.v1.GetSourceRequest
200, // 225: state.v1.StateStoreService.ListSources:input_type -> state.v1.ListSourcesRequest
202, // 226: state.v1.StateStoreService.SetSourceSigning:input_type -> state.v1.SetSourceSigningRequest
204, // 227: state.v1.StateStoreService.SetSourceSecret:input_type -> state.v1.SetSourceSecretRequest
186, // 228: state.v1.StateStoreService.SetSourceName:input_type -> state.v1.SetSourceNameRequest
188, // 229: state.v1.StateStoreService.SetSourceDeliveryHeader:input_type -> state.v1.SetSourceDeliveryHeaderRequest
190, // 230: state.v1.StateStoreService.DeleteSource:input_type -> state.v1.DeleteSourceRequest
206, // 231: state.v1.StateStoreService.ArmedBindingsForSource:input_type -> state.v1.ArmedBindingsForSourceRequest
208, // 232: state.v1.StateStoreService.RecordDispatch:input_type -> state.v1.RecordDispatchRequest
210, // 233: state.v1.StateStoreService.SetDispatchTask:input_type -> state.v1.SetDispatchTaskRequest
215, // 234: state.v1.StateStoreService.RecordPlaybookDispatch:input_type -> state.v1.RecordPlaybookDispatchRequest
217, // 235: state.v1.StateStoreService.DeletePlaybookDispatches:input_type -> state.v1.DeletePlaybookDispatchesRequest
219, // 236: state.v1.StateStoreService.StreamUndispatchedCaptures:input_type -> state.v1.StreamUndispatchedCapturesRequest
221, // 237: state.v1.StateStoreService.EnqueueBindingTask:input_type -> state.v1.EnqueueBindingTaskRequest
223, // 238: state.v1.StateStoreService.EnqueueCallTask:input_type -> state.v1.EnqueueCallTaskRequest
225, // 239: state.v1.StateStoreService.WorkflowCallStatus:input_type -> state.v1.WorkflowCallStatusRequest
244, // 240: state.v1.StateStoreService.GetPrincipal:input_type -> state.v1.GetPrincipalRequest
249, // 241: state.v1.StateStoreService.ListPolicies:input_type -> state.v1.ListPoliciesRequest
251, // 242: state.v1.StateStoreService.PutPolicy:input_type -> state.v1.PutPolicyRequest
253, // 243: state.v1.StateStoreService.DeletePolicy:input_type -> state.v1.DeletePolicyRequest
255, // 244: state.v1.StateStoreService.EnsureShippedOrgPolicies:input_type -> state.v1.EnsureShippedOrgPoliciesRequest
258, // 245: state.v1.StateStoreService.RecordDenial:input_type -> state.v1.RecordDenialRequest
260, // 246: state.v1.StateStoreService.ListDenials:input_type -> state.v1.ListDenialsRequest
265, // 247: state.v1.StateStoreService.ListOrgs:input_type -> state.v1.ListOrgsRequest
267, // 248: state.v1.StateStoreService.GetOrg:input_type -> state.v1.GetOrgRequest
269, // 249: state.v1.StateStoreService.CreateOrg:input_type -> state.v1.CreateOrgRequest
271, // 250: state.v1.StateStoreService.ListWorkspaces:input_type -> state.v1.ListWorkspacesRequest
273, // 251: state.v1.StateStoreService.CreateWorkspace:input_type -> state.v1.CreateWorkspaceRequest
275, // 252: state.v1.StateStoreService.ListMembers:input_type -> state.v1.ListMembersRequest
277, // 253: state.v1.StateStoreService.SetMembership:input_type -> state.v1.SetMembershipRequest
279, // 254: state.v1.StateStoreService.RemoveMembership:input_type -> state.v1.RemoveMembershipRequest
281, // 255: state.v1.StateStoreService.AssignAgent:input_type -> state.v1.AssignAgentRequest
284, // 256: state.v1.StateStoreService.RecentLogs:output_type -> state.v1.RecentLogsResponse
230, // 257: state.v1.StateStoreService.InstallPackage:output_type -> state.v1.InstallPackageResponse
233, // 258: state.v1.StateStoreService.ListCatalogue:output_type -> state.v1.ListCatalogueResponse
235, // 259: state.v1.StateStoreService.InstallFromCatalogue:output_type -> state.v1.InstallFromCatalogueResponse
237, // 260: state.v1.StateStoreService.GetInstalledPackage:output_type -> state.v1.GetInstalledPackageResponse
239, // 261: state.v1.StateStoreService.ListInstalledPackages:output_type -> state.v1.ListInstalledPackagesResponse
241, // 262: state.v1.StateStoreService.AcceptPackageAuthority:output_type -> state.v1.AcceptPackageAuthorityResponse
243, // 263: state.v1.StateStoreService.RemoveInstalledPackage:output_type -> state.v1.RemoveInstalledPackageResponse
1, // 264: state.v1.StateStoreService.RegisterTaskGrant:output_type -> state.v1.RegisterTaskGrantResponse
3, // 265: state.v1.StateStoreService.RevokeTaskGrant:output_type -> state.v1.RevokeTaskGrantResponse
5, // 266: state.v1.StateStoreService.ResolveTaskGrant:output_type -> state.v1.ResolveTaskGrantResponse
9, // 267: state.v1.StateStoreService.ListIdentities:output_type -> state.v1.ListIdentitiesResponse
11, // 268: state.v1.StateStoreService.GetIdentity:output_type -> state.v1.GetIdentityResponse
17, // 269: state.v1.StateStoreService.CreateIdentity:output_type -> state.v1.CreateIdentityResponse
18, // 270: state.v1.StateStoreService.RenameIdentity:output_type -> state.v1.RenameIdentityResponse
19, // 271: state.v1.StateStoreService.SuspendIdentity:output_type -> state.v1.SuspendIdentityResponse
20, // 272: state.v1.StateStoreService.ReactivateIdentity:output_type -> state.v1.ReactivateIdentityResponse
21, // 273: state.v1.StateStoreService.RetireIdentity:output_type -> state.v1.RetireIdentityResponse
23, // 274: state.v1.StateStoreService.ResolveIdentitySubject:output_type -> state.v1.ResolveIdentitySubjectResponse
25, // 275: state.v1.StateStoreService.BindIdentitySubject:output_type -> state.v1.BindIdentitySubjectResponse
28, // 276: state.v1.StateStoreService.AddPersonalToken:output_type -> state.v1.AddPersonalTokenResponse
30, // 277: state.v1.StateStoreService.ListPersonalTokens:output_type -> state.v1.ListPersonalTokensResponse
32, // 278: state.v1.StateStoreService.RevokePersonalToken:output_type -> state.v1.RevokePersonalTokenResponse
48, // 279: state.v1.StateStoreService.EnqueueIssue:output_type -> state.v1.EnqueueIssueResponse
52, // 280: state.v1.StateStoreService.EnqueueChatTask:output_type -> state.v1.EnqueueChatTaskResponse
50, // 281: state.v1.StateStoreService.ActiveTasksByOrigin:output_type -> state.v1.ActiveTasksByOriginResponse
54, // 282: state.v1.StateStoreService.ClaimNext:output_type -> state.v1.ClaimNextResponse
56, // 283: state.v1.StateStoreService.ClaimByIssue:output_type -> state.v1.ClaimByIssueResponse
58, // 284: state.v1.StateStoreService.Transition:output_type -> state.v1.TransitionResponse
74, // 285: state.v1.StateStoreService.Update:output_type -> state.v1.UpdateResponse
60, // 286: state.v1.StateStoreService.StartStep:output_type -> state.v1.StartStepResponse
62, // 287: state.v1.StateStoreService.FinishStep:output_type -> state.v1.FinishStepResponse
64, // 288: state.v1.StateStoreService.CancelExecution:output_type -> state.v1.CancelExecutionResponse
67, // 289: state.v1.StateStoreService.ListSteps:output_type -> state.v1.ListStepsResponse
70, // 290: state.v1.StateStoreService.GetHarnessSecret:output_type -> state.v1.GetHarnessSecretResponse
72, // 291: state.v1.StateStoreService.PutHarnessSecret:output_type -> state.v1.PutHarnessSecretResponse
76, // 292: state.v1.StateStoreService.Requeue:output_type -> state.v1.RequeueResponse
78, // 293: state.v1.StateStoreService.ParkTask:output_type -> state.v1.ParkTaskResponse
80, // 294: state.v1.StateStoreService.RecoverStale:output_type -> state.v1.RecoverStaleResponse
82, // 295: state.v1.StateStoreService.ArchiveTask:output_type -> state.v1.ArchiveTaskResponse
84, // 296: state.v1.StateStoreService.RetryTask:output_type -> state.v1.RetryTaskResponse
86, // 297: state.v1.StateStoreService.RespondReviewGate:output_type -> state.v1.RespondReviewGateResponse
88, // 298: state.v1.StateStoreService.BeginRemediation:output_type -> state.v1.BeginRemediationResponse
90, // 299: state.v1.StateStoreService.UpdateReviewPayload:output_type -> state.v1.UpdateReviewPayloadResponse
92, // 300: state.v1.StateStoreService.SetReviewCursors:output_type -> state.v1.SetReviewCursorsResponse
94, // 301: state.v1.StateStoreService.TaskByIssue:output_type -> state.v1.TaskByIssueResponse
96, // 302: state.v1.StateStoreService.OpenTaskByPR:output_type -> state.v1.OpenTaskByPRResponse
98, // 303: state.v1.StateStoreService.TaskByID:output_type -> state.v1.TaskByIDResponse
100, // 304: state.v1.StateStoreService.OpenPRs:output_type -> state.v1.OpenPRsResponse
102, // 305: state.v1.StateStoreService.ClearTerminalTasks:output_type -> state.v1.ClearTerminalTasksResponse
104, // 306: state.v1.StateStoreService.Tasks:output_type -> state.v1.TasksResponse
106, // 307: state.v1.StateStoreService.StatusCounts:output_type -> state.v1.StatusCountsResponse
108, // 308: state.v1.StateStoreService.InsertEvent:output_type -> state.v1.InsertEventResponse
110, // 309: state.v1.StateStoreService.EventsSince:output_type -> state.v1.EventsSinceResponse
112, // 310: state.v1.StateStoreService.TaskEvents:output_type -> state.v1.TaskEventsResponse
114, // 311: state.v1.StateStoreService.WorkflowStats:output_type -> state.v1.WorkflowStatsResponse
116, // 312: state.v1.StateStoreService.StageStats:output_type -> state.v1.StageStatsResponse
118, // 313: state.v1.StateStoreService.TokensByDay:output_type -> state.v1.TokensByDayResponse
121, // 314: state.v1.StateStoreService.PutConfigSnapshot:output_type -> state.v1.PutConfigSnapshotResponse
123, // 315: state.v1.StateStoreService.GetConfigSnapshot:output_type -> state.v1.GetConfigSnapshotResponse
126, // 316: state.v1.StateStoreService.PutChannelStatus:output_type -> state.v1.PutChannelStatusResponse
128, // 317: state.v1.StateStoreService.ListChannelStatus:output_type -> state.v1.ListChannelStatusResponse
131, // 318: state.v1.StateStoreService.PutApplyStatus:output_type -> state.v1.PutApplyStatusResponse
133, // 319: state.v1.StateStoreService.ListApplyStatus:output_type -> state.v1.ListApplyStatusResponse
142, // 320: state.v1.StateStoreService.PutPresence:output_type -> state.v1.PutPresenceResponse
137, // 321: state.v1.StateStoreService.RecordCaptureRefusal:output_type -> state.v1.RecordCaptureRefusalResponse
140, // 322: state.v1.StateStoreService.ListCaptureRefusals:output_type -> state.v1.ListCaptureRefusalsResponse
144, // 323: state.v1.StateStoreService.ListPresence:output_type -> state.v1.ListPresenceResponse
147, // 324: state.v1.StateStoreService.ReadTaskLog:output_type -> state.v1.ReadTaskLogResponse
149, // 325: state.v1.StateStoreService.StreamTaskLogContent:output_type -> state.v1.StreamTaskLogContentResponse
151, // 326: state.v1.StateStoreService.InsertCapture:output_type -> state.v1.InsertCaptureResponse
153, // 327: state.v1.StateStoreService.StreamCaptures:output_type -> state.v1.StreamCapturesResponse
155, // 328: state.v1.StateStoreService.InsertMapping:output_type -> state.v1.InsertMappingResponse
157, // 329: state.v1.StateStoreService.GetMapping:output_type -> state.v1.GetMappingResponse
159, // 330: state.v1.StateStoreService.ListMappings:output_type -> state.v1.ListMappingsResponse
161, // 331: state.v1.StateStoreService.UpdateMapping:output_type -> state.v1.UpdateMappingResponse
163, // 332: state.v1.StateStoreService.DeleteMapping:output_type -> state.v1.DeleteMappingResponse
165, // 333: state.v1.StateStoreService.RecordMappingMatch:output_type -> state.v1.RecordMappingMatchResponse
167, // 334: state.v1.StateStoreService.InsertEventType:output_type -> state.v1.InsertEventTypeResponse
169, // 335: state.v1.StateStoreService.UpdateEventType:output_type -> state.v1.UpdateEventTypeResponse
171, // 336: state.v1.StateStoreService.DeleteEventType:output_type -> state.v1.DeleteEventTypeResponse
173, // 337: state.v1.StateStoreService.ListEventTypes:output_type -> state.v1.ListEventTypesResponse
175, // 338: state.v1.StateStoreService.InsertBinding:output_type -> state.v1.InsertBindingResponse
177, // 339: state.v1.StateStoreService.GetBinding:output_type -> state.v1.GetBindingResponse
179, // 340: state.v1.StateStoreService.ListBindings:output_type -> state.v1.ListBindingsResponse
214, // 341: state.v1.StateStoreService.ListDispatches:output_type -> state.v1.ListDispatchesResponse
181, // 342: state.v1.StateStoreService.UpdateBinding:output_type -> state.v1.UpdateBindingResponse
183, // 343: state.v1.StateStoreService.DeleteBinding:output_type -> state.v1.DeleteBindingResponse
185, // 344: state.v1.StateStoreService.ApproveBinding:output_type -> state.v1.ApproveBindingResponse
193, // 345: state.v1.StateStoreService.PauseBinding:output_type -> state.v1.PauseBindingResponse
195, // 346: state.v1.StateStoreService.ResumeBinding:output_type -> state.v1.ResumeBindingResponse
197, // 347: state.v1.StateStoreService.InsertSource:output_type -> state.v1.InsertSourceResponse
199, // 348: state.v1.StateStoreService.GetSource:output_type -> state.v1.GetSourceResponse
201, // 349: state.v1.StateStoreService.ListSources:output_type -> state.v1.ListSourcesResponse
203, // 350: state.v1.StateStoreService.SetSourceSigning:output_type -> state.v1.SetSourceSigningResponse
205, // 351: state.v1.StateStoreService.SetSourceSecret:output_type -> state.v1.SetSourceSecretResponse
187, // 352: state.v1.StateStoreService.SetSourceName:output_type -> state.v1.SetSourceNameResponse
189, // 353: state.v1.StateStoreService.SetSourceDeliveryHeader:output_type -> state.v1.SetSourceDeliveryHeaderResponse
191, // 354: state.v1.StateStoreService.DeleteSource:output_type -> state.v1.DeleteSourceResponse
207, // 355: state.v1.StateStoreService.ArmedBindingsForSource:output_type -> state.v1.ArmedBindingsForSourceResponse
209, // 356: state.v1.StateStoreService.RecordDispatch:output_type -> state.v1.RecordDispatchResponse
211, // 357: state.v1.StateStoreService.SetDispatchTask:output_type -> state.v1.SetDispatchTaskResponse
216, // 358: state.v1.StateStoreService.RecordPlaybookDispatch:output_type -> state.v1.RecordPlaybookDispatchResponse
218, // 359: state.v1.StateStoreService.DeletePlaybookDispatches:output_type -> state.v1.DeletePlaybookDispatchesResponse
220, // 360: state.v1.StateStoreService.StreamUndispatchedCaptures:output_type -> state.v1.StreamUndispatchedCapturesResponse
222, // 361: state.v1.StateStoreService.EnqueueBindingTask:output_type -> state.v1.EnqueueBindingTaskResponse
224, // 362: state.v1.StateStoreService.EnqueueCallTask:output_type -> state.v1.EnqueueCallTaskResponse
226, // 363: state.v1.StateStoreService.WorkflowCallStatus:output_type -> state.v1.WorkflowCallStatusResponse
247, // 364: state.v1.StateStoreService.GetPrincipal:output_type -> state.v1.GetPrincipalResponse
250, // 365: state.v1.StateStoreService.ListPolicies:output_type -> state.v1.ListPoliciesResponse
252, // 366: state.v1.StateStoreService.PutPolicy:output_type -> state.v1.PutPolicyResponse
254, // 367: state.v1.StateStoreService.DeletePolicy:output_type -> state.v1.DeletePolicyResponse
256, // 368: state.v1.StateStoreService.EnsureShippedOrgPolicies:output_type -> state.v1.EnsureShippedOrgPoliciesResponse
259, // 369: state.v1.StateStoreService.RecordDenial:output_type -> state.v1.RecordDenialResponse
261, // 370: state.v1.StateStoreService.ListDenials:output_type -> state.v1.ListDenialsResponse
266, // 371: state.v1.StateStoreService.ListOrgs:output_type -> state.v1.ListOrgsResponse
268, // 372: state.v1.StateStoreService.GetOrg:output_type -> state.v1.GetOrgResponse
270, // 373: state.v1.StateStoreService.CreateOrg:output_type -> state.v1.CreateOrgResponse
272, // 374: state.v1.StateStoreService.ListWorkspaces:output_type -> state.v1.ListWorkspacesResponse
274, // 375: state.v1.StateStoreService.CreateWorkspace:output_type -> state.v1.CreateWorkspaceResponse
276, // 376: state.v1.StateStoreService.ListMembers:output_type -> state.v1.ListMembersResponse
278, // 377: state.v1.StateStoreService.SetMembership:output_type -> state.v1.SetMembershipResponse
280, // 378: state.v1.StateStoreService.RemoveMembership:output_type -> state.v1.RemoveMembershipResponse
282, // 379: state.v1.StateStoreService.AssignAgent:output_type -> state.v1.AssignAgentResponse
256, // [256:380] is the sub-list for method output_type
132, // [132:256] is the sub-list for method input_type
132, // [132:132] is the sub-list for extension type_name
132, // [132:132] is the sub-list for extension extendee
0, // [0:132] is the sub-list for field type_name
}
func init() { file_state_v1_state_proto_init() }
@@ -17106,7 +17209,7 @@ func file_state_v1_state_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_state_v1_state_proto_rawDesc), len(file_state_v1_state_proto_rawDesc)),
NumEnums: 0,
NumMessages: 285,
NumMessages: 287,
NumExtensions: 0,
NumServices: 1,
},
@@ -19,6 +19,7 @@ import (
const _ = grpc.SupportPackageIsVersion9
const (
StateStoreService_RecentLogs_FullMethodName = "/state.v1.StateStoreService/RecentLogs"
StateStoreService_InstallPackage_FullMethodName = "/state.v1.StateStoreService/InstallPackage"
StateStoreService_ListCatalogue_FullMethodName = "/state.v1.StateStoreService/ListCatalogue"
StateStoreService_InstallFromCatalogue_FullMethodName = "/state.v1.StateStoreService/InstallFromCatalogue"
@@ -156,6 +157,7 @@ const (
// service over internal/infrastructure/postgres; the proto bypasses the Go
// interfacebloat cap (max 8), like gateway.v1.ChatService does.
type StateStoreServiceClient interface {
RecentLogs(ctx context.Context, in *RecentLogsRequest, opts ...grpc.CallOption) (*RecentLogsResponse, error)
// Installed Archie packages. Administrative until org-scoped principals land.
InstallPackage(ctx context.Context, in *InstallPackageRequest, opts ...grpc.CallOption) (*InstallPackageResponse, error)
// ListCatalogue returns the packages the instance's verified catalogue
@@ -386,6 +388,16 @@ func NewStateStoreServiceClient(cc grpc.ClientConnInterface) StateStoreServiceCl
return &stateStoreServiceClient{cc}
}
func (c *stateStoreServiceClient) RecentLogs(ctx context.Context, in *RecentLogsRequest, opts ...grpc.CallOption) (*RecentLogsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RecentLogsResponse)
err := c.cc.Invoke(ctx, StateStoreService_RecentLogs_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *stateStoreServiceClient) InstallPackage(ctx context.Context, in *InstallPackageRequest, opts ...grpc.CallOption) (*InstallPackageResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(InstallPackageResponse)
@@ -1655,6 +1667,7 @@ func (c *stateStoreServiceClient) AssignAgent(ctx context.Context, in *AssignAge
// service over internal/infrastructure/postgres; the proto bypasses the Go
// interfacebloat cap (max 8), like gateway.v1.ChatService does.
type StateStoreServiceServer interface {
RecentLogs(context.Context, *RecentLogsRequest) (*RecentLogsResponse, error)
// Installed Archie packages. Administrative until org-scoped principals land.
InstallPackage(context.Context, *InstallPackageRequest) (*InstallPackageResponse, error)
// ListCatalogue returns the packages the instance's verified catalogue
@@ -1885,6 +1898,9 @@ type StateStoreServiceServer interface {
// pointer dereference when methods are called.
type UnimplementedStateStoreServiceServer struct{}
func (UnimplementedStateStoreServiceServer) RecentLogs(context.Context, *RecentLogsRequest) (*RecentLogsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method RecentLogs not implemented")
}
func (UnimplementedStateStoreServiceServer) InstallPackage(context.Context, *InstallPackageRequest) (*InstallPackageResponse, error) {
return nil, status.Error(codes.Unimplemented, "method InstallPackage not implemented")
}
@@ -2275,6 +2291,24 @@ func RegisterStateStoreServiceServer(s grpc.ServiceRegistrar, srv StateStoreServ
s.RegisterService(&StateStoreService_ServiceDesc, srv)
}
func _StateStoreService_RecentLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RecentLogsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(StateStoreServiceServer).RecentLogs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: StateStoreService_RecentLogs_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(StateStoreServiceServer).RecentLogs(ctx, req.(*RecentLogsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _StateStoreService_InstallPackage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InstallPackageRequest)
if err := dec(in); err != nil {
@@ -4475,6 +4509,10 @@ var StateStoreService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "state.v1.StateStoreService",
HandlerType: (*StateStoreServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "RecentLogs",
Handler: _StateStoreService_RecentLogs_Handler,
},
{
MethodName: "InstallPackage",
Handler: _StateStoreService_InstallPackage_Handler,
@@ -65,15 +65,13 @@ func StartEmbedded(ctx context.Context, opts EmbeddedOptions, log *slog.Logger)
// are both checked here.
CustomClientAuthentication: authenticator{token: token, tasks: opts.Tasks},
NoSigs: true, // the daemon owns signals, not the embedded server
// NoLog leaves the server's logger nil (ConfigureLogger is only ever
// called on reload). A nil logger makes the server's Fatalf a no-op
// rather than an os.Exit, so a JetStream startup failure cannot crash
// archied -- it surfaces instead as a Connect error below.
// The custom logger below reports fatal errors without exiting archied.
NoLog: true,
})
if err != nil {
return nil, fmt.Errorf("embedded nats create: %w", err)
}
srv.SetLogger(brokerLogger{log: log.With("service", "nats", "component", "nats")}, false, false)
srv.Start()
// Wait for the server to accept connections, or stop it if ctx is already
@@ -110,3 +108,18 @@ func (e *EmbeddedServer) Shutdown() {
e.srv.Shutdown()
e.log.Debug("embedded nats stopped")
}
// Fatal broker errors stay local instead of terminating the host process.
type brokerLogger struct{ log *slog.Logger }
func (l brokerLogger) Noticef(format string, args ...any) { l.log.Info(fmt.Sprintf(format, args...)) }
func (l brokerLogger) Warnf(format string, args ...any) { l.log.Warn(fmt.Sprintf(format, args...)) }
func (l brokerLogger) Errorf(format string, args ...any) { l.log.Error(fmt.Sprintf(format, args...)) }
func (l brokerLogger) Fatalf(format string, args ...any) { l.log.Error(fmt.Sprintf(format, args...)) }
func (l brokerLogger) Debugf(format string, args ...any) { l.log.Debug(fmt.Sprintf(format, args...)) }
func (l brokerLogger) Tracef(format string, args ...any) { l.log.Debug(fmt.Sprintf(format, args...)) }
@@ -8,6 +8,7 @@ import (
"google.golang.org/grpc/status"
pb "github.com/samcharles93/archie-core/internal/contracts/gateway/v1"
"github.com/samcharles93/archie-core/internal/logging"
)
// SkillEntry is one catalogued skill as the Skills page shows it: what it does
@@ -43,6 +44,7 @@ type CuratorAction struct {
// ChatService. A zero Catalog answers empty lists and an Unavailable reload,
// which is the honest answer from a process that hosts none of them.
type Catalog struct {
Logs func(context.Context, string, logging.Query) (logging.Result, error)
Skills func() []SkillEntry
Curators func(context.Context) []CuratorState
ReloadChannel func(context.Context, string) error
@@ -0,0 +1,25 @@
package gatewayrpc
import (
"context"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
pb "github.com/samcharles93/archie-core/internal/contracts/gateway/v1"
"github.com/samcharles93/archie-core/internal/infrastructure/logrpc"
"github.com/samcharles93/archie-core/internal/logging"
)
func (s *server) RecentLogs(ctx context.Context, r *pb.RecentLogsRequest) (*pb.RecentLogsResponse, error) {
if s.catalog.Logs == nil {
return nil, status.Error(codes.Unavailable, "service logs unavailable")
}
snapshot, err := logrpc.Encode(s.catalog.Logs(ctx, r.Service, logrpc.Query(r.Query)))
return &pb.RecentLogsResponse{Snapshot: snapshot}, err
}
func (c *Client) RecentLogs(ctx context.Context, service string, q logging.Query) (logging.Result, error) {
response, err := c.client.RecentLogs(ctx, &pb.RecentLogsRequest{Query: logrpc.Request(q), Service: service})
return logrpc.Decode(response.GetSnapshot(), err)
}
+34
View File
@@ -0,0 +1,34 @@
// Package logrpc encodes bounded service log snapshots over the existing contracts.
package logrpc
import (
"encoding/json"
pb "github.com/samcharles93/archie-core/internal/contracts/logging/v1"
"github.com/samcharles93/archie-core/internal/logging"
)
func Query(r *pb.LogQuery) logging.Query {
return logging.Query{Levels: r.GetLevels(), Component: r.GetComponent(), Contains: r.GetContains(), Limit: int(r.GetLimit())}
}
func Request(q logging.Query) *pb.LogQuery {
return &pb.LogQuery{Levels: q.Levels, Component: q.Component, Contains: q.Contains, Limit: int32(q.Limit)}
}
func Encode(result logging.Result, err error) (*pb.LogSnapshot, error) {
if err != nil {
return nil, err
}
raw, err := json.Marshal(result.Entries)
return &pb.LogSnapshot{EntriesJson: raw, Truncated: result.Truncated}, err
}
func Decode(result *pb.LogSnapshot, err error) (logging.Result, error) {
if err != nil {
return logging.Result{}, err
}
out := logging.Result{Truncated: result.Truncated}
err = json.Unmarshal(result.EntriesJson, &out.Entries)
return out, err
}
+55
View File
@@ -0,0 +1,55 @@
package logrpc
import (
"context"
"encoding/json"
"fmt"
"log/slog"
"github.com/nats-io/nats.go"
"github.com/samcharles93/archie-core/internal/logging"
"github.com/samcharles93/archie-core/internal/natsrpc"
)
const daemonSubject = "archie.logs.archied"
func RegisterDaemon(nc *nats.Conn, feed *logging.Feed, log *slog.Logger) (func(), error) {
return natsrpc.RegisterAll(nc, []natsrpc.Registration{{Subject: daemonSubject, Handler: func(msg *nats.Msg) {
var q logging.Query
if err := json.Unmarshal(msg.Data, &q); err != nil {
natsrpc.Respond(msg, log, "logs", reply{Error: "invalid log query"})
return
}
result, err := feed.Read(q)
out := reply{Result: result}
if err != nil {
out.Error = err.Error()
}
natsrpc.Respond(msg, log, "logs", out)
}}})
}
type reply struct {
Result logging.Result
Error string
}
func ReadDaemon(ctx context.Context, nc *nats.Conn, q logging.Query) (logging.Result, error) {
raw, err := json.Marshal(q)
if err != nil {
return logging.Result{}, err
}
msg, err := nc.RequestWithContext(ctx, daemonSubject, raw)
if err != nil {
return logging.Result{}, err
}
var out reply
if err := json.Unmarshal(msg.Data, &out); err != nil {
return logging.Result{}, err
}
if out.Error != "" {
return logging.Result{}, fmt.Errorf("daemon logs: %s", out.Error)
}
return out.Result, nil
}
@@ -0,0 +1,19 @@
package messagingrpc
import (
"context"
pb "github.com/samcharles93/archie-core/internal/contracts/messaging/v1"
"github.com/samcharles93/archie-core/internal/infrastructure/logrpc"
"github.com/samcharles93/archie-core/internal/logging"
)
func (s *server) RecentLogs(_ context.Context, r *pb.RecentLogsRequest) (*pb.RecentLogsResponse, error) {
snapshot, err := logrpc.Encode(s.feed.Read(logrpc.Query(r.Query)))
return &pb.RecentLogsResponse{Snapshot: snapshot}, err
}
func (c *Client) RecentLogs(ctx context.Context, q logging.Query) (logging.Result, error) {
response, err := c.rpc.RecentLogs(ctx, &pb.RecentLogsRequest{Query: logrpc.Request(q)})
return logrpc.Decode(response.GetSnapshot(), err)
}
@@ -18,6 +18,7 @@ import (
pb "github.com/samcharles93/archie-core/internal/contracts/messaging/v1"
"github.com/samcharles93/archie-core/internal/infrastructure/gatewayrpc"
"github.com/samcharles93/archie-core/internal/logging"
)
const tokenMetadataKey = "messaging-token"
@@ -34,11 +35,12 @@ type Deliverer interface {
type server struct {
pb.UnimplementedMessagingServiceServer
deliverer Deliverer
feed *logging.Feed
}
// RegisterServer registers MessagingService over d.
func RegisterServer(registrar grpc.ServiceRegistrar, d Deliverer) {
pb.RegisterMessagingServiceServer(registrar, &server{deliverer: d})
func RegisterServer(registrar grpc.ServiceRegistrar, d Deliverer, feed *logging.Feed) {
pb.RegisterMessagingServiceServer(registrar, &server{deliverer: d, feed: feed})
}
func (s *server) Deliver(ctx context.Context, req *pb.DeliverRequest) (*pb.DeliverResponse, error) {
+19
View File
@@ -0,0 +1,19 @@
package staterpc
import (
"context"
pb "github.com/samcharles93/archie-core/internal/contracts/state/v1"
"github.com/samcharles93/archie-core/internal/infrastructure/logrpc"
"github.com/samcharles93/archie-core/internal/logging"
)
func (s *server) RecentLogs(_ context.Context, r *pb.RecentLogsRequest) (*pb.RecentLogsResponse, error) {
snapshot, err := logrpc.Encode(s.deps.LogFeed.Read(logrpc.Query(r.Query)))
return &pb.RecentLogsResponse{Snapshot: snapshot}, err
}
func (c *Client) RecentLogs(ctx context.Context, q logging.Query) (logging.Result, error) {
response, err := c.client.RecentLogs(ctx, &pb.RecentLogsRequest{Query: logrpc.Request(q)})
return logrpc.Decode(response.GetSnapshot(), err)
}
@@ -141,6 +141,7 @@ type Deps struct {
// TaskLogs reads task attempt logs. Nil answers ReadTaskLog with
// Unavailable.
TaskLogs storecontract.TaskLogStore
LogFeed *logging.Feed
Log *slog.Logger
}
@@ -0,0 +1,39 @@
package staterpc
import (
"context"
"strings"
"testing"
"time"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
pb "github.com/samcharles93/archie-core/internal/contracts/state/v1"
)
func TestServiceLogsRequireInstanceCredential(t *testing.T) {
run := strings.Repeat("ab", 32)
grants := &TaskGrants{Store: credentials{}}
if err := grants.register(t.Context(), 7, run, time.Hour); err != nil {
t.Fatal(err)
}
for _, tt := range []struct {
name, token string
code codes.Code
}{
{"instance", "admin", codes.OK},
{"task cannot read other services", run, codes.PermissionDenied},
{"anonymous", "", codes.Unauthenticated},
} {
t.Run(tt.name, func(t *testing.T) {
ctx := metadata.NewIncomingContext(t.Context(), metadata.Pairs(tokenMetadataKey, tt.token))
_, err := grants.UnaryInterceptor("admin")(ctx, &pb.RecentLogsRequest{}, &grpc.UnaryServerInfo{FullMethod: pb.StateStoreService_RecentLogs_FullMethodName}, func(context.Context, any) (any, error) { return &pb.RecentLogsResponse{}, nil })
if status.Code(err) != tt.code {
t.Fatalf("code %s want %s", status.Code(err), tt.code)
}
})
}
}
+42
View File
@@ -0,0 +1,42 @@
package logging
import (
"encoding/json"
"slices"
)
// Read returns matching recent entries, bounded for both RPC and NATS replies.
func (f *Feed) Read(q Query) (Result, error) {
entries := f.Snapshot()
limit := q.Limit
if limit <= 0 {
limit = DefaultTailLines
}
if limit > MaxTailLines {
limit = MaxTailLines
}
out := Result{Entries: []Entry{}}
size := 0
for _, entry := range slices.Backward(entries) {
if !q.matches(entry) {
continue
}
if len(out.Entries) == limit {
out.Truncated = true
break
}
raw, err := json.Marshal(entry)
if err != nil {
return Result{}, err
}
if size+len(raw) > 512<<10 {
out.Truncated = true
continue
}
size += len(raw)
out.Entries = append(out.Entries, entry)
}
slices.Reverse(out.Entries)
return out, nil
}
+38
View File
@@ -0,0 +1,38 @@
package logging
import (
"strings"
"testing"
)
func TestRecentLogsBounds(t *testing.T) {
tests := []struct {
name string
entries []Entry
query Query
count int
truncated bool
}{
{name: "level and component filter", entries: []Entry{{Level: "INFO", Message: "older"}, {Level: "ERROR", Message: "failure", Fields: map[string]any{"component": "store"}}}, query: Query{Levels: []string{"error"}, Component: "store"}, count: 1},
{name: "recent limit", entries: []Entry{{Message: "older"}, {Message: "newer"}}, query: Query{Limit: 1}, count: 1, truncated: true},
{name: "oversized record does not hide other recent lines", entries: []Entry{{Message: "normal"}, {Message: strings.Repeat("x", 1<<20)}}, count: 1, truncated: true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
feed := NewFeed(1000)
for _, entry := range tt.entries {
feed.append(entry)
}
result, err := feed.Read(tt.query)
if err != nil {
t.Fatal(err)
}
if len(result.Entries) != tt.count || result.Truncated != tt.truncated {
t.Fatalf("count %d truncated %v", len(result.Entries), result.Truncated)
}
if tt.name == "recent limit" && result.Entries[0].Message != "newer" {
t.Fatal("read retained older entry")
}
})
}
}
+85 -49
View File
@@ -1,29 +1,23 @@
package webui
import (
"context"
"maps"
"net/http"
"slices"
"strconv"
"strings"
"sync"
"time"
"github.com/samcharles93/archie-core/internal/domain/presence"
"github.com/samcharles93/archie-core/internal/logging"
)
// handleLogs serves a page of log history.
func (s *Server) handleLogs(w http.ResponseWriter, r *http.Request) {
path := s.logFile()
if path == "" {
// Not an error: file logging is optional. Say so plainly so the UI can
// explain how to turn it on rather than showing an empty table.
writeJSON(w, map[string]any{
"entries": s.LogFeed.Snapshot(),
"file": "",
"disabled": true,
"components": mergeComponents(nil, s.LogFeed.Snapshot()),
})
return
}
// LogSource reads one service's bounded recent log over its contract.
type LogSource func(context.Context, logging.Query) (logging.Result, error)
func (s *Server) handleLogs(w http.ResponseWriter, r *http.Request) {
q := r.URL.Query()
limit := logging.DefaultTailLines
if raw := strings.TrimSpace(q.Get("limit")); raw != "" {
@@ -32,42 +26,75 @@ func (s *Server) handleLogs(w http.ResponseWriter, r *http.Request) {
http.Error(w, "bad limit", http.StatusBadRequest)
return
}
switch {
case parsed <= 0:
limit = logging.DefaultTailLines
case parsed > logging.MaxTailLines:
limit = logging.MaxTailLines
default:
limit = parsed
if parsed > 0 {
limit = min(parsed, logging.MaxTailLines)
}
}
result, err := logging.Tail(path, logging.Query{
Levels: splitCSV(q.Get("level")),
Component: strings.TrimSpace(q.Get("component")),
Contains: strings.TrimSpace(q.Get("q")),
Limit: limit,
})
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
sources := s.LogSources
if len(sources) == 0 {
sources = map[string]LogSource{presence.UI: func(_ context.Context, q logging.Query) (logging.Result, error) { return s.LogFeed.Read(q) }}
}
service := q.Get("service")
owner := service
if service == presence.Agent || service == presence.Broker {
owner = presence.Daemon
}
if owner != "" && sources[owner] == nil {
http.Error(w, "unknown service", http.StatusBadRequest)
return
}
components, err := logging.Components(path)
if err != nil {
// The filter list is a convenience; failing to build it must not cost
// the caller their log entries.
s.Log.Warn("log components unavailable", "err", err)
components = []string{}
query := logging.Query{Limit: limit, Levels: splitCSV(q.Get("level")), Component: q.Get("component"), Contains: q.Get("q")}
entries, errors, truncated := readServiceLogs(r.Context(), sources, owner, query)
services := logServices(sources, entries)
components := mergeComponents(nil, entries)
if service != "" {
entries = slices.DeleteFunc(entries, func(e logging.Entry) bool { return e.Fields["service"] != service })
}
liveEntries := s.LogFeed.Snapshot()
components = mergeComponents(components, liveEntries)
slices.SortStableFunc(entries, func(a, b logging.Entry) int { return a.Time.Compare(b.Time) })
if len(entries) > limit {
entries = entries[len(entries)-limit:]
truncated = true
}
writeJSON(w, map[string]any{"entries": entries, "components": components, "services": services, "errors": errors, "truncated": truncated, "disabled": len(s.LogSources) == 0 && s.LogFeed == nil})
}
writeJSON(w, map[string]any{
"entries": append(result.Entries, liveEntries...),
"truncated": result.Truncated,
"file": result.File,
"components": components,
})
func readServiceLogs(ctx context.Context, sources map[string]LogSource, selected string, q logging.Query) ([]logging.Entry, map[string]string, bool) {
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()
entries := []logging.Entry{}
failures := map[string]string{}
truncated := false
var mu sync.Mutex
var wg sync.WaitGroup
for name, source := range sources {
if selected != "" && name != selected {
continue
}
wg.Go(func() {
result, err := source(ctx, q)
mu.Lock()
defer mu.Unlock()
if err != nil {
failures[name] = err.Error()
return
}
truncated = truncated || result.Truncated
for _, entry := range result.Entries {
entry.Fields = maps.Clone(entry.Fields)
if entry.Fields == nil {
entry.Fields = map[string]any{}
}
// Only the daemon receives worker and embedded-broker logs.
observed, _ := entry.Fields["service"].(string)
if name != presence.Daemon || (observed != presence.Agent && observed != presence.Broker) {
entry.Fields["service"] = name
}
entries = append(entries, entry)
}
})
}
wg.Wait()
return entries, failures, truncated
}
func mergeComponents(history []string, live []logging.Entry) []string {
@@ -88,11 +115,6 @@ func mergeComponents(history []string, live []logging.Entry) []string {
return components
}
// logFile returns this process's readable log path, or "".
func (s *Server) logFile() string {
return strings.TrimSpace(s.LogFile)
}
func splitCSV(v string) []string {
if strings.TrimSpace(v) == "" {
return nil
@@ -106,3 +128,17 @@ func splitCSV(v string) []string {
}
return out
}
func logServices(sources map[string]LogSource, entries []logging.Entry) []string {
services := make([]string, 0, len(sources))
for name := range sources {
services = append(services, name)
}
for _, entry := range entries {
if name, ok := entry.Fields["service"].(string); ok && !slices.Contains(services, name) {
services = append(services, name)
}
}
slices.Sort(services)
return services
}
+2 -6
View File
@@ -44,7 +44,8 @@ type Server struct {
// LogFeed is the daemon diagnostic stream. It is separate from Events,
// which contains persisted task lifecycle activity only.
LogFeed *logging.Feed
LogFeed *logging.Feed
LogSources map[string]LogSource
// TaskLogs reads task logs. Nil means this process cannot read them.
TaskLogs TaskLogSource
@@ -203,11 +204,6 @@ type Server struct {
// than Confirmed.
RunningVersions func() map[string]string
// LogFile is the log file this process can read history from, for
// GET /api/logs. Process-local: the file is on the daemon's disk, so
// only a dashboard sharing that host can set it.
LogFile string
// TrustForwardedHeaders controls whether X-Forwarded-Proto and
// X-Forwarded-Host are trusted when validating Origin on mutating
// requests. When false, Origin scheme must match the direct connection (r.TLS).
+6
View File
@@ -2,9 +2,12 @@ syntax = "proto3";
package gateway.v1;
import "logging/v1/logging.proto";
import "google/protobuf/timestamp.proto";
service ChatService {
rpc RecentLogs(RecentLogsRequest) returns (RecentLogsResponse);
rpc Snapshot(SnapshotRequest) returns (SnapshotResponse);
rpc GetSession(GetSessionRequest) returns (GetSessionResponse);
rpc RecentMessages(RecentMessagesRequest) returns (RecentMessagesResponse);
@@ -277,3 +280,6 @@ message CuratorAction {
// configuration. It is Unavailable from a Gateway that hosts no channels.
message ReloadChannelRequest { string channel_id = 1; }
message ReloadChannelResponse {}
message RecentLogsRequest { logging.v1.LogQuery query = 1; string service = 2; }
message RecentLogsResponse { logging.v1.LogSnapshot snapshot = 1; }
+12
View File
@@ -0,0 +1,12 @@
syntax = "proto3";
package logging.v1;
message LogQuery {
int32 limit = 1;
repeated string levels = 2;
string component = 3;
string contains = 4;
}
message LogSnapshot {
bytes entries_json = 1;
bool truncated = 2;
}
+6
View File
@@ -2,10 +2,13 @@ syntax = "proto3";
package messaging.v1;
import "logging/v1/logging.proto";
// MessagingService is the Messaging Service's contract: the process that holds
// the chat channel transports. Other services send outbound messages through
// it rather than holding channel credentials themselves.
service MessagingService {
rpc RecentLogs(RecentLogsRequest) returns (RecentLogsResponse);
// Deliver sends text to one chat on one channel. FAILED_PRECONDITION means
// the channel is not running or cannot send; the caller may retry later.
rpc Deliver(DeliverRequest) returns (DeliverResponse);
@@ -20,3 +23,6 @@ message DeliverRequest {
}
message DeliverResponse {}
message RecentLogsRequest { logging.v1.LogQuery query = 1; }
message RecentLogsResponse { logging.v1.LogSnapshot snapshot = 1; }
+6
View File
@@ -2,6 +2,8 @@ syntax = "proto3";
package state.v1;
import "logging/v1/logging.proto";
import "google/protobuf/timestamp.proto";
// StateStore is the single gRPC service fronting archie's PostgreSQL database.
@@ -12,6 +14,7 @@ import "google/protobuf/timestamp.proto";
// service over internal/infrastructure/postgres; the proto bypasses the Go
// interfacebloat cap (max 8), like gateway.v1.ChatService does.
service StateStoreService {
rpc RecentLogs(RecentLogsRequest) returns (RecentLogsResponse);
// Installed Archie packages. Administrative until org-scoped principals land.
rpc InstallPackage(InstallPackageRequest) returns (InstallPackageResponse);
// ListCatalogue returns the packages the instance's verified catalogue
@@ -1486,3 +1489,6 @@ message AssignAgentRequest {
string identity_id = 2;
}
message AssignAgentResponse {}
message RecentLogsRequest { logging.v1.LogQuery query = 1; }
message RecentLogsResponse { logging.v1.LogSnapshot snapshot = 1; }
+61 -61
View File
@@ -14,57 +14,57 @@ Defaulting to \`null\`.`),null)}function op(e){return ip(e)&&!Number.isNaN(e)&&e
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=Wg(c),u=e+1<n.length?Wg(n[e+1]):null;if(l&&u&&Gg(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=Wg(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>Hg(e)),rows:r.map(e=>e.map(e=>Hg(e)))});continue}if(!c.trim()){o(),s();continue}let d=c.match(/^(#{1,3})\s+(.+)$/);if(d){o(),s(),t.push({kind:`h${d[1].length}`,inline:Hg(d[2])});continue}let f=c.match(/^\s*[-*]\s+(.+)$/),p=c.match(/^\s*\d+[.)]\s+(.+)$/);if(f||p){o();let e=p?`ol`:`ul`;(!i||i.tag!==e)&&(s(),i={tag:e,items:[]}),i.items.push((f||p)[1]);continue}if(c.startsWith(`>`)){o(),s(),t.push({kind:`blockquote`,inline:Hg(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function Wg(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function Gg(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var Kg={class:`[overflow-wrap:anywhere]`},qg={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},Jg={class:`font-mono text-[0.85em]`},Yg={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},Xg={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},Zg={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Qg={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},$g={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},e_={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},t_={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},n_={key:8,class:`mb-2.5 last:mb-0`},r_=n({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=M(()=>Ug(t.text));return(e,t)=>(P(),V(`div`,Kg,[(P(!0),V(R,null,H(n.value,(e,t)=>(P(),V(R,{key:t},[e.kind===`pre`?(P(),V(`pre`,qg,[B(`code`,Jg,L(e.code),1)])):e.kind===`table`?(P(),V(`table`,Yg,[B(`thead`,null,[B(`tr`,null,[(P(!0),V(R,null,H(e.head,(e,t)=>(P(),V(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[O(Bg,{inline:e},null,8,[`inline`])]))),128))])]),B(`tbody`,null,[(P(!0),V(R,null,H(e.rows,(e,t)=>(P(),V(`tr`,{key:t},[(P(!0),V(R,null,H(e,(e,t)=>(P(),V(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[O(Bg,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(P(),V(`blockquote`,Xg,[O(Bg,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(P(),V(`h1`,Zg,[O(Bg,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(P(),V(`h2`,Qg,[O(Bg,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(P(),V(`h3`,$g,[O(Bg,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(P(),V(`ul`,e_,[(P(!0),V(R,null,H(e.items,(e,t)=>(P(),V(`li`,{key:t},[O(Bg,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(P(),V(`ol`,t_,[(P(!0),V(R,null,H(e.items,(e,t)=>(P(),V(`li`,{key:t},[O(Bg,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(P(),V(`p`,n_,[O(Bg,{inline:e.inline},null,8,[`inline`])])):N(``,!0)],64))),128))]))}}),i_={class:`truncate`},a_=n({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=c(`RouterLink`);return P(),U(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-full border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:C(()=>[O(F(ir),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),B(`span`,i_,L(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),o_={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},s_={class:`font-semibold text-foreground`},c_={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},l_=n({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=M(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=M(()=>t.tool.parameters||t.tool.Parameters||``),i=M(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=M(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(P(),U(a_,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(P(),V(`div`,o_,[O(F(ai),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),B(`span`,s_,L(n.value),1),r.value?(P(),V(`code`,c_,L(r.value),1)):N(``,!0),B(`span`,{class:k(F(G)(`text-fg-muted`,i.value&&`text-danger`))},L(a.value),3)]))}}),u_={key:0,class:`mb-2 grid gap-0.5 text-xs`},d_={key:1,class:`mb-2 flex flex-wrap gap-1.5`},f_={key:3,class:`whitespace-pre-wrap`},p_=n({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(P(),V(`div`,{class:k([`flex`,e.assistant?`justify-start`:`justify-end`])},[B(`div`,{class:k(F(G)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(P(),V(`div`,u_,[(P(!0),V(R,null,H(e.tools,(t,n)=>(P(),U(l_,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):N(``,!0),e.media.length?(P(),V(`div`,d_,[(P(!0),V(R,null,H(e.media,(e,t)=>(P(),U(Ng,{key:t,attachment:e},null,8,[`attachment`]))),128))])):N(``,!0),e.assistant?(P(),U(r_,{key:2,text:e.text},null,8,[`text`])):(P(),V(`div`,f_,L(e.text),1)),A(t.$slots,`default`)],2)],2))}}),m_={class:`text-sm`},h_={class:`font-medium`},g_={key:0,class:`mt-1 text-fg-muted`},__={key:1,class:`mt-2 flex flex-wrap gap-2`},v_=n({__name:`ChatChoLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>CS?`${n.slice(0,CS).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var TS=[`title`],ES=n({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=M(()=>Zx(n.event)),a=M(()=>wS(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=M(()=>n.event.at?$b(n.event.at):`—`);return(e,t)=>(P(),U(F(xS),{class:k(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[dn(un(o,[`prevent`]),[`enter`]),dn(un(o,[`prevent`]),[`space`])]},{default:C(()=>[O(F(Z),{class:`font-medium`},{default:C(()=>[l(L(n.event.kind||n.event.type||`event`),1)]),_:1}),O(F(Z),{class:`font-mono`},{default:C(()=>[l(L(i.value>0?`#${i.value}`:`—`),1)]),_:1}),O(F(Z),{class:`w-[55%] max-w-0`},{default:C(()=>[B(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},L(a.value.text),9,TS)]),_:1}),O(F(Z),null,{default:C(()=>[l(L(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),DS=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function OS(e){return(Number(e?.task_id)||0)>0}function kS(e,t){return t===`tasks`?OS(e):t!==`system`||!OS(e)}function AS(e,t){return e.filter(e=>kS(e,t))}function jS(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function MS(e,t){return`${e}:${t??0}`}function NS(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=MS(wS(n).text,r),a=t[t.length-1];if(a&&a.key===i){a.count+=1,a.events.push(n);continue}t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var PS={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},FS={class:`max-h-[28rem] overflow-y-auto`},IS=[`aria-expanded`,`aria-label`,`onClick`],LS=[`title`],RS=n({__name:`LiveActivityCard`,setup(e){let t=rv(),{activity:n,streamKind:r,streamState:i}=kn(An()),a=W(`all`),o=M(()=>AS(n.value,a.value)),s=M(()=>jS(o.value.length,a.value)),c=je(new Set),u=M(()=>NS(o.value));function d(e){c.has(e)?c.delete(e):c.add(e)}function f(e){return c.has(e.key)}function p(e){return wS(e.representative)}function m(e){return e.representative.at?$b(e.representative.at):`—`}function h(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(P(),U(F(Kb),null,{default:C(()=>[O(F(Zb),null,{default:C(()=>[O(F(Qb),null,{default:C(()=>[...t[1]||=[l(`Live activity`,-1)]]),_:1}),O(F(qb),{class:`flex items-center gap-2`},{default:C(()=>[O(F(_S),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:F(DS)},null,8,[`modelValue`,`options`]),O(F(xn),{variant:F(r)},{default:C(()=>[l(L(F(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),O(F(Jb),null,{default:C(()=>[B(`div`,PS,[B(`div`,FS,[O(F(yS),null,{default:C(()=>[O(F(SS),{class:`sticky top-0 z-10 bg-card`},{default:C(()=>[O(F(xS),null,{default:C(()=>[O(F(Q),null,{default:C(()=>[...t[2]||=[l(`Event`,-1)]]),_:1}),O(F(Q),null,{default:C(()=>[...t[3]||=[l(`Task`,-1)]]),_:1}),O(F(Q),null,{default:C(()=>[...t[4]||=[l(`Detail`,-1)]]),_:1}),O(F(Q),null,{default:C(()=>[...t[5]||=[l(`When`,-1)]]),_:1})]),_:1})]),_:1}),O(F(bS),null,{default:C(()=>[o.value.length?N(``,!0):(P(),U(F(xS),{key:0},{default:C(()=>[O(F(Z),{colspan:`4`},{default:C(()=>[O(F(Lb),null,{default:C(()=>[O(F(Bb),null,{default:C(()=>[O(F(Ub),null,{default:C(()=>[l(L(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(P(!0),V(R,{key:1},H(u.value,e=>(P(),V(R,{key:e.key},[e.count===1?(P(),U(ES,{key:0,event:e.representative,onOpen:h},null,8,[`event`])):(P(),V(R,{key:1},[O(F(xS),{class:k(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&h(e.taskID),onKeydown:[dn(un(t=>e.taskID>0&&h(e.taskID),[`prevent`]),[`enter`]),dn(un(t=>e.taskID>0&&h(e.taskID),[`prevent`]),[`space`])]},{default:C(()=>[O(F(Z),{class:`font-medium`},{default:C(()=>[B(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":f(e),"aria-label":`${f(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:un(t=>d(e.key),[`stop`])},[f(e)?(P(),U(F(dr),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(P(),U(F(fr),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),l(` `+L(e.label)+` `,1),O(F(xn),{variant:`idle`},{default:C(()=>[l(`×`+L(e.count),1)]),_:2},1024)],8,IS)]),_:2},1024),O(F(Z),{class:`font-mono`},{default:C(()=>[l(L(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),O(F(Z),{class:`w-[55%] max-w-0`},{default:C(()=>[B(`span`,{class:`block truncate`,title:p(e).truncated?p(e).full:void 0},L(p(e).text),9,LS)]),_:2},1024),O(F(Z),null,{default:C(()=>[l(L(m(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),f(e)?(P(!0),V(R,{key:0},H(e.events,(t,n)=>(P(),U(ES,{key:`${e.key}:${n}`,event:t,onOpen: Line truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function iw(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function aw(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function ow(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function sw(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var cw=W([]),lw=W([]),uw=W(!0),dw=W(null),fw=W(null),pw=W(!1),mw=W(null);async function hw(){try{let e=await K.eventTypes();uw.value=e.enabled!==!1,cw.value=e.event_types||[],lw.value=e.proposals||[],dw.value=null}catch(e){dw.value=e.message||String(e)}}function gw(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function _w(e){mw.value=null,fw.value=e}function vw(e){let t=Ew.value.find(t=>String(t.id)===e.sample_id);_w({mode:`proposal`,id:null,source:e.source,name:``,rule:gw(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function yw(e=``){_w({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function bw(e){_w({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:gw(e.rule),headersText:``,body:``,exampleHeaders:{}})}function xw(){fw.value=null}async function Sw(){let e=fw.value;if(e){pw.value=!0;try{if(e.mode===`edit`&&e.id)await K.eventTypeUpdate(e.id,{name:e.name,rule:sw(e.rule)});else{let t=e.mode===`paste`?rw(e.headersText):e.exampleHeaders;await K.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:sw(e.rule),example:{headers:t,body:e.body}})}fw.value=null,await hw()}catch(e){mw.value=e.message||String(e)}finally{pw.value=!1}}}var Cw=W(null);async function ww(){let e=Cw.value;if(Cw.value=null,e)try{await K.eventTypeDelete(e.id),await hw()}catch(e){dw.value=e.message||String(e)}}var Tw=100,Ew=W([]),Dw=W(!0),Ow=W(null),kw=W(!0),Aw=W(null);async function jw(){try{let e=await K.captures(Tw);Dw.value=e.enabled!==!1,Ew.value=e.captures||[],Ow.value=null}catch(e){Ow.value=e.message||String(e)}finally{kw.value=!1}}function Mw(e){let t=Ew.value.find(t=>t.id===e);return t&&(Aw.value=t),!!t}function Nw(){Ew.value.length&&(Aw.value=Ew.value[0])}function Pw(){In(`captures`,()=>{jw(),hw()})}var Fw={key:0,class:`text-xs text-fg-muted`},Iw={key:1,class:`flex flex-col gap-1 text-xs`},Lw={key:1},Rw={key:2,class:`text-xs text-fg-muted`},zw=n({__name:`DispatchLinks`,props:{kind:{},id:{}},setup(e){let t=e,n=W([]),r=W(!1);j(()=>[t.kind,t.id],async()=>{r.value=!1;try{n.value=await K.dispatches(t.kind,t.id)}catch{n.value=[],r.value=!0}},{immediate:!0});let i=e=>({path:`/events`,query:{tab:`inspector`,capture:e}});return(e,a)=>{let o=c(`RouterLink`);return r.value?(P(),V(`p`,Fw,`Dispatches unavailable.`)):n.value.length?(P(),V(`ul`,Iw,[(P(!0),V(R,null,H(n.value,e=>(P(),V(`li`,{key:e.binding_id+e.capture_id,class:`flex flex-wrap items-center gap-x-2 font-mono text-fg-muted`},[t.kind===`bindings`?N(``,!0):(P(),U(o,{key:0,to:{path:`/events`,query:{tab:`bindings`}},class:`hover:text-foreground`},{default:C(()=>[l(`binding `+L(e.binding_id.slice(0,8))+` v`+L(e.binding_version),1)]),_:2},1024)),t.kind===`captures`?N(``,!0):(P(),U(o,{key:1,to:i(e.capture_id),class:`hover:text-foreground`},{default:C(()=>[l(`capture `+L(e.capture_id.slice(0,8)),1)]),_:2},1032,[`to`])),t.kind===`tasks`?N(``,!0):(P(),V(R,{key:2},[e.task_id?(P(),U(o,{key:0,to:`/tasks/${e.task_id}`,class:`text-foreground hover:underline`},{default:C(()=>[l(`task #`+L(e.task_id),1)]),_:2},1032,[`to`])):(P(),V(`span`,Lw,L(e.reason||`claimed, no task recorded`),1))],64)),B(`span`,null,L(F($b)(e.dispatched_at)),1)]))),128))])):t.kind===`tasks`?N(``,!0):(P(),V(`p`,Rw,` No dispatches yet. `))}}}),Bw=n({__name:`Spinner`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(P(),U(F(Er),{role:`status`,"aria-label":`Loading`,class:k(F(G)(`size-4 animate-spin`,t.class))},null,8,[`class`]))}});function Vw(e,t){return t?e.filter(e=>e.event_type_id===t):[]}function Hw(e){return(e?.repository??`required`)!==`none`}function Uw(e,t){return e.filter(e=>t===`any`||e.type===`any`||e.type===t)}function Ww(e,t){switch(t){case`string`:return e;case`number`:return e.trim()!==``&&!Number.isNaN(Number(e))?Number(e):e;case`bool`:return e===`true`||e!==`false`&&e;default:try{return JSON.parse(e)}catch{return e}}}var Gw={pending_approval:`pending approval`,armed:`armed`,paused:`paused`},Kw={pending_approval:`warn`,armed:`ok`,paused:`idle`};function qw(e){ Line truncated
`)}};oB.defaultYaml={explicit:!1,version:`1.2`},oB.defaultTags={"!!":`tag:yaml.org,2002:`};function sB(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function cB(e){let t=new Set;return $z(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function lB(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function uB(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=cB(e);let a=lB(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(Gz(t.node)||qz(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function dB(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=dB(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=dB(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=dB(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=dB(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function fB(e,t,n){if(Array.isArray(e))return e.map((e,t)=>fB(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Yz(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var pB=class{constructor(e){Object.defineProperty(this,Bz,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Hz(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=fB(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?dB(i,{"":o},``,o):o}},mB=class extends pB{constructor(e){super(Pz),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],$z(e,{Node:(e,t)=>{(Vz(t)||Yz(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(fB(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=hB(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(sB(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function hB(e,t,n){if(Vz(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(qz(t)){let r=0;for(let i of t.items){let t=hB(e,i,n);t>r&&(r=t)}return r}if(Wz(t)){let r=hB(e,t.key,n),i=hB(e,t.value,n);return Math.max(r,i)}return 1}var gB=e=>!e||typeof e!=`function`&&typeof e!=`object`,_B=class extends pB{constructor(e){super(Rz),this.value=e}toJSON(e,t){return t?.keep?this.value:fB(this.value,e,t)}toString(){return String(this.value)}};_B.BLOCK_FOLDED=`BLOCK_FOLDED`,_B.BLOCK_LITERAL=`BLOCK_LITERAL`,_B.PLAIN=`PLAIN`,_B.QUOTE_DOUBLE=`QUOTE_DOUBLE`,_B.QUOTE_SINGLE=`QUOTE_SINGLE`;var vB=`tag:yaml.org,2002:`;function yB(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function bB(e,t,n){if(Hz(e)&&(e=e.contents),Jz(e))return e;if(Wz(e)){let t=n.schema[Iz].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new mB(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=vB+t.slice(2));let l=yB(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new _B(e);return c&&(c.node=t),t Line truncated
`)?TB(n,t):n.includes(`
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function iw(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function aw(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function ow(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function sw(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var cw=W([]),lw=W([]),uw=W(!0),dw=W(null),fw=W(null),pw=W(!1),mw=W(null);async function hw(){try{let e=await K.eventTypes();uw.value=e.enabled!==!1,cw.value=e.event_types||[],lw.value=e.proposals||[],dw.value=null}catch(e){dw.value=e.message||String(e)}}function gw(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function _w(e){mw.value=null,fw.value=e}function vw(e){let t=Ew.value.find(t=>String(t.id)===e.sample_id);_w({mode:`proposal`,id:null,source:e.source,name:``,rule:gw(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function yw(e=``){_w({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function bw(e){_w({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:gw(e.rule),headersText:``,body:``,exampleHeaders:{}})}function xw(){fw.value=null}async function Sw(){let e=fw.value;if(e){pw.value=!0;try{if(e.mode===`edit`&&e.id)await K.eventTypeUpdate(e.id,{name:e.name,rule:sw(e.rule)});else{let t=e.mode===`paste`?rw(e.headersText):e.exampleHeaders;await K.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:sw(e.rule),example:{headers:t,body:e.body}})}fw.value=null,await hw()}catch(e){mw.value=e.message||String(e)}finally{pw.value=!1}}}var Cw=W(null);async function ww(){let e=Cw.value;if(Cw.value=null,e)try{await K.eventTypeDelete(e.id),await hw()}catch(e){dw.value=e.message||String(e)}}var Tw=100,Ew=W([]),Dw=W(!0),Ow=W(null),kw=W(!0),Aw=W(null);async function jw(){try{let e=await K.captures(Tw);Dw.value=e.enabled!==!1,Ew.value=e.captures||[],Ow.value=null}catch(e){Ow.value=e.message||String(e)}finally{kw.value=!1}}function Mw(e){let t=Ew.value.find(t=>t.id===e);return t&&(Aw.value=t),!!t}function Nw(){Ew.value.length&&(Aw.value=Ew.value[0])}function Pw(){In(`captures`,()=>{jw(),hw()})}var Fw={key:0,class:`text-xs text-fg-muted`},Iw={key:1,class:`flex flex-col gap-1 text-xs`},Lw={key:1},Rw={key:2,class:`text-xs text-fg-muted`},zw=n({__name:`DispatchLinks`,props:{kind:{},id:{}},setup(e){let t=e,n=W([]),r=W(!1);j(()=>[t.kind,t.id],async()=>{r.value=!1;try{n.value=await K.dispatches(t.kind,t.id)}catch{n.value=[],r.value=!0}},{immediate:!0});let i=e=>({path:`/events`,query:{tab:`inspector`,capture:e}});return(e,a)=>{let o=c(`RouterLink`);return r.value?(P(),V(`p`,Fw,`Dispatches unavailable.`)):n.value.length?(P(),V(`ul`,Iw,[(P(!0),V(R,null,H(n.value,e=>(P(),V(`li`,{key:e.binding_id+e.capture_id,class:`flex flex-wrap items-center gap-x-2 font-mono text-fg-muted`},[t.kind===`bindings`?N(``,!0):(P(),U(o,{key:0,to:{path:`/events`,query:{tab:`bindings`}},class:`hover:text-foreground`},{default:C(()=>[l(`binding `+L(e.binding_id.slice(0,8))+` v`+L(e.binding_version),1)]),_:2},1024)),t.kind===`captures`?N(``,!0):(P(),U(o,{key:1,to:i(e.capture_id),class:`hover:text-foreground`},{default:C(()=>[l(`capture `+L(e.capture_id.slice(0,8)),1)]),_:2},1032,[`to`])),t.kind===`tasks`?N(``,!0):(P(),V(R,{key:2},[e.task_id?(P(),U(o,{key:0,to:`/tasks/${e.task_id}`,class:`text-foreground hover:underline`},{default:C(()=>[l(`task #`+L(e.task_id),1)]),_:2},1032,[`to`])):(P(),V(`span`,Lw,L(e.reason||`claimed, no task recorded`),1))],64)),B(`span`,null,L(F($b)(e.dispatched_at)),1)]))),128))])):t.kind===`tasks`?N(``,!0):(P(),V(`p`,Rw,` No dispatches yet. `))}}}),Bw=n({__name:`Spinner`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(P(),U(F(Er),{role:`status`,"aria-label":`Loading`,class:k(F(G)(`size-4 animate-spin`,t.class))},null,8,[`class`]))}});function Vw(e,t){return t?e.filter(e=>e.event_type_id===t):[]}function Hw(e){return(e?.repository??`required`)!==`none`}function Uw(e,t){return e.filter(e=>t===`any`||e.type===`any`||e.type===t)}function Ww(e,t){switch(t){case`string`:return e;case`number`:return e.trim()!==``&&!Number.isNaN(Number(e))?Number(e):e;case`bool`:return e===`true`||e!==`false`&&e;default:try{return JSON.parse(e)}catch{return e}}}var Gw={pending_approval:`pending approval`,armed:`armed`,paused:`paused`},Kw={pending_approval:`warn`,armed:`ok`,paused:`idle`};function qw(e){ Line truncated
`)}};uB.defaultYaml={explicit:!1,version:`1.2`},uB.defaultTags={"!!":`tag:yaml.org,2002:`};function dB(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function fB(e){let t=new Set;return rB(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function pB(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function mB(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=fB(e);let a=pB(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(Yz(t.node)||Zz(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function hB(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=hB(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=hB(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=hB(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=hB(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function gB(e,t,n){if(Array.isArray(e))return e.map((e,t)=>gB(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!$z(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var _B=class{constructor(e){Object.defineProperty(this,Wz,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Kz(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=gB(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?hB(i,{"":o},``,o):o}},vB=class extends _B{constructor(e){super(Rz),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],rB(e,{Node:(e,t)=>{(Gz(t)||$z(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(gB(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=yB(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(dB(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function yB(e,t,n){if(Gz(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(Zz(t)){let r=0;for(let i of t.items){let t=yB(e,i,n);t>r&&(r=t)}return r}if(Jz(t)){let r=yB(e,t.key,n),i=yB(e,t.value,n);return Math.max(r,i)}return 1}var bB=e=>!e||typeof e!=`function`&&typeof e!=`object`,xB=class extends _B{constructor(e){super(Hz),this.value=e}toJSON(e,t){return t?.keep?this.value:gB(this.value,e,t)}toString(){return String(this.value)}};xB.BLOCK_FOLDED=`BLOCK_FOLDED`,xB.BLOCK_LITERAL=`BLOCK_LITERAL`,xB.PLAIN=`PLAIN`,xB.QUOTE_DOUBLE=`QUOTE_DOUBLE`,xB.QUOTE_SINGLE=`QUOTE_SINGLE`;var SB=`tag:yaml.org,2002:`;function CB(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function wB(e,t,n){if(Kz(e)&&(e=e.contents),Qz(e))return e;if(Jz(e)){let t=n.schema[Bz].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new vB(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=SB+t.slice(2));let l=CB(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new xB(e);return c&&(c.node=t),t Line truncated
`)?kB(n,t):n.includes(`
`)?`
`+TB(n,t):(e.endsWith(` `)?``:` `)+n,DB=`flow`,OB=`block`,kB=`quoted`;function AB(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=jB(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
`)n===`block`&&(h=jB(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`+kB(n,t):(e.endsWith(` `)?``:` `)+n,jB=`flow`,MB=`block`,NB=`quoted`;function PB(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=FB(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
`)n===`block`&&(h=FB(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function jB(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
`);r=t,i=t+1,a=e[i]}return r}var MB=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),NB=e=>/^(%|---|\.\.\.)/m.test(e);function PB(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function FB(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(NB(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function FB(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
`);r=t,i=t+1,a=e[i]}return r}var IB=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),LB=e=>/^(%|---|\.\.\.)/m.test(e);function RB(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function zB(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(LB(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:AB(o,a,kB,MB(t,!1))}function IB(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return FB(e,t);let n=t.indent||(NB(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:AB(r,n,DB,MB(t,!1))}function LB(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=FB;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?IB:i&&!t?FB:n?IB:FB}return r(e,t)}var RB;try{RB=RegExp(`(^|(?<!
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:PB(o,a,NB,IB(t,!1))}function BB(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return zB(e,t);let n=t.indent||(LB(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:PB(r,n,jB,IB(t,!1))}function VB(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=zB;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?BB:i&&!t?zB:n?BB:zB}return r(e,t)}var HB;try{HB=RegExp(`(^|(?<!
))
+(?!
|$)`,`g`)}catch{RB=/\n+(?!\n|$)/g}function zB({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return LB(n,r);let l=r.indent||(r.forceBlockIndent||NB(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===_B.BLOCK_FOLDED?!1:t===_B.BLOCK_LITERAL||!PB(n,c,l.length);if(!n)return u?`|
|$)`,`g`)}catch{HB=/\n+(?!\n|$)/g}function UB({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return VB(n,r);let l=r.indent||(r.forceBlockIndent||LB(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===xB.BLOCK_FOLDED?!1:t===xB.BLOCK_LITERAL||!RB(n,c,l.length);if(!n)return u?`|
`:`>
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
`&&(p=p.slice(0,-1)),p.replace(RB,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
`&&(p=p.slice(0,-1)),p.replace(HB,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=MB(r,!0);o!==`folded`&&t!==_B.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=AB(`${v}${e}${p}`,l,OB,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function BB(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
`)||u&&/[[\]{},]/.test(a))return LB(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?LB(a,t):zB(e,t,n,r);if(!s&&!u&&i!==_B.PLAIN&&a.includes(`
`))return zB(e,t,n,r);if(NB(a)){if(c===``)return t.forceBlockIndent=!0,zB(e,t,n,r);if(s&&c===l)return LB(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return LB(a,t)}return s?d:AB(d,c,DB,MB(t,!1))}function VB(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==_B.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=_B.QUOTE_DOUBLE);let c=e=>{switch(e){case _B.BLOCK_FOLDED:case _B.BLOCK_LITERAL:return i||a?LB(o.value,t):zB(o,t,n,r);case _B.QUOTE_DOUBLE:return FB(o.value,t);case _B.QUOTE_SINGLE:return IB(o.value,t);case _B.PLAIN:return BB(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function HB(e,t){let n=Object.assign({blockQuote:!0,commentString:wB,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function UB(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(Gz(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function WB(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(Gz(e)||qz(e))&&e.anchor;a&&sB(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function GB(e,t,n,r){if(Wz(e))return e.toString(t,n,r);if(Vz(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=Jz(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=UB(t.doc.schema.tags,a);let o=WB(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):Gz(a)?VB(a,t,n,r):a.toString(t,n,r);return o?Gz(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function KB({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=Jz(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(qz(e)||!Jz(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||qz(e)||(Gz(e)?e.type===_B.BLOCK_FOLDED||e.type===_B.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=GB(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=EB(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=EB(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=EB(g,n.indent,l(f))));let _,v,y;Jz(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&Gz(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&Kz(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=GB(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${TB(e,n.indent)}`}x===``&&!n.inFlow?S===`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=IB(r,!0);o!==`folded`&&t!==xB.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=PB(`${v}${e}${p}`,l,MB,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function WB(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
`)||u&&/[[\]{},]/.test(a))return VB(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?VB(a,t):UB(e,t,n,r);if(!s&&!u&&i!==xB.PLAIN&&a.includes(`
`))return UB(e,t,n,r);if(LB(a)){if(c===``)return t.forceBlockIndent=!0,UB(e,t,n,r);if(s&&c===l)return VB(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return VB(a,t)}return s?d:PB(d,c,jB,IB(t,!1))}function GB(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==xB.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=xB.QUOTE_DOUBLE);let c=e=>{switch(e){case xB.BLOCK_FOLDED:case xB.BLOCK_LITERAL:return i||a?VB(o.value,t):UB(o,t,n,r);case xB.QUOTE_DOUBLE:return zB(o.value,t);case xB.QUOTE_SINGLE:return BB(o.value,t);case xB.PLAIN:return WB(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function KB(e,t){let n=Object.assign({blockQuote:!0,commentString:OB,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function qB(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(Yz(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function JB(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(Yz(e)||Zz(e))&&e.anchor;a&&dB(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function YB(e,t,n,r){if(Jz(e))return e.toString(t,n,r);if(Gz(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=Qz(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=qB(t.doc.schema.tags,a);let o=JB(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):Yz(a)?GB(a,t,n,r):a.toString(t,n,r);return o?Yz(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function XB({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=Qz(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(Zz(e)||!Qz(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||Zz(e)||(Yz(e)?e.type===xB.BLOCK_FOLDED||e.type===xB.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=YB(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=AB(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=AB(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=AB(g,n.indent,l(f))));let _,v,y;Qz(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&Yz(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&Xz(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=YB(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${kB(e,n.indent)}`}x===``&&!n.inFlow?S===`
`&&y&&(S=`
`):S+=`\n${n.indent}`}else if(!p&&qz(t)){let e=x[0],r=x.indexOf(`
`):S+=`\n${n.indent}`}else if(!p&&Zz(t)){let e=x[0],r=x.indexOf(`
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=EB(g,n.indent,l(y)):h&&i&&i(),g}function qB(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var JB=`<<`,YB={identify:e=>e===JB||typeof e==`symbol`&&e.description===JB,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new _B(Symbol(JB)),{addToJSMap:ZB}),stringify:()=>JB},XB=(e,t)=>(YB.identify(t)||Gz(t)&&(!t.type||t.type===_B.PLAIN)&&YB.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===YB.tag&&e.default);function ZB(e,t,n){let r=$B(e,n);if(Kz(r))for(let n of r.items)QB(e,t,n);else if(Array.isArray(r))for(let n of r)QB(e,t,n);else QB(e,t,r)}function QB(e,t,n){let r=$B(e,n);if(!Uz(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function $B(e,t){return e&&Vz(t)?t.resolve(e.doc,e):t}function eV(e,t,{key:n,value:r}){if(Jz(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(XB(e,n))ZB(e,t,r);else{let i=fB(n,``,e);if(t instanceof Map)t.set(i,fB(r,i,e));else if(t instanceof Set)t.add(i);else{let a=tV(n,i,e),o=fB(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function tV(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(Jz(e)&&n?.doc){let t=HB(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),qB(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function nV(e,t,n){return new rV(bB(e,void 0,n),bB(t,void 0,n))}var rV=class e{constructor(e,t=null){Object.defineProperty(this,Bz,{value:Lz}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return Jz(n)&&(n=n.clone(t)),Jz(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return eV(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?KB(this,e,t,n):JSON.stringify(this)}};function iV(e,t,n){return(t.inFlow??e.flow?oV:aV)(e,t,n)}function aV({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(Jz(i))!d&&i.spaceBefore&&f.push(``),sV(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(Wz(i)){let e=Jz(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),sV(n,f,e.commentBefore,d))}d=!1;let s=GB(i,u,()=>o=null,()=>d=!0);o&&(s+=EB(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=AB(g,n.indent,l(y)):h&&i&&i(),g}function ZB(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var QB=`<<`,$B={identify:e=>e===QB||typeof e==`symbol`&&e.description===QB,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new xB(Symbol(QB)),{addToJSMap:tV}),stringify:()=>QB},eV=(e,t)=>($B.identify(t)||Yz(t)&&(!t.type||t.type===xB.PLAIN)&&$B.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===$B.tag&&e.default);function tV(e,t,n){let r=rV(e,n);if(Xz(r))for(let n of r.items)nV(e,t,n);else if(Array.isArray(r))for(let n of r)nV(e,t,n);else nV(e,t,r)}function nV(e,t,n){let r=rV(e,n);if(!qz(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function rV(e,t){return e&&Gz(t)?t.resolve(e.doc,e):t}function iV(e,t,{key:n,value:r}){if(Qz(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(eV(e,n))tV(e,t,r);else{let i=gB(n,``,e);if(t instanceof Map)t.set(i,gB(r,i,e));else if(t instanceof Set)t.add(i);else{let a=aV(n,i,e),o=gB(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function aV(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(Qz(e)&&n?.doc){let t=KB(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),ZB(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function oV(e,t,n){return new sV(wB(e,void 0,n),wB(t,void 0,n))}var sV=class e{constructor(e,t=null){Object.defineProperty(this,Wz,{value:Vz}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return Qz(n)&&(n=n.clone(t)),Qz(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return iV(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?XB(this,e,t,n):JSON.stringify(this)}};function cV(e,t,n){return(t.inFlow??e.flow?uV:lV)(e,t,n)}function lV({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(Qz(i))!d&&i.spaceBefore&&f.push(``),dV(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(Jz(i)){let e=Qz(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),dV(n,f,e.commentBefore,d))}d=!1;let s=YB(i,u,()=>o=null,()=>d=!0);o&&(s+=AB(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
`}}return e?(p+=`
`+TB(l(e),c),s&&s()):d&&o&&o(),p}function oV({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(Jz(i))i.spaceBefore&&d.push(``),sV(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(Wz(i)){let e=Jz(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),sV(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=Jz(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=GB(i,c,()=>a=null);l||=d.length>u||o.includes(`
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=EB(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function sV({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=TB(t(r),e);n.push(i.trimStart())}}function cV(e,t){let n=Gz(t)?t.value:t;for(let r of e)if(Wz(r)&&(r.key===t||r.key===n||Gz(r.key)&&r.key.value===n))return r}var lV=class extends CB{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(Iz,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(nV(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=Wz(e)?e:!e||typeof e!=`object`||!(`key`in e)?new rV(e,e?.value):new rV(e.key,e.value);let r=cV(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);Gz(r.value)&&gB(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=cV(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=cV(this.items,e)?.value;return(!t&&Gz(n)?n.value:n)??void 0}has(e){return!!cV(this.items,e)}set(e,t){this.add(new rV(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)eV(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!Wz(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),iV(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},uV={collection:`map`,default:!0,nodeClass:lV,tag:`tag:yaml.org,2002:map`,resolve(e,t){return Uz(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>lV.from(e,t,n)},dV=class extends CB{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(zz,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=fV(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=fV(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&Gz(r)?r.value:r}has(e){let t=fV(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=fV(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];Gz(r)&&gB(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(fB(e,String(r++),t));return n}toString(e,t,n){return e?iV(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(bB(a,void 0,n))}}return i}};function fV(e){let t=Gz(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var pV={collection:`seq`,default:!0,nodeClass:dV,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return Kz(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>dV.from(e,t,n)},mV={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),VB(e,t,n,r)}},hV={identify:e=>e==null,createNode:()=>new _B(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new _B(null),stringify:({source:e},t)=>typeof e==`string`&&hV.test.test(e)?e:t.options.nullStr},gV={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new _B(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&gV.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function _V({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var vV={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:_V},yV={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),string Line truncated
`:` `)}return VB({comment:e,type:t,value:s},r,i,a)}};function NV(e,t){if(Kz(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Wz(r)){if(Uz(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new rV(new _B(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=Wz(r)?r:new rV(r)}}else t(`Expected a sequence for this tag`);return e}function PV(e,t,n){let{replacer:r}=n,i=new dV(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(nV(o,s,n))}return i}var FV={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:NV,createNode:PV},IV=class e extends dV{constructor(){super(),this.add=lV.prototype.add.bind(this),this.delete=lV.prototype.delete.bind(this),this.get=lV.prototype.get.bind(this),this.has=lV.prototype.has.bind(this),this.set=lV.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(Wz(e)?(r=fB(e.key,``,t),i=fB(e.value,r,t)):r=fB(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=PV(e,t,n),i=new this;return i.items=r.items,i}};IV.tag=`tag:yaml.org,2002:omap`;var LV={collection:`seq`,identify:e=>e instanceof Map,nodeClass:IV,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=NV(e,t),r=[];for(let{key:e}of n.items)Gz(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new IV,n)},createNode:(e,t,n)=>IV.from(e,t,n)};function RV({value:e,source:t},n){return t&&(e?zV:BV).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var zV={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new _B(!0),stringify:RV},BV={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new _B(!1),stringify:RV},VV={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:_V},HV={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():_V(e)}},UV={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new _B(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:_V},WV=e=>typeof e==`bigint`||Number.isInteger(e);function GV(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function KV(e,t,n){let{value:r}=e;if(WV(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return _V(e)}var qV={identify:WV,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>GV(e,2,2,n),stringify:e=>KV(e,2,`0b`)},JV={identify:WV,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>GV(e,1,8,n),stringify:e=>KV(e,8,`0`)},YV={identify:WV,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>GV(e,0,10,n),stringify:_V},XV={identify:WV,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>GV(e,2,16,n),stringify:e=>KV(e,16,`0x`)},ZV=class e extends lV{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=Wz(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new rV(e.key,null):new rV(e,null),cV(this.items,t.key)||this.items.push(t)}get(e,t){let n=cV(this.items,e);return!t&&Wz(n)?Gz(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=cV(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new rV(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return s Line truncated
`)?(n.push(`...`),n.push(TB(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(TB(a(t),``)))}return n.join(`
`+kB(l(e),c),s&&s()):d&&o&&o(),p}function uV({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(Qz(i))i.spaceBefore&&d.push(``),dV(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(Jz(i)){let e=Qz(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),dV(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=Qz(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=YB(i,c,()=>a=null);l||=d.length>u||o.includes(`
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=AB(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function dV({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=kB(t(r),e);n.push(i.trimStart())}}function fV(e,t){let n=Yz(t)?t.value:t;for(let r of e)if(Jz(r)&&(r.key===t||r.key===n||Yz(r.key)&&r.key.value===n))return r}var pV=class extends DB{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(Bz,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(oV(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=Jz(e)?e:!e||typeof e!=`object`||!(`key`in e)?new sV(e,e?.value):new sV(e.key,e.value);let r=fV(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);Yz(r.value)&&bB(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=fV(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=fV(this.items,e)?.value;return(!t&&Yz(n)?n.value:n)??void 0}has(e){return!!fV(this.items,e)}set(e,t){this.add(new sV(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)iV(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!Jz(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),cV(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},mV={collection:`map`,default:!0,nodeClass:pV,tag:`tag:yaml.org,2002:map`,resolve(e,t){return qz(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>pV.from(e,t,n)},hV=class extends DB{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(Uz,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=gV(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=gV(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&Yz(r)?r.value:r}has(e){let t=gV(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=gV(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];Yz(r)&&bB(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(gB(e,String(r++),t));return n}toString(e,t,n){return e?cV(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(wB(a,void 0,n))}}return i}};function gV(e){let t=Yz(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var _V={collection:`seq`,default:!0,nodeClass:hV,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return Xz(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>hV.from(e,t,n)},vV={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),GB(e,t,n,r)}},yV={identify:e=>e==null,createNode:()=>new xB(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new xB(null),stringify:({source:e},t)=>typeof e==`string`&&yV.test.test(e)?e:t.options.nullStr},bV={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new xB(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&bV.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function xV({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var SV={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:xV},CV={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),string Line truncated
`:` `)}return GB({comment:e,type:t,value:s},r,i,a)}};function LV(e,t){if(Xz(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Jz(r)){if(qz(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new sV(new xB(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=Jz(r)?r:new sV(r)}}else t(`Expected a sequence for this tag`);return e}function RV(e,t,n){let{replacer:r}=n,i=new hV(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(oV(o,s,n))}return i}var zV={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:LV,createNode:RV},BV=class e extends hV{constructor(){super(),this.add=pV.prototype.add.bind(this),this.delete=pV.prototype.delete.bind(this),this.get=pV.prototype.get.bind(this),this.has=pV.prototype.has.bind(this),this.set=pV.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(Jz(e)?(r=gB(e.key,``,t),i=gB(e.value,r,t)):r=gB(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=RV(e,t,n),i=new this;return i.items=r.items,i}};BV.tag=`tag:yaml.org,2002:omap`;var VV={collection:`seq`,identify:e=>e instanceof Map,nodeClass:BV,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=LV(e,t),r=[];for(let{key:e}of n.items)Yz(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new BV,n)},createNode:(e,t,n)=>BV.from(e,t,n)};function HV({value:e,source:t},n){return t&&(e?UV:WV).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var UV={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new xB(!0),stringify:HV},WV={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new xB(!1),stringify:HV},GV={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:xV},KV={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():xV(e)}},qV={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new xB(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:xV},JV=e=>typeof e==`bigint`||Number.isInteger(e);function YV(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function XV(e,t,n){let{value:r}=e;if(JV(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return xV(e)}var ZV={identify:JV,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>YV(e,2,2,n),stringify:e=>XV(e,2,`0b`)},QV={identify:JV,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>YV(e,1,8,n),stringify:e=>XV(e,8,`0`)},$V={identify:JV,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>YV(e,0,10,n),stringify:xV},eH={identify:JV,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>YV(e,2,16,n),stringify:e=>XV(e,16,`0x`)},tH=class e extends pV{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=Jz(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new sV(e.key,null):new sV(e,null),fV(this.items,t.key)||this.items.push(t)}get(e,t){let n=fV(this.items,e);return!t&&Jz(n)?Yz(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=fV(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new sV(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return s Line truncated
`)?(n.push(`...`),n.push(kB(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(kB(a(t),``)))}return n.join(`
`)+`
`}var fH=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Bz,{value:Fz});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new oB({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[Bz]:{value:Fz}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Jz(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){pH(this.contents)&&this.contents.add(e)}addIn(e,t){pH(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=cB(this);e.anchor=!t||n.has(t)?lB(t||`a`,n):t}return new mB(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=uB(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=bB(e,l,p);return o&&qz(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new rV(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return pH(this.contents)?this.contents.delete(e):!1}deleteIn(e){return SB(e)?this.contents!=null&&(this.contents=null,!0):pH(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return qz(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return SB(e)?!t&&Gz(this.contents)?this.contents.value:this.contents:qz(this.contents)?this.contents.getIn(e,t):void 0}has(e){return qz(this.contents)?this.contents.has(e):!1}hasIn(e){return SB(e)?this.contents!==void 0:qz(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=xB(this.schema,[e],t):pH(this.contents)&&this.contents.set(e,t)}setIn(e,t){SB(e)?this.contents=t:this.contents==null?this.contents=xB(this.schema,Array.from(e),t):pH(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new oB({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new oB({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new uH(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=fB(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?dB(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return dH(this,e)}};function pH(e){if(qz(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var mH=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},hH=class extends mH{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},gH=class extends mH{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},_H=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function vH(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],ee=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:ee,start:x??ee}}function yH(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(yH(t.key)||yH(t.value))return!0}return!1;default:return!0}}function bH(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&yH(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function xH(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||Gz(e)&&Gz(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var SH=`All mapping items must start at the same column`;function CH({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??lV)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=vH(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,SH)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||yH(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,SH);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&bH(r.indent,u,i),n.atKey=!1,xH(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=vH(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&bH(r.indent,f,i),s=c.range[2];let l=new rV(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let e=new rV(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function wH({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??dV)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=vH(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&bH(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function TH(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var EH=`Block collections are not allowed within flow collections`,DH=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function OH({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?lV:dV))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=vH(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&yH(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];Wz(t)&&(t=t.value??t.key),t.comment?t.comment+=`
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],DH(m)&&i(r.range,`BLOCK_IN_FLOW`,EH)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);DH(f)&&i(g.range,`BLOCK_IN_FLOW`,EH),n.atKey=!1;let _=vH(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?DH(m)&&i(v.range,`BLOCK_IN_FLOW`,EH):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new rV(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;xH(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new lV(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=TH(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function kH(e,t,n,r,i,a){let o=n.type===`block-map`?CH(e,t,n,r,a):n.type===`block-seq`?wH(e,t,n,r,a):OH(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function AH(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===lV.tagName&&s===`map`||o===dV.tagName&&s===`seq`)return kH(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),kH(e,t,n,i,o)}let l=kH(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=Jz(u)?u:new _B(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function jH(e,t,n){let r=t.offset,i=MH(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?_B.BLOCK_FOLDED:_B.BLOCK_LITERAL,o=t.source?NH(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
`}var gH=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Wz,{value:zz});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new uB({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[Wz]:{value:zz}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Qz(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){_H(this.contents)&&this.contents.add(e)}addIn(e,t){_H(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=fB(this);e.anchor=!t||n.has(t)?pB(t||`a`,n):t}return new vB(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=mB(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=wB(e,l,p);return o&&Zz(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new sV(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return _H(this.contents)?this.contents.delete(e):!1}deleteIn(e){return EB(e)?this.contents!=null&&(this.contents=null,!0):_H(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Zz(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return EB(e)?!t&&Yz(this.contents)?this.contents.value:this.contents:Zz(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Zz(this.contents)?this.contents.has(e):!1}hasIn(e){return EB(e)?this.contents!==void 0:Zz(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=TB(this.schema,[e],t):_H(this.contents)&&this.contents.set(e,t)}setIn(e,t){EB(e)?this.contents=t:this.contents==null?this.contents=TB(this.schema,Array.from(e),t):_H(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new uB({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new uB({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new mH(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=gB(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?hB(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return hH(this,e)}};function _H(e){if(Zz(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var vH=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},yH=class extends vH{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},bH=class extends vH{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},xH=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function SH(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],ee=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:ee,start:x??ee}}function CH(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(CH(t.key)||CH(t.value))return!0}return!1;default:return!0}}function wH(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&CH(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function TH(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||Yz(e)&&Yz(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var EH=`All mapping items must start at the same column`;function DH({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??pV)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=SH(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,EH)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||CH(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,EH);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&wH(r.indent,u,i),n.atKey=!1,TH(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=SH(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&wH(r.indent,f,i),s=c.range[2];let l=new sV(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let e=new sV(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function OH({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??hV)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=SH(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&wH(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function kH(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var AH=`Block collections are not allowed within flow collections`,jH=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function MH({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?pV:hV))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=SH(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&CH(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];Jz(t)&&(t=t.value??t.key),t.comment?t.comment+=`
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],jH(m)&&i(r.range,`BLOCK_IN_FLOW`,AH)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);jH(f)&&i(g.range,`BLOCK_IN_FLOW`,AH),n.atKey=!1;let _=SH(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?jH(m)&&i(v.range,`BLOCK_IN_FLOW`,AH):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new sV(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;TH(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new pV(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=kH(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function NH(e,t,n,r,i,a){let o=n.type===`block-map`?DH(e,t,n,r,a):n.type===`block-seq`?OH(e,t,n,r,a):MH(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function PH(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===pV.tagName&&s===`map`||o===hV.tagName&&s===`seq`)return NH(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),NH(e,t,n,i,o)}let l=NH(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=Qz(u)?u:new xB(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function FH(e,t,n){let r=t.offset,i=IH(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?xB.BLOCK_FOLDED:xB.BLOCK_LITERAL,o=t.source?LH(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===_B.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===xB.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`):t.length>c||r[0]===` `?(f===` `?f=`
`:!p&&f===`
`&&(f=`
@@ -77,59 +77,59 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
`+o[e][0].slice(c);d[d.length-1]!==`
`&&(d+=`
`);break;default:d+=`
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function MH({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function NH(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function PH(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=_B.PLAIN,c=FH(a,l);break;case`single-quoted-scalar`:s=_B.QUOTE_SINGLE,c=IH(a,l);break;case`double-quoted-scalar`:s=_B.QUOTE_DOUBLE,c=RH(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=TH(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function FH(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),LH(e)}function IH(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),LH(e.slice(1,-1)).replace(/''/g,`'`)}function LH(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function IH({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function LH(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function RH(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=xB.PLAIN,c=zH(a,l);break;case`single-quoted-scalar`:s=xB.QUOTE_SINGLE,c=BH(a,l);break;case`double-quoted-scalar`:s=xB.QUOTE_DOUBLE,c=HH(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=kH(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function zH(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),VH(e)}function BH(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),VH(e.slice(1,-1)).replace(/''/g,`'`)}function VH(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
`?a+=o:o=`
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function RH(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function HH(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
`){if(i===`
`){let{fold:t,offset:i}=zH(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=BH[i];if(a)n+=a;else if(i===`
`){let{fold:t,offset:i}=UH(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=WH[i];if(a)n+=a;else if(i===`
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=VH(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=GH(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
`&&(a!==`\r`||e[r+2]!==`
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function zH(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function UH(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
`||r===`\r`)&&(r!==`\r`||e[t+2]===`
`);)r===`
`&&(n+=`
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var BH={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function VH(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function HH(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?jH(e,t,r):PH(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[Rz]:c?UH(e.schema,i,c,n,r):t.type===`scalar`?WH(e,i,t,r):e.schema[Rz];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=Gz(a)?a:new _B(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new _B(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function UH(e,t,n,r,i){if(n===`!`)return e[Rz];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[Rz])}function WH({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[Rz];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[Rz];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function GH(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var KH={composeNode:qH,composeEmptyNode:JH};function qH(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=YH(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=HH(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=AH(KH,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=JH(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!Gz(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function JH(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=HH(e,{type:`scalar`,offset:GH(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function YH({options:e},{offset:t,source:n,end:r},i){let a=new mB(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=TH(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function XH(e,t,{offset:n,start:r,value:i,end:a},o){let s=new fH(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=vH(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?qH(c,i,l,o):JH(c,l.end,r,null,l,o);let u=s.contents.range[2],d=TH(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function ZH(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function QH(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var WH={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function GH(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function KH(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?FH(e,t,r):RH(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[Hz]:c?qH(e.schema,i,c,n,r):t.type===`scalar`?JH(e,i,t,r):e.schema[Hz];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=Yz(a)?a:new xB(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new xB(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function qH(e,t,n,r,i){if(n===`!`)return e[Hz];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[Hz])}function JH({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[Hz];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[Hz];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function YH(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var XH={composeNode:ZH,composeEmptyNode:QH};function ZH(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=$H(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=KH(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=PH(XH,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=QH(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!Yz(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function QH(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=KH(e,{type:`scalar`,offset:YH(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function $H({options:e},{offset:t,source:n,end:r},i){let a=new vB(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=kH(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function eU(e,t,{offset:n,start:r,value:i,end:a},o){let s=new gH(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=SH(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?ZH(c,i,l,o):QH(c,l.end,r,null,l,o);let u=s.contents.range[2],d=kH(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function tU(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function nU(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
`:`
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var $H=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=ZH(e);r?this.warnings.push(new gH(i,t,n)):this.errors.push(new hH(i,t,n))},this.directives=new oB({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=QH(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(qz(i)&&!i.flow&&i.items.length>0){let e=i.items[0];Wz(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:QH(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=ZH(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=XH(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new hH(ZH(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new hH(ZH(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=TH(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new hH(ZH(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new fH(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},eU=Symbol(`break visit`),tU=Symbol(`skip children`),nU=Symbol(`remove item`);function rU(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),iU(Object.freeze([]),e,t)}rU.BREAK=eU,rU.SKIP=tU,rU.REMOVE=nU,rU.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},rU.parentCollection=(e,t)=>{let n=rU.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function iU(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=iU(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===eU)return eU;else r===nU&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function aU(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var rU=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=tU(e);r?this.warnings.push(new bH(i,t,n)):this.errors.push(new yH(i,t,n))},this.directives=new uB({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=nU(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(Zz(i)&&!i.flow&&i.items.length>0){let e=i.items[0];Jz(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:nU(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=tU(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=eU(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new yH(tU(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new yH(tU(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=kH(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new yH(tU(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new gH(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},iU=Symbol(`break visit`),aU=Symbol(`skip children`),oU=Symbol(`remove item`);function sU(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),cU(Object.freeze([]),e,t)}sU.BREAK=iU,sU.SKIP=aU,sU.REMOVE=oU,sU.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},sU.parentCollection=(e,t)=>{let n=sU.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function cU(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=cU(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===iU)return iU;else r===oU&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function lU(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
`:case`\r
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function oU(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var sU=new Set(`0123456789ABCDEFabcdef`),cU=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),lU=new Set(`,[]{}`),uU=new Set(` ,[]{}
\r `),dU=e=>!e||uU.has(e),fU=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function uU(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var dU=new Set(`0123456789ABCDEFabcdef`),fU=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),pU=new Set(`,[]{}`),mU=new Set(` ,[]{}
\r `),hU=e=>!e||mU.has(e),gU=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
`||t===`\r`&&this.buffer[e+1]===`
`}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
`||!t&&!this.atEnd)return e+n+1}return t===`
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&oU(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&oU(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!oU(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&oU(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(dU),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&oU(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(dU),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||oU(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&uU(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&uU(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!uU(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&uU(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(hU),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&uU(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(hU),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||uU(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
`,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>oU(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>uU(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
`:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
`)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
`,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(oU(r)||e&&lU.has(r))break;t=n}else if(oU(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(uU(r)||e&&pU.has(r))break;t=n}else if(uU(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`?(n+=1,r=`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&lU.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&lU.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(dU),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(oU(n)||t&&lU.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!oU(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(cU.has(t))t=this.buffer[++e];else if(t===`%`&&sU.has(this.buffer[e+1])&&sU.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&pU.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&pU.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(hU),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(uU(n)||t&&pU.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!uU(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(fU.has(t))t=this.buffer[++e];else if(t===`%`&&dU.has(this.buffer[e+1])&&dU.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},pU=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function mU(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function hU(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function gU(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function _U(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function vU(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function yU(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function bU(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!mU(t.start,`explicit-key-ind`)&&!mU(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,gU(t.value)?t.value.end?yU(t.value.end,t.sep):t.value.end=t.sep:yU(t.start,t.sep),delete t.sep)}var xU=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new fU,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=aU(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&bU(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&hU(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.i Line truncated
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},_U=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function vU(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function yU(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function bU(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function xU(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function SU(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function CU(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function wU(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!vU(t.start,`explicit-key-ind`)&&!vU(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,bU(t.value)?t.value.end?CU(t.value.end,t.sep):t.value.end=t.sep:CU(t.start,t.sep),delete t.sep)}var TU=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new gU,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=lU(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&wU(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&yU(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.i Line truncated
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){yU(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(mU(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=vU(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(mU(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(gU(t.key)&&!mU(t.sep,`newline`)){let e=vU(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):mU(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!mU(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){yU(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||mU(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.ite Line truncated
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){CU(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(vU(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=SU(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(vU(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(bU(t.key)&&!vU(t.sep,`newline`)){let e=SU(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):vU(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!vU(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){CU(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||vU(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.ite Line truncated
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=vU(_U(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=vU(_U(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function SU(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new pU||null,prettyErrors:t}}function CU(e,t={}){let{lineCounter:n,prettyErrors:r}=SU(t),i=new xU(n?.addNewLine),a=new $H(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new hH(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(_H(e,n)),o.warnings.forEach(_H(e,n))),o}function wU(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=CU(e,n);if(!i)return null;if(i.warnings.forEach(e=>qB(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function TU(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return Hz(e)&&!r?e.toString(n):new fH(e,r,n).toString(n)}function EU(e,t){let n=new Map;for(let e of t)n.set(e.name,[...n.get(e.name)??[],e]);return{edges:e.edges,nodes:e.nodes.map(e=>{let{stage:t,occurrence:r}=e.data,i=t===void 0?void 0:n.get(t)?.[r??0];return i?{...e,data:{...e.data,run:i}}:e})}}function DU(e,t){let n=e=>e.path&&e.path.length>=2?Number(e.path[1]):-1,r=e.nodes.find(e=>JSON.stringify(e.data.path)===JSON.stringify(t))?.data,i=r?.resume??r?.stage;if(!r||!i)return null;let a=Math.max(-1,...e.nodes.filter(e=>e.data.run).map(e=>n(e.data))),o=n(r);if(o<0||o>a)return null;let s=e.nodes.filter(e=>e.data.path?.length===2).sort((e,t)=>n(e.data)-n(t.data)).map(e=>e.data.resume??e.data.stage??``),c=e=>!!e&&s.filter(t=>t===e).length>1;return c(i)||o>0&&c(s[o-1])?{label:`Add an id to resume here`,from:i,blocked:!0}:{label:o===a?`Resume from here`:`Re-run from here`,from:i}}var OU=140,kU=280,AU={"agent.run":`Agent`,"command.run":`Run commands`,"repo.prepare":`Prepare worktree`,"repo.commit":`Commit`,"repo.open-pr":`Open pull request`,"gate.repository":`Repository gate`,"gate.diff-size":`Diff size gate`,"gate.diff-rules":`Diff rules gate`,"forge.comment":`Comment`,"forge.close-issue":`Close issue`,"human.approve":`Human approval`,"workflow.call":`Call workflow`,"workflow.handoff":`Hand off`,"workflow.finish":`Finish`,"review.pr":`Review pull request`,"review.start-round":`Start review round`,"review.reply":`Reply to review`};function jU(e){return AU[e]??e}var MU=/\{\{\s*steps\.([A-Za-z0-9_-]+)\.[^}]*\}\}/g;function NU(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function PU(e,t){let n=e=>typeof t[e]==`string`?t[e]:``;switch(e){case`agent.run`:return[n(`role`)||`builder`,t.read_only?`read-only`:n(`gate`)?`gated: ${n(`gate`)}`:``].filter(Boolean).join(` · `);case`repo.commit`:return[n(`message`),t.push?`push`:``].filter(Boolean).join(` · `);case`workflow.call`:case`workflow.handoff`:return n(`workflow`);case`workflow.finish`:return n(`status`)||`completed`;case`human.approve`:return n(`then`)?`then ${n(`then`)}`:``;case`gate.repository`:return n(`expect`)===`test-failure`?`tests must fail`:t.repair?`repair if red`:``}return``}function FU(e){for(let t of[`mission`,`message`,`body`,`plan`,`detail`]){let n=e[t];if(typeof n==`string`&&n.trim())return n.replace(/\{\{\s*([^}]+?)\s*\}\}/g,`‹$1›`).split(`
`).find(e=>e.trim())?.trim()}}function IU(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(MU)].map(e=>e[1]))]}function LU(e){let t=CU(e).toJS(),n=NU(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=`start`;r.push({id:s,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Starts when`,type:``,detail:``}});let c=[s],l=1,u=new Map,d=e=>{let t=u.get(e)??0;return u.set(e,t+1),t},f=(e,t,n,i,s,c,l)=>{let u=NU(e)?e:{},f=typeof u.type==`string`?u.type:``,p=NU(u.settings)?u.settings:{},m=typeof u.id==`string`?u.id:``,h=`step-${t}`,g=s?`${s}/${m||f}`:m||f;r.push({id:h,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:m||t,title:m||jU(f),type:f,detail:PU(f,p),summary:FU(p),when:typeof u.when==`string`?u.when:void 0,retry:NU(u.retry)&&typeof u.retry.attempts==`number`?u.retry.attempts:void 0,continues:u.on_failure===`continue`,branch:s,path:l,stage:g,occurrence:d(g),...c?{resume:c}:{}}}),m&&a.set(m,h);for(let e of IU(u.settings,u.when))o.push({from:e,to:h});return h},p=(e,t,n)=>{e.forEach((r,a)=>i.push({id:`flow-${r}-${t}`,source:r,target:t,kind:`flow`,insertAfter:a===e.length-1?n:void 0}))};for(let[e,t]of n.entries()){if(NU(t)&&NU(t.parallel)){let n=Object.entries(t.parallel),r=typeof t.id==`string`?t.id:`parallel`,i=[],a=0;n.forEach(([t,o],s)=>{let u=(s-(n.length-1)/2)*kU,d=c,m=c;(Array.isArray(o)?o:[]).forEach((i,o)=>{let c=f(i,`${e+1}-${t}-${o+1}`,u,(l+o)*OU,t,r,[`steps`,e,`parallel`,t,o]);p(d,c,d===m&&s===n.length-1?e-1:void 0),d=[c],a=Math.max(a,o+1)}),i.push(...d)}),c=i,l+=Math.max(a,1);continue}let n=f(t,String(e+1),0,l*OU,void 0,void 0,[`steps`,e]);p(c,n,e-1),c=[n],l++}r.push({id:`add-end`,type:`add`,position:{x:104,y:l*OU-24},data:{kind:`step`,key:`add`,title:``,type:``,detail:``}}),p(c,`add-end`);for(let{from:e,to:t}of o){let n=a.get(e);n&&(i.some(e=>e.kind===`flow`&&e.source===n&&e.target===t)||i.push({id:`data-${n}-${t}`,source:n,target:t,kind:`data`,label:e,offset:24+14*i.filter(e=>e.kind===`data`).length,sourceHandle:`data-out`,targetHandle:`data-in`}))}return{nodes:r,edges:i}}var RU={agent:sr,command:Jr,repo:Cr,gate:Gr,forge:jr,human:ti,review:xr,workflow:ii},zU={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function BU(e){return RU[e.split(`.`)[0]]??ii}function VU(e){return Object.keys(zU).map(t=>({title:zU[t],icon:RU[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function HU(e,t){let n=CU(e).getIn(t,!0);if(Uz(n))return n.toJSON()}function UU(e,t,n){let r=CU(e);return r.setIn(t,r.createNode(YU(n))),r.toString()}function WU(e,t,n){let r=CU(e),i=r.get(`steps`,!0);if(Kz(i)||(r.set(`steps`,r.createNode([])),i=r.get(`steps`,!0)),!Kz(i))return{source:e,path:[]};let a=Math.min(Math.max(t+1,0),i.items.length);return i.items.splice(a,0,r.createNode({type:n})),{source:r.toString(),path:[`steps`,a]}}function GU(e,t){let n=CU(e),r=n.getIn(t.slice(0,-1),!0),i=t.at(-1);if(!Kz(r)||typeof i!=`number`)return{source:e,path:t};let a=n.createNode(n.getIn(t));return Uz(a)&&a.delete(`id`),r.items.splice(i+1,0,a),{source:n.toString(),path:[...t.slice(0,-1),i+1]}}function KU(e,t){let n=CU(e);n.deleteIn(t);let r=t.slice(0,-1);if(r.length>2){let e=n.getIn(r,!0);Kz(e)&&e.items.length===0&&n.deleteIn(r)}return n.toString()}function qU(e,t,n){let r=CU(e),i=r.getIn(t.slice(0,-1),!0),a=t.at(-1);if(!Kz(i)||typeof a!=`number`)return{source:e,path:t};let o=a+n;if(o<0||o>=i.items.length)return{source:e,path:t};let[s]=i.items.splice(a,1);return i.items.splice(o,0,s),{source:r.toString(),path:[...t.slice(0,-1),o]}}function JU(e,t){let n=CU(e).toJS(),r=Array.isArray(n?.steps)?n.steps:[],i=typeof t[1]==`number`?t[1]:r.length,a=[],o=e=>{if(typeof e!=`object`||!e)return;let t=e;if(typeof t.id==`string`&&a.push(t.id),typeof t.parallel==`object`&&t.parallel!==null)for(let e of Object.values(t.parallel))Array.isArray(e)&&e.forEach(o)};if(r.slice(0,i).forEach(o),t.length===5){let e=r[i]?.parallel?.[t[3]];Array.isArray(e)&&e.slice(0,t[4]).forEach(o)}return a}function YU(e){if(Array.isArray(e))return e.map(YU);if(typeof e!=`object`||!e)return e;let t={};for(let[n,r]of Object.entries(e)){if(r===void 0||r===``||r===null)continue;let e=YU(r);(typeof e!=`object`||!e||Array.isArray(e)||Object.keys(e).length!==0)&&(t[n]=e)}return t}function XU(e,t){let n=CU(e).get(t,!0);return n&&typeof n==`object`&&`toJSON`in n?n.toJSON():CU(e).get(t)}function ZU(e,t,n){let r=CU(e),i=YU({[t]:n})[t];return i===void 0?r.delete(t):r.set(t,r.createNode(i)),r.toString()}function QU(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function $U(e,t=[]){let n=CU(e),r=n.errors[0];if(r)return{ok:!1,message:pW(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!mW(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`string`?i.id.trim():``;if(!a)return{ok:!1,message:`workflow id is required`};le Line truncated
`).map((e,t)=>({number:t+1,text:e,tokens:lW(e)}))}var sW=/^(\s*)(-\s+)?/,cW=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function lW(e){let{code:t,comment:n}=uW(e),r=dW(t);return n&&r.push({text:n,kind:`comment`}),r}function uW(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(t){r===t&&(t=``);continue}if(r===`"`||r===`'`){t=r;continue}if(r===`#`&&(n===0||/\s/.test(e[n-1]??``)))return{code:e.slice(0,n),comment:e.slice(n)}}return{code:e,comment:``}}function dW(e){if(!e)return[];let t=[],n=sW.exec(e);n?.[1]&&t.push({text:n[1],kind:`plain`}),n?.[2]&&t.push({text:n[2],kind:`punct`});let r=e.slice(n?.[0].length??0);if(!r)return t;let i=cW.exec(r);return i?(t.push({text:i[1]??``,kind:`key`}),t.push({text:i[2]??`:`,kind:`punct`}),i[3]&&t.push({text:i[3],kind:`plain`}),[...t,...fW(i[4]??``)]):[...t,...fW(r)]}function fW(e){if(!e)return[];let t=/^("[^"]*"?|'[^']*'?)([\s\S]*)$/.exec(e);if(!t)return[{text:e,kind:`plain`}];let n=[{text:t[1]??``,kind:`string`}];return t[2]&&n.push({text:t[2],kind:`plain`}),n}function pW(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function mW(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function hW(e){return typeof e==`string`&&e.trim()!==``}var gW={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},_W={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},vW={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},yW={class:`min-w-0 flex-1`},bW=[`value`,`placeholder`],xW={class:`truncate font-mono text-[11px] text-fg-subtle`},SW={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},CW={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},wW={key:1,class:`space-y-1.5`},TW=[`title`],EW=[`value`],DW=[`value`],OW={key:3,class:`flex flex-wrap items-center gap-1 pt-0.5`},kW=[`onClick`],AW=[`onClick`],jW={key:2,class:`divide-y divide-border rounded-md border border-border`},MW=[`title`],NW=[`value`,`onChange`],PW=[`value`],FW=[`value`,`onInput`],IW=[`value`,`onFocus`,`onInput`],LW=[`title`],RW={key:0,class:`text-xs text-danger`},zW={class:`space-y-2`},BW={class:`divide-y divide-border rounded-md border border-border`},VW={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},HW=[`value`],UW={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},WW=[`value`],GW={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},KW=[`value`],qW={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},JW={class:`flex items-center border-t border-border px-4 py-2.5`},YW=n({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=M(()=>HU(n.yaml,n.path)??{}),a=M(()=>typeof i.value.type==`string`?i.value.type:``),o=M(()=>n.vocabulary.find(e=>e.name===a.value)),s=M(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),c=M(()=>JU(n.yaml,n.path)),u=M(()=>o.value?.settings&&i.value.settings?iW(i.value.settings,o.value.settings,`settings`):``),d=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],f=/mission|body|detail|plan|rules/;function p(e,t){return t.type===`string`?t.enum?`select`:f.test(e)?`text`:`line`:t.type===`boolean`?`boolean`:t.type===`integer`||t.type===`number`?`number`:t.type===`array`&&t.items?.type===`string`?`lines`:`yaml`}let m=M(()=>{let e=Object.entries(o.value?.settings?.properties??{}).map(([e,t])=>({key:e,schema:t,kind:p(e,t)})),t=e.filter(e=>d.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>d.indexOf(e.key)-d.indexOf(t.key))[0],n=e.filter(e=>e!==t);return{lead:t,compact:n.filter(e=>[`select`,`line`,`number`,`boolean`].includes(e.kind)),long:n.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function h(e){let{id:t,type:i,...a}=e;r(`update:yaml`,UU(n.yaml,n.path,{id:t,type:i,...a}))}function g(e,t){h({...i.value,[e]:t})}function _(e){g(`retry`,{...i.value.retry,...e})}function v(e,t){h({...i.value,settings:{...s.value,[e]:t}})}let y=W(null);function b(e,t){let n=y.value??m.value.lead?.key;if(!n)return;let r=typeof s.value[n]==`string`?s.value[n]:``,i=`{{ steps.${e}.${t} }}`;v(n,r?`${r.trimEnd()} ${i}`:i)}let x=W({});function S(e,t){try{v(e,t.trim()?wU(t):void 0),x.value={...x.value,[e]:``}}catch(t){x.value={...x.value,[e]:String(t.message).split(`
`)[0]}}}let ee=e=>e===void 0?``:TU(e).trimEnd(),w=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),T=e=>typeof s.value[e]==`string`?s.value[e]:``;return(e,t)=>(P(),V(`aside`,gW,[B(`header`,_W,[B(`span`,vW,[(P(),U(ye(F(BU)(a.value)),{class:`size-4`}))]),B(`div`,yW,[B(`input`,{value:i.value.id??``,class:`w-full truncate bg-transparent text-sm font-medium outline-none placeholder:text-fg-subtle focus:underline`,placeholder:F(jU)(a.value),"aria-label":`Step id`,onInput:t[0]||=e=>g(`id`,e.target.value)},null,40,bW),B(`div`,xW,L(a.value),1)]),O(F(q),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:t[1]||=e=>r(`close`)},{default:C(()=>[O(F(oi))]),_:1})]),B(`div`,SW,[u.value?(P(),V(`p`,CW,L(u.value),1)):N(``,!0),m.value.lead?(P(),V(`section`,wW,[B(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:m.value.lead.schema.description},[l(L(w(m.value.lead.key,m.value.lead.schema))+` `,1),m.value.lead.schema.description?(P(),U(F(_r),{key:0,class:`size-3 text-fg-subtle`})):N(``,!0)],8,TW),m.value.lead.kind===`select`?(P(),V(`select`,{key:0,class:`h-9 w-full rounded-md border border-input bg-background px-2`,value:T(m.value.lead.key),onChange:t[2]||=e=>v(m.value.lead.key,e.target.value||void 0)},[t[13]||=B(`option`,{value:``},`Default`,-1),(P(!0),V(R,null,H(m.value.lead.schema.enum,e=>(P(),V(`option`,{key:e,value:e},L(e),9,DW))),128))],40,EW)):m.value.lead.kind===`text`?(P(),U(F(mh),{key:1,"model-value":T(m.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:t[3]||=e=>y.value=m.value.lead.key,"onUpdate:modelValue":t[4]||=e=>v(m.value.lead.key,String(e))},null,8,[`model-value`])):(P(),U(F(J),{key:2,"model-value":T(m.value.lead.key),onFocus:t[5]||=e=>y.value=m.value.lead.key,"onUpdate:modelValue":t[6]||=e=>v(m.value.lead.key,String(e))},null,8,[`model-value`])),c.value.length&&m.value.lead.kind!==`select`?(P(),V(`div`,OW,[t[14]||=B(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(P(!0),V(R,null,H(c.value,e=>(P(),V(R,{key:e},[B(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>b(e,`summary`)},L(e),9,kW),B(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>b(e,`result`)},L(e)+`.result`,9,AW)],64))),128))])):N(``,!0)])):N(``,!0),m.value.compact.length?(P(),V(`section`,jW,[(P(!0),V(R,null,H(m.value.compact,e=>(P(),V(`div`,{key:e.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[B(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:e.schema.description},[l(L(w(e.key,e.schema))+` `,1),e.schema.description?(P(),U(F(_r),{key:0,class:`size-3 text-fg-subtle`})):N(``,!0)],8,MW),e.kind===`boolean`?(P(),U(F(sb),{key:0,"model-value":s.value[e.key]===!0,"onUpdate:modelValue":t=>v(e.key,t||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):e.kind===`select`?(P(),V(`select`,{key:1,class:`h-7 max-w-40 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:T(e.key),onChange:t=>v(e.key,t.target.value||void 0)},[t[15]||=B(`option`,{value:``},`Default`,-1),(P(!0),V(R,null,H(e.schema.enum,e=>(P(),V(`option`,{key:e,value:e},L(e),9,PW))),128))],40,NW)):e.kind===`number`?(P(),V(`input`,{key:2,type:`number`,class:`h-7 w-24 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:s.value[e.key]??``,onInput:t=>v(e.key,t.target.value===``?void 0:Number(t.target.value))},null,40,FW)):(P(),V(`input`,{key:3,class:`h-7 w-40 rounded-md border border-input bg-background px-2 text-[13px]`,value:T(e.key),onFocus:t=>y.value=e.key,onInput:t=>v(e.key,t.target.value)},null,40,IW))]))),128))])):N(``,!0),(P(!0),V(R,null,H(m.value.long,e=>(P(),V(`section`,{key:e.key,class:`space-y-1.5`},[B(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:e.schema.description},[l(L(w(e.key,e.schema))+` `,1),e.schema.description?(P(),U(F(_r),{key:0,class:`size-3 text-fg-subtle`})):N(``,!0)],8,LW),e.kind===`text`?(P(),U(F(mh),{key:0,"model-value":T(e.key),class:`min-h-20 text-[13px]`,onFocus:t=>y.value=e.key,"onUpdate:modelValue":t=>v(e.key,String(t))},null,8,[`model-value`,`onFocus`,`onUpdate:modelValue`])):e.kind===`lines`?(P(),U(F(mh),{key:1,"model-value":Array.isArray(s.value[e.key])?s.value[e.key].join(`
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=SU(xU(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=SU(xU(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function EU(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new _U||null,prettyErrors:t}}function DU(e,t={}){let{lineCounter:n,prettyErrors:r}=EU(t),i=new TU(n?.addNewLine),a=new rU(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new yH(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(xH(e,n)),o.warnings.forEach(xH(e,n))),o}function OU(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=DU(e,n);if(!i)return null;if(i.warnings.forEach(e=>ZB(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function kU(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return Kz(e)&&!r?e.toString(n):new gH(e,r,n).toString(n)}function AU(e,t){let n=new Map;for(let e of t)n.set(e.name,[...n.get(e.name)??[],e]);return{edges:e.edges,nodes:e.nodes.map(e=>{let{stage:t,occurrence:r}=e.data,i=t===void 0?void 0:n.get(t)?.[r??0];return i?{...e,data:{...e.data,run:i}}:e})}}function jU(e,t){let n=e=>e.path&&e.path.length>=2?Number(e.path[1]):-1,r=e.nodes.find(e=>JSON.stringify(e.data.path)===JSON.stringify(t))?.data,i=r?.resume??r?.stage;if(!r||!i)return null;let a=Math.max(-1,...e.nodes.filter(e=>e.data.run).map(e=>n(e.data))),o=n(r);if(o<0||o>a)return null;let s=e.nodes.filter(e=>e.data.path?.length===2).sort((e,t)=>n(e.data)-n(t.data)).map(e=>e.data.resume??e.data.stage??``),c=e=>!!e&&s.filter(t=>t===e).length>1;return c(i)||o>0&&c(s[o-1])?{label:`Add an id to resume here`,from:i,blocked:!0}:{label:o===a?`Resume from here`:`Re-run from here`,from:i}}var MU=140,NU=280,PU={"agent.run":`Agent`,"command.run":`Run commands`,"repo.prepare":`Prepare worktree`,"repo.commit":`Commit`,"repo.open-pr":`Open pull request`,"gate.repository":`Repository gate`,"gate.diff-size":`Diff size gate`,"gate.diff-rules":`Diff rules gate`,"forge.comment":`Comment`,"forge.close-issue":`Close issue`,"human.approve":`Human approval`,"workflow.call":`Call workflow`,"workflow.handoff":`Hand off`,"workflow.finish":`Finish`,"review.pr":`Review pull request`,"review.start-round":`Start review round`,"review.reply":`Reply to review`};function FU(e){return PU[e]??e}var IU=/\{\{\s*steps\.([A-Za-z0-9_-]+)\.[^}]*\}\}/g;function LU(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function RU(e,t){let n=e=>typeof t[e]==`string`?t[e]:``;switch(e){case`agent.run`:return[n(`role`)||`builder`,t.read_only?`read-only`:n(`gate`)?`gated: ${n(`gate`)}`:``].filter(Boolean).join(` · `);case`repo.commit`:return[n(`message`),t.push?`push`:``].filter(Boolean).join(` · `);case`workflow.call`:case`workflow.handoff`:return n(`workflow`);case`workflow.finish`:return n(`status`)||`completed`;case`human.approve`:return n(`then`)?`then ${n(`then`)}`:``;case`gate.repository`:return n(`expect`)===`test-failure`?`tests must fail`:t.repair?`repair if red`:``}return``}function zU(e){for(let t of[`mission`,`message`,`body`,`plan`,`detail`]){let n=e[t];if(typeof n==`string`&&n.trim())return n.replace(/\{\{\s*([^}]+?)\s*\}\}/g,`‹$1›`).split(`
`).find(e=>e.trim())?.trim()}}function BU(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(IU)].map(e=>e[1]))]}function VU(e){let t=DU(e).toJS(),n=LU(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=`start`;r.push({id:s,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Starts when`,type:``,detail:``}});let c=[s],l=1,u=new Map,d=e=>{let t=u.get(e)??0;return u.set(e,t+1),t},f=(e,t,n,i,s,c,l)=>{let u=LU(e)?e:{},f=typeof u.type==`string`?u.type:``,p=LU(u.settings)?u.settings:{},m=typeof u.id==`string`?u.id:``,h=`step-${t}`,g=s?`${s}/${m||f}`:m||f;r.push({id:h,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:m||t,title:m||FU(f),type:f,detail:RU(f,p),summary:zU(p),when:typeof u.when==`string`?u.when:void 0,retry:LU(u.retry)&&typeof u.retry.attempts==`number`?u.retry.attempts:void 0,continues:u.on_failure===`continue`,branch:s,path:l,stage:g,occurrence:d(g),...c?{resume:c}:{}}}),m&&a.set(m,h);for(let e of BU(u.settings,u.when))o.push({from:e,to:h});return h},p=(e,t,n)=>{e.forEach((r,a)=>i.push({id:`flow-${r}-${t}`,source:r,target:t,kind:`flow`,insertAfter:a===e.length-1?n:void 0}))};for(let[e,t]of n.entries()){if(LU(t)&&LU(t.parallel)){let n=Object.entries(t.parallel),r=typeof t.id==`string`?t.id:`parallel`,i=[],a=0;n.forEach(([t,o],s)=>{let u=(s-(n.length-1)/2)*NU,d=c,m=c;(Array.isArray(o)?o:[]).forEach((i,o)=>{let c=f(i,`${e+1}-${t}-${o+1}`,u,(l+o)*MU,t,r,[`steps`,e,`parallel`,t,o]);p(d,c,d===m&&s===n.length-1?e-1:void 0),d=[c],a=Math.max(a,o+1)}),i.push(...d)}),c=i,l+=Math.max(a,1);continue}let n=f(t,String(e+1),0,l*MU,void 0,void 0,[`steps`,e]);p(c,n,e-1),c=[n],l++}r.push({id:`add-end`,type:`add`,position:{x:104,y:l*MU-24},data:{kind:`step`,key:`add`,title:``,type:``,detail:``}}),p(c,`add-end`);for(let{from:e,to:t}of o){let n=a.get(e);n&&(i.some(e=>e.kind===`flow`&&e.source===n&&e.target===t)||i.push({id:`data-${n}-${t}`,source:n,target:t,kind:`data`,label:e,offset:24+14*i.filter(e=>e.kind===`data`).length,sourceHandle:`data-out`,targetHandle:`data-in`}))}return{nodes:r,edges:i}}var HU={agent:sr,command:Jr,repo:Cr,gate:Gr,forge:jr,human:ti,review:xr,workflow:ii},UU={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function WU(e){return HU[e.split(`.`)[0]]??ii}function GU(e){return Object.keys(UU).map(t=>({title:UU[t],icon:HU[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function KU(e,t){let n=DU(e).getIn(t,!0);if(qz(n))return n.toJSON()}function qU(e,t,n){let r=DU(e);return r.setIn(t,r.createNode($U(n))),r.toString()}function JU(e,t,n){let r=DU(e),i=r.get(`steps`,!0);if(Xz(i)||(r.set(`steps`,r.createNode([])),i=r.get(`steps`,!0)),!Xz(i))return{source:e,path:[]};let a=Math.min(Math.max(t+1,0),i.items.length);return i.items.splice(a,0,r.createNode({type:n})),{source:r.toString(),path:[`steps`,a]}}function YU(e,t){let n=DU(e),r=n.getIn(t.slice(0,-1),!0),i=t.at(-1);if(!Xz(r)||typeof i!=`number`)return{source:e,path:t};let a=n.createNode(n.getIn(t));return qz(a)&&a.delete(`id`),r.items.splice(i+1,0,a),{source:n.toString(),path:[...t.slice(0,-1),i+1]}}function XU(e,t){let n=DU(e);n.deleteIn(t);let r=t.slice(0,-1);if(r.length>2){let e=n.getIn(r,!0);Xz(e)&&e.items.length===0&&n.deleteIn(r)}return n.toString()}function ZU(e,t,n){let r=DU(e),i=r.getIn(t.slice(0,-1),!0),a=t.at(-1);if(!Xz(i)||typeof a!=`number`)return{source:e,path:t};let o=a+n;if(o<0||o>=i.items.length)return{source:e,path:t};let[s]=i.items.splice(a,1);return i.items.splice(o,0,s),{source:r.toString(),path:[...t.slice(0,-1),o]}}function QU(e,t){let n=DU(e).toJS(),r=Array.isArray(n?.steps)?n.steps:[],i=typeof t[1]==`number`?t[1]:r.length,a=[],o=e=>{if(typeof e!=`object`||!e)return;let t=e;if(typeof t.id==`string`&&a.push(t.id),typeof t.parallel==`object`&&t.parallel!==null)for(let e of Object.values(t.parallel))Array.isArray(e)&&e.forEach(o)};if(r.slice(0,i).forEach(o),t.length===5){let e=r[i]?.parallel?.[t[3]];Array.isArray(e)&&e.slice(0,t[4]).forEach(o)}return a}function $U(e){if(Array.isArray(e))return e.map($U);if(typeof e!=`object`||!e)return e;let t={};for(let[n,r]of Object.entries(e)){if(r===void 0||r===``||r===null)continue;let e=$U(r);(typeof e!=`object`||!e||Array.isArray(e)||Object.keys(e).length!==0)&&(t[n]=e)}return t}function eW(e,t){let n=DU(e).get(t,!0);return n&&typeof n==`object`&&`toJSON`in n?n.toJSON():DU(e).get(t)}function tW(e,t,n){let r=DU(e),i=$U({[t]:n})[t];return i===void 0?r.delete(t):r.set(t,r.createNode(i)),r.toString()}function nW(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function rW(e,t=[]){let n=DU(e),r=n.errors[0];if(r)return{ok:!1,message:_W(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!vW(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`string`?i.id.trim():``;if(!a)return{ok:!1,message:`workflow id is required`};le Line truncated
`).map((e,t)=>({number:t+1,text:e,tokens:pW(e)}))}var dW=/^(\s*)(-\s+)?/,fW=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function pW(e){let{code:t,comment:n}=mW(e),r=hW(t);return n&&r.push({text:n,kind:`comment`}),r}function mW(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(t){r===t&&(t=``);continue}if(r===`"`||r===`'`){t=r;continue}if(r===`#`&&(n===0||/\s/.test(e[n-1]??``)))return{code:e.slice(0,n),comment:e.slice(n)}}return{code:e,comment:``}}function hW(e){if(!e)return[];let t=[],n=dW.exec(e);n?.[1]&&t.push({text:n[1],kind:`plain`}),n?.[2]&&t.push({text:n[2],kind:`punct`});let r=e.slice(n?.[0].length??0);if(!r)return t;let i=fW.exec(r);return i?(t.push({text:i[1]??``,kind:`key`}),t.push({text:i[2]??`:`,kind:`punct`}),i[3]&&t.push({text:i[3],kind:`plain`}),[...t,...gW(i[4]??``)]):[...t,...gW(r)]}function gW(e){if(!e)return[];let t=/^("[^"]*"?|'[^']*'?)([\s\S]*)$/.exec(e);if(!t)return[{text:e,kind:`plain`}];let n=[{text:t[1]??``,kind:`string`}];return t[2]&&n.push({text:t[2],kind:`plain`}),n}function _W(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function vW(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function yW(e){return typeof e==`string`&&e.trim()!==``}var bW={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},xW={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},SW={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},CW={class:`min-w-0 flex-1`},wW=[`value`,`placeholder`],TW={class:`truncate font-mono text-[11px] text-fg-subtle`},EW={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},DW={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},OW={key:1,class:`space-y-1.5`},kW=[`title`],AW=[`value`],jW=[`value`],MW={key:3,class:`flex flex-wrap items-center gap-1 pt-0.5`},NW=[`onClick`],PW=[`onClick`],FW={key:2,class:`divide-y divide-border rounded-md border border-border`},IW=[`title`],LW=[`value`,`onChange`],RW=[`value`],zW=[`value`,`onInput`],BW=[`value`,`onFocus`,`onInput`],VW=[`title`],HW={key:0,class:`text-xs text-danger`},UW={class:`space-y-2`},WW={class:`divide-y divide-border rounded-md border border-border`},GW={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},KW=[`value`],qW={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},JW=[`value`],YW={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},XW=[`value`],ZW={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},QW={class:`flex items-center border-t border-border px-4 py-2.5`},$W=n({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=M(()=>KU(n.yaml,n.path)??{}),a=M(()=>typeof i.value.type==`string`?i.value.type:``),o=M(()=>n.vocabulary.find(e=>e.name===a.value)),s=M(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),c=M(()=>QU(n.yaml,n.path)),u=M(()=>o.value?.settings&&i.value.settings?cW(i.value.settings,o.value.settings,`settings`):``),d=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],f=/mission|body|detail|plan|rules/;function p(e,t){return t.type===`string`?t.enum?`select`:f.test(e)?`text`:`line`:t.type===`boolean`?`boolean`:t.type===`integer`||t.type===`number`?`number`:t.type===`array`&&t.items?.type===`string`?`lines`:`yaml`}let m=M(()=>{let e=Object.entries(o.value?.settings?.properties??{}).map(([e,t])=>({key:e,schema:t,kind:p(e,t)})),t=e.filter(e=>d.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>d.indexOf(e.key)-d.indexOf(t.key))[0],n=e.filter(e=>e!==t);return{lead:t,compact:n.filter(e=>[`select`,`line`,`number`,`boolean`].includes(e.kind)),long:n.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function h(e){let{id:t,type:i,...a}=e;r(`update:yaml`,qU(n.yaml,n.path,{id:t,type:i,...a}))}function g(e,t){h({...i.value,[e]:t})}function _(e){g(`retry`,{...i.value.retry,...e})}function v(e,t){h({...i.value,settings:{...s.value,[e]:t}})}let y=W(null);function b(e,t){let n=y.value??m.value.lead?.key;if(!n)return;let r=typeof s.value[n]==`string`?s.value[n]:``,i=`{{ steps.${e}.${t} }}`;v(n,r?`${r.trimEnd()} ${i}`:i)}let x=W({});function S(e,t){try{v(e,t.trim()?OU(t):void 0),x.value={...x.value,[e]:``}}catch(t){x.value={...x.value,[e]:String(t.message).split(`
`)[0]}}}let ee=e=>e===void 0?``:kU(e).trimEnd(),w=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),T=e=>typeof s.value[e]==`string`?s.value[e]:``;return(e,t)=>(P(),V(`aside`,bW,[B(`header`,xW,[B(`span`,SW,[(P(),U(ye(F(WU)(a.value)),{class:`size-4`}))]),B(`div`,CW,[B(`input`,{value:i.value.id??``,class:`w-full truncate bg-transparent text-sm font-medium outline-none placeholder:text-fg-subtle focus:underline`,placeholder:F(FU)(a.value),"aria-label":`Step id`,onInput:t[0]||=e=>g(`id`,e.target.value)},null,40,wW),B(`div`,TW,L(a.value),1)]),O(F(q),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:t[1]||=e=>r(`close`)},{default:C(()=>[O(F(oi))]),_:1})]),B(`div`,EW,[u.value?(P(),V(`p`,DW,L(u.value),1)):N(``,!0),m.value.lead?(P(),V(`section`,OW,[B(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:m.value.lead.schema.description},[l(L(w(m.value.lead.key,m.value.lead.schema))+` `,1),m.value.lead.schema.description?(P(),U(F(_r),{key:0,class:`size-3 text-fg-subtle`})):N(``,!0)],8,kW),m.value.lead.kind===`select`?(P(),V(`select`,{key:0,class:`h-9 w-full rounded-md border border-input bg-background px-2`,value:T(m.value.lead.key),onChange:t[2]||=e=>v(m.value.lead.key,e.target.value||void 0)},[t[13]||=B(`option`,{value:``},`Default`,-1),(P(!0),V(R,null,H(m.value.lead.schema.enum,e=>(P(),V(`option`,{key:e,value:e},L(e),9,jW))),128))],40,AW)):m.value.lead.kind===`text`?(P(),U(F(mh),{key:1,"model-value":T(m.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:t[3]||=e=>y.value=m.value.lead.key,"onUpdate:modelValue":t[4]||=e=>v(m.value.lead.key,String(e))},null,8,[`model-value`])):(P(),U(F(J),{key:2,"model-value":T(m.value.lead.key),onFocus:t[5]||=e=>y.value=m.value.lead.key,"onUpdate:modelValue":t[6]||=e=>v(m.value.lead.key,String(e))},null,8,[`model-value`])),c.value.length&&m.value.lead.kind!==`select`?(P(),V(`div`,MW,[t[14]||=B(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(P(!0),V(R,null,H(c.value,e=>(P(),V(R,{key:e},[B(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>b(e,`summary`)},L(e),9,NW),B(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>b(e,`result`)},L(e)+`.result`,9,PW)],64))),128))])):N(``,!0)])):N(``,!0),m.value.compact.length?(P(),V(`section`,FW,[(P(!0),V(R,null,H(m.value.compact,e=>(P(),V(`div`,{key:e.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[B(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:e.schema.description},[l(L(w(e.key,e.schema))+` `,1),e.schema.description?(P(),U(F(_r),{key:0,class:`size-3 text-fg-subtle`})):N(``,!0)],8,IW),e.kind===`boolean`?(P(),U(F(sb),{key:0,"model-value":s.value[e.key]===!0,"onUpdate:modelValue":t=>v(e.key,t||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):e.kind===`select`?(P(),V(`select`,{key:1,class:`h-7 max-w-40 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:T(e.key),onChange:t=>v(e.key,t.target.value||void 0)},[t[15]||=B(`option`,{value:``},`Default`,-1),(P(!0),V(R,null,H(e.schema.enum,e=>(P(),V(`option`,{key:e,value:e},L(e),9,RW))),128))],40,LW)):e.kind===`number`?(P(),V(`input`,{key:2,type:`number`,class:`h-7 w-24 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:s.value[e.key]??``,onInput:t=>v(e.key,t.target.value===``?void 0:Number(t.target.value))},null,40,zW)):(P(),V(`input`,{key:3,class:`h-7 w-40 rounded-md border border-input bg-background px-2 text-[13px]`,value:T(e.key),onFocus:t=>y.value=e.key,onInput:t=>v(e.key,t.target.value)},null,40,BW))]))),128))])):N(``,!0),(P(!0),V(R,null,H(m.value.long,e=>(P(),V(`section`,{key:e.key,class:`space-y-1.5`},[B(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:e.schema.description},[l(L(w(e.key,e.schema))+` `,1),e.schema.description?(P(),U(F(_r),{key:0,class:`size-3 text-fg-subtle`})):N(``,!0)],8,VW),e.kind===`text`?(P(),U(F(mh),{key:0,"model-value":T(e.key),class:`min-h-20 text-[13px]`,onFocus:t=>y.value=e.key,"onUpdate:modelValue":t=>v(e.key,String(t))},null,8,[`model-value`,`onFocus`,`onUpdate:modelValue`])):e.kind===`lines`?(P(),U(F(mh),{key:1,"model-value":Array.isArray(s.value[e.key])?s.value[e.key].join(`
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>v(e.key,String(t).split(`
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(P(),V(R,{key:2},[O(F(mh),{"model-value":ee(s.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>S(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),x.value[e.key]?(P(),V(`span`,RW,L(x.value[e.key]),1)):N(``,!0)],64))]))),128)),B(`section`,zW,[t[21]||=B(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),B(`div`,BW,[B(`label`,VW,[t[16]||=B(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),B(`input`,{class:`h-7 w-48 rounded-md border border-input bg-background px-2 font-mono text-xs`,placeholder:`always`,value:i.value.when??``,onInput:t[7]||=e=>g(`when`,e.target.value)},null,40,HW)]),B(`label`,UW,[t[18]||=B(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),B(`select`,{class:`h-7 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:i.value.on_failure??``,onChange:t[8]||=e=>g(`on_failure`,e.target.value||void 0)},[...t[17]||=[B(`option`,{value:``},`Park the task`,-1),B(`option`,{value:`continue`},`Continue`,-1)]],40,WW)]),B(`label`,GW,[t[19]||=B(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),B(`input`,{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:i.value.retry?.attempts??``,onInput:t[9]||=e=>_({attempts:e.target.value===``?void 0:Number(e.target.value)})},null,40,KW)]),B(`label`,qW,[t[20]||=B(`span`,{class:`flex-1 text-[13px]`},`Retry backoff`,-1),O(F(Xy),{"model-value":i.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":t[10]||=e=>_({backoff:e||void 0})},null,8,[`model-value`])])])])]),B(`footer`,JW,[O(F(q),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:t[11]||=e=>r(`remove`)},{default:C(()=>[O(F(Xr)),t[22]||=l(` Delete step`,-1)]),_:1}),O(F(q),{type:`button`,size:`sm`,class:`ml-auto`,onClick:t[12]||=e=>r(`close`)},{default:C(()=>[...t[23]||=[l(`Done`,-1)]]),_:1})])]))}}),XW=`repository_path`;function ZW(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:XW,path:n.trim(),type:`string`,required:!0}),r}function QW(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function $W(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=QW(Ww(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function eG(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:Ww(e.value,i.type??`string`)})}return n}function tG(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function nG(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...nG(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...nG(n,r)]}):[]}function rG(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function iG(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function aG(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var oG={class:`flex h-full flex-col`},sG={class:`flex items-center gap-2 border-b border-border px-4 py-3`},cG={class:`min-w-0 flex-1 truncate text-sm font-medium`},lG={key:0,class:`flex flex-1 items-center justify-center`},uG={class:`space-y-1.5`},dG=[`disabled`],fG=[`value`],pG={key:1,class:`space-y-1.5`},mG=[`value`],hG=[`title`],gG={class:`space-y-1.5`},_G={id:`bind-paths`},vG=[`value`],yG={class:`divide-y divide-border rounded-md border border-border`},bG={class:`flex items-center gap-1.5 text-xs`},xG={class:`font-mono`},SG={class:`text-fg-subtle`},CG={key:0,class:`text-danger`,title:`Required`},wG=[`title`,`aria-label`,`onClick`],TG=[`onUpdate:modelValue`,`aria-label`],EG=[`onUpdate:modelValue`,`aria-label`],DG={key:2,class:`text-xs text-danger`},OG=[`title`],kG={key:0,class:`space-y-1 px-3 py-2`},AG={key:0,class:`text-xs text-danger`},jG={key:1,class:`truncate font-mono text-xs text-success`},MG={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},NG={class:`space-y-2`},PG={key:0,role:`alert`,class:`text-xs text-danger`},FG={key:1,class:`teLine truncated
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(P(),V(R,{key:2},[O(F(mh),{"model-value":ee(s.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>S(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),x.value[e.key]?(P(),V(`span`,HW,L(x.value[e.key]),1)):N(``,!0)],64))]))),128)),B(`section`,UW,[t[21]||=B(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),B(`div`,WW,[B(`label`,GW,[t[16]||=B(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),B(`input`,{class:`h-7 w-48 rounded-md border border-input bg-background px-2 font-mono text-xs`,placeholder:`always`,value:i.value.when??``,onInput:t[7]||=e=>g(`when`,e.target.value)},null,40,KW)]),B(`label`,qW,[t[18]||=B(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),B(`select`,{class:`h-7 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:i.value.on_failure??``,onChange:t[8]||=e=>g(`on_failure`,e.target.value||void 0)},[...t[17]||=[B(`option`,{value:``},`Park the task`,-1),B(`option`,{value:`continue`},`Continue`,-1)]],40,JW)]),B(`label`,YW,[t[19]||=B(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),B(`input`,{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:i.value.retry?.attempts??``,onInput:t[9]||=e=>_({attempts:e.target.value===``?void 0:Number(e.target.value)})},null,40,XW)]),B(`label`,ZW,[t[20]||=B(`span`,{class:`flex-1 text-[13px]`},`Retry backoff`,-1),O(F(Xy),{"model-value":i.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":t[10]||=e=>_({backoff:e||void 0})},null,8,[`model-value`])])])])]),B(`footer`,QW,[O(F(q),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:t[11]||=e=>r(`remove`)},{default:C(()=>[O(F(Xr)),t[22]||=l(` Delete step`,-1)]),_:1}),O(F(q),{type:`button`,size:`sm`,class:`ml-auto`,onClick:t[12]||=e=>r(`close`)},{default:C(()=>[...t[23]||=[l(`Done`,-1)]]),_:1})])]))}}),eG=`repository_path`;function tG(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:eG,path:n.trim(),type:`string`,required:!0}),r}function nG(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function rG(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=nG(Ww(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function iG(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:Ww(e.value,i.type??`string`)})}return n}function aG(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function oG(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...oG(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...oG(n,r)]}):[]}function sG(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function cG(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function lG(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var uG={class:`flex h-full flex-col`},dG={class:`flex items-center gap-2 border-b border-border px-4 py-3`},fG={class:`min-w-0 flex-1 truncate text-sm font-medium`},pG={key:0,class:`flex flex-1 items-center justify-center`},mG={class:`space-y-1.5`},hG=[`disabled`],gG=[`value`],_G={key:1,class:`space-y-1.5`},vG=[`value`],yG=[`title`],bG={class:`space-y-1.5`},xG={id:`bind-paths`},SG=[`value`],CG={class:`divide-y divide-border rounded-md border border-border`},wG={class:`flex items-center gap-1.5 text-xs`},TG={class:`font-mono`},EG={class:`text-fg-subtle`},DG={key:0,class:`text-danger`,title:`Required`},OG=[`title`,`aria-label`,`onClick`],kG=[`onUpdate:modelValue`,`aria-label`],AG=[`onUpdate:modelValue`,`aria-label`],jG={key:2,class:`text-xs text-danger`},MG=[`title`],NG={key:0,class:`space-y-1 px-3 py-2`},PG={key:0,class:`text-xs text-danger`},FG={key:1,class:`truncate font-mono text-xs text-success`},IG={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},LG={class:`space-y-2`},RG={key:0,role:`alert`,class:`text-xs text-danger`},zG={key:1,class:`teLine truncated
`).replace(`
`,`
+`).split(`
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function O$(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=k$(n.code,e);return Array.isArray(e)?e.some(e=>D$(n[r],e,t,n.type===`keyup`)):D$(n[r],e,t,n.type===`keyup`)}}function k$(e,t){return t.includes(e)?`code`:`key`}function A$(e,t){let n=M(()=>u(t?.target)??w$),r=ge(u(e)===!0),i=!1,a=new Set,o=c(u(e));j(()=>u(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),Sq([`blur`,`contextmenu`],s),wq((...e)=>o(...e),e=>{let n=u(t?.actInsideInputWithModifier)??!0,a=u(t?.preventDefault)??!1;if(i=E$(e),(!i||i&&!n)&&T$(e))return;let o=e.composedPath?.call(e)?.[0]||e.target,s=o?.nodeName===`BUTTON`||o?.nodeName===`A`;!a&&(i||!s)&&e.preventDefault(),r.value=!0},{eventName:`keydown`,target:n}),wq((...e)=>o(...e),e=>{let n=u(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&T$(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=u(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?O$(e,a):e}return r}var j$=`vue-flow__node-desc`,M$=`vue-flow__edge-desc`,N$=`vue-flow__aria-live`,P$=[`Enter`,` `,`Escape`],F$={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function I$(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function L$(e,t){let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function R$(e){return{width:e.offsetWidth,height:e.offsetHeight}}function z$(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function B$(e,t){return{x:z$(e.x,t[0][0],t[1][0]),y:z$(e.y,t[0][1],t[1][1])}}function V$(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function H$(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function U$(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!H$(e)}function W$(e){return U$(e)&&`computedPosition`in e}function G$(e){return!Number.isNaN(e)&&Number.isFinite(e)}function K$(e){return G$(e.width)&&G$(e.height)&&G$(e.x)&&G$(e.y)}function q$(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:bt({width:0,height:0}),computedPosition:bt({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:l0(e.data)?e.data:{},events:bt(l0(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function J$(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:l0(e.data)?e.data:{},events:bt(l0(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function Y$(e,t,n,r){let i=typeof e==`string`?e:e.id,a=new Set,o=r===`source`?`target`:`source`;for(let e of n)e[o]===i&&a.add(e[r]);return t.filter(e=>a.has(e.id))}function X$(...e){if(e.length===3){let[t,n,r]=e;return Y$(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>H$(e)&&e.source===r).map(e=>n.find(t=>U$(t)&&t.id===e.target))}function Z$(...e){if(e.length===3){let[t,n,r]=e;return Y$(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>H$(e)&&e.target===r).map(e=>n.find(t=>U$(t)&&t.id===e.source))}function Q$({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function $$(e,t){return t.some(t=>H$(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function e1({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function t1({x:e,y:t},{x:n,y:r,zoom:i},a=!1,o=[1,1]){let s={x:(e-n)/i,y:(t-r)/i};return a?K1(s,o):s}function n1(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function r1({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function i1({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function a1(e){let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};for(let n=0;n<e.length;n++){let r=e[n];t=n1(t,r1({...r.computedPosition,...r.dimensions}))}return i1(t)}function o1(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...t1(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s=!1}=t,c= Line truncated
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function M$(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=N$(n.code,e);return Array.isArray(e)?e.some(e=>j$(n[r],e,t,n.type===`keyup`)):j$(n[r],e,t,n.type===`keyup`)}}function N$(e,t){return t.includes(e)?`code`:`key`}function P$(e,t){let n=M(()=>u(t?.target)??O$),r=ge(u(e)===!0),i=!1,a=new Set,o=c(u(e));j(()=>u(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),Eq([`blur`,`contextmenu`],s),Oq((...e)=>o(...e),e=>{let n=u(t?.actInsideInputWithModifier)??!0,a=u(t?.preventDefault)??!1;if(i=A$(e),(!i||i&&!n)&&k$(e))return;let o=e.composedPath?.call(e)?.[0]||e.target,s=o?.nodeName===`BUTTON`||o?.nodeName===`A`;!a&&(i||!s)&&e.preventDefault(),r.value=!0},{eventName:`keydown`,target:n}),Oq((...e)=>o(...e),e=>{let n=u(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&k$(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=u(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?M$(e,a):e}return r}var F$=`vue-flow__node-desc`,I$=`vue-flow__edge-desc`,L$=`vue-flow__aria-live`,R$=[`Enter`,` `,`Escape`],z$={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function B$(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function V$(e,t){let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function H$(e){return{width:e.offsetWidth,height:e.offsetHeight}}function U$(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function W$(e,t){return{x:U$(e.x,t[0][0],t[1][0]),y:U$(e.y,t[0][1],t[1][1])}}function G$(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function K$(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function q$(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!K$(e)}function J$(e){return q$(e)&&`computedPosition`in e}function Y$(e){return!Number.isNaN(e)&&Number.isFinite(e)}function X$(e){return Y$(e.width)&&Y$(e.height)&&Y$(e.x)&&Y$(e.y)}function Z$(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:bt({width:0,height:0}),computedPosition:bt({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:p0(e.data)?e.data:{},events:bt(p0(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function Q$(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:p0(e.data)?e.data:{},events:bt(p0(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function $$(e,t,n,r){let i=typeof e==`string`?e:e.id,a=new Set,o=r===`source`?`target`:`source`;for(let e of n)e[o]===i&&a.add(e[r]);return t.filter(e=>a.has(e.id))}function e1(...e){if(e.length===3){let[t,n,r]=e;return $$(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>K$(e)&&e.source===r).map(e=>n.find(t=>q$(t)&&t.id===e.target))}function t1(...e){if(e.length===3){let[t,n,r]=e;return $$(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>K$(e)&&e.target===r).map(e=>n.find(t=>q$(t)&&t.id===e.source))}function n1({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function r1(e,t){return t.some(t=>K$(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function i1({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function a1({x:e,y:t},{x:n,y:r,zoom:i},a=!1,o=[1,1]){let s={x:(e-n)/i,y:(t-r)/i};return a?X1(s,o):s}function o1(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function s1({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function c1({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function l1(e){let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};for(let n=0;n<e.length;n++){let r=e[n];t=o1(t,s1({...r.computedPosition,...r.dimensions}))}return c1(t)}function u1(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...a1(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s=!1}=t,c= Line truncated
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
Node: ${e}
@@ -149,4 +149,4 @@ Edge: ${e}
Source: ${t}
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},B1=class extends Error{constructor(e,...t){super(z1[e]?.call(z1,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function V1(e){return`clientX`in e}function H1(e){return`sourceEvent`in e}function U1(e,t){let n=V1(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var W1=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function G1(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function K1(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var q1=()=>!0;function J1(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function Y1(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())L$(i,I$(e))>0&&r.push(e);return r}var X1=250;function Z1(e,t,n,r){let i=[],a=1/0,o=Y1(e,n,t+X1);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=P1(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function Q1(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=q1},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=U1(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=$1(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===y$.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=n0(t,e,a,p,n,!0)}return b}function $1(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function e0(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function t0(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function n0(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===y$.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...P1(o,c,c.position,!0)}:c}var r0={[g$.Left]:g$.Right,[g$.Right]:g$.Left,[g$.Top]:g$.Bottom,[g$.Bottom]:g$.Top},i0=[`production`,`prod`];function a0(e,...t){o0()&&console.warn(`[Vue Flow]: ${e}`,...t)}function o0(){return!i0.includes(`production`)}function s0(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...R$(t)}}):null}function c0(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),ht(()=>{o.blur()})):n([e])}function l0(e){return F(e)!==void 0}function u0(e,t,n,r){if(!e||!e.source||!e.target)return n(new B1(R1.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=H$(e)?e:{...e,id:Q$(e)},i=J$(i,void 0,r),!$$(i,t)&&i}function d0(e,t,n,r,i){if(!t.source||!t.target)return i(new B1(R1.EDGE_INVALID,e.id)),!1;if(!n)return i(new B1(R1.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?Q$(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function f0(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!U$(o)){n(new B1(R1.NODE_INVALID,o?.id));continue}let s=q$(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new B1(R1.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function p0(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function m0(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;p0(`source`,o,`${r}-${a}--Line truncated
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},W1=class extends Error{constructor(e,...t){super(U1[e]?.call(U1,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function G1(e){return`clientX`in e}function K1(e){return`sourceEvent`in e}function q1(e,t){let n=G1(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var J1=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function Y1(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function X1(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var Z1=()=>!0;function Q1(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function $1(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())V$(i,B$(e))>0&&r.push(e);return r}var e0=250;function t0(e,t,n,r){let i=[],a=1/0,o=$1(e,n,t+e0);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=R1(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function n0(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Z1},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=q1(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=r0(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===C$.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=o0(t,e,a,p,n,!0)}return b}function r0(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function i0(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function a0(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function o0(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===C$.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...R1(o,c,c.position,!0)}:c}var s0={[b$.Left]:b$.Right,[b$.Right]:b$.Left,[b$.Top]:b$.Bottom,[b$.Bottom]:b$.Top},c0=[`production`,`prod`];function l0(e,...t){u0()&&console.warn(`[Vue Flow]: ${e}`,...t)}function u0(){return!c0.includes(`production`)}function d0(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...H$(t)}}):null}function f0(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),ht(()=>{o.blur()})):n([e])}function p0(e){return F(e)!==void 0}function m0(e,t,n,r){if(!e||!e.source||!e.target)return n(new W1(H1.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=K$(e)?e:{...e,id:n1(e)},i=Q$(i,void 0,r),!r1(i,t)&&i}function h0(e,t,n,r,i){if(!t.source||!t.target)return i(new W1(H1.EDGE_INVALID,e.id)),!1;if(!n)return i(new W1(H1.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?n1(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function g0(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!q$(o)){n(new W1(H1.NODE_INVALID,o?.id));continue}let s=Z$(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new W1(H1.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function _0(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function v0(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;_0(`source`,o,`${r}-${a}--Line truncated
+11 -1
View File
@@ -11,7 +11,7 @@ import {
SelectValue,
} from "@/components/ui/select";
import { LOG_LEVELS } from "@/lib/log";
import { componentOptions, filters } from "./state";
import { componentOptions, serviceOptions, filters } from "./state";
/**
* The list's filters: level, component and a search over messages and fields.
@@ -38,6 +38,9 @@ const componentSelectOptions = computed(() => [
...componentOptions.value.map((name) => ({ value: name, label: name })),
]);
const service=computed(()=>filters.service||ALL);
function setService(value:unknown):void{filters.service=value===ALL?"":String(value??"")}
const level = computed(() => filters.level || ALL);
const component = computed(() => filters.component || ALL);
@@ -67,6 +70,13 @@ onUnmounted(() => clearTimeout(searchTimer));
<template>
<div class="flex min-w-0 flex-wrap items-center gap-2">
<Select :model-value="service" @update:model-value="setService">
<SelectTrigger size="sm" class="w-48" aria-label="Service"><SelectValue placeholder="All services" /></SelectTrigger>
<SelectContent><SelectGroup>
<SelectItem :value="ALL">All services</SelectItem>
<SelectItem v-for="name in serviceOptions" :key="name" :value="name">{{ name }}</SelectItem>
</SelectGroup></SelectContent>
</Select>
<Select :model-value="level" @update:model-value="setLevel">
<SelectTrigger size="sm" class="w-44" aria-label="Level">
<SelectValue />
+2
View File
@@ -3,6 +3,7 @@ import { Card, CardContent, CardHeader } from "@/components/ui/card";
import LogFilters from "./LogFilters.vue";
import LogList from "./LogList.vue";
import {serviceErrors} from "./state";
import LogStatus from "./LogStatus.vue";
/** The log surface: the filters and the stream's own state over the lines. */
@@ -19,6 +20,7 @@ import LogStatus from "./LogStatus.vue";
<LogStatus />
</CardHeader>
<CardContent class="px-0">
<p v-for="(error,service) in serviceErrors" :key="service" role="alert" class="px-3 py-2 text-sm text-danger">{{ service }}: {{ error }}</p>
<LogList />
</CardContent>
</Card>
-4
View File
@@ -3,10 +3,6 @@ import LogsHeader from "./LogsHeader.vue";
import LogStream from "./LogStream.vue";
import { useLogs } from "./state";
/**
* The daemon log: the history /api/logs serves with the live stream tailed
* onto it. Composes the page; it holds no state of its own.
*/
useLogs();
</script>
+2
View File
@@ -9,6 +9,7 @@ import type { LogEntry } from "@/lib/log";
/** The filters the list is read through. All three narrow the read
* server-side as well as the live stream locally. */
export interface LogFilters {
service?: string;
level: string;
component: string;
q: string;
@@ -36,6 +37,7 @@ export function matchesFilters(entry: LogEntry, filters: LogFilters): boolean {
) {
return false;
}
if (filters.service && entry.fields?.service !== filters.service) return false;
if (filters.component && entry.fields?.component !== filters.component)
return false;
if (filters.q) {
+21 -5
View File
@@ -25,6 +25,8 @@ import { logsEmptyDetail, logsEmptyTitle } from "./logs-empty";
interface LogHistory {
entries?: LogEntry[];
components?: string[];
services?:string[];
errors?:Record<string,string>;
file?: string;
truncated?: boolean;
/** The process serving the request keeps no durable history. */
@@ -33,12 +35,15 @@ interface LogHistory {
export const filters = reactive<LogFilters>({
level: "",
service:"",
component: "",
q: "",
});
/** The components the filter can name: those the server found, plus any the
* live stream has shown since. */
export const serviceOptions=ref<string[]>([]);
export const serviceErrors=ref<Record<string,string>>({});
export const componentOptions = ref<string[]>([]);
export const paused = ref(false);
export const loading = ref(true);
@@ -69,8 +74,8 @@ export const meta = computed(() => {
if (loading.value) return "Refreshing…";
if (durableUnavailable.value) return "Live only";
if (truncated.value)
return `showing the most recent matches from ${logFile.value}`;
return logFile.value;
return "Showing recent matches; older lines are omitted";
return logFile.value || "Recent service logs; refreshed every 5 seconds";
});
/** The stream's state as a badge kind. Never `ok` for a stream that is still
@@ -89,27 +94,34 @@ export const emptyDetail = computed(() =>
logsEmptyDetail(durableUnavailable.value, streamState.value),
);
let generation=0;
export async function loadLogs(): Promise<void> {
loading.value = true;
const current=++generation;
loading.value = true;
readError.value = null;
try {
const res = await api.logs<LogHistory>({
service:filters.service,
level: filters.level,
component: filters.component,
q: filters.q,
limit: 500,
});
componentOptions.value = res.components ?? [];
if(current!==generation)return;
serviceOptions.value=[...new Set([...serviceOptions.value,...(res.services??[])])].sort();
serviceErrors.value=res.errors??{};
componentOptions.value = res.components ?? [];
durableUnavailable.value = !!res.disabled;
truncated.value = !!res.truncated;
logFile.value = res.file ?? "";
historyEntries.value = res.entries ?? [];
} catch (err) {
if(current!==generation)return;
// The server's own message is the only part of a failure an operator can
// act on, so it is what the list says instead of the lines.
readError.value = (err as Error).message || String(err);
} finally {
loading.value = false;
if(current===generation)loading.value = false;
}
}
@@ -134,6 +146,7 @@ function handleEntry(raw: unknown): void {
liveTick.value += 1;
}
let refresh:ReturnType<typeof setInterval>|undefined;
let unsubscribe: (() => void) | undefined;
/** Owns the initial read, the re-reads a filter change causes, and the live
@@ -151,10 +164,13 @@ export function useLogs(): void {
liveTick.value += 1;
void loadLogs();
refresh=setInterval(()=>{if(!paused.value)void loadLogs()},5000);
unsubscribe = live.subscribe("logs", handleEntry);
streamState.value = live.streamState;
});
onUnmounted(() => {
clearInterval(refresh);
generation++;
unsubscribe?.();
unsubscribe = undefined;
});