@cursor/july 0.1.107 → 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 +30 -8
- package/dist/channels/github/github-channel.js +8 -5
- package/dist/channels/github/types.d.ts +5 -1
- package/dist/channels/github/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 +5 -1
- package/dist/channels/origin/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 +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.CtuckIiL.js → app.BASKM3M4.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.BHZYsNVi.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.Bkkhnu8K.js → VPLocalSearchBox.BOKxlYGP.js} +1 -1
- package/dist/docs/assets/chunks/{theme.DhpIe0Pa.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_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_cli.md.Dm67hd2D.js → reference_cli.md.Ca26u0Es.js} +6 -6
- package/dist/docs/assets/{reference_cli.md.Dm67hd2D.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/troubleshooting.md.CYEAO9bM.js +1 -0
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +4 -4
- package/dist/docs/deployment.html +7 -7
- package/dist/docs/deployment.md +7 -2
- package/dist/docs/evals.html +6 -6
- package/dist/docs/evals.md +3 -2
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-agents.html +6 -6
- package/dist/docs/guides/cloud-agents.md +4 -3
- package/dist/docs/guides/convert-automation.html +4 -4
- package/dist/docs/guides/github.html +5 -5
- package/dist/docs/guides/github.md +2 -1
- package/dist/docs/guides/grokbot-agents.html +6 -6
- package/dist/docs/guides/grokbot-agents.md +2 -2
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/improve.html +40 -0
- package/dist/docs/guides/improve.md +91 -0
- package/dist/docs/guides/mcp-oauth.html +4 -4
- package/dist/docs/guides/opentelemetry.html +5 -5
- package/dist/docs/guides/slack.html +6 -6
- package/dist/docs/guides/slack.md +2 -1
- 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 +4 -0
- package/dist/docs/llms-full.txt +158 -33
- package/dist/docs/llms.txt +1 -0
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +6 -6
- package/dist/docs/reference/agent-config.md +5 -2
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +4 -4
- package/dist/docs/reference/cli.html +10 -10
- package/dist/docs/reference/cli.md +18 -11
- package/dist/docs/reference/connections.html +6 -6
- package/dist/docs/reference/connections.md +2 -1
- package/dist/docs/reference/extensions.html +6 -6
- package/dist/docs/reference/extensions.md +2 -0
- package/dist/docs/reference/hooks.html +4 -4
- package/dist/docs/reference/http-api.html +4 -4
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +4 -4
- package/dist/docs/reference/project-layout.html +4 -4
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/result.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 +4 -4
- package/dist/docs/reference/subagents.html +4 -4
- package/dist/docs/reference/tools.html +4 -4
- package/dist/docs/scaffolding-agents.html +5 -5
- package/dist/docs/scaffolding-agents.md +2 -1
- package/dist/docs/skills/ab.html +4 -4
- package/dist/docs/skills/create-agent.html +6 -6
- package/dist/docs/skills/create-agent.md +1 -1
- package/dist/docs/skills/debug.html +5 -5
- package/dist/docs/skills/debug.md +1 -1
- package/dist/docs/skills/evals.html +6 -6
- package/dist/docs/skills/evals.md +1 -1
- package/dist/docs/skills/framework-map.html +5 -5
- package/dist/docs/skills/framework-map.md +4 -2
- package/dist/docs/skills/github.html +6 -6
- package/dist/docs/skills/github.md +1 -1
- 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/grokbot-agents.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 +5 -5
- 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/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 +38 -14
- 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/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 +27 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +32 -0
- package/dist/internal/deploy-manifest.d.ts +23 -0
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +84 -1
- 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/guest-network.d.ts +4 -10
- package/dist/internal/guest-network.d.ts.map +1 -1
- package/dist/internal/guest-network.js +42 -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 +41 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +249 -0
- package/dist/internal/hosted-delivery.d.ts +10 -1
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +100 -22
- 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/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 +2 -0
- package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -1
- package/dist/internal/reminder-control-plane-protocol.js +9 -2
- package/dist/internal/reminder-runner.d.ts +8 -0
- package/dist/internal/reminder-runner.d.ts.map +1 -1
- package/dist/internal/reminder-runner.js +36 -9
- 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/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 +57 -56
- package/dist/internal/session-engine.d.ts +2 -6
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +95 -67
- package/dist/playground/assets/{index-Bq2HpEQB.js → index-BMDqAeXu.js} +28 -28
- package/dist/playground/assets/index-LUgJoWdL.css +1 -0
- package/dist/playground/index.html +2 -2
- 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 +33 -5
- 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/slack.md +2 -1
- package/docs/reference/agent-config.md +5 -2
- package/docs/reference/cli.md +18 -11
- 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 +8 -1
- 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/src/bin/agent-serve.ts +27 -2
- package/src/channels/github/github-channel.ts +8 -8
- package/src/channels/github/types.ts +5 -0
- package/src/channels/origin/origin-channel.ts +29 -13
- package/src/channels/origin/types.ts +5 -0
- 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/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 +50 -10
- 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/credentials.ts +35 -7
- package/src/internal/deploy-client.ts +54 -0
- package/src/internal/deploy-manifest.ts +115 -1
- package/src/internal/describe-error.ts +28 -0
- package/src/internal/guest-network.ts +43 -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 +387 -0
- package/src/internal/hosted-delivery.ts +155 -22
- 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/platform-timers.ts +191 -0
- package/src/internal/reminder-control-plane-protocol.ts +15 -2
- package/src/internal/reminder-runner.ts +60 -9
- package/src/internal/resolve-prod-target.ts +15 -0
- package/src/internal/sdk-runner.ts +2 -1
- package/src/internal/server.ts +89 -79
- package/src/internal/session-engine.ts +141 -83
- package/src/storage-backends/cursor-hosted.ts +40 -1
- package/src/types.ts +39 -6
- package/dist/docs/assets/chunks/@localSearchIndexroot.DXXZxiMv.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-CZKKNlmb.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/{troubleshooting.md.Cus_YZga.lean.js → troubleshooting.md.CYEAO9bM.lean.js} +0 -0
|
@@ -240,8 +240,11 @@ console.log(`listening on ${handle.url}`);
|
|
|
240
240
|
Host settings match the documented [CLI](./cli.md) `serve` flags.
|
|
241
241
|
`serve()` also accepts `discovery` (project-loading options) and
|
|
242
242
|
`mode: "single" | "multi"`. The Cursor credential resolves in one order
|
|
243
|
-
everywhere: explicit `apiKey`, then `CURSOR_API_KEY`, then
|
|
244
|
-
|
|
243
|
+
everywhere: explicit `apiKey`, then `CURSOR_API_KEY`, then
|
|
244
|
+
`CURSOR_API_KEY_FILE` (hosted default `/run/cursor/secrets/CURSOR_API_KEY`
|
|
245
|
+
when unset), then `CURSOR_SERVICE_ACCOUNT_KEY`, then the key stored by
|
|
246
|
+
`agent-sdk login`. On a host that has both the service-account key and a
|
|
247
|
+
bind file, the file principal wins.
|
|
245
248
|
|
|
246
249
|
## What's next
|
|
247
250
|
|
package/docs/reference/cli.md
CHANGED
|
@@ -109,7 +109,7 @@ the agent project. Slugged mounts get a subdirectory named for the slug.
|
|
|
109
109
|
| `--host` | Bind this host. The default is loopback-only `127.0.0.1`. |
|
|
110
110
|
| `--dev` | Disable automatic schedule and reminder firing, admit unsigned loopback GitHub deliveries, and widen playground session access on loopback. |
|
|
111
111
|
| `--mode` | Use `multi` for slugged routes and an index, or `single` for one agent at the unslugged `/v1/*`. The default is `multi`. |
|
|
112
|
-
| `--api-key` | Use this Cursor API key.
|
|
112
|
+
| `--api-key` | Use this Cursor API key. Otherwise the command uses `CURSOR_API_KEY`, then `CURSOR_API_KEY_FILE` (hosted default `/run/cursor/secrets/CURSOR_API_KEY` when unset), then `CURSOR_SERVICE_ACCOUNT_KEY`, then the stored login. |
|
|
113
113
|
| `--state-root` | Store sessions, streams, workspaces, and channel state here. Keep durable production state outside the agent repository. |
|
|
114
114
|
| `--bearer-token` | Require this bearer token on routes without authored auth. Mutually exclusive with `--allow-anonymous`. |
|
|
115
115
|
| `--allow-anonymous` | Admit every caller as one `anonymous` principal. Use only behind a trusted network boundary. |
|
|
@@ -557,10 +557,14 @@ runtime, and Cursor account MCP connections. `--key-name` changes the
|
|
|
557
557
|
name of a browser-minted key. `login --api-key` validates and stores a
|
|
558
558
|
key you already created.
|
|
559
559
|
|
|
560
|
-
`whoami` shows which credential is active and why.
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
560
|
+
`whoami` shows which credential is active and why. An explicit key
|
|
561
|
+
wins, then `CURSOR_API_KEY`, then `CURSOR_API_KEY_FILE` (hosted default
|
|
562
|
+
`/run/cursor/secrets/CURSOR_API_KEY` when unset), then
|
|
563
|
+
`CURSOR_SERVICE_ACCOUNT_KEY`, then the stored login. A host that has
|
|
564
|
+
both the service-account key and a bind file authenticates as the file
|
|
565
|
+
principal. `logout` removes the local credential file but doesn't
|
|
566
|
+
revoke the API key. Revoke it in the Cursor dashboard when it should
|
|
567
|
+
stop working.
|
|
564
568
|
|
|
565
569
|
Login and account RPCs honor `CURSOR_API_BASE_URL`. The SDK harness
|
|
566
570
|
honors `CURSOR_BACKEND_URL`. Set both to the same URL, or keys minted
|
|
@@ -598,9 +602,9 @@ agent-sdk deploy [--dir <path>] [--slug <slug> | --all] [--team <id>]
|
|
|
598
602
|
[--no-wait] [--json]
|
|
599
603
|
```
|
|
600
604
|
|
|
601
|
-
Managed hosting requires team
|
|
602
|
-
|
|
603
|
-
team.
|
|
605
|
+
Managed hosting requires team membership and the team's cloud-agent
|
|
606
|
+
entitlement. A team service-account API key with agent access can
|
|
607
|
+
deploy. `--team` defaults to the signed-in account's team.
|
|
604
608
|
|
|
605
609
|
For a single project, the slug defaults to a normalized version of the
|
|
606
610
|
directory name. Deployment slugs contain lowercase letters, digits, `_`,
|
|
@@ -843,8 +847,9 @@ checklist. It doesn't change files.
|
|
|
843
847
|
`slack create` opens the signed-in Cursor dashboard wizard. Finish Slack
|
|
844
848
|
consent and the bot name there. The CLI writes the token pair into
|
|
845
849
|
`<dir>/.env.local` and runs `doctor`. It requires a signed-in host
|
|
846
|
-
(`agent-sdk login` or `CURSOR_API_KEY`).
|
|
847
|
-
|
|
850
|
+
(`agent-sdk login` or `CURSOR_API_KEY`). A team service-account key
|
|
851
|
+
cannot create Slack apps. `--prod` provisions the production app; the
|
|
852
|
+
default is the development app. `--name` / `--icon`
|
|
848
853
|
/ `--channel-posts` prefill the wizard. A second create for the same
|
|
849
854
|
slug and env overwrites the live Slack app. If Slack needs a workspace
|
|
850
855
|
admin's approval, the wizard waits; keep the CLI running, open Slack's
|
|
@@ -957,7 +962,9 @@ These environment variables affect the CLI and its channel packs.
|
|
|
957
962
|
|
|
958
963
|
| Variable | Meaning |
|
|
959
964
|
| --- | --- |
|
|
960
|
-
| `CURSOR_API_KEY` | Cursor credential. It takes precedence over the stored login. |
|
|
965
|
+
| `CURSOR_API_KEY` | Cursor credential. It takes precedence over `CURSOR_API_KEY_FILE`, `CURSOR_SERVICE_ACCOUNT_KEY`, and the stored login. |
|
|
966
|
+
| `CURSOR_API_KEY_FILE` | Path to a Cursor credential file. Used when `CURSOR_API_KEY` is unset. When this variable is unset, the hosted default `/run/cursor/secrets/CURSOR_API_KEY` is tried. A present file takes precedence over `CURSOR_SERVICE_ACCOUNT_KEY` and the stored login. |
|
|
967
|
+
| `CURSOR_SERVICE_ACCOUNT_KEY` | Team service-account credential. Used when `CURSOR_API_KEY` and `CURSOR_API_KEY_FILE` (including the hosted default path) are unset. It takes precedence over the stored login. |
|
|
961
968
|
| `CURSOR_API_BASE_URL` | Backend used by login, account, deployment, and event-relay RPCs. |
|
|
962
969
|
| `CURSOR_BACKEND_URL` | Backend used by the Cursor SDK harness. |
|
|
963
970
|
| `AGENT_SERVE_CONFIG_DIR` | Directory for stored credentials and update-check state. Defaults to the CLI config directory under `~/.config`. |
|
|
@@ -224,7 +224,8 @@ Name the file `account.ts`. `cursor.ts` collides with the IDE `cursor`
|
|
|
224
224
|
MCP namespace. `advertiseTools: true` puts connector tools on local
|
|
225
225
|
turns by name. Without it they sit behind harness meta-tools.
|
|
226
226
|
|
|
227
|
-
The host must be signed in (`agent-sdk login` or
|
|
227
|
+
The host must be signed in (`agent-sdk login`, `CURSOR_API_KEY`, or
|
|
228
|
+
`CURSOR_SERVICE_ACCOUNT_KEY`).
|
|
228
229
|
`serve` fails fast at startup otherwise, and logs each connector's live
|
|
229
230
|
status (`connected`, `needsAuth`, `error`) as it starts.
|
|
230
231
|
|
|
@@ -265,6 +265,8 @@ Continue with these pages:
|
|
|
265
265
|
lets an agent launch and steer cloud agents
|
|
266
266
|
- [Cursor Grok Bot agents](../guides/grokbot-agents.md): the extension
|
|
267
267
|
that lets an agent talk to Grok Bot agents
|
|
268
|
+
- [Self-improvement](../guides/improve.md): the extension that lets an
|
|
269
|
+
agent change its own source through a cloud agent and a pull request
|
|
268
270
|
- [Tools](./tools.md): the tool contract extensions contribute to
|
|
269
271
|
- [Skills](./skills.md): the skill forms an extension can carry
|
|
270
272
|
- [Project layout](./project-layout.md): where `agent/extensions/` sits
|
|
@@ -113,7 +113,8 @@ Cursor checks the project in this order:
|
|
|
113
113
|
|
|
114
114
|
Validation, discovery, direct server-tool calls, and server startup work
|
|
115
115
|
without a Cursor credential. Model turns and evals need
|
|
116
|
-
`CURSOR_API_KEY`
|
|
116
|
+
`CURSOR_API_KEY`, then `CURSOR_API_KEY_FILE` (hosted default `/run/cursor/secrets/CURSOR_API_KEY`), then `CURSOR_SERVICE_ACCOUNT_KEY`, then a saved
|
|
117
|
+
`agent-sdk login`.
|
|
117
118
|
|
|
118
119
|
## What happens after the first agent works?
|
|
119
120
|
|
package/docs/troubleshooting.md
CHANGED
|
@@ -30,7 +30,7 @@ not on `PATH`, use `npx @cursor/july`.
|
|
|
30
30
|
| What you see | What to do |
|
|
31
31
|
| --- | --- |
|
|
32
32
|
| Built-in file reads and greps fail; the turn retries for a long time | Run under Node 22.13+ (or `tsx`), never Bun. Look for `NGHTTP2_FRAME_SIZE_ERROR` in logs. |
|
|
33
|
-
| The turn fails immediately with an API-key error | Sign in with `agent-sdk login`, or set `CURSOR_API_KEY`. Discovery, `info`, `call`, and serve bring-up work without a key; model turns need one. |
|
|
33
|
+
| The turn fails immediately with an API-key error | Sign in with `agent-sdk login`, or set `CURSOR_API_KEY` or `CURSOR_SERVICE_ACCOUNT_KEY`. Discovery, `info`, `call`, and serve bring-up work without a key; model turns need one. |
|
|
34
34
|
| Replies quote rules or `AGENTS.md` from outside your agent project | The session workspace inherited parent-folder config. Nested git checkouts default `local.cwd` to a per-project cache directory under `~/.cache`. Point `defineAgent({ local: { cwd } })` at a checkout only when the agent should inherit that tree, or set `--state-root` to a clean directory (for example under `/tmp`). |
|
|
35
35
|
| Yellow box shows Datadog/Linear tools, but the model lists `GetDynamicTools` / IDE `cursor` tools and never calls them | Attached MCP sits behind harness meta-tools, or the harness cwd is still inside another checkout. Set `advertiseTools: true` for named tools on local turns. Check `GET /v1/info` `local.cwd` and `connections[].advertiseTools`. |
|
|
36
36
|
| Server tools, skills, or workspace seed files never appear | Server tools and sandbox seeds apply on the local runtime (cloud server tools need `--public-url` / `--cloud-tools-url`). Skills reach cloud through the Agent Store when hosting or a personal `CURSOR_API_KEY` is available; otherwise only skills already in the cloud repo. `validate` warns when this combination is present. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cursor/july",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.108",
|
|
4
4
|
"description": "(early alpha) Filesystem-first framework for defining Cursor agents as markdown and TypeScript and serving them over channels with the Cursor SDK.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"repository": {
|
|
@@ -146,6 +146,13 @@
|
|
|
146
146
|
"import": "./dist/extensions/cursor-grokbot-agents/extension.js",
|
|
147
147
|
"default": "./dist/extensions/cursor-grokbot-agents/extension.js"
|
|
148
148
|
},
|
|
149
|
+
"./extensions/improve": {
|
|
150
|
+
"anysphere-source": "./src/extensions/improve/extension.ts",
|
|
151
|
+
"bun": "./dist/extensions/improve/extension.js",
|
|
152
|
+
"types": "./dist/extensions/improve/extension.d.ts",
|
|
153
|
+
"import": "./dist/extensions/improve/extension.js",
|
|
154
|
+
"default": "./dist/extensions/improve/extension.js"
|
|
155
|
+
},
|
|
149
156
|
"./schedules": {
|
|
150
157
|
"anysphere-source": "./src/schedules.ts",
|
|
151
158
|
"types": "./dist/schedules.d.ts",
|
|
@@ -133,7 +133,7 @@ npx tsc --noEmit -p ./<slug>
|
|
|
133
133
|
tsx does not typecheck. Tool `execute` must return JSON-shaped
|
|
134
134
|
values: object literals or `type` aliases, not `interface` types.
|
|
135
135
|
|
|
136
|
-
Model turns need `CURSOR_API_KEY
|
|
136
|
+
Model turns need a Cursor credential (`CURSOR_API_KEY`, then `CURSOR_API_KEY_FILE`, then `CURSOR_SERVICE_ACCOUNT_KEY`, then `agent-sdk login`). Without one, finish the
|
|
137
137
|
key-free checks, confirm `run` fails with only the API-key error,
|
|
138
138
|
and hand these over:
|
|
139
139
|
|
package/skills/debug/SKILL.md
CHANGED
|
@@ -34,7 +34,7 @@ Local `agent-sdk serve`. Hosted start or health failures:
|
|
|
34
34
|
| `403` on stream | Wrong principal. Same auth as create; beyond loopback send `--bearer-token`. |
|
|
35
35
|
| Works on loopback, blocked via tunnel | `localDevStrict()` rejects forwarded headers. Use `--bearer-token`. Never `--allow-anonymous` with account MCP. |
|
|
36
36
|
| Slack `channel idle … missing credentials` | Expected. `slack doctor --prefix <PREFIX>`. |
|
|
37
|
-
| Immediate API-key error | Model turns need `CURSOR_API_KEY
|
|
37
|
+
| Immediate API-key error | Model turns need a Cursor credential (`CURSOR_API_KEY`, then `CURSOR_API_KEY_FILE`, then `CURSOR_SERVICE_ACCOUNT_KEY`, then `agent-sdk login`). |
|
|
38
38
|
| Approvals or sandbox seeds missing | `runtime: "cloud"`. Those are local only. `validate` warns. |
|
|
39
39
|
| `validate` clean, CI typecheck fails | tsx skipped types. JSON-shaped returns; `type` not `interface`. |
|
|
40
40
|
|
package/skills/evals/SKILL.md
CHANGED
|
@@ -29,7 +29,7 @@ agent-sdk eval --dir . --tag smoke
|
|
|
29
29
|
| `evals/weather.eval.ts` + `{ id: "nyc" }` | `weather/nyc` |
|
|
30
30
|
|
|
31
31
|
`eval` boots an ephemeral server and a temp state root. `--url`
|
|
32
|
-
points at a running agent. Model turns need `CURSOR_API_KEY
|
|
32
|
+
points at a running agent. Model turns need a Cursor credential (`CURSOR_API_KEY`, then `CURSOR_API_KEY_FILE`, then `CURSOR_SERVICE_ACCOUNT_KEY`, then `agent-sdk login`).
|
|
33
33
|
|
|
34
34
|
## Seeding
|
|
35
35
|
|
|
@@ -28,8 +28,10 @@ Public docs: `node_modules/@cursor/july/dist/docs/llms.txt` or
|
|
|
28
28
|
per-project cache directory under `~/.cache`. Point cwd at a
|
|
29
29
|
checkout only when the agent must inherit that tree.
|
|
30
30
|
5. **Attached MCP is nameless** until `advertiseTools: true`.
|
|
31
|
-
6. **Model turns need
|
|
32
|
-
|
|
31
|
+
6. **Model turns need a Cursor credential** (`CURSOR_API_KEY`, then
|
|
32
|
+
`CURSOR_API_KEY_FILE`, then `CURSOR_SERVICE_ACCOUNT_KEY`, then
|
|
33
|
+
`agent-sdk login`). `validate`,
|
|
34
|
+
`info`, `call`, and `serve` bring-up do not.
|
|
33
35
|
|
|
34
36
|
## Folder structure
|
|
35
37
|
|
package/skills/github/SKILL.md
CHANGED
|
@@ -48,7 +48,7 @@ at deploy. Repos must share one GitHub owner.
|
|
|
48
48
|
|
|
49
49
|
| Source | When |
|
|
50
50
|
| --- | --- |
|
|
51
|
-
| `cursorAccount` + `serve --cursor-events` | Preferred. Signed-in host (`agent-sdk login`
|
|
51
|
+
| `cursorAccount` + `serve --cursor-events` | Preferred. Signed-in host (`agent-sdk login`, `CURSOR_API_KEY`, or `CURSOR_SERVICE_ACCOUNT_KEY`). Repos from the channel and from repeatable `--repo owner/name`. Cap 20, one GitHub owner |
|
|
52
52
|
| HTTP `POST /<slug>/v1/channels/github` with a webhook secret | `allowAll()` + `X-Hub-Signature-256` |
|
|
53
53
|
| HTTP, no secret | Loopback only. `serve --dev` also admits unsigned loopback (fixtures / forward) |
|
|
54
54
|
|
package/src/bin/agent-serve.ts
CHANGED
|
@@ -99,6 +99,7 @@ Usage:
|
|
|
99
99
|
${CLI} session <sessionId> [--url <baseUrl> | --prod]
|
|
100
100
|
[--json | --text | --events] [--out <file.ndjson>]
|
|
101
101
|
[--slug <slug>] [--team <id>] [--dir <path>]
|
|
102
|
+
or: --prod [<sessionId>] --slug <slug> --message "…" [--dry-run] [--as-of <instant>]
|
|
102
103
|
${CLI} cost [sessionId] [--url <baseUrl> | --prod] [--json]
|
|
103
104
|
[--slug <slug>] [--team <id>] [--dir <path>]
|
|
104
105
|
${CLI} playground [--url <baseUrl> | --prod] [--session <id>] [--print]
|
|
@@ -108,6 +109,7 @@ Usage:
|
|
|
108
109
|
[--session <id>] [--continuation-token <t>]
|
|
109
110
|
[--events <file.ndjson>] [--no-events] [--text]
|
|
110
111
|
[--timeout-ms <n>] [--no-stream] [--slug <slug>] [--team <id>]
|
|
112
|
+
[--dry-run] [--as-of <instant>]
|
|
111
113
|
${CLI} trajectory --events <file.ndjson> [--text]
|
|
112
114
|
${CLI} call <tool> [--input <json>] [--dir <path> | --url <baseUrl> | --prod]
|
|
113
115
|
[--session <id>] [--slug <slug>] [--team <id>]
|
|
@@ -197,6 +199,10 @@ Commands:
|
|
|
197
199
|
Writes a single events.ndjson trace (summarize with trajectory).
|
|
198
200
|
Streams tool calls and reply text to stderr when stderr is a TTY.
|
|
199
201
|
Pass --prod to hit the hosted deployment instead of a local server.
|
|
202
|
+
On an AgentSDK v2 slug, --prod starts a hosted session through
|
|
203
|
+
the control plane (Temporal, no resident engine); --session
|
|
204
|
+
ses_… resumes that exact session. A 404 falls back to the v1
|
|
205
|
+
engine alias.
|
|
200
206
|
trajectory Summarize an events.ndjson file into a trajectory.
|
|
201
207
|
call Call an authored server tool deterministically (no model turn)
|
|
202
208
|
via POST /v1/tools/:toolName. --session runs it inside an
|
|
@@ -311,8 +317,11 @@ Options:
|
|
|
311
317
|
ALB/ECS checks; use single when one agent is the whole host.
|
|
312
318
|
--dev Dev mode: mounts POST /v1/dev/schedules/:scheduleId and
|
|
313
319
|
disables the cron runner (dispatch schedules by hand).
|
|
314
|
-
--api-key Cursor API key (defaults to CURSOR_API_KEY, then
|
|
315
|
-
|
|
320
|
+
--api-key Cursor API key (defaults to CURSOR_API_KEY, then
|
|
321
|
+
CURSOR_API_KEY_FILE — hosted default
|
|
322
|
+
/run/cursor/secrets/CURSOR_API_KEY when unset —
|
|
323
|
+
then CURSOR_SERVICE_ACCOUNT_KEY, then the stored
|
|
324
|
+
\`${CLI} login\` credential).
|
|
316
325
|
--key-name login: label for the minted API key (defaults to
|
|
317
326
|
"${CLI} (<hostname>)").
|
|
318
327
|
--state-root Durable state directory (default <dir>/.agent-serve). Put it
|
|
@@ -361,6 +370,9 @@ Options:
|
|
|
361
370
|
--dir basename. Mutually exclusive with --url. Requires
|
|
362
371
|
\`${CLI} login\`. For eval, this is how you opt into the
|
|
363
372
|
persisted server-side batch (default is local).
|
|
373
|
+
--dry-run run/session --prod: mark the hosted v2 turn non-mutating.
|
|
374
|
+
--as-of run/session --prod: freeze the session clock at this
|
|
375
|
+
timezone-bearing ISO-8601 instant.
|
|
364
376
|
--once logs: print current progress / log buffer once and exit
|
|
365
377
|
(default is to follow).
|
|
366
378
|
--print playground/docs: print the URL only; do not open a
|
|
@@ -571,6 +583,7 @@ async function main(argv: string[]): Promise<number> {
|
|
|
571
583
|
context: { type: "string" },
|
|
572
584
|
comment: { type: "string" },
|
|
573
585
|
"dry-run": { type: "boolean", default: false },
|
|
586
|
+
"as-of": { type: "string" },
|
|
574
587
|
out: { type: "string" },
|
|
575
588
|
team: { type: "string" },
|
|
576
589
|
"no-wait": { type: "boolean", default: false },
|
|
@@ -914,6 +927,8 @@ async function main(argv: string[]): Promise<number> {
|
|
|
914
927
|
stateRoot: values["state-root"],
|
|
915
928
|
timeoutMs: parseTimeoutMs(values["timeout-ms"]),
|
|
916
929
|
stream: values["no-stream"] ? false : undefined,
|
|
930
|
+
dryRun: values["dry-run"],
|
|
931
|
+
asOf: values["as-of"],
|
|
917
932
|
})
|
|
918
933
|
);
|
|
919
934
|
}
|
|
@@ -1094,6 +1109,10 @@ async function main(argv: string[]): Promise<number> {
|
|
|
1094
1109
|
}
|
|
1095
1110
|
|
|
1096
1111
|
case "session": {
|
|
1112
|
+
const messages = await loadMessages(
|
|
1113
|
+
values.message,
|
|
1114
|
+
values["messages-file"]
|
|
1115
|
+
);
|
|
1097
1116
|
return cmdSession(
|
|
1098
1117
|
positionals[0],
|
|
1099
1118
|
axFromOptions({
|
|
@@ -1108,6 +1127,10 @@ async function main(argv: string[]): Promise<number> {
|
|
|
1108
1127
|
text: values.text,
|
|
1109
1128
|
rawEvents: values["raw-events"],
|
|
1110
1129
|
out: values.out,
|
|
1130
|
+
messages,
|
|
1131
|
+
sessionId: values["session-id"] ?? values.session,
|
|
1132
|
+
dryRun: values["dry-run"],
|
|
1133
|
+
asOf: values["as-of"],
|
|
1111
1134
|
})
|
|
1112
1135
|
);
|
|
1113
1136
|
}
|
|
@@ -1488,6 +1511,8 @@ function axFromOptions(
|
|
|
1488
1511
|
sessionId: partial.sessionId,
|
|
1489
1512
|
resume: partial.resume,
|
|
1490
1513
|
continuationToken: partial.continuationToken,
|
|
1514
|
+
dryRun: partial.dryRun,
|
|
1515
|
+
asOf: partial.asOf,
|
|
1491
1516
|
timeoutMs: partial.timeoutMs,
|
|
1492
1517
|
events: partial.events,
|
|
1493
1518
|
text: partial.text,
|
|
@@ -831,11 +831,9 @@ async function handlePullRequest(input: {
|
|
|
831
831
|
dispatch.message ?? defaultGitHubPullRequestMessage(ctx, pullRequest),
|
|
832
832
|
...(dispatch.context ?? []),
|
|
833
833
|
].join("\n");
|
|
834
|
-
const cloud =
|
|
835
|
-
|
|
836
|
-
ctx,
|
|
837
|
-
pullRequest
|
|
838
|
-
);
|
|
834
|
+
const cloud =
|
|
835
|
+
dispatch.cloud ??
|
|
836
|
+
(await resolveCloudOptions(input.options.cloud, ctx, pullRequest));
|
|
839
837
|
return startTurn({
|
|
840
838
|
options: input.options,
|
|
841
839
|
args: input.args,
|
|
@@ -1558,6 +1556,8 @@ async function startTurn(input: {
|
|
|
1558
1556
|
}): Promise<Response> {
|
|
1559
1557
|
const files = input.dispatch.workspaceFiles;
|
|
1560
1558
|
const lazy = typeof files === "function";
|
|
1559
|
+
const cloud = input.dispatch.cloud ?? input.cloud;
|
|
1560
|
+
const state = { ...input.dispatch.state, ...input.state };
|
|
1561
1561
|
|
|
1562
1562
|
const sendTurn = async () => {
|
|
1563
1563
|
const workspaceFiles = lazy ? await files() : files;
|
|
@@ -1568,11 +1568,11 @@ async function startTurn(input: {
|
|
|
1568
1568
|
? { continuationToken: githubContinuationKey(input.ctx) }
|
|
1569
1569
|
: {}),
|
|
1570
1570
|
title: input.dispatch.title ?? defaultGitHubTitle(input.ctx),
|
|
1571
|
-
|
|
1571
|
+
cloud,
|
|
1572
1572
|
...(workspaceFiles === undefined ? {} : { workspaceFiles }),
|
|
1573
|
-
state:
|
|
1573
|
+
state: state as unknown as JsonValue,
|
|
1574
1574
|
// Resume must refresh headSha / refs without wiping sticky banner id.
|
|
1575
|
-
refreshState:
|
|
1575
|
+
refreshState: state as unknown as JsonValue,
|
|
1576
1576
|
});
|
|
1577
1577
|
};
|
|
1578
1578
|
|
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
ChannelEventHandlers,
|
|
8
8
|
ChannelStartArgs,
|
|
9
9
|
HostContext,
|
|
10
|
+
JsonObject,
|
|
10
11
|
SendMessageFn,
|
|
11
12
|
SendMessageOptions,
|
|
12
13
|
} from "../../types.js";
|
|
@@ -355,6 +356,10 @@ export interface GitHubTurnDispatch {
|
|
|
355
356
|
message?: string;
|
|
356
357
|
/** Optional session title override. */
|
|
357
358
|
title?: string;
|
|
359
|
+
/** Per-turn cloud options. Overrides the channel-level `cloud` resolver. */
|
|
360
|
+
cloud?: AgentCloudOptions;
|
|
361
|
+
/** Extra durable channel state. Provider-owned fields take precedence. */
|
|
362
|
+
state?: JsonObject;
|
|
358
363
|
/**
|
|
359
364
|
* Seeded into the session workspace before the turn (`send`'s
|
|
360
365
|
* `workspaceFiles`). A function runs after the webhook is
|
|
@@ -99,13 +99,20 @@ function asBoolean(value: unknown): boolean | undefined {
|
|
|
99
99
|
function originActor(value: unknown): OriginActor | undefined {
|
|
100
100
|
const record = asRecord(value);
|
|
101
101
|
if (record === undefined) return undefined;
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
102
|
+
|
|
103
|
+
const nestedActors = [
|
|
104
|
+
["user", asRecord(record.user)],
|
|
105
|
+
["app", asRecord(record.app)],
|
|
106
|
+
["service_account", asRecord(record.serviceAccount)],
|
|
107
|
+
] as const;
|
|
108
|
+
for (const [kind, actor] of nestedActors) {
|
|
109
|
+
const id = asNonEmptyString(actor?.id);
|
|
110
|
+
if (id !== undefined) {
|
|
111
|
+
return { id, kind };
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const id = asNonEmptyString(record.id);
|
|
109
116
|
if (id === undefined) return undefined;
|
|
110
117
|
const kind = asNonEmptyString(record.kind);
|
|
111
118
|
return kind === undefined ? { id } : { id, kind };
|
|
@@ -361,16 +368,20 @@ export function defaultOriginAuth(
|
|
|
361
368
|
ctx: Omit<OriginEventContext, "host" | "artifacts" | "origin">
|
|
362
369
|
): AuthContext {
|
|
363
370
|
const senderId = ctx.sender?.id;
|
|
371
|
+
const senderKind = ctx.sender?.kind;
|
|
364
372
|
return {
|
|
365
373
|
authenticator: "origin-webhook",
|
|
366
374
|
principalId: senderId ?? "origin",
|
|
367
|
-
principalType:
|
|
375
|
+
principalType:
|
|
376
|
+
senderKind === "app" || senderKind === "service_account"
|
|
377
|
+
? "service"
|
|
378
|
+
: "user",
|
|
368
379
|
attributes: {
|
|
369
380
|
conversation_kind: "pull_request",
|
|
370
381
|
repository: ctx.repository.fullName,
|
|
371
382
|
...(ctx.deliveryId === undefined ? {} : { delivery_id: ctx.deliveryId }),
|
|
372
383
|
...(senderId === undefined ? {} : { subject: senderId }),
|
|
373
|
-
...(
|
|
384
|
+
...(senderKind === undefined ? {} : { user_type: senderKind }),
|
|
374
385
|
issuer: `origin:${ctx.repository.owner}`,
|
|
375
386
|
},
|
|
376
387
|
};
|
|
@@ -461,17 +472,19 @@ async function startTurn(input: {
|
|
|
461
472
|
state: OriginChannelState;
|
|
462
473
|
}): Promise<Response> {
|
|
463
474
|
const source = continuationSource(input.options.continuation, "origin");
|
|
475
|
+
const cloud = input.dispatch.cloud ?? input.cloud;
|
|
476
|
+
const state = { ...input.dispatch.state, ...input.state };
|
|
464
477
|
const session = await input.args.send(input.message, {
|
|
465
478
|
auth: input.dispatch.auth,
|
|
466
479
|
...(source === "engine"
|
|
467
480
|
? { continuationToken: originContinuationKey(input.ctx) }
|
|
468
481
|
: {}),
|
|
469
482
|
title: input.dispatch.title ?? defaultOriginTitle(input.ctx),
|
|
470
|
-
|
|
471
|
-
state:
|
|
483
|
+
cloud,
|
|
484
|
+
state: state as unknown as JsonValue,
|
|
472
485
|
// Resume must refresh the triggering comment / delivery identifiers so
|
|
473
486
|
// reply delivery targets the latest wake, not the session's first.
|
|
474
|
-
refreshState:
|
|
487
|
+
refreshState: state as unknown as JsonValue,
|
|
475
488
|
});
|
|
476
489
|
return turnStarted(session);
|
|
477
490
|
}
|
|
@@ -605,7 +618,10 @@ export async function dispatchOriginWebhook(input: {
|
|
|
605
618
|
ctx,
|
|
606
619
|
dispatch,
|
|
607
620
|
extra: { event: eventType },
|
|
608
|
-
message:
|
|
621
|
+
message:
|
|
622
|
+
commentBody.trim() === ""
|
|
623
|
+
? `Origin comment on ${ctx.repository.fullName}#${ctx.pullRequestNumber}`
|
|
624
|
+
: commentBody.trim(),
|
|
609
625
|
triggeringCommentId: commentId,
|
|
610
626
|
});
|
|
611
627
|
}
|
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
ChannelEventHandlers,
|
|
8
8
|
ChannelStartArgs,
|
|
9
9
|
HostContext,
|
|
10
|
+
JsonObject,
|
|
10
11
|
SendMessageFn,
|
|
11
12
|
} from "../../types.js";
|
|
12
13
|
import type { OriginTokenProvider } from "./api.js";
|
|
@@ -95,6 +96,10 @@ export type OriginTurnDispatch = {
|
|
|
95
96
|
message?: string;
|
|
96
97
|
title?: string;
|
|
97
98
|
context?: readonly string[];
|
|
99
|
+
/** Per-turn cloud options. Overrides the channel-level `cloud` resolver. */
|
|
100
|
+
cloud?: AgentCloudOptions;
|
|
101
|
+
/** Extra durable channel state. Provider-owned fields take precedence. */
|
|
102
|
+
state?: JsonObject;
|
|
98
103
|
};
|
|
99
104
|
|
|
100
105
|
/** Bound per-delivery helpers passed to an {@link OriginTaskDispatch.task}. */
|