@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,54 @@
|
|
|
1
|
+
// On-demand download of the Temporal CLI binary from GitHub releases.
|
|
2
|
+
//
|
|
3
|
+
// `up` needs a `temporal` binary and the upstream release is a small, public,
|
|
4
|
+
// stable artifact. The fetch/gunzip/untar/write mechanics are shared with the
|
|
5
|
+
// stigmer-server downloader in `../artifact.ts`; this module only owns Temporal's
|
|
6
|
+
// asset-naming and the default version.
|
|
7
|
+
//
|
|
8
|
+
// Parity note: like the Go CLI, this does not verify a checksum (the stigmer
|
|
9
|
+
// -server downloader does, per DD-003). A checksum-hardening follow-up is filed;
|
|
10
|
+
// until then the integrity guarantee is HTTPS + GitHub's release immutability.
|
|
11
|
+
|
|
12
|
+
import { existsSync } from "node:fs";
|
|
13
|
+
import { fetchTarballBinary, mapReleaseArch, mapReleaseOs } from "../artifact.js";
|
|
14
|
+
|
|
15
|
+
// Re-exported so existing consumers (temporal/index.ts, download.test.ts) keep
|
|
16
|
+
// importing the tar reader from here.
|
|
17
|
+
export { extractTarEntry } from "../artifact.js";
|
|
18
|
+
|
|
19
|
+
/** Default Temporal CLI version (matches the Go CLI's `DefaultTemporalVersion`). */
|
|
20
|
+
export const DEFAULT_TEMPORAL_VERSION = "1.5.1";
|
|
21
|
+
|
|
22
|
+
export interface TemporalDownloadTarget {
|
|
23
|
+
/** Temporal CLI version, e.g. "1.5.1". */
|
|
24
|
+
version: string;
|
|
25
|
+
/** Absolute path to write the extracted `temporal` binary to. */
|
|
26
|
+
binPath: string;
|
|
27
|
+
/** Node platform (defaults to process.platform). */
|
|
28
|
+
platform?: NodeJS.Platform;
|
|
29
|
+
/** Node arch (defaults to process.arch). */
|
|
30
|
+
arch?: string;
|
|
31
|
+
/** Override the fetch implementation (tests). */
|
|
32
|
+
fetchImpl?: typeof fetch;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Download and install the Temporal CLI binary to `binPath`. */
|
|
36
|
+
export async function downloadTemporalCli(target: TemporalDownloadTarget): Promise<void> {
|
|
37
|
+
const goos = mapReleaseOs(target.platform ?? process.platform);
|
|
38
|
+
const goarch = mapReleaseArch(target.arch ?? process.arch);
|
|
39
|
+
const archive = `temporal_cli_${target.version}_${goos}_${goarch}.tar.gz`;
|
|
40
|
+
const url = `https://github.com/temporalio/cli/releases/download/v${target.version}/${archive}`;
|
|
41
|
+
|
|
42
|
+
await fetchTarballBinary({
|
|
43
|
+
url,
|
|
44
|
+
entryName: "temporal",
|
|
45
|
+
binPath: target.binPath,
|
|
46
|
+
label: "Temporal CLI",
|
|
47
|
+
fetchImpl: target.fetchImpl,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** True if a Temporal binary is already present at `binPath`. */
|
|
52
|
+
export function isTemporalInstalled(binPath: string): boolean {
|
|
53
|
+
return existsSync(binPath);
|
|
54
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Public surface of the Temporal subsystem.
|
|
2
|
+
|
|
3
|
+
export { DEFAULT_TEMPORAL_VERSION, downloadTemporalCli, extractTarEntry, isTemporalInstalled } from "./download.js";
|
|
4
|
+
export { isLikelyTemporal, processCommandLine } from "./inspect.js";
|
|
5
|
+
export { TemporalManager, type TemporalManagerOptions } from "./manager.js";
|
|
6
|
+
export { type SupervisedTarget, type SupervisorOptions, TemporalSupervisor } from "./supervisor.js";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Process-identity check guarding against PID reuse.
|
|
2
|
+
//
|
|
3
|
+
// A PID file can outlive the process it named; the OS may then assign that PID
|
|
4
|
+
// to something unrelated. Before trusting a PID as "our Temporal", we confirm
|
|
5
|
+
// the live process's command line actually looks like the Temporal dev server.
|
|
6
|
+
// POSIX-only (uses `ps`); returns false on any uncertainty.
|
|
7
|
+
|
|
8
|
+
import { execFileSync } from "node:child_process";
|
|
9
|
+
|
|
10
|
+
/** Full command line of a process via `ps`, or null if it cannot be read. */
|
|
11
|
+
export function processCommandLine(pid: number): string | null {
|
|
12
|
+
try {
|
|
13
|
+
return execFileSync("ps", ["-p", String(pid), "-o", "command="], {
|
|
14
|
+
encoding: "utf8",
|
|
15
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
16
|
+
}).trim();
|
|
17
|
+
} catch {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Heuristically confirm that `pid` is the Temporal server we manage: its command
|
|
24
|
+
* line mentions "temporal" and either our binary path or a "server" subcommand.
|
|
25
|
+
*/
|
|
26
|
+
export function isLikelyTemporal(pid: number, binPath: string): boolean {
|
|
27
|
+
const cmd = processCommandLine(pid);
|
|
28
|
+
if (cmd === null) return false;
|
|
29
|
+
const lower = cmd.toLowerCase();
|
|
30
|
+
if (!lower.includes("temporal")) return false;
|
|
31
|
+
return cmd.includes(binPath) || lower.includes("server");
|
|
32
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { mkdtempSync } from "node:fs";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { describe, expect, it } from "vitest";
|
|
5
|
+
import { temporalPidFile } from "../paths.js";
|
|
6
|
+
import { writePidFile } from "../state/pidfile.js";
|
|
7
|
+
import { TemporalManager } from "./manager.js";
|
|
8
|
+
|
|
9
|
+
function tempHome(): string {
|
|
10
|
+
return mkdtempSync(join(tmpdir(), "stigmer-home-"));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
describe("TemporalManager", () => {
|
|
14
|
+
it("exposes the frontend address", () => {
|
|
15
|
+
const manager = TemporalManager.forHome(tempHome());
|
|
16
|
+
expect(manager.address).toBe("127.0.0.1:7233");
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("reads the PID from the ~/.stigmer/temporal.pid location", () => {
|
|
20
|
+
const home = tempHome();
|
|
21
|
+
const manager = TemporalManager.forHome(home);
|
|
22
|
+
expect(manager.getPid()).toBeNull();
|
|
23
|
+
writePidFile(temporalPidFile(home), 5151);
|
|
24
|
+
expect(manager.getPid()).toBe(5151);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("reports not-running when there is no PID file", async () => {
|
|
28
|
+
const manager = TemporalManager.forHome(tempHome());
|
|
29
|
+
expect(await manager.isRunning()).toBe(false);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
// Lifecycle manager for the local Temporal dev server.
|
|
2
|
+
//
|
|
3
|
+
// Faithful TS port of the Go CLI's `temporal.Manager`, reorganized around the
|
|
4
|
+
// shared primitives (file lock, PID file, TCP readiness). It installs the
|
|
5
|
+
// `temporal` binary on demand, starts the dev server in its own process group,
|
|
6
|
+
// and answers "is it really running?" with the same layered check the Go CLI
|
|
7
|
+
// uses (PID present -> alive -> actually Temporal -> port listening). Start is
|
|
8
|
+
// idempotent: a healthy instance — ours or another process's — is reused.
|
|
9
|
+
|
|
10
|
+
import { mkdirSync, openSync } from "node:fs";
|
|
11
|
+
import { homedir } from "node:os";
|
|
12
|
+
import { dirname, join } from "node:path";
|
|
13
|
+
import { spawn } from "node:child_process";
|
|
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 { tcpConnects, waitForTcp } from "../net/tcp.js";
|
|
18
|
+
import { binDir, logDir, temporalDataDir, temporalLockFile, temporalPidFile } from "../paths.js";
|
|
19
|
+
import { TEMPORAL_PORT, TEMPORAL_UI_PORT } from "../constants.js";
|
|
20
|
+
import { type FileLock, acquireLock } from "../state/lock.js";
|
|
21
|
+
import { readPidFile, removePidFile, writePidFile } from "../state/pidfile.js";
|
|
22
|
+
import { findProcessByPort, isProcessAlive, killProcessGroup } from "../state/proc.js";
|
|
23
|
+
import { DEFAULT_TEMPORAL_VERSION, downloadTemporalCli, isTemporalInstalled } from "./download.js";
|
|
24
|
+
import { isLikelyTemporal } from "./inspect.js";
|
|
25
|
+
|
|
26
|
+
const READY_TIMEOUT_MS = 10_000;
|
|
27
|
+
const STOP_POLL_MS = 500;
|
|
28
|
+
const STOP_TIMEOUT_MS = 10_000;
|
|
29
|
+
|
|
30
|
+
export interface TemporalManagerOptions {
|
|
31
|
+
/** Path to the temporal binary (~/.stigmer/bin/temporal). */
|
|
32
|
+
binPath: string;
|
|
33
|
+
/** Temporal dev-server data directory (~/.stigmer/temporal-data). */
|
|
34
|
+
dataDir: string;
|
|
35
|
+
/** Log file the dev server's output is appended to. */
|
|
36
|
+
logFile: string;
|
|
37
|
+
/** PID file (kept for debugging; the lock is the source of truth). */
|
|
38
|
+
pidFile: string;
|
|
39
|
+
/** Single-instance lock file. */
|
|
40
|
+
lockFile: string;
|
|
41
|
+
version?: string;
|
|
42
|
+
port?: number;
|
|
43
|
+
uiPort?: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export class TemporalManager {
|
|
47
|
+
private readonly binPath: string;
|
|
48
|
+
private readonly dataDir: string;
|
|
49
|
+
private readonly logFile: string;
|
|
50
|
+
private readonly pidFile: string;
|
|
51
|
+
private readonly lockFile: string;
|
|
52
|
+
private readonly version: string;
|
|
53
|
+
private readonly port: number;
|
|
54
|
+
private readonly uiPort: number;
|
|
55
|
+
private lock: FileLock | null = null;
|
|
56
|
+
|
|
57
|
+
constructor(options: TemporalManagerOptions) {
|
|
58
|
+
this.binPath = options.binPath;
|
|
59
|
+
this.dataDir = options.dataDir;
|
|
60
|
+
this.logFile = options.logFile;
|
|
61
|
+
this.pidFile = options.pidFile;
|
|
62
|
+
this.lockFile = options.lockFile;
|
|
63
|
+
this.version = options.version ?? DEFAULT_TEMPORAL_VERSION;
|
|
64
|
+
this.port = options.port ?? TEMPORAL_PORT;
|
|
65
|
+
this.uiPort = options.uiPort ?? TEMPORAL_UI_PORT;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Build a manager from the standard ~/.stigmer layout. */
|
|
69
|
+
static forHome(home: string = homedir()): TemporalManager {
|
|
70
|
+
return new TemporalManager({
|
|
71
|
+
binPath: join(binDir(home), "temporal"),
|
|
72
|
+
dataDir: temporalDataDir(home),
|
|
73
|
+
logFile: join(logDir(home), "temporal.log"),
|
|
74
|
+
pidFile: temporalPidFile(home),
|
|
75
|
+
lockFile: temporalLockFile(home),
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** host:port of the Temporal frontend. */
|
|
80
|
+
get address(): string {
|
|
81
|
+
return `127.0.0.1:${this.port}`;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** PID of the running dev server, or null. */
|
|
85
|
+
getPid(): number | null {
|
|
86
|
+
return readPidFile(this.pidFile);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Install the Temporal binary on demand if it is not already present. */
|
|
90
|
+
async ensureInstalled(): Promise<void> {
|
|
91
|
+
if (isTemporalInstalled(this.binPath)) {
|
|
92
|
+
log.debug("temporal CLI already installed", { path: this.binPath });
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
log.info("downloading Temporal CLI", { version: this.version });
|
|
96
|
+
await downloadTemporalCli({ version: this.version, binPath: this.binPath });
|
|
97
|
+
log.info("Temporal CLI installed", { path: this.binPath });
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Start the dev server. Idempotent: reuses a healthy instance, reclaims a lock
|
|
102
|
+
* left by a dead daemon, and refuses to start only when another live process
|
|
103
|
+
* holds the lock without a responding server.
|
|
104
|
+
*/
|
|
105
|
+
async start(): Promise<void> {
|
|
106
|
+
if (await this.isRunning()) {
|
|
107
|
+
log.info("Temporal already running and healthy — reusing", { address: this.address });
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// A lock we still hold means Temporal died under us; drop it so we can
|
|
112
|
+
// re-acquire cleanly.
|
|
113
|
+
if (this.lock !== null) {
|
|
114
|
+
log.info("releasing stale Temporal lock (server died while we held it)");
|
|
115
|
+
this.lock.release();
|
|
116
|
+
this.lock = null;
|
|
117
|
+
removePidFile(this.pidFile);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
this.cleanupStaleProcesses();
|
|
121
|
+
|
|
122
|
+
const lock = acquireLock(this.lockFile);
|
|
123
|
+
if (lock === null) {
|
|
124
|
+
// Another live process owns the lock. If its server answers, reuse it;
|
|
125
|
+
// otherwise we cannot safely start a competing instance.
|
|
126
|
+
if (await this.isPortInUse()) {
|
|
127
|
+
log.info("Temporal lock held by another process and port is active — reusing");
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
throw new CliExitError("Temporal lock held by another process but the service is not responding", ExitCode.General);
|
|
131
|
+
}
|
|
132
|
+
this.lock = lock;
|
|
133
|
+
|
|
134
|
+
try {
|
|
135
|
+
await this.ensureInstalled();
|
|
136
|
+
mkdirSync(this.dataDir, { recursive: true });
|
|
137
|
+
mkdirSync(dirname(this.logFile), { recursive: true });
|
|
138
|
+
|
|
139
|
+
const pid = this.spawnServer();
|
|
140
|
+
writePidFile(this.pidFile, pid);
|
|
141
|
+
log.info("Temporal dev server started", { pid, port: this.port });
|
|
142
|
+
|
|
143
|
+
await waitForTcp({ port: this.port, timeoutMs: READY_TIMEOUT_MS, label: "temporal dev server" });
|
|
144
|
+
log.info("Temporal is ready", { address: this.address });
|
|
145
|
+
} catch (err) {
|
|
146
|
+
const pid = this.getPid();
|
|
147
|
+
if (pid !== null) killProcessGroup(pid, "SIGKILL");
|
|
148
|
+
removePidFile(this.pidFile);
|
|
149
|
+
this.lock?.release();
|
|
150
|
+
this.lock = null;
|
|
151
|
+
throw err;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** Stop the dev server gracefully (SIGTERM, then SIGKILL), releasing the lock. */
|
|
156
|
+
async stop(): Promise<void> {
|
|
157
|
+
const pid = this.getPid();
|
|
158
|
+
if (pid === null) {
|
|
159
|
+
this.lock?.release();
|
|
160
|
+
this.lock = null;
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
killProcessGroup(pid, "SIGTERM");
|
|
165
|
+
log.info("sent SIGTERM to Temporal process group", { pid });
|
|
166
|
+
|
|
167
|
+
const deadline = Date.now() + STOP_TIMEOUT_MS;
|
|
168
|
+
while (Date.now() < deadline) {
|
|
169
|
+
if (!(await this.isRunning())) {
|
|
170
|
+
this.finishStop();
|
|
171
|
+
log.info("Temporal stopped");
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
await sleep(STOP_POLL_MS);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
log.warn("Temporal did not stop gracefully — force killing process group", { pid });
|
|
178
|
+
killProcessGroup(pid, "SIGKILL");
|
|
179
|
+
this.finishStop();
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** Layered liveness: PID present -> alive -> actually Temporal -> port open. */
|
|
183
|
+
async isRunning(): Promise<boolean> {
|
|
184
|
+
const pid = this.getPid();
|
|
185
|
+
if (pid === null) return false;
|
|
186
|
+
if (!isProcessAlive(pid)) return false;
|
|
187
|
+
if (!isLikelyTemporal(pid, this.binPath)) return false;
|
|
188
|
+
return this.isPortInUse();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
private isPortInUse(): Promise<boolean> {
|
|
192
|
+
return tcpConnects(this.port, "127.0.0.1", 100);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
private finishStop(): void {
|
|
196
|
+
removePidFile(this.pidFile);
|
|
197
|
+
this.lock?.release();
|
|
198
|
+
this.lock = null;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// Start the dev server detached in its own process group so the whole tree can
|
|
202
|
+
// later be signaled, with output appended to the Temporal log file.
|
|
203
|
+
private spawnServer(): number {
|
|
204
|
+
const out = openSync(this.logFile, "a");
|
|
205
|
+
const child = spawn(
|
|
206
|
+
this.binPath,
|
|
207
|
+
[
|
|
208
|
+
"server",
|
|
209
|
+
"start-dev",
|
|
210
|
+
"--port",
|
|
211
|
+
String(this.port),
|
|
212
|
+
"--db-filename",
|
|
213
|
+
join(this.dataDir, "temporal.db"),
|
|
214
|
+
"--ui-port",
|
|
215
|
+
String(this.uiPort),
|
|
216
|
+
"--log-format",
|
|
217
|
+
"json",
|
|
218
|
+
],
|
|
219
|
+
{ detached: true, stdio: ["ignore", out, out] },
|
|
220
|
+
);
|
|
221
|
+
child.unref();
|
|
222
|
+
if (child.pid === undefined) {
|
|
223
|
+
throw new CliExitError("failed to start Temporal process", ExitCode.General);
|
|
224
|
+
}
|
|
225
|
+
return child.pid;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Remove a stale PID file, or kill an orphaned Temporal occupying our port.
|
|
229
|
+
private cleanupStaleProcesses(): void {
|
|
230
|
+
const pid = this.getPid();
|
|
231
|
+
if (pid !== null) {
|
|
232
|
+
if (!isProcessAlive(pid) || !isLikelyTemporal(pid, this.binPath)) {
|
|
233
|
+
removePidFile(this.pidFile);
|
|
234
|
+
}
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
const orphan = findProcessByPort(this.port);
|
|
238
|
+
if (orphan !== null && isLikelyTemporal(orphan, this.binPath)) {
|
|
239
|
+
log.warn("killing orphaned Temporal found via port", { pid: orphan, port: this.port });
|
|
240
|
+
killProcessGroup(orphan, "SIGKILL");
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function sleep(ms: number): Promise<void> {
|
|
246
|
+
return new Promise((r) => setTimeout(r, ms));
|
|
247
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { type Logger } from "../../logger.js";
|
|
3
|
+
import { type SupervisedTarget, TemporalSupervisor } from "./supervisor.js";
|
|
4
|
+
|
|
5
|
+
const silentLog: Logger = { debug: vi.fn(), info: vi.fn(), warn: vi.fn(), error: vi.fn() };
|
|
6
|
+
|
|
7
|
+
function makeTarget(overrides: Partial<SupervisedTarget> = {}): SupervisedTarget & {
|
|
8
|
+
isRunning: ReturnType<typeof vi.fn>;
|
|
9
|
+
start: ReturnType<typeof vi.fn>;
|
|
10
|
+
} {
|
|
11
|
+
return {
|
|
12
|
+
isRunning: vi.fn(async () => true),
|
|
13
|
+
start: vi.fn(async () => {}),
|
|
14
|
+
...overrides,
|
|
15
|
+
} as never;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function makeSupervisor(target: SupervisedTarget) {
|
|
19
|
+
return new TemporalSupervisor(target, { backoffMs: 0, sleep: async () => {}, log: silentLog });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
describe("TemporalSupervisor.checkHealthAndRestart", () => {
|
|
23
|
+
it("does nothing while the target is healthy", async () => {
|
|
24
|
+
const target = makeTarget({ isRunning: vi.fn(async () => true) });
|
|
25
|
+
await makeSupervisor(target).checkHealthAndRestart();
|
|
26
|
+
expect(target.start).not.toHaveBeenCalled();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("restarts when the target is unhealthy", async () => {
|
|
30
|
+
const target = makeTarget({ isRunning: vi.fn(async () => false) });
|
|
31
|
+
await makeSupervisor(target).checkHealthAndRestart();
|
|
32
|
+
expect(target.start).toHaveBeenCalledTimes(1);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("swallows a restart failure (retried on the next tick)", async () => {
|
|
36
|
+
const target = makeTarget({
|
|
37
|
+
isRunning: vi.fn(async () => false),
|
|
38
|
+
start: vi.fn(async () => {
|
|
39
|
+
throw new Error("boom");
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
42
|
+
await expect(makeSupervisor(target).checkHealthAndRestart()).resolves.toBeUndefined();
|
|
43
|
+
expect(target.start).toHaveBeenCalledTimes(1);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("does not restart if stopped during the backoff", async () => {
|
|
47
|
+
const target = makeTarget({ isRunning: vi.fn(async () => false) });
|
|
48
|
+
const supervisor = new TemporalSupervisor(target, {
|
|
49
|
+
backoffMs: 0,
|
|
50
|
+
// Stop the supervisor while it is "sleeping" through the backoff.
|
|
51
|
+
sleep: async () => {
|
|
52
|
+
supervisor.stop();
|
|
53
|
+
},
|
|
54
|
+
log: silentLog,
|
|
55
|
+
});
|
|
56
|
+
await supervisor.checkHealthAndRestart();
|
|
57
|
+
expect(target.start).not.toHaveBeenCalled();
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
describe("TemporalSupervisor start/stop", () => {
|
|
62
|
+
it("schedules ticks and stops cleanly", async () => {
|
|
63
|
+
vi.useFakeTimers();
|
|
64
|
+
try {
|
|
65
|
+
const target = makeTarget({ isRunning: vi.fn(async () => true) });
|
|
66
|
+
const supervisor = new TemporalSupervisor(target, { intervalMs: 1000, log: silentLog });
|
|
67
|
+
supervisor.start();
|
|
68
|
+
await vi.advanceTimersByTimeAsync(1000);
|
|
69
|
+
expect(target.isRunning).toHaveBeenCalledTimes(1);
|
|
70
|
+
supervisor.stop();
|
|
71
|
+
await vi.advanceTimersByTimeAsync(5000);
|
|
72
|
+
expect(target.isRunning).toHaveBeenCalledTimes(1); // no further ticks after stop
|
|
73
|
+
} finally {
|
|
74
|
+
vi.useRealTimers();
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
});
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// Self-healing supervisor for the Temporal dev server.
|
|
2
|
+
//
|
|
3
|
+
// On a fixed interval it asks "is Temporal healthy?" and, if not, restarts it
|
|
4
|
+
// via the idempotent start path (which reuses healthy instances and cleans up
|
|
5
|
+
// stale ones). This is intentionally separate from the daemon's child
|
|
6
|
+
// supervisor: Temporal owns its own lifecycle and lock, so it carries its own
|
|
7
|
+
// watchdog — exactly the split the Go CLI uses.
|
|
8
|
+
//
|
|
9
|
+
// The check and backoff are dependency-injected (clock) so the policy is unit-
|
|
10
|
+
// testable without real time, and the loop never overlaps with itself.
|
|
11
|
+
|
|
12
|
+
import { type Logger, log as defaultLog } from "../../logger.js";
|
|
13
|
+
|
|
14
|
+
const DEFAULT_INTERVAL_MS = 5_000;
|
|
15
|
+
const DEFAULT_BACKOFF_MS = 1_000;
|
|
16
|
+
|
|
17
|
+
/** The minimal surface the supervisor drives. TemporalManager satisfies it. */
|
|
18
|
+
export interface SupervisedTarget {
|
|
19
|
+
isRunning(): Promise<boolean>;
|
|
20
|
+
start(): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface SupervisorOptions {
|
|
24
|
+
intervalMs?: number;
|
|
25
|
+
backoffMs?: number;
|
|
26
|
+
/** Injectable sleep, for deterministic tests. */
|
|
27
|
+
sleep?: (ms: number) => Promise<void>;
|
|
28
|
+
log?: Logger;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class TemporalSupervisor {
|
|
32
|
+
private readonly target: SupervisedTarget;
|
|
33
|
+
private readonly intervalMs: number;
|
|
34
|
+
private readonly backoffMs: number;
|
|
35
|
+
private readonly sleep: (ms: number) => Promise<void>;
|
|
36
|
+
private readonly log: Logger;
|
|
37
|
+
private timer: NodeJS.Timeout | null = null;
|
|
38
|
+
private stopped = false;
|
|
39
|
+
private ticking = false;
|
|
40
|
+
|
|
41
|
+
constructor(target: SupervisedTarget, options: SupervisorOptions = {}) {
|
|
42
|
+
this.target = target;
|
|
43
|
+
this.intervalMs = options.intervalMs ?? DEFAULT_INTERVAL_MS;
|
|
44
|
+
this.backoffMs = options.backoffMs ?? DEFAULT_BACKOFF_MS;
|
|
45
|
+
this.sleep = options.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
46
|
+
this.log = options.log ?? defaultLog;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Begin monitoring. Returns immediately; the loop runs on a timer. */
|
|
50
|
+
start(): void {
|
|
51
|
+
if (this.timer !== null) return;
|
|
52
|
+
this.stopped = false;
|
|
53
|
+
this.log.info("starting Temporal supervisor", { interval_ms: this.intervalMs });
|
|
54
|
+
const tick = (): void => {
|
|
55
|
+
void this.checkHealthAndRestart().finally(() => {
|
|
56
|
+
if (!this.stopped) this.timer = setTimeout(tick, this.intervalMs);
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
this.timer = setTimeout(tick, this.intervalMs);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Stop monitoring. Safe to call multiple times. */
|
|
63
|
+
stop(): void {
|
|
64
|
+
this.stopped = true;
|
|
65
|
+
if (this.timer !== null) {
|
|
66
|
+
clearTimeout(this.timer);
|
|
67
|
+
this.timer = null;
|
|
68
|
+
}
|
|
69
|
+
this.log.info("stopping Temporal supervisor");
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* One health check + conditional restart. Public for unit testing: it is the
|
|
74
|
+
* whole supervision policy, exercised without real timers.
|
|
75
|
+
*/
|
|
76
|
+
async checkHealthAndRestart(): Promise<void> {
|
|
77
|
+
if (this.ticking) return; // never overlap a previous tick
|
|
78
|
+
this.ticking = true;
|
|
79
|
+
try {
|
|
80
|
+
if (await this.target.isRunning()) {
|
|
81
|
+
this.log.debug("Temporal health check passed");
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
this.log.warn("Temporal health check failed — attempting restart");
|
|
85
|
+
await this.sleep(this.backoffMs);
|
|
86
|
+
if (this.stopped) return; // bailed out during backoff
|
|
87
|
+
try {
|
|
88
|
+
await this.target.start();
|
|
89
|
+
this.log.info("Temporal restarted");
|
|
90
|
+
} catch (err) {
|
|
91
|
+
this.log.error("failed to restart Temporal — will retry next check", { error: String(err) });
|
|
92
|
+
}
|
|
93
|
+
} finally {
|
|
94
|
+
this.ticking = false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Embedded web-console availability.
|
|
2
|
+
//
|
|
3
|
+
// The Go CLI embeds the console's static assets via go:embed and serves them on
|
|
4
|
+
// :8234. There is no TS equivalent bundled in T05, so the daemon detects the
|
|
5
|
+
// console as unavailable and skips it cleanly (recording a "stopped" state),
|
|
6
|
+
// exactly as the Go daemon does when built without assets. Real serving — and
|
|
7
|
+
// the asset-bundling decision behind it — is deferred to T06.
|
|
8
|
+
|
|
9
|
+
/** Whether an embedded web console is available to serve. Always false until
|
|
10
|
+
* T06 wires asset bundling + an HTTP handler. */
|
|
11
|
+
export function isWebConsoleAvailable(): boolean {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
package/src/logger.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Diagnostic logger for the CLI. Writes only to stderr so structured command
|
|
2
|
+
// output on stdout stays clean for piping. `debug` is silent unless `--debug`
|
|
3
|
+
// is set, so scripts never see diagnostics on the happy path; `info`/`warn`/
|
|
4
|
+
// `error` always emit, which is what the supervised daemon relies on to record
|
|
5
|
+
// its lifecycle into daemon.log (its stderr is redirected there).
|
|
6
|
+
|
|
7
|
+
import { isDebug } from "./runtime.js";
|
|
8
|
+
|
|
9
|
+
function emit(level: string, msg: string, fields?: Record<string, unknown>): void {
|
|
10
|
+
const suffix = fields
|
|
11
|
+
? " " +
|
|
12
|
+
Object.entries(fields)
|
|
13
|
+
.map(([k, v]) => `${k}=${typeof v === "string" ? v : JSON.stringify(v)}`)
|
|
14
|
+
.join(" ")
|
|
15
|
+
: "";
|
|
16
|
+
process.stderr.write(`${level} ${msg}${suffix}\n`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const log = {
|
|
20
|
+
/** Emit a diagnostic line; a no-op unless `--debug` is active. */
|
|
21
|
+
debug(msg: string, fields?: Record<string, unknown>): void {
|
|
22
|
+
if (isDebug()) emit("debug", msg, fields);
|
|
23
|
+
},
|
|
24
|
+
/** Emit an informational line (always). */
|
|
25
|
+
info(msg: string, fields?: Record<string, unknown>): void {
|
|
26
|
+
emit("info", msg, fields);
|
|
27
|
+
},
|
|
28
|
+
/** Emit a warning line (always). */
|
|
29
|
+
warn(msg: string, fields?: Record<string, unknown>): void {
|
|
30
|
+
emit("warn", msg, fields);
|
|
31
|
+
},
|
|
32
|
+
/** Emit an error line (always). */
|
|
33
|
+
error(msg: string, fields?: Record<string, unknown>): void {
|
|
34
|
+
emit("error", msg, fields);
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** The logger interface, for dependency injection in tests. */
|
|
39
|
+
export type Logger = typeof log;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { CommandResult, resultToHuman, resultToJson, resultToQuiet } from "./command-result.js";
|
|
3
|
+
|
|
4
|
+
describe("resultToJson", () => {
|
|
5
|
+
it("emits status as a lowercase string", () => {
|
|
6
|
+
expect(JSON.parse(resultToJson(CommandResult.success("ok"))).status).toBe("success");
|
|
7
|
+
expect(JSON.parse(resultToJson(CommandResult.warning("w"))).status).toBe("warning");
|
|
8
|
+
expect(JSON.parse(resultToJson(CommandResult.error("e"))).status).toBe("error");
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it("omits empty sections and hints", () => {
|
|
12
|
+
const parsed = JSON.parse(resultToJson(CommandResult.success("done")));
|
|
13
|
+
expect(parsed).not.toHaveProperty("sections");
|
|
14
|
+
expect(parsed).not.toHaveProperty("hints");
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("serializes sections (fields + items) and hints", () => {
|
|
18
|
+
const result = CommandResult.success("Created");
|
|
19
|
+
result.addSection("Details").field("ID", "abc").field("Name", "agent");
|
|
20
|
+
result.addSection("Items").item("first").item("second");
|
|
21
|
+
result.hint("try this").hint("and that");
|
|
22
|
+
|
|
23
|
+
const parsed = JSON.parse(resultToJson(result));
|
|
24
|
+
expect(parsed.sections).toHaveLength(2);
|
|
25
|
+
expect(parsed.sections[0]).toEqual({
|
|
26
|
+
title: "Details",
|
|
27
|
+
fields: [
|
|
28
|
+
{ key: "ID", value: "abc" },
|
|
29
|
+
{ key: "Name", value: "agent" },
|
|
30
|
+
],
|
|
31
|
+
});
|
|
32
|
+
expect(parsed.sections[1]).toEqual({ title: "Items", items: ["first", "second"] });
|
|
33
|
+
expect(parsed.hints).toEqual(["try this", "and that"]);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe("resultToHuman (plain, no color)", () => {
|
|
38
|
+
it("renders the status icon, message, fields, and hints", () => {
|
|
39
|
+
const result = CommandResult.success("Created agent");
|
|
40
|
+
result.addSection("Details").field("ID", "agt-123");
|
|
41
|
+
result.hint("Run: stigmer get agent agt-123");
|
|
42
|
+
|
|
43
|
+
const out = resultToHuman(result, false);
|
|
44
|
+
expect(out).toContain("✓ Created agent");
|
|
45
|
+
expect(out).toContain("Details:");
|
|
46
|
+
expect(out).toContain("ID");
|
|
47
|
+
expect(out).toContain("agt-123");
|
|
48
|
+
expect(out).toContain("Run: stigmer get agent agt-123");
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("uses an error icon for error results", () => {
|
|
52
|
+
expect(resultToHuman(CommandResult.error("boom"), false)).toContain("✗ boom");
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
describe("resultToQuiet (plain, no color)", () => {
|
|
57
|
+
it("renders only the status line", () => {
|
|
58
|
+
const result = CommandResult.success("Done");
|
|
59
|
+
result.addSection("Details").field("ID", "abc");
|
|
60
|
+
const out = resultToQuiet(result, false);
|
|
61
|
+
expect(out).toBe("✓ Done\n");
|
|
62
|
+
expect(out).not.toContain("Details");
|
|
63
|
+
});
|
|
64
|
+
});
|