@grok/agent-sdk 0.0.0-stage → 0.2.27
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/AGENTS.md +336 -0
- package/CHANGELOG.md +3 -0
- package/LICENSE.md +3 -0
- package/README.md +106 -2
- package/dist/artifacts.d.ts +37 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/artifacts.js +52 -0
- package/dist/bin/agent-sdk.js +2 -0
- package/dist/bin/agent-serve.d.ts +20 -0
- package/dist/bin/agent-serve.d.ts.map +1 -0
- package/dist/bin/agent-serve.js +1703 -0
- package/dist/channels/bitbucket/api.d.ts +217 -0
- package/dist/channels/bitbucket/api.d.ts.map +1 -0
- package/dist/channels/bitbucket/api.js +648 -0
- package/dist/channels/bitbucket/binding.d.ts +75 -0
- package/dist/channels/bitbucket/binding.d.ts.map +1 -0
- package/dist/channels/bitbucket/binding.js +313 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts +47 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-channel.js +173 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts +73 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-webhook.js +399 -0
- package/dist/channels/bitbucket/checks.d.ts +67 -0
- package/dist/channels/bitbucket/checks.d.ts.map +1 -0
- package/dist/channels/bitbucket/checks.js +90 -0
- package/dist/channels/bitbucket/cursor-account.d.ts +37 -0
- package/dist/channels/bitbucket/cursor-account.d.ts.map +1 -0
- package/dist/channels/bitbucket/cursor-account.js +65 -0
- package/dist/channels/bitbucket/defaults.d.ts +26 -0
- package/dist/channels/bitbucket/defaults.d.ts.map +1 -0
- package/dist/channels/bitbucket/defaults.js +77 -0
- package/dist/channels/bitbucket/events.d.ts +22 -0
- package/dist/channels/bitbucket/events.d.ts.map +1 -0
- package/dist/channels/bitbucket/events.js +59 -0
- package/dist/channels/bitbucket/index.d.ts +38 -0
- package/dist/channels/bitbucket/index.d.ts.map +1 -0
- package/dist/channels/bitbucket/index.js +37 -0
- package/dist/channels/bitbucket/replay.d.ts +63 -0
- package/dist/channels/bitbucket/replay.d.ts.map +1 -0
- package/dist/channels/bitbucket/replay.js +326 -0
- package/dist/channels/bitbucket/state.d.ts +35 -0
- package/dist/channels/bitbucket/state.d.ts.map +1 -0
- package/dist/channels/bitbucket/state.js +30 -0
- package/dist/channels/bitbucket/types.d.ts +236 -0
- package/dist/channels/bitbucket/types.d.ts.map +1 -0
- package/dist/channels/bitbucket/types.js +1 -0
- package/dist/channels/change-monitors/change-monitors-channel.d.ts +5 -0
- package/dist/channels/change-monitors/change-monitors-channel.d.ts.map +1 -0
- package/dist/channels/change-monitors/change-monitors-channel.js +45 -0
- package/dist/channels/change-monitors/index.d.ts +4 -0
- package/dist/channels/change-monitors/index.d.ts.map +1 -0
- package/dist/channels/change-monitors/index.js +2 -0
- package/dist/channels/change-monitors/types.d.ts +42 -0
- package/dist/channels/change-monitors/types.d.ts.map +1 -0
- package/dist/channels/change-monitors/types.js +1 -0
- package/dist/channels/checks.d.ts +121 -0
- package/dist/channels/checks.d.ts.map +1 -0
- package/dist/channels/checks.js +76 -0
- package/dist/channels/deployments/deployments-channel.d.ts +95 -0
- package/dist/channels/deployments/deployments-channel.d.ts.map +1 -0
- package/dist/channels/deployments/deployments-channel.js +188 -0
- package/dist/channels/deployments/index.d.ts +25 -0
- package/dist/channels/deployments/index.d.ts.map +1 -0
- package/dist/channels/deployments/index.js +24 -0
- package/dist/channels/deployments/types.d.ts +83 -0
- package/dist/channels/deployments/types.d.ts.map +1 -0
- package/dist/channels/deployments/types.js +7 -0
- package/dist/channels/github/api.d.ts +133 -0
- package/dist/channels/github/api.d.ts.map +1 -0
- package/dist/channels/github/api.js +373 -0
- package/dist/channels/github/auth.d.ts +71 -0
- package/dist/channels/github/auth.d.ts.map +1 -0
- package/dist/channels/github/auth.js +247 -0
- package/dist/channels/github/binding.d.ts +86 -0
- package/dist/channels/github/binding.d.ts.map +1 -0
- package/dist/channels/github/binding.js +123 -0
- package/dist/channels/github/checks.d.ts +64 -0
- package/dist/channels/github/checks.d.ts.map +1 -0
- package/dist/channels/github/checks.js +93 -0
- package/dist/channels/github/cursor-account.d.ts +109 -0
- package/dist/channels/github/cursor-account.d.ts.map +1 -0
- package/dist/channels/github/cursor-account.js +206 -0
- package/dist/channels/github/defaults.d.ts +23 -0
- package/dist/channels/github/defaults.d.ts.map +1 -0
- package/dist/channels/github/defaults.js +132 -0
- package/dist/channels/github/events.d.ts +18 -0
- package/dist/channels/github/events.d.ts.map +1 -0
- package/dist/channels/github/events.js +56 -0
- package/dist/channels/github/forward.d.ts +139 -0
- package/dist/channels/github/forward.d.ts.map +1 -0
- package/dist/channels/github/forward.js +263 -0
- package/dist/channels/github/github-channel.d.ts +187 -0
- package/dist/channels/github/github-channel.d.ts.map +1 -0
- package/dist/channels/github/github-channel.js +2089 -0
- package/dist/channels/github/index.d.ts +64 -0
- package/dist/channels/github/index.d.ts.map +1 -0
- package/dist/channels/github/index.js +52 -0
- package/dist/channels/github/progress.d.ts +84 -0
- package/dist/channels/github/progress.d.ts.map +1 -0
- package/dist/channels/github/progress.js +235 -0
- package/dist/channels/github/replay.d.ts +115 -0
- package/dist/channels/github/replay.d.ts.map +1 -0
- package/dist/channels/github/replay.js +269 -0
- package/dist/channels/github/state.d.ts +47 -0
- package/dist/channels/github/state.d.ts.map +1 -0
- package/dist/channels/github/state.js +77 -0
- package/dist/channels/github/types.d.ts +515 -0
- package/dist/channels/github/types.d.ts.map +1 -0
- package/dist/channels/github/types.js +1 -0
- package/dist/channels/gitlab/api.d.ts +118 -0
- package/dist/channels/gitlab/api.d.ts.map +1 -0
- package/dist/channels/gitlab/api.js +220 -0
- package/dist/channels/gitlab/binding.d.ts +63 -0
- package/dist/channels/gitlab/binding.d.ts.map +1 -0
- package/dist/channels/gitlab/binding.js +166 -0
- package/dist/channels/gitlab/checks.d.ts +110 -0
- package/dist/channels/gitlab/checks.d.ts.map +1 -0
- package/dist/channels/gitlab/checks.js +121 -0
- package/dist/channels/gitlab/cursor-account.d.ts +36 -0
- package/dist/channels/gitlab/cursor-account.d.ts.map +1 -0
- package/dist/channels/gitlab/cursor-account.js +64 -0
- package/dist/channels/gitlab/defaults.d.ts +25 -0
- package/dist/channels/gitlab/defaults.d.ts.map +1 -0
- package/dist/channels/gitlab/defaults.js +61 -0
- package/dist/channels/gitlab/events.d.ts +12 -0
- package/dist/channels/gitlab/events.d.ts.map +1 -0
- package/dist/channels/gitlab/events.js +26 -0
- package/dist/channels/gitlab/gitlab-channel.d.ts +48 -0
- package/dist/channels/gitlab/gitlab-channel.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-channel.js +173 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts +54 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-webhook.js +421 -0
- package/dist/channels/gitlab/index.d.ts +35 -0
- package/dist/channels/gitlab/index.d.ts.map +1 -0
- package/dist/channels/gitlab/index.js +34 -0
- package/dist/channels/gitlab/replay.d.ts +105 -0
- package/dist/channels/gitlab/replay.d.ts.map +1 -0
- package/dist/channels/gitlab/replay.js +222 -0
- package/dist/channels/gitlab/state.d.ts +33 -0
- package/dist/channels/gitlab/state.d.ts.map +1 -0
- package/dist/channels/gitlab/state.js +31 -0
- package/dist/channels/gitlab/types.d.ts +222 -0
- package/dist/channels/gitlab/types.d.ts.map +1 -0
- package/dist/channels/gitlab/types.js +1 -0
- package/dist/channels/issues/index.d.ts +4 -0
- package/dist/channels/issues/index.d.ts.map +1 -0
- package/dist/channels/issues/index.js +2 -0
- package/dist/channels/issues/issues-channel.d.ts +5 -0
- package/dist/channels/issues/issues-channel.d.ts.map +1 -0
- package/dist/channels/issues/issues-channel.js +35 -0
- package/dist/channels/issues/types.d.ts +33 -0
- package/dist/channels/issues/types.d.ts.map +1 -0
- package/dist/channels/issues/types.js +1 -0
- package/dist/channels/origin/api.d.ts +157 -0
- package/dist/channels/origin/api.d.ts.map +1 -0
- package/dist/channels/origin/api.js +363 -0
- package/dist/channels/origin/binding.d.ts +57 -0
- package/dist/channels/origin/binding.d.ts.map +1 -0
- package/dist/channels/origin/binding.js +56 -0
- package/dist/channels/origin/checks.d.ts +119 -0
- package/dist/channels/origin/checks.d.ts.map +1 -0
- package/dist/channels/origin/checks.js +147 -0
- package/dist/channels/origin/cursor-account.d.ts +24 -0
- package/dist/channels/origin/cursor-account.d.ts.map +1 -0
- package/dist/channels/origin/cursor-account.js +35 -0
- package/dist/channels/origin/defaults.d.ts +43 -0
- package/dist/channels/origin/defaults.d.ts.map +1 -0
- package/dist/channels/origin/defaults.js +94 -0
- package/dist/channels/origin/events.d.ts +10 -0
- package/dist/channels/origin/events.d.ts.map +1 -0
- package/dist/channels/origin/events.js +25 -0
- package/dist/channels/origin/index.d.ts +45 -0
- package/dist/channels/origin/index.d.ts.map +1 -0
- package/dist/channels/origin/index.js +33 -0
- package/dist/channels/origin/origin-channel.d.ts +72 -0
- package/dist/channels/origin/origin-channel.d.ts.map +1 -0
- package/dist/channels/origin/origin-channel.js +628 -0
- package/dist/channels/origin/origin-webhook.d.ts +69 -0
- package/dist/channels/origin/origin-webhook.d.ts.map +1 -0
- package/dist/channels/origin/origin-webhook.js +213 -0
- package/dist/channels/origin/reactions.d.ts +56 -0
- package/dist/channels/origin/reactions.d.ts.map +1 -0
- package/dist/channels/origin/reactions.js +46 -0
- package/dist/channels/origin/state.d.ts +32 -0
- package/dist/channels/origin/state.d.ts.map +1 -0
- package/dist/channels/origin/state.js +31 -0
- package/dist/channels/origin/types.d.ts +257 -0
- package/dist/channels/origin/types.d.ts.map +1 -0
- package/dist/channels/origin/types.js +1 -0
- package/dist/channels/pagerduty/api.d.ts +74 -0
- package/dist/channels/pagerduty/api.d.ts.map +1 -0
- package/dist/channels/pagerduty/api.js +101 -0
- package/dist/channels/pagerduty/defaults.d.ts +42 -0
- package/dist/channels/pagerduty/defaults.d.ts.map +1 -0
- package/dist/channels/pagerduty/defaults.js +132 -0
- package/dist/channels/pagerduty/events.d.ts +24 -0
- package/dist/channels/pagerduty/events.d.ts.map +1 -0
- package/dist/channels/pagerduty/events.js +38 -0
- package/dist/channels/pagerduty/index.d.ts +31 -0
- package/dist/channels/pagerduty/index.d.ts.map +1 -0
- package/dist/channels/pagerduty/index.js +30 -0
- package/dist/channels/pagerduty/pagerduty-channel.d.ts +64 -0
- package/dist/channels/pagerduty/pagerduty-channel.d.ts.map +1 -0
- package/dist/channels/pagerduty/pagerduty-channel.js +195 -0
- package/dist/channels/pagerduty/pagerduty-webhook.d.ts +70 -0
- package/dist/channels/pagerduty/pagerduty-webhook.d.ts.map +1 -0
- package/dist/channels/pagerduty/pagerduty-webhook.js +280 -0
- package/dist/channels/pagerduty/payload.d.ts +33 -0
- package/dist/channels/pagerduty/payload.d.ts.map +1 -0
- package/dist/channels/pagerduty/payload.js +150 -0
- package/dist/channels/pagerduty/replay.d.ts +35 -0
- package/dist/channels/pagerduty/replay.d.ts.map +1 -0
- package/dist/channels/pagerduty/replay.js +115 -0
- package/dist/channels/pagerduty/secrets.d.ts +16 -0
- package/dist/channels/pagerduty/secrets.d.ts.map +1 -0
- package/dist/channels/pagerduty/secrets.js +23 -0
- package/dist/channels/pagerduty/self-user.d.ts +51 -0
- package/dist/channels/pagerduty/self-user.d.ts.map +1 -0
- package/dist/channels/pagerduty/self-user.js +157 -0
- package/dist/channels/pagerduty/state.d.ts +31 -0
- package/dist/channels/pagerduty/state.d.ts.map +1 -0
- package/dist/channels/pagerduty/state.js +30 -0
- package/dist/channels/pagerduty/types.d.ts +217 -0
- package/dist/channels/pagerduty/types.d.ts.map +1 -0
- package/dist/channels/pagerduty/types.js +1 -0
- package/dist/channels/runs/index.d.ts +4 -0
- package/dist/channels/runs/index.d.ts.map +1 -0
- package/dist/channels/runs/index.js +2 -0
- package/dist/channels/runs/runs-channel.d.ts +5 -0
- package/dist/channels/runs/runs-channel.d.ts.map +1 -0
- package/dist/channels/runs/runs-channel.js +34 -0
- package/dist/channels/runs/types.d.ts +34 -0
- package/dist/channels/runs/types.d.ts.map +1 -0
- package/dist/channels/runs/types.js +1 -0
- package/dist/channels/slack/agentic-delivery.d.ts +24 -0
- package/dist/channels/slack/agentic-delivery.d.ts.map +1 -0
- package/dist/channels/slack/agentic-delivery.js +510 -0
- package/dist/channels/slack/agentic-posted.d.ts +30 -0
- package/dist/channels/slack/agentic-posted.d.ts.map +1 -0
- package/dist/channels/slack/agentic-posted.js +101 -0
- package/dist/channels/slack/agentic-signals.d.ts +43 -0
- package/dist/channels/slack/agentic-signals.d.ts.map +1 -0
- package/dist/channels/slack/agentic-signals.js +199 -0
- package/dist/channels/slack/api.d.ts +172 -0
- package/dist/channels/slack/api.d.ts.map +1 -0
- package/dist/channels/slack/api.js +642 -0
- package/dist/channels/slack/approvals.d.ts +48 -0
- package/dist/channels/slack/approvals.d.ts.map +1 -0
- package/dist/channels/slack/approvals.js +233 -0
- package/dist/channels/slack/assistant.d.ts +23 -0
- package/dist/channels/slack/assistant.d.ts.map +1 -0
- package/dist/channels/slack/assistant.js +57 -0
- package/dist/channels/slack/attachments.d.ts +85 -0
- package/dist/channels/slack/attachments.d.ts.map +1 -0
- package/dist/channels/slack/attachments.js +507 -0
- package/dist/channels/slack/auth.d.ts +46 -0
- package/dist/channels/slack/auth.d.ts.map +1 -0
- package/dist/channels/slack/auth.js +97 -0
- package/dist/channels/slack/blocks.d.ts +61 -0
- package/dist/channels/slack/blocks.d.ts.map +1 -0
- package/dist/channels/slack/blocks.js +90 -0
- package/dist/channels/slack/bot-mentions.d.ts +108 -0
- package/dist/channels/slack/bot-mentions.d.ts.map +1 -0
- package/dist/channels/slack/bot-mentions.js +243 -0
- package/dist/channels/slack/channel-watch.d.ts +80 -0
- package/dist/channels/slack/channel-watch.d.ts.map +1 -0
- package/dist/channels/slack/channel-watch.js +264 -0
- package/dist/channels/slack/cli-project.d.ts +19 -0
- package/dist/channels/slack/cli-project.d.ts.map +1 -0
- package/dist/channels/slack/cli-project.js +203 -0
- package/dist/channels/slack/code-fences.d.ts +17 -0
- package/dist/channels/slack/code-fences.d.ts.map +1 -0
- package/dist/channels/slack/code-fences.js +164 -0
- package/dist/channels/slack/constants.d.ts +27 -0
- package/dist/channels/slack/constants.d.ts.map +1 -0
- package/dist/channels/slack/constants.js +37 -0
- package/dist/channels/slack/credentials.d.ts +35 -0
- package/dist/channels/slack/credentials.d.ts.map +1 -0
- package/dist/channels/slack/credentials.js +73 -0
- package/dist/channels/slack/defaults.d.ts +50 -0
- package/dist/channels/slack/defaults.d.ts.map +1 -0
- package/dist/channels/slack/defaults.js +592 -0
- package/dist/channels/slack/dispatch.d.ts +153 -0
- package/dist/channels/slack/dispatch.d.ts.map +1 -0
- package/dist/channels/slack/dispatch.js +820 -0
- package/dist/channels/slack/doctor.d.ts +40 -0
- package/dist/channels/slack/doctor.d.ts.map +1 -0
- package/dist/channels/slack/doctor.js +277 -0
- package/dist/channels/slack/eval-directive.d.ts +59 -0
- package/dist/channels/slack/eval-directive.d.ts.map +1 -0
- package/dist/channels/slack/eval-directive.js +252 -0
- package/dist/channels/slack/event-id-dedupe.d.ts +10 -0
- package/dist/channels/slack/event-id-dedupe.d.ts.map +1 -0
- package/dist/channels/slack/event-id-dedupe.js +23 -0
- package/dist/channels/slack/external-policy.d.ts +28 -0
- package/dist/channels/slack/external-policy.d.ts.map +1 -0
- package/dist/channels/slack/external-policy.js +51 -0
- package/dist/channels/slack/footer.d.ts +33 -0
- package/dist/channels/slack/footer.d.ts.map +1 -0
- package/dist/channels/slack/footer.js +72 -0
- package/dist/channels/slack/inbound.d.ts +104 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -0
- package/dist/channels/slack/inbound.js +350 -0
- package/dist/channels/slack/index.d.ts +56 -0
- package/dist/channels/slack/index.d.ts.map +1 -0
- package/dist/channels/slack/index.js +55 -0
- package/dist/channels/slack/init.d.ts +41 -0
- package/dist/channels/slack/init.d.ts.map +1 -0
- package/dist/channels/slack/init.js +109 -0
- package/dist/channels/slack/interactive.d.ts +73 -0
- package/dist/channels/slack/interactive.d.ts.map +1 -0
- package/dist/channels/slack/interactive.js +309 -0
- package/dist/channels/slack/links.d.ts +10 -0
- package/dist/channels/slack/links.d.ts.map +1 -0
- package/dist/channels/slack/links.js +18 -0
- package/dist/channels/slack/live-delivery.d.ts +80 -0
- package/dist/channels/slack/live-delivery.d.ts.map +1 -0
- package/dist/channels/slack/live-delivery.js +386 -0
- package/dist/channels/slack/log.d.ts +25 -0
- package/dist/channels/slack/log.d.ts.map +1 -0
- package/dist/channels/slack/log.js +44 -0
- package/dist/channels/slack/manifest.d.ts +80 -0
- package/dist/channels/slack/manifest.d.ts.map +1 -0
- package/dist/channels/slack/manifest.js +186 -0
- package/dist/channels/slack/message-body.d.ts +13 -0
- package/dist/channels/slack/message-body.d.ts.map +1 -0
- package/dist/channels/slack/message-body.js +74 -0
- package/dist/channels/slack/nudge-carrier.d.ts +21 -0
- package/dist/channels/slack/nudge-carrier.d.ts.map +1 -0
- package/dist/channels/slack/nudge-carrier.js +201 -0
- package/dist/channels/slack/nudge-store.d.ts +77 -0
- package/dist/channels/slack/nudge-store.d.ts.map +1 -0
- package/dist/channels/slack/nudge-store.js +288 -0
- package/dist/channels/slack/paint-start.d.ts +22 -0
- package/dist/channels/slack/paint-start.d.ts.map +1 -0
- package/dist/channels/slack/paint-start.js +76 -0
- package/dist/channels/slack/placeholder.d.ts +62 -0
- package/dist/channels/slack/placeholder.d.ts.map +1 -0
- package/dist/channels/slack/placeholder.js +237 -0
- package/dist/channels/slack/pr-ref.d.ts +24 -0
- package/dist/channels/slack/pr-ref.d.ts.map +1 -0
- package/dist/channels/slack/pr-ref.js +55 -0
- package/dist/channels/slack/progress-delivery.d.ts +28 -0
- package/dist/channels/slack/progress-delivery.d.ts.map +1 -0
- package/dist/channels/slack/progress-delivery.js +109 -0
- package/dist/channels/slack/reasoning-card.d.ts +38 -0
- package/dist/channels/slack/reasoning-card.d.ts.map +1 -0
- package/dist/channels/slack/reasoning-card.js +90 -0
- package/dist/channels/slack/reasoning-chip.d.ts +8 -0
- package/dist/channels/slack/reasoning-chip.d.ts.map +1 -0
- package/dist/channels/slack/reasoning-chip.js +30 -0
- package/dist/channels/slack/recording-sink.d.ts +29 -0
- package/dist/channels/slack/recording-sink.d.ts.map +1 -0
- package/dist/channels/slack/recording-sink.js +128 -0
- package/dist/channels/slack/redact.d.ts +2 -0
- package/dist/channels/slack/redact.d.ts.map +1 -0
- package/dist/channels/slack/redact.js +5 -0
- package/dist/channels/slack/reply-options.d.ts +56 -0
- package/dist/channels/slack/reply-options.d.ts.map +1 -0
- package/dist/channels/slack/reply-options.js +218 -0
- package/dist/channels/slack/self-identity.d.ts +18 -0
- package/dist/channels/slack/self-identity.d.ts.map +1 -0
- package/dist/channels/slack/self-identity.js +49 -0
- package/dist/channels/slack/sender-name.d.ts +26 -0
- package/dist/channels/slack/sender-name.d.ts.map +1 -0
- package/dist/channels/slack/sender-name.js +79 -0
- package/dist/channels/slack/setup.d.ts +33 -0
- package/dist/channels/slack/setup.d.ts.map +1 -0
- package/dist/channels/slack/setup.js +99 -0
- package/dist/channels/slack/slack-channel.d.ts +46 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -0
- package/dist/channels/slack/slack-channel.js +683 -0
- package/dist/channels/slack/socket-mode.d.ts +26 -0
- package/dist/channels/slack/socket-mode.d.ts.map +1 -0
- package/dist/channels/slack/socket-mode.js +100 -0
- package/dist/channels/slack/stop.d.ts +14 -0
- package/dist/channels/slack/stop.d.ts.map +1 -0
- package/dist/channels/slack/stop.js +22 -0
- package/dist/channels/slack/stream.d.ts +42 -0
- package/dist/channels/slack/stream.d.ts.map +1 -0
- package/dist/channels/slack/stream.js +30 -0
- package/dist/channels/slack/thread-context.d.ts +89 -0
- package/dist/channels/slack/thread-context.d.ts.map +1 -0
- package/dist/channels/slack/thread-context.js +459 -0
- package/dist/channels/slack/tool-approval-events.d.ts +38 -0
- package/dist/channels/slack/tool-approval-events.d.ts.map +1 -0
- package/dist/channels/slack/tool-approval-events.js +207 -0
- package/dist/channels/slack/tool-cards.d.ts +22 -0
- package/dist/channels/slack/tool-cards.d.ts.map +1 -0
- package/dist/channels/slack/tool-cards.js +167 -0
- package/dist/channels/slack/tool-chip.d.ts +9 -0
- package/dist/channels/slack/tool-chip.d.ts.map +1 -0
- package/dist/channels/slack/tool-chip.js +22 -0
- package/dist/channels/slack/types.d.ts +811 -0
- package/dist/channels/slack/types.d.ts.map +1 -0
- package/dist/channels/slack/types.js +4 -0
- package/dist/channels/slack/upload.d.ts +13 -0
- package/dist/channels/slack/upload.d.ts.map +1 -0
- package/dist/channels/slack/upload.js +122 -0
- package/dist/channels/slack/user-info.d.ts +16 -0
- package/dist/channels/slack/user-info.d.ts.map +1 -0
- package/dist/channels/slack/user-info.js +58 -0
- package/dist/channels.d.ts +188 -0
- package/dist/channels.d.ts.map +1 -0
- package/dist/channels.js +421 -0
- package/dist/connections.d.ts +160 -0
- package/dist/connections.d.ts.map +1 -0
- package/dist/connections.js +185 -0
- package/dist/dashboard-session-url.d.ts +15 -0
- package/dist/dashboard-session-url.d.ts.map +1 -0
- package/dist/dashboard-session-url.js +24 -0
- package/dist/docs/404.html +24 -0
- package/dist/docs/architecture.svg +59 -0
- package/dist/docs/assets/app.wA5xBBcd.js +309 -0
- package/dist/docs/assets/building-with-agents.md.FZXrY8Nk.js +9 -0
- package/dist/docs/assets/building-with-agents.md.FZXrY8Nk.lean.js +1 -0
- package/dist/docs/assets/changelog.md.BvHRIiMH.js +1 -0
- package/dist/docs/assets/changelog.md.BvHRIiMH.lean.js +1 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.BoDEJQWv.js +1 -0
- package/dist/docs/assets/chunks/VPLocalSearchBox.C29HLCVL.js +9 -0
- package/dist/docs/assets/chunks/arc.BOaoYWmh.js +1 -0
- package/dist/docs/assets/chunks/architectureDiagram-Q4EWVU46.MfG0itQh.js +36 -0
- package/dist/docs/assets/chunks/baseUniq.CUeJciCF.js +1 -0
- package/dist/docs/assets/chunks/blockDiagram-DXYQGD6D.BrXMZRtK.js +132 -0
- package/dist/docs/assets/chunks/c4Diagram-AHTNJAMY.DfkDHeB9.js +10 -0
- package/dist/docs/assets/chunks/channel.D2BTz0L-.js +1 -0
- package/dist/docs/assets/chunks/chunk-4BX2VUAB.xKz8CiXK.js +1 -0
- package/dist/docs/assets/chunks/chunk-4TB4RGXK.kkfBh4zk.js +206 -0
- package/dist/docs/assets/chunks/chunk-55IACEB6.BClJGb94.js +1 -0
- package/dist/docs/assets/chunks/chunk-EDXVE4YY.P9BpQ9L3.js +1 -0
- package/dist/docs/assets/chunks/chunk-FMBD7UC4.R4iYi58S.js +15 -0
- package/dist/docs/assets/chunks/chunk-OYMX7WX6.Cpn8L1dw.js +231 -0
- package/dist/docs/assets/chunks/chunk-QZHKN3VN.BLftECqU.js +1 -0
- package/dist/docs/assets/chunks/chunk-YZCP3GAM.BWDV1AYt.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DqByliAC.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DqByliAC.js +1 -0
- package/dist/docs/assets/chunks/clone.CldT1lbQ.js +1 -0
- package/dist/docs/assets/chunks/cose-bilkent-S5V4N54A.DGpAcJ55.js +1 -0
- package/dist/docs/assets/chunks/cytoscape.esm.BQk4lpUV.js +331 -0
- package/dist/docs/assets/chunks/dagre-KV5264BT.BBXxGEaD.js +4 -0
- package/dist/docs/assets/chunks/defaultLocale.C4B-KCzX.js +1 -0
- package/dist/docs/assets/chunks/diagram-5BDNPKRD.EKqOwmK2.js +10 -0
- package/dist/docs/assets/chunks/diagram-G4DWMVQ6.CB8pdkoZ.js +24 -0
- package/dist/docs/assets/chunks/diagram-MMDJMWI5.aHh4WGg9.js +43 -0
- package/dist/docs/assets/chunks/diagram-TYMM5635.YIsbRH20.js +24 -0
- package/dist/docs/assets/chunks/erDiagram-SMLLAGMA.B3bTCW_e.js +85 -0
- package/dist/docs/assets/chunks/flowDiagram-DWJPFMVM.M81hXIXZ.js +162 -0
- package/dist/docs/assets/chunks/framework.BNw1pucY.js +19 -0
- package/dist/docs/assets/chunks/ganttDiagram-T4ZO3ILL.BKg7WY--.js +292 -0
- package/dist/docs/assets/chunks/gitGraphDiagram-UUTBAWPF.CLEMZgO3.js +106 -0
- package/dist/docs/assets/chunks/graph.DS38W_Q-.js +1 -0
- package/dist/docs/assets/chunks/infoDiagram-42DDH7IO.BTiWTi82.js +2 -0
- package/dist/docs/assets/chunks/init.Gi6I4Gst.js +1 -0
- package/dist/docs/assets/chunks/ishikawaDiagram-UXIWVN3A.DcqY_KQL.js +70 -0
- package/dist/docs/assets/chunks/journeyDiagram-VCZTEJTY.0lQNZ40U.js +139 -0
- package/dist/docs/assets/chunks/kanban-definition-6JOO6SKY.L5sKlf7X.js +89 -0
- package/dist/docs/assets/chunks/katex.DkKDou_j.js +257 -0
- package/dist/docs/assets/chunks/layout.7u4gFhQa.js +1 -0
- package/dist/docs/assets/chunks/linear.D5v33SOb.js +1 -0
- package/dist/docs/assets/chunks/min.Dc9uCxf9.js +1 -0
- package/dist/docs/assets/chunks/mindmap-definition-QFDTVHPH.B56nGoB_.js +96 -0
- package/dist/docs/assets/chunks/ordinal.DBvzRdQf.js +1 -0
- package/dist/docs/assets/chunks/pieDiagram-DEJITSTG.Cba8e8lS.js +30 -0
- package/dist/docs/assets/chunks/quadrantDiagram-34T5L4WZ.2YjBycHF.js +7 -0
- package/dist/docs/assets/chunks/requirementDiagram-MS252O5E.D4P5RqVI.js +84 -0
- package/dist/docs/assets/chunks/sankeyDiagram-XADWPNL6.C0Hn8NUm.js +10 -0
- package/dist/docs/assets/chunks/sequenceDiagram-FGHM5R23.BZm7EaoT.js +157 -0
- package/dist/docs/assets/chunks/stateDiagram-FHFEXIEX.DcR4f3X2.js +1 -0
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.Bb4oMe0P.js +1 -0
- package/dist/docs/assets/chunks/theme.DvfKzyXq.js +2 -0
- package/dist/docs/assets/chunks/timeline-definition-GMOUNBTQ.CgDh96vg.js +120 -0
- package/dist/docs/assets/chunks/vennDiagram-DHZGUBPP.B4fagbC8.js +34 -0
- package/dist/docs/assets/chunks/virtual_mermaid-config.DDnGl6nM.js +1 -0
- package/dist/docs/assets/chunks/wardley-RL74JXVD.Ck68omim.js +162 -0
- package/dist/docs/assets/chunks/wardleyDiagram-NUSXRM2D.DBUg0bvz.js +20 -0
- package/dist/docs/assets/chunks/xychartDiagram-5P7HB3ND.DnKSGQE1.js +7 -0
- package/dist/docs/assets/deployment.md.3MMWuPeV.js +31 -0
- package/dist/docs/assets/deployment.md.3MMWuPeV.lean.js +1 -0
- package/dist/docs/assets/evals.md.CHR34K1Y.js +68 -0
- package/dist/docs/assets/evals.md.CHR34K1Y.lean.js +1 -0
- package/dist/docs/assets/guides_agent-to-agent.md.CwL5cwuE.js +42 -0
- package/dist/docs/assets/guides_agent-to-agent.md.CwL5cwuE.lean.js +1 -0
- package/dist/docs/assets/guides_bitbucket.md.CKUayYtD.js +145 -0
- package/dist/docs/assets/guides_bitbucket.md.CKUayYtD.lean.js +1 -0
- package/dist/docs/assets/guides_cloud-agents.md.BzbzcOyj.js +9 -0
- package/dist/docs/assets/guides_cloud-agents.md.BzbzcOyj.lean.js +1 -0
- package/dist/docs/assets/guides_convert-automation.md.DMEX9nF-.js +43 -0
- package/dist/docs/assets/guides_convert-automation.md.DMEX9nF-.lean.js +1 -0
- package/dist/docs/assets/guides_export-grokbot.md.qo5bxi4h.js +55 -0
- package/dist/docs/assets/guides_export-grokbot.md.qo5bxi4h.lean.js +1 -0
- package/dist/docs/assets/guides_github.md.TuNiZAOQ.js +162 -0
- package/dist/docs/assets/guides_github.md.TuNiZAOQ.lean.js +1 -0
- package/dist/docs/assets/guides_gitlab.md.CtNI4fSH.js +153 -0
- package/dist/docs/assets/guides_gitlab.md.CtNI4fSH.lean.js +1 -0
- package/dist/docs/assets/guides_grokbot-agents.md.BwAykJ7U.js +15 -0
- package/dist/docs/assets/guides_grokbot-agents.md.BwAykJ7U.lean.js +1 -0
- package/dist/docs/assets/guides_hooks.md.B2XfGX50.js +54 -0
- package/dist/docs/assets/guides_hooks.md.B2XfGX50.lean.js +1 -0
- package/dist/docs/assets/guides_improve.md.CZKVt1cT.js +21 -0
- package/dist/docs/assets/guides_improve.md.CZKVt1cT.lean.js +1 -0
- package/dist/docs/assets/guides_jev.md.D7XH4JH3.js +151 -0
- package/dist/docs/assets/guides_jev.md.D7XH4JH3.lean.js +1 -0
- package/dist/docs/assets/guides_mcp-oauth.md.Cxq2TxBB.js +38 -0
- package/dist/docs/assets/guides_mcp-oauth.md.Cxq2TxBB.lean.js +1 -0
- package/dist/docs/assets/guides_migrate.md.CQlGaBKX.js +7 -0
- package/dist/docs/assets/guides_migrate.md.CQlGaBKX.lean.js +1 -0
- package/dist/docs/assets/guides_opentelemetry.md.D4wO7_8v.js +37 -0
- package/dist/docs/assets/guides_opentelemetry.md.D4wO7_8v.lean.js +1 -0
- package/dist/docs/assets/guides_pagerduty.md.BHXMcMtx.js +60 -0
- package/dist/docs/assets/guides_pagerduty.md.BHXMcMtx.lean.js +1 -0
- package/dist/docs/assets/guides_slack.md.ClIyi7FI.js +75 -0
- package/dist/docs/assets/guides_slack.md.ClIyi7FI.lean.js +1 -0
- package/dist/docs/assets/guides_webhooks.md.Cpdc3BDX.js +93 -0
- package/dist/docs/assets/guides_webhooks.md.Cpdc3BDX.lean.js +1 -0
- package/dist/docs/assets/hillclimbing.md.Dxvd-0gT.js +7 -0
- package/dist/docs/assets/hillclimbing.md.Dxvd-0gT.lean.js +1 -0
- package/dist/docs/assets/index.md.CAnsLl8D.js +27 -0
- package/dist/docs/assets/index.md.CAnsLl8D.lean.js +1 -0
- package/dist/docs/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
- package/dist/docs/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
- package/dist/docs/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
- package/dist/docs/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
- package/dist/docs/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
- package/dist/docs/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
- package/dist/docs/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
- package/dist/docs/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
- package/dist/docs/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
- package/dist/docs/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
- package/dist/docs/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
- package/dist/docs/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
- package/dist/docs/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
- package/dist/docs/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
- package/dist/docs/assets/quickstart.md.D8JDfkKO.js +170 -0
- package/dist/docs/assets/quickstart.md.D8JDfkKO.lean.js +1 -0
- package/dist/docs/assets/reference_agent-config.md.CZrbHOfT.js +38 -0
- package/dist/docs/assets/reference_agent-config.md.CZrbHOfT.lean.js +1 -0
- package/dist/docs/assets/reference_artifacts.md.DLV9MZES.js +18 -0
- package/dist/docs/assets/reference_artifacts.md.DLV9MZES.lean.js +1 -0
- package/dist/docs/assets/reference_channels.md.CNNIS6K7.js +22 -0
- package/dist/docs/assets/reference_channels.md.CNNIS6K7.lean.js +1 -0
- package/dist/docs/assets/reference_cli.md.1o_TqKdt.js +103 -0
- package/dist/docs/assets/reference_cli.md.1o_TqKdt.lean.js +1 -0
- package/dist/docs/assets/reference_connections.md.BJE2Zllp.js +66 -0
- package/dist/docs/assets/reference_connections.md.BJE2Zllp.lean.js +1 -0
- package/dist/docs/assets/reference_evals.md.Ccwp4x3o.js +56 -0
- package/dist/docs/assets/reference_evals.md.Ccwp4x3o.lean.js +1 -0
- package/dist/docs/assets/reference_extensions.md.DKxTuCIw.js +62 -0
- package/dist/docs/assets/reference_extensions.md.DKxTuCIw.lean.js +1 -0
- package/dist/docs/assets/reference_hooks.md.CROr0QgC.js +51 -0
- package/dist/docs/assets/reference_hooks.md.CROr0QgC.lean.js +1 -0
- package/dist/docs/assets/reference_http-api.md.Dji-DD_Z.js +11 -0
- package/dist/docs/assets/reference_http-api.md.Dji-DD_Z.lean.js +1 -0
- package/dist/docs/assets/reference_instructions.md.BYMVxAkw.js +14 -0
- package/dist/docs/assets/reference_instructions.md.BYMVxAkw.lean.js +1 -0
- package/dist/docs/assets/reference_memory.md.BwyJXYZe.js +4 -0
- package/dist/docs/assets/reference_memory.md.BwyJXYZe.lean.js +1 -0
- package/dist/docs/assets/reference_playground.md.q4MI-0td.js +1 -0
- package/dist/docs/assets/reference_playground.md.q4MI-0td.lean.js +1 -0
- package/dist/docs/assets/reference_project-layout.md.mFcS8yDD.js +25 -0
- package/dist/docs/assets/reference_project-layout.md.mFcS8yDD.lean.js +1 -0
- package/dist/docs/assets/reference_prompt.md.DqPh71XN.js +9 -0
- package/dist/docs/assets/reference_prompt.md.DqPh71XN.lean.js +1 -0
- package/dist/docs/assets/reference_schedules.md.BqWnJES4.js +47 -0
- package/dist/docs/assets/reference_schedules.md.BqWnJES4.lean.js +1 -0
- package/dist/docs/assets/reference_sessions.md.Bi6lHttM.js +22 -0
- package/dist/docs/assets/reference_sessions.md.Bi6lHttM.lean.js +1 -0
- package/dist/docs/assets/reference_skills.md.Ckddg6KX.js +15 -0
- package/dist/docs/assets/reference_skills.md.Ckddg6KX.lean.js +1 -0
- package/dist/docs/assets/reference_subagents.md.ChNGh6HK.js +10 -0
- package/dist/docs/assets/reference_subagents.md.ChNGh6HK.lean.js +1 -0
- package/dist/docs/assets/reference_tools.md.Bo0UfT0a.js +79 -0
- package/dist/docs/assets/reference_tools.md.Bo0UfT0a.lean.js +1 -0
- package/dist/docs/assets/style.B9o0luvp.css +1 -0
- package/dist/docs/assets/templates_agentic-owners.md.CTEnR0jp.js +13 -0
- package/dist/docs/assets/templates_agentic-owners.md.CTEnR0jp.lean.js +1 -0
- package/dist/docs/assets/templates_grokbot-agents.md.DgpPEs7B.js +5 -0
- package/dist/docs/assets/templates_grokbot-agents.md.DgpPEs7B.lean.js +1 -0
- package/dist/docs/assets/templates_security-reviewer.md.Gh6EF9Us.js +3 -0
- package/dist/docs/assets/templates_security-reviewer.md.Gh6EF9Us.lean.js +1 -0
- package/dist/docs/assets/templates_thermo-quality-review.md.B77UyTrX.js +3 -0
- package/dist/docs/assets/templates_thermo-quality-review.md.B77UyTrX.lean.js +1 -0
- package/dist/docs/assets/templates_thermo-review.md.DRJ7mC5U.js +3 -0
- package/dist/docs/assets/templates_thermo-review.md.DRJ7mC5U.lean.js +1 -0
- package/dist/docs/assets/templates_triage.md.CNN6b0JZ.js +9 -0
- package/dist/docs/assets/templates_triage.md.CNN6b0JZ.lean.js +1 -0
- package/dist/docs/assets/troubleshooting.md.DFnoTDlQ.js +1 -0
- package/dist/docs/assets/troubleshooting.md.DFnoTDlQ.lean.js +1 -0
- package/dist/docs/building-with-agents.html +68 -0
- package/dist/docs/building-with-agents.md +134 -0
- package/dist/docs/changelog.html +60 -0
- package/dist/docs/changelog.md +114 -0
- package/dist/docs/deployment.html +90 -0
- package/dist/docs/deployment.md +309 -0
- package/dist/docs/evals.html +127 -0
- package/dist/docs/evals.md +239 -0
- package/dist/docs/guides/agent-to-agent.html +101 -0
- package/dist/docs/guides/agent-to-agent.md +162 -0
- package/dist/docs/guides/bitbucket.html +204 -0
- package/dist/docs/guides/bitbucket.md +293 -0
- package/dist/docs/guides/cloud-agents.html +68 -0
- package/dist/docs/guides/cloud-agents.md +81 -0
- package/dist/docs/guides/convert-automation.html +102 -0
- package/dist/docs/guides/convert-automation.md +180 -0
- package/dist/docs/guides/export-grokbot.html +114 -0
- package/dist/docs/guides/export-grokbot.md +239 -0
- package/dist/docs/guides/github.html +221 -0
- package/dist/docs/guides/github.md +373 -0
- package/dist/docs/guides/gitlab.html +212 -0
- package/dist/docs/guides/gitlab.md +299 -0
- package/dist/docs/guides/grokbot-agents.html +74 -0
- package/dist/docs/guides/grokbot-agents.md +135 -0
- package/dist/docs/guides/hooks.html +113 -0
- package/dist/docs/guides/hooks.md +116 -0
- package/dist/docs/guides/improve.html +80 -0
- package/dist/docs/guides/improve.md +129 -0
- package/dist/docs/guides/jev.html +210 -0
- package/dist/docs/guides/jev.md +298 -0
- package/dist/docs/guides/mcp-oauth.html +97 -0
- package/dist/docs/guides/mcp-oauth.md +148 -0
- package/dist/docs/guides/migrate.html +66 -0
- package/dist/docs/guides/migrate.md +164 -0
- package/dist/docs/guides/opentelemetry.html +96 -0
- package/dist/docs/guides/opentelemetry.md +205 -0
- package/dist/docs/guides/pagerduty.html +119 -0
- package/dist/docs/guides/pagerduty.md +336 -0
- package/dist/docs/guides/slack.html +134 -0
- package/dist/docs/guides/slack.md +309 -0
- package/dist/docs/guides/webhooks.html +152 -0
- package/dist/docs/guides/webhooks.md +250 -0
- package/dist/docs/hashmap.json +1 -0
- package/dist/docs/hillclimbing.html +66 -0
- package/dist/docs/hillclimbing.md +134 -0
- package/dist/docs/index.html +86 -0
- package/dist/docs/index.md +110 -0
- package/dist/docs/llms-full.txt +10077 -0
- package/dist/docs/llms.txt +68 -0
- package/dist/docs/quickstart.html +229 -0
- package/dist/docs/quickstart.md +307 -0
- package/dist/docs/reference/agent-config.html +97 -0
- package/dist/docs/reference/agent-config.md +238 -0
- package/dist/docs/reference/artifacts.html +77 -0
- package/dist/docs/reference/artifacts.md +113 -0
- package/dist/docs/reference/channels.html +81 -0
- package/dist/docs/reference/channels.md +214 -0
- package/dist/docs/reference/cli.html +162 -0
- package/dist/docs/reference/cli.md +1098 -0
- package/dist/docs/reference/connections.html +125 -0
- package/dist/docs/reference/connections.md +307 -0
- package/dist/docs/reference/evals.html +115 -0
- package/dist/docs/reference/evals.md +294 -0
- package/dist/docs/reference/extensions.html +121 -0
- package/dist/docs/reference/extensions.md +209 -0
- package/dist/docs/reference/hooks.html +110 -0
- package/dist/docs/reference/hooks.md +197 -0
- package/dist/docs/reference/http-api.html +70 -0
- package/dist/docs/reference/http-api.md +221 -0
- package/dist/docs/reference/instructions.html +73 -0
- package/dist/docs/reference/instructions.md +64 -0
- package/dist/docs/reference/memory.html +63 -0
- package/dist/docs/reference/memory.md +114 -0
- package/dist/docs/reference/playground.html +60 -0
- package/dist/docs/reference/playground.md +36 -0
- package/dist/docs/reference/project-layout.html +84 -0
- package/dist/docs/reference/project-layout.md +117 -0
- package/dist/docs/reference/prompt.html +68 -0
- package/dist/docs/reference/prompt.md +47 -0
- package/dist/docs/reference/schedules.html +106 -0
- package/dist/docs/reference/schedules.md +190 -0
- package/dist/docs/reference/sessions.html +81 -0
- package/dist/docs/reference/sessions.md +200 -0
- package/dist/docs/reference/skills.html +74 -0
- package/dist/docs/reference/skills.md +72 -0
- package/dist/docs/reference/subagents.html +69 -0
- package/dist/docs/reference/subagents.md +61 -0
- package/dist/docs/reference/tools.html +138 -0
- package/dist/docs/reference/tools.md +306 -0
- package/dist/docs/templates/agentic-owners.html +72 -0
- package/dist/docs/templates/agentic-owners.md +126 -0
- package/dist/docs/templates/grokbot-agents.html +64 -0
- package/dist/docs/templates/grokbot-agents.md +55 -0
- package/dist/docs/templates/security-reviewer.html +62 -0
- package/dist/docs/templates/security-reviewer.md +81 -0
- package/dist/docs/templates/thermo-quality-review.html +62 -0
- package/dist/docs/templates/thermo-quality-review.md +75 -0
- package/dist/docs/templates/thermo-review.html +62 -0
- package/dist/docs/templates/thermo-review.md +75 -0
- package/dist/docs/templates/triage.html +68 -0
- package/dist/docs/templates/triage.md +101 -0
- package/dist/docs/troubleshooting.html +60 -0
- package/dist/docs/troubleshooting.md +149 -0
- package/dist/docs/vp-icons.css +0 -0
- package/dist/evals/assertions.d.ts +199 -0
- package/dist/evals/assertions.d.ts.map +1 -0
- package/dist/evals/assertions.js +447 -0
- package/dist/evals/expect.d.ts +95 -0
- package/dist/evals/expect.d.ts.map +1 -0
- package/dist/evals/expect.js +184 -0
- package/dist/evals/judge.d.ts +134 -0
- package/dist/evals/judge.d.ts.map +1 -0
- package/dist/evals/judge.js +221 -0
- package/dist/evals/loaders.d.ts +51 -0
- package/dist/evals/loaders.d.ts.map +1 -0
- package/dist/evals/loaders.js +107 -0
- package/dist/evals/matchers.d.ts +95 -0
- package/dist/evals/matchers.d.ts.map +1 -0
- package/dist/evals/matchers.js +141 -0
- package/dist/evals/reporters.d.ts +70 -0
- package/dist/evals/reporters.d.ts.map +1 -0
- package/dist/evals/reporters.js +196 -0
- package/dist/evals/results.d.ts +103 -0
- package/dist/evals/results.d.ts.map +1 -0
- package/dist/evals/results.js +27 -0
- package/dist/evals/run-facts.d.ts +77 -0
- package/dist/evals/run-facts.d.ts.map +1 -0
- package/dist/evals/run-facts.js +213 -0
- package/dist/evals.d.ts +446 -0
- package/dist/evals.d.ts.map +1 -0
- package/dist/evals.js +304 -0
- package/dist/executors.d.ts +11 -0
- package/dist/executors.d.ts.map +1 -0
- package/dist/executors.js +21 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +94 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/extension.js +104 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +118 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.js +290 -0
- package/dist/extensions/cursor-cloud-agents/lib/channels.d.ts +3 -0
- package/dist/extensions/cursor-cloud-agents/lib/channels.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/channels.js +11 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts +25 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.js +65 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts +5 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.js +4 -0
- package/dist/extensions/cursor-cloud-agents/lib/launch-agent.d.ts +47 -0
- package/dist/extensions/cursor-cloud-agents/lib/launch-agent.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/launch-agent.js +62 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts +17 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.js +60 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts +8 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.js +14 -0
- package/dist/extensions/cursor-cloud-agents/lib/watch.d.ts +17 -0
- package/dist/extensions/cursor-cloud-agents/lib/watch.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/watch.js +85 -0
- package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.d.ts +19 -0
- package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.js +60 -0
- package/dist/extensions/cursor-cloud-agents/skills/handoff.md +41 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.js +19 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.js +43 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.js +14 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +49 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.js +25 -0
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/reply.js +26 -0
- package/dist/extensions/cursor-grokbot-agents/extension.d.ts +77 -0
- package/dist/extensions/cursor-grokbot-agents/extension.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/extension.js +70 -0
- package/dist/extensions/cursor-grokbot-agents/lib/agents.d.ts +11 -0
- package/dist/extensions/cursor-grokbot-agents/lib/agents.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/agents.js +31 -0
- package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts +56 -0
- package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/backend.js +138 -0
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.d.ts +28 -0
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.js +46 -0
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts +53 -0
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.js +186 -0
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.js +15 -0
- package/dist/extensions/cursor-grokbot-agents/lib/lock.d.ts +12 -0
- package/dist/extensions/cursor-grokbot-agents/lib/lock.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/lock.js +24 -0
- package/dist/extensions/cursor-grokbot-agents/skills/consult.md +40 -0
- package/dist/extensions/cursor-grokbot-agents/tools/ask.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/ask.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/ask.js +26 -0
- package/dist/extensions/cursor-grokbot-agents/tools/check.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/check.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/check.js +21 -0
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.js +13 -0
- package/dist/extensions/cursor-grokbot-agents/tools/list.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/list.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/list.js +22 -0
- package/dist/extensions/improve/extension.d.ts +48 -0
- package/dist/extensions/improve/extension.d.ts.map +1 -0
- package/dist/extensions/improve/extension.js +43 -0
- package/dist/extensions/improve/skills/yourself.d.ts +4 -0
- package/dist/extensions/improve/skills/yourself.d.ts.map +1 -0
- package/dist/extensions/improve/skills/yourself.js +43 -0
- package/dist/extensions/jev/extension.d.ts +46 -0
- package/dist/extensions/jev/extension.d.ts.map +1 -0
- package/dist/extensions/jev/extension.js +56 -0
- package/dist/extensions/jev/lib/evaluate.d.ts +105 -0
- package/dist/extensions/jev/lib/evaluate.d.ts.map +1 -0
- package/dist/extensions/jev/lib/evaluate.js +154 -0
- package/dist/extensions/jev/skills/gated-write.md +25 -0
- package/dist/extensions/jev/skills/questions.md +33 -0
- package/dist/extensions/jev/tools/evaluate.d.ts +4 -0
- package/dist/extensions/jev/tools/evaluate.d.ts.map +1 -0
- package/dist/extensions/jev/tools/evaluate.js +72 -0
- package/dist/extensions/slack-communication/extension.d.ts +28 -0
- package/dist/extensions/slack-communication/extension.d.ts.map +1 -0
- package/dist/extensions/slack-communication/extension.js +32 -0
- package/dist/extensions/slack-communication/skills/slack-voice.d.ts +5 -0
- package/dist/extensions/slack-communication/skills/slack-voice.d.ts.map +1 -0
- package/dist/extensions/slack-communication/skills/slack-voice.js +52 -0
- package/dist/extensions/slack-communication/tools/delete-message.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/delete-message.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/delete-message.js +29 -0
- package/dist/extensions/slack-communication/tools/edit-message.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/edit-message.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/edit-message.js +34 -0
- package/dist/extensions/slack-communication/tools/post-card.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/post-card.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/post-card.js +25 -0
- package/dist/extensions/slack-communication/tools/post-file.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/post-file.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/post-file.js +75 -0
- package/dist/extensions/slack-communication/tools/post-update.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/post-update.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/post-update.js +33 -0
- package/dist/extensions/slack-communication/tools/react.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/react.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/react.js +27 -0
- package/dist/extensions/slack-communication/tools/set-status.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/set-status.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/set-status.js +18 -0
- package/dist/extensions.d.ts +87 -0
- package/dist/extensions.d.ts.map +1 -0
- package/dist/extensions.js +141 -0
- package/dist/files-backends/agent-store-presigned-url.d.ts +3 -0
- package/dist/files-backends/agent-store-presigned-url.d.ts.map +1 -0
- package/dist/files-backends/agent-store-presigned-url.js +223 -0
- package/dist/files-backends/cursor-hosted.d.ts +65 -0
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -0
- package/dist/files-backends/cursor-hosted.js +848 -0
- package/dist/files-backends/local-fs.d.ts +33 -0
- package/dist/files-backends/local-fs.d.ts.map +1 -0
- package/dist/files-backends/local-fs.js +133 -0
- package/dist/files.d.ts +203 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +129 -0
- package/dist/filesystem.d.ts +515 -0
- package/dist/filesystem.d.ts.map +1 -0
- package/dist/filesystem.js +1596 -0
- package/dist/hooks.d.ts +25 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +25 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +94 -0
- package/dist/internal/advertise-tools.d.ts +96 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -0
- package/dist/internal/advertise-tools.js +255 -0
- package/dist/internal/approval-gate.d.ts +35 -0
- package/dist/internal/approval-gate.d.ts.map +1 -0
- package/dist/internal/approval-gate.js +81 -0
- package/dist/internal/artifacts-store.d.ts +123 -0
- package/dist/internal/artifacts-store.d.ts.map +1 -0
- package/dist/internal/artifacts-store.js +657 -0
- package/dist/internal/as-of.d.ts +39 -0
- package/dist/internal/as-of.d.ts.map +1 -0
- package/dist/internal/as-of.js +207 -0
- package/dist/internal/auth.d.ts +12 -0
- package/dist/internal/auth.d.ts.map +1 -0
- package/dist/internal/auth.js +34 -0
- package/dist/internal/authored-alias-hooks.d.ts +43 -0
- package/dist/internal/authored-alias-hooks.d.ts.map +1 -0
- package/dist/internal/authored-alias-hooks.js +104 -0
- package/dist/internal/authored-loaders.d.ts +50 -0
- package/dist/internal/authored-loaders.d.ts.map +1 -0
- package/dist/internal/authored-loaders.js +183 -0
- package/dist/internal/bounded-int.d.ts +11 -0
- package/dist/internal/bounded-int.d.ts.map +1 -0
- package/dist/internal/bounded-int.js +12 -0
- package/dist/internal/bounded.d.ts +7 -0
- package/dist/internal/bounded.d.ts.map +1 -0
- package/dist/internal/bounded.js +21 -0
- package/dist/internal/brand.d.ts +6 -0
- package/dist/internal/brand.d.ts.map +1 -0
- package/dist/internal/brand.js +17 -0
- package/dist/internal/browser-origin-guard.d.ts +19 -0
- package/dist/internal/browser-origin-guard.d.ts.map +1 -0
- package/dist/internal/browser-origin-guard.js +51 -0
- package/dist/internal/builtin-tools/artifacts.d.ts +10 -0
- package/dist/internal/builtin-tools/artifacts.d.ts.map +1 -0
- package/dist/internal/builtin-tools/artifacts.js +87 -0
- package/dist/internal/builtin-tools/index.d.ts +17 -0
- package/dist/internal/builtin-tools/index.d.ts.map +1 -0
- package/dist/internal/builtin-tools/index.js +39 -0
- package/dist/internal/builtin-tools/reminders.d.ts +9 -0
- package/dist/internal/builtin-tools/reminders.d.ts.map +1 -0
- package/dist/internal/builtin-tools/reminders.js +115 -0
- package/dist/internal/channel-architecture.d.ts +21 -0
- package/dist/internal/channel-architecture.d.ts.map +1 -0
- package/dist/internal/channel-architecture.js +43 -0
- package/dist/internal/channel-dispatch.d.ts +43 -0
- package/dist/internal/channel-dispatch.d.ts.map +1 -0
- package/dist/internal/channel-dispatch.js +74 -0
- package/dist/internal/channel-route-dispatch.d.ts +13 -0
- package/dist/internal/channel-route-dispatch.d.ts.map +1 -0
- package/dist/internal/channel-route-dispatch.js +51 -0
- package/dist/internal/channel-state.d.ts +17 -0
- package/dist/internal/channel-state.d.ts.map +1 -0
- package/dist/internal/channel-state.js +69 -0
- package/dist/internal/chat-client.d.ts +45 -0
- package/dist/internal/chat-client.d.ts.map +1 -0
- package/dist/internal/chat-client.js +457 -0
- package/dist/internal/cli-ax.d.ts +227 -0
- package/dist/internal/cli-ax.d.ts.map +1 -0
- package/dist/internal/cli-ax.js +1825 -0
- package/dist/internal/cli-bitbucket.d.ts +33 -0
- package/dist/internal/cli-bitbucket.d.ts.map +1 -0
- package/dist/internal/cli-bitbucket.js +332 -0
- package/dist/internal/cli-convert-automation.d.ts +39 -0
- package/dist/internal/cli-convert-automation.d.ts.map +1 -0
- package/dist/internal/cli-convert-automation.js +257 -0
- package/dist/internal/cli-cursor.d.ts +38 -0
- package/dist/internal/cli-cursor.d.ts.map +1 -0
- package/dist/internal/cli-cursor.js +205 -0
- package/dist/internal/cli-deploy.d.ts +171 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -0
- package/dist/internal/cli-deploy.js +2072 -0
- package/dist/internal/cli-docs.d.ts +34 -0
- package/dist/internal/cli-docs.d.ts.map +1 -0
- package/dist/internal/cli-docs.js +156 -0
- package/dist/internal/cli-github.d.ts +47 -0
- package/dist/internal/cli-github.d.ts.map +1 -0
- package/dist/internal/cli-github.js +600 -0
- package/dist/internal/cli-gitlab.d.ts +37 -0
- package/dist/internal/cli-gitlab.d.ts.map +1 -0
- package/dist/internal/cli-gitlab.js +350 -0
- package/dist/internal/cli-images.d.ts +68 -0
- package/dist/internal/cli-images.d.ts.map +1 -0
- package/dist/internal/cli-images.js +536 -0
- package/dist/internal/cli-init-grokbot.d.ts +29 -0
- package/dist/internal/cli-init-grokbot.d.ts.map +1 -0
- package/dist/internal/cli-init-grokbot.js +181 -0
- package/dist/internal/cli-manifest.d.ts +19 -0
- package/dist/internal/cli-manifest.d.ts.map +1 -0
- package/dist/internal/cli-manifest.js +37 -0
- package/dist/internal/cli-mcp-oauth.d.ts +51 -0
- package/dist/internal/cli-mcp-oauth.d.ts.map +1 -0
- package/dist/internal/cli-mcp-oauth.js +300 -0
- package/dist/internal/cli-mcp.d.ts +75 -0
- package/dist/internal/cli-mcp.d.ts.map +1 -0
- package/dist/internal/cli-mcp.js +659 -0
- package/dist/internal/cli-migrate.d.ts +18 -0
- package/dist/internal/cli-migrate.d.ts.map +1 -0
- package/dist/internal/cli-migrate.js +351 -0
- package/dist/internal/cli-pagerduty.d.ts +32 -0
- package/dist/internal/cli-pagerduty.d.ts.map +1 -0
- package/dist/internal/cli-pagerduty.js +242 -0
- package/dist/internal/cli-skills.d.ts +21 -0
- package/dist/internal/cli-skills.d.ts.map +1 -0
- package/dist/internal/cli-skills.js +65 -0
- package/dist/internal/cli-slack-manual.d.ts +41 -0
- package/dist/internal/cli-slack-manual.d.ts.map +1 -0
- package/dist/internal/cli-slack-manual.js +296 -0
- package/dist/internal/cli-slack.d.ts +59 -0
- package/dist/internal/cli-slack.d.ts.map +1 -0
- package/dist/internal/cli-slack.js +708 -0
- package/dist/internal/cloud-merge.d.ts +25 -0
- package/dist/internal/cloud-merge.d.ts.map +1 -0
- package/dist/internal/cloud-merge.js +40 -0
- package/dist/internal/cloud-turn-usage.d.ts +34 -0
- package/dist/internal/cloud-turn-usage.d.ts.map +1 -0
- package/dist/internal/cloud-turn-usage.js +94 -0
- package/dist/internal/comment-safe.d.ts +8 -0
- package/dist/internal/comment-safe.d.ts.map +1 -0
- package/dist/internal/comment-safe.js +12 -0
- package/dist/internal/connection-env.d.ts +31 -0
- package/dist/internal/connection-env.d.ts.map +1 -0
- package/dist/internal/connection-env.js +83 -0
- package/dist/internal/continuation-channel.d.ts +48 -0
- package/dist/internal/continuation-channel.d.ts.map +1 -0
- package/dist/internal/continuation-channel.js +170 -0
- package/dist/internal/continuation-identity.d.ts +126 -0
- package/dist/internal/continuation-identity.d.ts.map +1 -0
- package/dist/internal/continuation-identity.js +897 -0
- package/dist/internal/continuation.d.ts +3 -0
- package/dist/internal/continuation.d.ts.map +1 -0
- package/dist/internal/continuation.js +1 -0
- package/dist/internal/conversation-mirror.d.ts +72 -0
- package/dist/internal/conversation-mirror.d.ts.map +1 -0
- package/dist/internal/conversation-mirror.js +401 -0
- package/dist/internal/conversation-pack.d.ts +29 -0
- package/dist/internal/conversation-pack.d.ts.map +1 -0
- package/dist/internal/conversation-pack.js +96 -0
- package/dist/internal/convert-automation/convert-workflow.d.ts +10 -0
- package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -0
- package/dist/internal/convert-automation/convert-workflow.js +976 -0
- package/dist/internal/convert-automation/types.d.ts +202 -0
- package/dist/internal/convert-automation/types.d.ts.map +1 -0
- package/dist/internal/convert-automation/types.js +13 -0
- package/dist/internal/convert-grokbot/answers.d.ts +127 -0
- package/dist/internal/convert-grokbot/answers.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/answers.js +445 -0
- package/dist/internal/convert-grokbot/bot.d.ts +50 -0
- package/dist/internal/convert-grokbot/bot.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/bot.js +72 -0
- package/dist/internal/convert-grokbot/checks.d.ts +26 -0
- package/dist/internal/convert-grokbot/checks.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/checks.js +170 -0
- package/dist/internal/convert-grokbot/convert.d.ts +60 -0
- package/dist/internal/convert-grokbot/convert.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/convert.js +470 -0
- package/dist/internal/convert-grokbot/handoff.d.ts +44 -0
- package/dist/internal/convert-grokbot/handoff.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/handoff.js +160 -0
- package/dist/internal/convert-grokbot/recipe.d.ts +61 -0
- package/dist/internal/convert-grokbot/recipe.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/recipe.js +94 -0
- package/dist/internal/convert-grokbot/routine.d.ts +51 -0
- package/dist/internal/convert-grokbot/routine.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/routine.js +128 -0
- package/dist/internal/convert-grokbot/slack.d.ts +28 -0
- package/dist/internal/convert-grokbot/slack.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/slack.js +50 -0
- package/dist/internal/cron.d.ts +17 -0
- package/dist/internal/cron.d.ts.map +1 -0
- package/dist/internal/cron.js +60 -0
- package/dist/internal/cursor/account-mcp.d.ts +135 -0
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -0
- package/dist/internal/cursor/account-mcp.js +513 -0
- package/dist/internal/cursor/backend-client.d.ts +229 -0
- package/dist/internal/cursor/backend-client.d.ts.map +1 -0
- package/dist/internal/cursor/backend-client.js +700 -0
- package/dist/internal/cursor/bound-secret-file.d.ts +56 -0
- package/dist/internal/cursor/bound-secret-file.d.ts.map +1 -0
- package/dist/internal/cursor/bound-secret-file.js +88 -0
- package/dist/internal/cursor/credentials.d.ts +196 -0
- package/dist/internal/cursor/credentials.d.ts.map +1 -0
- package/dist/internal/cursor/credentials.js +463 -0
- package/dist/internal/cursor/cursor-api-transport.d.ts +37 -0
- package/dist/internal/cursor/cursor-api-transport.d.ts.map +1 -0
- package/dist/internal/cursor/cursor-api-transport.js +40 -0
- package/dist/internal/cursor/github-credentials.d.ts +44 -0
- package/dist/internal/cursor/github-credentials.d.ts.map +1 -0
- package/dist/internal/cursor/github-credentials.js +174 -0
- package/dist/internal/cursor/hosted-bound-secrets.d.ts +45 -0
- package/dist/internal/cursor/hosted-bound-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-bound-secrets.js +64 -0
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts +30 -0
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-deployment-secrets.js +97 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts +39 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-store-secrets.js +84 -0
- package/dist/internal/cursor/session-token.d.ts +45 -0
- package/dist/internal/cursor/session-token.d.ts.map +1 -0
- package/dist/internal/cursor/session-token.js +85 -0
- package/dist/internal/cursor/store-api-client.d.ts +60 -0
- package/dist/internal/cursor/store-api-client.d.ts.map +1 -0
- package/dist/internal/cursor/store-api-client.js +189 -0
- package/dist/internal/cursor-account-mcp-auth.d.ts +70 -0
- package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -0
- package/dist/internal/cursor-account-mcp-auth.js +233 -0
- package/dist/internal/cursor-agent-template.d.ts +9 -0
- package/dist/internal/cursor-agent-template.d.ts.map +1 -0
- package/dist/internal/cursor-agent-template.js +43 -0
- package/dist/internal/cursor-deployment-relay.d.ts +95 -0
- package/dist/internal/cursor-deployment-relay.d.ts.map +1 -0
- package/dist/internal/cursor-deployment-relay.js +212 -0
- package/dist/internal/cursor-event-relay.d.ts +243 -0
- package/dist/internal/cursor-event-relay.d.ts.map +1 -0
- package/dist/internal/cursor-event-relay.js +430 -0
- package/dist/internal/cursor-relay-core.d.ts +160 -0
- package/dist/internal/cursor-relay-core.d.ts.map +1 -0
- package/dist/internal/cursor-relay-core.js +442 -0
- package/dist/internal/deferred-channel-session.d.ts +21 -0
- package/dist/internal/deferred-channel-session.d.ts.map +1 -0
- package/dist/internal/deferred-channel-session.js +55 -0
- package/dist/internal/deploy-client.d.ts +604 -0
- package/dist/internal/deploy-client.d.ts.map +1 -0
- package/dist/internal/deploy-client.js +1009 -0
- package/dist/internal/deploy-manifest.d.ts +179 -0
- package/dist/internal/deploy-manifest.d.ts.map +1 -0
- package/dist/internal/deploy-manifest.js +320 -0
- package/dist/internal/deploy-source.d.ts +38 -0
- package/dist/internal/deploy-source.d.ts.map +1 -0
- package/dist/internal/deploy-source.js +124 -0
- package/dist/internal/describe-error.d.ts +6 -0
- package/dist/internal/describe-error.d.ts.map +1 -0
- package/dist/internal/describe-error.js +31 -0
- package/dist/internal/dev-mode.d.ts +13 -0
- package/dist/internal/dev-mode.d.ts.map +1 -0
- package/dist/internal/dev-mode.js +17 -0
- package/dist/internal/discovery/agent-config.d.ts +55 -0
- package/dist/internal/discovery/agent-config.d.ts.map +1 -0
- package/dist/internal/discovery/agent-config.js +230 -0
- package/dist/internal/discovery/agent.d.ts +16 -0
- package/dist/internal/discovery/agent.d.ts.map +1 -0
- package/dist/internal/discovery/agent.js +347 -0
- package/dist/internal/discovery/channels.d.ts +10 -0
- package/dist/internal/discovery/channels.d.ts.map +1 -0
- package/dist/internal/discovery/channels.js +88 -0
- package/dist/internal/discovery/connections.d.ts +13 -0
- package/dist/internal/discovery/connections.d.ts.map +1 -0
- package/dist/internal/discovery/connections.js +430 -0
- package/dist/internal/discovery/context.d.ts +36 -0
- package/dist/internal/discovery/context.d.ts.map +1 -0
- package/dist/internal/discovery/context.js +84 -0
- package/dist/internal/discovery/cursor-plugin.d.ts +25 -0
- package/dist/internal/discovery/cursor-plugin.d.ts.map +1 -0
- package/dist/internal/discovery/cursor-plugin.js +513 -0
- package/dist/internal/discovery/extension-overlay.d.ts +31 -0
- package/dist/internal/discovery/extension-overlay.d.ts.map +1 -0
- package/dist/internal/discovery/extension-overlay.js +142 -0
- package/dist/internal/discovery/extensions.d.ts +28 -0
- package/dist/internal/discovery/extensions.d.ts.map +1 -0
- package/dist/internal/discovery/extensions.js +376 -0
- package/dist/internal/discovery/fs.d.ts +15 -0
- package/dist/internal/discovery/fs.d.ts.map +1 -0
- package/dist/internal/discovery/fs.js +92 -0
- package/dist/internal/discovery/hooks.d.ts +7 -0
- package/dist/internal/discovery/hooks.d.ts.map +1 -0
- package/dist/internal/discovery/hooks.js +50 -0
- package/dist/internal/discovery/info.d.ts +6 -0
- package/dist/internal/discovery/info.d.ts.map +1 -0
- package/dist/internal/discovery/info.js +166 -0
- package/dist/internal/discovery/instructions.d.ts +7 -0
- package/dist/internal/discovery/instructions.d.ts.map +1 -0
- package/dist/internal/discovery/instructions.js +79 -0
- package/dist/internal/discovery/instrumentation.d.ts +10 -0
- package/dist/internal/discovery/instrumentation.d.ts.map +1 -0
- package/dist/internal/discovery/instrumentation.js +29 -0
- package/dist/internal/discovery/modules.d.ts +20 -0
- package/dist/internal/discovery/modules.d.ts.map +1 -0
- package/dist/internal/discovery/modules.js +88 -0
- package/dist/internal/discovery/names.d.ts +14 -0
- package/dist/internal/discovery/names.d.ts.map +1 -0
- package/dist/internal/discovery/names.js +39 -0
- package/dist/internal/discovery/project-public.d.ts +16 -0
- package/dist/internal/discovery/project-public.d.ts.map +1 -0
- package/dist/internal/discovery/project-public.js +54 -0
- package/dist/internal/discovery/project.d.ts +57 -0
- package/dist/internal/discovery/project.d.ts.map +1 -0
- package/dist/internal/discovery/project.js +298 -0
- package/dist/internal/discovery/reminders.d.ts +7 -0
- package/dist/internal/discovery/reminders.d.ts.map +1 -0
- package/dist/internal/discovery/reminders.js +54 -0
- package/dist/internal/discovery/runtime.d.ts +34 -0
- package/dist/internal/discovery/runtime.d.ts.map +1 -0
- package/dist/internal/discovery/runtime.js +97 -0
- package/dist/internal/discovery/schedules.d.ts +7 -0
- package/dist/internal/discovery/schedules.d.ts.map +1 -0
- package/dist/internal/discovery/schedules.js +107 -0
- package/dist/internal/discovery/seed-files.d.ts +7 -0
- package/dist/internal/discovery/seed-files.d.ts.map +1 -0
- package/dist/internal/discovery/seed-files.js +30 -0
- package/dist/internal/discovery/services.d.ts +27 -0
- package/dist/internal/discovery/services.d.ts.map +1 -0
- package/dist/internal/discovery/services.js +122 -0
- package/dist/internal/discovery/skills.d.ts +11 -0
- package/dist/internal/discovery/skills.d.ts.map +1 -0
- package/dist/internal/discovery/skills.js +139 -0
- package/dist/internal/discovery/subagent.d.ts +16 -0
- package/dist/internal/discovery/subagent.d.ts.map +1 -0
- package/dist/internal/discovery/subagent.js +113 -0
- package/dist/internal/discovery/tools.d.ts +18 -0
- package/dist/internal/discovery/tools.d.ts.map +1 -0
- package/dist/internal/discovery/tools.js +144 -0
- package/dist/internal/discovery.d.ts +15 -0
- package/dist/internal/discovery.d.ts.map +1 -0
- package/dist/internal/discovery.js +13 -0
- package/dist/internal/distribution.d.ts +65 -0
- package/dist/internal/distribution.d.ts.map +1 -0
- package/dist/internal/distribution.js +102 -0
- package/dist/internal/docs-site.d.ts +38 -0
- package/dist/internal/docs-site.d.ts.map +1 -0
- package/dist/internal/docs-site.js +216 -0
- package/dist/internal/duration.d.ts +8 -0
- package/dist/internal/duration.d.ts.map +1 -0
- package/dist/internal/duration.js +35 -0
- package/dist/internal/env-file.d.ts +19 -0
- package/dist/internal/env-file.d.ts.map +1 -0
- package/dist/internal/env-file.js +74 -0
- package/dist/internal/estimate-cost.d.ts +55 -0
- package/dist/internal/estimate-cost.d.ts.map +1 -0
- package/dist/internal/estimate-cost.js +118 -0
- package/dist/internal/eval-judge-model.d.ts +64 -0
- package/dist/internal/eval-judge-model.d.ts.map +1 -0
- package/dist/internal/eval-judge-model.js +129 -0
- package/dist/internal/eval-run-store.d.ts +119 -0
- package/dist/internal/eval-run-store.d.ts.map +1 -0
- package/dist/internal/eval-run-store.js +479 -0
- package/dist/internal/eval-runner.d.ts +106 -0
- package/dist/internal/eval-runner.d.ts.map +1 -0
- package/dist/internal/eval-runner.js +616 -0
- package/dist/internal/eval-transport.d.ts +24 -0
- package/dist/internal/eval-transport.d.ts.map +1 -0
- package/dist/internal/eval-transport.js +22 -0
- package/dist/internal/evals-client.d.ts +104 -0
- package/dist/internal/evals-client.d.ts.map +1 -0
- package/dist/internal/evals-client.js +299 -0
- package/dist/internal/event-log.d.ts +94 -0
- package/dist/internal/event-log.d.ts.map +1 -0
- package/dist/internal/event-log.js +302 -0
- package/dist/internal/event-mapper.d.ts +165 -0
- package/dist/internal/event-mapper.d.ts.map +1 -0
- package/dist/internal/event-mapper.js +665 -0
- package/dist/internal/expected-delivery-failure.d.ts +3 -0
- package/dist/internal/expected-delivery-failure.d.ts.map +1 -0
- package/dist/internal/expected-delivery-failure.js +34 -0
- package/dist/internal/factory-resource-channel.d.ts +33 -0
- package/dist/internal/factory-resource-channel.d.ts.map +1 -0
- package/dist/internal/factory-resource-channel.js +63 -0
- package/dist/internal/filesystem/errors.d.ts +64 -0
- package/dist/internal/filesystem/errors.d.ts.map +1 -0
- package/dist/internal/filesystem/errors.js +172 -0
- package/dist/internal/filesystem/format.d.ts +28 -0
- package/dist/internal/filesystem/format.d.ts.map +1 -0
- package/dist/internal/filesystem/format.js +209 -0
- package/dist/internal/filesystem/merge.d.ts +34 -0
- package/dist/internal/filesystem/merge.d.ts.map +1 -0
- package/dist/internal/filesystem/merge.js +154 -0
- package/dist/internal/filesystem/nearest.d.ts +15 -0
- package/dist/internal/filesystem/nearest.d.ts.map +1 -0
- package/dist/internal/filesystem/nearest.js +90 -0
- package/dist/internal/filesystem/scratch.d.ts +60 -0
- package/dist/internal/filesystem/scratch.d.ts.map +1 -0
- package/dist/internal/filesystem/scratch.js +190 -0
- package/dist/internal/filesystem/sdk-schemas.d.ts +29 -0
- package/dist/internal/filesystem/sdk-schemas.d.ts.map +1 -0
- package/dist/internal/filesystem/sdk-schemas.js +154 -0
- package/dist/internal/filesystem/subagent-inherit.d.ts +39 -0
- package/dist/internal/filesystem/subagent-inherit.d.ts.map +1 -0
- package/dist/internal/filesystem/subagent-inherit.js +96 -0
- package/dist/internal/filesystem/tools.d.ts +48 -0
- package/dist/internal/filesystem/tools.d.ts.map +1 -0
- package/dist/internal/filesystem/tools.js +648 -0
- package/dist/internal/filesystem/walk.d.ts +77 -0
- package/dist/internal/filesystem/walk.d.ts.map +1 -0
- package/dist/internal/filesystem/walk.js +283 -0
- package/dist/internal/framework-file-storage.d.ts +51 -0
- package/dist/internal/framework-file-storage.d.ts.map +1 -0
- package/dist/internal/framework-file-storage.js +291 -0
- package/dist/internal/framework-storage-selection.d.ts +30 -0
- package/dist/internal/framework-storage-selection.d.ts.map +1 -0
- package/dist/internal/framework-storage-selection.js +84 -0
- package/dist/internal/frontmatter.d.ts +20 -0
- package/dist/internal/frontmatter.d.ts.map +1 -0
- package/dist/internal/frontmatter.js +85 -0
- package/dist/internal/github-fanout.d.ts +32 -0
- package/dist/internal/github-fanout.d.ts.map +1 -0
- package/dist/internal/github-fanout.js +106 -0
- package/dist/internal/guest-network.d.ts +98 -0
- package/dist/internal/guest-network.d.ts.map +1 -0
- package/dist/internal/guest-network.js +313 -0
- package/dist/internal/handleAgentServeTrigger.d.ts +98 -0
- package/dist/internal/handleAgentServeTrigger.d.ts.map +1 -0
- package/dist/internal/handleAgentServeTrigger.js +194 -0
- package/dist/internal/hmac-secret-values.d.ts +48 -0
- package/dist/internal/hmac-secret-values.d.ts.map +1 -0
- package/dist/internal/hmac-secret-values.js +68 -0
- package/dist/internal/host-files.d.ts +29 -0
- package/dist/internal/host-files.d.ts.map +1 -0
- package/dist/internal/host-files.js +256 -0
- package/dist/internal/host-kv.d.ts +21 -0
- package/dist/internal/host-kv.d.ts.map +1 -0
- package/dist/internal/host-kv.js +62 -0
- package/dist/internal/host-otel.d.ts +26 -0
- package/dist/internal/host-otel.d.ts.map +1 -0
- package/dist/internal/host-otel.js +184 -0
- package/dist/internal/host-platforms.d.ts +58 -0
- package/dist/internal/host-platforms.d.ts.map +1 -0
- package/dist/internal/host-platforms.js +118 -0
- package/dist/internal/hosted-admission-adapter.d.ts +36 -0
- package/dist/internal/hosted-admission-adapter.d.ts.map +1 -0
- package/dist/internal/hosted-admission-adapter.js +7 -0
- package/dist/internal/hosted-admission-context.d.ts +20 -0
- package/dist/internal/hosted-admission-context.d.ts.map +1 -0
- package/dist/internal/hosted-admission-context.js +31 -0
- package/dist/internal/hosted-catch-protocol.d.ts +54 -0
- package/dist/internal/hosted-catch-protocol.d.ts.map +1 -0
- package/dist/internal/hosted-catch-protocol.js +90 -0
- package/dist/internal/hosted-catch.d.ts +42 -0
- package/dist/internal/hosted-catch.d.ts.map +1 -0
- package/dist/internal/hosted-catch.js +154 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +275 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -0
- package/dist/internal/hosted-delivery-protocol.js +708 -0
- package/dist/internal/hosted-delivery.d.ts +135 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -0
- package/dist/internal/hosted-delivery.js +1098 -0
- package/dist/internal/hosted-eval-cases.d.ts +21 -0
- package/dist/internal/hosted-eval-cases.d.ts.map +1 -0
- package/dist/internal/hosted-eval-cases.js +162 -0
- package/dist/internal/hosted-execution-diag.d.ts +64 -0
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -0
- package/dist/internal/hosted-execution-diag.js +219 -0
- package/dist/internal/hosted-execution-flush.d.ts +65 -0
- package/dist/internal/hosted-execution-flush.d.ts.map +1 -0
- package/dist/internal/hosted-execution-flush.js +113 -0
- package/dist/internal/hosted-execution-latency.d.ts +80 -0
- package/dist/internal/hosted-execution-latency.d.ts.map +1 -0
- package/dist/internal/hosted-execution-latency.js +226 -0
- package/dist/internal/hosted-managed-automation.d.ts +30 -0
- package/dist/internal/hosted-managed-automation.d.ts.map +1 -0
- package/dist/internal/hosted-managed-automation.js +83 -0
- package/dist/internal/hosting.d.ts +62 -0
- package/dist/internal/hosting.d.ts.map +1 -0
- package/dist/internal/hosting.js +130 -0
- package/dist/internal/http-channel-define.d.ts +11 -0
- package/dist/internal/http-channel-define.d.ts.map +1 -0
- package/dist/internal/http-channel-define.js +21 -0
- package/dist/internal/http-channel.d.ts +54 -0
- package/dist/internal/http-channel.d.ts.map +1 -0
- package/dist/internal/http-channel.js +543 -0
- package/dist/internal/http-control-plane-session.d.ts +54 -0
- package/dist/internal/http-control-plane-session.d.ts.map +1 -0
- package/dist/internal/http-control-plane-session.js +163 -0
- package/dist/internal/ids.d.ts +27 -0
- package/dist/internal/ids.d.ts.map +1 -0
- package/dist/internal/ids.js +54 -0
- package/dist/internal/incoming-headers-to-fetch.d.ts +10 -0
- package/dist/internal/incoming-headers-to-fetch.d.ts.map +1 -0
- package/dist/internal/incoming-headers-to-fetch.js +40 -0
- package/dist/internal/init-interview.d.ts +64 -0
- package/dist/internal/init-interview.d.ts.map +1 -0
- package/dist/internal/init-interview.js +193 -0
- package/dist/internal/init-project.d.ts +188 -0
- package/dist/internal/init-project.d.ts.map +1 -0
- package/dist/internal/init-project.js +492 -0
- package/dist/internal/init-scaffold.d.ts +20 -0
- package/dist/internal/init-scaffold.d.ts.map +1 -0
- package/dist/internal/init-scaffold.js +194 -0
- package/dist/internal/inline-stdio-define-stub.d.ts +3 -0
- package/dist/internal/inline-stdio-define-stub.d.ts.map +1 -0
- package/dist/internal/inline-stdio-define-stub.js +4 -0
- package/dist/internal/inline-stdio-mcp.d.ts +34 -0
- package/dist/internal/inline-stdio-mcp.d.ts.map +1 -0
- package/dist/internal/inline-stdio-mcp.js +170 -0
- package/dist/internal/install-cursor-skills.d.ts +160 -0
- package/dist/internal/install-cursor-skills.d.ts.map +1 -0
- package/dist/internal/install-cursor-skills.js +464 -0
- package/dist/internal/interview/agent-questions.d.ts +19 -0
- package/dist/internal/interview/agent-questions.d.ts.map +1 -0
- package/dist/internal/interview/agent-questions.js +120 -0
- package/dist/internal/interview/question.d.ts +82 -0
- package/dist/internal/interview/question.d.ts.map +1 -0
- package/dist/internal/interview/question.js +198 -0
- package/dist/internal/is-record.d.ts +2 -0
- package/dist/internal/is-record.d.ts.map +1 -0
- package/dist/internal/is-record.js +3 -0
- package/dist/internal/json-schema.d.ts +25 -0
- package/dist/internal/json-schema.d.ts.map +1 -0
- package/dist/internal/json-schema.js +69 -0
- package/dist/internal/legacy-command-guard.d.ts +24 -0
- package/dist/internal/legacy-command-guard.d.ts.map +1 -0
- package/dist/internal/legacy-command-guard.js +47 -0
- package/dist/internal/listen-port.d.ts +22 -0
- package/dist/internal/listen-port.d.ts.map +1 -0
- package/dist/internal/listen-port.js +66 -0
- package/dist/internal/local-control-plane.d.ts +59 -0
- package/dist/internal/local-control-plane.d.ts.map +1 -0
- package/dist/internal/local-control-plane.js +341 -0
- package/dist/internal/local-env.d.ts +10 -0
- package/dist/internal/local-env.d.ts.map +1 -0
- package/dist/internal/local-env.js +55 -0
- package/dist/internal/local-ingress.d.ts +35 -0
- package/dist/internal/local-ingress.d.ts.map +1 -0
- package/dist/internal/local-ingress.js +50 -0
- package/dist/internal/log-ring.d.ts +23 -0
- package/dist/internal/log-ring.d.ts.map +1 -0
- package/dist/internal/log-ring.js +41 -0
- package/dist/internal/logs-client.d.ts +98 -0
- package/dist/internal/logs-client.d.ts.map +1 -0
- package/dist/internal/logs-client.js +418 -0
- package/dist/internal/map-pool.d.ts +11 -0
- package/dist/internal/map-pool.d.ts.map +1 -0
- package/dist/internal/map-pool.js +34 -0
- package/dist/internal/mcp-endpoint.d.ts +84 -0
- package/dist/internal/mcp-endpoint.d.ts.map +1 -0
- package/dist/internal/mcp-endpoint.js +566 -0
- package/dist/internal/mcp-host.d.ts +99 -0
- package/dist/internal/mcp-host.d.ts.map +1 -0
- package/dist/internal/mcp-host.js +422 -0
- package/dist/internal/mcp-oauth-on-demand.d.ts +68 -0
- package/dist/internal/mcp-oauth-on-demand.d.ts.map +1 -0
- package/dist/internal/mcp-oauth-on-demand.js +250 -0
- package/dist/internal/mcp-oauth-persist.d.ts +42 -0
- package/dist/internal/mcp-oauth-persist.d.ts.map +1 -0
- package/dist/internal/mcp-oauth-persist.js +76 -0
- package/dist/internal/mcp-oauth.d.ts +118 -0
- package/dist/internal/mcp-oauth.d.ts.map +1 -0
- package/dist/internal/mcp-oauth.js +393 -0
- package/dist/internal/memory-dir.d.ts +8 -0
- package/dist/internal/memory-dir.d.ts.map +1 -0
- package/dist/internal/memory-dir.js +7 -0
- package/dist/internal/model-config.d.ts +7 -0
- package/dist/internal/model-config.d.ts.map +1 -0
- package/dist/internal/model-config.js +67 -0
- package/dist/internal/named-webhook-secret.d.ts +39 -0
- package/dist/internal/named-webhook-secret.d.ts.map +1 -0
- package/dist/internal/named-webhook-secret.js +47 -0
- package/dist/internal/net.d.ts +5 -0
- package/dist/internal/net.d.ts.map +1 -0
- package/dist/internal/net.js +28 -0
- package/dist/internal/open-browser.d.ts +5 -0
- package/dist/internal/open-browser.d.ts.map +1 -0
- package/dist/internal/open-browser.js +33 -0
- package/dist/internal/otel/attrs.d.ts +7 -0
- package/dist/internal/otel/attrs.d.ts.map +1 -0
- package/dist/internal/otel/attrs.js +13 -0
- package/dist/internal/otel/collector.d.ts +50 -0
- package/dist/internal/otel/collector.d.ts.map +1 -0
- package/dist/internal/otel/collector.js +765 -0
- package/dist/internal/otel/computer-use-attrs.d.ts +18 -0
- package/dist/internal/otel/computer-use-attrs.d.ts.map +1 -0
- package/dist/internal/otel/computer-use-attrs.js +30 -0
- package/dist/internal/otel/config.d.ts +59 -0
- package/dist/internal/otel/config.d.ts.map +1 -0
- package/dist/internal/otel/config.js +236 -0
- package/dist/internal/otel/conversation-span-processor.d.ts +9 -0
- package/dist/internal/otel/conversation-span-processor.d.ts.map +1 -0
- package/dist/internal/otel/conversation-span-processor.js +34 -0
- package/dist/internal/otel/customer.d.ts +52 -0
- package/dist/internal/otel/customer.d.ts.map +1 -0
- package/dist/internal/otel/customer.js +727 -0
- package/dist/internal/otel/http.d.ts +13 -0
- package/dist/internal/otel/http.d.ts.map +1 -0
- package/dist/internal/otel/http.js +93 -0
- package/dist/internal/otel/mcp.d.ts +16 -0
- package/dist/internal/otel/mcp.d.ts.map +1 -0
- package/dist/internal/otel/mcp.js +46 -0
- package/dist/internal/otel/propagation.d.ts +6 -0
- package/dist/internal/otel/propagation.d.ts.map +1 -0
- package/dist/internal/otel/propagation.js +14 -0
- package/dist/internal/otel/runtime.d.ts +41 -0
- package/dist/internal/otel/runtime.d.ts.map +1 -0
- package/dist/internal/otel/runtime.js +92 -0
- package/dist/internal/otel/tool-error-class.d.ts +4 -0
- package/dist/internal/otel/tool-error-class.d.ts.map +1 -0
- package/dist/internal/otel/tool-error-class.js +36 -0
- package/dist/internal/otel-env.d.ts +6 -0
- package/dist/internal/otel-env.d.ts.map +1 -0
- package/dist/internal/otel-env.js +5 -0
- package/dist/internal/package-inline-stdio.d.ts +12 -0
- package/dist/internal/package-inline-stdio.d.ts.map +1 -0
- package/dist/internal/package-inline-stdio.js +107 -0
- package/dist/internal/peer-connections.d.ts +63 -0
- package/dist/internal/peer-connections.d.ts.map +1 -0
- package/dist/internal/peer-connections.js +115 -0
- package/dist/internal/persistent-stage-log-mirror.d.ts +57 -0
- package/dist/internal/persistent-stage-log-mirror.d.ts.map +1 -0
- package/dist/internal/persistent-stage-log-mirror.js +231 -0
- package/dist/internal/platform-schedule-sync.d.ts +17 -0
- package/dist/internal/platform-schedule-sync.d.ts.map +1 -0
- package/dist/internal/platform-schedule-sync.js +55 -0
- package/dist/internal/platform-timers.d.ts +42 -0
- package/dist/internal/platform-timers.d.ts.map +1 -0
- package/dist/internal/platform-timers.js +251 -0
- package/dist/internal/playground/static.d.ts +52 -0
- package/dist/internal/playground/static.d.ts.map +1 -0
- package/dist/internal/playground/static.js +230 -0
- package/dist/internal/playground/toolchain.d.ts +57 -0
- package/dist/internal/playground/toolchain.d.ts.map +1 -0
- package/dist/internal/playground/toolchain.js +213 -0
- package/dist/internal/playground-proxy.d.ts +69 -0
- package/dist/internal/playground-proxy.d.ts.map +1 -0
- package/dist/internal/playground-proxy.js +434 -0
- package/dist/internal/process-memory-telemetry.d.ts +89 -0
- package/dist/internal/process-memory-telemetry.d.ts.map +1 -0
- package/dist/internal/process-memory-telemetry.js +226 -0
- package/dist/internal/project-layout.d.ts +7 -0
- package/dist/internal/project-layout.d.ts.map +1 -0
- package/dist/internal/project-layout.js +24 -0
- package/dist/internal/prompt-context.d.ts +38 -0
- package/dist/internal/prompt-context.d.ts.map +1 -0
- package/dist/internal/prompt-context.js +86 -0
- package/dist/internal/reminder-control-plane-protocol.d.ts +196 -0
- package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -0
- package/dist/internal/reminder-control-plane-protocol.js +279 -0
- package/dist/internal/reminder-runner.d.ts +223 -0
- package/dist/internal/reminder-runner.d.ts.map +1 -0
- package/dist/internal/reminder-runner.js +1241 -0
- package/dist/internal/reminder-schedule.d.ts +26 -0
- package/dist/internal/reminder-schedule.d.ts.map +1 -0
- package/dist/internal/reminder-schedule.js +83 -0
- package/dist/internal/reminder-store.d.ts +78 -0
- package/dist/internal/reminder-store.d.ts.map +1 -0
- package/dist/internal/reminder-store.js +105 -0
- package/dist/internal/request-error-status.d.ts +14 -0
- package/dist/internal/request-error-status.d.ts.map +1 -0
- package/dist/internal/request-error-status.js +77 -0
- package/dist/internal/request-headers.d.ts +11 -0
- package/dist/internal/request-headers.d.ts.map +1 -0
- package/dist/internal/request-headers.js +14 -0
- package/dist/internal/resolve-prod-target.d.ts +76 -0
- package/dist/internal/resolve-prod-target.d.ts.map +1 -0
- package/dist/internal/resolve-prod-target.js +215 -0
- package/dist/internal/resolved-connections.d.ts +65 -0
- package/dist/internal/resolved-connections.d.ts.map +1 -0
- package/dist/internal/resolved-connections.js +108 -0
- package/dist/internal/router.d.ts +33 -0
- package/dist/internal/router.d.ts.map +1 -0
- package/dist/internal/router.js +93 -0
- package/dist/internal/run-client.d.ts +78 -0
- package/dist/internal/run-client.d.ts.map +1 -0
- package/dist/internal/run-client.js +369 -0
- package/dist/internal/runtime-dispatch-runner.d.ts +25 -0
- package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -0
- package/dist/internal/runtime-dispatch-runner.js +35 -0
- package/dist/internal/sanitize-mcp-tool-name.d.ts +20 -0
- package/dist/internal/sanitize-mcp-tool-name.d.ts.map +1 -0
- package/dist/internal/sanitize-mcp-tool-name.js +28 -0
- package/dist/internal/schedule-runner.d.ts +42 -0
- package/dist/internal/schedule-runner.d.ts.map +1 -0
- package/dist/internal/schedule-runner.js +157 -0
- package/dist/internal/scm/pr-url.d.ts +56 -0
- package/dist/internal/scm/pr-url.d.ts.map +1 -0
- package/dist/internal/scm/pr-url.js +153 -0
- package/dist/internal/sdk-runner.d.ts +204 -0
- package/dist/internal/sdk-runner.d.ts.map +1 -0
- package/dist/internal/sdk-runner.js +1006 -0
- package/dist/internal/sdk-subagent-inherit-support.d.ts +9 -0
- package/dist/internal/sdk-subagent-inherit-support.d.ts.map +1 -0
- package/dist/internal/sdk-subagent-inherit-support.js +89 -0
- package/dist/internal/secret-alternatives.d.ts +11 -0
- package/dist/internal/secret-alternatives.d.ts.map +1 -0
- package/dist/internal/secret-alternatives.js +13 -0
- package/dist/internal/serve-restart.d.ts +42 -0
- package/dist/internal/serve-restart.d.ts.map +1 -0
- package/dist/internal/serve-restart.js +72 -0
- package/dist/internal/server.d.ts +45 -0
- package/dist/internal/server.d.ts.map +1 -0
- package/dist/internal/server.js +2566 -0
- package/dist/internal/session-cost.d.ts +49 -0
- package/dist/internal/session-cost.d.ts.map +1 -0
- package/dist/internal/session-cost.js +147 -0
- package/dist/internal/session-engine.d.ts +955 -0
- package/dist/internal/session-engine.d.ts.map +1 -0
- package/dist/internal/session-engine.js +4880 -0
- package/dist/internal/session-links.d.ts +14 -0
- package/dist/internal/session-links.d.ts.map +1 -0
- package/dist/internal/session-links.js +64 -0
- package/dist/internal/session-live-publisher.d.ts +48 -0
- package/dist/internal/session-live-publisher.d.ts.map +1 -0
- package/dist/internal/session-live-publisher.js +415 -0
- package/dist/internal/session-run-log.d.ts +108 -0
- package/dist/internal/session-run-log.d.ts.map +1 -0
- package/dist/internal/session-run-log.js +398 -0
- package/dist/internal/session-store.d.ts +73 -0
- package/dist/internal/session-store.d.ts.map +1 -0
- package/dist/internal/session-store.js +279 -0
- package/dist/internal/session-urls.d.ts +10 -0
- package/dist/internal/session-urls.d.ts.map +1 -0
- package/dist/internal/session-urls.js +25 -0
- package/dist/internal/sessions-client.d.ts +63 -0
- package/dist/internal/sessions-client.d.ts.map +1 -0
- package/dist/internal/sessions-client.js +215 -0
- package/dist/internal/skill-catalog.d.ts +28 -0
- package/dist/internal/skill-catalog.d.ts.map +1 -0
- package/dist/internal/skill-catalog.js +36 -0
- package/dist/internal/skills-sync.d.ts +22 -0
- package/dist/internal/skills-sync.d.ts.map +1 -0
- package/dist/internal/skills-sync.js +40 -0
- package/dist/internal/slack-provision-client.d.ts +199 -0
- package/dist/internal/slack-provision-client.d.ts.map +1 -0
- package/dist/internal/slack-provision-client.js +320 -0
- package/dist/internal/slack-thread-key.d.ts +7 -0
- package/dist/internal/slack-thread-key.d.ts.map +1 -0
- package/dist/internal/slack-thread-key.js +10 -0
- package/dist/internal/sleep.d.ts +2 -0
- package/dist/internal/sleep.d.ts.map +1 -0
- package/dist/internal/sleep.js +3 -0
- package/dist/internal/slug.d.ts +12 -0
- package/dist/internal/slug.d.ts.map +1 -0
- package/dist/internal/slug.js +38 -0
- package/dist/internal/sqlite-experimental-warning.d.ts +2 -0
- package/dist/internal/sqlite-experimental-warning.d.ts.map +1 -0
- package/dist/internal/sqlite-experimental-warning.js +22 -0
- package/dist/internal/start-log-store.d.ts +53 -0
- package/dist/internal/start-log-store.d.ts.map +1 -0
- package/dist/internal/start-log-store.js +155 -0
- package/dist/internal/steering.d.ts +15 -0
- package/dist/internal/steering.d.ts.map +1 -0
- package/dist/internal/steering.js +17 -0
- package/dist/internal/storage-coordinator.d.ts +200 -0
- package/dist/internal/storage-coordinator.d.ts.map +1 -0
- package/dist/internal/storage-coordinator.js +747 -0
- package/dist/internal/storage-roles.d.ts +83 -0
- package/dist/internal/storage-roles.d.ts.map +1 -0
- package/dist/internal/storage-roles.js +24 -0
- package/dist/internal/storage.d.ts +2 -0
- package/dist/internal/storage.d.ts.map +1 -0
- package/dist/internal/storage.js +1 -0
- package/dist/internal/store-api-protocol.d.ts +164 -0
- package/dist/internal/store-api-protocol.d.ts.map +1 -0
- package/dist/internal/store-api-protocol.js +145 -0
- package/dist/internal/store-mirror.d.ts +28 -0
- package/dist/internal/store-mirror.d.ts.map +1 -0
- package/dist/internal/store-mirror.js +54 -0
- package/dist/internal/stream-progress.d.ts +14 -0
- package/dist/internal/stream-progress.d.ts.map +1 -0
- package/dist/internal/stream-progress.js +231 -0
- package/dist/internal/terminal-style.d.ts +40 -0
- package/dist/internal/terminal-style.d.ts.map +1 -0
- package/dist/internal/terminal-style.js +93 -0
- package/dist/internal/testing/conversation-identity-vectors.d.ts +53 -0
- package/dist/internal/testing/conversation-identity-vectors.d.ts.map +1 -0
- package/dist/internal/testing/conversation-identity-vectors.js +170 -0
- package/dist/internal/testing/factory-resource-fixtures.d.ts +64 -0
- package/dist/internal/testing/factory-resource-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/factory-resource-fixtures.js +55 -0
- package/dist/internal/testing/hmac-secret-vectors.d.ts +38 -0
- package/dist/internal/testing/hmac-secret-vectors.d.ts.map +1 -0
- package/dist/internal/testing/hmac-secret-vectors.js +89 -0
- package/dist/internal/testing/pagerduty-continuation-fixtures.d.ts +42 -0
- package/dist/internal/testing/pagerduty-continuation-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/pagerduty-continuation-fixtures.js +175 -0
- package/dist/internal/testing/scm-continuation-fixtures.d.ts +33 -0
- package/dist/internal/testing/scm-continuation-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/scm-continuation-fixtures.js +257 -0
- package/dist/internal/testing/slack-continuation-fixtures.d.ts +26 -0
- package/dist/internal/testing/slack-continuation-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/slack-continuation-fixtures.js +136 -0
- package/dist/internal/tool-call-retry.d.ts +87 -0
- package/dist/internal/tool-call-retry.d.ts.map +1 -0
- package/dist/internal/tool-call-retry.js +387 -0
- package/dist/internal/tool-catalog.d.ts +31 -0
- package/dist/internal/tool-catalog.d.ts.map +1 -0
- package/dist/internal/tool-catalog.js +76 -0
- package/dist/internal/tool-policy.d.ts +110 -0
- package/dist/internal/tool-policy.d.ts.map +1 -0
- package/dist/internal/tool-policy.js +138 -0
- package/dist/internal/tool-result.d.ts +20 -0
- package/dist/internal/tool-result.d.ts.map +1 -0
- package/dist/internal/tool-result.js +50 -0
- package/dist/internal/trajectory.d.ts +68 -0
- package/dist/internal/trajectory.d.ts.map +1 -0
- package/dist/internal/trajectory.js +336 -0
- package/dist/internal/turn-governor.d.ts +54 -0
- package/dist/internal/turn-governor.d.ts.map +1 -0
- package/dist/internal/turn-governor.js +108 -0
- package/dist/internal/turn-lease-store.d.ts +51 -0
- package/dist/internal/turn-lease-store.d.ts.map +1 -0
- package/dist/internal/turn-lease-store.js +172 -0
- package/dist/internal/turn-outbox.d.ts +24 -0
- package/dist/internal/turn-outbox.d.ts.map +1 -0
- package/dist/internal/turn-outbox.js +65 -0
- package/dist/internal/update-check.d.ts +93 -0
- package/dist/internal/update-check.d.ts.map +1 -0
- package/dist/internal/update-check.js +401 -0
- package/dist/internal/v2-hosting.d.ts +34 -0
- package/dist/internal/v2-hosting.d.ts.map +1 -0
- package/dist/internal/v2-hosting.js +35 -0
- package/dist/internal/workspace-sync.d.ts +44 -0
- package/dist/internal/workspace-sync.d.ts.map +1 -0
- package/dist/internal/workspace-sync.js +85 -0
- package/dist/internal/workspace.d.ts +155 -0
- package/dist/internal/workspace.d.ts.map +1 -0
- package/dist/internal/workspace.js +468 -0
- package/dist/internal/zod-schema.d.ts +14 -0
- package/dist/internal/zod-schema.d.ts.map +1 -0
- package/dist/internal/zod-schema.js +22 -0
- package/dist/internal/zod3-datetime.d.ts +12 -0
- package/dist/internal/zod3-datetime.d.ts.map +1 -0
- package/dist/internal/zod3-datetime.js +17 -0
- package/dist/kv/memory-kv.d.ts +24 -0
- package/dist/kv/memory-kv.d.ts.map +1 -0
- package/dist/kv/memory-kv.js +80 -0
- package/dist/kv.d.ts +18 -0
- package/dist/kv.d.ts.map +1 -0
- package/dist/kv.js +16 -0
- package/dist/memory.d.ts +113 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +312 -0
- package/dist/otel-public.d.ts +6 -0
- package/dist/otel-public.d.ts.map +1 -0
- package/dist/otel-public.js +5 -0
- package/dist/otel.d.ts +31 -0
- package/dist/otel.d.ts.map +1 -0
- package/dist/otel.js +146 -0
- package/dist/playground/assets/cursor-icons-16-DfKNljMZ.woff2 +0 -0
- package/dist/playground/assets/index-B3_YohwW.js +62 -0
- package/dist/playground/assets/index-Cn3-adsJ.css +1 -0
- package/dist/playground/index.html +17 -0
- package/dist/prompt.d.ts +39 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +68 -0
- package/dist/public-deprecated.d.ts +36 -0
- package/dist/public-deprecated.d.ts.map +1 -0
- package/dist/public-deprecated.js +39 -0
- package/dist/reminders.d.ts +42 -0
- package/dist/reminders.d.ts.map +1 -0
- package/dist/reminders.js +45 -0
- package/dist/schedules.d.ts +23 -0
- package/dist/schedules.d.ts.map +1 -0
- package/dist/schedules.js +26 -0
- package/dist/skills.d.ts +22 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +22 -0
- package/dist/storage-backends/cursor-hosted-v2.d.ts +54 -0
- package/dist/storage-backends/cursor-hosted-v2.d.ts.map +1 -0
- package/dist/storage-backends/cursor-hosted-v2.js +113 -0
- package/dist/storage-backends/cursor-hosted.d.ts +94 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -0
- package/dist/storage-backends/cursor-hosted.js +225 -0
- package/dist/storage-backends/file-kv.d.ts +42 -0
- package/dist/storage-backends/file-kv.d.ts.map +1 -0
- package/dist/storage-backends/file-kv.js +226 -0
- package/dist/storage-protocol.d.ts +124 -0
- package/dist/storage-protocol.d.ts.map +1 -0
- package/dist/storage-protocol.js +181 -0
- package/dist/storage.d.ts +254 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +145 -0
- package/dist/tools.d.ts +135 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +78 -0
- package/dist/types.d.ts +3804 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +191 -0
- package/docs/README.md +115 -0
- package/docs/building-with-agents.md +139 -0
- package/docs/changelog.md +119 -0
- package/docs/deployment.md +314 -0
- package/docs/evals.md +244 -0
- package/docs/guides/agent-to-agent.md +167 -0
- package/docs/guides/bitbucket.md +298 -0
- package/docs/guides/cloud-agents.md +86 -0
- package/docs/guides/convert-automation.md +185 -0
- package/docs/guides/export-grokbot.md +244 -0
- package/docs/guides/github.md +378 -0
- package/docs/guides/gitlab.md +304 -0
- package/docs/guides/grokbot-agents.md +140 -0
- package/docs/guides/hooks.md +121 -0
- package/docs/guides/improve.md +134 -0
- package/docs/guides/jev.md +303 -0
- package/docs/guides/mcp-oauth.md +153 -0
- package/docs/guides/migrate.md +169 -0
- package/docs/guides/opentelemetry.md +205 -0
- package/docs/guides/pagerduty.md +341 -0
- package/docs/guides/slack.md +314 -0
- package/docs/guides/webhooks.md +255 -0
- package/docs/hillclimbing.md +139 -0
- package/docs/quickstart.md +312 -0
- package/docs/reference/agent-config.md +243 -0
- package/docs/reference/artifacts.md +118 -0
- package/docs/reference/channels.md +219 -0
- package/docs/reference/cli.md +1103 -0
- package/docs/reference/connections.md +312 -0
- package/docs/reference/evals.md +299 -0
- package/docs/reference/extensions.md +214 -0
- package/docs/reference/hooks.md +202 -0
- package/docs/reference/http-api.md +226 -0
- package/docs/reference/instructions.md +69 -0
- package/docs/reference/memory.md +119 -0
- package/docs/reference/playground.md +41 -0
- package/docs/reference/project-layout.md +122 -0
- package/docs/reference/prompt.md +52 -0
- package/docs/reference/schedules.md +195 -0
- package/docs/reference/sessions.md +205 -0
- package/docs/reference/skills.md +77 -0
- package/docs/reference/subagents.md +66 -0
- package/docs/reference/tools.md +311 -0
- package/docs/templates/agentic-owners.md +131 -0
- package/docs/templates/grokbot-agents.md +60 -0
- package/docs/templates/security-reviewer.md +86 -0
- package/docs/templates/thermo-quality-review.md +80 -0
- package/docs/templates/thermo-review.md +80 -0
- package/docs/templates/triage.md +106 -0
- package/docs/troubleshooting.md +154 -0
- package/package.json +429 -4
- package/schemas/grokbot-answers.schema.json +354 -0
- package/scripts/install-cursor-skills.mjs +29 -0
- package/skills/create-agent/SKILL.md +175 -0
- package/skills/debug/SKILL.md +43 -0
- package/skills/deploy/SKILL.md +169 -0
- package/skills/evals/SKILL.md +145 -0
- package/skills/framework-map/SKILL.md +128 -0
- package/skills/github/SKILL.md +133 -0
- package/skills/hillclimb/SKILL.md +63 -0
- package/skills/mcp-auth/SKILL.md +60 -0
- package/skills/migrate-v2/SKILL.md +397 -0
- package/skills/otel/SKILL.md +48 -0
- package/skills/setup-slack/SKILL.md +136 -0
- package/templates/agentic-owners/README.md +78 -0
- package/templates/agentic-owners/bot/agent.ts +8 -0
- package/templates/agentic-owners/bot/channels/github.ts +63 -0
- package/templates/agentic-owners/bot/instructions.md +34 -0
- package/templates/agentic-owners/bot/lib/config.ts +5 -0
- package/templates/agentic-owners/bot/lib/github.ts +219 -0
- package/templates/agentic-owners/bot/lib/owners/README.md +50 -0
- package/templates/agentic-owners/bot/lib/owners/constants.ts +22 -0
- package/templates/agentic-owners/bot/lib/owners/decision.ts +480 -0
- package/templates/agentic-owners/bot/lib/owners/globalOverride.ts +60 -0
- package/templates/agentic-owners/bot/lib/owners/handles.ts +54 -0
- package/templates/agentic-owners/bot/lib/owners/match.ts +287 -0
- package/templates/agentic-owners/bot/lib/owners/matching.ts +147 -0
- package/templates/agentic-owners/bot/lib/owners/parse.ts +696 -0
- package/templates/agentic-owners/bot/lib/owners/policyMode.ts +57 -0
- package/templates/agentic-owners/bot/lib/owners/prompt.ts +64 -0
- package/templates/agentic-owners/bot/lib/owners/prompts/base-review.md +105 -0
- package/templates/agentic-owners/bot/lib/owners/types.ts +73 -0
- package/templates/agentic-owners/bot/lib/review.ts +723 -0
- package/templates/agentic-owners/bot/tools/record_review.ts +62 -0
- package/templates/agentic-owners/evals/evals.config.ts +5 -0
- package/templates/agentic-owners/evals/owners.eval.ts +111 -0
- package/templates/agentic-owners/package.json +20 -0
- package/templates/agentic-owners/tsconfig.json +12 -0
- package/templates/agents-md/README.md +43 -0
- package/templates/agents-md/bot/agent.ts +8 -0
- package/templates/agents-md/bot/channels/github.ts +10 -0
- package/templates/agents-md/bot/channels/queue.ts +23 -0
- package/templates/agents-md/bot/channels/slack.ts +9 -0
- package/templates/agents-md/bot/instructions.md +38 -0
- package/templates/agents-md/bot/lib/collect.ts +412 -0
- package/templates/agents-md/bot/lib/config.ts +8 -0
- package/templates/agents-md/bot/lib/paths.ts +49 -0
- package/templates/agents-md/bot/schedules/weekly.ts +17 -0
- package/templates/agents-md/bot/tools/apply_agents.ts +217 -0
- package/templates/agents-md/evals/agents.eval.ts +136 -0
- package/templates/agents-md/evals/evals.config.ts +5 -0
- package/templates/agents-md/init.json +38 -0
- package/templates/agents-md/package.json +18 -0
- package/templates/agents-md/tsconfig.json +12 -0
- package/templates/code-wiki/README.md +34 -0
- package/templates/code-wiki/bot/agent.ts +8 -0
- package/templates/code-wiki/bot/channels/github.ts +125 -0
- package/templates/code-wiki/bot/instructions.md +39 -0
- package/templates/code-wiki/bot/lib/repos.ts +5 -0
- package/templates/code-wiki/bot/lib/wiki.ts +22 -0
- package/templates/code-wiki/bot/tools/apply_wiki.ts +210 -0
- package/templates/code-wiki/evals/evals.config.ts +5 -0
- package/templates/code-wiki/evals/wiki.eval.ts +124 -0
- package/templates/code-wiki/init.json +25 -0
- package/templates/code-wiki/package.json +18 -0
- package/templates/code-wiki/tsconfig.json +12 -0
- package/templates/demo/README.md +37 -0
- package/templates/demo/bot/agent.ts +8 -0
- package/templates/demo/bot/channels/github.ts +52 -0
- package/templates/demo/bot/channels/queue.ts +24 -0
- package/templates/demo/bot/instructions.md +8 -0
- package/templates/demo/bot/lib/collect.ts +66 -0
- package/templates/demo/bot/lib/repos.ts +5 -0
- package/templates/demo/bot/tools/record_demo.ts +37 -0
- package/templates/demo/evals/demo.eval.ts +29 -0
- package/templates/demo/evals/evals.config.ts +5 -0
- package/templates/demo/init.json +25 -0
- package/templates/demo/package.json +18 -0
- package/templates/demo/tsconfig.json +12 -0
- package/templates/grokbot-agents/README.md +27 -0
- package/templates/grokbot-agents/bot/agent.ts +6 -0
- package/templates/grokbot-agents/bot/extensions/grokbot.ts +5 -0
- package/templates/grokbot-agents/bot/instructions.md +7 -0
- package/templates/grokbot-agents/evals/evals.config.ts +5 -0
- package/templates/grokbot-agents/evals/grokbot-agents.eval.ts +18 -0
- package/templates/grokbot-agents/init.json +18 -0
- package/templates/grokbot-agents/package.json +17 -0
- package/templates/grokbot-agents/tsconfig.json +12 -0
- package/templates/pr-autofixer/bot/agent.ts +11 -0
- package/templates/pr-autofixer/bot/channels/drive.ts +24 -0
- package/templates/pr-autofixer/bot/channels/github.ts +155 -0
- package/templates/pr-autofixer/bot/channels/slack.ts +16 -0
- package/templates/pr-autofixer/bot/hooks/bind-agent.ts +19 -0
- package/templates/pr-autofixer/bot/instructions.md +83 -0
- package/templates/pr-autofixer/bot/lib/affinity.ts +24 -0
- package/templates/pr-autofixer/bot/lib/drive-schemas.ts +18 -0
- package/templates/pr-autofixer/bot/lib/drive.ts +73 -0
- package/templates/pr-autofixer/bot/lib/merge-watch.ts +116 -0
- package/templates/pr-autofixer/bot/lib/pr-state.ts +40 -0
- package/templates/pr-autofixer/bot/lib/repos.ts +18 -0
- package/templates/pr-autofixer/bot/lib/start-drive.ts +113 -0
- package/templates/pr-autofixer/bot/lib/webhook-buffer.ts +215 -0
- package/templates/pr-autofixer/bot/lib/webhook-routing.ts +231 -0
- package/templates/pr-autofixer/bot/tools/drive_pr.ts +21 -0
- package/templates/pr-autofixer/evals/coordinator.eval.ts +16 -0
- package/templates/pr-autofixer/evals/evals.config.ts +5 -0
- package/templates/pr-autofixer/init.json +25 -0
- package/templates/pr-autofixer/package.json +18 -0
- package/templates/pr-autofixer/tsconfig.json +12 -0
- package/templates/security-help/README.md +46 -0
- package/templates/security-help/bot/agent.ts +17 -0
- package/templates/security-help/bot/channels/github.ts +13 -0
- package/templates/security-help/bot/channels/slack.ts +84 -0
- package/templates/security-help/bot/instructions.md +19 -0
- package/templates/security-help/bot/lib/pr-first-pass.ts +40 -0
- package/templates/security-help/bot/lib/repos.ts +5 -0
- package/templates/security-help/bot/skills/access-request.md +10 -0
- package/templates/security-help/bot/skills/faq.md +31 -0
- package/templates/security-help/bot/skills/security-playbooks.md +12 -0
- package/templates/security-help/bot/skills/security-pr-first-pass.md +12 -0
- package/templates/security-help/evals/evals.config.ts +5 -0
- package/templates/security-help/evals/security-help.eval.ts +51 -0
- package/templates/security-help/init.json +31 -0
- package/templates/security-help/package.json +17 -0
- package/templates/security-help/tsconfig.json +12 -0
- package/templates/security-reviewer/README.md +33 -0
- package/templates/security-reviewer/bot/agent.ts +8 -0
- package/templates/security-reviewer/bot/channels/github.ts +43 -0
- package/templates/security-reviewer/bot/instructions.md +22 -0
- package/templates/security-reviewer/bot/lib/repos.ts +5 -0
- package/templates/security-reviewer/bot/tools/post_findings.ts +68 -0
- package/templates/security-reviewer/evals/evals.config.ts +5 -0
- package/templates/security-reviewer/evals/review.eval.ts +50 -0
- package/templates/security-reviewer/init.json +25 -0
- package/templates/security-reviewer/package.json +18 -0
- package/templates/security-reviewer/tsconfig.json +12 -0
- package/templates/thermo-quality-review/README.md +35 -0
- package/templates/thermo-quality-review/bot/agent.ts +8 -0
- package/templates/thermo-quality-review/bot/channels/github.ts +39 -0
- package/templates/thermo-quality-review/bot/instructions.md +43 -0
- package/templates/thermo-quality-review/bot/tools/post_findings.ts +67 -0
- package/templates/thermo-quality-review/evals/evals.config.ts +5 -0
- package/templates/thermo-quality-review/evals/review.eval.ts +59 -0
- package/templates/thermo-quality-review/package.json +18 -0
- package/templates/thermo-quality-review/tsconfig.json +12 -0
- package/templates/thermo-review/README.md +35 -0
- package/templates/thermo-review/bot/agent.ts +8 -0
- package/templates/thermo-review/bot/channels/github.ts +39 -0
- package/templates/thermo-review/bot/instructions.md +40 -0
- package/templates/thermo-review/bot/tools/post_findings.ts +67 -0
- package/templates/thermo-review/evals/evals.config.ts +5 -0
- package/templates/thermo-review/evals/review.eval.ts +50 -0
- package/templates/thermo-review/package.json +18 -0
- package/templates/thermo-review/tsconfig.json +12 -0
- package/templates/triage/README.md +47 -0
- package/templates/triage/bot/agent.ts +8 -0
- package/templates/triage/bot/channels/queue.ts +29 -0
- package/templates/triage/bot/channels/webhook.ts +41 -0
- package/templates/triage/bot/hooks/memory.ts +3 -0
- package/templates/triage/bot/instructions.md +38 -0
- package/templates/triage/bot/lib/actuate.ts +703 -0
- package/templates/triage/bot/lib/parse-queue-event.ts +160 -0
- package/templates/triage/bot/lib/tracker.ts +5 -0
- package/templates/triage/bot/lib/types.ts +48 -0
- package/templates/triage/bot/lib/verify-webhook.ts +79 -0
- package/templates/triage/bot/skills/triage-rubric.md +44 -0
- package/templates/triage/bot/tools/record_triage.ts +29 -0
- package/templates/triage/evals/evals.config.ts +5 -0
- package/templates/triage/evals/triage.eval.ts +64 -0
- package/templates/triage/overlays/jira/README.md +21 -0
- package/templates/triage/overlays/jira/bot/lib/tracker.ts +8 -0
- package/templates/triage/overlays/jira/bot/mcp-connections/tracker.ts +6 -0
- package/templates/triage/overlays/linear/README.md +21 -0
- package/templates/triage/overlays/linear/bot/lib/tracker.ts +8 -0
- package/templates/triage/overlays/linear/bot/mcp-connections/tracker.ts +6 -0
- package/templates/triage/package.json +18 -0
- package/templates/triage/tsconfig.json +12 -0
|
@@ -0,0 +1,2072 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `agent-sdk deploy | deployments | deployment | stop | rollback | delete | rotate-token |
|
|
3
|
+
* secrets set|list|unset` — Heroku-style deploys
|
|
4
|
+
* onto Cursor's managed agent-serve hosting.
|
|
5
|
+
*
|
|
6
|
+
* All intelligence is server-side (backend/server/src/agentServe/); these
|
|
7
|
+
* handlers resolve parameters (credentials, team, slug, the project's
|
|
8
|
+
* `hosting` / `architecture` manifest block), call the v1 agent-serve or
|
|
9
|
+
* v2 agentsdk management API through `deploy-client.ts`, poll status, and
|
|
10
|
+
* render.
|
|
11
|
+
*/
|
|
12
|
+
import { basename, relative, resolve } from "node:path";
|
|
13
|
+
import { catchAuthDeclaration, isPublicEndpointPolicy } from "../channels.js";
|
|
14
|
+
import { isCursorAccountTransport, } from "../types.js";
|
|
15
|
+
import { CursorBackendClient } from "./cursor/backend-client.js";
|
|
16
|
+
import { cursorExternalApiUrl, resolveApiKey, SIGN_IN_HINT } from "./cursor/credentials.js";
|
|
17
|
+
import { authorizeCursorAccountConnectors } from "./cursor-account-mcp-auth.js";
|
|
18
|
+
import { readDeployTemplate } from "./cursor-agent-template.js";
|
|
19
|
+
import { AgentServeDeployClient, SEVERAL_AGENTS_DEPLOY_ALONE, DeployApiError, deploymentServiceAccountId, TERMINAL_AGENTKIT_DEPLOY_STATUSES, TERMINAL_DEPLOY_STATUSES, validateDeploymentSlug, } from "./deploy-client.js";
|
|
20
|
+
import { channelCatchSecretNames, channelCredentialSecretNames, channelSecretAlternatives, } from "./deploy-manifest.js";
|
|
21
|
+
import { unmetSecretAlternatives } from "./secret-alternatives.js";
|
|
22
|
+
import { inferDeployGitSource } from "./deploy-source.js";
|
|
23
|
+
import { describeError } from "./describe-error.js";
|
|
24
|
+
import { formatDiagnostics, hasErrorDiagnostics, isAgentProjectDir, listChildAgentDirs, loadAgentProject, } from "./discovery.js";
|
|
25
|
+
import { CLI_COMMAND_NAME as CLI } from "./distribution.js";
|
|
26
|
+
import { isReservedSecretName, isValidCursorEventRepo, validateSettableSecretName, } from "./hosting.js";
|
|
27
|
+
import { deploymentArchitecture, rejectV2ForLegacyCommand } from "./legacy-command-guard.js";
|
|
28
|
+
import { deployProgressLabel, sanitizeCustomerError } from "./logs-client.js";
|
|
29
|
+
import { sleep } from "./sleep.js";
|
|
30
|
+
import { slugFromDirectoryName } from "./slug.js";
|
|
31
|
+
import { stderrPalette } from "./terminal-style.js";
|
|
32
|
+
const DEFAULT_POLL_INTERVAL_MS = 3_000;
|
|
33
|
+
const DEFAULT_DEPLOY_TIMEOUT_MS = 10 * 60 * 1000;
|
|
34
|
+
const MULTI_COMPONENT_ALLOWED_TEAM_ID = 1;
|
|
35
|
+
function canPublishAgentsAsOne(teamId) {
|
|
36
|
+
return teamId === MULTI_COMPONENT_ALLOWED_TEAM_ID;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Credentials → deploy client → team id. Shared by deploy commands and
|
|
40
|
+
* `--prod` AX routing. Returns an exit code (error already rendered) on
|
|
41
|
+
* failure.
|
|
42
|
+
*/
|
|
43
|
+
export async function resolveDeployAuth(options) {
|
|
44
|
+
const err = options.err ?? ((text) => void process.stderr.write(text));
|
|
45
|
+
const resolved = await resolveApiKey(options.apiKey === undefined ? undefined : { apiKey: options.apiKey });
|
|
46
|
+
if (resolved === undefined) {
|
|
47
|
+
err(`Not signed in to Cursor. ${SIGN_IN_HINT}\n`);
|
|
48
|
+
return 1;
|
|
49
|
+
}
|
|
50
|
+
// The deployment management routes live on the external API host
|
|
51
|
+
// (api.cursor.com), not the default backend (api2.cursor.sh) — see
|
|
52
|
+
// cursorExternalApiUrl. GetMe below stays on the resolved backend.
|
|
53
|
+
const client = new AgentServeDeployClient({
|
|
54
|
+
backendUrl: cursorExternalApiUrl(),
|
|
55
|
+
apiKey: resolved.apiKey,
|
|
56
|
+
fetchImpl: options.fetchImpl,
|
|
57
|
+
});
|
|
58
|
+
let teamId;
|
|
59
|
+
if (options.team !== undefined) {
|
|
60
|
+
teamId = Number.parseInt(options.team, 10);
|
|
61
|
+
if (Number.isNaN(teamId) || teamId <= 0) {
|
|
62
|
+
err(`Invalid --team: ${options.team} (expected a positive team id)\n`);
|
|
63
|
+
return 1;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
const account = new CursorBackendClient({
|
|
68
|
+
backendUrl: resolved.backendUrl,
|
|
69
|
+
apiKey: resolved.apiKey,
|
|
70
|
+
fetchImpl: options.fetchImpl,
|
|
71
|
+
});
|
|
72
|
+
let identity;
|
|
73
|
+
try {
|
|
74
|
+
identity = await account.getMe();
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
err(`Could not resolve your team from the Cursor account: ${describeError(error)}\nPass --team <id> explicitly.\n`);
|
|
78
|
+
return 1;
|
|
79
|
+
}
|
|
80
|
+
if (identity.teamId === undefined || identity.teamId <= 0) {
|
|
81
|
+
err("This Cursor account has no default team; pass --team <id> (find it in the Cursor dashboard URL).\n");
|
|
82
|
+
return 1;
|
|
83
|
+
}
|
|
84
|
+
teamId = identity.teamId;
|
|
85
|
+
const dim = stderrPalette().dim;
|
|
86
|
+
err(`${dim(`Using team ${teamId}${identity.teamName === undefined ? "" : ` (${identity.teamName})`}`)}\n${dim(" the account's team — pass --team to override.")}\n`);
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
client,
|
|
90
|
+
teamId,
|
|
91
|
+
apiKey: resolved.apiKey,
|
|
92
|
+
backendUrl: resolved.backendUrl,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Shared preamble: credentials → client → team id. Returns an exit code
|
|
97
|
+
* (with the error already rendered) when resolution fails.
|
|
98
|
+
*/
|
|
99
|
+
export async function prepare(options) {
|
|
100
|
+
const out = options.out ?? ((text) => void process.stdout.write(text));
|
|
101
|
+
const err = options.err ?? ((text) => void process.stderr.write(text));
|
|
102
|
+
const auth = await resolveDeployAuth({
|
|
103
|
+
team: options.team,
|
|
104
|
+
apiKey: options.apiKey,
|
|
105
|
+
fetchImpl: options.fetchImpl,
|
|
106
|
+
err,
|
|
107
|
+
});
|
|
108
|
+
if (typeof auth === "number") {
|
|
109
|
+
return auth;
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
client: auth.client,
|
|
113
|
+
teamId: auth.teamId,
|
|
114
|
+
apiKey: auth.apiKey,
|
|
115
|
+
backendUrl: auth.backendUrl,
|
|
116
|
+
json: options.json === true,
|
|
117
|
+
noWait: options.noWait === true,
|
|
118
|
+
pollIntervalMs: options.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS,
|
|
119
|
+
timeoutMs: options.timeoutMs ?? DEFAULT_DEPLOY_TIMEOUT_MS,
|
|
120
|
+
out,
|
|
121
|
+
err,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
// ============================================================================
|
|
125
|
+
// deploy
|
|
126
|
+
// ============================================================================
|
|
127
|
+
export async function cmdDeploy(options) {
|
|
128
|
+
const ctx = await prepare(options);
|
|
129
|
+
if (typeof ctx === "number") {
|
|
130
|
+
return ctx;
|
|
131
|
+
}
|
|
132
|
+
if (options.multiTenant === true && ctx.teamId !== MULTI_COMPONENT_ALLOWED_TEAM_ID) {
|
|
133
|
+
ctx.err("--multi-tenant is not available for this team.\n");
|
|
134
|
+
return 1;
|
|
135
|
+
}
|
|
136
|
+
const targets = await resolveDeployTargets(options, ctx);
|
|
137
|
+
if (typeof targets === "number") {
|
|
138
|
+
return targets;
|
|
139
|
+
}
|
|
140
|
+
if (targets.length === 1) {
|
|
141
|
+
return deployOne(ctx, options, targets[0]);
|
|
142
|
+
}
|
|
143
|
+
const manifests = [];
|
|
144
|
+
for (const target of targets) {
|
|
145
|
+
manifests.push(await readDeployManifest(target.dir));
|
|
146
|
+
}
|
|
147
|
+
if (manifests.every((manifest) => manifest.architecture === "v2")) {
|
|
148
|
+
// One team can publish several agents as one deployment. Other teams deploy each agent alone.
|
|
149
|
+
if (!canPublishAgentsAsOne(ctx.teamId)) {
|
|
150
|
+
ctx.err(severalAgentsDeployAloneText(options, targets));
|
|
151
|
+
return 1;
|
|
152
|
+
}
|
|
153
|
+
if (!ctx.json) {
|
|
154
|
+
ctx.err(options.all === true
|
|
155
|
+
? deployingAllAgentsLine(options, targets)
|
|
156
|
+
: deployingAsOneApplicationLine(options, targets));
|
|
157
|
+
}
|
|
158
|
+
return deployAgentsdkApplication(ctx, options, targets, {
|
|
159
|
+
// `persistent` is per child agent, like `agentPath`: each release
|
|
160
|
+
// component carries its own.
|
|
161
|
+
componentPersistent: Object.fromEntries(targets.map((target, index) => [target.slug, manifests[index]?.persistent === true])),
|
|
162
|
+
componentImage: Object.fromEntries(targets.flatMap((target, index) => manifests[index]?.image === undefined ? [] : [[target.slug, manifests[index].image]])),
|
|
163
|
+
hasScmChannels: manifests.some((manifest) => manifest.hasScmChannels),
|
|
164
|
+
declaredSecretNames: declaredSecretNames(manifests),
|
|
165
|
+
hasDeploymentsChannels: manifests.some((manifest) => manifest.hasDeploymentsChannels),
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
if (!ctx.json && options.all === true) {
|
|
169
|
+
ctx.err(deployingAllAgentsLine(options, targets));
|
|
170
|
+
}
|
|
171
|
+
if (!ctx.json && manifests.some((manifest) => manifest.architecture === "v2")) {
|
|
172
|
+
ctx.err(`warning: agents under this parent mix architectures; deploying each separately (v2 children become standalone single-component applications).\n`);
|
|
173
|
+
}
|
|
174
|
+
// --path is per-agent (relative to the repo root). When deploying several
|
|
175
|
+
// agents, ignore a shared --path so each target can infer its own path.
|
|
176
|
+
let deployOptions = options;
|
|
177
|
+
if (options.path !== undefined) {
|
|
178
|
+
if (!ctx.json) {
|
|
179
|
+
ctx.err(`warning: ignoring --path ${JSON.stringify(options.path)} for a multi-agent deploy; each agent infers its own path from git.\n`);
|
|
180
|
+
}
|
|
181
|
+
deployOptions = { ...options, path: undefined };
|
|
182
|
+
}
|
|
183
|
+
// Multi-agent batch: deploy sequentially; --json emits an array.
|
|
184
|
+
const jsonResults = [];
|
|
185
|
+
let failures = 0;
|
|
186
|
+
for (const [index, target] of targets.entries()) {
|
|
187
|
+
if (!ctx.json) {
|
|
188
|
+
ctx.err(`\n=== [${index + 1}/${targets.length}] Deploying ${target.slug} ===\n`);
|
|
189
|
+
}
|
|
190
|
+
const before = jsonResults.length;
|
|
191
|
+
const code = await deployOne(ctx, deployOptions, target, {
|
|
192
|
+
jsonCollect: ctx.json ? jsonResults : undefined,
|
|
193
|
+
});
|
|
194
|
+
if (code !== 0) {
|
|
195
|
+
failures += 1;
|
|
196
|
+
if (ctx.json && jsonResults.length === before) {
|
|
197
|
+
jsonResults.push({ slug: target.slug, error: "deploy failed" });
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (ctx.json) {
|
|
202
|
+
ctx.out(`${JSON.stringify(jsonResults, null, 2)}\n`);
|
|
203
|
+
}
|
|
204
|
+
else if (failures > 0) {
|
|
205
|
+
ctx.err(`\n${failures} of ${targets.length} deploy(s) failed.\n`);
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
ctx.err(`\nDeployed ${targets.length} agents.\n`);
|
|
209
|
+
}
|
|
210
|
+
return failures === 0 ? 0 : 1;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Resolve which agent directory(ies) to deploy from `--dir` / `--slug` /
|
|
214
|
+
* `--all`, with an interactive picker when a multi-agent parent is on a TTY.
|
|
215
|
+
*/
|
|
216
|
+
async function resolveDeployTargets(options, ctx) {
|
|
217
|
+
let dir = resolve(options.dir ?? ".");
|
|
218
|
+
// A repo-root deploy commonly names the local agent through --path. Use
|
|
219
|
+
// that project for manifest discovery unless --dir or --all chose a scope.
|
|
220
|
+
if (options.dir === undefined && options.path !== undefined && options.all !== true) {
|
|
221
|
+
const localSourceDir = resolve(options.path);
|
|
222
|
+
if (await isAgentProjectDir(localSourceDir)) {
|
|
223
|
+
dir = localSourceDir;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
if (options.slug !== undefined) {
|
|
227
|
+
const slugError = validateDeploymentSlug(options.slug);
|
|
228
|
+
if (slugError !== undefined) {
|
|
229
|
+
ctx.err(`${slugError}\n`);
|
|
230
|
+
return 1;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (options.all === true && options.slug !== undefined) {
|
|
234
|
+
ctx.err("Pass either --slug or --all, not both.\n");
|
|
235
|
+
return 1;
|
|
236
|
+
}
|
|
237
|
+
if (await isAgentProjectDir(dir)) {
|
|
238
|
+
if (options.all === true) {
|
|
239
|
+
ctx.err(`--all requires a multi-agent parent directory (several child agents under --dir); ${dir} is a single agent project.\n`);
|
|
240
|
+
return 1;
|
|
241
|
+
}
|
|
242
|
+
let slug;
|
|
243
|
+
if (options.slug !== undefined) {
|
|
244
|
+
slug = options.slug;
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
const derived = slugFromDirectoryName(basename(dir));
|
|
248
|
+
if (derived === undefined) {
|
|
249
|
+
ctx.err(`Could not derive a deployment slug from the directory name ${JSON.stringify(basename(dir))}; pass --slug.\n`);
|
|
250
|
+
return 1;
|
|
251
|
+
}
|
|
252
|
+
slug = derived;
|
|
253
|
+
if (!ctx.json) {
|
|
254
|
+
ctx.err(`Deploying as "${slug}" (from the directory name).\n`);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return [{ slug, dir }];
|
|
258
|
+
}
|
|
259
|
+
let children;
|
|
260
|
+
try {
|
|
261
|
+
children = await listChildAgentDirs(dir);
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
ctx.err(`${describeError(error)}\n`);
|
|
265
|
+
return 1;
|
|
266
|
+
}
|
|
267
|
+
// Deploy slugs are lowercase-only; normalize directory names the same way
|
|
268
|
+
// single-agent deploy does so MixedCase child dirs still deploy.
|
|
269
|
+
children = children.flatMap((child) => {
|
|
270
|
+
const slug = slugFromDirectoryName(basename(child.dir));
|
|
271
|
+
if (slug === undefined) {
|
|
272
|
+
return [];
|
|
273
|
+
}
|
|
274
|
+
return [{ slug, dir: child.dir }];
|
|
275
|
+
});
|
|
276
|
+
if (children.length === 0) {
|
|
277
|
+
if (options.all === true) {
|
|
278
|
+
ctx.err(`--all requires child agent projects under --dir; none found in ${dir}.\n`);
|
|
279
|
+
return 1;
|
|
280
|
+
}
|
|
281
|
+
// Bare-slug deploy against a non-agent directory (still requires --repo).
|
|
282
|
+
let slug;
|
|
283
|
+
if (options.slug !== undefined) {
|
|
284
|
+
slug = options.slug;
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
const derived = slugFromDirectoryName(basename(dir));
|
|
288
|
+
if (derived === undefined) {
|
|
289
|
+
ctx.err(`No agent projects under ${dir}, and could not derive a slug from ${JSON.stringify(basename(dir))}; pass --slug or --dir <agent>.\n`);
|
|
290
|
+
return 1;
|
|
291
|
+
}
|
|
292
|
+
slug = derived;
|
|
293
|
+
if (!ctx.json) {
|
|
294
|
+
ctx.err(`Deploying as "${slug}" (no agent project at ${dir}).\n`);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
return [{ slug, dir }];
|
|
298
|
+
}
|
|
299
|
+
if (children.length === 1) {
|
|
300
|
+
const only = children[0];
|
|
301
|
+
if (options.all === true) {
|
|
302
|
+
// One child is fine for --all (degenerate multi-agent parent).
|
|
303
|
+
}
|
|
304
|
+
else if (options.slug !== undefined && options.slug.toLowerCase() !== only.slug) {
|
|
305
|
+
ctx.err(`No agent "${options.slug}" under ${dir}; found "${only.slug}".\n`);
|
|
306
|
+
return 1;
|
|
307
|
+
}
|
|
308
|
+
if (!ctx.json) {
|
|
309
|
+
ctx.err(`Deploying "${only.slug}" (only agent under ${basename(dir)}).\n`);
|
|
310
|
+
}
|
|
311
|
+
return [only];
|
|
312
|
+
}
|
|
313
|
+
// Multiple children.
|
|
314
|
+
if (options.all === true) {
|
|
315
|
+
return [...children];
|
|
316
|
+
}
|
|
317
|
+
if (options.slug !== undefined) {
|
|
318
|
+
const wanted = options.slug.toLowerCase();
|
|
319
|
+
const match = children.find((child) => child.slug === wanted);
|
|
320
|
+
if (match === undefined) {
|
|
321
|
+
ctx.err(`No agent "${options.slug}" under ${dir}.\n` +
|
|
322
|
+
formatAgentList(children) +
|
|
323
|
+
`Pass --slug <name> or --all.\n`);
|
|
324
|
+
return 1;
|
|
325
|
+
}
|
|
326
|
+
return [match];
|
|
327
|
+
}
|
|
328
|
+
// An all-v2 parent needs no picker or --all. A v1 child, or a child that
|
|
329
|
+
// fails to load, keeps the interactive picker below.
|
|
330
|
+
if (await allChildrenAreV2(children)) {
|
|
331
|
+
return [...children];
|
|
332
|
+
}
|
|
333
|
+
const chooser = options.chooseTargets ??
|
|
334
|
+
((agents) => promptChooseDeployTargets(agents, {
|
|
335
|
+
err: ctx.err,
|
|
336
|
+
stdin: options.stdin ?? process.stdin,
|
|
337
|
+
interactive: ctx.json !== true &&
|
|
338
|
+
(options.stdin ?? process.stdin).isTTY === true &&
|
|
339
|
+
process.stderr.isTTY === true,
|
|
340
|
+
}));
|
|
341
|
+
const chosen = await chooser(children);
|
|
342
|
+
if (chosen === null) {
|
|
343
|
+
ctx.err("Deploy cancelled.\n");
|
|
344
|
+
return 1;
|
|
345
|
+
}
|
|
346
|
+
if (chosen.length === 0) {
|
|
347
|
+
ctx.err(`Multiple agents under ${dir}:\n` +
|
|
348
|
+
formatAgentList(children) +
|
|
349
|
+
`Pass --slug <name> or --all (or re-run on a TTY to pick interactively).\n`);
|
|
350
|
+
return 1;
|
|
351
|
+
}
|
|
352
|
+
return chosen;
|
|
353
|
+
}
|
|
354
|
+
function deployingAllAgentsLine(options, targets) {
|
|
355
|
+
return `Deploying all ${targets.length} agents under ${basename(resolve(options.dir ?? "."))}: ${targets.map((target) => target.slug).join(", ")}.\n`;
|
|
356
|
+
}
|
|
357
|
+
function deployingAsOneApplicationLine(options, targets) {
|
|
358
|
+
return `Deploying all ${targets.length} v2 agents under ${basename(resolve(options.dir ?? "."))} as one application (pass --slug <name> to deploy a single agent standalone).\n`;
|
|
359
|
+
}
|
|
360
|
+
function severalAgentsDeployAloneText(options, targets) {
|
|
361
|
+
const flags = copiedDeployFlags(options);
|
|
362
|
+
const commands = targets.map((target) => ` ${CLI} deploy --dir ${quoteShell(relativeDeployDir(target.dir))}${flags}`);
|
|
363
|
+
return `${SEVERAL_AGENTS_DEPLOY_ALONE}\n${commands.join("\n")}\n`;
|
|
364
|
+
}
|
|
365
|
+
function copiedDeployFlags(options) {
|
|
366
|
+
const parts = [];
|
|
367
|
+
if (options.team !== undefined) {
|
|
368
|
+
parts.push(`--team ${quoteShell(options.team)}`);
|
|
369
|
+
}
|
|
370
|
+
if (options.repo !== undefined) {
|
|
371
|
+
parts.push(`--repo ${quoteShell(options.repo)}`);
|
|
372
|
+
}
|
|
373
|
+
if (options.ref !== undefined) {
|
|
374
|
+
parts.push(`--ref ${quoteShell(options.ref)}`);
|
|
375
|
+
}
|
|
376
|
+
for (const repo of options.cursorEventsRepos ?? []) {
|
|
377
|
+
parts.push(`--cursor-events-repo ${quoteShell(repo)}`);
|
|
378
|
+
}
|
|
379
|
+
for (const domain of options.allowDomains ?? []) {
|
|
380
|
+
parts.push(`--allow-domain ${quoteShell(domain)}`);
|
|
381
|
+
}
|
|
382
|
+
return parts.length === 0 ? "" : ` ${parts.join(" ")}`;
|
|
383
|
+
}
|
|
384
|
+
function relativeDeployDir(dir) {
|
|
385
|
+
const rel = relative(process.cwd(), dir);
|
|
386
|
+
return rel === "" ? "." : rel;
|
|
387
|
+
}
|
|
388
|
+
function quoteShell(value) {
|
|
389
|
+
if (/^[A-Za-z0-9_./:-]+$/.test(value)) {
|
|
390
|
+
return value;
|
|
391
|
+
}
|
|
392
|
+
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
393
|
+
}
|
|
394
|
+
function formatAgentList(agents) {
|
|
395
|
+
return agents.map((agent, i) => ` ${i + 1}) ${agent.slug}\n`).join("");
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* True when every child agent project loads and declares
|
|
399
|
+
* `architecture: "v2"`. Broken projects count as not-v2 so target
|
|
400
|
+
* resolution falls back to the picker instead of failing the whole deploy
|
|
401
|
+
* on a child the user might not even select.
|
|
402
|
+
*/
|
|
403
|
+
async function allChildrenAreV2(children) {
|
|
404
|
+
for (const child of children) {
|
|
405
|
+
try {
|
|
406
|
+
if ((await readDeployManifest(child.dir)).architecture !== "v2") {
|
|
407
|
+
return false;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
catch {
|
|
411
|
+
return false;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
return true;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* TTY picker for multi-agent parents. Non-interactive callers get `[]`
|
|
418
|
+
* so {@link resolveDeployTargets} can print the --slug/--all hint.
|
|
419
|
+
*/
|
|
420
|
+
export async function promptChooseDeployTargets(agents, options) {
|
|
421
|
+
options.err(`Multiple agents (${agents.length}):\n` + formatAgentList(agents) + ` a) all\n`);
|
|
422
|
+
if (!options.interactive) {
|
|
423
|
+
return [];
|
|
424
|
+
}
|
|
425
|
+
options.err('Deploy which? Enter a number, slug, "all", or "q" to cancel: ');
|
|
426
|
+
const readLine = createLineReader(options.stdin);
|
|
427
|
+
// createLineReader pauses until data; ensure stdin is flowing on a TTY.
|
|
428
|
+
options.stdin.resume?.();
|
|
429
|
+
const answer = (await readLine())?.trim().toLowerCase();
|
|
430
|
+
if (answer === undefined || answer === "q" || answer === "quit") {
|
|
431
|
+
return null;
|
|
432
|
+
}
|
|
433
|
+
if (answer === "a" || answer === "all" || answer === "*") {
|
|
434
|
+
return [...agents];
|
|
435
|
+
}
|
|
436
|
+
const asIndex = Number.parseInt(answer, 10);
|
|
437
|
+
if (!Number.isNaN(asIndex) &&
|
|
438
|
+
String(asIndex) === answer &&
|
|
439
|
+
asIndex >= 1 &&
|
|
440
|
+
asIndex <= agents.length) {
|
|
441
|
+
return [agents[asIndex - 1]];
|
|
442
|
+
}
|
|
443
|
+
const bySlug = agents.find((agent) => agent.slug.toLowerCase() === answer);
|
|
444
|
+
if (bySlug !== undefined) {
|
|
445
|
+
return [bySlug];
|
|
446
|
+
}
|
|
447
|
+
options.err(`Unrecognized choice ${JSON.stringify(answer)} — expected 1–${agents.length}, a slug, "all", or "q". Aborting.\n`);
|
|
448
|
+
return null;
|
|
449
|
+
}
|
|
450
|
+
const MISSING_DEPLOY_REPO_HINT = `Could not resolve an https:// git repository URL for this deploy.\n` +
|
|
451
|
+
` Pass --repo https://github.com/<owner>/<repo>, https://gitlab.com/<group>/<project>, or an Origin repository URL (inferred from origin when possible).\n`;
|
|
452
|
+
async function deployOne(ctx, options, target, extras) {
|
|
453
|
+
const { dir, slug } = target;
|
|
454
|
+
// Fill --repo/--ref/--path from the local git checkout when omitted so
|
|
455
|
+
// `agent-sdk deploy` inside an agent directory is enough. Only probe git
|
|
456
|
+
// for real agent projects (avoids ambient monorepo remotes when someone
|
|
457
|
+
// deploys a bare --slug). Explicit flags always win.
|
|
458
|
+
const isAgent = await isAgentProjectDir(dir);
|
|
459
|
+
const needsGitInference = isAgent &&
|
|
460
|
+
(options.repo === undefined || options.ref === undefined || options.path === undefined);
|
|
461
|
+
const inferred = needsGitInference
|
|
462
|
+
? await inferDeployGitSource(dir, {
|
|
463
|
+
...(options.git === undefined ? {} : { git: options.git }),
|
|
464
|
+
})
|
|
465
|
+
: {};
|
|
466
|
+
const gitRepoUrl = options.repo ?? inferred.gitRepoUrl;
|
|
467
|
+
const gitRef = options.ref ?? inferred.gitRef;
|
|
468
|
+
const agentPath = options.path ?? inferred.agentPath;
|
|
469
|
+
if (gitRepoUrl !== undefined && !gitRepoUrl.startsWith("https://")) {
|
|
470
|
+
ctx.err(`Invalid --repo: ${gitRepoUrl} (expected an https:// git repository URL)\n`);
|
|
471
|
+
return 1;
|
|
472
|
+
}
|
|
473
|
+
if (gitRepoUrl === undefined) {
|
|
474
|
+
ctx.err(MISSING_DEPLOY_REPO_HINT);
|
|
475
|
+
return 1;
|
|
476
|
+
}
|
|
477
|
+
for (const repo of options.cursorEventsRepos ?? []) {
|
|
478
|
+
if (!isValidCursorEventRepo(repo)) {
|
|
479
|
+
ctx.err(`Invalid --cursor-events-repo: ${repo} (expected owner/name, gitlab.com/<group>/<project>, or bitbucket.org/<workspace>/<repo>)\n`);
|
|
480
|
+
return 1;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
if (!ctx.json && gitRepoUrl !== undefined) {
|
|
484
|
+
const inferredBits = [];
|
|
485
|
+
if (options.repo === undefined && inferred.gitRepoUrl !== undefined) {
|
|
486
|
+
inferredBits.push("repo");
|
|
487
|
+
}
|
|
488
|
+
if (options.ref === undefined && inferred.gitRef !== undefined) {
|
|
489
|
+
inferredBits.push("ref");
|
|
490
|
+
}
|
|
491
|
+
if (options.path === undefined && inferred.agentPath !== undefined) {
|
|
492
|
+
inferredBits.push("path");
|
|
493
|
+
}
|
|
494
|
+
ctx.err(` source: ${gitRepoUrl}${gitRef === undefined ? "" : ` @ ${gitRef}`}\n` +
|
|
495
|
+
(agentPath === undefined ? "" : ` path: ${agentPath}\n`) +
|
|
496
|
+
(inferredBits.length === 0
|
|
497
|
+
? ""
|
|
498
|
+
: ` (inferred ${inferredBits.join(", ")} from git; pass --repo/--ref/--path to override)\n`));
|
|
499
|
+
}
|
|
500
|
+
// The package manifest (`defineAgent({ hosting })`) is the source of
|
|
501
|
+
// truth for egress domains and expected secret names; flags override or
|
|
502
|
+
// augment it. Directories without an agent project have no manifest. The same load supplies the
|
|
503
|
+
// cursorAccount connection refs for the post-deploy connector auth and
|
|
504
|
+
// the channels declared public via `publicEndpoint()`.
|
|
505
|
+
const manifest = isAgent ? await readDeployManifest(dir) : undefined;
|
|
506
|
+
const hosting = manifest?.hosting;
|
|
507
|
+
const egressAllowedDomains = [
|
|
508
|
+
...new Set([...(hosting?.egressDomains ?? []), ...(options.allowDomains ?? [])]),
|
|
509
|
+
];
|
|
510
|
+
const publicRoutePaths = (manifest?.publicChannelIds ?? []).map((channelId) => `/v1/channels/${channelId}`);
|
|
511
|
+
if (!ctx.json && manifest?.httpChannelPublicEndpoint === true) {
|
|
512
|
+
ctx.err(`warning: publicEndpoint() on the built-in HTTP channel has no effect on hosting — only custom channels (/v1/channels/…) can be public; the session API always requires the alias token.\n`);
|
|
513
|
+
}
|
|
514
|
+
if (!ctx.json && publicRoutePaths.length > 0 && manifest?.architecture !== "v2") {
|
|
515
|
+
// Security-relevant surface change: say exactly what will be reachable
|
|
516
|
+
// without the alias token before the deploy is accepted. v2 registers
|
|
517
|
+
// these routes only after bake, so a relative path here would not be a
|
|
518
|
+
// live webhook URL — the running status prints the absolute one.
|
|
519
|
+
ctx.err(` public: ${publicRoutePaths.join(", ")} (served WITHOUT the alias token — these channels authenticate requests themselves)\n`);
|
|
520
|
+
}
|
|
521
|
+
const extensionEgress = manifest?.extensionEgress ?? [];
|
|
522
|
+
if (!ctx.json && extensionEgress.length > 0) {
|
|
523
|
+
// Mounted packages widen the pod's egress without an agent.ts edit; name
|
|
524
|
+
// each one before the deploy is accepted.
|
|
525
|
+
ctx.err(` egress from extensions: ${extensionEgress
|
|
526
|
+
.map((entry) => `${entry.extension} (${entry.egressDomains.join(", ")})`)
|
|
527
|
+
.join("; ")}\n`);
|
|
528
|
+
}
|
|
529
|
+
const deadSecretChannels = manifest?.publicChannelIdsWithDeadSecretPolicies ?? [];
|
|
530
|
+
if (!ctx.json && deadSecretChannels.length > 0) {
|
|
531
|
+
ctx.err(`warning: ${deadSecretChannels
|
|
532
|
+
.map((channelId) => `/v1/channels/${channelId}`)
|
|
533
|
+
.join(", ")}: publicEndpoint() sits beside sharedSecretAuth()/hmacSignatureAuth() — auth chains are any-of, so every request is admitted and those secret policies never run. Drop publicEndpoint() to enforce them, or drop them to make the intent explicit.\n`);
|
|
534
|
+
}
|
|
535
|
+
if (manifest?.architecture === "v2") {
|
|
536
|
+
if (!ctx.json) {
|
|
537
|
+
ctx.err(` architecture: v2${manifest.persistent ? " (persistent)" : ""}${manifest.image === undefined ? "" : `\n image: ${manifest.image}`}\n`);
|
|
538
|
+
}
|
|
539
|
+
return deployOneAgentsdk(ctx, extras, {
|
|
540
|
+
persistent: manifest.persistent,
|
|
541
|
+
image: manifest.image,
|
|
542
|
+
slug,
|
|
543
|
+
gitRepoUrl,
|
|
544
|
+
gitRef,
|
|
545
|
+
agentPath,
|
|
546
|
+
repositories: options.cursorEventsRepos,
|
|
547
|
+
hasScmChannels: manifest.hasScmChannels,
|
|
548
|
+
declaredSecretNames: declaredSecretNames([manifest]),
|
|
549
|
+
hasDeploymentsChannels: manifest.hasDeploymentsChannels,
|
|
550
|
+
multiTenant: options.multiTenant === true,
|
|
551
|
+
template: readDeployTemplate(dir),
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
if (options.multiTenant === true) {
|
|
555
|
+
ctx.err("--multi-tenant is only valid for architecture: v2 deploys (Cursor-managed products).\n");
|
|
556
|
+
return 1;
|
|
557
|
+
}
|
|
558
|
+
// Today's only source shape: the control plane builds from a git ref.
|
|
559
|
+
// See DeploySource for the artifact seam.
|
|
560
|
+
const source = {
|
|
561
|
+
kind: "git-ref",
|
|
562
|
+
gitRepoUrl,
|
|
563
|
+
...(gitRef === undefined ? {} : { gitRef }),
|
|
564
|
+
...(agentPath === undefined ? {} : { agentPath }),
|
|
565
|
+
...(options.cursorEventsRepos === undefined || options.cursorEventsRepos.length === 0
|
|
566
|
+
? {}
|
|
567
|
+
: { cursorEventRepos: options.cursorEventsRepos }),
|
|
568
|
+
...(egressAllowedDomains.length === 0 ? {} : { egressAllowedDomains }),
|
|
569
|
+
publicRoutePaths: publicRoutePaths.length === 0 ? undefined : publicRoutePaths,
|
|
570
|
+
// Deliberately NO manifest here: the control plane captures it from the
|
|
571
|
+
// provisioned engine (`GET /v1/manifest` after the health probe), which
|
|
572
|
+
// is the single write path for deploy manifests. `july manifest` remains
|
|
573
|
+
// available for local visibility only.
|
|
574
|
+
};
|
|
575
|
+
let accepted;
|
|
576
|
+
try {
|
|
577
|
+
accepted = await ctx.client.deploy({
|
|
578
|
+
teamId: ctx.teamId,
|
|
579
|
+
slug,
|
|
580
|
+
source,
|
|
581
|
+
template: readDeployTemplate(dir),
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
catch (error) {
|
|
585
|
+
return renderApiError(error, ctx.err);
|
|
586
|
+
}
|
|
587
|
+
const aliasUrl = ctx.client.aliasUrl(accepted.engineAlias);
|
|
588
|
+
if (!ctx.json && accepted.aliasToken !== undefined) {
|
|
589
|
+
ctx.out(aliasTokenBlock(accepted.aliasToken));
|
|
590
|
+
}
|
|
591
|
+
if (ctx.noWait) {
|
|
592
|
+
if (extras?.jsonCollect !== undefined) {
|
|
593
|
+
extras.jsonCollect.push(accepted);
|
|
594
|
+
}
|
|
595
|
+
else if (ctx.json) {
|
|
596
|
+
ctx.out(`${JSON.stringify(accepted, null, 2)}\n`);
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
ctx.out(`Deploy accepted: ${slug} (team ${ctx.teamId}, generation ${accepted.generation}, ${accepted.deploymentKind})\n` +
|
|
600
|
+
` alias: ${aliasUrl}\n` +
|
|
601
|
+
`Check progress with \`${CLI} deployment ${slug} --team ${ctx.teamId}\`.\n`);
|
|
602
|
+
}
|
|
603
|
+
return 0;
|
|
604
|
+
}
|
|
605
|
+
let detail;
|
|
606
|
+
try {
|
|
607
|
+
detail = await pollUntil(ctx, slug, TERMINAL_DEPLOY_STATUSES, () => ctx.client.getDeployment({ teamId: ctx.teamId, slug }));
|
|
608
|
+
}
|
|
609
|
+
catch (error) {
|
|
610
|
+
return renderApiError(error, ctx.err);
|
|
611
|
+
}
|
|
612
|
+
warnMissingSecrets(ctx, slug, declaredSecretNames([manifest]), detail.secretNames);
|
|
613
|
+
const payload = accepted.aliasToken === undefined ? detail : { ...detail, aliasToken: accepted.aliasToken };
|
|
614
|
+
if (extras?.jsonCollect !== undefined) {
|
|
615
|
+
extras.jsonCollect.push(payload);
|
|
616
|
+
return detail.status === "running" ? 0 : 1;
|
|
617
|
+
}
|
|
618
|
+
if (ctx.json) {
|
|
619
|
+
ctx.out(`${JSON.stringify(payload, null, 2)}\n`);
|
|
620
|
+
return detail.status === "running" ? 0 : 1;
|
|
621
|
+
}
|
|
622
|
+
if (detail.status !== "running") {
|
|
623
|
+
ctx.err(`Deployment ${slug} ended ${detail.status}${deployFailureDetail(detail.lastError)}\n`);
|
|
624
|
+
return 1;
|
|
625
|
+
}
|
|
626
|
+
const deployedPublicRoutes = detail.publicRoutePaths ?? [];
|
|
627
|
+
ctx.out(`Deployed ${slug} (team ${ctx.teamId})\n` +
|
|
628
|
+
` status: running\n` +
|
|
629
|
+
` generation: ${detail.generation}\n` +
|
|
630
|
+
` kind: ${detail.deploymentKind}\n` +
|
|
631
|
+
` alias: ${aliasUrl}\n` +
|
|
632
|
+
` playground: ${aliasUrl}/playground (sign in with the alias token)\n` +
|
|
633
|
+
` open: ${CLI} playground --prod --slug ${slug} --team ${ctx.teamId}\n` +
|
|
634
|
+
// Paste-ready webhook URLs: these subtrees skip the alias token, so
|
|
635
|
+
// the channel handler must verify deliveries (webhook signatures).
|
|
636
|
+
deployedPublicRoutes
|
|
637
|
+
.map((path) => ` public: ${aliasUrl}${path} (no alias token)\n`)
|
|
638
|
+
.join(""));
|
|
639
|
+
await runPostDeployConnectorAuth(ctx, options, {
|
|
640
|
+
slug,
|
|
641
|
+
connections: manifest?.cursorAccountConnections ?? [],
|
|
642
|
+
serviceAccountId: deploymentServiceAccountId(detail),
|
|
643
|
+
});
|
|
644
|
+
return 0;
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Multi-agent parent whose children all declare `architecture: "v2"`:
|
|
648
|
+
* deploy ONE application whose release carries a component per child. The
|
|
649
|
+
* application slug derives from the parent directory name; each component
|
|
650
|
+
* key is the child's slug and its path is the child directory relative to
|
|
651
|
+
* the repo root (a shared --path names the parent's directory in the repo).
|
|
652
|
+
*/
|
|
653
|
+
async function deployAgentsdkApplication(ctx, options, targets, declarations) {
|
|
654
|
+
const parentDir = resolve(options.dir ?? ".");
|
|
655
|
+
const slug = slugFromDirectoryName(basename(parentDir));
|
|
656
|
+
if (slug === undefined) {
|
|
657
|
+
ctx.err(`Could not derive an application slug from the parent directory name ${JSON.stringify(basename(parentDir))} — rename it (deploy slugs use lowercase letters, digits, '-' or '_').\n`);
|
|
658
|
+
return 1;
|
|
659
|
+
}
|
|
660
|
+
const needsGitInference = options.repo === undefined || options.ref === undefined || options.path === undefined;
|
|
661
|
+
const inferred = needsGitInference
|
|
662
|
+
? await inferDeployGitSource(parentDir, {
|
|
663
|
+
...(options.git === undefined ? {} : { git: options.git }),
|
|
664
|
+
})
|
|
665
|
+
: {};
|
|
666
|
+
const gitRepoUrl = options.repo ?? inferred.gitRepoUrl;
|
|
667
|
+
const gitRef = options.ref ?? inferred.gitRef;
|
|
668
|
+
const parentPath = options.path ?? inferred.agentPath;
|
|
669
|
+
if (gitRepoUrl !== undefined && !gitRepoUrl.startsWith("https://")) {
|
|
670
|
+
ctx.err(`Invalid --repo: ${gitRepoUrl} (expected an https:// git repository URL)\n`);
|
|
671
|
+
return 1;
|
|
672
|
+
}
|
|
673
|
+
if (gitRepoUrl === undefined) {
|
|
674
|
+
ctx.err(MISSING_DEPLOY_REPO_HINT);
|
|
675
|
+
return 1;
|
|
676
|
+
}
|
|
677
|
+
for (const repo of options.cursorEventsRepos ?? []) {
|
|
678
|
+
if (!isValidCursorEventRepo(repo)) {
|
|
679
|
+
ctx.err(`Invalid --cursor-events-repo: ${repo} (expected owner/name, gitlab.com/<group>/<project>, or bitbucket.org/<workspace>/<repo>)\n`);
|
|
680
|
+
return 1;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
const components = targets.map((target) => ({
|
|
684
|
+
componentKey: target.slug,
|
|
685
|
+
agentPath: [parentPath, basename(target.dir)]
|
|
686
|
+
.filter((part) => part !== undefined && part !== "")
|
|
687
|
+
.join("/"),
|
|
688
|
+
persistent: declarations.componentPersistent[target.slug] === true,
|
|
689
|
+
image: declarations.componentImage[target.slug],
|
|
690
|
+
}));
|
|
691
|
+
if (!ctx.json) {
|
|
692
|
+
ctx.err(`Deploying "${slug}" as one v2 application with ${targets.length} components (slug from the parent directory name).\n` +
|
|
693
|
+
` architecture: v2\n` +
|
|
694
|
+
` source: ${gitRepoUrl}${gitRef === undefined ? "" : ` @ ${gitRef}`}\n` +
|
|
695
|
+
components
|
|
696
|
+
.map((component) => ` component: ${component.componentKey} (${component.agentPath ?? "."})${component.persistent ? " persistent" : ""}${component.image === undefined ? "" : ` image ${component.image}`}\n`)
|
|
697
|
+
.join(""));
|
|
698
|
+
}
|
|
699
|
+
return deployOneAgentsdk(ctx, undefined, {
|
|
700
|
+
// Multi-component: the flag travels on each component instead.
|
|
701
|
+
persistent: false,
|
|
702
|
+
slug,
|
|
703
|
+
gitRepoUrl,
|
|
704
|
+
gitRef,
|
|
705
|
+
agentPath: undefined,
|
|
706
|
+
components,
|
|
707
|
+
repositories: options.cursorEventsRepos,
|
|
708
|
+
hasScmChannels: declarations.hasScmChannels,
|
|
709
|
+
declaredSecretNames: declarations.declaredSecretNames,
|
|
710
|
+
hasDeploymentsChannels: declarations.hasDeploymentsChannels,
|
|
711
|
+
multiTenant: options.multiTenant === true,
|
|
712
|
+
template: readDeployTemplate(parentDir),
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* `architecture: "v2"` deploy: POST `/internal/agentsdk/deployments` and
|
|
717
|
+
* poll the matching GET.
|
|
718
|
+
*/
|
|
719
|
+
async function deployOneAgentsdk(ctx, extras, args) {
|
|
720
|
+
const { slug } = args;
|
|
721
|
+
const componentsLine = args.components === undefined
|
|
722
|
+
? ""
|
|
723
|
+
: ` components: ${args.components.map((component) => component.componentKey).join(", ")}\n`;
|
|
724
|
+
if (args.multiTenant && !ctx.json) {
|
|
725
|
+
ctx.err(" multi-tenant: existing product\n");
|
|
726
|
+
}
|
|
727
|
+
let accepted;
|
|
728
|
+
try {
|
|
729
|
+
accepted = await ctx.client.deployAgentkit({
|
|
730
|
+
teamId: ctx.teamId,
|
|
731
|
+
slug,
|
|
732
|
+
gitRepoUrl: args.gitRepoUrl,
|
|
733
|
+
gitRef: args.gitRef,
|
|
734
|
+
agentPath: args.agentPath,
|
|
735
|
+
components: args.components,
|
|
736
|
+
repositories: args.repositories,
|
|
737
|
+
...(args.multiTenant ? { multiTenant: true } : {}),
|
|
738
|
+
persistent: args.persistent,
|
|
739
|
+
image: args.image,
|
|
740
|
+
template: args.template,
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
catch (error) {
|
|
744
|
+
return renderApiError(error, ctx.err, {
|
|
745
|
+
multiTenant: args.multiTenant,
|
|
746
|
+
teamId: ctx.teamId,
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
if (!ctx.json && accepted.aliasToken !== undefined) {
|
|
750
|
+
ctx.out(aliasTokenBlock(accepted.aliasToken));
|
|
751
|
+
}
|
|
752
|
+
if (ctx.noWait) {
|
|
753
|
+
if (extras?.jsonCollect !== undefined) {
|
|
754
|
+
extras.jsonCollect.push(accepted);
|
|
755
|
+
}
|
|
756
|
+
else if (ctx.json) {
|
|
757
|
+
ctx.out(`${JSON.stringify(accepted, null, 2)}\n`);
|
|
758
|
+
}
|
|
759
|
+
else {
|
|
760
|
+
ctx.out(`Deploy accepted: ${slug} (team ${ctx.teamId}, v2)\n` +
|
|
761
|
+
` application: ${accepted.applicationId}\n` +
|
|
762
|
+
` release: ${accepted.releaseId}\n` +
|
|
763
|
+
` alias: ${ctx.client.aliasUrl(accepted.engineAlias)}\n` +
|
|
764
|
+
componentsLine);
|
|
765
|
+
}
|
|
766
|
+
return 0;
|
|
767
|
+
}
|
|
768
|
+
let detail;
|
|
769
|
+
try {
|
|
770
|
+
detail = await pollUntil(ctx, slug, TERMINAL_AGENTKIT_DEPLOY_STATUSES, () => ctx.client.getAgentkitDeploy({ teamId: ctx.teamId, slug }));
|
|
771
|
+
}
|
|
772
|
+
catch (error) {
|
|
773
|
+
return renderApiError(error, ctx.err);
|
|
774
|
+
}
|
|
775
|
+
const payload = { ...detail, aliasToken: accepted.aliasToken };
|
|
776
|
+
if (extras?.jsonCollect !== undefined) {
|
|
777
|
+
extras.jsonCollect.push(payload);
|
|
778
|
+
return detail.status === "running" ? 0 : 1;
|
|
779
|
+
}
|
|
780
|
+
if (ctx.json) {
|
|
781
|
+
ctx.out(`${JSON.stringify(payload, null, 2)}\n`);
|
|
782
|
+
return detail.status === "running" ? 0 : 1;
|
|
783
|
+
}
|
|
784
|
+
if (detail.status !== "running") {
|
|
785
|
+
ctx.err(`Deployment ${slug} ended ${detail.status}${deployFailureDetail(detail.lastError)}\n`);
|
|
786
|
+
return 1;
|
|
787
|
+
}
|
|
788
|
+
warnMissingSecrets(ctx, slug, args.declaredSecretNames, detail.secretNames);
|
|
789
|
+
const watchesRepositories = args.hasScmChannels || args.hasDeploymentsChannels === true;
|
|
790
|
+
ctx.out(`Deployed ${slug} (team ${ctx.teamId})\n` +
|
|
791
|
+
` status: running\n` +
|
|
792
|
+
` architecture: v2\n` +
|
|
793
|
+
` application: ${detail.applicationId}\n` +
|
|
794
|
+
` release: ${detail.releaseId}\n` +
|
|
795
|
+
` alias: ${ctx.client.aliasUrl(accepted.engineAlias)}\n` +
|
|
796
|
+
(args.components === undefined
|
|
797
|
+
? ""
|
|
798
|
+
: ` components: ${args.components
|
|
799
|
+
.map((component) => component.componentKey)
|
|
800
|
+
.join(", ")}\n`) +
|
|
801
|
+
(detail.repositories === undefined || !watchesRepositories
|
|
802
|
+
? ""
|
|
803
|
+
: ` watching: ${detail.repositories.length === 0 ? "(nothing)" : detail.repositories.join(", ")}\n`) +
|
|
804
|
+
livePublicWebhookLines(ctx, detail));
|
|
805
|
+
// No --cursor-events-repo hint: that flag fails closed without the webhook.
|
|
806
|
+
if (detail.unboundInferredRepository !== undefined) {
|
|
807
|
+
ctx.err(`warning: ${slug} is not watching ${detail.unboundInferredRepository}.\n` +
|
|
808
|
+
(detail.repositories !== undefined && detail.repositories.length > 0
|
|
809
|
+
? ` Kept the existing scopes: ${detail.repositories.join(", ")}.\n`
|
|
810
|
+
: ` The deployment watches nothing.\n`));
|
|
811
|
+
return 0;
|
|
812
|
+
}
|
|
813
|
+
// An agent with GitHub/GitLab/Origin/deployments channels bound to no
|
|
814
|
+
// repository scope gets no deliveries at all (deployments channels receive
|
|
815
|
+
// the watched repos' deployment events), which is otherwise invisible here.
|
|
816
|
+
if (watchesRepositories && detail.repositories?.length === 0) {
|
|
817
|
+
ctx.err(`warning: ${slug} watches no repositories, so its GitHub/GitLab/Origin/deployments channels receive no events.\n` +
|
|
818
|
+
` Redeploy with --cursor-events-repo <owner>/<name> or gitlab.com/<group>/<project> to set the scope.\n`);
|
|
819
|
+
}
|
|
820
|
+
return 0;
|
|
821
|
+
}
|
|
822
|
+
/**
|
|
823
|
+
* Post-deploy connector authorization for `cursorAccount` connections: the
|
|
824
|
+
* agent's connectors execute with tokens owned by the deployment's service
|
|
825
|
+
* account, which start out unauthorized. On a TTY this runs the dashboard's
|
|
826
|
+
* Authenticate flow inline (browser OAuth per connector, already-authorized
|
|
827
|
+
* ones skipped); otherwise it reports status only. Never affects the deploy
|
|
828
|
+
* outcome — anything left unauthorized just gets a playground-page pointer.
|
|
829
|
+
*/
|
|
830
|
+
async function runPostDeployConnectorAuth(ctx, options, args) {
|
|
831
|
+
if (args.connections.length === 0) {
|
|
832
|
+
return;
|
|
833
|
+
}
|
|
834
|
+
const { serviceAccountId } = args;
|
|
835
|
+
if (serviceAccountId === undefined) {
|
|
836
|
+
ctx.err(`warning: this agent uses Cursor account connectors, but the deployment has no service account; redeploy to mint one.\n`);
|
|
837
|
+
return;
|
|
838
|
+
}
|
|
839
|
+
const backendClient = new CursorBackendClient({
|
|
840
|
+
backendUrl: ctx.backendUrl,
|
|
841
|
+
apiKey: ctx.apiKey,
|
|
842
|
+
fetchImpl: options.fetchImpl,
|
|
843
|
+
});
|
|
844
|
+
const interactive = options.openBrowserImpl !== undefined ||
|
|
845
|
+
(process.stdout.isTTY === true && process.stdin.isTTY === true);
|
|
846
|
+
let anyUnauthorized = false;
|
|
847
|
+
for (const ref of args.connections) {
|
|
848
|
+
ctx.out(`\nThis agent uses Cursor account connectors (connection "${ref.name}"${ref.servers === undefined || ref.servers.length === 0 ? "" : `: ${ref.servers.join(", ")}`}).\n`);
|
|
849
|
+
try {
|
|
850
|
+
const result = await authorizeCursorAccountConnectors({
|
|
851
|
+
backendClient,
|
|
852
|
+
teamId: ctx.teamId,
|
|
853
|
+
slug: args.slug,
|
|
854
|
+
serviceAccountId,
|
|
855
|
+
connectionName: ref.name,
|
|
856
|
+
servers: ref.servers,
|
|
857
|
+
interactive,
|
|
858
|
+
out: ctx.out,
|
|
859
|
+
err: ctx.err,
|
|
860
|
+
openBrowserImpl: options.openBrowserImpl,
|
|
861
|
+
sleep: options.sleepImpl,
|
|
862
|
+
pollIntervalMs: options.connectorPollIntervalMs,
|
|
863
|
+
pollTimeoutMs: options.connectorPollTimeoutMs,
|
|
864
|
+
});
|
|
865
|
+
if (result.pending.length > 0 || result.errored.length > 0) {
|
|
866
|
+
anyUnauthorized = true;
|
|
867
|
+
if (result.pending.length > 0) {
|
|
868
|
+
ctx.out(`Connectors not authorized yet: ${result.pending.join(", ")}.\n`);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
catch (error) {
|
|
873
|
+
anyUnauthorized = true;
|
|
874
|
+
ctx.err(`warning: could not check connector authorization for "${ref.name}": ${describeError(error)}\n`);
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
if (anyUnauthorized) {
|
|
878
|
+
ctx.out(`You can authorize connectors at the playground page (cursor.com dashboard → Deployed Agents → ${args.slug}) or with \`${CLI} mcp oauth <connection>\`.\n`);
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Read the deploy-relevant bits of the project manifest at `dir` in one
|
|
883
|
+
* load: the `hosting` block, the agent's cursorAccount connections, and the
|
|
884
|
+
* channels declared public via `publicEndpoint()`.
|
|
885
|
+
*/
|
|
886
|
+
async function readDeployManifest(dir) {
|
|
887
|
+
const project = await loadAgentProject(dir);
|
|
888
|
+
// Fail here, before anything is dispatched: a project with error
|
|
889
|
+
// diagnostics (e.g. agent/storage.ts on architecture v2) would only be
|
|
890
|
+
// refused later by `serve` inside the hosted build, wasting a bake.
|
|
891
|
+
if (hasErrorDiagnostics(project)) {
|
|
892
|
+
throw new Error(`Refusing to deploy ${project.name} — it has errors:\n${formatDiagnostics(project.diagnostics.filter((d) => d.severity === "error"))}`);
|
|
893
|
+
}
|
|
894
|
+
return {
|
|
895
|
+
hosting: project.agent.hosting,
|
|
896
|
+
architecture: project.agent.architecture,
|
|
897
|
+
persistent: project.agent.persistent === true,
|
|
898
|
+
image: project.agent.hosting?.image,
|
|
899
|
+
cursorAccountConnections: project.agent.connections.flatMap((connection) => isCursorAccountTransport(connection.transport)
|
|
900
|
+
? [{ name: connection.name, servers: connection.transport.servers }]
|
|
901
|
+
: []),
|
|
902
|
+
publicChannelIds: project.channels
|
|
903
|
+
.filter((channel) => (channel.definition.auth ?? []).some(isPublicEndpointPolicy))
|
|
904
|
+
.map((channel) => channel.id),
|
|
905
|
+
publicChannelIdsWithDeadSecretPolicies: project.channels
|
|
906
|
+
.filter((channel) => {
|
|
907
|
+
const auth = channel.definition.auth ?? [];
|
|
908
|
+
return (auth.some(isPublicEndpointPolicy) &&
|
|
909
|
+
auth.some((policy) => {
|
|
910
|
+
const kind = catchAuthDeclaration(policy)?.kind;
|
|
911
|
+
return kind !== undefined && kind !== "public";
|
|
912
|
+
}));
|
|
913
|
+
})
|
|
914
|
+
.map((channel) => channel.id),
|
|
915
|
+
httpChannelPublicEndpoint: (project.httpChannel.auth ?? []).some(isPublicEndpointPolicy),
|
|
916
|
+
catchSecretNames: [
|
|
917
|
+
...new Set(project.channels.flatMap((channel) => channelCatchSecretNames(channel.definition))),
|
|
918
|
+
],
|
|
919
|
+
credentialSecretNames: [
|
|
920
|
+
...new Set(project.channels.flatMap((channel) => channelCredentialSecretNames(channel.definition))),
|
|
921
|
+
],
|
|
922
|
+
secretAlternatives: project.channels.flatMap((channel) => channelSecretAlternatives(channel.definition)),
|
|
923
|
+
hasScmChannels: project.channels.some((channel) => {
|
|
924
|
+
const kind = channel.definition.meta?.kind;
|
|
925
|
+
return kind === "github" || kind === "gitlab" || kind === "origin";
|
|
926
|
+
}),
|
|
927
|
+
hasDeploymentsChannels: project.channels.some((channel) => channel.definition.meta?.kind === "deployments"),
|
|
928
|
+
extensionEgress: (project.agent.extensions ?? []).flatMap((extension) => {
|
|
929
|
+
const egressDomains = extension.hosting?.egressDomains ?? [];
|
|
930
|
+
return egressDomains.length === 0 ? [] : [{ extension: extension.name, egressDomains }];
|
|
931
|
+
}),
|
|
932
|
+
};
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* Every secret name the deployment is expected to carry: the authored
|
|
936
|
+
* `hosting.secretNames` plus the names the control plane verifies caught
|
|
937
|
+
* requests with. Empty when the manifests declare none.
|
|
938
|
+
*/
|
|
939
|
+
function declaredSecretNames(manifests) {
|
|
940
|
+
return {
|
|
941
|
+
names: [
|
|
942
|
+
...new Set(manifests.flatMap((manifest) => manifest === undefined
|
|
943
|
+
? []
|
|
944
|
+
: [
|
|
945
|
+
...(manifest.hosting?.secretNames ?? []),
|
|
946
|
+
...manifest.catchSecretNames,
|
|
947
|
+
...manifest.credentialSecretNames,
|
|
948
|
+
])),
|
|
949
|
+
],
|
|
950
|
+
alternatives: manifests.flatMap((manifest) => manifest?.secretAlternatives ?? []),
|
|
951
|
+
};
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* Friendly post-deploy nudge: the manifest declares secrets the agent
|
|
955
|
+
* expects, but the deployment does not have them all set yet.
|
|
956
|
+
*/
|
|
957
|
+
function warnMissingSecrets(ctx, slug, declared, set) {
|
|
958
|
+
for (const group of unmetSecretAlternatives(declared?.alternatives ?? [], set)) {
|
|
959
|
+
ctx.err(`warning: none of ${group.names.join(", ")} is set on ${slug}: ${group.unsetEffect}\n` +
|
|
960
|
+
` set one with \`${CLI} secrets set ${slug} ${group.names[0]}\`\n`);
|
|
961
|
+
}
|
|
962
|
+
if (declared === undefined || declared.names.length === 0) {
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
const setNames = new Set(set ?? []);
|
|
966
|
+
// Platform-managed names (CURSOR_*, hosted storage) are injected by the
|
|
967
|
+
// control plane and never appear in secrets list — do not warn on them.
|
|
968
|
+
const missing = declared.names.filter((name) => !setNames.has(name) && !isReservedSecretName(name));
|
|
969
|
+
if (missing.length === 0) {
|
|
970
|
+
return;
|
|
971
|
+
}
|
|
972
|
+
ctx.err(`warning: secrets declared in the agent manifest but not set on ${slug}: ${missing.join(", ")}\n` +
|
|
973
|
+
` set them with \`${CLI} secrets set ${slug} ${missing.join(" ")}\`\n`);
|
|
974
|
+
}
|
|
975
|
+
// ============================================================================
|
|
976
|
+
// deployments (list)
|
|
977
|
+
// ============================================================================
|
|
978
|
+
export async function cmdDeployments(options) {
|
|
979
|
+
const ctx = await prepare(options);
|
|
980
|
+
if (typeof ctx === "number") {
|
|
981
|
+
return ctx;
|
|
982
|
+
}
|
|
983
|
+
let deployments;
|
|
984
|
+
try {
|
|
985
|
+
deployments = await ctx.client.listDeployments({ teamId: ctx.teamId });
|
|
986
|
+
}
|
|
987
|
+
catch (error) {
|
|
988
|
+
return renderApiError(error, ctx.err);
|
|
989
|
+
}
|
|
990
|
+
let applications = [];
|
|
991
|
+
try {
|
|
992
|
+
applications = await ctx.client.listAgentkitDeployments({
|
|
993
|
+
teamId: ctx.teamId,
|
|
994
|
+
});
|
|
995
|
+
}
|
|
996
|
+
catch (error) {
|
|
997
|
+
// Older control planes 404 this route; keep listing v1.
|
|
998
|
+
if (!(error instanceof DeployApiError && error.status === 404)) {
|
|
999
|
+
return renderApiError(error, ctx.err);
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
if (ctx.json) {
|
|
1003
|
+
// Empty v2 list keeps `{ deployments }` for v1-only parsers.
|
|
1004
|
+
ctx.out(`${JSON.stringify(applications.length === 0 ? { deployments } : { deployments, applications }, null, 2)}\n`);
|
|
1005
|
+
return 0;
|
|
1006
|
+
}
|
|
1007
|
+
if (deployments.length === 0 && applications.length === 0) {
|
|
1008
|
+
ctx.out(`No deployments on team ${ctx.teamId}. Create one with \`${CLI} deploy\`.\n`);
|
|
1009
|
+
return 0;
|
|
1010
|
+
}
|
|
1011
|
+
ctx.out(`${renderTable(["SLUG", "ARCH", "STATUS", "GEN", "KIND", "UPDATED"], [
|
|
1012
|
+
...deployments.map((d) => [
|
|
1013
|
+
d.slug,
|
|
1014
|
+
"v1",
|
|
1015
|
+
d.status,
|
|
1016
|
+
String(d.generation),
|
|
1017
|
+
d.deploymentKind,
|
|
1018
|
+
d.desiredUpdatedAt ?? "",
|
|
1019
|
+
]),
|
|
1020
|
+
...applications.map((application) => [
|
|
1021
|
+
application.slug,
|
|
1022
|
+
"v2",
|
|
1023
|
+
application.status,
|
|
1024
|
+
"-",
|
|
1025
|
+
"application",
|
|
1026
|
+
application.deployments
|
|
1027
|
+
.map((row) => row.desiredUpdatedAt)
|
|
1028
|
+
.sort()
|
|
1029
|
+
.at(-1) ?? "",
|
|
1030
|
+
]),
|
|
1031
|
+
])}\n`);
|
|
1032
|
+
return 0;
|
|
1033
|
+
}
|
|
1034
|
+
// ============================================================================
|
|
1035
|
+
// deployment <slug> (detail)
|
|
1036
|
+
// ============================================================================
|
|
1037
|
+
export async function cmdDeploymentStatus(slug, options) {
|
|
1038
|
+
if (slug === undefined || slug === "") {
|
|
1039
|
+
(options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} deployment <slug> [--team <id>] [--json]\n`);
|
|
1040
|
+
return 1;
|
|
1041
|
+
}
|
|
1042
|
+
const ctx = await prepare(options);
|
|
1043
|
+
if (typeof ctx === "number") {
|
|
1044
|
+
return ctx;
|
|
1045
|
+
}
|
|
1046
|
+
// Same dispatch as `stop`: v1 409s architecture-v2 slugs, so the v2
|
|
1047
|
+
// GET goes first. A v2 404 (missing slug, or an older backend) falls
|
|
1048
|
+
// through to the v1 agent-serve detail.
|
|
1049
|
+
try {
|
|
1050
|
+
const detail = await ctx.client.getAgentkitDeploy({
|
|
1051
|
+
teamId: ctx.teamId,
|
|
1052
|
+
slug,
|
|
1053
|
+
});
|
|
1054
|
+
renderAgentkitDeploymentStatus(ctx, detail);
|
|
1055
|
+
return 0;
|
|
1056
|
+
}
|
|
1057
|
+
catch (error) {
|
|
1058
|
+
if (!(error instanceof DeployApiError) || error.status !== 404) {
|
|
1059
|
+
return renderApiError(error, ctx.err);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
let detail;
|
|
1063
|
+
try {
|
|
1064
|
+
detail = await ctx.client.getDeployment({ teamId: ctx.teamId, slug });
|
|
1065
|
+
}
|
|
1066
|
+
catch (error) {
|
|
1067
|
+
return renderApiError(error, ctx.err);
|
|
1068
|
+
}
|
|
1069
|
+
if (ctx.json) {
|
|
1070
|
+
ctx.out(`${JSON.stringify(detail, null, 2)}\n`);
|
|
1071
|
+
return 0;
|
|
1072
|
+
}
|
|
1073
|
+
const aliasUrl = ctx.client.aliasUrl(detail.engineAlias);
|
|
1074
|
+
const lines = [`${detail.slug} (team ${detail.teamId})`, ` status: ${detail.status}`];
|
|
1075
|
+
if (detail.progress !== undefined) {
|
|
1076
|
+
lines.push(` progress: ${detail.progress}`);
|
|
1077
|
+
}
|
|
1078
|
+
if (detail.statusMessage !== null &&
|
|
1079
|
+
detail.statusMessage !== undefined &&
|
|
1080
|
+
detail.statusMessage.trim() !== "") {
|
|
1081
|
+
lines.push(` step: ${detail.statusMessage}`);
|
|
1082
|
+
}
|
|
1083
|
+
lines.push(` generation: ${detail.generation}`, ` kind: ${detail.deploymentKind}`, ` alias: ${aliasUrl}`, ` playground: ${aliasUrl}/playground`);
|
|
1084
|
+
if (detail.gitRepoUrl !== null && detail.gitRepoUrl !== undefined) {
|
|
1085
|
+
lines.push(` repo: ${detail.gitRepoUrl} @ ${detail.gitRef ?? ""}`);
|
|
1086
|
+
}
|
|
1087
|
+
if (detail.serviceAccountId !== undefined && detail.serviceAccountId !== null) {
|
|
1088
|
+
lines.push(` service account: ${detail.serviceAccountId}`);
|
|
1089
|
+
}
|
|
1090
|
+
if (detail.agentStoreSourceId !== undefined) {
|
|
1091
|
+
// The durable file store's address: GET /v0/agent-serve-files/<id> lists
|
|
1092
|
+
// it, and the pod sees it as AGENT_SERVE_STORE_SOURCE_ID.
|
|
1093
|
+
lines.push(` file store: ${detail.agentStoreSourceId}`);
|
|
1094
|
+
}
|
|
1095
|
+
if (detail.egressAllowedDomains !== undefined && detail.egressAllowedDomains.length > 0) {
|
|
1096
|
+
lines.push(` egress: ${detail.egressAllowedDomains.join(", ")}`);
|
|
1097
|
+
}
|
|
1098
|
+
if (detail.publicRoutePaths !== undefined && detail.publicRoutePaths.length > 0) {
|
|
1099
|
+
// Served through the alias WITHOUT X-Agent-Alias-Token (the channel
|
|
1100
|
+
// authenticates deliveries itself).
|
|
1101
|
+
for (const path of detail.publicRoutePaths) {
|
|
1102
|
+
lines.push(` public: ${aliasUrl}${path} (no alias token)`);
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
if (detail.secretNames !== undefined && detail.secretNames.length > 0) {
|
|
1106
|
+
lines.push(` secrets: ${detail.secretNames.join(", ")}`);
|
|
1107
|
+
}
|
|
1108
|
+
if (detail.podCredentialMaskedKey !== undefined && detail.podCredentialMaskedKey !== null) {
|
|
1109
|
+
lines.push(` pod credential: ${detail.podCredentialMaskedKey}`);
|
|
1110
|
+
}
|
|
1111
|
+
if (detail.engineUrl !== null && detail.engineUrl !== undefined) {
|
|
1112
|
+
lines.push(` engine: ${detail.engineUrl}`);
|
|
1113
|
+
}
|
|
1114
|
+
if (detail.engineAccess !== null &&
|
|
1115
|
+
detail.engineAccess !== undefined &&
|
|
1116
|
+
typeof detail.engineAccess === "object") {
|
|
1117
|
+
lines.push(` engine access: ${detail.engineAccess.url} (expires ${detail.engineAccess.expiresAt})`);
|
|
1118
|
+
}
|
|
1119
|
+
if (detail.lastError !== null && detail.lastError !== undefined) {
|
|
1120
|
+
lines.push(` last error: ${sanitizeCustomerError(detail.lastError)}`);
|
|
1121
|
+
}
|
|
1122
|
+
if (detail.desiredUpdatedAt !== undefined) {
|
|
1123
|
+
lines.push(` updated: ${detail.desiredUpdatedAt}`);
|
|
1124
|
+
}
|
|
1125
|
+
ctx.out(`${lines.join("\n")}\n`);
|
|
1126
|
+
return 0;
|
|
1127
|
+
}
|
|
1128
|
+
/**
|
|
1129
|
+
* Absolute webhook URLs for channels the running release actually admits
|
|
1130
|
+
* without an alias token. A missing alias or an empty path list prints
|
|
1131
|
+
* nothing — a relative `/v1/channels/…` line is not a live URL. A
|
|
1132
|
+
* multi-tenant release returns an empty list: the engine alias 404s, and
|
|
1133
|
+
* the deployment URL is not this application's alias.
|
|
1134
|
+
*/
|
|
1135
|
+
function livePublicWebhookLines(ctx, detail) {
|
|
1136
|
+
const engineAlias = detail.engineAlias;
|
|
1137
|
+
if (detail.status !== "running" || engineAlias === undefined) {
|
|
1138
|
+
return "";
|
|
1139
|
+
}
|
|
1140
|
+
return (detail.publicRoutePaths ?? [])
|
|
1141
|
+
.map((path) => ` public: ${ctx.client.aliasUrl(engineAlias)}${path} (no alias token)\n`)
|
|
1142
|
+
.join("");
|
|
1143
|
+
}
|
|
1144
|
+
function renderAgentkitDeploymentStatus(ctx, detail) {
|
|
1145
|
+
if (ctx.json) {
|
|
1146
|
+
ctx.out(`${JSON.stringify(detail, null, 2)}\n`);
|
|
1147
|
+
return;
|
|
1148
|
+
}
|
|
1149
|
+
const lines = [
|
|
1150
|
+
`${detail.slug} (team ${detail.teamId})`,
|
|
1151
|
+
` status: ${detail.status}`,
|
|
1152
|
+
` architecture: v2`,
|
|
1153
|
+
` application: ${detail.applicationId}`,
|
|
1154
|
+
` release: ${detail.releaseId}`,
|
|
1155
|
+
` progress: ${detail.progress}`,
|
|
1156
|
+
];
|
|
1157
|
+
if (detail.statusMessage !== null && detail.statusMessage.trim() !== "") {
|
|
1158
|
+
lines.push(` step: ${detail.statusMessage}`);
|
|
1159
|
+
}
|
|
1160
|
+
if (detail.repositories !== undefined) {
|
|
1161
|
+
lines.push(` watching: ${detail.repositories.length === 0 ? "(nothing)" : detail.repositories.join(", ")}`);
|
|
1162
|
+
}
|
|
1163
|
+
if (detail.secretNames !== undefined && detail.secretNames.length > 0) {
|
|
1164
|
+
lines.push(` secrets: ${detail.secretNames.join(", ")}`);
|
|
1165
|
+
}
|
|
1166
|
+
const publicLines = livePublicWebhookLines(ctx, detail);
|
|
1167
|
+
if (publicLines.length > 0) {
|
|
1168
|
+
lines.push(...publicLines.replace(/\n$/, "").split("\n"));
|
|
1169
|
+
}
|
|
1170
|
+
if (detail.lastError !== null && detail.lastError !== undefined) {
|
|
1171
|
+
lines.push(` last error: ${sanitizeCustomerError(detail.lastError)}`);
|
|
1172
|
+
}
|
|
1173
|
+
ctx.out(`${lines.join("\n")}\n`);
|
|
1174
|
+
}
|
|
1175
|
+
// ============================================================================
|
|
1176
|
+
// stop <slug>
|
|
1177
|
+
// ============================================================================
|
|
1178
|
+
export async function cmdStop(slug, options) {
|
|
1179
|
+
if (slug === undefined || slug === "") {
|
|
1180
|
+
(options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} stop <slug> [--team <id>] [--json] [--no-wait]\n`);
|
|
1181
|
+
return 1;
|
|
1182
|
+
}
|
|
1183
|
+
const ctx = await prepare(options);
|
|
1184
|
+
if (typeof ctx === "number") {
|
|
1185
|
+
return ctx;
|
|
1186
|
+
}
|
|
1187
|
+
// Stop takes only a slug, so there is no manifest to dispatch on (unlike
|
|
1188
|
+
// deploy). The v2 agentsdk control plane goes first: v1 endpoints refuse
|
|
1189
|
+
// `architecture: "v2"` slugs with a 409 rather than a 404, so v1-first
|
|
1190
|
+
// could not fall through. A v2 404 (including an older backend without
|
|
1191
|
+
// the `/internal/agentsdk` mount) falls back to the v1 stop.
|
|
1192
|
+
let architecture = "v2";
|
|
1193
|
+
let accepted;
|
|
1194
|
+
try {
|
|
1195
|
+
accepted = await ctx.client.stopAgentkit({
|
|
1196
|
+
teamId: ctx.teamId,
|
|
1197
|
+
slug,
|
|
1198
|
+
cancelRuns: options.cancelRuns,
|
|
1199
|
+
});
|
|
1200
|
+
}
|
|
1201
|
+
catch (error) {
|
|
1202
|
+
if (!(error instanceof DeployApiError) || error.status !== 404) {
|
|
1203
|
+
return renderApiError(error, ctx.err);
|
|
1204
|
+
}
|
|
1205
|
+
if (options.cancelRuns === true) {
|
|
1206
|
+
ctx.err(`Canceling active runs while stopping is supported only for Agent SDK v2 deployments.\n`);
|
|
1207
|
+
return 1;
|
|
1208
|
+
}
|
|
1209
|
+
try {
|
|
1210
|
+
accepted = await ctx.client.stopDeployment({ teamId: ctx.teamId, slug });
|
|
1211
|
+
architecture = "v1";
|
|
1212
|
+
}
|
|
1213
|
+
catch (v1Error) {
|
|
1214
|
+
return renderApiError(v1Error, ctx.err);
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
const cancellation = "cancellation" in accepted ? accepted.cancellation : undefined;
|
|
1218
|
+
const stoppedGlobally = "scope" in accepted && accepted.scope === "global";
|
|
1219
|
+
if (ctx.noWait) {
|
|
1220
|
+
if (ctx.json) {
|
|
1221
|
+
ctx.out(`${JSON.stringify(accepted, null, 2)}\n`);
|
|
1222
|
+
}
|
|
1223
|
+
else {
|
|
1224
|
+
ctx.out(stoppedGlobally
|
|
1225
|
+
? `Stop accepted for ${slug} across all tenants (status: ${accepted.status}).\n`
|
|
1226
|
+
: `Stop accepted for ${slug} (status: ${accepted.status}).\n`);
|
|
1227
|
+
}
|
|
1228
|
+
return cancellation?.failed === 0 || cancellation === undefined ? 0 : 1;
|
|
1229
|
+
}
|
|
1230
|
+
let detail;
|
|
1231
|
+
try {
|
|
1232
|
+
detail =
|
|
1233
|
+
architecture === "v2"
|
|
1234
|
+
? await pollUntil(ctx, slug, new Set(["stopped"]), () => ctx.client.getAgentkitDeploy({ teamId: ctx.teamId, slug }))
|
|
1235
|
+
: await pollUntil(ctx, slug, new Set(["stopped"]), () => ctx.client.getDeployment({ teamId: ctx.teamId, slug }));
|
|
1236
|
+
}
|
|
1237
|
+
catch (error) {
|
|
1238
|
+
return renderApiError(error, ctx.err);
|
|
1239
|
+
}
|
|
1240
|
+
if (ctx.json) {
|
|
1241
|
+
ctx.out(`${JSON.stringify(detail, null, 2)}\n`);
|
|
1242
|
+
}
|
|
1243
|
+
else if (stoppedGlobally) {
|
|
1244
|
+
ctx.out(`Stopped ${slug} across all tenants (team ${ctx.teamId}); resume with \`${CLI} start ${slug}\`.\n`);
|
|
1245
|
+
}
|
|
1246
|
+
else {
|
|
1247
|
+
ctx.out(`Stopped ${slug} (team ${ctx.teamId}).\n`);
|
|
1248
|
+
}
|
|
1249
|
+
if (cancellation !== undefined) {
|
|
1250
|
+
return writeCancellationStarted(ctx, cancellation, slug);
|
|
1251
|
+
}
|
|
1252
|
+
return 0;
|
|
1253
|
+
}
|
|
1254
|
+
function writeCancellationStarted(ctx, cancellation, slug) {
|
|
1255
|
+
ctx.out(`Started cancellation across ${cancellation.batchesStarted} deployment batch(es).\n`);
|
|
1256
|
+
if (cancellation.sessionsMarkedFailed !== undefined) {
|
|
1257
|
+
ctx.out(`Marked ${cancellation.sessionsMarkedFailed} factory session(s) failed.\n`);
|
|
1258
|
+
}
|
|
1259
|
+
if (cancellation.failed > 0) {
|
|
1260
|
+
ctx.err(`Failed to start ${cancellation.failed} cancellation batch(es); retry with \`${CLI} cancel-runs ${slug}\`.\n`);
|
|
1261
|
+
return 1;
|
|
1262
|
+
}
|
|
1263
|
+
return 0;
|
|
1264
|
+
}
|
|
1265
|
+
export async function cmdStart(slug, options) {
|
|
1266
|
+
if (slug === undefined || slug === "") {
|
|
1267
|
+
(options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} start <slug> [--team <id>] [--json]\n`);
|
|
1268
|
+
return 1;
|
|
1269
|
+
}
|
|
1270
|
+
const ctx = await prepare(options);
|
|
1271
|
+
if (typeof ctx === "number") {
|
|
1272
|
+
return ctx;
|
|
1273
|
+
}
|
|
1274
|
+
try {
|
|
1275
|
+
const accepted = await ctx.client.startAgentkit({
|
|
1276
|
+
teamId: ctx.teamId,
|
|
1277
|
+
slug,
|
|
1278
|
+
});
|
|
1279
|
+
if (ctx.json) {
|
|
1280
|
+
ctx.out(`${JSON.stringify(accepted, null, 2)}\n`);
|
|
1281
|
+
}
|
|
1282
|
+
else {
|
|
1283
|
+
ctx.out(`Started ${slug} (team ${ctx.teamId}).\n`);
|
|
1284
|
+
}
|
|
1285
|
+
return 0;
|
|
1286
|
+
}
|
|
1287
|
+
catch (error) {
|
|
1288
|
+
return renderApiError(error, ctx.err);
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
export async function cmdKill(slug, options) {
|
|
1292
|
+
if (slug === undefined || slug === "") {
|
|
1293
|
+
(options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} kill <slug> [--team <id>] [--json]\n`);
|
|
1294
|
+
return 1;
|
|
1295
|
+
}
|
|
1296
|
+
const ctx = await prepare(options);
|
|
1297
|
+
if (typeof ctx === "number") {
|
|
1298
|
+
return ctx;
|
|
1299
|
+
}
|
|
1300
|
+
let accepted;
|
|
1301
|
+
try {
|
|
1302
|
+
accepted = await ctx.client.killAgentkit({ teamId: ctx.teamId, slug });
|
|
1303
|
+
}
|
|
1304
|
+
catch (error) {
|
|
1305
|
+
return renderApiError(error, ctx.err);
|
|
1306
|
+
}
|
|
1307
|
+
if (ctx.json) {
|
|
1308
|
+
ctx.out(`${JSON.stringify(accepted, null, 2)}\n`);
|
|
1309
|
+
}
|
|
1310
|
+
else {
|
|
1311
|
+
ctx.out(accepted.scope === "global"
|
|
1312
|
+
? `Killed ${slug} across all tenants (team ${ctx.teamId}): deploys locked, admission stopped.\n`
|
|
1313
|
+
: `Killed ${slug} (team ${ctx.teamId}): deploys locked, admission stopped.\n`);
|
|
1314
|
+
ctx.out(`Resume traffic with \`${CLI} unlock-deploys ${slug}\` then \`${CLI} start ${slug}\`.\n`);
|
|
1315
|
+
ctx.out(`Unlock deploys with \`${CLI} unlock-deploys ${slug}\`.\n`);
|
|
1316
|
+
}
|
|
1317
|
+
if (accepted.cancellation !== undefined) {
|
|
1318
|
+
return writeCancellationStarted(ctx, accepted.cancellation, slug);
|
|
1319
|
+
}
|
|
1320
|
+
return 0;
|
|
1321
|
+
}
|
|
1322
|
+
export async function cmdUnlockDeploys(slug, options) {
|
|
1323
|
+
if (slug === undefined || slug === "") {
|
|
1324
|
+
(options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} unlock-deploys <slug> [--team <id>] [--json]\n`);
|
|
1325
|
+
return 1;
|
|
1326
|
+
}
|
|
1327
|
+
const ctx = await prepare(options);
|
|
1328
|
+
if (typeof ctx === "number") {
|
|
1329
|
+
return ctx;
|
|
1330
|
+
}
|
|
1331
|
+
try {
|
|
1332
|
+
const accepted = await ctx.client.unlockAgentkitDeploys({
|
|
1333
|
+
teamId: ctx.teamId,
|
|
1334
|
+
slug,
|
|
1335
|
+
});
|
|
1336
|
+
if (ctx.json) {
|
|
1337
|
+
ctx.out(`${JSON.stringify(accepted, null, 2)}\n`);
|
|
1338
|
+
}
|
|
1339
|
+
else {
|
|
1340
|
+
ctx.out(`Unlocked deploys for ${slug} (team ${ctx.teamId}).\n`);
|
|
1341
|
+
}
|
|
1342
|
+
return 0;
|
|
1343
|
+
}
|
|
1344
|
+
catch (error) {
|
|
1345
|
+
return renderApiError(error, ctx.err);
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
export async function cmdCancelRuns(slug, options) {
|
|
1349
|
+
if (slug === undefined || slug === "") {
|
|
1350
|
+
(options.err ?? ((text) => void process.stderr.write(text)))(`Usage: ${CLI} cancel-runs <slug> [--team <id>] [--json]\n`);
|
|
1351
|
+
return 1;
|
|
1352
|
+
}
|
|
1353
|
+
const ctx = await prepare(options);
|
|
1354
|
+
if (typeof ctx === "number") {
|
|
1355
|
+
return ctx;
|
|
1356
|
+
}
|
|
1357
|
+
let result;
|
|
1358
|
+
try {
|
|
1359
|
+
result = await ctx.client.cancelAgentkitRuns({
|
|
1360
|
+
teamId: ctx.teamId,
|
|
1361
|
+
slug,
|
|
1362
|
+
});
|
|
1363
|
+
}
|
|
1364
|
+
catch (error) {
|
|
1365
|
+
return renderApiError(error, ctx.err);
|
|
1366
|
+
}
|
|
1367
|
+
if (ctx.json) {
|
|
1368
|
+
ctx.out(`${JSON.stringify(result, null, 2)}\n`);
|
|
1369
|
+
}
|
|
1370
|
+
else {
|
|
1371
|
+
ctx.out(`Started cancellation across ${result.batchesStarted} deployment batch(es).\n`);
|
|
1372
|
+
if (result.sessionsMarkedFailed !== undefined) {
|
|
1373
|
+
ctx.out(`Marked ${result.sessionsMarkedFailed} factory session(s) failed.\n`);
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
if (result.failed > 0) {
|
|
1377
|
+
ctx.err(`Failed to start ${result.failed} cancellation batch(es).\n`);
|
|
1378
|
+
return 1;
|
|
1379
|
+
}
|
|
1380
|
+
return 0;
|
|
1381
|
+
}
|
|
1382
|
+
// ============================================================================
|
|
1383
|
+
// event-repos <slug> --repo <owner/name>...
|
|
1384
|
+
// ============================================================================
|
|
1385
|
+
export async function cmdEventRepos(slug, repositories, options) {
|
|
1386
|
+
if (slug === undefined || slug === "") {
|
|
1387
|
+
(options.err ?? ((text) => void process.stderr.write(text)))(`Usage: ${CLI} event-repos <slug> --repo <owner/name>... [--team <id>] [--json]\n`);
|
|
1388
|
+
return 1;
|
|
1389
|
+
}
|
|
1390
|
+
const ctx = await prepare(options);
|
|
1391
|
+
if (typeof ctx === "number") {
|
|
1392
|
+
return ctx;
|
|
1393
|
+
}
|
|
1394
|
+
let configured;
|
|
1395
|
+
try {
|
|
1396
|
+
configured = await ctx.client.setAgentkitEventRepositories({
|
|
1397
|
+
teamId: ctx.teamId,
|
|
1398
|
+
slug,
|
|
1399
|
+
repositories,
|
|
1400
|
+
});
|
|
1401
|
+
}
|
|
1402
|
+
catch (error) {
|
|
1403
|
+
return renderApiError(error, ctx.err);
|
|
1404
|
+
}
|
|
1405
|
+
if (ctx.json) {
|
|
1406
|
+
ctx.out(`${JSON.stringify({ repositories: configured }, null, 2)}\n`);
|
|
1407
|
+
}
|
|
1408
|
+
else if (configured.length === 0) {
|
|
1409
|
+
ctx.out(`${slug} now watches no repositories.\n`);
|
|
1410
|
+
}
|
|
1411
|
+
else {
|
|
1412
|
+
ctx.out(`${slug} now watches ${configured.join(", ")}.\n`);
|
|
1413
|
+
}
|
|
1414
|
+
return 0;
|
|
1415
|
+
}
|
|
1416
|
+
// ============================================================================
|
|
1417
|
+
// upgrade <slug>
|
|
1418
|
+
// ============================================================================
|
|
1419
|
+
/** Release ids are uuids; anything else the user typed is a version. */
|
|
1420
|
+
const RELEASE_ID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
1421
|
+
export async function cmdUpgrade(args, options) {
|
|
1422
|
+
return cmdPinRelease(args, options, {
|
|
1423
|
+
usage: `Usage: ${CLI} upgrade <slug> [--release <id|version>] [--team <id>] [--json]\n`,
|
|
1424
|
+
pin: (client, request) => client.upgradeAgentkitInstall(request),
|
|
1425
|
+
success: (slug, releaseId) => `${slug} now runs release ${releaseId}.\n`,
|
|
1426
|
+
});
|
|
1427
|
+
}
|
|
1428
|
+
export async function cmdRollback(args, options) {
|
|
1429
|
+
return cmdPinRelease(args, options, {
|
|
1430
|
+
usage: `Usage: ${CLI} rollback <slug> [--release <id|version>] [--team <id>] [--json]\n`,
|
|
1431
|
+
pin: (client, request) => client.rollbackAgentkitInstall(request),
|
|
1432
|
+
success: (slug, releaseId) => `${slug} rolled back to release ${releaseId}.\n`,
|
|
1433
|
+
});
|
|
1434
|
+
}
|
|
1435
|
+
async function cmdPinRelease(args, options, pin) {
|
|
1436
|
+
const { slug, release } = args;
|
|
1437
|
+
if (slug === undefined || slug === "") {
|
|
1438
|
+
(options.err ?? ((text) => void process.stderr.write(text)))(pin.usage);
|
|
1439
|
+
return 1;
|
|
1440
|
+
}
|
|
1441
|
+
const ctx = await prepare(options);
|
|
1442
|
+
if (typeof ctx === "number") {
|
|
1443
|
+
return ctx;
|
|
1444
|
+
}
|
|
1445
|
+
const selector = release?.trim() ?? "";
|
|
1446
|
+
let releaseId;
|
|
1447
|
+
try {
|
|
1448
|
+
releaseId = await pin.pin(ctx.client, {
|
|
1449
|
+
teamId: ctx.teamId,
|
|
1450
|
+
slug,
|
|
1451
|
+
...(selector === ""
|
|
1452
|
+
? {}
|
|
1453
|
+
: RELEASE_ID_RE.test(selector)
|
|
1454
|
+
? { releaseId: selector }
|
|
1455
|
+
: { version: selector }),
|
|
1456
|
+
});
|
|
1457
|
+
}
|
|
1458
|
+
catch (error) {
|
|
1459
|
+
return renderApiError(error, ctx.err);
|
|
1460
|
+
}
|
|
1461
|
+
if (ctx.json) {
|
|
1462
|
+
ctx.out(`${JSON.stringify({ releaseId }, null, 2)}\n`);
|
|
1463
|
+
}
|
|
1464
|
+
else {
|
|
1465
|
+
ctx.out(pin.success(slug, releaseId));
|
|
1466
|
+
}
|
|
1467
|
+
return 0;
|
|
1468
|
+
}
|
|
1469
|
+
// ============================================================================
|
|
1470
|
+
// delete <slug>
|
|
1471
|
+
// ============================================================================
|
|
1472
|
+
export async function cmdDelete(slug, options) {
|
|
1473
|
+
if (slug === undefined || slug === "") {
|
|
1474
|
+
(options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} delete <slug> [--team <id>] [--json] [--no-wait]\n`);
|
|
1475
|
+
return 1;
|
|
1476
|
+
}
|
|
1477
|
+
const ctx = await prepare(options);
|
|
1478
|
+
if (typeof ctx === "number") {
|
|
1479
|
+
return ctx;
|
|
1480
|
+
}
|
|
1481
|
+
// Same dispatch as `stop`: v1 409s architecture-v2 slugs, so the v2
|
|
1482
|
+
// DELETE goes first. A v2 404 (missing slug, or an older backend)
|
|
1483
|
+
// falls through to the v1 agent-serve delete.
|
|
1484
|
+
let architecture = "v2";
|
|
1485
|
+
let accepted;
|
|
1486
|
+
try {
|
|
1487
|
+
accepted = await ctx.client.deleteAgentkit({ teamId: ctx.teamId, slug });
|
|
1488
|
+
}
|
|
1489
|
+
catch (error) {
|
|
1490
|
+
if (!(error instanceof DeployApiError) || error.status !== 404) {
|
|
1491
|
+
return renderApiError(error, ctx.err);
|
|
1492
|
+
}
|
|
1493
|
+
try {
|
|
1494
|
+
accepted = await ctx.client.deleteDeployment({
|
|
1495
|
+
teamId: ctx.teamId,
|
|
1496
|
+
slug,
|
|
1497
|
+
});
|
|
1498
|
+
architecture = "v1";
|
|
1499
|
+
}
|
|
1500
|
+
catch (v1Error) {
|
|
1501
|
+
return renderApiError(v1Error, ctx.err);
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
if (ctx.noWait) {
|
|
1505
|
+
if (ctx.json) {
|
|
1506
|
+
ctx.out(`${JSON.stringify(accepted, null, 2)}\n`);
|
|
1507
|
+
}
|
|
1508
|
+
else {
|
|
1509
|
+
ctx.out(`Delete accepted for ${slug} (status: ${accepted.status}).\n`);
|
|
1510
|
+
}
|
|
1511
|
+
return 0;
|
|
1512
|
+
}
|
|
1513
|
+
try {
|
|
1514
|
+
await pollUntilGone(ctx, slug, () => architecture === "v2"
|
|
1515
|
+
? ctx.client.getAgentkitDeploy({ teamId: ctx.teamId, slug })
|
|
1516
|
+
: ctx.client.getDeployment({ teamId: ctx.teamId, slug }));
|
|
1517
|
+
}
|
|
1518
|
+
catch (error) {
|
|
1519
|
+
return renderApiError(error, ctx.err);
|
|
1520
|
+
}
|
|
1521
|
+
if (ctx.json) {
|
|
1522
|
+
ctx.out(`${JSON.stringify({ slug, status: "deleted" }, null, 2)}\n`);
|
|
1523
|
+
}
|
|
1524
|
+
else {
|
|
1525
|
+
ctx.out(`Deleted ${slug} (team ${ctx.teamId}).\n`);
|
|
1526
|
+
}
|
|
1527
|
+
return 0;
|
|
1528
|
+
}
|
|
1529
|
+
// ============================================================================
|
|
1530
|
+
// rotate-token <slug>
|
|
1531
|
+
// ============================================================================
|
|
1532
|
+
export async function cmdRotateToken(slug, options) {
|
|
1533
|
+
if (slug === undefined || slug === "") {
|
|
1534
|
+
(options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} rotate-token <slug> [--team <id>]\n`);
|
|
1535
|
+
return 1;
|
|
1536
|
+
}
|
|
1537
|
+
const ctx = await prepare(options);
|
|
1538
|
+
if (typeof ctx === "number") {
|
|
1539
|
+
return ctx;
|
|
1540
|
+
}
|
|
1541
|
+
let aliasToken;
|
|
1542
|
+
try {
|
|
1543
|
+
const architecture = await deploymentArchitecture({
|
|
1544
|
+
client: ctx.client,
|
|
1545
|
+
teamId: ctx.teamId,
|
|
1546
|
+
slug,
|
|
1547
|
+
});
|
|
1548
|
+
aliasToken =
|
|
1549
|
+
architecture === "v2"
|
|
1550
|
+
? await ctx.client.rotateAgentsdkAliasToken({
|
|
1551
|
+
teamId: ctx.teamId,
|
|
1552
|
+
slug,
|
|
1553
|
+
})
|
|
1554
|
+
: await ctx.client.rotateAliasToken({
|
|
1555
|
+
teamId: ctx.teamId,
|
|
1556
|
+
slug,
|
|
1557
|
+
});
|
|
1558
|
+
}
|
|
1559
|
+
catch (error) {
|
|
1560
|
+
return renderApiError(error, ctx.err);
|
|
1561
|
+
}
|
|
1562
|
+
if (ctx.json) {
|
|
1563
|
+
ctx.out(`${JSON.stringify({ aliasToken }, null, 2)}\n`);
|
|
1564
|
+
return 0;
|
|
1565
|
+
}
|
|
1566
|
+
ctx.out(`Rotated the alias token for ${slug}. The old token stopped working immediately.\n${aliasTokenBlock(aliasToken)}`);
|
|
1567
|
+
return 0;
|
|
1568
|
+
}
|
|
1569
|
+
// ============================================================================
|
|
1570
|
+
// secrets set|list|unset
|
|
1571
|
+
// ============================================================================
|
|
1572
|
+
async function secretDeploymentArchitecture(ctx, slug) {
|
|
1573
|
+
return deploymentArchitecture({
|
|
1574
|
+
client: ctx.client,
|
|
1575
|
+
teamId: ctx.teamId,
|
|
1576
|
+
slug,
|
|
1577
|
+
});
|
|
1578
|
+
}
|
|
1579
|
+
export async function cmdSecretsSet(slug, specs, options) {
|
|
1580
|
+
const usageErr = options.err ?? ((t) => void process.stderr.write(t));
|
|
1581
|
+
if (slug === undefined || slug === "" || specs.length === 0) {
|
|
1582
|
+
usageErr(`Usage: ${CLI} secrets set <slug> NAME [NAME2 ...] [--team <id>] [--json]\n` +
|
|
1583
|
+
` Hidden prompt on a TTY. One NAME reads all of stdin (redirect a PEM).\n` +
|
|
1584
|
+
` Several NAMEs: one stdin line each.\n` +
|
|
1585
|
+
` Opt-in (leaks into argv / agent terminals): NAME=VALUE … --from-argv\n`);
|
|
1586
|
+
return 1;
|
|
1587
|
+
}
|
|
1588
|
+
// Parse and validate every name before prompting for any value, so a
|
|
1589
|
+
// typo in the last name cannot waste typed-in secrets.
|
|
1590
|
+
const parsed = [];
|
|
1591
|
+
for (const spec of specs) {
|
|
1592
|
+
const eq = spec.indexOf("=");
|
|
1593
|
+
const name = eq === -1 ? spec : spec.slice(0, eq);
|
|
1594
|
+
const nameError = validateSettableSecretName(name);
|
|
1595
|
+
if (nameError !== undefined) {
|
|
1596
|
+
usageErr(`${nameError}\n`);
|
|
1597
|
+
return 1;
|
|
1598
|
+
}
|
|
1599
|
+
parsed.push(eq === -1 ? { name } : { name, value: spec.slice(eq + 1) });
|
|
1600
|
+
}
|
|
1601
|
+
const hasArgvValues = parsed.some((entry) => entry.value !== undefined);
|
|
1602
|
+
if (hasArgvValues && options.fromArgv !== true) {
|
|
1603
|
+
usageErr(`Refusing NAME=VALUE on argv (shows up in shell history and agent-captured terminals).\n` +
|
|
1604
|
+
`Pass names only:\n` +
|
|
1605
|
+
` ${CLI} secrets set ${slug} NAME\n` +
|
|
1606
|
+
`Hidden prompt on a TTY. One NAME reads all of stdin, including newlines:\n` +
|
|
1607
|
+
` ${CLI} secrets set ${slug} NAME < ./secret.pem\n` +
|
|
1608
|
+
`Several NAMEs take one stdin line each.\n`);
|
|
1609
|
+
return 1;
|
|
1610
|
+
}
|
|
1611
|
+
if (hasArgvValues) {
|
|
1612
|
+
usageErr(`warning: --from-argv puts secret values in argv (shell history and agent-captured terminals).\n`);
|
|
1613
|
+
}
|
|
1614
|
+
const ctx = await prepare(options);
|
|
1615
|
+
if (typeof ctx === "number") {
|
|
1616
|
+
return ctx;
|
|
1617
|
+
}
|
|
1618
|
+
const stdin = options.stdin ?? process.stdin;
|
|
1619
|
+
const secrets = [];
|
|
1620
|
+
let secretNames;
|
|
1621
|
+
let architecture;
|
|
1622
|
+
try {
|
|
1623
|
+
const only = parsed.length === 1 ? parsed[0] : undefined;
|
|
1624
|
+
if (only !== undefined && only.value === undefined && stdin.isTTY !== true) {
|
|
1625
|
+
secrets.push({
|
|
1626
|
+
name: only.name,
|
|
1627
|
+
value: await readWholeStdinValue(stdin, only.name),
|
|
1628
|
+
});
|
|
1629
|
+
}
|
|
1630
|
+
else {
|
|
1631
|
+
const readValue = createSecretValueReader(stdin, ctx.err);
|
|
1632
|
+
for (const entry of parsed) {
|
|
1633
|
+
secrets.push({
|
|
1634
|
+
name: entry.name,
|
|
1635
|
+
value: entry.value ?? (await readValue(entry.name)),
|
|
1636
|
+
});
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
architecture = await secretDeploymentArchitecture(ctx, slug);
|
|
1640
|
+
secretNames =
|
|
1641
|
+
architecture === "v2"
|
|
1642
|
+
? await ctx.client.setAgentkitSecrets({
|
|
1643
|
+
teamId: ctx.teamId,
|
|
1644
|
+
slug,
|
|
1645
|
+
secrets,
|
|
1646
|
+
})
|
|
1647
|
+
: await ctx.client.setSecrets({
|
|
1648
|
+
teamId: ctx.teamId,
|
|
1649
|
+
slug,
|
|
1650
|
+
secrets,
|
|
1651
|
+
});
|
|
1652
|
+
}
|
|
1653
|
+
catch (error) {
|
|
1654
|
+
return renderApiError(error, ctx.err);
|
|
1655
|
+
}
|
|
1656
|
+
if (ctx.json) {
|
|
1657
|
+
ctx.out(`${JSON.stringify({ secretNames }, null, 2)}\n`);
|
|
1658
|
+
return 0;
|
|
1659
|
+
}
|
|
1660
|
+
ctx.out(`Set ${secrets.length} secret${secrets.length === 1 ? "" : "s"} on ${slug}.\n` +
|
|
1661
|
+
`Secrets now set: ${secretNames.join(", ")}\n` +
|
|
1662
|
+
(architecture === "v2"
|
|
1663
|
+
? `The next task picks them up; no redeploy is required.\n`
|
|
1664
|
+
: `The engine picks them up on its next deploy.\n`));
|
|
1665
|
+
return 0;
|
|
1666
|
+
}
|
|
1667
|
+
export async function cmdSecretsList(slug, options) {
|
|
1668
|
+
if (slug === undefined || slug === "") {
|
|
1669
|
+
(options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} secrets list <slug> [--team <id>] [--json]\n`);
|
|
1670
|
+
return 1;
|
|
1671
|
+
}
|
|
1672
|
+
const ctx = await prepare(options);
|
|
1673
|
+
if (typeof ctx === "number") {
|
|
1674
|
+
return ctx;
|
|
1675
|
+
}
|
|
1676
|
+
let secrets;
|
|
1677
|
+
try {
|
|
1678
|
+
const architecture = await secretDeploymentArchitecture(ctx, slug);
|
|
1679
|
+
secrets =
|
|
1680
|
+
architecture === "v2"
|
|
1681
|
+
? await ctx.client.listAgentkitSecrets({ teamId: ctx.teamId, slug })
|
|
1682
|
+
: await ctx.client.listSecrets({ teamId: ctx.teamId, slug });
|
|
1683
|
+
}
|
|
1684
|
+
catch (error) {
|
|
1685
|
+
return renderApiError(error, ctx.err);
|
|
1686
|
+
}
|
|
1687
|
+
if (ctx.json) {
|
|
1688
|
+
ctx.out(`${JSON.stringify({ secrets }, null, 2)}\n`);
|
|
1689
|
+
return 0;
|
|
1690
|
+
}
|
|
1691
|
+
if (secrets.length === 0) {
|
|
1692
|
+
ctx.out(`No secrets set on ${slug}. Add one with \`${CLI} secrets set ${slug} NAME\`.\n`);
|
|
1693
|
+
return 0;
|
|
1694
|
+
}
|
|
1695
|
+
ctx.out(`${renderTable(["NAME", "CREATED"], secrets.map((secret) => [secret.name, secret.createdAt]))}\n`);
|
|
1696
|
+
return 0;
|
|
1697
|
+
}
|
|
1698
|
+
export async function cmdSecretsUnset(slug, name, options) {
|
|
1699
|
+
if (slug === undefined || slug === "" || name === undefined || name === "") {
|
|
1700
|
+
(options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} secrets unset <slug> NAME [--team <id>]\n`);
|
|
1701
|
+
return 1;
|
|
1702
|
+
}
|
|
1703
|
+
const ctx = await prepare(options);
|
|
1704
|
+
if (typeof ctx === "number") {
|
|
1705
|
+
return ctx;
|
|
1706
|
+
}
|
|
1707
|
+
try {
|
|
1708
|
+
const architecture = await secretDeploymentArchitecture(ctx, slug);
|
|
1709
|
+
if (architecture === "v2") {
|
|
1710
|
+
await ctx.client.deleteAgentkitSecret({
|
|
1711
|
+
teamId: ctx.teamId,
|
|
1712
|
+
slug,
|
|
1713
|
+
name,
|
|
1714
|
+
});
|
|
1715
|
+
}
|
|
1716
|
+
else {
|
|
1717
|
+
await ctx.client.deleteSecret({ teamId: ctx.teamId, slug, name });
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
catch (error) {
|
|
1721
|
+
if (error instanceof DeployApiError && error.status === 404) {
|
|
1722
|
+
ctx.err(`No secret named ${name} on deployment ${slug} — check \`${CLI} secrets list ${slug}\` (and the slug / --team).\n`);
|
|
1723
|
+
return 1;
|
|
1724
|
+
}
|
|
1725
|
+
return renderApiError(error, ctx.err);
|
|
1726
|
+
}
|
|
1727
|
+
if (ctx.json) {
|
|
1728
|
+
ctx.out(`${JSON.stringify({ removed: name }, null, 2)}\n`);
|
|
1729
|
+
}
|
|
1730
|
+
else {
|
|
1731
|
+
ctx.out(`Removed secret ${name} from ${slug}.\n`);
|
|
1732
|
+
}
|
|
1733
|
+
return 0;
|
|
1734
|
+
}
|
|
1735
|
+
/**
|
|
1736
|
+
* Returns a reader for interactive secret values: hidden (no-echo) prompt
|
|
1737
|
+
* when `stdin` is a TTY, otherwise one line per secret from the piped
|
|
1738
|
+
* stream. One reader per command so piped lines are consumed in order.
|
|
1739
|
+
* A single NAME uses {@link readWholeStdinValue} instead, so a redirected
|
|
1740
|
+
* PEM keeps its internal newlines.
|
|
1741
|
+
*/
|
|
1742
|
+
function createSecretValueReader(stdin, err) {
|
|
1743
|
+
if (stdin.isTTY === true) {
|
|
1744
|
+
return (name) => promptHidden(stdin, err, `Value for ${name}: `);
|
|
1745
|
+
}
|
|
1746
|
+
const readLine = createLineReader(stdin);
|
|
1747
|
+
return async (name) => {
|
|
1748
|
+
const line = await readLine();
|
|
1749
|
+
if (line === undefined) {
|
|
1750
|
+
throw new DeployApiError(`stdin ended before a value for ${name} was provided (pipe one line per secret).`, 0);
|
|
1751
|
+
}
|
|
1752
|
+
return line;
|
|
1753
|
+
};
|
|
1754
|
+
}
|
|
1755
|
+
/** Longest mask run drawn while typing a secret; the count carries the rest. */
|
|
1756
|
+
const SECRET_MASK_MAX_WIDTH = 24;
|
|
1757
|
+
/**
|
|
1758
|
+
* One line of typing feedback for the hidden prompt. Echoing the value would
|
|
1759
|
+
* leak it, so the line carries a bounded mask plus the exact character count —
|
|
1760
|
+
* enough to see that keystrokes, backspaces, and pasted values landed. The
|
|
1761
|
+
* mask is clamped to the terminal width so the redraw stays on one line.
|
|
1762
|
+
*/
|
|
1763
|
+
function renderSecretPromptLine(prompt, length, dim) {
|
|
1764
|
+
const count = `${length} char${length === 1 ? "" : "s"}`;
|
|
1765
|
+
const room = (process.stderr.columns ?? 80) - prompt.length - count.length - 2;
|
|
1766
|
+
const maskWidth = Math.max(0, Math.min(length, SECRET_MASK_MAX_WIDTH, room));
|
|
1767
|
+
// `·` over `•`: the rest of the CLI's progress output already uses it, and
|
|
1768
|
+
// fonts that ship no bullet glyph draw a tofu box in its place.
|
|
1769
|
+
const mask = "·".repeat(maskWidth);
|
|
1770
|
+
const body = mask === "" ? count : `${mask} ${count}`;
|
|
1771
|
+
return `\r\u001b[2K${prompt}${dim(body)}`;
|
|
1772
|
+
}
|
|
1773
|
+
/**
|
|
1774
|
+
* Raw-mode hidden prompt: never echoes the value, redraws a mask + character
|
|
1775
|
+
* count as it is typed, supports backspace and Ctrl-C.
|
|
1776
|
+
*/
|
|
1777
|
+
function promptHidden(stdin, err, prompt) {
|
|
1778
|
+
return new Promise((resolvePromise, reject) => {
|
|
1779
|
+
const { dim } = stderrPalette();
|
|
1780
|
+
let value = "";
|
|
1781
|
+
const draw = () => {
|
|
1782
|
+
err(renderSecretPromptLine(prompt, value.length, dim));
|
|
1783
|
+
};
|
|
1784
|
+
draw();
|
|
1785
|
+
stdin.setRawMode?.(true);
|
|
1786
|
+
stdin.resume();
|
|
1787
|
+
const cleanup = () => {
|
|
1788
|
+
stdin.off("data", onData);
|
|
1789
|
+
stdin.setRawMode?.(false);
|
|
1790
|
+
stdin.pause();
|
|
1791
|
+
draw();
|
|
1792
|
+
err("\n");
|
|
1793
|
+
};
|
|
1794
|
+
const onData = (chunk) => {
|
|
1795
|
+
const text = typeof chunk === "string" ? chunk : chunk.toString("utf8");
|
|
1796
|
+
for (const ch of text) {
|
|
1797
|
+
if (ch === "\r" || ch === "\n") {
|
|
1798
|
+
cleanup();
|
|
1799
|
+
resolvePromise(value);
|
|
1800
|
+
return;
|
|
1801
|
+
}
|
|
1802
|
+
if (ch === "\u0003") {
|
|
1803
|
+
cleanup();
|
|
1804
|
+
reject(new DeployApiError("Aborted.", 0));
|
|
1805
|
+
return;
|
|
1806
|
+
}
|
|
1807
|
+
if (ch === "\u007f" || ch === "\b") {
|
|
1808
|
+
value = value.slice(0, -1);
|
|
1809
|
+
continue;
|
|
1810
|
+
}
|
|
1811
|
+
value += ch;
|
|
1812
|
+
}
|
|
1813
|
+
// One redraw per chunk keeps a pasted value from flooding the terminal.
|
|
1814
|
+
draw();
|
|
1815
|
+
};
|
|
1816
|
+
stdin.on("data", onData);
|
|
1817
|
+
});
|
|
1818
|
+
}
|
|
1819
|
+
/**
|
|
1820
|
+
* Whole piped stdin for a single secret. One trailing newline is removed so
|
|
1821
|
+
* `echo value | secrets set slug NAME` still stores `value`. Internal
|
|
1822
|
+
* newlines stay, which is what a redirected PEM needs.
|
|
1823
|
+
*/
|
|
1824
|
+
async function readWholeStdinValue(stdin, name) {
|
|
1825
|
+
const raw = await readStreamText(stdin);
|
|
1826
|
+
if (raw === "") {
|
|
1827
|
+
throw new DeployApiError(`stdin ended before a value for ${name} was provided.`, 0);
|
|
1828
|
+
}
|
|
1829
|
+
return stripOneTrailingNewline(raw);
|
|
1830
|
+
}
|
|
1831
|
+
function stripOneTrailingNewline(value) {
|
|
1832
|
+
if (value.endsWith("\r\n")) {
|
|
1833
|
+
return value.slice(0, -2);
|
|
1834
|
+
}
|
|
1835
|
+
if (value.endsWith("\n") || value.endsWith("\r")) {
|
|
1836
|
+
return value.slice(0, -1);
|
|
1837
|
+
}
|
|
1838
|
+
return value;
|
|
1839
|
+
}
|
|
1840
|
+
function readStreamText(stream) {
|
|
1841
|
+
return new Promise((resolve, reject) => {
|
|
1842
|
+
const chunks = [];
|
|
1843
|
+
const cleanup = () => {
|
|
1844
|
+
stream.off("data", onData);
|
|
1845
|
+
stream.off("end", onEnd);
|
|
1846
|
+
stream.off("error", onError);
|
|
1847
|
+
};
|
|
1848
|
+
const onData = (chunk) => {
|
|
1849
|
+
chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
|
|
1850
|
+
};
|
|
1851
|
+
const onEnd = () => {
|
|
1852
|
+
cleanup();
|
|
1853
|
+
resolve(Buffer.concat(chunks).toString("utf8"));
|
|
1854
|
+
};
|
|
1855
|
+
const onError = (error) => {
|
|
1856
|
+
cleanup();
|
|
1857
|
+
reject(error instanceof Error ? error : new Error(String(error)));
|
|
1858
|
+
};
|
|
1859
|
+
stream.on("data", onData);
|
|
1860
|
+
stream.on("end", onEnd);
|
|
1861
|
+
stream.on("error", onError);
|
|
1862
|
+
stream.resume();
|
|
1863
|
+
});
|
|
1864
|
+
}
|
|
1865
|
+
/** Buffered line reader over a piped stream; undefined once it ends. */
|
|
1866
|
+
export function createLineReader(stream) {
|
|
1867
|
+
let buffer = "";
|
|
1868
|
+
let ended = false;
|
|
1869
|
+
const waiters = [];
|
|
1870
|
+
const drain = () => {
|
|
1871
|
+
while (waiters.length > 0) {
|
|
1872
|
+
const newline = buffer.indexOf("\n");
|
|
1873
|
+
if (newline !== -1) {
|
|
1874
|
+
const line = buffer.slice(0, newline).replace(/\r$/, "");
|
|
1875
|
+
buffer = buffer.slice(newline + 1);
|
|
1876
|
+
waiters.shift()?.(line);
|
|
1877
|
+
continue;
|
|
1878
|
+
}
|
|
1879
|
+
if (!ended) {
|
|
1880
|
+
return;
|
|
1881
|
+
}
|
|
1882
|
+
// Stream ended: a trailing unterminated line still counts once.
|
|
1883
|
+
const rest = buffer;
|
|
1884
|
+
buffer = "";
|
|
1885
|
+
waiters.shift()?.(rest === "" ? undefined : rest.replace(/\r$/, ""));
|
|
1886
|
+
}
|
|
1887
|
+
};
|
|
1888
|
+
stream.on("data", (chunk) => {
|
|
1889
|
+
buffer += typeof chunk === "string" ? chunk : chunk.toString("utf8");
|
|
1890
|
+
drain();
|
|
1891
|
+
});
|
|
1892
|
+
stream.on("end", () => {
|
|
1893
|
+
ended = true;
|
|
1894
|
+
drain();
|
|
1895
|
+
});
|
|
1896
|
+
stream.resume();
|
|
1897
|
+
return () => new Promise((resolvePromise) => {
|
|
1898
|
+
waiters.push(resolvePromise);
|
|
1899
|
+
drain();
|
|
1900
|
+
});
|
|
1901
|
+
}
|
|
1902
|
+
// ============================================================================
|
|
1903
|
+
// Polling + rendering helpers
|
|
1904
|
+
// ============================================================================
|
|
1905
|
+
/**
|
|
1906
|
+
* Poll deployment status every `pollIntervalMs` until it lands in
|
|
1907
|
+
* `terminal` (single-line progress on a TTY, one line per transition
|
|
1908
|
+
* otherwise). Prefers customer `statusMessage` / `progress` over raw
|
|
1909
|
+
* status so create → checkout → start is visible. Throws DeployApiError
|
|
1910
|
+
* on request failures or timeout.
|
|
1911
|
+
*/
|
|
1912
|
+
async function pollUntil(ctx, slug, terminal, fetchDetail) {
|
|
1913
|
+
const startedAt = Date.now();
|
|
1914
|
+
const tty = process.stderr.isTTY === true;
|
|
1915
|
+
let lastLabel;
|
|
1916
|
+
let sawProgress = false;
|
|
1917
|
+
const report = (detail) => {
|
|
1918
|
+
if (ctx.json) {
|
|
1919
|
+
return;
|
|
1920
|
+
}
|
|
1921
|
+
const label = deployProgressLabel(detail);
|
|
1922
|
+
const elapsed = Math.round((Date.now() - startedAt) / 1000);
|
|
1923
|
+
if (tty) {
|
|
1924
|
+
ctx.err(`\r\x1b[2K${slug}: ${label} (${elapsed}s)`);
|
|
1925
|
+
sawProgress = true;
|
|
1926
|
+
}
|
|
1927
|
+
else if (label !== lastLabel) {
|
|
1928
|
+
ctx.err(`${slug}: ${label}\n`);
|
|
1929
|
+
}
|
|
1930
|
+
lastLabel = label;
|
|
1931
|
+
};
|
|
1932
|
+
const finishProgressLine = () => {
|
|
1933
|
+
if (tty && sawProgress) {
|
|
1934
|
+
ctx.err("\n");
|
|
1935
|
+
}
|
|
1936
|
+
};
|
|
1937
|
+
for (;;) {
|
|
1938
|
+
let detail;
|
|
1939
|
+
try {
|
|
1940
|
+
detail = await fetchDetail();
|
|
1941
|
+
}
|
|
1942
|
+
catch (error) {
|
|
1943
|
+
// Capacity / rate-limit on GET is not a bake failure. The v2 accept
|
|
1944
|
+
// already started freeze; keep polling until the wait budget expires.
|
|
1945
|
+
if (isTransientDeployStatusError(error) && Date.now() - startedAt < ctx.timeoutMs) {
|
|
1946
|
+
if (!ctx.json) {
|
|
1947
|
+
const elapsed = Math.round((Date.now() - startedAt) / 1000);
|
|
1948
|
+
const label = "Waiting for status (server busy)";
|
|
1949
|
+
if (tty) {
|
|
1950
|
+
ctx.err(`\r\x1b[2K${slug}: ${label} (${elapsed}s)`);
|
|
1951
|
+
sawProgress = true;
|
|
1952
|
+
}
|
|
1953
|
+
else if (label !== lastLabel) {
|
|
1954
|
+
ctx.err(`${slug}: ${label}\n`);
|
|
1955
|
+
}
|
|
1956
|
+
lastLabel = label;
|
|
1957
|
+
}
|
|
1958
|
+
const waitMs = transientDeployStatusWaitMs(error, ctx.pollIntervalMs);
|
|
1959
|
+
const remaining = ctx.timeoutMs - (Date.now() - startedAt);
|
|
1960
|
+
await sleep(Math.max(0, Math.min(waitMs, remaining)));
|
|
1961
|
+
continue;
|
|
1962
|
+
}
|
|
1963
|
+
finishProgressLine();
|
|
1964
|
+
throw error;
|
|
1965
|
+
}
|
|
1966
|
+
report(detail);
|
|
1967
|
+
if (terminal.has(detail.status)) {
|
|
1968
|
+
finishProgressLine();
|
|
1969
|
+
return detail;
|
|
1970
|
+
}
|
|
1971
|
+
if (Date.now() - startedAt >= ctx.timeoutMs) {
|
|
1972
|
+
finishProgressLine();
|
|
1973
|
+
const last = deployProgressLabel(detail);
|
|
1974
|
+
throw new DeployApiError(`Timed out after ${Math.round(ctx.timeoutMs / 1000)}s waiting for ${slug} (last: ${last}). It may still converge — check \`${CLI} deployment ${slug} --team ${ctx.teamId}\`.`, 0);
|
|
1975
|
+
}
|
|
1976
|
+
await sleep(ctx.pollIntervalMs);
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
/** Load-shed / rate-limit on status GET — the deploy itself may still be baking. */
|
|
1980
|
+
function isTransientDeployStatusError(error) {
|
|
1981
|
+
return error instanceof DeployApiError && (error.status === 503 || error.status === 429);
|
|
1982
|
+
}
|
|
1983
|
+
function transientDeployStatusWaitMs(error, pollIntervalMs) {
|
|
1984
|
+
if (error.status === 429 &&
|
|
1985
|
+
error.retryAfterSeconds !== undefined &&
|
|
1986
|
+
error.retryAfterSeconds > 0) {
|
|
1987
|
+
return Math.max(pollIntervalMs, error.retryAfterSeconds * 1000);
|
|
1988
|
+
}
|
|
1989
|
+
return pollIntervalMs;
|
|
1990
|
+
}
|
|
1991
|
+
/**
|
|
1992
|
+
* Wait until GET 404s (the delete reconciler purged the record). Treats
|
|
1993
|
+
* other errors as failures. Throws DeployApiError on timeout.
|
|
1994
|
+
*/
|
|
1995
|
+
async function pollUntilGone(ctx, slug, getDetail) {
|
|
1996
|
+
const startedAt = Date.now();
|
|
1997
|
+
const tty = process.stderr.isTTY === true;
|
|
1998
|
+
let sawProgress = false;
|
|
1999
|
+
const report = (label) => {
|
|
2000
|
+
if (ctx.json) {
|
|
2001
|
+
return;
|
|
2002
|
+
}
|
|
2003
|
+
const elapsed = Math.round((Date.now() - startedAt) / 1000);
|
|
2004
|
+
if (tty) {
|
|
2005
|
+
ctx.err(`\r\x1b[2K${slug}: ${label} (${elapsed}s)`);
|
|
2006
|
+
sawProgress = true;
|
|
2007
|
+
}
|
|
2008
|
+
};
|
|
2009
|
+
const finishProgressLine = () => {
|
|
2010
|
+
if (tty && sawProgress) {
|
|
2011
|
+
ctx.err("\n");
|
|
2012
|
+
}
|
|
2013
|
+
};
|
|
2014
|
+
for (;;) {
|
|
2015
|
+
try {
|
|
2016
|
+
const detail = await getDetail();
|
|
2017
|
+
report(deployProgressLabel(detail));
|
|
2018
|
+
}
|
|
2019
|
+
catch (error) {
|
|
2020
|
+
if (error instanceof DeployApiError && error.status === 404) {
|
|
2021
|
+
finishProgressLine();
|
|
2022
|
+
return;
|
|
2023
|
+
}
|
|
2024
|
+
finishProgressLine();
|
|
2025
|
+
throw error;
|
|
2026
|
+
}
|
|
2027
|
+
if (Date.now() - startedAt >= ctx.timeoutMs) {
|
|
2028
|
+
finishProgressLine();
|
|
2029
|
+
throw new DeployApiError(`Timed out after ${Math.round(ctx.timeoutMs / 1000)}s waiting for ${slug} to disappear. It may still be deleting — check \`${CLI} deployment ${slug} --team ${ctx.teamId}\`.`, 0);
|
|
2030
|
+
}
|
|
2031
|
+
await sleep(ctx.pollIntervalMs);
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
function aliasTokenBlock(aliasToken) {
|
|
2035
|
+
return (`\n Alias token (shown ONCE — save it now, it cannot be retrieved again):\n\n` +
|
|
2036
|
+
` ${aliasToken}\n\n` +
|
|
2037
|
+
` Send it as the X-Agent-Alias-Token header on requests to the alias URL.\n` +
|
|
2038
|
+
` Lost tokens: \`${CLI} rotate-token <slug>\` mints a replacement.\n\n`);
|
|
2039
|
+
}
|
|
2040
|
+
/**
|
|
2041
|
+
* `: <reason>` suffix for a deploy that ended in a non-running state, or
|
|
2042
|
+
* empty when the control plane recorded no reason.
|
|
2043
|
+
*/
|
|
2044
|
+
function deployFailureDetail(lastError) {
|
|
2045
|
+
if (lastError === null || lastError === undefined || lastError.trim() === "") {
|
|
2046
|
+
return "";
|
|
2047
|
+
}
|
|
2048
|
+
return `: ${sanitizeCustomerError(lastError.trim())}`;
|
|
2049
|
+
}
|
|
2050
|
+
export function renderApiError(error, err, context) {
|
|
2051
|
+
if (error instanceof DeployApiError) {
|
|
2052
|
+
err(`${error.message}\n`);
|
|
2053
|
+
if (error.status === 409 && error.message.includes("application multiTenant does not match")) {
|
|
2054
|
+
if (context?.multiTenant === true) {
|
|
2055
|
+
err("This slug is a single-tenant application. Redeploy it without --multi-tenant.\n");
|
|
2056
|
+
}
|
|
2057
|
+
else if (context?.teamId === MULTI_COMPONENT_ALLOWED_TEAM_ID) {
|
|
2058
|
+
err("This slug is a Cursor-managed (multi-tenant) product. Redeploy it with --multi-tenant.\n");
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
return 1;
|
|
2062
|
+
}
|
|
2063
|
+
throw error;
|
|
2064
|
+
}
|
|
2065
|
+
export function renderTable(header, rows) {
|
|
2066
|
+
const widths = header.map((h, i) => Math.max(h.length, ...rows.map((row) => (row[i] ?? "").length)));
|
|
2067
|
+
const renderRow = (row) => row
|
|
2068
|
+
.map((cell, i) => cell.padEnd(widths[i] ?? 0))
|
|
2069
|
+
.join(" ")
|
|
2070
|
+
.trimEnd();
|
|
2071
|
+
return [renderRow(header), ...rows.map(renderRow)].join("\n");
|
|
2072
|
+
}
|