@stigmer/cli 0.1.0-dev.20261017064309.g94d062a29f89 → 0.1.1
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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Resource creation for the run path: Run.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// We build the full proto messages and drive
|
|
4
4
|
// the generated command controllers directly — the fidelity rule
|
|
5
5
|
// resources/apply/handlers.ts states: the SDK's typed `create(input)` wrappers model a
|
|
6
|
-
// subset of fields, and
|
|
6
|
+
// subset of fields, and the conversation's resources are already proto
|
|
7
7
|
// messages, so a round-trip through the input types would be lossy and pointless.
|
|
8
8
|
|
|
9
9
|
import type { Client } from "@connectrpc/connect";
|
|
@@ -11,7 +11,6 @@ import { create, type DescService } from "@bufbuild/protobuf";
|
|
|
11
11
|
import { type Run, RunSchema } from "@stigmer/apis/ai/stigmer/agentic/run/v1/api_pb";
|
|
12
12
|
import { RunCommandController } from "@stigmer/apis/ai/stigmer/agentic/run/v1/command_pb";
|
|
13
13
|
import { InteractionMode, ServiceTier, ThinkingMode } from "@stigmer/apis/ai/stigmer/agentic/run/v1/enum_pb";
|
|
14
|
-
import type { Attachment } from "@stigmer/apis/ai/stigmer/agentic/run/v1/spec_pb";
|
|
15
14
|
import {
|
|
16
15
|
type RunSpec,
|
|
17
16
|
RunSpecSchema,
|
|
@@ -20,9 +19,9 @@ import {
|
|
|
20
19
|
type RunConfig,
|
|
21
20
|
RunConfigSchema,
|
|
22
21
|
} from "@stigmer/apis/ai/stigmer/agentic/run/v1/invocation_pb";
|
|
23
|
-
import {
|
|
22
|
+
import { ENGINES } from "./engines.js";
|
|
24
23
|
import { type SessionSpec, SessionSpecSchema } from "@stigmer/apis/ai/stigmer/agentic/session/v1/spec_pb";
|
|
25
|
-
import type {
|
|
24
|
+
import type { SessionResource } from "@stigmer/apis/ai/stigmer/agentic/session/v1/resource_pb";
|
|
26
25
|
import { ApiResourceMetadataSchema } from "@stigmer/apis/ai/stigmer/commons/apiresource/metadata_pb";
|
|
27
26
|
import {
|
|
28
27
|
type ApiResourceReference,
|
|
@@ -55,13 +54,14 @@ export interface AgentRefInput {
|
|
|
55
54
|
* embedded session_spec. agentRef names the new conversation's agent; with
|
|
56
55
|
* neither, the new conversation runs the built-in assistant.
|
|
57
56
|
*
|
|
58
|
-
*
|
|
59
|
-
* one-call bootstrap (spec.session_spec, stigmer/stigmer#249) and
|
|
60
|
-
* auto-created session. A session's agent,
|
|
61
|
-
*
|
|
62
|
-
* target carries the session id alone, and the conversation
|
|
63
|
-
* it was started with.
|
|
64
|
-
*
|
|
57
|
+
* resources, harness, vaults, includeMyVault, plugins and environment
|
|
58
|
+
* ride the one-call bootstrap (spec.session_spec, stigmer/stigmer#249) and
|
|
59
|
+
* shape the auto-created session. A session's agent, harness, vault, plugin
|
|
60
|
+
* and environment choice are set at creation, so with sessionId set they are
|
|
61
|
+
* not sent: the target carries the session id alone, and the conversation
|
|
62
|
+
* keeps the vaults it was started with. Files reach an existing conversation
|
|
63
|
+
* through fileIds, or through an update of its own resources. A run carries
|
|
64
|
+
* no keys of its own; they come from the vaults its conversation uses.
|
|
65
65
|
*/
|
|
66
66
|
export interface CreateRunInput {
|
|
67
67
|
readonly agentRef?: AgentRefInput;
|
|
@@ -74,9 +74,13 @@ export interface CreateRunInput {
|
|
|
74
74
|
readonly includeMyVault: boolean;
|
|
75
75
|
/** The plugins the new conversation uses: their skills, agents, MCP servers and hooks. */
|
|
76
76
|
readonly plugins: readonly ApiResourceReference[];
|
|
77
|
-
|
|
77
|
+
/** The Environment the new conversation names; undefined leaves its agent's or organization's default. */
|
|
78
|
+
readonly environment?: ApiResourceReference;
|
|
79
|
+
/** The Files the message carries, by id. */
|
|
80
|
+
readonly fileIds: readonly string[];
|
|
78
81
|
readonly workspaceFileRefs: readonly string[];
|
|
79
|
-
|
|
82
|
+
/** The new conversation's repositories, folders and Files. */
|
|
83
|
+
readonly resources: readonly SessionResource[];
|
|
80
84
|
readonly model: string;
|
|
81
85
|
readonly mode: RunMode;
|
|
82
86
|
readonly serviceTier: ServiceTierFlag;
|
|
@@ -85,7 +89,7 @@ export interface CreateRunInput {
|
|
|
85
89
|
readonly harness: HarnessFlag;
|
|
86
90
|
}
|
|
87
91
|
|
|
88
|
-
/** Create a run.
|
|
92
|
+
/** Create a run. */
|
|
89
93
|
export async function createAgentRun(
|
|
90
94
|
controller: ControllerFn,
|
|
91
95
|
input: CreateRunInput,
|
|
@@ -96,7 +100,7 @@ export async function createAgentRun(
|
|
|
96
100
|
metadata: create(ApiResourceMetadataSchema, { name: runName(), org: input.orgId }),
|
|
97
101
|
spec: create(RunSpecSchema, {
|
|
98
102
|
message: input.message === "" ? "execute" : input.message,
|
|
99
|
-
|
|
103
|
+
fileIds: [...input.fileIds],
|
|
100
104
|
workspaceFileRefs: [...input.workspaceFileRefs],
|
|
101
105
|
autoApproveAll: input.autoApproveAll,
|
|
102
106
|
target: buildTarget(input),
|
|
@@ -123,21 +127,22 @@ function buildTarget(input: CreateRunInput): RunSpec["target"] {
|
|
|
123
127
|
// field at its default, and include_my_vault's default is off, so a person's
|
|
124
128
|
// run would lose their own My vault. The agent reference names the
|
|
125
129
|
// conversation's agent. A resolved harness is stamped explicitly,
|
|
126
|
-
// including "
|
|
130
|
+
// including "stigmer": the value may be a deliberate per-run escape from the
|
|
127
131
|
// account's default_harness preference, so it must survive any future change
|
|
128
132
|
// to the server-side default. Empty means "no opinion" and stays off the wire
|
|
129
|
-
// (server defaults to
|
|
133
|
+
// (server defaults to Stigmer). Subject is left empty: the server defaults its
|
|
130
134
|
// sentinel and the async title activity replaces it. The server clones this
|
|
131
135
|
// spec onto the auto-created session and then clears it from the persisted
|
|
132
136
|
// run — the Session resource stays the single source of truth.
|
|
133
137
|
function buildSessionSpec(input: CreateRunInput): SessionSpec {
|
|
134
138
|
const { agentRef, harness } = input;
|
|
135
139
|
const spec = create(SessionSpecSchema, {
|
|
136
|
-
|
|
140
|
+
resources: [...input.resources],
|
|
137
141
|
vaults: [...input.vaults],
|
|
138
142
|
includeMyVault: input.includeMyVault,
|
|
139
143
|
plugins: [...input.plugins],
|
|
140
144
|
});
|
|
145
|
+
if (input.environment !== undefined) spec.environmentRef = input.environment;
|
|
141
146
|
if (agentRef !== undefined) {
|
|
142
147
|
spec.agentRef = create(ApiResourceReferenceSchema, {
|
|
143
148
|
kind: ApiResourceKind.agent,
|
|
@@ -146,8 +151,7 @@ function buildSessionSpec(input: CreateRunInput): SessionSpec {
|
|
|
146
151
|
version: agentRef.version ?? "",
|
|
147
152
|
});
|
|
148
153
|
}
|
|
149
|
-
if (harness
|
|
150
|
-
else if (harness === "native") spec.harness = Harness.NATIVE;
|
|
154
|
+
if (harness !== "") spec.harness = ENGINES[harness].harness;
|
|
151
155
|
return spec;
|
|
152
156
|
}
|
|
153
157
|
|
|
@@ -173,9 +177,8 @@ function buildRunConfig(
|
|
|
173
177
|
return cfg;
|
|
174
178
|
}
|
|
175
179
|
|
|
176
|
-
// Unique-enough placeholder name
|
|
177
|
-
//
|
|
178
|
-
// says run.
|
|
180
|
+
// Unique-enough placeholder name (microseconds since the epoch); the backend
|
|
181
|
+
// owns final identity.
|
|
179
182
|
function runName(): string {
|
|
180
183
|
return `run-${Date.now() * 1000}`;
|
|
181
184
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// The engines the CLI names by word (`--harness`, an eval run's
|
|
2
|
+
// `<engine>/<model>`, the account's `default_harness`), in one table every
|
|
3
|
+
// reader shares: the flag check, an agent's engine as a flag, the create's
|
|
4
|
+
// engine, the eval target parser, the account's default model and the run
|
|
5
|
+
// header. Typed over the proto's engines, so an engine the proto adds is a
|
|
6
|
+
// compile error here until it has a word, a name and a default-model field.
|
|
7
|
+
|
|
8
|
+
import { Harness } from "@stigmer/apis/ai/stigmer/agentic/session/v1/enum_pb";
|
|
9
|
+
import type { IdentityAccountPreferences } from "@stigmer/apis/ai/stigmer/iam/identityaccount/v1/spec_pb";
|
|
10
|
+
|
|
11
|
+
/** One engine: its proto member, its harness label as a person reads it (docs/vocabulary.md, "Harness"), and the account preference holding its default model. */
|
|
12
|
+
interface EngineEntry {
|
|
13
|
+
readonly harness: Exclude<Harness, Harness.UNSPECIFIED>;
|
|
14
|
+
readonly label: string;
|
|
15
|
+
readonly accountModel: keyof IdentityAccountPreferences;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Every engine by the word the CLI takes, in proto order. */
|
|
19
|
+
export const ENGINES = {
|
|
20
|
+
stigmer: { harness: Harness.STIGMER, label: "Stigmer", accountModel: "defaultStigmerModel" },
|
|
21
|
+
claude: { harness: Harness.CLAUDE, label: "Claude Agent", accountModel: "defaultClaudeModel" },
|
|
22
|
+
} as const satisfies Record<string, EngineEntry>;
|
|
23
|
+
|
|
24
|
+
/** An engine's word: `stigmer` or `claude`. */
|
|
25
|
+
export type EngineWord = keyof typeof ENGINES;
|
|
26
|
+
|
|
27
|
+
/** The engine words, in proto order. */
|
|
28
|
+
export const ENGINE_WORDS = Object.keys(ENGINES) as EngineWord[];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A word as help and refusals show it, beside its label only where the two
|
|
32
|
+
* differ: `"stigmer"`, `"claude" (Claude Agent)`. A word is the first word of
|
|
33
|
+
* its label, in lower case (docs/vocabulary.md, "Harness"), so the two differ
|
|
34
|
+
* where the label says more.
|
|
35
|
+
*/
|
|
36
|
+
export function engineChoice(word: EngineWord): string {
|
|
37
|
+
const label = ENGINES[word].label;
|
|
38
|
+
return label.toLowerCase() === word ? `"${word}"` : `"${word}" (${label})`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** The words with their labels, joined for help and refusals: `"stigmer" or "claude" (Claude Agent)`. */
|
|
42
|
+
export const ENGINE_WORD_LIST = `${ENGINE_WORDS.slice(0, -1).map(engineChoice).join(", ")} or ${engineChoice(ENGINE_WORDS.at(-1)!)}`;
|
|
43
|
+
|
|
44
|
+
const WORD_BY_HARNESS: Readonly<Record<Exclude<Harness, Harness.UNSPECIFIED>, EngineWord>> = {
|
|
45
|
+
[Harness.STIGMER]: "stigmer",
|
|
46
|
+
[Harness.CLAUDE]: "claude",
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/** Whether `word` names an engine. */
|
|
50
|
+
export function isEngineWord(word: string): word is EngineWord {
|
|
51
|
+
return Object.hasOwn(ENGINES, word);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** The word of a proto engine, "" for unspecified or a number this build does not name. */
|
|
55
|
+
export function engineWordOf(harness: Harness | undefined): EngineWord | "" {
|
|
56
|
+
return harness === undefined ? "" : ((WORD_BY_HARNESS as Partial<Record<Harness, EngineWord>>)[harness] ?? "");
|
|
57
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// The Environment a new conversation runs in, from
|
|
2
|
+
// `stigmer run --environment <ref>`.
|
|
3
|
+
//
|
|
4
|
+
// An Environment is the packages and the network access of the sandbox a
|
|
5
|
+
// conversation runs in. Naming one is the conversation's own choice, which
|
|
6
|
+
// wins over its agent's default and its organization's; naming none leaves
|
|
7
|
+
// those to apply. The reference resolves by the one rule every run flag
|
|
8
|
+
// naming resources shares (references.ts). Whether an Environment applies on
|
|
9
|
+
// the server at all is the server's to say: a conversation that runs on the
|
|
10
|
+
// person's own machine, or on a server that starts no sandboxes, is refused
|
|
11
|
+
// with the server's own sentence, so nothing is judged here.
|
|
12
|
+
|
|
13
|
+
import { ApiResourceKind } from "@stigmer/apis/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
14
|
+
import type { ApiResourceReference } from "@stigmer/apis/ai/stigmer/commons/apiresource/io_pb";
|
|
15
|
+
import type { Stigmer } from "@stigmer/client";
|
|
16
|
+
import { resolveRunReferences } from "./references.js";
|
|
17
|
+
|
|
18
|
+
/** The Environment reads an id lookup needs, injectable for tests. */
|
|
19
|
+
export type EnvironmentReader = Pick<Stigmer, "environment">;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Resolve the `--environment` reference to the reference the conversation
|
|
23
|
+
* stores, or undefined when the flag was not given. A malformed reference is
|
|
24
|
+
* a usage error.
|
|
25
|
+
*/
|
|
26
|
+
export async function resolveRunEnvironment(
|
|
27
|
+
client: EnvironmentReader,
|
|
28
|
+
ref: string,
|
|
29
|
+
org: string,
|
|
30
|
+
): Promise<ApiResourceReference | undefined> {
|
|
31
|
+
if (ref === "") return undefined;
|
|
32
|
+
const [resolved] = await resolveRunReferences(
|
|
33
|
+
{
|
|
34
|
+
flag: "--environment",
|
|
35
|
+
noun: "environment",
|
|
36
|
+
kind: ApiResourceKind.environment,
|
|
37
|
+
get: (id) => client.environment.get(id),
|
|
38
|
+
},
|
|
39
|
+
[ref],
|
|
40
|
+
org,
|
|
41
|
+
);
|
|
42
|
+
return resolved;
|
|
43
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
// The post-stream epilogue, shared by every renderer
|
|
2
|
-
// run_display_summary.go). After the stream ends we fetch the authoritative final
|
|
1
|
+
// The post-stream epilogue, shared by every renderer. After the stream ends we fetch the authoritative final
|
|
3
2
|
// run and its usage report, then print a compact, copy-paste-friendly exit
|
|
4
3
|
// summary to stderr (AI content already went to stdout). A completed turn
|
|
5
4
|
// names its duration and its tokens, never a price; tokens counted from the
|
|
@@ -17,7 +16,7 @@ import { RunPhase } from "@stigmer/apis/ai/stigmer/agentic/run/v1/enum_pb";
|
|
|
17
16
|
import type { Run } from "@stigmer/apis/ai/stigmer/agentic/run/v1/api_pb";
|
|
18
17
|
import { GetRunUsageReportInputSchema } from "@stigmer/apis/ai/stigmer/agentic/run/v1/io_pb";
|
|
19
18
|
import type { UsageReportAggregate } from "@stigmer/apis/ai/stigmer/agentic/run/v1/usage_pb";
|
|
20
|
-
import { foldSession, turnOf, type Stigmer, type NoteItem, type Turn, type TurnItem } from "@stigmer/client";
|
|
19
|
+
import { foldSession, formatElapsed, turnOf, type Stigmer, type NoteItem, type Turn, type TurnItem } from "@stigmer/client";
|
|
21
20
|
import { CliExitError, ExitCode } from "../../errors/index.js";
|
|
22
21
|
import { shouldColorize, styler } from "../../output/style.js";
|
|
23
22
|
import { formatTokenCount } from "../run-format.js";
|
|
@@ -27,7 +26,7 @@ import type { HeadlessResult } from "../stream/headless.js";
|
|
|
27
26
|
|
|
28
27
|
/**
|
|
29
28
|
* Fetch the final run + usage and print the exit summary. Returns the
|
|
30
|
-
* final run so the caller can act on its
|
|
29
|
+
* final run so the caller can act on its outputs (e.g. --download).
|
|
31
30
|
*/
|
|
32
31
|
export async function runEpilogue(
|
|
33
32
|
client: Stigmer,
|
|
@@ -35,7 +34,7 @@ export async function runEpilogue(
|
|
|
35
34
|
runId: string,
|
|
36
35
|
result: HeadlessResult,
|
|
37
36
|
): Promise<Run> {
|
|
38
|
-
// A stream error before any phase is a hard failure
|
|
37
|
+
// A stream error before any phase is a hard failure.
|
|
39
38
|
if (result.error !== "" && result.phase === "") {
|
|
40
39
|
throw new CliExitError(result.error, ExitCode.General);
|
|
41
40
|
}
|
|
@@ -72,8 +71,7 @@ async function fetchUsage(client: Stigmer, runId: string): Promise<UsageReportAg
|
|
|
72
71
|
type Styler = ReturnType<typeof styler>;
|
|
73
72
|
type Write = (line: string) => void;
|
|
74
73
|
|
|
75
|
-
// Compact session summary + a copy-paste resume command.
|
|
76
|
-
// displaySessionExitLine + sessionResumeVerb.
|
|
74
|
+
// Compact session summary + a copy-paste resume command.
|
|
77
75
|
async function printSessionExit(
|
|
78
76
|
write: Write,
|
|
79
77
|
s: Styler,
|
|
@@ -99,6 +97,11 @@ async function printSessionExit(
|
|
|
99
97
|
case RunPhase.RUN_TERMINATED:
|
|
100
98
|
write(s.yellow(`Stopped: ${await failure()}`));
|
|
101
99
|
break;
|
|
100
|
+
case RunPhase.RUN_PENDING:
|
|
101
|
+
case RunPhase.RUN_IN_PROGRESS:
|
|
102
|
+
// Left while the turn works: leaving is not stopping.
|
|
103
|
+
write(s.yellow(`Left the session. The agent keeps working (${formatAgentPhase(phase)}).`));
|
|
104
|
+
break;
|
|
102
105
|
default:
|
|
103
106
|
write(s.yellow(`Exited (${formatAgentPhase(phase)})`));
|
|
104
107
|
}
|
|
@@ -107,8 +110,8 @@ async function printSessionExit(
|
|
|
107
110
|
write(` ${resumeVerb(phase)} stigmer resume ${sessionId}`);
|
|
108
111
|
}
|
|
109
112
|
|
|
110
|
-
// Non-session completion (rare for run; e.g. a degraded backend)
|
|
111
|
-
//
|
|
113
|
+
// Non-session completion (rare for run; e.g. a degraded backend): the phase
|
|
114
|
+
// and, on failure, why.
|
|
112
115
|
async function printCompletion(write: Write, s: Styler, exec: Run, failure: () => Promise<string>): Promise<void> {
|
|
113
116
|
const phase = exec.status?.phase ?? RunPhase.RUN_PHASE_UNSPECIFIED;
|
|
114
117
|
if (phase === RunPhase.RUN_FAILED) {
|
|
@@ -139,6 +142,9 @@ function resumeVerb(phase: RunPhase): string {
|
|
|
139
142
|
return "To continue:";
|
|
140
143
|
case RunPhase.RUN_FAILED:
|
|
141
144
|
return "To retry: ";
|
|
145
|
+
case RunPhase.RUN_PENDING:
|
|
146
|
+
case RunPhase.RUN_IN_PROGRESS:
|
|
147
|
+
return "To come back:";
|
|
142
148
|
default:
|
|
143
149
|
return "To resume: ";
|
|
144
150
|
}
|
|
@@ -185,16 +191,11 @@ function firstFailedOutput(items: readonly TurnItem[]): string | undefined {
|
|
|
185
191
|
|
|
186
192
|
const GENERIC_FAILURE = "Run failed (error details unavailable — check run logs)";
|
|
187
193
|
|
|
188
|
-
// "
|
|
189
|
-
//
|
|
194
|
+
// "1m 23s"/"45s" between two RFC3339 timestamps, in the shared format
|
|
195
|
+
// (`formatElapsed`), or "" when either is unknown.
|
|
190
196
|
function formatDuration(startedAt: string, completedAt: string): string {
|
|
191
|
-
if (startedAt === "" || completedAt === "") return "";
|
|
192
197
|
const start = Date.parse(startedAt);
|
|
193
198
|
const end = Date.parse(completedAt);
|
|
194
199
|
if (Number.isNaN(start) || Number.isNaN(end) || end < start) return "";
|
|
195
|
-
|
|
196
|
-
if (totalSeconds < 60) return `${totalSeconds}s`;
|
|
197
|
-
const minutes = Math.floor(totalSeconds / 60);
|
|
198
|
-
const seconds = totalSeconds % 60;
|
|
199
|
-
return seconds === 0 ? `${minutes}m` : `${minutes}m${seconds}s`;
|
|
200
|
+
return formatElapsed(end - start);
|
|
200
201
|
}
|