@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,223 @@
|
|
|
1
|
+
// Resolution and on-demand acquisition of the seedpack content.
|
|
2
|
+
//
|
|
3
|
+
// The seedpack (system agents, skills, MCP servers, workflows under the
|
|
4
|
+
// "stigmer" org) is the TS equivalent of the Go CLI's `go:embed`-ed bundle.
|
|
5
|
+
// A lean `npx @stigmer/cli` must not carry ~300 content files (DD-002), so the
|
|
6
|
+
// content ships as `@stigmer/seedpack` and is acquired on demand — the same
|
|
7
|
+
// pattern as `@stigmer/runner-slim` and the managed Temporal binary.
|
|
8
|
+
//
|
|
9
|
+
// Two sources, tried in order (mirrors runtime/runner.ts):
|
|
10
|
+
// 1. A repo-tree checkout (dev): `<repo>/seedpack`.
|
|
11
|
+
// 2. The published `@stigmer/seedpack@<cli-version>`, installed on demand into
|
|
12
|
+
// ~/.stigmer/runtimes/<version>/ and read from
|
|
13
|
+
// node_modules/@stigmer/seedpack.
|
|
14
|
+
//
|
|
15
|
+
// The content-hash and extract logic mirror `@stigmer/seedpack` exactly (which
|
|
16
|
+
// in turn mirrors the Go `seedpack` package); the CLI reimplements them over a
|
|
17
|
+
// resolved directory so it stays decoupled from the package in the lean install
|
|
18
|
+
// (where the package is not a dependency, only an on-demand artifact).
|
|
19
|
+
|
|
20
|
+
import { execFileSync } from "node:child_process";
|
|
21
|
+
import { createHash } from "node:crypto";
|
|
22
|
+
import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
23
|
+
import { homedir } from "node:os";
|
|
24
|
+
import { dirname, join, posix, relative, sep } from "node:path";
|
|
25
|
+
import { fileURLToPath } from "node:url";
|
|
26
|
+
import { CliExitError } from "../../errors/cli-exit-error.js";
|
|
27
|
+
import { ExitCode } from "../../errors/exit-codes.js";
|
|
28
|
+
import { log } from "../../logger.js";
|
|
29
|
+
import { VERSION } from "../../version.js";
|
|
30
|
+
import { runtimesDir } from "../paths.js";
|
|
31
|
+
|
|
32
|
+
const SEEDPACK_PACKAGE = "@stigmer/seedpack";
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The canonical seedpack entries, in apply-safe order. Kept in sync with
|
|
36
|
+
* `SEEDPACK_ENTRIES` in `@stigmer/seedpack` and the `//go:embed` set in
|
|
37
|
+
* `seedpack/embed.go` — `tools/`, `icons/`, and `canary/` (CI canary metadata,
|
|
38
|
+
* not a resource) are deliberately excluded so the content set (and thus the
|
|
39
|
+
* idempotency hash) is identical across delivery paths.
|
|
40
|
+
*/
|
|
41
|
+
export const SEEDPACK_ENTRIES = [
|
|
42
|
+
"stigmer.yaml",
|
|
43
|
+
"organizations",
|
|
44
|
+
"skills",
|
|
45
|
+
"agents",
|
|
46
|
+
"workflows",
|
|
47
|
+
"mcp-servers",
|
|
48
|
+
] as const;
|
|
49
|
+
|
|
50
|
+
/** Marker file recording the last successfully-applied content hash. */
|
|
51
|
+
export const MARKER_FILE = ".seedpack-bootstrapped";
|
|
52
|
+
|
|
53
|
+
export interface SeedpackContent {
|
|
54
|
+
/** Absolute path to the content root (holds stigmer.yaml). */
|
|
55
|
+
readonly dir: string;
|
|
56
|
+
/** Where the content came from — surfaced in diagnostics. */
|
|
57
|
+
readonly source: "repo" | "package";
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface ResolveSeedpackOptions {
|
|
61
|
+
home?: string;
|
|
62
|
+
/** Release version of @stigmer/seedpack to acquire (defaults to the CLI version). */
|
|
63
|
+
version?: string;
|
|
64
|
+
/** npm install implementation (injectable for tests). */
|
|
65
|
+
install?: (installDir: string, spec: string) => void;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Resolve the seedpack content directory: a repo-tree checkout in dev, else the
|
|
70
|
+
* on-demand-acquired `@stigmer/seedpack` package. Throws actionable guidance when
|
|
71
|
+
* acquisition is not possible (non-release build, or a failed/incomplete install).
|
|
72
|
+
*/
|
|
73
|
+
export function resolveSeedpackContent(opts: ResolveSeedpackOptions = {}): SeedpackContent {
|
|
74
|
+
const repo = repoSeedpackDir();
|
|
75
|
+
if (repo !== null) return { dir: repo, source: "repo" };
|
|
76
|
+
return { dir: acquireSeedpack(opts), source: "package" };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Acquire the published `@stigmer/seedpack@<version>` into
|
|
81
|
+
* ~/.stigmer/runtimes/<version>/ (idempotent) and return its package directory.
|
|
82
|
+
* The version is pinned to the CLI's own version so system content stays in
|
|
83
|
+
* lockstep with the control plane it bootstraps.
|
|
84
|
+
*/
|
|
85
|
+
export function acquireSeedpack(opts: ResolveSeedpackOptions = {}): string {
|
|
86
|
+
const home = opts.home ?? homedir();
|
|
87
|
+
const version = opts.version ?? VERSION;
|
|
88
|
+
if (!isAcquirableRelease(version)) {
|
|
89
|
+
throw new CliExitError(`cannot acquire ${SEEDPACK_PACKAGE} for a non-release build (${version})`, ExitCode.General, [
|
|
90
|
+
"Run from the repo (the seedpack/ tree is used directly in dev).",
|
|
91
|
+
"On-demand acquisition is only available for published releases.",
|
|
92
|
+
]);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const installDir = join(runtimesDir(home), version);
|
|
96
|
+
const pkgDir = join(installDir, "node_modules", "@stigmer", "seedpack");
|
|
97
|
+
const marker = join(pkgDir, "stigmer.yaml");
|
|
98
|
+
|
|
99
|
+
if (!existsSync(marker)) {
|
|
100
|
+
log.info(`acquiring ${SEEDPACK_PACKAGE}`, { version, dir: installDir });
|
|
101
|
+
mkdirSync(installDir, { recursive: true });
|
|
102
|
+
// A stable package.json root keeps the install deterministic. npm install is
|
|
103
|
+
// additive and non-pruning, so this prefix is safely shared with the runner.
|
|
104
|
+
const rootPkg = join(installDir, "package.json");
|
|
105
|
+
if (!existsSync(rootPkg)) {
|
|
106
|
+
writeFileSync(rootPkg, `${JSON.stringify({ name: "stigmer-runtime", private: true, version: "0.0.0" }, null, 2)}\n`);
|
|
107
|
+
}
|
|
108
|
+
const install = opts.install ?? installSeedpack;
|
|
109
|
+
install(installDir, `${SEEDPACK_PACKAGE}@${version}`);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (!existsSync(marker)) {
|
|
113
|
+
throw new CliExitError(`${SEEDPACK_PACKAGE} install did not produce ${marker}`, ExitCode.General, [
|
|
114
|
+
`Remove ${installDir} and retry.`,
|
|
115
|
+
]);
|
|
116
|
+
}
|
|
117
|
+
return pkgDir;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Install the seedpack package into an isolated prefix. Output is inherited so
|
|
121
|
+
// the user sees the one-time download progress.
|
|
122
|
+
function installSeedpack(installDir: string, spec: string): void {
|
|
123
|
+
try {
|
|
124
|
+
execFileSync("npm", ["install", spec, "--prefix", installDir, "--omit=dev", "--no-audit", "--no-fund"], {
|
|
125
|
+
stdio: "inherit",
|
|
126
|
+
});
|
|
127
|
+
} catch (err) {
|
|
128
|
+
throw new CliExitError(`failed to install ${spec}`, ExitCode.General, [
|
|
129
|
+
`Command: npm install ${spec} --prefix ${installDir}`,
|
|
130
|
+
"Ensure npm is on PATH and the network is reachable.",
|
|
131
|
+
String(err),
|
|
132
|
+
]);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Deterministic SHA-256 over the canonical content, identical to
|
|
138
|
+
* `@stigmer/seedpack`'s `contentHash` (and the Go algorithm): files walked in
|
|
139
|
+
* lexical order, each contributing its forward-slash relative path, a NUL, and
|
|
140
|
+
* its bytes. Used as the idempotency marker.
|
|
141
|
+
*/
|
|
142
|
+
export function hashSeedpackContent(dir: string): string {
|
|
143
|
+
const hash = createHash("sha256");
|
|
144
|
+
for (const rel of listContentFiles(dir)) {
|
|
145
|
+
hash.update(rel);
|
|
146
|
+
hash.update(NUL);
|
|
147
|
+
hash.update(readFileSync(join(dir, rel)));
|
|
148
|
+
}
|
|
149
|
+
return `sha256:${hash.digest("hex").slice(0, 16)}`;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Copy the canonical entries from `srcDir` into `destDir`, producing a clean
|
|
154
|
+
* Stigmer project the declarative-apply path can process directly (never
|
|
155
|
+
* carrying build tooling or assets that happen to sit beside the content).
|
|
156
|
+
*/
|
|
157
|
+
export function extractSeedpack(srcDir: string, destDir: string): void {
|
|
158
|
+
mkdirSync(destDir, { recursive: true });
|
|
159
|
+
for (const entry of SEEDPACK_ENTRIES) {
|
|
160
|
+
const src = join(srcDir, entry);
|
|
161
|
+
if (!existsSync(src)) continue;
|
|
162
|
+
cpSync(src, join(destDir, entry), { recursive: true });
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const NUL = Uint8Array.of(0);
|
|
167
|
+
|
|
168
|
+
/** Lexically-sorted, forward-slash relative paths of every file under the canonical entries. */
|
|
169
|
+
export function listContentFiles(root: string): string[] {
|
|
170
|
+
const files: string[] = [];
|
|
171
|
+
const walk = (abs: string): void => {
|
|
172
|
+
for (const dirent of readdirSync(abs, { withFileTypes: true })) {
|
|
173
|
+
const full = join(abs, dirent.name);
|
|
174
|
+
if (dirent.isDirectory()) walk(full);
|
|
175
|
+
else if (dirent.isFile()) files.push(toPosix(relative(root, full)));
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
for (const entry of SEEDPACK_ENTRIES) {
|
|
179
|
+
const abs = join(root, entry);
|
|
180
|
+
if (!existsSync(abs)) continue;
|
|
181
|
+
if (statSync(abs).isDirectory()) walk(abs);
|
|
182
|
+
else files.push(entry);
|
|
183
|
+
}
|
|
184
|
+
return files.sort();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** The stored marker hash for `markerDir`, or null when never applied. */
|
|
188
|
+
export function readMarker(markerDir: string): string | null {
|
|
189
|
+
try {
|
|
190
|
+
return readFileSync(join(markerDir, MARKER_FILE), "utf8").trim() || null;
|
|
191
|
+
} catch {
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** Persist the applied content hash so a future run can skip unchanged content. */
|
|
197
|
+
export function writeMarker(markerDir: string, hash: string): void {
|
|
198
|
+
mkdirSync(markerDir, { recursive: true });
|
|
199
|
+
writeFileSync(join(markerDir, MARKER_FILE), `${hash}\n`);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function toPosix(p: string): string {
|
|
203
|
+
return sep === posix.sep ? p : p.split(sep).join(posix.sep);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// A source build reports "0.0.0-dev" and the dev channel stamps "<v>-dev.<stamp>";
|
|
207
|
+
// neither publishes a matching @stigmer/seedpack, so they are not acquirable.
|
|
208
|
+
function isAcquirableRelease(version: string): boolean {
|
|
209
|
+
return !version.includes("-dev");
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Walk up from this module to a repo root containing seedpack/stigmer.yaml.
|
|
213
|
+
function repoSeedpackDir(): string | null {
|
|
214
|
+
let dir = dirname(fileURLToPath(import.meta.url));
|
|
215
|
+
for (let i = 0; i < 10; i += 1) {
|
|
216
|
+
const candidate = join(dir, "seedpack");
|
|
217
|
+
if (existsSync(join(candidate, "stigmer.yaml"))) return candidate;
|
|
218
|
+
const parent = dirname(dir);
|
|
219
|
+
if (parent === dir) break;
|
|
220
|
+
dir = parent;
|
|
221
|
+
}
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Minimal terminal prompts for the setup wizard. Prompts and echoes are written
|
|
2
|
+
// to stderr so stdout stays clean; secret entry switches the TTY to raw mode and
|
|
3
|
+
// suppresses echo so API keys never appear on screen or in scrollback.
|
|
4
|
+
|
|
5
|
+
import { createInterface } from "node:readline";
|
|
6
|
+
|
|
7
|
+
/** Ask a yes/no question (default no). Returns true only for an explicit yes. */
|
|
8
|
+
export async function confirm(question: string): Promise<boolean> {
|
|
9
|
+
const answer = (await promptLine(`${question} [y/N] `)).trim().toLowerCase();
|
|
10
|
+
return answer === "y" || answer === "yes";
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Read a line from stdin, showing `question` on stderr. */
|
|
14
|
+
export function promptLine(question: string): Promise<string> {
|
|
15
|
+
const rl = createInterface({ input: process.stdin, output: process.stderr });
|
|
16
|
+
return new Promise((resolve) => {
|
|
17
|
+
rl.question(question, (answer) => {
|
|
18
|
+
rl.close();
|
|
19
|
+
resolve(answer);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Read a secret from stdin with echo suppressed (falls back to plain read on a
|
|
25
|
+
* non-TTY stdin, e.g. piped input). */
|
|
26
|
+
export function promptSecret(question: string): Promise<string> {
|
|
27
|
+
const stdin = process.stdin;
|
|
28
|
+
if (stdin.isTTY !== true || typeof stdin.setRawMode !== "function") {
|
|
29
|
+
return promptLine(`${question}: `);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
process.stderr.write(`${question}: `);
|
|
33
|
+
return new Promise((resolve) => {
|
|
34
|
+
let value = "";
|
|
35
|
+
stdin.setRawMode(true);
|
|
36
|
+
stdin.resume();
|
|
37
|
+
|
|
38
|
+
const finish = (): void => {
|
|
39
|
+
stdin.setRawMode(false);
|
|
40
|
+
stdin.pause();
|
|
41
|
+
stdin.removeListener("data", onData);
|
|
42
|
+
process.stderr.write("\n");
|
|
43
|
+
resolve(value);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const onData = (chunk: Buffer): void => {
|
|
47
|
+
const char = chunk.toString("utf8");
|
|
48
|
+
switch (char) {
|
|
49
|
+
case "\n":
|
|
50
|
+
case "\r":
|
|
51
|
+
case "\u0004": // Ctrl-D
|
|
52
|
+
finish();
|
|
53
|
+
break;
|
|
54
|
+
case "\u0003": // Ctrl-C
|
|
55
|
+
stdin.setRawMode(false);
|
|
56
|
+
process.stderr.write("\n");
|
|
57
|
+
process.exit(130);
|
|
58
|
+
break;
|
|
59
|
+
case "\u007f": // Backspace
|
|
60
|
+
case "\b":
|
|
61
|
+
value = value.slice(0, -1);
|
|
62
|
+
break;
|
|
63
|
+
default:
|
|
64
|
+
value += char;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
stdin.on("data", onData);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import type { Config } from "../../config/config.js";
|
|
3
|
+
import { readLlm } from "../llm-config.js";
|
|
4
|
+
import { applyChoice, buildLlmForChoice } from "./wizard.js";
|
|
5
|
+
|
|
6
|
+
function config(local?: unknown): Config {
|
|
7
|
+
return { backend: { type: "local", local } };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
describe("buildLlmForChoice", () => {
|
|
11
|
+
it("applies provider defaults and overrides", () => {
|
|
12
|
+
expect(buildLlmForChoice("anthropic")).toEqual({ provider: "anthropic", model: "claude-sonnet-4.5" });
|
|
13
|
+
expect(buildLlmForChoice("anthropic", { apiKey: "k", model: "m" })).toEqual({
|
|
14
|
+
provider: "anthropic",
|
|
15
|
+
model: "m",
|
|
16
|
+
api_key: "k",
|
|
17
|
+
});
|
|
18
|
+
expect(buildLlmForChoice("ollama", { baseUrl: "http://host:1" })).toEqual({
|
|
19
|
+
provider: "ollama",
|
|
20
|
+
model: "qwen2.5-coder:7b",
|
|
21
|
+
base_url: "http://host:1",
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("returns undefined for skip (clears config)", () => {
|
|
26
|
+
expect(buildLlmForChoice("skip")).toBeUndefined();
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
describe("applyChoice", () => {
|
|
31
|
+
it("writes the selection while preserving siblings", () => {
|
|
32
|
+
const cfg = config({ temporal: { managed: true }, llm: { provider: "openai" } });
|
|
33
|
+
const updated = applyChoice(cfg, "anthropic", { apiKey: "k" });
|
|
34
|
+
expect(readLlm(updated)).toEqual({ provider: "anthropic", model: "claude-sonnet-4.5", api_key: "k" });
|
|
35
|
+
expect((updated.backend.local as { temporal: unknown }).temporal).toEqual({ managed: true });
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("skip clears the llm section", () => {
|
|
39
|
+
const updated = applyChoice(config({ llm: { provider: "openai" } }), "skip");
|
|
40
|
+
expect(readLlm(updated)).toBeUndefined();
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// LLM provider selection for `stigmer setup`.
|
|
2
|
+
//
|
|
3
|
+
// The decision logic is a pure function (`buildLlmForChoice`) shared by the
|
|
4
|
+
// non-interactive flag path and the interactive menu, so both produce identical
|
|
5
|
+
// config and the rules are unit-testable in isolation. The interactive menu
|
|
6
|
+
// (`runInteractiveWizard`) is a thin shell around it, mirroring the Go wizard's
|
|
7
|
+
// provider list and API-key handling (env var first, then a hidden prompt).
|
|
8
|
+
|
|
9
|
+
import type { Config } from "../../config/config.js";
|
|
10
|
+
import { type LlmSettings, setLlm, withProviderDefaults } from "../llm-config.js";
|
|
11
|
+
import { promptLine, promptSecret } from "./prompt.js";
|
|
12
|
+
|
|
13
|
+
export type ProviderChoice = "anthropic" | "openai" | "ollama" | "skip";
|
|
14
|
+
|
|
15
|
+
export interface SelectionInputs {
|
|
16
|
+
apiKey?: string;
|
|
17
|
+
model?: string;
|
|
18
|
+
baseUrl?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Resolve a provider choice (plus optional overrides) to the LLM settings to
|
|
23
|
+
* persist. "skip" yields `undefined`, which clears the section.
|
|
24
|
+
*/
|
|
25
|
+
export function buildLlmForChoice(choice: ProviderChoice, inputs: SelectionInputs = {}): LlmSettings | undefined {
|
|
26
|
+
if (choice === "skip") return undefined;
|
|
27
|
+
return withProviderDefaults({
|
|
28
|
+
provider: choice,
|
|
29
|
+
model: inputs.model,
|
|
30
|
+
api_key: inputs.apiKey,
|
|
31
|
+
base_url: inputs.baseUrl,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Apply a provider choice to a config, returning the updated copy. */
|
|
36
|
+
export function applyChoice(config: Config, choice: ProviderChoice, inputs: SelectionInputs = {}): Config {
|
|
37
|
+
return setLlm(config, buildLlmForChoice(choice, inputs));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Run the interactive provider menu against the current terminal. Returns the
|
|
42
|
+
* updated config, or `null` if the user aborts. For cloud providers, an API key
|
|
43
|
+
* already in the environment is used without prompting (matching the Go wizard).
|
|
44
|
+
*/
|
|
45
|
+
export async function runInteractiveWizard(config: Config, env: NodeJS.ProcessEnv = process.env): Promise<Config | null> {
|
|
46
|
+
process.stderr.write("\nChoose your LLM provider (required for agent execution):\n\n");
|
|
47
|
+
process.stderr.write(" [1] Anthropic — Cloud API, best quality (requires API key)\n");
|
|
48
|
+
process.stderr.write(" [2] OpenAI — Cloud API (requires API key)\n");
|
|
49
|
+
process.stderr.write(" [3] Ollama — Free, local, offline (lower quality output)\n");
|
|
50
|
+
process.stderr.write(" [4] Skip — Configure later (agents won't execute)\n\n");
|
|
51
|
+
|
|
52
|
+
for (;;) {
|
|
53
|
+
const choice = (await promptLine("Select [1-4]: ")).trim();
|
|
54
|
+
switch (choice) {
|
|
55
|
+
case "1":
|
|
56
|
+
return applyChoice(config, "anthropic", { apiKey: await resolveCloudKey("anthropic", env) });
|
|
57
|
+
case "2":
|
|
58
|
+
return applyChoice(config, "openai", { apiKey: await resolveCloudKey("openai", env) });
|
|
59
|
+
case "3":
|
|
60
|
+
return applyChoice(config, "ollama");
|
|
61
|
+
case "4":
|
|
62
|
+
return applyChoice(config, "skip");
|
|
63
|
+
default:
|
|
64
|
+
process.stderr.write("Invalid choice. Please enter 1, 2, 3, or 4.\n");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function resolveCloudKey(provider: "anthropic" | "openai", env: NodeJS.ProcessEnv): Promise<string | undefined> {
|
|
70
|
+
const envVar = provider === "anthropic" ? "ANTHROPIC_API_KEY" : "OPENAI_API_KEY";
|
|
71
|
+
const existing = env[envVar];
|
|
72
|
+
if (existing) {
|
|
73
|
+
process.stderr.write(`Using ${envVar} from environment\n`);
|
|
74
|
+
return undefined; // env var takes precedence; do not persist a copy
|
|
75
|
+
}
|
|
76
|
+
const key = (await promptSecret(`Enter your ${provider === "anthropic" ? "Anthropic" : "OpenAI"} API key`)).trim();
|
|
77
|
+
return key === "" ? undefined : key;
|
|
78
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// The daemon's health snapshot, written atomically by the supervisor and read
|
|
2
|
+
// by `stigmer status`.
|
|
3
|
+
//
|
|
4
|
+
// It is the single consistent view of every managed component. The supervisor
|
|
5
|
+
// is the only writer; status (and any other reader) only reads. JSON keys are
|
|
6
|
+
// snake_case to match the file the Go daemon writes, so the format is stable
|
|
7
|
+
// across the migration.
|
|
8
|
+
|
|
9
|
+
import { readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
10
|
+
|
|
11
|
+
export type ComponentLifecycle = "running" | "stopped" | "failed" | "unhealthy";
|
|
12
|
+
|
|
13
|
+
/** Runtime state of a single managed component. */
|
|
14
|
+
export interface ComponentState {
|
|
15
|
+
pid: number;
|
|
16
|
+
state: ComponentLifecycle;
|
|
17
|
+
started_at: string;
|
|
18
|
+
restart_count: number;
|
|
19
|
+
last_error?: string;
|
|
20
|
+
/** For components that announce readiness (the runner's "polling" marker):
|
|
21
|
+
* true once observed. Absent for components without a readiness signal. */
|
|
22
|
+
ready?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** The full snapshot persisted to `health-state.json`. */
|
|
26
|
+
export interface HealthState {
|
|
27
|
+
daemon_pid: number;
|
|
28
|
+
started_at: string;
|
|
29
|
+
components: Record<string, ComponentState>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Write the health state atomically: serialize to a temp file then rename over
|
|
34
|
+
* the target, so a reader never observes a half-written snapshot.
|
|
35
|
+
*/
|
|
36
|
+
export function writeHealthState(path: string, state: HealthState): void {
|
|
37
|
+
const tmp = `${path}.tmp`;
|
|
38
|
+
writeFileSync(tmp, `${JSON.stringify(state, null, 2)}\n`, "utf8");
|
|
39
|
+
renameSync(tmp, path);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Load the health state, or null if it is missing or unparseable. */
|
|
43
|
+
export function loadHealthState(path: string): HealthState | null {
|
|
44
|
+
let raw: string;
|
|
45
|
+
try {
|
|
46
|
+
raw = readFileSync(path, "utf8");
|
|
47
|
+
} catch {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
return JSON.parse(raw) as HealthState;
|
|
52
|
+
} catch {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Public surface of the local-stack state primitives.
|
|
2
|
+
|
|
3
|
+
export { type ComponentLifecycle, type ComponentState, type HealthState, loadHealthState, writeHealthState } from "./health-state.js";
|
|
4
|
+
export { type FileLock, acquireLock } from "./lock.js";
|
|
5
|
+
export { DEFAULT_LOG_RETENTION_DAYS, cleanupOldLogs, rotateLogs } from "./log-rotation.js";
|
|
6
|
+
export { readPidFile, removePidFile, writePidFile } from "./pidfile.js";
|
|
7
|
+
export { findProcessByPort, isProcessAlive, killProcess, killProcessGroup } from "./proc.js";
|
|
8
|
+
export { type StartupConfig, loadStartupConfig, removeStartupConfig, saveStartupConfig } from "./startup-config.js";
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// A single-instance file lock built on atomic O_EXCL file creation.
|
|
2
|
+
//
|
|
3
|
+
// Node has no portable `flock`, so the lock is a file whose existence is the
|
|
4
|
+
// lock and whose contents are the owning PID. Creation uses the "wx" flag
|
|
5
|
+
// (O_CREAT | O_EXCL), which is atomic on POSIX and Windows, so two racing
|
|
6
|
+
// acquirers cannot both win. If the file already exists we read the owner PID:
|
|
7
|
+
// a dead owner means a stale lock we may reclaim; a live owner means the lock
|
|
8
|
+
// is genuinely held. This guards the Temporal dev server against double-start
|
|
9
|
+
// the way the Go CLI's flock does, without a native dependency.
|
|
10
|
+
|
|
11
|
+
import { closeSync, mkdirSync, openSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
12
|
+
import { dirname } from "node:path";
|
|
13
|
+
import { isProcessAlive } from "./proc.js";
|
|
14
|
+
|
|
15
|
+
/** A held lock. Call release() exactly once when done. */
|
|
16
|
+
export interface FileLock {
|
|
17
|
+
readonly path: string;
|
|
18
|
+
release(): void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Try to acquire the lock at `path`. Returns a FileLock on success, or null if
|
|
23
|
+
* the lock is held by a live process. A lock left behind by a dead process is
|
|
24
|
+
* reclaimed automatically.
|
|
25
|
+
*/
|
|
26
|
+
export function acquireLock(path: string): FileLock | null {
|
|
27
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
28
|
+
|
|
29
|
+
if (tryCreate(path)) return makeLock(path);
|
|
30
|
+
|
|
31
|
+
// The lock file exists. Reclaim it only if its owner is gone.
|
|
32
|
+
const owner = readOwner(path);
|
|
33
|
+
if (owner !== null && isProcessAlive(owner)) {
|
|
34
|
+
return null; // genuinely held by a live process
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Stale (or unreadable) lock: remove and retry exactly once. A failure on the
|
|
38
|
+
// retry means another process raced us to it — treat the lock as held.
|
|
39
|
+
rmSync(path, { force: true });
|
|
40
|
+
return tryCreate(path) ? makeLock(path) : null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function tryCreate(path: string): boolean {
|
|
44
|
+
try {
|
|
45
|
+
const fd = openSync(path, "wx");
|
|
46
|
+
writeFileSync(fd, `${process.pid}\n`, "utf8");
|
|
47
|
+
closeSync(fd);
|
|
48
|
+
return true;
|
|
49
|
+
} catch (err) {
|
|
50
|
+
if ((err as NodeJS.ErrnoException).code === "EEXIST") return false;
|
|
51
|
+
throw err;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function readOwner(path: string): number | null {
|
|
56
|
+
try {
|
|
57
|
+
const firstLine = readFileSync(path, "utf8").split("\n", 1)[0]?.trim() ?? "";
|
|
58
|
+
const pid = Number.parseInt(firstLine, 10);
|
|
59
|
+
return Number.isInteger(pid) && pid > 0 ? pid : null;
|
|
60
|
+
} catch {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function makeLock(path: string): FileLock {
|
|
66
|
+
let released = false;
|
|
67
|
+
return {
|
|
68
|
+
path,
|
|
69
|
+
release(): void {
|
|
70
|
+
if (released) return;
|
|
71
|
+
released = true;
|
|
72
|
+
// Only remove the file if we still own it, so we never delete a lock a
|
|
73
|
+
// different process acquired after ours was (somehow) gone.
|
|
74
|
+
if (readOwner(path) === process.pid) rmSync(path, { force: true });
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// Log rotation, run once at the start of every `up`.
|
|
2
|
+
//
|
|
3
|
+
// Each non-empty component log is renamed with a timestamp suffix so a fresh
|
|
4
|
+
// run starts clean while the previous run's output is preserved for diagnosis.
|
|
5
|
+
// Archived logs older than the retention window are then pruned. This mirrors
|
|
6
|
+
// the Go CLI's `rotateLogsIfNeeded` + `cleanupOldLogs`.
|
|
7
|
+
|
|
8
|
+
import { mkdirSync, readdirSync, renameSync, rmSync, statSync } from "node:fs";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
|
|
11
|
+
/** Component log files eligible for rotation. */
|
|
12
|
+
const ROTATABLE_LOGS = [
|
|
13
|
+
"daemon.log",
|
|
14
|
+
"stigmer-server.log",
|
|
15
|
+
"stigmer-server.err",
|
|
16
|
+
"runner.log",
|
|
17
|
+
"runner.err",
|
|
18
|
+
"temporal.log",
|
|
19
|
+
"llm.log",
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
/** Default retention for archived logs, in days. */
|
|
23
|
+
export const DEFAULT_LOG_RETENTION_DAYS = 7;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Rotate non-empty component logs in `logDir`, returning the number rotated.
|
|
27
|
+
* Creates the directory if needed and prunes archives past the retention
|
|
28
|
+
* window. A clock can be injected for deterministic tests.
|
|
29
|
+
*/
|
|
30
|
+
export function rotateLogs(
|
|
31
|
+
logDir: string,
|
|
32
|
+
options: { now?: Date; retentionDays?: number } = {},
|
|
33
|
+
): number {
|
|
34
|
+
const now = options.now ?? new Date();
|
|
35
|
+
mkdirSync(logDir, { recursive: true });
|
|
36
|
+
|
|
37
|
+
const suffix = timestampSuffix(now);
|
|
38
|
+
let rotated = 0;
|
|
39
|
+
for (const name of ROTATABLE_LOGS) {
|
|
40
|
+
const oldPath = join(logDir, name);
|
|
41
|
+
let size: number;
|
|
42
|
+
try {
|
|
43
|
+
size = statSync(oldPath).size;
|
|
44
|
+
} catch {
|
|
45
|
+
continue; // missing log — nothing to rotate
|
|
46
|
+
}
|
|
47
|
+
if (size === 0) continue; // empty log — leave it in place
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
renameSync(oldPath, `${oldPath}.${suffix}`);
|
|
51
|
+
rotated += 1;
|
|
52
|
+
} catch {
|
|
53
|
+
// A rotation failure must not block startup; leave the log and move on.
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
cleanupOldLogs(logDir, options.retentionDays ?? DEFAULT_LOG_RETENTION_DAYS, now);
|
|
58
|
+
return rotated;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Delete archived logs (`*.log.*` / `*.err.*`) older than `keepDays`, returning
|
|
63
|
+
* the count removed.
|
|
64
|
+
*/
|
|
65
|
+
export function cleanupOldLogs(
|
|
66
|
+
logDir: string,
|
|
67
|
+
keepDays: number = DEFAULT_LOG_RETENTION_DAYS,
|
|
68
|
+
now: Date = new Date(),
|
|
69
|
+
): number {
|
|
70
|
+
const cutoff = now.getTime() - keepDays * 24 * 60 * 60 * 1000;
|
|
71
|
+
let entries: string[];
|
|
72
|
+
try {
|
|
73
|
+
entries = readdirSync(logDir);
|
|
74
|
+
} catch {
|
|
75
|
+
return 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
let deleted = 0;
|
|
79
|
+
for (const entry of entries) {
|
|
80
|
+
if (!isArchivedLog(entry)) continue;
|
|
81
|
+
const path = join(logDir, entry);
|
|
82
|
+
let mtimeMs: number;
|
|
83
|
+
try {
|
|
84
|
+
mtimeMs = statSync(path).mtimeMs;
|
|
85
|
+
} catch {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
if (mtimeMs >= cutoff) continue;
|
|
89
|
+
try {
|
|
90
|
+
rmSync(path, { force: true });
|
|
91
|
+
deleted += 1;
|
|
92
|
+
} catch {
|
|
93
|
+
// Best-effort cleanup; a stuck file does not fail startup.
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return deleted;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Archived logs are the rotated copies: a base ending in `.log` or `.err`
|
|
100
|
+
// followed by a timestamp suffix (e.g. `runner.log.2026-06-13-141502`).
|
|
101
|
+
function isArchivedLog(name: string): boolean {
|
|
102
|
+
return /\.(log|err)\..+$/.test(name);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Matches the Go layout "2006-01-02-150405" (local time): YYYY-MM-DD-HHmmss.
|
|
106
|
+
function timestampSuffix(date: Date): string {
|
|
107
|
+
const p = (n: number, width = 2): string => String(n).padStart(width, "0");
|
|
108
|
+
return (
|
|
109
|
+
`${date.getFullYear()}-${p(date.getMonth() + 1)}-${p(date.getDate())}-` +
|
|
110
|
+
`${p(date.getHours())}${p(date.getMinutes())}${p(date.getSeconds())}`
|
|
111
|
+
);
|
|
112
|
+
}
|