@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,56 @@
|
|
|
1
|
+
// In-process Ink renderer for the interactive (TTY) stream path.
|
|
2
|
+
//
|
|
3
|
+
// Go spawns a separate `stigmer-ink` subprocess (sdk/ink/src/cli/stigmer-ink.tsx)
|
|
4
|
+
// and pipes session config to it. Here the CLI *is* a TS process, so we render
|
|
5
|
+
// Ink in-process and — crucially — reuse the CLI's already-authenticated client
|
|
6
|
+
// via InkStigmerProvider rather than letting SessionApp build its own. SessionView
|
|
7
|
+
// (from @stigmer/ink) owns the live conversation: history, streaming, approvals,
|
|
8
|
+
// and a follow-up composer.
|
|
9
|
+
//
|
|
10
|
+
// This module is only ever reached through a dynamic import() in the command
|
|
11
|
+
// action (DD-001), so React/Ink load lazily — non-streaming commands never pay
|
|
12
|
+
// for them. Within this already-lazy module, ordinary JSX/imports are fine.
|
|
13
|
+
|
|
14
|
+
import React from "react";
|
|
15
|
+
import { render } from "ink";
|
|
16
|
+
import { InkStigmerProvider, SessionView, type InteractionMode } from "@stigmer/ink";
|
|
17
|
+
import type { DeploymentMode, Stigmer } from "@stigmer/sdk";
|
|
18
|
+
|
|
19
|
+
export interface InkSessionOptions {
|
|
20
|
+
/** The CLI's configured, refreshing-token client (backend.stigmer). */
|
|
21
|
+
readonly client: Stigmer;
|
|
22
|
+
readonly sessionId: string;
|
|
23
|
+
/** Org slug, for follow-up executions created from the composer. */
|
|
24
|
+
readonly org: string;
|
|
25
|
+
/** Initial interaction mode; the user can toggle with Ctrl+T. */
|
|
26
|
+
readonly mode: InteractionMode;
|
|
27
|
+
/** Feature-gating mode; "cloud" unless the CLI targets a local backend. */
|
|
28
|
+
readonly deploymentMode?: DeploymentMode;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Render a live session in the terminal and resolve when the user exits (Ctrl+C
|
|
33
|
+
* unmounts the app). This NEVER calls process.exit — the caller still runs its
|
|
34
|
+
* epilogue (final Get + usage). Termination signals unmount the Ink tree so the
|
|
35
|
+
* terminal is restored cleanly, but control returns here rather than killing
|
|
36
|
+
* the host process.
|
|
37
|
+
*/
|
|
38
|
+
export async function runInkSession(opts: InkSessionOptions): Promise<void> {
|
|
39
|
+
const instance = render(
|
|
40
|
+
<InkStigmerProvider client={opts.client} deploymentMode={opts.deploymentMode ?? "cloud"}>
|
|
41
|
+
<SessionView sessionId={opts.sessionId} org={opts.org} mode={opts.mode} />
|
|
42
|
+
</InkStigmerProvider>,
|
|
43
|
+
{ exitOnCtrlC: true },
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const onSignal = (): void => instance.unmount();
|
|
47
|
+
process.once("SIGINT", onSignal);
|
|
48
|
+
process.once("SIGTERM", onSignal);
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
await instance.waitUntilExit();
|
|
52
|
+
} finally {
|
|
53
|
+
process.removeListener("SIGINT", onSignal);
|
|
54
|
+
process.removeListener("SIGTERM", onSignal);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// DD-001 boundary guard: React/Ink must load lazily so non-streaming commands
|
|
2
|
+
// and `--help` never pay for them. This codifies the boundary structurally so a
|
|
3
|
+
// regression (a stray static import) fails CI instead of silently slowing every
|
|
4
|
+
// command. The one allowed static importer is ink.tsx, which is itself only ever
|
|
5
|
+
// reached through a dynamic import().
|
|
6
|
+
|
|
7
|
+
import { readFileSync, readdirSync } from "node:fs";
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
import { describe, expect, it } from "vitest";
|
|
11
|
+
|
|
12
|
+
const SRC_ROOT = fileURLToPath(new URL("../..", import.meta.url));
|
|
13
|
+
// The only modules allowed to statically import react/ink/@stigmer/ink. Each is
|
|
14
|
+
// itself reached exclusively through a dynamic import() in a command action, so
|
|
15
|
+
// the heavy graph stays out of every non-interactive path (DD-001).
|
|
16
|
+
const INK_MODULES = [
|
|
17
|
+
join(SRC_ROOT, "resources/stream/ink.tsx"),
|
|
18
|
+
join(SRC_ROOT, "resources/picker/ink.tsx"),
|
|
19
|
+
];
|
|
20
|
+
const STATIC_HEAVY_IMPORT = /^\s*import\s+[^;]*?from\s+["'](?:react|ink|@stigmer\/ink)["']/m;
|
|
21
|
+
|
|
22
|
+
function walk(dir: string): string[] {
|
|
23
|
+
const out: string[] = [];
|
|
24
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
25
|
+
const path = join(dir, entry.name);
|
|
26
|
+
if (entry.isDirectory()) out.push(...walk(path));
|
|
27
|
+
else if (/\.(ts|tsx)$/.test(entry.name)) out.push(path);
|
|
28
|
+
}
|
|
29
|
+
return out;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
describe("lazy-import boundary (DD-001)", () => {
|
|
33
|
+
it("only the lazy Ink entrypoints statically import react/ink/@stigmer/ink", () => {
|
|
34
|
+
const offenders = walk(SRC_ROOT)
|
|
35
|
+
.filter((path) => !INK_MODULES.includes(path))
|
|
36
|
+
.filter((path) => STATIC_HEAVY_IMPORT.test(readFileSync(path, "utf8")));
|
|
37
|
+
expect(offenders).toEqual([]);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it("the Ink entrypoints are reached only through dynamic import()", () => {
|
|
41
|
+
const staticImporters = walk(SRC_ROOT).filter((path) => {
|
|
42
|
+
if (INK_MODULES.includes(path)) return false;
|
|
43
|
+
const src = readFileSync(path, "utf8");
|
|
44
|
+
return /^\s*import\s+[^;]*?from\s+["'][^"']*(?:stream|picker)\/ink(?:\.js)?["']/m.test(src);
|
|
45
|
+
});
|
|
46
|
+
expect(staticImporters).toEqual([]);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// The workflow run stream renders over a CLI-local plaintext/NDJSON renderer
|
|
50
|
+
// (no Ink WorkflowView this round), so it must stay out of the React/Ink graph.
|
|
51
|
+
it("workflow-stream.ts has no static react/ink imports", () => {
|
|
52
|
+
const src = readFileSync(join(SRC_ROOT, "resources/run/workflow-stream.ts"), "utf8");
|
|
53
|
+
expect(STATIC_HEAVY_IMPORT.test(src)).toBe(false);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// `connect` renders plaintext only; its command + resources stay Ink-free.
|
|
57
|
+
it("connect command and resources have no static react/ink imports", () => {
|
|
58
|
+
for (const rel of ["commands/connect.ts", "resources/connect/connect.ts", "resources/connect/display.ts"]) {
|
|
59
|
+
const src = readFileSync(join(SRC_ROOT, rel), "utf8");
|
|
60
|
+
expect(STATIC_HEAVY_IMPORT.test(src)).toBe(false);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
});
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// Golden-line tests for the NDJSON renderer: event type strings, payload shape,
|
|
2
|
+
// and Go-parity payload cleaning (empty strings dropped, false/0 kept).
|
|
3
|
+
|
|
4
|
+
import { describe, expect, it } from "vitest";
|
|
5
|
+
import { ApprovalAction } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
6
|
+
import type { StreamEvent, ToolCallInfo } from "./events.js";
|
|
7
|
+
import { NdjsonRenderer } from "./render-ndjson.js";
|
|
8
|
+
|
|
9
|
+
const FIXED_TS = "2026-01-01T00:00:00.000Z";
|
|
10
|
+
|
|
11
|
+
function buffer(): {
|
|
12
|
+
writer: { write(s: string): void };
|
|
13
|
+
raw: () => string;
|
|
14
|
+
lines: () => Array<Record<string, unknown>>;
|
|
15
|
+
} {
|
|
16
|
+
let raw = "";
|
|
17
|
+
return {
|
|
18
|
+
writer: { write: (s: string) => void (raw += s) },
|
|
19
|
+
raw: () => raw,
|
|
20
|
+
lines: () =>
|
|
21
|
+
raw
|
|
22
|
+
.split("\n")
|
|
23
|
+
.filter((l) => l !== "")
|
|
24
|
+
.map((l) => JSON.parse(l) as Record<string, unknown>),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function renderer(defaultAction = ApprovalAction.SKIP) {
|
|
29
|
+
const data = buffer();
|
|
30
|
+
const status = buffer();
|
|
31
|
+
const r = new NdjsonRenderer({ data: data.writer, status: status.writer, defaultAction, now: () => FIXED_TS });
|
|
32
|
+
return { r, data, status };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function toolInfo(overrides: Partial<ToolCallInfo> = {}): ToolCallInfo {
|
|
36
|
+
return { id: "", name: "read", status: "running", args: undefined, result: "", error: "", durationMs: 0, ...overrides };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function render(events: StreamEvent[], defaultAction = ApprovalAction.SKIP) {
|
|
40
|
+
const ctx = renderer(defaultAction);
|
|
41
|
+
for (const e of events) ctx.r.render(e);
|
|
42
|
+
return ctx;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
describe("envelope", () => {
|
|
46
|
+
it("wraps each event as {type, ts, payload} and strips empty payload fields", () => {
|
|
47
|
+
const { data } = render([{ kind: "aiStreamDelta", content: "", subAgentId: "" }]);
|
|
48
|
+
const [line] = data.lines();
|
|
49
|
+
expect(line.type).toBe("ai_stream_delta");
|
|
50
|
+
expect(line.ts).toBe(FIXED_TS);
|
|
51
|
+
expect(line.payload).toEqual({});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("keeps boolean false and present strings", () => {
|
|
55
|
+
const { data } = render([
|
|
56
|
+
{ kind: "approvalNeeded", toolCallId: "t1", toolName: "delete", argsPreview: "", message: "ok", fromSubAgent: false, subAgentName: "" },
|
|
57
|
+
]);
|
|
58
|
+
const [line] = data.lines();
|
|
59
|
+
expect(line.type).toBe("approval_needed");
|
|
60
|
+
expect(line.payload).toEqual({ tool_call_id: "t1", tool_name: "delete", message: "ok", from_sub_agent: false });
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
describe("tool events", () => {
|
|
65
|
+
it("emits tool_running with only the meaningful fields", () => {
|
|
66
|
+
const { data } = render([
|
|
67
|
+
{ kind: "toolRunning", toolCallId: "t1", subAgentId: "", toolCall: toolInfo({ id: "t1", result: "out", durationMs: 42 }) },
|
|
68
|
+
]);
|
|
69
|
+
expect(data.lines()[0]).toMatchObject({
|
|
70
|
+
type: "tool_running",
|
|
71
|
+
payload: { tool_call_id: "t1", tool_name: "read", status: "running", result: "out", duration_ms: 42 },
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it("includes tool_calls in ai_stream_end, omits when empty", () => {
|
|
76
|
+
const { data } = render([
|
|
77
|
+
{ kind: "aiStreamEnd", content: "done", subAgentId: "", toolCalls: [toolInfo({ id: "t1", status: "completed" })] },
|
|
78
|
+
{ kind: "aiMessage", content: "x", subAgentId: "", toolCalls: [] },
|
|
79
|
+
]);
|
|
80
|
+
const [end, msg] = data.lines();
|
|
81
|
+
expect((end.payload as Record<string, unknown>).tool_calls).toEqual([{ name: "read", status: "completed", id: "t1" }]);
|
|
82
|
+
expect((msg.payload as Record<string, unknown>).tool_calls).toBeUndefined();
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
describe("done", () => {
|
|
87
|
+
it("drops an empty error but keeps a present one", () => {
|
|
88
|
+
const { data } = render([
|
|
89
|
+
{ kind: "done", phase: "completed", error: "" },
|
|
90
|
+
{ kind: "done", phase: "failed", error: "boom" },
|
|
91
|
+
]);
|
|
92
|
+
const [ok, fail] = data.lines();
|
|
93
|
+
expect(ok.payload).toEqual({ phase: "completed" });
|
|
94
|
+
expect(fail.payload).toEqual({ phase: "failed", error: "boom" });
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
describe("approval policy", () => {
|
|
99
|
+
it("honors the configured default action without warning", () => {
|
|
100
|
+
const { r, status } = renderer(ApprovalAction.APPROVE);
|
|
101
|
+
const action = r.resolveApproval({
|
|
102
|
+
kind: "approvalNeeded", toolCallId: "t1", toolName: "delete", argsPreview: "", message: "", fromSubAgent: false, subAgentName: "",
|
|
103
|
+
});
|
|
104
|
+
expect(action).toBe(ApprovalAction.APPROVE);
|
|
105
|
+
expect(status.lines()).toHaveLength(0);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it("auto-skips with a stderr warning when no default is set", () => {
|
|
109
|
+
const { r, status } = renderer(ApprovalAction.UNSPECIFIED);
|
|
110
|
+
const action = r.resolveApproval({
|
|
111
|
+
kind: "approvalNeeded", toolCallId: "t1", toolName: "delete", argsPreview: "", message: "", fromSubAgent: false, subAgentName: "",
|
|
112
|
+
});
|
|
113
|
+
expect(action).toBe(ApprovalAction.SKIP);
|
|
114
|
+
expect(status.raw()).toContain("auto-skipping approval for delete");
|
|
115
|
+
});
|
|
116
|
+
});
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// NDJSON headless renderer: StreamEvent → Go's run --json wire taxonomy.
|
|
2
|
+
//
|
|
3
|
+
// Mirrors run_stream_json.go's handleJSONEvent one case at a time — the event
|
|
4
|
+
// `type` strings and payload keys are a parity contract (DD-005). The envelope
|
|
5
|
+
// + payload cleaning live in output/ndjson.ts; this module only maps events to
|
|
6
|
+
// `{type, payload}` and applies the headless approval policy.
|
|
7
|
+
|
|
8
|
+
import { ndjsonEnvelope, writeNdjson } from "../../output/ndjson.js";
|
|
9
|
+
import { ApprovalAction } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
10
|
+
import type { ToolCallInfo, ApprovalNeededEvent, StreamEvent } from "./events.js";
|
|
11
|
+
import type { HeadlessRenderer } from "./headless.js";
|
|
12
|
+
|
|
13
|
+
/** A minimal output sink (process.stdout/stderr or a test buffer). */
|
|
14
|
+
export interface LineWriter {
|
|
15
|
+
write(chunk: string): unknown;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface NdjsonRendererOptions {
|
|
19
|
+
/** NDJSON event lines (stdout). */
|
|
20
|
+
readonly data: LineWriter;
|
|
21
|
+
/** Fatal/auto-skip diagnostics (stderr). */
|
|
22
|
+
readonly status: LineWriter;
|
|
23
|
+
/** Approval default; UNSPECIFIED means auto-skip with a warning. */
|
|
24
|
+
readonly defaultAction: ApprovalAction;
|
|
25
|
+
/** Injectable clock for deterministic tests. */
|
|
26
|
+
readonly now?: () => string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Writes one `{type, ts, payload}` line per event; auto-resolves approvals. */
|
|
30
|
+
export class NdjsonRenderer implements HeadlessRenderer {
|
|
31
|
+
constructor(private readonly opts: NdjsonRendererOptions) {}
|
|
32
|
+
|
|
33
|
+
render(event: StreamEvent): void {
|
|
34
|
+
const mapped = mapToNdjson(event);
|
|
35
|
+
if (mapped !== undefined) {
|
|
36
|
+
writeNdjson(this.opts.data, ndjsonEnvelope(mapped.type, mapped.payload, this.opts.now));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// JSON mode has no interactive prompt: honor --approve-default, else skip with
|
|
41
|
+
// a warning to stderr. Mirrors run_stream_json.go's resolveJSONApproval.
|
|
42
|
+
resolveApproval(event: ApprovalNeededEvent): ApprovalAction {
|
|
43
|
+
if (this.opts.defaultAction === ApprovalAction.UNSPECIFIED) {
|
|
44
|
+
this.opts.status.write(`⚠ No --approve-default set; auto-skipping approval for ${event.toolName}\n`);
|
|
45
|
+
return ApprovalAction.SKIP;
|
|
46
|
+
}
|
|
47
|
+
return this.opts.defaultAction;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface MappedEvent {
|
|
52
|
+
readonly type: string;
|
|
53
|
+
readonly payload: Record<string, unknown>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Map one event to its NDJSON type + raw payload (cleaned later). The arms are
|
|
57
|
+
// 1:1 with handleJSONEvent so the wire output stays byte-faithful.
|
|
58
|
+
function mapToNdjson(event: StreamEvent): MappedEvent | undefined {
|
|
59
|
+
switch (event.kind) {
|
|
60
|
+
case "aiStreamStart":
|
|
61
|
+
return { type: "ai_stream_start", payload: { content: event.content, sub_agent_id: event.subAgentId } };
|
|
62
|
+
case "aiStreamDelta":
|
|
63
|
+
return { type: "ai_stream_delta", payload: { content: event.content, sub_agent_id: event.subAgentId } };
|
|
64
|
+
case "aiStreamEnd":
|
|
65
|
+
return {
|
|
66
|
+
type: "ai_stream_end",
|
|
67
|
+
payload: { content: event.content, tool_calls: toolCallsToJson(event.toolCalls), sub_agent_id: event.subAgentId },
|
|
68
|
+
};
|
|
69
|
+
case "aiMessage":
|
|
70
|
+
return {
|
|
71
|
+
type: "ai_message",
|
|
72
|
+
payload: { content: event.content, tool_calls: toolCallsToJson(event.toolCalls), sub_agent_id: event.subAgentId },
|
|
73
|
+
};
|
|
74
|
+
case "humanMessage":
|
|
75
|
+
return { type: "human_message", payload: { content: event.content } };
|
|
76
|
+
case "toolRunning":
|
|
77
|
+
return { type: "tool_running", payload: toolEventPayload(event.toolCallId, event.toolCall, event.subAgentId) };
|
|
78
|
+
case "toolCompleted":
|
|
79
|
+
return { type: "tool_completed", payload: toolEventPayload(event.toolCallId, event.toolCall, event.subAgentId) };
|
|
80
|
+
case "toolWaitingApproval":
|
|
81
|
+
return {
|
|
82
|
+
type: "tool_waiting_approval",
|
|
83
|
+
payload: toolEventPayload(event.toolCallId, event.toolCall, event.subAgentId),
|
|
84
|
+
};
|
|
85
|
+
case "toolStreamDelta":
|
|
86
|
+
return {
|
|
87
|
+
type: "tool_stream_delta",
|
|
88
|
+
payload: {
|
|
89
|
+
tool_call_id: event.toolCallId,
|
|
90
|
+
tool_name: event.toolCall.name,
|
|
91
|
+
content: event.content,
|
|
92
|
+
sub_agent_id: event.subAgentId,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
case "systemMessage":
|
|
96
|
+
return { type: "system_message", payload: { content: event.content } };
|
|
97
|
+
case "phaseChange":
|
|
98
|
+
return { type: "phase_change", payload: { phase: event.phase, previous: event.previous } };
|
|
99
|
+
case "approvalNeeded":
|
|
100
|
+
return {
|
|
101
|
+
type: "approval_needed",
|
|
102
|
+
payload: {
|
|
103
|
+
tool_call_id: event.toolCallId,
|
|
104
|
+
tool_name: event.toolName,
|
|
105
|
+
args_preview: event.argsPreview,
|
|
106
|
+
message: event.message,
|
|
107
|
+
from_sub_agent: event.fromSubAgent,
|
|
108
|
+
sub_agent_name: event.subAgentName,
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
case "todoUpdate":
|
|
112
|
+
return {
|
|
113
|
+
type: "todo_update",
|
|
114
|
+
payload: { todos: event.todos.map((t) => ({ id: t.id, content: t.content, status: t.status })) },
|
|
115
|
+
};
|
|
116
|
+
case "contextCompacted":
|
|
117
|
+
return {
|
|
118
|
+
type: "context_compacted",
|
|
119
|
+
payload: {
|
|
120
|
+
source: event.source,
|
|
121
|
+
tokens_before: event.tokensBefore,
|
|
122
|
+
tokens_after: event.tokensAfter,
|
|
123
|
+
compression_ratio: event.compressionRatio,
|
|
124
|
+
duration_ms: event.durationMs,
|
|
125
|
+
messages_before: event.messagesBefore,
|
|
126
|
+
messages_after: event.messagesAfter,
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
case "subAgentStarted":
|
|
130
|
+
return {
|
|
131
|
+
type: "sub_agent_started",
|
|
132
|
+
payload: { id: event.id, name: event.name, description: event.description },
|
|
133
|
+
};
|
|
134
|
+
case "subAgentCompleted":
|
|
135
|
+
return {
|
|
136
|
+
type: "sub_agent_completed",
|
|
137
|
+
payload: { id: event.id, status: event.status, tool_count: event.toolCount, output: event.output },
|
|
138
|
+
};
|
|
139
|
+
case "done":
|
|
140
|
+
return { type: "done", payload: { phase: event.phase, error: event.error } };
|
|
141
|
+
case "streamError":
|
|
142
|
+
return { type: "stream_error", payload: { error: event.error } };
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// The shared payload for tool-lifecycle events. Mirrors Go's toolEventPayload:
|
|
147
|
+
// args/result/error/duration are only present when meaningful. Empty strings are
|
|
148
|
+
// stripped later by cleanNdjsonPayload.
|
|
149
|
+
function toolEventPayload(toolCallId: string, tc: ToolCallInfo, subAgentId: string): Record<string, unknown> {
|
|
150
|
+
return {
|
|
151
|
+
tool_call_id: toolCallId,
|
|
152
|
+
tool_name: tc.name,
|
|
153
|
+
status: tc.status,
|
|
154
|
+
sub_agent_id: subAgentId,
|
|
155
|
+
args: tc.args,
|
|
156
|
+
result: tc.result,
|
|
157
|
+
error: tc.error,
|
|
158
|
+
duration_ms: tc.durationMs > 0 ? tc.durationMs : undefined,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Convert a tool-call list to JSON maps, returning undefined for an empty list
|
|
163
|
+
// (so the field is dropped). Inner maps keep name+status; the rest are omitted
|
|
164
|
+
// when empty. Mirrors Go's toolCallsToJSON.
|
|
165
|
+
function toolCallsToJson(tcs: readonly ToolCallInfo[]): Array<Record<string, unknown>> | undefined {
|
|
166
|
+
if (tcs.length === 0) return undefined;
|
|
167
|
+
return tcs.map((tc) => {
|
|
168
|
+
const m: Record<string, unknown> = { name: tc.name, status: tc.status };
|
|
169
|
+
if (tc.id !== "") m.id = tc.id;
|
|
170
|
+
if (tc.args !== undefined) m.args = tc.args;
|
|
171
|
+
if (tc.result !== "") m.result = tc.result;
|
|
172
|
+
if (tc.error !== "") m.error = tc.error;
|
|
173
|
+
if (tc.durationMs > 0) m.duration_ms = tc.durationMs;
|
|
174
|
+
return m;
|
|
175
|
+
});
|
|
176
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// Tests for the plaintext renderer: AI text to data, terse status lines to
|
|
2
|
+
// status, approvals auto-skipped, untracked event kinds silent.
|
|
3
|
+
|
|
4
|
+
import { describe, expect, it } from "vitest";
|
|
5
|
+
import { ApprovalAction } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
6
|
+
import type { StreamEvent, ToolCallInfo } from "./events.js";
|
|
7
|
+
import { PlaintextRenderer } from "./render-plaintext.js";
|
|
8
|
+
|
|
9
|
+
function toolInfo(overrides: Partial<ToolCallInfo> = {}): ToolCallInfo {
|
|
10
|
+
return { id: "t1", name: "read", status: "completed", result: "", error: "", durationMs: 0, ...overrides };
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function render(events: StreamEvent[]): { data: string; status: string } {
|
|
14
|
+
let data = "";
|
|
15
|
+
let status = "";
|
|
16
|
+
const r = new PlaintextRenderer({ data: { write: (s) => void (data += s) }, status: { write: (s) => void (status += s) } });
|
|
17
|
+
for (const e of events) r.render(e);
|
|
18
|
+
return { data, status };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
describe("PlaintextRenderer", () => {
|
|
22
|
+
it("streams AI text to data and finalizes on stream end", () => {
|
|
23
|
+
const { data } = render([
|
|
24
|
+
{ kind: "aiStreamDelta", content: "Hello", subAgentId: "" },
|
|
25
|
+
{ kind: "aiStreamDelta", content: " world", subAgentId: "" },
|
|
26
|
+
{ kind: "aiStreamEnd", content: "Hello world", subAgentId: "", toolCalls: [] },
|
|
27
|
+
]);
|
|
28
|
+
expect(data).toBe("Hello world\n");
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("writes tool success and failure lines to status", () => {
|
|
32
|
+
const { status } = render([
|
|
33
|
+
{ kind: "toolRunning", toolCallId: "t1", subAgentId: "", toolCall: toolInfo({ status: "running" }) },
|
|
34
|
+
{ kind: "toolCompleted", toolCallId: "t1", subAgentId: "", toolCall: toolInfo() },
|
|
35
|
+
{ kind: "toolCompleted", toolCallId: "t2", subAgentId: "", toolCall: toolInfo({ name: "shell", error: "exploded" }) },
|
|
36
|
+
]);
|
|
37
|
+
expect(status).toContain("⠋ read");
|
|
38
|
+
expect(status).toContain("✓ read");
|
|
39
|
+
expect(status).toContain("✗ shell: exploded");
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("notes the auto-skip for approvals and resolves to SKIP", () => {
|
|
43
|
+
const r = new PlaintextRenderer({ data: { write: () => {} }, status: { write: () => {} } });
|
|
44
|
+
const action = r.resolveApproval({
|
|
45
|
+
kind: "approvalNeeded", toolCallId: "t1", toolName: "delete", argsPreview: "", message: "", fromSubAgent: false, subAgentName: "",
|
|
46
|
+
});
|
|
47
|
+
expect(action).toBe(ApprovalAction.SKIP);
|
|
48
|
+
|
|
49
|
+
const { status } = render([
|
|
50
|
+
{ kind: "approvalNeeded", toolCallId: "t1", toolName: "delete", argsPreview: "", message: "", fromSubAgent: false, subAgentName: "" },
|
|
51
|
+
]);
|
|
52
|
+
expect(status).toContain("Approval needed: delete (auto-skipped in non-TTY mode)");
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("renders sub-agent and context-compaction lines, stays silent on phase/done", () => {
|
|
56
|
+
const { data, status } = render([
|
|
57
|
+
{ kind: "subAgentStarted", id: "s1", name: "researcher", description: "Explore code", input: "" },
|
|
58
|
+
{ kind: "subAgentCompleted", id: "s1", status: "SUB_AGENT_COMPLETED", toolCount: 2, output: "" },
|
|
59
|
+
{ kind: "contextCompacted", source: "graph_start", tokensBefore: 12000, tokensAfter: 6000, compressionRatio: 0.5, durationMs: 10, messagesBefore: 8, messagesAfter: 3 },
|
|
60
|
+
{ kind: "phaseChange", phase: "in_progress", previous: "pending" },
|
|
61
|
+
{ kind: "done", phase: "completed", error: "" },
|
|
62
|
+
]);
|
|
63
|
+
expect(status).toContain("↳ Sub-agent: Explore code");
|
|
64
|
+
expect(status).toContain("✓ Sub-agent completed: s1");
|
|
65
|
+
expect(status).toContain("Context compacted (12K → 6K tokens)");
|
|
66
|
+
expect(data).toBe("");
|
|
67
|
+
});
|
|
68
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Plaintext headless renderer for non-TTY output (piped stdout).
|
|
2
|
+
//
|
|
3
|
+
// Mirrors Go's streamAgentPlainText (run_stream_plaintext.go): clean AI text to
|
|
4
|
+
// the data sink (stdout), terse tool/status lines to the status sink (stderr).
|
|
5
|
+
// No ANSI, no frames. Approvals are auto-skipped — there is no keyboard here;
|
|
6
|
+
// use --json for a machine-readable non-TTY stream. Phase/done/stream-error are
|
|
7
|
+
// not rendered: the driver returns the outcome and the command surfaces it.
|
|
8
|
+
|
|
9
|
+
import { ApprovalAction } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
10
|
+
import type { ApprovalNeededEvent, StreamEvent } from "./events.js";
|
|
11
|
+
import type { HeadlessRenderer } from "./headless.js";
|
|
12
|
+
import type { LineWriter } from "./render-ndjson.js";
|
|
13
|
+
|
|
14
|
+
export interface PlaintextRendererOptions {
|
|
15
|
+
/** AI text output (stdout). */
|
|
16
|
+
readonly data: LineWriter;
|
|
17
|
+
/** Tool/status/diagnostic lines (stderr). */
|
|
18
|
+
readonly status: LineWriter;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const MAX_ERROR_LEN = 100;
|
|
22
|
+
|
|
23
|
+
/** Renders a terse, ANSI-free transcript; auto-skips every approval. */
|
|
24
|
+
export class PlaintextRenderer implements HeadlessRenderer {
|
|
25
|
+
constructor(private readonly opts: PlaintextRendererOptions) {}
|
|
26
|
+
|
|
27
|
+
render(event: StreamEvent): void {
|
|
28
|
+
const { data, status } = this.opts;
|
|
29
|
+
switch (event.kind) {
|
|
30
|
+
case "aiStreamDelta":
|
|
31
|
+
data.write(event.content);
|
|
32
|
+
return;
|
|
33
|
+
case "aiStreamEnd":
|
|
34
|
+
data.write("\n");
|
|
35
|
+
return;
|
|
36
|
+
case "aiMessage":
|
|
37
|
+
if (event.content !== "") data.write(`${event.content}\n`);
|
|
38
|
+
return;
|
|
39
|
+
case "humanMessage":
|
|
40
|
+
status.write(`\n> ${event.content}\n\n`);
|
|
41
|
+
return;
|
|
42
|
+
case "toolRunning":
|
|
43
|
+
status.write(` ⠋ ${event.toolCall.name}\n`);
|
|
44
|
+
return;
|
|
45
|
+
case "toolCompleted":
|
|
46
|
+
status.write(
|
|
47
|
+
event.toolCall.error !== ""
|
|
48
|
+
? ` ✗ ${event.toolCall.name}: ${truncate(event.toolCall.error, MAX_ERROR_LEN)}\n`
|
|
49
|
+
: ` ✓ ${event.toolCall.name}\n`,
|
|
50
|
+
);
|
|
51
|
+
return;
|
|
52
|
+
case "approvalNeeded":
|
|
53
|
+
status.write(` ⚠ Approval needed: ${event.toolName} (auto-skipped in non-TTY mode)\n`);
|
|
54
|
+
return;
|
|
55
|
+
case "subAgentStarted":
|
|
56
|
+
status.write(` ↳ Sub-agent: ${event.description !== "" ? event.description : event.name}\n`);
|
|
57
|
+
return;
|
|
58
|
+
case "subAgentCompleted":
|
|
59
|
+
status.write(` ✓ Sub-agent completed: ${event.id}\n`);
|
|
60
|
+
return;
|
|
61
|
+
case "contextCompacted":
|
|
62
|
+
status.write(
|
|
63
|
+
` … Context compacted (${Math.floor(event.tokensBefore / 1000)}K → ${Math.floor(event.tokensAfter / 1000)}K tokens)\n`,
|
|
64
|
+
);
|
|
65
|
+
return;
|
|
66
|
+
case "systemMessage":
|
|
67
|
+
status.write(`[system] ${event.content}\n`);
|
|
68
|
+
return;
|
|
69
|
+
default:
|
|
70
|
+
// phaseChange, toolWaitingApproval, toolStreamDelta, todoUpdate, done,
|
|
71
|
+
// streamError: not surfaced in plaintext (parity with Go).
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Non-TTY has no prompt — always skip (the render() line already noted it).
|
|
77
|
+
resolveApproval(_event: ApprovalNeededEvent): ApprovalAction {
|
|
78
|
+
return ApprovalAction.SKIP;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Trim and ellipsize. Mirrors Go's truncate.
|
|
83
|
+
function truncate(value: string, maxLen: number): string {
|
|
84
|
+
const trimmed = value.trim();
|
|
85
|
+
return trimmed.length <= maxLen ? trimmed : `${trimmed.slice(0, maxLen)}…`;
|
|
86
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// Tests for the historical-replay projection (snapshotToEvents). Stored
|
|
2
|
+
// executions must yield the same event vocabulary as the live differ, with
|
|
3
|
+
// `done` emitted only for the final execution.
|
|
4
|
+
|
|
5
|
+
import { create } from "@bufbuild/protobuf";
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
import {
|
|
8
|
+
AgentExecutionSchema,
|
|
9
|
+
AgentExecutionStatusSchema,
|
|
10
|
+
type AgentExecution,
|
|
11
|
+
} from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
|
|
12
|
+
import { AgentExecutionSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/spec_pb";
|
|
13
|
+
import {
|
|
14
|
+
AgentMessageSchema,
|
|
15
|
+
ToolCallSchema,
|
|
16
|
+
type AgentMessage,
|
|
17
|
+
type ToolCall,
|
|
18
|
+
} from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/message_pb";
|
|
19
|
+
import {
|
|
20
|
+
ExecutionPhase,
|
|
21
|
+
MessageType,
|
|
22
|
+
ToolCallStatus,
|
|
23
|
+
} from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
24
|
+
import type { StreamEvent } from "./events.js";
|
|
25
|
+
import { snapshotToEvents } from "./snapshot.js";
|
|
26
|
+
|
|
27
|
+
function exec(opts: {
|
|
28
|
+
message?: string;
|
|
29
|
+
phase?: ExecutionPhase;
|
|
30
|
+
messages?: AgentMessage[];
|
|
31
|
+
error?: string;
|
|
32
|
+
}): AgentExecution {
|
|
33
|
+
return create(AgentExecutionSchema, {
|
|
34
|
+
spec: create(AgentExecutionSpecSchema, { message: opts.message ?? "" }),
|
|
35
|
+
status: create(AgentExecutionStatusSchema, {
|
|
36
|
+
phase: opts.phase ?? ExecutionPhase.EXECUTION_COMPLETED,
|
|
37
|
+
messages: opts.messages ?? [],
|
|
38
|
+
error: opts.error ?? "",
|
|
39
|
+
}),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function aiMsg(content: string): AgentMessage {
|
|
44
|
+
return create(AgentMessageSchema, { type: MessageType.MESSAGE_AI, content });
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function systemMsg(content: string): AgentMessage {
|
|
48
|
+
return create(AgentMessageSchema, { type: MessageType.MESSAGE_SYSTEM, content });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function toolMsg(tc: ToolCall): AgentMessage {
|
|
52
|
+
return create(AgentMessageSchema, { type: MessageType.MESSAGE_TOOL, toolCalls: [tc], timestamp: "t1" });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function tool(id: string, status: ToolCallStatus): ToolCall {
|
|
56
|
+
return create(ToolCallSchema, { id, name: "read", status, startedAt: "t0" });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const kinds = (events: StreamEvent[]): string[] => events.map((e) => e.kind);
|
|
60
|
+
|
|
61
|
+
describe("snapshotToEvents", () => {
|
|
62
|
+
it("emits the human prompt, AI text, and a terminal done for the last execution", () => {
|
|
63
|
+
const events = snapshotToEvents([exec({ message: "do it", messages: [aiMsg("done")] })]);
|
|
64
|
+
expect(kinds(events)).toEqual(["humanMessage", "aiMessage", "done"]);
|
|
65
|
+
expect(events[0]).toMatchObject({ kind: "humanMessage", content: "do it" });
|
|
66
|
+
expect(events[2]).toMatchObject({ kind: "done", phase: "completed" });
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("suppresses the 'execute' placeholder prompt", () => {
|
|
70
|
+
const events = snapshotToEvents([exec({ message: "execute", messages: [aiMsg("hi")] })]);
|
|
71
|
+
expect(kinds(events)).toEqual(["aiMessage", "done"]);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("promotes a MESSAGE_TOOL into a stateful tool event by status", () => {
|
|
75
|
+
const events = snapshotToEvents([
|
|
76
|
+
exec({ messages: [toolMsg(tool("tc1", ToolCallStatus.TOOL_CALL_COMPLETED))] }),
|
|
77
|
+
]);
|
|
78
|
+
expect(kinds(events)).toEqual(["toolCompleted", "done"]);
|
|
79
|
+
expect(events[0]).toMatchObject({ kind: "toolCompleted", toolCallId: "tc1" });
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it("only the final execution emits done", () => {
|
|
83
|
+
const events = snapshotToEvents([
|
|
84
|
+
exec({ message: "first", messages: [aiMsg("a")] }),
|
|
85
|
+
exec({ message: "second", messages: [aiMsg("b")] }),
|
|
86
|
+
]);
|
|
87
|
+
expect(kinds(events)).toEqual(["humanMessage", "aiMessage", "humanMessage", "aiMessage", "done"]);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it("carries the failure phase + error into done", () => {
|
|
91
|
+
const events = snapshotToEvents([
|
|
92
|
+
exec({ phase: ExecutionPhase.EXECUTION_FAILED, error: "boom", messages: [systemMsg("context")] }),
|
|
93
|
+
]);
|
|
94
|
+
const done = events.at(-1);
|
|
95
|
+
expect(done).toMatchObject({ kind: "done", phase: "failed", error: "boom" });
|
|
96
|
+
});
|
|
97
|
+
});
|