@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,443 @@
|
|
|
1
|
+
// `usage` reports: token and model breakdowns at three granularities
|
|
2
|
+
// (session, agent, org), and the organization's agent hours. Usage is
|
|
3
|
+
// counted in tokens and never priced, so the tables show TOKENS and a SHARE
|
|
4
|
+
// of the report's tokens; no dollar figure appears. A served-by line says
|
|
5
|
+
// whose provider credential served the tokens (the organization's own keys
|
|
6
|
+
// or a connection the platform provides), and "estimated" marks numbers counted from a
|
|
7
|
+
// run's own runner report rather than the deployment's meter. Mirrors the
|
|
8
|
+
// retired Go CLI's usage_* renderers for layout and date formatting.
|
|
9
|
+
//
|
|
10
|
+
// Two clocks, two words, two units. Every report shows WORKING time, the
|
|
11
|
+
// seconds an agent worked (never waiting for a person), as a duration in
|
|
12
|
+
// hours and minutes, never days, because a turn is minutes and a month's
|
|
13
|
+
// work is hundreds of hours. `usage hours` shows AGENT HOURS, the unit a
|
|
14
|
+
// Stigmer Cloud plan includes and bills, in tenths of an hour rounded half
|
|
15
|
+
// up, the rule the console's billing page and the invoice use; it is the
|
|
16
|
+
// one place a price may appear, the plan's own price past its allowance.
|
|
17
|
+
//
|
|
18
|
+
// A deliberate divergence from the retired Go CLI, which serialized usage
|
|
19
|
+
// reports with the standard library (encoding/json + yaml.v3) directly on the
|
|
20
|
+
// proto messages, a *different* shape (lowerCamel keys, integer enums, numeric
|
|
21
|
+
// int64) than the protojson used by every other command. We emit protojson
|
|
22
|
+
// here for consistency with the rest of the CLI (string enums/int64,
|
|
23
|
+
// snake_case keys).
|
|
24
|
+
|
|
25
|
+
import { create } from "@bufbuild/protobuf";
|
|
26
|
+
import { RunPhase } from "@stigmer/apis/ai/stigmer/agentic/run/v1/enum_pb";
|
|
27
|
+
import {
|
|
28
|
+
GetAgentUsageReportInputSchema,
|
|
29
|
+
GetAgentUsageReportOutputSchema,
|
|
30
|
+
GetOrgUsageReportInputSchema,
|
|
31
|
+
GetOrgUsageReportOutputSchema,
|
|
32
|
+
GetSessionUsageReportInputSchema,
|
|
33
|
+
GetSessionUsageReportOutputSchema,
|
|
34
|
+
type GetAgentUsageReportOutput,
|
|
35
|
+
type GetOrgUsageReportOutput,
|
|
36
|
+
type GetSessionUsageReportOutput,
|
|
37
|
+
} from "@stigmer/apis/ai/stigmer/agentic/run/v1/io_pb";
|
|
38
|
+
import {
|
|
39
|
+
ProviderKeySource,
|
|
40
|
+
type ModelUsage,
|
|
41
|
+
type UsageReportAggregate,
|
|
42
|
+
} from "@stigmer/apis/ai/stigmer/agentic/run/v1/usage_pb";
|
|
43
|
+
import {
|
|
44
|
+
AgentHoursSchema,
|
|
45
|
+
AgentHoursWindow,
|
|
46
|
+
GetAgentHoursInputSchema,
|
|
47
|
+
type AgentHours,
|
|
48
|
+
} from "@stigmer/apis/ai/stigmer/billing/subscription/v1/io_pb";
|
|
49
|
+
import type { Stigmer } from "@stigmer/client";
|
|
50
|
+
import type { OutputFormat } from "../output/index.js";
|
|
51
|
+
import { renderProtoJson, renderProtoYaml, renderTable } from "../output/index.js";
|
|
52
|
+
import { formatTokenCount } from "./run-format.js";
|
|
53
|
+
|
|
54
|
+
export interface DateRange {
|
|
55
|
+
readonly from: string;
|
|
56
|
+
readonly to: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// --- Fetch ---
|
|
60
|
+
|
|
61
|
+
export async function getSessionUsageReport(client: Stigmer, sessionId: string): Promise<GetSessionUsageReportOutput> {
|
|
62
|
+
return client.run.getSessionUsageReport(create(GetSessionUsageReportInputSchema, { sessionId }));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export async function getAgentUsageReport(
|
|
66
|
+
client: Stigmer,
|
|
67
|
+
agentId: string,
|
|
68
|
+
org: string,
|
|
69
|
+
range: DateRange,
|
|
70
|
+
): Promise<GetAgentUsageReportOutput> {
|
|
71
|
+
return client.run.getAgentUsageReport(
|
|
72
|
+
create(GetAgentUsageReportInputSchema, { agentId, org, fromDate: range.from, toDate: range.to }),
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export async function getOrgUsageReport(
|
|
77
|
+
client: Stigmer,
|
|
78
|
+
org: string,
|
|
79
|
+
range: DateRange,
|
|
80
|
+
): Promise<GetOrgUsageReportOutput> {
|
|
81
|
+
return client.run.getOrgUsageReport(
|
|
82
|
+
create(GetOrgUsageReportInputSchema, { org, fromDate: range.from, toDate: range.to }),
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export async function getAgentHours(client: Stigmer, org: string): Promise<AgentHours> {
|
|
87
|
+
return client.subscription.getAgentHours(create(GetAgentHoursInputSchema, { org }));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// --- Render: agent hours ---
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Where the organization stands against its plan's agent hours, as one
|
|
94
|
+
* line: the hours used of those included in the window ("this month" on
|
|
95
|
+
* Free's calendar month, "this period" on a subscription's), the reset
|
|
96
|
+
* date, then what happens past the allowance by the plan's own terms (an
|
|
97
|
+
* allowance with no hourly price pauses new work; a price bills each hour
|
|
98
|
+
* past it). A plan with no allowance shows the hours alone.
|
|
99
|
+
*/
|
|
100
|
+
export function renderAgentHours(hours: AgentHours, format: OutputFormat): string {
|
|
101
|
+
if (format === "json") return renderProtoJson(AgentHoursSchema, hours);
|
|
102
|
+
if (format === "yaml") return renderProtoYaml(AgentHoursSchema, hours);
|
|
103
|
+
|
|
104
|
+
const window = hours.window === AgentHoursWindow.calendar_month ? "this month" : "this period";
|
|
105
|
+
const used = formatAgentHours(hours.workingSeconds);
|
|
106
|
+
const resets = hours.windowEnd === undefined ? "" : ` (resets ${utcDay(hours.windowEnd.seconds)} UTC)`;
|
|
107
|
+
const included = hours.includedHours;
|
|
108
|
+
if (included === undefined) {
|
|
109
|
+
return `Agent hours: ${used} used ${window}${resets}.\n`;
|
|
110
|
+
}
|
|
111
|
+
const head = `Agent hours: ${used} of ${included} h used ${window}${resets}.`;
|
|
112
|
+
if (hours.perAgentHourMicros !== undefined) {
|
|
113
|
+
return `${head} Then ${formatHourlyPrice(hours.perAgentHourMicros)} an hour, on this period's invoice.\n`;
|
|
114
|
+
}
|
|
115
|
+
const usedUp = hours.workingSeconds >= BigInt(included) * 3600n;
|
|
116
|
+
return usedUp
|
|
117
|
+
? `${head} New work is paused until the reset.\n`
|
|
118
|
+
: `${head} New work pauses at the allowance.\n`;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Working agent time as hours to one decimal, e.g. "18.4 h": the tenth of
|
|
123
|
+
* an hour the invoice bills by, rounded half up. The console's billing page
|
|
124
|
+
* prints the same figure (formatAgentHours in @stigmer/react-sdk).
|
|
125
|
+
*/
|
|
126
|
+
export function formatAgentHours(seconds: bigint): string {
|
|
127
|
+
const tenths = (seconds + 180n) / 360n;
|
|
128
|
+
return `${tenths / 10n}.${tenths % 10n} h`;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Working time as a duration: "312h 5m" from an hour up, "4m 12s" under
|
|
133
|
+
* it, "42s" under a minute, "0s" for none. Never days: a report compares
|
|
134
|
+
* agents' hours, and a day would hide them.
|
|
135
|
+
*/
|
|
136
|
+
export function formatWorkingTime(seconds: bigint): string {
|
|
137
|
+
if (seconds <= 0n) return "0s";
|
|
138
|
+
const hours = seconds / 3600n;
|
|
139
|
+
const minutes = (seconds % 3600n) / 60n;
|
|
140
|
+
const rest = seconds % 60n;
|
|
141
|
+
if (hours > 0n) return `${hours}h ${minutes}m`;
|
|
142
|
+
if (minutes > 0n) return `${minutes}m ${rest}s`;
|
|
143
|
+
return `${rest}s`;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// "$0.50" from micro-USD, rounded half up to the cent.
|
|
147
|
+
function formatHourlyPrice(micros: bigint): string {
|
|
148
|
+
const cents = (micros + 5_000n) / 10_000n;
|
|
149
|
+
return `$${cents / 100n}.${String(cents % 100n).padStart(2, "0")}`;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// "2026-11-01": the UTC calendar day of an epoch-seconds instant.
|
|
153
|
+
function utcDay(seconds: bigint): string {
|
|
154
|
+
return new Date(Number(seconds) * 1000).toISOString().slice(0, 10);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// --- Render: session ---
|
|
158
|
+
|
|
159
|
+
export function renderSessionUsage(report: GetSessionUsageReportOutput, format: OutputFormat): string {
|
|
160
|
+
if (format === "json") return renderProtoJson(GetSessionUsageReportOutputSchema, report);
|
|
161
|
+
if (format === "yaml") return renderProtoYaml(GetSessionUsageReportOutputSchema, report);
|
|
162
|
+
|
|
163
|
+
const lines: string[] = ["", `Session: ${report.sessionId}`];
|
|
164
|
+
const period = formatDateRange(report.firstRunAt, report.lastRunAt);
|
|
165
|
+
if (period !== "") {
|
|
166
|
+
lines.push(`Period: ${period} (${report.runCount} runs)`);
|
|
167
|
+
} else {
|
|
168
|
+
lines.push(`Runs: ${report.runCount}`);
|
|
169
|
+
}
|
|
170
|
+
const totalTokens = reportTokens(report.totalUsage, report.modelBreakdown);
|
|
171
|
+
lines.push(`Tokens: ${formatTokenCount(totalTokens)}${report.isEstimated ? " (estimated)" : ""}`);
|
|
172
|
+
lines.push(`Working time: ${formatWorkingTime(report.totalUsage?.workingSeconds ?? 0n)}`);
|
|
173
|
+
const servedBy = formatServedBy(report.totalUsage);
|
|
174
|
+
if (servedBy !== "") lines.push(`Served by: ${servedBy}`);
|
|
175
|
+
lines.push("");
|
|
176
|
+
|
|
177
|
+
if (report.modelBreakdown.length > 0) {
|
|
178
|
+
const rows = report.modelBreakdown.map((m) => [
|
|
179
|
+
m.model,
|
|
180
|
+
formatTokenCount(m.inputTokens),
|
|
181
|
+
formatTokenCount(m.outputTokens),
|
|
182
|
+
formatTokenCount(m.cacheReadInputTokens),
|
|
183
|
+
formatTokenCount(m.totalTokens),
|
|
184
|
+
formatShare(m.totalTokens, totalTokens),
|
|
185
|
+
]);
|
|
186
|
+
lines.push(renderTable(["MODEL", "INPUT", "OUTPUT", "CACHED", "TOKENS", "SHARE"], rows), "");
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const cacheRate = formatCacheHitRate(report.totalUsage);
|
|
190
|
+
if (cacheRate !== "") lines.push(`Cache hit rate: ${cacheRate}`);
|
|
191
|
+
|
|
192
|
+
if (report.runs.length > 0) {
|
|
193
|
+
lines.push("");
|
|
194
|
+
const rows = report.runs.map((exec, i) => [
|
|
195
|
+
String(i + 1),
|
|
196
|
+
formatDate(exec.startedAt),
|
|
197
|
+
`${exec.isEstimated ? ESTIMATED_MARK : ""}${formatTokenCount(exec.totalTokens)}`,
|
|
198
|
+
formatWorkingTime(exec.workingSeconds),
|
|
199
|
+
exec.primaryModel,
|
|
200
|
+
mapPhaseToString(exec.phase),
|
|
201
|
+
]);
|
|
202
|
+
lines.push(renderTable(["#", "DATE", "TOKENS", "WORKING", "MODEL", "STATUS"], rows));
|
|
203
|
+
if (report.runs.some((exec) => exec.isEstimated)) {
|
|
204
|
+
lines.push(`${ESTIMATED_MARK} estimated from the run's own report`);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
lines.push("");
|
|
209
|
+
return `${lines.join("\n")}\n`;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// --- Render: agent ---
|
|
213
|
+
|
|
214
|
+
export function renderAgentUsage(
|
|
215
|
+
report: GetAgentUsageReportOutput,
|
|
216
|
+
range: DateRange,
|
|
217
|
+
format: OutputFormat,
|
|
218
|
+
): string {
|
|
219
|
+
if (format === "json") return renderProtoJson(GetAgentUsageReportOutputSchema, report);
|
|
220
|
+
if (format === "yaml") return renderProtoYaml(GetAgentUsageReportOutputSchema, report);
|
|
221
|
+
|
|
222
|
+
const name = report.agentName === "" ? report.agentId : report.agentName;
|
|
223
|
+
const lines: string[] = ["", `Agent: ${name}`];
|
|
224
|
+
if (range.from !== "" || range.to !== "") {
|
|
225
|
+
lines.push(`Period: ${formatInputDateRange(range.from, range.to)}`);
|
|
226
|
+
}
|
|
227
|
+
const totalTokens = reportTokens(report.totalUsage, report.modelBreakdown);
|
|
228
|
+
lines.push("");
|
|
229
|
+
lines.push(` Sessions: ${report.totalSessions}`);
|
|
230
|
+
lines.push(` Runs: ${report.totalRuns}`);
|
|
231
|
+
lines.push(` Total tokens: ${formatTokenCount(totalTokens)}`);
|
|
232
|
+
lines.push(` Working time: ${formatWorkingTime(report.totalUsage?.workingSeconds ?? 0n)}`);
|
|
233
|
+
if (report.totalRuns > 0) {
|
|
234
|
+
lines.push(` Avg/run: ${formatTokenCount(totalTokens / BigInt(report.totalRuns))}`);
|
|
235
|
+
}
|
|
236
|
+
const servedBy = formatServedBy(report.totalUsage);
|
|
237
|
+
if (servedBy !== "") lines.push(` Served by: ${servedBy}`);
|
|
238
|
+
lines.push("");
|
|
239
|
+
|
|
240
|
+
if (report.modelBreakdown.length > 0) {
|
|
241
|
+
const rows = report.modelBreakdown.map((m) => [
|
|
242
|
+
m.model,
|
|
243
|
+
formatTokenCount(m.totalTokens),
|
|
244
|
+
formatShare(m.totalTokens, totalTokens),
|
|
245
|
+
]);
|
|
246
|
+
lines.push(renderTable(["MODEL", "TOKENS", "SHARE"], rows), "");
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (report.sessions.length > 0) {
|
|
250
|
+
const rows = report.sessions.map((sess, i) => [
|
|
251
|
+
String(i + 1),
|
|
252
|
+
formatDateRange(sess.firstRunAt, sess.lastRunAt),
|
|
253
|
+
String(sess.runCount),
|
|
254
|
+
formatTokenCount(sess.totalTokens),
|
|
255
|
+
formatWorkingTime(sess.workingSeconds),
|
|
256
|
+
]);
|
|
257
|
+
lines.push(renderTable(["#", "PERIOD", "RUNS", "TOKENS", "WORKING"], rows));
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
lines.push("");
|
|
261
|
+
return `${lines.join("\n")}\n`;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// --- Render: org ---
|
|
265
|
+
|
|
266
|
+
export function renderOrgUsage(
|
|
267
|
+
report: GetOrgUsageReportOutput,
|
|
268
|
+
range: DateRange,
|
|
269
|
+
format: OutputFormat,
|
|
270
|
+
): string {
|
|
271
|
+
if (format === "json") return renderProtoJson(GetOrgUsageReportOutputSchema, report);
|
|
272
|
+
if (format === "yaml") return renderProtoYaml(GetOrgUsageReportOutputSchema, report);
|
|
273
|
+
|
|
274
|
+
const totalTokens = reportTokens(report.totalUsage, report.modelBreakdown);
|
|
275
|
+
const lines: string[] = ["", "Organization Usage Report", `Period: ${formatInputDateRange(range.from, range.to)}`, ""];
|
|
276
|
+
lines.push(` Agents: ${report.totalAgents}`);
|
|
277
|
+
lines.push(` Sessions: ${report.totalSessions}`);
|
|
278
|
+
lines.push(` Runs: ${report.totalRuns}`);
|
|
279
|
+
lines.push(` Total tokens: ${formatTokenCount(totalTokens)}`);
|
|
280
|
+
lines.push(` Working time: ${formatWorkingTime(report.totalUsage?.workingSeconds ?? 0n)}`);
|
|
281
|
+
const servedBy = formatServedBy(report.totalUsage);
|
|
282
|
+
if (servedBy !== "") lines.push(` Served by: ${servedBy}`);
|
|
283
|
+
lines.push("");
|
|
284
|
+
|
|
285
|
+
if (report.modelBreakdown.length > 0) {
|
|
286
|
+
const rows = report.modelBreakdown.map((m) => [
|
|
287
|
+
m.model,
|
|
288
|
+
formatTokenCount(m.totalTokens),
|
|
289
|
+
formatShare(m.totalTokens, totalTokens),
|
|
290
|
+
]);
|
|
291
|
+
lines.push(renderTable(["MODEL", "TOKENS", "SHARE"], rows), "");
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
if (report.topAgents.length > 0) {
|
|
295
|
+
const rows = report.topAgents.map((a) => [
|
|
296
|
+
a.agentName === "" ? a.agentId : a.agentName,
|
|
297
|
+
String(a.runCount),
|
|
298
|
+
formatTokenCount(a.totalTokens),
|
|
299
|
+
formatShare(a.totalTokens, totalTokens),
|
|
300
|
+
formatWorkingTime(a.workingSeconds),
|
|
301
|
+
]);
|
|
302
|
+
lines.push(renderTable(["AGENT", "RUNS", "TOKENS", "SHARE", "WORKING"], rows), "");
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
if (report.harnessUsage.length > 0) {
|
|
306
|
+
const rows = report.harnessUsage.map((h) => [
|
|
307
|
+
h.harness,
|
|
308
|
+
String(h.runCount),
|
|
309
|
+
formatTokenCount(h.totalTokens),
|
|
310
|
+
formatShare(h.totalTokens, totalTokens),
|
|
311
|
+
]);
|
|
312
|
+
lines.push(renderTable(["HARNESS", "RUNS", "TOKENS", "SHARE"], rows), "");
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
if (report.dailyUsage.length > 0) {
|
|
316
|
+
const rows = report.dailyUsage.map((day) => [day.date, String(day.runCount), formatTokenCount(day.totalTokens)]);
|
|
317
|
+
lines.push(renderTable(["DATE", "RUNS", "TOKENS"], rows));
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
lines.push("");
|
|
321
|
+
return `${lines.join("\n")}\n`;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// --- Formatting helpers ---
|
|
325
|
+
|
|
326
|
+
// Prefixes a run's tokens when they were counted from its runner's own report.
|
|
327
|
+
const ESTIMATED_MARK = "~";
|
|
328
|
+
|
|
329
|
+
// The report's token total: the aggregate's, or the model rows' sum when the
|
|
330
|
+
// aggregate is absent (a report with no runs may carry none).
|
|
331
|
+
function reportTokens(usage: UsageReportAggregate | undefined, models: readonly ModelUsage[]): bigint {
|
|
332
|
+
if (usage !== undefined) return usage.totalTokens;
|
|
333
|
+
return models.reduce((sum, m) => sum + m.totalTokens, 0n);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Whose provider credential served a report's tokens, as one line. The split
|
|
338
|
+
* shows only when more than one known source served tokens; a single known
|
|
339
|
+
* source reads as its name, with any tokens whose server was not recorded
|
|
340
|
+
* noted beside it. No known source (every run counted from its runner's own
|
|
341
|
+
* report, or metered records older than the field) prints nothing, since
|
|
342
|
+
* there is nothing to tell apart.
|
|
343
|
+
*/
|
|
344
|
+
export function formatServedBy(usage: UsageReportAggregate | undefined): string {
|
|
345
|
+
if (usage === undefined) return "";
|
|
346
|
+
const rows = usage.servedBy.filter((row) => row.totalTokens > 0n);
|
|
347
|
+
const isKnown = (source: ProviderKeySource): boolean =>
|
|
348
|
+
source !== ProviderKeySource.UNSPECIFIED;
|
|
349
|
+
const known = rows.filter((row) => isKnown(row.providerKeySource));
|
|
350
|
+
if (known.length === 0) return "";
|
|
351
|
+
if (known.length === 1) {
|
|
352
|
+
const label = servedByLabel(known[0].providerKeySource);
|
|
353
|
+
const unrecorded = rows
|
|
354
|
+
.filter((row) => !isKnown(row.providerKeySource))
|
|
355
|
+
.reduce((sum, row) => sum + row.totalTokens, 0n);
|
|
356
|
+
return unrecorded > 0n ? `${label} (${formatTokenCount(unrecorded)} tokens not recorded)` : label;
|
|
357
|
+
}
|
|
358
|
+
const total = rows.reduce((sum, row) => sum + row.totalTokens, 0n);
|
|
359
|
+
return rows
|
|
360
|
+
.map(
|
|
361
|
+
(row) =>
|
|
362
|
+
`${servedByLabel(row.providerKeySource)} ${formatTokenCount(row.totalTokens)} (${formatShare(row.totalTokens, total)})`,
|
|
363
|
+
)
|
|
364
|
+
.join(" · ");
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
function servedByLabel(source: ProviderKeySource): string {
|
|
368
|
+
switch (source) {
|
|
369
|
+
case ProviderKeySource.ORGANIZATION:
|
|
370
|
+
return "your keys";
|
|
371
|
+
case ProviderKeySource.PLATFORM:
|
|
372
|
+
return "the platform's connection";
|
|
373
|
+
case ProviderKeySource.UNSPECIFIED:
|
|
374
|
+
return "not recorded";
|
|
375
|
+
default: {
|
|
376
|
+
const unknown: never = source;
|
|
377
|
+
return `source ${String(unknown)}`;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
function formatShare(part: bigint, total: bigint): string {
|
|
383
|
+
if (total === 0n) return "0.0%";
|
|
384
|
+
return `${((Number(part) / Number(total)) * 100).toFixed(1)}%`;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// The share of all input served from the cache. The aggregate's input_tokens
|
|
388
|
+
// excludes both cache buckets, so the whole input is the three summed.
|
|
389
|
+
function formatCacheHitRate(usage: UsageReportAggregate | undefined): string {
|
|
390
|
+
if (usage === undefined || usage.cacheReadInputTokens === 0n) return "";
|
|
391
|
+
const allInput = usage.inputTokens + usage.cacheReadInputTokens + usage.cacheCreationInputTokens;
|
|
392
|
+
const rate = (Number(usage.cacheReadInputTokens) / Number(allInput)) * 100;
|
|
393
|
+
return `${Math.round(rate)}% cached`;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] as const;
|
|
397
|
+
|
|
398
|
+
// "Jan 02" from an ISO 8601 timestamp; raw (≤10 chars) on parse failure.
|
|
399
|
+
function formatDate(iso: string): string {
|
|
400
|
+
if (iso === "") return "";
|
|
401
|
+
const date = new Date(iso);
|
|
402
|
+
if (Number.isNaN(date.getTime())) return iso.length >= 10 ? iso.slice(0, 10) : iso;
|
|
403
|
+
return `${MONTHS[date.getMonth()]} ${String(date.getDate()).padStart(2, "0")}`;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
function formatDateRange(from: string, to: string): string {
|
|
407
|
+
const f = formatDate(from);
|
|
408
|
+
const t = formatDate(to);
|
|
409
|
+
if (f === "" && t === "") return "";
|
|
410
|
+
if (f === "") return `to ${t}`;
|
|
411
|
+
if (t === "") return `from ${f}`;
|
|
412
|
+
return `${f} to ${t}`;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// Plain user-supplied date strings (e.g. "2026-03-01"), shown verbatim.
|
|
416
|
+
function formatInputDateRange(from: string, to: string): string {
|
|
417
|
+
if (from === "" && to === "") return "";
|
|
418
|
+
if (from === "") return `to ${to}`;
|
|
419
|
+
if (to === "") return `from ${from}`;
|
|
420
|
+
return `${from} to ${to}`;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// Matches Go's mapPhaseToString (snake_case phase labels for the usage table).
|
|
424
|
+
function mapPhaseToString(phase: RunPhase): string {
|
|
425
|
+
switch (phase) {
|
|
426
|
+
case RunPhase.RUN_PENDING:
|
|
427
|
+
return "pending";
|
|
428
|
+
case RunPhase.RUN_IN_PROGRESS:
|
|
429
|
+
return "in_progress";
|
|
430
|
+
case RunPhase.RUN_COMPLETED:
|
|
431
|
+
return "completed";
|
|
432
|
+
case RunPhase.RUN_FAILED:
|
|
433
|
+
return "failed";
|
|
434
|
+
case RunPhase.RUN_CANCELLED:
|
|
435
|
+
return "cancelled";
|
|
436
|
+
case RunPhase.RUN_WAITING_FOR_APPROVAL:
|
|
437
|
+
return "waiting_for_approval";
|
|
438
|
+
case RunPhase.RUN_TERMINATED:
|
|
439
|
+
return "terminated";
|
|
440
|
+
default:
|
|
441
|
+
return "unknown";
|
|
442
|
+
}
|
|
443
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Offline resource validation: parse a YAML document into its proto schema.
|
|
2
|
+
//
|
|
3
|
+
// protobuf-es `fromJson` performs structural validation — field types, required
|
|
4
|
+
// shapes, and enum membership — without a server round-trip, mirroring the Go
|
|
5
|
+
// CLI's local load-and-validate. The accepted kinds are the file-based verbs
|
|
6
|
+
// (apply/validate) that carry a YAML representation.
|
|
7
|
+
|
|
8
|
+
import { type DescMessage, fromJson, type JsonValue } from "@bufbuild/protobuf";
|
|
9
|
+
import { AgentSchema } from "@stigmer/apis/ai/stigmer/agentic/agent/v1/api_pb";
|
|
10
|
+
import { ApiResourceKind } from "@stigmer/apis/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
11
|
+
import { mcpServerWayForward, subagentsWayForward } from "@stigmer/client";
|
|
12
|
+
|
|
13
|
+
// Exported for the verb/dispatch conformance suite (registry/registry.test.ts),
|
|
14
|
+
// which holds this map and the matrix's Verb.Validate promises to strict
|
|
15
|
+
// bidirectional equality — the stigmer/stigmer#353 drift class. Command code
|
|
16
|
+
// resolves schemas through `schemaForValidate`, never this map directly.
|
|
17
|
+
export const VALIDATE_SCHEMAS: ReadonlyMap<ApiResourceKind, DescMessage> = new Map<ApiResourceKind, DescMessage>([
|
|
18
|
+
[ApiResourceKind.agent, AgentSchema],
|
|
19
|
+
]);
|
|
20
|
+
|
|
21
|
+
export function schemaForValidate(kind: ApiResourceKind): DescMessage | undefined {
|
|
22
|
+
return VALIDATE_SCHEMAS.get(kind);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Structurally validate a parsed YAML document against its proto schema. */
|
|
26
|
+
export function validateDocument(schema: DescMessage, document: JsonValue): void {
|
|
27
|
+
// A retired field is not a forward-compat one: the leniency below would
|
|
28
|
+
// pass an agent listing mcp_server_usages or sub_agents that apply then
|
|
29
|
+
// refuses, so each is refused here with the same way forward.
|
|
30
|
+
const retired = mcpServerWayForward(document);
|
|
31
|
+
if (retired !== undefined) throw new Error(`mcp_server_usages is no longer read. ${retired}`);
|
|
32
|
+
const subagents = subagentsWayForward(document);
|
|
33
|
+
if (subagents !== undefined) throw new Error(`sub_agents is no longer read. ${subagents}`);
|
|
34
|
+
// ignoreUnknownFields mirrors the server's lenient unmarshal: forward-compat
|
|
35
|
+
// fields a newer server adds should not fail a slightly older CLI.
|
|
36
|
+
fromJson(schema, document, { ignoreUnknownFields: true });
|
|
37
|
+
}
|