@cursor/july 0.1.94 → 0.1.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +3 -4
- package/dist/channels/deployments/types.d.ts +1 -1
- package/dist/channels/deployments/types.d.ts.map +1 -1
- package/dist/channels/deployments/types.js +1 -0
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +14 -2
- package/dist/channels/github/types.d.ts +18 -3
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/origin/api.d.ts +59 -13
- package/dist/channels/origin/api.d.ts.map +1 -1
- package/dist/channels/origin/api.js +168 -27
- package/dist/channels/origin/binding.d.ts +2 -2
- package/dist/channels/origin/checks.d.ts +6 -6
- package/dist/channels/origin/checks.js +6 -6
- package/dist/channels/origin/cursor-account.d.ts +5 -3
- package/dist/channels/origin/cursor-account.d.ts.map +1 -1
- package/dist/channels/origin/cursor-account.js +5 -3
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +11 -3
- package/dist/channels/origin/origin-webhook.d.ts +11 -1
- package/dist/channels/origin/origin-webhook.d.ts.map +1 -1
- package/dist/channels/origin/origin-webhook.js +23 -3
- package/dist/channels/origin/types.d.ts +8 -0
- package/dist/channels/origin/types.d.ts.map +1 -1
- package/dist/channels/slack/api.d.ts +9 -0
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +36 -5
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +17 -46
- package/dist/channels/slack/dispatch.d.ts +7 -1
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +47 -23
- package/dist/channels/slack/inbound.d.ts +8 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +32 -0
- package/dist/channels/slack/live-delivery.d.ts +26 -29
- package/dist/channels/slack/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +172 -73
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +5 -1
- package/dist/channels/slack/nudge-carrier.d.ts +2 -0
- package/dist/channels/slack/nudge-carrier.d.ts.map +1 -1
- package/dist/channels/slack/nudge-carrier.js +48 -1
- package/dist/channels/slack/pr-ref.d.ts +7 -1
- package/dist/channels/slack/pr-ref.d.ts.map +1 -1
- package/dist/channels/slack/pr-ref.js +42 -23
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +2 -2
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.CFDEas4I.js → app.jXleCmOc.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DFoGuETX.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.B1IIYpYS.js → VPLocalSearchBox.8LhyglIT.js} +1 -1
- package/dist/docs/assets/chunks/{theme.Ct4NSiLm.js → theme.9ged-pr2.js} +2 -2
- package/dist/docs/assets/index.md.CI93Ltlb.js +5 -0
- package/dist/docs/assets/{index.md.DRakGHFe.lean.js → index.md.CI93Ltlb.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.Cw6_ICYG.js → reference_cli.md.CCnG-nJx.js} +4 -2
- package/dist/docs/assets/{reference_cli.md.Cw6_ICYG.lean.js → reference_cli.md.CCnG-nJx.lean.js} +1 -1
- package/dist/docs/assets/{reference_skills.md.8son6Hjm.js → reference_skills.md.BFW9retM.js} +3 -3
- package/dist/docs/assets/{templates_agentic-owners.md.DqtPdm6f.js → templates_agentic-owners.md.BZSH4N9z.js} +1 -1
- package/dist/docs/assets/templates_code-wiki.md.CDYZIBFN.js +2 -0
- package/dist/docs/assets/templates_code-wiki.md.CDYZIBFN.lean.js +1 -0
- package/dist/docs/assets/{templates_demo.md.DhFcWN6j.js → templates_demo.md.BeQX9V3H.js} +1 -1
- package/dist/docs/assets/{templates_pr-autofixer.md.DU7dQpor.js → templates_pr-autofixer.md.x5zl6-GT.js} +2 -2
- package/dist/docs/assets/{templates_pr-autofixer.md.DU7dQpor.lean.js → templates_pr-autofixer.md.x5zl6-GT.lean.js} +1 -1
- package/dist/docs/assets/templates_security-help.md.C3Ny_Qr2.js +4 -0
- package/dist/docs/assets/templates_security-help.md.C3Ny_Qr2.lean.js +1 -0
- package/dist/docs/assets/{templates_security-reviewer.md.CTa7u_l1.js → templates_security-reviewer.md.lshxbCLK.js} +2 -2
- package/dist/docs/assets/{templates_security-reviewer.md.CTa7u_l1.lean.js → templates_security-reviewer.md.lshxbCLK.lean.js} +1 -1
- package/dist/docs/assets/{templates_triage.md.CVlpctKS.js → templates_triage.md.Co4UNzkZ.js} +3 -3
- package/dist/docs/assets/{templates_triage.md.CVlpctKS.lean.js → templates_triage.md.Co4UNzkZ.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +4 -4
- package/dist/docs/deployment.html +4 -4
- package/dist/docs/evals.html +4 -4
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-runtime.html +4 -4
- package/dist/docs/guides/convert-automation.html +4 -4
- package/dist/docs/guides/github.html +4 -4
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +4 -4
- package/dist/docs/guides/opentelemetry.html +4 -4
- package/dist/docs/guides/slack.html +4 -4
- package/dist/docs/guides/webhooks.html +4 -4
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +4 -4
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +5 -1
- package/dist/docs/llms-full.txt +189 -26
- package/dist/docs/llms.txt +2 -0
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +4 -4
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +4 -4
- package/dist/docs/reference/cli.html +8 -6
- package/dist/docs/reference/cli.md +4 -1
- package/dist/docs/reference/connections.html +4 -4
- package/dist/docs/reference/hooks.html +4 -4
- package/dist/docs/reference/http-api.html +4 -4
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +4 -4
- package/dist/docs/reference/project-layout.html +4 -4
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +4 -4
- package/dist/docs/reference/skills.html +7 -7
- package/dist/docs/reference/subagents.html +4 -4
- package/dist/docs/reference/tools.html +4 -4
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/storage.html +4 -4
- package/dist/docs/templates/agentic-owners.html +7 -7
- package/dist/docs/templates/agentic-owners.md +1 -1
- package/dist/docs/templates/code-wiki.html +28 -0
- package/dist/docs/templates/code-wiki.md +91 -0
- package/dist/docs/templates/demo.html +6 -6
- package/dist/docs/templates/demo.md +3 -2
- package/dist/docs/templates/pr-autofixer.html +6 -6
- package/dist/docs/templates/pr-autofixer.md +7 -13
- package/dist/docs/templates/security-help.html +30 -0
- package/dist/docs/templates/security-help.md +65 -0
- package/dist/docs/templates/security-reviewer.html +6 -6
- package/dist/docs/templates/security-reviewer.md +1 -2
- package/dist/docs/templates/triage.html +7 -7
- package/dist/docs/templates/triage.md +2 -6
- package/dist/docs/troubleshooting.html +4 -4
- package/dist/files-backends/cursor-hosted.d.ts +26 -0
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +32 -4
- package/dist/files.d.ts +2 -0
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +5 -0
- package/dist/internal/advertise-tools.d.ts +2 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +15 -1
- package/dist/internal/bounded.d.ts +7 -0
- package/dist/internal/bounded.d.ts.map +1 -0
- package/dist/internal/bounded.js +32 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +142 -7
- package/dist/internal/conversation-mirror.d.ts +85 -0
- package/dist/internal/conversation-mirror.d.ts.map +1 -0
- package/dist/internal/conversation-mirror.js +312 -0
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +22 -48
- package/dist/internal/cursor/session-token.d.ts +45 -0
- package/dist/internal/cursor/session-token.d.ts.map +1 -0
- package/dist/internal/cursor/session-token.js +99 -0
- package/dist/internal/cursor-agent-template.d.ts +1 -1
- package/dist/internal/cursor-agent-template.d.ts.map +1 -1
- package/dist/internal/cursor-agent-template.js +1 -0
- package/dist/internal/deferred-channel-session.d.ts +20 -0
- package/dist/internal/deferred-channel-session.d.ts.map +1 -0
- package/dist/internal/deferred-channel-session.js +62 -0
- package/dist/internal/deploy-client.d.ts +13 -1
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +11 -1
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +11 -5
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +22 -2
- package/dist/internal/framework-file-storage.d.ts +61 -0
- package/dist/internal/framework-file-storage.d.ts.map +1 -0
- package/dist/internal/framework-file-storage.js +204 -0
- package/dist/internal/framework-storage-selection.d.ts +38 -16
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +78 -17
- package/dist/internal/hosted-admission-context.d.ts +20 -0
- package/dist/internal/hosted-admission-context.d.ts.map +1 -0
- package/dist/internal/hosted-admission-context.js +31 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +5 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +33 -1
- package/dist/internal/hosted-delivery.d.ts +11 -2
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +79 -35
- package/dist/internal/hosted-managed-automation.d.ts +30 -0
- package/dist/internal/hosted-managed-automation.d.ts.map +1 -0
- package/dist/internal/hosted-managed-automation.js +58 -0
- package/dist/internal/init-project.d.ts.map +1 -1
- package/dist/internal/init-project.js +2 -0
- package/dist/internal/install-cursor-skills.d.ts.map +1 -1
- package/dist/internal/install-cursor-skills.js +1 -3
- package/dist/internal/managed-delivery.d.ts +80 -0
- package/dist/internal/managed-delivery.d.ts.map +1 -0
- package/dist/internal/managed-delivery.js +86 -0
- package/dist/internal/review-comments.d.ts.map +1 -1
- package/dist/internal/review-comments.js +10 -98
- package/dist/internal/runtime-dispatch-runner.d.ts +5 -1
- package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -1
- package/dist/internal/runtime-dispatch-runner.js +7 -0
- package/dist/internal/scm/pr-url.d.ts +14 -0
- package/dist/internal/scm/pr-url.d.ts.map +1 -0
- package/dist/internal/scm/pr-url.js +65 -0
- package/dist/internal/sdk-runner.d.ts +25 -0
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +70 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +11 -2
- package/dist/internal/session-engine.d.ts +13 -0
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +71 -3
- package/dist/internal/steering.d.ts +15 -0
- package/dist/internal/steering.d.ts.map +1 -0
- package/dist/internal/steering.js +18 -0
- package/dist/playground/assets/index-B1DDvBeC.css +1 -0
- package/dist/playground/assets/{index-B3JCyigB.js → index-Cx9CclK_.js} +47 -47
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted.d.ts +8 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +4 -3
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +5 -1
- package/docs/reference/cli.md +4 -1
- package/docs/templates/agentic-owners.md +1 -1
- package/docs/templates/code-wiki.md +96 -0
- package/docs/templates/demo.md +3 -2
- package/docs/templates/pr-autofixer.md +7 -13
- package/docs/templates/security-help.md +70 -0
- package/docs/templates/security-reviewer.md +1 -2
- package/docs/templates/triage.md +2 -6
- package/package.json +2 -2
- package/skills/ab/SKILL.md +13 -97
- package/skills/create-agent/SKILL.md +123 -223
- package/skills/debug/SKILL.md +34 -68
- package/skills/evals/SKILL.md +55 -180
- package/skills/framework-map/SKILL.md +83 -145
- package/skills/github/SKILL.md +53 -111
- package/skills/hillclimb/SKILL.md +40 -163
- package/skills/mcp-auth/SKILL.md +48 -107
- package/skills/otel/SKILL.md +22 -68
- package/skills/setup-slack/SKILL.md +77 -208
- package/src/channels/deployments/types.ts +1 -0
- package/src/channels/github/github-channel.ts +23 -8
- package/src/channels/github/types.ts +19 -2
- package/src/channels/origin/api.ts +242 -30
- package/src/channels/origin/binding.ts +2 -2
- package/src/channels/origin/checks.ts +6 -6
- package/src/channels/origin/cursor-account.ts +5 -3
- package/src/channels/origin/origin-channel.ts +13 -1
- package/src/channels/origin/origin-webhook.ts +27 -3
- package/src/channels/origin/types.ts +8 -0
- package/src/channels/slack/api.ts +41 -5
- package/src/channels/slack/defaults.ts +15 -49
- package/src/channels/slack/dispatch.ts +56 -22
- package/src/channels/slack/inbound.ts +43 -0
- package/src/channels/slack/live-delivery.ts +235 -114
- package/src/channels/slack/manifest.ts +5 -1
- package/src/channels/slack/nudge-carrier.ts +48 -1
- package/src/channels/slack/pr-ref.ts +56 -25
- package/src/channels/slack/slack-channel.ts +2 -0
- package/src/files-backends/cursor-hosted.ts +41 -2
- package/src/files.ts +11 -0
- package/src/internal/advertise-tools.ts +18 -2
- package/src/internal/bounded.ts +28 -0
- package/src/internal/cli-deploy.ts +183 -7
- package/src/internal/conversation-mirror.ts +406 -0
- package/src/internal/cursor/backend-client.ts +34 -58
- package/src/internal/cursor/session-token.ts +115 -0
- package/src/internal/cursor-agent-template.ts +1 -0
- package/src/internal/deferred-channel-session.ts +61 -0
- package/src/internal/deploy-client.ts +24 -1
- package/src/internal/deploy-manifest.ts +10 -5
- package/src/internal/discovery.ts +25 -2
- package/src/internal/framework-file-storage.ts +222 -0
- package/src/internal/framework-storage-selection.ts +101 -19
- package/src/internal/hosted-admission-context.ts +37 -0
- package/src/internal/hosted-delivery-protocol.ts +44 -1
- package/src/internal/hosted-delivery.ts +105 -40
- package/src/internal/hosted-managed-automation.ts +72 -0
- package/src/internal/init-project.ts +2 -0
- package/src/internal/install-cursor-skills.ts +1 -4
- package/src/internal/managed-delivery.ts +125 -0
- package/src/internal/review-comments.ts +10 -113
- package/src/internal/runtime-dispatch-runner.ts +10 -0
- package/src/internal/scm/pr-url.ts +95 -0
- package/src/internal/sdk-runner.ts +103 -0
- package/src/internal/server.ts +12 -0
- package/src/internal/session-engine.ts +76 -4
- package/src/internal/steering.ts +17 -0
- package/src/storage-backends/cursor-hosted.ts +10 -1
- package/src/types.ts +2 -1
- package/templates/agentic-owners/README.md +1 -1
- package/templates/agentic-owners/agent/agent.ts +0 -10
- package/templates/agentic-owners/agent/channels/github.ts +5 -14
- package/templates/agentic-owners/agent/lib/config.ts +0 -8
- package/templates/agentic-owners/agent/lib/review.ts +2 -15
- package/templates/agentic-owners/agent/tools/record_review.ts +2 -4
- package/templates/code-wiki/README.md +34 -0
- package/templates/code-wiki/agent/agent.ts +8 -0
- package/templates/code-wiki/agent/channels/github.ts +144 -0
- package/templates/code-wiki/agent/instructions.md +39 -0
- package/templates/code-wiki/agent/lib/repos.ts +5 -0
- package/templates/code-wiki/agent/lib/wiki.ts +22 -0
- package/templates/code-wiki/agent/tools/apply_wiki.ts +219 -0
- package/templates/code-wiki/evals/evals.config.ts +5 -0
- package/templates/code-wiki/evals/wiki.eval.ts +132 -0
- package/templates/code-wiki/init.json +25 -0
- package/templates/code-wiki/package.json +18 -0
- package/templates/code-wiki/tsconfig.json +12 -0
- package/templates/demo/agent/agent.ts +0 -10
- package/templates/pr-autofixer/README.md +0 -2
- package/templates/pr-autofixer/agent/agent.ts +0 -11
- package/templates/pr-autofixer/agent/channels/slack.ts +0 -7
- package/templates/pr-autofixer/agent/lib/pr-state.ts +5 -17
- package/templates/pr-autofixer/agent/lib/repos.ts +0 -1
- package/templates/security-help/README.md +2 -2
- package/templates/security-help/agent/agent.ts +1 -2
- package/templates/security-help/agent/channels/slack.ts +0 -3
- package/templates/security-help/agent/instructions.md +9 -10
- package/templates/security-help/agent/skills/access-request.md +1 -1
- package/templates/security-help/agent/skills/faq.md +31 -0
- package/templates/security-help/agent/skills/security-playbooks.md +1 -1
- package/templates/security-help/package.json +1 -2
- package/templates/security-reviewer/agent/agent.ts +0 -10
- package/templates/triage/agent/agent.ts +0 -10
- package/templates/triage/agent/channels/queue.ts +1 -1
- package/templates/triage/agent/channels/webhook.ts +1 -3
- package/dist/docs/assets/chunks/@localSearchIndexroot.DU3U2Ij2.js +0 -1
- package/dist/docs/assets/index.md.DRakGHFe.js +0 -5
- package/dist/internal/deployment-scm-event-stream.d.ts +0 -116
- package/dist/internal/deployment-scm-event-stream.d.ts.map +0 -1
- package/dist/internal/deployment-scm-event-stream.js +0 -474
- package/dist/playground/assets/index-D9N7-q97.css +0 -1
- package/src/internal/deployment-scm-event-stream.ts +0 -593
- package/templates/security-help/agent/knowledge/faq/approvals.md +0 -5
- package/templates/security-help/agent/knowledge/faq/channels.md +0 -6
- package/templates/security-help/agent/knowledge/faq/phishing.md +0 -10
- package/templates/security-help/agent/skills/security-first-pass.md +0 -15
- /package/dist/docs/assets/{reference_skills.md.8son6Hjm.lean.js → reference_skills.md.BFW9retM.lean.js} +0 -0
- /package/dist/docs/assets/{templates_agentic-owners.md.DqtPdm6f.lean.js → templates_agentic-owners.md.BZSH4N9z.lean.js} +0 -0
- /package/dist/docs/assets/{templates_demo.md.DhFcWN6j.lean.js → templates_demo.md.BeQX9V3H.lean.js} +0 -0
|
@@ -1,186 +1,63 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agentsdk-hillclimb
|
|
3
3
|
description: >-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
existing agent.
|
|
8
|
-
paths:
|
|
9
|
-
- packages/agent-serve/**/*
|
|
4
|
+
Improve one existing Agent SDK agent: pin fixtures, measure, change
|
|
5
|
+
one lever, remeasure, lock the win with an eval. Use when an agent
|
|
6
|
+
already runs and needs better results.
|
|
10
7
|
---
|
|
11
8
|
|
|
12
9
|
# Agent SDK hillclimb
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
host serves the same index at `/docs/llms.txt`.
|
|
11
|
+
Measure → change one lever → remeasure. One failure mode per round.
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
whole framework; climb one concrete failure mode at a time. Sibling skills:
|
|
20
|
-
`framework-map` (orientation), `evals` (the ratchet), `ab` (live variant
|
|
21
|
-
metrics under serve), `github` (deterministic webhook replay), `debug`
|
|
22
|
-
(when a run misbehaves rather than underperforms).
|
|
13
|
+
Siblings: `skills/evals/SKILL.md`, `skills/github/SKILL.md`,
|
|
14
|
+
`skills/debug/SKILL.md`.
|
|
23
15
|
|
|
24
16
|
## Preconditions
|
|
25
17
|
|
|
26
|
-
|
|
18
|
+
From the user or the invoking message:
|
|
27
19
|
|
|
28
|
-
1. **Target
|
|
29
|
-
2. **
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
wall time, higher finding quality, fewer wrong side-effects, …)
|
|
33
|
-
4. **Freeze line** — what must not change (API contracts, public output shape)
|
|
20
|
+
1. **Target.** Path or slug
|
|
21
|
+
2. **Fixtures.** Fixed inputs
|
|
22
|
+
3. **Success.** What better means this round
|
|
23
|
+
4. **Freeze line.** What must not change
|
|
34
24
|
|
|
35
|
-
|
|
25
|
+
Ask before editing if any are missing. A moving fixture is noise.
|
|
36
26
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
A climb over a moving input is noise. Before round 1:
|
|
40
|
-
|
|
41
|
-
- **GitHub agents** — replay, don't wait for live events:
|
|
42
|
-
`agent-sdk github replay <pr> --dir <project>` synthesizes signed,
|
|
43
|
-
GitHub-shaped payloads from read access only, identically every run;
|
|
44
|
-
`--dry-run --out fixtures/github` snapshots them for offline replay.
|
|
45
|
-
- **Tool behavior** — isolate host tools from the model with
|
|
46
|
-
`agent-sdk call <tool> --dir <project> --input '{...}'` (schema-validated,
|
|
47
|
-
in-process, no turn). If the tool output is wrong, no prompt change fixes it.
|
|
48
|
-
- **Chat agents** — `agent-sdk run --dir <project> --message "<fixture>"`
|
|
49
|
-
gives a JSON trajectory plus an NDJSON trace under
|
|
50
|
-
`<project>/.agent-serve/traces/`; `agent-sdk trajectory --events <file>`
|
|
51
|
-
re-summarizes any saved trace.
|
|
52
|
-
- **Manual probes** — the playground Try modal on any channel route
|
|
53
|
-
remembers your last body per endpoint and has Copy curl; a successful Try
|
|
54
|
-
opens the created session.
|
|
55
|
-
|
|
56
|
-
## Loop
|
|
57
|
-
|
|
58
|
-
Repeat until the user stops or fixtures meet the criteria.
|
|
59
|
-
|
|
60
|
-
### 1. Baseline
|
|
61
|
-
|
|
62
|
-
- Serve with Node (never Bun):
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
agent-sdk serve --dir <project> --dev
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
- Hit the agent the way a user would (channel HTTP, playground, Slack in
|
|
69
|
-
`--dev` if that is the surface under test).
|
|
70
|
-
|
|
71
|
-
Custom channels live at `http://127.0.0.1:3000/<slug>/v1/channels/<id>`.
|
|
72
|
-
Playground: `http://127.0.0.1:3000/<slug>/playground`.
|
|
73
|
-
|
|
74
|
-
- Record for each fixture:
|
|
75
|
-
- HTTP/status and wall time
|
|
76
|
-
- `sessionId` + playground URL
|
|
77
|
-
- final result text / structured output
|
|
78
|
-
- tool trajectory from session `events.ndjson` (`actions.requested` /
|
|
79
|
-
`action.result`)
|
|
80
|
-
- workspace footprint (what the host seeded vs what the model opened)
|
|
81
|
-
|
|
82
|
-
Sessions typically live under:
|
|
83
|
-
|
|
84
|
-
`<project>/.agent-serve/<slug>/sessions/<sessionId>/`
|
|
85
|
-
|
|
86
|
-
### 2. Reflect
|
|
87
|
-
|
|
88
|
-
Score the run on three axes; cite evidence from the trajectory, not vibes.
|
|
89
|
-
|
|
90
|
-
| Axis | Ask |
|
|
27
|
+
| Surface | Pin it |
|
|
91
28
|
| --- | --- |
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
|
|
96
|
-
Name the **single dominant failure mode** for this round (e.g. “full-file dumps
|
|
97
|
-
trigger grep loops”, “skill not on disk so model searches the monorepo”).
|
|
98
|
-
|
|
99
|
-
### 3. Propose one change
|
|
100
|
-
|
|
101
|
-
Prefer the smallest lever that addresses that failure mode — and check the
|
|
102
|
-
subtractive lever first:
|
|
103
|
-
|
|
104
|
-
0. **Deletion** — remove the code, cache, flag, or prompt that caused the
|
|
105
|
-
failure. A round that shrinks the agent while holding the metrics is a
|
|
106
|
-
win, not a wash.
|
|
107
|
-
1. **Instructions / skills** — tighten procedure, state the output contract
|
|
108
|
-
(shape, sections, caps), forbid escape hatches that invite thrash. First
|
|
109
|
-
lever for quality, formatting, and wording failures.
|
|
110
|
-
2. **Evidence shape** — trim, split, or order artifacts so the intended file
|
|
111
|
-
is primary
|
|
112
|
-
3. **Host prep** — deterministic tools / channel handlers seed only what the
|
|
113
|
-
model needs (`workspaceFiles`, channel `callTool`, …). First lever for
|
|
114
|
-
tool-wandering and latency failures. Prep evidence and gate side effects;
|
|
115
|
-
do **not** move formatting, summarizing, or classification here — that is
|
|
116
|
-
the model's job specified badly, and host code is a permanent tax (types,
|
|
117
|
-
tests, restarts, drift).
|
|
118
|
-
4. **Tool surface** — remove or gate tools that enable wandering
|
|
119
|
-
5. **Framework changes** only if the agent cannot express the fix otherwise —
|
|
120
|
-
but when the gap is plumbing the framework should own (posting, chunking,
|
|
121
|
-
auth, retries), extend it or file the gap. A hand-rolled transport
|
|
122
|
-
workaround in `agent/lib/` outlives the gap and never flows back.
|
|
123
|
-
|
|
124
|
-
State the hypothesis in one sentence: *“If we X, metric Y should move because Z.”*
|
|
125
|
-
|
|
126
|
-
### 4. Apply and remeasure
|
|
29
|
+
| GitHub | `agent-sdk github replay <pr> --dir <project>` (`--dry-run --out fixtures/github`) |
|
|
30
|
+
| One tool | `agent-sdk call <tool> --dir <project> --input '{...}'` |
|
|
31
|
+
| Chat | `agent-sdk run --dir <project> --message "<fixture>"` |
|
|
127
32
|
|
|
128
|
-
|
|
129
|
-
- Restart serve if needed (agent project code or package `src/`).
|
|
130
|
-
- Re-run the **same** fixtures.
|
|
131
|
-
- Diff metrics side-by-side (tools, bytes, time, quality notes).
|
|
132
|
-
- Keep the change only if the target metric improves without regressing the
|
|
133
|
-
freeze line; otherwise revert or narrow.
|
|
134
|
-
- **Ratchet every kept change**: land an eval that would have failed before
|
|
135
|
-
it (tool-choice gate, `action.result` count bound, output-shape regex —
|
|
136
|
-
see `evals/SKILL.md`), and never weaken an existing gate to make a round
|
|
137
|
-
pass. `agent-sdk eval --dir <project> --json` is the regression check
|
|
138
|
-
between rounds.
|
|
139
|
-
|
|
140
|
-
Present a short round report to the user before starting the next climb.
|
|
141
|
-
|
|
142
|
-
## Measurement tips
|
|
143
|
-
|
|
144
|
-
- Prefer `action.result` counts by `toolName` over raw event volume.
|
|
145
|
-
- Log paths the model actually read; escape outside the session workspace is a
|
|
146
|
-
harness smell.
|
|
147
|
-
- Separate **host** work (channel `callTool`, prepare steps) from **model**
|
|
148
|
-
tools when blaming latency. The biggest wins this framework has seen came
|
|
149
|
-
from moving deterministic work to the host (one PR reviewer's host-prepared
|
|
150
|
-
reviews cut ~8-minute tool-wandering turns to ~1 minute), not from prompt
|
|
151
|
-
tuning.
|
|
152
|
-
- The reverse also holds: every optimization on the deterministic path —
|
|
153
|
-
prefetch, fingerprint dedupe, write coalescing, TTL caches — is code, tests,
|
|
154
|
-
and flags forever. Add one only against measured pressure (wake volume,
|
|
155
|
-
rate-limit hits, model spend) recorded in the round report; when the data
|
|
156
|
-
says the cache would rarely hit, don't build it.
|
|
157
|
-
- For quality, spot-check against a known-good review or oracle on at least
|
|
158
|
-
one fixture; efficiency-only climbs will silently drop findings.
|
|
159
|
-
- `turn.failed` with `"turn interrupted"` in a trace means a follow-up or
|
|
160
|
-
stop preempted the turn — measurement artifact, not a regression.
|
|
161
|
-
|
|
162
|
-
## Working agreements
|
|
163
|
-
|
|
164
|
-
- One failure mode per round — no mixed “also rewrite instructions while
|
|
165
|
-
trimming evidence” bundles unless the user asks.
|
|
166
|
-
- Climbs accrete; schedule the counter-move. Every few rounds propose a
|
|
167
|
-
**shrink round**: dead flags, caches that never hit (the disposition
|
|
168
|
-
metrics tell you), host renderers the model could own under an output
|
|
169
|
-
contract. The eval suite is exactly what makes deletion safe.
|
|
170
|
-
- Keep fixtures fixed until a climb explicitly needs a harder case.
|
|
171
|
-
- Use mise/Node workflows already documented for this package; do not introduce
|
|
172
|
-
Bun.
|
|
173
|
-
- Do not deploy, post real GitHub reviews, or push unless the user asks.
|
|
174
|
-
- Commit only when asked.
|
|
33
|
+
## Loop
|
|
175
34
|
|
|
176
|
-
|
|
35
|
+
1. **Serve.** `agent-sdk serve --dir <project> --mode single --dev`
|
|
36
|
+
Playground: `http://127.0.0.1:3000/playground`.
|
|
37
|
+
2. **Hit it.** Same path a user would. Record status, wall time,
|
|
38
|
+
`sessionId`, output, and `action.result` counts by `toolName`.
|
|
39
|
+
3. **Name the failure.** Score correctness, efficiency, harness
|
|
40
|
+
fit. One dominant failure this round.
|
|
41
|
+
4. **Change one lever.** Smallest first. Delete the code or prompt
|
|
42
|
+
that caused it. Then instructions / skills, evidence shape,
|
|
43
|
+
host prep (`workspaceFiles`, channel `callTool`) for wandering
|
|
44
|
+
and latency (not formatting or judgment), remove or gate
|
|
45
|
+
wandering tools, framework only if the agent cannot express
|
|
46
|
+
the fix. Hypothesis: *If we X, metric Y should move because Z.*
|
|
47
|
+
5. **Remeasure.** Same fixtures. Keep only if the target metric
|
|
48
|
+
improves and the freeze line holds.
|
|
49
|
+
6. **Lock.** A kept change gets an eval that would have failed
|
|
50
|
+
before it (`skills/evals/SKILL.md`). Never weaken a gate to
|
|
51
|
+
pass a round.
|
|
177
52
|
|
|
178
53
|
```markdown
|
|
179
|
-
### Hillclimb round N
|
|
54
|
+
### Hillclimb round N. `<slug>`
|
|
180
55
|
- Fixture(s): …
|
|
181
56
|
- Hypothesis: …
|
|
182
|
-
- Change:
|
|
183
|
-
- Before → after: tools …; wall …;
|
|
57
|
+
- Change: …
|
|
58
|
+
- Before → after: tools …; wall …; quality …
|
|
184
59
|
- Verdict: keep | revert | narrow
|
|
185
|
-
- Next failure mode
|
|
60
|
+
- Next failure mode:
|
|
186
61
|
```
|
|
62
|
+
|
|
63
|
+
Do not deploy or post real GitHub reviews unless asked.
|
package/skills/mcp-auth/SKILL.md
CHANGED
|
@@ -2,139 +2,80 @@
|
|
|
2
2
|
name: agentsdk-mcp-auth
|
|
3
3
|
description: >-
|
|
4
4
|
Authorize host MCP OAuth for defineConnection({ url, oauth: true }):
|
|
5
|
-
agent-sdk mcp oauth, local
|
|
6
|
-
|
|
5
|
+
agent-sdk mcp oauth, local tokens, --store, advertiseTools, egress.
|
|
6
|
+
Use when wiring or debugging MCP auth.
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
# Host MCP OAuth
|
|
9
|
+
# Host MCP OAuth
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
host serves the same index at `/docs/llms.txt`.
|
|
13
|
-
|
|
14
|
-
Use this skill when a human asks to authorize a remote MCP server on an
|
|
15
|
-
Agent SDK host, store credentials for Cursor-managed hosting, or debug
|
|
16
|
-
`host.mcp` auth failures for `oauth: true` connections.
|
|
17
|
-
|
|
18
|
-
Sibling skills: `framework-map` for layout, `create-agent` when scaffolding,
|
|
19
|
-
`debug` for unrelated local failures, `operate` for deploy/secrets ops.
|
|
20
|
-
|
|
21
|
-
Docs: `docs/guides/mcp-oauth.md`, `docs/reference/connections.md`,
|
|
22
|
-
`docs/reference/cli.md#mcp-oauth`.
|
|
23
|
-
|
|
24
|
-
## When to use host OAuth vs account MCP
|
|
11
|
+
Guide: `docs/guides/mcp-oauth.md`.
|
|
25
12
|
|
|
26
13
|
| Need | Use |
|
|
27
14
|
| --- | --- |
|
|
28
|
-
| Connector already in Cursor dashboard
|
|
29
|
-
| Remote URL that speaks OAuth; host
|
|
30
|
-
| Static bearer / API key | `headers` / env on
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
15
|
+
| Connector already in the Cursor dashboard | `defineConnection({ cursorAccount: true })` or `servers: "*"` / `servers: […]` |
|
|
16
|
+
| Remote URL that speaks OAuth; host holds tokens | `defineConnection({ url, oauth: true })` + this skill |
|
|
17
|
+
| Static bearer / API key | `headers` / env on `{ url }` |
|
|
18
|
+
|
|
19
|
+
`advertiseTools: true` puts named tools on local turns. Host tools
|
|
20
|
+
can still call `ctx.host.mcp`.
|
|
21
|
+
|
|
22
|
+
## Checklist
|
|
23
|
+
|
|
24
|
+
1. **Declare the connection.** `agent/mcp-connections/<name>.ts`
|
|
25
|
+
with `url` + `oauth: true`. Use `agent/host-connections/` when
|
|
26
|
+
the model must not see it.
|
|
27
|
+
2. **Name the secrets** if you will `--store`:
|
|
28
|
+
`hosting.secretNames` lists
|
|
29
|
+
`MCP_OAUTH_<NAME>_{ACCESS_TOKEN,REFRESH_TOKEN,CLIENT_ID}`.
|
|
30
|
+
3. **Allow egress** on hosted non-bootstrap hosts:
|
|
31
|
+
`hosting.egressDomains`.
|
|
32
|
+
4. **Authorize.** Local: `agent-sdk mcp oauth <name>`. Hosted:
|
|
33
|
+
`agent-sdk mcp oauth <name> --store` then `agent-sdk deploy`.
|
|
34
|
+
`secrets list` shows the names.
|
|
45
35
|
|
|
46
36
|
```ts
|
|
47
37
|
// agent/mcp-connections/inventory.ts
|
|
48
|
-
import { defineConnection } from "@cursor/july/connections";
|
|
49
|
-
|
|
50
38
|
export default defineConnection({
|
|
51
39
|
url: "https://mcp.example.com/inventory",
|
|
52
40
|
oauth: true,
|
|
53
|
-
description: "Inventory MCP.",
|
|
54
41
|
});
|
|
55
42
|
```
|
|
56
43
|
|
|
57
|
-
In `agent/agent.ts`:
|
|
58
|
-
|
|
59
|
-
```ts
|
|
60
|
-
hosting: {
|
|
61
|
-
egressDomains: ["mcp.example.com"], // if hosted + non-bootstrap host
|
|
62
|
-
secretNames: [
|
|
63
|
-
"MCP_OAUTH_INVENTORY_ACCESS_TOKEN",
|
|
64
|
-
"MCP_OAUTH_INVENTORY_REFRESH_TOKEN",
|
|
65
|
-
"MCP_OAUTH_INVENTORY_CLIENT_ID",
|
|
66
|
-
],
|
|
67
|
-
},
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Naming: connection file `inventory.ts` → env prefix `MCP_OAUTH_INVENTORY`.
|
|
71
|
-
Do **not** put `CURSOR_*` or hosted-storage names in `secretNames`.
|
|
72
|
-
|
|
73
|
-
Wire privileged calls through host tools:
|
|
74
|
-
|
|
75
44
|
```ts
|
|
76
|
-
|
|
77
|
-
|
|
45
|
+
// agent/agent.ts
|
|
46
|
+
export default defineAgent({
|
|
47
|
+
hosting: {
|
|
48
|
+
secretNames: [
|
|
49
|
+
"MCP_OAUTH_INVENTORY_ACCESS_TOKEN",
|
|
50
|
+
"MCP_OAUTH_INVENTORY_REFRESH_TOKEN",
|
|
51
|
+
"MCP_OAUTH_INVENTORY_CLIENT_ID",
|
|
52
|
+
],
|
|
53
|
+
egressDomains: ["mcp.example.com"],
|
|
54
|
+
},
|
|
78
55
|
});
|
|
79
56
|
```
|
|
80
57
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
## Phase 1 — Local authorize (agent + human)
|
|
58
|
+
File `inventory.ts` → prefix `MCP_OAUTH_INVENTORY`. Do not put
|
|
59
|
+
`CURSOR_*` names in `secretNames`.
|
|
85
60
|
|
|
86
61
|
```bash
|
|
87
|
-
cd <agent-project>
|
|
88
62
|
agent-sdk mcp oauth <connection>
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Human completes the browser login. Callback:
|
|
92
|
-
`http://localhost:8787/callback`. Tokens:
|
|
93
|
-
`~/.config/agent-serve/mcp-auth.json` (or `$AGENT_SERVE_CONFIG_DIR`).
|
|
94
|
-
|
|
95
|
-
Already authorized → command prints that and exits 0. URL change →
|
|
96
|
-
re-run; resource URL binding drops the old entry.
|
|
97
|
-
|
|
98
|
-
## Phase 2 — Store on the deployment (agent + human)
|
|
99
|
-
|
|
100
|
-
Requires `agent-sdk login` (or `CURSOR_API_KEY`) and deploy rights.
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
agent-sdk mcp oauth <connection> --store [--slug <slug>] [--team <id>]
|
|
63
|
+
agent-sdk mcp oauth <connection> --store [--slug <slug>]
|
|
104
64
|
agent-sdk secrets list <slug>
|
|
105
|
-
agent-sdk deploy
|
|
65
|
+
agent-sdk deploy
|
|
106
66
|
```
|
|
107
67
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
Local:
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
agent-sdk validate --dir .
|
|
117
|
-
agent-sdk call <tool-that-uses-host.mcp> --dir .
|
|
118
|
-
# or exercise the same path from the playground
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
Hosted: confirm egress allowlist includes the MCP host, secrets exist,
|
|
122
|
-
redeploy completed, then exercise the same host tool once.
|
|
123
|
-
|
|
124
|
-
## Failure table
|
|
68
|
+
Browser callback: `http://127.0.0.1:8787/callback`. Tokens live in
|
|
69
|
+
the CLI config directory (`mcp-auth.json` or
|
|
70
|
+
`$AGENT_SERVE_CONFIG_DIR`). URL change drops the old entry; re-run.
|
|
71
|
+
`--store` does not restart a running engine.
|
|
125
72
|
|
|
126
73
|
| Symptom | Fix |
|
|
127
74
|
| --- | --- |
|
|
128
|
-
| `must be defineConnection({ url, oauth: true })` | Wrong
|
|
129
|
-
| `Unknown MCP connection` | Filename
|
|
130
|
-
| Callback hang | Free port 8787; finish browser flow
|
|
131
|
-
| Hosted 401
|
|
132
|
-
| Model invents `mcp_auth` / IDE MCP |
|
|
133
|
-
| Tokens ignored after URL edit | Expected; run `mcp oauth` again for the new resource URL |
|
|
134
|
-
|
|
135
|
-
## Don't
|
|
75
|
+
| `must be defineConnection({ url, oauth: true })` | Wrong name or missing `oauth: true` |
|
|
76
|
+
| `Unknown MCP connection` | Filename must match the CLI arg |
|
|
77
|
+
| Callback hang | Free port 8787; finish the browser flow here |
|
|
78
|
+
| Hosted 401 | `secrets list`; `--store`; redeploy |
|
|
79
|
+
| Model invents `mcp_auth` / IDE MCP | `advertiseTools: true` on local turns |
|
|
136
80
|
|
|
137
|
-
|
|
138
|
-
- Don't add `BUGBOTDB_URL` / `AGENT_SERVE_DEPLOYMENT_ID` to `secretNames`
|
|
139
|
-
- Don't use Bun for the CLI (use Node / `tsx`)
|
|
140
|
-
- Don't expect `--store` alone to restart a running engine; redeploy
|
|
81
|
+
No raw tokens in git.
|
package/skills/otel/SKILL.md
CHANGED
|
@@ -1,80 +1,48 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agentsdk-otel
|
|
3
3
|
description: >-
|
|
4
|
-
Wire OpenTelemetry export
|
|
5
|
-
|
|
6
|
-
Datadog/Grafana/OTLP export, session/turn/tool tracing, or custom metrics.
|
|
4
|
+
Wire OpenTelemetry export (defineOtel, OTLP env, traces/metrics/logs,
|
|
5
|
+
ctx.host.otel). Use when adding collector export or custom metrics.
|
|
7
6
|
---
|
|
8
7
|
|
|
9
8
|
# Agent SDK OpenTelemetry (`defineOtel`)
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
Push traces and metrics from the serve process to an OTLP
|
|
11
|
+
collector. Logs are off until you opt in.
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
metrics, from the serve process to an OTLP collector. Logs are off
|
|
16
|
-
until you opt in.
|
|
17
|
-
|
|
18
|
-
Read [OpenTelemetry](../../docs/guides/opentelemetry.md) for the full
|
|
19
|
-
guide, including how this joins Cursor enterprise export.
|
|
13
|
+
Guide: `docs/guides/opentelemetry.md`.
|
|
20
14
|
|
|
21
15
|
## Enable
|
|
22
16
|
|
|
23
17
|
Any one of:
|
|
24
18
|
|
|
25
|
-
1.
|
|
19
|
+
1. `OTEL_EXPORTER_OTLP_ENDPOINT` (optional
|
|
26
20
|
`OTEL_SERVICE_NAME`, `OTEL_EXPORTER_OTLP_HEADERS`,
|
|
27
|
-
`OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf|http/json`)
|
|
28
|
-
|
|
29
|
-
`OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` / `_METRICS_ENDPOINT` /
|
|
30
|
-
`_LOGS_ENDPOINT`.
|
|
31
|
-
2. **Authored.** `agent/otel.ts`:
|
|
21
|
+
`OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf|http/json`)
|
|
22
|
+
2. `agent/otel.ts`:
|
|
32
23
|
|
|
33
24
|
```ts
|
|
34
25
|
import { defineOtel } from "@cursor/july/otel";
|
|
35
26
|
|
|
36
27
|
export default defineOtel({
|
|
37
28
|
serviceName: "cursor",
|
|
38
|
-
exporters: [
|
|
39
|
-
{
|
|
40
|
-
url: "https://otel.example.com",
|
|
41
|
-
protocol: "http/protobuf",
|
|
42
|
-
headers: { Authorization: "Bearer …" },
|
|
43
|
-
},
|
|
44
|
-
],
|
|
29
|
+
exporters: [{ url: "https://otel.example.com", protocol: "http/protobuf" }],
|
|
45
30
|
});
|
|
46
31
|
```
|
|
47
32
|
|
|
48
|
-
3.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
Multiple `exporters` fan out. Default protocol is `http/protobuf`.
|
|
52
|
-
Use `http/json` only when the collector requires it. `grpc` is ignored.
|
|
53
|
-
|
|
54
|
-
Precedence: `serve({ otel })` over `agent/otel.ts` over env.
|
|
55
|
-
|
|
56
|
-
## Signals
|
|
57
|
-
|
|
58
|
-
| Signal | Default | What |
|
|
59
|
-
| --- | --- | --- |
|
|
60
|
-
| Traces | on | `agent_sdk.http` → `agent_sdk.session` → `agent_sdk.turn` → `agent_sdk.tool` / `agent_sdk.subagent` |
|
|
61
|
-
| Metrics | on | `cursor.token.usage`, `cursor.tool.calls`, `cursor.cost.usage`, plus `agent_sdk.*` counts and HTTP duration |
|
|
62
|
-
| Logs | off | Opt in with `logs: true`, `OTEL_LOGS_EXPORTER=otlp`, or `OTEL_LOG_USER_PROMPTS=1` / `OTEL_LOG_TOOL_CONTENT=1` |
|
|
33
|
+
3. `serve(dir, { otel: { … } })`. `otel: false` disables env and
|
|
34
|
+
authored config.
|
|
63
35
|
|
|
64
|
-
|
|
65
|
-
|
|
36
|
+
| Signal | Default |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| Traces | on (`agent_sdk.http` → session → turn → tool / subagent) |
|
|
39
|
+
| Metrics | on (`cursor.token.usage`, `cursor.tool.calls`, `cursor.cost.usage`) |
|
|
40
|
+
| Logs | off (`logs: true` or `OTEL_LOGS_EXPORTER=otlp`) |
|
|
66
41
|
|
|
67
|
-
|
|
42
|
+
Prompt text and tool payloads stay off the wire unless you set
|
|
43
|
+
`OTEL_LOG_USER_PROMPTS` / `OTEL_LOG_TOOL_CONTENT`.
|
|
68
44
|
|
|
69
|
-
|
|
70
|
-
`setAttributes` still tags the open session when a collector is
|
|
71
|
-
attached. Prefix names with team or agent. No custom spans. Reserved
|
|
72
|
-
metric names: `cursor.token.usage`, `cursor.tool.calls`,
|
|
73
|
-
`cursor.cost.usage`, `agent_sdk.session.count`,
|
|
74
|
-
`agent_sdk.turn.count`, `agent_sdk.subagent.count`,
|
|
75
|
-
`agent_sdk.http.duration`. Reserved attributes:
|
|
76
|
-
`cursor.conversation.id`, `agent_sdk.agent`, `agent_sdk.turn_id`,
|
|
77
|
-
`agent_sdk.framework`.
|
|
45
|
+
## Custom metrics
|
|
78
46
|
|
|
79
47
|
```ts
|
|
80
48
|
ctx.host.otel.setAttributes({ "abc.ticket_id": "INC-123" });
|
|
@@ -82,20 +50,6 @@ ctx.host.otel.increment("abc.ticket.resolved");
|
|
|
82
50
|
ctx.host.otel.record("abc.approval.duration_ms", 1420);
|
|
83
51
|
```
|
|
84
52
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
- `cursor.tool.name` / `cursor.tool.kind` / `cursor.tool.status`
|
|
89
|
-
- `cursor.token.type`, `cursor.model.name`
|
|
90
|
-
- `agent_sdk.agent`, `agent_sdk.turn_id`, `agent_sdk.call_id`, `agent_sdk.channel`
|
|
91
|
-
|
|
92
|
-
Resource defaults: `service.name=cursor`, `cursor.entrypoint=sdk_ts`,
|
|
93
|
-
`cursor.surface=unspecified`.
|
|
94
|
-
|
|
95
|
-
Inbound HTTP extracts W3C `traceparent`, so a channel request parents
|
|
96
|
-
the session span when the turn starts in that request.
|
|
97
|
-
|
|
98
|
-
If another TracerProvider already owns the process (CLI / IDE), Agent
|
|
99
|
-
SDK reuses it. Run `serve` as its own process when Agent SDK should
|
|
100
|
-
own the destination. Conflicting `agent/otel.ts` files across mounts
|
|
101
|
-
fail at serve start.
|
|
53
|
+
Prefix names with team or agent. No custom spans. Join on
|
|
54
|
+
`cursor.conversation.id` and `agent_sdk.agent`. Run `serve` as its
|
|
55
|
+
own process when Agent SDK should own the destination.
|