@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/resources/run/stream.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/resources/run/stream.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gDAAgD,CAAC;AAE1E,OAAO,EAA8B,KAAK,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEtF,OAAO,EAAgB,QAAQ,EAAE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AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,QAAQ,CAG/C;AAED,uGAAuG;AACvG,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAGzC;AAUD,4GAA4G;AAC5G,wBAAsB,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1H;AA4BD,wBAAsB,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAOvG;AAkBD;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,GACnB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAMjF"}
|
package/resources/run/stream.js
CHANGED
|
@@ -9,7 +9,26 @@
|
|
|
9
9
|
// headless paths share one driver (runHeadlessStream) over the SDK's
|
|
10
10
|
// followSession, folded by SessionLog; asks are answered through the
|
|
11
11
|
// session's confirmToolUse / grantPermission.
|
|
12
|
-
|
|
12
|
+
//
|
|
13
|
+
// How it ends (the CLI's rule, client-apps/AGENTS.md):
|
|
14
|
+
// - Off a terminal and with -o json the stream returns when the run's turn
|
|
15
|
+
// ends. On a terminal the view stays a conversation until the person
|
|
16
|
+
// leaves (`until: "exit"`), or returns when the run's turn ends
|
|
17
|
+
// (`until: "turn"`).
|
|
18
|
+
// - `downloadDir` saves each turn's outputs as that turn ends: in the view
|
|
19
|
+
// for every turn seen ending (and the run this command started, even when
|
|
20
|
+
// it ended before the view loaded), told as a note in the thread; headless,
|
|
21
|
+
// the one turn, once it ends.
|
|
22
|
+
// - The returned Run is the session's newest turn, the one the exit summary
|
|
23
|
+
// reports, and `exitByTurn` turns its phase into the exit code through the
|
|
24
|
+
// shared table (`exitCodeOf`): 0 completed; 1 failed, cancelled or
|
|
25
|
+
// stopped; 130 when the person left while it still works.
|
|
26
|
+
import { RunPhase } from "@stigmer/apis/ai/stigmer/agentic/run/v1/enum_pb";
|
|
27
|
+
import { followSession, turnPhaseOf } from "@stigmer/client";
|
|
28
|
+
import { exitCodeOf } from "@stigmer/client/node";
|
|
29
|
+
import { CliExitError, ExitCode } from "../../errors/index.js";
|
|
30
|
+
import { downloadRunOutputs } from "../download.js";
|
|
31
|
+
import { listRunsBySession } from "../session.js";
|
|
13
32
|
import { runEpilogue } from "./epilogue.js";
|
|
14
33
|
import { renderSessionHeader } from "./header.js";
|
|
15
34
|
import { submitAnswer } from "../stream/answer.js";
|
|
@@ -19,22 +38,58 @@ import { PlaintextRenderer } from "../stream/render-plaintext.js";
|
|
|
19
38
|
import { isInkSupported } from "../stream/tty.js";
|
|
20
39
|
/**
|
|
21
40
|
* Stream the run to its end, then run the epilogue. Returns the
|
|
22
|
-
* authoritative final run (for
|
|
41
|
+
* authoritative final run (for downloading its outputs).
|
|
23
42
|
*/
|
|
24
43
|
export async function streamAgentRun(deps) {
|
|
25
44
|
if (deps.outputMode === "json") {
|
|
26
45
|
renderSessionHeader(process.stderr, deps.header);
|
|
27
46
|
const result = await runHeadless(deps, new NdjsonRenderer({ data: process.stdout, status: process.stderr }));
|
|
28
|
-
return runEpilogue(deps.client, deps.sessionId, deps.runId, result);
|
|
47
|
+
return downloadHeadless(deps, await runEpilogue(deps.client, deps.sessionId, deps.runId, result));
|
|
29
48
|
}
|
|
30
49
|
if (isInkSupported(process.stdout)) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
50
|
+
deps.clearProgress?.();
|
|
51
|
+
const { actionFailed } = await runInk(deps);
|
|
52
|
+
// Ink owns the live view; the epilogue still prints the exit summary, of
|
|
53
|
+
// the session's newest turn: the person may have sent follow-ups since
|
|
54
|
+
// the run this command started (stigmer#2781).
|
|
55
|
+
const runId = await newestRunId(deps.client, deps.sessionId, deps.runId);
|
|
56
|
+
const newest = await runEpilogue(deps.client, deps.sessionId, runId, { phase: "", error: "", turn: undefined });
|
|
57
|
+
// A save the view could not make fails the command, as a failed download off a terminal does.
|
|
58
|
+
if (actionFailed)
|
|
59
|
+
throw new CliExitError("some turn's outputs were not saved (the session says which)", ExitCode.General);
|
|
60
|
+
return newest;
|
|
34
61
|
}
|
|
35
62
|
renderSessionHeader(process.stderr, deps.header);
|
|
36
63
|
const result = await runHeadless(deps, new PlaintextRenderer({ data: process.stdout, status: process.stderr }));
|
|
37
|
-
return runEpilogue(deps.client, deps.sessionId, deps.runId, result);
|
|
64
|
+
return downloadHeadless(deps, await runEpilogue(deps.client, deps.sessionId, deps.runId, result));
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The exit code for how a run's turn ended, from the shared table: 0
|
|
68
|
+
* completed; 1 failed, cancelled or stopped; 130 still working (the person
|
|
69
|
+
* left first). A run whose phase is unknown exits 1.
|
|
70
|
+
*/
|
|
71
|
+
export function turnExitCode(run) {
|
|
72
|
+
const phase = turnPhaseOf(run.status?.phase ?? RunPhase.RUN_PHASE_UNSPECIFIED);
|
|
73
|
+
return phase === undefined ? ExitCode.General : exitCodeOf({ phase });
|
|
74
|
+
}
|
|
75
|
+
/** Exit by the turn's code (`turnExitCode`): silently, since the summary already said how it ended. */
|
|
76
|
+
export function exitByTurn(run) {
|
|
77
|
+
const code = turnExitCode(run);
|
|
78
|
+
if (code !== ExitCode.Success)
|
|
79
|
+
throw new CliExitError("", code);
|
|
80
|
+
}
|
|
81
|
+
// Off a terminal the stream returned at the turn's end: save its outputs now.
|
|
82
|
+
async function downloadHeadless(deps, run) {
|
|
83
|
+
if ((deps.downloadDir ?? "") !== "") {
|
|
84
|
+
await saveTurnOutputs(deps.client, run.metadata?.id ?? "", deps.downloadDir ?? "", deps.progress);
|
|
85
|
+
}
|
|
86
|
+
return run;
|
|
87
|
+
}
|
|
88
|
+
/** Save one turn's outputs under `outputDir`, saying so through `say`; a turn that saved none says that. */
|
|
89
|
+
export async function saveTurnOutputs(client, runId, outputDir, say) {
|
|
90
|
+
const outcome = await downloadRunOutputs(client, runId, { outputPath: "", outputDir }, say);
|
|
91
|
+
if (outcome.noOutputs)
|
|
92
|
+
say?.("No outputs saved in this turn.");
|
|
38
93
|
}
|
|
39
94
|
// Drive a headless renderer over the session's log, with Ctrl-C wired to stop
|
|
40
95
|
// the follow cleanly (the driver treats an aborted signal as a clean exit and
|
|
@@ -60,15 +115,44 @@ async function runHeadless(deps, renderer) {
|
|
|
60
115
|
process.removeListener("SIGTERM", onSignal);
|
|
61
116
|
}
|
|
62
117
|
}
|
|
118
|
+
// The session's newest run, or `fallback` when the list cannot be read.
|
|
119
|
+
export async function newestRunId(client, sessionId, fallback) {
|
|
120
|
+
try {
|
|
121
|
+
const runs = await listRunsBySession(client, sessionId);
|
|
122
|
+
return runs[0]?.metadata?.id || fallback;
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
return fallback;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
63
128
|
// Lazily import the Ink renderer so React/Ink load only on the interactive path
|
|
64
129
|
// (non-streaming commands and --help never pay for them).
|
|
65
130
|
async function runInk(deps) {
|
|
66
131
|
const { runInkSession } = await import("../stream/ink.js");
|
|
67
|
-
|
|
132
|
+
return runInkSession({
|
|
68
133
|
client: deps.client,
|
|
69
134
|
sessionId: deps.sessionId,
|
|
70
135
|
org: deps.org,
|
|
71
136
|
mode: deps.mode === "plan" ? "plan" : "agent",
|
|
137
|
+
workspaceRoots: deps.workspaceRoots,
|
|
138
|
+
until: deps.until ?? "exit",
|
|
139
|
+
watchRunId: deps.runId,
|
|
140
|
+
afterTurn: turnDownloader(deps.client, deps.downloadDir ?? "", deps.runId),
|
|
72
141
|
});
|
|
73
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* The view's per-turn action under `--download`: save each turn's outputs as
|
|
145
|
+
* it ends, the turns that had ended before the view loaded left alone, except
|
|
146
|
+
* the run this command started (it may end before the view loads). None
|
|
147
|
+
* without a directory.
|
|
148
|
+
*/
|
|
149
|
+
export function turnDownloader(client, outputDir, startedRunId) {
|
|
150
|
+
if (outputDir === "")
|
|
151
|
+
return undefined;
|
|
152
|
+
return async (turn, atLoad, say) => {
|
|
153
|
+
if (atLoad && turn.runId !== startedRunId)
|
|
154
|
+
return;
|
|
155
|
+
await saveTurnOutputs(client, turn.runId, outputDir, say);
|
|
156
|
+
};
|
|
157
|
+
}
|
|
74
158
|
//# sourceMappingURL=stream.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/resources/run/stream.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,2BAA2B;AAC3B,EAAE;AACF,4FAA4F;AAC5F,sEAAsE;AACtE,+EAA+E;AAC/E,EAAE;AACF,2EAA2E;AAC3E,qEAAqE;AACrE,qEAAqE;AACrE,8CAA8C;
|
|
1
|
+
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/resources/run/stream.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,2BAA2B;AAC3B,EAAE;AACF,4FAA4F;AAC5F,sEAAsE;AACtE,+EAA+E;AAC/E,EAAE;AACF,2EAA2E;AAC3E,qEAAqE;AACrE,qEAAqE;AACrE,8CAA8C;AAC9C,EAAE;AACF,uDAAuD;AACvD,2EAA2E;AAC3E,uEAAuE;AACvE,kEAAkE;AAClE,uBAAuB;AACvB,2EAA2E;AAC3E,4EAA4E;AAC5E,8EAA8E;AAC9E,gCAAgC;AAChC,4EAA4E;AAC5E,6EAA6E;AAC7E,qEAAqE;AACrE,4DAA4D;AAG5D,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,EAAE,aAAa,EA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AC;IAC3D,OAAO,aAAa,CAAC;QACnB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;QAC7C,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,MAAM;QAC3B,UAAU,EAAE,IAAI,CAAC,KAAK;QACtB,SAAS,EAAE,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,IAAI,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC;KAC3E,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAe,EACf,SAAiB,EACjB,YAAoB;IAEpB,IAAI,SAAS,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IACvC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;QACjC,IAAI,MAAM,IAAI,IAAI,CAAC,KAAK,KAAK,YAAY;YAAE,OAAO;QAClD,MAAM,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;IAC5D,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type SessionResource } from "@stigmer/apis/ai/stigmer/agentic/session/v1/resource_pb";
|
|
2
2
|
/**
|
|
3
|
-
* Convert `--workspace`/`--branch`/`--commit` flags into
|
|
4
|
-
* Returns an empty list when no workspace is
|
|
5
|
-
*
|
|
6
|
-
* branch/commit and duplicate-name detection.
|
|
3
|
+
* Convert `--workspace`/`--branch`/`--commit` flags into the conversation's
|
|
4
|
+
* repository and folder resources. Returns an empty list when no workspace is
|
|
5
|
+
* requested. Enforces the single-git-workspace rule for branch/commit and duplicate-name detection.
|
|
7
6
|
*/
|
|
8
|
-
export declare function
|
|
7
|
+
export declare function parseWorkspaceResources(workspaces: readonly string[], branch: string, commit: string): SessionResource[];
|
|
9
8
|
/**
|
|
10
|
-
* The absolute paths of any local (non-git) workspace roots.
|
|
11
|
-
*
|
|
12
|
-
* upload) versus an upload.
|
|
9
|
+
* The absolute paths of any local (non-git) workspace roots. `--attach`
|
|
10
|
+
* planning uses these to decide whether a file is workspace-relative (no
|
|
11
|
+
* upload) versus an upload.
|
|
13
12
|
*/
|
|
14
|
-
export declare function localWorkspaceRoots(
|
|
15
|
-
/** The derived display names of the workspace entries, for the session header. */
|
|
16
|
-
export declare function workspaceNames(entries: readonly WorkspaceEntry[]): string[];
|
|
13
|
+
export declare function localWorkspaceRoots(resources: readonly SessionResource[]): string[];
|
|
17
14
|
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/resources/run/workspace.ts"],"names":[],"mappings":"AAYA,OAAO,EAGL,KAAK,
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/resources/run/workspace.ts"],"names":[],"mappings":"AAYA,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,yDAAyD,CAAC;AAGjE;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,eAAe,EAAE,CA4BnB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,EAAE,CAQnF"}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
// Workspace flag parsing for runs.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
// (plus `--branch`/`--commit`) into
|
|
5
|
-
// an HTTPS git
|
|
6
|
-
// rejected). SSH git URLs are rejected with HTTPS guidance, and `--branch`/
|
|
3
|
+
// Turns repeatable `--workspace` values
|
|
4
|
+
// (plus `--branch`/`--commit`) into the conversation's resources. A workspace is
|
|
5
|
+
// either an HTTPS git repository (branch/commit allowed) or a local directory
|
|
6
|
+
// (branch/commit rejected). SSH git URLs are rejected with HTTPS guidance, and `--branch`/
|
|
7
7
|
// `--commit` only apply to a single git workspace.
|
|
8
8
|
import { statSync } from "node:fs";
|
|
9
9
|
import { homedir } from "node:os";
|
|
10
10
|
import { basename, isAbsolute, resolve } from "node:path";
|
|
11
11
|
import { create } from "@bufbuild/protobuf";
|
|
12
|
-
import {
|
|
12
|
+
import { GitRepositoryResourceSchema, LocalPathResourceSchema, SessionResourceSchema, } from "@stigmer/apis/ai/stigmer/agentic/session/v1/resource_pb";
|
|
13
13
|
import { UsageError } from "../../errors/index.js";
|
|
14
14
|
/**
|
|
15
|
-
* Convert `--workspace`/`--branch`/`--commit` flags into
|
|
16
|
-
* Returns an empty list when no workspace is
|
|
17
|
-
*
|
|
18
|
-
* branch/commit and duplicate-name detection.
|
|
15
|
+
* Convert `--workspace`/`--branch`/`--commit` flags into the conversation's
|
|
16
|
+
* repository and folder resources. Returns an empty list when no workspace is
|
|
17
|
+
* requested. Enforces the single-git-workspace rule for branch/commit and duplicate-name detection.
|
|
19
18
|
*/
|
|
20
|
-
export function
|
|
19
|
+
export function parseWorkspaceResources(workspaces, branch, commit) {
|
|
21
20
|
if (workspaces.length === 0) {
|
|
22
21
|
if (branch !== "" || commit !== "") {
|
|
23
22
|
throw new UsageError("--branch and --commit require --workspace");
|
|
@@ -30,7 +29,7 @@ export function parseWorkspaceEntries(workspaces, branch, commit) {
|
|
|
30
29
|
const entries = [];
|
|
31
30
|
const seenNames = new Map(); // derived name -> original value
|
|
32
31
|
for (const ws of workspaces) {
|
|
33
|
-
const
|
|
32
|
+
const resource = parseWorkspaceSource(ws, branch, commit);
|
|
34
33
|
const name = deriveEntryName(ws);
|
|
35
34
|
const prev = seenNames.get(name);
|
|
36
35
|
if (prev !== undefined) {
|
|
@@ -38,29 +37,25 @@ export function parseWorkspaceEntries(workspaces, branch, commit) {
|
|
|
38
37
|
"use distinct directory names or repository URLs");
|
|
39
38
|
}
|
|
40
39
|
seenNames.set(name, ws);
|
|
41
|
-
entries.push(create(
|
|
40
|
+
entries.push(create(SessionResourceSchema, { name, resource }));
|
|
42
41
|
}
|
|
43
42
|
return entries;
|
|
44
43
|
}
|
|
45
44
|
/**
|
|
46
|
-
* The absolute paths of any local (non-git) workspace roots.
|
|
47
|
-
*
|
|
48
|
-
* upload) versus an upload.
|
|
45
|
+
* The absolute paths of any local (non-git) workspace roots. `--attach`
|
|
46
|
+
* planning uses these to decide whether a file is workspace-relative (no
|
|
47
|
+
* upload) versus an upload.
|
|
49
48
|
*/
|
|
50
|
-
export function localWorkspaceRoots(
|
|
49
|
+
export function localWorkspaceRoots(resources) {
|
|
51
50
|
const roots = [];
|
|
52
|
-
for (const entry of
|
|
53
|
-
if (entry.
|
|
54
|
-
roots.push(entry.
|
|
51
|
+
for (const entry of resources) {
|
|
52
|
+
if (entry.resource.case === "localPath") {
|
|
53
|
+
roots.push(entry.resource.value.path);
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
56
|
return roots;
|
|
58
57
|
}
|
|
59
|
-
|
|
60
|
-
export function workspaceNames(entries) {
|
|
61
|
-
return entries.map((entry) => entry.name);
|
|
62
|
-
}
|
|
63
|
-
// Mirrors Go's parseWorkspaceSource: variant selection (git vs local) plus the
|
|
58
|
+
// The resource arm (git vs local) plus the
|
|
64
59
|
// branch/commit applicability rules and SSH rejection.
|
|
65
60
|
function parseWorkspaceSource(workspace, branch, commit) {
|
|
66
61
|
if (isSshGitUrl(workspace)) {
|
|
@@ -68,9 +63,10 @@ function parseWorkspaceSource(workspace, branch, commit) {
|
|
|
68
63
|
"Use HTTPS instead: https://github.com/org/repo");
|
|
69
64
|
}
|
|
70
65
|
if (isGitUrl(workspace)) {
|
|
71
|
-
return
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
return {
|
|
67
|
+
case: "gitRepository",
|
|
68
|
+
value: create(GitRepositoryResourceSchema, { url: workspace, branch, commit }),
|
|
69
|
+
};
|
|
74
70
|
}
|
|
75
71
|
if (branch !== "" || commit !== "") {
|
|
76
72
|
throw new UsageError("--branch and --commit are only valid with git workspace URLs (https://...)");
|
|
@@ -78,7 +74,7 @@ function parseWorkspaceSource(workspace, branch, commit) {
|
|
|
78
74
|
return parseLocalWorkspace(workspace);
|
|
79
75
|
}
|
|
80
76
|
// Resolve a local path, verify it is an existing directory, and wrap it as a
|
|
81
|
-
//
|
|
77
|
+
// local path resource.
|
|
82
78
|
function parseLocalWorkspace(path) {
|
|
83
79
|
const resolved = resolveLocalPath(path);
|
|
84
80
|
let isDir;
|
|
@@ -93,18 +89,16 @@ function parseLocalWorkspace(path) {
|
|
|
93
89
|
}
|
|
94
90
|
if (!isDir)
|
|
95
91
|
throw new UsageError(`workspace path is not a directory: ${resolved}`);
|
|
96
|
-
return create(
|
|
97
|
-
source: { case: "localPath", value: create(LocalPathSourceSchema, { path: resolved }) },
|
|
98
|
-
});
|
|
92
|
+
return { case: "localPath", value: create(LocalPathResourceSchema, { path: resolved }) };
|
|
99
93
|
}
|
|
100
94
|
// A short identity for the entry: the repo name for git URLs, the directory
|
|
101
|
-
// basename for local paths.
|
|
95
|
+
// basename for local paths.
|
|
102
96
|
function deriveEntryName(workspace) {
|
|
103
97
|
if (isGitUrl(workspace))
|
|
104
98
|
return deriveGitRepoName(workspace);
|
|
105
99
|
return deriveLocalDirName(workspace);
|
|
106
100
|
}
|
|
107
|
-
// Last non-empty URL path segment, sans ".git".
|
|
101
|
+
// Last non-empty URL path segment, sans ".git".
|
|
108
102
|
function deriveGitRepoName(rawUrl) {
|
|
109
103
|
let path;
|
|
110
104
|
try {
|
|
@@ -121,8 +115,7 @@ function deriveGitRepoName(rawUrl) {
|
|
|
121
115
|
}
|
|
122
116
|
throw new UsageError(`cannot derive workspace name from URL: ${rawUrl}`);
|
|
123
117
|
}
|
|
124
|
-
// Directory basename of the resolved absolute path.
|
|
125
|
-
// deriveLocalDirName — "." resolves to the CWD basename, not ".".
|
|
118
|
+
// Directory basename of the resolved absolute path — "." resolves to the CWD basename, not ".".
|
|
126
119
|
function deriveLocalDirName(path) {
|
|
127
120
|
const resolved = resolveLocalPath(path);
|
|
128
121
|
const name = basename(resolved);
|
|
@@ -131,7 +124,7 @@ function deriveLocalDirName(path) {
|
|
|
131
124
|
}
|
|
132
125
|
return name;
|
|
133
126
|
}
|
|
134
|
-
// Expand a leading "~/" and make the path absolute.
|
|
127
|
+
// Expand a leading "~/" and make the path absolute.
|
|
135
128
|
function resolveLocalPath(path) {
|
|
136
129
|
let p = path;
|
|
137
130
|
if (p.startsWith("~/"))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/resources/run/workspace.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,EAAE;AACF,
|
|
1
|
+
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/resources/run/workspace.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,EAAE;AACF,wCAAwC;AACxC,iFAAiF;AACjF,8EAA8E;AAC9E,2FAA2F;AAC3F,mDAAmD;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,EAEvB,qBAAqB,GACtB,MAAM,yDAAyD,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,UAAU,u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E,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;IACD,MAAM,IAAI,UAAU,CAAC,0CAA0C,MAAM,EAAE,CAAC,CAAC;AAC3E,CAAC;AAED,gGAAgG;AAChG,SAAS,kBAAkB,CAAC,IAAY;IACtC,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAChC,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;QAChD,MAAM,IAAI,UAAU,CAAC,2CAA2C,IAAI,EAAE,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,oDAAoD;AACpD,SAAS,gBAAgB,CAAC,IAAY;IACpC,IAAI,CAAC,GAAG,IAAI,CAAC;IACb,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,CAAC,GAAG,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3D,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACxC,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS;IACzB,OAAO,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,WAAW,CAAC,CAAS;IAC5B,OAAO,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-approve.d.ts","sourceRoot":"","sources":["../src/resources/run-approve.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-approve.d.ts","sourceRoot":"","sources":["../src/resources/run-approve.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAuB,KAAK,OAAO,EAAgB,MAAM,iBAAiB,CAAC;AAGlF,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAElE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,oEAAoE;IACpE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,0CAA0C;AAC1C,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;CACpC;AAED,kDAAkD;AAClD,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,CAAC,CAQ7G"}
|
package/resources/run-approve.js
CHANGED
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
// class run for the rest of the turn
|
|
14
14
|
//
|
|
15
15
|
// A comment rides only a deny (the contract refuses it on an allow), so a
|
|
16
|
-
// comment with any other action is refused before anything is sent.
|
|
17
|
-
// retired words approve, reject and approve-all are refused with the word that
|
|
18
|
-
// replaced them.
|
|
16
|
+
// comment with any other action is refused before anything is sent.
|
|
19
17
|
import { foldSession, turnOf } from "@stigmer/client";
|
|
20
18
|
import { UsageError } from "../errors/index.js";
|
|
21
19
|
import { listSessionEvents, sessionOfRun } from "./session.js";
|
|
@@ -30,12 +28,6 @@ export async function approveAgentToolCall(client, opts) {
|
|
|
30
28
|
await submitAnswer(client, sessionId, ask.id, answer);
|
|
31
29
|
return { toolUseId: ask.id, toolName: ask.name, answer: answer.kind };
|
|
32
30
|
}
|
|
33
|
-
// The actions `--action` no longer takes, each with the word that replaced it.
|
|
34
|
-
const RETIRED = {
|
|
35
|
-
approve: '"approve" is now "allow"',
|
|
36
|
-
reject: '"reject" is now "deny"',
|
|
37
|
-
"approve-all": '"approve-all" is now "allow-all"',
|
|
38
|
-
};
|
|
39
31
|
function answerOf(action, comment) {
|
|
40
32
|
switch (action) {
|
|
41
33
|
case "deny":
|
|
@@ -47,8 +39,7 @@ function answerOf(action, comment) {
|
|
|
47
39
|
}
|
|
48
40
|
return action === "allow" ? { kind: "allow" } : { kind: "grant" };
|
|
49
41
|
}
|
|
50
|
-
|
|
51
|
-
throw new UsageError(`invalid --action "${action}": ${replaced === undefined ? "" : `${replaced}; `}must be one of: allow, deny, allow-all`);
|
|
42
|
+
throw new UsageError(`invalid --action "${action}": must be one of: allow, deny, allow-all`);
|
|
52
43
|
}
|
|
53
44
|
function pickAsk(runId, asks, toolCallId) {
|
|
54
45
|
if (asks.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-approve.js","sourceRoot":"","sources":["../src/resources/run-approve.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,WAAW;AACX,EAAE;AACF,4EAA4E;AAC5E,mEAAmE;AACnE,6EAA6E;AAC7E,mDAAmD;AACnD,EAAE;AACF,uCAAuC;AACvC,0EAA0E;AAC1E,6BAA6B;AAC7B,0EAA0E;AAC1E,oDAAoD;AACpD,EAAE;AACF,0EAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"run-approve.js","sourceRoot":"","sources":["../src/resources/run-approve.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,WAAW;AACX,EAAE;AACF,4EAA4E;AAC5E,mEAAmE;AACnE,6EAA6E;AAC7E,mDAAmD;AACnD,EAAE;AACF,uCAAuC;AACvC,0EAA0E;AAC1E,6BAA6B;AAC7B,0EAA0E;AAC1E,oDAAoD;AACpD,EAAE;AACF,0EAA0E;AAC1E,oEAAoE;AAEpE,OAAO,EAA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,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -10,10 +10,10 @@ export interface CancelResult extends ControlResult {
|
|
|
10
10
|
}
|
|
11
11
|
/** Cancel a run: interrupt its session, stopping every unfinished turn of it. */
|
|
12
12
|
export declare function cancelRun(client: Stigmer, id: string): Promise<CancelResult>;
|
|
13
|
-
/** Force-stop a run immediately.
|
|
13
|
+
/** Force-stop a run immediately. */
|
|
14
14
|
export declare function terminateRun(client: Stigmer, id: string, reason: string): Promise<ControlResult>;
|
|
15
|
-
/** Pause a run in progress.
|
|
15
|
+
/** Pause a run in progress. */
|
|
16
16
|
export declare function pauseRun(client: Stigmer, id: string, reason: string): Promise<ControlResult>;
|
|
17
|
-
/** Resume a paused run
|
|
17
|
+
/** Resume a paused run (no reason). */
|
|
18
18
|
export declare function resumeRun(client: Stigmer, id: string): Promise<ControlResult>;
|
|
19
19
|
//# sourceMappingURL=run-control.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-control.d.ts","sourceRoot":"","sources":["../src/resources/run-control.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-control.d.ts","sourceRoot":"","sources":["../src/resources/run-control.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG/C,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,2FAA2F;AAC3F,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C;AAED,iFAAiF;AACjF,wBAAsB,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAGlF;AAED,oCAAoC;AACpC,wBAAsB,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAEtG;AAED,+BAA+B;AAC/B,wBAAsB,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAElG;AAED,uCAAuC;AACvC,wBAAsB,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAEnF"}
|
package/resources/run-control.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Lifecycle control for runs (cancel / terminate / pause / resume).
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
// each verb returns the resulting phase as a human label, read back from the
|
|
3
|
+
// Each verb returns the resulting phase as a human label, read back from the
|
|
5
4
|
// server so the success line reports the authoritative post-mutation state.
|
|
6
5
|
// terminate, pause and resume issue the run controller RPC. cancel
|
|
7
6
|
// interrupts the run's session (runs.ts `cancelAgentRun`): every unfinished
|
|
@@ -19,15 +18,15 @@ export async function cancelRun(client, id) {
|
|
|
19
18
|
const { run, wasAlreadyTerminal, stoppedRunIds } = await cancelAgentRun(client, id);
|
|
20
19
|
return { ...toResult(run), wasAlreadyTerminal, stoppedRunIds };
|
|
21
20
|
}
|
|
22
|
-
/** Force-stop a run immediately.
|
|
21
|
+
/** Force-stop a run immediately. */
|
|
23
22
|
export async function terminateRun(client, id, reason) {
|
|
24
23
|
return toResult(await client.run.terminate(create(TerminateRunInputSchema, { id, reason })));
|
|
25
24
|
}
|
|
26
|
-
/** Pause a run in progress.
|
|
25
|
+
/** Pause a run in progress. */
|
|
27
26
|
export async function pauseRun(client, id, reason) {
|
|
28
27
|
return toResult(await client.run.pause(create(PauseRunInputSchema, { id, reason })));
|
|
29
28
|
}
|
|
30
|
-
/** Resume a paused run
|
|
29
|
+
/** Resume a paused run (no reason). */
|
|
31
30
|
export async function resumeRun(client, id) {
|
|
32
31
|
return toResult(await client.run.resume(create(ResumeRunInputSchema, { id })));
|
|
33
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-control.js","sourceRoot":"","sources":["../src/resources/run-control.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF
|
|
1
|
+
{"version":3,"file":"run-control.js","sourceRoot":"","sources":["../src/resources/run-control.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,6EAA6E;AAC7E,4EAA4E;AAC5E,mEAAmE;AACnE,4EAA4E;AAC5E,2EAA2E;AAC3E,2DAA2D;AAC3D,EAAE;AACF,8EAA8E;AAC9E,kEAAkE;AAElE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,+CAA+C,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAa7D,iFAAiF;AACjF,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,MAAe,EAAE,EAAU;IACzD,MAAM,EAAE,GAAG,EAAE,kBAAkB,EAAE,aAAa,EAAE,GAAG,MAAM,cAAc,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACpF,OAAO,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,EAAE,kBAAkB,EAAE,aAAa,EAAE,CAAC;AACjE,CAAC;AAED,oCAAoC;AACpC,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAAe,EAAE,EAAU,EAAE,MAAc;IAC5E,OAAO,QAAQ,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,uBAAuB,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;AAC/F,CAAC;AAED,+BAA+B;AAC/B,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,MAAe,EAAE,EAAU,EAAE,MAAc;IACxE,OAAO,QAAQ,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,mBAAmB,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;AACvF,CAAC;AAED,uCAAuC;AACvC,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,MAAe,EAAE,EAAU;IACzD,OAAO,QAAQ,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AACjF,CAAC;AAED,SAAS,QAAQ,CAAC,GAAQ;IACxB,OAAO,EAAE,KAAK,EAAE,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,IAAI,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAAC;AAC1F,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Human duration between two ISO 8601 timestamps
|
|
2
|
+
* Human duration between two ISO 8601 timestamps:
|
|
3
3
|
* "-" when either bound is missing/unparseable, "<n>s" under a minute,
|
|
4
4
|
* "<m>m <s>s" under an hour, "<h>h <m>m" otherwise.
|
|
5
5
|
*/
|
|
6
6
|
export declare function calculateDuration(start: string, end: string): string;
|
|
7
|
-
/** Truncate to `maxLen`, appending "..." when cut.
|
|
7
|
+
/** Truncate to `maxLen`, appending "..." when cut. */
|
|
8
8
|
export declare function truncateWithEllipsis(value: string, maxLen: number): string;
|
|
9
9
|
/**
|
|
10
10
|
* Compact token count: the integer under a thousand, then one decimal with a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-format.d.ts","sourceRoot":"","sources":["../src/resources/run-format.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-format.d.ts","sourceRoot":"","sources":["../src/resources/run-format.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAUpE;AAED,sDAAsD;AACtD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAI1E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMtD"}
|
package/resources/run-format.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
// Shared, presentation-only formatters for run output.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
// math, ellipsis truncation) and add the compact token count the usage
|
|
3
|
+
// Duration math, ellipsis truncation, and the compact token count the usage
|
|
5
4
|
// reports and the run epilogue share. They live here, away from any RPC code,
|
|
6
5
|
// so run output formats durations, tokens and truncated text the same way
|
|
7
6
|
// everywhere.
|
|
8
7
|
/**
|
|
9
|
-
* Human duration between two ISO 8601 timestamps
|
|
8
|
+
* Human duration between two ISO 8601 timestamps:
|
|
10
9
|
* "-" when either bound is missing/unparseable, "<n>s" under a minute,
|
|
11
10
|
* "<m>m <s>s" under an hour, "<h>h <m>m" otherwise.
|
|
12
11
|
*/
|
|
@@ -24,7 +23,7 @@ export function calculateDuration(start, end) {
|
|
|
24
23
|
return `${Math.floor(totalSeconds / 60)}m ${totalSeconds % 60}s`;
|
|
25
24
|
return `${Math.floor(totalSeconds / 3600)}h ${Math.floor((totalSeconds % 3600) / 60)}m`;
|
|
26
25
|
}
|
|
27
|
-
/** Truncate to `maxLen`, appending "..." when cut.
|
|
26
|
+
/** Truncate to `maxLen`, appending "..." when cut. */
|
|
28
27
|
export function truncateWithEllipsis(value, maxLen) {
|
|
29
28
|
if (value.length <= maxLen)
|
|
30
29
|
return value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-format.js","sourceRoot":"","sources":["../src/resources/run-format.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,EAAE;AACF,
|
|
1
|
+
{"version":3,"file":"run-format.js","sourceRoot":"","sources":["../src/resources/run-format.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,0EAA0E;AAC1E,cAAc;AAEd;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa,EAAE,GAAW;IAC1D,IAAI,KAAK,KAAK,EAAE,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,GAAG,CAAC;IAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAClC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC;IAE7D,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IAC1D,IAAI,YAAY,GAAG,EAAE;QAAE,OAAO,GAAG,YAAY,GAAG,CAAC;IACjD,IAAI,YAAY,GAAG,IAAI;QAAE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,EAAE,CAAC,KAAK,YAAY,GAAG,EAAE,GAAG,CAAC;IAC1F,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC;AAC1F,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,oBAAoB,CAAC,KAAa,EAAE,MAAc;IAChE,IAAI,KAAK,CAAC,MAAM,IAAI,MAAM;QAAE,OAAO,KAAK,CAAC;IACzC,IAAI,MAAM,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/C,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC;AAC5C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACxB,IAAI,CAAC,GAAG,IAAI;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACnC,uEAAuE;IACvE,IAAI,CAAC,GAAG,OAAO;QAAE,OAAO,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;IACpD,OAAO,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;AAC1C,CAAC"}
|
package/resources/run-logs.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { type Stigmer } from "@stigmer/client";
|
|
|
2
2
|
export interface LogsOptions {
|
|
3
3
|
readonly runId: string;
|
|
4
4
|
readonly follow: boolean;
|
|
5
|
+
/** One Managed Agents JSON object per event (`-o json`), as `run --json` writes them; no end line. */
|
|
6
|
+
readonly ndjson?: boolean;
|
|
5
7
|
}
|
|
6
8
|
/** Where rendered log lines go. */
|
|
7
9
|
export interface LineSink {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-logs.d.ts","sourceRoot":"","sources":["../src/resources/run-logs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-logs.d.ts","sourceRoot":"","sources":["../src/resources/run-logs.ts"],"names":[],"mappings":"AAuBA,OAAO,EAA0D,KAAK,OAAO,EAAa,MAAM,iBAAiB,CAAC;AAOlH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,sGAAsG;IACtG,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,mCAAmC;AACnC,MAAM,WAAW,QAAQ;IACvB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,4CAA4C;AAC5C,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED,wEAAwE;AACxE,wBAAsB,aAAa,CACjC,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,WAAW,EACnB,OAAO,GAAE,WAA8B,GACtC,OAAO,CAAC,IAAI,CAAC,CAkCf"}
|