@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,308 @@
|
|
|
1
|
+
// CLI configuration model and persistence (~/.stigmer/config.yaml).
|
|
2
|
+
//
|
|
3
|
+
// Named backends ("a named backend without a credential story is half a
|
|
4
|
+
// feature"): the `backends` map + `current_backend` are the
|
|
5
|
+
// kubectl-context model — each entry carries its own endpoint AND its own
|
|
6
|
+
// credentials, so switching between Stigmer Cloud and a self-hosted server
|
|
7
|
+
// never clobbers either side's login state. Two names are reserved:
|
|
8
|
+
// "local" (the managed daemon, never stored in the map — its endpoint and
|
|
9
|
+
// no-auth posture are fixed) and "cloud" (where `stigmer auth login` lands
|
|
10
|
+
// by default).
|
|
11
|
+
//
|
|
12
|
+
// Legacy shape + migration: older files carried one `backend.cloud` slot
|
|
13
|
+
// selected by `backend.type`. Loading migrates that shape in memory
|
|
14
|
+
// (cloud section → `backends.cloud`, type → `current_backend`); the first
|
|
15
|
+
// save writes the new shape — a one-time write migration. The
|
|
16
|
+
// legacy `backend.type` is still WRITTEN (mirroring local vs non-local)
|
|
17
|
+
// so older readers keep a coherent view, and the opaque `backend.local`
|
|
18
|
+
// section (daemon/LLM/Temporal settings owned by other tools) is
|
|
19
|
+
// preserved verbatim, exactly as before.
|
|
20
|
+
|
|
21
|
+
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
22
|
+
import { dirname } from "node:path";
|
|
23
|
+
import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
|
|
24
|
+
import { UsageError } from "../errors/index.js";
|
|
25
|
+
import { isStandalone } from "../runtime.js";
|
|
26
|
+
import { configPath } from "./paths.js";
|
|
27
|
+
|
|
28
|
+
/** The legacy binary switch, still written as a mirror for older readers. */
|
|
29
|
+
export type BackendType = "local" | "cloud";
|
|
30
|
+
|
|
31
|
+
/** The two named-backend families: Stigmer Cloud, or any OSS server. */
|
|
32
|
+
export type NamedBackendType = "cloud" | "selfhost";
|
|
33
|
+
|
|
34
|
+
/** The reserved name of the managed local daemon backend. */
|
|
35
|
+
export const LOCAL_BACKEND_NAME = "local";
|
|
36
|
+
|
|
37
|
+
/** The reserved name `stigmer auth login` targets from local mode. */
|
|
38
|
+
export const CLOUD_BACKEND_NAME = "cloud";
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* One named backend: endpoint + its own credentials. Property names are
|
|
42
|
+
* snake_case to keep the YAML in the file's established dialect.
|
|
43
|
+
*
|
|
44
|
+
* Credential lanes by type:
|
|
45
|
+
* - cloud: the OAuth token set (token / refresh_token / token_expiry),
|
|
46
|
+
* written by `stigmer auth login` and rotated by the token provider.
|
|
47
|
+
* - selfhost: `api_key` — a server-minted `stk_` token
|
|
48
|
+
* (`stigmer apikey create`). Browser login against self-hosted
|
|
49
|
+
* issuers is deliberately not modeled here; the API token is the
|
|
50
|
+
* self-host credential story.
|
|
51
|
+
*/
|
|
52
|
+
export interface NamedBackendConfig {
|
|
53
|
+
type: NamedBackendType;
|
|
54
|
+
endpoint?: string;
|
|
55
|
+
token?: string;
|
|
56
|
+
org_id?: string;
|
|
57
|
+
env_id?: string;
|
|
58
|
+
refresh_token?: string;
|
|
59
|
+
token_expiry?: string;
|
|
60
|
+
api_key?: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Cloud backend connection — the LEGACY single-slot shape (older files). */
|
|
64
|
+
export interface CloudBackendConfig {
|
|
65
|
+
endpoint?: string;
|
|
66
|
+
token?: string;
|
|
67
|
+
org_id?: string;
|
|
68
|
+
env_id?: string;
|
|
69
|
+
refresh_token?: string;
|
|
70
|
+
token_expiry?: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface BackendConfig {
|
|
74
|
+
type: BackendType;
|
|
75
|
+
/** Local daemon/LLM/Temporal settings — opaque to this CLI,
|
|
76
|
+
* preserved verbatim across save so coexisting tools keep their config. */
|
|
77
|
+
local?: unknown;
|
|
78
|
+
/** Legacy cloud slot — read for migration, never written back. */
|
|
79
|
+
cloud?: CloudBackendConfig;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface ContextConfig {
|
|
83
|
+
/** The context organization's id (or, set by hand, whatever value was given). */
|
|
84
|
+
org?: string;
|
|
85
|
+
/** Its slug when `context set` stored it, for output; never sent to the server. */
|
|
86
|
+
org_slug?: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* One added plugin marketplace as the file spells it. The `marketplace`
|
|
91
|
+
* commands are the only writer; the shape is kept loose here and narrowed by
|
|
92
|
+
* `src/marketplace/config.ts`, so a hand-edited entry this CLI cannot read is
|
|
93
|
+
* reported by `stigmer marketplace list` instead of being dropped on the next
|
|
94
|
+
* save. The official marketplace is built in and never stored. `type` is the
|
|
95
|
+
* discriminator, the word this file already uses for backends.
|
|
96
|
+
*/
|
|
97
|
+
export interface MarketplaceEntryConfig {
|
|
98
|
+
type?: string;
|
|
99
|
+
/** GitHub `owner/repo` for `type: github`. */
|
|
100
|
+
repo?: string;
|
|
101
|
+
/** Branch, tag or commit for `type: github`; the default branch when absent. */
|
|
102
|
+
ref?: string;
|
|
103
|
+
/** Absolute directory for `type: local`. */
|
|
104
|
+
path?: string;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface Config {
|
|
108
|
+
backend: BackendConfig;
|
|
109
|
+
backends?: Record<string, NamedBackendConfig>;
|
|
110
|
+
current_backend?: string;
|
|
111
|
+
context?: ContextConfig;
|
|
112
|
+
/** Added plugin marketplaces, keyed by the name a user installs from. */
|
|
113
|
+
marketplaces?: Record<string, MarketplaceEntryConfig>;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const SAVE_HEADER = `# Stigmer CLI Configuration
|
|
117
|
+
# For configuration options and examples, see:
|
|
118
|
+
# https://github.com/stigmer/stigmer/blob/main/docs/cli/configuration.md
|
|
119
|
+
|
|
120
|
+
`;
|
|
121
|
+
|
|
122
|
+
/** The default config: the local backend, no daemon settings fabricated. */
|
|
123
|
+
export function getDefault(): Config {
|
|
124
|
+
return {
|
|
125
|
+
backend: { type: "local" },
|
|
126
|
+
backends: {},
|
|
127
|
+
current_backend: LOCAL_BACKEND_NAME,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Load the config from disk. In standalone mode the file is ignored and the
|
|
133
|
+
* default is returned, isolating sidecar/automation invocations from ambient
|
|
134
|
+
* user config (matches the Go CLI). A missing file also yields the default.
|
|
135
|
+
*/
|
|
136
|
+
export function load(path: string = configPath()): Config {
|
|
137
|
+
if (isStandalone()) {
|
|
138
|
+
return getDefault();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
let raw: string;
|
|
142
|
+
try {
|
|
143
|
+
raw = readFileSync(path, "utf8");
|
|
144
|
+
} catch (err) {
|
|
145
|
+
if (isNotFound(err)) return getDefault();
|
|
146
|
+
throw err;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const parsed = parseYaml(raw) as Partial<Config> | null;
|
|
150
|
+
return normalize(parsed);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Persist the config to disk (0600 file in a 0755 directory), with the
|
|
155
|
+
* documentation header the file has always carried. Writes the NAMED shape
|
|
156
|
+
* (the one-time migration): the legacy cloud slot is dropped — its content
|
|
157
|
+
* lives in `backends.cloud` — and `backend.type` is written as the
|
|
158
|
+
* local-vs-not mirror. A pristine local config (no named backends) writes
|
|
159
|
+
* exactly the legacy bytes.
|
|
160
|
+
*/
|
|
161
|
+
export function save(config: Config, path: string = configPath()): void {
|
|
162
|
+
mkdirSync(dirname(path), { recursive: true, mode: 0o755 });
|
|
163
|
+
const body = stringifyYaml(stripUndefined(serializable(config)));
|
|
164
|
+
writeFileSync(path, SAVE_HEADER + body, { mode: 0o600 });
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/** The active backend's name (normalize always stamps current_backend). */
|
|
168
|
+
export function activeBackendName(config: Config): string {
|
|
169
|
+
const name = config.current_backend ?? "";
|
|
170
|
+
return name === "" ? LOCAL_BACKEND_NAME : name;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* The active backend: the reserved local daemon (entry undefined) or a
|
|
175
|
+
* named entry. A current_backend naming a missing entry is a loud
|
|
176
|
+
* configuration error, never a silent fallback — the config was edited by
|
|
177
|
+
* hand or a remove left it dangling.
|
|
178
|
+
*/
|
|
179
|
+
export function activeBackend(config: Config): {
|
|
180
|
+
name: string;
|
|
181
|
+
entry: NamedBackendConfig | undefined;
|
|
182
|
+
} {
|
|
183
|
+
const name = activeBackendName(config);
|
|
184
|
+
if (name === LOCAL_BACKEND_NAME) {
|
|
185
|
+
return { name, entry: undefined };
|
|
186
|
+
}
|
|
187
|
+
const entry = config.backends?.[name];
|
|
188
|
+
if (entry === undefined) {
|
|
189
|
+
throw new UsageError(
|
|
190
|
+
`current backend "${name}" does not exist — run 'stigmer config backend list' and 'stigmer config backend use <name>'`,
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
return { name, entry };
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** True when the active backend is Stigmer Cloud. */
|
|
197
|
+
export function isCloudMode(config: Config): boolean {
|
|
198
|
+
return activeBackend(config).entry?.type === "cloud";
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function normalize(parsed: Partial<Config> | null): Config {
|
|
202
|
+
if (parsed === null || typeof parsed !== "object") {
|
|
203
|
+
return getDefault();
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const legacy = parsed.backend;
|
|
207
|
+
const backends = normalizeBackends(parsed.backends);
|
|
208
|
+
|
|
209
|
+
// Migration: a legacy cloud slot becomes the reserved "cloud" entry —
|
|
210
|
+
// unless a named shape already exists (then the named shape wins and the
|
|
211
|
+
// stale legacy slot is ignored).
|
|
212
|
+
if (Object.keys(backends).length === 0 && legacy?.cloud !== undefined) {
|
|
213
|
+
backends[CLOUD_BACKEND_NAME] = { type: "cloud", ...legacy.cloud };
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
let current =
|
|
217
|
+
typeof parsed.current_backend === "string" ? parsed.current_backend : "";
|
|
218
|
+
if (current === "") {
|
|
219
|
+
current =
|
|
220
|
+
legacy?.type === "cloud" && backends[CLOUD_BACKEND_NAME] !== undefined
|
|
221
|
+
? CLOUD_BACKEND_NAME
|
|
222
|
+
: LOCAL_BACKEND_NAME;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return {
|
|
226
|
+
backend: {
|
|
227
|
+
type: legacy?.type === "cloud" ? "cloud" : "local",
|
|
228
|
+
local: legacy?.local,
|
|
229
|
+
},
|
|
230
|
+
backends,
|
|
231
|
+
current_backend: current,
|
|
232
|
+
context: parsed.context,
|
|
233
|
+
marketplaces: normalizeMarketplaces(parsed.marketplaces),
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/** Object-valued entries verbatim; anything else is not a marketplace and is dropped. */
|
|
238
|
+
function normalizeMarketplaces(
|
|
239
|
+
parsed: Record<string, MarketplaceEntryConfig> | undefined,
|
|
240
|
+
): Record<string, MarketplaceEntryConfig> | undefined {
|
|
241
|
+
if (parsed === undefined || parsed === null || typeof parsed !== "object") {
|
|
242
|
+
return undefined;
|
|
243
|
+
}
|
|
244
|
+
const marketplaces: Record<string, MarketplaceEntryConfig> = {};
|
|
245
|
+
for (const [name, entry] of Object.entries(parsed)) {
|
|
246
|
+
if (entry === null || typeof entry !== "object") continue;
|
|
247
|
+
marketplaces[name] = { ...entry };
|
|
248
|
+
}
|
|
249
|
+
return Object.keys(marketplaces).length === 0 ? undefined : marketplaces;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function normalizeBackends(
|
|
253
|
+
parsed: Record<string, NamedBackendConfig> | undefined,
|
|
254
|
+
): Record<string, NamedBackendConfig> {
|
|
255
|
+
const backends: Record<string, NamedBackendConfig> = {};
|
|
256
|
+
if (parsed === undefined || typeof parsed !== "object") {
|
|
257
|
+
return backends;
|
|
258
|
+
}
|
|
259
|
+
for (const [name, entry] of Object.entries(parsed)) {
|
|
260
|
+
if (entry === null || typeof entry !== "object") continue;
|
|
261
|
+
backends[name] = {
|
|
262
|
+
...entry,
|
|
263
|
+
type: entry.type === "cloud" ? "cloud" : "selfhost",
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
return backends;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/** The on-disk shape: named model + legacy mirror, minimal for defaults. */
|
|
270
|
+
function serializable(config: Config): Config {
|
|
271
|
+
const backends = config.backends ?? {};
|
|
272
|
+
const current = activeBackendName(config);
|
|
273
|
+
const pristineLocal =
|
|
274
|
+
Object.keys(backends).length === 0 && current === LOCAL_BACKEND_NAME;
|
|
275
|
+
return {
|
|
276
|
+
backend: {
|
|
277
|
+
// The legacy mirror: local stays "local"; anything named is "cloud"
|
|
278
|
+
// to older readers (which cannot represent selfhost anyway).
|
|
279
|
+
type: current === LOCAL_BACKEND_NAME ? "local" : "cloud",
|
|
280
|
+
local: config.backend.local,
|
|
281
|
+
// The legacy cloud slot is never written back — migrated.
|
|
282
|
+
},
|
|
283
|
+
...(pristineLocal ? {} : { backends, current_backend: current }),
|
|
284
|
+
context: config.context,
|
|
285
|
+
marketplaces: config.marketplaces,
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Recursively drop undefined-valued keys so the serialized YAML omits empty
|
|
290
|
+
// optionals (matching Go's yaml omitempty), while preserving the opaque local
|
|
291
|
+
// section untouched.
|
|
292
|
+
function stripUndefined<T>(value: T): T {
|
|
293
|
+
if (Array.isArray(value)) {
|
|
294
|
+
return value.map((item) => stripUndefined(item)) as unknown as T;
|
|
295
|
+
}
|
|
296
|
+
if (value !== null && typeof value === "object") {
|
|
297
|
+
const out: Record<string, unknown> = {};
|
|
298
|
+
for (const [key, val] of Object.entries(value as Record<string, unknown>)) {
|
|
299
|
+
if (val !== undefined) out[key] = stripUndefined(val);
|
|
300
|
+
}
|
|
301
|
+
return out as T;
|
|
302
|
+
}
|
|
303
|
+
return value;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
function isNotFound(err: unknown): boolean {
|
|
307
|
+
return (err as NodeJS.ErrnoException | null)?.code === "ENOENT";
|
|
308
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Public surface of the CLI config module.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
type BackendConfig,
|
|
5
|
+
type BackendType,
|
|
6
|
+
type CloudBackendConfig,
|
|
7
|
+
type Config,
|
|
8
|
+
type ContextConfig,
|
|
9
|
+
type MarketplaceEntryConfig,
|
|
10
|
+
type NamedBackendConfig,
|
|
11
|
+
type NamedBackendType,
|
|
12
|
+
CLOUD_BACKEND_NAME,
|
|
13
|
+
LOCAL_BACKEND_NAME,
|
|
14
|
+
activeBackend,
|
|
15
|
+
activeBackendName,
|
|
16
|
+
getDefault,
|
|
17
|
+
isCloudMode,
|
|
18
|
+
load,
|
|
19
|
+
save,
|
|
20
|
+
} from "./config.js";
|
|
21
|
+
export {
|
|
22
|
+
DEFAULT_CLOUD_CONSOLE_URL,
|
|
23
|
+
ensureAuthenticated,
|
|
24
|
+
resolveConsoleURL,
|
|
25
|
+
contextOrganizationId,
|
|
26
|
+
contextOrganizationLabel,
|
|
27
|
+
resolveContextOrganization,
|
|
28
|
+
resolveEndpoint,
|
|
29
|
+
resolveOrganization,
|
|
30
|
+
resolveToken,
|
|
31
|
+
} from "./resolve.js";
|
|
32
|
+
export { configDir, configPath, dataDir } from "./paths.js";
|
|
33
|
+
export { configKeyNames, getConfigValue, setConfigValue } from "./keys.js";
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Dotted-key access for the generic `config get|set|list` commands. Only the
|
|
2
|
+
// fields this CLI owns are exposed; daemon/local settings are not, and are
|
|
3
|
+
// preserved opaquely on save.
|
|
4
|
+
|
|
5
|
+
import { UsageError } from "../errors/usage-error.js";
|
|
6
|
+
import {
|
|
7
|
+
CLOUD_BACKEND_NAME,
|
|
8
|
+
type Config,
|
|
9
|
+
LOCAL_BACKEND_NAME,
|
|
10
|
+
activeBackendName,
|
|
11
|
+
} from "./config.js";
|
|
12
|
+
|
|
13
|
+
interface ConfigKey {
|
|
14
|
+
/** Stored (non-resolved) value, "" when unset. */
|
|
15
|
+
get(config: Config): string;
|
|
16
|
+
/** Validate and apply the value, creating sub-objects as needed. */
|
|
17
|
+
set(config: Config, value: string): void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// The backend.cloud.* keys predate named backends and remain the documented
|
|
21
|
+
// kv surface for the reserved "cloud" entry; `current_backend` is the named
|
|
22
|
+
// model's own key. `backend.type` stays the simple local/cloud switch
|
|
23
|
+
// (named backends switch through `config backend use`).
|
|
24
|
+
const KEYS: Record<string, ConfigKey> = {
|
|
25
|
+
"backend.type": {
|
|
26
|
+
get: (config) =>
|
|
27
|
+
activeBackendName(config) === LOCAL_BACKEND_NAME ? "local" : "cloud",
|
|
28
|
+
set: (config, value) => {
|
|
29
|
+
if (value !== "local" && value !== "cloud") {
|
|
30
|
+
throw new UsageError(
|
|
31
|
+
`invalid backend.type "${value}" (expected: local, cloud)`,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
if (value === "cloud") {
|
|
35
|
+
(config.backends ??= {})[CLOUD_BACKEND_NAME] ??= { type: "cloud" };
|
|
36
|
+
config.current_backend = CLOUD_BACKEND_NAME;
|
|
37
|
+
} else {
|
|
38
|
+
config.current_backend = LOCAL_BACKEND_NAME;
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
current_backend: {
|
|
43
|
+
get: (config) => activeBackendName(config),
|
|
44
|
+
set: (config, value) => {
|
|
45
|
+
if (
|
|
46
|
+
value !== LOCAL_BACKEND_NAME &&
|
|
47
|
+
config.backends?.[value] === undefined
|
|
48
|
+
) {
|
|
49
|
+
throw new UsageError(
|
|
50
|
+
`unknown backend "${value}" (add it first: stigmer config backend add)`,
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
config.current_backend = value;
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
"backend.cloud.endpoint": {
|
|
57
|
+
get: (config) => config.backends?.[CLOUD_BACKEND_NAME]?.endpoint ?? "",
|
|
58
|
+
set: (config, value) => {
|
|
59
|
+
const backends = (config.backends ??= {});
|
|
60
|
+
(backends[CLOUD_BACKEND_NAME] ??= { type: "cloud" }).endpoint = value;
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
"backend.cloud.org_id": {
|
|
64
|
+
get: (config) => config.backends?.[CLOUD_BACKEND_NAME]?.org_id ?? "",
|
|
65
|
+
set: (config, value) => {
|
|
66
|
+
const backends = (config.backends ??= {});
|
|
67
|
+
(backends[CLOUD_BACKEND_NAME] ??= { type: "cloud" }).org_id = value;
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
"context.org": {
|
|
71
|
+
get: (config) => config.context?.org ?? "",
|
|
72
|
+
set: (config, value) => {
|
|
73
|
+
// The raw escape hatch stores the value as given; the slug stored
|
|
74
|
+
// beside an earlier checked value would no longer describe it.
|
|
75
|
+
const context = (config.context ??= {});
|
|
76
|
+
context.org = value;
|
|
77
|
+
delete context.org_slug;
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/** All known config keys, sorted, for `config list` and error messages. */
|
|
83
|
+
export function configKeyNames(): string[] {
|
|
84
|
+
return Object.keys(KEYS).sort();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function getConfigValue(config: Config, key: string): string {
|
|
88
|
+
const entry = KEYS[key];
|
|
89
|
+
if (entry === undefined) throw new UsageError(unknownKeyMessage(key));
|
|
90
|
+
return entry.get(config);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function setConfigValue(
|
|
94
|
+
config: Config,
|
|
95
|
+
key: string,
|
|
96
|
+
value: string,
|
|
97
|
+
): void {
|
|
98
|
+
const entry = KEYS[key];
|
|
99
|
+
if (entry === undefined) throw new UsageError(unknownKeyMessage(key));
|
|
100
|
+
entry.set(config, value);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function unknownKeyMessage(key: string): string {
|
|
104
|
+
return `unknown config key "${key}" (known keys: ${configKeyNames().join(", ")})`;
|
|
105
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Filesystem locations for CLI configuration and local data. Mirrors the Go
|
|
2
|
+
// CLI's config path helpers (~/.stigmer/...). Functions take the home dir as a
|
|
3
|
+
// parameter (defaulting to os.homedir()) so tests can redirect them cleanly.
|
|
4
|
+
|
|
5
|
+
import { homedir } from "node:os";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
|
|
8
|
+
export const CONFIG_DIR_NAME = ".stigmer";
|
|
9
|
+
export const CONFIG_FILE_NAME = "config.yaml";
|
|
10
|
+
export const DEFAULT_DATA_DIR = "data";
|
|
11
|
+
|
|
12
|
+
/** Absolute path to the config directory (~/.stigmer). */
|
|
13
|
+
export function configDir(home: string = homedir()): string {
|
|
14
|
+
return join(home, CONFIG_DIR_NAME);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Absolute path to the config file (~/.stigmer/config.yaml). */
|
|
18
|
+
export function configPath(home: string = homedir()): string {
|
|
19
|
+
return join(configDir(home), CONFIG_FILE_NAME);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Absolute path to the local backend data directory (~/.stigmer/data). */
|
|
23
|
+
export function dataDir(home: string = homedir()): string {
|
|
24
|
+
return join(configDir(home), DEFAULT_DATA_DIR);
|
|
25
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// Effective-value resolution with env > config > default precedence. These are
|
|
2
|
+
// the settings the backend client and read verbs depend on; centralizing the
|
|
3
|
+
// precedence keeps every call site consistent (mirrors the Go CLI's Resolve*).
|
|
4
|
+
//
|
|
5
|
+
// All resolvers read the ACTIVE named backend (config.ts): local is the
|
|
6
|
+
// managed daemon (fixed endpoint, never requires auth), cloud entries carry
|
|
7
|
+
// the OAuth token set, selfhost entries carry an endpoint + api_key.
|
|
8
|
+
|
|
9
|
+
import { CliExitError, ExitCode } from "../errors/index.js";
|
|
10
|
+
import { SERVER_PORT } from "../local/constants.js";
|
|
11
|
+
import { type Config, activeBackend } from "./config.js";
|
|
12
|
+
|
|
13
|
+
const DEFAULT_CLOUD_ENDPOINT = "api.stigmer.ai:443";
|
|
14
|
+
const DEFAULT_LOCAL_ENDPOINT = "localhost:7234";
|
|
15
|
+
|
|
16
|
+
/** Well-known URL for the Stigmer Cloud web console. */
|
|
17
|
+
export const DEFAULT_CLOUD_CONSOLE_URL = "https://app.stigmer.ai";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Resolve the server endpoint.
|
|
21
|
+
* STIGMER_SERVER_ADDRESS (explicit override, any backend)
|
|
22
|
+
* > the active entry's endpoint (cloud falls back to api.stigmer.ai:443)
|
|
23
|
+
* > localhost:7234 (the local daemon)
|
|
24
|
+
*
|
|
25
|
+
* A selfhost entry without an endpoint is a loud configuration error —
|
|
26
|
+
* `config backend add` requires one, so this only happens to hand-edited
|
|
27
|
+
* files, and guessing an address for a self-hosted server helps nobody.
|
|
28
|
+
*/
|
|
29
|
+
export function resolveEndpoint(config: Config): string {
|
|
30
|
+
const override = process.env.STIGMER_SERVER_ADDRESS;
|
|
31
|
+
if (override !== undefined && override !== "") {
|
|
32
|
+
return override;
|
|
33
|
+
}
|
|
34
|
+
const { name, entry } = activeBackend(config);
|
|
35
|
+
if (entry === undefined) {
|
|
36
|
+
return DEFAULT_LOCAL_ENDPOINT;
|
|
37
|
+
}
|
|
38
|
+
if (entry.endpoint !== undefined && entry.endpoint !== "") {
|
|
39
|
+
return entry.endpoint;
|
|
40
|
+
}
|
|
41
|
+
if (entry.type === "cloud") {
|
|
42
|
+
return DEFAULT_CLOUD_ENDPOINT;
|
|
43
|
+
}
|
|
44
|
+
throw new CliExitError(
|
|
45
|
+
`backend "${name}" has no endpoint configured`,
|
|
46
|
+
ExitCode.Usage,
|
|
47
|
+
[
|
|
48
|
+
`Re-add it with one:`,
|
|
49
|
+
` stigmer config backend add ${name} --endpoint <host:port>`,
|
|
50
|
+
],
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Resolve the auth token.
|
|
56
|
+
* STIGMER_API_KEY (env, also where the --api-key global is bridged)
|
|
57
|
+
* > the active entry's credential (cloud: login token; selfhost: api_key)
|
|
58
|
+
* > "" (unauthenticated)
|
|
59
|
+
*/
|
|
60
|
+
export function resolveToken(config: Config): string {
|
|
61
|
+
const env = process.env.STIGMER_API_KEY;
|
|
62
|
+
if (env !== undefined && env !== "") {
|
|
63
|
+
return env;
|
|
64
|
+
}
|
|
65
|
+
const { entry } = activeBackend(config);
|
|
66
|
+
if (entry === undefined) {
|
|
67
|
+
return "";
|
|
68
|
+
}
|
|
69
|
+
return (entry.type === "cloud" ? entry.token : entry.api_key) ?? "";
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Resolve the active organization.
|
|
74
|
+
* --org flag override > STIGMER_ORG env > context.org
|
|
75
|
+
* > the active entry's org_id (legacy fallback)
|
|
76
|
+
*/
|
|
77
|
+
export function resolveOrganization(config: Config, flagOrg?: string): string {
|
|
78
|
+
if (flagOrg !== undefined && flagOrg !== "") {
|
|
79
|
+
return flagOrg;
|
|
80
|
+
}
|
|
81
|
+
const env = process.env.STIGMER_ORG;
|
|
82
|
+
if (env !== undefined && env !== "") {
|
|
83
|
+
return env;
|
|
84
|
+
}
|
|
85
|
+
const context = resolveContextOrganization(config);
|
|
86
|
+
if (context !== "") {
|
|
87
|
+
return context;
|
|
88
|
+
}
|
|
89
|
+
// Nothing names one: the CLI never invents an organization. A server that
|
|
90
|
+
// holds one fills it into every request that names none (its
|
|
91
|
+
// getServerInfo answers single_org); a server that holds several refuses
|
|
92
|
+
// the request, and the commands that need one say so first.
|
|
93
|
+
return "";
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Resolve the web console URL:
|
|
98
|
+
* 1. `STIGMER_CONSOLE_URL` (explicit override)
|
|
99
|
+
* 2. local daemon → `http://localhost:{SERVER_PORT}` — the server's own
|
|
100
|
+
* unified port serves the console (one origin for UI and
|
|
101
|
+
* API; the Go-era separate 8234 listener is retired)
|
|
102
|
+
* 3. selfhost → the entry's endpoint on the same one-origin rule
|
|
103
|
+
* (https for :443, http otherwise)
|
|
104
|
+
* 4. cloud → {@link DEFAULT_CLOUD_CONSOLE_URL}
|
|
105
|
+
*
|
|
106
|
+
* The console origin is also the app origin that serves the hosted chat
|
|
107
|
+
* page (`/chat/<share id>`) and the embed loader (`/embed.js`), so
|
|
108
|
+
* chat-link builders use this same resolver — both routes live in the
|
|
109
|
+
* same static export the server serves.
|
|
110
|
+
*/
|
|
111
|
+
export function resolveConsoleURL(
|
|
112
|
+
config: Config,
|
|
113
|
+
env: NodeJS.ProcessEnv = process.env,
|
|
114
|
+
): string {
|
|
115
|
+
const override = env.STIGMER_CONSOLE_URL;
|
|
116
|
+
if (override !== undefined && override !== "") return override;
|
|
117
|
+
const { entry } = activeBackend(config);
|
|
118
|
+
if (entry === undefined) return `http://localhost:${SERVER_PORT}`;
|
|
119
|
+
if (entry.type === "selfhost") {
|
|
120
|
+
const endpoint = entry.endpoint ?? "";
|
|
121
|
+
const scheme = endpoint.endsWith(":443") ? "https" : "http";
|
|
122
|
+
return `${scheme}://${endpoint.replace(/:443$/, "")}`;
|
|
123
|
+
}
|
|
124
|
+
return DEFAULT_CLOUD_CONSOLE_URL;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The configured organization, with the active entry's org_id fallback.
|
|
129
|
+
* Reports only what is explicitly set (no implicit local default) so
|
|
130
|
+
* config/context display can faithfully show "(not set)".
|
|
131
|
+
*/
|
|
132
|
+
export function resolveContextOrganization(config: Config): string {
|
|
133
|
+
if (
|
|
134
|
+
config.context?.org !== undefined &&
|
|
135
|
+
config.context.org !== ""
|
|
136
|
+
) {
|
|
137
|
+
return config.context.org;
|
|
138
|
+
}
|
|
139
|
+
return activeBackend(config).entry?.org_id ?? "";
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Fail fast with a clear "please log in" error when a CLOUD command has no
|
|
144
|
+
* usable credential. The local daemon never requires auth. Selfhost
|
|
145
|
+
* backends are deliberately not gated client-side: an unauthenticated
|
|
146
|
+
* self-host (no issuer configured) is a legitimate posture, and an
|
|
147
|
+
* authenticated one answers UNAUTHENTICATED with a clear message — the
|
|
148
|
+
* server owns that decision. A credential is any of: the STIGMER_API_KEY
|
|
149
|
+
* env (or bridged --api-key), a persisted access token, or a refresh token
|
|
150
|
+
* (which the token provider can exchange for a fresh access token).
|
|
151
|
+
*/
|
|
152
|
+
export function ensureAuthenticated(config: Config): void {
|
|
153
|
+
const { entry } = activeBackend(config);
|
|
154
|
+
if (entry?.type !== "cloud") return;
|
|
155
|
+
if (process.env.STIGMER_API_KEY) return;
|
|
156
|
+
if (entry.token || entry.refresh_token) return;
|
|
157
|
+
throw new CliExitError("Not authenticated", ExitCode.Auth, [
|
|
158
|
+
"Please sign in:",
|
|
159
|
+
" stigmer auth login",
|
|
160
|
+
]);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** How output names the context organization: the slug `set` stored with its id, else the value as configured. */
|
|
164
|
+
export function contextOrganizationLabel(config: Config): string {
|
|
165
|
+
const org = resolveContextOrganization(config);
|
|
166
|
+
const slug = config.context?.org_slug ?? "";
|
|
167
|
+
return org === "" || slug === "" ? org : slug;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** The context organization's id, shown beside its label; "" when the label already is the configured value. */
|
|
171
|
+
export function contextOrganizationId(config: Config): string {
|
|
172
|
+
const org = resolveContextOrganization(config);
|
|
173
|
+
return contextOrganizationLabel(config) === org ? "" : org;
|
|
174
|
+
}
|