@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,132 @@
|
|
|
1
|
+
// Answer-submission resilience for the headless stream driver, and the
|
|
2
|
+
// user-facing message for a dropped event stream.
|
|
3
|
+
//
|
|
4
|
+
// An answer races ordinary network blips, so a transient failure retries
|
|
5
|
+
// with exponential backoff. A FAILED_PRECONDITION is final: the call no
|
|
6
|
+
// longer waits (another answer, or a grant on its class, settled it, or its
|
|
7
|
+
// turn ended), which the driver reads as settled rather than failed.
|
|
8
|
+
// classifyStreamError words a stream that dropped for good, with a resume
|
|
9
|
+
// hint.
|
|
10
|
+
import { Code, ConnectError } from "@connectrpc/connect";
|
|
11
|
+
import { StigmerError } from "@stigmer/client";
|
|
12
|
+
export const APPROVAL_RETRY_MAX_ATTEMPTS = 3;
|
|
13
|
+
export const APPROVAL_RETRY_BASE_DELAY_MS = 1000;
|
|
14
|
+
const MAX_CHAIN_DEPTH = 20;
|
|
15
|
+
/**
|
|
16
|
+
* Retry `fn` up to `maxAttempts` times with doubling backoff, stopping early on
|
|
17
|
+
* success, a non-retryable error, or abort. The delay between attempts is
|
|
18
|
+
* abort-aware. Rejects with the last error on failure.
|
|
19
|
+
*/
|
|
20
|
+
export async function retryWithBackoff(signal, maxAttempts, baseDelayMs, fn) {
|
|
21
|
+
let lastErr;
|
|
22
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
23
|
+
if (signal.aborted)
|
|
24
|
+
throw new DOMException("Aborted", "AbortError");
|
|
25
|
+
try {
|
|
26
|
+
await fn();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
lastErr = err;
|
|
31
|
+
if (!isRetryableSubmitError(err))
|
|
32
|
+
throw err;
|
|
33
|
+
if (attempt < maxAttempts - 1) {
|
|
34
|
+
await abortableDelay(baseDelayMs * 2 ** attempt, signal);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
throw lastErr;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* True when an answer-submit error is transient and worth retrying.
|
|
42
|
+
* Non-RPC errors default to retryable (typically transient I/O).
|
|
43
|
+
*/
|
|
44
|
+
export function isRetryableSubmitError(err) {
|
|
45
|
+
const coded = extractCoded(err);
|
|
46
|
+
if (coded === undefined)
|
|
47
|
+
return true;
|
|
48
|
+
switch (coded.code) {
|
|
49
|
+
case Code.Unavailable:
|
|
50
|
+
case Code.DeadlineExceeded:
|
|
51
|
+
case Code.ResourceExhausted:
|
|
52
|
+
case Code.Aborted:
|
|
53
|
+
case Code.Internal:
|
|
54
|
+
case Code.Unknown:
|
|
55
|
+
return true;
|
|
56
|
+
default:
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* True when an answer was refused because the call no longer waits: it was
|
|
62
|
+
* answered already (a grant on its class allows every waiting call of the
|
|
63
|
+
* class at once) or its turn ended.
|
|
64
|
+
*/
|
|
65
|
+
export function isSettledAnswerError(err) {
|
|
66
|
+
return extractCoded(err)?.code === Code.FailedPrecondition;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Translate a dropped event-stream error into a user-facing message with a
|
|
70
|
+
* resume hint.
|
|
71
|
+
*/
|
|
72
|
+
export function classifyStreamError(err, sessionId) {
|
|
73
|
+
let message;
|
|
74
|
+
const coded = extractCoded(err);
|
|
75
|
+
if (coded === undefined) {
|
|
76
|
+
message = `Unexpected stream error: ${messageOf(err)}`;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
switch (coded.code) {
|
|
80
|
+
case Code.Unavailable:
|
|
81
|
+
message = "Connection to server lost.";
|
|
82
|
+
break;
|
|
83
|
+
case Code.Canceled:
|
|
84
|
+
message = "Server cancelled the stream.";
|
|
85
|
+
break;
|
|
86
|
+
case Code.DeadlineExceeded:
|
|
87
|
+
message = "Server response timed out.";
|
|
88
|
+
break;
|
|
89
|
+
default:
|
|
90
|
+
message = `Stream error (${Code[coded.code] ?? "Unknown"}): ${coded.message}`;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (sessionId !== "")
|
|
94
|
+
message += `\nRe-attach to this session: stigmer resume ${sessionId}`;
|
|
95
|
+
return message;
|
|
96
|
+
}
|
|
97
|
+
// Walk the cause chain for the first SDK/Connect coded error, as
|
|
98
|
+
// errors/classify.ts does.
|
|
99
|
+
function extractCoded(err) {
|
|
100
|
+
let depth = 0;
|
|
101
|
+
for (let current = err; current != null && depth < MAX_CHAIN_DEPTH; current = causeOf(current), depth++) {
|
|
102
|
+
if (current instanceof StigmerError)
|
|
103
|
+
return { code: current.connectCode, message: current.message };
|
|
104
|
+
if (current instanceof ConnectError)
|
|
105
|
+
return { code: current.code, message: current.rawMessage };
|
|
106
|
+
}
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
function causeOf(value) {
|
|
110
|
+
return value !== null && typeof value === "object" ? value.cause : undefined;
|
|
111
|
+
}
|
|
112
|
+
function messageOf(value) {
|
|
113
|
+
if (value instanceof Error)
|
|
114
|
+
return value.message;
|
|
115
|
+
if (typeof value === "string")
|
|
116
|
+
return value;
|
|
117
|
+
return String(value);
|
|
118
|
+
}
|
|
119
|
+
function abortableDelay(ms, signal) {
|
|
120
|
+
return new Promise((resolve, reject) => {
|
|
121
|
+
const timer = setTimeout(() => {
|
|
122
|
+
signal.removeEventListener("abort", onAbort);
|
|
123
|
+
resolve();
|
|
124
|
+
}, ms);
|
|
125
|
+
const onAbort = () => {
|
|
126
|
+
clearTimeout(timer);
|
|
127
|
+
reject(new DOMException("Aborted", "AbortError"));
|
|
128
|
+
};
|
|
129
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=submit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit.js","sourceRoot":"","sources":["../../src/resources/stream/submit.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the terminal can host the interactive Ink renderer: stdout must be a
|
|
3
|
+
* TTY and TERM must not be "dumb". When false, the command uses plaintext.
|
|
4
|
+
*/
|
|
5
|
+
export declare function isInkSupported(stream?: {
|
|
6
|
+
isTTY?: boolean;
|
|
7
|
+
}): boolean;
|
|
8
|
+
//# sourceMappingURL=tty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tty.d.ts","sourceRoot":"","sources":["../../src/resources/stream/tty.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAmB,GAAG,OAAO,CAGpF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Terminal-capability gate for renderer selection.
|
|
2
|
+
//
|
|
3
|
+
// Deliberately free of any React/Ink imports so the command can decide whether
|
|
4
|
+
// to take the interactive path *before* paying the dynamic-import cost of
|
|
5
|
+
// ink.tsx. Mirrors Go's termctl.IsSupported.
|
|
6
|
+
/**
|
|
7
|
+
* Whether the terminal can host the interactive Ink renderer: stdout must be a
|
|
8
|
+
* TTY and TERM must not be "dumb". When false, the command uses plaintext.
|
|
9
|
+
*/
|
|
10
|
+
export function isInkSupported(stream = process.stdout) {
|
|
11
|
+
if (stream.isTTY !== true)
|
|
12
|
+
return false;
|
|
13
|
+
return process.env.TERM !== "dumb";
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=tty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tty.js","sourceRoot":"","sources":["../../src/resources/stream/tty.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,+EAA+E;AAC/E,0EAA0E;AAC1E,6CAA6C;AAE7C;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,SAA8B,OAAO,CAAC,MAAM;IACzE,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACxC,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Stigmer } from "@stigmer/client";
|
|
2
|
+
import { CommandResult } from "../output/index.js";
|
|
3
|
+
export declare function tagVersion(client: Stigmer, typeArg: string, ref: string, hash: string, tag: string, org: string): Promise<CommandResult>;
|
|
4
|
+
//# sourceMappingURL=tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../src/resources/tag.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKnD,wBAAsB,UAAU,CAC9B,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,aAAa,CAAC,CAWxB"}
|
package/resources/tag.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// `tag` dispatch: assign a tag to a versioned resource. Tags are mutable
|
|
2
|
+
// pointers — reassigning a tag moves it to the named version. Agents carry a
|
|
3
|
+
// tag RPC; skills and plugins are tagged when they are pushed.
|
|
4
|
+
//
|
|
5
|
+
// This is an id-shaped mutation, so it rides the high-level sub-clients
|
|
6
|
+
// (resolve the resource by reference, then tagVersion) rather than a raw
|
|
7
|
+
// controller.
|
|
8
|
+
import { create } from "@bufbuild/protobuf";
|
|
9
|
+
import { TagAgentVersionInputSchema } from "@stigmer/apis/ai/stigmer/agentic/agent/v1/version_pb";
|
|
10
|
+
import { UsageError } from "../errors/index.js";
|
|
11
|
+
import { CommandResult } from "../output/index.js";
|
|
12
|
+
/** The resource types a tag can be assigned to, by the aliases the CLI accepts. */
|
|
13
|
+
const TAGGABLE = new Set(["agent"]);
|
|
14
|
+
export async function tagVersion(client, typeArg, ref, hash, tag, org) {
|
|
15
|
+
if (!TAGGABLE.has(typeArg.trim().toLowerCase())) {
|
|
16
|
+
throw new UsageError(`tagging is not supported for resource type "${typeArg}"\n\nSupported types: agent`);
|
|
17
|
+
}
|
|
18
|
+
const [refOrg, slug] = parseOrgSlug(ref, org);
|
|
19
|
+
const agent = await client.agent.getByReference({ org: refOrg, slug });
|
|
20
|
+
const agentId = agent.metadata?.id ?? "";
|
|
21
|
+
await client.agent.tagVersion(create(TagAgentVersionInputSchema, { agentId, versionHash: hash, tag }));
|
|
22
|
+
return CommandResult.success(`Tagged version ${truncateHash(hash)} as '${tag}'`);
|
|
23
|
+
}
|
|
24
|
+
// "org/slug" → [org, slug]; a bare token uses the resolved org context.
|
|
25
|
+
function parseOrgSlug(ref, defaultOrg) {
|
|
26
|
+
const slash = ref.indexOf("/");
|
|
27
|
+
if (slash > 0) {
|
|
28
|
+
return [ref.slice(0, slash), ref.slice(slash + 1)];
|
|
29
|
+
}
|
|
30
|
+
return [defaultOrg, ref];
|
|
31
|
+
}
|
|
32
|
+
// The backend addresses versions by their full content hash; the CLI echoes a
|
|
33
|
+
// 12-char prefix for readability, matching Go's truncateHash.
|
|
34
|
+
function truncateHash(hash) {
|
|
35
|
+
return hash.length > 12 ? hash.slice(0, 12) : hash;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../src/resources/tag.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,6EAA6E;AAC7E,+DAA+D;AAC/D,EAAE;AACF,wEAAwE;AACxE,yEAAyE;AACzE,cAAc;AAEd,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAC;AAElG,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,mFAAmF;AACnF,MAAM,QAAQ,GAAwB,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AAEzD,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,MAAe,EACf,OAAe,EACf,GAAW,EACX,IAAY,EACZ,GAAW,EACX,GAAW;IAEX,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,UAAU,CAAC,+CAA+C,OAAO,6BAA6B,CAAC,CAAC;IAC5G,CAAC;IAED,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IACvE,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC;IACzC,MAAM,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,0BAA0B,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IAEvG,OAAO,aAAa,CAAC,OAAO,CAAC,kBAAkB,YAAY,CAAC,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC;AACnF,CAAC;AAED,wEAAwE;AACxE,SAAS,YAAY,CAAC,GAAW,EAAE,UAAkB;IACnD,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;IACrD,CAAC;IACD,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;AAC3B,CAAC;AAED,8EAA8E;AAC9E,8DAA8D;AAC9D,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type GetAgentUsageReportOutput, type GetOrgUsageReportOutput, type GetSessionUsageReportOutput } from "@stigmer/apis/ai/stigmer/agentic/run/v1/io_pb";
|
|
2
|
+
import { type UsageReportAggregate } from "@stigmer/apis/ai/stigmer/agentic/run/v1/usage_pb";
|
|
3
|
+
import { type AgentHours } from "@stigmer/apis/ai/stigmer/billing/subscription/v1/io_pb";
|
|
4
|
+
import type { Stigmer } from "@stigmer/client";
|
|
5
|
+
import type { OutputFormat } from "../output/index.js";
|
|
6
|
+
export interface DateRange {
|
|
7
|
+
readonly from: string;
|
|
8
|
+
readonly to: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function getSessionUsageReport(client: Stigmer, sessionId: string): Promise<GetSessionUsageReportOutput>;
|
|
11
|
+
export declare function getAgentUsageReport(client: Stigmer, agentId: string, org: string, range: DateRange): Promise<GetAgentUsageReportOutput>;
|
|
12
|
+
export declare function getOrgUsageReport(client: Stigmer, org: string, range: DateRange): Promise<GetOrgUsageReportOutput>;
|
|
13
|
+
export declare function getAgentHours(client: Stigmer, org: string): Promise<AgentHours>;
|
|
14
|
+
/**
|
|
15
|
+
* Where the organization stands against its plan's agent hours, as one
|
|
16
|
+
* line: the hours used of those included in the window ("this month" on
|
|
17
|
+
* Free's calendar month, "this period" on a subscription's), the reset
|
|
18
|
+
* date, then what happens past the allowance by the plan's own terms (an
|
|
19
|
+
* allowance with no hourly price pauses new work; a price bills each hour
|
|
20
|
+
* past it). A plan with no allowance shows the hours alone.
|
|
21
|
+
*/
|
|
22
|
+
export declare function renderAgentHours(hours: AgentHours, format: OutputFormat): string;
|
|
23
|
+
/**
|
|
24
|
+
* Working agent time as hours to one decimal, e.g. "18.4 h": the tenth of
|
|
25
|
+
* an hour the invoice bills by, rounded half up. The console's billing page
|
|
26
|
+
* prints the same figure (formatAgentHours in @stigmer/react-sdk).
|
|
27
|
+
*/
|
|
28
|
+
export declare function formatAgentHours(seconds: bigint): string;
|
|
29
|
+
/**
|
|
30
|
+
* Working time as a duration: "312h 5m" from an hour up, "4m 12s" under
|
|
31
|
+
* it, "42s" under a minute, "0s" for none. Never days: a report compares
|
|
32
|
+
* agents' hours, and a day would hide them.
|
|
33
|
+
*/
|
|
34
|
+
export declare function formatWorkingTime(seconds: bigint): string;
|
|
35
|
+
export declare function renderSessionUsage(report: GetSessionUsageReportOutput, format: OutputFormat): string;
|
|
36
|
+
export declare function renderAgentUsage(report: GetAgentUsageReportOutput, range: DateRange, format: OutputFormat): string;
|
|
37
|
+
export declare function renderOrgUsage(report: GetOrgUsageReportOutput, range: DateRange, format: OutputFormat): string;
|
|
38
|
+
/**
|
|
39
|
+
* Whose provider credential served a report's tokens, as one line. The split
|
|
40
|
+
* shows only when more than one known source served tokens; a single known
|
|
41
|
+
* source reads as its name, with any tokens whose server was not recorded
|
|
42
|
+
* noted beside it. No known source (every run counted from its runner's own
|
|
43
|
+
* report, or metered records older than the field) prints nothing, since
|
|
44
|
+
* there is nothing to tell apart.
|
|
45
|
+
*/
|
|
46
|
+
export declare function formatServedBy(usage: UsageReportAggregate | undefined): string;
|
|
47
|
+
//# sourceMappingURL=usage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../src/resources/usage.ts"],"names":[],"mappings":"AA0BA,OAAO,EAOL,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EACjC,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,wDAAwD,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIvD,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAID,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAEpH;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,yBAAyB,CAAC,CAIpC;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,OAAO,EACf,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,uBAAuB,CAAC,CAIlC;AAED,wBAAsB,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAErF;AAID;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAmBhF;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGxD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQzD;AAeD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,2BAA2B,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAmDpG;AAID,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,yBAAyB,EACjC,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,YAAY,GACnB,MAAM,CA4CR;AAID,wBAAgB,cAAc,CAC5B,MAAM,EAAE,uBAAuB,EAC/B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,YAAY,GACnB,MAAM,CAoDR;AAcD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,oBAAoB,GAAG,SAAS,GAAG,MAAM,CAqB9E"}
|
|
@@ -0,0 +1,376 @@
|
|
|
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
|
+
import { create } from "@bufbuild/protobuf";
|
|
25
|
+
import { RunPhase } from "@stigmer/apis/ai/stigmer/agentic/run/v1/enum_pb";
|
|
26
|
+
import { GetAgentUsageReportInputSchema, GetAgentUsageReportOutputSchema, GetOrgUsageReportInputSchema, GetOrgUsageReportOutputSchema, GetSessionUsageReportInputSchema, GetSessionUsageReportOutputSchema, } from "@stigmer/apis/ai/stigmer/agentic/run/v1/io_pb";
|
|
27
|
+
import { ProviderKeySource, } from "@stigmer/apis/ai/stigmer/agentic/run/v1/usage_pb";
|
|
28
|
+
import { AgentHoursSchema, AgentHoursWindow, GetAgentHoursInputSchema, } from "@stigmer/apis/ai/stigmer/billing/subscription/v1/io_pb";
|
|
29
|
+
import { renderProtoJson, renderProtoYaml, renderTable } from "../output/index.js";
|
|
30
|
+
import { formatTokenCount } from "./run-format.js";
|
|
31
|
+
// --- Fetch ---
|
|
32
|
+
export async function getSessionUsageReport(client, sessionId) {
|
|
33
|
+
return client.run.getSessionUsageReport(create(GetSessionUsageReportInputSchema, { sessionId }));
|
|
34
|
+
}
|
|
35
|
+
export async function getAgentUsageReport(client, agentId, org, range) {
|
|
36
|
+
return client.run.getAgentUsageReport(create(GetAgentUsageReportInputSchema, { agentId, org, fromDate: range.from, toDate: range.to }));
|
|
37
|
+
}
|
|
38
|
+
export async function getOrgUsageReport(client, org, range) {
|
|
39
|
+
return client.run.getOrgUsageReport(create(GetOrgUsageReportInputSchema, { org, fromDate: range.from, toDate: range.to }));
|
|
40
|
+
}
|
|
41
|
+
export async function getAgentHours(client, org) {
|
|
42
|
+
return client.subscription.getAgentHours(create(GetAgentHoursInputSchema, { org }));
|
|
43
|
+
}
|
|
44
|
+
// --- Render: agent hours ---
|
|
45
|
+
/**
|
|
46
|
+
* Where the organization stands against its plan's agent hours, as one
|
|
47
|
+
* line: the hours used of those included in the window ("this month" on
|
|
48
|
+
* Free's calendar month, "this period" on a subscription's), the reset
|
|
49
|
+
* date, then what happens past the allowance by the plan's own terms (an
|
|
50
|
+
* allowance with no hourly price pauses new work; a price bills each hour
|
|
51
|
+
* past it). A plan with no allowance shows the hours alone.
|
|
52
|
+
*/
|
|
53
|
+
export function renderAgentHours(hours, format) {
|
|
54
|
+
if (format === "json")
|
|
55
|
+
return renderProtoJson(AgentHoursSchema, hours);
|
|
56
|
+
if (format === "yaml")
|
|
57
|
+
return renderProtoYaml(AgentHoursSchema, hours);
|
|
58
|
+
const window = hours.window === AgentHoursWindow.calendar_month ? "this month" : "this period";
|
|
59
|
+
const used = formatAgentHours(hours.workingSeconds);
|
|
60
|
+
const resets = hours.windowEnd === undefined ? "" : ` (resets ${utcDay(hours.windowEnd.seconds)} UTC)`;
|
|
61
|
+
const included = hours.includedHours;
|
|
62
|
+
if (included === undefined) {
|
|
63
|
+
return `Agent hours: ${used} used ${window}${resets}.\n`;
|
|
64
|
+
}
|
|
65
|
+
const head = `Agent hours: ${used} of ${included} h used ${window}${resets}.`;
|
|
66
|
+
if (hours.perAgentHourMicros !== undefined) {
|
|
67
|
+
return `${head} Then ${formatHourlyPrice(hours.perAgentHourMicros)} an hour, on this period's invoice.\n`;
|
|
68
|
+
}
|
|
69
|
+
const usedUp = hours.workingSeconds >= BigInt(included) * 3600n;
|
|
70
|
+
return usedUp
|
|
71
|
+
? `${head} New work is paused until the reset.\n`
|
|
72
|
+
: `${head} New work pauses at the allowance.\n`;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Working agent time as hours to one decimal, e.g. "18.4 h": the tenth of
|
|
76
|
+
* an hour the invoice bills by, rounded half up. The console's billing page
|
|
77
|
+
* prints the same figure (formatAgentHours in @stigmer/react-sdk).
|
|
78
|
+
*/
|
|
79
|
+
export function formatAgentHours(seconds) {
|
|
80
|
+
const tenths = (seconds + 180n) / 360n;
|
|
81
|
+
return `${tenths / 10n}.${tenths % 10n} h`;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Working time as a duration: "312h 5m" from an hour up, "4m 12s" under
|
|
85
|
+
* it, "42s" under a minute, "0s" for none. Never days: a report compares
|
|
86
|
+
* agents' hours, and a day would hide them.
|
|
87
|
+
*/
|
|
88
|
+
export function formatWorkingTime(seconds) {
|
|
89
|
+
if (seconds <= 0n)
|
|
90
|
+
return "0s";
|
|
91
|
+
const hours = seconds / 3600n;
|
|
92
|
+
const minutes = (seconds % 3600n) / 60n;
|
|
93
|
+
const rest = seconds % 60n;
|
|
94
|
+
if (hours > 0n)
|
|
95
|
+
return `${hours}h ${minutes}m`;
|
|
96
|
+
if (minutes > 0n)
|
|
97
|
+
return `${minutes}m ${rest}s`;
|
|
98
|
+
return `${rest}s`;
|
|
99
|
+
}
|
|
100
|
+
// "$0.50" from micro-USD, rounded half up to the cent.
|
|
101
|
+
function formatHourlyPrice(micros) {
|
|
102
|
+
const cents = (micros + 5000n) / 10000n;
|
|
103
|
+
return `$${cents / 100n}.${String(cents % 100n).padStart(2, "0")}`;
|
|
104
|
+
}
|
|
105
|
+
// "2026-11-01": the UTC calendar day of an epoch-seconds instant.
|
|
106
|
+
function utcDay(seconds) {
|
|
107
|
+
return new Date(Number(seconds) * 1000).toISOString().slice(0, 10);
|
|
108
|
+
}
|
|
109
|
+
// --- Render: session ---
|
|
110
|
+
export function renderSessionUsage(report, format) {
|
|
111
|
+
if (format === "json")
|
|
112
|
+
return renderProtoJson(GetSessionUsageReportOutputSchema, report);
|
|
113
|
+
if (format === "yaml")
|
|
114
|
+
return renderProtoYaml(GetSessionUsageReportOutputSchema, report);
|
|
115
|
+
const lines = ["", `Session: ${report.sessionId}`];
|
|
116
|
+
const period = formatDateRange(report.firstRunAt, report.lastRunAt);
|
|
117
|
+
if (period !== "") {
|
|
118
|
+
lines.push(`Period: ${period} (${report.runCount} runs)`);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
lines.push(`Runs: ${report.runCount}`);
|
|
122
|
+
}
|
|
123
|
+
const totalTokens = reportTokens(report.totalUsage, report.modelBreakdown);
|
|
124
|
+
lines.push(`Tokens: ${formatTokenCount(totalTokens)}${report.isEstimated ? " (estimated)" : ""}`);
|
|
125
|
+
lines.push(`Working time: ${formatWorkingTime(report.totalUsage?.workingSeconds ?? 0n)}`);
|
|
126
|
+
const servedBy = formatServedBy(report.totalUsage);
|
|
127
|
+
if (servedBy !== "")
|
|
128
|
+
lines.push(`Served by: ${servedBy}`);
|
|
129
|
+
lines.push("");
|
|
130
|
+
if (report.modelBreakdown.length > 0) {
|
|
131
|
+
const rows = report.modelBreakdown.map((m) => [
|
|
132
|
+
m.model,
|
|
133
|
+
formatTokenCount(m.inputTokens),
|
|
134
|
+
formatTokenCount(m.outputTokens),
|
|
135
|
+
formatTokenCount(m.cacheReadInputTokens),
|
|
136
|
+
formatTokenCount(m.totalTokens),
|
|
137
|
+
formatShare(m.totalTokens, totalTokens),
|
|
138
|
+
]);
|
|
139
|
+
lines.push(renderTable(["MODEL", "INPUT", "OUTPUT", "CACHED", "TOKENS", "SHARE"], rows), "");
|
|
140
|
+
}
|
|
141
|
+
const cacheRate = formatCacheHitRate(report.totalUsage);
|
|
142
|
+
if (cacheRate !== "")
|
|
143
|
+
lines.push(`Cache hit rate: ${cacheRate}`);
|
|
144
|
+
if (report.runs.length > 0) {
|
|
145
|
+
lines.push("");
|
|
146
|
+
const rows = report.runs.map((exec, i) => [
|
|
147
|
+
String(i + 1),
|
|
148
|
+
formatDate(exec.startedAt),
|
|
149
|
+
`${exec.isEstimated ? ESTIMATED_MARK : ""}${formatTokenCount(exec.totalTokens)}`,
|
|
150
|
+
formatWorkingTime(exec.workingSeconds),
|
|
151
|
+
exec.primaryModel,
|
|
152
|
+
mapPhaseToString(exec.phase),
|
|
153
|
+
]);
|
|
154
|
+
lines.push(renderTable(["#", "DATE", "TOKENS", "WORKING", "MODEL", "STATUS"], rows));
|
|
155
|
+
if (report.runs.some((exec) => exec.isEstimated)) {
|
|
156
|
+
lines.push(`${ESTIMATED_MARK} estimated from the run's own report`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
lines.push("");
|
|
160
|
+
return `${lines.join("\n")}\n`;
|
|
161
|
+
}
|
|
162
|
+
// --- Render: agent ---
|
|
163
|
+
export function renderAgentUsage(report, range, format) {
|
|
164
|
+
if (format === "json")
|
|
165
|
+
return renderProtoJson(GetAgentUsageReportOutputSchema, report);
|
|
166
|
+
if (format === "yaml")
|
|
167
|
+
return renderProtoYaml(GetAgentUsageReportOutputSchema, report);
|
|
168
|
+
const name = report.agentName === "" ? report.agentId : report.agentName;
|
|
169
|
+
const lines = ["", `Agent: ${name}`];
|
|
170
|
+
if (range.from !== "" || range.to !== "") {
|
|
171
|
+
lines.push(`Period: ${formatInputDateRange(range.from, range.to)}`);
|
|
172
|
+
}
|
|
173
|
+
const totalTokens = reportTokens(report.totalUsage, report.modelBreakdown);
|
|
174
|
+
lines.push("");
|
|
175
|
+
lines.push(` Sessions: ${report.totalSessions}`);
|
|
176
|
+
lines.push(` Runs: ${report.totalRuns}`);
|
|
177
|
+
lines.push(` Total tokens: ${formatTokenCount(totalTokens)}`);
|
|
178
|
+
lines.push(` Working time: ${formatWorkingTime(report.totalUsage?.workingSeconds ?? 0n)}`);
|
|
179
|
+
if (report.totalRuns > 0) {
|
|
180
|
+
lines.push(` Avg/run: ${formatTokenCount(totalTokens / BigInt(report.totalRuns))}`);
|
|
181
|
+
}
|
|
182
|
+
const servedBy = formatServedBy(report.totalUsage);
|
|
183
|
+
if (servedBy !== "")
|
|
184
|
+
lines.push(` Served by: ${servedBy}`);
|
|
185
|
+
lines.push("");
|
|
186
|
+
if (report.modelBreakdown.length > 0) {
|
|
187
|
+
const rows = report.modelBreakdown.map((m) => [
|
|
188
|
+
m.model,
|
|
189
|
+
formatTokenCount(m.totalTokens),
|
|
190
|
+
formatShare(m.totalTokens, totalTokens),
|
|
191
|
+
]);
|
|
192
|
+
lines.push(renderTable(["MODEL", "TOKENS", "SHARE"], rows), "");
|
|
193
|
+
}
|
|
194
|
+
if (report.sessions.length > 0) {
|
|
195
|
+
const rows = report.sessions.map((sess, i) => [
|
|
196
|
+
String(i + 1),
|
|
197
|
+
formatDateRange(sess.firstRunAt, sess.lastRunAt),
|
|
198
|
+
String(sess.runCount),
|
|
199
|
+
formatTokenCount(sess.totalTokens),
|
|
200
|
+
formatWorkingTime(sess.workingSeconds),
|
|
201
|
+
]);
|
|
202
|
+
lines.push(renderTable(["#", "PERIOD", "RUNS", "TOKENS", "WORKING"], rows));
|
|
203
|
+
}
|
|
204
|
+
lines.push("");
|
|
205
|
+
return `${lines.join("\n")}\n`;
|
|
206
|
+
}
|
|
207
|
+
// --- Render: org ---
|
|
208
|
+
export function renderOrgUsage(report, range, format) {
|
|
209
|
+
if (format === "json")
|
|
210
|
+
return renderProtoJson(GetOrgUsageReportOutputSchema, report);
|
|
211
|
+
if (format === "yaml")
|
|
212
|
+
return renderProtoYaml(GetOrgUsageReportOutputSchema, report);
|
|
213
|
+
const totalTokens = reportTokens(report.totalUsage, report.modelBreakdown);
|
|
214
|
+
const lines = ["", "Organization Usage Report", `Period: ${formatInputDateRange(range.from, range.to)}`, ""];
|
|
215
|
+
lines.push(` Agents: ${report.totalAgents}`);
|
|
216
|
+
lines.push(` Sessions: ${report.totalSessions}`);
|
|
217
|
+
lines.push(` Runs: ${report.totalRuns}`);
|
|
218
|
+
lines.push(` Total tokens: ${formatTokenCount(totalTokens)}`);
|
|
219
|
+
lines.push(` Working time: ${formatWorkingTime(report.totalUsage?.workingSeconds ?? 0n)}`);
|
|
220
|
+
const servedBy = formatServedBy(report.totalUsage);
|
|
221
|
+
if (servedBy !== "")
|
|
222
|
+
lines.push(` Served by: ${servedBy}`);
|
|
223
|
+
lines.push("");
|
|
224
|
+
if (report.modelBreakdown.length > 0) {
|
|
225
|
+
const rows = report.modelBreakdown.map((m) => [
|
|
226
|
+
m.model,
|
|
227
|
+
formatTokenCount(m.totalTokens),
|
|
228
|
+
formatShare(m.totalTokens, totalTokens),
|
|
229
|
+
]);
|
|
230
|
+
lines.push(renderTable(["MODEL", "TOKENS", "SHARE"], rows), "");
|
|
231
|
+
}
|
|
232
|
+
if (report.topAgents.length > 0) {
|
|
233
|
+
const rows = report.topAgents.map((a) => [
|
|
234
|
+
a.agentName === "" ? a.agentId : a.agentName,
|
|
235
|
+
String(a.runCount),
|
|
236
|
+
formatTokenCount(a.totalTokens),
|
|
237
|
+
formatShare(a.totalTokens, totalTokens),
|
|
238
|
+
formatWorkingTime(a.workingSeconds),
|
|
239
|
+
]);
|
|
240
|
+
lines.push(renderTable(["AGENT", "RUNS", "TOKENS", "SHARE", "WORKING"], rows), "");
|
|
241
|
+
}
|
|
242
|
+
if (report.harnessUsage.length > 0) {
|
|
243
|
+
const rows = report.harnessUsage.map((h) => [
|
|
244
|
+
h.harness,
|
|
245
|
+
String(h.runCount),
|
|
246
|
+
formatTokenCount(h.totalTokens),
|
|
247
|
+
formatShare(h.totalTokens, totalTokens),
|
|
248
|
+
]);
|
|
249
|
+
lines.push(renderTable(["HARNESS", "RUNS", "TOKENS", "SHARE"], rows), "");
|
|
250
|
+
}
|
|
251
|
+
if (report.dailyUsage.length > 0) {
|
|
252
|
+
const rows = report.dailyUsage.map((day) => [day.date, String(day.runCount), formatTokenCount(day.totalTokens)]);
|
|
253
|
+
lines.push(renderTable(["DATE", "RUNS", "TOKENS"], rows));
|
|
254
|
+
}
|
|
255
|
+
lines.push("");
|
|
256
|
+
return `${lines.join("\n")}\n`;
|
|
257
|
+
}
|
|
258
|
+
// --- Formatting helpers ---
|
|
259
|
+
// Prefixes a run's tokens when they were counted from its runner's own report.
|
|
260
|
+
const ESTIMATED_MARK = "~";
|
|
261
|
+
// The report's token total: the aggregate's, or the model rows' sum when the
|
|
262
|
+
// aggregate is absent (a report with no runs may carry none).
|
|
263
|
+
function reportTokens(usage, models) {
|
|
264
|
+
if (usage !== undefined)
|
|
265
|
+
return usage.totalTokens;
|
|
266
|
+
return models.reduce((sum, m) => sum + m.totalTokens, 0n);
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Whose provider credential served a report's tokens, as one line. The split
|
|
270
|
+
* shows only when more than one known source served tokens; a single known
|
|
271
|
+
* source reads as its name, with any tokens whose server was not recorded
|
|
272
|
+
* noted beside it. No known source (every run counted from its runner's own
|
|
273
|
+
* report, or metered records older than the field) prints nothing, since
|
|
274
|
+
* there is nothing to tell apart.
|
|
275
|
+
*/
|
|
276
|
+
export function formatServedBy(usage) {
|
|
277
|
+
if (usage === undefined)
|
|
278
|
+
return "";
|
|
279
|
+
const rows = usage.servedBy.filter((row) => row.totalTokens > 0n);
|
|
280
|
+
const isKnown = (source) => source !== ProviderKeySource.UNSPECIFIED;
|
|
281
|
+
const known = rows.filter((row) => isKnown(row.providerKeySource));
|
|
282
|
+
if (known.length === 0)
|
|
283
|
+
return "";
|
|
284
|
+
if (known.length === 1) {
|
|
285
|
+
const label = servedByLabel(known[0].providerKeySource);
|
|
286
|
+
const unrecorded = rows
|
|
287
|
+
.filter((row) => !isKnown(row.providerKeySource))
|
|
288
|
+
.reduce((sum, row) => sum + row.totalTokens, 0n);
|
|
289
|
+
return unrecorded > 0n ? `${label} (${formatTokenCount(unrecorded)} tokens not recorded)` : label;
|
|
290
|
+
}
|
|
291
|
+
const total = rows.reduce((sum, row) => sum + row.totalTokens, 0n);
|
|
292
|
+
return rows
|
|
293
|
+
.map((row) => `${servedByLabel(row.providerKeySource)} ${formatTokenCount(row.totalTokens)} (${formatShare(row.totalTokens, total)})`)
|
|
294
|
+
.join(" · ");
|
|
295
|
+
}
|
|
296
|
+
function servedByLabel(source) {
|
|
297
|
+
switch (source) {
|
|
298
|
+
case ProviderKeySource.ORGANIZATION:
|
|
299
|
+
return "your keys";
|
|
300
|
+
case ProviderKeySource.PLATFORM:
|
|
301
|
+
return "the platform's connection";
|
|
302
|
+
case ProviderKeySource.UNSPECIFIED:
|
|
303
|
+
return "not recorded";
|
|
304
|
+
default: {
|
|
305
|
+
const unknown = source;
|
|
306
|
+
return `source ${String(unknown)}`;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
function formatShare(part, total) {
|
|
311
|
+
if (total === 0n)
|
|
312
|
+
return "0.0%";
|
|
313
|
+
return `${((Number(part) / Number(total)) * 100).toFixed(1)}%`;
|
|
314
|
+
}
|
|
315
|
+
// The share of all input served from the cache. The aggregate's input_tokens
|
|
316
|
+
// excludes both cache buckets, so the whole input is the three summed.
|
|
317
|
+
function formatCacheHitRate(usage) {
|
|
318
|
+
if (usage === undefined || usage.cacheReadInputTokens === 0n)
|
|
319
|
+
return "";
|
|
320
|
+
const allInput = usage.inputTokens + usage.cacheReadInputTokens + usage.cacheCreationInputTokens;
|
|
321
|
+
const rate = (Number(usage.cacheReadInputTokens) / Number(allInput)) * 100;
|
|
322
|
+
return `${Math.round(rate)}% cached`;
|
|
323
|
+
}
|
|
324
|
+
const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
325
|
+
// "Jan 02" from an ISO 8601 timestamp; raw (≤10 chars) on parse failure.
|
|
326
|
+
function formatDate(iso) {
|
|
327
|
+
if (iso === "")
|
|
328
|
+
return "";
|
|
329
|
+
const date = new Date(iso);
|
|
330
|
+
if (Number.isNaN(date.getTime()))
|
|
331
|
+
return iso.length >= 10 ? iso.slice(0, 10) : iso;
|
|
332
|
+
return `${MONTHS[date.getMonth()]} ${String(date.getDate()).padStart(2, "0")}`;
|
|
333
|
+
}
|
|
334
|
+
function formatDateRange(from, to) {
|
|
335
|
+
const f = formatDate(from);
|
|
336
|
+
const t = formatDate(to);
|
|
337
|
+
if (f === "" && t === "")
|
|
338
|
+
return "";
|
|
339
|
+
if (f === "")
|
|
340
|
+
return `to ${t}`;
|
|
341
|
+
if (t === "")
|
|
342
|
+
return `from ${f}`;
|
|
343
|
+
return `${f} to ${t}`;
|
|
344
|
+
}
|
|
345
|
+
// Plain user-supplied date strings (e.g. "2026-03-01"), shown verbatim.
|
|
346
|
+
function formatInputDateRange(from, to) {
|
|
347
|
+
if (from === "" && to === "")
|
|
348
|
+
return "";
|
|
349
|
+
if (from === "")
|
|
350
|
+
return `to ${to}`;
|
|
351
|
+
if (to === "")
|
|
352
|
+
return `from ${from}`;
|
|
353
|
+
return `${from} to ${to}`;
|
|
354
|
+
}
|
|
355
|
+
// Matches Go's mapPhaseToString (snake_case phase labels for the usage table).
|
|
356
|
+
function mapPhaseToString(phase) {
|
|
357
|
+
switch (phase) {
|
|
358
|
+
case RunPhase.RUN_PENDING:
|
|
359
|
+
return "pending";
|
|
360
|
+
case RunPhase.RUN_IN_PROGRESS:
|
|
361
|
+
return "in_progress";
|
|
362
|
+
case RunPhase.RUN_COMPLETED:
|
|
363
|
+
return "completed";
|
|
364
|
+
case RunPhase.RUN_FAILED:
|
|
365
|
+
return "failed";
|
|
366
|
+
case RunPhase.RUN_CANCELLED:
|
|
367
|
+
return "cancelled";
|
|
368
|
+
case RunPhase.RUN_WAITING_FOR_APPROVAL:
|
|
369
|
+
return "waiting_for_approval";
|
|
370
|
+
case RunPhase.RUN_TERMINATED:
|
|
371
|
+
return "terminated";
|
|
372
|
+
default:
|
|
373
|
+
return "unknown";
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
//# sourceMappingURL=usage.js.map
|