@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,62 @@
|
|
|
1
|
+
import { type JsonValue, type Message } from "@bufbuild/protobuf";
|
|
2
|
+
import { type ApiResourceMetadata } from "@stigmer/apis/ai/stigmer/commons/apiresource/metadata_pb";
|
|
3
|
+
import { CommandResult } from "../../output/index.js";
|
|
4
|
+
import { type ApplyHandler, type ControllerFn } from "./handlers.js";
|
|
5
|
+
export interface ApplyItem {
|
|
6
|
+
readonly filePath: string;
|
|
7
|
+
readonly handler: ApplyHandler;
|
|
8
|
+
readonly document: JsonValue;
|
|
9
|
+
}
|
|
10
|
+
export interface ApplyOutcome {
|
|
11
|
+
readonly result: CommandResult;
|
|
12
|
+
/** Optional org-mismatch warning to surface on stderr. */
|
|
13
|
+
readonly warning?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The applied resource message (absent in dry-run), as the server stored
|
|
16
|
+
* it: authoritative metadata (id, slug, visibility) for anything that
|
|
17
|
+
* runs after the apply.
|
|
18
|
+
*/
|
|
19
|
+
readonly applied?: Message;
|
|
20
|
+
}
|
|
21
|
+
/** Expand a path into ordered, kind-resolved apply items (strict YAML parse). */
|
|
22
|
+
export declare function resolveApplyItems(path: string): ApplyItem[];
|
|
23
|
+
/**
|
|
24
|
+
* Resolve a YAML `kind` to its apply handler, enforcing the verb-support gate.
|
|
25
|
+
* The unknown-kind wording is the registry's (`unknownKindError`), shared
|
|
26
|
+
* with `validate -f`, so a retired kind is refused with the same sentence on
|
|
27
|
+
* both paths. `where` is woven into errors for a precise location.
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveHandlerForKind(kind: string, where: string): ApplyHandler;
|
|
30
|
+
/**
|
|
31
|
+
* Stable sort by dependency priority (Array.prototype.sort is stable in V8).
|
|
32
|
+
* The priority rides each handler (`applyOrder`, sourced from the SDK
|
|
33
|
+
* manifest registry) — there is deliberately no local ordering table to
|
|
34
|
+
* drift from it.
|
|
35
|
+
*/
|
|
36
|
+
export declare function sortApplyItems(items: ApplyItem[]): ApplyItem[];
|
|
37
|
+
/** True when any item needs org context (everything except Organization). */
|
|
38
|
+
export declare function requiresOrgContext(items: readonly ApplyItem[]): boolean;
|
|
39
|
+
/** Apply a single YAML item: strict-marshal to a proto, then apply the message. */
|
|
40
|
+
export declare function applyItem(controller: ControllerFn, item: ApplyItem, org: string, dryRun: boolean): Promise<ApplyOutcome>;
|
|
41
|
+
/**
|
|
42
|
+
* Strict YAML→proto marshal for one item, with a precise location in the error.
|
|
43
|
+
* Split out from {@link applyItem} so marshalling can be exercised and reused
|
|
44
|
+
* apart from the apply it feeds.
|
|
45
|
+
*
|
|
46
|
+
* A file is a desired state (`toDesiredState`): its etag is dropped, and so
|
|
47
|
+
* is the id of each reference it names by slug. A file `get -o yaml`
|
|
48
|
+
* printed whole applies after the resource changed, and a reference whose
|
|
49
|
+
* slug was edited follows the new slug instead of disagreeing with a
|
|
50
|
+
* leftover id.
|
|
51
|
+
*/
|
|
52
|
+
export declare function marshalItem(item: ApplyItem): Message;
|
|
53
|
+
/**
|
|
54
|
+
* Apply a fully-marshalled resource message: inject org, then dry-run preview or
|
|
55
|
+
* drive the controller's `apply` RPC. The single apply core behind file mode,
|
|
56
|
+
* taking the message rather than the YAML so org injection, create/update
|
|
57
|
+
* detection and result shaping live in one place whatever produced the message.
|
|
58
|
+
*/
|
|
59
|
+
export declare function applyMessage(controller: ControllerFn, handler: ApplyHandler, message: Message, org: string, dryRun: boolean): Promise<ApplyOutcome>;
|
|
60
|
+
/** Read a resource message's metadata (id/name/slug/org), if present. */
|
|
61
|
+
export declare function resourceMetadata(message: Message): ApiResourceMetadata | undefined;
|
|
62
|
+
//# sourceMappingURL=apply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/resources/apply/apply.ts"],"names":[],"mappings":"AAaA,OAAO,EAA4B,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAY5F,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAA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AAE,OAAO,EAChB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,OAAO,GACd,OAAO,CAAC,YAAY,CAAC,CAqBvB;AAiMD,yEAAyE;AACzE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,mBAAmB,GAAG,SAAS,CAElF"}
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
// File-mode apply orchestration (`apply -f <file|dir>`).
|
|
2
|
+
//
|
|
3
|
+
// Pipeline per document: strict YAML→proto marshal, reduced to the desired
|
|
4
|
+
// state the file declares (no etag, references by slug) → inject the
|
|
5
|
+
// resolved org when absent → dry-run preview OR drive the raw command
|
|
6
|
+
// controller's `apply` RPC with the full proto → build a CommandResult. Items
|
|
7
|
+
// across all files are sorted into dependency order before applying so parents
|
|
8
|
+
// (org → agent → channel → …) land before their dependents.
|
|
9
|
+
//
|
|
10
|
+
// The slug rules (a renamed-away slug named, a declared slug followed with a
|
|
11
|
+
// rename, a kind that cannot rename) are the SDK's, shared with the
|
|
12
|
+
// console's YAML editors; this file words their outcomes for the terminal.
|
|
13
|
+
import { create, equals, fromJson } from "@bufbuild/protobuf";
|
|
14
|
+
import { Code } from "@connectrpc/connect";
|
|
15
|
+
import { ApiResourceKind } from "@stigmer/apis/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
16
|
+
import { ApiResourceVisibility } from "@stigmer/apis/ai/stigmer/commons/apiresource/enum_pb";
|
|
17
|
+
import { UpdateVisibilityInputSchema } from "@stigmer/apis/ai/stigmer/commons/apiresource/io_pb";
|
|
18
|
+
import { UpdateOrganizationPoliciesInputSchema } from "@stigmer/apis/ai/stigmer/tenancy/organization/v1/io_pb";
|
|
19
|
+
import { OrganizationQueryController } from "@stigmer/apis/ai/stigmer/tenancy/organization/v1/query_pb";
|
|
20
|
+
import { OrganizationPoliciesSchema, } from "@stigmer/apis/ai/stigmer/tenancy/organization/v1/spec_pb";
|
|
21
|
+
import { ApiResourceMetadataSchema, } from "@stigmer/apis/ai/stigmer/commons/apiresource/metadata_pb";
|
|
22
|
+
import { organizationLabel, organizationNamed, } from "../../client/organizations.js";
|
|
23
|
+
import { applyNamingCurrentSlug, followDeclaredSlug, retiredShapeWayForward, SlugChangeRefusedError, SlugRenamedError, toDesiredState, } from "@stigmer/client";
|
|
24
|
+
import { classify, UsageError } from "../../errors/index.js";
|
|
25
|
+
import { CommandResult } from "../../output/index.js";
|
|
26
|
+
import { defaultRegistry, unknownKindError, Verb } from "../../registry/index.js";
|
|
27
|
+
import { loadDocuments, resolveYamlFiles } from "../documents.js";
|
|
28
|
+
import { APPLY_HANDLERS } from "./handlers.js";
|
|
29
|
+
/** Expand a path into ordered, kind-resolved apply items (strict YAML parse). */
|
|
30
|
+
export function resolveApplyItems(path) {
|
|
31
|
+
const files = resolveYamlFiles(path);
|
|
32
|
+
if (files.length === 0)
|
|
33
|
+
throw new UsageError("no YAML files found");
|
|
34
|
+
const items = [];
|
|
35
|
+
for (const file of files) {
|
|
36
|
+
for (const doc of loadDocuments(file, { strict: true })) {
|
|
37
|
+
items.push({ filePath: file, handler: resolveHandlerForKind(doc.kind, file), document: doc.document });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (items.length === 0)
|
|
41
|
+
throw new UsageError("no valid resources found in files");
|
|
42
|
+
return sortApplyItems(items);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Resolve a YAML `kind` to its apply handler, enforcing the verb-support gate.
|
|
46
|
+
* The unknown-kind wording is the registry's (`unknownKindError`), shared
|
|
47
|
+
* with `validate -f`, so a retired kind is refused with the same sentence on
|
|
48
|
+
* both paths. `where` is woven into errors for a precise location.
|
|
49
|
+
*/
|
|
50
|
+
export function resolveHandlerForKind(kind, where) {
|
|
51
|
+
const info = defaultRegistry().getByYamlKind(kind);
|
|
52
|
+
if (info === undefined)
|
|
53
|
+
throw unknownKindError(kind, where);
|
|
54
|
+
if (!info.supportedVerbs.has(Verb.Apply))
|
|
55
|
+
throw new UsageError(`${info.displayName} does not support 'apply'`);
|
|
56
|
+
const handler = APPLY_HANDLERS.get(info.kind);
|
|
57
|
+
if (handler === undefined)
|
|
58
|
+
throw new UsageError(`apply not implemented for ${info.displayName}`);
|
|
59
|
+
return handler;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Stable sort by dependency priority (Array.prototype.sort is stable in V8).
|
|
63
|
+
* The priority rides each handler (`applyOrder`, sourced from the SDK
|
|
64
|
+
* manifest registry) — there is deliberately no local ordering table to
|
|
65
|
+
* drift from it.
|
|
66
|
+
*/
|
|
67
|
+
export function sortApplyItems(items) {
|
|
68
|
+
items.sort((a, b) => a.handler.applyOrder - b.handler.applyOrder);
|
|
69
|
+
return items;
|
|
70
|
+
}
|
|
71
|
+
/** True when any item needs org context (everything except Organization). */
|
|
72
|
+
export function requiresOrgContext(items) {
|
|
73
|
+
return items.some((item) => item.handler.kind !== ApiResourceKind.organization);
|
|
74
|
+
}
|
|
75
|
+
/** Apply a single YAML item: strict-marshal to a proto, then apply the message. */
|
|
76
|
+
export async function applyItem(controller, item, org, dryRun) {
|
|
77
|
+
return applyMessage(controller, item.handler, marshalItem(item), org, dryRun);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Strict YAML→proto marshal for one item, with a precise location in the error.
|
|
81
|
+
* Split out from {@link applyItem} so marshalling can be exercised and reused
|
|
82
|
+
* apart from the apply it feeds.
|
|
83
|
+
*
|
|
84
|
+
* A file is a desired state (`toDesiredState`): its etag is dropped, and so
|
|
85
|
+
* is the id of each reference it names by slug. A file `get -o yaml`
|
|
86
|
+
* printed whole applies after the resource changed, and a reference whose
|
|
87
|
+
* slug was edited follows the new slug instead of disagreeing with a
|
|
88
|
+
* leftover id.
|
|
89
|
+
*/
|
|
90
|
+
export function marshalItem(item) {
|
|
91
|
+
try {
|
|
92
|
+
return toDesiredState(item.handler.schema, fromJson(item.handler.schema, item.document, { ignoreUnknownFields: false }));
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
const hint = retiredShapeWayForward(item.document);
|
|
96
|
+
throw new UsageError(`invalid ${item.handler.displayName} in ${item.filePath}: ${err.message}${hint === undefined ? "" : `\n${hint}`}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Apply a fully-marshalled resource message: inject org, then dry-run preview or
|
|
101
|
+
* drive the controller's `apply` RPC. The single apply core behind file mode,
|
|
102
|
+
* taking the message rather than the YAML so org injection, create/update
|
|
103
|
+
* detection and result shaping live in one place whatever produced the message.
|
|
104
|
+
*/
|
|
105
|
+
export async function applyMessage(controller, handler, message, org, dryRun) {
|
|
106
|
+
// An organization belongs to no organization: its own metadata.org stays
|
|
107
|
+
// empty, whatever the context or `--org` names for the file's other kinds.
|
|
108
|
+
const orgWarning = handler.kind === ApiResourceKind.organization ? undefined : await injectOrg(controller, message, org);
|
|
109
|
+
const created = (metaOf(message)?.id ?? "") === "";
|
|
110
|
+
if (dryRun) {
|
|
111
|
+
return { result: await buildDryRunResult(controller, handler, message), warning: orgWarning };
|
|
112
|
+
}
|
|
113
|
+
const applied = await applyNamingSlug(controller, handler, message);
|
|
114
|
+
// Visibility and policies land before the slug: a refused rename stops
|
|
115
|
+
// the command, so everything else the manifest asked for has landed by
|
|
116
|
+
// then, and the refusal reports it.
|
|
117
|
+
const visibilityWarning = await applyDeclaredVisibility(controller, handler, message, applied);
|
|
118
|
+
await applyDeclaredPolicies(controller, handler, message, applied);
|
|
119
|
+
const slugWarning = await applyDeclaredSlug(controller, handler, message, applied, visibilityWarning);
|
|
120
|
+
const warning = combineWarnings(orgWarning, visibilityWarning, slugWarning);
|
|
121
|
+
const result = buildApplyResult(handler, applied, created);
|
|
122
|
+
return { result, warning, applied };
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Land a manifest-declared visibility through the guarded door. Plain
|
|
126
|
+
* updates preserve the stored visibility on both editions (oss#573) — the
|
|
127
|
+
* `updateVisibility` RPC is the only mutation path, so when the applied
|
|
128
|
+
* resource comes back with a different level than the manifest declared,
|
|
129
|
+
* follow up with one RPC (the skill-push precedent: no-ops are skipped, an
|
|
130
|
+
* unchanged manifest costs nothing extra). Server-side guard rejections
|
|
131
|
+
* (an unsupported level) propagate as command failures —
|
|
132
|
+
* the spec update has landed at that point, and the error says so.
|
|
133
|
+
*
|
|
134
|
+
* Returns a warning (instead of following up) for kinds without the RPC:
|
|
135
|
+
* their manifests can only carry a level the create path already rejected,
|
|
136
|
+
* so a diff here means a pre-existing resource and an unsupported ask.
|
|
137
|
+
*/
|
|
138
|
+
async function applyDeclaredVisibility(controller, handler, message, applied) {
|
|
139
|
+
const declared = metaOf(message)?.visibility ?? ApiResourceVisibility.api_resource_visibility_unspecified;
|
|
140
|
+
if (declared === ApiResourceVisibility.api_resource_visibility_unspecified)
|
|
141
|
+
return undefined;
|
|
142
|
+
const appliedMeta = metaOf(applied);
|
|
143
|
+
const resourceId = appliedMeta?.id ?? "";
|
|
144
|
+
if (resourceId === "" || appliedMeta?.visibility === declared)
|
|
145
|
+
return undefined;
|
|
146
|
+
if (handler.updateVisibility === undefined) {
|
|
147
|
+
return (`${handler.displayName} visibility cannot be changed declaratively — ` +
|
|
148
|
+
"the manifest's metadata.visibility was ignored (the stored value is kept)");
|
|
149
|
+
}
|
|
150
|
+
try {
|
|
151
|
+
const updated = await handler.updateVisibility(controller, create(UpdateVisibilityInputSchema, { resourceId, visibility: declared }));
|
|
152
|
+
// Reflect the landed level on the outcome the caller already holds.
|
|
153
|
+
const updatedMeta = metaOf(updated);
|
|
154
|
+
if (appliedMeta !== undefined && updatedMeta !== undefined) {
|
|
155
|
+
appliedMeta.visibility = updatedMeta.visibility;
|
|
156
|
+
}
|
|
157
|
+
return undefined;
|
|
158
|
+
}
|
|
159
|
+
catch (err) {
|
|
160
|
+
throw new UsageError(`${handler.displayName} spec applied, but the manifest's visibility change was rejected: ${err.message}`);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Land an Organization manifest's declared policies through the guarded
|
|
165
|
+
* door. An update or apply keeps the stored policies (a stale manifest
|
|
166
|
+
* neither fails nor reverts one), so when the applied organization comes
|
|
167
|
+
* back with different policies than the manifest declared, follow up with
|
|
168
|
+
* one `updatePolicies` — the visibility precedent: a manifest that declares
|
|
169
|
+
* no policies, or the ones already stored, costs nothing extra. A refusal
|
|
170
|
+
* (a member who may not change them) fails the command after the spec has
|
|
171
|
+
* landed, and the error says so.
|
|
172
|
+
*/
|
|
173
|
+
async function applyDeclaredPolicies(controller, handler, message, applied) {
|
|
174
|
+
if (handler.updatePolicies === undefined)
|
|
175
|
+
return;
|
|
176
|
+
const declared = message.spec?.policies;
|
|
177
|
+
if (declared === undefined)
|
|
178
|
+
return;
|
|
179
|
+
const appliedOrg = applied;
|
|
180
|
+
const orgId = appliedOrg.metadata?.id ?? "";
|
|
181
|
+
if (orgId === "" || equals(OrganizationPoliciesSchema, storedPolicies(appliedOrg), declared))
|
|
182
|
+
return;
|
|
183
|
+
try {
|
|
184
|
+
const updated = (await handler.updatePolicies(controller, create(UpdateOrganizationPoliciesInputSchema, { orgId, policies: declared })));
|
|
185
|
+
// Reflect the landed policies on the outcome the caller already holds.
|
|
186
|
+
if (appliedOrg.spec !== undefined) {
|
|
187
|
+
appliedOrg.spec.policies = updated.spec?.policies;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
catch (err) {
|
|
191
|
+
throw new UsageError(`${handler.displayName} spec applied, but the manifest's policies change was rejected: ${err.message}`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* The policies an organization holds: a row stored without them holds the
|
|
196
|
+
* defaults (members may create agents), as the server reads it.
|
|
197
|
+
*/
|
|
198
|
+
function storedPolicies(organization) {
|
|
199
|
+
return (organization.spec?.policies ?? create(OrganizationPoliciesSchema, { membersCanCreateAgents: true }));
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Land a manifest-declared slug change through the guarded door (the SDK's
|
|
203
|
+
* `followDeclaredSlug`). An apply finds its resource by the manifest's id
|
|
204
|
+
* when it carries one, and an update ignores the slug, so a manifest that
|
|
205
|
+
* carries the id and a new slug (an organization's `get -o yaml`, edited)
|
|
206
|
+
* updates the resource and leaves the slug as it was; one `rename` follows,
|
|
207
|
+
* as visibility is followed up. Without the id the slug is how apply finds
|
|
208
|
+
* the resource, so a new slug means a new resource. A kind with no rename
|
|
209
|
+
* keeps its slug, and the returned warning says so. A refusal fails the
|
|
210
|
+
* command after the spec and any declared visibility have landed; the error
|
|
211
|
+
* says what landed and carries the visibility follow-up's warning. Its
|
|
212
|
+
* advice follows the refusal: a slug that is taken or reserved
|
|
213
|
+
* (AlreadyExists) asks for another slug, a caller who may not rename
|
|
214
|
+
* (PermissionDenied: renaming needs what deleting needs, an organization's
|
|
215
|
+
* owner for an organization) is told so, anything else gets none.
|
|
216
|
+
*/
|
|
217
|
+
async function applyDeclaredSlug(controller, handler, message, applied, visibilityWarning) {
|
|
218
|
+
const declared = metaOf(message);
|
|
219
|
+
const appliedMeta = metaOf(applied);
|
|
220
|
+
try {
|
|
221
|
+
const followed = await followDeclaredSlug(controller, handler, message, applied);
|
|
222
|
+
if (followed.slugKept) {
|
|
223
|
+
return (`${handler.displayName} slugs do not change: the file's metadata.slug '${declared?.slug ?? ""}' ` +
|
|
224
|
+
`was not applied, and the slug stays '${appliedMeta?.slug ?? ""}'`);
|
|
225
|
+
}
|
|
226
|
+
if (followed.renamedFrom !== undefined && appliedMeta !== undefined) {
|
|
227
|
+
appliedMeta.slug = metaOf(followed.message)?.slug ?? declared?.slug ?? appliedMeta.slug;
|
|
228
|
+
}
|
|
229
|
+
return undefined;
|
|
230
|
+
}
|
|
231
|
+
catch (err) {
|
|
232
|
+
/* v8 ignore next -- @preserve: followDeclaredSlug throws only SlugChangeRefusedError; the guard narrows the type */
|
|
233
|
+
if (!(err instanceof SlugChangeRefusedError))
|
|
234
|
+
throw err;
|
|
235
|
+
const visibilityLanded = declared !== undefined &&
|
|
236
|
+
declared.visibility !== ApiResourceVisibility.api_resource_visibility_unspecified &&
|
|
237
|
+
appliedMeta?.visibility === declared.visibility;
|
|
238
|
+
const landed = visibilityLanded ? "spec and visibility" : "spec";
|
|
239
|
+
const warning = visibilityWarning === undefined ? "" : ` (${visibilityWarning})`;
|
|
240
|
+
throw new UsageError(`${handler.displayName} ${landed} applied${warning}, but the manifest's slug change was rejected: ` +
|
|
241
|
+
`${err.cause.message}. The slug stays '${err.slug}'${renameAdvice(err.cause, handler)}.`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/** What to do after a refused rename, by the refusal's code; "" when there is nothing to add. */
|
|
245
|
+
function renameAdvice(err, handler) {
|
|
246
|
+
switch (classify(err)?.code) {
|
|
247
|
+
case Code.AlreadyExists:
|
|
248
|
+
return "; choose another slug and apply again";
|
|
249
|
+
case Code.PermissionDenied:
|
|
250
|
+
return handler.kind === ApiResourceKind.organization
|
|
251
|
+
? "; renaming needs the organization's owner"
|
|
252
|
+
: `; renaming needs the permission to delete the ${handler.displayName.toLowerCase()}`;
|
|
253
|
+
default:
|
|
254
|
+
return "";
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Applies the message (the SDK's `applyNamingCurrentSlug`); a refusal for a
|
|
259
|
+
* renamed-away slug is answered with the slug the resource has now, read
|
|
260
|
+
* as the caller by the old slug (which still leads to it for reading), so
|
|
261
|
+
* the file can be corrected. A caller who may not read the resource, or a
|
|
262
|
+
* kind with no read by reference, gets the server's own words.
|
|
263
|
+
*/
|
|
264
|
+
async function applyNamingSlug(controller, handler, message) {
|
|
265
|
+
try {
|
|
266
|
+
return await applyNamingCurrentSlug(controller, handler, message);
|
|
267
|
+
}
|
|
268
|
+
catch (err) {
|
|
269
|
+
if (!(err instanceof SlugRenamedError))
|
|
270
|
+
throw err;
|
|
271
|
+
throw new UsageError(`${handler.displayName} '${err.slug}' was renamed to '${err.currentSlug}'; update the file's metadata.slug to '${err.currentSlug}' and apply again`);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
function combineWarnings(...warnings) {
|
|
275
|
+
const present = warnings.filter((w) => w !== undefined);
|
|
276
|
+
return present.length > 0 ? present.join("; ") : undefined;
|
|
277
|
+
}
|
|
278
|
+
/** Read a resource message's metadata (id/name/slug/org), if present. */
|
|
279
|
+
export function resourceMetadata(message) {
|
|
280
|
+
return metaOf(message);
|
|
281
|
+
}
|
|
282
|
+
function metaOf(message) {
|
|
283
|
+
return message.metadata;
|
|
284
|
+
}
|
|
285
|
+
// Inject the resolved org into metadata.org when the document omitted it. When
|
|
286
|
+
// the document specifies a *different* org, return a warning (Go warns but
|
|
287
|
+
// honors the document's value — we do the same). An organization is named
|
|
288
|
+
// by its id or its slug, so two different strings are asked about before
|
|
289
|
+
// they are called different organizations, and the warning names each by
|
|
290
|
+
// its slug where the caller can see it.
|
|
291
|
+
async function injectOrg(controller, message, org) {
|
|
292
|
+
if (org === "")
|
|
293
|
+
return undefined;
|
|
294
|
+
const holder = message;
|
|
295
|
+
if (holder.metadata === undefined) {
|
|
296
|
+
holder.metadata = create(ApiResourceMetadataSchema, { org });
|
|
297
|
+
return undefined;
|
|
298
|
+
}
|
|
299
|
+
if (holder.metadata.org === "") {
|
|
300
|
+
holder.metadata.org = org;
|
|
301
|
+
return undefined;
|
|
302
|
+
}
|
|
303
|
+
if (holder.metadata.org === org)
|
|
304
|
+
return undefined;
|
|
305
|
+
const reader = organizationReader(controller);
|
|
306
|
+
const [declared, target] = await Promise.all([
|
|
307
|
+
organizationNamed(reader, holder.metadata.org),
|
|
308
|
+
organizationNamed(reader, org),
|
|
309
|
+
]);
|
|
310
|
+
if (declared !== undefined && declared.id === target?.id)
|
|
311
|
+
return undefined;
|
|
312
|
+
const declaredLabel = declared?.slug || holder.metadata.org;
|
|
313
|
+
const targetLabel = target?.slug || org;
|
|
314
|
+
return `resource org '${declaredLabel}' differs from target org '${targetLabel}'; using '${declaredLabel}'`;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* The organization get the shared name helpers ask, over the raw query
|
|
318
|
+
* controller, asked once per value for as long as the controller lives (one
|
|
319
|
+
* command): a manifest of many documents naming one organization makes one
|
|
320
|
+
* lookup, not two per document.
|
|
321
|
+
*/
|
|
322
|
+
function organizationReader(controller) {
|
|
323
|
+
let gets = organizationGets.get(controller);
|
|
324
|
+
if (gets === undefined) {
|
|
325
|
+
gets = new Map();
|
|
326
|
+
organizationGets.set(controller, gets);
|
|
327
|
+
}
|
|
328
|
+
const memo = gets;
|
|
329
|
+
return {
|
|
330
|
+
organization: {
|
|
331
|
+
get: (value) => {
|
|
332
|
+
let got = memo.get(value);
|
|
333
|
+
if (got === undefined) {
|
|
334
|
+
got = controller(OrganizationQueryController).get({ value });
|
|
335
|
+
memo.set(value, got);
|
|
336
|
+
}
|
|
337
|
+
return got;
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
/** Each controller's organization gets, by the value asked. */
|
|
343
|
+
const organizationGets = new WeakMap();
|
|
344
|
+
function buildApplyResult(handler, applied, created) {
|
|
345
|
+
const meta = metaOf(applied);
|
|
346
|
+
const result = CommandResult.success(`${handler.displayName} ${created ? "created" : "updated"} successfully`);
|
|
347
|
+
const section = result.addSection("Resource Details");
|
|
348
|
+
if (meta?.id)
|
|
349
|
+
section.field("ID", meta.id);
|
|
350
|
+
if (meta?.name)
|
|
351
|
+
section.field("Name", meta.name);
|
|
352
|
+
if (meta?.slug)
|
|
353
|
+
section.field("Slug", meta.slug);
|
|
354
|
+
return result;
|
|
355
|
+
}
|
|
356
|
+
// The preview names the organization by slug, as other output does: the
|
|
357
|
+
// injected context organization is an id.
|
|
358
|
+
async function buildDryRunResult(controller, handler, message) {
|
|
359
|
+
const meta = metaOf(message);
|
|
360
|
+
const name = meta?.name ?? handler.displayName;
|
|
361
|
+
const result = CommandResult.success(`Dry run: ${name} is valid`);
|
|
362
|
+
const section = result.addSection(`${handler.displayName} Preview`);
|
|
363
|
+
if (meta?.name)
|
|
364
|
+
section.field("Name", meta.name);
|
|
365
|
+
if (meta?.slug)
|
|
366
|
+
section.field("Slug", meta.slug);
|
|
367
|
+
if (meta?.org)
|
|
368
|
+
section.field("Org", await organizationLabel(organizationReader(controller), meta.org));
|
|
369
|
+
return result;
|
|
370
|
+
}
|
|
371
|
+
//# sourceMappingURL=apply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../../src/resources/apply/apply.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,EAAE;AACF,2EAA2E;AAC3E,qEAAqE;AACrE,sEAAsE;AACtE,8EAA8E;AAC9E,+EAA+E;AAC/E,4DAA4D;AAC5D,EAAE;AACF,6EAA6E;AAC7E,oEAAoE;AACpE,2EAA2E;AAE3E,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAgC,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,mFAAmF,CAAC;AACpH,OAAO,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAC7F,OAAO,EAAE,2BAA2B,EAAE,MAAM,oDAAoD,CAAC;AAEjG,OAAO,EAAE,qCAAqC,EAAE,MAAM,wDAAwD,CAAC;AAC/G,OAAO,EAAE,2BAA2B,EAAE,MAAM,2DAA2D,CAAC;AACxG,OAAO,EAEL,0BAA0B,GAC3B,MAAM,0DAA0D,CAAC;AAClE,OAAO,EAEL,yBAAyB,GAC1B,MAAM,0DAA0D,CAAC;AAClE,OAAO,EAEL,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,GACf,MAA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GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAI,EAAE,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC;IAC/C,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,YAAY,IAAI,WAAW,CAAC,CAAC;IAClE,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,WAAW,UAAU,CAAC,CAAC;IACpE,IAAI,IAAI,EAAE,IAAI;QAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,IAAI,IAAI,EAAE,IAAI;QAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,IAAI,IAAI,EAAE,GAAG;QAAE,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,iBAAiB,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACvG,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { DescMessage, DescService, Message } from "@bufbuild/protobuf";
|
|
2
|
+
import type { Client } from "@connectrpc/connect";
|
|
3
|
+
import type { ApiResourceReference, RenameInput, UpdateVisibilityInput } from "@stigmer/apis/ai/stigmer/commons/apiresource/io_pb";
|
|
4
|
+
import { ApiResourceKind } from "@stigmer/apis/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
5
|
+
import type { UpdateOrganizationPoliciesInput } from "@stigmer/apis/ai/stigmer/tenancy/organization/v1/io_pb";
|
|
6
|
+
/** Accessor for a raw Connect client over a generated service controller. */
|
|
7
|
+
export type ControllerFn = <Desc extends DescService>(service: Desc) => Client<Desc>;
|
|
8
|
+
export interface ApplyHandler {
|
|
9
|
+
readonly kind: ApiResourceKind;
|
|
10
|
+
/** Human-facing name for messages, e.g. "MCP Server". */
|
|
11
|
+
readonly displayName: string;
|
|
12
|
+
/** Proto schema for strict YAML→proto marshalling. */
|
|
13
|
+
readonly schema: DescMessage;
|
|
14
|
+
/**
|
|
15
|
+
* Position in the dependency apply order (ascending) — referenced kinds
|
|
16
|
+
* apply before their dependents. Manifest kinds carry the SDK registry's
|
|
17
|
+
* value; the CLI extras slot around them (organization first, the
|
|
18
|
+
* session after every blueprint it can reference).
|
|
19
|
+
*/
|
|
20
|
+
readonly applyOrder: number;
|
|
21
|
+
/** Drive the controller's `apply` RPC with the full resource message. */
|
|
22
|
+
apply(controller: ControllerFn, message: Message): Promise<Message>;
|
|
23
|
+
/**
|
|
24
|
+
* Drive the controller's `updateVisibility` RPC — the only door for
|
|
25
|
+
* visibility changes (plain updates preserve stored visibility, oss#573).
|
|
26
|
+
* Present exactly when the kind has the RPC; the apply core follows up
|
|
27
|
+
* through it when a manifest-declared level differs from the stored one.
|
|
28
|
+
* Manifest kinds inherit the binding from the SDK registry.
|
|
29
|
+
*/
|
|
30
|
+
updateVisibility?(controller: ControllerFn, input: UpdateVisibilityInput): Promise<Message>;
|
|
31
|
+
/**
|
|
32
|
+
* Drive the controller's `rename` RPC, the only door for a slug change
|
|
33
|
+
* (an update ignores the slug). Present exactly when the kind has the
|
|
34
|
+
* RPC; the apply core follows up through it when a manifest that carries
|
|
35
|
+
* the resource's id declares a different slug than the stored one.
|
|
36
|
+
*/
|
|
37
|
+
rename?(controller: ControllerFn, input: RenameInput): Promise<Message>;
|
|
38
|
+
/**
|
|
39
|
+
* Read the resource a reference names, as the caller: present on every
|
|
40
|
+
* kind with a rename, so a write the server refuses for naming a
|
|
41
|
+
* renamed-away slug can be answered with the slug it has now, when the
|
|
42
|
+
* caller may read it.
|
|
43
|
+
*/
|
|
44
|
+
getByReference?(controller: ControllerFn, ref: ApiResourceReference): Promise<Message>;
|
|
45
|
+
/**
|
|
46
|
+
* Drive the organization's `updatePolicies` RPC, the only door for a
|
|
47
|
+
* policy change (update and apply keep the stored policies). Present only
|
|
48
|
+
* on the organization; the apply core follows up through it when a
|
|
49
|
+
* manifest declares policies that differ from the stored ones.
|
|
50
|
+
*/
|
|
51
|
+
updatePolicies?(controller: ControllerFn, input: UpdateOrganizationPoliciesInput): Promise<Message>;
|
|
52
|
+
}
|
|
53
|
+
export declare const APPLY_HANDLERS: ReadonlyMap<ApiResourceKind, ApplyHandler>;
|
|
54
|
+
//# sourceMappingURL=handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/resources/apply/handlers.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EACV,oBAAoB,EACpB,WAAW,EACX,qBAAqB,EACtB,MAAM,oDAAoD,CAAC;AAG5D,OAAO,EAAE,eAAe,EAAE,MAAM,mFAAmF,CAAC;AAIpH,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,wDAAwD,CAAC;AAG9G,6EAA6E;AAC7E,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,SAAS,WAAW,EAAE,OAAO,EAAE,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC;AAErF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,yDAAyD;IACzD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,yEAAyE;IACzE,KAAK,CAAC,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACpE;;;;;;OAMG;IACH,gBAAgB,CAAC,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5F;;;;;OAKG;IACH,MAAM,CAAC,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACxE;;;;;OAKG;IACH,cAAc,CAAC,CAAC,UAAU,EAAE,YAAY,EAAE,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvF;;;;;OAKG;IACH,cAAc,CAAC,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,EAAE,+BAA+B,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACrG;AAwBD,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,eAAe,EAAE,YAAY,CAGpE,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Apply-handler registry for `apply -f` (file mode).
|
|
2
|
+
//
|
|
3
|
+
// The manifest kinds come from the SDK's manifest registry
|
|
4
|
+
// (`manifestKinds()` in @stigmer/client) — the one table binding a kind to its
|
|
5
|
+
// proto schema, its raw command-controller `apply` RPC, and its dependency
|
|
6
|
+
// apply order. The CLI consumes that table instead of keeping a copy: the
|
|
7
|
+
// copy this file used to carry drifted twice (ChannelApp was missing
|
|
8
|
+
// entirely — stigmer/stigmer#353 — and three kinds were absent from the
|
|
9
|
+
// local ordering map, so multi-document bundles applied on file-order luck).
|
|
10
|
+
//
|
|
11
|
+
// Both registries drive the *generated controllers* directly — not the
|
|
12
|
+
// high-level SDK `apply(input)` methods — because the SDK's `*Input`
|
|
13
|
+
// wrappers are lossy (they drop `metadata.id`, so an update would be
|
|
14
|
+
// misrouted as a create). The `apply` RPC takes the full resource message,
|
|
15
|
+
// preserving every field round-tripped from YAML.
|
|
16
|
+
//
|
|
17
|
+
// CLI_EXTRA_HANDLERS carries the kinds the CLI applies but the SDK's
|
|
18
|
+
// manifest engine deliberately does not treat as manifest kinds:
|
|
19
|
+
// Organization (not org-scoped — the bootstrap resource every other kind
|
|
20
|
+
// lives inside) and Session, a runtime kind rather than a blueprint.
|
|
21
|
+
// A kind added here must also declare Apply in the registry's verb matrix —
|
|
22
|
+
// the conformance test in registry/registry.test.ts enforces both
|
|
23
|
+
// directions, so an entry without a matrix line (or vice versa) fails CI.
|
|
24
|
+
import { SessionSchema } from "@stigmer/apis/ai/stigmer/agentic/session/v1/api_pb";
|
|
25
|
+
import { SessionCommandController } from "@stigmer/apis/ai/stigmer/agentic/session/v1/command_pb";
|
|
26
|
+
import { ApiResourceKind } from "@stigmer/apis/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
27
|
+
import { OrganizationSchema } from "@stigmer/apis/ai/stigmer/tenancy/organization/v1/api_pb";
|
|
28
|
+
import { OrganizationCommandController } from "@stigmer/apis/ai/stigmer/tenancy/organization/v1/command_pb";
|
|
29
|
+
import { OrganizationQueryController } from "@stigmer/apis/ai/stigmer/tenancy/organization/v1/query_pb";
|
|
30
|
+
import { manifestKinds } from "@stigmer/client";
|
|
31
|
+
// The SDK registry's applyOrder values end at schedule = 12; the extras slot
|
|
32
|
+
// outside that range so a future SDK kind never collides with them.
|
|
33
|
+
const CLI_EXTRA_HANDLERS = [
|
|
34
|
+
{
|
|
35
|
+
kind: ApiResourceKind.organization,
|
|
36
|
+
displayName: "Organization",
|
|
37
|
+
schema: OrganizationSchema,
|
|
38
|
+
applyOrder: 0,
|
|
39
|
+
apply: (c, m) => c(OrganizationCommandController).apply(m),
|
|
40
|
+
rename: (c, i) => c(OrganizationCommandController).rename(i),
|
|
41
|
+
getByReference: (c, ref) => c(OrganizationQueryController).get({ value: ref.slug }),
|
|
42
|
+
updatePolicies: (c, i) => c(OrganizationCommandController).updatePolicies(i),
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
kind: ApiResourceKind.session,
|
|
46
|
+
displayName: "Session",
|
|
47
|
+
schema: SessionSchema,
|
|
48
|
+
applyOrder: 14,
|
|
49
|
+
apply: (c, m) => c(SessionCommandController).apply(m),
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
export const APPLY_HANDLERS = new Map([
|
|
53
|
+
...manifestKinds().map((handler) => [handler.kind, handler]),
|
|
54
|
+
...CLI_EXTRA_HANDLERS.map((handler) => [handler.kind, handler]),
|
|
55
|
+
]);
|
|
56
|
+
//# sourceMappingURL=handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../src/resources/apply/handlers.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,EAAE;AACF,2DAA2D;AAC3D,+EAA+E;AAC/E,2EAA2E;AAC3E,0EAA0E;AAC1E,qEAAqE;AACrE,wEAAwE;AACxE,6EAA6E;AAC7E,EAAE;AACF,uEAAuE;AACvE,qEAAqE;AACrE,qEAAqE;AACrE,2EAA2E;AAC3E,kDAAkD;AAClD,EAAE;AACF,qEAAqE;AACrE,iEAAiE;AACjE,yEAAyE;AACzE,qEAAqE;AACrE,4EAA4E;AAC5E,kEAAkE;AAClE,0EAA0E;AAS1E,OAAO,EAAgB,aAAa,EAAE,MAAM,oDAAoD,CAAC;AACjG,OAAO,EAAE,wBAAwB,EAAE,MAAM,wDAAwD,CAAC;AAClG,OAAO,EAAE,eAAe,EAAE,MAAM,mFAAmF,CAAC;AACpH,OAAO,EAAqB,kBAAkB,EAAE,MAAM,yDAAyD,CAAC;AAChH,OAAO,EAAE,6BAA6B,EAAE,MAAM,6DAA6D,CAAC;AAC5G,OAAO,EAAE,2BAA2B,EAAE,MAAM,2DAA2D,CAAC;AAExG,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAmDhD,6EAA6E;AAC7E,oEAAoE;AACpE,MAAM,kBAAkB,GAA4B;IAClD;QACE,IAAI,EAAE,eAAe,CAAC,YAAY;QAClC,WAAW,EAAE,cAAc;QAC3B,MAA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over the link. Mirrors the SDK's SharingAudience. */
|
|
4
|
+
export type LinkAudience = "public" | "org";
|
|
5
|
+
/** Inputs for {@link linkAgent} beyond the reference itself. */
|
|
6
|
+
export interface LinkAgentOptions {
|
|
7
|
+
/** Desired link state: `true` to turn it on, `false` to turn it off. */
|
|
8
|
+
readonly enabled: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Desired audience. Omitted means "keep the link's current audience" —
|
|
11
|
+
* a plain toggle must never flip an org-members-only link back to
|
|
12
|
+
* public (or vice versa).
|
|
13
|
+
*/
|
|
14
|
+
readonly audience?: LinkAudience;
|
|
15
|
+
/**
|
|
16
|
+
* Rotate the link token: the server generates a fresh `?k=` secret and
|
|
17
|
+
* the current link (tokened or plain) stops working immediately. The
|
|
18
|
+
* token is server-owned status — never part of the spec this module
|
|
19
|
+
* merges.
|
|
20
|
+
*/
|
|
21
|
+
readonly resetLink?: boolean;
|
|
22
|
+
/** The app origin serving the hosted chat page and `embed.js`. */
|
|
23
|
+
readonly appOrigin: string;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the CLI points at a local backend. Guest chat (the token mint
|
|
26
|
+
* behind the hosted page) is a Stigmer Cloud capability, so a local link
|
|
27
|
+
* gets a "won't serve visitors" warning alongside the result.
|
|
28
|
+
*/
|
|
29
|
+
readonly isLocal: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The chat link's slug (`--name`): which web channel of the agent to
|
|
32
|
+
* edit, and the slug a new one is created under. Omitted means the
|
|
33
|
+
* agent's canonical link, created as `<agent slug>-web`.
|
|
34
|
+
*/
|
|
35
|
+
readonly name?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Turn the referenced agent's chat link on or off and describe the
|
|
39
|
+
* outcome. Idempotent: when the link is already in the desired state, no
|
|
40
|
+
* write is issued (the link is still reported when it is on). When the
|
|
41
|
+
* agent has no link yet, turning it on creates one.
|
|
42
|
+
*/
|
|
43
|
+
export declare function linkAgent(client: Stigmer, ref: string, org: string, options: LinkAgentOptions): Promise<CommandResult>;
|
|
44
|
+
/**
|
|
45
|
+
* Turn the referenced channel (a `chn_…` id, `org/slug`, or bare slug
|
|
46
|
+
* against `org`) on or off, whatever its type, and describe the outcome.
|
|
47
|
+
* The write is the masked update of `spec.enabled` alone; a channel
|
|
48
|
+
* already in the state is reported without a write. Disabling pauses the
|
|
49
|
+
* channel: its configuration, credentials and install stay as stored.
|
|
50
|
+
*/
|
|
51
|
+
export declare function setChannelEnabled(client: Stigmer, ref: string, org: string, enabled: boolean): Promise<CommandResult>;
|
|
52
|
+
//# sourceMappingURL=channel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../src/resources/channel.ts"],"names":[],"mappings":"AAyCA,OAAO,EAOL,KAAK,OAAO,EACb,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAMnD,qEAAqE;AACrE,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE5C,gEAAgE;AAChE,MAAM,WAAW,gBAAgB;IAC/B,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,kEAAkE;IAClE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAKD;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,MAAM,EAAE,OAAO,EACf,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,aAAa,CAAC,CAuGxB;AAmRD;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,OAAO,EACf,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,aAAa,CAAC,CAsCxB"}
|