@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,118 @@
|
|
|
1
|
+
// The foreground launcher hands the supervised daemon everything it needs to
|
|
2
|
+
// run through the environment — the same mechanism the Go CLI uses. Centralizing
|
|
3
|
+
// the variable names and the (de)serialization here keeps that contract in one
|
|
4
|
+
// place: the launcher writes it with buildDaemonEnv, the daemon reads it with
|
|
5
|
+
// readDaemonConfig, and nothing in between guesses at string keys.
|
|
6
|
+
|
|
7
|
+
/** Environment variable names that make up the launcher -> daemon contract. */
|
|
8
|
+
export const DaemonEnvVar = {
|
|
9
|
+
DataDir: "STIGMER_DATA_DIR",
|
|
10
|
+
LogDir: "STIGMER_LOG_DIR",
|
|
11
|
+
TemporalManaged: "STIGMER_TEMPORAL_MANAGED",
|
|
12
|
+
TemporalAddress: "TEMPORAL_SERVICE_ADDRESS",
|
|
13
|
+
ServerOnly: "STIGMER_SERVER_ONLY",
|
|
14
|
+
NoWeb: "STIGMER_NO_WEB",
|
|
15
|
+
ServerBin: "STIGMER_SERVER_BIN",
|
|
16
|
+
RunnerNodeBin: "STIGMER_RUNNER_NODE_BIN",
|
|
17
|
+
RunnerEntry: "STIGMER_RUNNER_ENTRY",
|
|
18
|
+
RunnerAppDir: "STIGMER_RUNNER_APP_DIR",
|
|
19
|
+
CursorApiKey: "CURSOR_API_KEY",
|
|
20
|
+
ActivityRouting: "STIGMER_ACTIVITY_ROUTING",
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
23
|
+
/** Resolved runner launch coordinates. */
|
|
24
|
+
export interface RunnerLaunch {
|
|
25
|
+
nodeBin: string;
|
|
26
|
+
entryPath: string;
|
|
27
|
+
appDir: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** The daemon's resolved configuration, parsed from the environment. */
|
|
31
|
+
export interface DaemonConfig {
|
|
32
|
+
dataDir: string;
|
|
33
|
+
logDir: string;
|
|
34
|
+
temporalManaged: boolean;
|
|
35
|
+
temporalAddress: string;
|
|
36
|
+
serverOnly: boolean;
|
|
37
|
+
noWeb: boolean;
|
|
38
|
+
serverBin: string;
|
|
39
|
+
runner?: RunnerLaunch;
|
|
40
|
+
cursorApiKey?: string;
|
|
41
|
+
activityRouting?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Inputs the launcher already resolved, to encode into the daemon env. */
|
|
45
|
+
export interface DaemonEnvInputs {
|
|
46
|
+
dataDir: string;
|
|
47
|
+
logDir: string;
|
|
48
|
+
temporalManaged: boolean;
|
|
49
|
+
temporalAddress: string;
|
|
50
|
+
serverOnly: boolean;
|
|
51
|
+
noWeb: boolean;
|
|
52
|
+
serverBin: string;
|
|
53
|
+
runner?: RunnerLaunch;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Build the environment for the internal-daemon child: the caller's environment
|
|
58
|
+
* plus the resolved contract values. Runner coordinates are omitted in
|
|
59
|
+
* server-only mode.
|
|
60
|
+
*/
|
|
61
|
+
export function buildDaemonEnv(inputs: DaemonEnvInputs, base: NodeJS.ProcessEnv = process.env): NodeJS.ProcessEnv {
|
|
62
|
+
const env: NodeJS.ProcessEnv = { ...base };
|
|
63
|
+
env[DaemonEnvVar.DataDir] = inputs.dataDir;
|
|
64
|
+
env[DaemonEnvVar.LogDir] = inputs.logDir;
|
|
65
|
+
env[DaemonEnvVar.TemporalManaged] = String(inputs.temporalManaged);
|
|
66
|
+
env[DaemonEnvVar.TemporalAddress] = inputs.temporalAddress;
|
|
67
|
+
env[DaemonEnvVar.ServerBin] = inputs.serverBin;
|
|
68
|
+
if (inputs.serverOnly) env[DaemonEnvVar.ServerOnly] = "true";
|
|
69
|
+
if (inputs.noWeb) env[DaemonEnvVar.NoWeb] = "1";
|
|
70
|
+
if (inputs.runner !== undefined && !inputs.serverOnly) {
|
|
71
|
+
env[DaemonEnvVar.RunnerNodeBin] = inputs.runner.nodeBin;
|
|
72
|
+
env[DaemonEnvVar.RunnerEntry] = inputs.runner.entryPath;
|
|
73
|
+
env[DaemonEnvVar.RunnerAppDir] = inputs.runner.appDir;
|
|
74
|
+
}
|
|
75
|
+
return env;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Parse the daemon configuration from an environment. Throws if a required
|
|
79
|
+
* value is missing. */
|
|
80
|
+
export function readDaemonConfig(env: NodeJS.ProcessEnv = process.env): DaemonConfig {
|
|
81
|
+
const dataDir = required(env, DaemonEnvVar.DataDir);
|
|
82
|
+
const logDir = env[DaemonEnvVar.LogDir] ?? `${dataDir}/logs`;
|
|
83
|
+
const serverOnly = env[DaemonEnvVar.ServerOnly] === "true";
|
|
84
|
+
|
|
85
|
+
const runner = readRunner(env);
|
|
86
|
+
return {
|
|
87
|
+
dataDir,
|
|
88
|
+
logDir,
|
|
89
|
+
temporalManaged: env[DaemonEnvVar.TemporalManaged] === "true",
|
|
90
|
+
temporalAddress: env[DaemonEnvVar.TemporalAddress] ?? "127.0.0.1:7233",
|
|
91
|
+
serverOnly,
|
|
92
|
+
noWeb: env[DaemonEnvVar.NoWeb] === "1",
|
|
93
|
+
serverBin: required(env, DaemonEnvVar.ServerBin),
|
|
94
|
+
runner: serverOnly ? undefined : runner,
|
|
95
|
+
cursorApiKey: nonEmpty(env[DaemonEnvVar.CursorApiKey]),
|
|
96
|
+
activityRouting: nonEmpty(env[DaemonEnvVar.ActivityRouting]),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function readRunner(env: NodeJS.ProcessEnv): RunnerLaunch | undefined {
|
|
101
|
+
const nodeBin = env[DaemonEnvVar.RunnerNodeBin];
|
|
102
|
+
const entryPath = env[DaemonEnvVar.RunnerEntry];
|
|
103
|
+
const appDir = env[DaemonEnvVar.RunnerAppDir];
|
|
104
|
+
if (!nodeBin || !entryPath || !appDir) return undefined;
|
|
105
|
+
return { nodeBin, entryPath, appDir };
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function required(env: NodeJS.ProcessEnv, key: string): string {
|
|
109
|
+
const value = env[key];
|
|
110
|
+
if (value === undefined || value === "") {
|
|
111
|
+
throw new Error(`${key} is required for the daemon process`);
|
|
112
|
+
}
|
|
113
|
+
return value;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function nonEmpty(value: string | undefined): string | undefined {
|
|
117
|
+
return value !== undefined && value !== "" ? value : undefined;
|
|
118
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// The production ProcessHost and Clock.
|
|
2
|
+
//
|
|
3
|
+
// Children are spawned detached (their own process group) so the whole tree can
|
|
4
|
+
// be signaled, with stdout+stderr piped through the daemon. The daemon tees each
|
|
5
|
+
// chunk to the component's log file and scans stdout for an optional readiness
|
|
6
|
+
// marker — the same pipe-and-watch shape the conformance/e2e harnesses use,
|
|
7
|
+
// which is what lets `status` report "runner actually polling" instead of mere
|
|
8
|
+
// liveness. Logs survive normally because the daemon outlives its children; an
|
|
9
|
+
// abnormal daemon death is handled by orphan cleanup on the next `up`.
|
|
10
|
+
|
|
11
|
+
import { spawn } from "node:child_process";
|
|
12
|
+
import { createWriteStream } from "node:fs";
|
|
13
|
+
import { killProcessGroup } from "../state/proc.js";
|
|
14
|
+
import type { ChildHandle, Clock, ExitInfo, ProcessHost, SpawnRequest } from "./types.js";
|
|
15
|
+
|
|
16
|
+
export class NodeProcessHost implements ProcessHost {
|
|
17
|
+
spawn(request: SpawnRequest): ChildHandle {
|
|
18
|
+
const out = createWriteStream(request.logFile, { flags: "a" });
|
|
19
|
+
const child = spawn(request.command, request.args, {
|
|
20
|
+
cwd: request.cwd,
|
|
21
|
+
env: request.env,
|
|
22
|
+
detached: true,
|
|
23
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
let exited = false;
|
|
27
|
+
let exitCb: ((info: ExitInfo) => void) | null = null;
|
|
28
|
+
let readyCb: (() => void) | null = null;
|
|
29
|
+
let ready = false;
|
|
30
|
+
|
|
31
|
+
// Keep a small rolling tail so a marker split across chunks is still found.
|
|
32
|
+
let tail = "";
|
|
33
|
+
const marker = request.readinessMarker;
|
|
34
|
+
child.stdout?.on("data", (chunk: Buffer) => {
|
|
35
|
+
out.write(chunk);
|
|
36
|
+
if (marker !== undefined && !ready) {
|
|
37
|
+
tail = (tail + chunk.toString("utf8")).slice(-Math.max(marker.length * 2, 256));
|
|
38
|
+
if (tail.includes(marker)) {
|
|
39
|
+
ready = true;
|
|
40
|
+
readyCb?.();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
child.stderr?.on("data", (chunk: Buffer) => out.write(chunk));
|
|
45
|
+
|
|
46
|
+
child.on("exit", (code, signal) => {
|
|
47
|
+
exited = true;
|
|
48
|
+
out.end();
|
|
49
|
+
exitCb?.({ code, signal });
|
|
50
|
+
});
|
|
51
|
+
child.on("error", (err) => {
|
|
52
|
+
out.write(`failed to spawn ${request.command}: ${String(err)}\n`);
|
|
53
|
+
exited = true;
|
|
54
|
+
exitCb?.({ code: null, signal: null });
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const pid = child.pid ?? -1;
|
|
58
|
+
return {
|
|
59
|
+
pid,
|
|
60
|
+
hasExited: () => exited,
|
|
61
|
+
onExit: (cb) => {
|
|
62
|
+
exitCb = cb;
|
|
63
|
+
},
|
|
64
|
+
onReady: (cb) => {
|
|
65
|
+
readyCb = cb;
|
|
66
|
+
if (ready) cb();
|
|
67
|
+
},
|
|
68
|
+
kill: (signal) => {
|
|
69
|
+
if (pid > 0) killProcessGroup(pid, signal);
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Real wall-clock implementation of Clock. */
|
|
76
|
+
export const systemClock: Clock = {
|
|
77
|
+
now: () => Date.now(),
|
|
78
|
+
sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
|
|
79
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Public surface of the daemon subsystem.
|
|
2
|
+
|
|
3
|
+
export { buildComponents, buildRunnerEnv, buildServerEnv } from "./components.js";
|
|
4
|
+
export { type DaemonConfig, type DaemonEnvInputs, DaemonEnvVar, buildDaemonEnv, readDaemonConfig } from "./env.js";
|
|
5
|
+
export { NodeProcessHost, systemClock } from "./host.js";
|
|
6
|
+
export { down, isRunning, type UpOptions, up } from "./launch.js";
|
|
7
|
+
export { type InternalDaemonDeps, type TemporalControl, runInternalDaemon } from "./process.js";
|
|
8
|
+
export {
|
|
9
|
+
HEALTH_CHECK_INTERVAL_MS,
|
|
10
|
+
MAX_RESTARTS,
|
|
11
|
+
MAX_UNHEALTHY_CHECKS,
|
|
12
|
+
ProcessSupervisor,
|
|
13
|
+
RAPID_CRASH_WINDOW_MS,
|
|
14
|
+
SETTLE_DELAY_MS,
|
|
15
|
+
type StartResult,
|
|
16
|
+
type SupervisorDeps,
|
|
17
|
+
} from "./supervisor.js";
|
|
18
|
+
export type { ChildHandle, Clock, ComponentSpec, ExitInfo, ProcessHost, ReadinessGate, SpawnRequest } from "./types.js";
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
// Foreground control of the daemon: `up` (spawn + verify + wait-ready),
|
|
2
|
+
// `down` (signal + wait + safety-net cleanup), and a liveness check.
|
|
3
|
+
//
|
|
4
|
+
// `up` resolves every heavy dependency in the foreground (Temporal binary,
|
|
5
|
+
// server binary, runner entry) so failures surface with a clear message before
|
|
6
|
+
// a detached daemon is spawned, then re-execs this same CLI as the hidden
|
|
7
|
+
// `internal-daemon` and waits until the server's gRPC port answers.
|
|
8
|
+
|
|
9
|
+
import { spawn } from "node:child_process";
|
|
10
|
+
import { mkdirSync, openSync } from "node:fs";
|
|
11
|
+
import { homedir } from "node:os";
|
|
12
|
+
import { join } from "node:path";
|
|
13
|
+
import { type Config, load as loadConfig } from "../../config/config.js";
|
|
14
|
+
import { log } from "../../logger.js";
|
|
15
|
+
import { CliExitError } from "../../errors/cli-exit-error.js";
|
|
16
|
+
import { ExitCode } from "../../errors/exit-codes.js";
|
|
17
|
+
import { DAEMON_PID_FILE, SERVER_PORT } from "../constants.js";
|
|
18
|
+
import { tcpConnects, waitForTcp } from "../net/tcp.js";
|
|
19
|
+
import { dataDir, logDir } from "../paths.js";
|
|
20
|
+
import { readPidFile, removePidFile } from "../state/pidfile.js";
|
|
21
|
+
import { findProcessByPort, isProcessAlive, killProcess } from "../state/proc.js";
|
|
22
|
+
import { type StartupConfig, removeStartupConfig, saveStartupConfig } from "../state/startup-config.js";
|
|
23
|
+
import { rotateLogs } from "../state/log-rotation.js";
|
|
24
|
+
import { ensureRunner } from "../runtime/runner.js";
|
|
25
|
+
import { ensureServerBinary } from "../runtime/server.js";
|
|
26
|
+
import { TemporalManager } from "../temporal/manager.js";
|
|
27
|
+
import { buildDaemonEnv } from "./env.js";
|
|
28
|
+
|
|
29
|
+
/** How long `up` waits for the server's gRPC port after spawning the daemon. */
|
|
30
|
+
const READY_TIMEOUT_MS = 60_000;
|
|
31
|
+
/** How long to wait for the daemon to come up before checking it is still alive. */
|
|
32
|
+
const DAEMON_SETTLE_MS = 3_000;
|
|
33
|
+
/** How long `down` waits for graceful daemon exit before force-killing. */
|
|
34
|
+
const STOP_TIMEOUT_MS = 15_000;
|
|
35
|
+
const STOP_POLL_MS = 500;
|
|
36
|
+
|
|
37
|
+
export interface UpOptions {
|
|
38
|
+
serverOnly?: boolean;
|
|
39
|
+
noWeb?: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Start the local stack in the background. Throws on any startup failure. */
|
|
43
|
+
export async function up(options: UpOptions = {}, home: string = homedir()): Promise<void> {
|
|
44
|
+
const data = dataDir(home);
|
|
45
|
+
const logs = logDir(home);
|
|
46
|
+
|
|
47
|
+
cleanupOrphans(data);
|
|
48
|
+
if (await isRunning(home)) {
|
|
49
|
+
throw new CliExitError("daemon is already running", ExitCode.General);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
mkdirSync(data, { recursive: true });
|
|
53
|
+
mkdirSync(logs, { recursive: true });
|
|
54
|
+
rotateLogs(logs);
|
|
55
|
+
|
|
56
|
+
const config = loadConfig();
|
|
57
|
+
const temporalManaged = isTemporalManaged(config);
|
|
58
|
+
const temporal = TemporalManager.forHome(home);
|
|
59
|
+
|
|
60
|
+
if (temporalManaged) {
|
|
61
|
+
log.info("ensuring Temporal is installed");
|
|
62
|
+
await temporal.ensureInstalled();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const serverBin = await ensureServerBinary({ home });
|
|
66
|
+
const runner = options.serverOnly === true ? undefined : ensureRunner({ home });
|
|
67
|
+
|
|
68
|
+
const env = buildDaemonEnv(
|
|
69
|
+
{
|
|
70
|
+
dataDir: data,
|
|
71
|
+
logDir: logs,
|
|
72
|
+
temporalManaged,
|
|
73
|
+
temporalAddress: temporal.address,
|
|
74
|
+
serverOnly: options.serverOnly === true,
|
|
75
|
+
noWeb: options.noWeb === true,
|
|
76
|
+
serverBin,
|
|
77
|
+
runner,
|
|
78
|
+
},
|
|
79
|
+
process.env,
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
const daemonPid = spawnDaemon(env, join(logs, "daemon.log"));
|
|
83
|
+
log.info("daemon process started", { pid: daemonPid });
|
|
84
|
+
|
|
85
|
+
await sleep(DAEMON_SETTLE_MS);
|
|
86
|
+
if (!isProcessAlive(daemonPid)) {
|
|
87
|
+
throw new CliExitError("daemon process crashed during startup", ExitCode.General, [
|
|
88
|
+
`Check ${join(logs, "daemon.log")} for details.`,
|
|
89
|
+
]);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
await waitForTcp({ port: SERVER_PORT, timeoutMs: READY_TIMEOUT_MS, label: "stigmer-server" });
|
|
93
|
+
|
|
94
|
+
await applySeedpackBestEffort(home);
|
|
95
|
+
|
|
96
|
+
saveStartupConfig(data, buildStartupConfig(data, logs, temporal.address, config, daemonPid, options));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Bootstrap the system seedpack into the freshly-started local backend (the TS
|
|
101
|
+
* equivalent of the Go daemon's EnsureSeedpackBootstrapped). Idempotent via a
|
|
102
|
+
* content-hash marker, so repeated `up`s are cheap. Best-effort: the stack is
|
|
103
|
+
* already serving by this point, so a seedpack failure is surfaced as a warning
|
|
104
|
+
* with a retry hint rather than tearing the stack down.
|
|
105
|
+
*/
|
|
106
|
+
async function applySeedpackBestEffort(home: string): Promise<void> {
|
|
107
|
+
try {
|
|
108
|
+
const [{ createBackendClient }, { getDefault }, { applySeedpack }] = await Promise.all([
|
|
109
|
+
import("../../client/index.js"),
|
|
110
|
+
import("../../config/config.js"),
|
|
111
|
+
import("../seedpack/apply.js"),
|
|
112
|
+
]);
|
|
113
|
+
// Always seed the local server `up` just started — never the active backend
|
|
114
|
+
// context. A user whose CLI is pointed at cloud must still get their local
|
|
115
|
+
// stack seeded, and must never have system resources applied to their cloud
|
|
116
|
+
// org. Pin to a fresh local config (localhost:SERVER_PORT) with no auth.
|
|
117
|
+
const client = createBackendClient({ config: getDefault(), getAccessToken: () => null });
|
|
118
|
+
const result = await applySeedpack(
|
|
119
|
+
{
|
|
120
|
+
controller: client.controller,
|
|
121
|
+
stigmer: client.stigmer,
|
|
122
|
+
info: (line) => process.stderr.write(`${line}\n`),
|
|
123
|
+
warn: (line) => process.stderr.write(`${line}\n`),
|
|
124
|
+
},
|
|
125
|
+
{ markerDir: dataDir(home), home },
|
|
126
|
+
);
|
|
127
|
+
log.debug("seedpack bootstrap complete", { applied: result.applied, hash: result.hash, org: result.org });
|
|
128
|
+
} catch (err) {
|
|
129
|
+
log.warn("seedpack bootstrap failed", { error: String(err) });
|
|
130
|
+
process.stderr.write(
|
|
131
|
+
"Warning: failed to apply system resources (seedpack). Run 'stigmer seedpack apply' to retry.\n",
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** Stop the local stack. Returns false if nothing was running. */
|
|
137
|
+
export async function down(home: string = homedir()): Promise<boolean> {
|
|
138
|
+
const data = dataDir(home);
|
|
139
|
+
let pid = readPidFile(join(data, DAEMON_PID_FILE));
|
|
140
|
+
if (pid === null) pid = findProcessByPort(SERVER_PORT);
|
|
141
|
+
|
|
142
|
+
if (pid === null || !isProcessAlive(pid)) {
|
|
143
|
+
removePidFile(join(data, DAEMON_PID_FILE));
|
|
144
|
+
await stopManagedTemporal(home);
|
|
145
|
+
cleanupOrphans(data);
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// The daemon traps SIGTERM and tears down children + Temporal in order.
|
|
150
|
+
killProcess(pid, "SIGTERM");
|
|
151
|
+
log.info("sent SIGTERM to daemon", { pid });
|
|
152
|
+
|
|
153
|
+
const deadline = Date.now() + STOP_TIMEOUT_MS;
|
|
154
|
+
while (Date.now() < deadline) {
|
|
155
|
+
if (!isProcessAlive(pid)) {
|
|
156
|
+
removePidFile(join(data, DAEMON_PID_FILE));
|
|
157
|
+
removeStartupConfig(data);
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
await sleep(STOP_POLL_MS);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
log.warn("daemon did not stop gracefully, force killing", { pid });
|
|
164
|
+
killProcess(pid, "SIGKILL");
|
|
165
|
+
removePidFile(join(data, DAEMON_PID_FILE));
|
|
166
|
+
removeStartupConfig(data);
|
|
167
|
+
await stopManagedTemporal(home);
|
|
168
|
+
cleanupOrphans(data);
|
|
169
|
+
return true;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** Whether the daemon is running: live PID, else a server-port fallback. */
|
|
173
|
+
export async function isRunning(home: string = homedir()): Promise<boolean> {
|
|
174
|
+
const data = dataDir(home);
|
|
175
|
+
const pid = readPidFile(join(data, DAEMON_PID_FILE));
|
|
176
|
+
if (pid !== null) {
|
|
177
|
+
if (isProcessAlive(pid)) return true;
|
|
178
|
+
removePidFile(join(data, DAEMON_PID_FILE)); // stale
|
|
179
|
+
}
|
|
180
|
+
return tcpConnects(SERVER_PORT, "127.0.0.1", 1000);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Re-exec this CLI as the detached internal-daemon, returning its PID. Replaying
|
|
184
|
+
// execArgv carries the tsx loader in dev and is a no-op for a plain-node build.
|
|
185
|
+
function spawnDaemon(env: NodeJS.ProcessEnv, daemonLog: string): number {
|
|
186
|
+
const script = process.argv[1];
|
|
187
|
+
if (script === undefined) {
|
|
188
|
+
throw new CliExitError("cannot resolve the CLI entry point to launch the daemon", ExitCode.General);
|
|
189
|
+
}
|
|
190
|
+
const out = openSync(daemonLog, "a");
|
|
191
|
+
const child = spawn(process.execPath, [...process.execArgv, script, "internal-daemon"], {
|
|
192
|
+
detached: true,
|
|
193
|
+
env,
|
|
194
|
+
stdio: ["ignore", out, out],
|
|
195
|
+
});
|
|
196
|
+
child.unref();
|
|
197
|
+
if (child.pid === undefined) {
|
|
198
|
+
throw new CliExitError("failed to start the daemon process", ExitCode.General);
|
|
199
|
+
}
|
|
200
|
+
return child.pid;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Kill any daemon/server/runner left alive by a previous, improperly-stopped run.
|
|
204
|
+
function cleanupOrphans(data: string): void {
|
|
205
|
+
for (const name of [DAEMON_PID_FILE, "stigmer-server.pid", "runner.pid"]) {
|
|
206
|
+
const pidPath = join(data, name);
|
|
207
|
+
const pid = readPidFile(pidPath);
|
|
208
|
+
if (pid === null) continue;
|
|
209
|
+
if (isProcessAlive(pid)) {
|
|
210
|
+
log.warn("killing orphaned process from a previous run", { file: name, pid });
|
|
211
|
+
killProcess(pid, "SIGTERM");
|
|
212
|
+
}
|
|
213
|
+
removePidFile(pidPath);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
async function stopManagedTemporal(home: string): Promise<void> {
|
|
218
|
+
try {
|
|
219
|
+
await TemporalManager.forHome(home).stop();
|
|
220
|
+
} catch (err) {
|
|
221
|
+
log.debug("managed Temporal stop skipped", { error: String(err) });
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Default to managed Temporal unless the opaque local config explicitly opts out
|
|
226
|
+
// (Go parity: managed is the default). Wave 4's `setup` models this section.
|
|
227
|
+
function isTemporalManaged(config: Config): boolean {
|
|
228
|
+
const local = config.backend.local as { temporal?: { managed?: boolean } } | undefined;
|
|
229
|
+
return local?.temporal?.managed !== false;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function buildStartupConfig(
|
|
233
|
+
data: string,
|
|
234
|
+
logs: string,
|
|
235
|
+
temporalAddr: string,
|
|
236
|
+
config: Config,
|
|
237
|
+
daemonPid: number,
|
|
238
|
+
options: UpOptions,
|
|
239
|
+
): StartupConfig {
|
|
240
|
+
const local = config.backend.local as { llm?: { provider?: string; model?: string; base_url?: string } } | undefined;
|
|
241
|
+
return {
|
|
242
|
+
data_dir: data,
|
|
243
|
+
log_dir: logs,
|
|
244
|
+
temporal_addr: temporalAddr,
|
|
245
|
+
llm_provider: local?.llm?.provider ?? "",
|
|
246
|
+
llm_model: local?.llm?.model ?? "",
|
|
247
|
+
llm_base_url: local?.llm?.base_url ?? "",
|
|
248
|
+
execution_mode: "local",
|
|
249
|
+
sandbox_image: "",
|
|
250
|
+
sandbox_auto_pull: false,
|
|
251
|
+
sandbox_cleanup: false,
|
|
252
|
+
sandbox_ttl: 0,
|
|
253
|
+
stigmer_server_pid: daemonPid,
|
|
254
|
+
server_only: options.serverOnly === true,
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function sleep(ms: number): Promise<void> {
|
|
259
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
260
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
// The supervised daemon body — the `stigmer internal-daemon` entry point.
|
|
2
|
+
//
|
|
3
|
+
// It brings the local stack up in the canonical order (managed Temporal, then
|
|
4
|
+
// the gated server, then the runner), records a health snapshot readers can
|
|
5
|
+
// trust, runs the 10s health monitor, and on a shutdown signal tears everything
|
|
6
|
+
// down in reverse. Temporal, the process host, the clock, and the shutdown
|
|
7
|
+
// trigger are all injectable so the whole body can be driven in a test without
|
|
8
|
+
// real signals or a real Temporal.
|
|
9
|
+
|
|
10
|
+
import { mkdirSync } from "node:fs";
|
|
11
|
+
import { dirname, join } from "node:path";
|
|
12
|
+
import { type Logger, log as defaultLog } from "../../logger.js";
|
|
13
|
+
import { DAEMON_PID_FILE, HEALTH_STATE_FILE } from "../constants.js";
|
|
14
|
+
import { type HealthState, writeHealthState } from "../state/health-state.js";
|
|
15
|
+
import { removePidFile, writePidFile } from "../state/pidfile.js";
|
|
16
|
+
import { TemporalManager } from "../temporal/manager.js";
|
|
17
|
+
import { TemporalSupervisor } from "../temporal/supervisor.js";
|
|
18
|
+
import { isWebConsoleAvailable } from "../webconsole/index.js";
|
|
19
|
+
import { buildComponents } from "./components.js";
|
|
20
|
+
import { type DaemonConfig, readDaemonConfig } from "./env.js";
|
|
21
|
+
import { NodeProcessHost, systemClock } from "./host.js";
|
|
22
|
+
import { HEALTH_CHECK_INTERVAL_MS, ProcessSupervisor, SETTLE_DELAY_MS } from "./supervisor.js";
|
|
23
|
+
import type { Clock, ProcessHost } from "./types.js";
|
|
24
|
+
|
|
25
|
+
/** The Temporal lifecycle surface the daemon drives. TemporalManager (+ its
|
|
26
|
+
* supervisor) satisfies it; tests provide a fake. */
|
|
27
|
+
export interface TemporalControl {
|
|
28
|
+
readonly address: string;
|
|
29
|
+
start(): Promise<void>;
|
|
30
|
+
stop(): Promise<void>;
|
|
31
|
+
isRunning(): Promise<boolean>;
|
|
32
|
+
getPid(): number | null;
|
|
33
|
+
startSupervisor(): void;
|
|
34
|
+
stopSupervisor(): void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface InternalDaemonDeps {
|
|
38
|
+
config?: DaemonConfig;
|
|
39
|
+
host?: ProcessHost;
|
|
40
|
+
clock?: Clock;
|
|
41
|
+
temporal?: TemporalControl;
|
|
42
|
+
log?: Logger;
|
|
43
|
+
/** Resolves when shutdown is requested (real entry: SIGTERM/SIGINT). */
|
|
44
|
+
waitForShutdown: () => Promise<void>;
|
|
45
|
+
/** Invoked once the stack is up and the monitor is running (tests). */
|
|
46
|
+
onStarted?: () => void;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Run the daemon to completion. Returns the process exit code. */
|
|
50
|
+
export async function runInternalDaemon(deps: InternalDaemonDeps): Promise<number> {
|
|
51
|
+
const config = deps.config ?? readDaemonConfig();
|
|
52
|
+
const host = deps.host ?? new NodeProcessHost();
|
|
53
|
+
const clock = deps.clock ?? systemClock;
|
|
54
|
+
const log = deps.log ?? defaultLog;
|
|
55
|
+
|
|
56
|
+
mkdirSync(config.logDir, { recursive: true });
|
|
57
|
+
mkdirSync(join(config.dataDir, "workspace"), { recursive: true });
|
|
58
|
+
writePidFile(join(config.dataDir, DAEMON_PID_FILE), process.pid);
|
|
59
|
+
|
|
60
|
+
const healthState: HealthState = {
|
|
61
|
+
daemon_pid: process.pid,
|
|
62
|
+
started_at: new Date(clock.now()).toISOString(),
|
|
63
|
+
components: {},
|
|
64
|
+
};
|
|
65
|
+
const healthPath = join(config.dataDir, HEALTH_STATE_FILE);
|
|
66
|
+
const persist = (): void => writeHealthState(healthPath, healthState);
|
|
67
|
+
|
|
68
|
+
const temporal = deps.temporal ?? (config.temporalManaged ? buildTemporal(config, log) : null);
|
|
69
|
+
|
|
70
|
+
// --- Start managed Temporal first (the server and runner depend on it). ---
|
|
71
|
+
if (temporal !== null) {
|
|
72
|
+
log.info("starting managed Temporal");
|
|
73
|
+
healthState.components.temporal = { pid: 0, state: "stopped", started_at: "", restart_count: 0 };
|
|
74
|
+
try {
|
|
75
|
+
await temporal.start();
|
|
76
|
+
} catch (err) {
|
|
77
|
+
healthState.components.temporal.state = "failed";
|
|
78
|
+
healthState.components.temporal.last_error = String(err);
|
|
79
|
+
persist();
|
|
80
|
+
log.error("failed to start managed Temporal", { error: String(err) });
|
|
81
|
+
return 1;
|
|
82
|
+
}
|
|
83
|
+
healthState.components.temporal.pid = temporal.getPid() ?? 0;
|
|
84
|
+
healthState.components.temporal.state = "running";
|
|
85
|
+
healthState.components.temporal.started_at = new Date(clock.now()).toISOString();
|
|
86
|
+
temporal.startSupervisor();
|
|
87
|
+
persist();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// --- Start the server (gated) and runner via the supervisor. ---
|
|
91
|
+
const supervisor = new ProcessSupervisor(buildComponents(config), { host, clock, healthState, persist, log });
|
|
92
|
+
const result = await supervisor.startAll();
|
|
93
|
+
if (!result.ok) {
|
|
94
|
+
log.error("critical component failed to start", { component: result.failedCritical });
|
|
95
|
+
if (temporal !== null) {
|
|
96
|
+
temporal.stopSupervisor();
|
|
97
|
+
await temporal.stop().catch(() => {});
|
|
98
|
+
}
|
|
99
|
+
return 1;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Let processes settle, then catch anything that crashed immediately.
|
|
103
|
+
await clock.sleep(SETTLE_DELAY_MS);
|
|
104
|
+
supervisor.settleCheck();
|
|
105
|
+
|
|
106
|
+
// Web console: detect-and-skip until T06 wires real serving.
|
|
107
|
+
healthState.components["web-console"] = {
|
|
108
|
+
pid: 0,
|
|
109
|
+
state: config.noWeb || !isWebConsoleAvailable() ? "stopped" : "running",
|
|
110
|
+
started_at: "",
|
|
111
|
+
restart_count: 0,
|
|
112
|
+
};
|
|
113
|
+
if (config.noWeb) log.info("web console disabled via --no-web");
|
|
114
|
+
else if (!isWebConsoleAvailable()) log.debug("web console not bundled in this build, skipping");
|
|
115
|
+
persist();
|
|
116
|
+
|
|
117
|
+
// --- Health monitor: sync Temporal + drive one supervisor tick per interval. ---
|
|
118
|
+
const monitor = setInterval(() => {
|
|
119
|
+
void (async () => {
|
|
120
|
+
if (temporal !== null) await syncTemporal(temporal, healthState);
|
|
121
|
+
await supervisor.tick();
|
|
122
|
+
})();
|
|
123
|
+
}, HEALTH_CHECK_INTERVAL_MS);
|
|
124
|
+
monitor.unref?.();
|
|
125
|
+
|
|
126
|
+
log.info("daemon started", { pid: process.pid });
|
|
127
|
+
deps.onStarted?.();
|
|
128
|
+
|
|
129
|
+
// --- Wait for shutdown, then tear down in reverse order. ---
|
|
130
|
+
await deps.waitForShutdown();
|
|
131
|
+
log.info("received shutdown signal");
|
|
132
|
+
clearInterval(monitor);
|
|
133
|
+
|
|
134
|
+
await supervisor.shutdown();
|
|
135
|
+
|
|
136
|
+
if (temporal !== null) {
|
|
137
|
+
temporal.stopSupervisor();
|
|
138
|
+
log.info("stopping managed Temporal");
|
|
139
|
+
await temporal.stop().catch((err) => log.warn("failed to stop managed Temporal cleanly", { error: String(err) }));
|
|
140
|
+
if (healthState.components.temporal !== undefined) healthState.components.temporal.state = "stopped";
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
persist();
|
|
144
|
+
removePidFile(join(config.dataDir, DAEMON_PID_FILE));
|
|
145
|
+
removePidFile(healthPath);
|
|
146
|
+
log.info("daemon shutdown complete");
|
|
147
|
+
return 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Sync the Temporal component's health from its self-supervising manager.
|
|
151
|
+
async function syncTemporal(temporal: TemporalControl, healthState: HealthState): Promise<void> {
|
|
152
|
+
const state = healthState.components.temporal;
|
|
153
|
+
if (state === undefined) return;
|
|
154
|
+
if (await temporal.isRunning()) {
|
|
155
|
+
state.state = "running";
|
|
156
|
+
state.pid = temporal.getPid() ?? state.pid;
|
|
157
|
+
state.last_error = undefined;
|
|
158
|
+
} else {
|
|
159
|
+
state.state = "unhealthy";
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Build the real managed-Temporal control from the ~/.stigmer layout (home is
|
|
164
|
+
// two levels up from the data dir: ~/.stigmer/data -> ~).
|
|
165
|
+
function buildTemporal(config: DaemonConfig, log: Logger): TemporalControl {
|
|
166
|
+
const home = dirname(dirname(config.dataDir));
|
|
167
|
+
const manager = TemporalManager.forHome(home);
|
|
168
|
+
let supervisor: TemporalSupervisor | null = null;
|
|
169
|
+
return {
|
|
170
|
+
get address() {
|
|
171
|
+
return manager.address;
|
|
172
|
+
},
|
|
173
|
+
start: () => manager.start(),
|
|
174
|
+
stop: () => manager.stop(),
|
|
175
|
+
isRunning: () => manager.isRunning(),
|
|
176
|
+
getPid: () => manager.getPid(),
|
|
177
|
+
startSupervisor: () => {
|
|
178
|
+
supervisor = new TemporalSupervisor(manager, { log });
|
|
179
|
+
supervisor.start();
|
|
180
|
+
},
|
|
181
|
+
stopSupervisor: () => supervisor?.stop(),
|
|
182
|
+
};
|
|
183
|
+
}
|