@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,28 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { mapReleaseArch, mapReleaseOs, sha256Hex } from "./artifact.js";
|
|
4
|
+
|
|
5
|
+
describe("mapReleaseOs", () => {
|
|
6
|
+
it("maps Node platforms to release OS tokens", () => {
|
|
7
|
+
expect(mapReleaseOs("darwin")).toBe("darwin");
|
|
8
|
+
expect(mapReleaseOs("win32")).toBe("windows");
|
|
9
|
+
expect(mapReleaseOs("linux")).toBe("linux");
|
|
10
|
+
expect(mapReleaseOs("freebsd")).toBe("linux"); // default bucket
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
describe("mapReleaseArch", () => {
|
|
15
|
+
it("maps Node arch names to release arch tokens", () => {
|
|
16
|
+
expect(mapReleaseArch("arm64")).toBe("arm64");
|
|
17
|
+
expect(mapReleaseArch("x64")).toBe("amd64");
|
|
18
|
+
expect(mapReleaseArch("ppc64")).toBe("ppc64"); // passthrough
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
describe("sha256Hex", () => {
|
|
23
|
+
it("computes a lowercase hex digest matching node:crypto", () => {
|
|
24
|
+
const bytes = new Uint8Array([1, 2, 3, 4, 5]);
|
|
25
|
+
const expected = createHash("sha256").update(bytes).digest("hex");
|
|
26
|
+
expect(sha256Hex(bytes)).toBe(expected);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
// Shared primitives for acquiring a single executable from a GitHub-release
|
|
2
|
+
// `.tar.gz`: release platform/arch mapping, a fetch + gunzip + minimal tar
|
|
3
|
+
// reader, optional sha256 verification, and an executable write.
|
|
4
|
+
//
|
|
5
|
+
// Both on-demand downloaders — the Temporal CLI (`temporal/download.ts`) and the
|
|
6
|
+
// `stigmer-server` control plane (`runtime/server.ts`) — build on this, so the
|
|
7
|
+
// fetch/extract contract lives in exactly one place. The tar reader is a tiny
|
|
8
|
+
// POSIX/ustar implementation: no native `tar` dependency, which keeps the base
|
|
9
|
+
// install lean (DD-002).
|
|
10
|
+
|
|
11
|
+
import { createHash } from "node:crypto";
|
|
12
|
+
import { chmodSync, mkdirSync, writeFileSync } from "node:fs";
|
|
13
|
+
import { dirname } from "node:path";
|
|
14
|
+
import { gunzipSync } from "fflate";
|
|
15
|
+
import { CliExitError } from "../errors/cli-exit-error.js";
|
|
16
|
+
import { ExitCode } from "../errors/exit-codes.js";
|
|
17
|
+
|
|
18
|
+
/** Release OS token, matching the `<os>` segment of our release asset names. */
|
|
19
|
+
export function mapReleaseOs(platform: NodeJS.Platform): string {
|
|
20
|
+
switch (platform) {
|
|
21
|
+
case "darwin":
|
|
22
|
+
return "darwin";
|
|
23
|
+
case "win32":
|
|
24
|
+
return "windows";
|
|
25
|
+
default:
|
|
26
|
+
return "linux";
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Release arch token, matching the `<arch>` segment of our release asset names. */
|
|
31
|
+
export function mapReleaseArch(arch: string): string {
|
|
32
|
+
switch (arch) {
|
|
33
|
+
case "arm64":
|
|
34
|
+
return "arm64";
|
|
35
|
+
case "x64":
|
|
36
|
+
return "amd64";
|
|
37
|
+
default:
|
|
38
|
+
return arch;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface TarballBinarySource {
|
|
43
|
+
/** URL of the `.tar.gz` archive. */
|
|
44
|
+
url: string;
|
|
45
|
+
/**
|
|
46
|
+
* URL of a `shasum -a 256`-format checksum file for {@link url}. When set, the
|
|
47
|
+
* downloaded archive's sha256 is verified against it before extraction and any
|
|
48
|
+
* mismatch aborts the install.
|
|
49
|
+
*/
|
|
50
|
+
checksumUrl?: string;
|
|
51
|
+
/** Basename of the entry to extract from the archive. */
|
|
52
|
+
entryName: string;
|
|
53
|
+
/** Absolute path to write the extracted, executable binary to. */
|
|
54
|
+
binPath: string;
|
|
55
|
+
/** Human label used in error messages (e.g. "Temporal CLI", "stigmer-server"). */
|
|
56
|
+
label: string;
|
|
57
|
+
/** Override the fetch implementation (tests). */
|
|
58
|
+
fetchImpl?: typeof fetch;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Download a `.tar.gz`, optionally verify its sha256, extract the named entry,
|
|
63
|
+
* and write it to `binPath` with executable permissions. Throws a
|
|
64
|
+
* {@link CliExitError} with the URL on any network, checksum, or extraction
|
|
65
|
+
* failure.
|
|
66
|
+
*/
|
|
67
|
+
export async function fetchTarballBinary(src: TarballBinarySource): Promise<void> {
|
|
68
|
+
const doFetch = src.fetchImpl ?? fetch;
|
|
69
|
+
const archive = await fetchBytes(doFetch, src.url, src.label);
|
|
70
|
+
|
|
71
|
+
if (src.checksumUrl !== undefined) {
|
|
72
|
+
const expected = parseShasum(await fetchText(doFetch, src.checksumUrl, `${src.label} checksum`));
|
|
73
|
+
const actual = sha256Hex(archive);
|
|
74
|
+
if (expected === "" || expected !== actual) {
|
|
75
|
+
throw new CliExitError(`${src.label} checksum mismatch — refusing to use the download`, ExitCode.General, [
|
|
76
|
+
`expected: ${expected || "(unparseable)"}`,
|
|
77
|
+
`actual: ${actual}`,
|
|
78
|
+
`archive: ${src.url}`,
|
|
79
|
+
]);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const tarBytes = gunzipSync(archive);
|
|
84
|
+
const binary = extractTarEntry(tarBytes, src.entryName);
|
|
85
|
+
if (binary === null) {
|
|
86
|
+
throw new CliExitError(`${src.entryName} not found in the downloaded ${src.label} archive`, ExitCode.General, [
|
|
87
|
+
`archive: ${src.url}`,
|
|
88
|
+
]);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
mkdirSync(dirname(src.binPath), { recursive: true });
|
|
92
|
+
writeFileSync(src.binPath, binary, { mode: 0o755 });
|
|
93
|
+
chmodSync(src.binPath, 0o755);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Lowercase hex sha256 of `bytes`. */
|
|
97
|
+
export function sha256Hex(bytes: Uint8Array): string {
|
|
98
|
+
return createHash("sha256").update(bytes).digest("hex");
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
async function fetchBytes(doFetch: typeof fetch, url: string, label: string): Promise<Uint8Array> {
|
|
102
|
+
const res = await doFetchOrThrow(doFetch, url, label);
|
|
103
|
+
return new Uint8Array(await res.arrayBuffer());
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async function fetchText(doFetch: typeof fetch, url: string, label: string): Promise<string> {
|
|
107
|
+
const res = await doFetchOrThrow(doFetch, url, label);
|
|
108
|
+
return res.text();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
async function doFetchOrThrow(doFetch: typeof fetch, url: string, label: string): Promise<Response> {
|
|
112
|
+
let res: Response;
|
|
113
|
+
try {
|
|
114
|
+
res = await doFetch(url);
|
|
115
|
+
} catch (err) {
|
|
116
|
+
throw new CliExitError(`failed to download ${label} from ${url}`, ExitCode.General, [String(err)]);
|
|
117
|
+
}
|
|
118
|
+
if (!res.ok) {
|
|
119
|
+
throw new CliExitError(`failed to download ${label}: HTTP ${res.status} from ${url}`, ExitCode.General);
|
|
120
|
+
}
|
|
121
|
+
return res;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// `shasum`/`sha256sum` output is "<hex> <filename>"; take the first token.
|
|
125
|
+
function parseShasum(content: string): string {
|
|
126
|
+
return (content.trim().split(/\s+/)[0] ?? "").toLowerCase();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Extract a single regular-file entry whose basename matches `name` from an
|
|
131
|
+
* (uncompressed) tar buffer. Minimal POSIX/ustar reader: 512-byte header blocks,
|
|
132
|
+
* octal size at offset 124, type flag at 156, data padded to 512 bytes.
|
|
133
|
+
*/
|
|
134
|
+
export function extractTarEntry(buf: Uint8Array, name: string): Uint8Array | null {
|
|
135
|
+
let offset = 0;
|
|
136
|
+
while (offset + 512 <= buf.length) {
|
|
137
|
+
const header = buf.subarray(offset, offset + 512);
|
|
138
|
+
const entryName = readCString(header, 0, 100);
|
|
139
|
+
if (entryName === "") break; // zero block marks end of archive
|
|
140
|
+
|
|
141
|
+
const size = Number.parseInt(readCString(header, 124, 12).trim() || "0", 8) || 0;
|
|
142
|
+
const typeFlag = String.fromCharCode(header[156] ?? 0);
|
|
143
|
+
const dataStart = offset + 512;
|
|
144
|
+
|
|
145
|
+
const isRegularFile = typeFlag === "0" || typeFlag === "\0";
|
|
146
|
+
if (isRegularFile && basename(entryName) === name) {
|
|
147
|
+
return buf.subarray(dataStart, dataStart + size);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Advance past this entry's data, rounded up to the 512-byte block size.
|
|
151
|
+
offset = dataStart + Math.ceil(size / 512) * 512;
|
|
152
|
+
}
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function readCString(block: Uint8Array, start: number, length: number): string {
|
|
157
|
+
let end = start;
|
|
158
|
+
const limit = start + length;
|
|
159
|
+
while (end < limit && block[end] !== 0) end += 1;
|
|
160
|
+
return Buffer.from(block.subarray(start, end)).toString("utf8");
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function basename(path: string): string {
|
|
164
|
+
const parts = path.split("/");
|
|
165
|
+
return parts[parts.length - 1] ?? path;
|
|
166
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Cross-cutting constants for the local-stack orchestration subsystem.
|
|
2
|
+
//
|
|
3
|
+
// These are the values that must stay identical across the foreground launcher,
|
|
4
|
+
// the supervised daemon, the Temporal manager, and the status/logs commands.
|
|
5
|
+
// Keeping them in one module is what lets a coding agent change a port or a
|
|
6
|
+
// queue name in exactly one place and trust that server-dispatch and
|
|
7
|
+
// runner-poll can never drift (see the T05 plan's "Critical correctness
|
|
8
|
+
// finding").
|
|
9
|
+
|
|
10
|
+
/** Port `stigmer-server` listens on (gRPC). Matches the Go CLI's `DaemonPort`. */
|
|
11
|
+
export const SERVER_PORT = 7234;
|
|
12
|
+
|
|
13
|
+
/** Port the embedded web console is served on (7xxx=API, 8xxx=UI convention). */
|
|
14
|
+
export const WEB_CONSOLE_PORT = 8234;
|
|
15
|
+
|
|
16
|
+
/** Temporal frontend gRPC port (dev server default). */
|
|
17
|
+
export const TEMPORAL_PORT = 7233;
|
|
18
|
+
|
|
19
|
+
/** Temporal Web UI port. */
|
|
20
|
+
export const TEMPORAL_UI_PORT = 8233;
|
|
21
|
+
|
|
22
|
+
/** Temporal namespace the local stack uses end-to-end. */
|
|
23
|
+
export const TEMPORAL_NAMESPACE = "default";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The Temporal task queue the unified runner polls and the server dispatches
|
|
27
|
+
* to. This is the single source of truth, pinned identically on both the
|
|
28
|
+
* launched server and the runner so they can never diverge.
|
|
29
|
+
*
|
|
30
|
+
* Note: the Go CLI daemon still sets the runner to the stale
|
|
31
|
+
* `agent_execution_runner` queue while the server dispatches to
|
|
32
|
+
* `stigmer_runner` (the unified TS runner queue) — a latent hang. The TS CLI
|
|
33
|
+
* uses the correct value; a Go follow-up tracks fixing the daemon env.
|
|
34
|
+
*/
|
|
35
|
+
export const RUNNER_TASK_QUEUE = "stigmer_runner";
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The marker the unified runner prints on stdout once its Temporal worker is
|
|
39
|
+
* actually polling. Two existing harnesses (`test/conformance`, `test/e2e`)
|
|
40
|
+
* already depend on it; the daemon uses it to report truthful runner readiness
|
|
41
|
+
* rather than mere process liveness.
|
|
42
|
+
*/
|
|
43
|
+
export const RUNNER_READY_MARKER = "Worker ready, polling for tasks";
|
|
44
|
+
|
|
45
|
+
/** PID file names (live under the data dir; see `paths.ts`). */
|
|
46
|
+
export const DAEMON_PID_FILE = "daemon.pid";
|
|
47
|
+
export const SERVER_PID_FILE = "stigmer-server.pid";
|
|
48
|
+
export const RUNNER_PID_FILE = "runner.pid";
|
|
49
|
+
|
|
50
|
+
/** State file names (live under the data dir). */
|
|
51
|
+
export const HEALTH_STATE_FILE = "health-state.json";
|
|
52
|
+
export const STARTUP_CONFIG_FILE = "startup-config.json";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { RUNNER_READY_MARKER, RUNNER_TASK_QUEUE } from "../constants.js";
|
|
3
|
+
import type { DaemonConfig } from "./env.js";
|
|
4
|
+
import { buildComponents, buildRunnerEnv, buildServerEnv } from "./components.js";
|
|
5
|
+
|
|
6
|
+
const config: DaemonConfig = {
|
|
7
|
+
dataDir: "/home/u/.stigmer/data",
|
|
8
|
+
logDir: "/home/u/.stigmer/data/logs",
|
|
9
|
+
temporalManaged: true,
|
|
10
|
+
temporalAddress: "127.0.0.1:7233",
|
|
11
|
+
serverOnly: false,
|
|
12
|
+
noWeb: false,
|
|
13
|
+
serverBin: "/bin/stigmer-server",
|
|
14
|
+
runner: { nodeBin: "/bin/node", entryPath: "/repo/runner/dist/main.js", appDir: "/repo/runner" },
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
describe("buildServerEnv", () => {
|
|
18
|
+
it("pins ports, queues, and db/storage paths under ~/.stigmer", () => {
|
|
19
|
+
const env = buildServerEnv(config, {});
|
|
20
|
+
expect(env.GRPC_PORT).toBe("7234");
|
|
21
|
+
expect(env.TEMPORAL_HOST_PORT).toBe("127.0.0.1:7233");
|
|
22
|
+
expect(env.TEMPORAL_NAMESPACE).toBe("default");
|
|
23
|
+
expect(env.TEMPORAL_AGENT_EXECUTION_RUNNER_TASK_QUEUE).toBe(RUNNER_TASK_QUEUE);
|
|
24
|
+
expect(env.TEMPORAL_WORKFLOW_EXECUTION_RUNNER_TASK_QUEUE).toBe(RUNNER_TASK_QUEUE);
|
|
25
|
+
expect(env.DB_PATH).toBe("/home/u/.stigmer/stigmer.db");
|
|
26
|
+
expect(env.STORAGE_PATH).toBe("/home/u/.stigmer/storage");
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
describe("buildRunnerEnv", () => {
|
|
31
|
+
it("configures static mode with the workspace and pinned queue", () => {
|
|
32
|
+
const env = buildRunnerEnv(config, {});
|
|
33
|
+
expect(env.MODE).toBe("local");
|
|
34
|
+
expect(env.STIGMER_RUNNER_MODE).toBeUndefined(); // static mode
|
|
35
|
+
expect(env.STIGMER_BACKEND_ENDPOINT).toBe("http://localhost:7234");
|
|
36
|
+
expect(env.TEMPORAL_SERVICE_ADDRESS).toBe("127.0.0.1:7233");
|
|
37
|
+
expect(env.TEMPORAL_NAMESPACE).toBe("default");
|
|
38
|
+
expect(env.WORKSPACE_ROOT_DIR).toBe("/home/u/.stigmer/data/workspace");
|
|
39
|
+
expect(env.STIGMER_TASK_QUEUE).toBe(RUNNER_TASK_QUEUE);
|
|
40
|
+
expect(env.LOG_LEVEL).toBe("info");
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("forwards CURSOR_API_KEY and activity routing only when set", () => {
|
|
44
|
+
expect(buildRunnerEnv(config, {}).CURSOR_API_KEY).toBeUndefined();
|
|
45
|
+
const withKey = buildRunnerEnv({ ...config, cursorApiKey: "ck", activityRouting: "session" }, {});
|
|
46
|
+
expect(withKey.CURSOR_API_KEY).toBe("ck");
|
|
47
|
+
expect(withKey.STIGMER_ACTIVITY_ROUTING).toBe("session");
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// The regression guard for the queue bug: the server dispatches to, and the
|
|
51
|
+
// runner polls, the exact same queue.
|
|
52
|
+
it("pins the runner's poll queue to the server's dispatch queue", () => {
|
|
53
|
+
const serverEnv = buildServerEnv(config, {});
|
|
54
|
+
const runnerEnv = buildRunnerEnv(config, {});
|
|
55
|
+
expect(runnerEnv.STIGMER_TASK_QUEUE).toBe(serverEnv.TEMPORAL_AGENT_EXECUTION_RUNNER_TASK_QUEUE);
|
|
56
|
+
expect(runnerEnv.STIGMER_TASK_QUEUE).toBe(serverEnv.TEMPORAL_WORKFLOW_EXECUTION_RUNNER_TASK_QUEUE);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
describe("buildComponents", () => {
|
|
61
|
+
it("orders server (critical, gated) before runner (marker, not critical)", () => {
|
|
62
|
+
const components = buildComponents(config, {});
|
|
63
|
+
expect(components.map((c) => c.name)).toEqual(["stigmer-server", "runner"]);
|
|
64
|
+
|
|
65
|
+
const [server, runner] = components;
|
|
66
|
+
expect(server.critical).toBe(true);
|
|
67
|
+
expect(server.gate).toBeDefined();
|
|
68
|
+
expect(server.resolve().readinessMarker).toBeUndefined();
|
|
69
|
+
|
|
70
|
+
expect(runner.critical).toBe(false);
|
|
71
|
+
expect(runner.gate).toBeUndefined();
|
|
72
|
+
expect(runner.resolve().readinessMarker).toBe(RUNNER_READY_MARKER);
|
|
73
|
+
expect(runner.resolve().args).toEqual(["/repo/runner/dist/main.js"]);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("omits the runner in server-only mode", () => {
|
|
77
|
+
const components = buildComponents({ ...config, serverOnly: true }, {});
|
|
78
|
+
expect(components.map((c) => c.name)).toEqual(["stigmer-server"]);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// Builds the ordered list of managed components and their child environments.
|
|
2
|
+
//
|
|
3
|
+
// This module is where the queue pin lives end-to-end: the server is told to
|
|
4
|
+
// dispatch to RUNNER_TASK_QUEUE and the runner is told to poll RUNNER_TASK_QUEUE,
|
|
5
|
+
// both from the same constant, so the two can never drift. Setting the server's
|
|
6
|
+
// load-bearing env explicitly (ports, queues, db/storage paths) rather than
|
|
7
|
+
// relying on its compiled defaults makes the launch deterministic and the pin
|
|
8
|
+
// enforceable — mirroring test/e2e/fixtures/server-manager.ts.
|
|
9
|
+
|
|
10
|
+
import { dirname, join } from "node:path";
|
|
11
|
+
import { RUNNER_TASK_QUEUE, RUNNER_READY_MARKER, SERVER_PID_FILE, RUNNER_PID_FILE, SERVER_PORT, TEMPORAL_NAMESPACE } from "../constants.js";
|
|
12
|
+
import { waitForTcp } from "../net/tcp.js";
|
|
13
|
+
import type { DaemonConfig } from "./env.js";
|
|
14
|
+
import type { ComponentSpec, ReadinessGate } from "./types.js";
|
|
15
|
+
|
|
16
|
+
/** How long the server has to open its gRPC port before startup aborts. */
|
|
17
|
+
const SERVER_GATE_TIMEOUT_MS = 30_000;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Environment for the `stigmer-server` child. Pins ports, Temporal coordinates,
|
|
21
|
+
* both runner task queues, and the db/storage paths to the ~/.stigmer layout.
|
|
22
|
+
*/
|
|
23
|
+
export function buildServerEnv(config: DaemonConfig, base: NodeJS.ProcessEnv = process.env): NodeJS.ProcessEnv {
|
|
24
|
+
const configDir = dirname(config.dataDir); // ~/.stigmer
|
|
25
|
+
return {
|
|
26
|
+
...base,
|
|
27
|
+
GRPC_PORT: String(SERVER_PORT),
|
|
28
|
+
TEMPORAL_HOST_PORT: config.temporalAddress,
|
|
29
|
+
TEMPORAL_NAMESPACE,
|
|
30
|
+
TEMPORAL_AGENT_EXECUTION_RUNNER_TASK_QUEUE: RUNNER_TASK_QUEUE,
|
|
31
|
+
TEMPORAL_WORKFLOW_EXECUTION_RUNNER_TASK_QUEUE: RUNNER_TASK_QUEUE,
|
|
32
|
+
DB_PATH: join(configDir, "stigmer.db"),
|
|
33
|
+
STORAGE_PATH: join(configDir, "storage"),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Environment for the unified runner child in static mode (STIGMER_RUNNER_MODE
|
|
39
|
+
* left unset). The runner polls RUNNER_TASK_QUEUE — the corrected queue that the
|
|
40
|
+
* server actually dispatches to.
|
|
41
|
+
*/
|
|
42
|
+
export function buildRunnerEnv(config: DaemonConfig, base: NodeJS.ProcessEnv = process.env): NodeJS.ProcessEnv {
|
|
43
|
+
const env: NodeJS.ProcessEnv = {
|
|
44
|
+
...base,
|
|
45
|
+
MODE: "local",
|
|
46
|
+
STIGMER_BACKEND_ENDPOINT: `http://localhost:${SERVER_PORT}`,
|
|
47
|
+
TEMPORAL_SERVICE_ADDRESS: config.temporalAddress,
|
|
48
|
+
TEMPORAL_NAMESPACE,
|
|
49
|
+
WORKSPACE_ROOT_DIR: join(config.dataDir, "workspace"),
|
|
50
|
+
STIGMER_TASK_QUEUE: RUNNER_TASK_QUEUE,
|
|
51
|
+
LOG_LEVEL: base.LOG_LEVEL ?? "info",
|
|
52
|
+
};
|
|
53
|
+
if (config.cursorApiKey !== undefined) env.CURSOR_API_KEY = config.cursorApiKey;
|
|
54
|
+
if (config.activityRouting !== undefined) env.STIGMER_ACTIVITY_ROUTING = config.activityRouting;
|
|
55
|
+
return env;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Build the ordered components: `stigmer-server` (critical, gated on its gRPC
|
|
60
|
+
* port) always first; the runner second unless server-only. Order matters — the
|
|
61
|
+
* runner talks to the server.
|
|
62
|
+
*/
|
|
63
|
+
export function buildComponents(config: DaemonConfig, base: NodeJS.ProcessEnv = process.env): ComponentSpec[] {
|
|
64
|
+
const components: ComponentSpec[] = [
|
|
65
|
+
{
|
|
66
|
+
name: "stigmer-server",
|
|
67
|
+
pidFile: join(config.dataDir, SERVER_PID_FILE),
|
|
68
|
+
critical: true,
|
|
69
|
+
resolve: () => ({
|
|
70
|
+
command: config.serverBin,
|
|
71
|
+
args: [],
|
|
72
|
+
env: buildServerEnv(config, base),
|
|
73
|
+
logFile: join(config.logDir, "stigmer-server.log"),
|
|
74
|
+
}),
|
|
75
|
+
gate: serverGate(),
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
if (config.serverOnly || config.runner === undefined) {
|
|
80
|
+
return components;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const runner = config.runner;
|
|
84
|
+
components.push({
|
|
85
|
+
name: "runner",
|
|
86
|
+
pidFile: join(config.dataDir, RUNNER_PID_FILE),
|
|
87
|
+
critical: false,
|
|
88
|
+
resolve: () => ({
|
|
89
|
+
command: runner.nodeBin,
|
|
90
|
+
args: [runner.entryPath],
|
|
91
|
+
cwd: join(config.dataDir, "workspace"),
|
|
92
|
+
env: buildRunnerEnv(config, base),
|
|
93
|
+
logFile: join(config.logDir, "runner.log"),
|
|
94
|
+
readinessMarker: RUNNER_READY_MARKER,
|
|
95
|
+
}),
|
|
96
|
+
});
|
|
97
|
+
return components;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// The server is ready once its gRPC port accepts a connection; fail fast if it
|
|
101
|
+
// exits first.
|
|
102
|
+
function serverGate(): ReadinessGate {
|
|
103
|
+
return {
|
|
104
|
+
description: `stigmer-server gRPC on port ${SERVER_PORT}`,
|
|
105
|
+
wait: (handle) =>
|
|
106
|
+
waitForTcp({
|
|
107
|
+
port: SERVER_PORT,
|
|
108
|
+
timeoutMs: SERVER_GATE_TIMEOUT_MS,
|
|
109
|
+
label: "stigmer-server gRPC",
|
|
110
|
+
getExit: () => (handle.hasExited() ? { code: null, signal: null } : null),
|
|
111
|
+
}),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { mkdtempSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { createServer, type Server } from "node:net";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
6
|
+
import type { Logger } from "../../logger.js";
|
|
7
|
+
import { RUNNER_READY_MARKER, SERVER_PORT } from "../constants.js";
|
|
8
|
+
import { isProcessAlive } from "../state/proc.js";
|
|
9
|
+
import { loadHealthState, type HealthState } from "../state/health-state.js";
|
|
10
|
+
import { readPidFile } from "../state/pidfile.js";
|
|
11
|
+
import type { DaemonConfig } from "./env.js";
|
|
12
|
+
import { NodeProcessHost } from "./host.js";
|
|
13
|
+
import { runInternalDaemon, type TemporalControl } from "./process.js";
|
|
14
|
+
import type { ChildHandle, Clock, ExitInfo, ProcessHost, SpawnRequest } from "./types.js";
|
|
15
|
+
|
|
16
|
+
const silent: Logger = { debug: vi.fn(), info: vi.fn(), warn: vi.fn(), error: vi.fn() };
|
|
17
|
+
|
|
18
|
+
function tempDir(): string {
|
|
19
|
+
return mkdtempSync(join(tmpdir(), "stigmer-int-"));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// ---- Integration 1: the real ProcessHost spawns, tees logs, detects the
|
|
23
|
+
// readiness marker, and stops a real child. ----
|
|
24
|
+
describe("NodeProcessHost (real spawn)", () => {
|
|
25
|
+
it("pipes logs, detects the readiness marker, and stops the child", async () => {
|
|
26
|
+
const dir = tempDir();
|
|
27
|
+
const script = join(dir, "fake-child.cjs");
|
|
28
|
+
writeFileSync(
|
|
29
|
+
script,
|
|
30
|
+
`process.stdout.write(${JSON.stringify(`${RUNNER_READY_MARKER}\n`)});\n` +
|
|
31
|
+
`process.on("SIGTERM", () => process.exit(0));\n` +
|
|
32
|
+
`setInterval(() => {}, 1000);\n`,
|
|
33
|
+
);
|
|
34
|
+
const logFile = join(dir, "child.log");
|
|
35
|
+
|
|
36
|
+
const host = new NodeProcessHost();
|
|
37
|
+
const request: SpawnRequest = {
|
|
38
|
+
command: process.execPath,
|
|
39
|
+
args: [script],
|
|
40
|
+
env: process.env,
|
|
41
|
+
logFile,
|
|
42
|
+
readinessMarker: RUNNER_READY_MARKER,
|
|
43
|
+
};
|
|
44
|
+
const handle = host.spawn(request);
|
|
45
|
+
|
|
46
|
+
const ready = new Promise<void>((resolve) => handle.onReady(resolve));
|
|
47
|
+
const exited = new Promise<void>((resolve) => handle.onExit(() => resolve()));
|
|
48
|
+
|
|
49
|
+
await ready;
|
|
50
|
+
expect(isProcessAlive(handle.pid)).toBe(true);
|
|
51
|
+
// The readiness marker is detected on the stdout stream, but the tee to the
|
|
52
|
+
// log file is a buffered write that may not have flushed to disk yet — poll
|
|
53
|
+
// the file rather than reading it once to avoid a race.
|
|
54
|
+
await expect.poll(() => readFileSync(logFile, "utf8")).toContain(RUNNER_READY_MARKER);
|
|
55
|
+
|
|
56
|
+
handle.kill("SIGTERM");
|
|
57
|
+
await exited;
|
|
58
|
+
expect(handle.hasExited()).toBe(true);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// ---- Integration 2: the full daemon body, with a fake process host + fake
|
|
63
|
+
// Temporal, but a real TCP listener satisfying the server's gRPC gate. ----
|
|
64
|
+
|
|
65
|
+
// Minimal fake host whose children exit on SIGTERM.
|
|
66
|
+
class FakeHost implements ProcessHost {
|
|
67
|
+
private nextPid = 2000;
|
|
68
|
+
readonly killed: NodeJS.Signals[] = [];
|
|
69
|
+
spawn(_request: SpawnRequest): ChildHandle {
|
|
70
|
+
let exited = false;
|
|
71
|
+
let exitCb: ((info: ExitInfo) => void) | null = null;
|
|
72
|
+
const pid = this.nextPid++;
|
|
73
|
+
return {
|
|
74
|
+
pid,
|
|
75
|
+
hasExited: () => exited,
|
|
76
|
+
onExit: (cb) => {
|
|
77
|
+
exitCb = cb;
|
|
78
|
+
},
|
|
79
|
+
onReady: () => {},
|
|
80
|
+
kill: (signal) => {
|
|
81
|
+
this.killed.push(signal);
|
|
82
|
+
if (!exited) {
|
|
83
|
+
exited = true;
|
|
84
|
+
exitCb?.({ code: null, signal });
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const fastClock: Clock = { now: () => Date.now(), sleep: () => Promise.resolve() };
|
|
92
|
+
|
|
93
|
+
function fakeTemporal(): TemporalControl {
|
|
94
|
+
return {
|
|
95
|
+
address: "127.0.0.1:7233",
|
|
96
|
+
start: vi.fn(async () => {}),
|
|
97
|
+
stop: vi.fn(async () => {}),
|
|
98
|
+
isRunning: vi.fn(async () => true),
|
|
99
|
+
getPid: () => 4242,
|
|
100
|
+
startSupervisor: vi.fn(),
|
|
101
|
+
stopSupervisor: vi.fn(),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function listenOn(port: number): Promise<Server> {
|
|
106
|
+
return new Promise((resolve, reject) => {
|
|
107
|
+
const server = createServer();
|
|
108
|
+
server.once("error", reject);
|
|
109
|
+
server.listen(port, "127.0.0.1", () => resolve(server));
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
let gateServer: Server | null = null;
|
|
114
|
+
afterEach(async () => {
|
|
115
|
+
if (gateServer !== null) {
|
|
116
|
+
await new Promise<void>((resolve) => gateServer?.close(() => resolve()));
|
|
117
|
+
gateServer = null;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
describe("runInternalDaemon (full body with fakes)", () => {
|
|
122
|
+
it("brings the stack up, writes a health snapshot, and tears down on shutdown", async () => {
|
|
123
|
+
const data = join(tempDir(), ".stigmer", "data");
|
|
124
|
+
const config: DaemonConfig = {
|
|
125
|
+
dataDir: data,
|
|
126
|
+
logDir: join(data, "logs"),
|
|
127
|
+
temporalManaged: true,
|
|
128
|
+
temporalAddress: "127.0.0.1:7233",
|
|
129
|
+
serverOnly: false,
|
|
130
|
+
noWeb: true,
|
|
131
|
+
serverBin: "server-cmd",
|
|
132
|
+
runner: { nodeBin: "node-cmd", entryPath: join(data, "entry.js"), appDir: data },
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// Satisfy the server's gRPC readiness gate with a real listener.
|
|
136
|
+
try {
|
|
137
|
+
gateServer = await listenOn(SERVER_PORT);
|
|
138
|
+
} catch {
|
|
139
|
+
// Port busy (a real daemon?) — the gate will still connect to whatever is
|
|
140
|
+
// listening, which is all this test needs.
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const host = new FakeHost();
|
|
144
|
+
const temporal = fakeTemporal();
|
|
145
|
+
const healthPath = join(data, "health-state.json");
|
|
146
|
+
|
|
147
|
+
let snapshot: HealthState | null = null;
|
|
148
|
+
let resolveShutdown!: () => void;
|
|
149
|
+
const shutdown = new Promise<void>((resolve) => {
|
|
150
|
+
resolveShutdown = resolve;
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
const code = await runInternalDaemon({
|
|
154
|
+
config,
|
|
155
|
+
host,
|
|
156
|
+
clock: fastClock,
|
|
157
|
+
temporal,
|
|
158
|
+
log: silent,
|
|
159
|
+
waitForShutdown: () => shutdown,
|
|
160
|
+
onStarted: () => {
|
|
161
|
+
snapshot = loadHealthState(healthPath);
|
|
162
|
+
resolveShutdown();
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
expect(code).toBe(0);
|
|
167
|
+
expect(temporal.start).toHaveBeenCalledOnce();
|
|
168
|
+
expect(temporal.stop).toHaveBeenCalledOnce();
|
|
169
|
+
|
|
170
|
+
// The snapshot captured while up shows the whole stack.
|
|
171
|
+
expect(snapshot).not.toBeNull();
|
|
172
|
+
const components = snapshot as unknown as HealthState;
|
|
173
|
+
expect(components.daemon_pid).toBe(process.pid);
|
|
174
|
+
expect(Object.keys(components.components).sort()).toEqual(["runner", "stigmer-server", "temporal", "web-console"]);
|
|
175
|
+
expect(components.components["stigmer-server"].state).toBe("running");
|
|
176
|
+
expect(components.components.runner.state).toBe("running");
|
|
177
|
+
|
|
178
|
+
// Children were signaled, and the daemon cleaned up after shutdown.
|
|
179
|
+
expect(host.killed).toContain("SIGTERM");
|
|
180
|
+
expect(readPidFile(join(data, "daemon.pid"))).toBeNull();
|
|
181
|
+
expect(loadHealthState(healthPath)).toBeNull();
|
|
182
|
+
});
|
|
183
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { buildDaemonEnv, type DaemonEnvInputs, readDaemonConfig } from "./env.js";
|
|
3
|
+
|
|
4
|
+
const baseInputs: DaemonEnvInputs = {
|
|
5
|
+
dataDir: "/home/u/.stigmer/data",
|
|
6
|
+
logDir: "/home/u/.stigmer/data/logs",
|
|
7
|
+
temporalManaged: true,
|
|
8
|
+
temporalAddress: "127.0.0.1:7233",
|
|
9
|
+
serverOnly: false,
|
|
10
|
+
noWeb: false,
|
|
11
|
+
serverBin: "/usr/local/bin/stigmer-server",
|
|
12
|
+
runner: { nodeBin: "/usr/bin/node", entryPath: "/repo/runner/dist/main.js", appDir: "/repo/runner" },
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
describe("buildDaemonEnv + readDaemonConfig", () => {
|
|
16
|
+
it("round-trips the full launcher -> daemon contract", () => {
|
|
17
|
+
const env = buildDaemonEnv(baseInputs, {});
|
|
18
|
+
const config = readDaemonConfig(env);
|
|
19
|
+
expect(config).toEqual({
|
|
20
|
+
dataDir: "/home/u/.stigmer/data",
|
|
21
|
+
logDir: "/home/u/.stigmer/data/logs",
|
|
22
|
+
temporalManaged: true,
|
|
23
|
+
temporalAddress: "127.0.0.1:7233",
|
|
24
|
+
serverOnly: false,
|
|
25
|
+
noWeb: false,
|
|
26
|
+
serverBin: "/usr/local/bin/stigmer-server",
|
|
27
|
+
runner: { nodeBin: "/usr/bin/node", entryPath: "/repo/runner/dist/main.js", appDir: "/repo/runner" },
|
|
28
|
+
cursorApiKey: undefined,
|
|
29
|
+
activityRouting: undefined,
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("omits runner coordinates in server-only mode", () => {
|
|
34
|
+
const env = buildDaemonEnv({ ...baseInputs, serverOnly: true }, {});
|
|
35
|
+
const config = readDaemonConfig(env);
|
|
36
|
+
expect(config.serverOnly).toBe(true);
|
|
37
|
+
expect(config.runner).toBeUndefined();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it("passes CURSOR_API_KEY and activity routing through from the base env", () => {
|
|
41
|
+
const env = buildDaemonEnv(baseInputs, { CURSOR_API_KEY: "ck", STIGMER_ACTIVITY_ROUTING: "session" });
|
|
42
|
+
const config = readDaemonConfig(env);
|
|
43
|
+
expect(config.cursorApiKey).toBe("ck");
|
|
44
|
+
expect(config.activityRouting).toBe("session");
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("requires the data dir and server binary", () => {
|
|
48
|
+
expect(() => readDaemonConfig({})).toThrow(/STIGMER_DATA_DIR/);
|
|
49
|
+
expect(() => readDaemonConfig({ STIGMER_DATA_DIR: "/x" })).toThrow(/STIGMER_SERVER_BIN/);
|
|
50
|
+
});
|
|
51
|
+
});
|