@stigmer/cli 0.1.0-dev.20261017020314.g644422724c27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +194 -0
- package/README.md +45 -0
- package/auth/auth0.d.ts +19 -0
- package/auth/auth0.d.ts.map +1 -0
- package/auth/auth0.js +39 -0
- package/auth/auth0.js.map +1 -0
- package/auth/callback-server.d.ts +18 -0
- package/auth/callback-server.d.ts.map +1 -0
- package/auth/callback-server.js +77 -0
- package/auth/callback-server.js.map +1 -0
- package/auth/index.d.ts +5 -0
- package/auth/index.d.ts.map +1 -0
- package/auth/index.js +6 -0
- package/auth/index.js.map +1 -0
- package/auth/login.d.ts +2 -0
- package/auth/login.d.ts.map +1 -0
- package/auth/login.js +81 -0
- package/auth/login.js.map +1 -0
- package/auth/pages.d.ts +7 -0
- package/auth/pages.d.ts.map +1 -0
- package/auth/pages.js +21 -0
- package/auth/pages.js.map +1 -0
- package/auth/pkce.d.ts +7 -0
- package/auth/pkce.d.ts.map +1 -0
- package/auth/pkce.js +22 -0
- package/auth/pkce.js.map +1 -0
- package/auth/token.d.ts +38 -0
- package/auth/token.d.ts.map +1 -0
- package/auth/token.js +120 -0
- package/auth/token.js.map +1 -0
- package/backend.d.ts +5 -0
- package/backend.d.ts.map +1 -0
- package/backend.js +14 -0
- package/backend.js.map +1 -0
- package/cli/stigmer.d.ts +3 -0
- package/cli/stigmer.d.ts.map +1 -0
- package/cli/stigmer.js +14 -0
- package/cli/stigmer.js.map +1 -0
- package/client/client.d.ts +44 -0
- package/client/client.d.ts.map +1 -0
- package/client/client.js +82 -0
- package/client/client.js.map +1 -0
- package/client/index.d.ts +2 -0
- package/client/index.d.ts.map +1 -0
- package/client/index.js +3 -0
- package/client/index.js.map +1 -0
- package/client/organizations.d.ts +41 -0
- package/client/organizations.d.ts.map +1 -0
- package/client/organizations.js +86 -0
- package/client/organizations.js.map +1 -0
- package/client/single-org.d.ts +16 -0
- package/client/single-org.d.ts.map +1 -0
- package/client/single-org.js +35 -0
- package/client/single-org.js.map +1 -0
- package/commands/access-history/index.d.ts +3 -0
- package/commands/access-history/index.d.ts.map +1 -0
- package/commands/access-history/index.js +99 -0
- package/commands/access-history/index.js.map +1 -0
- package/commands/agent-exec-flags.d.ts +30 -0
- package/commands/agent-exec-flags.d.ts.map +1 -0
- package/commands/agent-exec-flags.js +49 -0
- package/commands/agent-exec-flags.js.map +1 -0
- package/commands/agent.d.ts +3 -0
- package/commands/agent.d.ts.map +1 -0
- package/commands/agent.js +43 -0
- package/commands/agent.js.map +1 -0
- package/commands/apikey/duration.d.ts +2 -0
- package/commands/apikey/duration.d.ts.map +1 -0
- package/commands/apikey/duration.js +30 -0
- package/commands/apikey/duration.js.map +1 -0
- package/commands/apikey/index.d.ts +18 -0
- package/commands/apikey/index.d.ts.map +1 -0
- package/commands/apikey/index.js +198 -0
- package/commands/apikey/index.js.map +1 -0
- package/commands/apply.d.ts +3 -0
- package/commands/apply.d.ts.map +1 -0
- package/commands/apply.js +146 -0
- package/commands/apply.js.map +1 -0
- package/commands/auth/index.d.ts +3 -0
- package/commands/auth/index.d.ts.map +1 -0
- package/commands/auth/index.js +58 -0
- package/commands/auth/index.js.map +1 -0
- package/commands/auth/login.d.ts +13 -0
- package/commands/auth/login.d.ts.map +1 -0
- package/commands/auth/login.js +58 -0
- package/commands/auth/login.js.map +1 -0
- package/commands/auth/whoami.d.ts +22 -0
- package/commands/auth/whoami.d.ts.map +1 -0
- package/commands/auth/whoami.js +123 -0
- package/commands/auth/whoami.js.map +1 -0
- package/commands/channel.d.ts +3 -0
- package/commands/channel.d.ts.map +1 -0
- package/commands/channel.js +114 -0
- package/commands/channel.js.map +1 -0
- package/commands/completion.d.ts +3 -0
- package/commands/completion.d.ts.map +1 -0
- package/commands/completion.js +80 -0
- package/commands/completion.js.map +1 -0
- package/commands/config/backend.d.ts +3 -0
- package/commands/config/backend.d.ts.map +1 -0
- package/commands/config/backend.js +171 -0
- package/commands/config/backend.js.map +1 -0
- package/commands/config/context.d.ts +3 -0
- package/commands/config/context.d.ts.map +1 -0
- package/commands/config/context.js +88 -0
- package/commands/config/context.js.map +1 -0
- package/commands/config/index.d.ts +3 -0
- package/commands/config/index.d.ts.map +1 -0
- package/commands/config/index.js +13 -0
- package/commands/config/index.js.map +1 -0
- package/commands/config/kv.d.ts +3 -0
- package/commands/config/kv.d.ts.map +1 -0
- package/commands/config/kv.js +39 -0
- package/commands/config/kv.js.map +1 -0
- package/commands/connect.d.ts +3 -0
- package/commands/connect.d.ts.map +1 -0
- package/commands/connect.js +74 -0
- package/commands/connect.js.map +1 -0
- package/commands/delete.d.ts +3 -0
- package/commands/delete.d.ts.map +1 -0
- package/commands/delete.js +44 -0
- package/commands/delete.js.map +1 -0
- package/commands/down.d.ts +3 -0
- package/commands/down.d.ts.map +1 -0
- package/commands/down.js +23 -0
- package/commands/down.js.map +1 -0
- package/commands/download.d.ts +3 -0
- package/commands/download.d.ts.map +1 -0
- package/commands/download.js +79 -0
- package/commands/download.js.map +1 -0
- package/commands/eval.d.ts +3 -0
- package/commands/eval.d.ts.map +1 -0
- package/commands/eval.js +115 -0
- package/commands/eval.js.map +1 -0
- package/commands/get.d.ts +3 -0
- package/commands/get.d.ts.map +1 -0
- package/commands/get.js +113 -0
- package/commands/get.js.map +1 -0
- package/commands/install.d.ts +3 -0
- package/commands/install.d.ts.map +1 -0
- package/commands/install.js +68 -0
- package/commands/install.js.map +1 -0
- package/commands/internal-daemon.d.ts +3 -0
- package/commands/internal-daemon.d.ts.map +1 -0
- package/commands/internal-daemon.js +15 -0
- package/commands/internal-daemon.js.map +1 -0
- package/commands/list.d.ts +10 -0
- package/commands/list.d.ts.map +1 -0
- package/commands/list.js +131 -0
- package/commands/list.js.map +1 -0
- package/commands/logs.d.ts +3 -0
- package/commands/logs.d.ts.map +1 -0
- package/commands/logs.js +59 -0
- package/commands/logs.js.map +1 -0
- package/commands/marketplace.d.ts +3 -0
- package/commands/marketplace.d.ts.map +1 -0
- package/commands/marketplace.js +94 -0
- package/commands/marketplace.js.map +1 -0
- package/commands/mcp-server.d.ts +22 -0
- package/commands/mcp-server.d.ts.map +1 -0
- package/commands/mcp-server.js +105 -0
- package/commands/mcp-server.js.map +1 -0
- package/commands/mcp.d.ts +3 -0
- package/commands/mcp.d.ts.map +1 -0
- package/commands/mcp.js +58 -0
- package/commands/mcp.js.map +1 -0
- package/commands/push.d.ts +27 -0
- package/commands/push.d.ts.map +1 -0
- package/commands/push.js +401 -0
- package/commands/push.js.map +1 -0
- package/commands/reset.d.ts +3 -0
- package/commands/reset.d.ts.map +1 -0
- package/commands/reset.js +45 -0
- package/commands/reset.js.map +1 -0
- package/commands/resume.d.ts +3 -0
- package/commands/resume.d.ts.map +1 -0
- package/commands/resume.js +90 -0
- package/commands/resume.js.map +1 -0
- package/commands/run.d.ts +3 -0
- package/commands/run.d.ts.map +1 -0
- package/commands/run.js +158 -0
- package/commands/run.js.map +1 -0
- package/commands/runs/approve.d.ts +3 -0
- package/commands/runs/approve.d.ts.map +1 -0
- package/commands/runs/approve.js +37 -0
- package/commands/runs/approve.js.map +1 -0
- package/commands/runs/control.d.ts +3 -0
- package/commands/runs/control.d.ts.map +1 -0
- package/commands/runs/control.js +71 -0
- package/commands/runs/control.js.map +1 -0
- package/commands/runs/index.d.ts +3 -0
- package/commands/runs/index.d.ts.map +1 -0
- package/commands/runs/index.js +28 -0
- package/commands/runs/index.js.map +1 -0
- package/commands/runs/logs.d.ts +3 -0
- package/commands/runs/logs.d.ts.map +1 -0
- package/commands/runs/logs.js +33 -0
- package/commands/runs/logs.js.map +1 -0
- package/commands/runs/scores.d.ts +3 -0
- package/commands/runs/scores.d.ts.map +1 -0
- package/commands/runs/scores.js +26 -0
- package/commands/runs/scores.js.map +1 -0
- package/commands/runs/to-eval-case.d.ts +3 -0
- package/commands/runs/to-eval-case.d.ts.map +1 -0
- package/commands/runs/to-eval-case.js +35 -0
- package/commands/runs/to-eval-case.js.map +1 -0
- package/commands/runs/trace.d.ts +3 -0
- package/commands/runs/trace.d.ts.map +1 -0
- package/commands/runs/trace.js +24 -0
- package/commands/runs/trace.js.map +1 -0
- package/commands/schedule.d.ts +3 -0
- package/commands/schedule.d.ts.map +1 -0
- package/commands/schedule.js +57 -0
- package/commands/schedule.js.map +1 -0
- package/commands/search.d.ts +3 -0
- package/commands/search.d.ts.map +1 -0
- package/commands/search.js +76 -0
- package/commands/search.js.map +1 -0
- package/commands/service-account/index.d.ts +7 -0
- package/commands/service-account/index.d.ts.map +1 -0
- package/commands/service-account/index.js +144 -0
- package/commands/service-account/index.js.map +1 -0
- package/commands/setup.d.ts +3 -0
- package/commands/setup.d.ts.map +1 -0
- package/commands/setup.js +76 -0
- package/commands/setup.js.map +1 -0
- package/commands/shared.d.ts +15 -0
- package/commands/shared.d.ts.map +1 -0
- package/commands/shared.js +34 -0
- package/commands/shared.js.map +1 -0
- package/commands/status.d.ts +3 -0
- package/commands/status.d.ts.map +1 -0
- package/commands/status.js +18 -0
- package/commands/status.js.map +1 -0
- package/commands/tag.d.ts +3 -0
- package/commands/tag.d.ts.map +1 -0
- package/commands/tag.js +24 -0
- package/commands/tag.js.map +1 -0
- package/commands/up.d.ts +3 -0
- package/commands/up.d.ts.map +1 -0
- package/commands/up.js +84 -0
- package/commands/up.js.map +1 -0
- package/commands/usage.d.ts +5 -0
- package/commands/usage.d.ts.map +1 -0
- package/commands/usage.js +92 -0
- package/commands/usage.js.map +1 -0
- package/commands/validate.d.ts +3 -0
- package/commands/validate.d.ts.map +1 -0
- package/commands/validate.js +95 -0
- package/commands/validate.js.map +1 -0
- package/commands/vault.d.ts +3 -0
- package/commands/vault.d.ts.map +1 -0
- package/commands/vault.js +143 -0
- package/commands/vault.js.map +1 -0
- package/commands/version.d.ts +3 -0
- package/commands/version.d.ts.map +1 -0
- package/commands/version.js +11 -0
- package/commands/version.js.map +1 -0
- package/config/config.d.ts +110 -0
- package/config/config.d.ts.map +1 -0
- package/config/config.js +199 -0
- package/config/config.js.map +1 -0
- package/config/index.d.ts +5 -0
- package/config/index.d.ts.map +1 -0
- package/config/index.js +6 -0
- package/config/index.js.map +1 -0
- package/config/keys.d.ts +6 -0
- package/config/keys.d.ts.map +1 -0
- package/config/keys.js +80 -0
- package/config/keys.js.map +1 -0
- package/config/paths.d.ts +10 -0
- package/config/paths.d.ts.map +1 -0
- package/config/paths.js +21 -0
- package/config/paths.js.map +1 -0
- package/config/resolve.d.ts +65 -0
- package/config/resolve.d.ts.map +1 -0
- package/config/resolve.js +160 -0
- package/config/resolve.js.map +1 -0
- package/errors/classify.d.ts +17 -0
- package/errors/classify.d.ts.map +1 -0
- package/errors/classify.js +204 -0
- package/errors/classify.js.map +1 -0
- package/errors/cli-exit-error.d.ts +6 -0
- package/errors/cli-exit-error.d.ts.map +1 -0
- package/errors/cli-exit-error.js +15 -0
- package/errors/cli-exit-error.js.map +1 -0
- package/errors/exit-codes.d.ts +10 -0
- package/errors/exit-codes.d.ts.map +1 -0
- package/errors/exit-codes.js +15 -0
- package/errors/exit-codes.js.map +1 -0
- package/errors/handle.d.ts +14 -0
- package/errors/handle.d.ts.map +1 -0
- package/errors/handle.js +46 -0
- package/errors/handle.js.map +1 -0
- package/errors/index.d.ts +6 -0
- package/errors/index.d.ts.map +1 -0
- package/errors/index.js +7 -0
- package/errors/index.js.map +1 -0
- package/errors/usage-error.d.ts +5 -0
- package/errors/usage-error.d.ts.map +1 -0
- package/errors/usage-error.js +13 -0
- package/errors/usage-error.js.map +1 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +8 -0
- package/index.js.map +1 -0
- package/local/artifact.d.ts +77 -0
- package/local/artifact.d.ts.map +1 -0
- package/local/artifact.js +268 -0
- package/local/artifact.js.map +1 -0
- package/local/constants.d.ts +41 -0
- package/local/constants.d.ts.map +1 -0
- package/local/constants.js +48 -0
- package/local/constants.js.map +1 -0
- package/local/daemon/components.d.ts +20 -0
- package/local/daemon/components.d.ts.map +1 -0
- package/local/daemon/components.js +140 -0
- package/local/daemon/components.js.map +1 -0
- package/local/daemon/env.d.ts +77 -0
- package/local/daemon/env.d.ts.map +1 -0
- package/local/daemon/env.js +107 -0
- package/local/daemon/env.js.map +1 -0
- package/local/daemon/host.d.ts +15 -0
- package/local/daemon/host.d.ts.map +1 -0
- package/local/daemon/host.js +115 -0
- package/local/daemon/host.js.map +1 -0
- package/local/daemon/index.d.ts +8 -0
- package/local/daemon/index.d.ts.map +1 -0
- package/local/daemon/index.js +8 -0
- package/local/daemon/index.js.map +1 -0
- package/local/daemon/launch.d.ts +38 -0
- package/local/daemon/launch.d.ts.map +1 -0
- package/local/daemon/launch.js +261 -0
- package/local/daemon/launch.js.map +1 -0
- package/local/daemon/process.d.ts +42 -0
- package/local/daemon/process.d.ts.map +1 -0
- package/local/daemon/process.js +166 -0
- package/local/daemon/process.js.map +1 -0
- package/local/daemon/supervisor.d.ts +56 -0
- package/local/daemon/supervisor.d.ts.map +1 -0
- package/local/daemon/supervisor.js +211 -0
- package/local/daemon/supervisor.js.map +1 -0
- package/local/daemon/types.d.ts +65 -0
- package/local/daemon/types.d.ts.map +1 -0
- package/local/daemon/types.js +9 -0
- package/local/daemon/types.js.map +1 -0
- package/local/llm-config.d.ts +24 -0
- package/local/llm-config.d.ts.map +1 -0
- package/local/llm-config.js +74 -0
- package/local/llm-config.js.map +1 -0
- package/local/logs/tail.d.ts +19 -0
- package/local/logs/tail.d.ts.map +1 -0
- package/local/logs/tail.js +86 -0
- package/local/logs/tail.js.map +1 -0
- package/local/logs/view.d.ts +20 -0
- package/local/logs/view.d.ts.map +1 -0
- package/local/logs/view.js +50 -0
- package/local/logs/view.js.map +1 -0
- package/local/net/tcp.d.ts +23 -0
- package/local/net/tcp.d.ts.map +1 -0
- package/local/net/tcp.js +47 -0
- package/local/net/tcp.js.map +1 -0
- package/local/operator-config.d.ts +28 -0
- package/local/operator-config.d.ts.map +1 -0
- package/local/operator-config.js +77 -0
- package/local/operator-config.js.map +1 -0
- package/local/paths.d.ts +47 -0
- package/local/paths.d.ts.map +1 -0
- package/local/paths.js +83 -0
- package/local/paths.js.map +1 -0
- package/local/reset.d.ts +14 -0
- package/local/reset.d.ts.map +1 -0
- package/local/reset.js +57 -0
- package/local/reset.js.map +1 -0
- package/local/runtime/index.d.ts +5 -0
- package/local/runtime/index.d.ts.map +1 -0
- package/local/runtime/index.js +8 -0
- package/local/runtime/index.js.map +1 -0
- package/local/runtime/node.d.ts +17 -0
- package/local/runtime/node.d.ts.map +1 -0
- package/local/runtime/node.js +139 -0
- package/local/runtime/node.js.map +1 -0
- package/local/runtime/runner.d.ts +45 -0
- package/local/runtime/runner.d.ts.map +1 -0
- package/local/runtime/runner.js +131 -0
- package/local/runtime/runner.js.map +1 -0
- package/local/runtime/runtimes-install.d.ts +13 -0
- package/local/runtime/runtimes-install.d.ts.map +1 -0
- package/local/runtime/runtimes-install.js +63 -0
- package/local/runtime/runtimes-install.js.map +1 -0
- package/local/runtime/server.d.ts +40 -0
- package/local/runtime/server.d.ts.map +1 -0
- package/local/runtime/server.js +144 -0
- package/local/runtime/server.js.map +1 -0
- package/local/runtime/which.d.ts +3 -0
- package/local/runtime/which.d.ts.map +1 -0
- package/local/runtime/which.js +30 -0
- package/local/runtime/which.js.map +1 -0
- package/local/setup/prompt.d.ts +8 -0
- package/local/setup/prompt.d.ts.map +1 -0
- package/local/setup/prompt.js +63 -0
- package/local/setup/prompt.js.map +1 -0
- package/local/setup/wizard.d.ts +43 -0
- package/local/setup/wizard.d.ts.map +1 -0
- package/local/setup/wizard.js +119 -0
- package/local/setup/wizard.js.map +1 -0
- package/local/state/health-state.d.ts +26 -0
- package/local/state/health-state.d.ts.map +1 -0
- package/local/state/health-state.js +34 -0
- package/local/state/health-state.js.map +1 -0
- package/local/state/index.d.ts +7 -0
- package/local/state/index.d.ts.map +1 -0
- package/local/state/index.js +8 -0
- package/local/state/index.js.map +1 -0
- package/local/state/lock.d.ts +13 -0
- package/local/state/lock.d.ts.map +1 -0
- package/local/state/lock.js +84 -0
- package/local/state/lock.js.map +1 -0
- package/local/state/log-rotation.d.ts +17 -0
- package/local/state/log-rotation.d.ts.map +1 -0
- package/local/state/log-rotation.js +101 -0
- package/local/state/log-rotation.js.map +1 -0
- package/local/state/pidfile.d.ts +11 -0
- package/local/state/pidfile.d.ts.map +1 -0
- package/local/state/pidfile.js +35 -0
- package/local/state/pidfile.js.map +1 -0
- package/local/state/proc.d.ts +29 -0
- package/local/state/proc.d.ts.map +1 -0
- package/local/state/proc.js +84 -0
- package/local/state/proc.js.map +1 -0
- package/local/state/startup-config.d.ts +24 -0
- package/local/state/startup-config.d.ts.map +1 -0
- package/local/state/startup-config.js +36 -0
- package/local/state/startup-config.js.map +1 -0
- package/local/status.d.ts +9 -0
- package/local/status.d.ts.map +1 -0
- package/local/status.js +170 -0
- package/local/status.js.map +1 -0
- package/local/temporal/download.d.ts +42 -0
- package/local/temporal/download.d.ts.map +1 -0
- package/local/temporal/download.js +55 -0
- package/local/temporal/download.js.map +1 -0
- package/local/temporal/index.d.ts +5 -0
- package/local/temporal/index.d.ts.map +1 -0
- package/local/temporal/index.js +6 -0
- package/local/temporal/index.js.map +1 -0
- package/local/temporal/inspect.d.ts +15 -0
- package/local/temporal/inspect.d.ts.map +1 -0
- package/local/temporal/inspect.js +72 -0
- package/local/temporal/inspect.js.map +1 -0
- package/local/temporal/manager.d.ts +62 -0
- package/local/temporal/manager.d.ts.map +1 -0
- package/local/temporal/manager.js +221 -0
- package/local/temporal/manager.js.map +1 -0
- package/local/temporal/supervisor.d.ts +34 -0
- package/local/temporal/supervisor.d.ts.map +1 -0
- package/local/temporal/supervisor.js +83 -0
- package/local/temporal/supervisor.js.map +1 -0
- package/local/webconsole/index.d.ts +3 -0
- package/local/webconsole/index.d.ts.map +1 -0
- package/local/webconsole/index.js +27 -0
- package/local/webconsole/index.js.map +1 -0
- package/logger.d.ts +13 -0
- package/logger.d.ts.map +1 -0
- package/logger.js +35 -0
- package/logger.js.map +1 -0
- package/marketplace/config.d.ts +61 -0
- package/marketplace/config.d.ts.map +1 -0
- package/marketplace/config.js +179 -0
- package/marketplace/config.js.map +1 -0
- package/marketplace/github.d.ts +68 -0
- package/marketplace/github.d.ts.map +1 -0
- package/marketplace/github.js +272 -0
- package/marketplace/github.js.map +1 -0
- package/marketplace/index.d.ts +8 -0
- package/marketplace/index.d.ts.map +1 -0
- package/marketplace/index.js +12 -0
- package/marketplace/index.js.map +1 -0
- package/marketplace/install.d.ts +35 -0
- package/marketplace/install.d.ts.map +1 -0
- package/marketplace/install.js +156 -0
- package/marketplace/install.js.map +1 -0
- package/marketplace/materialize.d.ts +19 -0
- package/marketplace/materialize.d.ts.map +1 -0
- package/marketplace/materialize.js +53 -0
- package/marketplace/materialize.js.map +1 -0
- package/marketplace/official.d.ts +28 -0
- package/marketplace/official.d.ts.map +1 -0
- package/marketplace/official.js +87 -0
- package/marketplace/official.js.map +1 -0
- package/marketplace/read.d.ts +17 -0
- package/marketplace/read.d.ts.map +1 -0
- package/marketplace/read.js +44 -0
- package/marketplace/read.js.map +1 -0
- package/marketplace/ref.d.ts +13 -0
- package/marketplace/ref.d.ts.map +1 -0
- package/marketplace/ref.js +54 -0
- package/marketplace/ref.js.map +1 -0
- package/marketplace/render.d.ts +22 -0
- package/marketplace/render.d.ts.map +1 -0
- package/marketplace/render.js +115 -0
- package/marketplace/render.js.map +1 -0
- package/output/command-result.d.ts +55 -0
- package/output/command-result.d.ts.map +1 -0
- package/output/command-result.js +147 -0
- package/output/command-result.js.map +1 -0
- package/output/confirm.d.ts +22 -0
- package/output/confirm.d.ts.map +1 -0
- package/output/confirm.js +43 -0
- package/output/confirm.js.map +1 -0
- package/output/format.d.ts +22 -0
- package/output/format.d.ts.map +1 -0
- package/output/format.js +72 -0
- package/output/format.js.map +1 -0
- package/output/index.d.ts +7 -0
- package/output/index.d.ts.map +1 -0
- package/output/index.js +8 -0
- package/output/index.js.map +1 -0
- package/output/ndjson.d.ts +7 -0
- package/output/ndjson.d.ts.map +1 -0
- package/output/ndjson.js +13 -0
- package/output/ndjson.js.map +1 -0
- package/output/proto.d.ts +12 -0
- package/output/proto.d.ts.map +1 -0
- package/output/proto.js +34 -0
- package/output/proto.js.map +1 -0
- package/output/style.d.ts +19 -0
- package/output/style.d.ts.map +1 -0
- package/output/style.js +44 -0
- package/output/style.js.map +1 -0
- package/output/table.d.ts +5 -0
- package/output/table.d.ts.map +1 -0
- package/output/table.js +43 -0
- package/output/table.js.map +1 -0
- package/package.json +50 -0
- package/program.d.ts +17 -0
- package/program.d.ts.map +1 -0
- package/program.js +195 -0
- package/program.js.map +1 -0
- package/registry/aliases.d.ts +21 -0
- package/registry/aliases.d.ts.map +1 -0
- package/registry/aliases.js +99 -0
- package/registry/aliases.js.map +1 -0
- package/registry/index.d.ts +6 -0
- package/registry/index.d.ts.map +1 -0
- package/registry/index.js +7 -0
- package/registry/index.js.map +1 -0
- package/registry/metadata.d.ts +27 -0
- package/registry/metadata.d.ts.map +1 -0
- package/registry/metadata.js +152 -0
- package/registry/metadata.js.map +1 -0
- package/registry/registry.d.ts +56 -0
- package/registry/registry.d.ts.map +1 -0
- package/registry/registry.js +85 -0
- package/registry/registry.js.map +1 -0
- package/registry/verb-support.d.ts +5 -0
- package/registry/verb-support.d.ts.map +1 -0
- package/registry/verb-support.js +112 -0
- package/registry/verb-support.js.map +1 -0
- package/registry/verbs.d.ts +16 -0
- package/registry/verbs.d.ts.map +1 -0
- package/registry/verbs.js +35 -0
- package/registry/verbs.js.map +1 -0
- package/resources/access-history.d.ts +28 -0
- package/resources/access-history.d.ts.map +1 -0
- package/resources/access-history.js +124 -0
- package/resources/access-history.js.map +1 -0
- package/resources/agent/quality.d.ts +40 -0
- package/resources/agent/quality.d.ts.map +1 -0
- package/resources/agent/quality.js +338 -0
- package/resources/agent/quality.js.map +1 -0
- package/resources/agent/resolve.d.ts +5 -0
- package/resources/agent/resolve.d.ts.map +1 -0
- package/resources/agent/resolve.js +23 -0
- package/resources/agent/resolve.js.map +1 -0
- package/resources/apply/apply.d.ts +62 -0
- package/resources/apply/apply.d.ts.map +1 -0
- package/resources/apply/apply.js +371 -0
- package/resources/apply/apply.js.map +1 -0
- package/resources/apply/handlers.d.ts +54 -0
- package/resources/apply/handlers.d.ts.map +1 -0
- package/resources/apply/handlers.js +56 -0
- package/resources/apply/handlers.js.map +1 -0
- package/resources/channel.d.ts +52 -0
- package/resources/channel.d.ts.map +1 -0
- package/resources/channel.js +404 -0
- package/resources/channel.js.map +1 -0
- package/resources/connect/address.d.ts +5 -0
- package/resources/connect/address.d.ts.map +1 -0
- package/resources/connect/address.js +49 -0
- package/resources/connect/address.js.map +1 -0
- package/resources/connect/connect.d.ts +30 -0
- package/resources/connect/connect.d.ts.map +1 -0
- package/resources/connect/connect.js +163 -0
- package/resources/connect/connect.js.map +1 -0
- package/resources/connect/discover.d.ts +7 -0
- package/resources/connect/discover.d.ts.map +1 -0
- package/resources/connect/discover.js +122 -0
- package/resources/connect/discover.js.map +1 -0
- package/resources/connect/display.d.ts +10 -0
- package/resources/connect/display.d.ts.map +1 -0
- package/resources/connect/display.js +50 -0
- package/resources/connect/display.js.map +1 -0
- package/resources/connect/sign-in.d.ts +48 -0
- package/resources/connect/sign-in.d.ts.map +1 -0
- package/resources/connect/sign-in.js +158 -0
- package/resources/connect/sign-in.js.map +1 -0
- package/resources/cursor-pages.d.ts +9 -0
- package/resources/cursor-pages.d.ts.map +1 -0
- package/resources/cursor-pages.js +25 -0
- package/resources/cursor-pages.js.map +1 -0
- package/resources/delete.d.ts +34 -0
- package/resources/delete.d.ts.map +1 -0
- package/resources/delete.js +260 -0
- package/resources/delete.js.map +1 -0
- package/resources/documents.d.ts +16 -0
- package/resources/documents.d.ts.map +1 -0
- package/resources/documents.js +89 -0
- package/resources/documents.js.map +1 -0
- package/resources/download.d.ts +16 -0
- package/resources/download.d.ts.map +1 -0
- package/resources/download.js +101 -0
- package/resources/download.js.map +1 -0
- package/resources/eval-run/follow.d.ts +67 -0
- package/resources/eval-run/follow.d.ts.map +1 -0
- package/resources/eval-run/follow.js +285 -0
- package/resources/eval-run/follow.js.map +1 -0
- package/resources/eval-run/node-io.d.ts +4 -0
- package/resources/eval-run/node-io.d.ts.map +1 -0
- package/resources/eval-run/node-io.js +39 -0
- package/resources/eval-run/node-io.js.map +1 -0
- package/resources/eval-run/options.d.ts +116 -0
- package/resources/eval-run/options.d.ts.map +1 -0
- package/resources/eval-run/options.js +265 -0
- package/resources/eval-run/options.js.map +1 -0
- package/resources/eval-run/report.d.ts +64 -0
- package/resources/eval-run/report.d.ts.map +1 -0
- package/resources/eval-run/report.js +434 -0
- package/resources/eval-run/report.js.map +1 -0
- package/resources/eval-run/run.d.ts +10 -0
- package/resources/eval-run/run.d.ts.map +1 -0
- package/resources/eval-run/run.js +158 -0
- package/resources/eval-run/run.js.map +1 -0
- package/resources/eval.d.ts +69 -0
- package/resources/eval.d.ts.map +1 -0
- package/resources/eval.js +225 -0
- package/resources/eval.js.map +1 -0
- package/resources/get-bindings.d.ts +13 -0
- package/resources/get-bindings.d.ts.map +1 -0
- package/resources/get-bindings.js +93 -0
- package/resources/get-bindings.js.map +1 -0
- package/resources/get.d.ts +6 -0
- package/resources/get.d.ts.map +1 -0
- package/resources/get.js +43 -0
- package/resources/get.js.map +1 -0
- package/resources/git.d.ts +15 -0
- package/resources/git.d.ts.map +1 -0
- package/resources/git.js +69 -0
- package/resources/git.js.map +1 -0
- package/resources/ignore/index.d.ts +3 -0
- package/resources/ignore/index.d.ts.map +1 -0
- package/resources/ignore/index.js +6 -0
- package/resources/ignore/index.js.map +1 -0
- package/resources/ignore/matcher.d.ts +11 -0
- package/resources/ignore/matcher.d.ts.map +1 -0
- package/resources/ignore/matcher.js +41 -0
- package/resources/ignore/matcher.js.map +1 -0
- package/resources/list.d.ts +16 -0
- package/resources/list.d.ts.map +1 -0
- package/resources/list.js +453 -0
- package/resources/list.js.map +1 -0
- package/resources/mcp/add.d.ts +18 -0
- package/resources/mcp/add.d.ts.map +1 -0
- package/resources/mcp/add.js +95 -0
- package/resources/mcp/add.js.map +1 -0
- package/resources/mcp/placeholder-resolver.d.ts +19 -0
- package/resources/mcp/placeholder-resolver.d.ts.map +1 -0
- package/resources/mcp/placeholder-resolver.js +52 -0
- package/resources/mcp/placeholder-resolver.js.map +1 -0
- package/resources/picker/ink.d.ts +45 -0
- package/resources/picker/ink.d.ts.map +1 -0
- package/resources/picker/ink.js +45 -0
- package/resources/picker/ink.js.map +1 -0
- package/resources/picker/tty.d.ts +19 -0
- package/resources/picker/tty.d.ts.map +1 -0
- package/resources/picker/tty.js +21 -0
- package/resources/picker/tty.js.map +1 -0
- package/resources/plugin.d.ts +131 -0
- package/resources/plugin.d.ts.map +1 -0
- package/resources/plugin.js +382 -0
- package/resources/plugin.js.map +1 -0
- package/resources/reference.d.ts +44 -0
- package/resources/reference.d.ts.map +1 -0
- package/resources/reference.js +152 -0
- package/resources/reference.js.map +1 -0
- package/resources/render.d.ts +52 -0
- package/resources/render.d.ts.map +1 -0
- package/resources/render.js +135 -0
- package/resources/render.js.map +1 -0
- package/resources/run/agent-exec.d.ts +16 -0
- package/resources/run/agent-exec.d.ts.map +1 -0
- package/resources/run/agent-exec.js +89 -0
- package/resources/run/agent-exec.js.map +1 -0
- package/resources/run/attachments.d.ts +24 -0
- package/resources/run/attachments.d.ts.map +1 -0
- package/resources/run/attachments.js +237 -0
- package/resources/run/attachments.js.map +1 -0
- package/resources/run/create.d.ts +57 -0
- package/resources/run/create.d.ts.map +1 -0
- package/resources/run/create.js +112 -0
- package/resources/run/create.js.map +1 -0
- package/resources/run/epilogue.d.ts +9 -0
- package/resources/run/epilogue.d.ts.map +1 -0
- package/resources/run/epilogue.js +172 -0
- package/resources/run/epilogue.js.map +1 -0
- package/resources/run/header.d.ts +31 -0
- package/resources/run/header.d.ts.map +1 -0
- package/resources/run/header.js +54 -0
- package/resources/run/header.js.map +1 -0
- package/resources/run/plugins.d.ts +11 -0
- package/resources/run/plugins.d.ts.map +1 -0
- package/resources/run/plugins.js +18 -0
- package/resources/run/plugins.js.map +1 -0
- package/resources/run/prepare.d.ts +149 -0
- package/resources/run/prepare.d.ts.map +1 -0
- package/resources/run/prepare.js +180 -0
- package/resources/run/prepare.js.map +1 -0
- package/resources/run/references.d.ts +22 -0
- package/resources/run/references.d.ts.map +1 -0
- package/resources/run/references.js +56 -0
- package/resources/run/references.js.map +1 -0
- package/resources/run/resolve.d.ts +5 -0
- package/resources/run/resolve.d.ts.map +1 -0
- package/resources/run/resolve.js +16 -0
- package/resources/run/resolve.js.map +1 -0
- package/resources/run/resume.d.ts +12 -0
- package/resources/run/resume.d.ts.map +1 -0
- package/resources/run/resume.js +97 -0
- package/resources/run/resume.js.map +1 -0
- package/resources/run/stream.d.ts +24 -0
- package/resources/run/stream.d.ts.map +1 -0
- package/resources/run/stream.js +74 -0
- package/resources/run/stream.js.map +1 -0
- package/resources/run/vaults.d.ts +11 -0
- package/resources/run/vaults.d.ts.map +1 -0
- package/resources/run/vaults.js +19 -0
- package/resources/run/vaults.js.map +1 -0
- package/resources/run/workspace.d.ts +17 -0
- package/resources/run/workspace.d.ts.map +1 -0
- package/resources/run/workspace.js +147 -0
- package/resources/run/workspace.js.map +1 -0
- package/resources/run-approve.d.ts +18 -0
- package/resources/run-approve.d.ts.map +1 -0
- package/resources/run-approve.js +72 -0
- package/resources/run-approve.js.map +1 -0
- package/resources/run-control.d.ts +19 -0
- package/resources/run-control.d.ts.map +1 -0
- package/resources/run-control.js +37 -0
- package/resources/run-control.js.map +1 -0
- package/resources/run-format.d.ts +15 -0
- package/resources/run-format.d.ts.map +1 -0
- package/resources/run-format.js +49 -0
- package/resources/run-format.js.map +1 -0
- package/resources/run-logs.d.ts +17 -0
- package/resources/run-logs.d.ts.map +1 -0
- package/resources/run-logs.js +105 -0
- package/resources/run-logs.js.map +1 -0
- package/resources/run-scores.d.ts +20 -0
- package/resources/run-scores.d.ts.map +1 -0
- package/resources/run-scores.js +132 -0
- package/resources/run-scores.js.map +1 -0
- package/resources/run-to-eval-case.d.ts +24 -0
- package/resources/run-to-eval-case.d.ts.map +1 -0
- package/resources/run-to-eval-case.js +113 -0
- package/resources/run-to-eval-case.js.map +1 -0
- package/resources/run-trace.d.ts +10 -0
- package/resources/run-trace.d.ts.map +1 -0
- package/resources/run-trace.js +81 -0
- package/resources/run-trace.js.map +1 -0
- package/resources/runs.d.ts +45 -0
- package/resources/runs.d.ts.map +1 -0
- package/resources/runs.js +123 -0
- package/resources/runs.js.map +1 -0
- package/resources/schedule.d.ts +22 -0
- package/resources/schedule.d.ts.map +1 -0
- package/resources/schedule.js +116 -0
- package/resources/schedule.js.map +1 -0
- package/resources/search.d.ts +21 -0
- package/resources/search.d.ts.map +1 -0
- package/resources/search.js +25 -0
- package/resources/search.js.map +1 -0
- package/resources/service-account.d.ts +37 -0
- package/resources/service-account.d.ts.map +1 -0
- package/resources/service-account.js +139 -0
- package/resources/service-account.js.map +1 -0
- package/resources/session.d.ts +20 -0
- package/resources/session.d.ts.map +1 -0
- package/resources/session.js +51 -0
- package/resources/session.js.map +1 -0
- package/resources/skill.d.ts +123 -0
- package/resources/skill.d.ts.map +1 -0
- package/resources/skill.js +441 -0
- package/resources/skill.js.map +1 -0
- package/resources/stream/answer.d.ts +34 -0
- package/resources/stream/answer.d.ts.map +1 -0
- package/resources/stream/answer.js +88 -0
- package/resources/stream/answer.js.map +1 -0
- package/resources/stream/headless.d.ts +45 -0
- package/resources/stream/headless.d.ts.map +1 -0
- package/resources/stream/headless.js +100 -0
- package/resources/stream/headless.js.map +1 -0
- package/resources/stream/ink.d.ts +22 -0
- package/resources/stream/ink.d.ts.map +1 -0
- package/resources/stream/ink.js +24 -0
- package/resources/stream/ink.js.map +1 -0
- package/resources/stream/render-ndjson.d.ts +23 -0
- package/resources/stream/render-ndjson.d.ts.map +1 -0
- package/resources/stream/render-ndjson.js +28 -0
- package/resources/stream/render-ndjson.js.map +1 -0
- package/resources/stream/render-plaintext.d.ts +27 -0
- package/resources/stream/render-plaintext.d.ts.map +1 -0
- package/resources/stream/render-plaintext.js +142 -0
- package/resources/stream/render-plaintext.js.map +1 -0
- package/resources/stream/submit.d.ts +25 -0
- package/resources/stream/submit.d.ts.map +1 -0
- package/resources/stream/submit.js +132 -0
- package/resources/stream/submit.js.map +1 -0
- package/resources/stream/tty.d.ts +8 -0
- package/resources/stream/tty.d.ts.map +1 -0
- package/resources/stream/tty.js +15 -0
- package/resources/stream/tty.js.map +1 -0
- package/resources/tag.d.ts +4 -0
- package/resources/tag.d.ts.map +1 -0
- package/resources/tag.js +37 -0
- package/resources/tag.js.map +1 -0
- package/resources/usage.d.ts +47 -0
- package/resources/usage.d.ts.map +1 -0
- package/resources/usage.js +376 -0
- package/resources/usage.js.map +1 -0
- package/resources/validate.d.ts +7 -0
- package/resources/validate.d.ts.map +1 -0
- package/resources/validate.js +36 -0
- package/resources/validate.js.map +1 -0
- package/resources/vault.d.ts +79 -0
- package/resources/vault.d.ts.map +1 -0
- package/resources/vault.js +277 -0
- package/resources/vault.js.map +1 -0
- package/resources/version.d.ts +11 -0
- package/resources/version.d.ts.map +1 -0
- package/resources/version.js +80 -0
- package/resources/version.js.map +1 -0
- package/runtime.d.ts +5 -0
- package/runtime.d.ts.map +1 -0
- package/runtime.js +19 -0
- package/runtime.js.map +1 -0
- package/src/auth/auth0.ts +43 -0
- package/src/auth/callback-server.ts +104 -0
- package/src/auth/index.ts +6 -0
- package/src/auth/login.ts +106 -0
- package/src/auth/pages.ts +31 -0
- package/src/auth/pkce.ts +26 -0
- package/src/auth/token.ts +159 -0
- package/src/backend.ts +15 -0
- package/src/cli/stigmer.ts +16 -0
- package/src/client/client.ts +157 -0
- package/src/client/index.ts +3 -0
- package/src/client/organizations.ts +118 -0
- package/src/client/single-org.ts +62 -0
- package/src/commands/access-history/index.ts +124 -0
- package/src/commands/agent-exec-flags.ts +76 -0
- package/src/commands/agent.ts +57 -0
- package/src/commands/apikey/duration.ts +35 -0
- package/src/commands/apikey/index.ts +273 -0
- package/src/commands/apply.ts +200 -0
- package/src/commands/auth/index.ts +76 -0
- package/src/commands/auth/login.ts +70 -0
- package/src/commands/auth/whoami.ts +157 -0
- package/src/commands/channel.ts +178 -0
- package/src/commands/completion.ts +94 -0
- package/src/commands/config/backend.ts +239 -0
- package/src/commands/config/context.ts +110 -0
- package/src/commands/config/index.ts +18 -0
- package/src/commands/config/kv.ts +44 -0
- package/src/commands/connect.ts +115 -0
- package/src/commands/delete.ts +59 -0
- package/src/commands/down.ts +27 -0
- package/src/commands/download.ts +113 -0
- package/src/commands/eval.ts +148 -0
- package/src/commands/get.ts +138 -0
- package/src/commands/install.ts +108 -0
- package/src/commands/internal-daemon.ts +17 -0
- package/src/commands/list.ts +164 -0
- package/src/commands/logs.ts +73 -0
- package/src/commands/marketplace.ts +133 -0
- package/src/commands/mcp-server.ts +125 -0
- package/src/commands/mcp.ts +92 -0
- package/src/commands/push.ts +630 -0
- package/src/commands/reset.ts +57 -0
- package/src/commands/resume.ts +122 -0
- package/src/commands/run.ts +228 -0
- package/src/commands/runs/approve.ts +57 -0
- package/src/commands/runs/control.ts +96 -0
- package/src/commands/runs/index.ts +31 -0
- package/src/commands/runs/logs.ts +45 -0
- package/src/commands/runs/scores.ts +34 -0
- package/src/commands/runs/to-eval-case.ts +50 -0
- package/src/commands/runs/trace.ts +32 -0
- package/src/commands/schedule.ts +70 -0
- package/src/commands/search.ts +95 -0
- package/src/commands/service-account/index.ts +180 -0
- package/src/commands/setup.ts +97 -0
- package/src/commands/shared.ts +41 -0
- package/src/commands/status.ts +20 -0
- package/src/commands/tag.ts +31 -0
- package/src/commands/up.ts +113 -0
- package/src/commands/usage.ts +116 -0
- package/src/commands/validate.ts +127 -0
- package/src/commands/vault.ts +245 -0
- package/src/commands/version.ts +13 -0
- package/src/config/config.ts +308 -0
- package/src/config/index.ts +33 -0
- package/src/config/keys.ts +105 -0
- package/src/config/paths.ts +25 -0
- package/src/config/resolve.ts +174 -0
- package/src/errors/classify.ts +249 -0
- package/src/errors/cli-exit-error.ts +16 -0
- package/src/errors/exit-codes.ts +17 -0
- package/src/errors/handle.ts +53 -0
- package/src/errors/index.ts +7 -0
- package/src/errors/usage-error.ts +14 -0
- package/src/index.ts +8 -0
- package/src/local/artifact.ts +351 -0
- package/src/local/constants.ts +55 -0
- package/src/local/daemon/components.ts +145 -0
- package/src/local/daemon/env.ts +171 -0
- package/src/local/daemon/host.ts +128 -0
- package/src/local/daemon/index.ts +18 -0
- package/src/local/daemon/launch.ts +326 -0
- package/src/local/daemon/process.ts +213 -0
- package/src/local/daemon/supervisor.ts +249 -0
- package/src/local/daemon/types.ts +78 -0
- package/src/local/llm-config.ts +86 -0
- package/src/local/logs/tail.ts +100 -0
- package/src/local/logs/view.ts +65 -0
- package/src/local/net/tcp.ts +65 -0
- package/src/local/operator-config.ts +95 -0
- package/src/local/paths.ts +95 -0
- package/src/local/reset.ts +90 -0
- package/src/local/runtime/index.ts +19 -0
- package/src/local/runtime/node.ts +173 -0
- package/src/local/runtime/runner.ts +159 -0
- package/src/local/runtime/runtimes-install.ts +75 -0
- package/src/local/runtime/server.ts +197 -0
- package/src/local/runtime/which.ts +30 -0
- package/src/local/setup/prompt.ts +70 -0
- package/src/local/setup/wizard.ts +140 -0
- package/src/local/state/health-state.ts +55 -0
- package/src/local/state/index.ts +8 -0
- package/src/local/state/lock.ts +92 -0
- package/src/local/state/log-rotation.ts +112 -0
- package/src/local/state/pidfile.ts +37 -0
- package/src/local/state/proc.ts +82 -0
- package/src/local/state/startup-config.ts +55 -0
- package/src/local/status.ts +189 -0
- package/src/local/temporal/download.ts +84 -0
- package/src/local/temporal/index.ts +14 -0
- package/src/local/temporal/inspect.ts +80 -0
- package/src/local/temporal/manager.ts +261 -0
- package/src/local/temporal/supervisor.ts +97 -0
- package/src/local/webconsole/index.ts +30 -0
- package/src/logger.ts +39 -0
- package/src/marketplace/config.ts +255 -0
- package/src/marketplace/github.ts +410 -0
- package/src/marketplace/index.ts +54 -0
- package/src/marketplace/install.ts +217 -0
- package/src/marketplace/materialize.ts +80 -0
- package/src/marketplace/official.ts +126 -0
- package/src/marketplace/read.ts +76 -0
- package/src/marketplace/ref.ts +74 -0
- package/src/marketplace/render.ts +151 -0
- package/src/output/command-result.ts +199 -0
- package/src/output/confirm.ts +54 -0
- package/src/output/format.ts +101 -0
- package/src/output/index.ts +30 -0
- package/src/output/ndjson.ts +14 -0
- package/src/output/proto.ts +55 -0
- package/src/output/style.ts +57 -0
- package/src/output/table.ts +52 -0
- package/src/program.ts +209 -0
- package/src/registry/aliases.ts +113 -0
- package/src/registry/index.ts +30 -0
- package/src/registry/metadata.ts +170 -0
- package/src/registry/registry.ts +135 -0
- package/src/registry/verb-support.ts +117 -0
- package/src/registry/verbs.ts +42 -0
- package/src/resources/access-history.ts +167 -0
- package/src/resources/agent/quality.ts +424 -0
- package/src/resources/agent/resolve.ts +31 -0
- package/src/resources/apply/apply.ts +472 -0
- package/src/resources/apply/handlers.ts +115 -0
- package/src/resources/channel.ts +548 -0
- package/src/resources/connect/address.ts +47 -0
- package/src/resources/connect/connect.ts +219 -0
- package/src/resources/connect/discover.ts +145 -0
- package/src/resources/connect/display.ts +67 -0
- package/src/resources/connect/sign-in.ts +210 -0
- package/src/resources/cursor-pages.ts +35 -0
- package/src/resources/delete.ts +381 -0
- package/src/resources/documents.ts +102 -0
- package/src/resources/download.ts +147 -0
- package/src/resources/eval-run/follow.ts +390 -0
- package/src/resources/eval-run/node-io.ts +42 -0
- package/src/resources/eval-run/options.ts +391 -0
- package/src/resources/eval-run/report.ts +529 -0
- package/src/resources/eval-run/run.ts +230 -0
- package/src/resources/eval.ts +278 -0
- package/src/resources/get-bindings.ts +137 -0
- package/src/resources/get.ts +51 -0
- package/src/resources/git.ts +71 -0
- package/src/resources/ignore/index.ts +20 -0
- package/src/resources/ignore/matcher.ts +55 -0
- package/src/resources/list.ts +552 -0
- package/src/resources/mcp/add.ts +105 -0
- package/src/resources/mcp/placeholder-resolver.ts +63 -0
- package/src/resources/picker/ink.tsx +123 -0
- package/src/resources/picker/tty.ts +30 -0
- package/src/resources/plugin.ts +560 -0
- package/src/resources/reference.ts +170 -0
- package/src/resources/render.ts +198 -0
- package/src/resources/run/agent-exec.ts +115 -0
- package/src/resources/run/attachments.ts +300 -0
- package/src/resources/run/create.ts +181 -0
- package/src/resources/run/epilogue.ts +200 -0
- package/src/resources/run/header.ts +72 -0
- package/src/resources/run/plugins.ts +32 -0
- package/src/resources/run/prepare.ts +350 -0
- package/src/resources/run/references.ts +77 -0
- package/src/resources/run/resolve.ts +18 -0
- package/src/resources/run/resume.ts +122 -0
- package/src/resources/run/stream.ts +96 -0
- package/src/resources/run/vaults.ts +33 -0
- package/src/resources/run/workspace.ts +171 -0
- package/src/resources/run-approve.ts +94 -0
- package/src/resources/run-control.ts +59 -0
- package/src/resources/run-format.ts +44 -0
- package/src/resources/run-logs.ts +131 -0
- package/src/resources/run-scores.ts +164 -0
- package/src/resources/run-to-eval-case.ts +160 -0
- package/src/resources/run-trace.ts +102 -0
- package/src/resources/runs.ts +155 -0
- package/src/resources/schedule.ts +132 -0
- package/src/resources/search.ts +62 -0
- package/src/resources/service-account.ts +195 -0
- package/src/resources/session.ts +64 -0
- package/src/resources/skill.ts +577 -0
- package/src/resources/stream/answer.ts +125 -0
- package/src/resources/stream/headless.ts +150 -0
- package/src/resources/stream/ink.tsx +56 -0
- package/src/resources/stream/render-ndjson.ts +44 -0
- package/src/resources/stream/render-plaintext.ts +153 -0
- package/src/resources/stream/submit.ts +145 -0
- package/src/resources/stream/tty.ts +14 -0
- package/src/resources/tag.ts +51 -0
- package/src/resources/usage.ts +443 -0
- package/src/resources/validate.ts +37 -0
- package/src/resources/vault.ts +372 -0
- package/src/resources/version.ts +103 -0
- package/src/runtime.ts +23 -0
- package/src/types/marked-terminal.d.ts +31 -0
- package/src/version.ts +46 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +45 -0
- package/version.js.map +1 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Renderer dispatch for a created run. One of three paths is selected from
|
|
2
|
+
// the output mode and TTY:
|
|
3
|
+
//
|
|
4
|
+
// --json → headless NDJSON (stdout): each session event as Managed Agents JSON
|
|
5
|
+
// inline + TTY → in-process Ink (SessionView), lazily imported
|
|
6
|
+
// inline + non-TTY → headless plaintext (piped stdout), drawn from the fold
|
|
7
|
+
//
|
|
8
|
+
// All three converge on the same epilogue (final Get + usage summary). The
|
|
9
|
+
// headless paths share one driver (runHeadlessStream) over the SDK's
|
|
10
|
+
// followSession, folded by SessionLog; asks are answered through the
|
|
11
|
+
// session's confirmToolUse / grantPermission.
|
|
12
|
+
|
|
13
|
+
import type { Run } from "@stigmer/apis/ai/stigmer/agentic/run/v1/api_pb";
|
|
14
|
+
import { followSession, type Stigmer } from "@stigmer/client";
|
|
15
|
+
import { runEpilogue } from "./epilogue.js";
|
|
16
|
+
import { renderSessionHeader, type SessionHeaderInfo } from "./header.js";
|
|
17
|
+
import type { RunMode } from "./prepare.js";
|
|
18
|
+
import { submitAnswer, type ApproveDefault } from "../stream/answer.js";
|
|
19
|
+
import { runHeadlessStream, type HeadlessRenderer, type HeadlessResult } from "../stream/headless.js";
|
|
20
|
+
import { NdjsonRenderer } from "../stream/render-ndjson.js";
|
|
21
|
+
import { PlaintextRenderer } from "../stream/render-plaintext.js";
|
|
22
|
+
import { isInkSupported } from "../stream/tty.js";
|
|
23
|
+
|
|
24
|
+
/** The user-selected output mode for a streaming command. */
|
|
25
|
+
export type RunOutputMode = "inline" | "json";
|
|
26
|
+
|
|
27
|
+
export interface StreamDeps {
|
|
28
|
+
readonly client: Stigmer;
|
|
29
|
+
readonly sessionId: string;
|
|
30
|
+
readonly runId: string;
|
|
31
|
+
/** Org slug, for follow-up runs created from the Ink composer. */
|
|
32
|
+
readonly org: string;
|
|
33
|
+
readonly mode: RunMode;
|
|
34
|
+
readonly approveDefault: ApproveDefault;
|
|
35
|
+
readonly outputMode: RunOutputMode;
|
|
36
|
+
readonly header: SessionHeaderInfo;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Stream the run to its end, then run the epilogue. Returns the
|
|
41
|
+
* authoritative final run (for artifact download).
|
|
42
|
+
*/
|
|
43
|
+
export async function streamAgentRun(deps: StreamDeps): Promise<Run> {
|
|
44
|
+
if (deps.outputMode === "json") {
|
|
45
|
+
renderSessionHeader(process.stderr, deps.header);
|
|
46
|
+
const result = await runHeadless(deps, new NdjsonRenderer({ data: process.stdout, status: process.stderr }));
|
|
47
|
+
return runEpilogue(deps.client, deps.sessionId, deps.runId, result);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (isInkSupported(process.stdout)) {
|
|
51
|
+
await runInk(deps);
|
|
52
|
+
// Ink owns the live view; the epilogue still prints the exit summary.
|
|
53
|
+
return runEpilogue(deps.client, deps.sessionId, deps.runId, { phase: "", error: "", turn: undefined });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
renderSessionHeader(process.stderr, deps.header);
|
|
57
|
+
const result = await runHeadless(deps, new PlaintextRenderer({ data: process.stdout, status: process.stderr }));
|
|
58
|
+
return runEpilogue(deps.client, deps.sessionId, deps.runId, result);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Drive a headless renderer over the session's log, with Ctrl-C wired to stop
|
|
62
|
+
// the follow cleanly (the driver treats an aborted signal as a clean exit and
|
|
63
|
+
// the epilogue prints the phase).
|
|
64
|
+
async function runHeadless(deps: StreamDeps, renderer: HeadlessRenderer): Promise<HeadlessResult> {
|
|
65
|
+
const controller = new AbortController();
|
|
66
|
+
const onSignal = (): void => controller.abort();
|
|
67
|
+
process.once("SIGINT", onSignal);
|
|
68
|
+
process.once("SIGTERM", onSignal);
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
return await runHeadlessStream({
|
|
72
|
+
follow: (signal) => followSession(deps.client, deps.sessionId, { signal }),
|
|
73
|
+
answer: (toolUseId, answer) => submitAnswer(deps.client, deps.sessionId, toolUseId, answer),
|
|
74
|
+
approveDefault: deps.approveDefault,
|
|
75
|
+
renderer,
|
|
76
|
+
sessionId: deps.sessionId,
|
|
77
|
+
runId: deps.runId,
|
|
78
|
+
signal: controller.signal,
|
|
79
|
+
});
|
|
80
|
+
} finally {
|
|
81
|
+
process.removeListener("SIGINT", onSignal);
|
|
82
|
+
process.removeListener("SIGTERM", onSignal);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Lazily import the Ink renderer so React/Ink load only on the interactive path
|
|
87
|
+
// (non-streaming commands and --help never pay for them).
|
|
88
|
+
async function runInk(deps: StreamDeps): Promise<void> {
|
|
89
|
+
const { runInkSession } = await import("../stream/ink.js");
|
|
90
|
+
await runInkSession({
|
|
91
|
+
client: deps.client,
|
|
92
|
+
sessionId: deps.sessionId,
|
|
93
|
+
org: deps.org,
|
|
94
|
+
mode: deps.mode === "plan" ? "plan" : "agent",
|
|
95
|
+
});
|
|
96
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// The vaults a new conversation uses, from `stigmer run --vault <ref>`.
|
|
2
|
+
//
|
|
3
|
+
// A run carries no keys of its own: each turn reads its sender's My vault
|
|
4
|
+
// (unless `--no-my-vault`) and then these vaults, in the order given. Each
|
|
5
|
+
// reference resolves by the one rule every run flag naming resources shares
|
|
6
|
+
// (references.ts). A vault written twice is sent once, in its first
|
|
7
|
+
// position: the first vault holding a key wins, so a second mention would
|
|
8
|
+
// change nothing.
|
|
9
|
+
|
|
10
|
+
import { ApiResourceKind } from "@stigmer/apis/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
11
|
+
import type { ApiResourceReference } from "@stigmer/apis/ai/stigmer/commons/apiresource/io_pb";
|
|
12
|
+
import type { Stigmer } from "@stigmer/client";
|
|
13
|
+
import { resolveRunReferences } from "./references.js";
|
|
14
|
+
|
|
15
|
+
/** The vault reads an id lookup needs, injectable for tests. */
|
|
16
|
+
export type VaultReader = Pick<Stigmer, "vault">;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Resolve each `--vault` reference to the reference the conversation stores,
|
|
20
|
+
* in order, a reference written twice once. An empty or malformed reference
|
|
21
|
+
* is a usage error.
|
|
22
|
+
*/
|
|
23
|
+
export function resolveRunVaults(
|
|
24
|
+
client: VaultReader,
|
|
25
|
+
refs: readonly string[],
|
|
26
|
+
org: string,
|
|
27
|
+
): Promise<ApiResourceReference[]> {
|
|
28
|
+
return resolveRunReferences(
|
|
29
|
+
{ flag: "--vault", noun: "vault", kind: ApiResourceKind.vault, get: (id) => client.vault.get(id) },
|
|
30
|
+
refs,
|
|
31
|
+
org,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// Workspace flag parsing for runs.
|
|
2
|
+
//
|
|
3
|
+
// Ports the Go CLI's run_workspace.go: turns repeatable `--workspace` values
|
|
4
|
+
// (plus `--branch`/`--commit`) into WorkspaceEntry protos. A workspace is either
|
|
5
|
+
// an HTTPS git repo (branch/commit allowed) or a local directory (branch/commit
|
|
6
|
+
// rejected). SSH git URLs are rejected with HTTPS guidance, and `--branch`/
|
|
7
|
+
// `--commit` only apply to a single git workspace.
|
|
8
|
+
|
|
9
|
+
import { statSync } from "node:fs";
|
|
10
|
+
import { homedir } from "node:os";
|
|
11
|
+
import { basename, isAbsolute, resolve } from "node:path";
|
|
12
|
+
import { create } from "@bufbuild/protobuf";
|
|
13
|
+
import {
|
|
14
|
+
GitRepoSourceSchema,
|
|
15
|
+
LocalPathSourceSchema,
|
|
16
|
+
type WorkspaceEntry,
|
|
17
|
+
WorkspaceEntrySchema,
|
|
18
|
+
type WorkspaceSource,
|
|
19
|
+
WorkspaceSourceSchema,
|
|
20
|
+
} from "@stigmer/apis/ai/stigmer/agentic/session/v1/workspace_pb";
|
|
21
|
+
import { UsageError } from "../../errors/index.js";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Convert `--workspace`/`--branch`/`--commit` flags into WorkspaceEntry protos.
|
|
25
|
+
* Returns an empty list when no workspace is requested. Mirrors Go's
|
|
26
|
+
* parseWorkspaceEntries, including the single-git-workspace rule for
|
|
27
|
+
* branch/commit and duplicate-name detection.
|
|
28
|
+
*/
|
|
29
|
+
export function parseWorkspaceEntries(
|
|
30
|
+
workspaces: readonly string[],
|
|
31
|
+
branch: string,
|
|
32
|
+
commit: string,
|
|
33
|
+
): WorkspaceEntry[] {
|
|
34
|
+
if (workspaces.length === 0) {
|
|
35
|
+
if (branch !== "" || commit !== "") {
|
|
36
|
+
throw new UsageError("--branch and --commit require --workspace");
|
|
37
|
+
}
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (workspaces.length > 1 && (branch !== "" || commit !== "")) {
|
|
42
|
+
throw new UsageError("--branch and --commit are only valid with a single git workspace");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const entries: WorkspaceEntry[] = [];
|
|
46
|
+
const seenNames = new Map<string, string>(); // derived name -> original value
|
|
47
|
+
for (const ws of workspaces) {
|
|
48
|
+
const source = parseWorkspaceSource(ws, branch, commit);
|
|
49
|
+
const name = deriveEntryName(ws);
|
|
50
|
+
const prev = seenNames.get(name);
|
|
51
|
+
if (prev !== undefined) {
|
|
52
|
+
throw new UsageError(
|
|
53
|
+
`duplicate workspace name "${name}" derived from both "${prev}" and "${ws}"; ` +
|
|
54
|
+
"use distinct directory names or repository URLs",
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
seenNames.set(name, ws);
|
|
58
|
+
entries.push(create(WorkspaceEntrySchema, { name, source }));
|
|
59
|
+
}
|
|
60
|
+
return entries;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The absolute paths of any local (non-git) workspace roots. Attachment
|
|
65
|
+
* processing uses these to decide whether a file is workspace-relative (no
|
|
66
|
+
* upload) versus an upload. Mirrors Go's localWorkspaceRoots.
|
|
67
|
+
*/
|
|
68
|
+
export function localWorkspaceRoots(entries: readonly WorkspaceEntry[]): string[] {
|
|
69
|
+
const roots: string[] = [];
|
|
70
|
+
for (const entry of entries) {
|
|
71
|
+
if (entry.source?.source.case === "localPath") {
|
|
72
|
+
roots.push(entry.source.source.value.path);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return roots;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** The derived display names of the workspace entries, for the session header. */
|
|
79
|
+
export function workspaceNames(entries: readonly WorkspaceEntry[]): string[] {
|
|
80
|
+
return entries.map((entry) => entry.name);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Mirrors Go's parseWorkspaceSource: variant selection (git vs local) plus the
|
|
84
|
+
// branch/commit applicability rules and SSH rejection.
|
|
85
|
+
function parseWorkspaceSource(workspace: string, branch: string, commit: string): WorkspaceSource {
|
|
86
|
+
if (isSshGitUrl(workspace)) {
|
|
87
|
+
throw new UsageError(
|
|
88
|
+
`SSH git URLs are not supported: ${workspace}\n\n` +
|
|
89
|
+
"Use HTTPS instead: https://github.com/org/repo",
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (isGitUrl(workspace)) {
|
|
94
|
+
return create(WorkspaceSourceSchema, {
|
|
95
|
+
source: { case: "gitRepo", value: create(GitRepoSourceSchema, { url: workspace, branch, commit }) },
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (branch !== "" || commit !== "") {
|
|
100
|
+
throw new UsageError("--branch and --commit are only valid with git workspace URLs (https://...)");
|
|
101
|
+
}
|
|
102
|
+
return parseLocalWorkspace(workspace);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Resolve a local path, verify it is an existing directory, and wrap it as a
|
|
106
|
+
// LocalPathSource. Mirrors Go's parseLocalWorkspace.
|
|
107
|
+
function parseLocalWorkspace(path: string): WorkspaceSource {
|
|
108
|
+
const resolved = resolveLocalPath(path);
|
|
109
|
+
let isDir: boolean;
|
|
110
|
+
try {
|
|
111
|
+
isDir = statSync(resolved).isDirectory();
|
|
112
|
+
} catch (err) {
|
|
113
|
+
const e = err as NodeJS.ErrnoException;
|
|
114
|
+
if (e.code === "ENOENT") throw new UsageError(`workspace path does not exist: ${resolved}`);
|
|
115
|
+
throw new UsageError(`cannot access workspace path ${resolved}: ${e.message}`);
|
|
116
|
+
}
|
|
117
|
+
if (!isDir) throw new UsageError(`workspace path is not a directory: ${resolved}`);
|
|
118
|
+
|
|
119
|
+
return create(WorkspaceSourceSchema, {
|
|
120
|
+
source: { case: "localPath", value: create(LocalPathSourceSchema, { path: resolved }) },
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// A short identity for the entry: the repo name for git URLs, the directory
|
|
125
|
+
// basename for local paths. Mirrors Go's deriveEntryName.
|
|
126
|
+
function deriveEntryName(workspace: string): string {
|
|
127
|
+
if (isGitUrl(workspace)) return deriveGitRepoName(workspace);
|
|
128
|
+
return deriveLocalDirName(workspace);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Last non-empty URL path segment, sans ".git". Mirrors Go's deriveGitRepoName.
|
|
132
|
+
function deriveGitRepoName(rawUrl: string): string {
|
|
133
|
+
let path: string;
|
|
134
|
+
try {
|
|
135
|
+
path = new URL(rawUrl).pathname;
|
|
136
|
+
} catch {
|
|
137
|
+
throw new UsageError(`cannot parse git URL for name derivation: ${rawUrl}`);
|
|
138
|
+
}
|
|
139
|
+
path = path.replace(/\/+$/, "").replace(/\.git$/, "");
|
|
140
|
+
const segments = path.split("/");
|
|
141
|
+
for (let i = segments.length - 1; i >= 0; i--) {
|
|
142
|
+
if (segments[i] !== "") return segments[i];
|
|
143
|
+
}
|
|
144
|
+
throw new UsageError(`cannot derive workspace name from URL: ${rawUrl}`);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Directory basename of the resolved absolute path. Mirrors Go's
|
|
148
|
+
// deriveLocalDirName — "." resolves to the CWD basename, not ".".
|
|
149
|
+
function deriveLocalDirName(path: string): string {
|
|
150
|
+
const resolved = resolveLocalPath(path);
|
|
151
|
+
const name = basename(resolved);
|
|
152
|
+
if (name === "." || name === "/" || name === "") {
|
|
153
|
+
throw new UsageError(`cannot derive workspace name from path: ${path}`);
|
|
154
|
+
}
|
|
155
|
+
return name;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Expand a leading "~/" and make the path absolute. Mirrors Go's resolveLocalPath.
|
|
159
|
+
function resolveLocalPath(path: string): string {
|
|
160
|
+
let p = path;
|
|
161
|
+
if (p.startsWith("~/")) p = resolve(homedir(), p.slice(2));
|
|
162
|
+
return isAbsolute(p) ? p : resolve(p);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function isGitUrl(s: string): boolean {
|
|
166
|
+
return s.startsWith("https://") || s.startsWith("http://");
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function isSshGitUrl(s: string): boolean {
|
|
170
|
+
return s.startsWith("git@");
|
|
171
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// `runs approve` — answer a tool call a run waits on, through the run's
|
|
2
|
+
// session.
|
|
3
|
+
//
|
|
4
|
+
// The run's waiting asks are read from its events (the fold's `Turn.asks`);
|
|
5
|
+
// each is named by its tool use id, which `runs logs` shows on the
|
|
6
|
+
// stigmer.permission.asked line. `--tool-call` picks one; without it the run
|
|
7
|
+
// must wait on exactly one. The action answers it:
|
|
8
|
+
//
|
|
9
|
+
// allow ...... confirmToolUse, allow
|
|
10
|
+
// deny ....... confirmToolUse, deny, with `--comment` as the reason the
|
|
11
|
+
// agent reads
|
|
12
|
+
// allow-all .. grantPermission: this call and every waiting call of its
|
|
13
|
+
// class run for the rest of the turn
|
|
14
|
+
//
|
|
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. The
|
|
17
|
+
// retired words approve, reject and approve-all are refused with the word that
|
|
18
|
+
// replaced them.
|
|
19
|
+
|
|
20
|
+
import { foldSession, turnOf, type Stigmer, type ToolUse } from "@stigmer/client";
|
|
21
|
+
import { UsageError } from "../errors/index.js";
|
|
22
|
+
import { listSessionEvents, sessionOfRun } from "./session.js";
|
|
23
|
+
import { submitAnswer, type AskAnswer } from "./stream/answer.js";
|
|
24
|
+
|
|
25
|
+
export interface ApproveAgentOptions {
|
|
26
|
+
readonly runId: string;
|
|
27
|
+
/** The tool use to answer; "" when the run waits on exactly one. */
|
|
28
|
+
readonly toolCallId: string;
|
|
29
|
+
readonly action: string;
|
|
30
|
+
readonly comment: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The ask that was answered, and how. */
|
|
34
|
+
export interface ApproveResult {
|
|
35
|
+
readonly toolUseId: string;
|
|
36
|
+
readonly toolName: string;
|
|
37
|
+
readonly answer: AskAnswer["kind"];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Answer one of the run's waiting tool calls. */
|
|
41
|
+
export async function approveAgentToolCall(client: Stigmer, opts: ApproveAgentOptions): Promise<ApproveResult> {
|
|
42
|
+
const answer = answerOf(opts.action, opts.comment);
|
|
43
|
+
const run = await client.run.get(opts.runId);
|
|
44
|
+
const sessionId = sessionOfRun(run);
|
|
45
|
+
const turn = turnOf(foldSession(await listSessionEvents(client, sessionId, opts.runId)), opts.runId);
|
|
46
|
+
const ask = pickAsk(opts.runId, turn?.asks ?? [], opts.toolCallId);
|
|
47
|
+
await submitAnswer(client, sessionId, ask.id, answer);
|
|
48
|
+
return { toolUseId: ask.id, toolName: ask.name, answer: answer.kind };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// The actions `--action` no longer takes, each with the word that replaced it.
|
|
52
|
+
const RETIRED: Readonly<Record<string, string>> = {
|
|
53
|
+
approve: '"approve" is now "allow"',
|
|
54
|
+
reject: '"reject" is now "deny"',
|
|
55
|
+
"approve-all": '"approve-all" is now "allow-all"',
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
function answerOf(action: string, comment: string): AskAnswer {
|
|
59
|
+
switch (action) {
|
|
60
|
+
case "deny":
|
|
61
|
+
return { kind: "deny", reason: comment };
|
|
62
|
+
case "allow":
|
|
63
|
+
case "allow-all":
|
|
64
|
+
if (comment !== "") {
|
|
65
|
+
throw new UsageError("--comment is the reason given with a deny; an allow carries none");
|
|
66
|
+
}
|
|
67
|
+
return action === "allow" ? { kind: "allow" } : { kind: "grant" };
|
|
68
|
+
}
|
|
69
|
+
const replaced = RETIRED[action];
|
|
70
|
+
throw new UsageError(
|
|
71
|
+
`invalid --action "${action}": ${replaced === undefined ? "" : `${replaced}; `}must be one of: allow, deny, allow-all`,
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function pickAsk(runId: string, asks: readonly ToolUse[], toolCallId: string): ToolUse {
|
|
76
|
+
if (asks.length === 0) {
|
|
77
|
+
throw new UsageError(`run ${runId} has no tool call waiting for an answer`);
|
|
78
|
+
}
|
|
79
|
+
if (toolCallId !== "") {
|
|
80
|
+
const ask = asks.find((candidate) => candidate.id === toolCallId);
|
|
81
|
+
if (ask === undefined) {
|
|
82
|
+
throw new UsageError(`tool call ${toolCallId} does not wait for an answer in run ${runId}; waiting:\n${listAsks(asks)}`);
|
|
83
|
+
}
|
|
84
|
+
return ask;
|
|
85
|
+
}
|
|
86
|
+
if (asks.length > 1) {
|
|
87
|
+
throw new UsageError(`run ${runId} waits on ${asks.length} tool calls; name one with --tool-call:\n${listAsks(asks)}`);
|
|
88
|
+
}
|
|
89
|
+
return asks[0];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function listAsks(asks: readonly ToolUse[]): string {
|
|
93
|
+
return asks.map((ask) => ` ${ask.id} ${ask.name}`).join("\n");
|
|
94
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Lifecycle control for runs (cancel / terminate / pause / resume).
|
|
2
|
+
//
|
|
3
|
+
// Mirrors Go's execution.Cancel/Terminate/Pause/Resume (cancel.go + pause.go):
|
|
4
|
+
// each verb returns the resulting phase as a human label, read back from the
|
|
5
|
+
// server so the success line reports the authoritative post-mutation state.
|
|
6
|
+
// terminate, pause and resume issue the run controller RPC. cancel
|
|
7
|
+
// interrupts the run's session (runs.ts `cancelAgentRun`): every unfinished
|
|
8
|
+
// turn of the conversation stops, and the turns it stopped are reported. A
|
|
9
|
+
// run that had already ended is left as it is and says so.
|
|
10
|
+
//
|
|
11
|
+
// These return a plain `{ phase }` rather than a CommandResult so the command
|
|
12
|
+
// layer owns presentation (single source of the success wording).
|
|
13
|
+
|
|
14
|
+
import { create } from "@bufbuild/protobuf";
|
|
15
|
+
import type { Run } from "@stigmer/apis/ai/stigmer/agentic/run/v1/api_pb";
|
|
16
|
+
import { RunPhase } from "@stigmer/apis/ai/stigmer/agentic/run/v1/enum_pb";
|
|
17
|
+
import {
|
|
18
|
+
PauseRunInputSchema,
|
|
19
|
+
ResumeRunInputSchema,
|
|
20
|
+
TerminateRunInputSchema,
|
|
21
|
+
} from "@stigmer/apis/ai/stigmer/agentic/run/v1/io_pb";
|
|
22
|
+
import type { Stigmer } from "@stigmer/client";
|
|
23
|
+
import { cancelAgentRun, formatAgentPhase } from "./runs.js";
|
|
24
|
+
|
|
25
|
+
/** Outcome of a control verb: the post-mutation phase. */
|
|
26
|
+
export interface ControlResult {
|
|
27
|
+
readonly phase: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Outcome of a cancel: the phase, whether it had already ended, and the turns stopped. */
|
|
31
|
+
export interface CancelResult extends ControlResult {
|
|
32
|
+
readonly wasAlreadyTerminal: boolean;
|
|
33
|
+
readonly stoppedRunIds: readonly string[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Cancel a run: interrupt its session, stopping every unfinished turn of it. */
|
|
37
|
+
export async function cancelRun(client: Stigmer, id: string): Promise<CancelResult> {
|
|
38
|
+
const { run, wasAlreadyTerminal, stoppedRunIds } = await cancelAgentRun(client, id);
|
|
39
|
+
return { ...toResult(run), wasAlreadyTerminal, stoppedRunIds };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Force-stop a run immediately. Mirrors Go execution.Terminate. */
|
|
43
|
+
export async function terminateRun(client: Stigmer, id: string, reason: string): Promise<ControlResult> {
|
|
44
|
+
return toResult(await client.run.terminate(create(TerminateRunInputSchema, { id, reason })));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Pause a run in progress. Mirrors Go execution.Pause. */
|
|
48
|
+
export async function pauseRun(client: Stigmer, id: string, reason: string): Promise<ControlResult> {
|
|
49
|
+
return toResult(await client.run.pause(create(PauseRunInputSchema, { id, reason })));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Resume a paused run. Mirrors Go execution.Resume (no reason). */
|
|
53
|
+
export async function resumeRun(client: Stigmer, id: string): Promise<ControlResult> {
|
|
54
|
+
return toResult(await client.run.resume(create(ResumeRunInputSchema, { id })));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function toResult(run: Run): ControlResult {
|
|
58
|
+
return { phase: formatAgentPhase(run.status?.phase ?? RunPhase.RUN_PHASE_UNSPECIFIED) };
|
|
59
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Shared, presentation-only formatters for run output.
|
|
2
|
+
//
|
|
3
|
+
// These mirror helpers in Go's pkg/display + internal/cli/execution (duration
|
|
4
|
+
// math, ellipsis truncation) and add the compact token count the usage
|
|
5
|
+
// reports and the run epilogue share. They live here, away from any RPC code,
|
|
6
|
+
// so run output formats durations, tokens and truncated text the same way
|
|
7
|
+
// everywhere.
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Human duration between two ISO 8601 timestamps. Mirrors Go's calculateDuration:
|
|
11
|
+
* "-" when either bound is missing/unparseable, "<n>s" under a minute,
|
|
12
|
+
* "<m>m <s>s" under an hour, "<h>h <m>m" otherwise.
|
|
13
|
+
*/
|
|
14
|
+
export function calculateDuration(start: string, end: string): string {
|
|
15
|
+
if (start === "" || end === "") return "-";
|
|
16
|
+
const startMs = Date.parse(start);
|
|
17
|
+
const endMs = Date.parse(end);
|
|
18
|
+
if (Number.isNaN(startMs) || Number.isNaN(endMs)) return "-";
|
|
19
|
+
|
|
20
|
+
const totalSeconds = Math.floor((endMs - startMs) / 1000);
|
|
21
|
+
if (totalSeconds < 60) return `${totalSeconds}s`;
|
|
22
|
+
if (totalSeconds < 3600) return `${Math.floor(totalSeconds / 60)}m ${totalSeconds % 60}s`;
|
|
23
|
+
return `${Math.floor(totalSeconds / 3600)}h ${Math.floor((totalSeconds % 3600) / 60)}m`;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Truncate to `maxLen`, appending "..." when cut. Mirrors Go's display.TruncateWithEllipsis. */
|
|
27
|
+
export function truncateWithEllipsis(value: string, maxLen: number): string {
|
|
28
|
+
if (value.length <= maxLen) return value;
|
|
29
|
+
if (maxLen <= 3) return value.slice(0, maxLen);
|
|
30
|
+
return `${value.slice(0, maxLen - 3)}...`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Compact token count: the integer under a thousand, then one decimal with a
|
|
35
|
+
* "k" or "M" suffix ("18.4k", "1.2M"). Takes the wire's int64 as is; display
|
|
36
|
+
* precision makes the Number conversion harmless past 2^53.
|
|
37
|
+
*/
|
|
38
|
+
export function formatTokenCount(count: bigint): string {
|
|
39
|
+
const n = Number(count);
|
|
40
|
+
if (n < 1000) return String(count);
|
|
41
|
+
// 999,950 and up would round to "1000.0k"; it reads as "1.0M" instead.
|
|
42
|
+
if (n < 999_950) return `${(n / 1000).toFixed(1)}k`;
|
|
43
|
+
return `${(n / 1_000_000).toFixed(1)}M`;
|
|
44
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// `runs logs` — a run's events, one line each.
|
|
2
|
+
//
|
|
3
|
+
// A run is one turn of its session, and the turn's events are the session's
|
|
4
|
+
// log filtered to the run. Without --follow the run's stored events are
|
|
5
|
+
// listed (every page) and printed. With --follow the same listing is printed,
|
|
6
|
+
// then the session is followed from the last listed event: every new event is
|
|
7
|
+
// folded, the run's own are printed, and the follow stops once the fold says
|
|
8
|
+
// the turn has ended.
|
|
9
|
+
//
|
|
10
|
+
// A line is the event's Managed Agents type and its gist: the text of an
|
|
11
|
+
// event that carries content (a message, a tool result), else its Managed
|
|
12
|
+
// Agents JSON without the type, id and time (a tool use's name and input, an
|
|
13
|
+
// ask with its tool_use_id, a status's phase). The tool_use_id on a
|
|
14
|
+
// stigmer.permission.asked line is what `runs approve --tool-call` takes.
|
|
15
|
+
//
|
|
16
|
+
// Ctrl-C ends a follow cleanly: the SIGINT aborts the follow, which then
|
|
17
|
+
// simply stops (no stack trace).
|
|
18
|
+
|
|
19
|
+
import type { JsonObject, JsonValue } from "@bufbuild/protobuf";
|
|
20
|
+
import type { SessionEvent } from "@stigmer/apis/ai/stigmer/agentic/session/v1/event_pb";
|
|
21
|
+
import { followSession, SessionLog, toManagedAgentsJson, turnOf, type Stigmer, type Turn } from "@stigmer/client";
|
|
22
|
+
import { shouldColorize, styler } from "../output/style.js";
|
|
23
|
+
import { listSessionEvents, sessionOfRun } from "./session.js";
|
|
24
|
+
|
|
25
|
+
const MAX_LINE_LEN = 200;
|
|
26
|
+
|
|
27
|
+
export interface LogsOptions {
|
|
28
|
+
readonly runId: string;
|
|
29
|
+
readonly follow: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Where rendered log lines go. */
|
|
33
|
+
export interface LineSink {
|
|
34
|
+
write(line: string): void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** A line sink and whether to colour it. */
|
|
38
|
+
export interface LogsStreams {
|
|
39
|
+
readonly out: LineSink;
|
|
40
|
+
readonly colorize: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Print or follow a run's events. `signal` aborts a follow cleanly. */
|
|
44
|
+
export async function streamRunLogs(
|
|
45
|
+
client: Stigmer,
|
|
46
|
+
opts: LogsOptions,
|
|
47
|
+
signal: AbortSignal,
|
|
48
|
+
streams: LogsStreams = defaultStreams(),
|
|
49
|
+
): Promise<void> {
|
|
50
|
+
const sessionId = sessionOfRun(await client.run.get(opts.runId));
|
|
51
|
+
const events = await listSessionEvents(client, sessionId, opts.runId);
|
|
52
|
+
if (!opts.follow) {
|
|
53
|
+
if (events.length === 0) {
|
|
54
|
+
streams.out.write("No events recorded for this run.\n");
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
for (const event of events) renderEvent(event, streams);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
for (const event of events) renderEvent(event, streams);
|
|
62
|
+
const log = new SessionLog();
|
|
63
|
+
log.apply(events);
|
|
64
|
+
const listed = turnOf(log.snapshot(), opts.runId);
|
|
65
|
+
if (listed?.ended === true) {
|
|
66
|
+
renderEnd(listed, streams);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
for await (const frame of followSession(client, sessionId, { signal, afterSeq: log.snapshot().lastSeq })) {
|
|
70
|
+
if (frame.frame.case === "event" && frame.frame.value.runId === opts.runId) renderEvent(frame.frame.value, streams);
|
|
71
|
+
log.applyFrame(frame);
|
|
72
|
+
const turn = turnOf(log.snapshot(), opts.runId);
|
|
73
|
+
if (turn?.ended === true) {
|
|
74
|
+
renderEnd(turn, streams);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// One event's log line: its type, tinted by who wrote it, and its gist.
|
|
81
|
+
function renderEvent(event: SessionEvent, streams: LogsStreams): void {
|
|
82
|
+
const style = styler(streams.colorize);
|
|
83
|
+
const json = toManagedAgentsJson(event);
|
|
84
|
+
const type = String(json.type);
|
|
85
|
+
streams.out.write(`[${tintOf(type, style)(type)}] ${truncate(gistOf(json), MAX_LINE_LEN)}\n`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function renderEnd(turn: Turn, streams: LogsStreams): void {
|
|
89
|
+
const style = styler(streams.colorize);
|
|
90
|
+
streams.out.write(`\n${style.dim("[end]")} run ${turn.status?.phase ?? "ended"}\n`);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// A person's events cyan, the agent's green, the session's yellow, Stigmer's own dim.
|
|
94
|
+
function tintOf(type: string, style: ReturnType<typeof styler>): (text: string) => string {
|
|
95
|
+
if (type.startsWith("user.")) return style.cyan;
|
|
96
|
+
if (type.startsWith("agent.")) return style.green;
|
|
97
|
+
if (type.startsWith("session.")) return style.yellow;
|
|
98
|
+
return style.dim;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// The text an event carries, else its JSON without what the line already says.
|
|
102
|
+
function gistOf(json: JsonObject): string {
|
|
103
|
+
const { type: _type, id: _id, processed_at: _processedAt, ...rest } = json;
|
|
104
|
+
const text = textOf(rest.content);
|
|
105
|
+
if (text !== undefined) return text;
|
|
106
|
+
return Object.keys(rest).length === 0 ? "" : JSON.stringify(rest);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// The joined text blocks of a content list; undefined when there is no list.
|
|
110
|
+
function textOf(content: JsonValue | undefined): string | undefined {
|
|
111
|
+
if (!Array.isArray(content)) return undefined;
|
|
112
|
+
return content
|
|
113
|
+
.map((block) => (isObject(block) && typeof block.text === "string" ? block.text : ""))
|
|
114
|
+
.join("");
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function isObject(value: JsonValue): value is JsonObject {
|
|
118
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Cap a line (197 + "...").
|
|
122
|
+
function truncate(value: string, maxLen: number): string {
|
|
123
|
+
return value.length > maxLen ? `${value.slice(0, maxLen - 3)}...` : value;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function defaultStreams(): LogsStreams {
|
|
127
|
+
return {
|
|
128
|
+
out: { write: (line: string) => void process.stdout.write(line) },
|
|
129
|
+
colorize: shouldColorize(process.stdout),
|
|
130
|
+
};
|
|
131
|
+
}
|