@cursor/july 0.1.94 → 0.1.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +3 -4
- package/dist/channels/deployments/types.d.ts +1 -1
- package/dist/channels/deployments/types.d.ts.map +1 -1
- package/dist/channels/deployments/types.js +1 -0
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +14 -2
- package/dist/channels/github/types.d.ts +18 -3
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/origin/api.d.ts +59 -13
- package/dist/channels/origin/api.d.ts.map +1 -1
- package/dist/channels/origin/api.js +168 -27
- package/dist/channels/origin/binding.d.ts +2 -2
- package/dist/channels/origin/checks.d.ts +6 -6
- package/dist/channels/origin/checks.js +6 -6
- package/dist/channels/origin/cursor-account.d.ts +5 -3
- package/dist/channels/origin/cursor-account.d.ts.map +1 -1
- package/dist/channels/origin/cursor-account.js +5 -3
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +11 -3
- package/dist/channels/origin/origin-webhook.d.ts +11 -1
- package/dist/channels/origin/origin-webhook.d.ts.map +1 -1
- package/dist/channels/origin/origin-webhook.js +23 -3
- package/dist/channels/origin/types.d.ts +8 -0
- package/dist/channels/origin/types.d.ts.map +1 -1
- package/dist/channels/slack/api.d.ts +9 -0
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +36 -5
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +17 -46
- package/dist/channels/slack/dispatch.d.ts +7 -1
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +47 -23
- package/dist/channels/slack/inbound.d.ts +8 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +32 -0
- package/dist/channels/slack/live-delivery.d.ts +26 -29
- package/dist/channels/slack/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +172 -73
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +5 -1
- package/dist/channels/slack/nudge-carrier.d.ts +2 -0
- package/dist/channels/slack/nudge-carrier.d.ts.map +1 -1
- package/dist/channels/slack/nudge-carrier.js +48 -1
- package/dist/channels/slack/pr-ref.d.ts +7 -1
- package/dist/channels/slack/pr-ref.d.ts.map +1 -1
- package/dist/channels/slack/pr-ref.js +42 -23
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +2 -2
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.CFDEas4I.js → app.jXleCmOc.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DFoGuETX.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.B1IIYpYS.js → VPLocalSearchBox.8LhyglIT.js} +1 -1
- package/dist/docs/assets/chunks/{theme.Ct4NSiLm.js → theme.9ged-pr2.js} +2 -2
- package/dist/docs/assets/index.md.CI93Ltlb.js +5 -0
- package/dist/docs/assets/{index.md.DRakGHFe.lean.js → index.md.CI93Ltlb.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.Cw6_ICYG.js → reference_cli.md.CCnG-nJx.js} +4 -2
- package/dist/docs/assets/{reference_cli.md.Cw6_ICYG.lean.js → reference_cli.md.CCnG-nJx.lean.js} +1 -1
- package/dist/docs/assets/{reference_skills.md.8son6Hjm.js → reference_skills.md.BFW9retM.js} +3 -3
- package/dist/docs/assets/{templates_agentic-owners.md.DqtPdm6f.js → templates_agentic-owners.md.BZSH4N9z.js} +1 -1
- package/dist/docs/assets/templates_code-wiki.md.CDYZIBFN.js +2 -0
- package/dist/docs/assets/templates_code-wiki.md.CDYZIBFN.lean.js +1 -0
- package/dist/docs/assets/{templates_demo.md.DhFcWN6j.js → templates_demo.md.BeQX9V3H.js} +1 -1
- package/dist/docs/assets/{templates_pr-autofixer.md.DU7dQpor.js → templates_pr-autofixer.md.x5zl6-GT.js} +2 -2
- package/dist/docs/assets/{templates_pr-autofixer.md.DU7dQpor.lean.js → templates_pr-autofixer.md.x5zl6-GT.lean.js} +1 -1
- package/dist/docs/assets/templates_security-help.md.C3Ny_Qr2.js +4 -0
- package/dist/docs/assets/templates_security-help.md.C3Ny_Qr2.lean.js +1 -0
- package/dist/docs/assets/{templates_security-reviewer.md.CTa7u_l1.js → templates_security-reviewer.md.lshxbCLK.js} +2 -2
- package/dist/docs/assets/{templates_security-reviewer.md.CTa7u_l1.lean.js → templates_security-reviewer.md.lshxbCLK.lean.js} +1 -1
- package/dist/docs/assets/{templates_triage.md.CVlpctKS.js → templates_triage.md.Co4UNzkZ.js} +3 -3
- package/dist/docs/assets/{templates_triage.md.CVlpctKS.lean.js → templates_triage.md.Co4UNzkZ.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +4 -4
- package/dist/docs/deployment.html +4 -4
- package/dist/docs/evals.html +4 -4
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-runtime.html +4 -4
- package/dist/docs/guides/convert-automation.html +4 -4
- package/dist/docs/guides/github.html +4 -4
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +4 -4
- package/dist/docs/guides/opentelemetry.html +4 -4
- package/dist/docs/guides/slack.html +4 -4
- package/dist/docs/guides/webhooks.html +4 -4
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +4 -4
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +5 -1
- package/dist/docs/llms-full.txt +189 -26
- package/dist/docs/llms.txt +2 -0
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +4 -4
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +4 -4
- package/dist/docs/reference/cli.html +8 -6
- package/dist/docs/reference/cli.md +4 -1
- package/dist/docs/reference/connections.html +4 -4
- package/dist/docs/reference/hooks.html +4 -4
- package/dist/docs/reference/http-api.html +4 -4
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +4 -4
- package/dist/docs/reference/project-layout.html +4 -4
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +4 -4
- package/dist/docs/reference/skills.html +7 -7
- package/dist/docs/reference/subagents.html +4 -4
- package/dist/docs/reference/tools.html +4 -4
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/storage.html +4 -4
- package/dist/docs/templates/agentic-owners.html +7 -7
- package/dist/docs/templates/agentic-owners.md +1 -1
- package/dist/docs/templates/code-wiki.html +28 -0
- package/dist/docs/templates/code-wiki.md +91 -0
- package/dist/docs/templates/demo.html +6 -6
- package/dist/docs/templates/demo.md +3 -2
- package/dist/docs/templates/pr-autofixer.html +6 -6
- package/dist/docs/templates/pr-autofixer.md +7 -13
- package/dist/docs/templates/security-help.html +30 -0
- package/dist/docs/templates/security-help.md +65 -0
- package/dist/docs/templates/security-reviewer.html +6 -6
- package/dist/docs/templates/security-reviewer.md +1 -2
- package/dist/docs/templates/triage.html +7 -7
- package/dist/docs/templates/triage.md +2 -6
- package/dist/docs/troubleshooting.html +4 -4
- package/dist/files-backends/cursor-hosted.d.ts +26 -0
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +32 -4
- package/dist/files.d.ts +2 -0
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +5 -0
- package/dist/internal/advertise-tools.d.ts +2 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +15 -1
- package/dist/internal/bounded.d.ts +7 -0
- package/dist/internal/bounded.d.ts.map +1 -0
- package/dist/internal/bounded.js +32 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +142 -7
- package/dist/internal/conversation-mirror.d.ts +85 -0
- package/dist/internal/conversation-mirror.d.ts.map +1 -0
- package/dist/internal/conversation-mirror.js +312 -0
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +22 -48
- package/dist/internal/cursor/session-token.d.ts +45 -0
- package/dist/internal/cursor/session-token.d.ts.map +1 -0
- package/dist/internal/cursor/session-token.js +99 -0
- package/dist/internal/cursor-agent-template.d.ts +1 -1
- package/dist/internal/cursor-agent-template.d.ts.map +1 -1
- package/dist/internal/cursor-agent-template.js +1 -0
- package/dist/internal/deferred-channel-session.d.ts +20 -0
- package/dist/internal/deferred-channel-session.d.ts.map +1 -0
- package/dist/internal/deferred-channel-session.js +62 -0
- package/dist/internal/deploy-client.d.ts +13 -1
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +11 -1
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +11 -5
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +22 -2
- package/dist/internal/framework-file-storage.d.ts +61 -0
- package/dist/internal/framework-file-storage.d.ts.map +1 -0
- package/dist/internal/framework-file-storage.js +204 -0
- package/dist/internal/framework-storage-selection.d.ts +38 -16
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +78 -17
- package/dist/internal/hosted-admission-context.d.ts +20 -0
- package/dist/internal/hosted-admission-context.d.ts.map +1 -0
- package/dist/internal/hosted-admission-context.js +31 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +5 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +33 -1
- package/dist/internal/hosted-delivery.d.ts +11 -2
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +79 -35
- package/dist/internal/hosted-managed-automation.d.ts +30 -0
- package/dist/internal/hosted-managed-automation.d.ts.map +1 -0
- package/dist/internal/hosted-managed-automation.js +58 -0
- package/dist/internal/init-project.d.ts.map +1 -1
- package/dist/internal/init-project.js +2 -0
- package/dist/internal/install-cursor-skills.d.ts.map +1 -1
- package/dist/internal/install-cursor-skills.js +1 -3
- package/dist/internal/managed-delivery.d.ts +80 -0
- package/dist/internal/managed-delivery.d.ts.map +1 -0
- package/dist/internal/managed-delivery.js +86 -0
- package/dist/internal/review-comments.d.ts.map +1 -1
- package/dist/internal/review-comments.js +10 -98
- package/dist/internal/runtime-dispatch-runner.d.ts +5 -1
- package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -1
- package/dist/internal/runtime-dispatch-runner.js +7 -0
- package/dist/internal/scm/pr-url.d.ts +14 -0
- package/dist/internal/scm/pr-url.d.ts.map +1 -0
- package/dist/internal/scm/pr-url.js +65 -0
- package/dist/internal/sdk-runner.d.ts +25 -0
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +70 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +11 -2
- package/dist/internal/session-engine.d.ts +13 -0
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +71 -3
- package/dist/internal/steering.d.ts +15 -0
- package/dist/internal/steering.d.ts.map +1 -0
- package/dist/internal/steering.js +18 -0
- package/dist/playground/assets/index-B1DDvBeC.css +1 -0
- package/dist/playground/assets/{index-B3JCyigB.js → index-Cx9CclK_.js} +47 -47
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted.d.ts +8 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +4 -3
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +5 -1
- package/docs/reference/cli.md +4 -1
- package/docs/templates/agentic-owners.md +1 -1
- package/docs/templates/code-wiki.md +96 -0
- package/docs/templates/demo.md +3 -2
- package/docs/templates/pr-autofixer.md +7 -13
- package/docs/templates/security-help.md +70 -0
- package/docs/templates/security-reviewer.md +1 -2
- package/docs/templates/triage.md +2 -6
- package/package.json +2 -2
- package/skills/ab/SKILL.md +13 -97
- package/skills/create-agent/SKILL.md +123 -223
- package/skills/debug/SKILL.md +34 -68
- package/skills/evals/SKILL.md +55 -180
- package/skills/framework-map/SKILL.md +83 -145
- package/skills/github/SKILL.md +53 -111
- package/skills/hillclimb/SKILL.md +40 -163
- package/skills/mcp-auth/SKILL.md +48 -107
- package/skills/otel/SKILL.md +22 -68
- package/skills/setup-slack/SKILL.md +77 -208
- package/src/channels/deployments/types.ts +1 -0
- package/src/channels/github/github-channel.ts +23 -8
- package/src/channels/github/types.ts +19 -2
- package/src/channels/origin/api.ts +242 -30
- package/src/channels/origin/binding.ts +2 -2
- package/src/channels/origin/checks.ts +6 -6
- package/src/channels/origin/cursor-account.ts +5 -3
- package/src/channels/origin/origin-channel.ts +13 -1
- package/src/channels/origin/origin-webhook.ts +27 -3
- package/src/channels/origin/types.ts +8 -0
- package/src/channels/slack/api.ts +41 -5
- package/src/channels/slack/defaults.ts +15 -49
- package/src/channels/slack/dispatch.ts +56 -22
- package/src/channels/slack/inbound.ts +43 -0
- package/src/channels/slack/live-delivery.ts +235 -114
- package/src/channels/slack/manifest.ts +5 -1
- package/src/channels/slack/nudge-carrier.ts +48 -1
- package/src/channels/slack/pr-ref.ts +56 -25
- package/src/channels/slack/slack-channel.ts +2 -0
- package/src/files-backends/cursor-hosted.ts +41 -2
- package/src/files.ts +11 -0
- package/src/internal/advertise-tools.ts +18 -2
- package/src/internal/bounded.ts +28 -0
- package/src/internal/cli-deploy.ts +183 -7
- package/src/internal/conversation-mirror.ts +406 -0
- package/src/internal/cursor/backend-client.ts +34 -58
- package/src/internal/cursor/session-token.ts +115 -0
- package/src/internal/cursor-agent-template.ts +1 -0
- package/src/internal/deferred-channel-session.ts +61 -0
- package/src/internal/deploy-client.ts +24 -1
- package/src/internal/deploy-manifest.ts +10 -5
- package/src/internal/discovery.ts +25 -2
- package/src/internal/framework-file-storage.ts +222 -0
- package/src/internal/framework-storage-selection.ts +101 -19
- package/src/internal/hosted-admission-context.ts +37 -0
- package/src/internal/hosted-delivery-protocol.ts +44 -1
- package/src/internal/hosted-delivery.ts +105 -40
- package/src/internal/hosted-managed-automation.ts +72 -0
- package/src/internal/init-project.ts +2 -0
- package/src/internal/install-cursor-skills.ts +1 -4
- package/src/internal/managed-delivery.ts +125 -0
- package/src/internal/review-comments.ts +10 -113
- package/src/internal/runtime-dispatch-runner.ts +10 -0
- package/src/internal/scm/pr-url.ts +95 -0
- package/src/internal/sdk-runner.ts +103 -0
- package/src/internal/server.ts +12 -0
- package/src/internal/session-engine.ts +76 -4
- package/src/internal/steering.ts +17 -0
- package/src/storage-backends/cursor-hosted.ts +10 -1
- package/src/types.ts +2 -1
- package/templates/agentic-owners/README.md +1 -1
- package/templates/agentic-owners/agent/agent.ts +0 -10
- package/templates/agentic-owners/agent/channels/github.ts +5 -14
- package/templates/agentic-owners/agent/lib/config.ts +0 -8
- package/templates/agentic-owners/agent/lib/review.ts +2 -15
- package/templates/agentic-owners/agent/tools/record_review.ts +2 -4
- package/templates/code-wiki/README.md +34 -0
- package/templates/code-wiki/agent/agent.ts +8 -0
- package/templates/code-wiki/agent/channels/github.ts +144 -0
- package/templates/code-wiki/agent/instructions.md +39 -0
- package/templates/code-wiki/agent/lib/repos.ts +5 -0
- package/templates/code-wiki/agent/lib/wiki.ts +22 -0
- package/templates/code-wiki/agent/tools/apply_wiki.ts +219 -0
- package/templates/code-wiki/evals/evals.config.ts +5 -0
- package/templates/code-wiki/evals/wiki.eval.ts +132 -0
- package/templates/code-wiki/init.json +25 -0
- package/templates/code-wiki/package.json +18 -0
- package/templates/code-wiki/tsconfig.json +12 -0
- package/templates/demo/agent/agent.ts +0 -10
- package/templates/pr-autofixer/README.md +0 -2
- package/templates/pr-autofixer/agent/agent.ts +0 -11
- package/templates/pr-autofixer/agent/channels/slack.ts +0 -7
- package/templates/pr-autofixer/agent/lib/pr-state.ts +5 -17
- package/templates/pr-autofixer/agent/lib/repos.ts +0 -1
- package/templates/security-help/README.md +2 -2
- package/templates/security-help/agent/agent.ts +1 -2
- package/templates/security-help/agent/channels/slack.ts +0 -3
- package/templates/security-help/agent/instructions.md +9 -10
- package/templates/security-help/agent/skills/access-request.md +1 -1
- package/templates/security-help/agent/skills/faq.md +31 -0
- package/templates/security-help/agent/skills/security-playbooks.md +1 -1
- package/templates/security-help/package.json +1 -2
- package/templates/security-reviewer/agent/agent.ts +0 -10
- package/templates/triage/agent/agent.ts +0 -10
- package/templates/triage/agent/channels/queue.ts +1 -1
- package/templates/triage/agent/channels/webhook.ts +1 -3
- package/dist/docs/assets/chunks/@localSearchIndexroot.DU3U2Ij2.js +0 -1
- package/dist/docs/assets/index.md.DRakGHFe.js +0 -5
- package/dist/internal/deployment-scm-event-stream.d.ts +0 -116
- package/dist/internal/deployment-scm-event-stream.d.ts.map +0 -1
- package/dist/internal/deployment-scm-event-stream.js +0 -474
- package/dist/playground/assets/index-D9N7-q97.css +0 -1
- package/src/internal/deployment-scm-event-stream.ts +0 -593
- package/templates/security-help/agent/knowledge/faq/approvals.md +0 -5
- package/templates/security-help/agent/knowledge/faq/channels.md +0 -6
- package/templates/security-help/agent/knowledge/faq/phishing.md +0 -10
- package/templates/security-help/agent/skills/security-first-pass.md +0 -15
- /package/dist/docs/assets/{reference_skills.md.8son6Hjm.lean.js → reference_skills.md.BFW9retM.lean.js} +0 -0
- /package/dist/docs/assets/{templates_agentic-owners.md.DqtPdm6f.lean.js → templates_agentic-owners.md.BZSH4N9z.lean.js} +0 -0
- /package/dist/docs/assets/{templates_demo.md.DhFcWN6j.lean.js → templates_demo.md.BeQX9V3H.lean.js} +0 -0
|
@@ -71,6 +71,19 @@ const AGENT_SERVE_FILES_PATH = "/v0/agent-serve-files";
|
|
|
71
71
|
export const AGENT_SERVE_STORE_SOURCE_ID_ENV_VAR =
|
|
72
72
|
"AGENT_SERVE_STORE_SOURCE_ID";
|
|
73
73
|
|
|
74
|
+
/**
|
|
75
|
+
* The deployment's **framework-level** file store, distinct from the
|
|
76
|
+
* user-level store above. The user store carries author-facing bytes
|
|
77
|
+
* (`ctx.host.files`, skills, memory, artifacts) and is browsable and
|
|
78
|
+
* mountable; the framework store carries engine-owned session state —
|
|
79
|
+
* session records, event transcripts, continuation index, and the SDK
|
|
80
|
+
* conversation mirror — and is never exposed to authors or models.
|
|
81
|
+
* Provisioned by the v2 deploy pipeline alongside the user store; v1
|
|
82
|
+
* deployments have only the user store.
|
|
83
|
+
*/
|
|
84
|
+
export const AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID_ENV_VAR =
|
|
85
|
+
"AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID";
|
|
86
|
+
|
|
74
87
|
/** Cap on the per-process etag cache; a miss costs a lookup, not correctness. */
|
|
75
88
|
const MAX_REMEMBERED_ETAGS = 1_000;
|
|
76
89
|
|
|
@@ -101,6 +114,20 @@ export function isCursorHostedFilesAvailable(
|
|
|
101
114
|
return sourceId !== undefined && sourceId !== "";
|
|
102
115
|
}
|
|
103
116
|
|
|
117
|
+
/**
|
|
118
|
+
* The framework-level store's source id, or `undefined` when the deployment
|
|
119
|
+
* has none (v1, self-hosted, or a v2 deploy predating framework-store
|
|
120
|
+
* provisioning). Same detection posture as
|
|
121
|
+
* {@link isCursorHostedFilesAvailable}: keyed on the id alone — a missing
|
|
122
|
+
* credential must fail loudly at use, not silently deselect the store.
|
|
123
|
+
*/
|
|
124
|
+
export function cursorFrameworkStoreSourceId(
|
|
125
|
+
env: NodeJS.ProcessEnv = process.env
|
|
126
|
+
): string | undefined {
|
|
127
|
+
const sourceId = env[AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID_ENV_VAR]?.trim();
|
|
128
|
+
return sourceId === undefined || sourceId === "" ? undefined : sourceId;
|
|
129
|
+
}
|
|
130
|
+
|
|
104
131
|
/**
|
|
105
132
|
* Local `serve`/`run` with a personal `CURSOR_API_KEY` can address
|
|
106
133
|
* `/v0/agent-serve-files/user`. Hosted deployments have a store source id
|
|
@@ -127,6 +154,13 @@ export interface CursorHostedFilesOptions {
|
|
|
127
154
|
baseUrl?: string;
|
|
128
155
|
/** Bearer credential (default: `CURSOR_API_KEY`). */
|
|
129
156
|
apiKey?: string;
|
|
157
|
+
/**
|
|
158
|
+
* Lazy credential, re-resolved on every call and preferred over
|
|
159
|
+
* {@link apiKey} — hosted freeze snapshots listen unsigned and bind the
|
|
160
|
+
* key file after serve start. Kept separate so `apiKey` stays a plain
|
|
161
|
+
* string.
|
|
162
|
+
*/
|
|
163
|
+
resolveApiKey?: () => string | undefined;
|
|
130
164
|
/** File store to address (default: `AGENT_SERVE_STORE_SOURCE_ID`). */
|
|
131
165
|
storeSourceId?: string;
|
|
132
166
|
/** Test seam; defaults to global fetch. */
|
|
@@ -249,7 +283,11 @@ export function cursorHostedFiles(
|
|
|
249
283
|
}
|
|
250
284
|
out.push(toEntry(file, file.path));
|
|
251
285
|
}
|
|
252
|
-
|
|
286
|
+
// The FileSink contract promises key order, and transcript-chunk
|
|
287
|
+
// consumers depend on it (chunk keys are zero-padded so key order
|
|
288
|
+
// is append order). The server happens to scan in order today; do
|
|
289
|
+
// not let that be the only thing holding the contract.
|
|
290
|
+
return out.sort((a, b) => (a.key < b.key ? -1 : a.key > b.key ? 1 : 0));
|
|
253
291
|
}
|
|
254
292
|
// The unscoped listing was truncated (`complete: false`) and has no
|
|
255
293
|
// continuation to follow. `list()` promises the whole scope, so rather
|
|
@@ -622,7 +660,8 @@ function resolveStoreSourceId(options: CursorHostedFilesOptions): string {
|
|
|
622
660
|
}
|
|
623
661
|
|
|
624
662
|
function resolveApiKey(options: CursorHostedFilesOptions): string {
|
|
625
|
-
const
|
|
663
|
+
const configured = options.resolveApiKey?.() ?? options.apiKey;
|
|
664
|
+
const key = (configured ?? process.env.CURSOR_API_KEY)?.trim();
|
|
626
665
|
if (key === undefined || key === "") {
|
|
627
666
|
throw new Error(
|
|
628
667
|
"cursorHostedFiles requires CURSOR_API_KEY (deployment pod credential on Cursor hosting)"
|
package/src/files.ts
CHANGED
|
@@ -184,6 +184,17 @@ export const agentStoreKeys = {
|
|
|
184
184
|
`${STORAGE_KEY_ROOT}/${agent}/memory/journal.jsonl`,
|
|
185
185
|
memoryJournalRotated: (agent: string, stamp: string): string =>
|
|
186
186
|
`${STORAGE_KEY_ROOT}/${agent}/memory/journal-${stamp}.jsonl`,
|
|
187
|
+
// SDK conversation mirror (the runner's SQLite store, exported through the
|
|
188
|
+
// store APIs): one manifest per SDK agent id plus its content-addressed
|
|
189
|
+
// checkpoint blobs. See internal/conversation-mirror.ts.
|
|
190
|
+
conversationManifest: (agent: string, sdkAgentId: string): string =>
|
|
191
|
+
`${STORAGE_KEY_ROOT}/${agent}/conversations/${encodeURIComponent(sdkAgentId)}/manifest.json`,
|
|
192
|
+
conversationBlob: (
|
|
193
|
+
agent: string,
|
|
194
|
+
sdkAgentId: string,
|
|
195
|
+
blobId: string
|
|
196
|
+
): string =>
|
|
197
|
+
`${STORAGE_KEY_ROOT}/${agent}/conversations/${encodeURIComponent(sdkAgentId)}/blobs/${encodeURIComponent(blobId)}`,
|
|
187
198
|
} as const;
|
|
188
199
|
|
|
189
200
|
/**
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
* `defineConnection({ effects })` filters the listing before names are
|
|
28
28
|
* assigned: only tools whose MCP annotations classify as an intended
|
|
29
29
|
* effect are advertised. Unclassified tools are omitted, not guessed.
|
|
30
|
+
* Tools whose `annotations.title` is `do-not-call` are dropped as well
|
|
31
|
+
* (vendor host-UI / MCP Apps helpers that still carry `readOnlyHint`).
|
|
30
32
|
*/
|
|
31
33
|
|
|
32
34
|
import type {
|
|
@@ -134,8 +136,10 @@ export async function resolveAdvertisedTools(args: {
|
|
|
134
136
|
{ cause: error }
|
|
135
137
|
);
|
|
136
138
|
}
|
|
137
|
-
const intended = listed.filter(
|
|
138
|
-
|
|
139
|
+
const intended = listed.filter(
|
|
140
|
+
(info) =>
|
|
141
|
+
!isDoNotCallTool(info.annotations) &&
|
|
142
|
+
matchesIntendedEffects(info.annotations, connection.effects)
|
|
139
143
|
);
|
|
140
144
|
const exposed = exposeListedTools(intended, claimed);
|
|
141
145
|
for (const { info, exposedName } of exposed) {
|
|
@@ -232,6 +236,18 @@ function exposeListedTools(
|
|
|
232
236
|
}));
|
|
233
237
|
}
|
|
234
238
|
|
|
239
|
+
/**
|
|
240
|
+
* Vendors (Datadog MCP Apps) stamp host-UI-only helpers with this title.
|
|
241
|
+
* They still look like reads (`readOnlyHint: true`), so the effects
|
|
242
|
+
* filter would keep them. The model and agsh should not see them; the
|
|
243
|
+
* raw MCP listing stays intact for the host.
|
|
244
|
+
*/
|
|
245
|
+
const DO_NOT_CALL_TITLE = "do-not-call";
|
|
246
|
+
|
|
247
|
+
function isDoNotCallTool(annotations: McpToolAnnotations | undefined): boolean {
|
|
248
|
+
return annotations?.title?.trim() === DO_NOT_CALL_TITLE;
|
|
249
|
+
}
|
|
250
|
+
|
|
235
251
|
function matchesIntendedEffects(
|
|
236
252
|
annotations: McpToolAnnotations | undefined,
|
|
237
253
|
effects: readonly ToolEffect[] | undefined
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounded-concurrency map, in input order. Local rather than
|
|
3
|
+
* `@anysphere/utils`: this published package cannot depend on monorepo
|
|
4
|
+
* internals.
|
|
5
|
+
*/
|
|
6
|
+
export async function mapBounded<T, R>(
|
|
7
|
+
items: readonly T[],
|
|
8
|
+
max: number,
|
|
9
|
+
run: (item: T) => Promise<R>
|
|
10
|
+
): Promise<R[]> {
|
|
11
|
+
const out = new Array<R>(items.length);
|
|
12
|
+
let nextIndex = 0;
|
|
13
|
+
const workers = Array.from(
|
|
14
|
+
{ length: Math.min(max, items.length) },
|
|
15
|
+
async () => {
|
|
16
|
+
for (;;) {
|
|
17
|
+
const index = nextIndex;
|
|
18
|
+
nextIndex += 1;
|
|
19
|
+
if (index >= items.length) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
out[index] = await run(items[index] as T);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
await Promise.all(workers);
|
|
27
|
+
return out;
|
|
28
|
+
}
|
|
@@ -27,6 +27,7 @@ import { authorizeCursorAccountConnectors } from "./cursor-account-mcp-auth.js";
|
|
|
27
27
|
import { readDeployTemplate } from "./cursor-agent-template.js";
|
|
28
28
|
import {
|
|
29
29
|
type AgentkitDeployAccepted,
|
|
30
|
+
type AgentkitDeployComponent,
|
|
30
31
|
type AgentkitDeployStatus,
|
|
31
32
|
type AgentkitStopAccepted,
|
|
32
33
|
AgentServeDeployClient,
|
|
@@ -48,6 +49,8 @@ import {
|
|
|
48
49
|
import { type GitRunner, inferDeployGitSource } from "./deploy-source.js";
|
|
49
50
|
import {
|
|
50
51
|
type ChildAgentDir,
|
|
52
|
+
formatDiagnostics,
|
|
53
|
+
hasErrorDiagnostics,
|
|
51
54
|
isAgentProjectDir,
|
|
52
55
|
listChildAgentDirs,
|
|
53
56
|
loadAgentProject,
|
|
@@ -294,10 +297,35 @@ export async function cmdDeploy(options: DeployCliOptions): Promise<number> {
|
|
|
294
297
|
return targets;
|
|
295
298
|
}
|
|
296
299
|
|
|
300
|
+
if (targets.length === 1) {
|
|
301
|
+
return deployOne(ctx, options, targets[0]!);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// Multi-agent parent: when every child declares `architecture: "v2"`,
|
|
305
|
+
// the v2 control plane models sibling agents as release components of
|
|
306
|
+
// ONE application, so deploy them together (one app, one component per
|
|
307
|
+
// child) instead of minting a separate application per child. Mixed and
|
|
308
|
+
// v1 parents keep the per-child sequential deploys.
|
|
309
|
+
const manifests: DeployManifest[] = [];
|
|
310
|
+
for (const target of targets) {
|
|
311
|
+
manifests.push(await readDeployManifest(target.dir));
|
|
312
|
+
}
|
|
313
|
+
if (manifests.every((manifest) => manifest.architecture === "v2")) {
|
|
314
|
+
return deployAgentsdkApplication(ctx, options, targets);
|
|
315
|
+
}
|
|
316
|
+
if (
|
|
317
|
+
!ctx.json &&
|
|
318
|
+
manifests.some((manifest) => manifest.architecture === "v2")
|
|
319
|
+
) {
|
|
320
|
+
ctx.err(
|
|
321
|
+
`warning: agents under this parent mix architectures; deploying each separately (v2 children become standalone single-component applications).\n`
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
|
|
297
325
|
// --path is per-agent (relative to the repo root). When deploying several
|
|
298
326
|
// agents, ignore a shared --path so each target can infer its own path.
|
|
299
327
|
let deployOptions = options;
|
|
300
|
-
if (
|
|
328
|
+
if (options.path !== undefined) {
|
|
301
329
|
if (!ctx.json) {
|
|
302
330
|
ctx.err(
|
|
303
331
|
`warning: ignoring --path ${JSON.stringify(options.path)} for a multi-agent deploy; each agent infers its own path from git.\n`
|
|
@@ -306,10 +334,6 @@ export async function cmdDeploy(options: DeployCliOptions): Promise<number> {
|
|
|
306
334
|
deployOptions = { ...options, path: undefined };
|
|
307
335
|
}
|
|
308
336
|
|
|
309
|
-
if (targets.length === 1) {
|
|
310
|
-
return deployOne(ctx, deployOptions, targets[0]!);
|
|
311
|
-
}
|
|
312
|
-
|
|
313
337
|
// Multi-agent batch: deploy sequentially; --json emits an array.
|
|
314
338
|
const jsonResults: unknown[] = [];
|
|
315
339
|
let failures = 0;
|
|
@@ -477,6 +501,19 @@ async function resolveDeployTargets(
|
|
|
477
501
|
return [match];
|
|
478
502
|
}
|
|
479
503
|
|
|
504
|
+
// An all-v2 parent deploys as ONE application (siblings are components
|
|
505
|
+
// of a single app on the v2 control plane), so "deploy the parent" is
|
|
506
|
+
// unambiguous and needs no picker or --all. A child that is v1 — or
|
|
507
|
+
// fails to load — keeps the interactive picker below.
|
|
508
|
+
if (await allChildrenAreV2(children)) {
|
|
509
|
+
if (!ctx.json) {
|
|
510
|
+
ctx.err(
|
|
511
|
+
`Deploying all ${children.length} v2 agents under ${basename(dir)} as one application (pass --slug <name> to deploy a single agent standalone).\n`
|
|
512
|
+
);
|
|
513
|
+
}
|
|
514
|
+
return [...children];
|
|
515
|
+
}
|
|
516
|
+
|
|
480
517
|
const chooser =
|
|
481
518
|
options.chooseTargets ??
|
|
482
519
|
((agents) =>
|
|
@@ -508,6 +545,27 @@ function formatAgentList(agents: readonly DeployTarget[]): string {
|
|
|
508
545
|
return agents.map((agent, i) => ` ${i + 1}) ${agent.slug}\n`).join("");
|
|
509
546
|
}
|
|
510
547
|
|
|
548
|
+
/**
|
|
549
|
+
* True when every child agent project loads and declares
|
|
550
|
+
* `architecture: "v2"`. Broken projects count as not-v2 so target
|
|
551
|
+
* resolution falls back to the picker instead of failing the whole deploy
|
|
552
|
+
* on a child the user might not even select.
|
|
553
|
+
*/
|
|
554
|
+
async function allChildrenAreV2(
|
|
555
|
+
children: readonly DeployTarget[]
|
|
556
|
+
): Promise<boolean> {
|
|
557
|
+
for (const child of children) {
|
|
558
|
+
try {
|
|
559
|
+
if ((await readDeployManifest(child.dir)).architecture !== "v2") {
|
|
560
|
+
return false;
|
|
561
|
+
}
|
|
562
|
+
} catch {
|
|
563
|
+
return false;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
return true;
|
|
567
|
+
}
|
|
568
|
+
|
|
511
569
|
/**
|
|
512
570
|
* TTY picker for multi-agent parents. Non-interactive callers get `[]`
|
|
513
571
|
* so {@link resolveDeployTargets} can print the --slug/--all hint.
|
|
@@ -777,6 +835,100 @@ async function deployOne(
|
|
|
777
835
|
return 0;
|
|
778
836
|
}
|
|
779
837
|
|
|
838
|
+
/**
|
|
839
|
+
* Multi-agent parent whose children all declare `architecture: "v2"`:
|
|
840
|
+
* deploy ONE application whose release carries a component per child. The
|
|
841
|
+
* application slug derives from the parent directory name; each component
|
|
842
|
+
* key is the child's slug and its path is the child directory relative to
|
|
843
|
+
* the repo root (a shared --path names the parent's directory in the repo).
|
|
844
|
+
*/
|
|
845
|
+
async function deployAgentsdkApplication(
|
|
846
|
+
ctx: DeployCliContext,
|
|
847
|
+
options: DeployCliOptions,
|
|
848
|
+
targets: readonly DeployTarget[]
|
|
849
|
+
): Promise<number> {
|
|
850
|
+
const parentDir = resolve(options.dir ?? ".");
|
|
851
|
+
const slug = slugFromDirectoryName(basename(parentDir));
|
|
852
|
+
if (slug === undefined) {
|
|
853
|
+
ctx.err(
|
|
854
|
+
`Could not derive an application slug from the parent directory name ${JSON.stringify(basename(parentDir))} — rename it (deploy slugs use lowercase letters, digits, '-' or '_').\n`
|
|
855
|
+
);
|
|
856
|
+
return 1;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
const needsGitInference =
|
|
860
|
+
options.repo === undefined ||
|
|
861
|
+
options.ref === undefined ||
|
|
862
|
+
options.path === undefined;
|
|
863
|
+
const inferred = needsGitInference
|
|
864
|
+
? await inferDeployGitSource(parentDir, {
|
|
865
|
+
...(options.git === undefined ? {} : { git: options.git }),
|
|
866
|
+
})
|
|
867
|
+
: {};
|
|
868
|
+
const gitRepoUrl = options.repo ?? inferred.gitRepoUrl;
|
|
869
|
+
const gitRef = options.ref ?? inferred.gitRef;
|
|
870
|
+
const parentPath = options.path ?? inferred.agentPath;
|
|
871
|
+
|
|
872
|
+
if (gitRepoUrl !== undefined && !gitRepoUrl.startsWith("https://")) {
|
|
873
|
+
ctx.err(
|
|
874
|
+
`Invalid --repo: ${gitRepoUrl} (expected an https:// git repository URL)\n`
|
|
875
|
+
);
|
|
876
|
+
return 1;
|
|
877
|
+
}
|
|
878
|
+
if (gitRepoUrl === undefined) {
|
|
879
|
+
ctx.err(
|
|
880
|
+
`Could not resolve an https:// git repository URL for this deploy.\n` +
|
|
881
|
+
` Pass --repo https://github.com/<owner>/<repo> (inferred from origin when possible).\n`
|
|
882
|
+
);
|
|
883
|
+
return 1;
|
|
884
|
+
}
|
|
885
|
+
for (const repo of options.cursorEventsRepos ?? []) {
|
|
886
|
+
if (!isValidCursorEventRepo(repo)) {
|
|
887
|
+
ctx.err(`Invalid --cursor-events-repo: ${repo} (expected owner/name)\n`);
|
|
888
|
+
return 1;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
const components: AgentkitDeployComponent[] = targets.map((target) => ({
|
|
893
|
+
componentKey: target.slug,
|
|
894
|
+
agentPath: [parentPath, basename(target.dir)]
|
|
895
|
+
.filter((part): part is string => part !== undefined && part !== "")
|
|
896
|
+
.join("/"),
|
|
897
|
+
}));
|
|
898
|
+
|
|
899
|
+
if (!ctx.json) {
|
|
900
|
+
ctx.err(
|
|
901
|
+
`Deploying "${slug}" as one v2 application with ${targets.length} components (slug from the parent directory name).\n` +
|
|
902
|
+
` architecture: v2\n` +
|
|
903
|
+
` source: ${gitRepoUrl}${gitRef === undefined ? "" : ` @ ${gitRef}`}\n` +
|
|
904
|
+
components
|
|
905
|
+
.map(
|
|
906
|
+
(component) =>
|
|
907
|
+
` component: ${component.componentKey} (${component.agentPath ?? "."})\n`
|
|
908
|
+
)
|
|
909
|
+
.join("")
|
|
910
|
+
);
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
// Components bake sequentially on the control plane, so the default wait
|
|
914
|
+
// budget is per component; otherwise a 2+ component deploy routinely hits
|
|
915
|
+
// the client-side timeout while the server-side deploy is still fine. An
|
|
916
|
+
// explicitly passed timeout always wins.
|
|
917
|
+
const waitCtx =
|
|
918
|
+
options.timeoutMs === undefined
|
|
919
|
+
? { ...ctx, timeoutMs: ctx.timeoutMs * targets.length }
|
|
920
|
+
: ctx;
|
|
921
|
+
|
|
922
|
+
return deployOneAgentsdk(waitCtx, undefined, {
|
|
923
|
+
slug,
|
|
924
|
+
gitRepoUrl,
|
|
925
|
+
gitRef,
|
|
926
|
+
agentPath: undefined,
|
|
927
|
+
components,
|
|
928
|
+
repositories: options.cursorEventsRepos,
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
|
|
780
932
|
/**
|
|
781
933
|
* `architecture: "v2"` deploy: POST `/internal/agentkit/deployments` and
|
|
782
934
|
* poll the matching GET. The v2 accept path starts freeze bake; it does
|
|
@@ -790,10 +942,17 @@ async function deployOneAgentsdk(
|
|
|
790
942
|
gitRepoUrl: string;
|
|
791
943
|
gitRef: string | undefined;
|
|
792
944
|
agentPath: string | undefined;
|
|
945
|
+
components?: AgentkitDeployComponent[];
|
|
793
946
|
repositories: string[] | undefined;
|
|
794
947
|
}
|
|
795
948
|
): Promise<number> {
|
|
796
949
|
const { slug } = args;
|
|
950
|
+
const componentsLine =
|
|
951
|
+
args.components === undefined
|
|
952
|
+
? ""
|
|
953
|
+
: ` components: ${args.components
|
|
954
|
+
.map((component) => component.componentKey)
|
|
955
|
+
.join(", ")}\n`;
|
|
797
956
|
let accepted: AgentkitDeployAccepted;
|
|
798
957
|
try {
|
|
799
958
|
accepted = await ctx.client.deployAgentkit({
|
|
@@ -802,6 +961,7 @@ async function deployOneAgentsdk(
|
|
|
802
961
|
gitRepoUrl: args.gitRepoUrl,
|
|
803
962
|
gitRef: args.gitRef,
|
|
804
963
|
agentPath: args.agentPath,
|
|
964
|
+
components: args.components,
|
|
805
965
|
repositories: args.repositories,
|
|
806
966
|
});
|
|
807
967
|
} catch (error) {
|
|
@@ -817,7 +977,8 @@ async function deployOneAgentsdk(
|
|
|
817
977
|
ctx.out(
|
|
818
978
|
`Deploy accepted: ${slug} (team ${ctx.teamId}, v2)\n` +
|
|
819
979
|
` application: ${accepted.applicationId}\n` +
|
|
820
|
-
` release: ${accepted.releaseId}\n`
|
|
980
|
+
` release: ${accepted.releaseId}\n` +
|
|
981
|
+
componentsLine
|
|
821
982
|
);
|
|
822
983
|
}
|
|
823
984
|
return 0;
|
|
@@ -851,7 +1012,12 @@ async function deployOneAgentsdk(
|
|
|
851
1012
|
` status: running\n` +
|
|
852
1013
|
` architecture: v2\n` +
|
|
853
1014
|
` application: ${detail.applicationId}\n` +
|
|
854
|
-
` release: ${detail.releaseId}\n`
|
|
1015
|
+
` release: ${detail.releaseId}\n` +
|
|
1016
|
+
(args.components === undefined
|
|
1017
|
+
? ""
|
|
1018
|
+
: ` components: ${args.components
|
|
1019
|
+
.map((component) => component.componentKey)
|
|
1020
|
+
.join(", ")}\n`)
|
|
855
1021
|
);
|
|
856
1022
|
return 0;
|
|
857
1023
|
}
|
|
@@ -971,6 +1137,16 @@ interface DeployManifest {
|
|
|
971
1137
|
*/
|
|
972
1138
|
async function readDeployManifest(dir: string): Promise<DeployManifest> {
|
|
973
1139
|
const project = await loadAgentProject(dir);
|
|
1140
|
+
// Fail here, before anything is dispatched: a project with error
|
|
1141
|
+
// diagnostics (e.g. agent/storage.ts on architecture v2) would only be
|
|
1142
|
+
// refused later by `serve` inside the hosted build, wasting a bake.
|
|
1143
|
+
if (hasErrorDiagnostics(project)) {
|
|
1144
|
+
throw new Error(
|
|
1145
|
+
`Refusing to deploy ${project.name} — it has errors:\n${formatDiagnostics(
|
|
1146
|
+
project.diagnostics.filter((d) => d.severity === "error")
|
|
1147
|
+
)}`
|
|
1148
|
+
);
|
|
1149
|
+
}
|
|
974
1150
|
return {
|
|
975
1151
|
hosting: project.agent.hosting,
|
|
976
1152
|
architecture: project.agent.architecture,
|