@stigmer/cli 3.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/README.md +42 -0
- package/auth/auth0.d.ts +19 -0
- package/auth/auth0.d.ts.map +1 -0
- package/auth/auth0.js +39 -0
- package/auth/auth0.js.map +1 -0
- package/auth/callback-server.d.ts +18 -0
- package/auth/callback-server.d.ts.map +1 -0
- package/auth/callback-server.js +77 -0
- package/auth/callback-server.js.map +1 -0
- package/auth/index.d.ts +5 -0
- package/auth/index.d.ts.map +1 -0
- package/auth/index.js +6 -0
- package/auth/index.js.map +1 -0
- package/auth/login.d.ts +2 -0
- package/auth/login.d.ts.map +1 -0
- package/auth/login.js +56 -0
- package/auth/login.js.map +1 -0
- package/auth/pages.d.ts +7 -0
- package/auth/pages.d.ts.map +1 -0
- package/auth/pages.js +21 -0
- package/auth/pages.js.map +1 -0
- package/auth/pkce.d.ts +7 -0
- package/auth/pkce.d.ts.map +1 -0
- package/auth/pkce.js +22 -0
- package/auth/pkce.js.map +1 -0
- package/auth/token.d.ts +33 -0
- package/auth/token.d.ts.map +1 -0
- package/auth/token.js +111 -0
- package/auth/token.js.map +1 -0
- package/backend.d.ts +5 -0
- package/backend.d.ts.map +1 -0
- package/backend.js +14 -0
- package/backend.js.map +1 -0
- package/cli/stigmer.d.ts +3 -0
- package/cli/stigmer.d.ts.map +1 -0
- package/cli/stigmer.js +14 -0
- package/cli/stigmer.js.map +1 -0
- package/client/client.d.ts +25 -0
- package/client/client.d.ts.map +1 -0
- package/client/client.js +55 -0
- package/client/client.js.map +1 -0
- package/client/index.d.ts +2 -0
- package/client/index.d.ts.map +1 -0
- package/client/index.js +3 -0
- package/client/index.js.map +1 -0
- package/commands/agent-exec-flags.d.ts +30 -0
- package/commands/agent-exec-flags.d.ts.map +1 -0
- package/commands/agent-exec-flags.js +52 -0
- package/commands/agent-exec-flags.js.map +1 -0
- package/commands/apikey/duration.d.ts +2 -0
- package/commands/apikey/duration.d.ts.map +1 -0
- package/commands/apikey/duration.js +30 -0
- package/commands/apikey/duration.js.map +1 -0
- package/commands/apikey/index.d.ts +3 -0
- package/commands/apikey/index.d.ts.map +1 -0
- package/commands/apikey/index.js +118 -0
- package/commands/apikey/index.js.map +1 -0
- package/commands/apply.d.ts +3 -0
- package/commands/apply.d.ts.map +1 -0
- package/commands/apply.js +155 -0
- package/commands/apply.js.map +1 -0
- package/commands/auth/index.d.ts +3 -0
- package/commands/auth/index.d.ts.map +1 -0
- package/commands/auth/index.js +76 -0
- package/commands/auth/index.js.map +1 -0
- package/commands/completion.d.ts +3 -0
- package/commands/completion.d.ts.map +1 -0
- package/commands/completion.js +82 -0
- package/commands/completion.js.map +1 -0
- package/commands/config/backend.d.ts +3 -0
- package/commands/config/backend.d.ts.map +1 -0
- package/commands/config/backend.js +49 -0
- package/commands/config/backend.js.map +1 -0
- package/commands/config/context.d.ts +3 -0
- package/commands/config/context.d.ts.map +1 -0
- package/commands/config/context.js +23 -0
- package/commands/config/context.js.map +1 -0
- package/commands/config/index.d.ts +3 -0
- package/commands/config/index.d.ts.map +1 -0
- package/commands/config/index.js +13 -0
- package/commands/config/index.js.map +1 -0
- package/commands/config/kv.d.ts +3 -0
- package/commands/config/kv.d.ts.map +1 -0
- package/commands/config/kv.js +39 -0
- package/commands/config/kv.js.map +1 -0
- package/commands/connect.d.ts +3 -0
- package/commands/connect.d.ts.map +1 -0
- package/commands/connect.js +56 -0
- package/commands/connect.js.map +1 -0
- package/commands/delete.d.ts +3 -0
- package/commands/delete.d.ts.map +1 -0
- package/commands/delete.js +41 -0
- package/commands/delete.js.map +1 -0
- package/commands/diff.d.ts +3 -0
- package/commands/diff.d.ts.map +1 -0
- package/commands/diff.js +87 -0
- package/commands/diff.js.map +1 -0
- package/commands/down.d.ts +3 -0
- package/commands/down.d.ts.map +1 -0
- package/commands/down.js +23 -0
- package/commands/down.js.map +1 -0
- package/commands/download.d.ts +3 -0
- package/commands/download.d.ts.map +1 -0
- package/commands/download.js +46 -0
- package/commands/download.js.map +1 -0
- package/commands/draft.d.ts +3 -0
- package/commands/draft.d.ts.map +1 -0
- package/commands/draft.js +97 -0
- package/commands/draft.js.map +1 -0
- package/commands/execution/approve.d.ts +3 -0
- package/commands/execution/approve.d.ts.map +1 -0
- package/commands/execution/approve.js +60 -0
- package/commands/execution/approve.js.map +1 -0
- package/commands/execution/control.d.ts +3 -0
- package/commands/execution/control.d.ts.map +1 -0
- package/commands/execution/control.js +57 -0
- package/commands/execution/control.js.map +1 -0
- package/commands/execution/index.d.ts +3 -0
- package/commands/execution/index.d.ts.map +1 -0
- package/commands/execution/index.js +21 -0
- package/commands/execution/index.js.map +1 -0
- package/commands/execution/logs.d.ts +3 -0
- package/commands/execution/logs.d.ts.map +1 -0
- package/commands/execution/logs.js +34 -0
- package/commands/execution/logs.js.map +1 -0
- package/commands/execution/trace.d.ts +3 -0
- package/commands/execution/trace.d.ts.map +1 -0
- package/commands/execution/trace.js +24 -0
- package/commands/execution/trace.js.map +1 -0
- package/commands/get.d.ts +3 -0
- package/commands/get.d.ts.map +1 -0
- package/commands/get.js +81 -0
- package/commands/get.js.map +1 -0
- package/commands/internal-daemon.d.ts +3 -0
- package/commands/internal-daemon.d.ts.map +1 -0
- package/commands/internal-daemon.js +22 -0
- package/commands/internal-daemon.js.map +1 -0
- package/commands/list.d.ts +3 -0
- package/commands/list.d.ts.map +1 -0
- package/commands/list.js +117 -0
- package/commands/list.js.map +1 -0
- package/commands/logs.d.ts +3 -0
- package/commands/logs.d.ts.map +1 -0
- package/commands/logs.js +59 -0
- package/commands/logs.js.map +1 -0
- package/commands/mcp-server.d.ts +22 -0
- package/commands/mcp-server.d.ts.map +1 -0
- package/commands/mcp-server.js +104 -0
- package/commands/mcp-server.js.map +1 -0
- package/commands/push.d.ts +3 -0
- package/commands/push.d.ts.map +1 -0
- package/commands/push.js +150 -0
- package/commands/push.js.map +1 -0
- package/commands/reset.d.ts +3 -0
- package/commands/reset.d.ts.map +1 -0
- package/commands/reset.js +45 -0
- package/commands/reset.js.map +1 -0
- package/commands/resume.d.ts +3 -0
- package/commands/resume.d.ts.map +1 -0
- package/commands/resume.js +87 -0
- package/commands/resume.js.map +1 -0
- package/commands/run.d.ts +3 -0
- package/commands/run.d.ts.map +1 -0
- package/commands/run.js +193 -0
- package/commands/run.js.map +1 -0
- package/commands/search.d.ts +3 -0
- package/commands/search.d.ts.map +1 -0
- package/commands/search.js +73 -0
- package/commands/search.js.map +1 -0
- package/commands/seedpack.d.ts +3 -0
- package/commands/seedpack.d.ts.map +1 -0
- package/commands/seedpack.js +76 -0
- package/commands/seedpack.js.map +1 -0
- package/commands/setup.d.ts +3 -0
- package/commands/setup.d.ts.map +1 -0
- package/commands/setup.js +57 -0
- package/commands/setup.js.map +1 -0
- package/commands/shared.d.ts +15 -0
- package/commands/shared.d.ts.map +1 -0
- package/commands/shared.js +34 -0
- package/commands/shared.js.map +1 -0
- package/commands/status.d.ts +3 -0
- package/commands/status.d.ts.map +1 -0
- package/commands/status.js +18 -0
- package/commands/status.js.map +1 -0
- package/commands/tag.d.ts +3 -0
- package/commands/tag.d.ts.map +1 -0
- package/commands/tag.js +24 -0
- package/commands/tag.js.map +1 -0
- package/commands/up.d.ts +3 -0
- package/commands/up.d.ts.map +1 -0
- package/commands/up.js +39 -0
- package/commands/up.js.map +1 -0
- package/commands/usage.d.ts +3 -0
- package/commands/usage.d.ts.map +1 -0
- package/commands/usage.js +56 -0
- package/commands/usage.js.map +1 -0
- package/commands/validate.d.ts +3 -0
- package/commands/validate.d.ts.map +1 -0
- package/commands/validate.js +64 -0
- package/commands/validate.js.map +1 -0
- package/commands/version.d.ts +3 -0
- package/commands/version.d.ts.map +1 -0
- package/commands/version.js +11 -0
- package/commands/version.js.map +1 -0
- package/config/config.d.ts +39 -0
- package/config/config.d.ts.map +1 -0
- package/config/config.js +85 -0
- package/config/config.js.map +1 -0
- package/config/index.d.ts +5 -0
- package/config/index.d.ts.map +1 -0
- package/config/index.js +6 -0
- package/config/index.js.map +1 -0
- package/config/keys.d.ts +6 -0
- package/config/keys.d.ts.map +1 -0
- package/config/keys.js +53 -0
- package/config/keys.js.map +1 -0
- package/config/paths.d.ts +10 -0
- package/config/paths.d.ts.map +1 -0
- package/config/paths.js +21 -0
- package/config/paths.js.map +1 -0
- package/config/resolve.d.ts +33 -0
- package/config/resolve.d.ts.map +1 -0
- package/config/resolve.js +77 -0
- package/config/resolve.js.map +1 -0
- package/errors/classify.d.ts +17 -0
- package/errors/classify.d.ts.map +1 -0
- package/errors/classify.js +158 -0
- package/errors/classify.js.map +1 -0
- package/errors/cli-exit-error.d.ts +6 -0
- package/errors/cli-exit-error.d.ts.map +1 -0
- package/errors/cli-exit-error.js +15 -0
- package/errors/cli-exit-error.js.map +1 -0
- package/errors/exit-codes.d.ts +10 -0
- package/errors/exit-codes.d.ts.map +1 -0
- package/errors/exit-codes.js +12 -0
- package/errors/exit-codes.js.map +1 -0
- package/errors/handle.d.ts +14 -0
- package/errors/handle.d.ts.map +1 -0
- package/errors/handle.js +46 -0
- package/errors/handle.js.map +1 -0
- package/errors/index.d.ts +6 -0
- package/errors/index.d.ts.map +1 -0
- package/errors/index.js +7 -0
- package/errors/index.js.map +1 -0
- package/errors/usage-error.d.ts +5 -0
- package/errors/usage-error.d.ts.map +1 -0
- package/errors/usage-error.js +13 -0
- package/errors/usage-error.js.map +1 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +8 -0
- package/index.js.map +1 -0
- package/local/artifact.d.ts +38 -0
- package/local/artifact.d.ts.map +1 -0
- package/local/artifact.js +133 -0
- package/local/artifact.js.map +1 -0
- package/local/constants.d.ts +36 -0
- package/local/constants.d.ts.map +1 -0
- package/local/constants.js +44 -0
- package/local/constants.js.map +1 -0
- package/local/daemon/components.d.ts +20 -0
- package/local/daemon/components.d.ts.map +1 -0
- package/local/daemon/components.js +105 -0
- package/local/daemon/components.js.map +1 -0
- package/local/daemon/env.d.ts +55 -0
- package/local/daemon/env.d.ts.map +1 -0
- package/local/daemon/env.js +82 -0
- package/local/daemon/env.js.map +1 -0
- package/local/daemon/host.d.ts +7 -0
- package/local/daemon/host.d.ts.map +1 -0
- package/local/daemon/host.js +74 -0
- package/local/daemon/host.js.map +1 -0
- package/local/daemon/index.d.ts +8 -0
- package/local/daemon/index.d.ts.map +1 -0
- package/local/daemon/index.js +8 -0
- package/local/daemon/index.js.map +1 -0
- package/local/daemon/launch.d.ts +11 -0
- package/local/daemon/launch.d.ts.map +1 -0
- package/local/daemon/launch.js +219 -0
- package/local/daemon/launch.js.map +1 -0
- package/local/daemon/process.d.ts +28 -0
- package/local/daemon/process.d.ts.map +1 -0
- package/local/daemon/process.js +149 -0
- package/local/daemon/process.js.map +1 -0
- package/local/daemon/supervisor.d.ts +56 -0
- package/local/daemon/supervisor.d.ts.map +1 -0
- package/local/daemon/supervisor.js +211 -0
- package/local/daemon/supervisor.js.map +1 -0
- package/local/daemon/types.d.ts +63 -0
- package/local/daemon/types.d.ts.map +1 -0
- package/local/daemon/types.js +9 -0
- package/local/daemon/types.js.map +1 -0
- package/local/llm-config.d.ts +30 -0
- package/local/llm-config.d.ts.map +1 -0
- package/local/llm-config.js +93 -0
- package/local/llm-config.js.map +1 -0
- package/local/logs/tail.d.ts +19 -0
- package/local/logs/tail.d.ts.map +1 -0
- package/local/logs/tail.js +86 -0
- package/local/logs/tail.js.map +1 -0
- package/local/logs/view.d.ts +20 -0
- package/local/logs/view.d.ts.map +1 -0
- package/local/logs/view.js +50 -0
- package/local/logs/view.js.map +1 -0
- package/local/net/tcp.d.ts +23 -0
- package/local/net/tcp.d.ts.map +1 -0
- package/local/net/tcp.js +47 -0
- package/local/net/tcp.js.map +1 -0
- package/local/paths.d.ts +26 -0
- package/local/paths.d.ts.map +1 -0
- package/local/paths.js +57 -0
- package/local/paths.js.map +1 -0
- package/local/reset.d.ts +14 -0
- package/local/reset.d.ts.map +1 -0
- package/local/reset.js +57 -0
- package/local/reset.js.map +1 -0
- package/local/runtime/index.d.ts +5 -0
- package/local/runtime/index.d.ts.map +1 -0
- package/local/runtime/index.js +6 -0
- package/local/runtime/index.js.map +1 -0
- package/local/runtime/node.d.ts +8 -0
- package/local/runtime/node.d.ts.map +1 -0
- package/local/runtime/node.js +59 -0
- package/local/runtime/node.js.map +1 -0
- package/local/runtime/runner.d.ts +40 -0
- package/local/runtime/runner.d.ts.map +1 -0
- package/local/runtime/runner.js +154 -0
- package/local/runtime/runner.js.map +1 -0
- package/local/runtime/server.d.ts +39 -0
- package/local/runtime/server.d.ts.map +1 -0
- package/local/runtime/server.js +141 -0
- package/local/runtime/server.js.map +1 -0
- package/local/runtime/which.d.ts +3 -0
- package/local/runtime/which.d.ts.map +1 -0
- package/local/runtime/which.js +30 -0
- package/local/runtime/which.js.map +1 -0
- package/local/seedpack/apply.d.ts +43 -0
- package/local/seedpack/apply.d.ts.map +1 -0
- package/local/seedpack/apply.js +94 -0
- package/local/seedpack/apply.js.map +1 -0
- package/local/seedpack/content.d.ts +56 -0
- package/local/seedpack/content.d.ts.map +1 -0
- package/local/seedpack/content.js +201 -0
- package/local/seedpack/content.js.map +1 -0
- package/local/setup/prompt.d.ts +8 -0
- package/local/setup/prompt.d.ts.map +1 -0
- package/local/setup/prompt.js +63 -0
- package/local/setup/prompt.js.map +1 -0
- package/local/setup/wizard.d.ts +22 -0
- package/local/setup/wizard.d.ts.map +1 -0
- package/local/setup/wizard.js +65 -0
- package/local/setup/wizard.js.map +1 -0
- package/local/state/health-state.d.ts +26 -0
- package/local/state/health-state.d.ts.map +1 -0
- package/local/state/health-state.js +34 -0
- package/local/state/health-state.js.map +1 -0
- package/local/state/index.d.ts +7 -0
- package/local/state/index.d.ts.map +1 -0
- package/local/state/index.js +8 -0
- package/local/state/index.js.map +1 -0
- package/local/state/lock.d.ts +12 -0
- package/local/state/lock.d.ts.map +1 -0
- package/local/state/lock.js +70 -0
- package/local/state/lock.js.map +1 -0
- package/local/state/log-rotation.d.ts +17 -0
- package/local/state/log-rotation.d.ts.map +1 -0
- package/local/state/log-rotation.js +101 -0
- package/local/state/log-rotation.js.map +1 -0
- package/local/state/pidfile.d.ts +11 -0
- package/local/state/pidfile.d.ts.map +1 -0
- package/local/state/pidfile.js +35 -0
- package/local/state/pidfile.js.map +1 -0
- package/local/state/proc.d.ts +16 -0
- package/local/state/proc.d.ts.map +1 -0
- package/local/state/proc.js +69 -0
- package/local/state/proc.js.map +1 -0
- package/local/state/startup-config.d.ts +23 -0
- package/local/state/startup-config.d.ts.map +1 -0
- package/local/state/startup-config.js +33 -0
- package/local/state/startup-config.js.map +1 -0
- package/local/status.d.ts +9 -0
- package/local/status.d.ts.map +1 -0
- package/local/status.js +168 -0
- package/local/status.js.map +1 -0
- package/local/temporal/download.d.ts +20 -0
- package/local/temporal/download.d.ts.map +1 -0
- package/local/temporal/download.js +36 -0
- package/local/temporal/download.js.map +1 -0
- package/local/temporal/index.d.ts +5 -0
- package/local/temporal/index.d.ts.map +1 -0
- package/local/temporal/index.js +6 -0
- package/local/temporal/index.js.map +1 -0
- package/local/temporal/inspect.d.ts +8 -0
- package/local/temporal/inspect.d.ts.map +1 -0
- package/local/temporal/inspect.js +33 -0
- package/local/temporal/inspect.js.map +1 -0
- package/local/temporal/manager.d.ts +50 -0
- package/local/temporal/manager.d.ts.map +1 -0
- package/local/temporal/manager.js +208 -0
- package/local/temporal/manager.js.map +1 -0
- package/local/temporal/supervisor.d.ts +34 -0
- package/local/temporal/supervisor.d.ts.map +1 -0
- package/local/temporal/supervisor.js +83 -0
- package/local/temporal/supervisor.js.map +1 -0
- package/local/webconsole/index.d.ts +4 -0
- package/local/webconsole/index.d.ts.map +1 -0
- package/local/webconsole/index.js +13 -0
- package/local/webconsole/index.js.map +1 -0
- package/logger.d.ts +13 -0
- package/logger.d.ts.map +1 -0
- package/logger.js +35 -0
- package/logger.js.map +1 -0
- package/output/command-result.d.ts +47 -0
- package/output/command-result.d.ts.map +1 -0
- package/output/command-result.js +134 -0
- package/output/command-result.js.map +1 -0
- package/output/confirm.d.ts +22 -0
- package/output/confirm.d.ts.map +1 -0
- package/output/confirm.js +42 -0
- package/output/confirm.js.map +1 -0
- package/output/format.d.ts +22 -0
- package/output/format.d.ts.map +1 -0
- package/output/format.js +72 -0
- package/output/format.js.map +1 -0
- package/output/index.d.ts +7 -0
- package/output/index.d.ts.map +1 -0
- package/output/index.js +8 -0
- package/output/index.js.map +1 -0
- package/output/ndjson.d.ts +24 -0
- package/output/ndjson.d.ts.map +1 -0
- package/output/ndjson.js +38 -0
- package/output/ndjson.js.map +1 -0
- package/output/proto.d.ts +12 -0
- package/output/proto.d.ts.map +1 -0
- package/output/proto.js +34 -0
- package/output/proto.js.map +1 -0
- package/output/style.d.ts +19 -0
- package/output/style.d.ts.map +1 -0
- package/output/style.js +44 -0
- package/output/style.js.map +1 -0
- package/output/table.d.ts +5 -0
- package/output/table.d.ts.map +1 -0
- package/output/table.js +43 -0
- package/output/table.js.map +1 -0
- package/package.json +49 -0
- package/program.d.ts +3 -0
- package/program.d.ts.map +1 -0
- package/program.js +95 -0
- package/program.js.map +1 -0
- package/registry/aliases.d.ts +18 -0
- package/registry/aliases.d.ts.map +1 -0
- package/registry/aliases.js +85 -0
- package/registry/aliases.js.map +1 -0
- package/registry/index.d.ts +6 -0
- package/registry/index.d.ts.map +1 -0
- package/registry/index.js +7 -0
- package/registry/index.js.map +1 -0
- package/registry/metadata.d.ts +12 -0
- package/registry/metadata.d.ts.map +1 -0
- package/registry/metadata.js +49 -0
- package/registry/metadata.js.map +1 -0
- package/registry/registry.d.ts +39 -0
- package/registry/registry.d.ts.map +1 -0
- package/registry/registry.js +59 -0
- package/registry/registry.js.map +1 -0
- package/registry/verb-support.d.ts +5 -0
- package/registry/verb-support.d.ts.map +1 -0
- package/registry/verb-support.js +48 -0
- package/registry/verb-support.js.map +1 -0
- package/registry/verbs.d.ts +16 -0
- package/registry/verbs.d.ts.map +1 -0
- package/registry/verbs.js +36 -0
- package/registry/verbs.js.map +1 -0
- package/resources/apply/apply.d.ts +55 -0
- package/resources/apply/apply.d.ts.map +1 -0
- package/resources/apply/apply.js +163 -0
- package/resources/apply/apply.js.map +1 -0
- package/resources/apply/declarative.d.ts +106 -0
- package/resources/apply/declarative.d.ts.map +1 -0
- package/resources/apply/declarative.js +378 -0
- package/resources/apply/declarative.js.map +1 -0
- package/resources/apply/discovery.d.ts +7 -0
- package/resources/apply/discovery.d.ts.map +1 -0
- package/resources/apply/discovery.js +47 -0
- package/resources/apply/discovery.js.map +1 -0
- package/resources/apply/handlers.d.ts +15 -0
- package/resources/apply/handlers.d.ts.map +1 -0
- package/resources/apply/handlers.js +126 -0
- package/resources/apply/handlers.js.map +1 -0
- package/resources/apply/synth/project-track.d.ts +21 -0
- package/resources/apply/synth/project-track.d.ts.map +1 -0
- package/resources/apply/synth/project-track.js +102 -0
- package/resources/apply/synth/project-track.js.map +1 -0
- package/resources/apply/synth/reader.d.ts +18 -0
- package/resources/apply/synth/reader.d.ts.map +1 -0
- package/resources/apply/synth/reader.js +55 -0
- package/resources/apply/synth/reader.js.map +1 -0
- package/resources/apply/synth/runtime.d.ts +8 -0
- package/resources/apply/synth/runtime.d.ts.map +1 -0
- package/resources/apply/synth/runtime.js +32 -0
- package/resources/apply/synth/runtime.js.map +1 -0
- package/resources/apply/synth/synthesize.d.ts +43 -0
- package/resources/apply/synth/synthesize.d.ts.map +1 -0
- package/resources/apply/synth/synthesize.js +115 -0
- package/resources/apply/synth/synthesize.js.map +1 -0
- package/resources/connect/connect.d.ts +24 -0
- package/resources/connect/connect.d.ts.map +1 -0
- package/resources/connect/connect.js +71 -0
- package/resources/connect/connect.js.map +1 -0
- package/resources/connect/discover.d.ts +5 -0
- package/resources/connect/discover.d.ts.map +1 -0
- package/resources/connect/discover.js +100 -0
- package/resources/connect/discover.js.map +1 -0
- package/resources/connect/display.d.ts +5 -0
- package/resources/connect/display.d.ts.map +1 -0
- package/resources/connect/display.js +58 -0
- package/resources/connect/display.js.map +1 -0
- package/resources/connect/oauth.d.ts +45 -0
- package/resources/connect/oauth.d.ts.map +1 -0
- package/resources/connect/oauth.js +152 -0
- package/resources/connect/oauth.js.map +1 -0
- package/resources/delete.d.ts +18 -0
- package/resources/delete.d.ts.map +1 -0
- package/resources/delete.js +180 -0
- package/resources/delete.js.map +1 -0
- package/resources/diff.d.ts +16 -0
- package/resources/diff.d.ts.map +1 -0
- package/resources/diff.js +158 -0
- package/resources/diff.js.map +1 -0
- package/resources/documents.d.ts +16 -0
- package/resources/documents.d.ts.map +1 -0
- package/resources/documents.js +89 -0
- package/resources/documents.js.map +1 -0
- package/resources/download.d.ts +16 -0
- package/resources/download.d.ts.map +1 -0
- package/resources/download.js +107 -0
- package/resources/download.js.map +1 -0
- package/resources/execution-approve.d.ts +26 -0
- package/resources/execution-approve.d.ts.map +1 -0
- package/resources/execution-approve.js +69 -0
- package/resources/execution-approve.js.map +1 -0
- package/resources/execution-control.d.ts +16 -0
- package/resources/execution-control.d.ts.map +1 -0
- package/resources/execution-control.js +57 -0
- package/resources/execution-control.js.map +1 -0
- package/resources/execution-format.d.ts +12 -0
- package/resources/execution-format.d.ts.map +1 -0
- package/resources/execution-format.js +56 -0
- package/resources/execution-format.js.map +1 -0
- package/resources/execution-logs.d.ts +16 -0
- package/resources/execution-logs.d.ts.map +1 -0
- package/resources/execution-logs.js +132 -0
- package/resources/execution-logs.js.map +1 -0
- package/resources/execution-trace.d.ts +10 -0
- package/resources/execution-trace.d.ts.map +1 -0
- package/resources/execution-trace.js +125 -0
- package/resources/execution-trace.js.map +1 -0
- package/resources/execution.d.ts +59 -0
- package/resources/execution.d.ts.map +1 -0
- package/resources/execution.js +192 -0
- package/resources/execution.js.map +1 -0
- package/resources/get-bindings.d.ts +12 -0
- package/resources/get-bindings.d.ts.map +1 -0
- package/resources/get-bindings.js +40 -0
- package/resources/get-bindings.js.map +1 -0
- package/resources/get.d.ts +6 -0
- package/resources/get.d.ts.map +1 -0
- package/resources/get.js +31 -0
- package/resources/get.js.map +1 -0
- package/resources/git.d.ts +15 -0
- package/resources/git.d.ts.map +1 -0
- package/resources/git.js +69 -0
- package/resources/git.js.map +1 -0
- package/resources/ignore/defaults.d.ts +2 -0
- package/resources/ignore/defaults.d.ts.map +1 -0
- package/resources/ignore/defaults.js +140 -0
- package/resources/ignore/defaults.js.map +1 -0
- package/resources/ignore/index.d.ts +5 -0
- package/resources/ignore/index.d.ts.map +1 -0
- package/resources/ignore/index.js +6 -0
- package/resources/ignore/index.js.map +1 -0
- package/resources/ignore/match.d.ts +3 -0
- package/resources/ignore/match.d.ts.map +1 -0
- package/resources/ignore/match.js +166 -0
- package/resources/ignore/match.js.map +1 -0
- package/resources/ignore/matcher.d.ts +44 -0
- package/resources/ignore/matcher.d.ts.map +1 -0
- package/resources/ignore/matcher.js +125 -0
- package/resources/ignore/matcher.js.map +1 -0
- package/resources/ignore/pattern.d.ts +13 -0
- package/resources/ignore/pattern.d.ts.map +1 -0
- package/resources/ignore/pattern.js +118 -0
- package/resources/ignore/pattern.js.map +1 -0
- package/resources/list.d.ts +7 -0
- package/resources/list.d.ts.map +1 -0
- package/resources/list.js +82 -0
- package/resources/list.js.map +1 -0
- package/resources/mcp/runtime-env.d.ts +23 -0
- package/resources/mcp/runtime-env.d.ts.map +1 -0
- package/resources/mcp/runtime-env.js +68 -0
- package/resources/mcp/runtime-env.js.map +1 -0
- package/resources/picker/ink.d.ts +35 -0
- package/resources/picker/ink.d.ts.map +1 -0
- package/resources/picker/ink.js +45 -0
- package/resources/picker/ink.js.map +1 -0
- package/resources/picker/tty.d.ts +19 -0
- package/resources/picker/tty.d.ts.map +1 -0
- package/resources/picker/tty.js +21 -0
- package/resources/picker/tty.js.map +1 -0
- package/resources/reference.d.ts +32 -0
- package/resources/reference.d.ts.map +1 -0
- package/resources/reference.js +128 -0
- package/resources/reference.js.map +1 -0
- package/resources/render.d.ts +28 -0
- package/resources/render.d.ts.map +1 -0
- package/resources/render.js +87 -0
- package/resources/render.js.map +1 -0
- package/resources/run/agent-exec.d.ts +15 -0
- package/resources/run/agent-exec.d.ts.map +1 -0
- package/resources/run/agent-exec.js +81 -0
- package/resources/run/agent-exec.js.map +1 -0
- package/resources/run/attachments.d.ts +24 -0
- package/resources/run/attachments.d.ts.map +1 -0
- package/resources/run/attachments.js +209 -0
- package/resources/run/attachments.js.map +1 -0
- package/resources/run/create.d.ts +56 -0
- package/resources/run/create.d.ts.map +1 -0
- package/resources/run/create.js +105 -0
- package/resources/run/create.js.map +1 -0
- package/resources/run/env.d.ts +18 -0
- package/resources/run/env.d.ts.map +1 -0
- package/resources/run/env.js +147 -0
- package/resources/run/env.js.map +1 -0
- package/resources/run/epilogue.d.ts +9 -0
- package/resources/run/epilogue.d.ts.map +1 -0
- package/resources/run/epilogue.js +144 -0
- package/resources/run/epilogue.js.map +1 -0
- package/resources/run/header.d.ts +23 -0
- package/resources/run/header.d.ts.map +1 -0
- package/resources/run/header.js +51 -0
- package/resources/run/header.js.map +1 -0
- package/resources/run/prepare.d.ts +60 -0
- package/resources/run/prepare.d.ts.map +1 -0
- package/resources/run/prepare.js +78 -0
- package/resources/run/prepare.js.map +1 -0
- package/resources/run/resolve.d.ts +8 -0
- package/resources/run/resolve.d.ts.map +1 -0
- package/resources/run/resolve.js +28 -0
- package/resources/run/resolve.js.map +1 -0
- package/resources/run/resume.d.ts +13 -0
- package/resources/run/resume.d.ts.map +1 -0
- package/resources/run/resume.js +94 -0
- package/resources/run/resume.js.map +1 -0
- package/resources/run/stream.d.ts +24 -0
- package/resources/run/stream.d.ts.map +1 -0
- package/resources/run/stream.js +80 -0
- package/resources/run/stream.js.map +1 -0
- package/resources/run/workflow-stream.d.ts +25 -0
- package/resources/run/workflow-stream.d.ts.map +1 -0
- package/resources/run/workflow-stream.js +152 -0
- package/resources/run/workflow-stream.js.map +1 -0
- package/resources/run/workspace.d.ts +17 -0
- package/resources/run/workspace.d.ts.map +1 -0
- package/resources/run/workspace.js +147 -0
- package/resources/run/workspace.js.map +1 -0
- package/resources/search.d.ts +22 -0
- package/resources/search.d.ts.map +1 -0
- package/resources/search.js +23 -0
- package/resources/search.js.map +1 -0
- package/resources/session.d.ts +19 -0
- package/resources/session.d.ts.map +1 -0
- package/resources/session.js +51 -0
- package/resources/session.js.map +1 -0
- package/resources/skill.d.ts +84 -0
- package/resources/skill.d.ts.map +1 -0
- package/resources/skill.js +342 -0
- package/resources/skill.js.map +1 -0
- package/resources/stream/approval-detect.d.ts +38 -0
- package/resources/stream/approval-detect.d.ts.map +1 -0
- package/resources/stream/approval-detect.js +93 -0
- package/resources/stream/approval-detect.js.map +1 -0
- package/resources/stream/convert.d.ts +38 -0
- package/resources/stream/convert.d.ts.map +1 -0
- package/resources/stream/convert.js +178 -0
- package/resources/stream/convert.js.map +1 -0
- package/resources/stream/diff.d.ts +29 -0
- package/resources/stream/diff.d.ts.map +1 -0
- package/resources/stream/diff.js +214 -0
- package/resources/stream/diff.js.map +1 -0
- package/resources/stream/events.d.ts +137 -0
- package/resources/stream/events.d.ts.map +1 -0
- package/resources/stream/events.js +15 -0
- package/resources/stream/events.js.map +1 -0
- package/resources/stream/headless.d.ts +38 -0
- package/resources/stream/headless.d.ts.map +1 -0
- package/resources/stream/headless.js +75 -0
- package/resources/stream/headless.js.map +1 -0
- package/resources/stream/ink.d.ts +22 -0
- package/resources/stream/ink.d.ts.map +1 -0
- package/resources/stream/ink.js +24 -0
- package/resources/stream/ink.js.map +1 -0
- package/resources/stream/render-ndjson.d.ts +25 -0
- package/resources/stream/render-ndjson.d.ts.map +1 -0
- package/resources/stream/render-ndjson.js +156 -0
- package/resources/stream/render-ndjson.js.map +1 -0
- package/resources/stream/render-plaintext.d.ts +18 -0
- package/resources/stream/render-plaintext.d.ts.map +1 -0
- package/resources/stream/render-plaintext.js +71 -0
- package/resources/stream/render-plaintext.js.map +1 -0
- package/resources/stream/snapshot.d.ts +8 -0
- package/resources/stream/snapshot.d.ts.map +1 -0
- package/resources/stream/snapshot.js +163 -0
- package/resources/stream/snapshot.js.map +1 -0
- package/resources/stream/subagent.d.ts +12 -0
- package/resources/stream/subagent.d.ts.map +1 -0
- package/resources/stream/subagent.js +76 -0
- package/resources/stream/subagent.js.map +1 -0
- package/resources/stream/submit.d.ts +20 -0
- package/resources/stream/submit.d.ts.map +1 -0
- package/resources/stream/submit.js +125 -0
- package/resources/stream/submit.js.map +1 -0
- package/resources/stream/todo.d.ts +11 -0
- package/resources/stream/todo.d.ts.map +1 -0
- package/resources/stream/todo.js +44 -0
- package/resources/stream/todo.js.map +1 -0
- package/resources/stream/tool-state.d.ts +31 -0
- package/resources/stream/tool-state.d.ts.map +1 -0
- package/resources/stream/tool-state.js +126 -0
- package/resources/stream/tool-state.js.map +1 -0
- package/resources/stream/tty.d.ts +8 -0
- package/resources/stream/tty.d.ts.map +1 -0
- package/resources/stream/tty.js +15 -0
- package/resources/stream/tty.js.map +1 -0
- package/resources/stream/workflow-event-view.d.ts +21 -0
- package/resources/stream/workflow-event-view.d.ts.map +1 -0
- package/resources/stream/workflow-event-view.js +88 -0
- package/resources/stream/workflow-event-view.js.map +1 -0
- package/resources/stream/workflow-render-ndjson.d.ts +5 -0
- package/resources/stream/workflow-render-ndjson.d.ts.map +1 -0
- package/resources/stream/workflow-render-ndjson.js +54 -0
- package/resources/stream/workflow-render-ndjson.js.map +1 -0
- package/resources/stream/workflow-render-plaintext.d.ts +8 -0
- package/resources/stream/workflow-render-plaintext.d.ts.map +1 -0
- package/resources/stream/workflow-render-plaintext.js +34 -0
- package/resources/stream/workflow-render-plaintext.js.map +1 -0
- package/resources/tag.d.ts +4 -0
- package/resources/tag.d.ts.map +1 -0
- package/resources/tag.js +36 -0
- package/resources/tag.js.map +1 -0
- package/resources/usage.d.ts +14 -0
- package/resources/usage.d.ts.map +1 -0
- package/resources/usage.js +251 -0
- package/resources/usage.js.map +1 -0
- package/resources/validate.d.ts +6 -0
- package/resources/validate.d.ts.map +1 -0
- package/resources/validate.js +28 -0
- package/resources/validate.js.map +1 -0
- package/resources/version.d.ts +6 -0
- package/resources/version.d.ts.map +1 -0
- package/resources/version.js +75 -0
- package/resources/version.js.map +1 -0
- package/runtime.d.ts +5 -0
- package/runtime.d.ts.map +1 -0
- package/runtime.js +19 -0
- package/runtime.js.map +1 -0
- package/src/auth/auth0.ts +43 -0
- package/src/auth/callback-server.ts +104 -0
- package/src/auth/index.ts +6 -0
- package/src/auth/login.ts +61 -0
- package/src/auth/pages.ts +31 -0
- package/src/auth/pkce.test.ts +37 -0
- package/src/auth/pkce.ts +26 -0
- package/src/auth/token.test.ts +95 -0
- package/src/auth/token.ts +135 -0
- package/src/backend.ts +15 -0
- package/src/cli/stigmer.ts +16 -0
- package/src/client/client.test.ts +46 -0
- package/src/client/client.ts +84 -0
- package/src/client/index.ts +3 -0
- package/src/commands/agent-exec-flags.ts +75 -0
- package/src/commands/apikey/duration.test.ts +23 -0
- package/src/commands/apikey/duration.ts +35 -0
- package/src/commands/apikey/index.ts +133 -0
- package/src/commands/apply.ts +213 -0
- package/src/commands/auth/index.ts +87 -0
- package/src/commands/completion.ts +96 -0
- package/src/commands/config/backend.ts +58 -0
- package/src/commands/config/context.ts +26 -0
- package/src/commands/config/index.ts +18 -0
- package/src/commands/config/kv.ts +44 -0
- package/src/commands/connect.ts +75 -0
- package/src/commands/delete.ts +56 -0
- package/src/commands/diff.ts +97 -0
- package/src/commands/down.ts +27 -0
- package/src/commands/download.ts +68 -0
- package/src/commands/draft.ts +128 -0
- package/src/commands/execution/approve.ts +76 -0
- package/src/commands/execution/control.ts +79 -0
- package/src/commands/execution/index.ts +24 -0
- package/src/commands/execution/logs.ts +47 -0
- package/src/commands/execution/trace.ts +32 -0
- package/src/commands/get.ts +99 -0
- package/src/commands/internal-daemon.ts +25 -0
- package/src/commands/list.ts +138 -0
- package/src/commands/logs.ts +73 -0
- package/src/commands/mcp-server.test.ts +65 -0
- package/src/commands/mcp-server.ts +124 -0
- package/src/commands/push.ts +205 -0
- package/src/commands/reset.ts +57 -0
- package/src/commands/resume.ts +121 -0
- package/src/commands/run.ts +276 -0
- package/src/commands/search.ts +90 -0
- package/src/commands/seedpack.ts +94 -0
- package/src/commands/setup.ts +71 -0
- package/src/commands/shared.ts +41 -0
- package/src/commands/status.ts +20 -0
- package/src/commands/tag.ts +31 -0
- package/src/commands/up.ts +51 -0
- package/src/commands/usage.ts +74 -0
- package/src/commands/validate.test.ts +79 -0
- package/src/commands/validate.ts +73 -0
- package/src/commands/version.ts +13 -0
- package/src/config/config.test.ts +76 -0
- package/src/config/config.ts +127 -0
- package/src/config/index.ts +22 -0
- package/src/config/keys.test.ts +38 -0
- package/src/config/keys.ts +64 -0
- package/src/config/paths.ts +25 -0
- package/src/config/resolve.test.ts +103 -0
- package/src/config/resolve.ts +80 -0
- package/src/errors/classify.ts +199 -0
- package/src/errors/cli-exit-error.ts +16 -0
- package/src/errors/clierr.test.ts +172 -0
- package/src/errors/exit-codes.ts +14 -0
- package/src/errors/handle.ts +53 -0
- package/src/errors/index.ts +7 -0
- package/src/errors/usage-error.ts +14 -0
- package/src/index.ts +8 -0
- package/src/local/artifact.test.ts +28 -0
- package/src/local/artifact.ts +166 -0
- package/src/local/constants.ts +52 -0
- package/src/local/daemon/components.test.ts +80 -0
- package/src/local/daemon/components.ts +113 -0
- package/src/local/daemon/daemon.integration.test.ts +183 -0
- package/src/local/daemon/env.test.ts +51 -0
- package/src/local/daemon/env.ts +118 -0
- package/src/local/daemon/host.ts +79 -0
- package/src/local/daemon/index.ts +18 -0
- package/src/local/daemon/launch.ts +260 -0
- package/src/local/daemon/process.ts +183 -0
- package/src/local/daemon/supervisor.test.ts +260 -0
- package/src/local/daemon/supervisor.ts +249 -0
- package/src/local/daemon/types.ts +76 -0
- package/src/local/llm-config.test.ts +80 -0
- package/src/local/llm-config.ts +107 -0
- package/src/local/logs/tail.test.ts +70 -0
- package/src/local/logs/tail.ts +100 -0
- package/src/local/logs/view.test.ts +46 -0
- package/src/local/logs/view.ts +65 -0
- package/src/local/net/tcp.ts +65 -0
- package/src/local/paths.ts +67 -0
- package/src/local/reset.test.ts +53 -0
- package/src/local/reset.ts +90 -0
- package/src/local/runtime/index.ts +18 -0
- package/src/local/runtime/node.ts +67 -0
- package/src/local/runtime/runner.ts +186 -0
- package/src/local/runtime/runtime.test.ts +155 -0
- package/src/local/runtime/server.test.ts +152 -0
- package/src/local/runtime/server.ts +172 -0
- package/src/local/runtime/which.ts +30 -0
- package/src/local/seedpack/apply.test.ts +166 -0
- package/src/local/seedpack/apply.ts +139 -0
- package/src/local/seedpack/content.test.ts +148 -0
- package/src/local/seedpack/content.ts +223 -0
- package/src/local/setup/prompt.ts +70 -0
- package/src/local/setup/wizard.test.ts +42 -0
- package/src/local/setup/wizard.ts +78 -0
- package/src/local/state/health-state.ts +55 -0
- package/src/local/state/index.ts +8 -0
- package/src/local/state/lock.ts +77 -0
- package/src/local/state/log-rotation.ts +112 -0
- package/src/local/state/pidfile.ts +37 -0
- package/src/local/state/proc.ts +66 -0
- package/src/local/state/startup-config.ts +51 -0
- package/src/local/state/state.test.ts +166 -0
- package/src/local/status.test.ts +88 -0
- package/src/local/status.ts +186 -0
- package/src/local/temporal/download.test.ts +64 -0
- package/src/local/temporal/download.ts +54 -0
- package/src/local/temporal/index.ts +6 -0
- package/src/local/temporal/inspect.ts +32 -0
- package/src/local/temporal/manager.test.ts +31 -0
- package/src/local/temporal/manager.ts +247 -0
- package/src/local/temporal/supervisor.test.ts +77 -0
- package/src/local/temporal/supervisor.ts +97 -0
- package/src/local/webconsole/index.ts +13 -0
- package/src/logger.ts +39 -0
- package/src/output/command-result.test.ts +64 -0
- package/src/output/command-result.ts +185 -0
- package/src/output/confirm.test.ts +43 -0
- package/src/output/confirm.ts +53 -0
- package/src/output/format.test.ts +65 -0
- package/src/output/format.ts +101 -0
- package/src/output/index.ts +30 -0
- package/src/output/ndjson.ts +55 -0
- package/src/output/proto.test.ts +72 -0
- package/src/output/proto.ts +55 -0
- package/src/output/style.ts +57 -0
- package/src/output/table.test.ts +37 -0
- package/src/output/table.ts +52 -0
- package/src/program.test.ts +64 -0
- package/src/program.ts +100 -0
- package/src/registry/aliases.test.ts +99 -0
- package/src/registry/aliases.ts +93 -0
- package/src/registry/index.ts +7 -0
- package/src/registry/metadata.ts +60 -0
- package/src/registry/registry.test.ts +80 -0
- package/src/registry/registry.ts +101 -0
- package/src/registry/verb-support.ts +50 -0
- package/src/registry/verbs.ts +43 -0
- package/src/resources/apply/apply.integration.test.ts +207 -0
- package/src/resources/apply/apply.ts +202 -0
- package/src/resources/apply/declarative.integration.test.ts +126 -0
- package/src/resources/apply/declarative.test.ts +132 -0
- package/src/resources/apply/declarative.ts +474 -0
- package/src/resources/apply/discovery.ts +60 -0
- package/src/resources/apply/handlers.ts +145 -0
- package/src/resources/apply/synth/capstone.integration.test.ts +134 -0
- package/src/resources/apply/synth/project-track.integration.test.ts +194 -0
- package/src/resources/apply/synth/project-track.ts +126 -0
- package/src/resources/apply/synth/reader.test.ts +90 -0
- package/src/resources/apply/synth/reader.ts +68 -0
- package/src/resources/apply/synth/runtime.test.ts +29 -0
- package/src/resources/apply/synth/runtime.ts +39 -0
- package/src/resources/apply/synth/synthesize.test.ts +109 -0
- package/src/resources/apply/synth/synthesize.ts +161 -0
- package/src/resources/connect/__fixtures__/stdio-crash.mjs +6 -0
- package/src/resources/connect/__fixtures__/stdio-server.mjs +43 -0
- package/src/resources/connect/connect.integration.test.ts +185 -0
- package/src/resources/connect/connect.ts +107 -0
- package/src/resources/connect/discover.test.ts +45 -0
- package/src/resources/connect/discover.ts +125 -0
- package/src/resources/connect/display.ts +68 -0
- package/src/resources/connect/oauth.test.ts +155 -0
- package/src/resources/connect/oauth.ts +191 -0
- package/src/resources/delete.ts +239 -0
- package/src/resources/diff.integration.test.ts +103 -0
- package/src/resources/diff.test.ts +34 -0
- package/src/resources/diff.ts +187 -0
- package/src/resources/documents.test.ts +67 -0
- package/src/resources/documents.ts +102 -0
- package/src/resources/download.ts +151 -0
- package/src/resources/execution-approve.test.ts +50 -0
- package/src/resources/execution-approve.ts +94 -0
- package/src/resources/execution-control.ts +78 -0
- package/src/resources/execution-format.test.ts +48 -0
- package/src/resources/execution-format.ts +54 -0
- package/src/resources/execution-logs.ts +176 -0
- package/src/resources/execution-trace.ts +159 -0
- package/src/resources/execution.integration.test.ts +285 -0
- package/src/resources/execution.test.ts +138 -0
- package/src/resources/execution.ts +229 -0
- package/src/resources/get-bindings.ts +61 -0
- package/src/resources/get.ts +41 -0
- package/src/resources/git.ts +71 -0
- package/src/resources/ignore/defaults.ts +155 -0
- package/src/resources/ignore/ignore.test.ts +139 -0
- package/src/resources/ignore/index.ts +17 -0
- package/src/resources/ignore/match.ts +158 -0
- package/src/resources/ignore/matcher.ts +158 -0
- package/src/resources/ignore/pattern.ts +131 -0
- package/src/resources/list.ts +97 -0
- package/src/resources/mcp/runtime-env.test.ts +68 -0
- package/src/resources/mcp/runtime-env.ts +79 -0
- package/src/resources/mutate-verbs.integration.test.ts +233 -0
- package/src/resources/picker/ink.tsx +114 -0
- package/src/resources/picker/tty.test.ts +37 -0
- package/src/resources/picker/tty.ts +30 -0
- package/src/resources/push-download.integration.test.ts +175 -0
- package/src/resources/read-completion.integration.test.ts +156 -0
- package/src/resources/read-verbs.integration.test.ts +164 -0
- package/src/resources/reference.test.ts +107 -0
- package/src/resources/reference.ts +140 -0
- package/src/resources/render.ts +118 -0
- package/src/resources/run/agent-exec.ts +107 -0
- package/src/resources/run/attachments.test.ts +113 -0
- package/src/resources/run/attachments.ts +261 -0
- package/src/resources/run/create.test.ts +119 -0
- package/src/resources/run/create.ts +165 -0
- package/src/resources/run/env.test.ts +131 -0
- package/src/resources/run/env.ts +167 -0
- package/src/resources/run/epilogue.ts +166 -0
- package/src/resources/run/header.test.ts +61 -0
- package/src/resources/run/header.ts +62 -0
- package/src/resources/run/prepare.test.ts +92 -0
- package/src/resources/run/prepare.ts +139 -0
- package/src/resources/run/resolve.ts +32 -0
- package/src/resources/run/resume.ts +119 -0
- package/src/resources/run/stream.ts +108 -0
- package/src/resources/run/workflow-stream.integration.test.ts +157 -0
- package/src/resources/run/workflow-stream.ts +203 -0
- package/src/resources/run/workspace.test.ts +93 -0
- package/src/resources/run/workspace.ts +171 -0
- package/src/resources/search.ts +53 -0
- package/src/resources/session.test.ts +48 -0
- package/src/resources/session.ts +66 -0
- package/src/resources/skill.test.ts +227 -0
- package/src/resources/skill.ts +451 -0
- package/src/resources/stream/approval-detect.ts +118 -0
- package/src/resources/stream/convert.ts +210 -0
- package/src/resources/stream/diff.test.ts +316 -0
- package/src/resources/stream/diff.ts +254 -0
- package/src/resources/stream/events.ts +193 -0
- package/src/resources/stream/headless.test.ts +119 -0
- package/src/resources/stream/headless.ts +112 -0
- package/src/resources/stream/ink.tsx +56 -0
- package/src/resources/stream/lazy-import.test.ts +63 -0
- package/src/resources/stream/render-ndjson.test.ts +116 -0
- package/src/resources/stream/render-ndjson.ts +176 -0
- package/src/resources/stream/render-plaintext.test.ts +68 -0
- package/src/resources/stream/render-plaintext.ts +86 -0
- package/src/resources/stream/snapshot.test.ts +97 -0
- package/src/resources/stream/snapshot.ts +191 -0
- package/src/resources/stream/subagent.ts +104 -0
- package/src/resources/stream/submit.test.ts +77 -0
- package/src/resources/stream/submit.ts +137 -0
- package/src/resources/stream/todo.ts +53 -0
- package/src/resources/stream/tool-state.ts +142 -0
- package/src/resources/stream/tty.ts +14 -0
- package/src/resources/stream/workflow-event-view.test.ts +116 -0
- package/src/resources/stream/workflow-event-view.ts +111 -0
- package/src/resources/stream/workflow-render-ndjson.ts +61 -0
- package/src/resources/stream/workflow-render-plaintext.ts +43 -0
- package/src/resources/stream/workflow-render.test.ts +81 -0
- package/src/resources/tag.ts +50 -0
- package/src/resources/usage.test.ts +94 -0
- package/src/resources/usage.ts +301 -0
- package/src/resources/validate.test.ts +54 -0
- package/src/resources/validate.ts +31 -0
- package/src/resources/version.ts +105 -0
- package/src/runtime.ts +23 -0
- package/src/types/marked-terminal.d.ts +31 -0
- package/src/version.ts +46 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +45 -0
- package/version.js.map +1 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
// The snapshot→event differ: the headless analog of Go's streamToEvents
|
|
2
|
+
// (run_stream_events.go:203-468).
|
|
3
|
+
//
|
|
4
|
+
// Go's version owns a gRPC loop and blocks on an approval channel. This is a
|
|
5
|
+
// pure, stateful transformer instead: feed it each AgentExecution snapshot and
|
|
6
|
+
// it returns the discrete events for that snapshot, holding all cross-snapshot
|
|
7
|
+
// state (message cursor, tool/sub-agent/todo trackers, prompted-approval dedup).
|
|
8
|
+
// Approval *submission* is the renderer's job — the differ only emits
|
|
9
|
+
// ApprovalNeededEvent. The step numbering and ordering below mirror the Go body
|
|
10
|
+
// exactly, because the resulting event sequence is a wire-parity contract.
|
|
11
|
+
|
|
12
|
+
import type { AgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
|
|
13
|
+
import type { PendingApproval } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/approval_pb";
|
|
14
|
+
import type { AgentMessage, ToolCall } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/message_pb";
|
|
15
|
+
import type { SubAgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/subagent_pb";
|
|
16
|
+
import { ExecutionPhase, MessageType } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
17
|
+
import {
|
|
18
|
+
buildApprovalNeeded,
|
|
19
|
+
buildPendingApprovalFromToolCall,
|
|
20
|
+
findAllUnpromptedApprovals,
|
|
21
|
+
hasUsableApproval,
|
|
22
|
+
} from "./approval-detect.js";
|
|
23
|
+
import {
|
|
24
|
+
collectToolCallsFromMessages,
|
|
25
|
+
convertToolCalls,
|
|
26
|
+
findToolCallById,
|
|
27
|
+
isApprovalNoiseMessage,
|
|
28
|
+
isTerminalAgentPhase,
|
|
29
|
+
mapPhaseToString,
|
|
30
|
+
mapSummarizationSource,
|
|
31
|
+
sanitizeSystemContent,
|
|
32
|
+
} from "./convert.js";
|
|
33
|
+
import type { StreamEvent } from "./events.js";
|
|
34
|
+
import { SubAgentTracking } from "./subagent.js";
|
|
35
|
+
import { TodoDiffer } from "./todo.js";
|
|
36
|
+
import { buildToolEventMap, toolEventId, ToolStateTracker } from "./tool-state.js";
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Stateful differ. Construct one per execution stream, then call {@link next}
|
|
40
|
+
* for every snapshot in arrival order. Once a terminal `done` is emitted, later
|
|
41
|
+
* calls return nothing.
|
|
42
|
+
*/
|
|
43
|
+
export class SnapshotDiffer {
|
|
44
|
+
private displayedCount = 0;
|
|
45
|
+
private inStream = false;
|
|
46
|
+
private humanMessageEmitted = false;
|
|
47
|
+
private lastPhase: ExecutionPhase = ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED;
|
|
48
|
+
private seenSummarizationCount = 0;
|
|
49
|
+
private finished = false;
|
|
50
|
+
private readonly promptedIds = new Set<string>();
|
|
51
|
+
private readonly topTools = new ToolStateTracker();
|
|
52
|
+
private readonly subAgentTracking = new SubAgentTracking();
|
|
53
|
+
private readonly todos = new TodoDiffer();
|
|
54
|
+
|
|
55
|
+
/** Project one snapshot into its events, advancing all internal state. */
|
|
56
|
+
next(execution: AgentExecution): StreamEvent[] {
|
|
57
|
+
if (this.finished) return [];
|
|
58
|
+
const out: StreamEvent[] = [];
|
|
59
|
+
const status = execution.status;
|
|
60
|
+
const messages = status?.messages ?? [];
|
|
61
|
+
const subAgents = status?.subAgentExecutions ?? [];
|
|
62
|
+
const phase = status?.phase ?? ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED;
|
|
63
|
+
|
|
64
|
+
this.emitHumanMessage(out, execution);
|
|
65
|
+
|
|
66
|
+
// Step 1: track tool transitions, then interleave message + tool events.
|
|
67
|
+
const rootToolCalls = collectToolCallsFromMessages(messages);
|
|
68
|
+
const toolEvents = this.topTools.track(rootToolCalls, "");
|
|
69
|
+
const pendingTools = buildToolEventMap(toolEvents);
|
|
70
|
+
this.emitMessageEvents(out, messages, pendingTools);
|
|
71
|
+
|
|
72
|
+
// Step 1c: orphan tool events (no matching MESSAGE_TOOL this snapshot).
|
|
73
|
+
for (const ev of toolEvents) {
|
|
74
|
+
if (pendingTools.has(toolEventId(ev))) out.push(ev);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Step 1d–1f: sub-agents, todos, context compaction.
|
|
78
|
+
if (subAgents.length > 0) out.push(...this.subAgentTracking.emit(subAgents));
|
|
79
|
+
const todos = status?.todos ?? {};
|
|
80
|
+
if (Object.keys(todos).length > 0 || this.todos.hasPrev) {
|
|
81
|
+
out.push(...this.todos.diff(todos));
|
|
82
|
+
}
|
|
83
|
+
this.emitContextCompaction(out, execution);
|
|
84
|
+
|
|
85
|
+
// Step 2: phase change (with approval cycle-reset) before approval handling.
|
|
86
|
+
this.emitPhaseChange(out, phase);
|
|
87
|
+
|
|
88
|
+
// Step 3 + 3b: approval detection (pending_approvals, then status scan).
|
|
89
|
+
this.emitApprovals(out, status?.pendingApprovals ?? [], rootToolCalls, subAgents, phase);
|
|
90
|
+
|
|
91
|
+
// Step 5: terminal → done.
|
|
92
|
+
if (isTerminalAgentPhase(phase)) {
|
|
93
|
+
this.finished = true;
|
|
94
|
+
out.push({ kind: "done", phase: mapPhaseToString(phase), error: status?.error ?? "" });
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return out;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Step 0: emit the user's input message once, suppressing the "execute"
|
|
101
|
+
// placeholder. Mirrors streamToEvents Step 0.
|
|
102
|
+
private emitHumanMessage(out: StreamEvent[], execution: AgentExecution): void {
|
|
103
|
+
if (this.humanMessageEmitted) return;
|
|
104
|
+
const msg = execution.spec?.message ?? "";
|
|
105
|
+
if (msg !== "" && msg !== "execute") {
|
|
106
|
+
out.push({ kind: "humanMessage", content: msg });
|
|
107
|
+
this.humanMessageEmitted = true;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Steps 1b: convert new messages to events, interleaving matched tool events
|
|
112
|
+
// at their chronological position. Mirrors Go's emitMessageEvents.
|
|
113
|
+
private emitMessageEvents(out: StreamEvent[], messages: readonly AgentMessage[], pending: Map<string, StreamEvent>): void {
|
|
114
|
+
// Phase 1: an in-progress streaming AI message.
|
|
115
|
+
if (this.inStream && this.displayedCount < messages.length) {
|
|
116
|
+
const msg = messages[this.displayedCount];
|
|
117
|
+
if (msg.isStreaming) {
|
|
118
|
+
out.push({ kind: "aiStreamDelta", content: msg.content, subAgentId: "" });
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
out.push({ kind: "aiStreamEnd", content: msg.content, toolCalls: convertToolCalls(msg.toolCalls), subAgentId: "" });
|
|
122
|
+
this.displayedCount++;
|
|
123
|
+
this.inStream = false;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Phase 2: complete messages, detecting a new streaming start.
|
|
127
|
+
while (this.displayedCount < messages.length) {
|
|
128
|
+
const msg = messages[this.displayedCount];
|
|
129
|
+
if (msg.isStreaming && msg.type === MessageType.MESSAGE_AI) {
|
|
130
|
+
out.push({ kind: "aiStreamStart", content: msg.content, subAgentId: "" });
|
|
131
|
+
this.inStream = true;
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (msg.type === MessageType.MESSAGE_HUMAN) {
|
|
135
|
+
this.displayedCount++;
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (this.isTrackedToolMessage(msg)) {
|
|
139
|
+
emitMatchedToolEvents(out, msg, pending);
|
|
140
|
+
this.displayedCount++;
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
this.emitCompleteMessage(out, msg);
|
|
144
|
+
this.displayedCount++;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Emit one complete (non-streaming) message by type. Mirrors Go's emitCompleteMessage.
|
|
149
|
+
private emitCompleteMessage(out: StreamEvent[], msg: AgentMessage): void {
|
|
150
|
+
switch (msg.type) {
|
|
151
|
+
case MessageType.MESSAGE_HUMAN:
|
|
152
|
+
out.push({ kind: "humanMessage", content: msg.content });
|
|
153
|
+
return;
|
|
154
|
+
case MessageType.MESSAGE_AI:
|
|
155
|
+
out.push({ kind: "aiMessage", content: msg.content, toolCalls: convertToolCalls(msg.toolCalls), subAgentId: "" });
|
|
156
|
+
return;
|
|
157
|
+
case MessageType.MESSAGE_TOOL:
|
|
158
|
+
out.push({ kind: "toolResult", content: msg.content, toolCalls: convertToolCalls(msg.toolCalls) });
|
|
159
|
+
return;
|
|
160
|
+
case MessageType.MESSAGE_SYSTEM:
|
|
161
|
+
if (isApprovalNoiseMessage(msg.content)) return;
|
|
162
|
+
out.push({ kind: "systemMessage", content: sanitizeSystemContent(msg.content) });
|
|
163
|
+
return;
|
|
164
|
+
default:
|
|
165
|
+
out.push({ kind: "systemMessage", content: `Unknown message: ${msg.content}` });
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// True for a MESSAGE_TOOL whose tool call the top-level tracker already owns.
|
|
170
|
+
// Mirrors Go's isTrackedToolMessage.
|
|
171
|
+
private isTrackedToolMessage(msg: AgentMessage): boolean {
|
|
172
|
+
if (msg.type !== MessageType.MESSAGE_TOOL) return false;
|
|
173
|
+
return msg.toolCalls.some((tc) => tc.id !== "" && this.topTools.has(tc.id));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Step 1f: emit a ContextCompactedEvent per new summarization event. Mirrors
|
|
177
|
+
// the count-based tracking in streamToEvents.
|
|
178
|
+
private emitContextCompaction(out: StreamEvent[], execution: AgentExecution): void {
|
|
179
|
+
const events = execution.status?.contextInfo?.summarizationEvents ?? [];
|
|
180
|
+
for (let i = this.seenSummarizationCount; i < events.length; i++) {
|
|
181
|
+
const se = events[i];
|
|
182
|
+
out.push({
|
|
183
|
+
kind: "contextCompacted",
|
|
184
|
+
source: mapSummarizationSource(se.source),
|
|
185
|
+
tokensBefore: se.tokensBefore,
|
|
186
|
+
tokensAfter: se.tokensAfter,
|
|
187
|
+
compressionRatio: se.compressionRatio,
|
|
188
|
+
durationMs: se.durationMs,
|
|
189
|
+
messagesBefore: se.messagesBefore,
|
|
190
|
+
messagesAfter: se.messagesAfter,
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
this.seenSummarizationCount = events.length;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// Step 2: phase change, resetting the prompted set on an approval cycle
|
|
197
|
+
// (IN_PROGRESS→WAITING_FOR_APPROVAL) so a re-entered gate re-prompts instead
|
|
198
|
+
// of deadlocking. Mirrors streamToEvents Step 2.
|
|
199
|
+
private emitPhaseChange(out: StreamEvent[], phase: ExecutionPhase): void {
|
|
200
|
+
if (phase === this.lastPhase) return;
|
|
201
|
+
if (
|
|
202
|
+
phase === ExecutionPhase.EXECUTION_WAITING_FOR_APPROVAL &&
|
|
203
|
+
this.lastPhase === ExecutionPhase.EXECUTION_IN_PROGRESS
|
|
204
|
+
) {
|
|
205
|
+
this.promptedIds.clear();
|
|
206
|
+
}
|
|
207
|
+
out.push({ kind: "phaseChange", phase: mapPhaseToString(phase), previous: mapPhaseToString(this.lastPhase) });
|
|
208
|
+
this.lastPhase = phase;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Steps 3 + 3b: emit ApprovalNeededEvent for each unprompted pending approval,
|
|
212
|
+
// then fall back to a tool-status scan when pending_approvals is degraded.
|
|
213
|
+
private emitApprovals(
|
|
214
|
+
out: StreamEvent[],
|
|
215
|
+
pendingApprovals: readonly PendingApproval[],
|
|
216
|
+
rootToolCalls: readonly ToolCall[],
|
|
217
|
+
subAgents: readonly SubAgentExecution[],
|
|
218
|
+
phase: ExecutionPhase,
|
|
219
|
+
): void {
|
|
220
|
+
for (const pa of pendingApprovals) {
|
|
221
|
+
const key = pa.toolCallId;
|
|
222
|
+
if (key === "" || this.promptedIds.has(key)) continue;
|
|
223
|
+
const tc = findToolCallById(rootToolCalls, subAgents, pa.toolCallId);
|
|
224
|
+
out.push(buildApprovalNeeded(tc, pa));
|
|
225
|
+
this.promptedIds.add(key);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
if (
|
|
229
|
+
!hasUsableApproval(pendingApprovals, this.promptedIds) &&
|
|
230
|
+
phase === ExecutionPhase.EXECUTION_WAITING_FOR_APPROVAL
|
|
231
|
+
) {
|
|
232
|
+
for (const u of findAllUnpromptedApprovals(rootToolCalls, subAgents, this.promptedIds)) {
|
|
233
|
+
const pa = buildPendingApprovalFromToolCall(u.toolCall);
|
|
234
|
+
pa.fromSubAgent = u.fromSubAgent;
|
|
235
|
+
pa.subAgentName = u.subAgentName;
|
|
236
|
+
out.push(buildApprovalNeeded(u.toolCall, pa));
|
|
237
|
+
this.promptedIds.add(pa.toolCallId);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// Emit tool events whose IDs match the MESSAGE_TOOL's embedded tool calls at the
|
|
244
|
+
// current position, consuming them from `pending`. Mirrors Go's emitMatchedToolEvents.
|
|
245
|
+
function emitMatchedToolEvents(out: StreamEvent[], msg: AgentMessage, pending: Map<string, StreamEvent>): void {
|
|
246
|
+
for (const tc of msg.toolCalls) {
|
|
247
|
+
if (tc.id === "") continue;
|
|
248
|
+
const ev = pending.get(tc.id);
|
|
249
|
+
if (ev !== undefined) {
|
|
250
|
+
out.push(ev);
|
|
251
|
+
pending.delete(tc.id);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
// The sealed event model for the headless snapshot differ.
|
|
2
|
+
//
|
|
3
|
+
// Mirrors Go's pkg/executiontui.Event family (events.go). The differ projects
|
|
4
|
+
// each AgentExecution snapshot into a sequence of these discrete events; the
|
|
5
|
+
// NDJSON and plaintext renderers consume them. The Ink TTY path does NOT use
|
|
6
|
+
// this model — it renders from full snapshots via @stigmer/react.
|
|
7
|
+
//
|
|
8
|
+
// `kind` is the discriminant. The NDJSON renderer maps each kind to Go's exact
|
|
9
|
+
// wire taxonomy (run_stream_json.go), so kinds are deliberately 1:1 with the Go
|
|
10
|
+
// event types rather than the wire strings.
|
|
11
|
+
|
|
12
|
+
import type { JsonObject } from "@bufbuild/protobuf";
|
|
13
|
+
|
|
14
|
+
/** A tool call projected for rendering. Mirrors toolrender.ToolCallInfo. */
|
|
15
|
+
export interface ToolCallInfo {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly name: string;
|
|
18
|
+
/** Mapped status: pending|running|completed|failed|waiting_approval|skipped|unknown. */
|
|
19
|
+
readonly status: string;
|
|
20
|
+
readonly args?: JsonObject;
|
|
21
|
+
readonly result: string;
|
|
22
|
+
readonly error: string;
|
|
23
|
+
/** Elapsed time in ms from started_at→completed_at, or 0 when unknown. */
|
|
24
|
+
readonly durationMs: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** A todo item projected for rendering. Mirrors executiontui.TodoItem. */
|
|
28
|
+
export interface TodoItemView {
|
|
29
|
+
readonly id: string;
|
|
30
|
+
readonly content: string;
|
|
31
|
+
/** Mapped status: pending|in_progress|completed|cancelled. */
|
|
32
|
+
readonly status: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// --- The event union. Each variant carries exactly what its renderers need. ---
|
|
36
|
+
|
|
37
|
+
export interface AIMessageEvent {
|
|
38
|
+
readonly kind: "aiMessage";
|
|
39
|
+
readonly content: string;
|
|
40
|
+
readonly toolCalls: readonly ToolCallInfo[];
|
|
41
|
+
readonly subAgentId: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface AIStreamStartEvent {
|
|
45
|
+
readonly kind: "aiStreamStart";
|
|
46
|
+
readonly content: string;
|
|
47
|
+
readonly subAgentId: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface AIStreamDeltaEvent {
|
|
51
|
+
readonly kind: "aiStreamDelta";
|
|
52
|
+
readonly content: string;
|
|
53
|
+
readonly subAgentId: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface AIStreamEndEvent {
|
|
57
|
+
readonly kind: "aiStreamEnd";
|
|
58
|
+
readonly content: string;
|
|
59
|
+
readonly toolCalls: readonly ToolCallInfo[];
|
|
60
|
+
readonly subAgentId: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface HumanMessageEvent {
|
|
64
|
+
readonly kind: "humanMessage";
|
|
65
|
+
readonly content: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface ToolResultEvent {
|
|
69
|
+
readonly kind: "toolResult";
|
|
70
|
+
readonly content: string;
|
|
71
|
+
readonly toolCalls: readonly ToolCallInfo[];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface ToolRunningEvent {
|
|
75
|
+
readonly kind: "toolRunning";
|
|
76
|
+
readonly toolCallId: string;
|
|
77
|
+
readonly toolCall: ToolCallInfo;
|
|
78
|
+
readonly subAgentId: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface ToolCompletedEvent {
|
|
82
|
+
readonly kind: "toolCompleted";
|
|
83
|
+
readonly toolCallId: string;
|
|
84
|
+
readonly toolCall: ToolCallInfo;
|
|
85
|
+
readonly subAgentId: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface ToolWaitingApprovalEvent {
|
|
89
|
+
readonly kind: "toolWaitingApproval";
|
|
90
|
+
readonly toolCallId: string;
|
|
91
|
+
readonly toolCall: ToolCallInfo;
|
|
92
|
+
readonly subAgentId: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface ToolStreamDeltaEvent {
|
|
96
|
+
readonly kind: "toolStreamDelta";
|
|
97
|
+
readonly toolCallId: string;
|
|
98
|
+
readonly toolCall: ToolCallInfo;
|
|
99
|
+
readonly content: string;
|
|
100
|
+
readonly subAgentId: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface SystemMessageEvent {
|
|
104
|
+
readonly kind: "systemMessage";
|
|
105
|
+
readonly content: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface PhaseChangeEvent {
|
|
109
|
+
readonly kind: "phaseChange";
|
|
110
|
+
readonly phase: string;
|
|
111
|
+
readonly previous: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface ApprovalNeededEvent {
|
|
115
|
+
readonly kind: "approvalNeeded";
|
|
116
|
+
readonly toolCallId: string;
|
|
117
|
+
readonly toolName: string;
|
|
118
|
+
readonly argsPreview: string;
|
|
119
|
+
readonly message: string;
|
|
120
|
+
readonly fromSubAgent: boolean;
|
|
121
|
+
readonly subAgentName: string;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface TodoUpdateEvent {
|
|
125
|
+
readonly kind: "todoUpdate";
|
|
126
|
+
readonly todos: readonly TodoItemView[];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface ContextCompactedEvent {
|
|
130
|
+
readonly kind: "contextCompacted";
|
|
131
|
+
readonly source: string;
|
|
132
|
+
readonly tokensBefore: number;
|
|
133
|
+
readonly tokensAfter: number;
|
|
134
|
+
readonly compressionRatio: number;
|
|
135
|
+
readonly durationMs: number;
|
|
136
|
+
readonly messagesBefore: number;
|
|
137
|
+
readonly messagesAfter: number;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface SubAgentStartedEvent {
|
|
141
|
+
readonly kind: "subAgentStarted";
|
|
142
|
+
readonly id: string;
|
|
143
|
+
readonly name: string;
|
|
144
|
+
readonly description: string;
|
|
145
|
+
readonly input: string;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface SubAgentCompletedEvent {
|
|
149
|
+
readonly kind: "subAgentCompleted";
|
|
150
|
+
readonly id: string;
|
|
151
|
+
/** Protojson enum string for the sub-agent's terminal status. */
|
|
152
|
+
readonly status: string;
|
|
153
|
+
readonly toolCount: number;
|
|
154
|
+
readonly output: string;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface DoneEvent {
|
|
158
|
+
readonly kind: "done";
|
|
159
|
+
readonly phase: string;
|
|
160
|
+
readonly error: string;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface StreamErrorEvent {
|
|
164
|
+
readonly kind: "streamError";
|
|
165
|
+
readonly error: string;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/** The sealed union of every differ event. */
|
|
169
|
+
export type StreamEvent =
|
|
170
|
+
| AIMessageEvent
|
|
171
|
+
| AIStreamStartEvent
|
|
172
|
+
| AIStreamDeltaEvent
|
|
173
|
+
| AIStreamEndEvent
|
|
174
|
+
| HumanMessageEvent
|
|
175
|
+
| ToolResultEvent
|
|
176
|
+
| ToolRunningEvent
|
|
177
|
+
| ToolCompletedEvent
|
|
178
|
+
| ToolWaitingApprovalEvent
|
|
179
|
+
| ToolStreamDeltaEvent
|
|
180
|
+
| SystemMessageEvent
|
|
181
|
+
| PhaseChangeEvent
|
|
182
|
+
| ApprovalNeededEvent
|
|
183
|
+
| TodoUpdateEvent
|
|
184
|
+
| ContextCompactedEvent
|
|
185
|
+
| SubAgentStartedEvent
|
|
186
|
+
| SubAgentCompletedEvent
|
|
187
|
+
| DoneEvent
|
|
188
|
+
| StreamErrorEvent;
|
|
189
|
+
|
|
190
|
+
/** True for the two events that end a stream. */
|
|
191
|
+
export function isTerminalEvent(event: StreamEvent): boolean {
|
|
192
|
+
return event.kind === "done" || event.kind === "streamError";
|
|
193
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// Tests for the headless stream driver: terminal result propagation, approval
|
|
2
|
+
// auto-resolution + submission, submit-failure → stream_error, clean abort.
|
|
3
|
+
|
|
4
|
+
import { create } from "@bufbuild/protobuf";
|
|
5
|
+
import { describe, expect, it } from "vitest";
|
|
6
|
+
import { Code, ConnectError } from "@connectrpc/connect";
|
|
7
|
+
import {
|
|
8
|
+
AgentExecutionSchema,
|
|
9
|
+
AgentExecutionStatusSchema,
|
|
10
|
+
type AgentExecution,
|
|
11
|
+
} from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
|
|
12
|
+
import { AgentMessageSchema, ToolCallSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/message_pb";
|
|
13
|
+
import { PendingApprovalSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/approval_pb";
|
|
14
|
+
import {
|
|
15
|
+
ApprovalAction,
|
|
16
|
+
ExecutionPhase,
|
|
17
|
+
MessageType,
|
|
18
|
+
ToolCallStatus,
|
|
19
|
+
} from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
20
|
+
import type { ApprovalNeededEvent, StreamEvent } from "./events.js";
|
|
21
|
+
import { type HeadlessRenderer, runHeadlessStream } from "./headless.js";
|
|
22
|
+
|
|
23
|
+
function snapshot(phase: ExecutionPhase, opts: { waiting?: boolean } = {}): AgentExecution {
|
|
24
|
+
const toolCalls = opts.waiting
|
|
25
|
+
? [create(ToolCallSchema, { id: "t1", name: "delete", status: ToolCallStatus.TOOL_CALL_WAITING_APPROVAL })]
|
|
26
|
+
: [];
|
|
27
|
+
return create(AgentExecutionSchema, {
|
|
28
|
+
status: create(AgentExecutionStatusSchema, {
|
|
29
|
+
phase,
|
|
30
|
+
messages: [create(AgentMessageSchema, { type: MessageType.MESSAGE_AI, content: "hi", toolCalls })],
|
|
31
|
+
pendingApprovals: opts.waiting ? [create(PendingApprovalSchema, { toolCallId: "t1", toolName: "delete" })] : [],
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function source(snapshots: AgentExecution[]): (signal: AbortSignal) => AsyncIterable<AgentExecution> {
|
|
37
|
+
return async function* (signal: AbortSignal) {
|
|
38
|
+
for (const s of snapshots) {
|
|
39
|
+
if (signal.aborted) throw new DOMException("Aborted", "AbortError");
|
|
40
|
+
yield s;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
class RecordingRenderer implements HeadlessRenderer {
|
|
46
|
+
readonly kinds: string[] = [];
|
|
47
|
+
constructor(private readonly action: ApprovalAction = ApprovalAction.SKIP) {}
|
|
48
|
+
render(event: StreamEvent): void {
|
|
49
|
+
this.kinds.push(event.kind);
|
|
50
|
+
}
|
|
51
|
+
resolveApproval(_event: ApprovalNeededEvent): ApprovalAction {
|
|
52
|
+
return this.action;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
describe("runHeadlessStream", () => {
|
|
57
|
+
it("drives to a terminal done and returns the phase", async () => {
|
|
58
|
+
const renderer = new RecordingRenderer();
|
|
59
|
+
const result = await runHeadlessStream({
|
|
60
|
+
subscribe: source([snapshot(ExecutionPhase.EXECUTION_IN_PROGRESS), snapshot(ExecutionPhase.EXECUTION_COMPLETED)]),
|
|
61
|
+
submitApproval: async () => {},
|
|
62
|
+
renderer,
|
|
63
|
+
sessionId: "ses_1",
|
|
64
|
+
signal: new AbortController().signal,
|
|
65
|
+
});
|
|
66
|
+
expect(result).toEqual({ phase: "completed", error: "" });
|
|
67
|
+
expect(renderer.kinds).toContain("done");
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it("resolves and submits an approval, then completes", async () => {
|
|
71
|
+
const renderer = new RecordingRenderer(ApprovalAction.SKIP);
|
|
72
|
+
const submitted: Array<{ id: string; action: ApprovalAction }> = [];
|
|
73
|
+
const result = await runHeadlessStream({
|
|
74
|
+
subscribe: source([
|
|
75
|
+
snapshot(ExecutionPhase.EXECUTION_WAITING_FOR_APPROVAL, { waiting: true }),
|
|
76
|
+
snapshot(ExecutionPhase.EXECUTION_COMPLETED),
|
|
77
|
+
]),
|
|
78
|
+
submitApproval: async (id, action) => void submitted.push({ id, action }),
|
|
79
|
+
renderer,
|
|
80
|
+
sessionId: "ses_1",
|
|
81
|
+
signal: new AbortController().signal,
|
|
82
|
+
});
|
|
83
|
+
expect(submitted).toEqual([{ id: "t1", action: ApprovalAction.SKIP }]);
|
|
84
|
+
expect(renderer.kinds).toContain("approvalNeeded");
|
|
85
|
+
expect(result.phase).toBe("completed");
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("renders a stream_error and stops when submission fails permanently", async () => {
|
|
89
|
+
const renderer = new RecordingRenderer();
|
|
90
|
+
const result = await runHeadlessStream({
|
|
91
|
+
subscribe: source([
|
|
92
|
+
snapshot(ExecutionPhase.EXECUTION_WAITING_FOR_APPROVAL, { waiting: true }),
|
|
93
|
+
snapshot(ExecutionPhase.EXECUTION_COMPLETED),
|
|
94
|
+
]),
|
|
95
|
+
submitApproval: async () => {
|
|
96
|
+
throw new ConnectError("nope", Code.InvalidArgument);
|
|
97
|
+
},
|
|
98
|
+
renderer,
|
|
99
|
+
sessionId: "ses_9",
|
|
100
|
+
signal: new AbortController().signal,
|
|
101
|
+
});
|
|
102
|
+
expect(renderer.kinds).toContain("streamError");
|
|
103
|
+
expect(result.error).toContain("Failed to submit approval");
|
|
104
|
+
expect(result.error).toContain("stigmer resume ses_9");
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it("exits cleanly when aborted", async () => {
|
|
108
|
+
const controller = new AbortController();
|
|
109
|
+
controller.abort();
|
|
110
|
+
const result = await runHeadlessStream({
|
|
111
|
+
subscribe: source([snapshot(ExecutionPhase.EXECUTION_IN_PROGRESS)]),
|
|
112
|
+
submitApproval: async () => {},
|
|
113
|
+
renderer: new RecordingRenderer(),
|
|
114
|
+
sessionId: "",
|
|
115
|
+
signal: controller.signal,
|
|
116
|
+
});
|
|
117
|
+
expect(result).toEqual({ phase: "", error: "" });
|
|
118
|
+
});
|
|
119
|
+
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// The headless stream driver: subscribe → diff → render → resolve approvals.
|
|
2
|
+
//
|
|
3
|
+
// This is the single-process analog of Go's renderer goroutine + approval
|
|
4
|
+
// channel (run_stream.go / run_stream_events.go). Go runs streamToEvents in one
|
|
5
|
+
// goroutine and the renderer in another, exchanging approvals over channels.
|
|
6
|
+
// Here it's one async loop: each snapshot is diffed, every event is rendered,
|
|
7
|
+
// and an ApprovalNeededEvent is resolved by the renderer's policy and submitted
|
|
8
|
+
// (with retry) before the loop blocks on the next snapshot — which is safe
|
|
9
|
+
// because the backend withholds further updates until the approval lands.
|
|
10
|
+
|
|
11
|
+
import type { AgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
|
|
12
|
+
import { ApprovalAction } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
13
|
+
import { SnapshotDiffer } from "./diff.js";
|
|
14
|
+
import type { ApprovalNeededEvent, StreamEvent } from "./events.js";
|
|
15
|
+
import {
|
|
16
|
+
APPROVAL_RETRY_BASE_DELAY_MS,
|
|
17
|
+
APPROVAL_RETRY_MAX_ATTEMPTS,
|
|
18
|
+
classifyStreamError,
|
|
19
|
+
retryWithBackoff,
|
|
20
|
+
} from "./submit.js";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* A headless renderer: turns each differ event into output and decides how to
|
|
24
|
+
* resolve approvals. Both methods are synchronous — submission is the driver's
|
|
25
|
+
* job. Implemented by NdjsonRenderer and PlaintextRenderer.
|
|
26
|
+
*/
|
|
27
|
+
export interface HeadlessRenderer {
|
|
28
|
+
/** Render one event to the renderer's sinks. */
|
|
29
|
+
render(event: StreamEvent): void;
|
|
30
|
+
/** Choose the approval action for an emitted ApprovalNeededEvent (may warn). */
|
|
31
|
+
resolveApproval(event: ApprovalNeededEvent): ApprovalAction;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** The terminal outcome of a headless stream. */
|
|
35
|
+
export interface HeadlessResult {
|
|
36
|
+
readonly phase: string;
|
|
37
|
+
readonly error: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Dependencies for {@link runHeadlessStream}. */
|
|
41
|
+
export interface HeadlessStreamDeps {
|
|
42
|
+
/** The execution snapshot source (the SDK's agentExecution.subscribe). */
|
|
43
|
+
readonly subscribe: (signal: AbortSignal) => AsyncIterable<AgentExecution>;
|
|
44
|
+
/** Submit one approval decision. The caller binds the execution + RPC. */
|
|
45
|
+
readonly submitApproval: (toolCallId: string, action: ApprovalAction) => Promise<void>;
|
|
46
|
+
readonly renderer: HeadlessRenderer;
|
|
47
|
+
readonly sessionId: string;
|
|
48
|
+
readonly signal: AbortSignal;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Drive the stream to a terminal phase and return the outcome. Aborting (Ctrl-C)
|
|
53
|
+
* resolves cleanly with an empty result; a dropped stream renders a stream_error
|
|
54
|
+
* and returns its message.
|
|
55
|
+
*/
|
|
56
|
+
export async function runHeadlessStream(deps: HeadlessStreamDeps): Promise<HeadlessResult> {
|
|
57
|
+
const differ = new SnapshotDiffer();
|
|
58
|
+
try {
|
|
59
|
+
for await (const snapshot of deps.subscribe(deps.signal)) {
|
|
60
|
+
const terminal = await drainSnapshot(differ.next(snapshot), deps);
|
|
61
|
+
if (terminal !== undefined) return terminal;
|
|
62
|
+
}
|
|
63
|
+
return { phase: "", error: "" };
|
|
64
|
+
} catch (err) {
|
|
65
|
+
if (deps.signal.aborted) return { phase: "", error: "" };
|
|
66
|
+
const message = classifyStreamError(err, deps.sessionId);
|
|
67
|
+
deps.renderer.render({ kind: "streamError", error: message });
|
|
68
|
+
return { phase: "", error: message };
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Render every event for one snapshot, resolving approvals as they appear.
|
|
73
|
+
// Returns the terminal result when a done/stream_error event is reached.
|
|
74
|
+
async function drainSnapshot(events: StreamEvent[], deps: HeadlessStreamDeps): Promise<HeadlessResult | undefined> {
|
|
75
|
+
for (const event of events) {
|
|
76
|
+
deps.renderer.render(event);
|
|
77
|
+
|
|
78
|
+
if (event.kind === "approvalNeeded") {
|
|
79
|
+
const failure = await resolveAndSubmit(event, deps);
|
|
80
|
+
if (failure !== undefined) return failure;
|
|
81
|
+
}
|
|
82
|
+
if (event.kind === "done") return { phase: event.phase, error: event.error };
|
|
83
|
+
if (event.kind === "streamError") return { phase: "", error: event.error };
|
|
84
|
+
}
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Resolve an approval via the renderer's policy and submit it with retry. On
|
|
89
|
+
// terminal submit failure, render a stream_error and return it (mirrors Go's
|
|
90
|
+
// emitAndWaitApproval, which surfaces a StreamErrorEvent the renderer treats as
|
|
91
|
+
// terminal). A successful submit returns undefined to continue the stream.
|
|
92
|
+
async function resolveAndSubmit(
|
|
93
|
+
event: ApprovalNeededEvent,
|
|
94
|
+
deps: HeadlessStreamDeps,
|
|
95
|
+
): Promise<HeadlessResult | undefined> {
|
|
96
|
+
const action = deps.renderer.resolveApproval(event);
|
|
97
|
+
try {
|
|
98
|
+
await retryWithBackoff(deps.signal, APPROVAL_RETRY_MAX_ATTEMPTS, APPROVAL_RETRY_BASE_DELAY_MS, () =>
|
|
99
|
+
deps.submitApproval(event.toolCallId, action),
|
|
100
|
+
);
|
|
101
|
+
return undefined;
|
|
102
|
+
} catch (err) {
|
|
103
|
+
if (deps.signal.aborted) return { phase: "", error: "" };
|
|
104
|
+
let message = `Failed to submit approval after ${APPROVAL_RETRY_MAX_ATTEMPTS} attempts`;
|
|
105
|
+
if (deps.sessionId !== "") message += `. Re-attach to retry: stigmer resume ${deps.sessionId}`;
|
|
106
|
+
deps.renderer.render({ kind: "streamError", error: message });
|
|
107
|
+
return { phase: "", error: message };
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Re-export so command wiring can reference the enum without a deep import. */
|
|
112
|
+
export { ApprovalAction };
|