@cursor/july 0.1.96 → 0.1.97
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 +3 -2
- package/dist/bin/agent-serve.js +14 -3
- package/dist/channels/origin/api.d.ts +15 -4
- package/dist/channels/origin/api.d.ts.map +1 -1
- package/dist/channels/origin/api.js +19 -3
- package/dist/channels/origin/binding.d.ts +11 -0
- package/dist/channels/origin/binding.d.ts.map +1 -1
- package/dist/channels/origin/binding.js +41 -25
- package/dist/channels/origin/index.d.ts +1 -0
- package/dist/channels/origin/index.d.ts.map +1 -1
- package/dist/channels/origin/index.js +1 -0
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +3 -0
- package/dist/channels/origin/reactions.d.ts +56 -0
- package/dist/channels/origin/reactions.d.ts.map +1 -0
- package/dist/channels/origin/reactions.js +67 -0
- package/dist/channels/origin/types.d.ts +11 -0
- package/dist/channels/origin/types.d.ts.map +1 -1
- package/dist/channels/slack/approvals.d.ts +16 -0
- package/dist/channels/slack/approvals.d.ts.map +1 -1
- package/dist/channels/slack/approvals.js +86 -0
- package/dist/channels/slack/cli-project.d.ts +19 -0
- package/dist/channels/slack/cli-project.d.ts.map +1 -0
- package/dist/channels/slack/cli-project.js +234 -0
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +97 -39
- package/dist/channels/slack/init.d.ts +3 -2
- package/dist/channels/slack/init.d.ts.map +1 -1
- package/dist/channels/slack/init.js +5 -5
- package/dist/channels/slack/interactive.d.ts +2 -1
- package/dist/channels/slack/interactive.d.ts.map +1 -1
- package/dist/channels/slack/interactive.js +15 -4
- package/dist/channels/slack/manifest.d.ts +1 -1
- package/dist/channels/slack/manifest.js +1 -1
- package/dist/channels/slack/setup.d.ts +1 -1
- package/dist/channels/slack/setup.d.ts.map +1 -1
- package/dist/channels/slack/setup.js +10 -6
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +1 -0
- package/dist/channels/slack/tool-approval-events.d.ts.map +1 -1
- package/dist/channels/slack/tool-approval-events.js +91 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.jXleCmOc.js → app.B3rWNYE1.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.BU9nHdnQ.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.8LhyglIT.js → VPLocalSearchBox.C1lhqJJR.js} +1 -1
- package/dist/docs/assets/chunks/{theme.9ged-pr2.js → theme.B40_SXuv.js} +2 -2
- package/dist/docs/assets/{deployment.md.D9msOFOW.js → deployment.md.MFPKqsqI.js} +2 -2
- package/dist/docs/assets/{guides_mcp-oauth.md.DPYmBCbV.js → guides_mcp-oauth.md.CN-6YmTJ.js} +4 -4
- package/dist/docs/assets/{guides_mcp-oauth.md.DPYmBCbV.lean.js → guides_mcp-oauth.md.CN-6YmTJ.lean.js} +1 -1
- package/dist/docs/assets/guides_slack.md.VDXQV3ja.js +22 -0
- package/dist/docs/assets/guides_slack.md.VDXQV3ja.lean.js +1 -0
- package/dist/docs/assets/index.md.CVeRUOeZ.js +5 -0
- package/dist/docs/assets/{reference_agent-config.md.Cp_x38Nl.js → reference_agent-config.md.BHeYMgme.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.CCnG-nJx.js → reference_cli.md.RyZf5OTE.js} +9 -6
- package/dist/docs/assets/{reference_cli.md.CCnG-nJx.lean.js → reference_cli.md.RyZf5OTE.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.BH8Oc0D0.js → reference_connections.md.DxldvyIB.js} +4 -3
- package/dist/docs/assets/{reference_http-api.md.D89k1mdm.js → reference_http-api.md.5zOAbV86.js} +1 -1
- package/dist/docs/assets/reference_sessions.md.NxFP_CAC.js +1 -0
- package/dist/docs/assets/{reference_tools.md.BHeXn2id.js → reference_tools.md.B84gw9Ii.js} +1 -1
- package/dist/docs/assets/templates_agents-md.md.CXSMZljE.js +2 -0
- package/dist/docs/assets/templates_agents-md.md.CXSMZljE.lean.js +1 -0
- package/dist/docs/assets/troubleshooting.md.DCiPBhYs.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 +5 -4
- package/dist/docs/evals.html +4 -4
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-runtime.html +4 -4
- package/dist/docs/guides/convert-automation.html +4 -4
- package/dist/docs/guides/github.html +4 -4
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +8 -8
- package/dist/docs/guides/mcp-oauth.md +26 -8
- package/dist/docs/guides/opentelemetry.html +4 -4
- package/dist/docs/guides/slack.html +17 -33
- package/dist/docs/guides/slack.md +92 -201
- package/dist/docs/guides/webhooks.html +4 -4
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +4 -4
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +5 -3
- package/dist/docs/llms-full.txt +299 -653
- package/dist/docs/llms.txt +2 -2
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +6 -6
- package/dist/docs/reference/agent-config.md +2 -2
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +4 -4
- package/dist/docs/reference/cli.html +13 -10
- package/dist/docs/reference/cli.md +38 -16
- package/dist/docs/reference/connections.html +9 -8
- package/dist/docs/reference/connections.md +6 -3
- package/dist/docs/reference/hooks.html +4 -4
- package/dist/docs/reference/http-api.html +6 -6
- package/dist/docs/reference/http-api.md +2 -1
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +4 -4
- package/dist/docs/reference/project-layout.html +4 -4
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +5 -5
- package/dist/docs/reference/sessions.md +4 -2
- package/dist/docs/reference/skills.html +4 -4
- package/dist/docs/reference/subagents.html +4 -4
- package/dist/docs/reference/tools.html +6 -6
- package/dist/docs/reference/tools.md +9 -2
- package/dist/docs/scaffolding-agents.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 +28 -0
- package/dist/docs/templates/agents-md.md +105 -0
- package/dist/docs/templates/code-wiki.html +5 -5
- package/dist/docs/templates/demo.html +4 -4
- package/dist/docs/templates/pr-autofixer.html +4 -4
- package/dist/docs/templates/security-help.html +4 -4
- package/dist/docs/templates/security-reviewer.html +5 -5
- package/dist/docs/templates/triage.html +4 -4
- package/dist/docs/troubleshooting.html +5 -5
- package/dist/docs/troubleshooting.md +2 -2
- package/dist/evals/run-facts.d.ts.map +1 -1
- package/dist/evals/run-facts.js +27 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +15 -9
- package/dist/internal/approval-gate.d.ts +12 -13
- package/dist/internal/approval-gate.d.ts.map +1 -1
- package/dist/internal/approval-gate.js +16 -21
- package/dist/internal/chat-client.js +10 -0
- package/dist/internal/cli-deploy.d.ts +5 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +50 -17
- package/dist/internal/cli-mcp-oauth.js +8 -18
- package/dist/internal/cli-slack-manual.d.ts +24 -2
- package/dist/internal/cli-slack-manual.d.ts.map +1 -1
- package/dist/internal/cli-slack-manual.js +251 -20
- package/dist/internal/cli-slack.d.ts +9 -2
- package/dist/internal/cli-slack.d.ts.map +1 -1
- package/dist/internal/cli-slack.js +29 -82
- package/dist/internal/cursor/account-mcp.d.ts +1 -0
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
- package/dist/internal/cursor/account-mcp.js +17 -0
- package/dist/internal/cursor-agent-template.d.ts +1 -1
- package/dist/internal/cursor-agent-template.d.ts.map +1 -1
- package/dist/internal/cursor-agent-template.js +1 -0
- package/dist/internal/deploy-client.d.ts +17 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +31 -10
- package/dist/internal/env-file.d.ts +19 -0
- package/dist/internal/env-file.d.ts.map +1 -0
- package/dist/internal/env-file.js +90 -0
- package/dist/internal/framework-file-storage.d.ts +1 -1
- package/dist/internal/framework-file-storage.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.js +6 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +7 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +7 -0
- package/dist/internal/hosted-delivery.d.ts +6 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +63 -22
- package/dist/internal/hosted-execution-diag.d.ts +48 -0
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -0
- package/dist/internal/hosted-execution-diag.js +150 -0
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +81 -1
- package/dist/internal/init-project.d.ts.map +1 -1
- package/dist/internal/init-project.js +2 -0
- package/dist/internal/logs-client.d.ts +5 -0
- package/dist/internal/logs-client.d.ts.map +1 -1
- package/dist/internal/logs-client.js +5 -0
- package/dist/internal/mcp-endpoint.js +2 -3
- package/dist/internal/mcp-host.d.ts +10 -0
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +57 -8
- package/dist/internal/mcp-oauth-on-demand.d.ts +68 -0
- package/dist/internal/mcp-oauth-on-demand.d.ts.map +1 -0
- package/dist/internal/mcp-oauth-on-demand.js +287 -0
- package/dist/internal/mcp-oauth-persist.d.ts +42 -0
- package/dist/internal/mcp-oauth-persist.d.ts.map +1 -0
- package/dist/internal/mcp-oauth-persist.js +92 -0
- package/dist/internal/mcp-oauth.d.ts +1 -0
- package/dist/internal/mcp-oauth.d.ts.map +1 -1
- package/dist/internal/mcp-oauth.js +10 -2
- package/dist/internal/otel/collector.d.ts.map +1 -1
- package/dist/internal/otel/collector.js +22 -9
- package/dist/internal/server.d.ts +3 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +49 -22
- package/dist/internal/session-engine.d.ts +88 -3
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +515 -43
- package/dist/internal/sessions-client.d.ts +9 -7
- package/dist/internal/sessions-client.d.ts.map +1 -1
- package/dist/internal/sessions-client.js +3 -1
- package/dist/internal/storage-coordinator.d.ts +7 -0
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +28 -5
- package/dist/internal/storage-roles.d.ts +5 -0
- package/dist/internal/storage-roles.d.ts.map +1 -1
- package/dist/internal/stream-progress.d.ts.map +1 -1
- package/dist/internal/stream-progress.js +10 -0
- package/dist/internal/tool-policy.d.ts +9 -1
- package/dist/internal/tool-policy.d.ts.map +1 -1
- package/dist/internal/tool-policy.js +13 -0
- package/dist/internal/trajectory.d.ts.map +1 -1
- package/dist/internal/trajectory.js +10 -0
- package/dist/internal/turn-outbox.d.ts +24 -0
- package/dist/internal/turn-outbox.d.ts.map +1 -0
- package/dist/internal/turn-outbox.js +80 -0
- package/dist/playground/assets/{index-Cx9CclK_.js → index-DrkI6y5O.js} +45 -45
- package/dist/playground/assets/index-DzNGwm7q.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted.d.ts +1 -1
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +12 -0
- package/dist/storage.d.ts +8 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/types.d.ts +63 -7
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +5 -3
- package/docs/deployment.md +5 -4
- package/docs/guides/mcp-oauth.md +26 -8
- package/docs/guides/slack.md +93 -202
- package/docs/reference/agent-config.md +2 -2
- package/docs/reference/cli.md +38 -16
- package/docs/reference/connections.md +6 -3
- package/docs/reference/http-api.md +2 -1
- package/docs/reference/sessions.md +4 -2
- package/docs/reference/tools.md +9 -2
- package/docs/templates/agents-md.md +110 -0
- package/docs/troubleshooting.md +2 -2
- package/package.json +1 -1
- package/skills/create-agent/SKILL.md +2 -1
- package/skills/mcp-auth/SKILL.md +6 -3
- package/skills/setup-slack/SKILL.md +23 -13
- package/src/bin/agent-serve.ts +13 -1
- package/src/channels/origin/api.ts +24 -5
- package/src/channels/origin/binding.ts +55 -26
- package/src/channels/origin/index.ts +1 -0
- package/src/channels/origin/origin-channel.ts +4 -0
- package/src/channels/origin/reactions.ts +82 -0
- package/src/channels/origin/types.ts +11 -0
- package/src/channels/slack/approvals.ts +105 -0
- package/src/channels/slack/cli-project.ts +267 -0
- package/src/channels/slack/defaults.ts +109 -46
- package/src/channels/slack/init.ts +10 -5
- package/src/channels/slack/interactive.ts +35 -9
- package/src/channels/slack/manifest.ts +1 -1
- package/src/channels/slack/setup.ts +10 -6
- package/src/channels/slack/slack-channel.ts +1 -0
- package/src/channels/slack/tool-approval-events.ts +93 -0
- package/src/evals/run-facts.ts +32 -0
- package/src/internal/advertise-tools.ts +31 -10
- package/src/internal/approval-gate.ts +20 -29
- package/src/internal/chat-client.ts +19 -0
- package/src/internal/cli-deploy.ts +79 -9
- package/src/internal/cli-mcp-oauth.ts +7 -21
- package/src/internal/cli-slack-manual.ts +350 -18
- package/src/internal/cli-slack.ts +40 -84
- package/src/internal/cursor/account-mcp.ts +21 -0
- package/src/internal/cursor-agent-template.ts +1 -0
- package/src/internal/deploy-client.ts +43 -0
- package/src/internal/env-file.ts +84 -0
- package/src/internal/framework-file-storage.ts +7 -1
- package/src/internal/hosted-delivery-protocol.ts +7 -0
- package/src/internal/hosted-delivery.ts +100 -27
- package/src/internal/hosted-execution-diag.ts +207 -0
- package/src/internal/http-channel.ts +99 -0
- package/src/internal/init-project.ts +2 -0
- package/src/internal/logs-client.ts +5 -0
- package/src/internal/mcp-endpoint.ts +13 -4
- package/src/internal/mcp-host.ts +77 -11
- package/src/internal/mcp-oauth-on-demand.ts +352 -0
- package/src/internal/mcp-oauth-persist.ts +127 -0
- package/src/internal/mcp-oauth.ts +17 -1
- package/src/internal/otel/collector.ts +30 -0
- package/src/internal/server.ts +59 -9
- package/src/internal/session-engine.ts +659 -56
- package/src/internal/sessions-client.ts +17 -8
- package/src/internal/storage-coordinator.ts +38 -8
- package/src/internal/storage-roles.ts +7 -0
- package/src/internal/stream-progress.ts +19 -0
- package/src/internal/tool-policy.ts +18 -0
- package/src/internal/trajectory.ts +10 -0
- package/src/internal/turn-outbox.ts +85 -0
- package/src/storage-backends/cursor-hosted.ts +13 -1
- package/src/storage.ts +12 -0
- package/src/types.ts +68 -8
- package/templates/agents-md/README.md +39 -0
- package/templates/agents-md/agent/agent.ts +8 -0
- package/templates/agents-md/agent/channels/github.ts +10 -0
- package/templates/agents-md/agent/channels/queue.ts +28 -0
- package/templates/agents-md/agent/channels/slack.ts +9 -0
- package/templates/agents-md/agent/instructions.md +39 -0
- package/templates/agents-md/agent/lib/collect.ts +439 -0
- package/templates/agents-md/agent/lib/config.ts +8 -0
- package/templates/agents-md/agent/lib/paths.ts +51 -0
- package/templates/agents-md/agent/schedules/weekly.ts +17 -0
- package/templates/agents-md/agent/tools/apply_agents.ts +226 -0
- package/templates/agents-md/evals/agents.eval.ts +135 -0
- package/templates/agents-md/evals/evals.config.ts +5 -0
- package/templates/agents-md/init.json +38 -0
- package/templates/agents-md/package.json +18 -0
- package/templates/agents-md/tsconfig.json +12 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.DFoGuETX.js +0 -1
- package/dist/docs/assets/guides_slack.md.C32HsdKk.js +0 -38
- package/dist/docs/assets/guides_slack.md.C32HsdKk.lean.js +0 -1
- package/dist/docs/assets/index.md.CI93Ltlb.js +0 -5
- package/dist/docs/assets/reference_sessions.md.D0mIh4KK.js +0 -1
- package/dist/docs/assets/troubleshooting.md.Ctv3T8C2.js +0 -1
- package/dist/docs/design/agsh.md +0 -406
- package/dist/playground/assets/index-B1DDvBeC.css +0 -1
- package/docs/design/agsh.md +0 -406
- /package/dist/docs/assets/{deployment.md.D9msOFOW.lean.js → deployment.md.MFPKqsqI.lean.js} +0 -0
- /package/dist/docs/assets/{index.md.CI93Ltlb.lean.js → index.md.CVeRUOeZ.lean.js} +0 -0
- /package/dist/docs/assets/{reference_agent-config.md.Cp_x38Nl.lean.js → reference_agent-config.md.BHeYMgme.lean.js} +0 -0
- /package/dist/docs/assets/{reference_connections.md.BH8Oc0D0.lean.js → reference_connections.md.DxldvyIB.lean.js} +0 -0
- /package/dist/docs/assets/{reference_http-api.md.D89k1mdm.lean.js → reference_http-api.md.5zOAbV86.lean.js} +0 -0
- /package/dist/docs/assets/{reference_sessions.md.D0mIh4KK.lean.js → reference_sessions.md.NxFP_CAC.lean.js} +0 -0
- /package/dist/docs/assets/{reference_tools.md.BHeXn2id.lean.js → reference_tools.md.B84gw9Ii.lean.js} +0 -0
- /package/dist/docs/assets/{troubleshooting.md.Ctv3T8C2.lean.js → troubleshooting.md.DCiPBhYs.lean.js} +0 -0
package/dist/docs/llms-full.txt
CHANGED
|
@@ -693,9 +693,10 @@ use `UPPER_SNAKE_CASE`. Commit names only; set their values after
|
|
|
693
693
|
creating the deployment. Names beginning with `CURSOR_` are reserved.
|
|
694
694
|
|
|
695
695
|
For `defineConnection({ url, oauth: true })`, declare
|
|
696
|
-
`MCP_OAUTH_<CONNECTION>_*` in `secretNames
|
|
697
|
-
`agent-sdk mcp oauth <connection> --store
|
|
698
|
-
|
|
696
|
+
`MCP_OAUTH_<CONNECTION>_*` in `secretNames`. Finish Connect for the
|
|
697
|
+
current process. Run `agent-sdk mcp oauth <connection> --store` and
|
|
698
|
+
redeploy so the next pod sees the secrets.
|
|
699
|
+
See [Host MCP OAuth](/docs/guides/mcp-oauth.md).
|
|
699
700
|
|
|
700
701
|
Run `agent-sdk validate` before deploying. It reports invalid domains and
|
|
701
702
|
secret names as warnings, so fix them even when validation exits zero.
|
|
@@ -943,7 +944,7 @@ A self-hosted server can read these credentials.
|
|
|
943
944
|
| Slack tokens | Slack channels | `<PREFIX>_SLACK_BOT_TOKEN` + `<PREFIX>_SLACK_APP_TOKEN` per agent |
|
|
944
945
|
| GitHub webhook secret | delivery signature verification | `GITHUB_WEBHOOK_SECRET`, same value on server and signer |
|
|
945
946
|
| GitHub API | outbound API calls | a GitHub App (`GITHUB_APP_ID` + `GITHUB_APP_PRIVATE_KEY` + installation id) or `GITHUB_TOKEN` / `gh auth login` |
|
|
946
|
-
| MCP connection tokens | authored MCP connections | env vars your `mcp-connections/*.ts` read, or host OAuth secrets from `agent-sdk mcp oauth <name> --store` (`MCP_OAUTH_*`; see [Host MCP OAuth](/docs/guides/mcp-oauth.md)) |
|
|
947
|
+
| MCP connection tokens | authored MCP connections | env vars your `mcp-connections/*.ts` read, or host OAuth secrets from hosted Connect / `agent-sdk mcp oauth <name> --store` (`MCP_OAUTH_*`; see [Host MCP OAuth](/docs/guides/mcp-oauth.md)) |
|
|
947
948
|
|
|
948
949
|
Use a dedicated Cursor key per host. `agent-sdk whoami` shows the active
|
|
949
950
|
credential. `logout` removes the stored key from the host; revoke the key
|
|
@@ -1087,417 +1088,6 @@ Continue with these pages:
|
|
|
1087
1088
|
|
|
1088
1089
|
---
|
|
1089
1090
|
|
|
1090
|
-
Source: /docs/design/agsh.md
|
|
1091
|
-
|
|
1092
|
-
# agsh: a shell for deployed agents
|
|
1093
|
-
|
|
1094
|
-
## What this is
|
|
1095
|
-
|
|
1096
|
-
`agsh` (agent shell) is a standalone CLI that connects to one agent-sdk
|
|
1097
|
-
deployment and turns the agent's live tool surface into commands. Every tool
|
|
1098
|
-
the deployment can execute (authored server tools and tools provided by the
|
|
1099
|
-
agent's MCP connections) becomes a subcommand with a synopsis derived from its
|
|
1100
|
-
input schema, a man-page style `--help`, and a place in an interactive shell.
|
|
1101
|
-
|
|
1102
|
-
It is a separate binary and a separate package from `agent-sdk`. The
|
|
1103
|
-
`agent-sdk` CLI stays what it is today: the developer workflow tool for
|
|
1104
|
-
authoring, validating, deploying, and debugging agent projects. `agsh` is the
|
|
1105
|
-
operator's tool for working *inside* one deployed agent. The split also keeps
|
|
1106
|
-
heavy presentation dependencies (markdown rendering, syntax highlighting, the
|
|
1107
|
-
shell interpreter) out of `@cursor/july`, which ships to every agent project.
|
|
1108
|
-
|
|
1109
|
-
## The experience
|
|
1110
|
-
|
|
1111
|
-
```
|
|
1112
|
-
$ agsh help # list of commands, man-page style
|
|
1113
|
-
$ agsh read --help # man-page style: NAME, SYNOPSIS, DESCRIPTION, OPTIONS
|
|
1114
|
-
$ agsh read /repo/README.md
|
|
1115
|
-
$ agsh datadog_list_monitors --query "service:api"
|
|
1116
|
-
$ agsh # bare: interactive shell on a TTY, script from stdin otherwise
|
|
1117
|
-
❯ ls /repo | grep -i readme
|
|
1118
|
-
❯ read /repo/config.json | jq .version
|
|
1119
|
-
```
|
|
1120
|
-
|
|
1121
|
-
Every invocation binds to the deployment's latest session by default, with
|
|
1122
|
-
`--session` and `--continuation-token` overrides, and prints the session
|
|
1123
|
-
identifier as a final stderr line.
|
|
1124
|
-
|
|
1125
|
-
## Configuration
|
|
1126
|
-
|
|
1127
|
-
`agsh` is a client only; it never boots an agent. Every invocation needs a
|
|
1128
|
-
target deployment, given by flags or by environment variables. Flags always
|
|
1129
|
-
win over the environment.
|
|
1130
|
-
|
|
1131
|
-
Global command line options, accepted on every command and on the bare shell
|
|
1132
|
-
launch:
|
|
1133
|
-
|
|
1134
|
-
| Option | Environment default | Meaning |
|
|
1135
|
-
| --- | --- | --- |
|
|
1136
|
-
| `--target <url \| name>` | `AGENT_SHELL_TARGET` | The deployment to talk to: a URL is a local deployment (`http://127.0.0.1:39400/executor`), a name a production one (`change-monitor-executor`). |
|
|
1137
|
-
| `--team <team>` | `AGENT_SHELL_TEAM` | Team override for production resolution, when the login spans several. |
|
|
1138
|
-
| `--bearer-token <token>` | `AGENT_SHELL_BEARER_TOKEN` | Explicit bearer auth for a deployment that is not behind the Cursor login. |
|
|
1139
|
-
| `--session <id>` | | Bind to a specific session instead of the latest. |
|
|
1140
|
-
| `--continuation-token <token>` | | Bind by continuation token instead of session id. |
|
|
1141
|
-
| `--output <text\|json>` | | Result rendering: human-friendly views (default) or raw JSON. |
|
|
1142
|
-
| `-h`, `--help` | | Per-command help. |
|
|
1143
|
-
|
|
1144
|
-
One parameter carries the whole target selection, and the value's shape
|
|
1145
|
-
encodes the mode: a URL (`http://` or `https://`) targets a local
|
|
1146
|
-
deployment, anything else names a production one. Two options with a
|
|
1147
|
-
precedence rule would invite exactly the confusion a target selector must
|
|
1148
|
-
not have; with one parameter the only rule is that the flag beats the
|
|
1149
|
-
environment. A URL is self-contained down to the agent because one local
|
|
1150
|
-
agent-sdk serve process hosts every agent of the project (change-monitor's
|
|
1151
|
-
dev stack mounts `/executor` and `/planner` from a single port); a
|
|
1152
|
-
production deployment is a single agent, so its name is the complete
|
|
1153
|
-
address (`--team` narrows resolution when the login spans several).
|
|
1154
|
-
Authentication defaults to the stored Cursor login (the same engine-access
|
|
1155
|
-
credential agent-sdk uses); `--bearer-token` is the escape hatch for direct
|
|
1156
|
-
deployments. Session flags are per invocation and have no environment
|
|
1157
|
-
default: a session is state, not configuration. Color output follows the
|
|
1158
|
-
`NO_COLOR` convention and TTY detection; there is no agsh-specific color
|
|
1159
|
-
setting. No configuration file: one environment variable pins a working
|
|
1160
|
-
target for a terminal session
|
|
1161
|
-
(`AGENT_SHELL_TARGET=change-monitor-executor`, or a URL for a local stack),
|
|
1162
|
-
which is the whole persistent-configuration need.
|
|
1163
|
-
|
|
1164
|
-
With no target from flags or environment, every command fails with a message
|
|
1165
|
-
naming both ways to provide one.
|
|
1166
|
-
|
|
1167
|
-
## Architecture
|
|
1168
|
-
|
|
1169
|
-
### A new package
|
|
1170
|
-
|
|
1171
|
-
A new workspace package (working name `packages/agsh`, bin `agsh`) that
|
|
1172
|
-
depends on `@cursor/july` for target resolution, stored Cursor login, and the
|
|
1173
|
-
HTTP client plumbing. It owns the presentation stack: `marked` for terminal
|
|
1174
|
-
markdown (moved out of `@cursor/july`), with syntax highlighting (`shiki`)
|
|
1175
|
-
arriving in the phase that renders code; the shell interpreter is
|
|
1176
|
-
purpose-built (see Rationale).
|
|
1177
|
-
No new abstraction seam between the two packages; `agsh` imports what it
|
|
1178
|
-
needs until a second consumer justifies extracting a thin client.
|
|
1179
|
-
|
|
1180
|
-
### The tool catalog
|
|
1181
|
-
|
|
1182
|
-
At startup `agsh` fetches one live catalog of everything invocable on the
|
|
1183
|
-
deployment. This is the piece the current `/v1/info` cannot provide: `/v1/info`
|
|
1184
|
-
projects the authored manifest, and connection tools only exist at runtime,
|
|
1185
|
-
resolved per session under the connection's auth. A new endpoint provides the
|
|
1186
|
-
live view (see Backend changes).
|
|
1187
|
-
|
|
1188
|
-
Catalog entries carry exactly one identifier each: the tool name exactly as
|
|
1189
|
-
the agent sees it. Authored server tools keep their authored name (`read`).
|
|
1190
|
-
Connection tools appear under their model-facing advertised name (the
|
|
1191
|
-
sanitized passthrough name from `advertise-tools.ts`, e.g.
|
|
1192
|
-
`datadog_list_monitors`). The CLI never invents a different naming format:
|
|
1193
|
-
a tool name copied from a session transcript is a valid `agsh` command, and
|
|
1194
|
-
vice versa. Where a tool came from — the upstream connector name when the
|
|
1195
|
-
tool declares one, the connection name otherwise — is a field on the
|
|
1196
|
-
catalog entry, not part of the identifier.
|
|
1197
|
-
|
|
1198
|
-
### Two command tiers
|
|
1199
|
-
|
|
1200
|
-
Each catalog entry becomes a command, through one of two shapes:
|
|
1201
|
-
|
|
1202
|
-
**Curated commands for builtin tools.** The well-known tool names (`ls`,
|
|
1203
|
-
`read`, `grep`, `glob`, `diff`, ...) get hand-designed, POSIX-flavored
|
|
1204
|
-
command shapes, hardcoded in `agsh` next to their titles. These tools are
|
|
1205
|
-
what an operator types all day; their shapes should feel like the unix
|
|
1206
|
-
commands they mirror, not like generated bindings. A curated shape decides
|
|
1207
|
-
which schema fields are positional operands and which are flags, and every
|
|
1208
|
-
input has exactly one spelling: an operand is only an operand, never also a
|
|
1209
|
-
flag.
|
|
1210
|
-
|
|
1211
|
-
```
|
|
1212
|
-
$ agsh read /repo/package.json --limit 2
|
|
1213
|
-
{
|
|
1214
|
-
"name": "change-monitor",
|
|
1215
|
-
→ ses_a99d1b69c329eb75a2ec8603
|
|
1216
|
-
|
|
1217
|
-
$ agsh grep -i -A 2 toolEffect /repo/src
|
|
1218
|
-
src/tool-policy.ts:12:export type ToolEffect = "read" | "write";
|
|
1219
|
-
...
|
|
1220
|
-
→ ses_a99d1b69c329eb75a2ec8603
|
|
1221
|
-
|
|
1222
|
-
$ agsh ls /repo --ignore-globs '*.test.ts' --ignore-globs 'node_modules/**'
|
|
1223
|
-
```
|
|
1224
|
-
|
|
1225
|
-
`read` takes its path as an operand mapped to the schema's `path` field, with
|
|
1226
|
-
`--offset` and `--limit` as integer flags. `grep` follows POSIX grep:
|
|
1227
|
-
`grep [options] <pattern> [path]`, with the rg-style options (`-i`, `-A`,
|
|
1228
|
-
`-B`, `-C`, `--output-mode`, `--head-limit`) mapping onto the schema fields
|
|
1229
|
-
of the same names (kebab-cased). `ls` shows array input: an array field's flag repeats once
|
|
1230
|
-
per element. A curated shape binds to the deployment's live schema at
|
|
1231
|
-
startup; when a deployment's tool lacks the expected field, the command
|
|
1232
|
-
degrades to the generic shape below rather than guessing.
|
|
1233
|
-
|
|
1234
|
-
A curated shape may also reformat the tool's text result toward the unix
|
|
1235
|
-
command's own output conventions: the VFS ls tool returns the model-facing
|
|
1236
|
-
tree (` - name/` rows under a header), and `agsh ls` prints it as standard
|
|
1237
|
-
ls does, one name per line with the trailing slash kept on directories. The
|
|
1238
|
-
tool's result string itself stays what the model sees; when a result does
|
|
1239
|
-
not match the expected shape it prints verbatim.
|
|
1240
|
-
|
|
1241
|
-
**Generated commands for MCP tools.** Connection tools are dynamically
|
|
1242
|
-
discovered, so no special treatment is possible; they get a uniform
|
|
1243
|
-
schema-derived mapping:
|
|
1244
|
-
|
|
1245
|
-
- Every schema property is accepted as one flag, spelled as the
|
|
1246
|
-
kebab-cased property name (`org_slug` → `--org-slug`) — the unix
|
|
1247
|
-
convention; kebab collisions gain a numeric suffix. Properties already
|
|
1248
|
-
shaped like flags (grep's `-i`) stay literal. No positionals, no other
|
|
1249
|
-
aliases.
|
|
1250
|
-
- Object-typed properties flatten recursively into one flag per leaf,
|
|
1251
|
-
dash-joined (`--telemetry-context` for `telemetry.context`), so every
|
|
1252
|
-
option reads as a plain value; a free-form object with no declared
|
|
1253
|
-
properties stays one JSON-valued flag. A leaf is required only when its
|
|
1254
|
-
whole ancestor chain is.
|
|
1255
|
-
- Values are coerced by schema type: booleans are valueless flags, numbers
|
|
1256
|
-
and integers are parsed, arrays accept the flag repeated once per element,
|
|
1257
|
-
enums are validated before the call.
|
|
1258
|
-
|
|
1259
|
-
```
|
|
1260
|
-
$ agsh datadog_list_monitors --query "service:api" --limit 10
|
|
1261
|
-
```
|
|
1262
|
-
|
|
1263
|
-
In both tiers `-h`/`--help` and the global target and session flags are
|
|
1264
|
-
reserved and injected, a flag that names no schema property fails before any
|
|
1265
|
-
request (listing the tool's actual properties), and the bound session prints
|
|
1266
|
-
as a final stderr line.
|
|
1267
|
-
|
|
1268
|
-
### Result rendering
|
|
1269
|
-
|
|
1270
|
-
Raw JSON on a terminal is not an experience for people, so `--output=text`
|
|
1271
|
-
(the default) renders structured results through a small set of views,
|
|
1272
|
-
selected automatically by the shape of the value each call actually returned;
|
|
1273
|
-
tool metadata plays no part, since most tools advertise no output schema, and
|
|
1274
|
-
many return structured data as JSON text. A string result that parses as a
|
|
1275
|
-
JSON object or array counts as structured. An array of objects renders as a
|
|
1276
|
-
table (columns are the union of keys, missing cells stay blank, the table
|
|
1277
|
-
clamps to the terminal width); a single object renders as a property view
|
|
1278
|
-
(aligned keys, scalar lists as bullets, nested structures indented); an
|
|
1279
|
-
object that is nothing but an error wrapper renders as an `Error:` line;
|
|
1280
|
-
plain text prints verbatim. `--output=json` renders the structured value as
|
|
1281
|
-
raw JSON. The rendering never depends on the TTY: piped and interactive
|
|
1282
|
-
output carry the same content, only color follows TTY detection.
|
|
1283
|
-
|
|
1284
|
-
### Help rendering
|
|
1285
|
-
|
|
1286
|
-
`--help` on a tool renders a man-page layout: NAME (the tool name, with the
|
|
1287
|
-
tool's `title` beside it when the catalog carries one; titles are curated
|
|
1288
|
-
data, never derived from the description), SYNOPSIS (operands from the
|
|
1289
|
-
curated shape; options never enumerate — they summarize as `[options...]`,
|
|
1290
|
-
man-page style, so the line stays bounded), DESCRIPTION (the tool
|
|
1291
|
-
description rendered as terminal markdown), OPERANDS (positional arguments,
|
|
1292
|
-
curated commands only), and OPTIONS. Descriptions of operands and options
|
|
1293
|
-
come from the schema's property descriptions. Effect and approval metadata
|
|
1294
|
-
render as notes when declared. Everything except the curated shape derives
|
|
1295
|
-
from `GET /v1/tools/:name`; nothing else is hand-written per tool.
|
|
1296
|
-
|
|
1297
|
-
```
|
|
1298
|
-
$ agsh read --help
|
|
1299
|
-
NAME
|
|
1300
|
-
read - Read a file
|
|
1301
|
-
|
|
1302
|
-
SYNOPSIS
|
|
1303
|
-
read [options...] <path>
|
|
1304
|
-
|
|
1305
|
-
DESCRIPTION
|
|
1306
|
-
Reads a file from the local filesystem. This tool can also read image
|
|
1307
|
-
files when called with the appropriate path. Formats supported:
|
|
1308
|
-
jpeg/jpg, png, gif, webp.
|
|
1309
|
-
|
|
1310
|
-
OPERANDS
|
|
1311
|
-
<path>
|
|
1312
|
-
The absolute path of the file to read.
|
|
1313
|
-
|
|
1314
|
-
OPTIONS
|
|
1315
|
-
--offset <integer>
|
|
1316
|
-
The line number to start reading from. Positive values are 1-indexed
|
|
1317
|
-
from the start of the file. Negative values count backwards from the
|
|
1318
|
-
end. Only provide if the file is too large to read at once.
|
|
1319
|
-
|
|
1320
|
-
--limit <integer>
|
|
1321
|
-
The number of lines to read. Only provide if the file is too large
|
|
1322
|
-
to read at once.
|
|
1323
|
-
|
|
1324
|
-
NOTES
|
|
1325
|
-
Effect: read (performs no writes).
|
|
1326
|
-
```
|
|
1327
|
-
|
|
1328
|
-
`agsh help` lists the available command names grouped by source, authored
|
|
1329
|
-
tools first, then one group per upstream connector (its name is the group
|
|
1330
|
-
header — one aggregating connection can host tools from several connectors,
|
|
1331
|
-
and the connector name is what an operator recognizes). Each row is the
|
|
1332
|
-
name, with the title beside it when the tool declares one; everything else
|
|
1333
|
-
lives behind the command's `--help`:
|
|
1334
|
-
|
|
1335
|
-
The agent's description renders as a DESCRIPTION section when the deployment
|
|
1336
|
-
declares one (`/v1/info` carries both name and description).
|
|
1337
|
-
|
|
1338
|
-
```
|
|
1339
|
-
$ agsh help
|
|
1340
|
-
NAME
|
|
1341
|
-
change-monitor-executor
|
|
1342
|
-
|
|
1343
|
-
DESCRIPTION
|
|
1344
|
-
Executes monitoring plans against changed code.
|
|
1345
|
-
|
|
1346
|
-
COMMANDS
|
|
1347
|
-
diff Show workspace changes
|
|
1348
|
-
glob Find files by pattern
|
|
1349
|
-
grep Search file contents
|
|
1350
|
-
ls List a directory
|
|
1351
|
-
read Read a file
|
|
1352
|
-
report_change_issue
|
|
1353
|
-
report_change_succeeded
|
|
1354
|
-
|
|
1355
|
-
DATADOG
|
|
1356
|
-
datadog_list_monitors List monitors
|
|
1357
|
-
...
|
|
1358
|
-
|
|
1359
|
-
Run any command with --help for its synopsis and options.
|
|
1360
|
-
```
|
|
1361
|
-
|
|
1362
|
-
### Shell mode
|
|
1363
|
-
|
|
1364
|
-
Invoked bare, `agsh` starts a shell. On a TTY this is a REPL; on a pipe it
|
|
1365
|
-
reads a script from stdin, so `echo 'ls /' | agsh` and here-docs work.
|
|
1366
|
-
|
|
1367
|
-
The interpreter is purpose-built and minimal: tokenizing (quotes, escapes),
|
|
1368
|
-
pipelines, and `;` / `&&` / `||`. The command namespace is exactly the
|
|
1369
|
-
deployment's tool catalog plus a small curated set of local pipe filters
|
|
1370
|
-
(`head`, `tail`, `wc`, stdin-filtering `grep`), so a tool name can never be
|
|
1371
|
-
shadowed. There is no local filesystem, no variables, no control flow: agsh
|
|
1372
|
-
has nothing local to operate on, and every command is a single traced
|
|
1373
|
-
`POST /v1/tools/:name` call.
|
|
1374
|
-
|
|
1375
|
-
The shell binds one session identity at launch (latest by default) and keeps
|
|
1376
|
-
it for the whole run, so a sequence of tool calls observes one consistent
|
|
1377
|
-
session context.
|
|
1378
|
-
|
|
1379
|
-
## Backend changes on the agent-sdk runtime
|
|
1380
|
-
|
|
1381
|
-
Two read endpoints, mirroring the invocation path:
|
|
1382
|
-
|
|
1383
|
-
**`GET /v1/tools`: the live tool listing.** Returns the session's tool
|
|
1384
|
-
namespace exactly as a turn would assemble it: authored server tools plus the
|
|
1385
|
-
advertised passthrough tools synthesized from connections, under their
|
|
1386
|
-
model-facing names. Entries are light (name, source, and `title` when one is
|
|
1387
|
-
known); everything else lives behind the detail endpoint. Titles have two
|
|
1388
|
-
sources and no new authoring surface: connection tools inherit the upstream
|
|
1389
|
-
server's MCP title, which the host already propagates length-capped off
|
|
1390
|
-
listings; tools that do not come from MCP get theirs from a hardcoded
|
|
1391
|
-
name-to-title table in the runtime's endpoint implementation, covering the
|
|
1392
|
-
well-known tool names. A tool in neither place has no title. Accepts the same
|
|
1393
|
-
optional session binding as invocation (`session` or `continuationToken`)
|
|
1394
|
-
because advertised inventories can be tenant-scoped and resolved per session.
|
|
1395
|
-
Implementation reuses the existing plumbing: the discovered manifest for
|
|
1396
|
-
authored tools and the advertise-tools synthesis (`McpHost.listTools`, or the
|
|
1397
|
-
`oneOff` path when per-session auth substitution applies) for connection
|
|
1398
|
-
tools. This is not a duplicate of `/v1/info`: the info document stays the
|
|
1399
|
-
static authored manifest; the listing is the runtime view that only the
|
|
1400
|
-
running deployment can answer.
|
|
1401
|
-
|
|
1402
|
-
**`GET /v1/tools/:name`: one tool's full description.** Description, input
|
|
1403
|
-
schema, output schema when declared, effect when declared, approval
|
|
1404
|
-
requirement, and source connection. Same path as invocation
|
|
1405
|
-
(`POST /v1/tools/:name`), different method: GET describes what POST executes,
|
|
1406
|
-
for the same identifier.
|
|
1407
|
-
|
|
1408
|
-
Invocation needs no new naming scheme. Advertised connection tools are
|
|
1409
|
-
synthesized as ordinary server tools in the session's namespace, so
|
|
1410
|
-
`POST /v1/tools/:name` addresses them by their model-facing name like any
|
|
1411
|
-
authored tool, with the same session binding, policy checks, and per-call
|
|
1412
|
-
tracing. (The direct-call path did need the synthesis step added: it now
|
|
1413
|
-
resolves the advertised listing for the call's session identity when the
|
|
1414
|
-
authored lookup misses.)
|
|
1415
|
-
|
|
1416
|
-
Phase 1 ships the minimal runtime surface agsh calls: the `effect`
|
|
1417
|
-
projection in `/v1/info` (rendered in per-tool help), the scratch-workspace
|
|
1418
|
-
fallback on direct calls, and `continuationToken` binding on
|
|
1419
|
-
`POST /v1/tools/:toolName`. The detail endpoint in phase 2 also closes the
|
|
1420
|
-
output-schema gap; `/v1/info` stays as it is.
|
|
1421
|
-
|
|
1422
|
-
## Local development loop
|
|
1423
|
-
|
|
1424
|
-
`factory/change-monitor` is the test bed. Its `pnpm start` already serves the
|
|
1425
|
-
planner and executor locally through the agent-sdk dev runtime
|
|
1426
|
-
(`agent-sdk serve --dir . --dev`). The loop:
|
|
1427
|
-
|
|
1428
|
-
1. `cd factory/change-monitor && pnpm start` (local stack, both agents).
|
|
1429
|
-
2. `agsh --target http://127.0.0.1:<port>/<agent>` against it, via a dev shim
|
|
1430
|
-
analogous to `agent-sdk-dev` so the CLI runs from the worktree.
|
|
1431
|
-
3. Iterate end to end: VFS verbs (`ls`, `read`, `grep`, `glob`, `diff`) for the
|
|
1432
|
-
authored-tool path, and the planner's tenant connectors for the
|
|
1433
|
-
connection-tool path once `GET /v1/tools` exists.
|
|
1434
|
-
|
|
1435
|
-
## Removing the inspector surface from agent-sdk
|
|
1436
|
-
|
|
1437
|
-
The inspector CLI is still on development branches, so nothing migrates: the
|
|
1438
|
-
CLI-side code is removed from `agent-sdk` and `agsh` is built in its place.
|
|
1439
|
-
|
|
1440
|
-
- The verb commands (`ls`, `read`, `grep`, `glob`, `diff`) become the
|
|
1441
|
-
curated tier: their hand-designed shapes, schema-binding logic (including
|
|
1442
|
-
the candidate-field fallback), and session binding carry over. The
|
|
1443
|
-
schema-to-argv flag mapping seeds the generated tier for MCP tools.
|
|
1444
|
-
- The `tools` and `skills` commands disappear entirely. `agsh help` and
|
|
1445
|
-
per-tool `--help` are the discovery surface.
|
|
1446
|
-
- `marked` and `shiki` leave `@cursor/july`; agsh's help rendering takes
|
|
1447
|
-
`marked`, and `shiki` returns when agsh ships syntax highlighting.
|
|
1448
|
-
`agent-sdk` keeps its developer workflow commands unchanged.
|
|
1449
|
-
|
|
1450
|
-
## Plan
|
|
1451
|
-
|
|
1452
|
-
1. **Package and core invocation.** Create the package, port target
|
|
1453
|
-
resolution, the schema-to-argv mapping, and help rendering from the
|
|
1454
|
-
inspector code. Authored tools only, against the existing endpoints.
|
|
1455
|
-
Verified end to end on the local change-monitor stack.
|
|
1456
|
-
2. **Live catalog.** Add `GET /v1/tools` and `GET /v1/tools/:name` to
|
|
1457
|
-
the agent-sdk runtime, with the hardcoded title table for non-MCP tools, and verify
|
|
1458
|
-
direct invocation resolves advertised connection tools by their
|
|
1459
|
-
model-facing names. Connection tools appear as commands. Verified against
|
|
1460
|
-
the planner's connectors.
|
|
1461
|
-
3. **Shell mode.** The purpose-built mini-shell: REPL on TTY, script on
|
|
1462
|
-
stdin, tools as the command namespace, one session per shell run.
|
|
1463
|
-
4. **Cleanup.** Remove the inspector CLI surface and presentation
|
|
1464
|
-
dependencies from `@cursor/july`.
|
|
1465
|
-
|
|
1466
|
-
## Rationale and rejected alternatives
|
|
1467
|
-
|
|
1468
|
-
**Why not extend `agent-sdk`.** The audiences differ: `agent-sdk` is for the
|
|
1469
|
-
person building and deploying an agent; this tool is for the person operating
|
|
1470
|
-
inside one. Bundling also forces every agent project to carry markdown
|
|
1471
|
-
rendering, syntax highlighting, and a bash interpreter it never uses.
|
|
1472
|
-
|
|
1473
|
-
**Name.** `agsh` reads as "agent shell", is four characters, collides with
|
|
1474
|
-
nothing common, and works as a shell prompt name. Considered: `august`
|
|
1475
|
-
(pairs with `july` but says nothing about purpose), `toolsh` (awkward to
|
|
1476
|
-
pronounce), `cursor-shell` (too broad; this is scoped to one agent).
|
|
1477
|
-
|
|
1478
|
-
**Why a REST catalog instead of the MCP endpoint.** The deployment already
|
|
1479
|
-
speaks MCP at `/v1/mcp/tools`, including a per-connection bridge, but the
|
|
1480
|
-
bridge is bound to an active turn and speaks JSON-RPC. The CLI wants a plain
|
|
1481
|
-
authenticated GET with session binding that returns the assembled tool
|
|
1482
|
-
namespace under the names the model sees. Wrapping that in MCP framing buys
|
|
1483
|
-
nothing for a first-party client.
|
|
1484
|
-
|
|
1485
|
-
**Why a purpose-built interpreter instead of just-bash.** just-bash was the
|
|
1486
|
-
original plan (a full bash emulation with a custom-command extension point),
|
|
1487
|
-
and a prototype disproved it: custom commands replace its coreutils but can
|
|
1488
|
-
never shadow its shell builtins, and `read`, `test`, `type`, and `help` are
|
|
1489
|
-
builtins — so the flagship `read` tool is unreachable, and the precedence is
|
|
1490
|
-
not ours to control (vercel-labs owns the package). No other embeddable JS
|
|
1491
|
-
shell interpreter has a workable custom-command story (mvdan-sh's JS build
|
|
1492
|
-
does not expose one; bash-parser is a parser only). agsh also needs almost
|
|
1493
|
-
none of bash: no local filesystem, no variables, no control flow — just
|
|
1494
|
-
tokenizing, pipelines, and a command namespace it fully owns. A TypeScript
|
|
1495
|
-
REPL with tools as async functions (the shape of change-monitor's `script`
|
|
1496
|
-
tool) was considered and kept as a possible later addition; it trades away
|
|
1497
|
-
the unix muscle memory the curated commands exist for.
|
|
1498
|
-
|
|
1499
|
-
---
|
|
1500
|
-
|
|
1501
1091
|
Source: /docs/evals.md
|
|
1502
1092
|
|
|
1503
1093
|
# Evals
|
|
@@ -2795,8 +2385,9 @@ Source: /docs/guides/mcp-oauth.md
|
|
|
2795
2385
|
Use host MCP OAuth when your agent talks to a remote MCP server that
|
|
2796
2386
|
speaks OAuth, and you want credentials on the serve host (or the hosted
|
|
2797
2387
|
engine) instead of a Cursor account connector. Local login writes tokens
|
|
2798
|
-
next to your Cursor credentials. `--store` copies
|
|
2799
|
-
deployment as secrets so prod can reconnect after a redeploy.
|
|
2388
|
+
next to your Cursor credentials. `--store` copies those tokens onto the
|
|
2389
|
+
deployment as secrets so prod can reconnect after a redeploy. Hosted
|
|
2390
|
+
Connect lets the current process retry.
|
|
2800
2391
|
|
|
2801
2392
|
The companion skill is
|
|
2802
2393
|
[`skills/mcp-auth/SKILL.md`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/skills/mcp-auth/SKILL.md).
|
|
@@ -2807,8 +2398,8 @@ The companion skill is
|
|
|
2807
2398
|
flow (`agent-sdk mcp oauth <connection>`)
|
|
2808
2399
|
- Keep tokens in `mcp-auth.json` under the CLI config directory, bound
|
|
2809
2400
|
to that connection's resource URL
|
|
2810
|
-
- Upsert deployment secrets with `--store` so
|
|
2811
|
-
same tokens from env
|
|
2401
|
+
- Upsert deployment secrets with `--store` so the next deploy seeds the
|
|
2402
|
+
same tokens from env. Hosted Connect lets the current process retry.
|
|
2812
2403
|
- Use `advertiseTools: true` when local turns should call the server by
|
|
2813
2404
|
name. Host tools can still call it through `ctx.host.mcp`.
|
|
2814
2405
|
|
|
@@ -2888,7 +2479,16 @@ connection URL (tokens are bound to the resource URL).
|
|
|
2888
2479
|
|
|
2889
2480
|
## How do I store credentials on a hosted deployment?
|
|
2890
2481
|
|
|
2891
|
-
Authorize once
|
|
2482
|
+
Authorize once. Then get the tokens onto the deployment.
|
|
2483
|
+
|
|
2484
|
+
On a hosted engine, finishing Connect lets the current process retry.
|
|
2485
|
+
Self-hosted serve writes tokens locally only.
|
|
2486
|
+
|
|
2487
|
+
`--store` from a signed-in laptop is the reliable way to put
|
|
2488
|
+
`MCP_OAUTH_*` on the next deploy. If `agent-sdk secrets list` is
|
|
2489
|
+
empty, run `--store` and redeploy.
|
|
2490
|
+
|
|
2491
|
+
From a laptop, push secrets with the CLI:
|
|
2892
2492
|
|
|
2893
2493
|
```bash
|
|
2894
2494
|
agent-sdk mcp oauth inventory --store
|
|
@@ -2906,13 +2506,21 @@ agent-sdk mcp oauth inventory --store
|
|
|
2906
2506
|
| `MCP_OAUTH_<NAME>_CLIENT_ID` | dynamic client id when registration returned one |
|
|
2907
2507
|
|
|
2908
2508
|
You must be signed in (`agent-sdk login`) with permission to set secrets
|
|
2909
|
-
on that slug. Secrets apply on the **next** deploy
|
|
2910
|
-
`agent-sdk deploy`
|
|
2509
|
+
on that slug. Secrets apply on the **next** deploy. Run
|
|
2510
|
+
`agent-sdk deploy` after `--store`. A fresh pod sees `MCP_OAUTH_*`
|
|
2511
|
+
only after that deploy.
|
|
2911
2512
|
|
|
2912
2513
|
On the engine, when `mcp-auth.json` is empty, serve seeds the OAuth
|
|
2913
2514
|
provider from those env vars so host MCP calls work without a browser
|
|
2914
2515
|
on the pod.
|
|
2915
2516
|
|
|
2517
|
+
These secrets are deployment-wide. Anyone who can list or set secrets
|
|
2518
|
+
on that slug, and the hosted engine's runtime env, can use them. That
|
|
2519
|
+
is the same blast radius as `--store`. They are not scoped to the
|
|
2520
|
+
caller who clicked Connect. `cursorAccount: true` tokens stay on the
|
|
2521
|
+
Cursor backend for the deployment service account and do not use
|
|
2522
|
+
`MCP_OAUTH_*`.
|
|
2523
|
+
|
|
2916
2524
|
## How do host tools call the server?
|
|
2917
2525
|
|
|
2918
2526
|
```ts
|
|
@@ -2932,7 +2540,7 @@ an allowlist or other deterministic gate.
|
|
|
2932
2540
|
| --- | --- |
|
|
2933
2541
|
| `must be defineConnection({ url, oauth: true })` | Add `oauth: true` on that connection, or pick the right connection name |
|
|
2934
2542
|
| Callback never completes | Keep port `8787` free; finish the browser login on this machine |
|
|
2935
|
-
| Hosted calls unauthorized after `--store` | Confirm secrets with `agent-sdk secrets list <slug>`, then redeploy |
|
|
2543
|
+
| Hosted calls unauthorized after Connect or `--store` | Confirm secrets with `agent-sdk secrets list <slug>`, then redeploy |
|
|
2936
2544
|
| Tokens ignored after URL change | Expected: resource URL binding drops stale entries. Re-run `mcp oauth` |
|
|
2937
2545
|
|
|
2938
2546
|
## What's next
|
|
@@ -3162,16 +2770,14 @@ Source: /docs/guides/slack.md
|
|
|
3162
2770
|
|
|
3163
2771
|
# Slack agents
|
|
3164
2772
|
|
|
3165
|
-
The Slack channel
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
`agent-sdk slack init --manual` and paste the manifests at
|
|
3169
|
-
[api.slack.com](https://api.slack.com/apps). Socket Mode has no
|
|
3170
|
-
public Request URL. Replies stream in threads, with tool "thinking" steps,
|
|
3171
|
-
suggested prompts, and opt-in approval buttons.
|
|
2773
|
+
The Slack channel is a Socket Mode bot. The app connects out, so you
|
|
2774
|
+
don't need a public Request URL. Mentions and DMs start a thread.
|
|
2775
|
+
Replies stream there, with thinking steps and suggested prompts.
|
|
3172
2776
|
|
|
3173
|
-
|
|
3174
|
-
|
|
2777
|
+
Use `agent-sdk slack create` when Cursor should own the Slack app. Use
|
|
2778
|
+
`agent-sdk slack init --manual` when you own it. Commands and flags live
|
|
2779
|
+
in the [CLI reference](/docs/reference/cli.md#slack). Coding agents should
|
|
2780
|
+
follow [`skills/setup-slack/SKILL.md`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/skills/setup-slack/SKILL.md).
|
|
3175
2781
|
|
|
3176
2782
|
## Define the channel
|
|
3177
2783
|
|
|
@@ -3181,35 +2787,23 @@ Author `agent/channels/slack.ts` with `slackChannel()` from
|
|
|
3181
2787
|
```ts
|
|
3182
2788
|
import { slackChannel } from "@cursor/july/channels/slack";
|
|
3183
2789
|
|
|
3184
|
-
// Single agent: reads SLACK_BOT_TOKEN + SLACK_APP_TOKEN
|
|
3185
2790
|
export default slackChannel();
|
|
3186
|
-
|
|
3187
|
-
// Multi-agent serve: one Slack app (and token pair) per agent
|
|
3188
|
-
export default slackChannel({ envPrefix: "WEATHER_AGENT" });
|
|
3189
|
-
// → WEATHER_AGENT_SLACK_BOT_TOKEN + WEATHER_AGENT_SLACK_APP_TOKEN
|
|
3190
2791
|
```
|
|
3191
2792
|
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
`
|
|
3195
|
-
|
|
3196
|
-
sessions with `continuationToken = channelId:threadTs`, so a thread is
|
|
3197
|
-
one durable conversation. Replies stream (`chat.startStream` /
|
|
3198
|
-
`appendStream` / `stopStream`) with a plain-message fallback, a rotating
|
|
3199
|
-
status shows while the agent works, and the pack sets thread titles and
|
|
3200
|
-
suggested prompts. When a Slack API is unavailable (`method_not_found`,
|
|
3201
|
-
`missing_scope`), the pack degrades to `postMessage` instead of failing.
|
|
2793
|
+
`slackChannel()` reads `SLACK_BOT_TOKEN` and `SLACK_APP_TOKEN`. Pass
|
|
2794
|
+
`envPrefix: "WEATHER_AGENT"` to read `WEATHER_AGENT_SLACK_BOT_TOKEN`
|
|
2795
|
+
and `WEATHER_AGENT_SLACK_APP_TOKEN` instead. Use a prefix when one
|
|
2796
|
+
host serves several Slack bots.
|
|
3202
2797
|
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
2798
|
+
A thread is one conversation. The bot answers mentions and DMs. It
|
|
2799
|
+
refuses Slack Connect users, guests, and people from other workspaces.
|
|
2800
|
+
Missing tokens leave this channel idle. The rest of `serve` still
|
|
2801
|
+
starts.
|
|
3206
2802
|
|
|
3207
2803
|
## Control who can message the agent
|
|
3208
2804
|
|
|
3209
|
-
External senders are blocked
|
|
3210
|
-
people
|
|
3211
|
-
handler. Set `blockExternals: false` only when the agent should serve
|
|
3212
|
-
people outside your org:
|
|
2805
|
+
External senders are blocked. Set `blockExternals: false` only when
|
|
2806
|
+
people outside your org should reach the agent:
|
|
3213
2807
|
|
|
3214
2808
|
```ts
|
|
3215
2809
|
export default slackChannel({
|
|
@@ -3217,9 +2811,8 @@ export default slackChannel({
|
|
|
3217
2811
|
});
|
|
3218
2812
|
```
|
|
3219
2813
|
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
`respondTo: "author"`:
|
|
2814
|
+
Anyone in the thread can continue it. Restrict follow-ups to the person
|
|
2815
|
+
who started the session with `respondTo: "author"`:
|
|
3223
2816
|
|
|
3224
2817
|
```ts
|
|
3225
2818
|
export default slackChannel({
|
|
@@ -3229,237 +2822,143 @@ export default slackChannel({
|
|
|
3229
2822
|
|
|
3230
2823
|
## Set it up
|
|
3231
2824
|
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
a manifest at [api.slack.com](https://api.slack.com/apps) unless you
|
|
3237
|
-
are on the [manual setup](#manual-setup) path.
|
|
3238
|
-
|
|
3239
|
-
Bots that already have tokens in `.env.local` keep working. Skip the
|
|
3240
|
-
wizard unless you want a Cursor-managed app.
|
|
2825
|
+
`slack create` opens the Cursor dashboard wizard. Finish Slack consent
|
|
2826
|
+
and the bot name there. The CLI writes tokens to `.env.local` and never
|
|
2827
|
+
prints them. Skip the wizard if those tokens are already set, unless
|
|
2828
|
+
you want a Cursor-managed app.
|
|
3241
2829
|
|
|
3242
2830
|
### Provision with the CLI
|
|
3243
2831
|
|
|
3244
2832
|
```bash
|
|
3245
|
-
agent-sdk slack create --dir .
|
|
3246
|
-
agent-sdk slack create --dir . --prod
|
|
2833
|
+
agent-sdk slack create --dir .
|
|
2834
|
+
agent-sdk slack create --dir . --prod
|
|
3247
2835
|
```
|
|
3248
2836
|
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
to this agent** in the browser as the same Cursor account. The CLI
|
|
3253
|
-
writes `<PREFIX>_SLACK_BOT_TOKEN` and `<PREFIX>_SLACK_APP_TOKEN` into
|
|
3254
|
-
`<dir>/.env.local`, then runs `doctor`. Serve and smoke it as described
|
|
3255
|
-
[below](#wire-the-env-and-verify).
|
|
2837
|
+
Sign in first (`agent-sdk login` or `CURSOR_API_KEY`). Finish **Add
|
|
2838
|
+
Slack to this agent** as the same Cursor account. Then run
|
|
2839
|
+
`agent-sdk slack doctor --prefix MY_AGENT` and serve:
|
|
3256
2840
|
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
2841
|
+
```bash
|
|
2842
|
+
agent-sdk serve --dir . --dev
|
|
2843
|
+
```
|
|
2844
|
+
|
|
2845
|
+
Invite the bot and mention it, or DM it. Expect a Thinking status,
|
|
2846
|
+
then a threaded streaming reply.
|
|
2847
|
+
|
|
2848
|
+
If Slack needs a workspace admin, keep the CLI running. Open the
|
|
2849
|
+
**Request approval** link it prints. After an admin approves, click
|
|
3261
2850
|
**Retry** in the wizard.
|
|
3262
2851
|
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
that Slack app. It keeps the Slack app id and replaces the manifest and
|
|
3267
|
-
tokens. `agent-sdk slack destroy` deletes the provisioned app.
|
|
3268
|
-
`agent-sdk slack icon <source>` updates the icon later.
|
|
2852
|
+
`slack destroy` deletes the Cursor-managed app. `slack icon` updates
|
|
2853
|
+
its icon. A second `slack create` for the same agent and environment
|
|
2854
|
+
replaces that app's manifest and tokens.
|
|
3269
2855
|
|
|
3270
2856
|
### Provision from the dashboard
|
|
3271
2857
|
|
|
3272
2858
|
The same wizard is on [Deployed Agents](https://cursor.com/dashboard).
|
|
3273
|
-
Open **Integrations**
|
|
3274
|
-
or follow the URL `slack create` printed.
|
|
2859
|
+
Open **Integrations** and click **Add Slack to this agent**.
|
|
3275
2860
|
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
**Deploy** injects the stored secrets; there is no Slack-only Redeploy.
|
|
2861
|
+
Local `agent-sdk serve` reads `.env.local`. The next deploy injects the
|
|
2862
|
+
stored secrets.
|
|
3279
2863
|
|
|
3280
|
-
If Slack needs admin approval,
|
|
3281
|
-
|
|
3282
|
-
reminder). After an admin approves, click **Retry**.
|
|
2864
|
+
If Slack needs admin approval, click **Request approval**, then
|
|
2865
|
+
**Retry** after an admin approves.
|
|
3283
2866
|
|
|
3284
|
-
The app row's menu covers
|
|
3285
|
-
|
|
2867
|
+
The app row's menu covers rename, icon, token rotation, removal, and
|
|
2868
|
+
workspace disconnect.
|
|
3286
2869
|
|
|
3287
|
-
###
|
|
2870
|
+
### Create your own Slack app
|
|
3288
2871
|
|
|
3289
|
-
`
|
|
3290
|
-
|
|
3291
|
-
|
|
2872
|
+
`slack init --manual` is for an app you own. It writes the channel file
|
|
2873
|
+
and Slack manifests. When Slack CLI (`~/.slack/bin/slack`) is logged
|
|
2874
|
+
in, it installs the app. When it isn't, install the app yourself.
|
|
3292
2875
|
|
|
3293
2876
|
```bash
|
|
3294
|
-
agent-sdk slack
|
|
3295
|
-
```
|
|
3296
|
-
|
|
3297
|
-
Proceed when `app_token`, `connections_open`, `bot_token`, and
|
|
3298
|
-
`auth_test` are all green. Then serve and smoke it:
|
|
3299
|
-
|
|
3300
|
-
```bash
|
|
3301
|
-
agent-sdk serve --dir . --dev
|
|
3302
|
-
# expect: [agent-sdk/slack] Socket Mode connected
|
|
2877
|
+
agent-sdk slack init --manual --dir . --name "My Agent"
|
|
3303
2878
|
```
|
|
3304
2879
|
|
|
3305
|
-
|
|
3306
|
-
Thinking… status, then a threaded streaming reply, with correlated
|
|
3307
|
-
server logs (`inbound kind=app_mention`, `session start`,
|
|
3308
|
-
`reply delivered via stream|postMessage`).
|
|
3309
|
-
|
|
3310
|
-
### Manual setup
|
|
3311
|
-
|
|
3312
|
-
`slack init --manual` is for a Slack app you own at api.slack.com. You
|
|
3313
|
-
paste the generated manifests and mint tokens yourself. Use this when
|
|
3314
|
-
you want an unmanaged app, or when the dashboard wizard is not an
|
|
3315
|
-
option.
|
|
2880
|
+
Install Slack CLI if you need it:
|
|
3316
2881
|
|
|
3317
2882
|
```bash
|
|
3318
|
-
|
|
2883
|
+
curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash
|
|
3319
2884
|
```
|
|
3320
2885
|
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
events.
|
|
2886
|
+
Log in with `slack login --no-prompt`. In Slack, send
|
|
2887
|
+
`/slackauthticket <ticket>`, then
|
|
2888
|
+
`slack login --ticket <ticket> --challenge <code>`. Install the
|
|
2889
|
+
workspace app with `slack app install`. Create a separate production
|
|
2890
|
+
app the same way.
|
|
3327
2891
|
|
|
3328
|
-
|
|
3329
|
-
|
|
2892
|
+
Or paste `.slack/manifest.dev.json` at
|
|
2893
|
+
[api.slack.com/apps](https://api.slack.com/apps) (**Create New App** →
|
|
2894
|
+
**From a manifest**). Repeat with `.slack/manifest.prod.json`. Dev and
|
|
2895
|
+
prod are separate Slack apps.
|
|
3330
2896
|
|
|
3331
|
-
|
|
2897
|
+
Then put a bot token (`xoxb-...`) and an app-level token with
|
|
2898
|
+
`connections:write` (`xapp-...`) in `.env.local`. Use the names
|
|
2899
|
+
`slack init --manual` printed. Run `slack doctor` and serve as above.
|
|
3332
2900
|
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
1. Open [api.slack.com/apps](https://api.slack.com/apps) → **Create New
|
|
3336
|
-
App** → **From a manifest**.
|
|
3337
|
-
2. Paste `manifest.dev.json` and create the dev app.
|
|
3338
|
-
3. Repeat with `manifest.prod.json`. Dev and prod are separate Slack
|
|
3339
|
-
apps with separate tokens.
|
|
3340
|
-
|
|
3341
|
-
#### Install and mint tokens
|
|
3342
|
-
|
|
3343
|
-
For each app: **Install to Workspace** and copy the Bot User OAuth Token
|
|
3344
|
-
(`xoxb-…`). Then under **Basic Information → App-Level Tokens** create a
|
|
3345
|
-
token with scope `connections:write` and copy it (`xapp-…`).
|
|
3346
|
-
|
|
3347
|
-
Put the pair in `.env.local` using the names from `env.example`, then
|
|
3348
|
-
run `slack doctor` and serve as [above](#wire-the-env-and-verify).
|
|
2901
|
+
Serve this app with Agent SDK. Do not run `slack deploy`.
|
|
3349
2902
|
|
|
3350
2903
|
## Choose when the agent engages
|
|
3351
2904
|
|
|
3352
|
-
Mentions and DMs are on
|
|
3353
|
-
|
|
2905
|
+
Mentions and DMs are on. Watching channel posts without a mention is
|
|
2906
|
+
opt-in:
|
|
3354
2907
|
|
|
3355
2908
|
```ts
|
|
3356
2909
|
export default slackChannel({
|
|
3357
2910
|
envPrefix: "TRIAGE",
|
|
3358
2911
|
engagement: {
|
|
3359
|
-
// mentions / directMessages default to true
|
|
3360
2912
|
channelPosts: {
|
|
3361
|
-
allow: ["#triage-alerts"],
|
|
3362
|
-
posts: "top-level",
|
|
3363
|
-
debounceMs: 15_000,
|
|
3364
|
-
includeBotPosts: false, // default: bot-authored posts never dispatch
|
|
2913
|
+
allow: ["#triage-alerts"],
|
|
2914
|
+
posts: "top-level",
|
|
2915
|
+
debounceMs: 15_000,
|
|
3365
2916
|
},
|
|
3366
2917
|
},
|
|
3367
|
-
onChannelPost: async (
|
|
3368
|
-
// same contract as onAppMention: return null to skip
|
|
2918
|
+
onChannelPost: async (_ctx, message) => {
|
|
3369
2919
|
return message.markdown.length > 20 ? {} : null;
|
|
3370
2920
|
},
|
|
3371
2921
|
});
|
|
3372
2922
|
```
|
|
3373
2923
|
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
`
|
|
3377
|
-
channel.
|
|
3378
|
-
|
|
3379
|
-
Set `allow: ["*"]` to watch every channel the bot has joined.
|
|
2924
|
+
Pass `--channel-posts` on `slack create` or `slack init --manual` so
|
|
2925
|
+
the Slack app receives those events. The bot must be in each watched
|
|
2926
|
+
channel. `allow: ["*"]` watches every joined channel.
|
|
3380
2927
|
|
|
3381
|
-
Set `includeBotPosts: true`
|
|
3382
|
-
|
|
3383
|
-
watching app's own posts stay dropped either way, matched by the `bot_id`
|
|
3384
|
-
and bot user id from `auth.test`, so an agent can never dispatch on its
|
|
3385
|
-
own replies. Use this for a bot-fed alerts channel.
|
|
2928
|
+
Set `includeBotPosts: true` for alert feeds and other bots. This app
|
|
2929
|
+
never wakes on its own posts.
|
|
3386
2930
|
|
|
3387
2931
|
## Prepare work on the host
|
|
3388
2932
|
|
|
3389
2933
|
Mention and DM handlers may return a prepared `message`,
|
|
3390
|
-
`workspaceFiles`, or `cloud` block.
|
|
2934
|
+
`workspaceFiles`, or `cloud` block. Use the same host-prep pattern as
|
|
3391
2935
|
[custom channels](/docs/guides/webhooks.md#prepare-on-the-host-then-hand-off).
|
|
3392
|
-
PR agents use it: extract a PR URL from the mention text and run the
|
|
3393
|
-
same host path as the HTTP channel.
|
|
3394
2936
|
|
|
3395
|
-
Slack file uploads
|
|
2937
|
+
Slack file uploads attach automatically. Images become vision input.
|
|
3396
2938
|
Supported documents become workspace files for the turn.
|
|
3397
2939
|
|
|
3398
2940
|
## Add approval buttons
|
|
3399
2941
|
|
|
3400
|
-
Tools with `needsApproval` park until a person decides.
|
|
3401
|
-
|
|
2942
|
+
Tools with `needsApproval` park until a person decides. Post those
|
|
2943
|
+
decisions in Slack with one flag:
|
|
3402
2944
|
|
|
3403
2945
|
```ts
|
|
3404
2946
|
export default slackChannel({
|
|
3405
|
-
toolApprovals: true,
|
|
2947
|
+
toolApprovals: true,
|
|
3406
2948
|
});
|
|
3407
2949
|
```
|
|
3408
2950
|
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
Cards show redacted, truncated arguments (Block Kit size limits);
|
|
3415
|
-
execution still uses the full validated input, so review sensitive tools
|
|
3416
|
-
in the playground when the arguments may exceed the card. Approvals
|
|
3417
|
-
exist for `execution: "server"` tools on the local runtime only, and
|
|
3418
|
-
parked calls do not survive a host restart. The full lifecycle is in
|
|
2951
|
+
The Slack app needs interactivity. Recreate it with `slack create` if
|
|
2952
|
+
clicks do nothing. Cards show redacted, truncated arguments. Execution
|
|
2953
|
+
still uses the full input, so review sensitive tools in the playground
|
|
2954
|
+
when the card may hide fields. The lifecycle is in
|
|
3419
2955
|
[Human-in-the-loop](/docs/guides/human-in-the-loop.md).
|
|
3420
2956
|
|
|
3421
2957
|
## Run several agents on one host
|
|
3422
2958
|
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
with their Slack channel idle while everything else serves normally.
|
|
3427
|
-
|
|
3428
|
-
## Keep the channel healthy
|
|
3429
|
-
|
|
3430
|
-
Two habits matter most.
|
|
3431
|
-
|
|
3432
|
-
- Don't `await` long work inside Slack dispatch handlers. The pack
|
|
3433
|
-
dispatches through `waitUntil` and streams as the turn progresses.
|
|
3434
|
-
- In `--dev` (loopback) or `--allow-anonymous` (trusted shared host), the
|
|
3435
|
-
playground can list and stream Slack sessions and resolve their parked
|
|
3436
|
-
approvals (the audit trail records the HTTP caller). Bearer-auth hosts
|
|
3437
|
-
stay strict: Slack approvals must come from Slack interactivity or a
|
|
3438
|
-
matching principal.
|
|
3439
|
-
|
|
3440
|
-
## CLI reference
|
|
3441
|
-
|
|
3442
|
-
The `slack` subcommands cover setup end to end.
|
|
3443
|
-
|
|
3444
|
-
```bash
|
|
3445
|
-
agent-sdk slack setup # printed setup guide
|
|
3446
|
-
agent-sdk slack create --dir . # dashboard wizard (dev app)
|
|
3447
|
-
agent-sdk slack create --dir . --prod # prod app
|
|
3448
|
-
agent-sdk slack destroy --dir . # delete the provisioned app
|
|
3449
|
-
agent-sdk slack icon ./icon.png --dir . # set the provisioned app's icon
|
|
3450
|
-
agent-sdk slack init --manual --dir . # manifests to paste at api.slack.com
|
|
3451
|
-
agent-sdk slack manifest --env both # regenerate those JSON files
|
|
3452
|
-
agent-sdk slack doctor --prefix MY_AGENT # token / connectivity checks
|
|
3453
|
-
```
|
|
3454
|
-
|
|
3455
|
-
## What's next
|
|
3456
|
-
|
|
3457
|
-
Continue with these pages:
|
|
3458
|
-
|
|
3459
|
-
- [Human-in-the-loop](/docs/guides/human-in-the-loop.md): the approval lifecycle
|
|
3460
|
-
behind `toolApprovals`
|
|
3461
|
-
- [Webhooks and custom channels](/docs/guides/webhooks.md): the mechanism this
|
|
3462
|
-
pack is built on
|
|
2959
|
+
Give each agent its own Slack app and token pair. Set `envPrefix` so
|
|
2960
|
+
the names don't collide (`WEATHER_AGENT_SLACK_*`, `TRIAGE_SLACK_*`).
|
|
2961
|
+
Agents without tokens stay idle. The others still serve.
|
|
3463
2962
|
|
|
3464
2963
|
---
|
|
3465
2964
|
|
|
@@ -4058,7 +3557,7 @@ npx @cursor/july docs
|
|
|
4058
3557
|
| Building a new agent with Cursor | [Scaffold an agent with Cursor](/docs/scaffolding-agents.md) |
|
|
4059
3558
|
| Turning a Cursor Automation into a project | [Convert a Cursor Automation](/docs/guides/convert-automation.md) |
|
|
4060
3559
|
| Wiring an agent to Slack | [Slack guide](/docs/guides/slack.md) |
|
|
4061
|
-
| Starting from a packaged template | [Demo](/docs/templates/demo.md), [Code wiki](/docs/templates/code-wiki.md), [Security reviewer](/docs/templates/security-reviewer.md), [Security help](/docs/templates/security-help.md), [Triage](/docs/templates/triage.md), or [Agentic Owners](/docs/templates/agentic-owners.md) |
|
|
3560
|
+
| Starting from a packaged template | [Demo](/docs/templates/demo.md), [Code wiki](/docs/templates/code-wiki.md), [Living AGENTS.md](/docs/templates/agents-md.md), [Security reviewer](/docs/templates/security-reviewer.md), [Security help](/docs/templates/security-help.md), [Triage](/docs/templates/triage.md), or [Agentic Owners](/docs/templates/agentic-owners.md) |
|
|
4062
3561
|
| Wiring an agent to GitHub webhooks | [GitHub guide](/docs/guides/github.md) |
|
|
4063
3562
|
| Driving PRs from a cloud VM | [PR autofixer template](/docs/templates/pr-autofixer.md) |
|
|
4064
3563
|
| Driving an agent from Linear (or another tracker) | [Webhooks guide: Linear example](/docs/guides/webhooks.md#example-linear-as-the-control-plane) |
|
|
@@ -4086,6 +3585,8 @@ npx @cursor/july docs
|
|
|
4086
3585
|
collects the PR, the model records, then comments.
|
|
4087
3586
|
- [Keep a code wiki current after merge](/docs/templates/code-wiki.md):
|
|
4088
3587
|
update in-repo `wiki/` pages when a pull request merges.
|
|
3588
|
+
- [Keep AGENTS.md current from last week's work](/docs/templates/agents-md.md):
|
|
3589
|
+
pull rules out of merged PRs and Slack, then open a follow-up PR.
|
|
4089
3590
|
- [Security reviewer](/docs/templates/security-reviewer.md): review pull
|
|
4090
3591
|
requests for exploitable bugs and post one comment.
|
|
4091
3592
|
- [Answer security questions in Slack](/docs/templates/security-help.md):
|
|
@@ -4119,8 +3620,8 @@ npx @cursor/july docs
|
|
|
4119
3620
|
- [Human-in-the-loop approvals](/docs/guides/human-in-the-loop.md): park a
|
|
4120
3621
|
tool call until a person signs off.
|
|
4121
3622
|
- [Host MCP OAuth](/docs/guides/mcp-oauth.md): authorize
|
|
4122
|
-
`oauth: true` connections, store tokens locally, and
|
|
4123
|
-
on hosted deployments.
|
|
3623
|
+
`oauth: true` connections, store tokens locally, and persist them
|
|
3624
|
+
on hosted deployments (`--store`).
|
|
4124
3625
|
- [Agent-to-agent](/docs/guides/agent-to-agent.md): every agent is an MCP
|
|
4125
3626
|
server; agents can delegate to each other.
|
|
4126
3627
|
- [Cloud runtime](/docs/guides/cloud-runtime.md): run turns on Cursor cloud
|
|
@@ -4727,8 +4228,8 @@ When every slot is busy, newly admitted turns queue FIFO instead of
|
|
|
4727
4228
|
failing: the stream records a durable `turn.queued` event with the
|
|
4728
4229
|
queue position, `GET /v1/sessions` reports `queued: true`, and each
|
|
4729
4230
|
queued turn starts as soon as a slot frees. A queued turn still counts
|
|
4730
|
-
as running for busy semantics: follow-ups preempt it, and direct
|
|
4731
|
-
calls get `409 session_busy`. Omit for unlimited.
|
|
4231
|
+
as running for busy semantics: follow-ups preempt it, and direct
|
|
4232
|
+
write-effect tool calls get `409 session_busy`. Omit for unlimited.
|
|
4732
4233
|
|
|
4733
4234
|
```ts
|
|
4734
4235
|
export default defineAgent({
|
|
@@ -5507,8 +5008,9 @@ the value before execution. A local call needs no inference credential.
|
|
|
5507
5008
|
A hosted call still needs Cursor credentials to reach the deployment.
|
|
5508
5009
|
|
|
5509
5010
|
`--session` runs the tool inside an existing session and records it on
|
|
5510
|
-
the event stream. If a model turn is active or pending,
|
|
5511
|
-
|
|
5011
|
+
the event stream. If a model turn is active or pending, a read-effect
|
|
5012
|
+
tool runs alongside it and a write-effect tool gets `session_busy`;
|
|
5013
|
+
retry after the turn finishes. The command
|
|
5512
5014
|
prints the server's JSON response and exits non-zero unless the HTTP
|
|
5513
5015
|
response succeeds with `ok: true`. See
|
|
5514
5016
|
[Tools](/docs/reference/tools.md#call-a-tool-without-a-model-turn).
|
|
@@ -5580,6 +5082,7 @@ non-zero when the reconstructed trajectory failed.
|
|
|
5580
5082
|
agent-sdk init ./my-agent # scaffold package.json, tsconfig.json, agent/ + a demo tool
|
|
5581
5083
|
agent-sdk init ./my-demo --template demo # record a PR walkthrough
|
|
5582
5084
|
agent-sdk init ./code-wiki --template code-wiki # keep wiki pages current after merge
|
|
5085
|
+
agent-sdk init ./agents-md --template agents-md # keep AGENTS.md current from last week's PRs and Slack
|
|
5583
5086
|
agent-sdk init ./my-reviewer --template security-reviewer # review PRs for security bugs
|
|
5584
5087
|
agent-sdk init ./security-help --template security-help # answer security questions in Slack
|
|
5585
5088
|
agent-sdk init ./my-triage --template triage-linear # comment on Linear issues
|
|
@@ -5597,8 +5100,9 @@ agent-sdk init # no directory: print the setup guide
|
|
|
5597
5100
|
`@cursor/july` resolves for `dev` and `run`.
|
|
5598
5101
|
|
|
5599
5102
|
Templates may ship `init.json`. On a TTY, `init` asks those questions
|
|
5600
|
-
before writing files. `code-wiki`, `pr-autofixer`,
|
|
5601
|
-
ask for GitHub repos.
|
|
5103
|
+
before writing files. `code-wiki`, `pr-autofixer`, `security-help`, and
|
|
5104
|
+
`agents-md` ask for GitHub repos. `agents-md` also asks for Slack
|
|
5105
|
+
channels. Repeat
|
|
5602
5106
|
`--var id=value` to answer without a prompt.
|
|
5603
5107
|
`--json` and non-TTY hosts skip the interview unless `--var` is set.
|
|
5604
5108
|
|
|
@@ -5756,7 +5260,8 @@ commands with an explicit `--json` flag skip this automatic check.
|
|
|
5756
5260
|
agent-sdk deploy [--dir <path>] [--slug <slug> | --all] [--team <id>]
|
|
5757
5261
|
[--repo <https-url>] [--ref <git-ref>] [--path <agent-path>]
|
|
5758
5262
|
[--cursor-events-repo owner/name]...
|
|
5759
|
-
[--allow-domain <domain>]... [--
|
|
5263
|
+
[--allow-domain <domain>]... [--multi-tenant]
|
|
5264
|
+
[--no-wait] [--json]
|
|
5760
5265
|
```
|
|
5761
5266
|
|
|
5762
5267
|
Managed hosting requires team-admin permission and the team's
|
|
@@ -5783,6 +5288,12 @@ be a lowercase hostname with at least two labels and an alphabetic
|
|
|
5783
5288
|
top-level domain. One leading `*.` wildcard is allowed. A deployment
|
|
5784
5289
|
can declare at most 20 domains.
|
|
5785
5290
|
|
|
5291
|
+
`--multi-tenant` adds a release to an existing Cursor-managed
|
|
5292
|
+
(multi-tenant) product such as `security-reviewer`. It is valid only
|
|
5293
|
+
for `architecture: "v2"` and cannot create a new multi-tenant
|
|
5294
|
+
application — those stay on the operator seed path. Without the flag,
|
|
5295
|
+
HTTP deploy stays single-tenant and a managed slug 409s.
|
|
5296
|
+
|
|
5786
5297
|
By default, the command polls every three seconds for up to ten minutes
|
|
5787
5298
|
and succeeds only when the deployment reaches `running`. `--no-wait`
|
|
5788
5299
|
returns after the deployment request is accepted. Multi-agent deploys
|
|
@@ -5909,6 +5420,8 @@ URL connections run a browser PKCE flow. Tokens are written to
|
|
|
5909
5420
|
`mcp-auth.json` under the CLI config directory (override with
|
|
5910
5421
|
`AGENT_SERVE_CONFIG_DIR`). Pass `--store` to upsert matching
|
|
5911
5422
|
`MCP_OAUTH_<CONNECTION>_*` secrets on the hosted deployment.
|
|
5423
|
+
`--store` is the path for the next deploy. Hosted Connect lets the
|
|
5424
|
+
current process retry.
|
|
5912
5425
|
|
|
5913
5426
|
Cursor-account connections authorize the hosted deployment's service
|
|
5914
5427
|
account through the Cursor backend's connector consent flow. Those
|
|
@@ -5987,6 +5500,7 @@ agent-sdk slack icon <https-url-or-file> [--dir <path>] [--prod]
|
|
|
5987
5500
|
[--slack-team <T…>] [--team <id>] [--json]
|
|
5988
5501
|
agent-sdk slack init --manual [--dir <path>] [--name <name>]
|
|
5989
5502
|
[--prefix <prefix> | --no-prefix] [--channel-posts]
|
|
5503
|
+
[--install | --no-install] [--slack-team <T…>] [--prod]
|
|
5990
5504
|
agent-sdk slack manifest [--dir <path>] [--name <name>]
|
|
5991
5505
|
[--env dev|prod|both] [--channel-posts] [--print]
|
|
5992
5506
|
agent-sdk slack doctor [--dir <path>] [--prefix <prefix> | --no-prefix] [--json]
|
|
@@ -6015,17 +5529,26 @@ a local png, jpg, or gif file of at most 512KB.
|
|
|
6015
5529
|
|
|
6016
5530
|
`slack init` without `--manual` exits non-zero and writes no files. Use
|
|
6017
5531
|
`slack create` for the dashboard wizard. `slack init --manual` writes
|
|
6018
|
-
the channel file, development and production manifests,
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
the
|
|
6028
|
-
|
|
5532
|
+
the channel file, development and production manifests, a Slack CLI
|
|
5533
|
+
`.slack/` project (hook + manifests, committed with the repo). When
|
|
5534
|
+
Slack CLI is logged in, it installs the app. Otherwise `next` asks
|
|
5535
|
+
you to install it. `--install` requires that install. `--no-install`
|
|
5536
|
+
skips it. `--prod` selects the deployed app.
|
|
5537
|
+
`--slack-team` picks the workspace. Slack CLI keeps install tokens in
|
|
5538
|
+
that process; copy `xoxb` and mint `xapp` (`connections:write`) into
|
|
5539
|
+
`.env.local`. Tokens that appear in `.env` during that install are
|
|
5540
|
+
copied onto the prefixed names. Paste `.slack/manifest.dev.json` at
|
|
5541
|
+
api.slack.com when the Slack CLI is missing. Do not run
|
|
5542
|
+
`slack deploy`. The command refuses to overwrite the channel file.
|
|
5543
|
+
It updates the Slack CLI hook and manifests when `.slack/` already
|
|
5544
|
+
exists. If a collision occurs, it exits non-zero; files created
|
|
5545
|
+
earlier in the run remain. The token prefix defaults to the directory
|
|
5546
|
+
basename normalized to uppercase snake case.
|
|
5547
|
+
Explicit `--prefix` values use the same normalization. For example,
|
|
5548
|
+
`pr-approver` becomes `PR_APPROVER_SLACK_BOT_TOKEN`. `--no-prefix`
|
|
5549
|
+
uses shared `SLACK_BOT_TOKEN` and `SLACK_APP_TOKEN`.
|
|
5550
|
+
`--channel-posts` subscribes the manifests to channel-post events.
|
|
5551
|
+
The command always prints a JSON summary.
|
|
6029
5552
|
|
|
6030
5553
|
`slack manifest` regenerates selected manifest files. `--env` defaults
|
|
6031
5554
|
to `both`, and `--name` defaults to the directory name. `--print` writes
|
|
@@ -6156,8 +5679,10 @@ Tokens come from env vars. Never hardcode them in the file.
|
|
|
6156
5679
|
## Host MCP OAuth
|
|
6157
5680
|
|
|
6158
5681
|
For servers that speak OAuth, set `oauth: true` and authorize with the
|
|
6159
|
-
CLI. Tokens live in `mcp-auth.json` under the CLI
|
|
6160
|
-
copies them onto the
|
|
5682
|
+
CLI or mid-run Connect. Tokens live in `mcp-auth.json` under the CLI
|
|
5683
|
+
config directory. `--store` copies them onto the deployment as
|
|
5684
|
+
`MCP_OAUTH_<NAME>_*` secrets. Hosted Connect lets the current
|
|
5685
|
+
process retry.
|
|
6161
5686
|
|
|
6162
5687
|
```ts
|
|
6163
5688
|
export default defineConnection({
|
|
@@ -6169,6 +5694,7 @@ export default defineConnection({
|
|
|
6169
5694
|
```bash
|
|
6170
5695
|
agent-sdk mcp oauth inventory # browser PKCE → local mcp-auth.json
|
|
6171
5696
|
agent-sdk mcp oauth inventory --store # also upsert deployment secrets
|
|
5697
|
+
# Hosted Connect retries this process. Self-hosted stays file-only.
|
|
6172
5698
|
```
|
|
6173
5699
|
|
|
6174
5700
|
Full walkthrough: [Host MCP OAuth](/docs/guides/mcp-oauth.md). Companion
|
|
@@ -6387,7 +5913,7 @@ lazily on first use.
|
|
|
6387
5913
|
|
|
6388
5914
|
Continue with these pages:
|
|
6389
5915
|
|
|
6390
|
-
- [Host MCP OAuth](/docs/guides/mcp-oauth.md): `mcp oauth`, `--store`
|
|
5916
|
+
- [Host MCP OAuth](/docs/guides/mcp-oauth.md): `mcp oauth`, Connect, `--store`
|
|
6391
5917
|
- [Agent-to-agent](/docs/guides/agent-to-agent.md): peers in depth
|
|
6392
5918
|
- [Tools](/docs/reference/tools.md): authored tools that wrap MCP connections
|
|
6393
5919
|
- [Webhooks](/docs/guides/webhooks.md): calling MCP connections from handlers
|
|
@@ -6629,7 +6155,8 @@ curl -X POST http://127.0.0.1:3000/<slug>/v1/tools/inspect_pr \
|
|
|
6629
6155
|
It runs an authored server tool in-process: schema-validated, no model
|
|
6630
6156
|
turn. An optional `"sessionId"` in the body runs it inside an existing
|
|
6631
6157
|
session and records it on that session's stream (`409 session_busy`
|
|
6632
|
-
while a turn runs
|
|
6158
|
+
for a write-effect call while a turn runs; reads run alongside the
|
|
6159
|
+
turn). Agent-execution tools are rejected with `400`, and
|
|
6633
6160
|
unknown tools with `404` and the list of available names. For the
|
|
6634
6161
|
semantics, see [Tools](/docs/reference/tools.md#call-a-tool-without-a-model-turn).
|
|
6635
6162
|
|
|
@@ -7345,8 +6872,10 @@ message. Interrupted turns record `turn.failed` with
|
|
|
7345
6872
|
Slack `stop` / `@agent stop` does the same for that thread and clears
|
|
7346
6873
|
pending coalesced nudges.
|
|
7347
6874
|
|
|
7348
|
-
Session-bound deterministic tool calls share the
|
|
7349
|
-
|
|
6875
|
+
Session-bound deterministic tool calls share the lock only for writes: a
|
|
6876
|
+
write-effect call returns `409 session_busy` while a model turn is
|
|
6877
|
+
running, a read-effect call runs alongside the turn (see
|
|
6878
|
+
[Tools](/docs/reference/tools.md#call-a-tool-without-a-model-turn)).
|
|
7350
6879
|
|
|
7351
6880
|
## Which events can I stream?
|
|
7352
6881
|
|
|
@@ -7869,7 +7398,14 @@ when the call returns. Pass a `sessionId` (a body field over
|
|
|
7869
7398
|
HTTP, `--session` on the CLI, `options.sessionId` programmatically) to
|
|
7870
7399
|
run inside an existing session instead: the tool sees that session's
|
|
7871
7400
|
workspace, and the call is recorded on the session's event stream.
|
|
7872
|
-
|
|
7401
|
+
While a model turn is running, a session-bound call is admitted by its
|
|
7402
|
+
effect: a read-effect call (a declared `effect: "read"`, or an advertised
|
|
7403
|
+
MCP tool whose server annotates it read-only) runs alongside the turn,
|
|
7404
|
+
reading the workspace as the turn has left it, and is recorded under its
|
|
7405
|
+
own per-call `turnId` so trajectories keep it apart from the turn's own
|
|
7406
|
+
calls; a write-effect call — including an undeclared tool, which counts
|
|
7407
|
+
as a write — returns `409 session_busy` until the turn finishes, because
|
|
7408
|
+
a running turn owns the workspace. When the
|
|
7873
7409
|
session's harness cwd cannot be materialized, a read-effect call runs
|
|
7874
7410
|
in a scratch workspace instead and the outcome carries
|
|
7875
7411
|
`scratchWorkspace: true`; a write-effect call fails with
|
|
@@ -7879,7 +7415,7 @@ A session can also be addressed by its continuation token: an optional
|
|
|
7879
7415
|
`continuationToken` (`<channelId>:<key>`, as `/v1/sessions` lists it;
|
|
7880
7416
|
mutually exclusive with `sessionId`). A token that maps to a live
|
|
7881
7417
|
session behaves exactly like passing that session's id — same ownership
|
|
7882
|
-
check, same
|
|
7418
|
+
check, same busy semantics, same event recording. A token with no
|
|
7883
7419
|
session behind it runs the call scratch-bound with the token's channel
|
|
7884
7420
|
id and continuation key as the call's session identity, so a deployment
|
|
7885
7421
|
whose tools resolve state from the continuation key can serve it with
|
|
@@ -8333,6 +7869,116 @@ sessions skip GitHub writes.
|
|
|
8333
7869
|
|
|
8334
7870
|
---
|
|
8335
7871
|
|
|
7872
|
+
Source: /docs/templates/agents-md.md
|
|
7873
|
+
|
|
7874
|
+
# Keep AGENTS.md current from last week's work
|
|
7875
|
+
|
|
7876
|
+
This agent runs every Monday at 09:00 UTC. It reads last week's merged
|
|
7877
|
+
pull requests and the Slack channels you list. When a durable rule
|
|
7878
|
+
showed up, `apply_agents` parks the write until a person approves it,
|
|
7879
|
+
then opens a draft follow-up pull request against the default branch.
|
|
7880
|
+
Chores and rules the file already states stay quiet.
|
|
7881
|
+
|
|
7882
|
+
This template is one model turn: read the week, then call
|
|
7883
|
+
`apply_agents`.
|
|
7884
|
+
|
|
7885
|
+
Init once per app. Pass a different repo and channel list each time.
|
|
7886
|
+
|
|
7887
|
+
## Scaffold
|
|
7888
|
+
|
|
7889
|
+
```bash
|
|
7890
|
+
npx @cursor/july init ./agents-md --template agents-md
|
|
7891
|
+
```
|
|
7892
|
+
|
|
7893
|
+
`init` asks which GitHub repo to watch and which Slack channels to
|
|
7894
|
+
read. Pass `--var repos=acme/api --var slack=#eng-api,#api-private`
|
|
7895
|
+
to skip the prompt. Use `--var slack=none` when Slack is out of
|
|
7896
|
+
scope.
|
|
7897
|
+
|
|
7898
|
+
The answers land in `agent/lib/config.ts`. Edit that file when the
|
|
7899
|
+
set changes.
|
|
7900
|
+
|
|
7901
|
+
## Connect GitHub and Slack
|
|
7902
|
+
|
|
7903
|
+
Connect GitHub in Cursor for that repository (Settings or
|
|
7904
|
+
[cursor.com/dashboard](https://cursor.com/dashboard)). Sign the host
|
|
7905
|
+
in:
|
|
7906
|
+
|
|
7907
|
+
```bash
|
|
7908
|
+
cd agents-md
|
|
7909
|
+
agent-sdk login
|
|
7910
|
+
```
|
|
7911
|
+
|
|
7912
|
+
`cursorAccount` mints a short-lived, repo-scoped credential with
|
|
7913
|
+
`contents-write` so the agent can open the follow-up PR. See the
|
|
7914
|
+
[GitHub guide](/docs/guides/github.md).
|
|
7915
|
+
|
|
7916
|
+
Create the Slack app and invite the bot to each listed channel,
|
|
7917
|
+
including private ones:
|
|
7918
|
+
|
|
7919
|
+
```bash
|
|
7920
|
+
agent-sdk slack create --dir .
|
|
7921
|
+
```
|
|
7922
|
+
|
|
7923
|
+
See the [Slack guide](/docs/guides/slack.md).
|
|
7924
|
+
|
|
7925
|
+
## First weekly run
|
|
7926
|
+
|
|
7927
|
+
```bash
|
|
7928
|
+
agent-sdk dev
|
|
7929
|
+
```
|
|
7930
|
+
|
|
7931
|
+
Schedules never fire under `dev`. Dispatch the same path production
|
|
7932
|
+
uses:
|
|
7933
|
+
|
|
7934
|
+
```bash
|
|
7935
|
+
curl -X POST http://127.0.0.1:3000/v1/dev/schedules/weekly
|
|
7936
|
+
```
|
|
7937
|
+
|
|
7938
|
+
The playground can run `/queue/run` too.
|
|
7939
|
+
|
|
7940
|
+
The host writes `week/prs.md`, `week/slack.md`, `week/window.txt`,
|
|
7941
|
+
and `week/tree/**.txt` snapshots of the current `AGENTS.md` files,
|
|
7942
|
+
then starts a model turn. The
|
|
7943
|
+
model calls `apply_agents` once. A skip finishes. An update parks in
|
|
7944
|
+
the playground until someone approves; then a draft PR opens against
|
|
7945
|
+
the repository default branch. Later updates to the same base stack
|
|
7946
|
+
on `agents-md/<base>`. Pull requests from those branches are ignored
|
|
7947
|
+
so the follow-up cannot feed the next week.
|
|
7948
|
+
|
|
7949
|
+
Chat replies stay in the playground. `apply_agents` records a skip,
|
|
7950
|
+
or parks the write. Approve there or with
|
|
7951
|
+
`POST /v1/session/:id/approvals/:callId`.
|
|
7952
|
+
|
|
7953
|
+
## What to edit
|
|
7954
|
+
|
|
7955
|
+
- `agent/lib/config.ts`: repo and Slack channels
|
|
7956
|
+
- `agent/instructions.md`: what counts as an update
|
|
7957
|
+
- `evals/agents.eval.ts`: smoke cases
|
|
7958
|
+
|
|
7959
|
+
## Evals
|
|
7960
|
+
|
|
7961
|
+
Four smoke cases: a lint-only week, a billing rule that parks the
|
|
7962
|
+
write, the same rule already in `AGENTS.md`, and an empty week.
|
|
7963
|
+
|
|
7964
|
+
```bash
|
|
7965
|
+
agent-sdk eval
|
|
7966
|
+
```
|
|
7967
|
+
|
|
7968
|
+
Eval sessions skip the GitHub write.
|
|
7969
|
+
|
|
7970
|
+
## Deploy
|
|
7971
|
+
|
|
7972
|
+
```bash
|
|
7973
|
+
agent-sdk deploy
|
|
7974
|
+
```
|
|
7975
|
+
|
|
7976
|
+
Run it from the agent's git checkout. The command infers repository,
|
|
7977
|
+
ref, path, and slug. Production fires the Monday cron. The deployment
|
|
7978
|
+
uses the team's Cursor GitHub connection for the watched repo.
|
|
7979
|
+
|
|
7980
|
+
---
|
|
7981
|
+
|
|
8336
7982
|
Source: /docs/templates/code-wiki.md
|
|
8337
7983
|
|
|
8338
7984
|
# Keep a code wiki current after merge
|
|
@@ -8939,7 +8585,7 @@ not on `PATH`, use `npx @cursor/july`.
|
|
|
8939
8585
|
| What you see | What to do |
|
|
8940
8586
|
| --- | --- |
|
|
8941
8587
|
| `409` on a follow-up message | Refresh the `continuationToken` or confirm the session is a chat session. Task sessions do not accept follow-ups. |
|
|
8942
|
-
| `409 session_busy` on `call --session` | Wait for the
|
|
8588
|
+
| `409 session_busy` on `call --session` | The tool is a write (or declares no effect) and a model turn is running. Wait for the turn to finish, omit `--session` for a one-off call, or declare `effect: "read"` on a tool that only reads so it runs alongside turns. |
|
|
8943
8589
|
| `403` on stream or follow-up | Use the same auth identity that created the session. Off localhost, pass `--bearer-token` and send it on every request. |
|
|
8944
8590
|
| Works on localhost; blocked through a tunnel or LAN | Default auth allows only direct loopback callers. Share the host with `--bearer-token <secret>` (or authored `bearerAuth`). Use `--allow-anonymous` only on a trusted private network. |
|
|
8945
8591
|
| A channel route fails to compile with a schema type error | `GET` routes need a Zod `querySchema`. `POST` / `PUT` / `PATCH` need a Zod `bodySchema`. Use `z.object({})` or `z.unknown()` for open shapes. |
|
|
@@ -8967,7 +8613,7 @@ not on `PATH`, use `npx @cursor/july`.
|
|
|
8967
8613
|
| What you see | What to do |
|
|
8968
8614
|
| --- | --- |
|
|
8969
8615
|
| `must be defineConnection({ url, oauth: true })` | The connection file needs `oauth: true`, or you passed the wrong connection name to `agent-sdk mcp oauth`. |
|
|
8970
|
-
| Local auth works; hosted calls unauthorized |
|
|
8616
|
+
| Local auth works; hosted calls unauthorized | Finish Connect on the hosted engine, or run `agent-sdk mcp oauth <name> --store`. Confirm names with `agent-sdk secrets list <slug>`, then redeploy. |
|
|
8971
8617
|
| Model asks for `mcp_auth` or IDE MCP for a connector it already has | Attached MCP is behind meta-tools. Set `advertiseTools: true` for named tools on local turns, or call it from a host tool via `ctx.host.mcp`. |
|
|
8972
8618
|
|
|
8973
8619
|
See [Host MCP OAuth](/docs/guides/mcp-oauth.md) and
|