@cursor/bdk 0.2.8 → 0.2.10
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/dist/artifacts.js +3 -5
- package/dist/bin/agent-serve.d.ts +1 -0
- package/dist/bin/agent-serve.d.ts.map +1 -1
- package/dist/bin/agent-serve.js +820 -807
- package/dist/channels/bitbucket/api.js +305 -321
- package/dist/channels/bitbucket/binding.js +97 -61
- package/dist/channels/bitbucket/bitbucket-channel.d.ts +15 -1
- package/dist/channels/bitbucket/bitbucket-channel.d.ts.map +1 -1
- package/dist/channels/bitbucket/bitbucket-channel.js +95 -42
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts +11 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -1
- package/dist/channels/bitbucket/bitbucket-webhook.js +214 -204
- package/dist/channels/bitbucket/checks.js +9 -21
- package/dist/channels/bitbucket/cursor-account.js +1 -1
- package/dist/channels/bitbucket/defaults.js +14 -4
- package/dist/channels/bitbucket/events.js +1 -2
- package/dist/channels/bitbucket/index.d.ts +6 -2
- package/dist/channels/bitbucket/index.d.ts.map +1 -1
- package/dist/channels/bitbucket/index.js +6 -2
- package/dist/channels/bitbucket/replay.js +80 -56
- package/dist/channels/bitbucket/state.js +16 -7
- package/dist/channels/bitbucket/types.d.ts +11 -2
- package/dist/channels/bitbucket/types.d.ts.map +1 -1
- package/dist/channels/checks.js +18 -28
- package/dist/channels/deployments/deployments-channel.js +26 -34
- package/dist/channels/github/api.js +216 -210
- package/dist/channels/github/auth.d.ts +5 -1
- package/dist/channels/github/auth.d.ts.map +1 -1
- package/dist/channels/github/auth.js +157 -174
- package/dist/channels/github/binding.js +48 -39
- package/dist/channels/github/checks.js +9 -14
- package/dist/channels/github/cursor-account.js +6 -11
- package/dist/channels/github/defaults.js +105 -130
- package/dist/channels/github/forward.js +13 -17
- package/dist/channels/github/github-channel.d.ts +43 -2
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +1228 -958
- package/dist/channels/github/progress.js +145 -146
- package/dist/channels/github/replay.js +30 -39
- package/dist/channels/github/state.js +40 -16
- package/dist/channels/github/types.d.ts +30 -6
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/gitlab/api.js +100 -114
- package/dist/channels/gitlab/binding.js +52 -33
- package/dist/channels/gitlab/checks.js +28 -29
- package/dist/channels/gitlab/cursor-account.js +1 -1
- package/dist/channels/gitlab/defaults.js +9 -3
- package/dist/channels/gitlab/gitlab-channel.d.ts +16 -1
- package/dist/channels/gitlab/gitlab-channel.d.ts.map +1 -1
- package/dist/channels/gitlab/gitlab-channel.js +95 -42
- package/dist/channels/gitlab/gitlab-webhook.d.ts +10 -1
- package/dist/channels/gitlab/gitlab-webhook.d.ts.map +1 -1
- package/dist/channels/gitlab/gitlab-webhook.js +282 -249
- package/dist/channels/gitlab/index.d.ts +6 -2
- package/dist/channels/gitlab/index.d.ts.map +1 -1
- package/dist/channels/gitlab/index.js +6 -2
- package/dist/channels/gitlab/replay.js +50 -27
- package/dist/channels/gitlab/state.js +14 -6
- package/dist/channels/gitlab/types.d.ts +13 -2
- package/dist/channels/gitlab/types.d.ts.map +1 -1
- package/dist/channels/origin/api.js +100 -116
- package/dist/channels/origin/binding.js +15 -16
- package/dist/channels/origin/checks.js +30 -28
- package/dist/channels/origin/defaults.js +50 -65
- package/dist/channels/origin/origin-channel.js +266 -272
- package/dist/channels/origin/origin-webhook.js +70 -88
- package/dist/channels/origin/reactions.js +9 -21
- package/dist/channels/origin/state.js +13 -5
- package/dist/channels/slack/agentic-delivery.js +426 -478
- package/dist/channels/slack/agentic-posted.js +9 -10
- package/dist/channels/slack/agentic-signals.js +2 -3
- package/dist/channels/slack/api.js +417 -427
- package/dist/channels/slack/approvals.js +1 -1
- package/dist/channels/slack/assistant.js +37 -47
- package/dist/channels/slack/attachments.js +188 -206
- package/dist/channels/slack/auth.js +8 -6
- package/dist/channels/slack/bot-mentions.js +31 -45
- package/dist/channels/slack/channel-watch.js +42 -48
- package/dist/channels/slack/cli-project.js +112 -137
- package/dist/channels/slack/code-fences.js +3 -5
- package/dist/channels/slack/constants.js +2 -2
- package/dist/channels/slack/credentials.js +23 -38
- package/dist/channels/slack/defaults.js +292 -331
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +533 -460
- package/dist/channels/slack/doctor.js +200 -214
- package/dist/channels/slack/eval-directive.js +79 -96
- package/dist/channels/slack/event-id-dedupe.js +1 -1
- package/dist/channels/slack/external-policy.js +26 -39
- package/dist/channels/slack/footer.js +28 -41
- package/dist/channels/slack/inbound.d.ts +1 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +50 -31
- package/dist/channels/slack/init.d.ts +1 -5
- package/dist/channels/slack/init.d.ts.map +1 -1
- package/dist/channels/slack/init.js +42 -59
- package/dist/channels/slack/interactive.d.ts +9 -3
- package/dist/channels/slack/interactive.d.ts.map +1 -1
- package/dist/channels/slack/interactive.js +160 -162
- package/dist/channels/slack/links.js +1 -2
- package/dist/channels/slack/live-delivery.js +172 -190
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +44 -23
- package/dist/channels/slack/message-body.js +2 -2
- package/dist/channels/slack/nudge-carrier.js +30 -42
- package/dist/channels/slack/nudge-store.js +164 -191
- package/dist/channels/slack/paint-start.js +66 -81
- package/dist/channels/slack/placeholder.js +123 -152
- package/dist/channels/slack/pr-ref.js +1 -1
- package/dist/channels/slack/progress-delivery.js +65 -78
- package/dist/channels/slack/reasoning-card.js +36 -49
- package/dist/channels/slack/recording-sink.js +12 -24
- package/dist/channels/slack/reply-options.js +7 -12
- package/dist/channels/slack/self-identity.js +27 -35
- package/dist/channels/slack/sender-name.d.ts +12 -3
- package/dist/channels/slack/sender-name.d.ts.map +1 -1
- package/dist/channels/slack/sender-name.js +57 -61
- package/dist/channels/slack/setup.js +2 -4
- package/dist/channels/slack/slack-channel.d.ts +6 -4
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +441 -308
- package/dist/channels/slack/socket-mode.js +38 -52
- package/dist/channels/slack/thread-context.js +143 -160
- package/dist/channels/slack/tool-approval-events.js +149 -166
- package/dist/channels/slack/tool-cards.js +6 -11
- package/dist/channels/slack/tool-chip.js +1 -2
- package/dist/channels/slack/types.d.ts +15 -17
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/channels/slack/upload.js +84 -97
- package/dist/channels/slack/user-info.js +27 -41
- package/dist/channels.js +9 -20
- package/dist/dashboard-session-url.js +3 -4
- package/dist/docs/404.html +2 -2
- package/dist/docs/assets/{app.oyjtOr3W.js → app.DXI7bwox.js} +4 -4
- package/dist/docs/assets/{building-with-agents.md.BPjPFxFg.js → building-with-agents.md.Df87rAe1.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.CtLtpWcx.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.D0P6J_UJ.js → VPLocalSearchBox.BrbO5mEe.js} +1 -1
- package/dist/docs/assets/chunks/{arc.B0LY1J1h.js → arc.BOG1yms8.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.dPduLUxY.js → architectureDiagram-Q4EWVU46.C0hsMZnZ.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.B_Ohm21h.js → baseUniq.H044KjKs.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.B4zcanaJ.js → blockDiagram-DXYQGD6D.BsRW6GoB.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.D9Iw21nx.js → c4Diagram-AHTNJAMY.B9HV5PFR.js} +1 -1
- package/dist/docs/assets/chunks/channel.CBwrU9rP.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.DDVwRShI.js → chunk-4BX2VUAB.CPoT_ajl.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.DsYcdn1i.js → chunk-4TB4RGXK.DZBwWuCL.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.BzzQvcYp.js → chunk-55IACEB6.CZ3yTiyq.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.BMiXZ7FX.js → chunk-EDXVE4YY.6DfvHSd8.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.D_mBcLoc.js → chunk-FMBD7UC4.CpBj8HfK.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.CMVjWVMx.js → chunk-OYMX7WX6.BdKo8YqS.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.BG-FrPv9.js → chunk-QZHKN3VN.BnXNyxJx.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.CkFE1ap3.js → chunk-YZCP3GAM.Cg1OcF8G.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.CbC_mrvB.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.CbC_mrvB.js +1 -0
- package/dist/docs/assets/chunks/clone.BTvFyY1a.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.BVNnCTvY.js → cose-bilkent-S5V4N54A.1SP8al9c.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.CDN5PR9l.js → dagre-KV5264BT.DS1L6hJt.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.DQRUlT-i.js → diagram-5BDNPKRD.ChsausbG.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.CoeblYQT.js → diagram-G4DWMVQ6.3XsptNWj.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.DW3ymjl0.js → diagram-MMDJMWI5.DPA9Dk_P.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.BP0uN4Jw.js → diagram-TYMM5635.BVswXWrB.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.DVFUWEn4.js → erDiagram-SMLLAGMA.BSak5OSP.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.HU-eHspv.js → flowDiagram-DWJPFMVM.CQgN4TTz.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.DHNhXijY.js → ganttDiagram-T4ZO3ILL.GrT0kA4a.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.DkISXcO3.js → gitGraphDiagram-UUTBAWPF.CdS7Ucll.js} +1 -1
- package/dist/docs/assets/chunks/{graph.CCV0fuRR.js → graph.BVqKRmRo.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.bgILzOoc.js → infoDiagram-42DDH7IO.C3C9FRto.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.CuryXC0F.js → ishikawaDiagram-UXIWVN3A.2FuAh_Zj.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.BL1Pr-wu.js → journeyDiagram-VCZTEJTY.CaHMfK4b.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.BbGjvk4l.js → kanban-definition-6JOO6SKY.CjhIUwcA.js} +1 -1
- package/dist/docs/assets/chunks/{layout.C4PfdldS.js → layout.CGU3gfSf.js} +1 -1
- package/dist/docs/assets/chunks/{linear.C3xD1T6X.js → linear.DaihpW_n.js} +1 -1
- package/dist/docs/assets/chunks/{min.CzgRAQ9c.js → min.BS-j8kHQ.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.CA9rSWum.js → mindmap-definition-QFDTVHPH.BVJ1Bbnk.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.B8MprgJu.js → pieDiagram-DEJITSTG.Cz1WIv9r.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.DndDwbKT.js → quadrantDiagram-34T5L4WZ.DKLFxcjy.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.Zhfgwlnn.js → requirementDiagram-MS252O5E.BHegiK7x.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.B6RRm6N5.js → sankeyDiagram-XADWPNL6.DYkY6yPc.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.Bfmz-1PN.js → sequenceDiagram-FGHM5R23.DYQ1QUrI.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.gbrdNqgj.js → stateDiagram-FHFEXIEX.Iru8BsFo.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.BYXl4LW6.js +1 -0
- package/dist/docs/assets/chunks/{theme.gpWjytMh.js → theme.DaplWQhQ.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.Bl1l7M1f.js → timeline-definition-GMOUNBTQ.BwFA8hiX.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.Dfle4U0d.js → vennDiagram-DHZGUBPP.CZ60W1C_.js} +1 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.iXazD3Z7.js +162 -0
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.CM_4lmvZ.js → wardleyDiagram-NUSXRM2D.B69D2r8-.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.CHT5X28R.js → xychartDiagram-5P7HB3ND.CLPZEIU9.js} +1 -1
- package/dist/docs/assets/{deployment.md.BdqTiGdc.js → deployment.md.BYuEcDBv.js} +2 -2
- package/dist/docs/assets/{guides_bitbucket.md.BB6fqD-M.js → guides_bitbucket.md.CKUayYtD.js} +3 -3
- package/dist/docs/assets/{guides_bitbucket.md.BB6fqD-M.lean.js → guides_bitbucket.md.CKUayYtD.lean.js} +1 -1
- package/dist/docs/assets/{guides_github.md.Cr1Xlf-m.js → guides_github.md.TuNiZAOQ.js} +4 -4
- package/dist/docs/assets/{guides_github.md.Cr1Xlf-m.lean.js → guides_github.md.TuNiZAOQ.lean.js} +1 -1
- package/dist/docs/assets/{guides_gitlab.md.CMpmFi4M.js → guides_gitlab.md.CtNI4fSH.js} +4 -4
- package/dist/docs/assets/{guides_gitlab.md.CMpmFi4M.lean.js → guides_gitlab.md.CtNI4fSH.lean.js} +1 -1
- package/dist/docs/assets/guides_migrate.md.sCAvvlC6.js +7 -0
- package/dist/docs/assets/guides_migrate.md.sCAvvlC6.lean.js +1 -0
- package/dist/docs/assets/{reference_cli.md.GwugN3n-.js → reference_cli.md.dYCAL2lB.js} +4 -3
- package/dist/docs/assets/reference_cli.md.dYCAL2lB.lean.js +1 -0
- package/dist/docs/assets/{reference_skills.md.ClkMoQsV.js → reference_skills.md.C0guGcH0.js} +3 -3
- package/dist/docs/assets/troubleshooting.md.x-GBa7wN.js +1 -0
- package/dist/docs/assets/{troubleshooting.md.Bscj6ODe.lean.js → troubleshooting.md.x-GBa7wN.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +37 -37
- package/dist/docs/building-with-agents.md +2 -0
- package/dist/docs/deployment.html +38 -38
- package/dist/docs/deployment.md +7 -0
- package/dist/docs/evals.html +36 -36
- package/dist/docs/guides/agent-to-agent.html +35 -35
- package/dist/docs/guides/bitbucket.html +38 -38
- package/dist/docs/guides/bitbucket.md +9 -1
- package/dist/docs/guides/cloud-agents.html +35 -35
- package/dist/docs/guides/convert-automation.html +35 -35
- package/dist/docs/guides/github.html +39 -39
- package/dist/docs/guides/github.md +20 -4
- package/dist/docs/guides/gitlab.html +38 -38
- package/dist/docs/guides/gitlab.md +9 -1
- package/dist/docs/guides/grokbot-agents.html +35 -35
- package/dist/docs/guides/hooks.html +35 -35
- package/dist/docs/guides/improve.html +35 -35
- package/dist/docs/guides/jev.html +35 -35
- package/dist/docs/guides/mcp-oauth.html +35 -35
- package/dist/docs/guides/migrate.html +66 -0
- package/dist/docs/guides/migrate.md +122 -0
- package/dist/docs/guides/opentelemetry.html +35 -35
- package/dist/docs/guides/slack.html +35 -35
- package/dist/docs/guides/webhooks.html +35 -35
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +35 -35
- package/dist/docs/index.html +35 -35
- package/dist/docs/llms-full.txt +214 -6
- package/dist/docs/llms.txt +1 -0
- package/dist/docs/quickstart.html +35 -35
- package/dist/docs/reference/agent-config.html +35 -35
- package/dist/docs/reference/artifacts.html +35 -35
- package/dist/docs/reference/channels.html +35 -35
- package/dist/docs/reference/cli.html +39 -38
- package/dist/docs/reference/cli.md +39 -0
- package/dist/docs/reference/connections.html +35 -35
- package/dist/docs/reference/evals.html +35 -35
- package/dist/docs/reference/extensions.html +35 -35
- package/dist/docs/reference/hooks.html +35 -35
- package/dist/docs/reference/http-api.html +35 -35
- package/dist/docs/reference/instructions.html +35 -35
- package/dist/docs/reference/playground.html +35 -35
- package/dist/docs/reference/project-layout.html +35 -35
- package/dist/docs/reference/prompt.html +35 -35
- package/dist/docs/reference/schedules.html +35 -35
- package/dist/docs/reference/sessions.html +35 -35
- package/dist/docs/reference/skills.html +38 -38
- package/dist/docs/reference/subagents.html +35 -35
- package/dist/docs/reference/tools.html +35 -35
- package/dist/docs/templates/agentic-owners.html +35 -35
- package/dist/docs/templates/grokbot-agents.html +35 -35
- package/dist/docs/templates/security-reviewer.html +35 -35
- package/dist/docs/templates/thermo-quality-review.html +35 -35
- package/dist/docs/templates/thermo-review.html +35 -35
- package/dist/docs/templates/triage.html +35 -35
- package/dist/docs/troubleshooting.html +36 -36
- package/dist/docs/troubleshooting.md +1 -0
- package/dist/evals/assertions.js +20 -34
- package/dist/evals/expect.js +3 -6
- package/dist/evals/judge.js +5 -8
- package/dist/evals/loaders.js +45 -62
- package/dist/evals/matchers.js +2 -3
- package/dist/evals/reporters.js +43 -67
- package/dist/evals/results.js +1 -1
- package/dist/evals/run-facts.js +5 -6
- package/dist/evals.js +27 -15
- package/dist/extensions/cursor-cloud-agents/extension.js +4 -1
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +0 -1
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/backend.js +101 -130
- package/dist/extensions/cursor-cloud-agents/lib/fleet.js +22 -38
- package/dist/extensions/cursor-cloud-agents/lib/repos.js +8 -10
- package/dist/extensions/cursor-cloud-agents/lib/transcript.js +2 -3
- package/dist/extensions/cursor-cloud-agents/lib/watch.js +52 -66
- package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.js +29 -40
- package/dist/extensions/cursor-cloud-agents/tools/cancel.js +6 -17
- package/dist/extensions/cursor-cloud-agents/tools/dump.js +25 -36
- package/dist/extensions/cursor-cloud-agents/tools/get.js +3 -14
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +13 -21
- package/dist/extensions/cursor-cloud-agents/tools/list.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/list.js +9 -20
- package/dist/extensions/cursor-cloud-agents/tools/reply.js +5 -16
- package/dist/extensions/cursor-grokbot-agents/extension.js +4 -1
- package/dist/extensions/cursor-grokbot-agents/lib/agents.js +3 -3
- package/dist/extensions/cursor-grokbot-agents/lib/backend.js +53 -73
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.js +10 -23
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.js +112 -132
- package/dist/extensions/cursor-grokbot-agents/lib/lock.js +1 -2
- package/dist/extensions/cursor-grokbot-agents/tools/ask.js +5 -16
- package/dist/extensions/cursor-grokbot-agents/tools/check.js +4 -15
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.js +2 -13
- package/dist/extensions/cursor-grokbot-agents/tools/list.js +11 -23
- package/dist/extensions/jev/extension.js +3 -3
- package/dist/extensions/jev/lib/evaluate.js +43 -60
- package/dist/extensions/jev/tools/evaluate.js +6 -17
- package/dist/extensions/slack-communication/tools/post-file.js +1 -1
- package/dist/extensions.js +3 -5
- package/dist/files-backends/cursor-hosted.js +504 -523
- package/dist/files-backends/local-fs.js +72 -134
- package/dist/files.js +3 -3
- package/dist/filesystem.js +562 -861
- package/dist/index.js +16 -35
- package/dist/internal/advertise-tools.js +74 -86
- package/dist/internal/artifacts-store.js +298 -361
- package/dist/internal/as-of.js +2 -4
- package/dist/internal/authored-alias-hooks.js +6 -4
- package/dist/internal/authored-loaders.js +37 -52
- package/dist/internal/bounded-int.js +1 -2
- package/dist/internal/bounded.js +13 -24
- package/dist/internal/brand.js +1 -1
- package/dist/internal/browser-origin-guard.js +4 -4
- package/dist/internal/builtin-tools/artifacts.js +15 -27
- package/dist/internal/builtin-tools/index.js +2 -3
- package/dist/internal/builtin-tools/reminders.js +33 -52
- package/dist/internal/channel-architecture.d.ts +21 -0
- package/dist/internal/channel-architecture.d.ts.map +1 -0
- package/dist/internal/channel-architecture.js +41 -0
- package/dist/internal/channel-dispatch.js +3 -4
- package/dist/internal/channel-route-dispatch.js +40 -51
- package/dist/internal/channel-state.js +1 -1
- package/dist/internal/chat-client.js +319 -340
- package/dist/internal/cli-ax.js +1262 -1294
- package/dist/internal/cli-bitbucket.js +244 -272
- package/dist/internal/cli-convert-automation.js +137 -151
- package/dist/internal/cli-cursor.js +126 -147
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +1457 -1507
- package/dist/internal/cli-docs.js +130 -147
- package/dist/internal/cli-github.js +437 -476
- package/dist/internal/cli-gitlab.js +259 -288
- package/dist/internal/cli-images.js +266 -334
- package/dist/internal/cli-manifest.js +25 -37
- package/dist/internal/cli-mcp-oauth.js +228 -247
- package/dist/internal/cli-mcp.js +358 -383
- package/dist/internal/cli-migrate.d.ts +18 -0
- package/dist/internal/cli-migrate.d.ts.map +1 -0
- package/dist/internal/cli-migrate.js +136 -0
- package/dist/internal/cli-skills.js +35 -47
- package/dist/internal/cli-slack-manual.d.ts +0 -1
- package/dist/internal/cli-slack-manual.d.ts.map +1 -1
- package/dist/internal/cli-slack-manual.js +175 -204
- package/dist/internal/cli-slack.d.ts +1 -1
- package/dist/internal/cli-slack.d.ts.map +1 -1
- package/dist/internal/cli-slack.js +416 -456
- package/dist/internal/cloud-merge.js +7 -3
- package/dist/internal/cloud-turn-cost.js +8 -1
- package/dist/internal/connection-env.js +5 -6
- package/dist/internal/continuation-channel.js +10 -7
- package/dist/internal/continuation-identity.js +85 -67
- package/dist/internal/conversation-mirror.js +112 -131
- package/dist/internal/convert-automation/convert-workflow.js +21 -31
- package/dist/internal/cron.js +3 -3
- package/dist/internal/cursor/account-mcp.js +147 -146
- package/dist/internal/cursor/backend-client.js +290 -320
- package/dist/internal/cursor/bound-secret-file.js +3 -3
- package/dist/internal/cursor/credentials.d.ts +1 -0
- package/dist/internal/cursor/credentials.d.ts.map +1 -1
- package/dist/internal/cursor/credentials.js +130 -142
- package/dist/internal/cursor/cursor-api-transport.js +4 -8
- package/dist/internal/cursor/github-credentials.js +91 -108
- package/dist/internal/cursor/hosted-bound-secrets.js +3 -4
- package/dist/internal/cursor/hosted-deployment-secrets.js +1 -1
- package/dist/internal/cursor/hosted-store-secrets.js +5 -9
- package/dist/internal/cursor/session-token.js +36 -48
- package/dist/internal/cursor/store-api-client.js +77 -92
- package/dist/internal/cursor-account-mcp-auth.js +132 -149
- package/dist/internal/cursor-agent-template.js +1 -1
- package/dist/internal/cursor-deployment-relay.js +33 -54
- package/dist/internal/cursor-event-relay.js +65 -59
- package/dist/internal/cursor-relay-core.js +258 -286
- package/dist/internal/deferred-channel-session.js +3 -12
- package/dist/internal/deploy-client.js +410 -475
- package/dist/internal/deploy-manifest.d.ts +17 -0
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +71 -21
- package/dist/internal/deploy-source.js +31 -43
- package/dist/internal/discovery/agent-config.js +45 -59
- package/dist/internal/discovery/agent.js +276 -280
- package/dist/internal/discovery/channels.js +67 -80
- package/dist/internal/discovery/connections.js +286 -296
- package/dist/internal/discovery/context.js +2 -13
- package/dist/internal/discovery/cursor-plugin.js +223 -259
- package/dist/internal/discovery/extension-overlay.js +104 -131
- package/dist/internal/discovery/extensions.js +276 -281
- package/dist/internal/discovery/fs.js +56 -79
- package/dist/internal/discovery/hooks.js +39 -50
- package/dist/internal/discovery/info.js +17 -19
- package/dist/internal/discovery/instructions.js +58 -71
- package/dist/internal/discovery/modules.js +45 -58
- package/dist/internal/discovery/project.d.ts.map +1 -1
- package/dist/internal/discovery/project.js +192 -215
- package/dist/internal/discovery/reminders.js +41 -52
- package/dist/internal/discovery/runtime.js +1 -1
- package/dist/internal/discovery/schedules.js +71 -82
- package/dist/internal/discovery/seed-files.js +21 -32
- package/dist/internal/discovery/services.js +74 -96
- package/dist/internal/discovery/skills.js +77 -94
- package/dist/internal/discovery/subagent.js +79 -95
- package/dist/internal/discovery/tools.js +12 -23
- package/dist/internal/distribution.js +2 -2
- package/dist/internal/docs-site.js +30 -45
- package/dist/internal/duration.js +1 -1
- package/dist/internal/env-file.js +48 -64
- package/dist/internal/eval-judge-model.js +17 -28
- package/dist/internal/eval-run-store.js +265 -254
- package/dist/internal/eval-runner.d.ts +8 -0
- package/dist/internal/eval-runner.d.ts.map +1 -1
- package/dist/internal/eval-runner.js +406 -408
- package/dist/internal/eval-transport.d.ts +24 -0
- package/dist/internal/eval-transport.d.ts.map +1 -0
- package/dist/internal/eval-transport.js +22 -0
- package/dist/internal/evals-client.js +242 -246
- package/dist/internal/event-log.js +72 -120
- package/dist/internal/event-mapper.js +30 -31
- package/dist/internal/factory-resource-channel.js +16 -30
- package/dist/internal/filesystem/errors.js +6 -6
- package/dist/internal/filesystem/format.js +10 -13
- package/dist/internal/filesystem/merge.js +52 -94
- package/dist/internal/filesystem/nearest.js +15 -27
- package/dist/internal/filesystem/scratch.js +65 -85
- package/dist/internal/filesystem/tools.js +221 -241
- package/dist/internal/filesystem/walk.js +76 -143
- package/dist/internal/framework-file-storage.js +118 -139
- package/dist/internal/framework-storage-selection.js +21 -13
- package/dist/internal/frontmatter.js +4 -6
- package/dist/internal/github-fanout.js +50 -64
- package/dist/internal/guest-network.js +96 -109
- package/dist/internal/handleAgentServeTrigger.js +121 -126
- package/dist/internal/host-files.js +73 -88
- package/dist/internal/host-kv.js +21 -36
- package/dist/internal/host-otel.js +22 -19
- package/dist/internal/host-platforms.js +49 -63
- package/dist/internal/hosted-catch-protocol.d.ts +1 -0
- package/dist/internal/hosted-catch-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-catch-protocol.js +1 -0
- package/dist/internal/hosted-catch.d.ts +5 -3
- package/dist/internal/hosted-catch.d.ts.map +1 -1
- package/dist/internal/hosted-catch.js +84 -93
- package/dist/internal/hosted-delivery-protocol.js +32 -8
- package/dist/internal/hosted-delivery.d.ts +13 -1
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +614 -584
- package/dist/internal/hosted-eval-cases.d.ts +21 -0
- package/dist/internal/hosted-eval-cases.d.ts.map +1 -0
- package/dist/internal/hosted-eval-cases.js +162 -0
- package/dist/internal/hosted-execution-diag.js +38 -30
- package/dist/internal/hosted-execution-flush.js +75 -66
- package/dist/internal/hosted-execution-latency.js +16 -8
- package/dist/internal/hosted-managed-automation.js +2 -2
- package/dist/internal/hosting.js +2 -3
- package/dist/internal/http-channel-define.js +4 -1
- package/dist/internal/http-channel.js +101 -112
- package/dist/internal/http-control-plane-session.d.ts +18 -1
- package/dist/internal/http-control-plane-session.d.ts.map +1 -1
- package/dist/internal/http-control-plane-session.js +66 -32
- package/dist/internal/incoming-headers-to-fetch.js +1 -2
- package/dist/internal/init-interview.js +73 -93
- package/dist/internal/init-project.js +182 -214
- package/dist/internal/init-scaffold.js +10 -21
- package/dist/internal/inline-stdio-mcp.js +80 -86
- package/dist/internal/install-cursor-skills.d.ts.map +1 -1
- package/dist/internal/install-cursor-skills.js +238 -274
- package/dist/internal/legacy-command-guard.js +18 -31
- package/dist/internal/listen-port.js +34 -45
- package/dist/internal/local-control-plane.js +293 -307
- package/dist/internal/local-env.js +1 -1
- package/dist/internal/local-ingress.js +15 -9
- package/dist/internal/log-ring.js +1 -2
- package/dist/internal/logs-client.js +207 -227
- package/dist/internal/map-pool.js +24 -38
- package/dist/internal/mcp-endpoint.js +204 -180
- package/dist/internal/mcp-host.js +165 -168
- package/dist/internal/mcp-oauth-on-demand.js +170 -207
- package/dist/internal/mcp-oauth-persist.js +15 -29
- package/dist/internal/mcp-oauth.js +209 -266
- package/dist/internal/named-webhook-secret.d.ts +39 -0
- package/dist/internal/named-webhook-secret.d.ts.map +1 -0
- package/dist/internal/named-webhook-secret.js +47 -0
- package/dist/internal/open-browser.js +2 -3
- package/dist/internal/otel/collector.js +104 -68
- package/dist/internal/otel/config.js +24 -37
- package/dist/internal/otel/http.js +5 -7
- package/dist/internal/otel/mcp.js +3 -12
- package/dist/internal/otel/runtime.js +69 -83
- package/dist/internal/package-inline-stdio.js +57 -65
- package/dist/internal/peer-connections.js +9 -5
- package/dist/internal/platform-schedule-sync.js +39 -54
- package/dist/internal/platform-timers.js +176 -210
- package/dist/internal/playground/static.js +1 -2
- package/dist/internal/playground/toolchain.js +37 -53
- package/dist/internal/playground-proxy.js +230 -270
- package/dist/internal/process-memory-telemetry.js +33 -51
- package/dist/internal/prompt-context.js +3 -6
- package/dist/internal/reminder-control-plane-protocol.js +46 -13
- package/dist/internal/reminder-runner.js +770 -785
- package/dist/internal/reminder-schedule.js +1 -1
- package/dist/internal/reminder-store.js +57 -78
- package/dist/internal/request-error-status.js +1 -3
- package/dist/internal/request-headers.js +2 -2
- package/dist/internal/resolve-prod-target.js +119 -135
- package/dist/internal/resolved-connections.js +16 -6
- package/dist/internal/run-client.js +221 -229
- package/dist/internal/runtime-dispatch-runner.js +18 -43
- package/dist/internal/schedule-runner.js +49 -58
- package/dist/internal/scm/pr-url.js +7 -6
- package/dist/internal/sdk-runner.js +388 -363
- package/dist/internal/serve-restart.js +26 -39
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +1283 -1244
- package/dist/internal/session-cost.js +7 -9
- package/dist/internal/session-engine.d.ts +3 -1
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +2801 -2777
- package/dist/internal/session-links.js +12 -16
- package/dist/internal/session-run-log.js +134 -82
- package/dist/internal/session-store.js +133 -164
- package/dist/internal/sessions-client.js +97 -118
- package/dist/internal/skill-catalog.js +18 -23
- package/dist/internal/skills-sync.js +16 -30
- package/dist/internal/slack-provision-client.js +90 -116
- package/dist/internal/start-log-store.js +48 -67
- package/dist/internal/steering.js +1 -2
- package/dist/internal/storage-coordinator.js +160 -196
- package/dist/internal/store-mirror.js +16 -30
- package/dist/internal/stream-progress.js +6 -8
- package/dist/internal/terminal-style.js +3 -4
- package/dist/internal/testing/scm-continuation-fixtures.js +6 -2
- package/dist/internal/testing/slack-continuation-fixtures.d.ts +26 -0
- package/dist/internal/testing/slack-continuation-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/slack-continuation-fixtures.js +136 -0
- package/dist/internal/tool-catalog.js +11 -5
- package/dist/internal/tool-result.js +1 -1
- package/dist/internal/trajectory.js +19 -22
- package/dist/internal/turn-cost.js +52 -62
- package/dist/internal/turn-governor.js +5 -8
- package/dist/internal/turn-lease-store.js +85 -105
- package/dist/internal/turn-outbox.js +28 -43
- package/dist/internal/update-check.js +231 -259
- package/dist/internal/v2-hosting.js +1 -2
- package/dist/internal/workspace-sync.js +25 -41
- package/dist/internal/workspace.js +111 -139
- package/dist/kv/memory-kv.js +27 -51
- package/dist/memory.js +106 -148
- package/dist/otel.js +5 -8
- package/dist/playground/assets/index-DXm_VXAQ.css +1 -0
- package/dist/playground/assets/{index-MijLHTbB.js → index-JekUQERK.js} +45 -45
- package/dist/playground/index.html +2 -2
- package/dist/prompt.js +2 -4
- package/dist/storage-backends/cursor-hosted-v2.js +53 -83
- package/dist/storage-backends/cursor-hosted.js +105 -145
- package/dist/storage-backends/file-kv.js +100 -128
- package/dist/storage-protocol.js +3 -5
- package/dist/storage.js +17 -26
- package/dist/types.d.ts +68 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +20 -18
- package/docs/building-with-agents.md +2 -0
- package/docs/deployment.md +7 -0
- package/docs/guides/bitbucket.md +9 -1
- package/docs/guides/github.md +20 -4
- package/docs/guides/gitlab.md +9 -1
- package/docs/guides/migrate.md +127 -0
- package/docs/reference/cli.md +39 -0
- package/docs/troubleshooting.md +1 -0
- package/package.json +1 -1
- package/skills/debug/SKILL.md +1 -0
- package/skills/github/SKILL.md +23 -0
- package/skills/migrate-v2/SKILL.md +264 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.C25zYVuc.js +0 -1
- package/dist/docs/assets/chunks/channel.CRUyWDV-.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.CG_UObcQ.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.CG_UObcQ.js +0 -1
- package/dist/docs/assets/chunks/clone.NYSZ9qZN.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.DOOmulfQ.js +0 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.BJrCW6xc.js +0 -162
- package/dist/docs/assets/reference_cli.md.GwugN3n-.lean.js +0 -1
- package/dist/docs/assets/troubleshooting.md.Bscj6ODe.js +0 -1
- package/dist/playground/assets/index-DPKLl4C_.css +0 -1
- /package/dist/docs/assets/{building-with-agents.md.BPjPFxFg.lean.js → building-with-agents.md.Df87rAe1.lean.js} +0 -0
- /package/dist/docs/assets/{deployment.md.BdqTiGdc.lean.js → deployment.md.BYuEcDBv.lean.js} +0 -0
- /package/dist/docs/assets/{reference_skills.md.ClkMoQsV.lean.js → reference_skills.md.C0guGcH0.lean.js} +0 -0
package/dist/bin/agent-serve.js
CHANGED
|
@@ -11,19 +11,11 @@
|
|
|
11
11
|
* agent-sdk trajectory --events <file.ndjson>
|
|
12
12
|
* agent-sdk init [dir] [--json]
|
|
13
13
|
* agent-sdk convert-automation <url> [--dir <path>] [--json]
|
|
14
|
+
* agent-sdk migrate [--dir .] [--no-wait] [--json]
|
|
14
15
|
* agent-sdk eval [--dir .] [evalId...]
|
|
15
16
|
* agent-sdk validate [--dir .]
|
|
16
17
|
* agent-sdk slack <subcommand>
|
|
17
18
|
*/
|
|
18
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
19
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
20
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
21
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
22
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
23
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
24
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
19
|
import { spawn } from "node:child_process";
|
|
28
20
|
import { readFile } from "node:fs/promises";
|
|
29
21
|
import { resolve } from "node:path";
|
|
@@ -85,6 +77,8 @@ Usage:
|
|
|
85
77
|
[--slug <slug>] [--team <id>] [--text]
|
|
86
78
|
${CLI} init [dir] [--template <name>] [--var id=value]... [--json]
|
|
87
79
|
${CLI} convert-automation <url> [--dir <path>] [--json]
|
|
80
|
+
${CLI} migrate [--dir <path>] [--repo <url>] [--ref <ref>] [--path <agentPath>]
|
|
81
|
+
[--no-wait] [--json]
|
|
88
82
|
${CLI} install-skills [--print] [--json]
|
|
89
83
|
${CLI} mcp --prod [--slug <slug>] [--team <id>] [--dir <path>]
|
|
90
84
|
| --url <baseUrl> [--bearer-token <t>]
|
|
@@ -206,6 +200,11 @@ Commands:
|
|
|
206
200
|
resolved at runtime (manage authorization in Cursor, dashboard
|
|
207
201
|
-> MCP). Review the project, then run \`validate\` / \`dev\`.
|
|
208
202
|
Warnings never fail the command.
|
|
203
|
+
migrate Early-alpha projects only: start a Cursor cloud agent that
|
|
204
|
+
moves the project from hosted architecture v1 to v2 with the
|
|
205
|
+
bdk-migrate-v2 skill and opens a pull request. Reads the
|
|
206
|
+
pushed ref; --repo/--ref/--path are inferred like deploy.
|
|
207
|
+
Waits for the pull request unless --no-wait. Never deploys.
|
|
209
208
|
install-skills
|
|
210
209
|
Refresh the BDK skills for coding agents in
|
|
211
210
|
~/.cursor/skills/bdk and print where they landed.
|
|
@@ -384,7 +383,8 @@ Options:
|
|
|
384
383
|
path without writing them.
|
|
385
384
|
--no-wait deploy/stop/eval: return right after the request is
|
|
386
385
|
accepted instead of polling until a terminal status.
|
|
387
|
-
For eval, prints the runId (--url only).
|
|
386
|
+
For eval, prints the runId (--url only). migrate: print
|
|
387
|
+
the cloud agent URL and exit.
|
|
388
388
|
--cancel-runs stop: also cancel this install's active Agent SDK v2
|
|
389
389
|
session runs and reminder clocks, and mark factory
|
|
390
390
|
creating/active sessions failed (not every tenant).
|
|
@@ -441,12 +441,13 @@ Options:
|
|
|
441
441
|
--repo serve --cursor-events: repo to subscribe to (repeatable).
|
|
442
442
|
github forward: owner/repo to forward from (inferred from
|
|
443
443
|
the git remote when omitted; last wins).
|
|
444
|
-
deploy: https git repo URL (optional; inferred
|
|
445
|
-
git remote origin when omitted).
|
|
446
|
-
--ref deploy: git ref to build (optional;
|
|
447
|
-
current branch when omitted).
|
|
448
|
-
--path deploy: agent dir relative to repo root
|
|
449
|
-
inferred from --dir vs git toplevel when
|
|
444
|
+
deploy/migrate: https git repo URL (optional; inferred
|
|
445
|
+
from git remote origin when omitted).
|
|
446
|
+
--ref deploy/migrate: git ref to build or migrate (optional;
|
|
447
|
+
inferred from the current branch when omitted).
|
|
448
|
+
--path deploy/migrate: agent dir relative to repo root
|
|
449
|
+
(optional; inferred from --dir vs git toplevel when
|
|
450
|
+
omitted).
|
|
450
451
|
--all deploy: every child agent under a multi-agent --dir
|
|
451
452
|
(skips the interactive picker; mutually exclusive with
|
|
452
453
|
--slug).
|
|
@@ -489,812 +490,832 @@ function writeStdout(text) {
|
|
|
489
490
|
});
|
|
490
491
|
});
|
|
491
492
|
}
|
|
492
|
-
function main(argv) {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
493
|
+
async function main(argv) {
|
|
494
|
+
const [command, ...restIn] = argv;
|
|
495
|
+
if (command === undefined || command === "help" || command === "--help" || command === "-h") {
|
|
496
|
+
// Await the write: HELP is larger than a pipe buffer, and process.exit
|
|
497
|
+
// after main() would otherwise truncate --help under execFile / CI.
|
|
498
|
+
await writeStdout(HELP);
|
|
499
|
+
return command === undefined ? 1 : 0;
|
|
500
|
+
}
|
|
501
|
+
if (command === "version" || command === "--version" || command === "-V") {
|
|
502
|
+
await writeStdout(formatCliVersion({ json: restIn.includes("--json") }));
|
|
503
|
+
return 0;
|
|
504
|
+
}
|
|
505
|
+
// `session --events` means "dump raw events" (boolean). Rewrite so it does
|
|
506
|
+
// not collide with run/trajectory's `--events <file.ndjson>` string flag.
|
|
507
|
+
const rest = command === "session" ? restIn.map(arg => (arg === "--events" ? "--raw-events" : arg)) : restIn;
|
|
508
|
+
const { values, positionals } = parseArgs({
|
|
509
|
+
args: rest,
|
|
510
|
+
allowPositionals: true,
|
|
511
|
+
options: {
|
|
512
|
+
dir: { type: "string", default: "." },
|
|
513
|
+
template: { type: "string" },
|
|
514
|
+
var: { type: "string", multiple: true },
|
|
515
|
+
port: { type: "string" },
|
|
516
|
+
host: { type: "string" },
|
|
517
|
+
mode: { type: "string" },
|
|
518
|
+
dev: { type: "boolean", default: false },
|
|
519
|
+
"api-key": { type: "string" },
|
|
520
|
+
"key-name": { type: "string" },
|
|
521
|
+
"state-root": { type: "string" },
|
|
522
|
+
"bearer-token": { type: "string" },
|
|
523
|
+
"allow-anonymous": { type: "boolean", default: false },
|
|
524
|
+
"allow-anonymous-cursor-github": { type: "boolean", default: false },
|
|
525
|
+
"allow-anonymous-cursor-account-mcp": { type: "boolean", default: false },
|
|
526
|
+
"allow-anonymous-grokbot": { type: "boolean", default: false },
|
|
527
|
+
"cursor-scm-proxy": { type: "boolean", default: false },
|
|
528
|
+
"no-schedules": { type: "boolean", default: false },
|
|
529
|
+
"no-control-plane": { type: "boolean", default: false },
|
|
530
|
+
"no-playground": { type: "boolean", default: false },
|
|
531
|
+
"no-docs": { type: "boolean", default: false },
|
|
532
|
+
url: { type: "string" },
|
|
533
|
+
prod: { type: "boolean", default: false },
|
|
534
|
+
message: { type: "string", multiple: true },
|
|
535
|
+
input: { type: "string" },
|
|
536
|
+
"messages-file": { type: "string" },
|
|
537
|
+
"session-id": { type: "string" },
|
|
538
|
+
session: { type: "string" },
|
|
539
|
+
resume: { type: "boolean", default: false },
|
|
540
|
+
"continuation-token": { type: "string" },
|
|
541
|
+
events: { type: "string" },
|
|
542
|
+
"no-events": { type: "boolean", default: false },
|
|
543
|
+
slug: { type: "string" },
|
|
544
|
+
"timeout-ms": { type: "string" },
|
|
545
|
+
tag: { type: "string", multiple: true },
|
|
546
|
+
list: { type: "boolean", default: false },
|
|
547
|
+
verbose: { type: "boolean", default: false },
|
|
548
|
+
text: { type: "boolean", default: false },
|
|
549
|
+
"no-color": { type: "boolean", default: false },
|
|
550
|
+
"no-stream": { type: "boolean", default: false },
|
|
551
|
+
once: { type: "boolean", default: false },
|
|
552
|
+
"raw-events": { type: "boolean", default: false },
|
|
553
|
+
json: { type: "boolean", default: false },
|
|
554
|
+
name: { type: "string" },
|
|
555
|
+
env: { type: "string" },
|
|
556
|
+
"public-url": { type: "string" },
|
|
557
|
+
"cloud-tools-url": { type: "string" },
|
|
558
|
+
"mount-path": { type: "string" },
|
|
559
|
+
"base-url": { type: "string" },
|
|
560
|
+
print: { type: "boolean", default: false },
|
|
561
|
+
store: { type: "boolean", default: false },
|
|
562
|
+
remote: { type: "boolean", default: false },
|
|
563
|
+
transport: { type: "string" },
|
|
564
|
+
prefix: { type: "string" },
|
|
565
|
+
"no-prefix": { type: "boolean", default: false },
|
|
566
|
+
"channel-posts": { type: "boolean", default: false },
|
|
567
|
+
"slack-team": { type: "string" },
|
|
568
|
+
icon: { type: "string" },
|
|
569
|
+
force: { type: "boolean", default: false },
|
|
570
|
+
manual: { type: "boolean", default: false },
|
|
571
|
+
repo: { type: "string", multiple: true },
|
|
572
|
+
org: { type: "string" },
|
|
573
|
+
"cursor-events": { type: "boolean", default: false },
|
|
574
|
+
secret: { type: "string" },
|
|
575
|
+
channel: { type: "string", multiple: true },
|
|
576
|
+
install: { type: "boolean", default: false },
|
|
577
|
+
"no-install": { type: "boolean", default: false },
|
|
578
|
+
action: { type: "string" },
|
|
579
|
+
conclusion: { type: "string" },
|
|
580
|
+
context: { type: "string" },
|
|
581
|
+
comment: { type: "string" },
|
|
582
|
+
"dry-run": { type: "boolean", default: false },
|
|
583
|
+
"as-of": { type: "string" },
|
|
584
|
+
component: { type: "string" },
|
|
585
|
+
out: { type: "string" },
|
|
586
|
+
team: { type: "string" },
|
|
587
|
+
"no-wait": { type: "boolean", default: false },
|
|
588
|
+
"cancel-runs": { type: "boolean", default: false },
|
|
589
|
+
ref: { type: "string" },
|
|
590
|
+
release: { type: "string" },
|
|
591
|
+
path: { type: "string" },
|
|
592
|
+
all: { type: "boolean", default: false },
|
|
593
|
+
"cursor-events-repo": { type: "string", multiple: true },
|
|
594
|
+
"allow-domain": { type: "string", multiple: true },
|
|
595
|
+
// Hidden Anysphere-only flag; omitted from help.
|
|
596
|
+
"multi-tenant": { type: "boolean", default: false },
|
|
597
|
+
"from-argv": { type: "boolean", default: false },
|
|
598
|
+
strict: { type: "boolean", default: false },
|
|
599
|
+
junit: { type: "string" },
|
|
600
|
+
artifacts: { type: "string" },
|
|
601
|
+
"no-artifacts": { type: "boolean", default: false },
|
|
602
|
+
"skip-report": { type: "boolean", default: false },
|
|
603
|
+
"max-concurrency": { type: "string" },
|
|
604
|
+
version: { type: "boolean", short: "V", default: false },
|
|
605
|
+
},
|
|
606
|
+
});
|
|
607
|
+
const dir = values.dir ?? ".";
|
|
608
|
+
if (values.version === true) {
|
|
609
|
+
await writeStdout(formatCliVersion({ json: values.json === true }));
|
|
610
|
+
return 0;
|
|
611
|
+
}
|
|
612
|
+
// Best-effort, cached, and silent on failure. `update` does its own fresh
|
|
613
|
+
// lookup, --json runs stay quiet for machine consumers, and `mcp` skips it
|
|
614
|
+
// so MCP client spawns stay fast (stdout there is the protocol wire).
|
|
615
|
+
if (command !== "update" &&
|
|
616
|
+
command !== "mcp" &&
|
|
617
|
+
values.json !== true &&
|
|
618
|
+
!isServeRestartWorker()) {
|
|
619
|
+
await warnIfOutdated();
|
|
620
|
+
}
|
|
621
|
+
switch (command) {
|
|
622
|
+
case "slack": {
|
|
623
|
+
const { cmdSlack } = await import("../internal/cli-slack.js");
|
|
624
|
+
const env = values.env === "dev" || values.env === "prod" || values.env === "both"
|
|
625
|
+
? values.env
|
|
626
|
+
: undefined;
|
|
627
|
+
return cmdSlack(positionals[0], {
|
|
628
|
+
dir,
|
|
629
|
+
name: values.name,
|
|
630
|
+
env,
|
|
631
|
+
json: values.json,
|
|
632
|
+
print: values.print,
|
|
633
|
+
prefix: values.prefix,
|
|
634
|
+
noPrefix: values["no-prefix"],
|
|
635
|
+
channelPosts: values["channel-posts"],
|
|
636
|
+
channels: values.channel,
|
|
637
|
+
slackTeam: values["slack-team"],
|
|
638
|
+
prod: values.prod,
|
|
639
|
+
team: values.team,
|
|
640
|
+
apiKey: values["api-key"],
|
|
641
|
+
icon: values.icon,
|
|
642
|
+
force: values.force,
|
|
643
|
+
manual: values.manual,
|
|
644
|
+
install: values.install,
|
|
645
|
+
noInstall: values["no-install"],
|
|
646
|
+
iconSource: positionals[0] === "icon" ? positionals[1] : undefined,
|
|
647
|
+
});
|
|
506
648
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
"session-id": { type: "string" },
|
|
540
|
-
session: { type: "string" },
|
|
541
|
-
resume: { type: "boolean", default: false },
|
|
542
|
-
"continuation-token": { type: "string" },
|
|
543
|
-
events: { type: "string" },
|
|
544
|
-
"no-events": { type: "boolean", default: false },
|
|
545
|
-
slug: { type: "string" },
|
|
546
|
-
"timeout-ms": { type: "string" },
|
|
547
|
-
tag: { type: "string", multiple: true },
|
|
548
|
-
list: { type: "boolean", default: false },
|
|
549
|
-
verbose: { type: "boolean", default: false },
|
|
550
|
-
text: { type: "boolean", default: false },
|
|
551
|
-
"no-color": { type: "boolean", default: false },
|
|
552
|
-
"no-stream": { type: "boolean", default: false },
|
|
553
|
-
once: { type: "boolean", default: false },
|
|
554
|
-
"raw-events": { type: "boolean", default: false },
|
|
555
|
-
json: { type: "boolean", default: false },
|
|
556
|
-
name: { type: "string" },
|
|
557
|
-
env: { type: "string" },
|
|
558
|
-
"public-url": { type: "string" },
|
|
559
|
-
"cloud-tools-url": { type: "string" },
|
|
560
|
-
"mount-path": { type: "string" },
|
|
561
|
-
"base-url": { type: "string" },
|
|
562
|
-
print: { type: "boolean", default: false },
|
|
563
|
-
store: { type: "boolean", default: false },
|
|
564
|
-
remote: { type: "boolean", default: false },
|
|
565
|
-
transport: { type: "string" },
|
|
566
|
-
prefix: { type: "string" },
|
|
567
|
-
"no-prefix": { type: "boolean", default: false },
|
|
568
|
-
"channel-posts": { type: "boolean", default: false },
|
|
569
|
-
"slack-team": { type: "string" },
|
|
570
|
-
icon: { type: "string" },
|
|
571
|
-
force: { type: "boolean", default: false },
|
|
572
|
-
manual: { type: "boolean", default: false },
|
|
573
|
-
repo: { type: "string", multiple: true },
|
|
574
|
-
org: { type: "string" },
|
|
575
|
-
"cursor-events": { type: "boolean", default: false },
|
|
576
|
-
secret: { type: "string" },
|
|
577
|
-
channel: { type: "string", multiple: true },
|
|
578
|
-
install: { type: "boolean", default: false },
|
|
579
|
-
"no-install": { type: "boolean", default: false },
|
|
580
|
-
action: { type: "string" },
|
|
581
|
-
conclusion: { type: "string" },
|
|
582
|
-
context: { type: "string" },
|
|
583
|
-
comment: { type: "string" },
|
|
584
|
-
"dry-run": { type: "boolean", default: false },
|
|
585
|
-
"as-of": { type: "string" },
|
|
586
|
-
component: { type: "string" },
|
|
587
|
-
out: { type: "string" },
|
|
588
|
-
team: { type: "string" },
|
|
589
|
-
"no-wait": { type: "boolean", default: false },
|
|
590
|
-
"cancel-runs": { type: "boolean", default: false },
|
|
591
|
-
ref: { type: "string" },
|
|
592
|
-
release: { type: "string" },
|
|
593
|
-
path: { type: "string" },
|
|
594
|
-
all: { type: "boolean", default: false },
|
|
595
|
-
"cursor-events-repo": { type: "string", multiple: true },
|
|
596
|
-
"allow-domain": { type: "string", multiple: true },
|
|
597
|
-
// Hidden Anysphere-only flag; omitted from help.
|
|
598
|
-
"multi-tenant": { type: "boolean", default: false },
|
|
599
|
-
"from-argv": { type: "boolean", default: false },
|
|
600
|
-
strict: { type: "boolean", default: false },
|
|
601
|
-
junit: { type: "string" },
|
|
602
|
-
artifacts: { type: "string" },
|
|
603
|
-
"no-artifacts": { type: "boolean", default: false },
|
|
604
|
-
"skip-report": { type: "boolean", default: false },
|
|
605
|
-
"max-concurrency": { type: "string" },
|
|
606
|
-
version: { type: "boolean", short: "V", default: false },
|
|
607
|
-
},
|
|
608
|
-
});
|
|
609
|
-
const dir = (_l = values.dir) !== null && _l !== void 0 ? _l : ".";
|
|
610
|
-
if (values.version === true) {
|
|
611
|
-
yield writeStdout(formatCliVersion({ json: values.json === true }));
|
|
612
|
-
return 0;
|
|
649
|
+
case "github": {
|
|
650
|
+
const port = values.port === undefined ? undefined : Number.parseInt(values.port, 10);
|
|
651
|
+
if (port !== undefined && (Number.isNaN(port) || port < 0 || port > 65535)) {
|
|
652
|
+
process.stderr.write(`invalid --port: ${values.port}\n`);
|
|
653
|
+
return 1;
|
|
654
|
+
}
|
|
655
|
+
const { cmdGithub } = await import("../internal/cli-github.js");
|
|
656
|
+
return cmdGithub(positionals[0], {
|
|
657
|
+
dir,
|
|
658
|
+
slug: values.slug,
|
|
659
|
+
// `--channel` is repeatable for `slack doctor`; the github
|
|
660
|
+
// subcommands target a single channel, so the last one wins.
|
|
661
|
+
channel: values.channel?.at(-1),
|
|
662
|
+
host: values.host,
|
|
663
|
+
port,
|
|
664
|
+
url: values.url,
|
|
665
|
+
events: values.events,
|
|
666
|
+
// `--repo` is repeatable for `serve --cursor-events`; the github
|
|
667
|
+
// subcommands target a single repo, so the last one wins.
|
|
668
|
+
repo: values.repo?.at(-1),
|
|
669
|
+
org: values.org,
|
|
670
|
+
secret: values.secret,
|
|
671
|
+
install: values.install,
|
|
672
|
+
json: values.json,
|
|
673
|
+
prUrl: positionals[1],
|
|
674
|
+
action: values.action,
|
|
675
|
+
conclusion: values.conclusion,
|
|
676
|
+
context: values.context,
|
|
677
|
+
comment: values.comment,
|
|
678
|
+
dryRun: values["dry-run"],
|
|
679
|
+
out: values.out,
|
|
680
|
+
});
|
|
613
681
|
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
682
|
+
case "gitlab": {
|
|
683
|
+
const port = values.port === undefined ? undefined : Number.parseInt(values.port, 10);
|
|
684
|
+
if (port !== undefined && (Number.isNaN(port) || port < 0 || port > 65535)) {
|
|
685
|
+
process.stderr.write(`invalid --port: ${values.port}\n`);
|
|
686
|
+
return 1;
|
|
687
|
+
}
|
|
688
|
+
const { cmdGitlab } = await import("../internal/cli-gitlab.js");
|
|
689
|
+
return cmdGitlab(positionals[0], {
|
|
690
|
+
dir,
|
|
691
|
+
slug: values.slug,
|
|
692
|
+
channel: values.channel?.at(-1),
|
|
693
|
+
host: values.host,
|
|
694
|
+
port,
|
|
695
|
+
url: values.url,
|
|
696
|
+
events: values.events,
|
|
697
|
+
secret: values.secret,
|
|
698
|
+
json: values.json,
|
|
699
|
+
mrUrl: positionals[1],
|
|
700
|
+
action: values.action,
|
|
701
|
+
conclusion: values.conclusion,
|
|
702
|
+
comment: values.comment,
|
|
703
|
+
dryRun: values["dry-run"],
|
|
704
|
+
out: values.out,
|
|
705
|
+
});
|
|
622
706
|
}
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
: undefined;
|
|
629
|
-
return cmdSlack(positionals[0], {
|
|
630
|
-
dir,
|
|
631
|
-
name: values.name,
|
|
632
|
-
env,
|
|
633
|
-
json: values.json,
|
|
634
|
-
print: values.print,
|
|
635
|
-
prefix: values.prefix,
|
|
636
|
-
noPrefix: values["no-prefix"],
|
|
637
|
-
channelPosts: values["channel-posts"],
|
|
638
|
-
channels: values.channel,
|
|
639
|
-
slackTeam: values["slack-team"],
|
|
640
|
-
prod: values.prod,
|
|
641
|
-
team: values.team,
|
|
642
|
-
apiKey: values["api-key"],
|
|
643
|
-
icon: values.icon,
|
|
644
|
-
force: values.force,
|
|
645
|
-
manual: values.manual,
|
|
646
|
-
install: values.install,
|
|
647
|
-
noInstall: values["no-install"],
|
|
648
|
-
iconSource: positionals[0] === "icon" ? positionals[1] : undefined,
|
|
649
|
-
});
|
|
707
|
+
case "bitbucket": {
|
|
708
|
+
const port = values.port === undefined ? undefined : Number.parseInt(values.port, 10);
|
|
709
|
+
if (port !== undefined && (Number.isNaN(port) || port < 0 || port > 65535)) {
|
|
710
|
+
process.stderr.write(`invalid --port: ${values.port}\n`);
|
|
711
|
+
return 1;
|
|
650
712
|
}
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
713
|
+
const { cmdBitbucket } = await import("../internal/cli-bitbucket.js");
|
|
714
|
+
return cmdBitbucket(positionals[0], {
|
|
715
|
+
dir,
|
|
716
|
+
slug: values.slug,
|
|
717
|
+
channel: values.channel?.at(-1),
|
|
718
|
+
host: values.host,
|
|
719
|
+
port,
|
|
720
|
+
url: values.url,
|
|
721
|
+
events: values.events,
|
|
722
|
+
secret: values.secret,
|
|
723
|
+
json: values.json,
|
|
724
|
+
prUrl: positionals[1],
|
|
725
|
+
comment: values.comment,
|
|
726
|
+
dryRun: values["dry-run"],
|
|
727
|
+
out: values.out,
|
|
728
|
+
});
|
|
729
|
+
}
|
|
730
|
+
case "init": {
|
|
731
|
+
return cmdInit({
|
|
732
|
+
dir,
|
|
733
|
+
initTarget: positionals[0],
|
|
734
|
+
template: values.template,
|
|
735
|
+
vars: values.var,
|
|
736
|
+
json: values.json,
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
case "convert-automation": {
|
|
740
|
+
const { cmdConvertAutomation } = await import("../internal/cli-convert-automation.js");
|
|
741
|
+
const dirFlagPassed = rest.includes("--dir") || rest.some(arg => arg.startsWith("--dir="));
|
|
742
|
+
return cmdConvertAutomation({
|
|
743
|
+
url: positionals[0],
|
|
744
|
+
// Default target is ./<automation-name-slug>, not the cwd.
|
|
745
|
+
dir: dirFlagPassed ? dir : undefined,
|
|
746
|
+
json: values.json,
|
|
747
|
+
apiKey: values["api-key"],
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
case "migrate": {
|
|
751
|
+
const { cmdMigrate } = await import("../internal/cli-migrate.js");
|
|
752
|
+
return cmdMigrate({
|
|
753
|
+
dir,
|
|
754
|
+
repo: values.repo?.at(-1),
|
|
755
|
+
ref: values.ref,
|
|
756
|
+
path: values.path,
|
|
757
|
+
noWait: values["no-wait"],
|
|
758
|
+
json: values.json,
|
|
759
|
+
apiKey: values["api-key"],
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
case "install-skills": {
|
|
763
|
+
const { cmdInstallSkills } = await import("../internal/cli-skills.js");
|
|
764
|
+
return cmdInstallSkills({
|
|
765
|
+
json: values.json,
|
|
766
|
+
print: values.print,
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
case "mcp": {
|
|
770
|
+
const { cmdMcp } = await import("../internal/cli-mcp.js");
|
|
771
|
+
const mcpSub = positionals[0];
|
|
772
|
+
return cmdMcp(mcpSub, {
|
|
773
|
+
dir,
|
|
774
|
+
slug: values.slug,
|
|
775
|
+
team: values.team,
|
|
776
|
+
apiKey: values["api-key"],
|
|
777
|
+
url: values.url,
|
|
778
|
+
prod: values.prod,
|
|
779
|
+
bearerToken: values["bearer-token"],
|
|
780
|
+
name: values.name,
|
|
781
|
+
print: values.print,
|
|
782
|
+
json: values.json,
|
|
783
|
+
store: values.store,
|
|
784
|
+
remote: values.remote,
|
|
785
|
+
oauthConnection: mcpSub === "oauth" ? positionals[1] : undefined,
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
case "login": {
|
|
789
|
+
const { cmdLogin } = await import("../internal/cli-cursor.js");
|
|
790
|
+
return cmdLogin({
|
|
791
|
+
apiKey: values["api-key"],
|
|
792
|
+
keyName: values["key-name"],
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
case "logout": {
|
|
796
|
+
const { cmdLogout } = await import("../internal/cli-cursor.js");
|
|
797
|
+
return cmdLogout();
|
|
798
|
+
}
|
|
799
|
+
case "whoami": {
|
|
800
|
+
const { cmdWhoami } = await import("../internal/cli-cursor.js");
|
|
801
|
+
return cmdWhoami({ json: values.json });
|
|
802
|
+
}
|
|
803
|
+
case "update": {
|
|
804
|
+
return cmdUpdate();
|
|
805
|
+
}
|
|
806
|
+
case "deploy": {
|
|
807
|
+
// `--repo` is repeatable for `serve --cursor-events`; deploy targets a
|
|
808
|
+
// single source repo, so the last one wins.
|
|
809
|
+
const repo = values.repo?.at(-1);
|
|
810
|
+
const dirFlagPassed = rest.includes("--dir") || rest.some(arg => arg.startsWith("--dir="));
|
|
811
|
+
return cmdDeploy({
|
|
812
|
+
...deployOptionsFromValues(values),
|
|
813
|
+
dir: dirFlagPassed ? dir : undefined,
|
|
814
|
+
...(values.slug === undefined ? {} : { slug: values.slug }),
|
|
815
|
+
all: values.all === true,
|
|
816
|
+
...(repo === undefined ? {} : { repo }),
|
|
817
|
+
...(values.ref === undefined ? {} : { ref: values.ref }),
|
|
818
|
+
...(values.path === undefined ? {} : { path: values.path }),
|
|
819
|
+
...(values["cursor-events-repo"] === undefined
|
|
820
|
+
? {}
|
|
821
|
+
: { cursorEventsRepos: values["cursor-events-repo"] }),
|
|
822
|
+
...(values["allow-domain"] === undefined ? {} : { allowDomains: values["allow-domain"] }),
|
|
823
|
+
multiTenant: values["multi-tenant"] === true,
|
|
824
|
+
});
|
|
825
|
+
}
|
|
826
|
+
case "manifest": {
|
|
827
|
+
// Offline extraction of deploy metadata (events, egress, routes,
|
|
828
|
+
// /v1/info payload) — no VM, no network. Wd-1 of the event-ingress
|
|
829
|
+
// plan; `deploy` attaches this to the request from Wd-2 on.
|
|
830
|
+
return cmdManifest({ dir, json: values.json === true });
|
|
831
|
+
}
|
|
832
|
+
case "deployments": {
|
|
833
|
+
return cmdDeployments(deployOptionsFromValues(values));
|
|
834
|
+
}
|
|
835
|
+
case "deployment": {
|
|
836
|
+
return cmdDeploymentStatus(positionals[0], deployOptionsFromValues(values));
|
|
837
|
+
}
|
|
838
|
+
case "stop": {
|
|
839
|
+
return cmdStop(positionals[0], deployOptionsFromValues(values));
|
|
840
|
+
}
|
|
841
|
+
case "kill": {
|
|
842
|
+
return cmdKill(positionals[0], deployOptionsFromValues(values));
|
|
843
|
+
}
|
|
844
|
+
case "unlock-deploys": {
|
|
845
|
+
return cmdUnlockDeploys(positionals[0], deployOptionsFromValues(values));
|
|
846
|
+
}
|
|
847
|
+
case "start": {
|
|
848
|
+
return cmdStart(positionals[0], deployOptionsFromValues(values));
|
|
849
|
+
}
|
|
850
|
+
case "cancel-runs": {
|
|
851
|
+
return cmdCancelRuns(positionals[0], deployOptionsFromValues(values));
|
|
852
|
+
}
|
|
853
|
+
case "event-repos": {
|
|
854
|
+
return cmdEventRepos(positionals[0], values.repo ?? [], deployOptionsFromValues(values));
|
|
855
|
+
}
|
|
856
|
+
case "upgrade": {
|
|
857
|
+
return cmdUpgrade({ slug: positionals[0], release: values.release }, deployOptionsFromValues(values));
|
|
858
|
+
}
|
|
859
|
+
case "rollback": {
|
|
860
|
+
return cmdRollback({ slug: positionals[0], release: values.release }, deployOptionsFromValues(values));
|
|
861
|
+
}
|
|
862
|
+
case "delete": {
|
|
863
|
+
return cmdDelete(positionals[0], deployOptionsFromValues(values));
|
|
864
|
+
}
|
|
865
|
+
case "rotate-token": {
|
|
866
|
+
return cmdRotateToken(positionals[0], deployOptionsFromValues(values));
|
|
867
|
+
}
|
|
868
|
+
case "secrets": {
|
|
869
|
+
const base = deployOptionsFromValues(values);
|
|
870
|
+
switch (positionals[0]) {
|
|
871
|
+
case "set":
|
|
872
|
+
return cmdSecretsSet(positionals[1], positionals.slice(2), base);
|
|
873
|
+
case "list":
|
|
874
|
+
return cmdSecretsList(positionals[1], base);
|
|
875
|
+
case "unset":
|
|
876
|
+
return cmdSecretsUnset(positionals[1], positionals[2], base);
|
|
877
|
+
default:
|
|
878
|
+
process.stderr.write(`Usage: ${CLI} secrets <set|list|unset> <slug> ... [--team <id>] [--json]\n`);
|
|
655
879
|
return 1;
|
|
656
|
-
}
|
|
657
|
-
const { cmdGithub } = yield import("../internal/cli-github.js");
|
|
658
|
-
return cmdGithub(positionals[0], {
|
|
659
|
-
dir,
|
|
660
|
-
slug: values.slug,
|
|
661
|
-
// `--channel` is repeatable for `slack doctor`; the github
|
|
662
|
-
// subcommands target a single channel, so the last one wins.
|
|
663
|
-
channel: (_a = values.channel) === null || _a === void 0 ? void 0 : _a.at(-1),
|
|
664
|
-
host: values.host,
|
|
665
|
-
port,
|
|
666
|
-
url: values.url,
|
|
667
|
-
events: values.events,
|
|
668
|
-
// `--repo` is repeatable for `serve --cursor-events`; the github
|
|
669
|
-
// subcommands target a single repo, so the last one wins.
|
|
670
|
-
repo: (_b = values.repo) === null || _b === void 0 ? void 0 : _b.at(-1),
|
|
671
|
-
org: values.org,
|
|
672
|
-
secret: values.secret,
|
|
673
|
-
install: values.install,
|
|
674
|
-
json: values.json,
|
|
675
|
-
prUrl: positionals[1],
|
|
676
|
-
action: values.action,
|
|
677
|
-
conclusion: values.conclusion,
|
|
678
|
-
context: values.context,
|
|
679
|
-
comment: values.comment,
|
|
680
|
-
dryRun: values["dry-run"],
|
|
681
|
-
out: values.out,
|
|
682
|
-
});
|
|
683
880
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
881
|
+
}
|
|
882
|
+
case "images": {
|
|
883
|
+
const base = deployOptionsFromValues(values);
|
|
884
|
+
switch (positionals[0]) {
|
|
885
|
+
case "push":
|
|
886
|
+
return cmdImagesPush({ image: positionals[1], name: values.name }, base);
|
|
887
|
+
case "list":
|
|
888
|
+
return cmdImagesList(base);
|
|
889
|
+
case "rm":
|
|
890
|
+
return cmdImagesRm(positionals[1], base);
|
|
891
|
+
default:
|
|
892
|
+
process.stderr.write(`Usage: ${CLI} images <push <local-image> --name <name>|list|rm <name>> [--team <id>] [--json]\n`);
|
|
688
893
|
return 1;
|
|
689
|
-
}
|
|
690
|
-
const { cmdGitlab } = yield import("../internal/cli-gitlab.js");
|
|
691
|
-
return cmdGitlab(positionals[0], {
|
|
692
|
-
dir,
|
|
693
|
-
slug: values.slug,
|
|
694
|
-
channel: (_c = values.channel) === null || _c === void 0 ? void 0 : _c.at(-1),
|
|
695
|
-
host: values.host,
|
|
696
|
-
port,
|
|
697
|
-
url: values.url,
|
|
698
|
-
events: values.events,
|
|
699
|
-
secret: values.secret,
|
|
700
|
-
json: values.json,
|
|
701
|
-
mrUrl: positionals[1],
|
|
702
|
-
action: values.action,
|
|
703
|
-
conclusion: values.conclusion,
|
|
704
|
-
comment: values.comment,
|
|
705
|
-
dryRun: values["dry-run"],
|
|
706
|
-
out: values.out,
|
|
707
|
-
});
|
|
708
894
|
}
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
895
|
+
}
|
|
896
|
+
case "run": {
|
|
897
|
+
const messages = await loadMessages(values.message, values["messages-file"]);
|
|
898
|
+
return cmdRun(axFromOptions({
|
|
899
|
+
dir,
|
|
900
|
+
messages,
|
|
901
|
+
sessionId: values["session-id"] ?? values.session,
|
|
902
|
+
continuationToken: values["continuation-token"],
|
|
903
|
+
events: values["no-events"] ? false : values.events === undefined ? true : values.events,
|
|
904
|
+
text: values.text,
|
|
905
|
+
url: values.url,
|
|
906
|
+
prod: values.prod,
|
|
907
|
+
team: values.team,
|
|
908
|
+
apiKey: values["api-key"],
|
|
909
|
+
slug: values.slug,
|
|
910
|
+
bearerToken: values["bearer-token"],
|
|
911
|
+
stateRoot: values["state-root"],
|
|
912
|
+
timeoutMs: parseTimeoutMs(values["timeout-ms"]),
|
|
913
|
+
stream: values["no-stream"] ? false : undefined,
|
|
914
|
+
dryRun: values["dry-run"],
|
|
915
|
+
asOf: values["as-of"],
|
|
916
|
+
componentKey: values.component,
|
|
917
|
+
}));
|
|
918
|
+
}
|
|
919
|
+
case "call": {
|
|
920
|
+
return cmdCall(axFromOptions({
|
|
921
|
+
dir,
|
|
922
|
+
toolName: positionals[0],
|
|
923
|
+
toolInput: values.input,
|
|
924
|
+
sessionId: values["session-id"] ?? values.session,
|
|
925
|
+
url: values.url,
|
|
926
|
+
prod: values.prod,
|
|
927
|
+
team: values.team,
|
|
928
|
+
apiKey: values["api-key"],
|
|
929
|
+
slug: values.slug,
|
|
930
|
+
bearerToken: values["bearer-token"],
|
|
931
|
+
stateRoot: values["state-root"],
|
|
932
|
+
}));
|
|
933
|
+
}
|
|
934
|
+
case "skill": {
|
|
935
|
+
return cmdSkill(positionals[0], axFromOptions({
|
|
936
|
+
dir,
|
|
937
|
+
text: values.text,
|
|
938
|
+
url: values.url,
|
|
939
|
+
prod: values.prod,
|
|
940
|
+
team: values.team,
|
|
941
|
+
apiKey: values["api-key"],
|
|
942
|
+
slug: values.slug,
|
|
943
|
+
bearerToken: values["bearer-token"],
|
|
944
|
+
stateRoot: values["state-root"],
|
|
945
|
+
}));
|
|
946
|
+
}
|
|
947
|
+
case "trajectory": {
|
|
948
|
+
if (values.events === undefined) {
|
|
949
|
+
process.stderr.write("trajectory requires --events <file.ndjson>\n");
|
|
950
|
+
return 1;
|
|
731
951
|
}
|
|
732
|
-
|
|
733
|
-
|
|
952
|
+
return cmdTrajectory(axFromOptions({
|
|
953
|
+
dir,
|
|
954
|
+
events: values.events,
|
|
955
|
+
text: values.text,
|
|
956
|
+
}));
|
|
957
|
+
}
|
|
958
|
+
case "eval": {
|
|
959
|
+
// Remote status subcommand only when targeting --url. Otherwise the
|
|
960
|
+
// bare token "status" is a normal eval id (evals/status.eval.ts).
|
|
961
|
+
if (positionals[0] === "status" && values.url !== undefined) {
|
|
962
|
+
return cmdEvalStatus(positionals[1], axFromOptions({
|
|
734
963
|
dir,
|
|
735
|
-
initTarget: positionals[0],
|
|
736
|
-
template: values.template,
|
|
737
|
-
vars: values.var,
|
|
738
|
-
json: values.json,
|
|
739
|
-
});
|
|
740
|
-
}
|
|
741
|
-
case "convert-automation": {
|
|
742
|
-
const { cmdConvertAutomation } = yield import("../internal/cli-convert-automation.js");
|
|
743
|
-
const dirFlagPassed = rest.includes("--dir") || rest.some(arg => arg.startsWith("--dir="));
|
|
744
|
-
return cmdConvertAutomation({
|
|
745
|
-
url: positionals[0],
|
|
746
|
-
// Default target is ./<automation-name-slug>, not the cwd.
|
|
747
|
-
dir: dirFlagPassed ? dir : undefined,
|
|
748
964
|
json: values.json,
|
|
749
|
-
apiKey: values["api-key"],
|
|
750
|
-
});
|
|
751
|
-
}
|
|
752
|
-
case "install-skills": {
|
|
753
|
-
const { cmdInstallSkills } = yield import("../internal/cli-skills.js");
|
|
754
|
-
return cmdInstallSkills({
|
|
755
|
-
json: values.json,
|
|
756
|
-
print: values.print,
|
|
757
|
-
});
|
|
758
|
-
}
|
|
759
|
-
case "mcp": {
|
|
760
|
-
const { cmdMcp } = yield import("../internal/cli-mcp.js");
|
|
761
|
-
const mcpSub = positionals[0];
|
|
762
|
-
return cmdMcp(mcpSub, {
|
|
763
|
-
dir,
|
|
764
|
-
slug: values.slug,
|
|
765
|
-
team: values.team,
|
|
766
|
-
apiKey: values["api-key"],
|
|
767
965
|
url: values.url,
|
|
768
966
|
prod: values.prod,
|
|
769
|
-
bearerToken: values["bearer-token"],
|
|
770
|
-
name: values.name,
|
|
771
|
-
print: values.print,
|
|
772
|
-
json: values.json,
|
|
773
|
-
store: values.store,
|
|
774
|
-
remote: values.remote,
|
|
775
|
-
oauthConnection: mcpSub === "oauth" ? positionals[1] : undefined,
|
|
776
|
-
});
|
|
777
|
-
}
|
|
778
|
-
case "login": {
|
|
779
|
-
const { cmdLogin } = yield import("../internal/cli-cursor.js");
|
|
780
|
-
return cmdLogin({
|
|
781
|
-
apiKey: values["api-key"],
|
|
782
|
-
keyName: values["key-name"],
|
|
783
|
-
});
|
|
784
|
-
}
|
|
785
|
-
case "logout": {
|
|
786
|
-
const { cmdLogout } = yield import("../internal/cli-cursor.js");
|
|
787
|
-
return cmdLogout();
|
|
788
|
-
}
|
|
789
|
-
case "whoami": {
|
|
790
|
-
const { cmdWhoami } = yield import("../internal/cli-cursor.js");
|
|
791
|
-
return cmdWhoami({ json: values.json });
|
|
792
|
-
}
|
|
793
|
-
case "update": {
|
|
794
|
-
return cmdUpdate();
|
|
795
|
-
}
|
|
796
|
-
case "deploy": {
|
|
797
|
-
// `--repo` is repeatable for `serve --cursor-events`; deploy targets a
|
|
798
|
-
// single source repo, so the last one wins.
|
|
799
|
-
const repo = (_e = values.repo) === null || _e === void 0 ? void 0 : _e.at(-1);
|
|
800
|
-
const dirFlagPassed = rest.includes("--dir") || rest.some(arg => arg.startsWith("--dir="));
|
|
801
|
-
return cmdDeploy(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, deployOptionsFromValues(values)), { dir: dirFlagPassed ? dir : undefined }), (values.slug === undefined ? {} : { slug: values.slug })), { all: values.all === true }), (repo === undefined ? {} : { repo })), (values.ref === undefined ? {} : { ref: values.ref })), (values.path === undefined ? {} : { path: values.path })), (values["cursor-events-repo"] === undefined
|
|
802
|
-
? {}
|
|
803
|
-
: { cursorEventsRepos: values["cursor-events-repo"] })), (values["allow-domain"] === undefined ? {} : { allowDomains: values["allow-domain"] })), { multiTenant: values["multi-tenant"] === true }));
|
|
804
|
-
}
|
|
805
|
-
case "manifest": {
|
|
806
|
-
// Offline extraction of deploy metadata (events, egress, routes,
|
|
807
|
-
// /v1/info payload) — no VM, no network. Wd-1 of the event-ingress
|
|
808
|
-
// plan; `deploy` attaches this to the request from Wd-2 on.
|
|
809
|
-
return cmdManifest({ dir, json: values.json === true });
|
|
810
|
-
}
|
|
811
|
-
case "deployments": {
|
|
812
|
-
return cmdDeployments(deployOptionsFromValues(values));
|
|
813
|
-
}
|
|
814
|
-
case "deployment": {
|
|
815
|
-
return cmdDeploymentStatus(positionals[0], deployOptionsFromValues(values));
|
|
816
|
-
}
|
|
817
|
-
case "stop": {
|
|
818
|
-
return cmdStop(positionals[0], deployOptionsFromValues(values));
|
|
819
|
-
}
|
|
820
|
-
case "kill": {
|
|
821
|
-
return cmdKill(positionals[0], deployOptionsFromValues(values));
|
|
822
|
-
}
|
|
823
|
-
case "unlock-deploys": {
|
|
824
|
-
return cmdUnlockDeploys(positionals[0], deployOptionsFromValues(values));
|
|
825
|
-
}
|
|
826
|
-
case "start": {
|
|
827
|
-
return cmdStart(positionals[0], deployOptionsFromValues(values));
|
|
828
|
-
}
|
|
829
|
-
case "cancel-runs": {
|
|
830
|
-
return cmdCancelRuns(positionals[0], deployOptionsFromValues(values));
|
|
831
|
-
}
|
|
832
|
-
case "event-repos": {
|
|
833
|
-
return cmdEventRepos(positionals[0], (_m = values.repo) !== null && _m !== void 0 ? _m : [], deployOptionsFromValues(values));
|
|
834
|
-
}
|
|
835
|
-
case "upgrade": {
|
|
836
|
-
return cmdUpgrade({ slug: positionals[0], release: values.release }, deployOptionsFromValues(values));
|
|
837
|
-
}
|
|
838
|
-
case "rollback": {
|
|
839
|
-
return cmdRollback({ slug: positionals[0], release: values.release }, deployOptionsFromValues(values));
|
|
840
|
-
}
|
|
841
|
-
case "delete": {
|
|
842
|
-
return cmdDelete(positionals[0], deployOptionsFromValues(values));
|
|
843
|
-
}
|
|
844
|
-
case "rotate-token": {
|
|
845
|
-
return cmdRotateToken(positionals[0], deployOptionsFromValues(values));
|
|
846
|
-
}
|
|
847
|
-
case "secrets": {
|
|
848
|
-
const base = deployOptionsFromValues(values);
|
|
849
|
-
switch (positionals[0]) {
|
|
850
|
-
case "set":
|
|
851
|
-
return cmdSecretsSet(positionals[1], positionals.slice(2), base);
|
|
852
|
-
case "list":
|
|
853
|
-
return cmdSecretsList(positionals[1], base);
|
|
854
|
-
case "unset":
|
|
855
|
-
return cmdSecretsUnset(positionals[1], positionals[2], base);
|
|
856
|
-
default:
|
|
857
|
-
process.stderr.write(`Usage: ${CLI} secrets <set|list|unset> <slug> ... [--team <id>] [--json]\n`);
|
|
858
|
-
return 1;
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
case "images": {
|
|
862
|
-
const base = deployOptionsFromValues(values);
|
|
863
|
-
switch (positionals[0]) {
|
|
864
|
-
case "push":
|
|
865
|
-
return cmdImagesPush({ image: positionals[1], name: values.name }, base);
|
|
866
|
-
case "list":
|
|
867
|
-
return cmdImagesList(base);
|
|
868
|
-
case "rm":
|
|
869
|
-
return cmdImagesRm(positionals[1], base);
|
|
870
|
-
default:
|
|
871
|
-
process.stderr.write(`Usage: ${CLI} images <push <local-image> --name <name>|list|rm <name>> [--team <id>] [--json]\n`);
|
|
872
|
-
return 1;
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
case "run": {
|
|
876
|
-
const messages = yield loadMessages(values.message, values["messages-file"]);
|
|
877
|
-
return cmdRun(axFromOptions({
|
|
878
|
-
dir,
|
|
879
|
-
messages,
|
|
880
|
-
sessionId: (_o = values["session-id"]) !== null && _o !== void 0 ? _o : values.session,
|
|
881
|
-
continuationToken: values["continuation-token"],
|
|
882
|
-
events: values["no-events"] ? false : values.events === undefined ? true : values.events,
|
|
883
|
-
text: values.text,
|
|
884
|
-
url: values.url,
|
|
885
|
-
prod: values.prod,
|
|
886
|
-
team: values.team,
|
|
887
|
-
apiKey: values["api-key"],
|
|
888
967
|
slug: values.slug,
|
|
889
968
|
bearerToken: values["bearer-token"],
|
|
890
|
-
|
|
891
|
-
timeoutMs: parseTimeoutMs(values["timeout-ms"]),
|
|
892
|
-
stream: values["no-stream"] ? false : undefined,
|
|
893
|
-
dryRun: values["dry-run"],
|
|
894
|
-
asOf: values["as-of"],
|
|
895
|
-
componentKey: values.component,
|
|
969
|
+
out: values.out,
|
|
896
970
|
}));
|
|
897
971
|
}
|
|
898
|
-
|
|
899
|
-
return
|
|
972
|
+
if (positionals[0] === "cancel" && values.url !== undefined) {
|
|
973
|
+
return cmdEvalCancel(positionals[1], axFromOptions({
|
|
900
974
|
dir,
|
|
901
|
-
|
|
902
|
-
toolInput: values.input,
|
|
903
|
-
sessionId: (_p = values["session-id"]) !== null && _p !== void 0 ? _p : values.session,
|
|
975
|
+
json: values.json,
|
|
904
976
|
url: values.url,
|
|
905
977
|
prod: values.prod,
|
|
906
|
-
team: values.team,
|
|
907
|
-
apiKey: values["api-key"],
|
|
908
978
|
slug: values.slug,
|
|
909
979
|
bearerToken: values["bearer-token"],
|
|
910
|
-
stateRoot: values["state-root"],
|
|
911
980
|
}));
|
|
912
981
|
}
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
982
|
+
return cmdEval(axFromOptions({
|
|
983
|
+
dir,
|
|
984
|
+
evalIds: positionals,
|
|
985
|
+
list: values.list,
|
|
986
|
+
verbose: values.verbose,
|
|
987
|
+
json: values.json,
|
|
988
|
+
tags: values.tag,
|
|
989
|
+
url: values.url,
|
|
990
|
+
prod: values.prod,
|
|
991
|
+
noWait: values["no-wait"],
|
|
992
|
+
slug: values.slug,
|
|
993
|
+
bearerToken: values["bearer-token"],
|
|
994
|
+
stateRoot: values["state-root"],
|
|
995
|
+
timeoutMs: parseTimeoutMs(values["timeout-ms"]),
|
|
996
|
+
stream: values["no-stream"] ? false : undefined,
|
|
997
|
+
strict: values.strict,
|
|
998
|
+
junit: values.junit,
|
|
999
|
+
artifacts: values["no-artifacts"] ? false : values.artifacts,
|
|
1000
|
+
skipReport: values["skip-report"],
|
|
1001
|
+
maxConcurrency: parseMaxConcurrency(values["max-concurrency"]),
|
|
1002
|
+
out: values.out,
|
|
1003
|
+
}));
|
|
1004
|
+
}
|
|
1005
|
+
case "chat": {
|
|
1006
|
+
return cmdChat(axFromOptions({
|
|
1007
|
+
dir,
|
|
1008
|
+
messages: values.message,
|
|
1009
|
+
url: values.url,
|
|
1010
|
+
prod: values.prod,
|
|
1011
|
+
team: values.team,
|
|
1012
|
+
apiKey: values["api-key"],
|
|
1013
|
+
slug: values.slug,
|
|
1014
|
+
sessionId: values["session-id"] ?? values.session,
|
|
1015
|
+
resume: values.resume,
|
|
1016
|
+
continuationToken: values["continuation-token"],
|
|
1017
|
+
bearerToken: values["bearer-token"],
|
|
1018
|
+
json: values.json,
|
|
1019
|
+
text: values.text,
|
|
1020
|
+
noColor: values["no-color"],
|
|
1021
|
+
}));
|
|
1022
|
+
}
|
|
1023
|
+
case "resume": {
|
|
1024
|
+
return cmdResume(positionals[0], axFromOptions({
|
|
1025
|
+
dir,
|
|
1026
|
+
messages: values.message,
|
|
1027
|
+
url: values.url,
|
|
1028
|
+
prod: values.prod,
|
|
1029
|
+
team: values.team,
|
|
1030
|
+
apiKey: values["api-key"],
|
|
1031
|
+
slug: values.slug,
|
|
1032
|
+
// Positional wins; --session is accepted as a redundant alias.
|
|
1033
|
+
// No id → resume previous (cmdResume sets resume: true).
|
|
1034
|
+
sessionId: positionals[0] ?? values["session-id"] ?? values.session,
|
|
1035
|
+
continuationToken: values["continuation-token"],
|
|
1036
|
+
bearerToken: values["bearer-token"],
|
|
1037
|
+
json: values.json,
|
|
1038
|
+
text: values.text,
|
|
1039
|
+
noColor: values["no-color"],
|
|
1040
|
+
}));
|
|
1041
|
+
}
|
|
1042
|
+
case "logs": {
|
|
1043
|
+
return cmdLogs(axFromOptions({
|
|
1044
|
+
dir,
|
|
1045
|
+
url: values.url,
|
|
1046
|
+
prod: values.prod,
|
|
1047
|
+
team: values.team,
|
|
1048
|
+
apiKey: values["api-key"],
|
|
1049
|
+
slug: values.slug,
|
|
1050
|
+
bearerToken: values["bearer-token"],
|
|
1051
|
+
sessionId: positionals[0] ?? values["session-id"] ?? values.session,
|
|
1052
|
+
json: values.json,
|
|
1053
|
+
once: values.once,
|
|
1054
|
+
}));
|
|
1055
|
+
}
|
|
1056
|
+
case "sessions": {
|
|
1057
|
+
return cmdSessions(axFromOptions({
|
|
1058
|
+
dir,
|
|
1059
|
+
url: values.url,
|
|
1060
|
+
prod: values.prod,
|
|
1061
|
+
team: values.team,
|
|
1062
|
+
apiKey: values["api-key"],
|
|
1063
|
+
slug: values.slug,
|
|
1064
|
+
bearerToken: values["bearer-token"],
|
|
1065
|
+
json: values.json,
|
|
1066
|
+
}));
|
|
1067
|
+
}
|
|
1068
|
+
case "session": {
|
|
1069
|
+
const messages = await loadMessages(values.message, values["messages-file"]);
|
|
1070
|
+
return cmdSession(positionals[0], axFromOptions({
|
|
1071
|
+
dir,
|
|
1072
|
+
url: values.url,
|
|
1073
|
+
prod: values.prod,
|
|
1074
|
+
team: values.team,
|
|
1075
|
+
apiKey: values["api-key"],
|
|
1076
|
+
slug: values.slug,
|
|
1077
|
+
bearerToken: values["bearer-token"],
|
|
1078
|
+
json: values.json,
|
|
1079
|
+
text: values.text,
|
|
1080
|
+
rawEvents: values["raw-events"],
|
|
1081
|
+
out: values.out,
|
|
1082
|
+
messages,
|
|
1083
|
+
sessionId: values["session-id"] ?? values.session,
|
|
1084
|
+
dryRun: values["dry-run"],
|
|
1085
|
+
asOf: values["as-of"],
|
|
1086
|
+
componentKey: values.component,
|
|
1087
|
+
}));
|
|
1088
|
+
}
|
|
1089
|
+
case "cost": {
|
|
1090
|
+
return cmdCost(positionals[0] ?? values["session-id"] ?? values.session, axFromOptions({
|
|
1091
|
+
dir,
|
|
1092
|
+
url: values.url,
|
|
1093
|
+
prod: values.prod,
|
|
1094
|
+
team: values.team,
|
|
1095
|
+
apiKey: values["api-key"],
|
|
1096
|
+
slug: values.slug,
|
|
1097
|
+
bearerToken: values["bearer-token"],
|
|
1098
|
+
json: values.json,
|
|
1099
|
+
}));
|
|
1100
|
+
}
|
|
1101
|
+
case "playground": {
|
|
1102
|
+
return cmdPlayground(axFromOptions({
|
|
1103
|
+
dir,
|
|
1104
|
+
url: values.url,
|
|
1105
|
+
prod: values.prod,
|
|
1106
|
+
team: values.team,
|
|
1107
|
+
apiKey: values["api-key"],
|
|
1108
|
+
slug: values.slug,
|
|
1109
|
+
bearerToken: values["bearer-token"],
|
|
1110
|
+
sessionId: values["session-id"] ?? values.session,
|
|
1111
|
+
print: values.print,
|
|
1112
|
+
}));
|
|
1113
|
+
}
|
|
1114
|
+
case "docs": {
|
|
1115
|
+
const docsPort = values.port === undefined ? 0 : Number.parseInt(values.port, 10);
|
|
1116
|
+
if (Number.isNaN(docsPort) || docsPort < 0 || docsPort > 65535) {
|
|
1117
|
+
process.stderr.write(`invalid --port: ${values.port}\n`);
|
|
1118
|
+
return 1;
|
|
925
1119
|
}
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
1120
|
+
const { cmdDocs } = await import("../internal/cli-docs.js");
|
|
1121
|
+
return cmdDocs({
|
|
1122
|
+
port: docsPort,
|
|
1123
|
+
host: values.host,
|
|
1124
|
+
print: values.print === true,
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
case "validate": {
|
|
1128
|
+
const mounts = await loadMounts(dir);
|
|
1129
|
+
let hasError = false;
|
|
1130
|
+
for (const { slug, project } of mounts) {
|
|
1131
|
+
const label = slug === "" ? project.name : `${slug} (${project.name})`;
|
|
1132
|
+
if (project.diagnostics.length === 0) {
|
|
1133
|
+
process.stdout.write(`ok: ${label} has no diagnostics\n`);
|
|
1134
|
+
continue;
|
|
930
1135
|
}
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
events: values.events,
|
|
934
|
-
text: values.text,
|
|
935
|
-
}));
|
|
1136
|
+
process.stdout.write(`${label}:\n${formatDiagnostics(project.diagnostics)}\n`);
|
|
1137
|
+
hasError ||= project.diagnostics.some(d => d.severity === "error");
|
|
936
1138
|
}
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
return cmdEvalCancel(positionals[1], axFromOptions({
|
|
953
|
-
dir,
|
|
954
|
-
json: values.json,
|
|
955
|
-
url: values.url,
|
|
956
|
-
prod: values.prod,
|
|
957
|
-
slug: values.slug,
|
|
958
|
-
bearerToken: values["bearer-token"],
|
|
959
|
-
}));
|
|
960
|
-
}
|
|
961
|
-
return cmdEval(axFromOptions({
|
|
962
|
-
dir,
|
|
963
|
-
evalIds: positionals,
|
|
964
|
-
list: values.list,
|
|
965
|
-
verbose: values.verbose,
|
|
966
|
-
json: values.json,
|
|
967
|
-
tags: values.tag,
|
|
968
|
-
url: values.url,
|
|
969
|
-
prod: values.prod,
|
|
970
|
-
noWait: values["no-wait"],
|
|
971
|
-
slug: values.slug,
|
|
972
|
-
bearerToken: values["bearer-token"],
|
|
973
|
-
stateRoot: values["state-root"],
|
|
974
|
-
timeoutMs: parseTimeoutMs(values["timeout-ms"]),
|
|
975
|
-
stream: values["no-stream"] ? false : undefined,
|
|
976
|
-
strict: values.strict,
|
|
977
|
-
junit: values.junit,
|
|
978
|
-
artifacts: values["no-artifacts"] ? false : values.artifacts,
|
|
979
|
-
skipReport: values["skip-report"],
|
|
980
|
-
maxConcurrency: parseMaxConcurrency(values["max-concurrency"]),
|
|
981
|
-
out: values.out,
|
|
982
|
-
}));
|
|
1139
|
+
return hasError ? 1 : 0;
|
|
1140
|
+
}
|
|
1141
|
+
case "info": {
|
|
1142
|
+
const mounts = await loadMounts(dir);
|
|
1143
|
+
if (values.json) {
|
|
1144
|
+
const payload = mounts.length === 1 && mounts[0]?.slug === ""
|
|
1145
|
+
? projectInfo(mounts[0].project)
|
|
1146
|
+
: {
|
|
1147
|
+
agents: mounts.map(({ slug, project }) => ({
|
|
1148
|
+
slug,
|
|
1149
|
+
...projectInfo(project),
|
|
1150
|
+
})),
|
|
1151
|
+
};
|
|
1152
|
+
process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
|
|
1153
|
+
return 0;
|
|
983
1154
|
}
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
slug: values.slug,
|
|
993
|
-
sessionId: (_q = values["session-id"]) !== null && _q !== void 0 ? _q : values.session,
|
|
994
|
-
resume: values.resume,
|
|
995
|
-
continuationToken: values["continuation-token"],
|
|
996
|
-
bearerToken: values["bearer-token"],
|
|
997
|
-
json: values.json,
|
|
998
|
-
text: values.text,
|
|
999
|
-
noColor: values["no-color"],
|
|
1000
|
-
}));
|
|
1155
|
+
if (mounts.length > 1 || mounts[0]?.slug !== "") {
|
|
1156
|
+
process.stdout.write(`${mounts.length} agents under ${dir}:\n\n`);
|
|
1157
|
+
for (const { slug, project } of mounts) {
|
|
1158
|
+
const info = projectInfo(project);
|
|
1159
|
+
process.stdout.write(` /${slug} — ${info.name} (${formatModel(info.model)}, ${info.tools.length} tools, ${info.channels.length} channels)\n`);
|
|
1160
|
+
}
|
|
1161
|
+
const anyError = mounts.some(m => m.project.diagnostics.some(d => d.severity === "error"));
|
|
1162
|
+
return anyError ? 1 : 0;
|
|
1001
1163
|
}
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
slug: values.slug,
|
|
1011
|
-
// Positional wins; --session is accepted as a redundant alias.
|
|
1012
|
-
// No id → resume previous (cmdResume sets resume: true).
|
|
1013
|
-
sessionId: (_s = (_r = positionals[0]) !== null && _r !== void 0 ? _r : values["session-id"]) !== null && _s !== void 0 ? _s : values.session,
|
|
1014
|
-
continuationToken: values["continuation-token"],
|
|
1015
|
-
bearerToken: values["bearer-token"],
|
|
1016
|
-
json: values.json,
|
|
1017
|
-
text: values.text,
|
|
1018
|
-
noColor: values["no-color"],
|
|
1019
|
-
}));
|
|
1164
|
+
const project = mounts[0]?.project;
|
|
1165
|
+
const info = projectInfo(project);
|
|
1166
|
+
const lines = [];
|
|
1167
|
+
lines.push(`agent: ${info.name}`);
|
|
1168
|
+
lines.push(`model: ${formatModel(info.model)}`);
|
|
1169
|
+
lines.push(`mcp: ${info.mcp.path} (${info.mcp.tools.join(", ")})`);
|
|
1170
|
+
if (info.instructions !== undefined) {
|
|
1171
|
+
lines.push(`instructions: ${info.instructions.chars} chars`);
|
|
1020
1172
|
}
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1173
|
+
lines.push(section("tools", info.tools.map(t => `${t.name} — ${t.description}`)));
|
|
1174
|
+
lines.push(section("skills", info.skills.map(s => `${s.name} — ${s.description}`)));
|
|
1175
|
+
lines.push(section("extensions", info.extensions.map(e => {
|
|
1176
|
+
const contributed = [...e.tools, ...e.skills].join(", ") || "(nothing contributed)";
|
|
1177
|
+
const egress = e.hosting?.egressDomains ?? [];
|
|
1178
|
+
return egress.length === 0
|
|
1179
|
+
? `${e.name} — ${contributed}`
|
|
1180
|
+
: `${e.name} — ${contributed}; egress: ${egress.join(", ")}`;
|
|
1181
|
+
})));
|
|
1182
|
+
lines.push(section("MCP connections", info.connections.map(c => `${c.name} — ${c.transport}`)));
|
|
1183
|
+
lines.push(section("subagents", info.subagents.map(s => `${s.name} — ${s.description ?? ""}`)));
|
|
1184
|
+
lines.push(section("channels", info.channels.map(c => `${c.id}: ${c.routes.map(r => `${r.method} ${r.url}`).join(", ") || "(events only)"}`)));
|
|
1185
|
+
lines.push(section("schedules", info.schedules.map(s => `${s.name} (${s.cron}, ${s.kind})`)));
|
|
1186
|
+
lines.push(section("hooks", info.hooks));
|
|
1187
|
+
lines.push(section("hosting egress domains", info.hosting?.egressDomains ?? []));
|
|
1188
|
+
lines.push(section("hosting secret names", info.hosting?.secretNames ?? []));
|
|
1189
|
+
if (info.diagnostics.length > 0) {
|
|
1190
|
+
lines.push(`\ndiagnostics:\n${formatDiagnostics(info.diagnostics)}`);
|
|
1034
1191
|
}
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1192
|
+
process.stdout.write(`${lines.filter(line => line !== "").join("\n")}\n`);
|
|
1193
|
+
return info.diagnostics.some(d => d.severity === "error") ? 1 : 0;
|
|
1194
|
+
}
|
|
1195
|
+
case "dev":
|
|
1196
|
+
case "serve": {
|
|
1197
|
+
const serveDirResult = resolveServeDir({
|
|
1198
|
+
command,
|
|
1199
|
+
dir,
|
|
1200
|
+
positionals,
|
|
1201
|
+
dirFlagPassed: rest.includes("--dir"),
|
|
1202
|
+
});
|
|
1203
|
+
if (typeof serveDirResult !== "string") {
|
|
1204
|
+
process.stderr.write(serveDirResult.error);
|
|
1205
|
+
return 1;
|
|
1046
1206
|
}
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
prod: values.prod,
|
|
1053
|
-
team: values.team,
|
|
1054
|
-
apiKey: values["api-key"],
|
|
1055
|
-
slug: values.slug,
|
|
1056
|
-
bearerToken: values["bearer-token"],
|
|
1057
|
-
json: values.json,
|
|
1058
|
-
text: values.text,
|
|
1059
|
-
rawEvents: values["raw-events"],
|
|
1060
|
-
out: values.out,
|
|
1061
|
-
messages,
|
|
1062
|
-
sessionId: (_v = values["session-id"]) !== null && _v !== void 0 ? _v : values.session,
|
|
1063
|
-
dryRun: values["dry-run"],
|
|
1064
|
-
asOf: values["as-of"],
|
|
1065
|
-
componentKey: values.component,
|
|
1066
|
-
}));
|
|
1207
|
+
const serveDir = serveDirResult;
|
|
1208
|
+
const port = values.port === undefined ? undefined : Number.parseInt(values.port, 10);
|
|
1209
|
+
if (port !== undefined && (Number.isNaN(port) || port < 0 || port > 65535)) {
|
|
1210
|
+
process.stderr.write(`invalid --port: ${values.port}\n`);
|
|
1211
|
+
return 1;
|
|
1067
1212
|
}
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
url: values.url,
|
|
1072
|
-
prod: values.prod,
|
|
1073
|
-
team: values.team,
|
|
1074
|
-
apiKey: values["api-key"],
|
|
1075
|
-
slug: values.slug,
|
|
1076
|
-
bearerToken: values["bearer-token"],
|
|
1077
|
-
json: values.json,
|
|
1078
|
-
}));
|
|
1213
|
+
if (values["allow-anonymous"] === true && values["bearer-token"] !== undefined) {
|
|
1214
|
+
process.stderr.write("--allow-anonymous and --bearer-token are mutually exclusive\n");
|
|
1215
|
+
return 1;
|
|
1079
1216
|
}
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
prod: values.prod,
|
|
1085
|
-
team: values.team,
|
|
1086
|
-
apiKey: values["api-key"],
|
|
1087
|
-
slug: values.slug,
|
|
1088
|
-
bearerToken: values["bearer-token"],
|
|
1089
|
-
sessionId: (_y = values["session-id"]) !== null && _y !== void 0 ? _y : values.session,
|
|
1090
|
-
print: values.print,
|
|
1091
|
-
}));
|
|
1217
|
+
const mode = values.mode;
|
|
1218
|
+
if (mode !== undefined && mode !== "single" && mode !== "multi") {
|
|
1219
|
+
process.stderr.write(`invalid --mode: ${mode} (expected "single" or "multi")\n`);
|
|
1220
|
+
return 1;
|
|
1092
1221
|
}
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1222
|
+
const dev = command === "dev" || values.dev === true;
|
|
1223
|
+
const style = stdoutPalette();
|
|
1224
|
+
// Real env wins (loadEnvFile never overrides). Runs inside start()
|
|
1225
|
+
// so dev's Enter-restart picks up tokens written since boot.
|
|
1226
|
+
const loadLocalEnv = () => {
|
|
1227
|
+
const loadedEnvFiles = loadAgentLocalEnv(serveDir);
|
|
1228
|
+
if (loadedEnvFiles.length > 0) {
|
|
1229
|
+
process.stdout.write(`${style.dim(`env: loaded ${loadedEnvFiles.join(", ")}`)}\n`);
|
|
1098
1230
|
}
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1231
|
+
};
|
|
1232
|
+
const serveOptions = {
|
|
1233
|
+
port,
|
|
1234
|
+
host: values.host,
|
|
1235
|
+
mode: mode,
|
|
1236
|
+
dev,
|
|
1237
|
+
apiKey: values["api-key"],
|
|
1238
|
+
stateRoot: values["state-root"],
|
|
1239
|
+
authToken: values["bearer-token"],
|
|
1240
|
+
allowAnonymous: values["allow-anonymous"] === true ? true : undefined,
|
|
1241
|
+
allowAnonymousCursorGithub: values["allow-anonymous-cursor-github"] === true ? true : undefined,
|
|
1242
|
+
allowAnonymousCursorAccountMcp: values["allow-anonymous-cursor-account-mcp"] === true ? true : undefined,
|
|
1243
|
+
allowAnonymousGrokbot: values["allow-anonymous-grokbot"] === true ? true : undefined,
|
|
1244
|
+
cursorScmProxy: values["cursor-scm-proxy"] === true ? true : undefined,
|
|
1245
|
+
schedules: values["no-schedules"] === true ? false : undefined,
|
|
1246
|
+
noControlPlane: values["no-control-plane"] === true ? true : undefined,
|
|
1247
|
+
playground: values["no-playground"] === true ? false : undefined,
|
|
1248
|
+
docs: values["no-docs"] === true ? false : undefined,
|
|
1249
|
+
publicUrl: values["public-url"],
|
|
1250
|
+
cloudToolsUrl: values["cloud-tools-url"],
|
|
1251
|
+
cursorEvents: values["cursor-events"] === true ? { repos: values.repo ?? [] } : undefined,
|
|
1252
|
+
// Soft boot logs stay secondary to the banner. `dim` is a no-op on
|
|
1253
|
+
// already-styled lines (the MCP warning box).
|
|
1254
|
+
logger: (line) => {
|
|
1255
|
+
process.stdout.write(`${style.dim(line)}\n`);
|
|
1256
|
+
},
|
|
1257
|
+
};
|
|
1258
|
+
const enterToRestart = process.stdin.isTTY === true;
|
|
1259
|
+
if (enterToRestart && !isServeRestartWorker()) {
|
|
1260
|
+
return runEnterRestartSupervisor({
|
|
1261
|
+
spawn: (command, args, spawnOptions) => spawn(command, args, spawnOptions),
|
|
1262
|
+
onRestart: () => {
|
|
1263
|
+
clearTerminal();
|
|
1264
|
+
},
|
|
1104
1265
|
});
|
|
1105
1266
|
}
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
return hasError ? 1 : 0;
|
|
1119
|
-
}
|
|
1120
|
-
case "info": {
|
|
1121
|
-
const mounts = yield loadMounts(dir);
|
|
1122
|
-
if (values.json) {
|
|
1123
|
-
const payload = mounts.length === 1 && ((_f = mounts[0]) === null || _f === void 0 ? void 0 : _f.slug) === ""
|
|
1124
|
-
? projectInfo(mounts[0].project)
|
|
1125
|
-
: {
|
|
1126
|
-
agents: mounts.map(({ slug, project }) => (Object.assign({ slug }, projectInfo(project)))),
|
|
1127
|
-
};
|
|
1128
|
-
process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
|
|
1129
|
-
return 0;
|
|
1267
|
+
const bannerOpts = {
|
|
1268
|
+
noPlayground: values["no-playground"] === true,
|
|
1269
|
+
dev,
|
|
1270
|
+
bearerToken: values["bearer-token"] !== undefined,
|
|
1271
|
+
noSchedules: values["no-schedules"] === true,
|
|
1272
|
+
};
|
|
1273
|
+
const start = async () => {
|
|
1274
|
+
loadLocalEnv();
|
|
1275
|
+
const next = await serve(serveDir, serveOptions);
|
|
1276
|
+
printServeBanner(next, bannerOpts);
|
|
1277
|
+
if (enterToRestart) {
|
|
1278
|
+
process.stdout.write(style.dim(" press Enter to restart\n"));
|
|
1130
1279
|
}
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
const project = (_h = mounts[0]) === null || _h === void 0 ? void 0 : _h.project;
|
|
1141
|
-
const info = projectInfo(project);
|
|
1142
|
-
const lines = [];
|
|
1143
|
-
lines.push(`agent: ${info.name}`);
|
|
1144
|
-
lines.push(`model: ${formatModel(info.model)}`);
|
|
1145
|
-
lines.push(`mcp: ${info.mcp.path} (${info.mcp.tools.join(", ")})`);
|
|
1146
|
-
if (info.instructions !== undefined) {
|
|
1147
|
-
lines.push(`instructions: ${info.instructions.chars} chars`);
|
|
1148
|
-
}
|
|
1149
|
-
lines.push(section("tools", info.tools.map(t => `${t.name} — ${t.description}`)));
|
|
1150
|
-
lines.push(section("skills", info.skills.map(s => `${s.name} — ${s.description}`)));
|
|
1151
|
-
lines.push(section("extensions", info.extensions.map(e => {
|
|
1152
|
-
var _a;
|
|
1153
|
-
var _b;
|
|
1154
|
-
const contributed = [...e.tools, ...e.skills].join(", ") || "(nothing contributed)";
|
|
1155
|
-
const egress = (_b = (_a = e.hosting) === null || _a === void 0 ? void 0 : _a.egressDomains) !== null && _b !== void 0 ? _b : [];
|
|
1156
|
-
return egress.length === 0
|
|
1157
|
-
? `${e.name} — ${contributed}`
|
|
1158
|
-
: `${e.name} — ${contributed}; egress: ${egress.join(", ")}`;
|
|
1159
|
-
})));
|
|
1160
|
-
lines.push(section("MCP connections", info.connections.map(c => `${c.name} — ${c.transport}`)));
|
|
1161
|
-
lines.push(section("subagents", info.subagents.map(s => { var _a; return `${s.name} — ${(_a = s.description) !== null && _a !== void 0 ? _a : ""}`; })));
|
|
1162
|
-
lines.push(section("channels", info.channels.map(c => `${c.id}: ${c.routes.map(r => `${r.method} ${r.url}`).join(", ") || "(events only)"}`)));
|
|
1163
|
-
lines.push(section("schedules", info.schedules.map(s => `${s.name} (${s.cron}, ${s.kind})`)));
|
|
1164
|
-
lines.push(section("hooks", info.hooks));
|
|
1165
|
-
lines.push(section("hosting egress domains", (_z = (_j = info.hosting) === null || _j === void 0 ? void 0 : _j.egressDomains) !== null && _z !== void 0 ? _z : []));
|
|
1166
|
-
lines.push(section("hosting secret names", (_0 = (_k = info.hosting) === null || _k === void 0 ? void 0 : _k.secretNames) !== null && _0 !== void 0 ? _0 : []));
|
|
1167
|
-
if (info.diagnostics.length > 0) {
|
|
1168
|
-
lines.push(`\ndiagnostics:\n${formatDiagnostics(info.diagnostics)}`);
|
|
1169
|
-
}
|
|
1170
|
-
process.stdout.write(`${lines.filter(line => line !== "").join("\n")}\n`);
|
|
1171
|
-
return info.diagnostics.some(d => d.severity === "error") ? 1 : 0;
|
|
1172
|
-
}
|
|
1173
|
-
case "dev":
|
|
1174
|
-
case "serve": {
|
|
1175
|
-
const serveDirResult = resolveServeDir({
|
|
1176
|
-
command,
|
|
1177
|
-
dir,
|
|
1178
|
-
positionals,
|
|
1179
|
-
dirFlagPassed: rest.includes("--dir"),
|
|
1180
|
-
});
|
|
1181
|
-
if (typeof serveDirResult !== "string") {
|
|
1182
|
-
process.stderr.write(serveDirResult.error);
|
|
1183
|
-
return 1;
|
|
1184
|
-
}
|
|
1185
|
-
const serveDir = serveDirResult;
|
|
1186
|
-
const port = values.port === undefined ? undefined : Number.parseInt(values.port, 10);
|
|
1187
|
-
if (port !== undefined && (Number.isNaN(port) || port < 0 || port > 65535)) {
|
|
1188
|
-
process.stderr.write(`invalid --port: ${values.port}\n`);
|
|
1189
|
-
return 1;
|
|
1190
|
-
}
|
|
1191
|
-
if (values["allow-anonymous"] === true && values["bearer-token"] !== undefined) {
|
|
1192
|
-
process.stderr.write("--allow-anonymous and --bearer-token are mutually exclusive\n");
|
|
1193
|
-
return 1;
|
|
1194
|
-
}
|
|
1195
|
-
const mode = values.mode;
|
|
1196
|
-
if (mode !== undefined && mode !== "single" && mode !== "multi") {
|
|
1197
|
-
process.stderr.write(`invalid --mode: ${mode} (expected "single" or "multi")\n`);
|
|
1198
|
-
return 1;
|
|
1199
|
-
}
|
|
1200
|
-
const dev = command === "dev" || values.dev === true;
|
|
1201
|
-
const style = stdoutPalette();
|
|
1202
|
-
// Real env wins (loadEnvFile never overrides). Runs inside start()
|
|
1203
|
-
// so dev's Enter-restart picks up tokens written since boot.
|
|
1204
|
-
const loadLocalEnv = () => {
|
|
1205
|
-
const loadedEnvFiles = loadAgentLocalEnv(serveDir);
|
|
1206
|
-
if (loadedEnvFiles.length > 0) {
|
|
1207
|
-
process.stdout.write(`${style.dim(`env: loaded ${loadedEnvFiles.join(", ")}`)}\n`);
|
|
1280
|
+
return next;
|
|
1281
|
+
};
|
|
1282
|
+
const handle = await start();
|
|
1283
|
+
let closing = false;
|
|
1284
|
+
let restartRequested = false;
|
|
1285
|
+
await new Promise(resolve => {
|
|
1286
|
+
const shutdown = () => {
|
|
1287
|
+
if (closing) {
|
|
1288
|
+
return;
|
|
1208
1289
|
}
|
|
1290
|
+
closing = true;
|
|
1291
|
+
process.stdout.write("\nshutting down (draining running turns)\n");
|
|
1292
|
+
void handle.close().finally(resolve);
|
|
1209
1293
|
};
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
dev,
|
|
1215
|
-
apiKey: values["api-key"],
|
|
1216
|
-
stateRoot: values["state-root"],
|
|
1217
|
-
authToken: values["bearer-token"],
|
|
1218
|
-
allowAnonymous: values["allow-anonymous"] === true ? true : undefined,
|
|
1219
|
-
allowAnonymousCursorGithub: values["allow-anonymous-cursor-github"] === true ? true : undefined,
|
|
1220
|
-
allowAnonymousCursorAccountMcp: values["allow-anonymous-cursor-account-mcp"] === true ? true : undefined,
|
|
1221
|
-
allowAnonymousGrokbot: values["allow-anonymous-grokbot"] === true ? true : undefined,
|
|
1222
|
-
cursorScmProxy: values["cursor-scm-proxy"] === true ? true : undefined,
|
|
1223
|
-
schedules: values["no-schedules"] === true ? false : undefined,
|
|
1224
|
-
noControlPlane: values["no-control-plane"] === true ? true : undefined,
|
|
1225
|
-
playground: values["no-playground"] === true ? false : undefined,
|
|
1226
|
-
docs: values["no-docs"] === true ? false : undefined,
|
|
1227
|
-
publicUrl: values["public-url"],
|
|
1228
|
-
cloudToolsUrl: values["cloud-tools-url"],
|
|
1229
|
-
cursorEvents: values["cursor-events"] === true ? { repos: (_1 = values.repo) !== null && _1 !== void 0 ? _1 : [] } : undefined,
|
|
1230
|
-
// Soft boot logs stay secondary to the banner. `dim` is a no-op on
|
|
1231
|
-
// already-styled lines (the MCP warning box).
|
|
1232
|
-
logger: (line) => {
|
|
1233
|
-
process.stdout.write(`${style.dim(line)}\n`);
|
|
1234
|
-
},
|
|
1235
|
-
};
|
|
1236
|
-
const enterToRestart = process.stdin.isTTY === true;
|
|
1237
|
-
if (enterToRestart && !isServeRestartWorker()) {
|
|
1238
|
-
return runEnterRestartSupervisor({
|
|
1239
|
-
spawn: (command, args, spawnOptions) => spawn(command, args, spawnOptions),
|
|
1240
|
-
onRestart: () => {
|
|
1241
|
-
clearTerminal();
|
|
1242
|
-
},
|
|
1243
|
-
});
|
|
1294
|
+
process.on("SIGINT", shutdown);
|
|
1295
|
+
process.on("SIGTERM", shutdown);
|
|
1296
|
+
if (!enterToRestart) {
|
|
1297
|
+
return;
|
|
1244
1298
|
}
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
noSchedules: values["no-schedules"] === true,
|
|
1250
|
-
};
|
|
1251
|
-
const start = () => __awaiter(this, void 0, void 0, function* () {
|
|
1252
|
-
loadLocalEnv();
|
|
1253
|
-
const next = yield serve(serveDir, serveOptions);
|
|
1254
|
-
printServeBanner(next, bannerOpts);
|
|
1255
|
-
if (enterToRestart) {
|
|
1256
|
-
process.stdout.write(style.dim(" press Enter to restart\n"));
|
|
1257
|
-
}
|
|
1258
|
-
return next;
|
|
1259
|
-
});
|
|
1260
|
-
const handle = yield start();
|
|
1261
|
-
let closing = false;
|
|
1262
|
-
let restartRequested = false;
|
|
1263
|
-
yield new Promise(resolve => {
|
|
1264
|
-
const shutdown = () => {
|
|
1265
|
-
if (closing) {
|
|
1266
|
-
return;
|
|
1267
|
-
}
|
|
1268
|
-
closing = true;
|
|
1269
|
-
process.stdout.write("\nshutting down (draining running turns)\n");
|
|
1270
|
-
void handle.close().finally(resolve);
|
|
1271
|
-
};
|
|
1272
|
-
process.on("SIGINT", shutdown);
|
|
1273
|
-
process.on("SIGTERM", shutdown);
|
|
1274
|
-
if (!enterToRestart) {
|
|
1299
|
+
process.stdin.resume();
|
|
1300
|
+
process.stdin.on("data", (chunk) => {
|
|
1301
|
+
const text = typeof chunk === "string" ? chunk : chunk.toString("utf8");
|
|
1302
|
+
if (!isEnterOnly(text) || closing) {
|
|
1275
1303
|
return;
|
|
1276
1304
|
}
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
}
|
|
1283
|
-
closing = true;
|
|
1284
|
-
restartRequested = true;
|
|
1285
|
-
clearTerminal();
|
|
1286
|
-
process.stdout.write(style.dim("restarting…\n"));
|
|
1287
|
-
void handle.close().finally(resolve);
|
|
1288
|
-
});
|
|
1305
|
+
closing = true;
|
|
1306
|
+
restartRequested = true;
|
|
1307
|
+
clearTerminal();
|
|
1308
|
+
process.stdout.write(style.dim("restarting…\n"));
|
|
1309
|
+
void handle.close().finally(resolve);
|
|
1289
1310
|
});
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
default: {
|
|
1293
|
-
process.stderr.write(`Unknown command "${command}"\n\n${HELP}`);
|
|
1294
|
-
return 1;
|
|
1295
|
-
}
|
|
1311
|
+
});
|
|
1312
|
+
return restartRequested ? ENTER_RESTART_EXIT_CODE : 0;
|
|
1296
1313
|
}
|
|
1297
|
-
|
|
1314
|
+
default: {
|
|
1315
|
+
process.stderr.write(`Unknown command "${command}"\n\n${HELP}`);
|
|
1316
|
+
return 1;
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1298
1319
|
}
|
|
1299
1320
|
function deployOptionsFromValues(values) {
|
|
1300
1321
|
return {
|
|
@@ -1351,27 +1372,25 @@ function axFromOptions(partial) {
|
|
|
1351
1372
|
out: partial.out,
|
|
1352
1373
|
};
|
|
1353
1374
|
}
|
|
1354
|
-
function loadMessages(messages, messagesFile) {
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
throw new Error("--messages-file must be a JSON array of strings");
|
|
1362
|
-
}
|
|
1363
|
-
for (const item of parsed) {
|
|
1364
|
-
if (typeof item !== "string") {
|
|
1365
|
-
throw new Error("--messages-file entries must be strings");
|
|
1366
|
-
}
|
|
1367
|
-
out.push(item);
|
|
1368
|
-
}
|
|
1375
|
+
async function loadMessages(messages, messagesFile) {
|
|
1376
|
+
const out = [];
|
|
1377
|
+
if (messagesFile !== undefined) {
|
|
1378
|
+
const raw = await readFile(resolve(messagesFile), "utf8");
|
|
1379
|
+
const parsed = JSON.parse(raw);
|
|
1380
|
+
if (!Array.isArray(parsed)) {
|
|
1381
|
+
throw new Error("--messages-file must be a JSON array of strings");
|
|
1369
1382
|
}
|
|
1370
|
-
|
|
1371
|
-
|
|
1383
|
+
for (const item of parsed) {
|
|
1384
|
+
if (typeof item !== "string") {
|
|
1385
|
+
throw new Error("--messages-file entries must be strings");
|
|
1386
|
+
}
|
|
1387
|
+
out.push(item);
|
|
1372
1388
|
}
|
|
1373
|
-
|
|
1374
|
-
|
|
1389
|
+
}
|
|
1390
|
+
if (messages !== undefined) {
|
|
1391
|
+
out.push(...messages);
|
|
1392
|
+
}
|
|
1393
|
+
return out;
|
|
1375
1394
|
}
|
|
1376
1395
|
function parseTimeoutMs(value) {
|
|
1377
1396
|
if (value === undefined) {
|
|
@@ -1396,10 +1415,8 @@ function parseMaxConcurrency(value) {
|
|
|
1396
1415
|
/**
|
|
1397
1416
|
* Load mounts the same way `serve` does (multi-agent layout by default).
|
|
1398
1417
|
*/
|
|
1399
|
-
function loadMounts(dir) {
|
|
1400
|
-
return
|
|
1401
|
-
return resolveAgentMounts(dir);
|
|
1402
|
-
});
|
|
1418
|
+
async function loadMounts(dir) {
|
|
1419
|
+
return resolveAgentMounts(dir);
|
|
1403
1420
|
}
|
|
1404
1421
|
function section(title, items) {
|
|
1405
1422
|
if (items.length === 0) {
|
|
@@ -1435,8 +1452,6 @@ function resolveServeDir(args) {
|
|
|
1435
1452
|
return positionalDir;
|
|
1436
1453
|
}
|
|
1437
1454
|
function printServeBanner(handle, opts) {
|
|
1438
|
-
var _a, _b;
|
|
1439
|
-
var _c;
|
|
1440
1455
|
const c = stdoutPalette();
|
|
1441
1456
|
const agents = handle.agents;
|
|
1442
1457
|
// Name the framework build in the boot line: hosted engines install the
|
|
@@ -1447,7 +1462,7 @@ function printServeBanner(handle, opts) {
|
|
|
1447
1462
|
process.stdout.write(`${agents.length} agents listening ${versionTag}\n`);
|
|
1448
1463
|
}
|
|
1449
1464
|
else {
|
|
1450
|
-
const info = projectInfo(
|
|
1465
|
+
const info = projectInfo(agents[0]?.project ?? handle.project);
|
|
1451
1466
|
process.stdout.write(`${info.name} listening ${versionTag}\n`);
|
|
1452
1467
|
}
|
|
1453
1468
|
const playgroundUrl = resolvePlaygroundBannerUrl(handle, opts.noPlayground);
|
|
@@ -1462,7 +1477,7 @@ function printServeBanner(handle, opts) {
|
|
|
1462
1477
|
// plain `serve`, where operators often curl the HTTP surface directly.
|
|
1463
1478
|
if (!opts.dev) {
|
|
1464
1479
|
process.stdout.write(c.dim(` api ${handle.url}\n`));
|
|
1465
|
-
if (agents.length > 1 ||
|
|
1480
|
+
if (agents.length > 1 || agents[0]?.slug !== "") {
|
|
1466
1481
|
for (const agent of agents) {
|
|
1467
1482
|
const info = projectInfo(agent.project);
|
|
1468
1483
|
process.stdout.write(c.dim(` /${agent.slug} ${info.name}\n`));
|
|
@@ -1544,8 +1559,7 @@ function formatModel(model) {
|
|
|
1544
1559
|
*/
|
|
1545
1560
|
function installTransportErrorGuards() {
|
|
1546
1561
|
const isTransportNoise = (reason) => {
|
|
1547
|
-
|
|
1548
|
-
const message = reason instanceof Error ? `${reason.message}\n${(_a = reason.stack) !== null && _a !== void 0 ? _a : ""}` : String(reason);
|
|
1562
|
+
const message = reason instanceof Error ? `${reason.message}\n${reason.stack ?? ""}` : String(reason);
|
|
1549
1563
|
const code = reason !== null &&
|
|
1550
1564
|
typeof reason === "object" &&
|
|
1551
1565
|
"code" in reason &&
|
|
@@ -1577,12 +1591,11 @@ function installTransportErrorGuards() {
|
|
|
1577
1591
|
log("unhandledRejection", reason);
|
|
1578
1592
|
});
|
|
1579
1593
|
process.on("uncaughtException", error => {
|
|
1580
|
-
var _a;
|
|
1581
1594
|
if (isTransportNoise(error)) {
|
|
1582
1595
|
log("swallowed uncaughtException", error);
|
|
1583
1596
|
return;
|
|
1584
1597
|
}
|
|
1585
|
-
process.stderr.write(`[bdk] uncaughtException: ${
|
|
1598
|
+
process.stderr.write(`[bdk] uncaughtException: ${error.stack ?? error.message}\n`);
|
|
1586
1599
|
void flushSessionRunFatal(error).finally(() => {
|
|
1587
1600
|
process.exit(1);
|
|
1588
1601
|
});
|