@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,123 @@
|
|
|
1
|
+
// Run routing seam.
|
|
2
|
+
//
|
|
3
|
+
// Runs are not addressed through the generic resource registry: runs
|
|
4
|
+
// (`run_`) are served by a dedicated controller, and `delete run` maps to a
|
|
5
|
+
// *cancel*, not a destroy. A run is a turn of a conversation, and a cancel
|
|
6
|
+
// interrupts that conversation's session: every unfinished turn of it stops.
|
|
7
|
+
// This module owns the run-type check, the
|
|
8
|
+
// cancel-with-result semantics, and the run reads shared by `get run`,
|
|
9
|
+
// `list runs`, `delete run` and `download`; the run-ID check is
|
|
10
|
+
// reference.ts's `isRunId`, over the kind's current and retired prefixes.
|
|
11
|
+
import { create } from "@bufbuild/protobuf";
|
|
12
|
+
import { RunSchema } from "@stigmer/apis/ai/stigmer/agentic/run/v1/api_pb";
|
|
13
|
+
import { RunPhase } from "@stigmer/apis/ai/stigmer/agentic/run/v1/enum_pb";
|
|
14
|
+
import { RunListSchema, ListRunsRequestSchema } from "@stigmer/apis/ai/stigmer/agentic/run/v1/io_pb";
|
|
15
|
+
import { InterruptSessionInputSchema } from "@stigmer/apis/ai/stigmer/agentic/session/v1/io_pb";
|
|
16
|
+
import { ApiResourceKind } from "@stigmer/apis/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
17
|
+
import { buildTypeInfo } from "../registry/index.js";
|
|
18
|
+
import { readCursorPages } from "./cursor-pages.js";
|
|
19
|
+
import { obj, renderListMessage, str } from "./render.js";
|
|
20
|
+
import { sessionOfRun } from "./session.js";
|
|
21
|
+
// Terminal phases cannot be cancelled; mirrors Go's isTerminalAgentPhase.
|
|
22
|
+
const TERMINAL_AGENT_PHASES = new Set([
|
|
23
|
+
RunPhase.RUN_COMPLETED,
|
|
24
|
+
RunPhase.RUN_FAILED,
|
|
25
|
+
RunPhase.RUN_CANCELLED,
|
|
26
|
+
RunPhase.RUN_TERMINATED,
|
|
27
|
+
]);
|
|
28
|
+
/** True when an agent phase is terminal (no further transitions). Mirrors Go's isTerminalAgentPhase. */
|
|
29
|
+
export function isTerminalAgentPhase(phase) {
|
|
30
|
+
return TERMINAL_AGENT_PHASES.has(phase);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Cancel a run by interrupting its session, surfacing whether it was already
|
|
34
|
+
* terminal. Get first to read the phase and the session, short-circuit if
|
|
35
|
+
* terminal (so a finished run's conversation is never stopped by it),
|
|
36
|
+
* otherwise interrupt the session, which stops every unfinished turn of it,
|
|
37
|
+
* and read the run again for the phase it ended in.
|
|
38
|
+
*/
|
|
39
|
+
export async function cancelAgentRun(client, id) {
|
|
40
|
+
const current = await client.run.get(id);
|
|
41
|
+
const phase = current.status?.phase ?? RunPhase.RUN_PHASE_UNSPECIFIED;
|
|
42
|
+
if (TERMINAL_AGENT_PHASES.has(phase)) {
|
|
43
|
+
return { run: current, wasAlreadyTerminal: true, stoppedRunIds: [] };
|
|
44
|
+
}
|
|
45
|
+
const sessionId = sessionOfRun(current);
|
|
46
|
+
const interrupted = await client.session.interrupt(create(InterruptSessionInputSchema, { sessionId }));
|
|
47
|
+
return { run: await client.run.get(id), wasAlreadyTerminal: false, stoppedRunIds: interrupted.stoppedRunIds };
|
|
48
|
+
}
|
|
49
|
+
// The run kind's spellings, derived from its kind_meta row like every
|
|
50
|
+
// registered kind's (`run`, `runs`, any case).
|
|
51
|
+
const RUN_ALIASES = new Set((buildTypeInfo(ApiResourceKind.run)?.aliases ?? []).map((alias) => alias.toLowerCase()));
|
|
52
|
+
/**
|
|
53
|
+
* True for the `run` type-alias family. Runs bypass the resource
|
|
54
|
+
* registry (they're addressed by `run_` ID, not slug), so callers route
|
|
55
|
+
* on this predicate before the registry lookup — mirroring Go's command layer.
|
|
56
|
+
*/
|
|
57
|
+
export function isRunAlias(type) {
|
|
58
|
+
return RUN_ALIASES.has(type.trim().toLowerCase());
|
|
59
|
+
}
|
|
60
|
+
/** Fetch a single run by ID, with its schema. */
|
|
61
|
+
export async function getRun(client, id) {
|
|
62
|
+
return { schema: RunSchema, message: await client.run.get(id) };
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* List the newest `limit` runs for the current context, reading
|
|
66
|
+
* as many pages as that takes.
|
|
67
|
+
*
|
|
68
|
+
* `org` scopes results to that organization; empty means permission-bounded
|
|
69
|
+
* (all orgs the caller can view — the OSS single-tenant behavior). `labels`
|
|
70
|
+
* keeps only the runs carrying every pair given.
|
|
71
|
+
*/
|
|
72
|
+
export async function listAgentRuns(client, limit, org = "", labels = {}) {
|
|
73
|
+
const entries = await readCursorPages(limit, (pageSize, pageToken) => client.run.list(create(ListRunsRequestSchema, { pageSize, pageToken, org, labels })));
|
|
74
|
+
return { schema: RunListSchema, message: create(RunListSchema, { entries }) };
|
|
75
|
+
}
|
|
76
|
+
const RUN_TABLE = {
|
|
77
|
+
resourceName: "runs",
|
|
78
|
+
headers: ["ID", "AGENT", "STATUS", "STARTED"],
|
|
79
|
+
row: (json) => [
|
|
80
|
+
str(obj(json, "metadata"), "id"),
|
|
81
|
+
dash(str(obj(json, "status"), "agent_id")),
|
|
82
|
+
phaseLabel(str(obj(json, "status"), "phase")),
|
|
83
|
+
dash(str(obj(json, "status"), "started_at")),
|
|
84
|
+
],
|
|
85
|
+
};
|
|
86
|
+
/** Render a run list (json/yaml = full envelope; table = grid). */
|
|
87
|
+
export function renderRunList(result, format) {
|
|
88
|
+
return renderListMessage(result.schema, result.message, format, RUN_TABLE);
|
|
89
|
+
}
|
|
90
|
+
// Friendly phase label from a protojson enum string (table view only — json/yaml
|
|
91
|
+
// keep the canonical protojson value). "RUN_IN_PROGRESS" → "in-progress".
|
|
92
|
+
function phaseLabel(phase) {
|
|
93
|
+
if (phase === "")
|
|
94
|
+
return "-";
|
|
95
|
+
return phase.replace(/^RUN_/, "").toLowerCase().replace(/_/g, "-");
|
|
96
|
+
}
|
|
97
|
+
function dash(value) {
|
|
98
|
+
return value === "" ? "-" : value;
|
|
99
|
+
}
|
|
100
|
+
/** Human-readable run phase, matching Go's execution.FormatPhase. */
|
|
101
|
+
export function formatAgentPhase(phase) {
|
|
102
|
+
switch (phase) {
|
|
103
|
+
case RunPhase.RUN_PENDING:
|
|
104
|
+
return "pending";
|
|
105
|
+
case RunPhase.RUN_IN_PROGRESS:
|
|
106
|
+
return "running";
|
|
107
|
+
case RunPhase.RUN_WAITING_FOR_APPROVAL:
|
|
108
|
+
return "awaiting-approval";
|
|
109
|
+
case RunPhase.RUN_PAUSED:
|
|
110
|
+
return "paused";
|
|
111
|
+
case RunPhase.RUN_COMPLETED:
|
|
112
|
+
return "completed";
|
|
113
|
+
case RunPhase.RUN_FAILED:
|
|
114
|
+
return "failed";
|
|
115
|
+
case RunPhase.RUN_CANCELLED:
|
|
116
|
+
return "cancelled";
|
|
117
|
+
case RunPhase.RUN_TERMINATED:
|
|
118
|
+
return "terminated";
|
|
119
|
+
default:
|
|
120
|
+
return "unknown";
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=runs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../src/resources/runs.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,EAAE;AACF,qEAAqE;AACrE,4EAA4E;AAC5E,2EAA2E;AAC3E,6EAA6E;AAC7E,2CAA2C;AAC3C,uEAAuE;AACvE,gEAAgE;AAChE,0EAA0E;AAE1E,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAY,MAAM,gDAAgD,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACrG,OAAO,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,MAAM,mFAAmF,CAAC;AAGpH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,E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CAAC,UAAU;YACtB,OAAO,QAAQ,CAAC;QAClB,KAAK,QAAQ,CAAC,aAAa;YACzB,OAAO,WAAW,CAAC;QACrB,KAAK,QAAQ,CAAC,UAAU;YACtB,OAAO,QAAQ,CAAC;QAClB,KAAK,QAAQ,CAAC,aAAa;YACzB,OAAO,WAAW,CAAC;QACrB,KAAK,QAAQ,CAAC,cAAc;YAC1B,OAAO,YAAY,CAAC;QACtB;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Stigmer } from "@stigmer/client";
|
|
2
|
+
import { CommandResult } from "../output/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Resolve `ref` (a `sch_…` id, `org/slug`, or bare slug against `org`),
|
|
5
|
+
* clear its platform pause, and describe the outcome.
|
|
6
|
+
*/
|
|
7
|
+
export declare function resumeSchedule(stigmer: Stigmer, ref: string, org: string): Promise<CommandResult>;
|
|
8
|
+
/**
|
|
9
|
+
* Resolve `ref` (a `sch_…` id, `org/slug`, or bare slug against `org`) and
|
|
10
|
+
* fire it once, immediately.
|
|
11
|
+
*
|
|
12
|
+
* The fire is SYNCHRONOUS: the RPC runs the full run create pipeline
|
|
13
|
+
* and the result names the run's real outcome — the created run's
|
|
14
|
+
* id, or the refusing gate's copy verbatim. A refused run renders as an
|
|
15
|
+
* error result (non-zero exit) so a scripted test fire fails honestly,
|
|
16
|
+
* but the trigger itself succeeded: the fire is recorded in the
|
|
17
|
+
* schedule's run history either way. A disabled schedule is refused by
|
|
18
|
+
* the server with teaching copy; the CLI relays the server's message
|
|
19
|
+
* verbatim (never pattern-match refusal text).
|
|
20
|
+
*/
|
|
21
|
+
export declare function triggerSchedule(stigmer: Stigmer, ref: string, org: string): Promise<CommandResult>;
|
|
22
|
+
//# sourceMappingURL=schedule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../src/resources/schedule.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAOnD;;;GAGG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAavG;AAcD;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAkCxG"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// `schedule resume` dispatch: clear a platform auto-pause from a schedule
|
|
2
|
+
// and report what was cleared.
|
|
3
|
+
//
|
|
4
|
+
// "Paused" is the platform's latch (status.paused_reason, written after
|
|
5
|
+
// repeated failed runs), distinct from "disabled", the owner's switch
|
|
6
|
+
// (spec.enabled) — two words, two levers (see docs/vocabulary.md). The
|
|
7
|
+
// resume RPC is deliberately the only path that clears the latch: applying
|
|
8
|
+
// a manifest preserves status verbatim, so no declarative apply can
|
|
9
|
+
// silently un-pause a failing schedule.
|
|
10
|
+
//
|
|
11
|
+
// The pre-state read exists for honest messaging only: the RPC is
|
|
12
|
+
// idempotent and its response always shows a cleared latch, so "resumed"
|
|
13
|
+
// versus "was not paused" can only be told apart by looking first. The
|
|
14
|
+
// resume call is made either way — on the no-op path it doubles as a
|
|
15
|
+
// harmless re-arm of the schedule's clock.
|
|
16
|
+
import { timestampDate } from "@bufbuild/protobuf/wkt";
|
|
17
|
+
import { ScheduleFireOutcome } from "@stigmer/apis/ai/stigmer/agentic/schedule/v1/io_pb";
|
|
18
|
+
import { UsageError } from "../errors/index.js";
|
|
19
|
+
import { CommandResult } from "../output/index.js";
|
|
20
|
+
import { parseReference } from "./reference.js";
|
|
21
|
+
import { requireOrganization } from "../client/single-org.js";
|
|
22
|
+
/** The schedule kind's canonical id prefix (proto kind_meta). */
|
|
23
|
+
const SCHEDULE_ID_PREFIX = "sch";
|
|
24
|
+
/**
|
|
25
|
+
* Resolve `ref` (a `sch_…` id, `org/slug`, or bare slug against `org`),
|
|
26
|
+
* clear its platform pause, and describe the outcome.
|
|
27
|
+
*/
|
|
28
|
+
export async function resumeSchedule(stigmer, ref, org) {
|
|
29
|
+
const before = await loadSchedule(stigmer, ref, org);
|
|
30
|
+
const id = before.metadata?.id ?? "";
|
|
31
|
+
if (id === "") {
|
|
32
|
+
throw new UsageError(`Schedule '${ref}' has no id — cannot resume`);
|
|
33
|
+
}
|
|
34
|
+
const wasPausedReason = before.status?.pausedReason ?? "";
|
|
35
|
+
const wasFailures = before.status?.consecutiveFailures ?? 0;
|
|
36
|
+
const resumed = await stigmer.schedule.resume(id);
|
|
37
|
+
return describeOutcome(resumed, wasPausedReason, wasFailures);
|
|
38
|
+
}
|
|
39
|
+
async function loadSchedule(stigmer, ref, org) {
|
|
40
|
+
const parsed = parseReference(ref, org, SCHEDULE_ID_PREFIX);
|
|
41
|
+
if (parsed.kind === "id") {
|
|
42
|
+
return stigmer.schedule.get(parsed.id);
|
|
43
|
+
}
|
|
44
|
+
await requireOrganization(stigmer, parsed.org, [
|
|
45
|
+
"stigmer config context set --org <org>",
|
|
46
|
+
"stigmer schedule resume --org <org> ...",
|
|
47
|
+
]);
|
|
48
|
+
return stigmer.schedule.getByReference({ org: parsed.org, slug: parsed.slug });
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Resolve `ref` (a `sch_…` id, `org/slug`, or bare slug against `org`) and
|
|
52
|
+
* fire it once, immediately.
|
|
53
|
+
*
|
|
54
|
+
* The fire is SYNCHRONOUS: the RPC runs the full run create pipeline
|
|
55
|
+
* and the result names the run's real outcome — the created run's
|
|
56
|
+
* id, or the refusing gate's copy verbatim. A refused run renders as an
|
|
57
|
+
* error result (non-zero exit) so a scripted test fire fails honestly,
|
|
58
|
+
* but the trigger itself succeeded: the fire is recorded in the
|
|
59
|
+
* schedule's run history either way. A disabled schedule is refused by
|
|
60
|
+
* the server with teaching copy; the CLI relays the server's message
|
|
61
|
+
* verbatim (never pattern-match refusal text).
|
|
62
|
+
*/
|
|
63
|
+
export async function triggerSchedule(stigmer, ref, org) {
|
|
64
|
+
const before = await loadSchedule(stigmer, ref, org);
|
|
65
|
+
const id = before.metadata?.id ?? "";
|
|
66
|
+
if (id === "") {
|
|
67
|
+
throw new UsageError(`Schedule '${ref}' has no id — cannot trigger`);
|
|
68
|
+
}
|
|
69
|
+
const triggered = await stigmer.schedule.trigger(id);
|
|
70
|
+
const schedule = triggered.schedule ?? before;
|
|
71
|
+
const slug = schedule.metadata?.slug ?? "";
|
|
72
|
+
const name = schedule.metadata?.name || slug;
|
|
73
|
+
if (triggered.outcome === ScheduleFireOutcome.STARTED) {
|
|
74
|
+
const result = CommandResult.success(`Schedule '${name}' fired — run started`);
|
|
75
|
+
const section = result.addSection();
|
|
76
|
+
section.field("Run", triggered.runId);
|
|
77
|
+
section.field("Watch it", `stigmer get run ${triggered.runId}`);
|
|
78
|
+
if (schedule.status?.nextFireAt !== undefined) {
|
|
79
|
+
section.field("Next cron fire", timestampDate(schedule.status.nextFireAt).toISOString());
|
|
80
|
+
}
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
// The run was refused deterministically (a launch gate said no, or the
|
|
84
|
+
// target agent is gone). The fire happened and is recorded in run
|
|
85
|
+
// history; the refusing gate's copy relays verbatim.
|
|
86
|
+
const what = triggered.outcome === ScheduleFireOutcome.TARGET_MISSING
|
|
87
|
+
? "the target agent was not found"
|
|
88
|
+
: "a launch gate refused the run";
|
|
89
|
+
const result = CommandResult.error(`Schedule '${name}' fired, but ${what}`);
|
|
90
|
+
const section = result.addSection();
|
|
91
|
+
section.field("Reason", triggered.refusalReason);
|
|
92
|
+
result.hint("The fire is recorded in the schedule's run history; fix the cause and trigger again.");
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
function describeOutcome(schedule, wasPausedReason, wasFailures) {
|
|
96
|
+
const slug = schedule.metadata?.slug ?? "";
|
|
97
|
+
const name = schedule.metadata?.name || slug;
|
|
98
|
+
const wasPaused = wasPausedReason !== "" || wasFailures > 0;
|
|
99
|
+
const result = CommandResult.success(wasPaused ? `Schedule '${name}' resumed` : `Schedule '${name}' was not paused — nothing to clear`);
|
|
100
|
+
if (wasPaused) {
|
|
101
|
+
const section = result.addSection("Cleared");
|
|
102
|
+
if (wasPausedReason !== "")
|
|
103
|
+
section.field("Pause reason", wasPausedReason);
|
|
104
|
+
if (wasFailures > 0)
|
|
105
|
+
section.field("Consecutive failures", String(wasFailures));
|
|
106
|
+
}
|
|
107
|
+
if (schedule.spec?.enabled !== true) {
|
|
108
|
+
result.hint("This schedule is disabled (enabled: false) — it will not fire until you enable it:");
|
|
109
|
+
result.hint(` edit the manifest to 'enabled: true' and run: stigmer apply -f <file>`);
|
|
110
|
+
}
|
|
111
|
+
else if (schedule.status?.nextFireAt !== undefined) {
|
|
112
|
+
result.addSection().field("Next fire", timestampDate(schedule.status.nextFireAt).toISOString());
|
|
113
|
+
}
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=schedule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../src/resources/schedule.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,+BAA+B;AAC/B,EAAE;AACF,wEAAwE;AACxE,sEAAsE;AACtE,uEAAuE;AACvE,2EAA2E;AAC3E,oEAAoE;AACpE,wCAAwC;AACxC,EAAE;AACF,kEAAkE;AAClE,yEAAyE;AACzE,uEAAuE;AACvE,qEAAqE;AACrE,2CAA2C;AAE3C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAC;AAEzF,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GAAG,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAC7C,IAAI,eAAe,KAAK,EAAE;YAAE,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;QAC3E,IAAI,WAAW,GAAG,CAAC;YAAE,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;IAClF,CAAC;IAED,IAAI,QAAQ,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;QACpC,MAAM,CAAC,IAAI,CAAC,oFAAoF,CAAC,CAAC;QAClG,MAAM,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;IACzF,CAAC;SAAM,IAAI,QAAQ,CAAC,MAAM,EAAE,UAAU,KAAK,SAAS,EAAE,CAAC;QACrD,MAAM,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IAClG,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ApiResourceKind } from "@stigmer/apis/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
2
|
+
import type { Stigmer } from "@stigmer/client";
|
|
3
|
+
import type { OutputFormat } from "../output/index.js";
|
|
4
|
+
export interface SearchParams {
|
|
5
|
+
/** Organization scope. Empty searches across every org the caller can access. */
|
|
6
|
+
readonly org: string;
|
|
7
|
+
/** Results per page. */
|
|
8
|
+
readonly pageSize: number;
|
|
9
|
+
/** The previous page's token, to continue the same query; "" for the first page. */
|
|
10
|
+
readonly pageToken: string;
|
|
11
|
+
}
|
|
12
|
+
export interface SearchOutcome {
|
|
13
|
+
/** Rendered entries (table grid, or protojson array for json/yaml). */
|
|
14
|
+
readonly rendered: string;
|
|
15
|
+
/** How many results match across every page, by the server's count for the kind. */
|
|
16
|
+
readonly matches: number;
|
|
17
|
+
/** The token that reads the next page; "" when this page is the last. */
|
|
18
|
+
readonly nextPageToken: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function searchResources(client: Stigmer, kind: ApiResourceKind, query: string, params: SearchParams, format: OutputFormat): Promise<SearchOutcome>;
|
|
21
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/resources/search.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,mFAAmF,CAAC;AAEpH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAKvD,MAAM,WAAW,YAAY;IAC3B,iFAAiF;IACjF,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,wBAAwB;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,oFAAoF;IACpF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,oFAAoF;IACpF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yEAAyE;IACzE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,wBAAsB,eAAe,CACnC,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,aAAa,CAAC,CAuBxB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// `search` dispatch: a relevance-ranked, cross-resource text query over the
|
|
2
|
+
// unified SearchService. Only agents take the `search` verb (matching the Go
|
|
3
|
+
// CLI). Results render as SEARCH_TABLE, with a footer the command appends
|
|
4
|
+
// for human output (how many match, and how to read the next page), and
|
|
5
|
+
// name each result's organization by slug as `list` does.
|
|
6
|
+
import { ApiResourceKind } from "@stigmer/apis/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
7
|
+
import { SearchResultSchema } from "@stigmer/apis/ai/stigmer/search/v1/io_pb";
|
|
8
|
+
import { organizationLabels } from "../client/organizations.js";
|
|
9
|
+
import { SEARCH_TABLE } from "./list.js";
|
|
10
|
+
import { renderCollection, tableOrganizations } from "./render.js";
|
|
11
|
+
export async function searchResources(client, kind, query, params, format) {
|
|
12
|
+
const response = await client.search.query({
|
|
13
|
+
kinds: [kind],
|
|
14
|
+
query,
|
|
15
|
+
org: params.org,
|
|
16
|
+
pageSize: params.pageSize,
|
|
17
|
+
pageToken: params.pageToken,
|
|
18
|
+
});
|
|
19
|
+
return {
|
|
20
|
+
rendered: renderCollection(SearchResultSchema, response.entries, format, SEARCH_TABLE, await organizationLabels(client, tableOrganizations(SearchResultSchema, response.entries, format, SEARCH_TABLE))),
|
|
21
|
+
matches: response.countsByKind[ApiResourceKind[kind]] ?? response.entries.length,
|
|
22
|
+
nextPageToken: response.nextPageToken,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../src/resources/search.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,0EAA0E;AAC1E,wEAAwE;AACxE,0DAA0D;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,mFAAmF,CAAC;AACpH,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAG9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAoBnE,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,MAAe,EACf,IAAqB,EACrB,KAAa,EACb,MAAoB,EACpB,MAAoB;IAEpB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;QACzC,KAAK,EAAE,CAAC,IAAI,CAAC;QACb,KAAK;QACL,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,SAAS,EAAE,MAAM,CAAC,SAAS;KAC5B,CAAC,CAAC;IAEH,OAAO;QACL,QAAQ,EAAE,gBAAgB,CACxB,kBAAkB,EAClB,QAAQ,CAAC,OAAO,EAChB,MAAM,EACN,YAAY,EACZ,MAAM,kBAAkB,CACtB,MAAM,EACN,kBAAkB,CAAC,kBAAkB,EAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,CAC/E,CACF;QACD,OAAO,EAAE,QAAQ,CAAC,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM;QAChF,aAAa,EAAE,QAAQ,CAAC,aAAa;KACtC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ApiKey } from "@stigmer/apis/ai/stigmer/iam/apikey/v1/api_pb";
|
|
2
|
+
import { type IdentityAccount } from "@stigmer/apis/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
3
|
+
import { IamRole } from "@stigmer/apis/ai/stigmer/iam/v1/enum_pb";
|
|
4
|
+
import { type Stigmer } from "@stigmer/client";
|
|
5
|
+
import { CommandResult } from "../output/index.js";
|
|
6
|
+
import type { DeletePlan } from "./delete.js";
|
|
7
|
+
/** The clients these helpers call: the identity-account and API key clients. */
|
|
8
|
+
export type ServiceAccountClient = Pick<Stigmer, "identityAccount" | "apiKey">;
|
|
9
|
+
/**
|
|
10
|
+
* The organization role `--role` names. Owner is refused here as the server
|
|
11
|
+
* refuses it: an owner decides who owns the organization, and a key in a CI
|
|
12
|
+
* job must never be able to.
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseServiceAccountRole(value: string): IamRole;
|
|
15
|
+
/** Every service account of the organization, newest first. */
|
|
16
|
+
export declare function listServiceAccounts(client: ServiceAccountClient, org: string): Promise<IdentityAccount[]>;
|
|
17
|
+
/**
|
|
18
|
+
* The organization's service account named `ref` (its name, or its id).
|
|
19
|
+
* None answers NotFound (exit 5) with the command that lists them.
|
|
20
|
+
*/
|
|
21
|
+
export declare function findServiceAccount(client: ServiceAccountClient, org: string, ref: string): Promise<IdentityAccount>;
|
|
22
|
+
/** The API keys of the organization's service account named `ref`, newest first. */
|
|
23
|
+
export declare function listServiceAccountKeys(client: ServiceAccountClient, org: string, ref: string): Promise<ApiKey[]>;
|
|
24
|
+
/** The key list's table: one row per key, as `stigmer list apikeys` renders it. */
|
|
25
|
+
export declare function serviceAccountKeyRows(keys: readonly ApiKey[]): string[][];
|
|
26
|
+
export declare const SERVICE_ACCOUNT_KEY_TABLE_HEADERS: readonly ["ID", "NAME", "FINGERPRINT", "EXPIRES"];
|
|
27
|
+
/** Create a service account holding `role`, and say how to give it a key. */
|
|
28
|
+
export declare function createServiceAccount(client: ServiceAccountClient, org: string, name: string, role: IamRole): Promise<CommandResult>;
|
|
29
|
+
/**
|
|
30
|
+
* Stage the delete of a service account: resolve it by name, say that its
|
|
31
|
+
* keys stop working at once, and delete it only once the caller confirms.
|
|
32
|
+
*/
|
|
33
|
+
export declare function planDeleteServiceAccount(client: ServiceAccountClient, org: string, ref: string): Promise<DeletePlan>;
|
|
34
|
+
/** The list's table: one row per service account. */
|
|
35
|
+
export declare function serviceAccountRows(accounts: readonly IdentityAccount[]): string[][];
|
|
36
|
+
export declare const SERVICE_ACCOUNT_TABLE_HEADERS: readonly ["NAME", "ID", "CREATED"];
|
|
37
|
+
//# sourceMappingURL=service-account.d.ts.map
|
|
@@ -0,0 +1 @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,oBAAoB,EAC5B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,aAAa,CAAC,CAWxB;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,oBAAoB,EAC5B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,UAAU,CAAC,CAgBrB;AAED,qDAAqD;AACrD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,EAAE,EAAE,CAMnF;AAED,eAAO,MAAM,6BAA6B,oCAAqC,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// `stigmer service-account` dispatch: list an organization's service
|
|
2
|
+
// accounts, create one with its role, list one's API keys, delete one, and
|
|
3
|
+
// find one by name for `stigmer apikey create --service-account`.
|
|
4
|
+
//
|
|
5
|
+
// A service account is an organization's own non-person account that its
|
|
6
|
+
// automation (a CI job, a script) acts as through API keys, so the automation
|
|
7
|
+
// keeps working when the person who set it up leaves. It is an identity
|
|
8
|
+
// account, not a resource kind, so the generic verbs do not name it; these
|
|
9
|
+
// helpers drive the identity-account and key clients directly. A service
|
|
10
|
+
// account's keys are listed here (`listByAccount`), not by `stigmer list
|
|
11
|
+
// apikeys`, which answers the caller's own keys; one is revoked with
|
|
12
|
+
// `stigmer delete apikey <id>`.
|
|
13
|
+
//
|
|
14
|
+
// A service account is named by its name, unique among its organization's
|
|
15
|
+
// service accounts; its id (`ida_…`) is accepted too, so a script that kept
|
|
16
|
+
// the id from `create --json` can address it after a rename. The server
|
|
17
|
+
// lists them newest first and an organization has few, so every page is read
|
|
18
|
+
// and the name matched here. A bounded page count keeps a server that
|
|
19
|
+
// misreports its total from looping the CLI.
|
|
20
|
+
//
|
|
21
|
+
// Deleting one ends every key it has at once, so a delete is staged as a
|
|
22
|
+
// DeletePlan (delete.ts's shape): the account is resolved and named first,
|
|
23
|
+
// the command layer confirms, and only then is the delete sent.
|
|
24
|
+
import { create } from "@bufbuild/protobuf";
|
|
25
|
+
import { timestampDate } from "@bufbuild/protobuf/wkt";
|
|
26
|
+
import { IdentityAccountSchema, } from "@stigmer/apis/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
27
|
+
import { ListApiKeysByAccountInputSchema } from "@stigmer/apis/ai/stigmer/iam/apikey/v1/io_pb";
|
|
28
|
+
import { CreateServiceAccountInputSchema, ListServiceAccountsInputSchema, } from "@stigmer/apis/ai/stigmer/iam/identityaccount/v1/io_pb";
|
|
29
|
+
import { IamRole } from "@stigmer/apis/ai/stigmer/iam/v1/enum_pb";
|
|
30
|
+
import { iamRoleDisplayName } from "@stigmer/client";
|
|
31
|
+
import { CliExitError } from "../errors/cli-exit-error.js";
|
|
32
|
+
import { ExitCode } from "../errors/exit-codes.js";
|
|
33
|
+
import { UsageError } from "../errors/usage-error.js";
|
|
34
|
+
import { CommandResult, protoToJsonValue } from "../output/index.js";
|
|
35
|
+
import { readCursorPages } from "./cursor-pages.js";
|
|
36
|
+
/** The roles `--role` accepts, by the word a person types. */
|
|
37
|
+
const ROLES = new Map([
|
|
38
|
+
["admin", IamRole.admin],
|
|
39
|
+
["member", IamRole.member],
|
|
40
|
+
["viewer", IamRole.viewer],
|
|
41
|
+
]);
|
|
42
|
+
/**
|
|
43
|
+
* The organization role `--role` names. Owner is refused here as the server
|
|
44
|
+
* refuses it: an owner decides who owns the organization, and a key in a CI
|
|
45
|
+
* job must never be able to.
|
|
46
|
+
*/
|
|
47
|
+
export function parseServiceAccountRole(value) {
|
|
48
|
+
const role = ROLES.get(value.trim().toLowerCase());
|
|
49
|
+
if (role !== undefined)
|
|
50
|
+
return role;
|
|
51
|
+
if (value.trim().toLowerCase() === "owner") {
|
|
52
|
+
throw new UsageError("a service account cannot be an owner\n\nUse --role admin, member or viewer.");
|
|
53
|
+
}
|
|
54
|
+
throw new UsageError(`unknown role "${value}"\n\nUse --role admin, member or viewer.`);
|
|
55
|
+
}
|
|
56
|
+
/** Every service account of the organization, newest first. */
|
|
57
|
+
export async function listServiceAccounts(client, org) {
|
|
58
|
+
return readCursorPages(0, (pageSize, pageToken) => client.identityAccount.listServiceAccounts(create(ListServiceAccountsInputSchema, { org, pageSize, pageToken })));
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The organization's service account named `ref` (its name, or its id).
|
|
62
|
+
* None answers NotFound (exit 5) with the command that lists them.
|
|
63
|
+
*/
|
|
64
|
+
export async function findServiceAccount(client, org, ref) {
|
|
65
|
+
const wanted = ref.trim();
|
|
66
|
+
const accounts = await listServiceAccounts(client, org);
|
|
67
|
+
const found = accounts.find((account) => account.metadata?.name === wanted) ??
|
|
68
|
+
accounts.find((account) => account.metadata?.id === wanted);
|
|
69
|
+
if (found !== undefined)
|
|
70
|
+
return found;
|
|
71
|
+
throw new CliExitError(`no service account named "${wanted}" in this organization`, ExitCode.NotFound, [
|
|
72
|
+
"List them with: stigmer service-account list",
|
|
73
|
+
]);
|
|
74
|
+
}
|
|
75
|
+
/** The API keys of the organization's service account named `ref`, newest first. */
|
|
76
|
+
export async function listServiceAccountKeys(client, org, ref) {
|
|
77
|
+
const account = await findServiceAccount(client, org, ref);
|
|
78
|
+
return readCursorPages(0, (pageSize, pageToken) => client.apiKey.listByAccount(create(ListApiKeysByAccountInputSchema, { accountId: account.metadata?.id ?? "", pageSize, pageToken })));
|
|
79
|
+
}
|
|
80
|
+
/** The key list's table: one row per key, as `stigmer list apikeys` renders it. */
|
|
81
|
+
export function serviceAccountKeyRows(keys) {
|
|
82
|
+
return keys.map((key) => {
|
|
83
|
+
const fingerprint = key.spec?.fingerprint ?? "";
|
|
84
|
+
const expiresAt = key.spec?.expiresAt;
|
|
85
|
+
return [
|
|
86
|
+
key.metadata?.id ?? "",
|
|
87
|
+
key.metadata?.name || "-",
|
|
88
|
+
fingerprint === "" ? "" : `***${fingerprint}`,
|
|
89
|
+
key.spec?.neverExpires === true || expiresAt === undefined
|
|
90
|
+
? "Never"
|
|
91
|
+
: timestampDate(expiresAt).toISOString().slice(0, 10),
|
|
92
|
+
];
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
export const SERVICE_ACCOUNT_KEY_TABLE_HEADERS = ["ID", "NAME", "FINGERPRINT", "EXPIRES"];
|
|
96
|
+
/** Create a service account holding `role`, and say how to give it a key. */
|
|
97
|
+
export async function createServiceAccount(client, org, name, role) {
|
|
98
|
+
const account = await client.identityAccount.createServiceAccount(create(CreateServiceAccountInputSchema, { org, name: name.trim(), role }));
|
|
99
|
+
const created = account.metadata?.name ?? name.trim();
|
|
100
|
+
const result = CommandResult.success(`Service account ${created} created with the ${iamRoleDisplayName(role)} role`);
|
|
101
|
+
result.addSection().field("ID", account.metadata?.id ?? "");
|
|
102
|
+
result.hint(`Create its first API key: stigmer apikey create --service-account ${created}`);
|
|
103
|
+
return result.withData(protoToJsonValue(IdentityAccountSchema, account));
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Stage the delete of a service account: resolve it by name, say that its
|
|
107
|
+
* keys stop working at once, and delete it only once the caller confirms.
|
|
108
|
+
*/
|
|
109
|
+
export async function planDeleteServiceAccount(client, org, ref) {
|
|
110
|
+
const account = await findServiceAccount(client, org, ref);
|
|
111
|
+
const id = account.metadata?.id ?? "";
|
|
112
|
+
const name = account.metadata?.name ?? id;
|
|
113
|
+
const warning = CommandResult.warning("You are about to delete this service account:");
|
|
114
|
+
warning.addSection().item(`${name} (${id})`);
|
|
115
|
+
warning.hint("Every API key it has stops working at once, and it loses every role it holds.");
|
|
116
|
+
warning.hint("What it created stays with the organization.");
|
|
117
|
+
return {
|
|
118
|
+
warning,
|
|
119
|
+
confirmPrompt: "Proceed with deletion? [y/N]",
|
|
120
|
+
perform: async () => {
|
|
121
|
+
await client.identityAccount.delete(id);
|
|
122
|
+
return CommandResult.success(`Deleted service account ${name}; its API keys no longer work`);
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/** The list's table: one row per service account. */
|
|
127
|
+
export function serviceAccountRows(accounts) {
|
|
128
|
+
return accounts.map((account) => [
|
|
129
|
+
account.metadata?.name ?? "",
|
|
130
|
+
account.metadata?.id ?? "",
|
|
131
|
+
formatCreated(account),
|
|
132
|
+
]);
|
|
133
|
+
}
|
|
134
|
+
export const SERVICE_ACCOUNT_TABLE_HEADERS = ["NAME", "ID", "CREATED"];
|
|
135
|
+
function formatCreated(account) {
|
|
136
|
+
const at = account.status?.audit?.specAudit?.createdAt;
|
|
137
|
+
return at === undefined ? "" : timestampDate(at).toISOString();
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=service-account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-account.js","sourceRoot":"","sources":["../src/resources/service-account.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,2EAA2E;AAC3E,kEAAkE;AAClE,EAAE;AACF,yEAAyE;AACzE,8EAA8E;AAC9E,wEAAwE;AACxE,2EAA2E;AAC3E,yEAAyE;AACzE,yEAAyE;AACzE,qEAAqE;AACrE,gCAAgC;AAChC,EAAE;AACF,0EAA0E;AAC1E,4EAA4E;AAC5E,wEAAwE;AACxE,6EAA6E;AAC7E,sEAAsE;AACtE,6CAA6C;AAC7C,EAAE;AACF,yEAAyE;AACzE,2EAA2E;AAC3E,gEAAgE;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAEL,qBAAqB,GACtB,MAAM,wDAAwD,CAAC;AAChE,OAAO,EAAE,+BAA+B,EAAE,MAAM,8CAA8C,CAAC;AAC/F,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAgB,MAAM,iBAAiB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O,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE;QAC1B,aAAa,CAAC,OAAO,CAAC;KACvB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAU,CAAC;AAEhF,SAAS,aAAa,CAAC,OAAwB;IAC7C,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,CAAC;IACvD,OAAO,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Run } from "@stigmer/apis/ai/stigmer/agentic/run/v1/api_pb";
|
|
2
|
+
import type { Session } from "@stigmer/apis/ai/stigmer/agentic/session/v1/api_pb";
|
|
3
|
+
import type { SessionEvent } from "@stigmer/apis/ai/stigmer/agentic/session/v1/event_pb";
|
|
4
|
+
import type { Stigmer } from "@stigmer/client";
|
|
5
|
+
/** Fetch a single session by ID (Go's session.GetFromBackend). */
|
|
6
|
+
export declare function getSessionById(client: Stigmer, sessionId: string): Promise<Session>;
|
|
7
|
+
/**
|
|
8
|
+
* List a session's runs, newest-first (the backend's order). The RPC
|
|
9
|
+
* answers a page at a time, so every page is read: the result is the
|
|
10
|
+
* complete set. Returns the raw entries for resume to inspect.
|
|
11
|
+
*/
|
|
12
|
+
export declare function listRunsBySession(client: Stigmer, sessionId: string): Promise<Run[]>;
|
|
13
|
+
/**
|
|
14
|
+
* List a session's events oldest first, every page; with `runId`, only that
|
|
15
|
+
* run's (turn's) events.
|
|
16
|
+
*/
|
|
17
|
+
export declare function listSessionEvents(client: Stigmer, sessionId: string, runId?: string): Promise<SessionEvent[]>;
|
|
18
|
+
/** The session a run is a turn of; refuses a run that names none. */
|
|
19
|
+
export declare function sessionOfRun(run: Run): string;
|
|
20
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/resources/session.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gDAAgD,CAAC;AAE1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oDAAoD,CAAC;AAClF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sDAAsD,CAAC;AAEzF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAI/C,kEAAkE;AAClE,wBAAsB,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEzF;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAI1F;AAMD;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAW/G;AAED,qEAAqE;AACrE,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAI7C"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Read helpers for the dedicated `stigmer session` command surface (resume
|
|
2
|
+
// and friends). Session LIST is a first-class registry verb served by
|
|
3
|
+
// LIST_HANDLERS in resources/list.ts — stigmer/stigmer#469 promoted it there
|
|
4
|
+
// from a bespoke pre-gate route in commands/list.ts. get/delete stay
|
|
5
|
+
// deliberately unpromised in the verb matrix (stigmer/stigmer#354);
|
|
6
|
+
// resume-style flows read sessions through these helpers instead.
|
|
7
|
+
//
|
|
8
|
+
// A conversation's content is its session's event log: a session's events,
|
|
9
|
+
// or one run's, are listed oldest first, every page read, and a run is
|
|
10
|
+
// traced to its session by the run's own target.
|
|
11
|
+
import { create } from "@bufbuild/protobuf";
|
|
12
|
+
import { ListRunsBySessionRequestSchema } from "@stigmer/apis/ai/stigmer/agentic/run/v1/io_pb";
|
|
13
|
+
import { ListSessionEventsRequestSchema } from "@stigmer/apis/ai/stigmer/agentic/session/v1/io_pb";
|
|
14
|
+
import { CliExitError, ExitCode } from "../errors/index.js";
|
|
15
|
+
import { readCursorPages } from "./cursor-pages.js";
|
|
16
|
+
/** Fetch a single session by ID (Go's session.GetFromBackend). */
|
|
17
|
+
export async function getSessionById(client, sessionId) {
|
|
18
|
+
return client.session.get(sessionId);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* List a session's runs, newest-first (the backend's order). The RPC
|
|
22
|
+
* answers a page at a time, so every page is read: the result is the
|
|
23
|
+
* complete set. Returns the raw entries for resume to inspect.
|
|
24
|
+
*/
|
|
25
|
+
export async function listRunsBySession(client, sessionId) {
|
|
26
|
+
return readCursorPages(0, (pageSize, pageToken) => client.run.listBySession(create(ListRunsBySessionRequestSchema, { sessionId, pageSize, pageToken })));
|
|
27
|
+
}
|
|
28
|
+
// The most events one page asks for: the most the server returns.
|
|
29
|
+
const EVENT_PAGE_SIZE = 1000;
|
|
30
|
+
/**
|
|
31
|
+
* List a session's events oldest first, every page; with `runId`, only that
|
|
32
|
+
* run's (turn's) events.
|
|
33
|
+
*/
|
|
34
|
+
export async function listSessionEvents(client, sessionId, runId = "") {
|
|
35
|
+
const events = [];
|
|
36
|
+
let pageToken = "";
|
|
37
|
+
do {
|
|
38
|
+
const page = await client.session.listEvents(create(ListSessionEventsRequestSchema, { sessionId, runId, pageSize: EVENT_PAGE_SIZE, pageToken }));
|
|
39
|
+
events.push(...page.events);
|
|
40
|
+
pageToken = page.nextPageToken;
|
|
41
|
+
} while (pageToken !== "");
|
|
42
|
+
return events;
|
|
43
|
+
}
|
|
44
|
+
/** The session a run is a turn of; refuses a run that names none. */
|
|
45
|
+
export function sessionOfRun(run) {
|
|
46
|
+
const target = run.spec?.target;
|
|
47
|
+
if (target?.case === "sessionId" && target.value !== "")
|
|
48
|
+
return target.value;
|
|
49
|
+
throw new CliExitError(`run ${run.metadata?.id ?? ""} names no session`, ExitCode.General);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../src/resources/session.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,sEAAsE;AACtE,6EAA6E;AAC7E,qEAAqE;AACrE,oEAAoE;AACpE,kEAAkE;AAClE,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,iDAAiD;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,8BAA8B,EAAE,MAAM,+CAA+C,CAAC;AAG/F,OAAO,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAC;AAEnG,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,kEAAkE;AAClE,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAAe,EAAE,SAAiB;IACrE,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACvC,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAAe,EAAE,SAAiB;IACxE,OAAO,eAAe,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,CAChD,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,8BAA8B,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,CACrG,CAAC;AACJ,CAAC;AAGD,kEAAkE;AAClE,MAAM,eAAe,GAAG,IAAI,CAAC;AAE7B;;;GAGG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