@cursor/july 0.1.100 → 0.1.102
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/README.md +27 -0
- package/dist/bin/agent-serve.js +3 -2
- package/dist/channels/deployments/deployments-channel.d.ts +41 -5
- package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
- package/dist/channels/deployments/deployments-channel.js +88 -8
- package/dist/channels/deployments/types.d.ts +4 -3
- package/dist/channels/deployments/types.d.ts.map +1 -1
- package/dist/channels/origin/defaults.d.ts +43 -0
- package/dist/channels/origin/defaults.d.ts.map +1 -0
- package/dist/channels/origin/defaults.js +111 -0
- package/dist/channels/origin/index.d.ts +2 -0
- package/dist/channels/origin/index.d.ts.map +1 -1
- package/dist/channels/origin/index.js +2 -0
- package/dist/channels/origin/origin-channel.d.ts +2 -1
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +24 -3
- package/dist/channels/origin/state.d.ts +32 -0
- package/dist/channels/origin/state.d.ts.map +1 -0
- package/dist/channels/origin/state.js +23 -0
- package/dist/channels/origin/types.d.ts +23 -1
- package/dist/channels/origin/types.d.ts.map +1 -1
- package/dist/channels/slack/api.d.ts +1 -1
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +5 -2
- package/dist/channels/slack/assistant.d.ts +1 -1
- package/dist/channels/slack/assistant.d.ts.map +1 -1
- package/dist/channels/slack/code-fences.d.ts +17 -0
- package/dist/channels/slack/code-fences.d.ts.map +1 -0
- package/dist/channels/slack/code-fences.js +168 -0
- package/dist/channels/slack/dispatch.d.ts +3 -2
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +28 -8
- 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 +28 -0
- package/dist/channels/slack/index.d.ts +1 -0
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +1 -0
- package/dist/channels/slack/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +11 -4
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +2 -1
- package/dist/connections.d.ts +18 -2
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +18 -2
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.DZ1e0Ycq.js → app.CLA03RCz.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.FAqdWIXo.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.l8omwc6D.js → VPLocalSearchBox.ifxv-cJV.js} +1 -1
- package/dist/docs/assets/chunks/{theme.JVcD6gel.js → theme.DWCwM6p-.js} +2 -2
- package/dist/docs/assets/concepts.md.rPzW2HZN.js +1 -0
- package/dist/docs/assets/guides_cloud-agents.md.DumwWXba.js +9 -0
- package/dist/docs/assets/guides_cloud-agents.md.DumwWXba.lean.js +1 -0
- package/dist/docs/assets/{guides_cloud-runtime.md.CkYbjnAX.js → guides_cloud-runtime.md.BRirbRAN.js} +1 -1
- package/dist/docs/assets/index.md.Kiht7ell.js +5 -0
- package/dist/docs/assets/{index.md.Bb4k8kUm.lean.js → index.md.Kiht7ell.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.BiGoBAk2.js → reference_connections.md.Di6jJAXF.js} +12 -2
- package/dist/docs/assets/{reference_connections.md.BiGoBAk2.lean.js → reference_connections.md.Di6jJAXF.lean.js} +1 -1
- package/dist/docs/assets/reference_extensions.md.9WQMZe1l.js +56 -0
- package/dist/docs/assets/reference_extensions.md.9WQMZe1l.lean.js +1 -0
- package/dist/docs/assets/{reference_http-api.md.BEJx9XVj.js → reference_http-api.md.oySXBO8o.js} +1 -1
- package/dist/docs/assets/{reference_project-layout.md.Bv4KOtlB.js → reference_project-layout.md.CA6QP6Lw.js} +2 -2
- package/dist/docs/assets/{reference_project-layout.md.Bv4KOtlB.lean.js → reference_project-layout.md.CA6QP6Lw.lean.js} +1 -1
- package/dist/docs/assets/{reference_skills.md.BFW9retM.js → reference_skills.md.l2ezAcaN.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.CvAHsdSp.js → reference_tools.md.B1up2r9W.js} +1 -1
- package/dist/docs/assets/skills_framework-map.md.DDa4MeEW.js +1 -0
- package/dist/docs/assets/{skills_framework-map.md.BTi817yv.lean.js → skills_framework-map.md.DDa4MeEW.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +5 -5
- package/dist/docs/concepts.md +3 -3
- 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-agents.html +35 -0
- package/dist/docs/guides/cloud-agents.md +93 -0
- package/dist/docs/guides/cloud-runtime.html +6 -6
- package/dist/docs/guides/cloud-runtime.md +2 -0
- 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 +5 -5
- 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 +353 -5
- 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 +5 -5
- package/dist/docs/reference/cli.html +4 -4
- package/dist/docs/reference/connections.html +16 -6
- package/dist/docs/reference/connections.md +31 -0
- package/dist/docs/reference/extensions.html +82 -0
- package/dist/docs/reference/extensions.md +200 -0
- package/dist/docs/reference/hooks.html +4 -4
- package/dist/docs/reference/http-api.html +6 -6
- package/dist/docs/reference/http-api.md +1 -1
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +4 -4
- package/dist/docs/reference/project-layout.html +6 -6
- package/dist/docs/reference/project-layout.md +3 -0
- 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 +6 -6
- package/dist/docs/reference/skills.md +2 -0
- package/dist/docs/reference/subagents.html +5 -5
- package/dist/docs/reference/tools.html +6 -6
- package/dist/docs/reference/tools.md +2 -0
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/skills/ab.html +4 -4
- package/dist/docs/skills/create-agent.html +4 -4
- package/dist/docs/skills/debug.html +4 -4
- package/dist/docs/skills/evals.html +4 -4
- package/dist/docs/skills/framework-map.html +5 -5
- package/dist/docs/skills/framework-map.md +1 -0
- package/dist/docs/skills/github.html +4 -4
- package/dist/docs/skills/hillclimb.html +4 -4
- package/dist/docs/skills/index.html +4 -4
- package/dist/docs/skills/mcp-auth.html +4 -4
- package/dist/docs/skills/otel.html +4 -4
- package/dist/docs/skills/setup-slack.html +4 -4
- package/dist/docs/storage.html +4 -4
- package/dist/docs/templates/agentic-owners.html +4 -4
- package/dist/docs/templates/agents-md.html +4 -4
- package/dist/docs/templates/code-wiki.html +4 -4
- package/dist/docs/templates/demo.html +4 -4
- package/dist/docs/templates/pr-autofixer.html +4 -4
- package/dist/docs/templates/security-help.html +4 -4
- package/dist/docs/templates/security-reviewer.html +4 -4
- package/dist/docs/templates/triage.html +4 -4
- package/dist/docs/troubleshooting.html +4 -4
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +57 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/extension.js +66 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +78 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.js +286 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts +25 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.js +85 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts +5 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.js +4 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts +15 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.js +55 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts +8 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.js +15 -0
- package/dist/extensions/cursor-cloud-agents/skills/handoff.md +41 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.js +26 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.js +54 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.js +25 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +59 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.js +36 -0
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/reply.js +35 -0
- package/dist/extensions.d.ts +73 -0
- package/dist/extensions.d.ts.map +1 -0
- package/dist/extensions.js +112 -0
- package/dist/files-backends/cursor-hosted.d.ts +0 -8
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +1 -11
- package/dist/files.d.ts +5 -1
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +22 -18
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/internal/advertise-tools.d.ts +4 -1
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +20 -1
- package/dist/internal/as-of.d.ts +18 -0
- package/dist/internal/as-of.d.ts.map +1 -1
- package/dist/internal/as-of.js +131 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +64 -19
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +3 -1
- package/dist/internal/conversation-mirror.d.ts.map +1 -1
- package/dist/internal/conversation-mirror.js +13 -15
- package/dist/internal/cursor/backend-client.d.ts +8 -1
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +25 -9
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts +16 -0
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-deployment-secrets.js +61 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts +11 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -1
- package/dist/internal/cursor/hosted-store-secrets.js +15 -0
- package/dist/internal/cursor-deployment-relay.d.ts +15 -1
- package/dist/internal/cursor-deployment-relay.d.ts.map +1 -1
- package/dist/internal/cursor-deployment-relay.js +46 -7
- package/dist/internal/deploy-client.d.ts +23 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +54 -12
- package/dist/internal/discovery/ab.d.ts +9 -0
- package/dist/internal/discovery/ab.d.ts.map +1 -0
- package/dist/internal/discovery/ab.js +101 -0
- package/dist/internal/discovery/agent-config.d.ts +35 -0
- package/dist/internal/discovery/agent-config.d.ts.map +1 -0
- package/dist/internal/discovery/agent-config.js +173 -0
- package/dist/internal/discovery/agent.d.ts +11 -0
- package/dist/internal/discovery/agent.d.ts.map +1 -0
- package/dist/internal/discovery/agent.js +306 -0
- package/dist/internal/discovery/channels.d.ts +10 -0
- package/dist/internal/discovery/channels.d.ts.map +1 -0
- package/dist/internal/discovery/channels.js +97 -0
- package/dist/internal/discovery/connections.d.ts +17 -0
- package/dist/internal/discovery/connections.d.ts.map +1 -0
- package/dist/internal/discovery/connections.js +436 -0
- package/dist/internal/discovery/context.d.ts +20 -0
- package/dist/internal/discovery/context.d.ts.map +1 -0
- package/dist/internal/discovery/context.js +30 -0
- package/dist/internal/discovery/cursor-plugin.d.ts +25 -0
- package/dist/internal/discovery/cursor-plugin.d.ts.map +1 -0
- package/dist/internal/discovery/cursor-plugin.js +570 -0
- package/dist/internal/discovery/extensions.d.ts +19 -0
- package/dist/internal/discovery/extensions.d.ts.map +1 -0
- package/dist/internal/discovery/extensions.js +238 -0
- package/dist/internal/discovery/fs.d.ts +15 -0
- package/dist/internal/discovery/fs.d.ts.map +1 -0
- package/dist/internal/discovery/fs.js +115 -0
- package/dist/internal/discovery/hooks.d.ts +7 -0
- package/dist/internal/discovery/hooks.d.ts.map +1 -0
- package/dist/internal/discovery/hooks.js +48 -0
- package/dist/internal/discovery/info.d.ts +6 -0
- package/dist/internal/discovery/info.d.ts.map +1 -0
- package/dist/internal/discovery/info.js +141 -0
- package/dist/internal/discovery/instructions.d.ts +7 -0
- package/dist/internal/discovery/instructions.d.ts.map +1 -0
- package/dist/internal/discovery/instructions.js +95 -0
- package/dist/internal/discovery/modules.d.ts +20 -0
- package/dist/internal/discovery/modules.d.ts.map +1 -0
- package/dist/internal/discovery/modules.js +101 -0
- package/dist/internal/discovery/names.d.ts +12 -0
- package/dist/internal/discovery/names.d.ts.map +1 -0
- package/dist/internal/discovery/names.js +36 -0
- package/dist/internal/discovery/project.d.ts +53 -0
- package/dist/internal/discovery/project.d.ts.map +1 -0
- package/dist/internal/discovery/project.js +239 -0
- package/dist/internal/discovery/runtime.d.ts +34 -0
- package/dist/internal/discovery/runtime.d.ts.map +1 -0
- package/dist/internal/discovery/runtime.js +98 -0
- package/dist/internal/discovery/schedules.d.ts +7 -0
- package/dist/internal/discovery/schedules.d.ts.map +1 -0
- package/dist/internal/discovery/schedules.js +97 -0
- package/dist/internal/discovery/seed-files.d.ts +7 -0
- package/dist/internal/discovery/seed-files.d.ts.map +1 -0
- package/dist/internal/discovery/seed-files.js +41 -0
- package/dist/internal/discovery/services.d.ts +17 -0
- package/dist/internal/discovery/services.d.ts.map +1 -0
- package/dist/internal/discovery/services.js +104 -0
- package/dist/internal/discovery/skills.d.ts +16 -0
- package/dist/internal/discovery/skills.d.ts.map +1 -0
- package/dist/internal/discovery/skills.js +151 -0
- package/dist/internal/discovery/subagent.d.ts +13 -0
- package/dist/internal/discovery/subagent.d.ts.map +1 -0
- package/dist/internal/discovery/subagent.js +19 -0
- package/dist/internal/discovery/tools.d.ts +18 -0
- package/dist/internal/discovery/tools.d.ts.map +1 -0
- package/dist/internal/discovery/tools.js +159 -0
- package/dist/internal/discovery.d.ts +8 -62
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +8 -2210
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +5 -0
- package/dist/internal/framework-file-storage.d.ts +3 -3
- package/dist/internal/framework-file-storage.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.js +38 -9
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +8 -7
- package/dist/internal/frontmatter.d.ts +11 -3
- package/dist/internal/frontmatter.d.ts.map +1 -1
- package/dist/internal/frontmatter.js +29 -3
- package/dist/internal/hosted-delivery.d.ts +3 -1
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +19 -32
- package/dist/internal/hosted-execution-diag.d.ts +5 -0
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
- package/dist/internal/hosted-execution-diag.js +5 -0
- package/dist/internal/hosted-execution-flush.d.ts +46 -0
- package/dist/internal/hosted-execution-flush.d.ts.map +1 -0
- package/dist/internal/hosted-execution-flush.js +81 -0
- package/dist/internal/mcp-endpoint.js +1 -0
- package/dist/internal/mcp-host.d.ts +2 -1
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +66 -29
- package/dist/internal/otel/collector.d.ts +13 -0
- package/dist/internal/otel/collector.d.ts.map +1 -1
- package/dist/internal/otel/collector.js +84 -17
- package/dist/internal/otel/http.d.ts.map +1 -1
- package/dist/internal/otel/http.js +2 -10
- package/dist/internal/otel/mcp.d.ts +16 -0
- package/dist/internal/otel/mcp.d.ts.map +1 -0
- package/dist/internal/otel/mcp.js +68 -0
- package/dist/internal/otel/propagation.d.ts +6 -0
- package/dist/internal/otel/propagation.d.ts.map +1 -0
- package/dist/internal/otel/propagation.js +14 -0
- package/dist/internal/otel/runtime.d.ts.map +1 -1
- package/dist/internal/otel/runtime.js +2 -0
- package/dist/internal/review-comments.d.ts +1 -1
- package/dist/internal/review-comments.d.ts.map +1 -1
- package/dist/internal/review-comments.js +4 -4
- package/dist/internal/server.d.ts +3 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +79 -104
- package/dist/internal/session-engine.d.ts +14 -7
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +113 -66
- package/dist/internal/session-run-log.d.ts +3 -1
- package/dist/internal/session-run-log.d.ts.map +1 -1
- package/dist/internal/session-run-log.js +14 -14
- package/dist/internal/start-log-store.d.ts +60 -0
- package/dist/internal/start-log-store.d.ts.map +1 -0
- package/dist/internal/start-log-store.js +149 -0
- package/dist/internal/storage-coordinator.d.ts +4 -1
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +15 -13
- package/dist/internal/tool-catalog.d.ts.map +1 -1
- package/dist/internal/tool-catalog.js +9 -6
- package/dist/internal/tool-policy.d.ts +8 -0
- package/dist/internal/tool-policy.d.ts.map +1 -1
- package/dist/internal/tool-policy.js +19 -7
- package/dist/internal/turn-cost.d.ts +14 -0
- package/dist/internal/turn-cost.d.ts.map +1 -1
- package/dist/internal/turn-cost.js +41 -9
- package/dist/internal/v2-hosting.d.ts +22 -0
- package/dist/internal/v2-hosting.d.ts.map +1 -0
- package/dist/internal/v2-hosting.js +23 -0
- package/dist/otel.d.ts +16 -0
- package/dist/otel.d.ts.map +1 -1
- package/dist/otel.js +26 -0
- package/dist/playground/assets/index-B6C9S9nG.css +1 -0
- package/dist/playground/assets/{index-DVs98vPL.js → index-ZqNoT8Ie.js} +45 -45
- package/dist/playground/index.html +2 -2
- package/dist/storage-protocol.d.ts +47 -22
- package/dist/storage-protocol.d.ts.map +1 -1
- package/dist/storage-protocol.js +90 -54
- package/dist/storage.d.ts +2 -2
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +1 -1
- package/dist/tools.d.ts +9 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +9 -0
- package/dist/types.d.ts +154 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +29 -1
- package/docs/README.md +5 -1
- package/docs/concepts.md +3 -3
- package/docs/guides/cloud-agents.md +98 -0
- package/docs/guides/cloud-runtime.md +2 -0
- package/docs/reference/connections.md +31 -0
- package/docs/reference/extensions.md +205 -0
- package/docs/reference/http-api.md +1 -1
- package/docs/reference/project-layout.md +3 -0
- package/docs/reference/skills.md +2 -0
- package/docs/reference/tools.md +2 -0
- package/package.json +18 -4
- package/skills/framework-map/SKILL.md +1 -0
- package/src/bin/agent-serve.ts +11 -2
- package/src/channels/deployments/deployments-channel.ts +117 -8
- package/src/channels/deployments/types.ts +4 -3
- package/src/channels/origin/defaults.ts +143 -0
- package/src/channels/origin/index.ts +2 -0
- package/src/channels/origin/origin-channel.ts +37 -1
- package/src/channels/origin/state.ts +54 -0
- package/src/channels/origin/types.ts +24 -0
- package/src/channels/slack/api.ts +6 -3
- package/src/channels/slack/assistant.ts +1 -1
- package/src/channels/slack/code-fences.ts +183 -0
- package/src/channels/slack/dispatch.ts +27 -2
- package/src/channels/slack/inbound.ts +37 -0
- package/src/channels/slack/index.ts +1 -0
- package/src/channels/slack/live-delivery.ts +16 -13
- package/src/channels/slack/manifest.ts +2 -1
- package/src/connections.ts +18 -1
- package/src/extensions/cursor-cloud-agents/extension.ts +120 -0
- package/src/extensions/cursor-cloud-agents/lib/backend.ts +395 -0
- package/src/extensions/cursor-cloud-agents/lib/fleet.ts +109 -0
- package/src/extensions/cursor-cloud-agents/lib/inputs.ts +5 -0
- package/src/extensions/cursor-cloud-agents/lib/repos.ts +81 -0
- package/src/extensions/cursor-cloud-agents/lib/transcript.ts +23 -0
- package/src/extensions/cursor-cloud-agents/skills/handoff.md +41 -0
- package/src/extensions/cursor-cloud-agents/tools/cancel.ts +19 -0
- package/src/extensions/cursor-cloud-agents/tools/dump.ts +51 -0
- package/src/extensions/cursor-cloud-agents/tools/get.ts +18 -0
- package/src/extensions/cursor-cloud-agents/tools/launch.ts +64 -0
- package/src/extensions/cursor-cloud-agents/tools/list.ts +31 -0
- package/src/extensions/cursor-cloud-agents/tools/reply.ts +34 -0
- package/src/extensions.ts +141 -0
- package/src/files-backends/cursor-hosted.ts +1 -17
- package/src/files.ts +43 -34
- package/src/index.ts +11 -0
- package/src/internal/advertise-tools.ts +37 -12
- package/src/internal/as-of.ts +163 -0
- package/src/internal/cli-deploy.ts +86 -23
- package/src/internal/continuation-identity.ts +3 -1
- package/src/internal/conversation-mirror.ts +23 -18
- package/src/internal/cursor/backend-client.ts +32 -10
- package/src/internal/cursor/hosted-deployment-secrets.ts +72 -0
- package/src/internal/cursor/hosted-store-secrets.ts +27 -0
- package/src/internal/cursor-deployment-relay.ts +65 -8
- package/src/internal/deploy-client.ts +73 -18
- package/src/internal/discovery/ab.ts +111 -0
- package/src/internal/discovery/agent-config.ts +222 -0
- package/src/internal/discovery/agent.ts +360 -0
- package/src/internal/discovery/channels.ts +103 -0
- package/src/internal/discovery/connections.ts +540 -0
- package/src/internal/discovery/context.ts +46 -0
- package/src/internal/discovery/cursor-plugin.ts +708 -0
- package/src/internal/discovery/extensions.ts +348 -0
- package/src/internal/discovery/fs.ts +108 -0
- package/src/internal/discovery/hooks.ts +45 -0
- package/src/internal/discovery/info.ts +179 -0
- package/src/internal/discovery/instructions.ts +113 -0
- package/src/internal/discovery/modules.ts +107 -0
- package/src/internal/discovery/names.ts +44 -0
- package/src/internal/discovery/project.ts +270 -0
- package/src/internal/discovery/runtime.ts +159 -0
- package/src/internal/discovery/schedules.ts +94 -0
- package/src/internal/discovery/seed-files.ts +37 -0
- package/src/internal/discovery/services.ts +124 -0
- package/src/internal/discovery/skills.ts +176 -0
- package/src/internal/discovery/subagent.ts +29 -0
- package/src/internal/discovery/tools.ts +182 -0
- package/src/internal/discovery.ts +20 -2724
- package/src/internal/distribution.ts +5 -0
- package/src/internal/framework-file-storage.ts +43 -9
- package/src/internal/framework-storage-selection.ts +9 -9
- package/src/internal/frontmatter.ts +36 -3
- package/src/internal/hosted-delivery.ts +38 -63
- package/src/internal/hosted-execution-diag.ts +6 -0
- package/src/internal/hosted-execution-flush.ts +142 -0
- package/src/internal/mcp-endpoint.ts +1 -0
- package/src/internal/mcp-host.ts +116 -37
- package/src/internal/otel/collector.ts +125 -25
- package/src/internal/otel/http.ts +2 -12
- package/src/internal/otel/mcp.ts +69 -0
- package/src/internal/otel/propagation.ts +17 -0
- package/src/internal/otel/runtime.ts +2 -0
- package/src/internal/review-comments.ts +5 -2
- package/src/internal/server.ts +81 -100
- package/src/internal/session-engine.ts +152 -39
- package/src/internal/session-run-log.ts +18 -16
- package/src/internal/start-log-store.ts +174 -0
- package/src/internal/storage-coordinator.ts +19 -16
- package/src/internal/tool-catalog.ts +9 -6
- package/src/internal/tool-policy.ts +39 -9
- package/src/internal/turn-cost.ts +47 -4
- package/src/internal/v2-hosting.ts +38 -0
- package/src/otel.ts +38 -0
- package/src/storage-protocol.ts +126 -79
- package/src/storage.ts +5 -0
- package/src/tools.ts +18 -0
- package/src/types.ts +213 -14
- package/dist/docs/assets/chunks/@localSearchIndexroot.j70vvPL4.js +0 -1
- package/dist/docs/assets/concepts.md.lwAgBIMI.js +0 -1
- package/dist/docs/assets/index.md.Bb4k8kUm.js +0 -5
- package/dist/docs/assets/skills_framework-map.md.BTi817yv.js +0 -1
- package/dist/playground/assets/index-BszoQDc6.css +0 -1
- /package/dist/docs/assets/{concepts.md.lwAgBIMI.lean.js → concepts.md.rPzW2HZN.lean.js} +0 -0
- /package/dist/docs/assets/{guides_cloud-runtime.md.CkYbjnAX.lean.js → guides_cloud-runtime.md.BRirbRAN.lean.js} +0 -0
- /package/dist/docs/assets/{reference_http-api.md.BEJx9XVj.lean.js → reference_http-api.md.oySXBO8o.lean.js} +0 -0
- /package/dist/docs/assets/{reference_skills.md.BFW9retM.lean.js → reference_skills.md.l2ezAcaN.lean.js} +0 -0
- /package/dist/docs/assets/{reference_tools.md.CvAHsdSp.lean.js → reference_tools.md.B1up2r9W.lean.js} +0 -0
package/src/storage-protocol.ts
CHANGED
|
@@ -1,107 +1,129 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Durable session KV contract: key families plus a tolerant SessionRecord
|
|
3
|
-
* decoder.
|
|
4
|
-
*
|
|
5
|
-
* list can read Bugbot KV without importing `@cursor/july`.
|
|
3
|
+
* decoder. Architecture v1 remains in lockstep with the Bugbot-backed control
|
|
4
|
+
* plane. Architecture v2 uses the same key shape under its AgentSDK root.
|
|
6
5
|
*
|
|
7
6
|
* Additive JSON only — unknown fields are ignored.
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
9
|
import { createHash } from "node:crypto";
|
|
11
10
|
|
|
11
|
+
/** Legacy architecture-v1 storage root. */
|
|
12
|
+
export const STORAGE_KEY_ROOT = "agentkit/v1" as const;
|
|
13
|
+
|
|
12
14
|
/**
|
|
13
|
-
*
|
|
14
|
-
* prefix
|
|
15
|
+
* Architecture-v2 storage root. Hard cutoff: v2 writes and reads this
|
|
16
|
+
* prefix only. Existing `agentkit/v1` v2 objects are not migrated.
|
|
15
17
|
*/
|
|
16
|
-
export const
|
|
18
|
+
export const AGENTSDK_STORAGE_KEY_ROOT = "agentsdk/v1" as const;
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
|
-
* Exact session-record keys: `agentkit/v1/{agent}/session/{sessionId}`.
|
|
21
|
+
* Exact session-record keys: `{agentkit|agentsdk}/v1/{agent}/session/{sessionId}`.
|
|
20
22
|
* Rejects `session-events/` and the CP-owned `_cp` agent name.
|
|
21
23
|
*/
|
|
22
24
|
const DURABLE_SESSION_RECORD_KEY_RE =
|
|
23
|
-
/^agentkit\/v1\/([^/]+)\/session\/([^/]+)$/;
|
|
25
|
+
/^(agentkit|agentsdk)\/v1\/([^/]+)\/session\/([^/]+)$/;
|
|
24
26
|
|
|
25
27
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* to a database). Channel ids and continuation tokens are the only segments
|
|
30
|
-
* that may contain caller-controlled characters; they are URI-encoded, and
|
|
31
|
-
* a segment whose encoding exceeds {@link MAX_KEY_SEGMENT_BYTES} is replaced
|
|
32
|
-
* by a `sha256:…` digest — so every minted key has a bounded length that any
|
|
33
|
-
* backend (VARCHAR columns, btree index tuples, S3 key limits) can store,
|
|
34
|
-
* no matter what a caller stuffs into a token. The substitution is
|
|
35
|
-
* deterministic: writes and continuation lookups build the same key.
|
|
28
|
+
* Build the framework-owned key scheme under one versioned root. Channel ids
|
|
29
|
+
* and continuation tokens are URI-encoded, and oversized segments are
|
|
30
|
+
* replaced by a deterministic `sha256:…` digest.
|
|
36
31
|
*
|
|
37
32
|
* | Key | Value |
|
|
38
33
|
* | --- | --- |
|
|
39
|
-
* | `
|
|
40
|
-
* | `
|
|
41
|
-
* | `
|
|
42
|
-
* | `
|
|
43
|
-
* | `
|
|
34
|
+
* | `{root}/{agent}/session/{sessionId}` | `SessionRecord` |
|
|
35
|
+
* | `{root}/{agent}/session-events/{sessionId}/{index}` | `SessionEvent[]` chunk (index = first event's index, zero-padded) |
|
|
36
|
+
* | `{root}/{agent}/session-runs/{sessionPublicId}` | One session-level hosted-execution log (executions[] + lastFailure) |
|
|
37
|
+
* | `{root}/{agent}/logs/{logId}` | Hosted engine stdout/stderr tee (on-disk `start.log`; `ses_…` after send, `wf:{workflowId}` on admission failure) |
|
|
38
|
+
* | `{root}/{agent}/continuation/{channelId}/{token}` | `{ sessionId }` |
|
|
39
|
+
* | `{root}/{agent}/kv/{key}` | Author JSON via `HostContext.kv` |
|
|
44
40
|
*
|
|
45
41
|
* The `eval-runs` / `ab-samples` / `ab-snapshot` families are minted only
|
|
46
42
|
* by the tables `defineStorage` derives over the KV core; a backend that
|
|
47
43
|
* authors dedicated `StorageConfig.evals` / `StorageConfig.abs` groups never
|
|
48
44
|
* sees them.
|
|
49
45
|
*/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
`${
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
agent: string
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
46
|
+
function createStorageKeys(root: string) {
|
|
47
|
+
return {
|
|
48
|
+
session: (agent: string, sessionId: string): string =>
|
|
49
|
+
`${root}/${agent}/session/${sessionId}`,
|
|
50
|
+
sessionPrefix: (agent: string): string => `${root}/${agent}/session/`,
|
|
51
|
+
sessionEvents: (
|
|
52
|
+
agent: string,
|
|
53
|
+
sessionId: string,
|
|
54
|
+
firstIndex: number
|
|
55
|
+
): string =>
|
|
56
|
+
`${root}/${agent}/session-events/${sessionId}/${String(firstIndex).padStart(8, "0")}`,
|
|
57
|
+
sessionEventsPrefix: (agent: string, sessionId: string): string =>
|
|
58
|
+
`${root}/${agent}/session-events/${sessionId}/`,
|
|
59
|
+
/**
|
|
60
|
+
* One session-level hosted-execution log (v2 only). `sessionPublicId` is
|
|
61
|
+
* the factory `ses_…` so a throw that never minted a July session still
|
|
62
|
+
* lands under a stable key. Per-execution rows live inside the document.
|
|
63
|
+
*/
|
|
64
|
+
sessionRun: (agent: string, sessionPublicId: string): string =>
|
|
65
|
+
`${root}/${agent}/session-runs/${keySegment(sessionPublicId)}`,
|
|
66
|
+
sessionRunsPrefix: (agent: string): string =>
|
|
67
|
+
`${root}/${agent}/session-runs/`,
|
|
68
|
+
/**
|
|
69
|
+
* The v2 customer log: the engine stdout/stderr tee (on-disk `start.log`).
|
|
70
|
+
* `logId` is the factory `ses_…` after a `send`, or
|
|
71
|
+
* `wf:{workflowId}` / `wf:{workflowId}/{runId}` when admission fails
|
|
72
|
+
* before a session exists. Skip/task admissions do not write this key.
|
|
73
|
+
* Stored as raw UTF-8, not JSON — the file store accepts 64 MiB
|
|
74
|
+
* objects, and this key is flushed in snapshots, not per line.
|
|
75
|
+
*/
|
|
76
|
+
log: (agent: string, logId: string): string =>
|
|
77
|
+
`${root}/${agent}/logs/${keySegment(logId)}`,
|
|
78
|
+
logsPrefix: (agent: string): string => `${root}/${agent}/logs/`,
|
|
79
|
+
continuation: (
|
|
80
|
+
agent: string,
|
|
81
|
+
channelId: string,
|
|
82
|
+
continuationKey: string
|
|
83
|
+
): string =>
|
|
84
|
+
`${root}/${agent}/continuation/${keySegment(channelId)}/${keySegment(continuationKey)}`,
|
|
85
|
+
/**
|
|
86
|
+
* Author-facing opaque JSON (see `HostContext.kv`). `key` is URI-encoded /
|
|
87
|
+
* digested like other caller-controlled segments.
|
|
88
|
+
*/
|
|
89
|
+
kv: (agent: string, key: string): string =>
|
|
90
|
+
`${root}/${agent}/kv/${keySegment(key)}`,
|
|
91
|
+
kvPrefix: (agent: string): string => `${root}/${agent}/kv/`,
|
|
92
|
+
/** One playground eval-run snapshot (derived `evals` table). */
|
|
93
|
+
evalRun: (agent: string, runId: string): string =>
|
|
94
|
+
`${root}/${agent}/eval-runs/${keySegment(runId)}`,
|
|
95
|
+
evalRunsPrefix: (agent: string): string => `${root}/${agent}/eval-runs/`,
|
|
96
|
+
/**
|
|
97
|
+
* One A/B metric sample (derived `abs` table); the segments mirror the
|
|
98
|
+
* dedicated table's row identity (experiment + sessionId + at).
|
|
99
|
+
*/
|
|
100
|
+
abSample: (
|
|
101
|
+
agent: string,
|
|
102
|
+
experiment: string,
|
|
103
|
+
sessionId: string,
|
|
104
|
+
at: string
|
|
105
|
+
): string =>
|
|
106
|
+
`${root}/${agent}/ab-samples/${keySegment(experiment)}/${keySegment(sessionId)}/${keySegment(at)}`,
|
|
107
|
+
/** Latest aggregate A/B snapshot (derived `abs` table, LWW). */
|
|
108
|
+
abSnapshot: (agent: string): string => `${root}/${agent}/ab-snapshot`,
|
|
109
|
+
} as const;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export type StorageKeys = ReturnType<typeof createStorageKeys>;
|
|
113
|
+
|
|
114
|
+
/** Architecture-v1 keys. Kept stable for existing deployments. */
|
|
115
|
+
export const storageKeys: StorageKeys = createStorageKeys(STORAGE_KEY_ROOT);
|
|
116
|
+
|
|
117
|
+
/** Architecture-v2 keys. Hard cutoff onto {@link AGENTSDK_STORAGE_KEY_ROOT}. */
|
|
118
|
+
export const agentSdkStorageKeys: StorageKeys = createStorageKeys(
|
|
119
|
+
AGENTSDK_STORAGE_KEY_ROOT
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
export function storageKeysForArchitecture(
|
|
123
|
+
architecture: "v1" | "v2" | undefined
|
|
124
|
+
): StorageKeys {
|
|
125
|
+
return architecture === "v2" ? agentSdkStorageKeys : storageKeys;
|
|
126
|
+
}
|
|
105
127
|
|
|
106
128
|
/**
|
|
107
129
|
* Max bytes a caller-controlled key segment may occupy after URI-encoding.
|
|
@@ -111,6 +133,31 @@ export const storageKeys = {
|
|
|
111
133
|
*/
|
|
112
134
|
export const MAX_KEY_SEGMENT_BYTES = 256;
|
|
113
135
|
|
|
136
|
+
/**
|
|
137
|
+
* Stable start-log object id. A `send` attaches to the factory session
|
|
138
|
+
* so the factory/dashboard session-runs read can see it. Admission that
|
|
139
|
+
* fails before a session exists is keyed on the Temporal workflow run
|
|
140
|
+
* (`wf:{workflowId}` or `wf:{workflowId}/{runId}`) so the object joins
|
|
141
|
+
* the Temporal UI. A successful skip/task writes nothing — there is no
|
|
142
|
+
* customer log.
|
|
143
|
+
*/
|
|
144
|
+
export function frameworkStartLogId(args: {
|
|
145
|
+
sessionPublicId?: string | null;
|
|
146
|
+
workflowId?: string | null;
|
|
147
|
+
runId?: string | null;
|
|
148
|
+
}): string | undefined {
|
|
149
|
+
const sessionPublicId = args.sessionPublicId?.trim() ?? "";
|
|
150
|
+
if (sessionPublicId.length > 0) {
|
|
151
|
+
return sessionPublicId;
|
|
152
|
+
}
|
|
153
|
+
const workflowId = args.workflowId?.trim() ?? "";
|
|
154
|
+
if (workflowId.length === 0) {
|
|
155
|
+
return undefined;
|
|
156
|
+
}
|
|
157
|
+
const runId = args.runId?.trim() ?? "";
|
|
158
|
+
return runId.length > 0 ? `wf:${workflowId}/${runId}` : `wf:${workflowId}`;
|
|
159
|
+
}
|
|
160
|
+
|
|
114
161
|
/**
|
|
115
162
|
* URI-encode one caller-controlled key segment, substituting a `sha256:…`
|
|
116
163
|
* digest of the raw value when the encoding exceeds
|
|
@@ -127,7 +174,7 @@ export function keySegment(raw: string): string {
|
|
|
127
174
|
|
|
128
175
|
export function isDurableSessionRecordKey(key: string): boolean {
|
|
129
176
|
const match = DURABLE_SESSION_RECORD_KEY_RE.exec(key);
|
|
130
|
-
return match !== null && match[
|
|
177
|
+
return match !== null && match[2] !== "_cp";
|
|
131
178
|
}
|
|
132
179
|
|
|
133
180
|
/** List fields of a persisted `SessionRecord`. Unknown properties are dropped. */
|
package/src/storage.ts
CHANGED
|
@@ -61,8 +61,12 @@ import type { JsonValue, KvCasResult, KvVersionedEntry } from "./types.js";
|
|
|
61
61
|
export type {
|
|
62
62
|
DurableSessionRecord,
|
|
63
63
|
DurableSessionSummary,
|
|
64
|
+
StorageKeys,
|
|
64
65
|
} from "./storage-protocol.js";
|
|
65
66
|
export {
|
|
67
|
+
AGENTSDK_STORAGE_KEY_ROOT,
|
|
68
|
+
agentSdkStorageKeys,
|
|
69
|
+
frameworkStartLogId,
|
|
66
70
|
GOLDEN_DURABLE_SESSION_RECORD,
|
|
67
71
|
isDurableSessionRecordKey,
|
|
68
72
|
keySegment,
|
|
@@ -70,6 +74,7 @@ export {
|
|
|
70
74
|
parseDurableSessionRecord,
|
|
71
75
|
STORAGE_KEY_ROOT,
|
|
72
76
|
storageKeys,
|
|
77
|
+
storageKeysForArchitecture,
|
|
73
78
|
summarizeDurableSessionRecord,
|
|
74
79
|
} from "./storage-protocol.js";
|
|
75
80
|
|
package/src/tools.ts
CHANGED
|
@@ -53,7 +53,13 @@
|
|
|
53
53
|
*/
|
|
54
54
|
|
|
55
55
|
import type { z } from "zod";
|
|
56
|
+
import {
|
|
57
|
+
forwardTimeArgument,
|
|
58
|
+
missingTimeWindow,
|
|
59
|
+
schemaTimeWindowKeys,
|
|
60
|
+
} from "./internal/as-of.js";
|
|
56
61
|
import { brandDefinition } from "./internal/brand.js";
|
|
62
|
+
import { classifyAnnotationsEffect } from "./internal/tool-policy.js";
|
|
57
63
|
import type {
|
|
58
64
|
JsonObject,
|
|
59
65
|
JsonSchemaObject,
|
|
@@ -78,6 +84,18 @@ export type {
|
|
|
78
84
|
ToolNeedsApproval,
|
|
79
85
|
ToolResultContent,
|
|
80
86
|
} from "./types.js";
|
|
87
|
+
/**
|
|
88
|
+
* Time-window and effect classifiers the host applies to every tool call.
|
|
89
|
+
* Re-exported for tools that reach other tools themselves (change-monitor
|
|
90
|
+
* `script`): inner calls skip the host gate, so the sandbox applies the same
|
|
91
|
+
* forward-time, omitted-window, and read-only filters.
|
|
92
|
+
*/
|
|
93
|
+
export {
|
|
94
|
+
classifyAnnotationsEffect,
|
|
95
|
+
forwardTimeArgument,
|
|
96
|
+
missingTimeWindow,
|
|
97
|
+
schemaTimeWindowKeys,
|
|
98
|
+
};
|
|
81
99
|
|
|
82
100
|
/** Input type for `execute`: inferred from a zod schema, JSON otherwise. */
|
|
83
101
|
export type ToolInput<TSchema> = TSchema extends z.ZodTypeAny
|
package/src/types.ts
CHANGED
|
@@ -50,6 +50,9 @@ export type DefinitionKind =
|
|
|
50
50
|
| "instructions"
|
|
51
51
|
| "tool"
|
|
52
52
|
| "skill"
|
|
53
|
+
| "extension"
|
|
54
|
+
| "disabled-tool"
|
|
55
|
+
| "disabled-connection"
|
|
53
56
|
| "connection"
|
|
54
57
|
| "channel"
|
|
55
58
|
| "http-channel"
|
|
@@ -882,6 +885,13 @@ export interface ToolContext {
|
|
|
882
885
|
emit?: (payload: SessionEventPayload) => void;
|
|
883
886
|
/** The session's frozen `asOf`, or the wall clock. Use instead of `Date.now()`. */
|
|
884
887
|
now(): Date;
|
|
888
|
+
/**
|
|
889
|
+
* The session's frozen instant (ISO-8601), when it has one. Present exactly
|
|
890
|
+
* when this is an `asOf` session. A tool that reaches other tools itself —
|
|
891
|
+
* the script sandbox — reads it to apply the same forward-time guard to the
|
|
892
|
+
* calls it makes, which do not pass back through the host's gate.
|
|
893
|
+
*/
|
|
894
|
+
asOf?: string;
|
|
885
895
|
}
|
|
886
896
|
|
|
887
897
|
/**
|
|
@@ -952,6 +962,42 @@ export function normalizeConnectionEffects(
|
|
|
952
962
|
return unique;
|
|
953
963
|
}
|
|
954
964
|
|
|
965
|
+
/**
|
|
966
|
+
* Trim, drop blanks, and unique-preserve authored
|
|
967
|
+
* {@link ConnectionConfig.tools} name lists. Invalid shapes are left
|
|
968
|
+
* for discovery.
|
|
969
|
+
*/
|
|
970
|
+
export function normalizeConnectionTools(tools: readonly string[]): string[] {
|
|
971
|
+
const unique: string[] = [];
|
|
972
|
+
const seen = new Set<string>();
|
|
973
|
+
for (const raw of tools) {
|
|
974
|
+
const name = raw.trim();
|
|
975
|
+
if (name === "" || seen.has(name)) {
|
|
976
|
+
continue;
|
|
977
|
+
}
|
|
978
|
+
seen.add(name);
|
|
979
|
+
unique.push(name);
|
|
980
|
+
}
|
|
981
|
+
return unique;
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
/** True when `toolName` passes the connection's `tools` / `disallowedTools` filter. */
|
|
985
|
+
export function connectionAllowsTool(
|
|
986
|
+
filter: {
|
|
987
|
+
tools?: readonly string[];
|
|
988
|
+
disallowedTools?: readonly string[];
|
|
989
|
+
},
|
|
990
|
+
toolName: string
|
|
991
|
+
): boolean {
|
|
992
|
+
if (filter.tools !== undefined && !filter.tools.includes(toolName)) {
|
|
993
|
+
return false;
|
|
994
|
+
}
|
|
995
|
+
return (
|
|
996
|
+
filter.disallowedTools === undefined ||
|
|
997
|
+
!filter.disallowedTools.includes(toolName)
|
|
998
|
+
);
|
|
999
|
+
}
|
|
1000
|
+
|
|
955
1001
|
/**
|
|
956
1002
|
* A tool's declared {@link ToolEffect} — fixed, or decided per call from
|
|
957
1003
|
* validated input for tools that read or write depending on their arguments
|
|
@@ -1065,6 +1111,99 @@ export interface SkillConfig {
|
|
|
1065
1111
|
|
|
1066
1112
|
export type SkillDefinition = SkillConfig & BrandedDefinition<"skill">;
|
|
1067
1113
|
|
|
1114
|
+
// ============================================================================
|
|
1115
|
+
// Extensions (agent/extensions/<ns>.ts | agent/extensions/<ns>/extension.ts)
|
|
1116
|
+
// ============================================================================
|
|
1117
|
+
|
|
1118
|
+
/**
|
|
1119
|
+
* Input to `defineExtension`, the `extension.ts` at the root of an
|
|
1120
|
+
* agent-shaped tree (`tools/`, `skills/`, `lib/`).
|
|
1121
|
+
*/
|
|
1122
|
+
export interface ExtensionOptions<TConfig, TInput = TConfig> {
|
|
1123
|
+
/** The tree's directory; pass `import.meta.dirname`. */
|
|
1124
|
+
root: string;
|
|
1125
|
+
/** What the extension adds; shown by `info`. */
|
|
1126
|
+
description?: string;
|
|
1127
|
+
/** Mount configuration schema. A consumer's settings are validated at mount. */
|
|
1128
|
+
config?: z.ZodType<TConfig, z.ZodTypeDef, TInput>;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* What `extension.ts` default-exports. A consumer calls it from
|
|
1133
|
+
* `agent/extensions/<ns>.ts` to mount the extension with a configuration;
|
|
1134
|
+
* the extension's own modules import it to read that configuration.
|
|
1135
|
+
*/
|
|
1136
|
+
export interface Extension<TConfig = undefined, TInput = TConfig>
|
|
1137
|
+
extends ExtensionDeclaration {
|
|
1138
|
+
(
|
|
1139
|
+
...args: undefined extends TInput ? [config?: TInput] : [config: TInput]
|
|
1140
|
+
): ExtensionMount;
|
|
1141
|
+
/** The mounted configuration (schema defaults applied); throws before the mount. */
|
|
1142
|
+
readonly config: TConfig;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
/** The mount-independent part of an {@link Extension}: an agent-shaped tree. */
|
|
1146
|
+
export interface ExtensionDeclaration {
|
|
1147
|
+
readonly root: string;
|
|
1148
|
+
readonly description: string | undefined;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
/** A Cursor plugin directory declared by `cursorPlugin`. */
|
|
1152
|
+
export interface CursorPluginDeclaration extends ExtensionDeclaration {
|
|
1153
|
+
readonly layout: "cursor-plugin";
|
|
1154
|
+
readonly variables: Record<string, string>;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
/** What `agent/extensions/<ns>.ts` default-exports. */
|
|
1158
|
+
export interface ExtensionMount extends BrandedDefinition<"extension"> {
|
|
1159
|
+
readonly extension: ExtensionDeclaration | CursorPluginDeclaration;
|
|
1160
|
+
readonly config: unknown;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
/** `cursorPlugin({ ... })`: mount a Cursor plugin directory as an extension. */
|
|
1164
|
+
export interface CursorPluginOptions {
|
|
1165
|
+
/**
|
|
1166
|
+
* The plugin directory: the one holding `.cursor-plugin/plugin.json`
|
|
1167
|
+
* (or `.claude-plugin/plugin.json` / `plugin.json`). A relative path
|
|
1168
|
+
* resolves against the project root.
|
|
1169
|
+
*/
|
|
1170
|
+
path: string;
|
|
1171
|
+
/**
|
|
1172
|
+
* Values for the `${NAME}` placeholders in the plugin's MCP config, the
|
|
1173
|
+
* variables a Cursor install prompts for. Names the mount omits fall back
|
|
1174
|
+
* to `process.env`; a placeholder nothing resolves fails discovery.
|
|
1175
|
+
*/
|
|
1176
|
+
variables?: Record<string, string>;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
/**
|
|
1180
|
+
* `export default disableTool()` in a directory mount's `tools/<name>.ts`
|
|
1181
|
+
* removes the extension's `<ns>__<name>`.
|
|
1182
|
+
*/
|
|
1183
|
+
export type DisabledToolDefinition = BrandedDefinition<"disabled-tool">;
|
|
1184
|
+
|
|
1185
|
+
/**
|
|
1186
|
+
* `export default disableConnection()` in a directory mount's
|
|
1187
|
+
* `mcp-connections/<server>.ts` removes the extension's `<ns>__<server>`.
|
|
1188
|
+
*/
|
|
1189
|
+
export type DisabledConnectionDefinition =
|
|
1190
|
+
BrandedDefinition<"disabled-connection">;
|
|
1191
|
+
|
|
1192
|
+
/** One mounted extension and the names it contributed. */
|
|
1193
|
+
export interface DiscoveredExtension {
|
|
1194
|
+
/** Mount namespace: the filename stem or directory name under `agent/extensions/`. */
|
|
1195
|
+
name: string;
|
|
1196
|
+
description?: string;
|
|
1197
|
+
/** Composed tool names (`<ns>__<name>`), overrides applied. */
|
|
1198
|
+
tools: string[];
|
|
1199
|
+
/** Composed skill names (`<ns>__<name>`), overrides applied. */
|
|
1200
|
+
skills: string[];
|
|
1201
|
+
/** Composed MCP connection names (`<ns>__<server>`); Cursor plugin mounts. */
|
|
1202
|
+
connections: string[];
|
|
1203
|
+
/** Composed subagent names (`<ns>__<agent>`); Cursor plugin mounts. */
|
|
1204
|
+
subagents: string[];
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1068
1207
|
// ============================================================================
|
|
1069
1208
|
// MCP connections (agent/mcp-connections/*.ts)
|
|
1070
1209
|
// ============================================================================
|
|
@@ -1213,19 +1352,38 @@ export type InlineStdioConnectionConfig = {
|
|
|
1213
1352
|
* cloud VM.
|
|
1214
1353
|
*/
|
|
1215
1354
|
export type ConnectionConfig = (
|
|
1216
|
-
|
|
|
1217
|
-
|
|
1218
|
-
|
|
1355
|
+
| ((
|
|
1356
|
+
| Exclude<ConnectionTransport, { cursorAccount: true }>
|
|
1357
|
+
| {
|
|
1358
|
+
cursorAccount: true;
|
|
1359
|
+
/**
|
|
1360
|
+
* Which account connectors to expose.
|
|
1361
|
+
*
|
|
1362
|
+
* - Omit, pass `"*"`, or pass `["*"]` to forward **every** connected
|
|
1363
|
+
* HTTP/SSE server on the account (no per-connector allowlist).
|
|
1364
|
+
* - Pass connector names as they appear in the Cursor account's MCP
|
|
1365
|
+
* config (e.g. `["Linear", "Notion"]`) to restrict the set.
|
|
1366
|
+
*/
|
|
1367
|
+
servers?: string[] | "*";
|
|
1368
|
+
}
|
|
1369
|
+
) & {
|
|
1219
1370
|
/**
|
|
1220
|
-
*
|
|
1371
|
+
* Tool-name allowlist. Same shape as {@link AgentConfig.tools}:
|
|
1372
|
+
* when set, only these MCP tool names (the server's `tools/list`
|
|
1373
|
+
* names) are advertised and callable through `host.mcp`. Names
|
|
1374
|
+
* the server does not list are omitted, not guessed.
|
|
1375
|
+
*
|
|
1376
|
+
* A list of names is an allowlist. An object of handlers authors
|
|
1377
|
+
* TypeScript tools ({@link InlineStdioConnectionConfig}).
|
|
1378
|
+
*
|
|
1379
|
+
* On a model-visible connection this requires {@link advertiseTools}:
|
|
1380
|
+
* an attached server would still expose every tool. On
|
|
1381
|
+
* `host-connections/` it restricts `host.mcp` alone.
|
|
1221
1382
|
*
|
|
1222
|
-
*
|
|
1223
|
-
* HTTP/SSE server on the account (no per-connector allowlist).
|
|
1224
|
-
* - Pass connector names as they appear in the Cursor account's MCP
|
|
1225
|
-
* config (e.g. `["Linear", "Notion"]`) to restrict the set.
|
|
1383
|
+
* Combines with {@link disallowedTools} as deny-wins.
|
|
1226
1384
|
*/
|
|
1227
|
-
|
|
1228
|
-
}
|
|
1385
|
+
tools?: readonly string[];
|
|
1386
|
+
})
|
|
1229
1387
|
| InlineStdioConnectionConfig
|
|
1230
1388
|
) & {
|
|
1231
1389
|
/** Documentation only; shown in `info` output. */
|
|
@@ -1300,6 +1458,16 @@ export type ConnectionConfig = (
|
|
|
1300
1458
|
* are the same.
|
|
1301
1459
|
*/
|
|
1302
1460
|
effects?: ConnectionEffects;
|
|
1461
|
+
/**
|
|
1462
|
+
* Tool-name denylist. Same shape as the Cursor SDK's
|
|
1463
|
+
* `disallowedTools`: when set, these MCP tool names are omitted from
|
|
1464
|
+
* the advertised set and rejected on `host.mcp`. Combines with
|
|
1465
|
+
* {@link ConnectionConfig.tools} as deny-wins.
|
|
1466
|
+
*
|
|
1467
|
+
* On a model-visible connection this requires {@link advertiseTools}.
|
|
1468
|
+
* On `host-connections/` it restricts `host.mcp` alone.
|
|
1469
|
+
*/
|
|
1470
|
+
disallowedTools?: readonly string[];
|
|
1303
1471
|
};
|
|
1304
1472
|
|
|
1305
1473
|
/**
|
|
@@ -1322,7 +1490,11 @@ export function isInlineStdioConnection(
|
|
|
1322
1490
|
): connection is InlineStdioConnectionConfig & {
|
|
1323
1491
|
description?: string;
|
|
1324
1492
|
} {
|
|
1325
|
-
return
|
|
1493
|
+
return (
|
|
1494
|
+
"tools" in connection &&
|
|
1495
|
+
connection.tools !== undefined &&
|
|
1496
|
+
!Array.isArray(connection.tools)
|
|
1497
|
+
);
|
|
1326
1498
|
}
|
|
1327
1499
|
|
|
1328
1500
|
/**
|
|
@@ -1873,9 +2045,13 @@ export interface SendMessageOptions {
|
|
|
1873
2045
|
dryRun?: boolean;
|
|
1874
2046
|
/**
|
|
1875
2047
|
* ISO-8601 instant with a timezone, frozen at create: the prompt states
|
|
1876
|
-
* it, {@link ToolContext.now} returns it, and
|
|
1877
|
-
*
|
|
1878
|
-
*
|
|
2048
|
+
* it, {@link ToolContext.now} returns it, and every tool call is checked
|
|
2049
|
+
* against it — a relative time argument (`now-1h`), an absolute one after
|
|
2050
|
+
* the instant, or an omitted window a vendor schema declares is refused so
|
|
2051
|
+
* the model retries with explicit absolute bounds. Tools may also declare
|
|
2052
|
+
* {@link ToolConfig.timeArgs} for precise per-field checking. The check
|
|
2053
|
+
* reads arguments, not behavior: a tool that reads present state without a
|
|
2054
|
+
* time argument still answers from the present.
|
|
1879
2055
|
*/
|
|
1880
2056
|
asOf?: string;
|
|
1881
2057
|
/**
|
|
@@ -2791,6 +2967,8 @@ export interface DiscoveredTool {
|
|
|
2791
2967
|
advertised?: true;
|
|
2792
2968
|
/** Name of the advertising connection an advertised tool came from. */
|
|
2793
2969
|
connection?: string;
|
|
2970
|
+
/** Mounted extension this tool came from; absent for `agent/tools/`. */
|
|
2971
|
+
extension?: string;
|
|
2794
2972
|
/**
|
|
2795
2973
|
* Agent tools: script body materialized under
|
|
2796
2974
|
* `.agent-serve/tools/<name>.sh`.
|
|
@@ -2809,6 +2987,8 @@ export interface DiscoveredSkill {
|
|
|
2809
2987
|
markdown: string;
|
|
2810
2988
|
/** Package-relative sibling files. */
|
|
2811
2989
|
files: Record<string, SkillFileSource>;
|
|
2990
|
+
/** Mounted extension this skill came from; absent for `agent/skills/`. */
|
|
2991
|
+
extension?: string;
|
|
2812
2992
|
}
|
|
2813
2993
|
|
|
2814
2994
|
export interface DiscoveredConnection {
|
|
@@ -2824,6 +3004,16 @@ export interface DiscoveredConnection {
|
|
|
2824
3004
|
* Absent means every listed tool is advertised.
|
|
2825
3005
|
*/
|
|
2826
3006
|
effects?: readonly ToolEffect[];
|
|
3007
|
+
/**
|
|
3008
|
+
* Normalized tool-name allowlist from {@link ConnectionConfig.tools}.
|
|
3009
|
+
* Absent means every listed tool is kept.
|
|
3010
|
+
*/
|
|
3011
|
+
tools?: readonly string[];
|
|
3012
|
+
/**
|
|
3013
|
+
* Normalized tool-name denylist from
|
|
3014
|
+
* {@link ConnectionConfig.disallowedTools}.
|
|
3015
|
+
*/
|
|
3016
|
+
disallowedTools?: readonly string[];
|
|
2827
3017
|
}
|
|
2828
3018
|
|
|
2829
3019
|
export interface DiscoveredChannel {
|
|
@@ -2895,6 +3085,11 @@ export interface ResolvedAgent {
|
|
|
2895
3085
|
architecture?: AgentArchitecture;
|
|
2896
3086
|
tools: DiscoveredTool[];
|
|
2897
3087
|
skills: DiscoveredSkill[];
|
|
3088
|
+
/**
|
|
3089
|
+
* Mounted `agent/extensions/`. Their tools and skills are already merged
|
|
3090
|
+
* into {@link tools} and {@link skills}; this records provenance.
|
|
3091
|
+
*/
|
|
3092
|
+
extensions?: DiscoveredExtension[];
|
|
2898
3093
|
connections: DiscoveredConnection[];
|
|
2899
3094
|
/**
|
|
2900
3095
|
* MCP connections from `agent/host-connections/`. Host tools and
|
|
@@ -2977,11 +3172,15 @@ export interface AgentProjectInfo {
|
|
|
2977
3172
|
inputSchema: JsonSchemaObject;
|
|
2978
3173
|
}>;
|
|
2979
3174
|
skills: Array<{ name: string; description: string }>;
|
|
3175
|
+
/** Mounted extensions and the tool / skill names each contributed. */
|
|
3176
|
+
extensions: DiscoveredExtension[];
|
|
2980
3177
|
connections: Array<{
|
|
2981
3178
|
name: string;
|
|
2982
3179
|
transport: string;
|
|
2983
3180
|
advertiseTools?: boolean;
|
|
2984
3181
|
effects?: readonly ToolEffect[];
|
|
3182
|
+
tools?: readonly string[];
|
|
3183
|
+
disallowedTools?: readonly string[];
|
|
2985
3184
|
/**
|
|
2986
3185
|
* Present only for `cursorAccount` connections: the connector-name
|
|
2987
3186
|
* allowlist, or `"*"` for every connected server. Structured twin of the
|