@cursor/july 0.1.105 → 0.1.108
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 +10 -5
- package/dist/bin/agent-serve.js +31 -16
- package/dist/channels/bitbucket/types.d.ts +2 -4
- package/dist/channels/bitbucket/types.d.ts.map +1 -1
- package/dist/channels/deployments/types.d.ts +5 -8
- package/dist/channels/deployments/types.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +8 -5
- package/dist/channels/github/types.d.ts +7 -5
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/gitlab/types.d.ts +2 -5
- package/dist/channels/gitlab/types.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +27 -13
- package/dist/channels/origin/types.d.ts +7 -4
- package/dist/channels/origin/types.d.ts.map +1 -1
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +3 -0
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +1 -1
- package/dist/channels/slack/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +48 -11
- package/dist/channels/slack/types.d.ts +4 -3
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/channels.d.ts +45 -0
- package/dist/channels.d.ts.map +1 -1
- package/dist/channels.js +106 -7
- package/dist/connections.d.ts +2 -1
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +2 -1
- package/dist/docs/404.html +3 -3
- package/dist/docs/ab.html +6 -6
- package/dist/docs/assets/{app.BVwaffdK.js → app.BASKM3M4.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.BHZYsNVi.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.WuWTZ1x8.js → VPLocalSearchBox.BOKxlYGP.js} +2 -2
- package/dist/docs/assets/chunks/{theme.BYdI_6sF.js → theme.DbDZW-zb.js} +2 -2
- package/dist/docs/assets/{deployment.md.MFPKqsqI.js → deployment.md.JenwuCCB.js} +4 -4
- package/dist/docs/assets/{deployment.md.MFPKqsqI.lean.js → deployment.md.JenwuCCB.lean.js} +1 -1
- package/dist/docs/assets/{evals.md.CbMoebP1.js → evals.md.C1ekS3k2.js} +1 -1
- package/dist/docs/assets/guides_cloud-agents.md.BsloyHdY.js +9 -0
- package/dist/docs/assets/{guides_cloud-agents.md.DS8RIjwx.lean.js → guides_cloud-agents.md.BsloyHdY.lean.js} +1 -1
- package/dist/docs/assets/{guides_github.md.c0gdGJ-D.js → guides_github.md.BH33UEBJ.js} +1 -1
- package/dist/docs/assets/{guides_grokbot-agents.md.DVqdhBKb.js → guides_grokbot-agents.md.DyV-WArv.js} +1 -1
- package/dist/docs/assets/guides_improve.md.BGVk32bK.js +14 -0
- package/dist/docs/assets/guides_improve.md.BGVk32bK.lean.js +1 -0
- package/dist/docs/assets/{guides_opentelemetry.md.COh9jFVg.js → guides_opentelemetry.md.SCRMskno.js} +3 -3
- package/dist/docs/assets/{guides_opentelemetry.md.COh9jFVg.lean.js → guides_opentelemetry.md.SCRMskno.lean.js} +1 -1
- package/dist/docs/assets/{guides_slack.md.9oHPye9o.js → guides_slack.md.D4RVMM4G.js} +3 -3
- package/dist/docs/assets/{guides_slack.md.9oHPye9o.lean.js → guides_slack.md.D4RVMM4G.lean.js} +1 -1
- package/dist/docs/assets/index.md.BjH1w2ZW.js +5 -0
- package/dist/docs/assets/{reference_agent-config.md.CHNpiyp4.js → reference_agent-config.md.CvoL6pof.js} +1 -1
- package/dist/docs/assets/{reference_channels.md.DBGcaB7m.js → reference_channels.md.D-qTqwcq.js} +2 -2
- package/dist/docs/assets/{reference_channels.md.DBGcaB7m.lean.js → reference_channels.md.D-qTqwcq.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.C6Lo8SEd.js → reference_cli.md.Ca26u0Es.js} +6 -6
- package/dist/docs/assets/{reference_cli.md.C6Lo8SEd.lean.js → reference_cli.md.Ca26u0Es.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.Di6jJAXF.js → reference_connections.md.BojkC6c5.js} +1 -1
- package/dist/docs/assets/{reference_extensions.md.CGmMLblt.js → reference_extensions.md.CPWt00ds.js} +1 -1
- package/dist/docs/assets/{scaffolding-agents.md.em43xlY1.js → scaffolding-agents.md.Kctn3OVb.js} +1 -1
- package/dist/docs/assets/{skills_create-agent.md.BVoWPcan.js → skills_create-agent.md.Q3h6Je-e.js} +1 -1
- package/dist/docs/assets/{skills_debug.md.CDbPhHfg.js → skills_debug.md.CVjCXMFF.js} +1 -1
- package/dist/docs/assets/{skills_debug.md.CDbPhHfg.lean.js → skills_debug.md.CVjCXMFF.lean.js} +1 -1
- package/dist/docs/assets/{skills_evals.md.723kpUmA.js → skills_evals.md.BhovOvrl.js} +1 -1
- package/dist/docs/assets/skills_framework-map.md.D-tFZhFS.js +1 -0
- package/dist/docs/assets/{skills_framework-map.md.haibFyoB.lean.js → skills_framework-map.md.D-tFZhFS.lean.js} +1 -1
- package/dist/docs/assets/{skills_github.md.D0JahM8c.js → skills_github.md.hgFX_oKY.js} +1 -1
- package/dist/docs/assets/{skills_otel.md.CqhobH3B.js → skills_otel.md.B5Ddv1xH.js} +1 -1
- package/dist/docs/assets/{style.BRuM8477.css → style.DCD_zyg3.css} +1 -1
- package/dist/docs/assets/troubleshooting.md.CYEAO9bM.js +1 -0
- package/dist/docs/building-with-agents.html +6 -6
- package/dist/docs/concepts.html +5 -5
- package/dist/docs/deployment.html +9 -9
- package/dist/docs/deployment.md +7 -2
- package/dist/docs/evals.html +8 -8
- package/dist/docs/evals.md +3 -2
- package/dist/docs/guides/agent-to-agent.html +6 -6
- package/dist/docs/guides/cloud-agents.html +7 -7
- package/dist/docs/guides/cloud-agents.md +4 -3
- package/dist/docs/guides/convert-automation.html +6 -6
- package/dist/docs/guides/github.html +7 -7
- package/dist/docs/guides/github.md +2 -1
- package/dist/docs/guides/grokbot-agents.html +7 -7
- package/dist/docs/guides/grokbot-agents.md +2 -2
- package/dist/docs/guides/human-in-the-loop.html +6 -6
- package/dist/docs/guides/improve.html +40 -0
- package/dist/docs/guides/improve.md +91 -0
- package/dist/docs/guides/mcp-oauth.html +6 -6
- package/dist/docs/guides/opentelemetry.html +8 -8
- package/dist/docs/guides/opentelemetry.md +3 -4
- package/dist/docs/guides/slack.html +8 -8
- package/dist/docs/guides/slack.md +2 -1
- package/dist/docs/guides/webhooks.html +6 -6
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +6 -6
- package/dist/docs/index.html +8 -8
- package/dist/docs/index.md +4 -0
- package/dist/docs/llms-full.txt +180 -61
- package/dist/docs/llms.txt +1 -0
- package/dist/docs/quickstart.html +6 -6
- package/dist/docs/reference/agent-config.html +7 -7
- package/dist/docs/reference/agent-config.md +5 -2
- package/dist/docs/reference/artifacts.html +6 -6
- package/dist/docs/reference/channels.html +7 -7
- package/dist/docs/reference/channels.md +11 -19
- package/dist/docs/reference/cli.html +11 -11
- package/dist/docs/reference/cli.md +23 -13
- package/dist/docs/reference/connections.html +8 -8
- package/dist/docs/reference/connections.md +2 -1
- package/dist/docs/reference/extensions.html +7 -7
- package/dist/docs/reference/extensions.md +2 -0
- package/dist/docs/reference/hooks.html +6 -6
- package/dist/docs/reference/http-api.html +6 -6
- package/dist/docs/reference/instructions.html +6 -6
- package/dist/docs/reference/playground.html +5 -5
- package/dist/docs/reference/project-layout.html +6 -6
- package/dist/docs/reference/prompt.html +6 -6
- package/dist/docs/reference/result.html +6 -6
- package/dist/docs/reference/schedules.html +6 -6
- package/dist/docs/reference/sessions.html +5 -5
- package/dist/docs/reference/skills.html +6 -6
- package/dist/docs/reference/subagents.html +6 -6
- package/dist/docs/reference/tools.html +6 -6
- package/dist/docs/scaffolding-agents.html +6 -6
- package/dist/docs/scaffolding-agents.md +2 -1
- package/dist/docs/skills/ab.html +6 -6
- package/dist/docs/skills/create-agent.html +8 -8
- package/dist/docs/skills/create-agent.md +1 -1
- package/dist/docs/skills/debug.html +6 -6
- package/dist/docs/skills/debug.md +1 -1
- package/dist/docs/skills/evals.html +8 -8
- package/dist/docs/skills/evals.md +1 -1
- package/dist/docs/skills/framework-map.html +6 -6
- package/dist/docs/skills/framework-map.md +4 -2
- package/dist/docs/skills/github.html +8 -8
- package/dist/docs/skills/github.md +1 -1
- package/dist/docs/skills/hillclimb.html +6 -6
- package/dist/docs/skills/index.html +5 -5
- package/dist/docs/skills/mcp-auth.html +6 -6
- package/dist/docs/skills/otel.html +8 -8
- package/dist/docs/skills/otel.md +3 -3
- package/dist/docs/skills/setup-slack.html +6 -6
- package/dist/docs/storage.html +6 -6
- package/dist/docs/templates/agentic-owners.html +6 -6
- package/dist/docs/templates/agents-md.html +6 -6
- package/dist/docs/templates/code-wiki.html +6 -6
- package/dist/docs/templates/demo.html +6 -6
- package/dist/docs/templates/grokbot-agents.html +6 -6
- package/dist/docs/templates/pr-autofixer.html +6 -6
- package/dist/docs/templates/security-help.html +6 -6
- package/dist/docs/templates/security-reviewer.html +6 -6
- package/dist/docs/templates/triage.html +6 -6
- package/dist/docs/troubleshooting.html +6 -6
- package/dist/docs/troubleshooting.md +1 -1
- package/dist/extensions/improve/extension.d.ts +46 -0
- package/dist/extensions/improve/extension.d.ts.map +1 -0
- package/dist/extensions/improve/extension.js +41 -0
- package/dist/extensions/improve/skills/yourself.d.ts +4 -0
- package/dist/extensions/improve/skills/yourself.d.ts.map +1 -0
- package/dist/extensions/improve/skills/yourself.js +43 -0
- package/dist/index.d.ts +4 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -4
- package/dist/internal/builtin-tools/artifacts.d.ts.map +1 -1
- package/dist/internal/builtin-tools/artifacts.js +2 -3
- package/dist/internal/channel-route-dispatch.d.ts +13 -0
- package/dist/internal/channel-route-dispatch.d.ts.map +1 -0
- package/dist/internal/channel-route-dispatch.js +62 -0
- package/dist/internal/channel-state.d.ts +17 -0
- package/dist/internal/channel-state.d.ts.map +1 -0
- package/dist/internal/channel-state.js +78 -0
- package/dist/internal/cli-ax.d.ts +7 -0
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +99 -1
- package/dist/internal/cli-cursor.d.ts.map +1 -1
- package/dist/internal/cli-cursor.js +2 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +61 -25
- package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
- package/dist/internal/cli-mcp-oauth.js +15 -0
- package/dist/internal/cli-mcp.d.ts.map +1 -1
- package/dist/internal/cli-mcp.js +12 -0
- package/dist/internal/cli-slack.d.ts.map +1 -1
- package/dist/internal/cli-slack.js +8 -2
- package/dist/internal/cursor/backend-client.d.ts +25 -0
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +57 -2
- package/dist/internal/cursor/credentials.d.ts +8 -2
- package/dist/internal/cursor/credentials.d.ts.map +1 -1
- package/dist/internal/cursor/credentials.js +27 -5
- package/dist/internal/deploy-client.d.ts +35 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +46 -0
- package/dist/internal/deploy-manifest.d.ts +26 -0
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +99 -13
- package/dist/internal/describe-error.d.ts +1 -0
- package/dist/internal/describe-error.d.ts.map +1 -1
- package/dist/internal/describe-error.js +25 -0
- package/dist/internal/discovery/agent.d.ts.map +1 -1
- package/dist/internal/discovery/agent.js +1 -0
- package/dist/internal/discovery/info.d.ts.map +1 -1
- package/dist/internal/discovery/info.js +7 -3
- package/dist/internal/discovery/modules.d.ts +1 -1
- package/dist/internal/discovery/modules.d.ts.map +1 -1
- package/dist/internal/discovery/modules.js +1 -0
- package/dist/internal/discovery/project.d.ts.map +1 -1
- package/dist/internal/discovery/project.js +3 -0
- package/dist/internal/discovery/reminders.d.ts +7 -0
- package/dist/internal/discovery/reminders.d.ts.map +1 -0
- package/dist/internal/discovery/reminders.js +65 -0
- package/dist/internal/discovery/subagent.js +1 -0
- package/dist/internal/distribution.d.ts +5 -0
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +17 -0
- package/dist/internal/framework-storage-selection.d.ts +14 -3
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +36 -6
- package/dist/internal/guest-network.d.ts +4 -10
- package/dist/internal/guest-network.d.ts.map +1 -1
- package/dist/internal/guest-network.js +44 -26
- package/dist/internal/hosted-admission-adapter.d.ts +2 -0
- package/dist/internal/hosted-admission-adapter.d.ts.map +1 -1
- package/dist/internal/hosted-catch-protocol.d.ts +51 -0
- package/dist/internal/hosted-catch-protocol.d.ts.map +1 -0
- package/dist/internal/hosted-catch-protocol.js +103 -0
- package/dist/internal/hosted-catch.d.ts +40 -0
- package/dist/internal/hosted-catch.d.ts.map +1 -0
- package/dist/internal/hosted-catch.js +149 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +89 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +309 -0
- package/dist/internal/hosted-delivery.d.ts +20 -1
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +179 -36
- package/dist/internal/hosted-execution-diag.d.ts +4 -1
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
- package/dist/internal/hosted-execution-diag.js +13 -4
- package/dist/internal/hosted-execution-flush.d.ts +3 -0
- package/dist/internal/hosted-execution-flush.d.ts.map +1 -1
- package/dist/internal/hosted-execution-flush.js +2 -4
- package/dist/internal/http-control-plane-session.d.ts +30 -0
- package/dist/internal/http-control-plane-session.d.ts.map +1 -0
- package/dist/internal/http-control-plane-session.js +83 -0
- package/dist/internal/legacy-command-guard.d.ts +22 -0
- package/dist/internal/legacy-command-guard.d.ts.map +1 -0
- package/dist/internal/legacy-command-guard.js +51 -0
- package/dist/internal/local-control-plane.d.ts +18 -2
- package/dist/internal/local-control-plane.d.ts.map +1 -1
- package/dist/internal/local-control-plane.js +199 -17
- package/dist/internal/platform-timers.d.ts +7 -0
- package/dist/internal/platform-timers.d.ts.map +1 -1
- package/dist/internal/platform-timers.js +139 -0
- package/dist/internal/reminder-control-plane-protocol.d.ts +189 -0
- package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -0
- package/dist/internal/reminder-control-plane-protocol.js +251 -0
- package/dist/internal/reminder-runner.d.ts +56 -6
- package/dist/internal/reminder-runner.d.ts.map +1 -1
- package/dist/internal/reminder-runner.js +372 -57
- package/dist/internal/reminder-schedule.d.ts +5 -2
- package/dist/internal/reminder-schedule.d.ts.map +1 -1
- package/dist/internal/reminder-schedule.js +8 -6
- package/dist/internal/reminder-store.d.ts +24 -7
- package/dist/internal/reminder-store.d.ts.map +1 -1
- package/dist/internal/reminder-store.js +6 -5
- package/dist/internal/request-error-status.d.ts +2 -0
- package/dist/internal/request-error-status.d.ts.map +1 -1
- package/dist/internal/request-error-status.js +22 -3
- package/dist/internal/resolve-prod-target.d.ts +2 -0
- package/dist/internal/resolve-prod-target.d.ts.map +1 -1
- package/dist/internal/resolve-prod-target.js +13 -0
- package/dist/internal/scm/pr-url.d.ts +40 -0
- package/dist/internal/scm/pr-url.d.ts.map +1 -1
- package/dist/internal/scm/pr-url.js +93 -14
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +4 -3
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +118 -77
- package/dist/internal/session-engine.d.ts +6 -6
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +100 -67
- package/dist/playground/assets/{index-BaQzjaNK.js → index-BMDqAeXu.js} +34 -34
- package/dist/playground/assets/index-LUgJoWdL.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/reminders.d.ts +24 -5
- package/dist/reminders.d.ts.map +1 -1
- package/dist/reminders.js +28 -5
- package/dist/storage-backends/cursor-hosted.d.ts +6 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +29 -1
- package/dist/types.d.ts +122 -25
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +4 -0
- package/docs/deployment.md +7 -2
- package/docs/evals.md +3 -2
- package/docs/guides/cloud-agents.md +4 -3
- package/docs/guides/github.md +2 -1
- package/docs/guides/grokbot-agents.md +2 -2
- package/docs/guides/improve.md +96 -0
- package/docs/guides/opentelemetry.md +3 -4
- package/docs/guides/slack.md +2 -1
- package/docs/reference/agent-config.md +5 -2
- package/docs/reference/channels.md +11 -19
- package/docs/reference/cli.md +23 -13
- package/docs/reference/connections.md +2 -1
- package/docs/reference/extensions.md +2 -0
- package/docs/scaffolding-agents.md +2 -1
- package/docs/troubleshooting.md +1 -1
- package/package.json +10 -3
- package/skills/create-agent/SKILL.md +1 -1
- package/skills/debug/SKILL.md +1 -1
- package/skills/evals/SKILL.md +1 -1
- package/skills/framework-map/SKILL.md +4 -2
- package/skills/github/SKILL.md +1 -1
- package/skills/otel/SKILL.md +3 -3
- package/src/bin/agent-serve.ts +28 -11
- package/src/channels/bitbucket/types.ts +2 -4
- package/src/channels/deployments/types.ts +5 -8
- package/src/channels/github/github-channel.ts +8 -8
- package/src/channels/github/types.ts +7 -4
- package/src/channels/gitlab/types.ts +2 -5
- package/src/channels/origin/origin-channel.ts +29 -13
- package/src/channels/origin/types.ts +7 -3
- package/src/channels/slack/defaults.ts +3 -0
- package/src/channels/slack/dispatch.ts +1 -0
- package/src/channels/slack/live-delivery.ts +53 -12
- package/src/channels/slack/types.ts +4 -3
- package/src/channels.ts +157 -10
- package/src/connections.ts +2 -1
- package/src/extensions/improve/extension.ts +70 -0
- package/src/extensions/improve/skills/yourself.ts +50 -0
- package/src/index.ts +6 -3
- package/src/internal/builtin-tools/artifacts.ts +2 -3
- package/src/internal/channel-route-dispatch.ts +66 -0
- package/src/internal/channel-state.ts +96 -0
- package/src/internal/cli-ax.ts +110 -1
- package/src/internal/cli-cursor.ts +4 -1
- package/src/internal/cli-deploy.ts +80 -22
- package/src/internal/cli-mcp-oauth.ts +18 -0
- package/src/internal/cli-mcp.ts +11 -0
- package/src/internal/cli-slack.ts +15 -2
- package/src/internal/cursor/backend-client.ts +90 -2
- package/src/internal/cursor/credentials.ts +35 -7
- package/src/internal/deploy-client.ts +70 -0
- package/src/internal/deploy-manifest.ts +131 -12
- package/src/internal/describe-error.ts +28 -0
- package/src/internal/discovery/agent.ts +1 -0
- package/src/internal/discovery/info.ts +6 -0
- package/src/internal/discovery/modules.ts +2 -4
- package/src/internal/discovery/project.ts +3 -0
- package/src/internal/discovery/reminders.ts +65 -0
- package/src/internal/discovery/subagent.ts +1 -0
- package/src/internal/distribution.ts +20 -0
- package/src/internal/framework-storage-selection.ts +43 -6
- package/src/internal/guest-network.ts +46 -29
- package/src/internal/hosted-admission-adapter.ts +2 -0
- package/src/internal/hosted-catch-protocol.ts +130 -0
- package/src/internal/hosted-catch.ts +192 -0
- package/src/internal/hosted-delivery-protocol.ts +483 -0
- package/src/internal/hosted-delivery.ts +303 -43
- package/src/internal/hosted-execution-diag.ts +21 -3
- package/src/internal/hosted-execution-flush.ts +6 -3
- package/src/internal/http-control-plane-session.ts +104 -0
- package/src/internal/legacy-command-guard.ts +59 -0
- package/src/internal/local-control-plane.ts +281 -22
- package/src/internal/platform-timers.ts +191 -0
- package/src/internal/reminder-control-plane-protocol.ts +512 -0
- package/src/internal/reminder-runner.ts +481 -57
- package/src/internal/reminder-schedule.ts +11 -6
- package/src/internal/reminder-store.ts +27 -7
- package/src/internal/request-error-status.ts +27 -3
- package/src/internal/resolve-prod-target.ts +15 -0
- package/src/internal/scm/pr-url.ts +167 -20
- package/src/internal/sdk-runner.ts +2 -1
- package/src/internal/server.ts +151 -88
- package/src/internal/session-engine.ts +146 -83
- package/src/reminders.ts +35 -4
- package/src/storage-backends/cursor-hosted.ts +40 -1
- package/src/types.ts +134 -26
- package/dist/docs/assets/chunks/@localSearchIndexroot.CJxMklAy.js +0 -1
- package/dist/docs/assets/guides_cloud-agents.md.DS8RIjwx.js +0 -9
- package/dist/docs/assets/index.md.BW_6tOgR.js +0 -5
- package/dist/docs/assets/skills_framework-map.md.haibFyoB.js +0 -1
- package/dist/docs/assets/troubleshooting.md.Cus_YZga.js +0 -1
- package/dist/playground/assets/index-CceqnLTX.css +0 -1
- /package/dist/docs/assets/{evals.md.CbMoebP1.lean.js → evals.md.C1ekS3k2.lean.js} +0 -0
- /package/dist/docs/assets/{guides_github.md.c0gdGJ-D.lean.js → guides_github.md.BH33UEBJ.lean.js} +0 -0
- /package/dist/docs/assets/{guides_grokbot-agents.md.DVqdhBKb.lean.js → guides_grokbot-agents.md.DyV-WArv.lean.js} +0 -0
- /package/dist/docs/assets/{index.md.BW_6tOgR.lean.js → index.md.BjH1w2ZW.lean.js} +0 -0
- /package/dist/docs/assets/{reference_agent-config.md.CHNpiyp4.lean.js → reference_agent-config.md.CvoL6pof.lean.js} +0 -0
- /package/dist/docs/assets/{reference_connections.md.Di6jJAXF.lean.js → reference_connections.md.BojkC6c5.lean.js} +0 -0
- /package/dist/docs/assets/{reference_extensions.md.CGmMLblt.lean.js → reference_extensions.md.CPWt00ds.lean.js} +0 -0
- /package/dist/docs/assets/{scaffolding-agents.md.em43xlY1.lean.js → scaffolding-agents.md.Kctn3OVb.lean.js} +0 -0
- /package/dist/docs/assets/{skills_create-agent.md.BVoWPcan.lean.js → skills_create-agent.md.Q3h6Je-e.lean.js} +0 -0
- /package/dist/docs/assets/{skills_evals.md.723kpUmA.lean.js → skills_evals.md.BhovOvrl.lean.js} +0 -0
- /package/dist/docs/assets/{skills_github.md.D0JahM8c.lean.js → skills_github.md.hgFX_oKY.lean.js} +0 -0
- /package/dist/docs/assets/{skills_otel.md.CqhobH3B.lean.js → skills_otel.md.B5Ddv1xH.lean.js} +0 -0
- /package/dist/docs/assets/{troubleshooting.md.Cus_YZga.lean.js → troubleshooting.md.CYEAO9bM.lean.js} +0 -0
|
@@ -147,6 +147,7 @@ export function createStreamDeliveryStrategy(
|
|
|
147
147
|
channel.state.streamTs = started.ts;
|
|
148
148
|
channel.state.streamChannelId = started.channel;
|
|
149
149
|
channel.state.streamFull = false;
|
|
150
|
+
channel.state.streamAppendedChunks = 0;
|
|
150
151
|
channel.state.lastPostedText = openingText;
|
|
151
152
|
channel.state.streamBlockText = openingText;
|
|
152
153
|
log.info("chat.startStream ok", {
|
|
@@ -193,6 +194,21 @@ export function createStreamDeliveryStrategy(
|
|
|
193
194
|
highlightCodeFences(text)
|
|
194
195
|
);
|
|
195
196
|
|
|
197
|
+
/**
|
|
198
|
+
* The reply does not extend what the stream already holds, so there is no
|
|
199
|
+
* delta to append and the text on Slack is not the reply.
|
|
200
|
+
*/
|
|
201
|
+
const rewound = (channel: SlackChannel, text: string): boolean =>
|
|
202
|
+
streamDelta(channel, text) === "" &&
|
|
203
|
+
!highlightCodeFences(text).startsWith(
|
|
204
|
+
highlightCodeFences(channel.state.streamBlockText ?? "")
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
const countAppended = (channel: SlackChannel, chunks: number): void => {
|
|
208
|
+
channel.state.streamAppendedChunks =
|
|
209
|
+
(channel.state.streamAppendedChunks ?? 0) + chunks;
|
|
210
|
+
};
|
|
211
|
+
|
|
196
212
|
const stopWithSuffix = async (args: {
|
|
197
213
|
channel: SlackChannel;
|
|
198
214
|
channelId: string;
|
|
@@ -246,25 +262,25 @@ export function createStreamDeliveryStrategy(
|
|
|
246
262
|
};
|
|
247
263
|
|
|
248
264
|
/**
|
|
249
|
-
* The
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
* duplicate would be worse than a lost tail.
|
|
265
|
+
* The open stream cannot carry the rest of the reply — it is full, or the
|
|
266
|
+
* reply no longer extends what it holds. Close it as it stands so it stops
|
|
267
|
+
* spinning and post the remainder as a new thread message.
|
|
253
268
|
*/
|
|
254
|
-
const
|
|
269
|
+
const continueInNewMessage = async (args: {
|
|
255
270
|
channel: SlackChannel;
|
|
256
271
|
channelId: string;
|
|
257
272
|
ts: string;
|
|
258
273
|
remainder: string;
|
|
274
|
+
reason: string;
|
|
259
275
|
sessionId: string;
|
|
260
|
-
}): Promise<
|
|
261
|
-
const { channel, channelId, ts, remainder, sessionId } = args;
|
|
276
|
+
}): Promise<boolean> => {
|
|
277
|
+
const { channel, channelId, ts, remainder, reason, sessionId } = args;
|
|
262
278
|
const log = getLog();
|
|
263
279
|
await stopChatStream({ botToken, channel: channelId, ts });
|
|
264
280
|
channel.state.streamTs = null;
|
|
265
281
|
const threadTs = channel.state.threadTs;
|
|
266
282
|
if (remainder === "" || threadTs === null || threadTs === "") {
|
|
267
|
-
return;
|
|
283
|
+
return true;
|
|
268
284
|
}
|
|
269
285
|
try {
|
|
270
286
|
const posted = await postMessage({
|
|
@@ -275,19 +291,23 @@ export function createStreamDeliveryStrategy(
|
|
|
275
291
|
plainText: remainder.length >= SLACK_MARKDOWN_TEXT_MAX_LEN,
|
|
276
292
|
});
|
|
277
293
|
channel.state.lastBotMessageTs = posted.ts;
|
|
278
|
-
log.info("reply
|
|
294
|
+
log.info("reply continued in a new message", {
|
|
295
|
+
reason,
|
|
279
296
|
channel: channelId,
|
|
280
297
|
stream_ts: ts,
|
|
281
298
|
session: sessionId,
|
|
282
299
|
continued_chars: remainder.length,
|
|
283
300
|
});
|
|
301
|
+
return true;
|
|
284
302
|
} catch (error) {
|
|
285
|
-
log.warn("stream
|
|
303
|
+
log.warn("stream continuation failed", {
|
|
304
|
+
reason,
|
|
286
305
|
error: error instanceof Error ? error.message : String(error),
|
|
287
306
|
channel: channelId,
|
|
288
307
|
stream_ts: ts,
|
|
289
308
|
session: sessionId,
|
|
290
309
|
});
|
|
310
|
+
return false;
|
|
291
311
|
}
|
|
292
312
|
};
|
|
293
313
|
|
|
@@ -328,6 +348,7 @@ export function createStreamDeliveryStrategy(
|
|
|
328
348
|
noteAppendFailure(channel, result);
|
|
329
349
|
return;
|
|
330
350
|
}
|
|
351
|
+
countAppended(channel, 1);
|
|
331
352
|
channel.state.lastPostedText = text;
|
|
332
353
|
channel.state.streamBlockText = text;
|
|
333
354
|
},
|
|
@@ -364,8 +385,10 @@ export function createStreamDeliveryStrategy(
|
|
|
364
385
|
chunks: chunks.length,
|
|
365
386
|
});
|
|
366
387
|
noteAppendFailure(channel, result);
|
|
388
|
+
return false;
|
|
367
389
|
}
|
|
368
|
-
|
|
390
|
+
countAppended(channel, chunks.length);
|
|
391
|
+
return true;
|
|
369
392
|
},
|
|
370
393
|
|
|
371
394
|
async finalize({ channel, channelId, text, sessionId }) {
|
|
@@ -381,6 +404,22 @@ export function createStreamDeliveryStrategy(
|
|
|
381
404
|
}
|
|
382
405
|
// Measured before the stop attempt mutates stream state.
|
|
383
406
|
const remainder = streamDelta(channel, text);
|
|
407
|
+
// Nothing to append and the stream does not hold the reply: closing it
|
|
408
|
+
// here would leave the answer nowhere and report it as delivered.
|
|
409
|
+
if (rewound(channel, text)) {
|
|
410
|
+
const posted = await continueInNewMessage({
|
|
411
|
+
channel,
|
|
412
|
+
channelId,
|
|
413
|
+
ts,
|
|
414
|
+
remainder: text,
|
|
415
|
+
reason: "rewound",
|
|
416
|
+
sessionId,
|
|
417
|
+
});
|
|
418
|
+
if (posted) {
|
|
419
|
+
channel.state.lastPostedText = text;
|
|
420
|
+
}
|
|
421
|
+
return { delivered: posted };
|
|
422
|
+
}
|
|
384
423
|
const stopped =
|
|
385
424
|
channel.state.streamFull === true
|
|
386
425
|
? { ok: false, error: "msg_too_long" }
|
|
@@ -391,15 +430,17 @@ export function createStreamDeliveryStrategy(
|
|
|
391
430
|
stream_ts: ts,
|
|
392
431
|
session: sessionId,
|
|
393
432
|
chars: text.length,
|
|
433
|
+
appends: channel.state.streamAppendedChunks ?? 0,
|
|
394
434
|
});
|
|
395
435
|
return { delivered: true };
|
|
396
436
|
}
|
|
397
437
|
if (stopped.error === "msg_too_long") {
|
|
398
|
-
await
|
|
438
|
+
await continueInNewMessage({
|
|
399
439
|
channel,
|
|
400
440
|
channelId,
|
|
401
441
|
ts,
|
|
402
442
|
remainder,
|
|
443
|
+
reason: "msg_too_long",
|
|
403
444
|
sessionId,
|
|
404
445
|
});
|
|
405
446
|
channel.state.lastPostedText = text;
|
|
@@ -81,6 +81,8 @@ export interface SlackChannelState {
|
|
|
81
81
|
streamingUnavailable?: boolean;
|
|
82
82
|
/** The open stream hit Slack's size cap; appends stop until it closes. */
|
|
83
83
|
streamFull?: boolean;
|
|
84
|
+
/** Chunks Slack accepted on the open stream, reported when it closes. */
|
|
85
|
+
streamAppendedChunks?: number;
|
|
84
86
|
/** Editable progress message ts when `chat.startStream` is unavailable. */
|
|
85
87
|
progressTs: string | null;
|
|
86
88
|
/**
|
|
@@ -597,9 +599,8 @@ export interface SlackAccessPolicy {
|
|
|
597
599
|
export interface SlackChannelOptions {
|
|
598
600
|
credentials?: SlackCredentials;
|
|
599
601
|
/**
|
|
600
|
-
* Continuation selector.
|
|
601
|
-
*
|
|
602
|
-
* `"slack.thread/v2"`). Override with `"slack.none/v2"` for one-shot events.
|
|
602
|
+
* Continuation selector. Omit this to inherit the agent architecture's
|
|
603
|
+
* default. Set it explicitly only when migrating persisted identities.
|
|
603
604
|
*/
|
|
604
605
|
continuation?: ContinuationIdentity;
|
|
605
606
|
/** Defaults to `{ respondTo: "thread", blockExternals: true }`. */
|
package/src/channels.ts
CHANGED
|
@@ -64,9 +64,11 @@ export {
|
|
|
64
64
|
} from "./channels/checks.js";
|
|
65
65
|
|
|
66
66
|
import { Buffer } from "node:buffer";
|
|
67
|
-
import { timingSafeEqual } from "node:crypto";
|
|
67
|
+
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
68
68
|
import { brandDefinition } from "./internal/brand.js";
|
|
69
69
|
import { normalizeIdentity } from "./internal/continuation-identity.js";
|
|
70
|
+
import { attachCatchAdmission } from "./internal/hosted-catch.js";
|
|
71
|
+
import { attachHttpControlPlaneAdmission } from "./internal/http-control-plane-session.js";
|
|
70
72
|
import { isLoopbackAddress, isLoopbackHostname } from "./internal/net.js";
|
|
71
73
|
import type {
|
|
72
74
|
AuthContext,
|
|
@@ -117,7 +119,16 @@ export type {
|
|
|
117
119
|
export function defineChannel<TState = JsonValue>(
|
|
118
120
|
config: ChannelConfig<TState>
|
|
119
121
|
): ChannelDefinition<TState> {
|
|
120
|
-
|
|
122
|
+
const definition = brandDefinition("channel", config);
|
|
123
|
+
if (config.routes !== undefined && config.routes.length > 0) {
|
|
124
|
+
// Hosted: the control plane catches declared routes and replays them
|
|
125
|
+
// here. Provider packs attach their own admission afterwards.
|
|
126
|
+
attachCatchAdmission(
|
|
127
|
+
definition as ChannelDefinition<unknown>,
|
|
128
|
+
config.routes
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
return definition;
|
|
121
132
|
}
|
|
122
133
|
|
|
123
134
|
/**
|
|
@@ -127,13 +138,15 @@ export function defineChannel<TState = JsonValue>(
|
|
|
127
138
|
export function httpChannel(
|
|
128
139
|
config: HttpChannelConfig = {}
|
|
129
140
|
): HttpChannelDefinition {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
141
|
+
const definition =
|
|
142
|
+
config.continuation !== undefined
|
|
143
|
+
? brandDefinition("http-channel", {
|
|
144
|
+
...config,
|
|
145
|
+
continuation: normalizeIdentity(config.continuation, "http"),
|
|
146
|
+
})
|
|
147
|
+
: brandDefinition("http-channel", config);
|
|
148
|
+
attachHttpControlPlaneAdmission(definition);
|
|
149
|
+
return definition;
|
|
137
150
|
}
|
|
138
151
|
|
|
139
152
|
// ============================================================================
|
|
@@ -432,7 +445,13 @@ export function publicEndpoint(): AuthPolicy {
|
|
|
432
445
|
principalId: "anonymous",
|
|
433
446
|
principalType: "user",
|
|
434
447
|
});
|
|
435
|
-
|
|
448
|
+
// On the v2 control plane this also makes the channel's routes catchable
|
|
449
|
+
// with handler-side verification (the v1 alias posture): the CP admits
|
|
450
|
+
// every request on a declared route and the handler rejects bad ones.
|
|
451
|
+
return markCatchAuth(
|
|
452
|
+
Object.assign(policy, { [PUBLIC_ENDPOINT_MARKER]: true as const }),
|
|
453
|
+
{ kind: "public" }
|
|
454
|
+
);
|
|
436
455
|
}
|
|
437
456
|
|
|
438
457
|
/** True when a policy was created by {@link publicEndpoint}. */
|
|
@@ -443,3 +462,131 @@ export function isPublicEndpointPolicy(policy: AuthPolicy): boolean {
|
|
|
443
462
|
] === true
|
|
444
463
|
);
|
|
445
464
|
}
|
|
465
|
+
|
|
466
|
+
const CATCH_AUTH_MARKER = Symbol.for("agent-serve.catch-auth");
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* What `deploy` extracts from a {@link sharedSecretAuth} /
|
|
470
|
+
* {@link hmacSignatureAuth} policy into the manifest: the control plane runs
|
|
471
|
+
* the same check with the deployment secret of the same name before any
|
|
472
|
+
* compute starts. `secret` is a name, never a value.
|
|
473
|
+
*/
|
|
474
|
+
export type CatchAuthDeclaration =
|
|
475
|
+
| { kind: "header"; header: string; secret: string }
|
|
476
|
+
| { kind: "hmac-sha256"; header: string; secret: string; prefix?: string }
|
|
477
|
+
/** `publicEndpoint()`: the handler verifies; the control plane only rate limits. */
|
|
478
|
+
| { kind: "public" };
|
|
479
|
+
|
|
480
|
+
function markCatchAuth(
|
|
481
|
+
policy: AuthPolicy,
|
|
482
|
+
declaration: CatchAuthDeclaration
|
|
483
|
+
): AuthPolicy {
|
|
484
|
+
return Object.assign(policy, { [CATCH_AUTH_MARKER]: declaration });
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/** The catch declaration a policy carries, if it is a catch-capable policy. */
|
|
488
|
+
export function catchAuthDeclaration(
|
|
489
|
+
policy: AuthPolicy
|
|
490
|
+
): CatchAuthDeclaration | undefined {
|
|
491
|
+
const declaration = (policy as { [CATCH_AUTH_MARKER]?: unknown })[
|
|
492
|
+
CATCH_AUTH_MARKER
|
|
493
|
+
];
|
|
494
|
+
return typeof declaration === "object" && declaration !== null
|
|
495
|
+
? (declaration as CatchAuthDeclaration)
|
|
496
|
+
: undefined;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
function presentedHeaderSecret(headerName: string, value: string): string {
|
|
500
|
+
if (
|
|
501
|
+
headerName === "authorization" &&
|
|
502
|
+
value.toLowerCase().startsWith("bearer ")
|
|
503
|
+
) {
|
|
504
|
+
return value.slice("bearer ".length).trim();
|
|
505
|
+
}
|
|
506
|
+
return value.trim();
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Admit requests whose `header` equals the secret named `secret` (an
|
|
511
|
+
* `Authorization: Bearer <secret>` header also matches). Locally the value
|
|
512
|
+
* is `process.env[secret]`; hosted, the deployment secret of that name. On
|
|
513
|
+
* Cursor hosting this ALSO declares the channel's routes reachable through
|
|
514
|
+
* the control-plane catch API, which runs the same comparison before any
|
|
515
|
+
* compute exists. An unset secret admits nothing.
|
|
516
|
+
*/
|
|
517
|
+
export function sharedSecretAuth(options: {
|
|
518
|
+
header: string;
|
|
519
|
+
secret: string;
|
|
520
|
+
}): AuthPolicy {
|
|
521
|
+
const header = options.header.toLowerCase();
|
|
522
|
+
const policy: AuthPolicy = (request) => {
|
|
523
|
+
const expected = process.env[options.secret];
|
|
524
|
+
const presented = request.headers.get(header);
|
|
525
|
+
if (
|
|
526
|
+
expected === undefined ||
|
|
527
|
+
expected.length === 0 ||
|
|
528
|
+
presented === null ||
|
|
529
|
+
!constantTimeEquals(presentedHeaderSecret(header, presented), expected)
|
|
530
|
+
) {
|
|
531
|
+
return null;
|
|
532
|
+
}
|
|
533
|
+
return {
|
|
534
|
+
authenticator: "shared-secret",
|
|
535
|
+
principalId: "webhook",
|
|
536
|
+
principalType: "service",
|
|
537
|
+
};
|
|
538
|
+
};
|
|
539
|
+
return markCatchAuth(policy, {
|
|
540
|
+
kind: "header",
|
|
541
|
+
header,
|
|
542
|
+
secret: options.secret,
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* Admit requests whose `header` carries the hex HMAC-SHA256 of the raw body
|
|
548
|
+
* under the secret named `secret` (optionally behind a literal `prefix`
|
|
549
|
+
* such as `sha256=`). Same local / hosted / catch semantics as
|
|
550
|
+
* {@link sharedSecretAuth}.
|
|
551
|
+
*/
|
|
552
|
+
export function hmacSignatureAuth(options: {
|
|
553
|
+
header: string;
|
|
554
|
+
secret: string;
|
|
555
|
+
prefix?: string;
|
|
556
|
+
}): AuthPolicy {
|
|
557
|
+
const header = options.header.toLowerCase();
|
|
558
|
+
const prefix = options.prefix ?? "";
|
|
559
|
+
const policy: AuthPolicy = async (request) => {
|
|
560
|
+
const secret = process.env[options.secret];
|
|
561
|
+
const presented = request.headers.get(header)?.trim();
|
|
562
|
+
if (
|
|
563
|
+
secret === undefined ||
|
|
564
|
+
secret.length === 0 ||
|
|
565
|
+
presented === undefined ||
|
|
566
|
+
!presented.startsWith(prefix)
|
|
567
|
+
) {
|
|
568
|
+
return null;
|
|
569
|
+
}
|
|
570
|
+
const body = Buffer.from(await request.clone().arrayBuffer());
|
|
571
|
+
const expected = createHmac("sha256", secret).update(body).digest("hex");
|
|
572
|
+
if (
|
|
573
|
+
!constantTimeEquals(
|
|
574
|
+
presented.slice(prefix.length).toLowerCase(),
|
|
575
|
+
expected
|
|
576
|
+
)
|
|
577
|
+
) {
|
|
578
|
+
return null;
|
|
579
|
+
}
|
|
580
|
+
return {
|
|
581
|
+
authenticator: "hmac-signature",
|
|
582
|
+
principalId: "webhook",
|
|
583
|
+
principalType: "service",
|
|
584
|
+
};
|
|
585
|
+
};
|
|
586
|
+
return markCatchAuth(policy, {
|
|
587
|
+
kind: "hmac-sha256",
|
|
588
|
+
header,
|
|
589
|
+
secret: options.secret,
|
|
590
|
+
prefix: options.prefix,
|
|
591
|
+
});
|
|
592
|
+
}
|
package/src/connections.ts
CHANGED
|
@@ -65,7 +65,8 @@
|
|
|
65
65
|
* executes **on the Cursor backend** with the account's stored OAuth
|
|
66
66
|
* credentials, so the agent gets Linear / Notion / Slack / … tools with
|
|
67
67
|
* zero token plumbing and no OAuth secrets on this host. Requires the host
|
|
68
|
-
* to be signed in (`agent-sdk login` or
|
|
68
|
+
* to be signed in (`agent-sdk login`, `CURSOR_API_KEY`, or
|
|
69
|
+
* `CURSOR_SERVICE_ACCOUNT_KEY`):
|
|
69
70
|
*
|
|
70
71
|
* ```ts
|
|
71
72
|
* // agent/mcp-connections/account.ts — every connected server (no allowlist)
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Self-improvement as an extension. An agent's behaviour is source in a
|
|
3
|
+
* repository, so changing how it behaves is a change to that source: a
|
|
4
|
+
* one-off Cursor cloud agent does the coding on a branch and opens a pull
|
|
5
|
+
* request, the agent that mounted this writes the brief and reports the
|
|
6
|
+
* pull request, and the tree it runs from is never edited.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* // agent/extensions/improve.ts
|
|
10
|
+
* import improve from "@cursor/july/extensions/improve";
|
|
11
|
+
*
|
|
12
|
+
* export default improve({
|
|
13
|
+
* repo: "https://github.com/acme/agents",
|
|
14
|
+
* path: "agents/concierge",
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Contributes the `<namespace>__yourself` skill; mount it as `improve` so
|
|
19
|
+
* the skill reads `improve__yourself`. The coding goes through the
|
|
20
|
+
* cursor-cloud-agents extension, so mount that too, with `repo` among its
|
|
21
|
+
* `cloud.repos`. An agent whose own turns run on a cloud VM with the
|
|
22
|
+
* repository checked out needs no second mount: the skill has it work in
|
|
23
|
+
* that checkout.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { z } from "zod";
|
|
27
|
+
import { defineExtension } from "../../extensions.js";
|
|
28
|
+
import type { Extension } from "../../types.js";
|
|
29
|
+
|
|
30
|
+
export interface ImproveOptions {
|
|
31
|
+
/** Repository that holds the agent's source. One of the cloud agents mount's `cloud.repos`. */
|
|
32
|
+
repo: string;
|
|
33
|
+
/** The agent's directory in the repository, as `agent-sdk deploy --path` names it. */
|
|
34
|
+
path: string;
|
|
35
|
+
/** Ref the deployment tracks: branches start there and pull requests target it. Defaults to `main`. */
|
|
36
|
+
ref?: string;
|
|
37
|
+
/** What a coding agent must know about this tree beyond the Agent SDK layout, one line each. */
|
|
38
|
+
notes?: string[];
|
|
39
|
+
/** Who deploys a merged change and when it is live. Defaults to "It takes effect at the next deploy." */
|
|
40
|
+
deploy?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** {@link ImproveOptions} with defaults applied. */
|
|
44
|
+
export interface ImproveConfig extends ImproveOptions {
|
|
45
|
+
ref: string;
|
|
46
|
+
notes: string[];
|
|
47
|
+
deploy: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const line = z.string().trim().min(1);
|
|
51
|
+
|
|
52
|
+
const improve: Extension<ImproveConfig, ImproveOptions> = defineExtension({
|
|
53
|
+
root: import.meta.dirname,
|
|
54
|
+
description:
|
|
55
|
+
"Change your own source through a one-off cloud agent and a pull request, never the running tree.",
|
|
56
|
+
config: z.object({
|
|
57
|
+
repo: z.string().url(),
|
|
58
|
+
path: z
|
|
59
|
+
.string()
|
|
60
|
+
.regex(
|
|
61
|
+
/^[^\s/]+(\/[^\s/]+)*$/,
|
|
62
|
+
"Expected a repository-relative path like agents/concierge"
|
|
63
|
+
),
|
|
64
|
+
ref: line.default("main"),
|
|
65
|
+
notes: z.array(line).default([]),
|
|
66
|
+
deploy: line.default("It takes effect at the next deploy."),
|
|
67
|
+
}),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export default improve;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineSkill } from "../../../skills.js";
|
|
2
|
+
import type { SkillDefinition } from "../../../types.js";
|
|
3
|
+
import extension from "../extension.js";
|
|
4
|
+
|
|
5
|
+
const { repo, path, ref, notes, deploy } = extension.config;
|
|
6
|
+
|
|
7
|
+
const treeNotes =
|
|
8
|
+
notes.length === 0
|
|
9
|
+
? ""
|
|
10
|
+
: `\nAbout this tree in particular; copy these into the brief verbatim:\n\n${notes.map((note) => `- ${note}`).join("\n")}\n`;
|
|
11
|
+
|
|
12
|
+
const yourself: SkillDefinition = defineSkill({
|
|
13
|
+
description:
|
|
14
|
+
"Change your own source (instructions, skills, tools, channels, connections, model, deployment) through a one-off Cursor cloud agent and a pull request. Use whenever the ask is about how you yourself behave, including adding or editing a skill, so the change lands in the repository instead of the tree you happen to be running from.",
|
|
15
|
+
markdown: `# Improve yourself
|
|
16
|
+
|
|
17
|
+
You are the Agent SDK agent at \`${path}\` in ${repo}, deployed from \`${ref}\`. A change to how you behave is a change to that source, and it goes through the repository like any other change: a branch, a pull request, review, a deploy. Nothing about it is special except that people describe it in the second person.
|
|
18
|
+
|
|
19
|
+
## What changes where
|
|
20
|
+
|
|
21
|
+
Under \`${path}/agent/\`:
|
|
22
|
+
|
|
23
|
+
- \`instructions.md\` is the always-on system prompt: identity, tool-choice rules, the output contract.
|
|
24
|
+
- \`skills/<name>.md\` is a procedure loaded on demand; a \`<name>/SKILL.md\` directory carries sibling files. The \`description\` frontmatter is the routing rule the model sees.
|
|
25
|
+
- \`tools/<name>.ts\` is typed, executable behaviour: anything that must be right every time.
|
|
26
|
+
- \`channels/\`, \`mcp-connections/\`, and \`host-connections/\` are the surfaces and connectors.
|
|
27
|
+
- \`agent.ts\` is the model, its parameters, and the runtime.
|
|
28
|
+
- \`extensions/<ns>.ts\` mounts an extension. This skill arrives through one.
|
|
29
|
+
${treeNotes}
|
|
30
|
+
## The change is made on a clean checkout
|
|
31
|
+
|
|
32
|
+
Never edit the tree you run from: it is a deployed copy of \`${path}\`, and nothing changed there lasts. The change is made on a clean checkout of ${repo} at \`${ref}\`. When your own turn runs on a cloud VM with that repository checked out, that VM is the checkout: branch there. Otherwise hand the coding to a one-off Cursor cloud agent through the cloud agents extension, with \`launch\` under its mount namespace, \`repo\` set to ${repo}, and \`starting_ref\` to \`${ref}\`. One agent per change; steer it with \`reply\` rather than launching another.
|
|
33
|
+
|
|
34
|
+
## The brief
|
|
35
|
+
|
|
36
|
+
Whoever makes the change works from the same brief. For a cloud agent it is the whole handoff, because it cannot see this conversation:
|
|
37
|
+
|
|
38
|
+
- Who and why. A change to the source of the Agent SDK agent at \`${path}\`, asked for by the person in front of you: the change in their words, and what you know about why they want it.
|
|
39
|
+
- Where. Repository ${repo}, ref \`${ref}\`, directory \`${path}\`, the layout above, and the files you expect to change.
|
|
40
|
+
- How. Follow the repository's own conventions (its \`AGENTS.md\` files and rules along the paths touched). Keep the diff to the change. Run the checks the repository defines for \`${path}\`. Open a pull request against \`${ref}\`; never merge it.
|
|
41
|
+
- Report. The pull request URL, what changed, what was verified and how, and anything left unverified.
|
|
42
|
+
|
|
43
|
+
## Report
|
|
44
|
+
|
|
45
|
+
If you launched a cloud agent, give the person its URL with the full id, read its report with \`dump\` (\`get\` for status), and read the pull request before repeating its claims. Report the pull request, not that you delegated.
|
|
46
|
+
|
|
47
|
+
A merged pull request changes nothing by itself. ${deploy} Never say you have already changed yourself. Editing your own source is still an edit: do it when asked, and stop at the pull request. Deploying is a separate authorization.`,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export default yourself;
|
package/src/index.ts
CHANGED
|
@@ -139,7 +139,9 @@ export {
|
|
|
139
139
|
TOOL_MCP_ENDPOINT_PATH,
|
|
140
140
|
} from "./internal/mcp-endpoint.js";
|
|
141
141
|
export {
|
|
142
|
+
REMINDER_ARGS_MAX_BYTES,
|
|
142
143
|
ReminderValidationError,
|
|
144
|
+
rejectAnonymousReminderHandlers,
|
|
143
145
|
UnknownReminderError,
|
|
144
146
|
} from "./internal/reminder-runner.js";
|
|
145
147
|
export type { AgentMount } from "./internal/server.js";
|
|
@@ -169,8 +171,10 @@ export { prompt } from "./prompt.js";
|
|
|
169
171
|
export type {
|
|
170
172
|
ReminderBusyPolicy,
|
|
171
173
|
ReminderCreateInput,
|
|
174
|
+
ReminderDefinition,
|
|
172
175
|
ReminderFireContext,
|
|
173
176
|
ReminderFireResult,
|
|
177
|
+
ReminderHandlerConfig,
|
|
174
178
|
ReminderHostApi,
|
|
175
179
|
ReminderInfo,
|
|
176
180
|
ReminderReschedule,
|
|
@@ -179,6 +183,7 @@ export type {
|
|
|
179
183
|
ReminderTarget,
|
|
180
184
|
ReminderUntilContext,
|
|
181
185
|
} from "./reminders.js";
|
|
186
|
+
export { defineReminder } from "./reminders.js";
|
|
182
187
|
export { defineResult } from "./result.js";
|
|
183
188
|
export { defineSchedule } from "./schedules.js";
|
|
184
189
|
export { defineSkill } from "./skills.js";
|
|
@@ -226,9 +231,7 @@ export {
|
|
|
226
231
|
|
|
227
232
|
/**
|
|
228
233
|
* Runtime config for an agent — authored at `agent/agent.ts` (the root
|
|
229
|
-
* agent) or `agent/subagents/<id>/agent.ts` (a subagent).
|
|
230
|
-
* `architecture: "v2"` to deploy onto the v2 control plane; omitted
|
|
231
|
-
* channel continuation then inherits kind `/v2` defaults.
|
|
234
|
+
* agent) or `agent/subagents/<id>/agent.ts` (a subagent).
|
|
232
235
|
*/
|
|
233
236
|
export function defineAgent(config: AgentConfig): AgentConfigDefinition {
|
|
234
237
|
return brandDefinition("agent", config);
|
|
@@ -30,7 +30,7 @@ function kindVariant(name: string, schema: z.ZodType | undefined) {
|
|
|
30
30
|
.min(1)
|
|
31
31
|
.optional()
|
|
32
32
|
.describe(
|
|
33
|
-
"Stable
|
|
33
|
+
"Stable key, unique across kinds. Reusing it replaces that record instead of adding a new one."
|
|
34
34
|
),
|
|
35
35
|
});
|
|
36
36
|
}
|
|
@@ -47,10 +47,9 @@ export function tagArtifactTool(config: ArtifactsConfig): ToolDefinition {
|
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
const description = [
|
|
50
|
-
"Tag a
|
|
50
|
+
"Tag a finished output as an artifact. Artifacts persist across sessions and are listed for the people supervising this agent.",
|
|
51
51
|
"Kinds:",
|
|
52
52
|
...kinds.map(([name, kind]) => `- ${name}: ${kind.description}`),
|
|
53
|
-
"Same `key` upserts: tagging it again updates that record — use a stable key when re-tagging the same underlying thing (e.g. the same PR URL).",
|
|
54
53
|
].join("\n");
|
|
55
54
|
return defineTool({
|
|
56
55
|
description,
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { ChannelHandlerArgs, ChannelRoute } from "../types.js";
|
|
2
|
+
import { jsonResponse } from "./http-channel.js";
|
|
3
|
+
import { validateToolInput } from "./json-schema.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Run one authored channel route: validate the declared Zod query / body
|
|
7
|
+
* schemas onto `handlerArgs`, then call the handler. Shared by the local
|
|
8
|
+
* router mount and hosted catch replay so a caught request meets exactly
|
|
9
|
+
* the same schema gate as a direct one.
|
|
10
|
+
*/
|
|
11
|
+
export async function invokeChannelRoute(input: {
|
|
12
|
+
route: ChannelRoute;
|
|
13
|
+
request: Request;
|
|
14
|
+
handlerArgs: ChannelHandlerArgs;
|
|
15
|
+
}): Promise<Response> {
|
|
16
|
+
const { route, handlerArgs } = input;
|
|
17
|
+
let request = input.request;
|
|
18
|
+
|
|
19
|
+
if (route.querySchema !== undefined) {
|
|
20
|
+
const rawQuery = Object.fromEntries(
|
|
21
|
+
new URL(request.url).searchParams.entries()
|
|
22
|
+
);
|
|
23
|
+
const queryValidation = validateToolInput(route.querySchema, rawQuery);
|
|
24
|
+
if (!queryValidation.ok) {
|
|
25
|
+
return jsonResponse({ error: queryValidation.message }, { status: 400 });
|
|
26
|
+
}
|
|
27
|
+
handlerArgs.query = queryValidation.value;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (route.bodySchema !== undefined) {
|
|
31
|
+
// Buffer once so handlers that need the raw body (e.g. GitHub HMAC) can
|
|
32
|
+
// still read `request.text()` / `request.json()`.
|
|
33
|
+
let bodyText: string;
|
|
34
|
+
try {
|
|
35
|
+
bodyText = await request.text();
|
|
36
|
+
} catch {
|
|
37
|
+
return jsonResponse(
|
|
38
|
+
{ error: "Failed to read request body" },
|
|
39
|
+
{ status: 400 }
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
let rawBody: unknown;
|
|
43
|
+
try {
|
|
44
|
+
rawBody = bodyText === "" ? {} : JSON.parse(bodyText);
|
|
45
|
+
} catch {
|
|
46
|
+
return jsonResponse(
|
|
47
|
+
{ error: "Request body must be valid JSON" },
|
|
48
|
+
{ status: 400 }
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
const bodyValidation = validateToolInput(route.bodySchema, rawBody);
|
|
52
|
+
if (!bodyValidation.ok) {
|
|
53
|
+
return jsonResponse({ error: bodyValidation.message }, { status: 400 });
|
|
54
|
+
}
|
|
55
|
+
handlerArgs.body = bodyValidation.value;
|
|
56
|
+
request = new Request(request.url, {
|
|
57
|
+
method: request.method,
|
|
58
|
+
headers: request.headers,
|
|
59
|
+
body: bodyText === "" ? undefined : bodyText,
|
|
60
|
+
// node: undici / fetch may require duplex for streamed bodies;
|
|
61
|
+
// a string body does not.
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return route.handler(request, handlerArgs);
|
|
66
|
+
}
|