@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,548 @@
|
|
|
1
|
+
// `channel` dispatch: `link` turns an agent's chat link on or off and
|
|
2
|
+
// reports the hosted chat link + embed snippet; `enable` and `disable` flip
|
|
3
|
+
// any channel's switch.
|
|
4
|
+
//
|
|
5
|
+
// An agent's chat link is a web channel (a Channel whose spec carries
|
|
6
|
+
// `web`) — the agent is never modified. `link` resolves the agent, finds
|
|
7
|
+
// its web channel (the canonical one, or the one `--name` names), and
|
|
8
|
+
// writes it one of two ways:
|
|
9
|
+
//
|
|
10
|
+
// - An existing link is applied whole. apply replaces the channel's spec
|
|
11
|
+
// WHOLESALE, so a naive "set enabled" would silently wipe any
|
|
12
|
+
// allowed_origins, visitor messages, audience, credential bindings or
|
|
13
|
+
// run settings the owner configured in the console. This module reads
|
|
14
|
+
// the current channel first and sends the complete spec back with only
|
|
15
|
+
// the requested fields flipped — the same merge-preserve discipline as
|
|
16
|
+
// the web dialog. (The rotatable link token is exempt: it is
|
|
17
|
+
// server-owned status, which survives every apply verbatim.)
|
|
18
|
+
// - A new link is a strict create, never an apply: one organization's
|
|
19
|
+
// channels of every type share one set of slugs, so an apply under a
|
|
20
|
+
// slug another channel holds would update THAT channel (and be refused
|
|
21
|
+
// as a change of its type or agent). A create whose slug is taken is
|
|
22
|
+
// refused as AlreadyExists, which this module answers by naming the
|
|
23
|
+
// holder and `--name`; it never picks another slug on its own.
|
|
24
|
+
//
|
|
25
|
+
// `enable` and `disable` are the masked update the console's switch sends
|
|
26
|
+
// (`spec.enabled` alone), so they work on every channel type and keep
|
|
27
|
+
// everything else as stored. Disabling pauses a channel; delete is the
|
|
28
|
+
// teardown.
|
|
29
|
+
//
|
|
30
|
+
// URL and snippet shapes come from @stigmer/client's sharing helpers — the single
|
|
31
|
+
// source of truth shared with the web console — so every surface emits
|
|
32
|
+
// byte-identical output. The caller supplies the app origin (resolved from the
|
|
33
|
+
// backend type by the command layer) to keep this module pure and env-free.
|
|
34
|
+
|
|
35
|
+
import { create, type MessageInitShape } from "@bufbuild/protobuf";
|
|
36
|
+
import { Code } from "@connectrpc/connect";
|
|
37
|
+
import type { Agent } from "@stigmer/apis/ai/stigmer/agentic/agent/v1/api_pb";
|
|
38
|
+
import type { Channel, ChannelSchema } from "@stigmer/apis/ai/stigmer/agentic/channel/v1/api_pb";
|
|
39
|
+
import { RotateChannelLinkInputSchema } from "@stigmer/apis/ai/stigmer/agentic/channel/v1/io_pb";
|
|
40
|
+
import { ChannelAudience, type WebChannelConfig } from "@stigmer/apis/ai/stigmer/agentic/channel/v1/spec_pb";
|
|
41
|
+
import { ApiResourceKind } from "@stigmer/apis/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
42
|
+
import {
|
|
43
|
+
buildChatUrl,
|
|
44
|
+
buildEmbedSnippet,
|
|
45
|
+
getErrorReason,
|
|
46
|
+
StigmerError,
|
|
47
|
+
toChannelInput,
|
|
48
|
+
type ChannelInput,
|
|
49
|
+
type Stigmer,
|
|
50
|
+
} from "@stigmer/client";
|
|
51
|
+
import { UsageError } from "../errors/index.js";
|
|
52
|
+
import { CommandResult } from "../output/index.js";
|
|
53
|
+
import { idPrefixesFor, isAgentId, parseReference } from "./reference.js";
|
|
54
|
+
import { resolveAgentRef } from "./run/resolve.js";
|
|
55
|
+
import { requireOrganization } from "../client/single-org.js";
|
|
56
|
+
import { organizationLabel, sameOrganization } from "../client/organizations.js";
|
|
57
|
+
|
|
58
|
+
/** Who can chat over the link. Mirrors the SDK's SharingAudience. */
|
|
59
|
+
export type LinkAudience = "public" | "org";
|
|
60
|
+
|
|
61
|
+
/** Inputs for {@link linkAgent} beyond the reference itself. */
|
|
62
|
+
export interface LinkAgentOptions {
|
|
63
|
+
/** Desired link state: `true` to turn it on, `false` to turn it off. */
|
|
64
|
+
readonly enabled: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Desired audience. Omitted means "keep the link's current audience" —
|
|
67
|
+
* a plain toggle must never flip an org-members-only link back to
|
|
68
|
+
* public (or vice versa).
|
|
69
|
+
*/
|
|
70
|
+
readonly audience?: LinkAudience;
|
|
71
|
+
/**
|
|
72
|
+
* Rotate the link token: the server generates a fresh `?k=` secret and
|
|
73
|
+
* the current link (tokened or plain) stops working immediately. The
|
|
74
|
+
* token is server-owned status — never part of the spec this module
|
|
75
|
+
* merges.
|
|
76
|
+
*/
|
|
77
|
+
readonly resetLink?: boolean;
|
|
78
|
+
/** The app origin serving the hosted chat page and `embed.js`. */
|
|
79
|
+
readonly appOrigin: string;
|
|
80
|
+
/**
|
|
81
|
+
* Whether the CLI points at a local backend. Guest chat (the token mint
|
|
82
|
+
* behind the hosted page) is a Stigmer Cloud capability, so a local link
|
|
83
|
+
* gets a "won't serve visitors" warning alongside the result.
|
|
84
|
+
*/
|
|
85
|
+
readonly isLocal: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* The chat link's slug (`--name`): which web channel of the agent to
|
|
88
|
+
* edit, and the slug a new one is created under. Omitted means the
|
|
89
|
+
* agent's canonical link, created as `<agent slug>-web`.
|
|
90
|
+
*/
|
|
91
|
+
readonly name?: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** The ErrorInfo reason of a create whose slug a renamed channel still holds. */
|
|
95
|
+
const REASON_SLUG_RESERVED = "SLUG_RESERVED";
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Turn the referenced agent's chat link on or off and describe the
|
|
99
|
+
* outcome. Idempotent: when the link is already in the desired state, no
|
|
100
|
+
* write is issued (the link is still reported when it is on). When the
|
|
101
|
+
* agent has no link yet, turning it on creates one.
|
|
102
|
+
*/
|
|
103
|
+
export async function linkAgent(
|
|
104
|
+
client: Stigmer,
|
|
105
|
+
ref: string,
|
|
106
|
+
org: string,
|
|
107
|
+
options: LinkAgentOptions,
|
|
108
|
+
): Promise<CommandResult> {
|
|
109
|
+
// Fail fast with actionable guidance instead of the backend's validation
|
|
110
|
+
// error, on a server that needs an org — mirrors the connect org guard.
|
|
111
|
+
if (!isAgentId(ref) && !ref.includes("/")) {
|
|
112
|
+
await requireOrganization(client, org, [
|
|
113
|
+
"stigmer config context set --org <org>",
|
|
114
|
+
`stigmer channel link ${ref} --org <org>`,
|
|
115
|
+
]);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const agent = await resolveAgentRef(client, ref, org);
|
|
119
|
+
const agentOrg = agent.metadata?.org ?? "";
|
|
120
|
+
// A chat link lives in its agent's organization: its URL, billing and
|
|
121
|
+
// credential bindings belong to the organization that owns the agent.
|
|
122
|
+
// The server refuses an agent_ref in any other organization; refusing
|
|
123
|
+
// here names the remedy instead of surfacing a bare FAILED_PRECONDITION,
|
|
124
|
+
// and mirrors the chat link dialog, which never offers another org's
|
|
125
|
+
// agent. An empty org (an ID ref without context) is the agent's own.
|
|
126
|
+
// The agent names its organization by id and the caller may name it by
|
|
127
|
+
// slug, so a mismatch is asked about before it is refused. Both
|
|
128
|
+
// organizations print by slug: the requested one may be the context's id.
|
|
129
|
+
if (org !== "" && !(await sameOrganization(client, org, agentOrg))) {
|
|
130
|
+
const [agentOrgLabel, orgLabel] = await Promise.all([
|
|
131
|
+
organizationLabel(client, agentOrg),
|
|
132
|
+
organizationLabel(client, org),
|
|
133
|
+
]);
|
|
134
|
+
throw new UsageError(
|
|
135
|
+
`a chat link of ${agentOrgLabel}/${agent.metadata?.slug ?? ""} lives in ${agentOrgLabel}, not ${orgLabel}\n\n` +
|
|
136
|
+
"A chat link is the agent's own organization's channel. To offer another\n" +
|
|
137
|
+
"organization's agent from yours, install the plugin that carries it and\n" +
|
|
138
|
+
"link the installed copy. To manage this agent's own link:\n" +
|
|
139
|
+
` stigmer channel link ${ref} --org ${agentOrgLabel}`,
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
const linkOrg = agentOrg;
|
|
143
|
+
let link =
|
|
144
|
+
options.name !== undefined
|
|
145
|
+
? await resolveNamedWebChannel(client, agent, linkOrg, options.name, ref)
|
|
146
|
+
: await resolveCanonicalWebChannel(client, agent, linkOrg);
|
|
147
|
+
const currentWeb = webConfigOf(link);
|
|
148
|
+
|
|
149
|
+
const currentAudience = audienceFromProto(currentWeb?.audience);
|
|
150
|
+
const targetAudience = options.audience ?? currentAudience;
|
|
151
|
+
|
|
152
|
+
// Resetting the link is meaningless for org-members-only links: their
|
|
153
|
+
// access is gated by live membership, and the member link never carries
|
|
154
|
+
// the token. Refuse rather than silently rotating an unused secret —
|
|
155
|
+
// the chat link dialog hides its Reset control for org audience for the
|
|
156
|
+
// same reason.
|
|
157
|
+
if (options.resetLink === true && targetAudience === "org") {
|
|
158
|
+
throw new UsageError(
|
|
159
|
+
"--reset-link only applies to public links\n\n" +
|
|
160
|
+
"This link is restricted to organization members, whose access is\n" +
|
|
161
|
+
"checked on every message. To cut someone off, remove them from the\n" +
|
|
162
|
+
"organization.",
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// No link + turn off is a no-op, not a write: creating a channel just to
|
|
167
|
+
// mark it disabled would materialize a resource the owner never asked
|
|
168
|
+
// for. The one exception is an explicit --audience org, which is real
|
|
169
|
+
// configuration worth persisting as a paused link. The test is what the
|
|
170
|
+
// owner passed, not the target: a new link's target is org by default,
|
|
171
|
+
// and that alone asks for nothing.
|
|
172
|
+
const alreadyInState =
|
|
173
|
+
link !== null
|
|
174
|
+
? (link.spec?.enabled ?? false) === options.enabled &&
|
|
175
|
+
currentAudience === targetAudience
|
|
176
|
+
: !options.enabled && options.audience !== "org";
|
|
177
|
+
|
|
178
|
+
if (!alreadyInState) {
|
|
179
|
+
link =
|
|
180
|
+
link !== null
|
|
181
|
+
? // Apply the COMPLETE spec with only the requested fields changed,
|
|
182
|
+
// so a CLI toggle can never wipe console-configured origins,
|
|
183
|
+
// visitor messages, credential bindings, run settings, or an
|
|
184
|
+
// org-members-only audience.
|
|
185
|
+
await client.channel.apply(
|
|
186
|
+
preservingChannelInput(link, options.enabled, targetAudience),
|
|
187
|
+
)
|
|
188
|
+
: await createLink(client, agent, linkOrg, ref, options, targetAudience);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// The rotation is a separate targeted RPC (the token is server-owned
|
|
192
|
+
// status, not part of the spec apply merges). The returned channel
|
|
193
|
+
// carries the fresh token, so the link printed below is the new one.
|
|
194
|
+
if (options.resetLink === true && link !== null) {
|
|
195
|
+
link = await client.channel.rotateLink(
|
|
196
|
+
create(RotateChannelLinkInputSchema, {
|
|
197
|
+
resourceId: link.metadata?.id ?? "",
|
|
198
|
+
}),
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const outcomeOrg = link?.metadata?.org || linkOrg;
|
|
203
|
+
return describeOutcome(
|
|
204
|
+
agent,
|
|
205
|
+
link,
|
|
206
|
+
options,
|
|
207
|
+
targetAudience,
|
|
208
|
+
alreadyInState && options.resetLink !== true,
|
|
209
|
+
await organizationLabel(client, outcomeOrg),
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* The agent's canonical web channel **within one org**: the one whose slug
|
|
215
|
+
* is `<agent slug>-web` (the server's name for a nameless web channel),
|
|
216
|
+
* else the one whose slug equals the agent's (a chat link made before
|
|
217
|
+
* links were channels keeps the agent's slug), else the first web channel
|
|
218
|
+
* in that org, else null when the agent has no link there. Slack and
|
|
219
|
+
* WhatsApp channels are never this command's row. Mirrors the web dialog's
|
|
220
|
+
* selection so both surfaces manage the same row. The org scope is the
|
|
221
|
+
* agent's organization, where every channel of it lives; the server
|
|
222
|
+
* applies the scope via the request's org field, so a link written in
|
|
223
|
+
* another organization before sharing across organizations was retired is
|
|
224
|
+
* never the row this command edits.
|
|
225
|
+
*/
|
|
226
|
+
async function resolveCanonicalWebChannel(
|
|
227
|
+
client: Stigmer,
|
|
228
|
+
agent: Agent,
|
|
229
|
+
linkOrg: string,
|
|
230
|
+
): Promise<Channel | null> {
|
|
231
|
+
const agentSlug = agent.metadata?.slug ?? "";
|
|
232
|
+
let ownSlug: Channel | null = null;
|
|
233
|
+
let first: Channel | null = null;
|
|
234
|
+
for await (const channel of client.channel.listByAgentAll({
|
|
235
|
+
agentId: agent.metadata?.id ?? "",
|
|
236
|
+
org: linkOrg,
|
|
237
|
+
})) {
|
|
238
|
+
if (channel.spec?.type.case !== "web") continue;
|
|
239
|
+
const slug = channel.metadata?.slug;
|
|
240
|
+
if (slug === `${agentSlug}-web`) return channel;
|
|
241
|
+
if (slug === agentSlug) ownSlug ??= channel;
|
|
242
|
+
first ??= channel;
|
|
243
|
+
}
|
|
244
|
+
return ownSlug ?? first;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* The agent's channel the `--name` slug names, when it is one of the
|
|
249
|
+
* agent's web channels; null when the agent has no channel by that slug
|
|
250
|
+
* (a new link is created under it). A Slack or WhatsApp channel of the
|
|
251
|
+
* agent by that slug is refused, never edited, in the words a taken name
|
|
252
|
+
* gets.
|
|
253
|
+
*/
|
|
254
|
+
async function resolveNamedWebChannel(
|
|
255
|
+
client: Stigmer,
|
|
256
|
+
agent: Agent,
|
|
257
|
+
linkOrg: string,
|
|
258
|
+
name: string,
|
|
259
|
+
ref: string,
|
|
260
|
+
): Promise<Channel | null> {
|
|
261
|
+
for await (const channel of client.channel.listByAgentAll({
|
|
262
|
+
agentId: agent.metadata?.id ?? "",
|
|
263
|
+
org: linkOrg,
|
|
264
|
+
})) {
|
|
265
|
+
if (channel.metadata?.slug !== name) continue;
|
|
266
|
+
if (channel.spec?.type.case === "web") return channel;
|
|
267
|
+
throw nameHeldError(name, describeHolder(channel), ref);
|
|
268
|
+
}
|
|
269
|
+
return null;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Create the agent's new chat link, strictly: never an apply, so it can
|
|
274
|
+
* never update the channel that holds its slug. Without `--name` the
|
|
275
|
+
* channel is nameless and the server names it `<agent slug>-web` (its
|
|
276
|
+
* display name `<agent name> (Web)`); with `--name` it takes that slug.
|
|
277
|
+
* A taken slug is refused naming its holder.
|
|
278
|
+
*/
|
|
279
|
+
async function createLink(
|
|
280
|
+
client: Stigmer,
|
|
281
|
+
agent: Agent,
|
|
282
|
+
linkOrg: string,
|
|
283
|
+
ref: string,
|
|
284
|
+
options: LinkAgentOptions,
|
|
285
|
+
audience: LinkAudience,
|
|
286
|
+
): Promise<Channel> {
|
|
287
|
+
const slug = options.name ?? `${agent.metadata?.slug ?? ""}-web`;
|
|
288
|
+
try {
|
|
289
|
+
return await client.channel.create(newChannelInput(agent, linkOrg, options, audience));
|
|
290
|
+
} catch (err) {
|
|
291
|
+
if (!isAlreadyExists(err)) throw err;
|
|
292
|
+
if (getErrorReason(err)?.reason === REASON_SLUG_RESERVED) {
|
|
293
|
+
throw new UsageError(
|
|
294
|
+
`the name \`${slug}\` was another channel's until it was renamed in the last 30 days, and still leads to that channel\n\n` +
|
|
295
|
+
nameRemedy(ref),
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
throw nameHeldError(slug, await holderOf(client, err), ref);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// AlreadyExists, as the SDK raises it (a StigmerError over the ConnectError).
|
|
303
|
+
function isAlreadyExists(err: unknown): err is Error {
|
|
304
|
+
return err instanceof StigmerError && err.connectCode === Code.AlreadyExists;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// The holder's words: its type and agent when the caller may read it, its
|
|
308
|
+
// id when not, and "another channel" when the refusal names no id. The
|
|
309
|
+
// server's duplicate copy carries the holder's id as `(id: <id>)`.
|
|
310
|
+
async function holderOf(client: Stigmer, err: Error): Promise<string> {
|
|
311
|
+
const id = /\(id: ([^)\s]+)\)/.exec(err.message)?.[1];
|
|
312
|
+
if (id === undefined) return "another channel";
|
|
313
|
+
try {
|
|
314
|
+
return describeHolder(await client.channel.get(id));
|
|
315
|
+
} catch {
|
|
316
|
+
return `channel ${id}`;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/** The display word of each channel type, as a sentence names it. */
|
|
321
|
+
const TYPE_WORDS: Readonly<Record<string, string>> = {
|
|
322
|
+
web: "a chat link",
|
|
323
|
+
slack: "a Slack channel",
|
|
324
|
+
whatsapp: "a WhatsApp channel",
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
function describeHolder(channel: Channel): string {
|
|
328
|
+
const type = TYPE_WORDS[channel.spec?.type.case ?? ""] ?? "a channel";
|
|
329
|
+
const agentSlug = channel.spec?.agentRef?.slug ?? "";
|
|
330
|
+
return agentSlug === "" ? type : `${type} of agent \`${agentSlug}\``;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
function nameHeldError(slug: string, holder: string, ref: string): UsageError {
|
|
334
|
+
return new UsageError(`the name \`${slug}\` is held by ${holder}\n\n${nameRemedy(ref)}`);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
function nameRemedy(ref: string): string {
|
|
338
|
+
return (
|
|
339
|
+
"One organization's channels share one set of names. Pass --name <slug>\n" +
|
|
340
|
+
"to give this chat link another name:\n" +
|
|
341
|
+
` stigmer channel link ${ref} --name <slug>`
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// The web arm of a channel's spec; undefined when there is no channel yet.
|
|
346
|
+
function webConfigOf(channel: Channel | null): WebChannelConfig | undefined {
|
|
347
|
+
const type = channel?.spec?.type;
|
|
348
|
+
return type?.case === "web" ? type.value : undefined;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// Unspecified means the organization by contract: a link reaches anyone on
|
|
352
|
+
// the internet only when public is chosen, so a new link without
|
|
353
|
+
// --audience is organization-only.
|
|
354
|
+
function audienceFromProto(audience: ChannelAudience | undefined): LinkAudience {
|
|
355
|
+
return audience === ChannelAudience.public ? "public" : "org";
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
function protoAudience(audience: LinkAudience): ChannelAudience {
|
|
359
|
+
return audience === "org" ? ChannelAudience.org : ChannelAudience.public;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// The full channel input with the desired `enabled` and audience. The
|
|
363
|
+
// existing channel is restated whole (its id, name, slug, labels, origins,
|
|
364
|
+
// messages, credential bindings and run settings), so the apply changes
|
|
365
|
+
// that row and only the two fields; a manifest-created channel may carry
|
|
366
|
+
// any slug, and applying under another would create a SECOND channel. The
|
|
367
|
+
// audience is written explicitly — never left unspecified — so every
|
|
368
|
+
// stored channel says what it means.
|
|
369
|
+
function preservingChannelInput(
|
|
370
|
+
channel: Channel,
|
|
371
|
+
enabled: boolean,
|
|
372
|
+
audience: LinkAudience,
|
|
373
|
+
): ChannelInput {
|
|
374
|
+
const restated = toChannelInput(channel);
|
|
375
|
+
const web = webConfigOf(channel);
|
|
376
|
+
return {
|
|
377
|
+
...restated,
|
|
378
|
+
enabled,
|
|
379
|
+
web: {
|
|
380
|
+
audience: protoAudience(audience),
|
|
381
|
+
allowedOrigins: [...(web?.allowedOrigins ?? [])],
|
|
382
|
+
messages: {
|
|
383
|
+
rateLimited: web?.messages?.rateLimited ?? "",
|
|
384
|
+
unavailable: web?.messages?.unavailable ?? "",
|
|
385
|
+
conversationEnded: web?.messages?.conversationEnded ?? "",
|
|
386
|
+
},
|
|
387
|
+
},
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// A new web channel with empty configuration: nameless (the server names
|
|
392
|
+
// it after the agent) unless `--name` gave its slug.
|
|
393
|
+
function newChannelInput(
|
|
394
|
+
agent: Agent,
|
|
395
|
+
linkOrg: string,
|
|
396
|
+
options: LinkAgentOptions,
|
|
397
|
+
audience: LinkAudience,
|
|
398
|
+
): ChannelInput {
|
|
399
|
+
return {
|
|
400
|
+
org: linkOrg,
|
|
401
|
+
name: options.name ?? "",
|
|
402
|
+
...(options.name !== undefined ? { slug: options.name } : {}),
|
|
403
|
+
agentRef: { org: agent.metadata?.org ?? "", slug: agent.metadata?.slug ?? "" },
|
|
404
|
+
enabled: options.enabled,
|
|
405
|
+
web: {
|
|
406
|
+
audience: protoAudience(audience),
|
|
407
|
+
allowedOrigins: [],
|
|
408
|
+
messages: { rateLimited: "", unavailable: "", conversationEnded: "" },
|
|
409
|
+
},
|
|
410
|
+
vaults: [],
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// Build the user-facing result. The hosted chat link and the embed name the
|
|
415
|
+
// web channel by its id, the one identity a link carries, so no rename of
|
|
416
|
+
// the organization or the channel breaks them. The re-enable hint names the
|
|
417
|
+
// agent by its own slug, the reference this command takes (a channel's slug
|
|
418
|
+
// names the channel, never the agent), and the `--name` the caller passed.
|
|
419
|
+
// The link token comes from the channel's web status (post-rotation when
|
|
420
|
+
// --reset-link ran) and rides the printed URL and snippet — public audience
|
|
421
|
+
// only (org access is gated by membership). The words a person reads name
|
|
422
|
+
// the organization by `orgLabel`, its slug.
|
|
423
|
+
function describeOutcome(
|
|
424
|
+
agent: Agent,
|
|
425
|
+
link: Channel | null,
|
|
426
|
+
options: LinkAgentOptions,
|
|
427
|
+
audience: LinkAudience,
|
|
428
|
+
alreadyInState: boolean,
|
|
429
|
+
orgLabel: string,
|
|
430
|
+
): CommandResult {
|
|
431
|
+
const channelId = link?.metadata?.id ?? "";
|
|
432
|
+
const slug = agent.metadata?.slug ?? "";
|
|
433
|
+
const name = agent.metadata?.name || slug;
|
|
434
|
+
const typeStatus = link?.status?.typeStatus;
|
|
435
|
+
const linkToken = typeStatus?.case === "web" ? typeStatus.value.linkToken : "";
|
|
436
|
+
|
|
437
|
+
if (!options.enabled) {
|
|
438
|
+
const result = CommandResult.success(
|
|
439
|
+
alreadyInState ? `The chat link is already off for '${name}'` : `Chat link turned off for '${name}'`,
|
|
440
|
+
);
|
|
441
|
+
result.hint("The chat link no longer works. Turn it back on with:");
|
|
442
|
+
result.hint(
|
|
443
|
+
` stigmer channel link ${orgLabel}/${slug}${options.name !== undefined ? ` --name ${options.name}` : ""}`,
|
|
444
|
+
);
|
|
445
|
+
return result;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
const result = CommandResult.success(
|
|
449
|
+
options.resetLink === true
|
|
450
|
+
? `Chat link reset for '${name}' — the old link no longer works`
|
|
451
|
+
: alreadyInState
|
|
452
|
+
? `The chat link is already on for '${name}'`
|
|
453
|
+
: `Chat link turned on for '${name}'`,
|
|
454
|
+
);
|
|
455
|
+
|
|
456
|
+
const publicLinkToken = audience === "org" ? undefined : linkToken || undefined;
|
|
457
|
+
result
|
|
458
|
+
.addSection(audience === "org" ? "Member chat link" : "Public chat link")
|
|
459
|
+
.item(buildChatUrl(options.appOrigin, channelId, publicLinkToken));
|
|
460
|
+
|
|
461
|
+
if (audience === "org") {
|
|
462
|
+
// Embeds serve anonymous guests, which org-members-only links refuse
|
|
463
|
+
// by design — no snippet to print.
|
|
464
|
+
result.hint(`Only signed-in members of ${orgLabel} can chat. Access ends when they leave the organization.`);
|
|
465
|
+
result.hint(`Members chat on ${orgLabel}'s own provider keys.`);
|
|
466
|
+
} else {
|
|
467
|
+
const snippetSection = result.addSection("Embed on your site");
|
|
468
|
+
for (const line of buildEmbedSnippet(options.appOrigin, channelId, publicLinkToken).split("\n")) {
|
|
469
|
+
snippetSection.item(line);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
result.hint(`Visitors chat on ${orgLabel}'s own provider keys.`);
|
|
473
|
+
result.hint("Public links can be forwarded and indexed by search engines.");
|
|
474
|
+
if (options.resetLink === true) {
|
|
475
|
+
result.hint("Send the new link to the people who should keep chatting.");
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
// Only a public link needs guest sign-in; an organization link is the one
|
|
479
|
+
// a self-hosted server serves.
|
|
480
|
+
if (options.isLocal && audience === "public") {
|
|
481
|
+
result.hint("Guest chat is a Stigmer Cloud capability — this local link won't serve visitors.");
|
|
482
|
+
}
|
|
483
|
+
return result;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* Turn the referenced channel (a `chn_…` id, `org/slug`, or bare slug
|
|
488
|
+
* against `org`) on or off, whatever its type, and describe the outcome.
|
|
489
|
+
* The write is the masked update of `spec.enabled` alone; a channel
|
|
490
|
+
* already in the state is reported without a write. Disabling pauses the
|
|
491
|
+
* channel: its configuration, credentials and install stay as stored.
|
|
492
|
+
*/
|
|
493
|
+
export async function setChannelEnabled(
|
|
494
|
+
client: Stigmer,
|
|
495
|
+
ref: string,
|
|
496
|
+
org: string,
|
|
497
|
+
enabled: boolean,
|
|
498
|
+
): Promise<CommandResult> {
|
|
499
|
+
const verb = enabled ? "enable" : "disable";
|
|
500
|
+
const before = await loadChannel(client, ref, org, verb);
|
|
501
|
+
const id = before.metadata?.id ?? "";
|
|
502
|
+
const slug = before.metadata?.slug ?? "";
|
|
503
|
+
const name = before.metadata?.name || slug;
|
|
504
|
+
const alreadyInState = (before.spec?.enabled ?? false) === enabled;
|
|
505
|
+
|
|
506
|
+
const after = alreadyInState
|
|
507
|
+
? before
|
|
508
|
+
: await client.channel.update(
|
|
509
|
+
{
|
|
510
|
+
metadata: { id, org: before.metadata?.org ?? "" },
|
|
511
|
+
spec: { enabled },
|
|
512
|
+
} satisfies MessageInitShape<typeof ChannelSchema>,
|
|
513
|
+
["spec.enabled"],
|
|
514
|
+
);
|
|
515
|
+
|
|
516
|
+
const result = CommandResult.success(
|
|
517
|
+
enabled
|
|
518
|
+
? alreadyInState
|
|
519
|
+
? `Channel '${name}' is already enabled`
|
|
520
|
+
: `Channel '${name}' enabled`
|
|
521
|
+
: alreadyInState
|
|
522
|
+
? `Channel '${name}' is already disabled`
|
|
523
|
+
: `Channel '${name}' disabled`,
|
|
524
|
+
);
|
|
525
|
+
result
|
|
526
|
+
.addSection()
|
|
527
|
+
.field("ID", id)
|
|
528
|
+
.field("Slug", slug)
|
|
529
|
+
.field("Type", after.spec?.type.case ?? "")
|
|
530
|
+
.field("Enabled", String(after.spec?.enabled ?? false));
|
|
531
|
+
if (!enabled) {
|
|
532
|
+
result.hint("The channel is paused, not torn down: its configuration is kept. Turn it back on with:");
|
|
533
|
+
result.hint(` stigmer channel enable ${ref}`);
|
|
534
|
+
}
|
|
535
|
+
return result;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
async function loadChannel(client: Stigmer, ref: string, org: string, verb: string): Promise<Channel> {
|
|
539
|
+
const parsed = parseReference(ref, org, idPrefixesFor(ApiResourceKind.channel));
|
|
540
|
+
if (parsed.kind === "id") {
|
|
541
|
+
return client.channel.get(parsed.id);
|
|
542
|
+
}
|
|
543
|
+
await requireOrganization(client, parsed.org, [
|
|
544
|
+
"stigmer config context set --org <org>",
|
|
545
|
+
`stigmer channel ${verb} ${ref} --org <org>`,
|
|
546
|
+
]);
|
|
547
|
+
return client.channel.getByReference({ org: parsed.org, slug: parsed.slug });
|
|
548
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// The address a vault connection is saved at, by the server's one rule, so
|
|
2
|
+
// `connect plugin` can tell whether My vault already holds the login a
|
|
3
|
+
// server's tools are reached with before it asks for a sign-in.
|
|
4
|
+
//
|
|
5
|
+
// A tool's address is its full URL: scheme and host lowercased, a default
|
|
6
|
+
// port dropped, one trailing slash trimmed, query and fragment dropped. A URL
|
|
7
|
+
// holding a `${VAR}` placeholder, with credentials in it, or on another
|
|
8
|
+
// scheme names no address. The server normalizes every saved address itself
|
|
9
|
+
// and decides at each call; this mirror only spares a sign-in the caller has
|
|
10
|
+
// already made. The github.com login also fills a tool served over HTTPS
|
|
11
|
+
// from GitHub's own API hosts, as the server's rule says.
|
|
12
|
+
|
|
13
|
+
const DEFAULT_PORTS: Readonly<Record<string, string>> = {
|
|
14
|
+
"http:": "80",
|
|
15
|
+
"https:": "443",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** The Git host whose login also fills GitHub's API-hosted tools. */
|
|
19
|
+
const GITHUB_HOST = "github.com";
|
|
20
|
+
|
|
21
|
+
/** GitHub's own API hosts, served by the github.com login. */
|
|
22
|
+
const GITHUB_API_HOSTS: ReadonlySet<string> = new Set(["api.github.com", "api.githubcopilot.com"]);
|
|
23
|
+
|
|
24
|
+
/** A tool URL's address, or undefined when the URL names none. */
|
|
25
|
+
export function toolAddress(url: string): string | undefined {
|
|
26
|
+
const trimmed = url.trim();
|
|
27
|
+
if (trimmed === "" || trimmed.includes("${")) return undefined;
|
|
28
|
+
let parsed: URL;
|
|
29
|
+
try {
|
|
30
|
+
parsed = new URL(trimmed);
|
|
31
|
+
} catch {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
if (parsed.protocol !== "https:" && parsed.protocol !== "http:") return undefined;
|
|
35
|
+
if (parsed.username !== "" || parsed.password !== "") return undefined;
|
|
36
|
+
const port = parsed.port !== "" && parsed.port !== DEFAULT_PORTS[parsed.protocol] ? `:${parsed.port}` : "";
|
|
37
|
+
let path = parsed.pathname;
|
|
38
|
+
if (path.endsWith("/")) path = path.slice(0, -1);
|
|
39
|
+
return `${parsed.protocol}//${parsed.hostname.toLowerCase()}${port}${path}`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Whether a vault's connections, by address, hold a login for the tool at `address`. */
|
|
43
|
+
export function holdsLoginFor(connections: Readonly<Record<string, unknown>>, address: string): boolean {
|
|
44
|
+
if (Object.hasOwn(connections, address)) return true;
|
|
45
|
+
const url = new URL(address);
|
|
46
|
+
return url.protocol === "https:" && GITHUB_API_HOSTS.has(url.hostname) && Object.hasOwn(connections, GITHUB_HOST);
|
|
47
|
+
}
|