@stigmer/cli 0.1.0-dev.20261017064309.g94d062a29f89 → 0.1.0
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/README.md +5 -4
- package/auth/auth0.js +1 -1
- package/auth/auth0.js.map +1 -1
- package/auth/token.d.ts +26 -4
- package/auth/token.d.ts.map +1 -1
- package/auth/token.js +120 -24
- package/auth/token.js.map +1 -1
- package/client/client.d.ts.map +1 -1
- package/client/client.js +21 -8
- package/client/client.js.map +1 -1
- package/command-tree.d.ts +63 -0
- package/command-tree.d.ts.map +1 -0
- package/command-tree.js +128 -0
- package/command-tree.js.map +1 -0
- package/commands/access-history/index.d.ts.map +1 -1
- package/commands/access-history/index.js +13 -1
- package/commands/access-history/index.js.map +1 -1
- package/commands/agent-exec-flags.d.ts +2 -0
- package/commands/agent-exec-flags.d.ts.map +1 -1
- package/commands/agent-exec-flags.js +9 -5
- package/commands/agent-exec-flags.js.map +1 -1
- package/commands/apikey/duration.d.ts.map +1 -1
- package/commands/apikey/duration.js +1 -2
- package/commands/apikey/duration.js.map +1 -1
- package/commands/apikey/index.d.ts.map +1 -1
- package/commands/apikey/index.js +3 -4
- package/commands/apikey/index.js.map +1 -1
- package/commands/apply.d.ts.map +1 -1
- package/commands/apply.js +2 -32
- package/commands/apply.js.map +1 -1
- package/commands/auth/index.d.ts.map +1 -1
- package/commands/auth/index.js +7 -5
- package/commands/auth/index.js.map +1 -1
- package/commands/auth/whoami.js +1 -1
- package/commands/config/index.js +3 -3
- package/commands/config/kv.d.ts.map +1 -1
- package/commands/config/kv.js +18 -14
- package/commands/config/kv.js.map +1 -1
- package/commands/connect.d.ts.map +1 -1
- package/commands/connect.js +18 -2
- package/commands/connect.js.map +1 -1
- package/commands/download.d.ts.map +1 -1
- package/commands/download.js +81 -54
- package/commands/download.js.map +1 -1
- package/commands/eval.d.ts.map +1 -1
- package/commands/eval.js +17 -19
- package/commands/eval.js.map +1 -1
- package/commands/file.d.ts +3 -0
- package/commands/file.d.ts.map +1 -0
- package/commands/file.js +64 -0
- package/commands/file.js.map +1 -0
- package/commands/get.d.ts.map +1 -1
- package/commands/get.js +20 -13
- package/commands/get.js.map +1 -1
- package/commands/help.d.ts +15 -0
- package/commands/help.d.ts.map +1 -0
- package/commands/help.js +175 -0
- package/commands/help.js.map +1 -0
- package/commands/internal-daemon.d.ts.map +1 -1
- package/commands/internal-daemon.js +9 -2
- package/commands/internal-daemon.js.map +1 -1
- package/commands/list.d.ts.map +1 -1
- package/commands/list.js +22 -1
- package/commands/list.js.map +1 -1
- package/commands/logs.js +1 -1
- package/commands/logs.js.map +1 -1
- package/commands/mcp-server.d.ts +16 -6
- package/commands/mcp-server.d.ts.map +1 -1
- package/commands/mcp-server.js +51 -26
- package/commands/mcp-server.js.map +1 -1
- package/commands/provider-key/index.d.ts +3 -0
- package/commands/provider-key/index.d.ts.map +1 -0
- package/commands/provider-key/index.js +156 -0
- package/commands/provider-key/index.js.map +1 -0
- package/commands/push.js +8 -8
- package/commands/push.js.map +1 -1
- package/commands/resume.d.ts.map +1 -1
- package/commands/resume.js +17 -11
- package/commands/resume.js.map +1 -1
- package/commands/routine.d.ts.map +1 -1
- package/commands/routine.js +42 -3
- package/commands/routine.js.map +1 -1
- package/commands/run.d.ts.map +1 -1
- package/commands/run.js +34 -15
- package/commands/run.js.map +1 -1
- package/commands/runs/approve.d.ts.map +1 -1
- package/commands/runs/approve.js +10 -2
- package/commands/runs/approve.js.map +1 -1
- package/commands/runs/control.d.ts.map +1 -1
- package/commands/runs/control.js +24 -16
- package/commands/runs/control.js.map +1 -1
- package/commands/runs/index.d.ts.map +1 -1
- package/commands/runs/index.js +1 -2
- package/commands/runs/index.js.map +1 -1
- package/commands/runs/logs.d.ts.map +1 -1
- package/commands/runs/logs.js +7 -4
- package/commands/runs/logs.js.map +1 -1
- package/commands/runs/to-eval-case.d.ts.map +1 -1
- package/commands/runs/to-eval-case.js +13 -4
- package/commands/runs/to-eval-case.js.map +1 -1
- package/commands/runs/trace.js +1 -1
- package/commands/runs/trace.js.map +1 -1
- package/commands/search.js +2 -3
- package/commands/search.js.map +1 -1
- package/commands/service-account/index.d.ts.map +1 -1
- package/commands/service-account/index.js +4 -2
- package/commands/service-account/index.js.map +1 -1
- package/commands/session-help.d.ts +5 -0
- package/commands/session-help.d.ts.map +1 -0
- package/commands/session-help.js +38 -0
- package/commands/session-help.js.map +1 -0
- package/commands/setup.js +5 -5
- package/commands/setup.js.map +1 -1
- package/commands/shared.d.ts +10 -2
- package/commands/shared.d.ts.map +1 -1
- package/commands/shared.js +30 -3
- package/commands/shared.js.map +1 -1
- package/commands/tag.d.ts.map +1 -1
- package/commands/tag.js +11 -6
- package/commands/tag.js.map +1 -1
- package/commands/up.d.ts.map +1 -1
- package/commands/up.js +51 -21
- package/commands/up.js.map +1 -1
- package/commands/validate.js +2 -2
- package/commands/validate.js.map +1 -1
- package/commands/version.d.ts.map +1 -1
- package/commands/version.js +8 -4
- package/commands/version.js.map +1 -1
- package/config/config.d.ts +5 -22
- package/config/config.d.ts.map +1 -1
- package/config/config.js +56 -47
- package/config/config.js.map +1 -1
- package/config/index.d.ts +2 -2
- package/config/index.d.ts.map +1 -1
- package/config/index.js +1 -1
- package/config/index.js.map +1 -1
- package/config/keys.js +4 -4
- package/config/keys.js.map +1 -1
- package/config/paths.js +2 -2
- package/config/paths.js.map +1 -1
- package/config/resolve.d.ts +12 -2
- package/config/resolve.d.ts.map +1 -1
- package/config/resolve.js +18 -8
- package/config/resolve.js.map +1 -1
- package/errors/classify.d.ts +20 -0
- package/errors/classify.d.ts.map +1 -1
- package/errors/classify.js +97 -21
- package/errors/classify.js.map +1 -1
- package/errors/command-line.d.ts +14 -0
- package/errors/command-line.d.ts.map +1 -0
- package/errors/command-line.js +90 -0
- package/errors/command-line.js.map +1 -0
- package/errors/handle.js +2 -2
- package/errors/handle.js.map +1 -1
- package/errors/index.d.ts +2 -2
- package/errors/index.d.ts.map +1 -1
- package/errors/index.js +12 -2
- package/errors/index.js.map +1 -1
- package/errors/usage-error.js +1 -1
- package/errors/usage-error.js.map +1 -1
- package/global-options.d.ts +35 -0
- package/global-options.d.ts.map +1 -0
- package/global-options.js +81 -0
- package/global-options.js.map +1 -0
- package/local/artifact.d.ts +1 -20
- package/local/artifact.d.ts.map +1 -1
- package/local/artifact.js +35 -117
- package/local/artifact.js.map +1 -1
- package/local/constants.d.ts +3 -9
- package/local/constants.d.ts.map +1 -1
- package/local/constants.js +3 -9
- package/local/constants.js.map +1 -1
- package/local/daemon/components.d.ts +18 -5
- package/local/daemon/components.d.ts.map +1 -1
- package/local/daemon/components.js +61 -23
- package/local/daemon/components.js.map +1 -1
- package/local/daemon/env.d.ts +1 -5
- package/local/daemon/env.d.ts.map +1 -1
- package/local/daemon/env.js +0 -2
- package/local/daemon/env.js.map +1 -1
- package/local/daemon/host.d.ts +5 -0
- package/local/daemon/host.d.ts.map +1 -1
- package/local/daemon/host.js +68 -21
- package/local/daemon/host.js.map +1 -1
- package/local/daemon/index.d.ts +2 -1
- package/local/daemon/index.d.ts.map +1 -1
- package/local/daemon/index.js +2 -1
- package/local/daemon/index.js.map +1 -1
- package/local/daemon/launch.d.ts +58 -9
- package/local/daemon/launch.d.ts.map +1 -1
- package/local/daemon/launch.js +210 -64
- package/local/daemon/launch.js.map +1 -1
- package/local/daemon/process.d.ts +11 -7
- package/local/daemon/process.d.ts.map +1 -1
- package/local/daemon/process.js +74 -38
- package/local/daemon/process.js.map +1 -1
- package/local/daemon/signals.d.ts +3 -0
- package/local/daemon/signals.d.ts.map +1 -0
- package/local/daemon/signals.js +19 -0
- package/local/daemon/signals.js.map +1 -0
- package/local/daemon/supervisor.d.ts +9 -2
- package/local/daemon/supervisor.d.ts.map +1 -1
- package/local/daemon/supervisor.js +81 -22
- package/local/daemon/supervisor.js.map +1 -1
- package/local/daemon/types.d.ts +6 -1
- package/local/daemon/types.d.ts.map +1 -1
- package/local/daemon/types.js +2 -3
- package/local/daemon/types.js.map +1 -1
- package/local/llm-config.d.ts +4 -2
- package/local/llm-config.d.ts.map +1 -1
- package/local/llm-config.js +15 -9
- package/local/llm-config.js.map +1 -1
- package/local/logs/view.d.ts.map +1 -1
- package/local/logs/view.js +5 -6
- package/local/logs/view.js.map +1 -1
- package/local/net/tcp.d.ts +8 -6
- package/local/net/tcp.d.ts.map +1 -1
- package/local/net/tcp.js +13 -8
- package/local/net/tcp.js.map +1 -1
- package/local/paths.d.ts +1 -1
- package/local/paths.d.ts.map +1 -1
- package/local/paths.js +2 -3
- package/local/paths.js.map +1 -1
- package/local/provider-reach.d.ts +18 -0
- package/local/provider-reach.d.ts.map +1 -0
- package/local/provider-reach.js +109 -0
- package/local/provider-reach.js.map +1 -0
- package/local/reset.d.ts.map +1 -1
- package/local/reset.js +1 -2
- package/local/reset.js.map +1 -1
- package/local/runtime/index.d.ts.map +1 -1
- package/local/runtime/index.js +1 -2
- package/local/runtime/index.js.map +1 -1
- package/local/runtime/node.js +1 -1
- package/local/runtime/runner.js +2 -2
- package/local/runtime/runner.js.map +1 -1
- package/local/runtime/runtimes-install.js +1 -1
- package/local/runtime/server.d.ts.map +1 -1
- package/local/runtime/server.js +2 -4
- package/local/runtime/server.js.map +1 -1
- package/local/runtime/which.js +1 -1
- package/local/runtime/which.js.map +1 -1
- package/local/setup/wizard.d.ts +1 -1
- package/local/setup/wizard.d.ts.map +1 -1
- package/local/setup/wizard.js +7 -5
- package/local/setup/wizard.js.map +1 -1
- package/local/state/health-state.d.ts +6 -0
- package/local/state/health-state.d.ts.map +1 -1
- package/local/state/health-state.js +6 -2
- package/local/state/health-state.js.map +1 -1
- package/local/state/lock.d.ts +3 -2
- package/local/state/lock.d.ts.map +1 -1
- package/local/state/lock.js +26 -28
- package/local/state/lock.js.map +1 -1
- package/local/state/log-rotation.d.ts.map +1 -1
- package/local/state/log-rotation.js +2 -3
- package/local/state/log-rotation.js.map +1 -1
- package/local/state/pidfile.d.ts +24 -1
- package/local/state/pidfile.d.ts.map +1 -1
- package/local/state/pidfile.js +54 -6
- package/local/state/pidfile.js.map +1 -1
- package/local/state/proc.d.ts +31 -0
- package/local/state/proc.d.ts.map +1 -1
- package/local/state/proc.js +98 -1
- package/local/state/proc.js.map +1 -1
- package/local/state/startup-config.d.ts +2 -2
- package/local/status.d.ts +2 -4
- package/local/status.d.ts.map +1 -1
- package/local/status.js +26 -41
- package/local/status.js.map +1 -1
- package/local/temporal/download.d.ts +9 -5
- package/local/temporal/download.d.ts.map +1 -1
- package/local/temporal/download.js +29 -8
- package/local/temporal/download.js.map +1 -1
- package/local/temporal/index.d.ts +1 -1
- package/local/temporal/index.d.ts.map +1 -1
- package/local/temporal/index.js +1 -1
- package/local/temporal/index.js.map +1 -1
- package/local/temporal/manager.d.ts +31 -5
- package/local/temporal/manager.d.ts.map +1 -1
- package/local/temporal/manager.js +74 -35
- package/local/temporal/manager.js.map +1 -1
- package/local/temporal/supervisor.js +1 -1
- package/local/temporal/supervisor.js.map +1 -1
- package/local/webconsole/index.d.ts +5 -2
- package/local/webconsole/index.d.ts.map +1 -1
- package/local/webconsole/index.js +8 -6
- package/local/webconsole/index.js.map +1 -1
- package/marketplace/github.js +1 -1
- package/marketplace/github.js.map +1 -1
- package/marketplace/official.js +1 -1
- package/marketplace/official.js.map +1 -1
- package/output/command-result.d.ts +6 -0
- package/output/command-result.d.ts.map +1 -1
- package/output/command-result.js +13 -2
- package/output/command-result.js.map +1 -1
- package/output/confirm.d.ts.map +1 -1
- package/output/confirm.js +2 -3
- package/output/confirm.js.map +1 -1
- package/output/format.d.ts.map +1 -1
- package/output/format.js +5 -6
- package/output/format.js.map +1 -1
- package/output/index.d.ts +2 -2
- package/output/index.d.ts.map +1 -1
- package/output/index.js +2 -2
- package/output/index.js.map +1 -1
- package/output/printable.d.ts +8 -0
- package/output/printable.d.ts.map +1 -0
- package/output/printable.js +24 -0
- package/output/printable.js.map +1 -0
- package/output/proto.d.ts.map +1 -1
- package/output/proto.js +3 -4
- package/output/proto.js.map +1 -1
- package/output/style.js +2 -2
- package/output/style.js.map +1 -1
- package/output/table.d.ts +20 -1
- package/output/table.d.ts.map +1 -1
- package/output/table.js +75 -17
- package/output/table.js.map +1 -1
- package/package.json +13 -10
- package/program.d.ts +0 -14
- package/program.d.ts.map +1 -1
- package/program.js +57 -119
- package/program.js.map +1 -1
- package/registry/aliases.d.ts.map +1 -1
- package/registry/aliases.js +0 -3
- package/registry/aliases.js.map +1 -1
- package/registry/index.d.ts +1 -1
- package/registry/index.d.ts.map +1 -1
- package/registry/index.js +1 -1
- package/registry/index.js.map +1 -1
- package/registry/metadata.d.ts +0 -15
- package/registry/metadata.d.ts.map +1 -1
- package/registry/metadata.js +16 -57
- package/registry/metadata.js.map +1 -1
- package/registry/registry.d.ts +1 -5
- package/registry/registry.d.ts.map +1 -1
- package/registry/registry.js +3 -11
- package/registry/registry.js.map +1 -1
- package/registry/verb-support.d.ts.map +1 -1
- package/registry/verb-support.js +28 -5
- package/registry/verb-support.js.map +1 -1
- package/resources/agent/quality.d.ts +10 -5
- package/resources/agent/quality.d.ts.map +1 -1
- package/resources/agent/quality.js +19 -9
- package/resources/agent/quality.js.map +1 -1
- package/resources/agent/resolve.js +3 -3
- package/resources/agent/resolve.js.map +1 -1
- package/resources/apply/apply.d.ts +4 -3
- package/resources/apply/apply.d.ts.map +1 -1
- package/resources/apply/apply.js +54 -41
- package/resources/apply/apply.js.map +1 -1
- package/resources/apply/handlers.d.ts.map +1 -1
- package/resources/apply/handlers.js +3 -4
- package/resources/apply/handlers.js.map +1 -1
- package/resources/channel.d.ts.map +1 -1
- package/resources/channel.js +3 -4
- package/resources/channel.js.map +1 -1
- package/resources/connect/connect.js +2 -2
- package/resources/connect/connect.js.map +1 -1
- package/resources/delete.d.ts.map +1 -1
- package/resources/delete.js +38 -4
- package/resources/delete.js.map +1 -1
- package/resources/documents.js +1 -1
- package/resources/documents.js.map +1 -1
- package/resources/download.d.ts +43 -3
- package/resources/download.d.ts.map +1 -1
- package/resources/download.js +169 -34
- package/resources/download.js.map +1 -1
- package/resources/eval-run/options.d.ts +3 -1
- package/resources/eval-run/options.d.ts.map +1 -1
- package/resources/eval-run/options.js +36 -18
- package/resources/eval-run/options.js.map +1 -1
- package/resources/eval-run/report.d.ts +4 -2
- package/resources/eval-run/report.d.ts.map +1 -1
- package/resources/eval-run/report.js +9 -7
- package/resources/eval-run/report.js.map +1 -1
- package/resources/eval-run/run.d.ts +2 -1
- package/resources/eval-run/run.d.ts.map +1 -1
- package/resources/eval-run/run.js +13 -7
- package/resources/eval-run/run.js.map +1 -1
- package/resources/file.d.ts +27 -0
- package/resources/file.d.ts.map +1 -0
- package/resources/file.js +82 -0
- package/resources/file.js.map +1 -0
- package/resources/get-bindings.d.ts.map +1 -1
- package/resources/get-bindings.js +18 -0
- package/resources/get-bindings.js.map +1 -1
- package/resources/git.d.ts +1 -1
- package/resources/git.js +1 -1
- package/resources/list.d.ts +21 -2
- package/resources/list.d.ts.map +1 -1
- package/resources/list.js +148 -31
- package/resources/list.js.map +1 -1
- package/resources/plugin.d.ts.map +1 -1
- package/resources/plugin.js +4 -0
- package/resources/plugin.js.map +1 -1
- package/resources/provider-key.d.ts +81 -0
- package/resources/provider-key.d.ts.map +1 -0
- package/resources/provider-key.js +261 -0
- package/resources/provider-key.js.map +1 -0
- package/resources/reference.d.ts +15 -21
- package/resources/reference.d.ts.map +1 -1
- package/resources/reference.js +42 -88
- package/resources/reference.js.map +1 -1
- package/resources/render.d.ts +31 -7
- package/resources/render.d.ts.map +1 -1
- package/resources/render.js +66 -38
- package/resources/render.js.map +1 -1
- package/resources/routine.d.ts +21 -5
- package/resources/routine.d.ts.map +1 -1
- package/resources/routine.js +104 -15
- package/resources/routine.js.map +1 -1
- package/resources/run/agent-exec.d.ts +12 -2
- package/resources/run/agent-exec.d.ts.map +1 -1
- package/resources/run/agent-exec.js +85 -38
- package/resources/run/agent-exec.js.map +1 -1
- package/resources/run/create.d.ts +16 -12
- package/resources/run/create.d.ts.map +1 -1
- package/resources/run/create.js +14 -15
- package/resources/run/create.js.map +1 -1
- package/resources/run/engines.d.ts +32 -0
- package/resources/run/engines.d.ts.map +1 -0
- package/resources/run/engines.js +39 -0
- package/resources/run/engines.js.map +1 -0
- package/resources/run/environment.d.ts +11 -0
- package/resources/run/environment.d.ts.map +1 -0
- package/resources/run/environment.js +30 -0
- package/resources/run/environment.js.map +1 -0
- package/resources/run/epilogue.d.ts +1 -1
- package/resources/run/epilogue.d.ts.map +1 -1
- package/resources/run/epilogue.js +18 -19
- package/resources/run/epilogue.js.map +1 -1
- package/resources/run/files.d.ts +104 -0
- package/resources/run/files.d.ts.map +1 -0
- package/resources/run/files.js +316 -0
- package/resources/run/files.js.map +1 -0
- package/resources/run/header.d.ts +11 -9
- package/resources/run/header.d.ts.map +1 -1
- package/resources/run/header.js +14 -14
- package/resources/run/header.js.map +1 -1
- package/resources/run/prepare.d.ts +31 -25
- package/resources/run/prepare.d.ts.map +1 -1
- package/resources/run/prepare.js +42 -51
- package/resources/run/prepare.js.map +1 -1
- package/resources/run/references.d.ts.map +1 -1
- package/resources/run/references.js +6 -5
- package/resources/run/references.js.map +1 -1
- package/resources/run/resolve.js +1 -1
- package/resources/run/resolve.js.map +1 -1
- package/resources/run/resume.d.ts +3 -1
- package/resources/run/resume.d.ts.map +1 -1
- package/resources/run/resume.js +25 -10
- package/resources/run/resume.js.map +1 -1
- package/resources/run/stream.d.ts +34 -2
- package/resources/run/stream.d.ts.map +1 -1
- package/resources/run/stream.js +92 -8
- package/resources/run/stream.js.map +1 -1
- package/resources/run/workspace.d.ts +9 -12
- package/resources/run/workspace.d.ts.map +1 -1
- package/resources/run/workspace.js +29 -36
- package/resources/run/workspace.js.map +1 -1
- package/resources/run-approve.d.ts.map +1 -1
- package/resources/run-approve.js +2 -11
- package/resources/run-approve.js.map +1 -1
- package/resources/run-control.d.ts +3 -3
- package/resources/run-control.d.ts.map +1 -1
- package/resources/run-control.js +4 -5
- package/resources/run-control.js.map +1 -1
- package/resources/run-format.d.ts +2 -2
- package/resources/run-format.d.ts.map +1 -1
- package/resources/run-format.js +3 -4
- package/resources/run-format.js.map +1 -1
- package/resources/run-logs.d.ts +2 -0
- package/resources/run-logs.d.ts.map +1 -1
- package/resources/run-logs.js +16 -6
- package/resources/run-logs.js.map +1 -1
- package/resources/run-scores.d.ts +6 -2
- package/resources/run-scores.d.ts.map +1 -1
- package/resources/run-scores.js +7 -4
- package/resources/run-scores.js.map +1 -1
- package/resources/run-to-eval-case.js +2 -2
- package/resources/run-to-eval-case.js.map +1 -1
- package/resources/runs.d.ts +3 -3
- package/resources/runs.d.ts.map +1 -1
- package/resources/runs.js +5 -5
- package/resources/runs.js.map +1 -1
- package/resources/search.d.ts.map +1 -1
- package/resources/search.js +1 -2
- package/resources/search.js.map +1 -1
- package/resources/service-account.d.ts +2 -0
- package/resources/service-account.d.ts.map +1 -1
- package/resources/service-account.js +3 -1
- package/resources/service-account.js.map +1 -1
- package/resources/session.d.ts +4 -3
- package/resources/session.d.ts.map +1 -1
- package/resources/session.js +10 -7
- package/resources/session.js.map +1 -1
- package/resources/skill.d.ts +1 -1
- package/resources/skill.d.ts.map +1 -1
- package/resources/skill.js +7 -8
- package/resources/skill.js.map +1 -1
- package/resources/stream/answer.d.ts +1 -2
- package/resources/stream/answer.d.ts.map +1 -1
- package/resources/stream/answer.js +3 -16
- package/resources/stream/answer.js.map +1 -1
- package/resources/stream/composer.d.ts +16 -0
- package/resources/stream/composer.d.ts.map +1 -0
- package/resources/stream/composer.js +171 -0
- package/resources/stream/composer.js.map +1 -0
- package/resources/stream/ink.d.ts +20 -4
- package/resources/stream/ink.d.ts.map +1 -1
- package/resources/stream/ink.js +34 -3
- package/resources/stream/ink.js.map +1 -1
- package/resources/stream/render-plaintext.d.ts +1 -0
- package/resources/stream/render-plaintext.d.ts.map +1 -1
- package/resources/stream/render-plaintext.js +21 -4
- package/resources/stream/render-plaintext.js.map +1 -1
- package/resources/stream/tty.js +1 -1
- package/resources/stream/tty.js.map +1 -1
- package/resources/tag.d.ts.map +1 -1
- package/resources/tag.js +7 -8
- package/resources/tag.js.map +1 -1
- package/resources/usage.d.ts +3 -2
- package/resources/usage.d.ts.map +1 -1
- package/resources/usage.js +19 -16
- package/resources/usage.js.map +1 -1
- package/resources/validate.d.ts.map +1 -1
- package/resources/validate.js +1 -12
- package/resources/validate.js.map +1 -1
- package/resources/version.d.ts +17 -3
- package/resources/version.d.ts.map +1 -1
- package/resources/version.js +105 -14
- package/resources/version.js.map +1 -1
- package/resources/views/agent.d.ts +3 -0
- package/resources/views/agent.d.ts.map +1 -0
- package/resources/views/agent.js +54 -0
- package/resources/views/agent.js.map +1 -0
- package/resources/views/environment.d.ts +3 -0
- package/resources/views/environment.d.ts.map +1 -0
- package/resources/views/environment.js +37 -0
- package/resources/views/environment.js.map +1 -0
- package/resources/views/index.d.ts +22 -0
- package/resources/views/index.d.ts.map +1 -0
- package/resources/views/index.js +70 -0
- package/resources/views/index.js.map +1 -0
- package/resources/views/organization.d.ts +3 -0
- package/resources/views/organization.d.ts.map +1 -0
- package/resources/views/organization.js +27 -0
- package/resources/views/organization.js.map +1 -0
- package/resources/views/routine.d.ts +3 -0
- package/resources/views/routine.d.ts.map +1 -0
- package/resources/views/routine.js +37 -0
- package/resources/views/routine.js.map +1 -0
- package/resources/views/run.d.ts +3 -0
- package/resources/views/run.d.ts.map +1 -0
- package/resources/views/run.js +45 -0
- package/resources/views/run.js.map +1 -0
- package/resources/views/session.d.ts +5 -0
- package/resources/views/session.d.ts.map +1 -0
- package/resources/views/session.js +85 -0
- package/resources/views/session.js.map +1 -0
- package/resources/views/skill.d.ts +5 -0
- package/resources/views/skill.d.ts.map +1 -0
- package/resources/views/skill.js +48 -0
- package/resources/views/skill.js.map +1 -0
- package/resources/views/view.d.ts +66 -0
- package/resources/views/view.d.ts.map +1 -0
- package/resources/views/view.js +130 -0
- package/resources/views/view.js.map +1 -0
- package/resources/views/words.d.ts +52 -0
- package/resources/views/words.d.ts.map +1 -0
- package/resources/views/words.js +190 -0
- package/resources/views/words.js.map +1 -0
- package/runtime.d.ts +22 -0
- package/runtime.d.ts.map +1 -1
- package/runtime.js +33 -2
- package/runtime.js.map +1 -1
- package/src/auth/auth0.ts +1 -1
- package/src/auth/token.ts +136 -26
- package/src/client/client.ts +23 -16
- package/src/command-tree.ts +152 -0
- package/src/commands/access-history/index.ts +15 -2
- package/src/commands/agent-exec-flags.ts +11 -5
- package/src/commands/apikey/duration.ts +1 -2
- package/src/commands/apikey/index.ts +3 -4
- package/src/commands/apply.ts +3 -22
- package/src/commands/auth/index.ts +7 -5
- package/src/commands/auth/whoami.ts +1 -1
- package/src/commands/config/index.ts +3 -3
- package/src/commands/config/kv.ts +18 -14
- package/src/commands/connect.ts +21 -3
- package/src/commands/download.ts +106 -62
- package/src/commands/eval.ts +22 -21
- package/src/commands/file.ts +80 -0
- package/src/commands/get.ts +19 -13
- package/src/commands/help.ts +182 -0
- package/src/commands/internal-daemon.ts +9 -2
- package/src/commands/list.ts +22 -1
- package/src/commands/logs.ts +1 -1
- package/src/commands/mcp-server.ts +57 -28
- package/src/commands/provider-key/index.ts +192 -0
- package/src/commands/push.ts +8 -8
- package/src/commands/resume.ts +20 -12
- package/src/commands/routine.ts +58 -5
- package/src/commands/run.ts +37 -17
- package/src/commands/runs/approve.ts +13 -4
- package/src/commands/runs/control.ts +50 -27
- package/src/commands/runs/index.ts +1 -2
- package/src/commands/runs/logs.ts +9 -5
- package/src/commands/runs/to-eval-case.ts +18 -6
- package/src/commands/runs/trace.ts +1 -1
- package/src/commands/search.ts +2 -3
- package/src/commands/service-account/index.ts +7 -2
- package/src/commands/session-help.ts +39 -0
- package/src/commands/setup.ts +5 -5
- package/src/commands/shared.ts +32 -3
- package/src/commands/tag.ts +13 -7
- package/src/commands/up.ts +55 -21
- package/src/commands/validate.ts +2 -2
- package/src/commands/version.ts +9 -4
- package/src/config/config.ts +66 -69
- package/src/config/index.ts +1 -2
- package/src/config/keys.ts +4 -4
- package/src/config/paths.ts +2 -2
- package/src/config/resolve.ts +20 -8
- package/src/errors/classify.ts +110 -21
- package/src/errors/command-line.ts +95 -0
- package/src/errors/handle.ts +2 -2
- package/src/errors/index.ts +12 -2
- package/src/errors/usage-error.ts +1 -1
- package/src/global-options.ts +100 -0
- package/src/local/artifact.ts +46 -140
- package/src/local/constants.ts +3 -9
- package/src/local/daemon/components.ts +78 -22
- package/src/local/daemon/env.ts +3 -8
- package/src/local/daemon/host.ts +64 -19
- package/src/local/daemon/index.ts +2 -1
- package/src/local/daemon/launch.ts +251 -72
- package/src/local/daemon/process.ts +78 -46
- package/src/local/daemon/signals.ts +19 -0
- package/src/local/daemon/supervisor.ts +84 -21
- package/src/local/daemon/types.ts +8 -4
- package/src/local/llm-config.ts +15 -9
- package/src/local/logs/view.ts +5 -6
- package/src/local/net/tcp.ts +18 -11
- package/src/local/paths.ts +2 -3
- package/src/local/provider-reach.ts +124 -0
- package/src/local/reset.ts +1 -2
- package/src/local/runtime/index.ts +1 -2
- package/src/local/runtime/node.ts +1 -1
- package/src/local/runtime/runner.ts +2 -2
- package/src/local/runtime/runtimes-install.ts +1 -1
- package/src/local/runtime/server.ts +2 -4
- package/src/local/runtime/which.ts +1 -1
- package/src/local/setup/wizard.ts +7 -5
- package/src/local/state/health-state.ts +10 -2
- package/src/local/state/lock.ts +26 -28
- package/src/local/state/log-rotation.ts +2 -3
- package/src/local/state/pidfile.ts +61 -6
- package/src/local/state/proc.ts +104 -1
- package/src/local/state/startup-config.ts +2 -2
- package/src/local/status.ts +30 -41
- package/src/local/temporal/download.ts +31 -9
- package/src/local/temporal/index.ts +1 -1
- package/src/local/temporal/manager.ts +94 -34
- package/src/local/temporal/supervisor.ts +1 -1
- package/src/local/webconsole/index.ts +8 -5
- package/src/marketplace/github.ts +1 -1
- package/src/marketplace/official.ts +1 -1
- package/src/output/command-result.ts +14 -2
- package/src/output/confirm.ts +2 -3
- package/src/output/format.ts +5 -6
- package/src/output/index.ts +8 -1
- package/src/output/printable.ts +26 -0
- package/src/output/proto.ts +3 -4
- package/src/output/style.ts +2 -2
- package/src/output/table.ts +118 -15
- package/src/program.ts +58 -128
- package/src/registry/aliases.ts +0 -3
- package/src/registry/index.ts +0 -1
- package/src/registry/metadata.ts +16 -64
- package/src/registry/registry.ts +3 -13
- package/src/registry/verb-support.ts +28 -5
- package/src/resources/agent/quality.ts +29 -8
- package/src/resources/agent/resolve.ts +3 -3
- package/src/resources/apply/apply.ts +58 -49
- package/src/resources/apply/handlers.ts +3 -4
- package/src/resources/channel.ts +3 -4
- package/src/resources/connect/connect.ts +2 -2
- package/src/resources/delete.ts +44 -4
- package/src/resources/documents.ts +1 -1
- package/src/resources/download.ts +239 -43
- package/src/resources/eval-run/options.ts +38 -17
- package/src/resources/eval-run/report.ts +11 -5
- package/src/resources/eval-run/run.ts +13 -9
- package/src/resources/file.ts +114 -0
- package/src/resources/get-bindings.ts +18 -0
- package/src/resources/git.ts +1 -1
- package/src/resources/list.ts +178 -34
- package/src/resources/plugin.ts +3 -0
- package/src/resources/provider-key.ts +327 -0
- package/src/resources/reference.ts +41 -85
- package/src/resources/render.ts +72 -38
- package/src/resources/routine.ts +152 -15
- package/src/resources/run/agent-exec.ts +95 -44
- package/src/resources/run/create.ts +27 -24
- package/src/resources/run/engines.ts +57 -0
- package/src/resources/run/environment.ts +43 -0
- package/src/resources/run/epilogue.ts +18 -17
- package/src/resources/run/files.ts +433 -0
- package/src/resources/run/header.ts +18 -18
- package/src/resources/run/prepare.ts +67 -74
- package/src/resources/run/references.ts +6 -5
- package/src/resources/run/resolve.ts +1 -1
- package/src/resources/run/resume.ts +28 -9
- package/src/resources/run/stream.ts +110 -9
- package/src/resources/run/workspace.ts +37 -47
- package/src/resources/run-approve.ts +2 -14
- package/src/resources/run-control.ts +4 -5
- package/src/resources/run-format.ts +3 -4
- package/src/resources/run-logs.ts +17 -6
- package/src/resources/run-scores.ts +14 -4
- package/src/resources/run-to-eval-case.ts +2 -2
- package/src/resources/runs.ts +5 -5
- package/src/resources/search.ts +1 -2
- package/src/resources/service-account.ts +4 -1
- package/src/resources/session.ts +10 -7
- package/src/resources/skill.ts +7 -8
- package/src/resources/stream/answer.ts +3 -19
- package/src/resources/stream/composer.ts +170 -0
- package/src/resources/stream/ink.tsx +74 -10
- package/src/resources/stream/render-plaintext.ts +22 -4
- package/src/resources/stream/tty.ts +1 -1
- package/src/resources/tag.ts +7 -9
- package/src/resources/usage.ts +19 -15
- package/src/resources/validate.ts +1 -10
- package/src/resources/version.ts +117 -15
- package/src/resources/views/agent.ts +60 -0
- package/src/resources/views/environment.ts +41 -0
- package/src/resources/views/index.ts +82 -0
- package/src/resources/views/organization.ts +29 -0
- package/src/resources/views/routine.ts +39 -0
- package/src/resources/views/run.ts +46 -0
- package/src/resources/views/session.ts +91 -0
- package/src/resources/views/skill.ts +49 -0
- package/src/resources/views/view.ts +188 -0
- package/src/resources/views/words.ts +191 -0
- package/src/runtime.ts +51 -2
- package/errors/exit-codes.d.ts +0 -10
- package/errors/exit-codes.d.ts.map +0 -1
- package/errors/exit-codes.js +0 -15
- package/errors/exit-codes.js.map +0 -1
- package/resources/run/attachments.d.ts +0 -24
- package/resources/run/attachments.d.ts.map +0 -1
- package/resources/run/attachments.js +0 -237
- package/resources/run/attachments.js.map +0 -1
- package/src/errors/exit-codes.ts +0 -17
- package/src/resources/run/attachments.ts +0 -300
- package/src/types/marked-terminal.d.ts +0 -31
package/local/daemon/process.js
CHANGED
|
@@ -2,14 +2,18 @@
|
|
|
2
2
|
//
|
|
3
3
|
// It brings the local stack up in the canonical order (managed Temporal, then
|
|
4
4
|
// the gated server, then the runner), records a health snapshot readers can
|
|
5
|
-
// trust, runs the 10s health monitor, and
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
5
|
+
// trust, runs the 10s health monitor, and when a stop is requested tears down
|
|
6
|
+
// in reverse whatever has started. A stop is honoured from the first instant,
|
|
7
|
+
// startup included (stigmer#1175): the body looks at the request after every
|
|
8
|
+
// bounded startup step, the supervisor stops a child still behind its gate,
|
|
9
|
+
// and the stack is never reported started once a stop was asked for. A
|
|
10
|
+
// requested stop exits 0, wherever it landed. Temporal, the process host, the
|
|
11
|
+
// clock, and the stop request are all injectable so the whole body can be
|
|
12
|
+
// driven in a test without real signals or a real Temporal.
|
|
9
13
|
import { mkdirSync } from "node:fs";
|
|
10
14
|
import { dirname, join } from "node:path";
|
|
11
15
|
import { log as defaultLog } from "../../logger.js";
|
|
12
|
-
import { DAEMON_PID_FILE, HEALTH_STATE_FILE } from "../constants.js";
|
|
16
|
+
import { DAEMON_PID_FILE, HEALTH_STATE_FILE, SERVER_PORT } from "../constants.js";
|
|
13
17
|
import { writeHealthState } from "../state/health-state.js";
|
|
14
18
|
import { removePidFile, writePidFile } from "../state/pidfile.js";
|
|
15
19
|
import { TemporalManager } from "../temporal/manager.js";
|
|
@@ -19,20 +23,14 @@ import { buildComponents } from "./components.js";
|
|
|
19
23
|
import { readDaemonConfig } from "./env.js";
|
|
20
24
|
import { NodeProcessHost, systemClock } from "./host.js";
|
|
21
25
|
import { HEALTH_CHECK_INTERVAL_MS, ProcessSupervisor, SETTLE_DELAY_MS } from "./supervisor.js";
|
|
22
|
-
/** Resolve on the first SIGTERM or SIGINT — the daemon's shutdown trigger. */
|
|
23
|
-
export function waitForShutdownSignal() {
|
|
24
|
-
return new Promise((resolve) => {
|
|
25
|
-
const onSignal = () => resolve();
|
|
26
|
-
process.once("SIGTERM", onSignal);
|
|
27
|
-
process.once("SIGINT", onSignal);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
26
|
/** Run the daemon to completion. Returns the process exit code. */
|
|
31
27
|
export async function runInternalDaemon(deps) {
|
|
32
28
|
const config = deps.config ?? readDaemonConfig();
|
|
33
29
|
const host = deps.host ?? new NodeProcessHost();
|
|
34
30
|
const clock = deps.clock ?? systemClock;
|
|
35
31
|
const log = deps.log ?? defaultLog;
|
|
32
|
+
const { shutdown } = deps;
|
|
33
|
+
const serverPort = deps.serverPort ?? SERVER_PORT;
|
|
36
34
|
mkdirSync(config.logDir, { recursive: true });
|
|
37
35
|
mkdirSync(join(config.dataDir, "workspace"), { recursive: true });
|
|
38
36
|
writePidFile(join(config.dataDir, DAEMON_PID_FILE), process.pid);
|
|
@@ -44,6 +42,38 @@ export async function runInternalDaemon(deps) {
|
|
|
44
42
|
const healthPath = join(config.dataDir, HEALTH_STATE_FILE);
|
|
45
43
|
const persist = () => writeHealthState(healthPath, healthState);
|
|
46
44
|
const temporal = deps.temporal ?? (config.temporalManaged ? buildTemporal(config, log) : null);
|
|
45
|
+
let temporalStarted = false;
|
|
46
|
+
let started = null;
|
|
47
|
+
let monitor = null;
|
|
48
|
+
// The one teardown, in reverse start order, of whatever has started. After a
|
|
49
|
+
// failed start the daemon's record stays, for `up` to say why; after a
|
|
50
|
+
// requested stop nothing is left.
|
|
51
|
+
const stopStack = async (keepRecord) => {
|
|
52
|
+
if (monitor !== null)
|
|
53
|
+
clearInterval(monitor);
|
|
54
|
+
if (started !== null)
|
|
55
|
+
await started.shutdown();
|
|
56
|
+
if (temporal !== null && temporalStarted) {
|
|
57
|
+
temporal.stopSupervisor();
|
|
58
|
+
log.info("stopping managed Temporal");
|
|
59
|
+
await temporal.stop().catch((err) => log.warn("failed to stop managed Temporal cleanly", { error: String(err) }));
|
|
60
|
+
if (healthState.components.temporal !== undefined)
|
|
61
|
+
healthState.components.temporal.state = "stopped";
|
|
62
|
+
}
|
|
63
|
+
persist();
|
|
64
|
+
if (keepRecord)
|
|
65
|
+
return;
|
|
66
|
+
removePidFile(join(config.dataDir, DAEMON_PID_FILE));
|
|
67
|
+
removePidFile(healthPath);
|
|
68
|
+
log.info("daemon shutdown complete");
|
|
69
|
+
};
|
|
70
|
+
const stopRequested = async () => {
|
|
71
|
+
log.info("stop requested during startup");
|
|
72
|
+
await stopStack(false);
|
|
73
|
+
return 0;
|
|
74
|
+
};
|
|
75
|
+
if (shutdown.aborted)
|
|
76
|
+
return stopRequested();
|
|
47
77
|
// --- Start managed Temporal first (the server and runner depend on it). ---
|
|
48
78
|
if (temporal !== null) {
|
|
49
79
|
log.info("starting managed Temporal");
|
|
@@ -53,41 +83,53 @@ export async function runInternalDaemon(deps) {
|
|
|
53
83
|
}
|
|
54
84
|
catch (err) {
|
|
55
85
|
healthState.components.temporal.state = "failed";
|
|
56
|
-
healthState.components.temporal.last_error = String(err);
|
|
86
|
+
healthState.components.temporal.last_error = err instanceof Error ? err.message : String(err);
|
|
57
87
|
persist();
|
|
58
88
|
log.error("failed to start managed Temporal", { error: String(err) });
|
|
59
89
|
return 1;
|
|
60
90
|
}
|
|
91
|
+
temporalStarted = true;
|
|
61
92
|
healthState.components.temporal.pid = temporal.getPid() ?? 0;
|
|
62
93
|
healthState.components.temporal.state = "running";
|
|
63
94
|
healthState.components.temporal.started_at = new Date(clock.now()).toISOString();
|
|
64
95
|
temporal.startSupervisor();
|
|
65
96
|
persist();
|
|
97
|
+
if (shutdown.aborted)
|
|
98
|
+
return stopRequested();
|
|
66
99
|
}
|
|
67
100
|
// --- Start the server (gated) and runner via the supervisor. ---
|
|
68
|
-
const supervisor = new ProcessSupervisor(buildComponents(config, deps.env ?? process.env), {
|
|
101
|
+
const supervisor = new ProcessSupervisor(buildComponents(config, deps.env ?? process.env, serverPort), {
|
|
69
102
|
host,
|
|
70
103
|
clock,
|
|
71
104
|
healthState,
|
|
72
105
|
persist,
|
|
73
106
|
log,
|
|
107
|
+
serverPort,
|
|
74
108
|
});
|
|
75
|
-
|
|
109
|
+
started = supervisor;
|
|
110
|
+
const result = await supervisor.startAll(shutdown);
|
|
111
|
+
if (result.stopped === true)
|
|
112
|
+
return stopRequested();
|
|
76
113
|
if (!result.ok) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
114
|
+
const failed = result.failedCritical === undefined ? undefined : healthState.components[result.failedCritical];
|
|
115
|
+
log.error("critical component failed to start", { component: result.failedCritical, error: failed?.last_error });
|
|
116
|
+
// A server that hangs without opening its port is still running: stop what
|
|
117
|
+
// started, in reverse, as a clean shutdown would, so a failed start leaves
|
|
118
|
+
// nothing behind holding the port.
|
|
119
|
+
await stopStack(true);
|
|
82
120
|
return 1;
|
|
83
121
|
}
|
|
84
122
|
// Let processes settle, then catch anything that crashed immediately.
|
|
85
123
|
await clock.sleep(SETTLE_DELAY_MS);
|
|
124
|
+
if (shutdown.aborted)
|
|
125
|
+
return stopRequested();
|
|
86
126
|
supervisor.settleCheck();
|
|
87
127
|
// Web console: the SERVER serves it from its unified port; the
|
|
88
128
|
// daemon probes and records what a browser would actually find. pid 0 is
|
|
89
129
|
// truthful — there is no separate console process to supervise.
|
|
90
|
-
const consoleAvailable = config.noWeb ? false : await isWebConsoleAvailable();
|
|
130
|
+
const consoleAvailable = config.noWeb ? false : await isWebConsoleAvailable(serverPort, shutdown);
|
|
131
|
+
if (shutdown.aborted)
|
|
132
|
+
return stopRequested();
|
|
91
133
|
healthState.components["web-console"] = {
|
|
92
134
|
pid: 0,
|
|
93
135
|
state: consoleAvailable ? "running" : "stopped",
|
|
@@ -100,7 +142,7 @@ export async function runInternalDaemon(deps) {
|
|
|
100
142
|
log.debug("server did not answer the console probe (no export bundled), skipping");
|
|
101
143
|
persist();
|
|
102
144
|
// --- Health monitor: sync Temporal + drive one supervisor tick per interval. ---
|
|
103
|
-
|
|
145
|
+
monitor = setInterval(() => {
|
|
104
146
|
void (async () => {
|
|
105
147
|
if (temporal !== null)
|
|
106
148
|
await syncTemporal(temporal, healthState);
|
|
@@ -110,24 +152,18 @@ export async function runInternalDaemon(deps) {
|
|
|
110
152
|
monitor.unref?.();
|
|
111
153
|
log.info("daemon started", { pid: process.pid });
|
|
112
154
|
await deps.onStarted?.();
|
|
113
|
-
// --- Wait for
|
|
114
|
-
await
|
|
155
|
+
// --- Wait for the stop request, then tear down in reverse order. ---
|
|
156
|
+
await untilAborted(shutdown);
|
|
115
157
|
log.info("received shutdown signal");
|
|
116
|
-
|
|
117
|
-
await supervisor.shutdown();
|
|
118
|
-
if (temporal !== null) {
|
|
119
|
-
temporal.stopSupervisor();
|
|
120
|
-
log.info("stopping managed Temporal");
|
|
121
|
-
await temporal.stop().catch((err) => log.warn("failed to stop managed Temporal cleanly", { error: String(err) }));
|
|
122
|
-
if (healthState.components.temporal !== undefined)
|
|
123
|
-
healthState.components.temporal.state = "stopped";
|
|
124
|
-
}
|
|
125
|
-
persist();
|
|
126
|
-
removePidFile(join(config.dataDir, DAEMON_PID_FILE));
|
|
127
|
-
removePidFile(healthPath);
|
|
128
|
-
log.info("daemon shutdown complete");
|
|
158
|
+
await stopStack(false);
|
|
129
159
|
return 0;
|
|
130
160
|
}
|
|
161
|
+
// Resolve once `signal` aborts, at once if it already has.
|
|
162
|
+
function untilAborted(signal) {
|
|
163
|
+
if (signal.aborted)
|
|
164
|
+
return Promise.resolve();
|
|
165
|
+
return new Promise((resolve) => signal.addEventListener("abort", () => resolve(), { once: true }));
|
|
166
|
+
}
|
|
131
167
|
// Sync the Temporal component's health from its self-supervising manager.
|
|
132
168
|
async function syncTemporal(temporal, healthState) {
|
|
133
169
|
const state = healthState.components.temporal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../src/local/daemon/process.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,
|
|
1
|
+
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../src/local/daemon/process.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,4EAA4E;AAC5E,uEAAuE;AACvE,8EAA8E;AAC9E,0EAA0E;AAC1E,4DAA4D;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WA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request: SIGTERM or SIGINT, turned into an
|
|
2
|
+
// AbortSignal the moment it is armed (the idiom of `runs logs` and
|
|
3
|
+
// `mcp-server`).
|
|
4
|
+
//
|
|
5
|
+
// It lives apart from the daemon body so `internal-daemon` can arm it as its
|
|
6
|
+
// first act, before it imports anything heavy: a SIGTERM that arrives before
|
|
7
|
+
// the handlers exist meets Node's default handler, which exits at once and
|
|
8
|
+
// orphans every child already started (stigmer#1175). It installs `once`
|
|
9
|
+
// handlers, so a second signal during the teardown still ends the process,
|
|
10
|
+
// the conventional "press Ctrl-C again to force".
|
|
11
|
+
/** Arm the stop request: aborted on the first SIGTERM or SIGINT from now on. */
|
|
12
|
+
export function shutdownOnSignals() {
|
|
13
|
+
const controller = new AbortController();
|
|
14
|
+
const onSignal = () => controller.abort();
|
|
15
|
+
process.once("SIGTERM", onSignal);
|
|
16
|
+
process.once("SIGINT", onSignal);
|
|
17
|
+
return controller.signal;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=signals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signals.js","sourceRoot":"","sources":["../../src/local/daemon/signals.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,mEAAmE;AACnE,iBAAiB;AACjB,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAC3E,yEAAyE;AACzE,2EAA2E;AAC3E,kDAAkD;AAElD,gFAAgF;AAChF,MAAM,UAAU,iBAAiB;IAC/B,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,MAAM,QAAQ,GAAG,GAAS,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAClC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACjC,OAAO,UAAU,CAAC,MAAM,CAAC;AAC3B,CAAC"}
|
|
@@ -24,6 +24,8 @@ export interface StartResult {
|
|
|
24
24
|
ok: boolean;
|
|
25
25
|
/** Name of the critical component that failed, if any. */
|
|
26
26
|
failedCritical?: string;
|
|
27
|
+
/** True when a requested stop ended the start; nothing is left half-started. */
|
|
28
|
+
stopped?: boolean;
|
|
27
29
|
}
|
|
28
30
|
export declare class ProcessSupervisor {
|
|
29
31
|
private readonly managed;
|
|
@@ -38,9 +40,13 @@ export declare class ProcessSupervisor {
|
|
|
38
40
|
/**
|
|
39
41
|
* Start all components in order. A critical component that fails to start or
|
|
40
42
|
* gate aborts startup (returns failedCritical); a non-critical failure is
|
|
41
|
-
* recorded and skipped.
|
|
43
|
+
* recorded and skipped. When `shutdown` aborts, nothing further is spawned,
|
|
44
|
+
* a child still behind its gate is stopped, and the result says `stopped`
|
|
45
|
+
* once that stop has finished; children already past their gate are left
|
|
46
|
+
* for `shutdown()`.
|
|
42
47
|
*/
|
|
43
|
-
startAll(): Promise<StartResult>;
|
|
48
|
+
startAll(shutdown?: AbortSignal): Promise<StartResult>;
|
|
49
|
+
private stoppedWhileStarting;
|
|
44
50
|
/** After a brief settle, mark any component that already crashed as failed. */
|
|
45
51
|
settleCheck(): void;
|
|
46
52
|
/** One health-monitor iteration: restart crashed children, probe the server. */
|
|
@@ -50,6 +56,7 @@ export declare class ProcessSupervisor {
|
|
|
50
56
|
private probeServer;
|
|
51
57
|
private tryRestart;
|
|
52
58
|
private spawn;
|
|
59
|
+
private markFailed;
|
|
53
60
|
private killAndWait;
|
|
54
61
|
private raceTimeout;
|
|
55
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../../src/local/daemon/supervisor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../../src/local/daemon/supervisor.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,KAAK,MAAM,EAAqB,MAAM,iBAAiB,CAAC;AAEjE,OAAO,KAAK,EA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,CAAC,QAAQ,CAAC,UAAU,CAAS;gBAExB,KAAK,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,cAAc;IAgBxD;;;;;;;OAOG;IACG,QAAQ,CAAC,QAAQ,GAAE,WAA0C,GAAG,OAAO,CAAC,WAAW,CAAC;IAkD1F,OAAO,CAAC,oBAAoB;IAK5B,+EAA+E;IAC/E,WAAW,IAAI,IAAI;IAUnB,gFAAgF;IAC1E,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAiB3B,6DAA6D;IACvD,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;YAajB,WAAW;YAuBX,UAAU;IA6BxB,OAAO,CAAC,KAAK;IA0Bb,OAAO,CAAC,UAAU;YAQJ,WAAW;YAYX,WAAW;CAM1B"}
|
|
@@ -2,13 +2,24 @@
|
|
|
2
2
|
// restart with rapid-crash and max-restart guards, server health probing, and
|
|
3
3
|
// reverse-order shutdown.
|
|
4
4
|
//
|
|
5
|
+
// Every path that marks a component failed records why in the health snapshot:
|
|
6
|
+
// the error, and the child's last stderr lines, exited or still hanging. That
|
|
7
|
+
// record is what `stigmer status` shows and what a failed `stigmer up` prints
|
|
8
|
+
// (stigmer#1845), so a stopped-after-failure component keeps its "failed".
|
|
9
|
+
//
|
|
10
|
+
// A stop requested while the stack is still starting is honoured at once
|
|
11
|
+
// (stigmer#1175): `startAll` spawns nothing further and stops the child its
|
|
12
|
+
// readiness gate is waiting on, here, in the one class that owns the children,
|
|
13
|
+
// so no second flow ever stops a component while it is being started. Such a
|
|
14
|
+
// stop is not a failure, and records none.
|
|
15
|
+
//
|
|
5
16
|
// Every side effect (spawning, time, the health probe) is injected, so this
|
|
6
|
-
// whole policy is unit-testable without real processes or real waiting
|
|
7
|
-
//
|
|
17
|
+
// whole policy is unit-testable without real processes or real waiting.
|
|
18
|
+
// process.ts wires this to the real host,
|
|
8
19
|
// clock, Temporal, signals, and the 10s tick.
|
|
9
20
|
import { SERVER_PORT } from "../constants.js";
|
|
10
21
|
import { log as defaultLog } from "../../logger.js";
|
|
11
|
-
import { tcpConnects } from "../net/tcp.js";
|
|
22
|
+
import { describeExit, tcpConnects } from "../net/tcp.js";
|
|
12
23
|
import { removePidFile, writePidFile } from "../state/pidfile.js";
|
|
13
24
|
export const MAX_RESTARTS = 5;
|
|
14
25
|
export const RAPID_CRASH_WINDOW_MS = 5_000;
|
|
@@ -42,17 +53,21 @@ export class ProcessSupervisor {
|
|
|
42
53
|
/**
|
|
43
54
|
* Start all components in order. A critical component that fails to start or
|
|
44
55
|
* gate aborts startup (returns failedCritical); a non-critical failure is
|
|
45
|
-
* recorded and skipped.
|
|
56
|
+
* recorded and skipped. When `shutdown` aborts, nothing further is spawned,
|
|
57
|
+
* a child still behind its gate is stopped, and the result says `stopped`
|
|
58
|
+
* once that stop has finished; children already past their gate are left
|
|
59
|
+
* for `shutdown()`.
|
|
46
60
|
*/
|
|
47
|
-
async startAll() {
|
|
61
|
+
async startAll(shutdown = new AbortController().signal) {
|
|
48
62
|
for (const m of this.managed) {
|
|
63
|
+
if (shutdown.aborted)
|
|
64
|
+
return this.stoppedWhileStarting();
|
|
49
65
|
this.log.info("starting component", { component: m.spec.name });
|
|
50
66
|
try {
|
|
51
67
|
this.spawn(m);
|
|
52
68
|
}
|
|
53
69
|
catch (err) {
|
|
54
|
-
m
|
|
55
|
-
m.state.last_error = String(err);
|
|
70
|
+
this.markFailed(m, errorMessage(err), null);
|
|
56
71
|
this.log.error("failed to start component", { component: m.spec.name, error: String(err) });
|
|
57
72
|
if (m.spec.critical) {
|
|
58
73
|
this.persist();
|
|
@@ -61,28 +76,53 @@ export class ProcessSupervisor {
|
|
|
61
76
|
continue;
|
|
62
77
|
}
|
|
63
78
|
if (m.spec.gate !== undefined && m.handle !== null) {
|
|
79
|
+
// A stop during the gate stops the gated child; the gate then ends at
|
|
80
|
+
// its next look at the child's exit.
|
|
81
|
+
let stopping = null; // set by the listener, so not narrowed
|
|
82
|
+
const onStop = () => {
|
|
83
|
+
this.log.info("stop requested, stopping component", { component: m.spec.name, pid: m.state.pid });
|
|
84
|
+
stopping = this.killAndWait(m);
|
|
85
|
+
};
|
|
86
|
+
shutdown.addEventListener("abort", onStop, { once: true });
|
|
87
|
+
if (shutdown.aborted)
|
|
88
|
+
onStop(); // asked for during the spawn itself
|
|
64
89
|
try {
|
|
65
90
|
await m.spec.gate.wait(m.handle);
|
|
66
|
-
|
|
91
|
+
if (!shutdown.aborted)
|
|
92
|
+
this.log.info("component ready", { component: m.spec.name, gate: m.spec.gate.description });
|
|
67
93
|
}
|
|
68
94
|
catch (err) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
95
|
+
if (!shutdown.aborted) {
|
|
96
|
+
this.markFailed(m, errorMessage(err), m.handle);
|
|
97
|
+
this.persist();
|
|
98
|
+
if (m.spec.critical)
|
|
99
|
+
return { ok: false, failedCritical: m.spec.name };
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
shutdown.removeEventListener("abort", onStop);
|
|
104
|
+
}
|
|
105
|
+
if (stopping !== null) {
|
|
106
|
+
await stopping;
|
|
107
|
+
removePidFile(m.spec.pidFile);
|
|
108
|
+
m.state.state = "stopped";
|
|
74
109
|
}
|
|
75
110
|
}
|
|
76
111
|
}
|
|
112
|
+
if (shutdown.aborted)
|
|
113
|
+
return this.stoppedWhileStarting();
|
|
77
114
|
this.persist();
|
|
78
115
|
return { ok: true };
|
|
79
116
|
}
|
|
117
|
+
stoppedWhileStarting() {
|
|
118
|
+
this.persist();
|
|
119
|
+
return { ok: false, stopped: true };
|
|
120
|
+
}
|
|
80
121
|
/** After a brief settle, mark any component that already crashed as failed. */
|
|
81
122
|
settleCheck() {
|
|
82
123
|
for (const m of this.managed) {
|
|
83
124
|
if (m.handle !== null && m.handle.hasExited()) {
|
|
84
|
-
m.
|
|
85
|
-
m.state.last_error = "crashed during startup";
|
|
125
|
+
this.markFailed(m, `crashed during startup${exitSuffix(m.handle)}`, m.handle);
|
|
86
126
|
this.log.error("component crashed during startup", { component: m.spec.name, pid: m.state.pid });
|
|
87
127
|
}
|
|
88
128
|
}
|
|
@@ -113,7 +153,9 @@ export class ProcessSupervisor {
|
|
|
113
153
|
this.log.info("stopping component", { component: m.spec.name, pid: m.state.pid });
|
|
114
154
|
await this.killAndWait(m);
|
|
115
155
|
removePidFile(m.spec.pidFile);
|
|
116
|
-
|
|
156
|
+
// A component stopped because its start failed stays "failed".
|
|
157
|
+
if (m.state.state !== "failed")
|
|
158
|
+
m.state.state = "stopped";
|
|
117
159
|
}
|
|
118
160
|
this.persist();
|
|
119
161
|
}
|
|
@@ -123,6 +165,7 @@ export class ProcessSupervisor {
|
|
|
123
165
|
m.unhealthyCount = 0;
|
|
124
166
|
m.state.state = "running";
|
|
125
167
|
m.state.last_error = undefined;
|
|
168
|
+
m.state.last_output = undefined;
|
|
126
169
|
this.log.info("component recovered — gRPC port responding again", { component: m.spec.name });
|
|
127
170
|
}
|
|
128
171
|
return;
|
|
@@ -142,14 +185,13 @@ export class ProcessSupervisor {
|
|
|
142
185
|
async tryRestart(m) {
|
|
143
186
|
const startedAtMs = m.state.started_at !== "" ? Date.parse(m.state.started_at) : 0;
|
|
144
187
|
if (startedAtMs > 0 && this.clock.now() - startedAtMs < RAPID_CRASH_WINDOW_MS) {
|
|
145
|
-
|
|
146
|
-
m
|
|
188
|
+
const handle = m.handle;
|
|
189
|
+
this.markFailed(m, `crashed immediately after start${handle === null ? "" : exitSuffix(handle)} (likely a configuration or dependency error)`, handle);
|
|
147
190
|
this.log.error("component crashed too quickly, marking failed", { component: m.spec.name });
|
|
148
191
|
return;
|
|
149
192
|
}
|
|
150
193
|
if (m.state.restart_count >= MAX_RESTARTS) {
|
|
151
|
-
m
|
|
152
|
-
m.state.last_error = `exceeded max restarts (${MAX_RESTARTS})`;
|
|
194
|
+
this.markFailed(m, `exceeded max restarts (${MAX_RESTARTS})`, m.handle);
|
|
153
195
|
this.log.error("component exceeded max restarts, marking failed", { component: m.spec.name });
|
|
154
196
|
return;
|
|
155
197
|
}
|
|
@@ -160,8 +202,7 @@ export class ProcessSupervisor {
|
|
|
160
202
|
this.log.info("component restarted", { component: m.spec.name, restart_count: m.state.restart_count });
|
|
161
203
|
}
|
|
162
204
|
catch (err) {
|
|
163
|
-
m
|
|
164
|
-
m.state.last_error = String(err);
|
|
205
|
+
this.markFailed(m, errorMessage(err), null);
|
|
165
206
|
this.log.error("failed to restart component", { component: m.spec.name, error: String(err) });
|
|
166
207
|
}
|
|
167
208
|
}
|
|
@@ -182,10 +223,19 @@ export class ProcessSupervisor {
|
|
|
182
223
|
m.state.state = "running";
|
|
183
224
|
m.state.started_at = new Date(this.clock.now()).toISOString();
|
|
184
225
|
m.state.last_error = undefined;
|
|
226
|
+
m.state.last_output = undefined;
|
|
185
227
|
if (request.readinessMarker !== undefined)
|
|
186
228
|
m.state.ready = false;
|
|
187
229
|
writePidFile(m.spec.pidFile, handle.pid);
|
|
188
230
|
}
|
|
231
|
+
// Mark a component failed with why: the error, and the last stderr lines of
|
|
232
|
+
// the child that failed (none when no child was spawned for this failure).
|
|
233
|
+
markFailed(m, error, handle) {
|
|
234
|
+
m.state.state = "failed";
|
|
235
|
+
m.state.last_error = error;
|
|
236
|
+
const output = handle?.stderrTail() ?? [];
|
|
237
|
+
m.state.last_output = output.length > 0 ? [...output] : undefined;
|
|
238
|
+
}
|
|
189
239
|
// SIGTERM, wait for graceful exit, then SIGKILL as a last resort.
|
|
190
240
|
async killAndWait(m) {
|
|
191
241
|
if (m.handle === null || m.handle.hasExited())
|
|
@@ -208,4 +258,13 @@ export class ProcessSupervisor {
|
|
|
208
258
|
return result === timeout;
|
|
209
259
|
}
|
|
210
260
|
}
|
|
261
|
+
// An error's own message, so a recorded error never begins "Error:".
|
|
262
|
+
function errorMessage(err) {
|
|
263
|
+
return err instanceof Error ? err.message : String(err);
|
|
264
|
+
}
|
|
265
|
+
// " (exited with code 1)" once the child's end is observed, else nothing.
|
|
266
|
+
function exitSuffix(handle) {
|
|
267
|
+
const exit = handle.exitInfo();
|
|
268
|
+
return exit === null ? "" : ` (${describeExit(exit)})`;
|
|
269
|
+
}
|
|
211
270
|
//# sourceMappingURL=supervisor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supervisor.js","sourceRoot":"","sources":["../../src/local/daemon/supervisor.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,8EAA8E;AAC9E,0BAA0B;AAC1B,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,4EAA4E;AAC5E,8CAA8C;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAe,GAAG,IAAI,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGlE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC;AAC9B,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAC3C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AACtC,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC;AAC9C,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AACrC,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC;AA8B/C,MAAM,OAAO,iBAAiB;IACX,OAAO,CAAY;IACnB,IAAI,CAAc;IAClB,KAAK,CAAQ;IACb,WAAW,CAAc;IACzB,OAAO,CAAa;IACpB,GAAG,CAAS;IACZ,KAAK,CAAqC;IAC1C,UAAU,CAAS;IAEpC,YAAY,KAAsB,EAAE,IAAoB;QACtD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,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C,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC5G,OAAO,MAAM,KAAK,OAAO,CAAC;IAC5B,CAAC;CACF;AAED,qEAAqE;AACrE,SAAS,YAAY,CAAC,GAAY;IAChC,OAAO,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC;AAED,0EAA0E;AAC1E,SAAS,UAAU,CAAC,MAAmB;IACrC,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC/B,OAAO,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC;AACzD,CAAC"}
|
package/local/daemon/types.d.ts
CHANGED
|
@@ -21,6 +21,11 @@ export interface ChildHandle {
|
|
|
21
21
|
readonly pid: number;
|
|
22
22
|
/** True once the child has terminated (and been observed). */
|
|
23
23
|
hasExited(): boolean;
|
|
24
|
+
/** How the child terminated, once observed; null while it runs. */
|
|
25
|
+
exitInfo(): ExitInfo | null;
|
|
26
|
+
/** The child's last few complete stderr lines, oldest first: its last
|
|
27
|
+
* words, recorded beside a failure. */
|
|
28
|
+
stderrTail(): readonly string[];
|
|
24
29
|
/** Register the exit callback (invoked once). */
|
|
25
30
|
onExit(cb: (info: ExitInfo) => void): void;
|
|
26
31
|
/** Register the readiness callback (invoked once if a marker was set). */
|
|
@@ -43,7 +48,7 @@ export interface Clock {
|
|
|
43
48
|
/**
|
|
44
49
|
* Declarative description of one managed component. `resolve` is called lazily
|
|
45
50
|
* at (re)start time so binary resolution and env construction happen fresh on
|
|
46
|
-
* every attempt
|
|
51
|
+
* every attempt.
|
|
47
52
|
*/
|
|
48
53
|
export interface ComponentSpec {
|
|
49
54
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/local/daemon/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/local/daemon/types.ts"],"names":[],"mappings":"AAOA,8BAA8B;AAC9B,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;CAC/B;AAED,6CAA6C;AAC7C,MAAM,WAAW,YAAY;IAC3B,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wCAAwC;AACxC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D,SAAS,IAAI,OAAO,CAAC;IACrB,mEAAmE;IACnE,QAAQ,IAAI,QAAQ,GAAG,IAAI,CAAC;IAC5B;2CACuC;IACvC,UAAU,IAAI,SAAS,MAAM,EAAE,CAAC;IAChC,iDAAiD;IACjD,MAAM,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI,CAAC;IAC3C,0EAA0E;IAC1E,OAAO,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAC9B,wCAAwC;IACxC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;CACpC;AAED;iEACiE;AACjE,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,WAAW,CAAC;CAC3C;AAED,uEAAuE;AACvE,MAAM,WAAW,KAAK;IACpB,kCAAkC;IAClC,GAAG,IAAI,MAAM,CAAC;IACd,uCAAuC;IACvC,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,QAAQ,EAAE,OAAO,CAAC;IAClB,iDAAiD;IACjD,OAAO,IAAI,YAAY,CAAC;IACxB,wEAAwE;IACxE,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,8EAA8E;IAC9E,IAAI,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
package/local/daemon/types.js
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
//
|
|
3
3
|
// The supervisor's restart/health policy is the part that must be exhaustively
|
|
4
4
|
// testable, so every side effect it performs — spawning a process, reading the
|
|
5
|
-
// clock — goes through an interface that tests can fake
|
|
6
|
-
//
|
|
7
|
-
// unit.
|
|
5
|
+
// clock — goes through an interface that tests can fake, which makes the
|
|
6
|
+
// policy a pure unit.
|
|
8
7
|
export {};
|
|
9
8
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/local/daemon/types.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/local/daemon/types.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,yEAAyE;AACzE,sBAAsB"}
|
package/local/llm-config.d.ts
CHANGED
|
@@ -7,8 +7,10 @@ export interface LlmSettings {
|
|
|
7
7
|
/** The persisted LLM settings, if any. */
|
|
8
8
|
export declare function readLlm(config: Config): LlmSettings | undefined;
|
|
9
9
|
/**
|
|
10
|
-
* Detect
|
|
11
|
-
* only
|
|
10
|
+
* Detect the saved-key provider from the environment: ANTHROPIC_API_KEY is the
|
|
11
|
+
* only key this config section routes, so it is the only one that counts here.
|
|
12
|
+
* Other providers' keys reach the runner by inheritance and are judged by the
|
|
13
|
+
* reach rule (provider-reach.ts), not by this.
|
|
12
14
|
*/
|
|
13
15
|
export declare function detectProviderFromEnv(env?: NodeJS.ProcessEnv): string;
|
|
14
16
|
/** Effective provider: env override > config > API-key autodetect. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-config.d.ts","sourceRoot":"","sources":["../src/local/llm-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"llm-config.d.ts","sourceRoot":"","sources":["../src/local/llm-config.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,oFAAoF;AACpF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAYD,0CAA0C;AAC1C,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAE/D;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAGlF;AAED,sEAAsE;AACtE,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAK5F;AAED,6DAA6D;AAC7D,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAI1F;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,GAAG,SAAS,GAAG,MAAM,CAQhF"}
|