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