@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,12 @@
|
|
|
1
|
+
import type { SubAgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/subagent_pb";
|
|
2
|
+
import type { StreamEvent } from "./events.js";
|
|
3
|
+
/**
|
|
4
|
+
* Tracks every sub-agent across snapshots, emitting started/message/tool/
|
|
5
|
+
* completed events. Holds one cursor per sub-agent ID, persisting across calls.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SubAgentTracking {
|
|
8
|
+
private readonly cursors;
|
|
9
|
+
/** Process all sub-agent executions in a snapshot. Mirrors Go's emitSubAgentEvents. */
|
|
10
|
+
emit(subAgents: readonly SubAgentExecution[]): StreamEvent[];
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=subagent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subagent.d.ts","sourceRoot":"","sources":["../../../src/resources/stream/subagent.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kEAAkE,CAAC;AAO1G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAW/C;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqC;IAE7D,uFAAuF;IACvF,IAAI,CAAC,SAAS,EAAE,SAAS,iBAAiB,EAAE,GAAG,WAAW,EAAE;CA+B7D"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Sub-agent activity tracking for the snapshot differ.
|
|
2
|
+
//
|
|
3
|
+
// Ports the Go CLI's run_stream_subagent.go. Each sub-agent execution has its
|
|
4
|
+
// own message cursor and tool-state tracker (its data arrays grow independently
|
|
5
|
+
// of the top-level status), so this module keeps a per-sub-agent tracker keyed
|
|
6
|
+
// by sub-agent ID and emits started/message/tool/completed events with the
|
|
7
|
+
// sub-agent ID set for nested rendering.
|
|
8
|
+
import { MessageType } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
9
|
+
import { collectToolCallsFromMessages, isTerminalSubAgentStatus, subAgentStatusName, } from "./convert.js";
|
|
10
|
+
import { ToolStateTracker } from "./tool-state.js";
|
|
11
|
+
/**
|
|
12
|
+
* Tracks every sub-agent across snapshots, emitting started/message/tool/
|
|
13
|
+
* completed events. Holds one cursor per sub-agent ID, persisting across calls.
|
|
14
|
+
*/
|
|
15
|
+
export class SubAgentTracking {
|
|
16
|
+
cursors = new Map();
|
|
17
|
+
/** Process all sub-agent executions in a snapshot. Mirrors Go's emitSubAgentEvents. */
|
|
18
|
+
emit(subAgents) {
|
|
19
|
+
const out = [];
|
|
20
|
+
for (const sa of subAgents) {
|
|
21
|
+
if (sa.id === "")
|
|
22
|
+
continue;
|
|
23
|
+
let cursor = this.cursors.get(sa.id);
|
|
24
|
+
if (cursor === undefined) {
|
|
25
|
+
cursor = { displayedMsgCount: 0, inStream: false, tools: new ToolStateTracker(), completed: false };
|
|
26
|
+
this.cursors.set(sa.id, cursor);
|
|
27
|
+
out.push({ kind: "subAgentStarted", id: sa.id, name: sa.name, description: sa.subject, input: sa.input });
|
|
28
|
+
}
|
|
29
|
+
const toolEvents = cursor.tools.track(collectToolCallsFromMessages(sa.messages), sa.id);
|
|
30
|
+
emitSubAgentMessages(out, sa.id, sa.messages, cursor);
|
|
31
|
+
out.push(...toolEvents);
|
|
32
|
+
if (!cursor.completed && isTerminalSubAgentStatus(sa.status)) {
|
|
33
|
+
cursor.completed = true;
|
|
34
|
+
out.push({
|
|
35
|
+
kind: "subAgentCompleted",
|
|
36
|
+
id: sa.id,
|
|
37
|
+
status: subAgentStatusName(sa.status),
|
|
38
|
+
toolCount: collectToolCallsFromMessages(sa.messages).length,
|
|
39
|
+
output: sa.output,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return out;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// Emit new sub-agent messages, streaming AI messages incrementally. Tool results
|
|
47
|
+
// are owned by the tool-state tracker, so MESSAGE_TOOL entries are skipped, and
|
|
48
|
+
// AI tool-call lists are omitted to avoid duplicating the stateful tool blocks.
|
|
49
|
+
// Mirrors Go's emitSubAgentMessageEvents.
|
|
50
|
+
function emitSubAgentMessages(out, subAgentId, messages, cursor) {
|
|
51
|
+
// Phase 1: an in-progress streaming AI message.
|
|
52
|
+
if (cursor.inStream && cursor.displayedMsgCount < messages.length) {
|
|
53
|
+
const msg = messages[cursor.displayedMsgCount];
|
|
54
|
+
if (msg.isStreaming) {
|
|
55
|
+
out.push({ kind: "aiStreamDelta", content: msg.content, subAgentId });
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
out.push({ kind: "aiStreamEnd", content: msg.content, toolCalls: [], subAgentId });
|
|
59
|
+
cursor.displayedMsgCount++;
|
|
60
|
+
cursor.inStream = false;
|
|
61
|
+
}
|
|
62
|
+
// Phase 2: complete messages, detecting a new streaming start.
|
|
63
|
+
while (cursor.displayedMsgCount < messages.length) {
|
|
64
|
+
const msg = messages[cursor.displayedMsgCount];
|
|
65
|
+
if (msg.isStreaming && msg.type === MessageType.MESSAGE_AI) {
|
|
66
|
+
out.push({ kind: "aiStreamStart", content: msg.content, subAgentId });
|
|
67
|
+
cursor.inStream = true;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (msg.type === MessageType.MESSAGE_AI && msg.content !== "") {
|
|
71
|
+
out.push({ kind: "aiMessage", content: msg.content, toolCalls: [], subAgentId });
|
|
72
|
+
}
|
|
73
|
+
cursor.displayedMsgCount++;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=subagent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subagent.js","sourceRoot":"","sources":["../../../src/resources/stream/subagent.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,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EAAE,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;QACnF,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAC3B,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED,+DAA+D;IAC/D,OAAO,MAAM,CAAC,iBAAiB,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;QAClD,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAC/C,IAAI,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,IAAI,KAAK,WAAW,CAAC,UAAU,EAAE,CAAC;YAC3D,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;YACtE,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;YACvB,OAAO;QACT,CAAC;QACD,IAAI,GAAG,CAAC,IAAI,KAAK,WAAW,CAAC,UAAU,IAAI,GAAG,CAAC,OAAO,KAAK,EAAE,EAAE,CAAC;YAC9D,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;QACnF,CAAC;QACD,MAAM,CAAC,iBAAiB,EAAE,CAAC;IAC7B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const APPROVAL_RETRY_MAX_ATTEMPTS = 3;
|
|
2
|
+
export declare const APPROVAL_RETRY_BASE_DELAY_MS = 1000;
|
|
3
|
+
/**
|
|
4
|
+
* Retry `fn` up to `maxAttempts` times with doubling backoff, stopping early on
|
|
5
|
+
* success, a non-retryable error, or abort. Mirrors Go's retryWithBackoff. The
|
|
6
|
+
* delay between attempts is abort-aware. Rejects with the last error on failure.
|
|
7
|
+
*/
|
|
8
|
+
export declare function retryWithBackoff(signal: AbortSignal, maxAttempts: number, baseDelayMs: number, fn: () => Promise<void>): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* True when an approval-submit error is transient and worth retrying. Mirrors
|
|
11
|
+
* Go's isRetryableSubmitError, including the "no pending approvals" special
|
|
12
|
+
* case. Non-RPC errors default to retryable (typically transient I/O).
|
|
13
|
+
*/
|
|
14
|
+
export declare function isRetryableSubmitError(err: unknown): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Translate a dropped Subscribe stream error into a user-facing message with a
|
|
17
|
+
* resume hint. Mirrors Go's classifyStreamError.
|
|
18
|
+
*/
|
|
19
|
+
export declare function classifyStreamError(err: unknown, sessionId: string): string;
|
|
20
|
+
//# sourceMappingURL=submit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit.d.ts","sourceRoot":"","sources":["../../../src/resources/stream/submit.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAC7C,eAAO,MAAM,4BAA4B,OAAO,CAAC;AAIjD;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,WAAW,EACnB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,EAAE,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GACtB,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAiB5D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAuB3E"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// Approval-submission resilience for the headless stream driver.
|
|
2
|
+
//
|
|
3
|
+
// Ports the retry/backoff machinery from Go's run_stream_events.go:21-191:
|
|
4
|
+
// approval submits race a transient DB-consistency window ("no pending
|
|
5
|
+
// approvals") and ordinary network blips, so they retry with exponential
|
|
6
|
+
// backoff. Also ports classifyStreamError (:53-82) — the user-facing message
|
|
7
|
+
// for a dropped Subscribe stream, with a resume hint.
|
|
8
|
+
import { Code, ConnectError } from "@connectrpc/connect";
|
|
9
|
+
import { StigmerError } from "@stigmer/sdk";
|
|
10
|
+
export const APPROVAL_RETRY_MAX_ATTEMPTS = 3;
|
|
11
|
+
export const APPROVAL_RETRY_BASE_DELAY_MS = 1000;
|
|
12
|
+
const MAX_CHAIN_DEPTH = 20;
|
|
13
|
+
/**
|
|
14
|
+
* Retry `fn` up to `maxAttempts` times with doubling backoff, stopping early on
|
|
15
|
+
* success, a non-retryable error, or abort. Mirrors Go's retryWithBackoff. The
|
|
16
|
+
* delay between attempts is abort-aware. Rejects with the last error on failure.
|
|
17
|
+
*/
|
|
18
|
+
export async function retryWithBackoff(signal, maxAttempts, baseDelayMs, fn) {
|
|
19
|
+
let lastErr;
|
|
20
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
21
|
+
if (signal.aborted)
|
|
22
|
+
throw new DOMException("Aborted", "AbortError");
|
|
23
|
+
try {
|
|
24
|
+
await fn();
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
lastErr = err;
|
|
29
|
+
if (!isRetryableSubmitError(err))
|
|
30
|
+
throw err;
|
|
31
|
+
if (attempt < maxAttempts - 1) {
|
|
32
|
+
await abortableDelay(baseDelayMs * 2 ** attempt, signal);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
throw lastErr;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* True when an approval-submit error is transient and worth retrying. Mirrors
|
|
40
|
+
* Go's isRetryableSubmitError, including the "no pending approvals" special
|
|
41
|
+
* case. Non-RPC errors default to retryable (typically transient I/O).
|
|
42
|
+
*/
|
|
43
|
+
export function isRetryableSubmitError(err) {
|
|
44
|
+
const coded = extractCoded(err);
|
|
45
|
+
if (coded === undefined)
|
|
46
|
+
return true;
|
|
47
|
+
switch (coded.code) {
|
|
48
|
+
case Code.Unavailable:
|
|
49
|
+
case Code.DeadlineExceeded:
|
|
50
|
+
case Code.ResourceExhausted:
|
|
51
|
+
case Code.Aborted:
|
|
52
|
+
case Code.Internal:
|
|
53
|
+
case Code.Unknown:
|
|
54
|
+
return true;
|
|
55
|
+
case Code.FailedPrecondition:
|
|
56
|
+
return coded.message.includes("no pending approvals");
|
|
57
|
+
default:
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Translate a dropped Subscribe stream error into a user-facing message with a
|
|
63
|
+
* resume hint. Mirrors Go's classifyStreamError.
|
|
64
|
+
*/
|
|
65
|
+
export function classifyStreamError(err, sessionId) {
|
|
66
|
+
let message;
|
|
67
|
+
const coded = extractCoded(err);
|
|
68
|
+
if (coded === undefined) {
|
|
69
|
+
message = `Unexpected stream error: ${messageOf(err)}`;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
switch (coded.code) {
|
|
73
|
+
case Code.Unavailable:
|
|
74
|
+
message = "Connection to server lost.";
|
|
75
|
+
break;
|
|
76
|
+
case Code.Canceled:
|
|
77
|
+
message = "Server cancelled the stream.";
|
|
78
|
+
break;
|
|
79
|
+
case Code.DeadlineExceeded:
|
|
80
|
+
message = "Server response timed out.";
|
|
81
|
+
break;
|
|
82
|
+
default:
|
|
83
|
+
message = `Stream error (${Code[coded.code] ?? "Unknown"}): ${coded.message}`;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (sessionId !== "")
|
|
87
|
+
message += `\nRe-attach to this session: stigmer resume ${sessionId}`;
|
|
88
|
+
return message;
|
|
89
|
+
}
|
|
90
|
+
// Walk the cause chain for the first SDK/Connect coded error. Mirrors the
|
|
91
|
+
// Unwrap walk in errors/classify.ts.
|
|
92
|
+
function extractCoded(err) {
|
|
93
|
+
let depth = 0;
|
|
94
|
+
for (let current = err; current != null && depth < MAX_CHAIN_DEPTH; current = causeOf(current), depth++) {
|
|
95
|
+
if (current instanceof StigmerError)
|
|
96
|
+
return { code: current.connectCode, message: current.message };
|
|
97
|
+
if (current instanceof ConnectError)
|
|
98
|
+
return { code: current.code, message: current.rawMessage };
|
|
99
|
+
}
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
function causeOf(value) {
|
|
103
|
+
return value !== null && typeof value === "object" ? value.cause : undefined;
|
|
104
|
+
}
|
|
105
|
+
function messageOf(value) {
|
|
106
|
+
if (value instanceof Error)
|
|
107
|
+
return value.message;
|
|
108
|
+
if (typeof value === "string")
|
|
109
|
+
return value;
|
|
110
|
+
return String(value);
|
|
111
|
+
}
|
|
112
|
+
function abortableDelay(ms, signal) {
|
|
113
|
+
return new Promise((resolve, reject) => {
|
|
114
|
+
const timer = setTimeout(() => {
|
|
115
|
+
signal.removeEventListener("abort", onAbort);
|
|
116
|
+
resolve();
|
|
117
|
+
}, ms);
|
|
118
|
+
const onAbort = () => {
|
|
119
|
+
clearTimeout(timer);
|
|
120
|
+
reject(new DOMException("Aborted", "AbortError"));
|
|
121
|
+
};
|
|
122
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=submit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit.js","sourceRoot":"","sources":["../../../src/resources/stream/submit.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,yEAAyE;AACzE,6EAA6E;AAC7E,sDAAsD;AAEtD,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC;AAC7C,MAAM,CAAC,MAAM,4BA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0 +1,11 @@
|
|
|
1
|
+
import type { TodoItem } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/todo_pb";
|
|
2
|
+
import type { StreamEvent } from "./events.js";
|
|
3
|
+
/** Stateful todo differ: holds the last fingerprint snapshot across calls. */
|
|
4
|
+
export declare class TodoDiffer {
|
|
5
|
+
private prev;
|
|
6
|
+
/** True once any todo has been recorded, until the list is emptied. Mirrors Go's `len(prevTodos) > 0` guard. */
|
|
7
|
+
get hasPrev(): boolean;
|
|
8
|
+
/** Diff the current todo map and return a TodoUpdateEvent when it changed. */
|
|
9
|
+
diff(todos: Record<string, TodoItem>): StreamEvent[];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=todo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"todo.d.ts","sourceRoot":"","sources":["../../../src/resources/stream/todo.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8DAA8D,CAAC;AAE7F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAO/C,8EAA8E;AAC9E,qBAAa,UAAU;IACrB,OAAO,CAAC,IAAI,CAAkC;IAE9C,gHAAgH;IAChH,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,8EAA8E;IAC9E,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,WAAW,EAAE;CAMrD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Todo-list change detection for the snapshot differ.
|
|
2
|
+
//
|
|
3
|
+
// Ports the Go CLI's emitTodoEvents + fingerprint helpers
|
|
4
|
+
// (run_stream_events.go:786-847). Each snapshot carries the full todo map; this
|
|
5
|
+
// differ compares a lightweight {content,status} fingerprint per item and emits
|
|
6
|
+
// a single TodoUpdateEvent (with the full list) whenever anything is added,
|
|
7
|
+
// removed, or changed.
|
|
8
|
+
import { convertProtoTodos, mapTodoStatus } from "./convert.js";
|
|
9
|
+
/** Stateful todo differ: holds the last fingerprint snapshot across calls. */
|
|
10
|
+
export class TodoDiffer {
|
|
11
|
+
prev = new Map();
|
|
12
|
+
/** True once any todo has been recorded, until the list is emptied. Mirrors Go's `len(prevTodos) > 0` guard. */
|
|
13
|
+
get hasPrev() {
|
|
14
|
+
return this.prev.size > 0;
|
|
15
|
+
}
|
|
16
|
+
/** Diff the current todo map and return a TodoUpdateEvent when it changed. */
|
|
17
|
+
diff(todos) {
|
|
18
|
+
const current = buildFingerprints(todos);
|
|
19
|
+
if (!changed(this.prev, current))
|
|
20
|
+
return [];
|
|
21
|
+
this.prev = current;
|
|
22
|
+
return [{ kind: "todoUpdate", todos: convertProtoTodos(todos) }];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function buildFingerprints(todos) {
|
|
26
|
+
const fp = new Map();
|
|
27
|
+
for (const [id, item] of Object.entries(todos)) {
|
|
28
|
+
fp.set(id, { content: item.content, status: mapTodoStatus(item.status) });
|
|
29
|
+
}
|
|
30
|
+
return fp;
|
|
31
|
+
}
|
|
32
|
+
// True if the maps differ in size or any key's value. Detects add/remove/edit.
|
|
33
|
+
// Mirrors Go's todoFingerprintsChanged.
|
|
34
|
+
function changed(prev, current) {
|
|
35
|
+
if (prev.size !== current.size)
|
|
36
|
+
return true;
|
|
37
|
+
for (const [k, v] of current) {
|
|
38
|
+
const p = prev.get(k);
|
|
39
|
+
if (p === undefined || p.content !== v.content || p.status !== v.status)
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=todo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"todo.js","sourceRoot":"","sources":["../../../src/resources/stream/todo.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,EAAE;AACF,0DAA0D;AAC1D,gFAAgF;AAChF,gFAAgF;AAChF,4EAA4E;AAC5E,uBAAuB;AAGvB,OAAO,EAAE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,GAAG,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;IACvF,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ToolCall } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/message_pb";
|
|
2
|
+
import type { StreamEvent } from "./events.js";
|
|
3
|
+
/**
|
|
4
|
+
* Stateful tracker that converts successive tool-call snapshots into discrete
|
|
5
|
+
* lifecycle events. The state (last status + last streamed result per tool ID)
|
|
6
|
+
* persists across calls, so only genuine transitions produce events.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ToolStateTracker {
|
|
9
|
+
private readonly states;
|
|
10
|
+
private readonly results;
|
|
11
|
+
/**
|
|
12
|
+
* Diff `toolCalls` against tracked state and return the resulting events.
|
|
13
|
+
* `subAgentId` scopes the events for nested rendering ("" for top-level).
|
|
14
|
+
* Mirrors Go's trackToolCallStates branch-for-branch.
|
|
15
|
+
*/
|
|
16
|
+
track(toolCalls: readonly ToolCall[], subAgentId: string): StreamEvent[];
|
|
17
|
+
/**
|
|
18
|
+
* True if `id` has a tracked state, i.e. a stateful block already exists for
|
|
19
|
+
* it. Used to suppress a duplicate ToolResultEvent for a MESSAGE_TOOL the
|
|
20
|
+
* tracker already owns. Mirrors the membership check in Go's isTrackedToolMessage.
|
|
21
|
+
*/
|
|
22
|
+
has(id: string): boolean;
|
|
23
|
+
private running;
|
|
24
|
+
private waiting;
|
|
25
|
+
private completed;
|
|
26
|
+
}
|
|
27
|
+
/** The tool-call ID carried by a tool-lifecycle event, or "" otherwise. Mirrors Go's toolEventID. */
|
|
28
|
+
export declare function toolEventId(event: StreamEvent): string;
|
|
29
|
+
/** Index tool events by tool-call ID for chronological interleaving. Mirrors Go's buildToolEventMap. */
|
|
30
|
+
export declare function buildToolEventMap(events: readonly StreamEvent[]): Map<string, StreamEvent>;
|
|
31
|
+
//# sourceMappingURL=tool-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-state.d.ts","sourceRoot":"","sources":["../../../src/resources/stream/tool-state.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iEAAiE,CAAC;AAEhG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;GAIG;AACH,qBAAa,gBAAgB;IAE3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;IAEpD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IAErD;;;;OAIG;IACH,KAAK,CAAC,SAAS,EAAE,SAAS,QAAQ,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,WAAW,EAAE;IAqExE;;;;OAIG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIxB,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,SAAS;CAGlB;AAED,qGAAqG;AACrG,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAUtD;AAED,wGAAwG;AACxG,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAO1F"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// Tool-call state-transition tracking for the snapshot differ.
|
|
2
|
+
//
|
|
3
|
+
// Ports the Go CLI's trackToolCallStates (run_stream_events.go:597-695). Each
|
|
4
|
+
// snapshot carries the full tool-call list; this tracker diffs it against the
|
|
5
|
+
// last-known per-tool status/result to emit only the *transitions* (running,
|
|
6
|
+
// completed, waiting-approval, streaming delta). One tracker instance per scope:
|
|
7
|
+
// the top-level execution gets one, each sub-agent gets its own (matching Go's
|
|
8
|
+
// per-sub-agent tracker maps).
|
|
9
|
+
import { convertToolCall, isTerminalToolStatus, mapToolCallStatus } from "./convert.js";
|
|
10
|
+
/**
|
|
11
|
+
* Stateful tracker that converts successive tool-call snapshots into discrete
|
|
12
|
+
* lifecycle events. The state (last status + last streamed result per tool ID)
|
|
13
|
+
* persists across calls, so only genuine transitions produce events.
|
|
14
|
+
*/
|
|
15
|
+
export class ToolStateTracker {
|
|
16
|
+
// toolCallID -> last known status string.
|
|
17
|
+
states = new Map();
|
|
18
|
+
// toolCallID -> last known result content, for streaming-delta detection.
|
|
19
|
+
results = new Map();
|
|
20
|
+
/**
|
|
21
|
+
* Diff `toolCalls` against tracked state and return the resulting events.
|
|
22
|
+
* `subAgentId` scopes the events for nested rendering ("" for top-level).
|
|
23
|
+
* Mirrors Go's trackToolCallStates branch-for-branch.
|
|
24
|
+
*/
|
|
25
|
+
track(toolCalls, subAgentId) {
|
|
26
|
+
const pending = [];
|
|
27
|
+
for (const tc of toolCalls) {
|
|
28
|
+
if (tc.id === "")
|
|
29
|
+
continue;
|
|
30
|
+
const current = mapToolCallStatus(tc.status);
|
|
31
|
+
const seen = this.states.has(tc.id);
|
|
32
|
+
const prev = this.states.get(tc.id);
|
|
33
|
+
// First sight, already running: open a running block.
|
|
34
|
+
if (!seen && current === "running") {
|
|
35
|
+
pending.push(this.running(tc, subAgentId));
|
|
36
|
+
this.states.set(tc.id, current);
|
|
37
|
+
this.results.set(tc.id, tc.result);
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
// First sight, awaiting approval: open a waiting block.
|
|
41
|
+
if (!seen && current === "waiting_approval") {
|
|
42
|
+
pending.push(this.waiting(tc, subAgentId));
|
|
43
|
+
this.states.set(tc.id, current);
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
// First sight, already terminal (e.g. re-attach): synthesize completion so
|
|
47
|
+
// the block exists — otherwise its MESSAGE_TOOL is suppressed and it vanishes.
|
|
48
|
+
if (!seen && isTerminalToolStatus(current)) {
|
|
49
|
+
pending.push(this.completed(tc, subAgentId));
|
|
50
|
+
this.states.set(tc.id, current);
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
// running/waiting -> terminal: close the block.
|
|
54
|
+
if (seen && (prev === "running" || prev === "waiting_approval") && isTerminalToolStatus(current)) {
|
|
55
|
+
pending.push(this.completed(tc, subAgentId));
|
|
56
|
+
this.states.set(tc.id, current);
|
|
57
|
+
this.results.delete(tc.id);
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
// Any other status change: open running/waiting as appropriate.
|
|
61
|
+
if (current !== prev) {
|
|
62
|
+
if (current === "running") {
|
|
63
|
+
pending.push(this.running(tc, subAgentId));
|
|
64
|
+
this.results.set(tc.id, tc.result);
|
|
65
|
+
}
|
|
66
|
+
else if (current === "waiting_approval") {
|
|
67
|
+
pending.push(this.waiting(tc, subAgentId));
|
|
68
|
+
}
|
|
69
|
+
this.states.set(tc.id, current);
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
// Streaming content changed on a running tool: emit a delta.
|
|
73
|
+
if (current === "running" && tc.isStreaming && tc.result !== this.results.get(tc.id)) {
|
|
74
|
+
pending.push({
|
|
75
|
+
kind: "toolStreamDelta",
|
|
76
|
+
toolCallId: tc.id,
|
|
77
|
+
toolCall: convertToolCall(tc),
|
|
78
|
+
content: tc.result,
|
|
79
|
+
subAgentId,
|
|
80
|
+
});
|
|
81
|
+
this.results.set(tc.id, tc.result);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return pending;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* True if `id` has a tracked state, i.e. a stateful block already exists for
|
|
88
|
+
* it. Used to suppress a duplicate ToolResultEvent for a MESSAGE_TOOL the
|
|
89
|
+
* tracker already owns. Mirrors the membership check in Go's isTrackedToolMessage.
|
|
90
|
+
*/
|
|
91
|
+
has(id) {
|
|
92
|
+
return this.states.has(id);
|
|
93
|
+
}
|
|
94
|
+
running(tc, subAgentId) {
|
|
95
|
+
return { kind: "toolRunning", toolCallId: tc.id, toolCall: convertToolCall(tc), subAgentId };
|
|
96
|
+
}
|
|
97
|
+
waiting(tc, subAgentId) {
|
|
98
|
+
return { kind: "toolWaitingApproval", toolCallId: tc.id, toolCall: convertToolCall(tc), subAgentId };
|
|
99
|
+
}
|
|
100
|
+
completed(tc, subAgentId) {
|
|
101
|
+
return { kind: "toolCompleted", toolCallId: tc.id, toolCall: convertToolCall(tc), subAgentId };
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/** The tool-call ID carried by a tool-lifecycle event, or "" otherwise. Mirrors Go's toolEventID. */
|
|
105
|
+
export function toolEventId(event) {
|
|
106
|
+
switch (event.kind) {
|
|
107
|
+
case "toolRunning":
|
|
108
|
+
case "toolCompleted":
|
|
109
|
+
case "toolWaitingApproval":
|
|
110
|
+
case "toolStreamDelta":
|
|
111
|
+
return event.toolCallId;
|
|
112
|
+
default:
|
|
113
|
+
return "";
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/** Index tool events by tool-call ID for chronological interleaving. Mirrors Go's buildToolEventMap. */
|
|
117
|
+
export function buildToolEventMap(events) {
|
|
118
|
+
const m = new Map();
|
|
119
|
+
for (const ev of events) {
|
|
120
|
+
const id = toolEventId(ev);
|
|
121
|
+
if (id !== "")
|
|
122
|
+
m.set(id, ev);
|
|
123
|
+
}
|
|
124
|
+
return m;
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=tool-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-state.js","sourceRoot":"","sources":["../../../src/resources/stream/tool-state.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,iFAAiF;AACjF,+EAA+E;AAC/E,+BAA+B;AAG/B,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,iBAAiB,EA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AAC,EAAE,EAAE,QAAQ,EAAE,eAAe,CAAC,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC;IACjG,CAAC;CACF;AAED,qGAAqG;AACrG,MAAM,UAAU,WAAW,CAAC,KAAkB;IAC5C,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,aAAa,CAAC;QACnB,KAAK,eAAe,CAAC;QACrB,KAAK,qBAAqB,CAAC;QAC3B,KAAK,iBAAiB;YACpB,OAAO,KAAK,CAAC,UAAU,CAAC;QAC1B;YACE,OAAO,EAAE,CAAC;IACd,CAAC;AACH,CAAC;AAED,wGAAwG;AACxG,MAAM,UAAU,iBAAiB,CAAC,MAA8B;IAC9D,MAAM,CAAC,GAAG,IAAI,GAAG,EAAuB,CAAC;IACzC,KAAK,MAAM,EAAE,IAAI,MAAM,EAAE,CAAC;QACxB,MAAM,EAAE,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC;QAC3B,IAAI,EAAE,KAAK,EAAE;YAAE,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the terminal can host the interactive Ink renderer: stdout must be a
|
|
3
|
+
* TTY and TERM must not be "dumb". When false, the command uses plaintext.
|
|
4
|
+
*/
|
|
5
|
+
export declare function isInkSupported(stream?: {
|
|
6
|
+
isTTY?: boolean;
|
|
7
|
+
}): boolean;
|
|
8
|
+
//# sourceMappingURL=tty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tty.d.ts","sourceRoot":"","sources":["../../../src/resources/stream/tty.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAmB,GAAG,OAAO,CAGpF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Terminal-capability gate for renderer selection.
|
|
2
|
+
//
|
|
3
|
+
// Deliberately free of any React/Ink imports so the command can decide whether
|
|
4
|
+
// to take the interactive path *before* paying the dynamic-import cost of
|
|
5
|
+
// ink.tsx (DD-001 lazy boundary). Mirrors Go's termctl.IsSupported.
|
|
6
|
+
/**
|
|
7
|
+
* Whether the terminal can host the interactive Ink renderer: stdout must be a
|
|
8
|
+
* TTY and TERM must not be "dumb". When false, the command uses plaintext.
|
|
9
|
+
*/
|
|
10
|
+
export function isInkSupported(stream = process.stdout) {
|
|
11
|
+
if (stream.isTTY !== true)
|
|
12
|
+
return false;
|
|
13
|
+
return process.env.TERM !== "dumb";
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=tty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tty.js","sourceRoot":"","sources":["../../../src/resources/stream/tty.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,+EAA+E;AAC/E,0EAA0E;AAC1E,oEAAoE;AAEpE;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,SAA8B,OAAO,CAAC,MAAM;IACzE,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACxC,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type WorkflowExecutionEvent, WorkflowEventType } from "@stigmer/protos/ai/stigmer/agentic/workflowexecution/v1/event_pb";
|
|
2
|
+
/** Color intent for an event line; the renderer maps this to ANSI (or nothing). */
|
|
3
|
+
export type EventTone = "success" | "error" | "warning" | "info" | "muted";
|
|
4
|
+
/** A renderer-agnostic view of one workflow event. */
|
|
5
|
+
export interface WorkflowEventView {
|
|
6
|
+
/** HH:MM:SS slice of occurred_at, or "--------" when absent. */
|
|
7
|
+
readonly time: string;
|
|
8
|
+
/** Leading glyph (▶ ✓ ✗ → …); empty for the generic fallback line. */
|
|
9
|
+
readonly glyph: string;
|
|
10
|
+
/** Tone applied to the glyph. */
|
|
11
|
+
readonly tone: EventTone;
|
|
12
|
+
/** Human sentence describing the event. */
|
|
13
|
+
readonly text: string;
|
|
14
|
+
/** True when this event marks a terminal execution phase. */
|
|
15
|
+
readonly terminal: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** Canonical WorkflowEventType name (e.g. "execution_started") for NDJSON `type`. */
|
|
18
|
+
export declare function workflowEventTypeName(type: WorkflowEventType): string;
|
|
19
|
+
/** Map a workflow event to its display view. Switches on the typed oneof payload. */
|
|
20
|
+
export declare function toWorkflowEventView(event: WorkflowExecutionEvent): WorkflowEventView;
|
|
21
|
+
//# sourceMappingURL=workflow-event-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-event-view.d.ts","sourceRoot":"","sources":["../../../src/resources/stream/workflow-event-view.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,KAAK,sBAAsB,EAC3B,iBAAiB,EAClB,MAAM,kEAAkE,CAAC;AAE1E,mFAAmF;AACnF,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3E,sDAAsD;AACtD,MAAM,WAAW,iBAAiB;IAChC,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sEAAsE;IACtE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,iCAAiC;IACjC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,2CAA2C;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED,qFAAqF;AACrF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAErE;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,sBAAsB,GAAG,iBAAiB,CAwDpF"}
|