@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,167 @@
|
|
|
1
|
+
// Runtime-environment assembly for agent execution.
|
|
2
|
+
//
|
|
3
|
+
// Ports the Go CLI's `internal/cli/envfile` package (parser.go + merge.go): it
|
|
4
|
+
// parses `--env`/`--secret` flags and `--env-file`/`--secret-file` files into a
|
|
5
|
+
// single merged map of runtime values, each tagged secret or plaintext.
|
|
6
|
+
//
|
|
7
|
+
// Precedence is load-order, lowest to highest (mirrors LoadAndMergeWithSecrets):
|
|
8
|
+
// env-files (in order) < secret-files (in order) < --env flags < --secret flags
|
|
9
|
+
// so a later source overrides an earlier one on key collision, and a secret
|
|
10
|
+
// source overriding a plaintext source flips the value to secret. This exact
|
|
11
|
+
// ordering is a wire-parity contract with the Go CLI.
|
|
12
|
+
|
|
13
|
+
import { readFileSync } from "node:fs";
|
|
14
|
+
import type { EnvVarInput } from "@stigmer/sdk";
|
|
15
|
+
import { UsageError } from "../../errors/index.js";
|
|
16
|
+
|
|
17
|
+
/** A merged runtime environment: variable name -> value + secret flag. */
|
|
18
|
+
export type RuntimeEnv = Record<string, EnvVarInput>;
|
|
19
|
+
|
|
20
|
+
/** The four raw env sources collected from CLI flags, in precedence groups. */
|
|
21
|
+
export interface EnvSources {
|
|
22
|
+
readonly envFlags: readonly string[];
|
|
23
|
+
readonly secretFlags: readonly string[];
|
|
24
|
+
readonly envFiles: readonly string[];
|
|
25
|
+
readonly secretFiles: readonly string[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Load and merge every env source into one map. Mirrors Go's
|
|
30
|
+
* LoadAndMergeWithSecrets: files are processed before flags, and within each
|
|
31
|
+
* tier secrets are layered after plaintext, so the precedence is
|
|
32
|
+
* env-files < secret-files < --env < --secret (later wins).
|
|
33
|
+
*/
|
|
34
|
+
export function loadAndMergeEnv(sources: EnvSources): RuntimeEnv {
|
|
35
|
+
const layers: RuntimeEnv[] = [];
|
|
36
|
+
for (const path of sources.envFiles) layers.push(parseEnvFile(path, false));
|
|
37
|
+
for (const path of sources.secretFiles) layers.push(parseEnvFile(path, true));
|
|
38
|
+
if (sources.envFlags.length > 0) layers.push(parseEnvFlags(sources.envFlags, false));
|
|
39
|
+
if (sources.secretFlags.length > 0) layers.push(parseEnvFlags(sources.secretFlags, true));
|
|
40
|
+
return mergeEnv(layers);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Later layers override earlier ones; mirrors Go's MergeEnvSources.
|
|
44
|
+
function mergeEnv(layers: readonly RuntimeEnv[]): RuntimeEnv {
|
|
45
|
+
const result: RuntimeEnv = {};
|
|
46
|
+
for (const layer of layers) {
|
|
47
|
+
for (const [key, value] of Object.entries(layer)) result[key] = value;
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Parse a dotenv-style file: comments (#), blank lines, optional `export `
|
|
53
|
+
// prefix, and quoted values with escapes. Every value carries the file's
|
|
54
|
+
// secret tag. Mirrors Go's parseFileWithSecretFlag.
|
|
55
|
+
function parseEnvFile(path: string, isSecret: boolean): RuntimeEnv {
|
|
56
|
+
let contents: string;
|
|
57
|
+
try {
|
|
58
|
+
contents = readFileSync(path, "utf8");
|
|
59
|
+
} catch (err) {
|
|
60
|
+
throw new UsageError(`failed to open environment file ${path}: ${(err as Error).message}`);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const result: RuntimeEnv = {};
|
|
64
|
+
const lines = contents.split("\n");
|
|
65
|
+
for (let i = 0; i < lines.length; i++) {
|
|
66
|
+
const parsed = parseLine(lines[i]);
|
|
67
|
+
if (parsed === null) continue; // comment or blank
|
|
68
|
+
if (parsed instanceof Error) {
|
|
69
|
+
throw new UsageError(`${path}:${i + 1}: ${parsed.message}`);
|
|
70
|
+
}
|
|
71
|
+
result[parsed.key] = { value: parsed.value, isSecret };
|
|
72
|
+
}
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Parse repeated `KEY=VALUE` flag values. Unlike file parsing, a comment/blank
|
|
77
|
+
// flag value is an error (the user explicitly passed it). Mirrors Go's
|
|
78
|
+
// parseFlagsWithSecretFlag.
|
|
79
|
+
function parseEnvFlags(vars: readonly string[], isSecret: boolean): RuntimeEnv {
|
|
80
|
+
const result: RuntimeEnv = {};
|
|
81
|
+
for (const raw of vars) {
|
|
82
|
+
const parsed = parseLine(raw);
|
|
83
|
+
if (parsed === null) {
|
|
84
|
+
throw new UsageError(`invalid environment variable "${raw}": empty or comment`);
|
|
85
|
+
}
|
|
86
|
+
if (parsed instanceof Error) {
|
|
87
|
+
throw new UsageError(`invalid environment variable "${raw}": ${parsed.message}`);
|
|
88
|
+
}
|
|
89
|
+
result[parsed.key] = { value: parsed.value, isSecret };
|
|
90
|
+
}
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface ParsedEntry {
|
|
95
|
+
readonly key: string;
|
|
96
|
+
readonly value: string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Parse one `KEY=VALUE` line. Returns null for comments/blanks, an Error for a
|
|
100
|
+
// malformed entry, or the parsed pair. Mirrors Go's ParseLine.
|
|
101
|
+
function parseLine(line: string): ParsedEntry | Error | null {
|
|
102
|
+
let trimmed = line.trim();
|
|
103
|
+
if (trimmed === "" || trimmed.startsWith("#")) return null;
|
|
104
|
+
|
|
105
|
+
if (trimmed.startsWith("export ")) trimmed = trimmed.slice("export ".length);
|
|
106
|
+
|
|
107
|
+
const eq = trimmed.indexOf("=");
|
|
108
|
+
if (eq === -1) return new Error("invalid format: missing '=' separator");
|
|
109
|
+
|
|
110
|
+
const key = trimmed.slice(0, eq).trim();
|
|
111
|
+
if (key === "") return new Error("empty key");
|
|
112
|
+
if (!isValidEnvKey(key)) {
|
|
113
|
+
return new Error(`invalid key "${key}": must contain only letters, numbers, and underscores`);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return { key, value: parseValue(trimmed.slice(eq + 1)) };
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// First char a letter or underscore, rest alphanumeric/underscore. Mirrors Go's
|
|
120
|
+
// isValidEnvKey (notably: a leading digit is rejected).
|
|
121
|
+
function isValidEnvKey(key: string): boolean {
|
|
122
|
+
return /^[A-Za-z_][A-Za-z0-9_]*$/.test(key);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Trim, then strip matching single/double quotes and unescape. Mirrors Go's
|
|
126
|
+
// parseValue + unescapeValue.
|
|
127
|
+
function parseValue(raw: string): string {
|
|
128
|
+
const value = raw.trim();
|
|
129
|
+
if (value.length >= 2) {
|
|
130
|
+
const first = value[0];
|
|
131
|
+
const last = value[value.length - 1];
|
|
132
|
+
if ((first === '"' && last === '"') || (first === "'" && last === "'")) {
|
|
133
|
+
return unescapeValue(value.slice(1, -1));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return value;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Escape map for the single-pass scan below.
|
|
140
|
+
const ESCAPES: Readonly<Record<string, string>> = {
|
|
141
|
+
"\\": "\\",
|
|
142
|
+
'"': '"',
|
|
143
|
+
"'": "'",
|
|
144
|
+
n: "\n",
|
|
145
|
+
t: "\t",
|
|
146
|
+
r: "\r",
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
// Single-pass unescape, matching Go's strings.NewReplacer semantics: each `\x`
|
|
150
|
+
// is consumed at most once (a chained string-replace would double-process, e.g.
|
|
151
|
+
// turning a literal "\\n" into a newline). An unrecognized `\x` is left verbatim.
|
|
152
|
+
function unescapeValue(value: string): string {
|
|
153
|
+
let out = "";
|
|
154
|
+
for (let i = 0; i < value.length; i++) {
|
|
155
|
+
if (value[i] === "\\" && i + 1 < value.length) {
|
|
156
|
+
const next = value[i + 1];
|
|
157
|
+
const mapped = ESCAPES[next];
|
|
158
|
+
if (mapped !== undefined) {
|
|
159
|
+
out += mapped;
|
|
160
|
+
i++;
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
out += value[i];
|
|
165
|
+
}
|
|
166
|
+
return out;
|
|
167
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
// The post-stream epilogue, shared by every renderer (Go's streamAgentEpilogue +
|
|
2
|
+
// run_display_summary.go). After the stream ends we fetch the authoritative final
|
|
3
|
+
// execution and a usage report, then print a compact, copy-paste-friendly exit
|
|
4
|
+
// summary to stderr (AI content already went to stdout). A stream that failed
|
|
5
|
+
// before reaching a phase is re-raised as a CLI error.
|
|
6
|
+
|
|
7
|
+
import { create } from "@bufbuild/protobuf";
|
|
8
|
+
import { ExecutionPhase, MessageType, ToolCallStatus } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
9
|
+
import type { AgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
|
|
10
|
+
import { GetExecutionUsageReportInputSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/io_pb";
|
|
11
|
+
import type { UsageReportAggregate } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/usage_pb";
|
|
12
|
+
import type { Stigmer } from "@stigmer/sdk";
|
|
13
|
+
import { CliExitError, ExitCode } from "../../errors/index.js";
|
|
14
|
+
import { shouldColorize, styler } from "../../output/style.js";
|
|
15
|
+
import { mapPhaseToString } from "../stream/convert.js";
|
|
16
|
+
import type { HeadlessResult } from "../stream/headless.js";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Fetch the final execution + usage and print the exit summary. Returns the
|
|
20
|
+
* final execution so the caller can act on its artifacts (e.g. --download).
|
|
21
|
+
*/
|
|
22
|
+
export async function runEpilogue(
|
|
23
|
+
client: Stigmer,
|
|
24
|
+
sessionId: string,
|
|
25
|
+
executionId: string,
|
|
26
|
+
result: HeadlessResult,
|
|
27
|
+
): Promise<AgentExecution> {
|
|
28
|
+
// A stream error before any phase is a hard failure (Go: epilogue returns it).
|
|
29
|
+
if (result.error !== "" && result.phase === "") {
|
|
30
|
+
throw new CliExitError(result.error, ExitCode.General);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const exec = await client.agentExecution.get(executionId);
|
|
34
|
+
const usage = await fetchUsage(client, executionId);
|
|
35
|
+
|
|
36
|
+
const write = (line: string): void => void process.stderr.write(`${line}\n`);
|
|
37
|
+
const s = styler(shouldColorize(process.stderr));
|
|
38
|
+
write("");
|
|
39
|
+
if (sessionId !== "") {
|
|
40
|
+
printSessionExit(write, s, sessionId, exec, usage);
|
|
41
|
+
} else {
|
|
42
|
+
printCompletion(write, s, exec);
|
|
43
|
+
}
|
|
44
|
+
return exec;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Best-effort usage fetch; a failure here must not fail the run (Go tolerates a
|
|
48
|
+
// nil usage report and renders without the cost line).
|
|
49
|
+
async function fetchUsage(client: Stigmer, executionId: string): Promise<UsageReportAggregate | undefined> {
|
|
50
|
+
try {
|
|
51
|
+
const report = await client.agentExecution.getExecutionUsageReport(
|
|
52
|
+
create(GetExecutionUsageReportInputSchema, { executionId }),
|
|
53
|
+
);
|
|
54
|
+
return report.aggregate;
|
|
55
|
+
} catch {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
type Styler = ReturnType<typeof styler>;
|
|
61
|
+
type Write = (line: string) => void;
|
|
62
|
+
|
|
63
|
+
// Compact session summary + a copy-paste resume command. Mirrors Go's
|
|
64
|
+
// displaySessionExitLine + sessionResumeVerb.
|
|
65
|
+
function printSessionExit(
|
|
66
|
+
write: Write,
|
|
67
|
+
s: Styler,
|
|
68
|
+
sessionId: string,
|
|
69
|
+
exec: AgentExecution,
|
|
70
|
+
usage: UsageReportAggregate | undefined,
|
|
71
|
+
): void {
|
|
72
|
+
const phase = exec.status?.phase ?? ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED;
|
|
73
|
+
const duration = formatDuration(exec.status?.startedAt ?? "", exec.status?.completedAt ?? "");
|
|
74
|
+
const cost = usage !== undefined && usage.billableCostMicros > 0n ? formatCost(usage.billableCostMicros) : "";
|
|
75
|
+
|
|
76
|
+
switch (phase) {
|
|
77
|
+
case ExecutionPhase.EXECUTION_COMPLETED:
|
|
78
|
+
write(s.green(completedLine(duration, cost)));
|
|
79
|
+
break;
|
|
80
|
+
case ExecutionPhase.EXECUTION_FAILED:
|
|
81
|
+
write(s.red(`✗ Failed: ${resolveFailureError(exec)}`));
|
|
82
|
+
break;
|
|
83
|
+
case ExecutionPhase.EXECUTION_CANCELLED:
|
|
84
|
+
write(s.yellow("Cancelled"));
|
|
85
|
+
break;
|
|
86
|
+
case ExecutionPhase.EXECUTION_TERMINATED:
|
|
87
|
+
write(s.yellow(`Stopped: ${resolveFailureError(exec)}`));
|
|
88
|
+
break;
|
|
89
|
+
default:
|
|
90
|
+
write(s.yellow(`Exited (${mapPhaseToString(phase)})`));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
write("");
|
|
94
|
+
write(` ${resumeVerb(phase)} stigmer resume ${sessionId}`);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Non-session completion (rare for run; e.g. a degraded backend). Mirrors the
|
|
98
|
+
// information of Go's displayAgentExecutionComplete without the panel chrome.
|
|
99
|
+
function printCompletion(write: Write, s: Styler, exec: AgentExecution): void {
|
|
100
|
+
const phase = exec.status?.phase ?? ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED;
|
|
101
|
+
if (phase === ExecutionPhase.EXECUTION_FAILED) {
|
|
102
|
+
write(s.red(`✗ Execution failed: ${resolveFailureError(exec)}`));
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
write(s.green(`✓ Execution ${mapPhaseToString(phase)}`));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function completedLine(duration: string, cost: string): string {
|
|
109
|
+
if (duration !== "" && cost !== "") return `✓ Completed (${duration} · ${cost})`;
|
|
110
|
+
if (duration !== "") return `✓ Completed (${duration})`;
|
|
111
|
+
return "✓ Completed";
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function resumeVerb(phase: ExecutionPhase): string {
|
|
115
|
+
switch (phase) {
|
|
116
|
+
case ExecutionPhase.EXECUTION_COMPLETED:
|
|
117
|
+
return "To continue:";
|
|
118
|
+
case ExecutionPhase.EXECUTION_FAILED:
|
|
119
|
+
return "To retry: ";
|
|
120
|
+
default:
|
|
121
|
+
return "To resume: ";
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Mirrors Go's resolveFailureError: canonical error, else last system message,
|
|
126
|
+
// else first failed tool call's error, else a generic pointer to the logs.
|
|
127
|
+
function resolveFailureError(exec: AgentExecution): string {
|
|
128
|
+
const status = exec.status;
|
|
129
|
+
if (status === undefined) return GENERIC_FAILURE;
|
|
130
|
+
if (status.error !== "") return status.error;
|
|
131
|
+
|
|
132
|
+
for (let i = status.messages.length - 1; i >= 0; i--) {
|
|
133
|
+
const msg = status.messages[i];
|
|
134
|
+
if (msg.type === MessageType.MESSAGE_SYSTEM && msg.content !== "") return msg.content;
|
|
135
|
+
}
|
|
136
|
+
for (const msg of status.messages) {
|
|
137
|
+
for (const tc of msg.toolCalls) {
|
|
138
|
+
if (tc.status === ToolCallStatus.TOOL_CALL_FAILED && tc.error !== "") return tc.error;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return GENERIC_FAILURE;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const GENERIC_FAILURE = "Execution failed (error details unavailable — check execution logs)";
|
|
145
|
+
|
|
146
|
+
// "1m23s"/"45s" between two RFC3339 timestamps, or "" when unknown. Mirrors Go's
|
|
147
|
+
// parseDuration + Round(time.Second).
|
|
148
|
+
function formatDuration(startedAt: string, completedAt: string): string {
|
|
149
|
+
if (startedAt === "" || completedAt === "") return "";
|
|
150
|
+
const start = Date.parse(startedAt);
|
|
151
|
+
const end = Date.parse(completedAt);
|
|
152
|
+
if (Number.isNaN(start) || Number.isNaN(end) || end < start) return "";
|
|
153
|
+
const totalSeconds = Math.round((end - start) / 1000);
|
|
154
|
+
if (totalSeconds < 60) return `${totalSeconds}s`;
|
|
155
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
156
|
+
const seconds = totalSeconds % 60;
|
|
157
|
+
return seconds === 0 ? `${minutes}m` : `${minutes}m${seconds}s`;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// USD from micros. Mirrors usage.ts's formatCost precision tiers.
|
|
161
|
+
function formatCost(micros: bigint): string {
|
|
162
|
+
const usd = Number(micros) / 1_000_000;
|
|
163
|
+
if (usd === 0) return "$0.00";
|
|
164
|
+
if (usd < 1) return `$${usd.toFixed(3)}`;
|
|
165
|
+
return `$${usd.toFixed(2)}`;
|
|
166
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { create } from "@bufbuild/protobuf";
|
|
2
|
+
import {
|
|
3
|
+
WorkspaceEntrySchema,
|
|
4
|
+
} from "@stigmer/protos/ai/stigmer/agentic/session/v1/workspace_pb";
|
|
5
|
+
import { describe, expect, it } from "vitest";
|
|
6
|
+
import { renderSessionHeader, workspaceNames } from "./header.js";
|
|
7
|
+
|
|
8
|
+
function capture(): { out: { write(c: string): void; isTTY: boolean }; text: () => string } {
|
|
9
|
+
let buf = "";
|
|
10
|
+
return {
|
|
11
|
+
out: { write: (c: string) => void (buf += c), isTTY: false },
|
|
12
|
+
text: () => buf,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
describe("renderSessionHeader", () => {
|
|
17
|
+
it("omits empty fields and aligns labels", () => {
|
|
18
|
+
const { out, text } = capture();
|
|
19
|
+
renderSessionHeader(out, { agentName: "Reviewer", sessionId: "ses_abc", model: "", mode: "", workspaces: [] });
|
|
20
|
+
expect(text()).toBe("Agent: Reviewer\nSession: ses_abc\n\n");
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("surfaces plan mode but not agent/default", () => {
|
|
24
|
+
const plan = capture();
|
|
25
|
+
renderSessionHeader(plan.out, { agentName: "", sessionId: "", model: "", mode: "plan", workspaces: [] });
|
|
26
|
+
expect(plan.text()).toContain("Mode:");
|
|
27
|
+
expect(plan.text()).toContain("Plan (read-only)");
|
|
28
|
+
|
|
29
|
+
const agent = capture();
|
|
30
|
+
renderSessionHeader(agent.out, { agentName: "", sessionId: "s", model: "", mode: "agent", workspaces: [] });
|
|
31
|
+
expect(agent.text()).not.toContain("Mode:");
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("indents extra workspaces under the first", () => {
|
|
35
|
+
const { out, text } = capture();
|
|
36
|
+
renderSessionHeader(out, {
|
|
37
|
+
agentName: "",
|
|
38
|
+
sessionId: "",
|
|
39
|
+
model: "",
|
|
40
|
+
mode: "",
|
|
41
|
+
workspaces: ["app", "infra"],
|
|
42
|
+
});
|
|
43
|
+
expect(text()).toBe("Workspaces: app\n infra\n\n");
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("prints nothing when every field is empty", () => {
|
|
47
|
+
const { out, text } = capture();
|
|
48
|
+
renderSessionHeader(out, { agentName: "", sessionId: "", model: "", mode: "", workspaces: [] });
|
|
49
|
+
expect(text()).toBe("");
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
describe("workspaceNames", () => {
|
|
54
|
+
it("extracts the derived name from each entry", () => {
|
|
55
|
+
const entries = [
|
|
56
|
+
create(WorkspaceEntrySchema, { name: "app" }),
|
|
57
|
+
create(WorkspaceEntrySchema, { name: "infra" }),
|
|
58
|
+
];
|
|
59
|
+
expect(workspaceNames(entries)).toEqual(["app", "infra"]);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// The session header shown before a headless stream starts (Go's
|
|
2
|
+
// renderSessionHeader / sessionHeaderInfo in run_display_header.go).
|
|
3
|
+
//
|
|
4
|
+
// Deliberate divergence (clean over chrome): Go renders a lipgloss bordered
|
|
5
|
+
// panel with a side-by-side "recent sessions" column. That panel is TTY
|
|
6
|
+
// eye-candy; the interactive path here is owned by Ink's SessionView, which
|
|
7
|
+
// draws its own header. The only consumers of THIS header are the headless
|
|
8
|
+
// (--json / non-TTY plaintext) paths, where the output target is stderr — a
|
|
9
|
+
// bordered panel there would be noise. So we emit a compact, aligned key/value
|
|
10
|
+
// block carrying the same fields (Agent, Session, Model, Mode, Workspaces).
|
|
11
|
+
|
|
12
|
+
import type { WorkspaceEntry } from "@stigmer/protos/ai/stigmer/agentic/session/v1/workspace_pb";
|
|
13
|
+
import { shouldColorize, styler } from "../../output/style.js";
|
|
14
|
+
import type { RunMode } from "./prepare.js";
|
|
15
|
+
|
|
16
|
+
export interface SessionHeaderInfo {
|
|
17
|
+
readonly agentName: string;
|
|
18
|
+
readonly sessionId: string;
|
|
19
|
+
/** Session subject; shown for resumed sessions, empty for fresh runs. */
|
|
20
|
+
readonly subject?: string;
|
|
21
|
+
readonly model: string;
|
|
22
|
+
readonly mode: RunMode;
|
|
23
|
+
readonly workspaces: readonly string[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Fixed label column width; sized to the longest label ("Workspaces") + ": ".
|
|
27
|
+
const LABEL_WIDTH = 12;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Write the session header to `out` (stderr). Empty fields are omitted, exactly
|
|
31
|
+
* like Go's formatMetadataSection. A header with no populated fields prints
|
|
32
|
+
* nothing.
|
|
33
|
+
*/
|
|
34
|
+
export function renderSessionHeader(out: { write(chunk: string): unknown; isTTY?: boolean }, info: SessionHeaderInfo): void {
|
|
35
|
+
const s = styler(shouldColorize(out));
|
|
36
|
+
const lines: string[] = [];
|
|
37
|
+
|
|
38
|
+
if (info.agentName !== "") lines.push(row(s, "Agent", info.agentName));
|
|
39
|
+
if (info.sessionId !== "") lines.push(row(s, "Session", info.sessionId));
|
|
40
|
+
if ((info.subject ?? "") !== "") lines.push(row(s, "Subject", info.subject ?? ""));
|
|
41
|
+
if (info.model !== "") lines.push(row(s, "Model", info.model));
|
|
42
|
+
// Only "plan" is surfaced; "agent"/"" is the default and stays implicit.
|
|
43
|
+
if (info.mode === "plan") lines.push(row(s, "Mode", "Plan (read-only)"));
|
|
44
|
+
if (info.workspaces.length > 0) {
|
|
45
|
+
lines.push(row(s, "Workspaces", info.workspaces[0]));
|
|
46
|
+
const indent = " ".repeat(LABEL_WIDTH);
|
|
47
|
+
for (const ws of info.workspaces.slice(1)) lines.push(`${indent}${ws}`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (lines.length === 0) return;
|
|
51
|
+
out.write(`${lines.join("\n")}\n\n`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function row(s: ReturnType<typeof styler>, label: string, value: string): string {
|
|
55
|
+
const padded = `${label}:`.padEnd(LABEL_WIDTH, " ");
|
|
56
|
+
return `${s.dim(padded)}${value}`;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Displayable names from workspace entries (Go's workspaceNames). */
|
|
60
|
+
export function workspaceNames(entries: readonly WorkspaceEntry[]): string[] {
|
|
61
|
+
return entries.map((e) => e.name);
|
|
62
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// Unit tests for the prelude orchestrator: flag validation helpers and the
|
|
2
|
+
// STIGMER_ORG_ID injection rule. Attachment uploading is covered in
|
|
3
|
+
// attachments.test.ts, so these tests use no attachments.
|
|
4
|
+
|
|
5
|
+
import { describe, expect, it } from "vitest";
|
|
6
|
+
import { ApprovalAction } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
7
|
+
import type { Stigmer } from "@stigmer/sdk";
|
|
8
|
+
import { type AgentExecFlags, parseApprovalAction, prepareAgentExec, validateMode } from "./prepare.js";
|
|
9
|
+
|
|
10
|
+
describe("parseApprovalAction", () => {
|
|
11
|
+
it("maps each accepted value (case-insensitive)", () => {
|
|
12
|
+
expect(parseApprovalAction("")).toBe(ApprovalAction.UNSPECIFIED);
|
|
13
|
+
expect(parseApprovalAction("approve")).toBe(ApprovalAction.APPROVE);
|
|
14
|
+
expect(parseApprovalAction("SKIP")).toBe(ApprovalAction.SKIP);
|
|
15
|
+
expect(parseApprovalAction("reject")).toBe(ApprovalAction.REJECT);
|
|
16
|
+
expect(parseApprovalAction("approve-all")).toBe(ApprovalAction.APPROVE_ALL);
|
|
17
|
+
expect(parseApprovalAction("approve_all")).toBe(ApprovalAction.APPROVE_ALL);
|
|
18
|
+
expect(parseApprovalAction("approveall")).toBe(ApprovalAction.APPROVE_ALL);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("rejects an unknown value", () => {
|
|
22
|
+
expect(() => parseApprovalAction("maybe")).toThrow(/must be one of/);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe("validateMode", () => {
|
|
27
|
+
it("accepts empty, agent, and plan", () => {
|
|
28
|
+
expect(() => validateMode("")).not.toThrow();
|
|
29
|
+
expect(() => validateMode("agent")).not.toThrow();
|
|
30
|
+
expect(() => validateMode("plan")).not.toThrow();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("rejects anything else", () => {
|
|
34
|
+
expect(() => validateMode("yolo")).toThrow(/must be "agent" or "plan"/);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const BASE_FLAGS: AgentExecFlags = {
|
|
39
|
+
message: "hi",
|
|
40
|
+
attach: [],
|
|
41
|
+
approveDefault: "",
|
|
42
|
+
verbose: false,
|
|
43
|
+
detach: false,
|
|
44
|
+
workspace: [],
|
|
45
|
+
branch: "",
|
|
46
|
+
commit: "",
|
|
47
|
+
env: [],
|
|
48
|
+
envFile: [],
|
|
49
|
+
secret: [],
|
|
50
|
+
secretFile: [],
|
|
51
|
+
model: "",
|
|
52
|
+
autoApprove: false,
|
|
53
|
+
mode: "",
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// prepareAgentExec only touches client.agentExecution for attachment uploads;
|
|
57
|
+
// with no attachments a bare stub suffices.
|
|
58
|
+
const STUB_CLIENT = { agentExecution: {} } as unknown as Stigmer;
|
|
59
|
+
|
|
60
|
+
describe("prepareAgentExec env injection", () => {
|
|
61
|
+
it("injects STIGMER_ORG_ID when absent", async () => {
|
|
62
|
+
const prepared = await prepareAgentExec(BASE_FLAGS, STUB_CLIENT, "acme");
|
|
63
|
+
expect(prepared.runtimeEnv.STIGMER_ORG_ID).toEqual({ value: "acme", isSecret: false });
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it("does not override an explicit STIGMER_ORG_ID", async () => {
|
|
67
|
+
const prepared = await prepareAgentExec(
|
|
68
|
+
{ ...BASE_FLAGS, env: ["STIGMER_ORG_ID=explicit"] },
|
|
69
|
+
STUB_CLIENT,
|
|
70
|
+
"acme",
|
|
71
|
+
);
|
|
72
|
+
expect(prepared.runtimeEnv.STIGMER_ORG_ID).toEqual({ value: "explicit", isSecret: false });
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it("skips injection when org is empty", async () => {
|
|
76
|
+
const prepared = await prepareAgentExec(BASE_FLAGS, STUB_CLIENT, "");
|
|
77
|
+
expect(prepared.runtimeEnv.STIGMER_ORG_ID).toBeUndefined();
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it("carries through scalar flags", async () => {
|
|
81
|
+
const prepared = await prepareAgentExec(
|
|
82
|
+
{ ...BASE_FLAGS, message: "go", model: "claude", autoApprove: true, detach: true, mode: "plan" },
|
|
83
|
+
STUB_CLIENT,
|
|
84
|
+
"acme",
|
|
85
|
+
);
|
|
86
|
+
expect(prepared.message).toBe("go");
|
|
87
|
+
expect(prepared.model).toBe("claude");
|
|
88
|
+
expect(prepared.autoApproveAll).toBe(true);
|
|
89
|
+
expect(prepared.detach).toBe(true);
|
|
90
|
+
expect(prepared.mode).toBe("plan");
|
|
91
|
+
});
|
|
92
|
+
});
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// The agent-execution prelude: validate flags and resolve every input the
|
|
2
|
+
// create step needs. Ports the Go CLI's prepareAgentExec (run_agent_exec.go).
|
|
3
|
+
//
|
|
4
|
+
// Order matters and mirrors Go: validate cheap flags first (mode, approve
|
|
5
|
+
// default), then parse workspaces, then merge env, then process attachments
|
|
6
|
+
// (the only step that hits the network). A failure short-circuits before any
|
|
7
|
+
// upload. STIGMER_ORG_ID is injected into the runtime env when absent so agents
|
|
8
|
+
// can address the caller's org without the user wiring it manually.
|
|
9
|
+
|
|
10
|
+
import type { Attachment } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/spec_pb";
|
|
11
|
+
import { ApprovalAction } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
12
|
+
import type { WorkspaceEntry } from "@stigmer/protos/ai/stigmer/agentic/session/v1/workspace_pb";
|
|
13
|
+
import type { Stigmer } from "@stigmer/sdk";
|
|
14
|
+
import { UsageError } from "../../errors/index.js";
|
|
15
|
+
import { type ProgressSink, processAttachments } from "./attachments.js";
|
|
16
|
+
import { loadAndMergeEnv, type RuntimeEnv } from "./env.js";
|
|
17
|
+
import { localWorkspaceRoots, parseWorkspaceEntries } from "./workspace.js";
|
|
18
|
+
|
|
19
|
+
/** The interaction mode requested for the run; "" means the agent default. */
|
|
20
|
+
export type RunMode = "" | "agent" | "plan";
|
|
21
|
+
|
|
22
|
+
/** Raw agent-execution flags shared by `run` and `draft` (Go's agentExecFlags). */
|
|
23
|
+
export interface AgentExecFlags {
|
|
24
|
+
readonly message: string;
|
|
25
|
+
readonly attach: readonly string[];
|
|
26
|
+
readonly approveDefault: string;
|
|
27
|
+
readonly verbose: boolean;
|
|
28
|
+
readonly detach: boolean;
|
|
29
|
+
readonly workspace: readonly string[];
|
|
30
|
+
readonly branch: string;
|
|
31
|
+
readonly commit: string;
|
|
32
|
+
readonly env: readonly string[];
|
|
33
|
+
readonly envFile: readonly string[];
|
|
34
|
+
readonly secret: readonly string[];
|
|
35
|
+
readonly secretFile: readonly string[];
|
|
36
|
+
readonly model: string;
|
|
37
|
+
readonly autoApprove: boolean;
|
|
38
|
+
readonly mode: RunMode;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The validated, resolved inputs ready for create + stream. Mirrors Go's
|
|
43
|
+
* preparedAgentExec, minus the client/org which the command already owns.
|
|
44
|
+
*/
|
|
45
|
+
export interface PreparedRun {
|
|
46
|
+
readonly defaultAction: ApprovalAction;
|
|
47
|
+
readonly workspaceEntries: WorkspaceEntry[];
|
|
48
|
+
readonly runtimeEnv: RuntimeEnv;
|
|
49
|
+
readonly attachments: Attachment[];
|
|
50
|
+
readonly workspaceFileRefs: string[];
|
|
51
|
+
readonly message: string;
|
|
52
|
+
readonly detach: boolean;
|
|
53
|
+
readonly verbose: boolean;
|
|
54
|
+
readonly model: string;
|
|
55
|
+
readonly autoApproveAll: boolean;
|
|
56
|
+
readonly mode: RunMode;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Validate flags and resolve all execution inputs. The `org` is used to inject
|
|
61
|
+
* STIGMER_ORG_ID and the `client` to upload non-workspace attachments.
|
|
62
|
+
*/
|
|
63
|
+
export async function prepareAgentExec(
|
|
64
|
+
flags: AgentExecFlags,
|
|
65
|
+
client: Stigmer,
|
|
66
|
+
org: string,
|
|
67
|
+
progress?: ProgressSink,
|
|
68
|
+
): Promise<PreparedRun> {
|
|
69
|
+
const defaultAction = parseApprovalAction(flags.approveDefault);
|
|
70
|
+
validateMode(flags.mode);
|
|
71
|
+
|
|
72
|
+
const workspaceEntries = parseWorkspaceEntries(flags.workspace, flags.branch, flags.commit);
|
|
73
|
+
|
|
74
|
+
const runtimeEnv = loadAndMergeEnv({
|
|
75
|
+
envFlags: flags.env,
|
|
76
|
+
secretFlags: flags.secret,
|
|
77
|
+
envFiles: flags.envFile,
|
|
78
|
+
secretFiles: flags.secretFile,
|
|
79
|
+
});
|
|
80
|
+
if (runtimeEnv.STIGMER_ORG_ID === undefined && org !== "") {
|
|
81
|
+
runtimeEnv.STIGMER_ORG_ID = { value: org, isSecret: false };
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const { attachments, workspaceFileRefs } = await processAttachments(
|
|
85
|
+
client.agentExecution,
|
|
86
|
+
flags.attach,
|
|
87
|
+
localWorkspaceRoots(workspaceEntries),
|
|
88
|
+
progress,
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
defaultAction,
|
|
93
|
+
workspaceEntries,
|
|
94
|
+
runtimeEnv,
|
|
95
|
+
attachments,
|
|
96
|
+
workspaceFileRefs,
|
|
97
|
+
message: flags.message,
|
|
98
|
+
detach: flags.detach,
|
|
99
|
+
verbose: flags.verbose,
|
|
100
|
+
model: flags.model,
|
|
101
|
+
autoApproveAll: flags.autoApprove,
|
|
102
|
+
mode: flags.mode,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Parse the `--approve-default` flag to an ApprovalAction. Empty means "no
|
|
108
|
+
* default" (UNSPECIFIED). Mirrors Go's approval.ParseAction, including the
|
|
109
|
+
* approve-all aliases and case-insensitivity.
|
|
110
|
+
*/
|
|
111
|
+
export function parseApprovalAction(value: string): ApprovalAction {
|
|
112
|
+
if (value.trim() === "") return ApprovalAction.UNSPECIFIED;
|
|
113
|
+
switch (value.trim().toLowerCase()) {
|
|
114
|
+
case "approve":
|
|
115
|
+
return ApprovalAction.APPROVE;
|
|
116
|
+
case "skip":
|
|
117
|
+
return ApprovalAction.SKIP;
|
|
118
|
+
case "reject":
|
|
119
|
+
return ApprovalAction.REJECT;
|
|
120
|
+
case "approve-all":
|
|
121
|
+
case "approve_all":
|
|
122
|
+
case "approveall":
|
|
123
|
+
return ApprovalAction.APPROVE_ALL;
|
|
124
|
+
default:
|
|
125
|
+
throw new UsageError(
|
|
126
|
+
`invalid --approve-default value "${value}": must be one of: approve, skip, reject, approve-all`,
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Validate the `--mode` flag. Empty (unset) is valid and means "use default"
|
|
133
|
+
* (agent). Mirrors Go's validateMode.
|
|
134
|
+
*/
|
|
135
|
+
export function validateMode(mode: string): asserts mode is RunMode {
|
|
136
|
+
if (mode !== "" && mode !== "agent" && mode !== "plan") {
|
|
137
|
+
throw new UsageError(`invalid --mode value "${mode}": must be "agent" or "plan"`);
|
|
138
|
+
}
|
|
139
|
+
}
|