@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,300 @@
|
|
|
1
|
+
// Attachment processing for runs.
|
|
2
|
+
//
|
|
3
|
+
// Ports the Go CLI's run_attachments.go + run_attachments_zip.go. Each `--attach`
|
|
4
|
+
// path is either recorded as a workspace-relative reference (when it lives inside
|
|
5
|
+
// a local workspace root — no upload, the agent reads it directly) or uploaded
|
|
6
|
+
// via the UploadAttachment RPC and returned as an Attachment proto. Directories
|
|
7
|
+
// are zipped (hidden entries and symlinks skipped) and capped at 10 MB to match
|
|
8
|
+
// the server's gRPC receive limit.
|
|
9
|
+
|
|
10
|
+
import { readdirSync, readFileSync, realpathSync, statSync } from "node:fs";
|
|
11
|
+
import { extname, join, relative, resolve, sep } from "node:path";
|
|
12
|
+
import { create } from "@bufbuild/protobuf";
|
|
13
|
+
import { zipSync } from "fflate";
|
|
14
|
+
import { type Attachment, AttachmentSchema } from "@stigmer/apis/ai/stigmer/agentic/run/v1/spec_pb";
|
|
15
|
+
import {
|
|
16
|
+
type UploadAttachmentRequest,
|
|
17
|
+
UploadAttachmentRequestSchema,
|
|
18
|
+
type UploadAttachmentResponse,
|
|
19
|
+
} from "@stigmer/apis/ai/stigmer/agentic/run/v1/io_pb";
|
|
20
|
+
import { UsageError } from "../../errors/index.js";
|
|
21
|
+
|
|
22
|
+
// Must match the server's grpc.MaxRecvMsgSize (Go: maxAttachmentSize).
|
|
23
|
+
const MAX_ATTACHMENT_SIZE = 10 * 1024 * 1024; // 10 MB
|
|
24
|
+
|
|
25
|
+
/** A sink for human progress/warning lines (attachments are not byte-parity output). */
|
|
26
|
+
export type ProgressSink = (line: string) => void;
|
|
27
|
+
|
|
28
|
+
/** The minimal UploadAttachment RPC surface, injectable for testing. */
|
|
29
|
+
export interface AttachmentUploader {
|
|
30
|
+
uploadAttachment(req: UploadAttachmentRequest): Promise<UploadAttachmentResponse>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The split result of processing `--attach` paths. Mirrors Go's
|
|
35
|
+
* AttachmentResult: in-workspace files become relative references, everything
|
|
36
|
+
* else becomes an uploaded Attachment.
|
|
37
|
+
*/
|
|
38
|
+
export interface AttachmentResult {
|
|
39
|
+
readonly attachments: Attachment[];
|
|
40
|
+
readonly workspaceFileRefs: string[];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Process `--attach` paths against the local workspace roots. The first root a
|
|
45
|
+
* path falls inside wins and yields a workspace-relative reference; otherwise
|
|
46
|
+
* the path is uploaded. Mirrors Go's AttachmentProcessor.ProcessFiles.
|
|
47
|
+
*/
|
|
48
|
+
export async function processAttachments(
|
|
49
|
+
uploader: AttachmentUploader,
|
|
50
|
+
paths: readonly string[],
|
|
51
|
+
workspaceRoots: readonly string[],
|
|
52
|
+
progress?: ProgressSink,
|
|
53
|
+
): Promise<AttachmentResult> {
|
|
54
|
+
const attachments: Attachment[] = [];
|
|
55
|
+
const workspaceFileRefs: string[] = [];
|
|
56
|
+
if (paths.length === 0) return { attachments, workspaceFileRefs };
|
|
57
|
+
|
|
58
|
+
const takenDirNames = new Set<string>();
|
|
59
|
+
for (const path of paths) {
|
|
60
|
+
const rel = matchWorkspaceRoot(path, workspaceRoots);
|
|
61
|
+
if (rel !== null) {
|
|
62
|
+
progress?.(`Referencing workspace file: ${rel}`);
|
|
63
|
+
workspaceFileRefs.push(rel);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
attachments.push(await processFile(uploader, path, takenDirNames, progress));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return { attachments, workspaceFileRefs };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Returns the workspace-relative path if `path` is inside any root (first match
|
|
73
|
+
// wins), else null. Mirrors Go's matchWorkspaceRoot + workspaceRelativePath:
|
|
74
|
+
// both sides are resolved through realpath to prevent symlink escapes.
|
|
75
|
+
function matchWorkspaceRoot(path: string, roots: readonly string[]): string | null {
|
|
76
|
+
for (const root of roots) {
|
|
77
|
+
let evalFile: string;
|
|
78
|
+
let evalRoot: string;
|
|
79
|
+
try {
|
|
80
|
+
evalFile = realpathSync(resolve(path));
|
|
81
|
+
evalRoot = realpathSync(root);
|
|
82
|
+
} catch {
|
|
83
|
+
continue; // unresolvable path is treated as outside this root
|
|
84
|
+
}
|
|
85
|
+
if (evalFile === evalRoot || evalFile.startsWith(evalRoot + sep)) {
|
|
86
|
+
return toSlash(relative(evalRoot, evalFile));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Stat the path, then upload a file or zip+upload a directory. Mirrors Go's
|
|
93
|
+
// processFile.
|
|
94
|
+
async function processFile(
|
|
95
|
+
uploader: AttachmentUploader,
|
|
96
|
+
path: string,
|
|
97
|
+
takenDirNames: Set<string>,
|
|
98
|
+
progress?: ProgressSink,
|
|
99
|
+
): Promise<Attachment> {
|
|
100
|
+
let stat: ReturnType<typeof statSync>;
|
|
101
|
+
try {
|
|
102
|
+
stat = statSync(path);
|
|
103
|
+
} catch (err) {
|
|
104
|
+
const e = err as NodeJS.ErrnoException;
|
|
105
|
+
if (e.code === "ENOENT") throw new UsageError(`file not found: ${path}`);
|
|
106
|
+
throw new UsageError(`failed to stat attachment "${path}": ${e.message}`);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (stat.isDirectory()) return processDirectory(uploader, path, takenDirNames, progress);
|
|
110
|
+
|
|
111
|
+
const absPath = resolve(path);
|
|
112
|
+
const filename = basenameOf(path);
|
|
113
|
+
const contentType = detectContentType(filename);
|
|
114
|
+
progress?.(`Uploading ${filename} (${formatFileSize(stat.size)})...`);
|
|
115
|
+
const attachment = await uploadBytes(uploader, readFileSync(path), filename, contentType, progress);
|
|
116
|
+
attachment.localPath = absPath;
|
|
117
|
+
return attachment;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Zip a directory (extract=true so the runner unpacks it at mount_path) and
|
|
121
|
+
// upload it as one archive. Mirrors Go's processDirectory.
|
|
122
|
+
async function processDirectory(
|
|
123
|
+
uploader: AttachmentUploader,
|
|
124
|
+
path: string,
|
|
125
|
+
takenDirNames: Set<string>,
|
|
126
|
+
progress?: ProgressSink,
|
|
127
|
+
): Promise<Attachment> {
|
|
128
|
+
const absPath = resolve(path);
|
|
129
|
+
// Two same-named directories (`--attach a/data --attach b/data`) would
|
|
130
|
+
// derive the SAME explicit mount path, which the runner rejects as a user
|
|
131
|
+
// contradiction (attachment-injector.ts resolveMountPaths). The CLI derives
|
|
132
|
+
// these names mechanically from basenames, so it owns the rename — the same
|
|
133
|
+
// principle as the React composer's client-side uniquify (sdk/react
|
|
134
|
+
// attachment-utils.ts). Duplicate FILE attachments need no CLI handling:
|
|
135
|
+
// they carry no mountPath, so the runner renames them itself.
|
|
136
|
+
const requestedName = basenameOf(absPath);
|
|
137
|
+
const dirname = uniquifyDirName(requestedName, takenDirNames);
|
|
138
|
+
takenDirNames.add(dirname);
|
|
139
|
+
if (dirname !== requestedName) {
|
|
140
|
+
progress?.(
|
|
141
|
+
`Attaching second '${requestedName}/' as '${dirname}/' (a directory ` +
|
|
142
|
+
`named '${requestedName}' is already attached)`,
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const { bytes, fileCount, originalSize } = zipDirectory(absPath, progress);
|
|
147
|
+
const zipSize = bytes.byteLength;
|
|
148
|
+
progress?.(
|
|
149
|
+
`Zipping directory: ${dirname}/ (${fileCount} files, ` +
|
|
150
|
+
`${formatFileSize(originalSize)} -> ${formatFileSize(zipSize)} compressed)`,
|
|
151
|
+
);
|
|
152
|
+
if (zipSize > MAX_ATTACHMENT_SIZE) {
|
|
153
|
+
throw new UsageError(
|
|
154
|
+
`zipped directory too large (${formatFileSize(zipSize)}). ` +
|
|
155
|
+
`Maximum attachment size is ${formatFileSize(MAX_ATTACHMENT_SIZE)}`,
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const attachment = await uploadBytes(uploader, bytes, `${dirname}.zip`, "application/zip", progress);
|
|
160
|
+
attachment.extract = true;
|
|
161
|
+
attachment.mountPath = `inputs/${dirname}/`;
|
|
162
|
+
attachment.localPath = absPath;
|
|
163
|
+
return attachment;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Upload raw bytes via the RPC and build an Attachment. Mirrors Go's uploadBytes.
|
|
167
|
+
async function uploadBytes(
|
|
168
|
+
uploader: AttachmentUploader,
|
|
169
|
+
content: Uint8Array,
|
|
170
|
+
filename: string,
|
|
171
|
+
contentType: string,
|
|
172
|
+
progress?: ProgressSink,
|
|
173
|
+
): Promise<Attachment> {
|
|
174
|
+
const req = create(UploadAttachmentRequestSchema, { filename, content, contentType });
|
|
175
|
+
let resp: UploadAttachmentResponse;
|
|
176
|
+
try {
|
|
177
|
+
resp = await uploader.uploadAttachment(req);
|
|
178
|
+
} catch (err) {
|
|
179
|
+
throw new UsageError(`failed to upload attachment "${filename}": ${(err as Error).message}`);
|
|
180
|
+
}
|
|
181
|
+
progress?.(`Uploaded ${filename}`);
|
|
182
|
+
return create(AttachmentSchema, { filename, storageKey: resp.storageKey, contentType });
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
interface ZipResult {
|
|
186
|
+
readonly bytes: Uint8Array;
|
|
187
|
+
readonly fileCount: number;
|
|
188
|
+
readonly originalSize: number;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Build a zip of dirPath's contents, skipping hidden entries (and their
|
|
192
|
+
// subtrees) and symlinks. Mirrors Go's zipDirectory.
|
|
193
|
+
function zipDirectory(dirPath: string, progress?: ProgressSink): ZipResult {
|
|
194
|
+
const files: Record<string, Uint8Array> = {};
|
|
195
|
+
let fileCount = 0;
|
|
196
|
+
let originalSize = 0;
|
|
197
|
+
|
|
198
|
+
const walk = (current: string, prefix: string): void => {
|
|
199
|
+
const entries = readdirSync(current, { withFileTypes: true });
|
|
200
|
+
for (const entry of entries) {
|
|
201
|
+
if (entry.name.startsWith(".")) continue; // hidden entry (and subtree if dir)
|
|
202
|
+
const rel = prefix === "" ? entry.name : `${prefix}/${entry.name}`;
|
|
203
|
+
const full = join(current, entry.name);
|
|
204
|
+
if (entry.isSymbolicLink()) {
|
|
205
|
+
progress?.(`Skipping symlink: ${full}`);
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
if (entry.isDirectory()) {
|
|
209
|
+
walk(full, rel);
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
if (!entry.isFile()) continue;
|
|
213
|
+
const content = new Uint8Array(readFileSync(full));
|
|
214
|
+
files[rel] = content;
|
|
215
|
+
fileCount++;
|
|
216
|
+
originalSize += content.byteLength;
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
walk(dirPath, "");
|
|
220
|
+
|
|
221
|
+
if (fileCount === 0) {
|
|
222
|
+
throw new UsageError(`directory contains no attachable files: ${dirPath}`);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return { bytes: zipSync(files, { level: 6 }), fileCount, originalSize };
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// MIME by extension. Go consults the OS mime DB first (non-deterministic across
|
|
229
|
+
// hosts) and falls back to a fixed switch; we use a curated table so the result
|
|
230
|
+
// is deterministic. content_type is advisory — the server re-guesses from the
|
|
231
|
+
// filename when absent — so exact parity with Go's OS DB is not required.
|
|
232
|
+
const MIME_BY_EXT: Readonly<Record<string, string>> = {
|
|
233
|
+
".md": "text/markdown",
|
|
234
|
+
".markdown": "text/markdown",
|
|
235
|
+
".yaml": "application/x-yaml",
|
|
236
|
+
".yml": "application/x-yaml",
|
|
237
|
+
".toml": "application/toml",
|
|
238
|
+
".csv": "text/csv",
|
|
239
|
+
".tsv": "text/tab-separated-values",
|
|
240
|
+
".log": "text/plain",
|
|
241
|
+
".sql": "application/sql",
|
|
242
|
+
".parquet": "application/vnd.apache.parquet",
|
|
243
|
+
".avro": "application/avro",
|
|
244
|
+
".json": "application/json",
|
|
245
|
+
".txt": "text/plain",
|
|
246
|
+
".pdf": "application/pdf",
|
|
247
|
+
".html": "text/html",
|
|
248
|
+
".htm": "text/html",
|
|
249
|
+
".xml": "text/xml",
|
|
250
|
+
".zip": "application/zip",
|
|
251
|
+
".png": "image/png",
|
|
252
|
+
".jpg": "image/jpeg",
|
|
253
|
+
".jpeg": "image/jpeg",
|
|
254
|
+
".gif": "image/gif",
|
|
255
|
+
".svg": "image/svg+xml",
|
|
256
|
+
".js": "text/javascript",
|
|
257
|
+
".ts": "text/plain",
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
function detectContentType(filename: string): string {
|
|
261
|
+
const ext = extname(filename).toLowerCase();
|
|
262
|
+
if (ext === "") return "application/octet-stream";
|
|
263
|
+
return MIME_BY_EXT[ext] ?? "application/octet-stream";
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// Human-readable byte size. Mirrors Go's formatFileSize (1024-based, one decimal).
|
|
267
|
+
function formatFileSize(bytes: number): string {
|
|
268
|
+
const KB = 1024;
|
|
269
|
+
const MB = KB * 1024;
|
|
270
|
+
const GB = MB * 1024;
|
|
271
|
+
if (bytes >= GB) return `${(bytes / GB).toFixed(1)} GB`;
|
|
272
|
+
if (bytes >= MB) return `${(bytes / MB).toFixed(1)} MB`;
|
|
273
|
+
if (bytes >= KB) return `${(bytes / KB).toFixed(1)} KB`;
|
|
274
|
+
return `${bytes} B`;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// Returns `name` unchanged when free, otherwise the first free `name-2`,
|
|
278
|
+
// `name-3`, … variant. Deliberately extension-blind — directory names have no
|
|
279
|
+
// extension semantics ("reports.2024" becomes "reports.2024-2", not
|
|
280
|
+
// "reports-2.2024"), unlike the filename uniquify in the runner and React SDK
|
|
281
|
+
// (shared/attachment-naming.ts / attachment-utils.ts) this mirrors.
|
|
282
|
+
function uniquifyDirName(name: string, taken: ReadonlySet<string>): string {
|
|
283
|
+
if (!taken.has(name)) return name;
|
|
284
|
+
for (let n = 2; ; n++) {
|
|
285
|
+
const candidate = `${name}-${n}`;
|
|
286
|
+
if (!taken.has(candidate)) return candidate;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// path.basename, but resilient to trailing slashes (matches Go filepath.Base
|
|
291
|
+
// semantics closely enough for display/name derivation).
|
|
292
|
+
function basenameOf(p: string): string {
|
|
293
|
+
const cleaned = p.replace(/[/\\]+$/, "");
|
|
294
|
+
const idx = Math.max(cleaned.lastIndexOf("/"), cleaned.lastIndexOf("\\"));
|
|
295
|
+
return idx === -1 ? cleaned : cleaned.slice(idx + 1);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function toSlash(p: string): string {
|
|
299
|
+
return p.split(sep).join("/");
|
|
300
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
// Resource creation for the run path: Run.
|
|
2
|
+
//
|
|
3
|
+
// Ports the Go CLI's run_create.go. We build the full proto messages and drive
|
|
4
|
+
// the generated command controllers directly — the fidelity rule
|
|
5
|
+
// resources/apply/handlers.ts states: the SDK's typed `create(input)` wrappers model a
|
|
6
|
+
// subset of fields, and our attachments/workspace entries are already proto
|
|
7
|
+
// messages, so a round-trip through the input types would be lossy and pointless.
|
|
8
|
+
|
|
9
|
+
import type { Client } from "@connectrpc/connect";
|
|
10
|
+
import { create, type DescService } from "@bufbuild/protobuf";
|
|
11
|
+
import { type Run, RunSchema } from "@stigmer/apis/ai/stigmer/agentic/run/v1/api_pb";
|
|
12
|
+
import { RunCommandController } from "@stigmer/apis/ai/stigmer/agentic/run/v1/command_pb";
|
|
13
|
+
import { InteractionMode, ServiceTier, ThinkingMode } from "@stigmer/apis/ai/stigmer/agentic/run/v1/enum_pb";
|
|
14
|
+
import type { Attachment } from "@stigmer/apis/ai/stigmer/agentic/run/v1/spec_pb";
|
|
15
|
+
import {
|
|
16
|
+
type RunSpec,
|
|
17
|
+
RunSpecSchema,
|
|
18
|
+
} from "@stigmer/apis/ai/stigmer/agentic/run/v1/spec_pb";
|
|
19
|
+
import {
|
|
20
|
+
type RunConfig,
|
|
21
|
+
RunConfigSchema,
|
|
22
|
+
} from "@stigmer/apis/ai/stigmer/agentic/run/v1/invocation_pb";
|
|
23
|
+
import { Harness } from "@stigmer/apis/ai/stigmer/agentic/session/v1/enum_pb";
|
|
24
|
+
import { type SessionSpec, SessionSpecSchema } from "@stigmer/apis/ai/stigmer/agentic/session/v1/spec_pb";
|
|
25
|
+
import type { WorkspaceEntry } from "@stigmer/apis/ai/stigmer/agentic/session/v1/workspace_pb";
|
|
26
|
+
import { ApiResourceMetadataSchema } from "@stigmer/apis/ai/stigmer/commons/apiresource/metadata_pb";
|
|
27
|
+
import {
|
|
28
|
+
type ApiResourceReference,
|
|
29
|
+
ApiResourceReferenceSchema,
|
|
30
|
+
} from "@stigmer/apis/ai/stigmer/commons/apiresource/io_pb";
|
|
31
|
+
import { ApiResourceKind } from "@stigmer/apis/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
32
|
+
import type { HarnessFlag, RunMode, ServiceTierFlag, ThinkingFlag } from "./prepare.js";
|
|
33
|
+
|
|
34
|
+
const API_VERSION = "agentic.stigmer.ai/v1";
|
|
35
|
+
|
|
36
|
+
// Accessor for a raw Connect client over a generated controller — the same seam
|
|
37
|
+
// the BackendClient exposes (client.ts) and apply uses (handlers.ts).
|
|
38
|
+
export type ControllerFn = <Desc extends DescService>(service: Desc) => Client<Desc>;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The agent a new conversation starts on, by reference: the server resolves
|
|
42
|
+
* it, pins the version on the session it creates, and checks every later turn
|
|
43
|
+
* against that pin. An empty version pins the agent's current version.
|
|
44
|
+
*/
|
|
45
|
+
export interface AgentRefInput {
|
|
46
|
+
readonly org: string;
|
|
47
|
+
readonly slug: string;
|
|
48
|
+
readonly version?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Inputs for creating a run. The turn's target is one of two
|
|
53
|
+
* things: sessionId continues an existing conversation (whose agent the
|
|
54
|
+
* session already pins), or a new conversation the backend creates from the
|
|
55
|
+
* embedded session_spec. agentRef names the new conversation's agent; with
|
|
56
|
+
* neither, the new conversation runs the built-in assistant.
|
|
57
|
+
*
|
|
58
|
+
* workspaceEntries, harness, vaults, includeMyVault and plugins ride the
|
|
59
|
+
* one-call bootstrap (spec.session_spec, stigmer/stigmer#249) and shape the
|
|
60
|
+
* auto-created session. A session's agent, workspace, harness, vault and
|
|
61
|
+
* plugin choice are set at creation, so with sessionId set they are not sent: the
|
|
62
|
+
* target carries the session id alone, and the conversation keeps the vaults
|
|
63
|
+
* it was started with. A run carries no keys of its own; they come from the
|
|
64
|
+
* vaults its conversation uses.
|
|
65
|
+
*/
|
|
66
|
+
export interface CreateRunInput {
|
|
67
|
+
readonly agentRef?: AgentRefInput;
|
|
68
|
+
readonly sessionId?: string;
|
|
69
|
+
readonly orgId: string;
|
|
70
|
+
readonly message: string;
|
|
71
|
+
/** The shared vaults the new conversation uses, in order. */
|
|
72
|
+
readonly vaults: readonly ApiResourceReference[];
|
|
73
|
+
/** Whether each turn of the new conversation uses its sender's My vault first. */
|
|
74
|
+
readonly includeMyVault: boolean;
|
|
75
|
+
/** The plugins the new conversation uses: their skills, agents, MCP servers and hooks. */
|
|
76
|
+
readonly plugins: readonly ApiResourceReference[];
|
|
77
|
+
readonly attachments: readonly Attachment[];
|
|
78
|
+
readonly workspaceFileRefs: readonly string[];
|
|
79
|
+
readonly workspaceEntries: readonly WorkspaceEntry[];
|
|
80
|
+
readonly model: string;
|
|
81
|
+
readonly mode: RunMode;
|
|
82
|
+
readonly serviceTier: ServiceTierFlag;
|
|
83
|
+
readonly thinking: ThinkingFlag;
|
|
84
|
+
readonly autoApproveAll: boolean;
|
|
85
|
+
readonly harness: HarnessFlag;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Create a run. Mirrors Go's createAgentExecution. */
|
|
89
|
+
export async function createAgentRun(
|
|
90
|
+
controller: ControllerFn,
|
|
91
|
+
input: CreateRunInput,
|
|
92
|
+
): Promise<Run> {
|
|
93
|
+
const run = create(RunSchema, {
|
|
94
|
+
apiVersion: API_VERSION,
|
|
95
|
+
kind: "Run",
|
|
96
|
+
metadata: create(ApiResourceMetadataSchema, { name: runName(), org: input.orgId }),
|
|
97
|
+
spec: create(RunSpecSchema, {
|
|
98
|
+
message: input.message === "" ? "execute" : input.message,
|
|
99
|
+
attachments: [...input.attachments],
|
|
100
|
+
workspaceFileRefs: [...input.workspaceFileRefs],
|
|
101
|
+
autoApproveAll: input.autoApproveAll,
|
|
102
|
+
target: buildTarget(input),
|
|
103
|
+
runConfig: buildRunConfig(input.model, input.serviceTier, input.thinking),
|
|
104
|
+
// Only "plan" maps to a non-default mode; "agent"/"" leave it
|
|
105
|
+
// unspecified (agent).
|
|
106
|
+
interactionMode: input.mode === "plan" ? InteractionMode.PLAN : InteractionMode.UNSPECIFIED,
|
|
107
|
+
}),
|
|
108
|
+
});
|
|
109
|
+
return controller(RunCommandController).create(run);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// The turn's target: an existing session by id, or the session_spec of the
|
|
113
|
+
// conversation the backend creates for it.
|
|
114
|
+
function buildTarget(input: CreateRunInput): RunSpec["target"] {
|
|
115
|
+
const sessionId = input.sessionId ?? "";
|
|
116
|
+
if (sessionId !== "") return { case: "sessionId", value: sessionId };
|
|
117
|
+
return { case: "sessionSpec", value: buildSessionSpec(input) };
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Build the embedded session spec for the one-call bootstrap
|
|
121
|
+
// (stigmer/stigmer#249). It is always sent, even for a plain built-in
|
|
122
|
+
// assistant run: a conversation the server creates from no spec has every
|
|
123
|
+
// field at its default, and include_my_vault's default is off, so a person's
|
|
124
|
+
// run would lose their own My vault. The agent reference names the
|
|
125
|
+
// conversation's agent. A resolved harness is stamped explicitly,
|
|
126
|
+
// including "native": the value may be a deliberate per-run escape from the
|
|
127
|
+
// account's default_harness preference, so it must survive any future change
|
|
128
|
+
// to the server-side default. Empty means "no opinion" and stays off the wire
|
|
129
|
+
// (server defaults to native). Subject is left empty: the server defaults its
|
|
130
|
+
// sentinel and the async title activity replaces it. The server clones this
|
|
131
|
+
// spec onto the auto-created session and then clears it from the persisted
|
|
132
|
+
// run — the Session resource stays the single source of truth.
|
|
133
|
+
function buildSessionSpec(input: CreateRunInput): SessionSpec {
|
|
134
|
+
const { agentRef, harness } = input;
|
|
135
|
+
const spec = create(SessionSpecSchema, {
|
|
136
|
+
workspaceEntries: [...input.workspaceEntries],
|
|
137
|
+
vaults: [...input.vaults],
|
|
138
|
+
includeMyVault: input.includeMyVault,
|
|
139
|
+
plugins: [...input.plugins],
|
|
140
|
+
});
|
|
141
|
+
if (agentRef !== undefined) {
|
|
142
|
+
spec.agentRef = create(ApiResourceReferenceSchema, {
|
|
143
|
+
kind: ApiResourceKind.agent,
|
|
144
|
+
org: agentRef.org,
|
|
145
|
+
slug: agentRef.slug,
|
|
146
|
+
version: agentRef.version ?? "",
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
if (harness === "cursor") spec.harness = Harness.CURSOR;
|
|
150
|
+
else if (harness === "native") spec.harness = Harness.NATIVE;
|
|
151
|
+
return spec;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Build the RunConfig this message asks for, or undefined when no flag is set
|
|
155
|
+
// so the less specific layers (the agent's run defaults, the operator profile)
|
|
156
|
+
// choose. An explicit --service-tier or --thinking value maps to the enum even
|
|
157
|
+
// for the base choice ("standard"/"disabled"): sent alone it adjusts the model
|
|
158
|
+
// another layer chose (thinking off for one message on an agent whose
|
|
159
|
+
// defaults turn it on), and unspecified vs explicit is a load-bearing
|
|
160
|
+
// usage-record distinction (#357/#772).
|
|
161
|
+
function buildRunConfig(
|
|
162
|
+
model: string,
|
|
163
|
+
serviceTier: ServiceTierFlag,
|
|
164
|
+
thinking: ThinkingFlag,
|
|
165
|
+
): RunConfig | undefined {
|
|
166
|
+
if (model === "" && serviceTier === "" && thinking === "") return undefined;
|
|
167
|
+
const cfg = create(RunConfigSchema);
|
|
168
|
+
if (model !== "") cfg.modelName = model;
|
|
169
|
+
if (serviceTier === "fast") cfg.serviceTier = ServiceTier.FAST;
|
|
170
|
+
else if (serviceTier === "standard") cfg.serviceTier = ServiceTier.STANDARD;
|
|
171
|
+
if (thinking === "enabled") cfg.thinkingMode = ThinkingMode.ENABLED;
|
|
172
|
+
else if (thinking === "disabled") cfg.thinkingMode = ThinkingMode.DISABLED;
|
|
173
|
+
return cfg;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Unique-enough placeholder name; the backend owns final identity. Go's CLI
|
|
177
|
+
// used fmt.Sprintf("execution-%d", time.Now().UnixMicro()); the prefix now
|
|
178
|
+
// says run.
|
|
179
|
+
function runName(): string {
|
|
180
|
+
return `run-${Date.now() * 1000}`;
|
|
181
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
// The post-stream epilogue, shared by every renderer (Go's streamAgentEpilogue +
|
|
2
|
+
// run_display_summary.go). After the stream ends we fetch the authoritative final
|
|
3
|
+
// run and its usage report, then print a compact, copy-paste-friendly exit
|
|
4
|
+
// summary to stderr (AI content already went to stdout). A completed turn
|
|
5
|
+
// names its duration and its tokens, never a price; tokens counted from the
|
|
6
|
+
// runner's own report rather than the meter carry a "~". A stream that failed
|
|
7
|
+
// before reaching a phase is re-raised as a CLI error.
|
|
8
|
+
//
|
|
9
|
+
// What went wrong with a failed or stopped turn is read from the turn as the
|
|
10
|
+
// session's log folds it: the run's own error, else the turn's status error,
|
|
11
|
+
// its last error event, the platform's last note, the first failed tool use's
|
|
12
|
+
// output. The headless stream hands its folded turn over; after the Ink view,
|
|
13
|
+
// the turn's events are listed only when the summary needs them.
|
|
14
|
+
|
|
15
|
+
import { create } from "@bufbuild/protobuf";
|
|
16
|
+
import { RunPhase } from "@stigmer/apis/ai/stigmer/agentic/run/v1/enum_pb";
|
|
17
|
+
import type { Run } from "@stigmer/apis/ai/stigmer/agentic/run/v1/api_pb";
|
|
18
|
+
import { GetRunUsageReportInputSchema } from "@stigmer/apis/ai/stigmer/agentic/run/v1/io_pb";
|
|
19
|
+
import type { UsageReportAggregate } from "@stigmer/apis/ai/stigmer/agentic/run/v1/usage_pb";
|
|
20
|
+
import { foldSession, turnOf, type Stigmer, type NoteItem, type Turn, type TurnItem } from "@stigmer/client";
|
|
21
|
+
import { CliExitError, ExitCode } from "../../errors/index.js";
|
|
22
|
+
import { shouldColorize, styler } from "../../output/style.js";
|
|
23
|
+
import { formatTokenCount } from "../run-format.js";
|
|
24
|
+
import { formatAgentPhase } from "../runs.js";
|
|
25
|
+
import { listSessionEvents } from "../session.js";
|
|
26
|
+
import type { HeadlessResult } from "../stream/headless.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Fetch the final run + usage and print the exit summary. Returns the
|
|
30
|
+
* final run so the caller can act on its artifacts (e.g. --download).
|
|
31
|
+
*/
|
|
32
|
+
export async function runEpilogue(
|
|
33
|
+
client: Stigmer,
|
|
34
|
+
sessionId: string,
|
|
35
|
+
runId: string,
|
|
36
|
+
result: HeadlessResult,
|
|
37
|
+
): Promise<Run> {
|
|
38
|
+
// A stream error before any phase is a hard failure (Go: epilogue returns it).
|
|
39
|
+
if (result.error !== "" && result.phase === "") {
|
|
40
|
+
throw new CliExitError(result.error, ExitCode.General);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const exec = await client.run.get(runId);
|
|
44
|
+
const usage = await fetchUsage(client, runId);
|
|
45
|
+
|
|
46
|
+
const failure = (): Promise<string> => resolveFailureError(client, sessionId, runId, exec, result.turn);
|
|
47
|
+
|
|
48
|
+
const write = (line: string): void => void process.stderr.write(`${line}\n`);
|
|
49
|
+
const s = styler(shouldColorize(process.stderr));
|
|
50
|
+
write("");
|
|
51
|
+
if (sessionId !== "") {
|
|
52
|
+
await printSessionExit(write, s, sessionId, exec, usage, failure);
|
|
53
|
+
} else {
|
|
54
|
+
await printCompletion(write, s, exec, failure);
|
|
55
|
+
}
|
|
56
|
+
return exec;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Best-effort usage fetch; a failure here must not fail the run (the summary
|
|
60
|
+
// renders without the token count).
|
|
61
|
+
async function fetchUsage(client: Stigmer, runId: string): Promise<UsageReportAggregate | undefined> {
|
|
62
|
+
try {
|
|
63
|
+
const report = await client.run.getRunUsageReport(
|
|
64
|
+
create(GetRunUsageReportInputSchema, { runId }),
|
|
65
|
+
);
|
|
66
|
+
return report.aggregate;
|
|
67
|
+
} catch {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
type Styler = ReturnType<typeof styler>;
|
|
73
|
+
type Write = (line: string) => void;
|
|
74
|
+
|
|
75
|
+
// Compact session summary + a copy-paste resume command. Mirrors Go's
|
|
76
|
+
// displaySessionExitLine + sessionResumeVerb.
|
|
77
|
+
async function printSessionExit(
|
|
78
|
+
write: Write,
|
|
79
|
+
s: Styler,
|
|
80
|
+
sessionId: string,
|
|
81
|
+
exec: Run,
|
|
82
|
+
usage: UsageReportAggregate | undefined,
|
|
83
|
+
failure: () => Promise<string>,
|
|
84
|
+
): Promise<void> {
|
|
85
|
+
const phase = exec.status?.phase ?? RunPhase.RUN_PHASE_UNSPECIFIED;
|
|
86
|
+
const duration = formatDuration(exec.status?.startedAt ?? "", exec.status?.completedAt ?? "");
|
|
87
|
+
const tokens = formatRunTokens(usage);
|
|
88
|
+
|
|
89
|
+
switch (phase) {
|
|
90
|
+
case RunPhase.RUN_COMPLETED:
|
|
91
|
+
write(s.green(completedLine(duration, tokens)));
|
|
92
|
+
break;
|
|
93
|
+
case RunPhase.RUN_FAILED:
|
|
94
|
+
write(s.red(`✗ Failed: ${await failure()}`));
|
|
95
|
+
break;
|
|
96
|
+
case RunPhase.RUN_CANCELLED:
|
|
97
|
+
write(s.yellow("Cancelled"));
|
|
98
|
+
break;
|
|
99
|
+
case RunPhase.RUN_TERMINATED:
|
|
100
|
+
write(s.yellow(`Stopped: ${await failure()}`));
|
|
101
|
+
break;
|
|
102
|
+
default:
|
|
103
|
+
write(s.yellow(`Exited (${formatAgentPhase(phase)})`));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
write("");
|
|
107
|
+
write(` ${resumeVerb(phase)} stigmer resume ${sessionId}`);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Non-session completion (rare for run; e.g. a degraded backend). Mirrors the
|
|
111
|
+
// information of Go's displayAgentExecutionComplete without the panel chrome.
|
|
112
|
+
async function printCompletion(write: Write, s: Styler, exec: Run, failure: () => Promise<string>): Promise<void> {
|
|
113
|
+
const phase = exec.status?.phase ?? RunPhase.RUN_PHASE_UNSPECIFIED;
|
|
114
|
+
if (phase === RunPhase.RUN_FAILED) {
|
|
115
|
+
write(s.red(`✗ Run failed: ${await failure()}`));
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
write(s.green(`✓ Run ${formatAgentPhase(phase)}`));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function completedLine(duration: string, tokens: string): string {
|
|
122
|
+
const parts = [duration, tokens].filter((part) => part !== "");
|
|
123
|
+
return parts.length > 0 ? `✓ Completed (${parts.join(" · ")})` : "✓ Completed";
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// "18.4k tokens", or "" when the report is missing or counted none. The run
|
|
127
|
+
// aggregate carries no estimated flag of its own: a run counted from its
|
|
128
|
+
// runner's report adds tokens and no metered calls, so tokens with zero calls
|
|
129
|
+
// read as estimated ("~18.4k tokens").
|
|
130
|
+
function formatRunTokens(usage: UsageReportAggregate | undefined): string {
|
|
131
|
+
if (usage === undefined || usage.totalTokens <= 0n) return "";
|
|
132
|
+
const estimated = usage.llmCallCount === 0 ? "~" : "";
|
|
133
|
+
return `${estimated}${formatTokenCount(usage.totalTokens)} tokens`;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function resumeVerb(phase: RunPhase): string {
|
|
137
|
+
switch (phase) {
|
|
138
|
+
case RunPhase.RUN_COMPLETED:
|
|
139
|
+
return "To continue:";
|
|
140
|
+
case RunPhase.RUN_FAILED:
|
|
141
|
+
return "To retry: ";
|
|
142
|
+
default:
|
|
143
|
+
return "To resume: ";
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// The run's own error, else what the turn's events say (module header), else
|
|
148
|
+
// a generic pointer to the logs.
|
|
149
|
+
async function resolveFailureError(
|
|
150
|
+
client: Stigmer,
|
|
151
|
+
sessionId: string,
|
|
152
|
+
runId: string,
|
|
153
|
+
exec: Run,
|
|
154
|
+
folded: Turn | undefined,
|
|
155
|
+
): Promise<string> {
|
|
156
|
+
const error = exec.status?.error ?? "";
|
|
157
|
+
if (error !== "") return error;
|
|
158
|
+
const turn = folded ?? (await readTurn(client, sessionId, runId));
|
|
159
|
+
if (turn === undefined) return GENERIC_FAILURE;
|
|
160
|
+
if (turn.status !== undefined && turn.status.error !== "") return turn.status.error;
|
|
161
|
+
const lastError = turn.errors.at(-1);
|
|
162
|
+
if (lastError !== undefined && lastError.message !== "") return lastError.message;
|
|
163
|
+
const note = [...turn.items].reverse().find((item): item is NoteItem => item.kind === "note" && item.text !== "");
|
|
164
|
+
if (note !== undefined) return note.text;
|
|
165
|
+
return firstFailedOutput(turn.items) ?? GENERIC_FAILURE;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// The turn as its events fold; undefined outside a session.
|
|
169
|
+
async function readTurn(client: Stigmer, sessionId: string, runId: string): Promise<Turn | undefined> {
|
|
170
|
+
if (sessionId === "") return undefined;
|
|
171
|
+
return turnOf(foldSession(await listSessionEvents(client, sessionId, runId)), runId);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// The output of the first tool use that failed, a subagent's included.
|
|
175
|
+
function firstFailedOutput(items: readonly TurnItem[]): string | undefined {
|
|
176
|
+
for (const item of items) {
|
|
177
|
+
if (item.kind !== "tool_use") continue;
|
|
178
|
+
const text = item.result?.text ?? "";
|
|
179
|
+
if (item.state === "failed" && text !== "") return text;
|
|
180
|
+
const nested = item.thread === undefined ? undefined : firstFailedOutput(item.thread.items);
|
|
181
|
+
if (nested !== undefined) return nested;
|
|
182
|
+
}
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const GENERIC_FAILURE = "Run failed (error details unavailable — check run logs)";
|
|
187
|
+
|
|
188
|
+
// "1m23s"/"45s" between two RFC3339 timestamps, or "" when unknown. Mirrors Go's
|
|
189
|
+
// parseDuration + Round(time.Second).
|
|
190
|
+
function formatDuration(startedAt: string, completedAt: string): string {
|
|
191
|
+
if (startedAt === "" || completedAt === "") return "";
|
|
192
|
+
const start = Date.parse(startedAt);
|
|
193
|
+
const end = Date.parse(completedAt);
|
|
194
|
+
if (Number.isNaN(start) || Number.isNaN(end) || end < start) return "";
|
|
195
|
+
const totalSeconds = Math.round((end - start) / 1000);
|
|
196
|
+
if (totalSeconds < 60) return `${totalSeconds}s`;
|
|
197
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
198
|
+
const seconds = totalSeconds % 60;
|
|
199
|
+
return seconds === 0 ? `${minutes}m` : `${minutes}m${seconds}s`;
|
|
200
|
+
}
|