@cursor/july 0.1.102 → 0.1.104
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 +34 -32
- package/README.md +10 -12
- package/dist/ab.d.ts +1 -1
- package/dist/ab.js +1 -1
- package/dist/bin/agent-serve.d.ts +12 -12
- package/dist/bin/agent-serve.js +114 -36
- package/dist/channels/bitbucket/api.d.ts +176 -0
- package/dist/channels/bitbucket/api.d.ts.map +1 -0
- package/dist/channels/bitbucket/api.js +419 -0
- package/dist/channels/bitbucket/binding.d.ts +71 -0
- package/dist/channels/bitbucket/binding.d.ts.map +1 -0
- package/dist/channels/bitbucket/binding.js +269 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts +33 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-channel.js +120 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts +61 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-webhook.js +394 -0
- package/dist/channels/bitbucket/checks.d.ts +67 -0
- package/dist/channels/bitbucket/checks.d.ts.map +1 -0
- package/dist/channels/bitbucket/checks.js +102 -0
- package/dist/channels/bitbucket/cursor-account.d.ts +37 -0
- package/dist/channels/bitbucket/cursor-account.d.ts.map +1 -0
- package/dist/channels/bitbucket/cursor-account.js +65 -0
- package/dist/channels/bitbucket/defaults.d.ts +26 -0
- package/dist/channels/bitbucket/defaults.d.ts.map +1 -0
- package/dist/channels/bitbucket/defaults.js +73 -0
- package/dist/channels/bitbucket/events.d.ts +22 -0
- package/dist/channels/bitbucket/events.d.ts.map +1 -0
- package/dist/channels/bitbucket/events.js +64 -0
- package/dist/channels/bitbucket/index.d.ts +34 -0
- package/dist/channels/bitbucket/index.d.ts.map +1 -0
- package/dist/channels/bitbucket/index.js +33 -0
- package/dist/channels/bitbucket/replay.d.ts +63 -0
- package/dist/channels/bitbucket/replay.d.ts.map +1 -0
- package/dist/channels/bitbucket/replay.js +304 -0
- package/dist/channels/bitbucket/state.d.ts +35 -0
- package/dist/channels/bitbucket/state.d.ts.map +1 -0
- package/dist/channels/bitbucket/state.js +21 -0
- package/dist/channels/bitbucket/types.d.ts +229 -0
- package/dist/channels/bitbucket/types.d.ts.map +1 -0
- package/dist/channels/bitbucket/types.js +1 -0
- package/dist/channels/change-monitors/change-monitors-channel.d.ts +5 -0
- package/dist/channels/change-monitors/change-monitors-channel.d.ts.map +1 -0
- package/dist/channels/change-monitors/change-monitors-channel.js +41 -0
- package/dist/channels/change-monitors/index.d.ts +4 -0
- package/dist/channels/change-monitors/index.d.ts.map +1 -0
- package/dist/channels/change-monitors/index.js +2 -0
- package/dist/channels/change-monitors/types.d.ts +39 -0
- package/dist/channels/change-monitors/types.d.ts.map +1 -0
- package/dist/channels/change-monitors/types.js +1 -0
- package/dist/channels/deployments/deployments-channel.d.ts +22 -14
- package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
- package/dist/channels/deployments/deployments-channel.js +25 -27
- package/dist/channels/deployments/types.d.ts +12 -6
- package/dist/channels/deployments/types.d.ts.map +1 -1
- package/dist/channels/github/binding.d.ts +6 -0
- package/dist/channels/github/binding.d.ts.map +1 -1
- package/dist/channels/github/binding.js +3 -3
- package/dist/channels/github/cursor-account.d.ts +7 -3
- package/dist/channels/github/cursor-account.d.ts.map +1 -1
- package/dist/channels/github/cursor-account.js +10 -6
- package/dist/channels/github/defaults.d.ts.map +1 -1
- package/dist/channels/github/defaults.js +4 -0
- package/dist/channels/github/events.d.ts +1 -1
- package/dist/channels/github/events.js +1 -1
- package/dist/channels/github/forward.d.ts +1 -1
- package/dist/channels/github/forward.d.ts.map +1 -1
- package/dist/channels/github/forward.js +3 -2
- package/dist/channels/github/github-channel.d.ts +29 -39
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +68 -101
- package/dist/channels/github/progress.d.ts +22 -0
- package/dist/channels/github/progress.d.ts.map +1 -1
- package/dist/channels/github/progress.js +32 -5
- package/dist/channels/github/replay.d.ts +1 -1
- package/dist/channels/github/replay.js +1 -1
- package/dist/channels/github/state.d.ts +2 -0
- package/dist/channels/github/state.d.ts.map +1 -1
- package/dist/channels/github/state.js +14 -11
- package/dist/channels/github/types.d.ts +2 -4
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/gitlab/api.d.ts +91 -0
- package/dist/channels/gitlab/api.d.ts.map +1 -0
- package/dist/channels/gitlab/api.js +150 -0
- package/dist/channels/gitlab/binding.d.ts +58 -0
- package/dist/channels/gitlab/binding.d.ts.map +1 -0
- package/dist/channels/gitlab/binding.js +139 -0
- package/dist/channels/gitlab/checks.d.ts +110 -0
- package/dist/channels/gitlab/checks.d.ts.map +1 -0
- package/dist/channels/gitlab/checks.js +126 -0
- package/dist/channels/gitlab/cursor-account.d.ts +36 -0
- package/dist/channels/gitlab/cursor-account.d.ts.map +1 -0
- package/dist/channels/gitlab/cursor-account.js +65 -0
- package/dist/channels/gitlab/defaults.d.ts +25 -0
- package/dist/channels/gitlab/defaults.d.ts.map +1 -0
- package/dist/channels/gitlab/defaults.js +60 -0
- package/dist/channels/gitlab/events.d.ts +12 -0
- package/dist/channels/gitlab/events.d.ts.map +1 -0
- package/dist/channels/gitlab/events.js +28 -0
- package/dist/channels/gitlab/gitlab-channel.d.ts +33 -0
- package/dist/channels/gitlab/gitlab-channel.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-channel.js +120 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts +45 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-webhook.js +397 -0
- package/dist/channels/gitlab/index.d.ts +31 -0
- package/dist/channels/gitlab/index.d.ts.map +1 -0
- package/dist/channels/gitlab/index.js +30 -0
- package/dist/channels/gitlab/replay.d.ts +105 -0
- package/dist/channels/gitlab/replay.d.ts.map +1 -0
- package/dist/channels/gitlab/replay.js +206 -0
- package/dist/channels/gitlab/state.d.ts +33 -0
- package/dist/channels/gitlab/state.d.ts.map +1 -0
- package/dist/channels/gitlab/state.js +23 -0
- package/dist/channels/gitlab/types.d.ts +214 -0
- package/dist/channels/gitlab/types.d.ts.map +1 -0
- package/dist/channels/gitlab/types.js +1 -0
- package/dist/channels/issues/index.d.ts +4 -0
- package/dist/channels/issues/index.d.ts.map +1 -0
- package/dist/channels/issues/index.js +2 -0
- package/dist/channels/issues/issues-channel.d.ts +5 -0
- package/dist/channels/issues/issues-channel.d.ts.map +1 -0
- package/dist/channels/issues/issues-channel.js +37 -0
- package/dist/channels/issues/types.d.ts +33 -0
- package/dist/channels/issues/types.d.ts.map +1 -0
- package/dist/channels/issues/types.js +1 -0
- package/dist/channels/origin/api.d.ts.map +1 -1
- package/dist/channels/origin/api.js +4 -2
- package/dist/channels/origin/origin-channel.d.ts +4 -9
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +8 -48
- package/dist/channels/origin/types.d.ts +20 -2
- package/dist/channels/origin/types.d.ts.map +1 -1
- package/dist/channels/slack/eval-directive.d.ts.map +1 -1
- package/dist/channels/slack/eval-directive.js +1 -7
- package/dist/channels/slack/init.d.ts.map +1 -1
- package/dist/channels/slack/init.js +3 -3
- 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 +6 -13
- package/dist/channels/slack/types.d.ts +1 -1
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/channels.d.ts +1 -1
- package/dist/channels.d.ts.map +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/connections.d.ts +1 -1
- package/dist/connections.js +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.CLA03RCz.js → app.DbMWUyGb.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.Bqsulb9K.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.ifxv-cJV.js → VPLocalSearchBox.DcNeTh9o.js} +1 -1
- package/dist/docs/assets/chunks/{theme.DWCwM6p-.js → theme.DMjhY3gl.js} +2 -2
- package/dist/docs/assets/concepts.md.DgEcZOfT.js +1 -0
- package/dist/docs/assets/{concepts.md.rPzW2HZN.lean.js → concepts.md.DgEcZOfT.lean.js} +1 -1
- package/dist/docs/assets/{evals.md.CPzDAwoH.js → evals.md.CbMoebP1.js} +1 -1
- package/dist/docs/assets/guides_cloud-agents.md.DS8RIjwx.js +9 -0
- package/dist/docs/assets/{guides_github.md.BtPr9GaP.js → guides_github.md.c0gdGJ-D.js} +1 -1
- package/dist/docs/assets/{guides_github.md.BtPr9GaP.lean.js → guides_github.md.c0gdGJ-D.lean.js} +1 -1
- package/dist/docs/assets/{guides_opentelemetry.md.BVTXDCRg.js → guides_opentelemetry.md.COh9jFVg.js} +7 -8
- package/dist/docs/assets/{guides_opentelemetry.md.BVTXDCRg.lean.js → guides_opentelemetry.md.COh9jFVg.lean.js} +1 -1
- package/dist/docs/assets/{index.md.Kiht7ell.js → index.md.D75GWhPl.js} +1 -1
- package/dist/docs/assets/{reference_agent-config.md.BHeYMgme.js → reference_agent-config.md.CHNpiyp4.js} +3 -3
- package/dist/docs/assets/{reference_channels.md.Cd2f2iyV.js → reference_channels.md.DBGcaB7m.js} +2 -2
- package/dist/docs/assets/{reference_channels.md.Cd2f2iyV.lean.js → reference_channels.md.DBGcaB7m.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.DfoeyvL0.js → reference_cli.md.CJNc_xYK.js} +1 -1
- package/dist/docs/assets/{reference_extensions.md.9WQMZe1l.js → reference_extensions.md.DykHW3qL.js} +11 -5
- package/dist/docs/assets/reference_extensions.md.DykHW3qL.lean.js +1 -0
- package/dist/docs/assets/reference_hooks.md.Ddt5DdgJ.js +73 -0
- package/dist/docs/assets/{reference_hooks.md.a8BJxMR5.lean.js → reference_hooks.md.Ddt5DdgJ.lean.js} +1 -1
- package/dist/docs/assets/{reference_playground.md.DnX5nL-B.js → reference_playground.md.4myJPxrf.js} +1 -1
- package/dist/docs/assets/{reference_project-layout.md.CA6QP6Lw.js → reference_project-layout.md.DuBu9a96.js} +2 -2
- package/dist/docs/assets/reference_result.md.BK5SxDrf.js +19 -0
- package/dist/docs/assets/reference_result.md.BK5SxDrf.lean.js +1 -0
- package/dist/docs/assets/{reference_sessions.md.NxFP_CAC.js → reference_sessions.md.CueyOHSL.js} +1 -1
- package/dist/docs/assets/{reference_sessions.md.NxFP_CAC.lean.js → reference_sessions.md.CueyOHSL.lean.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.B1up2r9W.js → reference_tools.md.aGrn99hP.js} +1 -1
- package/dist/docs/assets/skills_framework-map.md.haibFyoB.js +1 -0
- package/dist/docs/assets/{skills_otel.md.CgiZryR3.js → skills_otel.md.CqhobH3B.js} +3 -3
- package/dist/docs/assets/{skills_otel.md.CgiZryR3.lean.js → skills_otel.md.CqhobH3B.lean.js} +1 -1
- package/dist/docs/assets/{templates_pr-autofixer.md.x5zl6-GT.js → templates_pr-autofixer.md.Bds_XWcV.js} +2 -2
- package/dist/docs/assets/{templates_pr-autofixer.md.x5zl6-GT.lean.js → templates_pr-autofixer.md.Bds_XWcV.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +5 -5
- package/dist/docs/concepts.md +2 -4
- package/dist/docs/deployment.html +4 -4
- package/dist/docs/design/filesystem.md +376 -0
- package/dist/docs/design/runtime-abstraction.md +2 -3
- package/dist/docs/evals.html +6 -6
- package/dist/docs/evals.md +9 -7
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-agents.html +6 -6
- package/dist/docs/guides/cloud-agents.md +4 -6
- package/dist/docs/guides/convert-automation.html +4 -4
- package/dist/docs/guides/github.html +6 -6
- package/dist/docs/guides/github.md +5 -1
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +5 -5
- package/dist/docs/guides/opentelemetry.html +10 -11
- package/dist/docs/guides/opentelemetry.md +41 -17
- 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 +2 -2
- package/dist/docs/llms-full.txt +907 -262
- package/dist/docs/llms.txt +3 -2
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +8 -8
- package/dist/docs/reference/agent-config.md +6 -10
- package/dist/docs/reference/artifacts.html +5 -5
- package/dist/docs/reference/channels.html +6 -6
- package/dist/docs/reference/channels.md +38 -8
- package/dist/docs/reference/cli.html +5 -5
- package/dist/docs/reference/cli.md +3 -4
- package/dist/docs/reference/connections.html +4 -4
- package/dist/docs/reference/extensions.html +16 -10
- package/dist/docs/reference/extensions.md +86 -22
- package/dist/docs/reference/hooks.html +69 -10
- package/dist/docs/reference/hooks.md +215 -46
- package/dist/docs/reference/http-api.html +4 -4
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +5 -5
- package/dist/docs/reference/playground.md +3 -0
- package/dist/docs/reference/project-layout.html +6 -6
- package/dist/docs/reference/project-layout.md +2 -1
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/result.html +45 -0
- package/dist/docs/reference/result.md +89 -0
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +5 -5
- package/dist/docs/reference/sessions.md +3 -1
- package/dist/docs/reference/skills.html +4 -4
- package/dist/docs/reference/subagents.html +4 -4
- package/dist/docs/reference/tools.html +5 -5
- package/dist/docs/reference/tools.md +1 -2
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/skills/ab.html +4 -4
- package/dist/docs/skills/create-agent.html +4 -4
- package/dist/docs/skills/debug.html +4 -4
- package/dist/docs/skills/evals.html +4 -4
- package/dist/docs/skills/framework-map.html +5 -5
- package/dist/docs/skills/framework-map.md +3 -1
- package/dist/docs/skills/github.html +4 -4
- package/dist/docs/skills/hillclimb.html +4 -4
- package/dist/docs/skills/index.html +4 -4
- package/dist/docs/skills/mcp-auth.html +4 -4
- package/dist/docs/skills/otel.html +7 -7
- package/dist/docs/skills/otel.md +8 -3
- package/dist/docs/skills/setup-slack.html +4 -4
- package/dist/docs/storage.html +4 -4
- package/dist/docs/templates/agentic-owners.html +4 -4
- package/dist/docs/templates/agents-md.html +4 -4
- package/dist/docs/templates/code-wiki.html +4 -4
- package/dist/docs/templates/demo.html +4 -4
- package/dist/docs/templates/pr-autofixer.html +6 -6
- package/dist/docs/templates/pr-autofixer.md +0 -3
- package/dist/docs/templates/security-help.html +4 -4
- package/dist/docs/templates/security-reviewer.html +4 -4
- package/dist/docs/templates/triage.html +4 -4
- package/dist/docs/troubleshooting.html +4 -4
- package/dist/evals.d.ts +1 -1
- package/dist/evals.d.ts.map +1 -1
- package/dist/extensions.d.ts +20 -7
- package/dist/extensions.d.ts.map +1 -1
- package/dist/extensions.js +36 -5
- package/dist/files.d.ts +16 -3
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +16 -3
- package/dist/filesystem.d.ts +440 -0
- package/dist/filesystem.d.ts.map +1 -0
- package/dist/filesystem.js +1694 -0
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/internal/ab-snapshot.d.ts.map +1 -1
- package/dist/internal/ab-snapshot.js +0 -1
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +1 -3
- package/dist/internal/authored-alias-hooks.d.ts +4 -13
- package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
- package/dist/internal/authored-alias-hooks.js +4 -20
- package/dist/internal/authored-loaders.d.ts +2 -3
- package/dist/internal/authored-loaders.d.ts.map +1 -1
- package/dist/internal/authored-loaders.js +6 -20
- package/dist/internal/channel-dispatch.d.ts +43 -0
- package/dist/internal/channel-dispatch.d.ts.map +1 -0
- package/dist/internal/channel-dispatch.js +77 -0
- package/dist/internal/chat-client.d.ts +1 -1
- package/dist/internal/chat-client.js +1 -1
- package/dist/internal/cli-ax.d.ts +5 -5
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +5 -5
- package/dist/internal/cli-bitbucket.d.ts +33 -0
- package/dist/internal/cli-bitbucket.d.ts.map +1 -0
- package/dist/internal/cli-bitbucket.js +359 -0
- package/dist/internal/cli-convert-automation.d.ts +1 -1
- package/dist/internal/cli-convert-automation.js +2 -2
- package/dist/internal/cli-cursor.d.ts +1 -1
- package/dist/internal/cli-cursor.d.ts.map +1 -1
- package/dist/internal/cli-cursor.js +2 -4
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +2 -6
- package/dist/internal/cli-github.d.ts +1 -1
- package/dist/internal/cli-github.js +3 -3
- package/dist/internal/cli-gitlab.d.ts +37 -0
- package/dist/internal/cli-gitlab.d.ts.map +1 -0
- package/dist/internal/cli-gitlab.js +380 -0
- package/dist/internal/cli-mcp.d.ts.map +1 -1
- package/dist/internal/cli-mcp.js +2 -6
- package/dist/internal/cli-slack.d.ts +1 -1
- package/dist/internal/cli-slack.d.ts.map +1 -1
- package/dist/internal/cli-slack.js +2 -4
- package/dist/internal/continuation-channel.d.ts +18 -2
- package/dist/internal/continuation-channel.d.ts.map +1 -1
- package/dist/internal/continuation-channel.js +67 -5
- package/dist/internal/continuation-identity.d.ts +24 -17
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +246 -32
- package/dist/internal/conversation-mirror.d.ts.map +1 -1
- package/dist/internal/conversation-mirror.js +4 -3
- package/dist/internal/convert-automation/types.d.ts +1 -1
- package/dist/internal/convert-automation/types.js +1 -1
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
- package/dist/internal/cursor/account-mcp.js +1 -3
- package/dist/internal/cursor/backend-client.d.ts +5 -4
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +5 -6
- package/dist/internal/cursor/bound-secret-file.d.ts +56 -0
- package/dist/internal/cursor/bound-secret-file.d.ts.map +1 -0
- package/dist/internal/cursor/bound-secret-file.js +88 -0
- package/dist/internal/cursor/credentials.d.ts +39 -5
- package/dist/internal/cursor/credentials.d.ts.map +1 -1
- package/dist/internal/cursor/credentials.js +58 -8
- package/dist/internal/cursor/hosted-bound-secrets.d.ts +41 -0
- package/dist/internal/cursor/hosted-bound-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-bound-secrets.js +54 -0
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts +19 -5
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -1
- package/dist/internal/cursor/hosted-deployment-secrets.js +29 -9
- package/dist/internal/cursor/hosted-store-secrets.d.ts +1 -1
- package/dist/internal/cursor/hosted-store-secrets.js +1 -1
- package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -1
- package/dist/internal/cursor-account-mcp-auth.js +2 -4
- package/dist/internal/cursor-deployment-relay.d.ts +6 -2
- package/dist/internal/cursor-deployment-relay.d.ts.map +1 -1
- package/dist/internal/cursor-deployment-relay.js +13 -9
- package/dist/internal/deploy-manifest.d.ts +1 -1
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +1 -1
- package/dist/internal/discovery/ab.d.ts +1 -1
- package/dist/internal/discovery/ab.d.ts.map +1 -1
- package/dist/internal/discovery/ab.js +21 -9
- package/dist/internal/discovery/agent.d.ts +6 -1
- package/dist/internal/discovery/agent.d.ts.map +1 -1
- package/dist/internal/discovery/agent.js +141 -120
- package/dist/internal/discovery/channels.d.ts +1 -1
- package/dist/internal/discovery/channels.d.ts.map +1 -1
- package/dist/internal/discovery/channels.js +14 -14
- package/dist/internal/discovery/connections.d.ts +1 -5
- package/dist/internal/discovery/connections.d.ts.map +1 -1
- package/dist/internal/discovery/connections.js +30 -44
- package/dist/internal/discovery/cursor-plugin.d.ts.map +1 -1
- package/dist/internal/discovery/cursor-plugin.js +1 -3
- package/dist/internal/discovery/extension-overlay.d.ts +32 -0
- package/dist/internal/discovery/extension-overlay.d.ts.map +1 -0
- package/dist/internal/discovery/extension-overlay.js +191 -0
- package/dist/internal/discovery/extensions.d.ts +11 -2
- package/dist/internal/discovery/extensions.d.ts.map +1 -1
- package/dist/internal/discovery/extensions.js +211 -74
- package/dist/internal/discovery/hooks.d.ts +1 -1
- package/dist/internal/discovery/hooks.d.ts.map +1 -1
- package/dist/internal/discovery/hooks.js +15 -2
- package/dist/internal/discovery/info.d.ts.map +1 -1
- package/dist/internal/discovery/info.js +10 -1
- package/dist/internal/discovery/modules.d.ts.map +1 -1
- package/dist/internal/discovery/modules.js +8 -2
- package/dist/internal/discovery/names.d.ts +1 -1
- package/dist/internal/discovery/names.d.ts.map +1 -1
- package/dist/internal/discovery/names.js +1 -0
- package/dist/internal/discovery/project.d.ts +0 -2
- package/dist/internal/discovery/project.d.ts.map +1 -1
- package/dist/internal/discovery/project.js +64 -10
- package/dist/internal/discovery/runtime.d.ts.map +1 -1
- package/dist/internal/discovery/runtime.js +1 -2
- package/dist/internal/discovery/schedules.d.ts +1 -1
- package/dist/internal/discovery/schedules.d.ts.map +1 -1
- package/dist/internal/discovery/schedules.js +23 -2
- package/dist/internal/discovery/services.d.ts +6 -2
- package/dist/internal/discovery/services.d.ts.map +1 -1
- package/dist/internal/discovery/services.js +31 -1
- package/dist/internal/discovery/skills.d.ts +1 -6
- package/dist/internal/discovery/skills.d.ts.map +1 -1
- package/dist/internal/discovery/skills.js +8 -3
- package/dist/internal/discovery/subagent.d.ts +3 -0
- package/dist/internal/discovery/subagent.d.ts.map +1 -1
- package/dist/internal/discovery/subagent.js +109 -0
- package/dist/internal/discovery.d.ts +1 -2
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +1 -2
- package/dist/internal/distribution.d.ts +10 -27
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +25 -73
- package/dist/internal/docs-site.js +1 -1
- package/dist/internal/eval-run-store.d.ts +0 -1
- package/dist/internal/eval-run-store.d.ts.map +1 -1
- package/dist/internal/eval-runner.d.ts.map +1 -1
- package/dist/internal/factory-resource-channel.d.ts +33 -0
- package/dist/internal/factory-resource-channel.d.ts.map +1 -0
- package/dist/internal/factory-resource-channel.js +77 -0
- package/dist/internal/filesystem/errors.d.ts +64 -0
- package/dist/internal/filesystem/errors.d.ts.map +1 -0
- package/dist/internal/filesystem/errors.js +175 -0
- package/dist/internal/filesystem/format.d.ts +28 -0
- package/dist/internal/filesystem/format.d.ts.map +1 -0
- package/dist/internal/filesystem/format.js +213 -0
- package/dist/internal/filesystem/merge.d.ts +34 -0
- package/dist/internal/filesystem/merge.d.ts.map +1 -0
- package/dist/internal/filesystem/merge.js +196 -0
- package/dist/internal/filesystem/scratch.d.ts +59 -0
- package/dist/internal/filesystem/scratch.d.ts.map +1 -0
- package/dist/internal/filesystem/scratch.js +212 -0
- package/dist/internal/filesystem/sdk-schemas.d.ts +29 -0
- package/dist/internal/filesystem/sdk-schemas.d.ts.map +1 -0
- package/dist/internal/filesystem/sdk-schemas.js +153 -0
- package/dist/internal/filesystem/tools.d.ts +42 -0
- package/dist/internal/filesystem/tools.d.ts.map +1 -0
- package/dist/internal/filesystem/tools.js +618 -0
- package/dist/internal/filesystem/walk.d.ts +74 -0
- package/dist/internal/filesystem/walk.d.ts.map +1 -0
- package/dist/internal/filesystem/walk.js +339 -0
- package/dist/internal/framework-file-storage.d.ts +8 -0
- package/dist/internal/framework-file-storage.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.js +8 -8
- package/dist/internal/github-fanout.d.ts +1 -1
- package/dist/internal/github-fanout.js +1 -1
- package/dist/internal/guest-network.d.ts +104 -0
- package/dist/internal/guest-network.d.ts.map +1 -0
- package/dist/internal/guest-network.js +309 -0
- package/dist/internal/host-otel.d.ts +3 -3
- package/dist/internal/host-otel.d.ts.map +1 -1
- package/dist/internal/host-otel.js +8 -4
- package/dist/internal/hosted-admission-adapter.d.ts +8 -7
- package/dist/internal/hosted-admission-adapter.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.d.ts +6 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +18 -5
- package/dist/internal/hosted-delivery.d.ts +18 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +258 -118
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +1 -3
- package/dist/internal/init-interview.d.ts.map +1 -1
- package/dist/internal/init-interview.js +1 -3
- package/dist/internal/init-project.d.ts +2 -2
- package/dist/internal/init-project.js +2 -2
- package/dist/internal/inline-stdio-define-stub.d.ts +1 -1
- package/dist/internal/inline-stdio-define-stub.d.ts.map +1 -1
- package/dist/internal/inline-stdio-define-stub.js +1 -1
- package/dist/internal/is-record.d.ts +2 -0
- package/dist/internal/is-record.d.ts.map +1 -0
- package/dist/internal/is-record.js +3 -0
- package/dist/internal/json-schema.d.ts.map +1 -1
- package/dist/internal/json-schema.js +18 -10
- package/dist/internal/local-control-plane.d.ts +1 -2
- package/dist/internal/local-control-plane.d.ts.map +1 -1
- package/dist/internal/local-control-plane.js +3 -20
- package/dist/internal/mcp-endpoint.d.ts.map +1 -1
- package/dist/internal/mcp-endpoint.js +1 -3
- package/dist/internal/otel/collector.d.ts +12 -3
- package/dist/internal/otel/collector.d.ts.map +1 -1
- package/dist/internal/otel/collector.js +77 -125
- package/dist/internal/otel/config.d.ts +0 -2
- package/dist/internal/otel/config.d.ts.map +1 -1
- package/dist/internal/otel/config.js +17 -20
- package/dist/internal/otel/http.d.ts +2 -0
- package/dist/internal/otel/http.d.ts.map +1 -1
- package/dist/internal/otel/http.js +7 -1
- package/dist/internal/otel/mcp.d.ts.map +1 -1
- package/dist/internal/otel/mcp.js +3 -16
- package/dist/internal/otel/runtime.d.ts +26 -1
- package/dist/internal/otel/runtime.d.ts.map +1 -1
- package/dist/internal/otel/runtime.js +164 -15
- package/dist/internal/package-inline-stdio.d.ts.map +1 -1
- package/dist/internal/package-inline-stdio.js +3 -11
- package/dist/internal/playground/toolchain.d.ts +1 -1
- package/dist/internal/playground/toolchain.d.ts.map +1 -1
- package/dist/internal/playground/toolchain.js +1 -1
- package/dist/internal/request-error-status.d.ts +12 -0
- package/dist/internal/request-error-status.d.ts.map +1 -0
- package/dist/internal/request-error-status.js +52 -0
- package/dist/internal/resolve-prod-target.d.ts +1 -1
- package/dist/internal/resolve-prod-target.d.ts.map +1 -1
- package/dist/internal/resolve-prod-target.js +3 -7
- package/dist/internal/result-output.d.ts +18 -0
- package/dist/internal/result-output.d.ts.map +1 -0
- package/dist/internal/result-output.js +33 -0
- package/dist/internal/run-client.d.ts +2 -2
- package/dist/internal/run-client.js +2 -2
- package/dist/internal/runtime-dispatch-runner.d.ts +1 -11
- package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -1
- package/dist/internal/runtime-dispatch-runner.js +2 -15
- package/dist/internal/sdk-runner.d.ts +1 -1
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +6 -7
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +110 -35
- package/dist/internal/session-cost.d.ts +3 -3
- package/dist/internal/session-cost.d.ts.map +1 -1
- package/dist/internal/session-cost.js +3 -3
- package/dist/internal/session-engine.d.ts +48 -11
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +507 -115
- package/dist/internal/session-run-log.d.ts.map +1 -1
- package/dist/internal/session-run-log.js +1 -3
- package/dist/internal/skills-sync.d.ts +1 -4
- package/dist/internal/skills-sync.d.ts.map +1 -1
- package/dist/internal/skills-sync.js +10 -50
- package/dist/internal/sleep.d.ts +2 -0
- package/dist/internal/sleep.d.ts.map +1 -0
- package/dist/internal/sleep.js +3 -0
- package/dist/internal/store-mirror.d.ts +29 -0
- package/dist/internal/store-mirror.d.ts.map +1 -0
- package/dist/internal/store-mirror.js +70 -0
- package/dist/internal/tenant-slack/relay.d.ts +73 -0
- package/dist/internal/tenant-slack/relay.d.ts.map +1 -0
- package/dist/internal/tenant-slack/relay.js +138 -0
- package/dist/internal/testing/factory-resource-fixtures.d.ts +48 -0
- package/dist/internal/testing/factory-resource-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/factory-resource-fixtures.js +41 -0
- package/dist/internal/testing/scm-continuation-fixtures.d.ts +33 -0
- package/dist/internal/testing/scm-continuation-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/scm-continuation-fixtures.js +253 -0
- package/dist/internal/workspace-sync.d.ts +22 -0
- package/dist/internal/workspace-sync.d.ts.map +1 -0
- package/dist/internal/workspace-sync.js +49 -0
- package/dist/internal/workspace.d.ts +7 -0
- package/dist/internal/workspace.d.ts.map +1 -1
- package/dist/internal/workspace.js +13 -0
- package/dist/otel.d.ts +23 -1
- package/dist/otel.d.ts.map +1 -1
- package/dist/otel.js +93 -2
- package/dist/playground/assets/index-8YiozU89.js +67 -0
- package/dist/playground/assets/index-MbMxXg-y.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/result.d.ts +24 -0
- package/dist/result.d.ts.map +1 -0
- package/dist/result.js +27 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +7 -4
- package/dist/storage-protocol.d.ts.map +1 -1
- package/dist/storage-protocol.js +1 -3
- package/dist/types.d.ts +141 -26
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +2 -2
- package/docs/concepts.md +2 -4
- package/docs/design/filesystem.md +376 -0
- package/docs/design/runtime-abstraction.md +2 -3
- package/docs/evals.md +9 -7
- package/docs/guides/cloud-agents.md +4 -6
- package/docs/guides/github.md +5 -1
- package/docs/guides/opentelemetry.md +41 -17
- package/docs/reference/agent-config.md +6 -10
- package/docs/reference/channels.md +38 -8
- package/docs/reference/cli.md +3 -4
- package/docs/reference/extensions.md +87 -23
- package/docs/reference/hooks.md +215 -46
- package/docs/reference/playground.md +3 -0
- package/docs/reference/project-layout.md +2 -1
- package/docs/reference/result.md +94 -0
- package/docs/reference/sessions.md +3 -1
- package/docs/reference/tools.md +1 -2
- package/docs/templates/pr-autofixer.md +0 -3
- package/package.json +42 -9
- package/skills/framework-map/SKILL.md +3 -1
- package/skills/otel/SKILL.md +8 -3
- package/src/ab.ts +1 -1
- package/src/bin/agent-serve.ts +121 -21
- package/src/channels/bitbucket/api.ts +623 -0
- package/src/channels/bitbucket/binding.ts +414 -0
- package/src/channels/bitbucket/bitbucket-channel.ts +182 -0
- package/src/channels/bitbucket/bitbucket-webhook.ts +576 -0
- package/src/channels/bitbucket/checks.ts +154 -0
- package/src/channels/bitbucket/cursor-account.ts +117 -0
- package/src/channels/bitbucket/defaults.ts +110 -0
- package/src/channels/bitbucket/events.ts +84 -0
- package/src/channels/bitbucket/index.ts +49 -0
- package/src/channels/bitbucket/replay.ts +439 -0
- package/src/channels/bitbucket/state.ts +59 -0
- package/src/channels/bitbucket/types.ts +266 -0
- package/src/channels/change-monitors/change-monitors-channel.ts +62 -0
- package/src/channels/change-monitors/index.ts +8 -0
- package/src/channels/change-monitors/types.ts +44 -0
- package/src/channels/deployments/deployments-channel.ts +25 -43
- package/src/channels/deployments/types.ts +12 -6
- package/src/channels/github/binding.ts +8 -1
- package/src/channels/github/cursor-account.ts +17 -6
- package/src/channels/github/defaults.ts +4 -0
- package/src/channels/github/events.ts +1 -1
- package/src/channels/github/forward.ts +3 -2
- package/src/channels/github/github-channel.ts +74 -221
- package/src/channels/github/progress.ts +76 -10
- package/src/channels/github/replay.ts +1 -1
- package/src/channels/github/state.ts +6 -0
- package/src/channels/github/types.ts +2 -5
- package/src/channels/gitlab/api.ts +228 -0
- package/src/channels/gitlab/binding.ts +233 -0
- package/src/channels/gitlab/checks.ts +243 -0
- package/src/channels/gitlab/cursor-account.ts +114 -0
- package/src/channels/gitlab/defaults.ts +93 -0
- package/src/channels/gitlab/events.ts +44 -0
- package/src/channels/gitlab/gitlab-channel.ts +176 -0
- package/src/channels/gitlab/gitlab-webhook.ts +555 -0
- package/src/channels/gitlab/index.ts +43 -0
- package/src/channels/gitlab/replay.ts +347 -0
- package/src/channels/gitlab/state.ts +55 -0
- package/src/channels/gitlab/types.ts +263 -0
- package/src/channels/issues/index.ts +9 -0
- package/src/channels/issues/issues-channel.ts +51 -0
- package/src/channels/issues/types.ts +41 -0
- package/src/channels/origin/api.ts +4 -2
- package/src/channels/origin/origin-channel.ts +19 -94
- package/src/channels/origin/types.ts +23 -2
- package/src/channels/slack/eval-directive.ts +1 -6
- package/src/channels/slack/init.ts +6 -3
- package/src/channels/slack/setup.ts +7 -6
- package/src/channels/slack/types.ts +1 -1
- package/src/channels.ts +0 -1
- package/src/client.ts +1 -1
- package/src/connections.ts +1 -1
- package/src/evals.ts +1 -1
- package/src/extensions.ts +47 -5
- package/src/files.ts +21 -3
- package/src/filesystem.ts +2074 -0
- package/src/index.ts +48 -28
- package/src/internal/ab-snapshot.ts +0 -3
- package/src/internal/advertise-tools.ts +1 -4
- package/src/internal/authored-alias-hooks.ts +4 -21
- package/src/internal/authored-loaders.ts +6 -23
- package/src/internal/channel-dispatch.ts +160 -0
- package/src/internal/chat-client.ts +1 -1
- package/src/internal/cli-ax.ts +5 -5
- package/src/internal/cli-bitbucket.ts +477 -0
- package/src/internal/cli-convert-automation.ts +7 -7
- package/src/internal/cli-cursor.ts +2 -5
- package/src/internal/cli-deploy.ts +2 -8
- package/src/internal/cli-github.ts +3 -3
- package/src/internal/cli-gitlab.ts +485 -0
- package/src/internal/cli-mcp.ts +2 -7
- package/src/internal/cli-slack.ts +2 -5
- package/src/internal/continuation-channel.ts +102 -4
- package/src/internal/continuation-identity.ts +338 -35
- package/src/internal/conversation-mirror.ts +4 -3
- package/src/internal/convert-automation/types.ts +1 -1
- package/src/internal/cursor/account-mcp.ts +1 -4
- package/src/internal/cursor/backend-client.ts +9 -10
- package/src/internal/cursor/bound-secret-file.ts +108 -0
- package/src/internal/cursor/credentials.ts +75 -10
- package/src/internal/cursor/hosted-bound-secrets.ts +75 -0
- package/src/internal/cursor/hosted-deployment-secrets.ts +42 -11
- package/src/internal/cursor/hosted-store-secrets.ts +1 -1
- package/src/internal/cursor-account-mcp-auth.ts +2 -5
- package/src/internal/cursor-deployment-relay.ts +11 -7
- package/src/internal/deploy-manifest.ts +4 -2
- package/src/internal/discovery/ab.ts +29 -9
- package/src/internal/discovery/agent.ts +181 -136
- package/src/internal/discovery/channels.ts +15 -13
- package/src/internal/discovery/connections.ts +55 -50
- package/src/internal/discovery/cursor-plugin.ts +1 -4
- package/src/internal/discovery/extension-overlay.ts +274 -0
- package/src/internal/discovery/extensions.ts +330 -105
- package/src/internal/discovery/hooks.ts +20 -2
- package/src/internal/discovery/info.ts +10 -0
- package/src/internal/discovery/modules.ts +8 -2
- package/src/internal/discovery/names.ts +2 -1
- package/src/internal/discovery/project.ts +80 -9
- package/src/internal/discovery/runtime.ts +1 -2
- package/src/internal/discovery/schedules.ts +28 -2
- package/src/internal/discovery/services.ts +37 -1
- package/src/internal/discovery/skills.ts +13 -3
- package/src/internal/discovery/subagent.ts +107 -0
- package/src/internal/discovery.ts +0 -2
- package/src/internal/distribution.ts +35 -83
- package/src/internal/docs-site.ts +1 -1
- package/src/internal/eval-run-store.ts +0 -7
- package/src/internal/eval-runner.ts +0 -1
- package/src/internal/factory-resource-channel.ts +122 -0
- package/src/internal/filesystem/errors.ts +220 -0
- package/src/internal/filesystem/format.ts +276 -0
- package/src/internal/filesystem/merge.ts +195 -0
- package/src/internal/filesystem/scratch.ts +255 -0
- package/src/internal/filesystem/sdk-schemas.ts +204 -0
- package/src/internal/filesystem/tools.ts +821 -0
- package/src/internal/filesystem/walk.ts +369 -0
- package/src/internal/framework-file-storage.ts +8 -8
- package/src/internal/github-fanout.ts +1 -1
- package/src/internal/guest-network.ts +389 -0
- package/src/internal/host-otel.ts +8 -4
- package/src/internal/hosted-admission-adapter.ts +8 -8
- package/src/internal/hosted-delivery-protocol.ts +26 -1
- package/src/internal/hosted-delivery.ts +393 -192
- package/src/internal/http-channel.ts +1 -4
- package/src/internal/init-interview.ts +1 -4
- package/src/internal/init-project.ts +2 -2
- package/src/internal/inline-stdio-define-stub.ts +1 -1
- package/src/internal/is-record.ts +3 -0
- package/src/internal/json-schema.ts +19 -10
- package/src/internal/local-control-plane.ts +5 -24
- package/src/internal/mcp-endpoint.ts +1 -4
- package/src/internal/otel/collector.ts +94 -159
- package/src/internal/otel/config.ts +10 -14
- package/src/internal/otel/http.ts +14 -1
- package/src/internal/otel/mcp.ts +3 -16
- package/src/internal/otel/runtime.ts +240 -25
- package/src/internal/package-inline-stdio.ts +3 -12
- package/src/internal/playground/toolchain.ts +1 -1
- package/src/internal/request-error-status.ts +72 -0
- package/src/internal/resolve-prod-target.ts +3 -8
- package/src/internal/result-output.ts +34 -0
- package/src/internal/run-client.ts +2 -2
- package/src/internal/runtime-dispatch-runner.ts +3 -21
- package/src/internal/sdk-runner.ts +7 -7
- package/src/internal/server.ts +153 -44
- package/src/internal/session-cost.ts +3 -3
- package/src/internal/session-engine.ts +621 -103
- package/src/internal/session-run-log.ts +1 -4
- package/src/internal/skills-sync.ts +13 -63
- package/src/internal/sleep.ts +3 -0
- package/src/internal/store-mirror.ts +86 -0
- package/src/internal/tenant-slack/relay.ts +179 -0
- package/src/internal/testing/factory-resource-fixtures.ts +85 -0
- package/src/internal/testing/scm-continuation-fixtures.ts +286 -0
- package/src/internal/workspace-sync.ts +55 -0
- package/src/internal/workspace.ts +14 -0
- package/src/otel.ts +143 -3
- package/src/result.ts +36 -0
- package/src/storage-backends/cursor-hosted.ts +7 -4
- package/src/storage-protocol.ts +1 -4
- package/src/types.ts +154 -37
- package/templates/triage/agent/lib/types.ts +0 -2
- package/dist/continuation.d.ts +0 -20
- package/dist/continuation.d.ts.map +0 -1
- package/dist/continuation.js +0 -18
- package/dist/docs/assets/chunks/@localSearchIndexroot.FAqdWIXo.js +0 -1
- package/dist/docs/assets/concepts.md.rPzW2HZN.js +0 -1
- package/dist/docs/assets/guides_cloud-agents.md.DumwWXba.js +0 -9
- package/dist/docs/assets/guides_cloud-runtime.md.BRirbRAN.js +0 -9
- package/dist/docs/assets/guides_cloud-runtime.md.BRirbRAN.lean.js +0 -1
- package/dist/docs/assets/reference_extensions.md.9WQMZe1l.lean.js +0 -1
- package/dist/docs/assets/reference_hooks.md.a8BJxMR5.js +0 -14
- package/dist/docs/assets/skills_framework-map.md.DDa4MeEW.js +0 -1
- package/dist/docs/guides/cloud-runtime.html +0 -35
- package/dist/docs/guides/cloud-runtime.md +0 -117
- package/dist/internal/convert-automation/index.d.ts +0 -3
- package/dist/internal/convert-automation/index.d.ts.map +0 -1
- package/dist/internal/convert-automation/index.js +0 -1
- package/dist/internal/grokbot/runner.d.ts +0 -64
- package/dist/internal/grokbot/runner.d.ts.map +0 -1
- package/dist/internal/grokbot/runner.js +0 -282
- package/dist/internal/managed-delivery.d.ts +0 -80
- package/dist/internal/managed-delivery.d.ts.map +0 -1
- package/dist/internal/managed-delivery.js +0 -86
- package/dist/internal/review-comments.d.ts +0 -370
- package/dist/internal/review-comments.d.ts.map +0 -1
- package/dist/internal/review-comments.js +0 -921
- package/dist/internal/shallow-clone.d.ts +0 -176
- package/dist/internal/shallow-clone.d.ts.map +0 -1
- package/dist/internal/shallow-clone.js +0 -419
- package/dist/playground/assets/index-B6C9S9nG.css +0 -1
- package/dist/playground/assets/index-ZqNoT8Ie.js +0 -69
- package/docs/guides/cloud-runtime.md +0 -122
- package/src/continuation.ts +0 -49
- package/src/internal/convert-automation/index.ts +0 -10
- package/src/internal/grokbot/runner.ts +0 -370
- package/src/internal/managed-delivery.ts +0 -125
- package/src/internal/review-comments.ts +0 -1363
- package/src/internal/shallow-clone.ts +0 -609
- /package/dist/docs/assets/{evals.md.CPzDAwoH.lean.js → evals.md.CbMoebP1.lean.js} +0 -0
- /package/dist/docs/assets/{guides_cloud-agents.md.DumwWXba.lean.js → guides_cloud-agents.md.DS8RIjwx.lean.js} +0 -0
- /package/dist/docs/assets/{index.md.Kiht7ell.lean.js → index.md.D75GWhPl.lean.js} +0 -0
- /package/dist/docs/assets/{reference_agent-config.md.BHeYMgme.lean.js → reference_agent-config.md.CHNpiyp4.lean.js} +0 -0
- /package/dist/docs/assets/{reference_cli.md.DfoeyvL0.lean.js → reference_cli.md.CJNc_xYK.lean.js} +0 -0
- /package/dist/docs/assets/{reference_playground.md.DnX5nL-B.lean.js → reference_playground.md.4myJPxrf.lean.js} +0 -0
- /package/dist/docs/assets/{reference_project-layout.md.CA6QP6Lw.lean.js → reference_project-layout.md.DuBu9a96.lean.js} +0 -0
- /package/dist/docs/assets/{reference_tools.md.B1up2r9W.lean.js → reference_tools.md.aGrn99hP.lean.js} +0 -0
- /package/dist/docs/assets/{skills_framework-map.md.DDa4MeEW.lean.js → skills_framework-map.md.haibFyoB.lean.js} +0 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitLab / Bitbucket continuation fixtures shared by the two continuation
|
|
3
|
+
* vocabulary copies — `internal/continuation-identity.ts` (July) and the
|
|
4
|
+
* control plane's `agentSdkConversationIdentity.ts` (server-shared). Both
|
|
5
|
+
* suites import this one module, so a payload shape or key format that only
|
|
6
|
+
* one copy understands fails CI on the other side.
|
|
7
|
+
*
|
|
8
|
+
* Pure data: no imports, so the server-shared suite can load it by relative
|
|
9
|
+
* path without pulling `@cursor/july` into the control plane.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export interface ScmContinuationFixture {
|
|
13
|
+
name: string;
|
|
14
|
+
kind: "gitlab" | "bitbucket";
|
|
15
|
+
/** Conversation type the channel's `<kind>.<type>/v2` selector names. */
|
|
16
|
+
type: "gitlab-mr" | "bitbucket-pr";
|
|
17
|
+
/**
|
|
18
|
+
* Mailbox event name. Bitbucket Data Center deliveries arrive with their
|
|
19
|
+
* Cloud-normalized key (`pr:opened` → `pullrequest:created`) next to the
|
|
20
|
+
* raw DC payload.
|
|
21
|
+
*/
|
|
22
|
+
eventType: string;
|
|
23
|
+
payload: Record<string, unknown>;
|
|
24
|
+
/** `cont:` key, or `undefined` when the delivery stamps `evt:`. */
|
|
25
|
+
expectedKey: string | undefined;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ScmDefaultSelectorFixture {
|
|
29
|
+
kind: "gitlab" | "bitbucket";
|
|
30
|
+
eventTypes: readonly string[];
|
|
31
|
+
expected: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const GITLAB_PROJECT = {
|
|
35
|
+
id: 1234,
|
|
36
|
+
name: "api",
|
|
37
|
+
path_with_namespace: "Acme/platform/api",
|
|
38
|
+
web_url: "https://gitlab.com/Acme/platform/api",
|
|
39
|
+
default_branch: "main",
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const GITLAB_MERGE_REQUEST = {
|
|
43
|
+
id: 9001,
|
|
44
|
+
iid: 42,
|
|
45
|
+
title: "Add widgets",
|
|
46
|
+
state: "opened",
|
|
47
|
+
source_branch: "feature/widgets",
|
|
48
|
+
target_branch: "main",
|
|
49
|
+
url: "https://gitlab.com/Acme/platform/api/-/merge_requests/42",
|
|
50
|
+
last_commit: { id: "0123456789abcdef0123456789abcdef01234567" },
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const BITBUCKET_CLOUD_REPOSITORY = {
|
|
54
|
+
type: "repository",
|
|
55
|
+
full_name: "acme/widgets",
|
|
56
|
+
name: "widgets",
|
|
57
|
+
uuid: "{5f2d1d5e-6d66-4f5b-9d3e-1b6e5b1c2f3a}",
|
|
58
|
+
workspace: { slug: "acme", uuid: "{a4f1c5d0-1111-4a2b-8c3d-9e0f1a2b3c4d}" },
|
|
59
|
+
links: { html: { href: "https://bitbucket.org/acme/widgets" } },
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const BITBUCKET_DC_REPOSITORY = {
|
|
63
|
+
slug: "widgets",
|
|
64
|
+
id: 17,
|
|
65
|
+
name: "widgets",
|
|
66
|
+
project: { key: "ACME", id: 3, name: "Acme" },
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const SCM_CONTINUATION_FIXTURES: readonly ScmContinuationFixture[] = [
|
|
70
|
+
{
|
|
71
|
+
name: "gitlab merge_request open",
|
|
72
|
+
kind: "gitlab",
|
|
73
|
+
type: "gitlab-mr",
|
|
74
|
+
eventType: "merge_request",
|
|
75
|
+
payload: {
|
|
76
|
+
object_kind: "merge_request",
|
|
77
|
+
event_type: "merge_request",
|
|
78
|
+
user: { id: 7, username: "alice", name: "Alice" },
|
|
79
|
+
project: GITLAB_PROJECT,
|
|
80
|
+
object_attributes: { ...GITLAB_MERGE_REQUEST, action: "open" },
|
|
81
|
+
},
|
|
82
|
+
expectedKey: "cont:gitlab-mr:acme/platform/api!42",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "gitlab merge_request update (new commits)",
|
|
86
|
+
kind: "gitlab",
|
|
87
|
+
type: "gitlab-mr",
|
|
88
|
+
eventType: "merge_request",
|
|
89
|
+
payload: {
|
|
90
|
+
object_kind: "merge_request",
|
|
91
|
+
event_type: "merge_request",
|
|
92
|
+
user: { id: 7, username: "alice", name: "Alice" },
|
|
93
|
+
project: GITLAB_PROJECT,
|
|
94
|
+
object_attributes: {
|
|
95
|
+
...GITLAB_MERGE_REQUEST,
|
|
96
|
+
action: "update",
|
|
97
|
+
oldrev: "fedcba9876543210fedcba9876543210fedcba98",
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
expectedKey: "cont:gitlab-mr:acme/platform/api!42",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "gitlab note on merge request",
|
|
104
|
+
kind: "gitlab",
|
|
105
|
+
type: "gitlab-mr",
|
|
106
|
+
eventType: "note",
|
|
107
|
+
payload: {
|
|
108
|
+
object_kind: "note",
|
|
109
|
+
event_type: "note",
|
|
110
|
+
user: { id: 8, username: "bob", name: "Bob" },
|
|
111
|
+
project: GITLAB_PROJECT,
|
|
112
|
+
object_attributes: {
|
|
113
|
+
id: 501,
|
|
114
|
+
note: "Looks good",
|
|
115
|
+
noteable_type: "MergeRequest",
|
|
116
|
+
noteable_id: 9001,
|
|
117
|
+
},
|
|
118
|
+
merge_request: GITLAB_MERGE_REQUEST,
|
|
119
|
+
},
|
|
120
|
+
expectedKey: "cont:gitlab-mr:acme/platform/api!42",
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "gitlab note on issue",
|
|
124
|
+
kind: "gitlab",
|
|
125
|
+
type: "gitlab-mr",
|
|
126
|
+
eventType: "note",
|
|
127
|
+
payload: {
|
|
128
|
+
object_kind: "note",
|
|
129
|
+
event_type: "note",
|
|
130
|
+
user: { id: 8, username: "bob", name: "Bob" },
|
|
131
|
+
project: GITLAB_PROJECT,
|
|
132
|
+
object_attributes: {
|
|
133
|
+
id: 502,
|
|
134
|
+
note: "Tracking",
|
|
135
|
+
noteable_type: "Issue",
|
|
136
|
+
noteable_id: 300,
|
|
137
|
+
},
|
|
138
|
+
issue: { id: 300, iid: 9, title: "Bug" },
|
|
139
|
+
},
|
|
140
|
+
expectedKey: undefined,
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: "gitlab pipeline attached to a merge request",
|
|
144
|
+
kind: "gitlab",
|
|
145
|
+
type: "gitlab-mr",
|
|
146
|
+
eventType: "pipeline",
|
|
147
|
+
payload: {
|
|
148
|
+
object_kind: "pipeline",
|
|
149
|
+
project: GITLAB_PROJECT,
|
|
150
|
+
object_attributes: { id: 77, status: "success", sha: "0123456789ab" },
|
|
151
|
+
merge_request: { iid: 42, id: 9001, title: "Add widgets" },
|
|
152
|
+
},
|
|
153
|
+
expectedKey: "cont:gitlab-mr:acme/platform/api!42",
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "gitlab pipeline without a merge request",
|
|
157
|
+
kind: "gitlab",
|
|
158
|
+
type: "gitlab-mr",
|
|
159
|
+
eventType: "pipeline",
|
|
160
|
+
payload: {
|
|
161
|
+
object_kind: "pipeline",
|
|
162
|
+
project: GITLAB_PROJECT,
|
|
163
|
+
object_attributes: { id: 78, status: "success", sha: "0123456789ab" },
|
|
164
|
+
merge_request: null,
|
|
165
|
+
},
|
|
166
|
+
expectedKey: undefined,
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: "gitlab push",
|
|
170
|
+
kind: "gitlab",
|
|
171
|
+
type: "gitlab-mr",
|
|
172
|
+
eventType: "push",
|
|
173
|
+
payload: {
|
|
174
|
+
object_kind: "push",
|
|
175
|
+
event_name: "push",
|
|
176
|
+
ref: "refs/heads/main",
|
|
177
|
+
project: GITLAB_PROJECT,
|
|
178
|
+
commits: [],
|
|
179
|
+
},
|
|
180
|
+
expectedKey: undefined,
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: "bitbucket cloud pullrequest:created",
|
|
184
|
+
kind: "bitbucket",
|
|
185
|
+
type: "bitbucket-pr",
|
|
186
|
+
eventType: "pullrequest:created",
|
|
187
|
+
payload: {
|
|
188
|
+
repository: BITBUCKET_CLOUD_REPOSITORY,
|
|
189
|
+
actor: { display_name: "Alice", uuid: "{u-1}" },
|
|
190
|
+
pullrequest: {
|
|
191
|
+
id: 7,
|
|
192
|
+
title: "Add widgets",
|
|
193
|
+
state: "OPEN",
|
|
194
|
+
source: {
|
|
195
|
+
branch: { name: "feature/widgets" },
|
|
196
|
+
commit: { hash: "0123456789ab" },
|
|
197
|
+
},
|
|
198
|
+
destination: { branch: { name: "main" }, commit: { hash: "fedcba98" } },
|
|
199
|
+
links: {
|
|
200
|
+
html: { href: "https://bitbucket.org/acme/widgets/pull-requests/7" },
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
expectedKey: "cont:bitbucket-pr:acme/widgets#7",
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: "bitbucket data center pr:opened (normalized to pullrequest:created)",
|
|
208
|
+
kind: "bitbucket",
|
|
209
|
+
type: "bitbucket-pr",
|
|
210
|
+
eventType: "pullrequest:created",
|
|
211
|
+
payload: {
|
|
212
|
+
eventKey: "pr:opened",
|
|
213
|
+
date: "2026-09-01T12:00:00+0000",
|
|
214
|
+
actor: { name: "alice", displayName: "Alice", id: 1 },
|
|
215
|
+
pullRequest: {
|
|
216
|
+
id: 7,
|
|
217
|
+
title: "Add widgets",
|
|
218
|
+
state: "OPEN",
|
|
219
|
+
open: true,
|
|
220
|
+
fromRef: {
|
|
221
|
+
id: "refs/heads/feature/widgets",
|
|
222
|
+
displayId: "feature/widgets",
|
|
223
|
+
latestCommit: "0123456789ab",
|
|
224
|
+
repository: BITBUCKET_DC_REPOSITORY,
|
|
225
|
+
},
|
|
226
|
+
toRef: {
|
|
227
|
+
id: "refs/heads/main",
|
|
228
|
+
displayId: "main",
|
|
229
|
+
latestCommit: "fedcba98",
|
|
230
|
+
repository: BITBUCKET_DC_REPOSITORY,
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
expectedKey: "cont:bitbucket-pr:acme/widgets#7",
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: "bitbucket cloud pullrequest:comment_created",
|
|
238
|
+
kind: "bitbucket",
|
|
239
|
+
type: "bitbucket-pr",
|
|
240
|
+
eventType: "pullrequest:comment_created",
|
|
241
|
+
payload: {
|
|
242
|
+
repository: BITBUCKET_CLOUD_REPOSITORY,
|
|
243
|
+
actor: { display_name: "Bob", uuid: "{u-2}" },
|
|
244
|
+
pullrequest: { id: 7, title: "Add widgets", state: "OPEN" },
|
|
245
|
+
comment: { id: 11, content: { raw: "Looks good" } },
|
|
246
|
+
},
|
|
247
|
+
expectedKey: "cont:bitbucket-pr:acme/widgets#7",
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: "bitbucket cloud repo:push",
|
|
251
|
+
kind: "bitbucket",
|
|
252
|
+
type: "bitbucket-pr",
|
|
253
|
+
eventType: "repo:push",
|
|
254
|
+
payload: {
|
|
255
|
+
repository: BITBUCKET_CLOUD_REPOSITORY,
|
|
256
|
+
actor: { display_name: "Alice", uuid: "{u-1}" },
|
|
257
|
+
push: { changes: [] },
|
|
258
|
+
},
|
|
259
|
+
expectedKey: undefined,
|
|
260
|
+
},
|
|
261
|
+
];
|
|
262
|
+
|
|
263
|
+
export const SCM_DEFAULT_SELECTOR_FIXTURES: readonly ScmDefaultSelectorFixture[] =
|
|
264
|
+
[
|
|
265
|
+
{ kind: "gitlab", eventTypes: ["merge_request"], expected: "gitlab.mr/v2" },
|
|
266
|
+
{
|
|
267
|
+
kind: "gitlab",
|
|
268
|
+
eventTypes: ["merge_request", "note"],
|
|
269
|
+
expected: "gitlab.mr/v2",
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
kind: "gitlab",
|
|
273
|
+
eventTypes: ["merge_request", "push"],
|
|
274
|
+
expected: "gitlab.none/v2",
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
kind: "bitbucket",
|
|
278
|
+
eventTypes: ["pullrequest:created", "pullrequest:updated"],
|
|
279
|
+
expected: "bitbucket.pr/v2",
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
kind: "bitbucket",
|
|
283
|
+
eventTypes: ["pullrequest:created", "repo:push"],
|
|
284
|
+
expected: "bitbucket.none/v2",
|
|
285
|
+
},
|
|
286
|
+
];
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sync `agent/sandbox/workspace/**` seed files onto an Agent Store so
|
|
3
|
+
* cloud-runtime turns read them from the store mount (the first cloud prompt
|
|
4
|
+
* names the directory; see `buildCloudWorkspaceSection`). Hosted deployments
|
|
5
|
+
* write store-root `workspace/<path>`. Local `serve`/`run` with
|
|
6
|
+
* `runtime: "cloud"` writes `agent-serve/<agent>/workspace/<path>` on the
|
|
7
|
+
* USER store.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { readFile } from "node:fs/promises";
|
|
11
|
+
import { agentStoreKeys, type FileSink } from "../files.js";
|
|
12
|
+
import { MEMORY_DIR_NAME } from "../memory.js";
|
|
13
|
+
import type { SeedFile } from "../types.js";
|
|
14
|
+
import { mirrorToStore, storeRelPath } from "./store-mirror.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Mirror the seed tree onto the store at its authored relative paths and
|
|
18
|
+
* delete keys no seed claims so redeploys drop removed files. Every seed
|
|
19
|
+
* loads and validates before the store is touched.
|
|
20
|
+
*/
|
|
21
|
+
export async function syncWorkspaceToStore(args: {
|
|
22
|
+
sink: FileSink;
|
|
23
|
+
seedFiles: readonly SeedFile[];
|
|
24
|
+
/** Store-root directory that holds the seed tree. Defaults to `workspace/`. */
|
|
25
|
+
workspacePrefix?: string;
|
|
26
|
+
}): Promise<void> {
|
|
27
|
+
const workspacePrefix =
|
|
28
|
+
args.workspacePrefix ?? agentStoreKeys.workspacePrefix();
|
|
29
|
+
const desired = new Map<string, Uint8Array>();
|
|
30
|
+
for (const seed of args.seedFiles) {
|
|
31
|
+
desired.set(
|
|
32
|
+
agentStoreKeys.workspaceFile(
|
|
33
|
+
seedRelPath(seed.relativePath),
|
|
34
|
+
workspacePrefix
|
|
35
|
+
),
|
|
36
|
+
await readFile(seed.sourcePath)
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
await mirrorToStore({ sink: args.sink, prefix: workspacePrefix, desired });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Same reservation as local materialization's `resolveWorkspaceWritePath`:
|
|
44
|
+
* `memory/` is the shared cross-session journal, so a seed under it fails
|
|
45
|
+
* the sync exactly as it fails a local first turn.
|
|
46
|
+
*/
|
|
47
|
+
function seedRelPath(relPath: string): string {
|
|
48
|
+
const rel = storeRelPath(relPath, "workspace file");
|
|
49
|
+
if (rel.split("/", 1)[0] === MEMORY_DIR_NAME) {
|
|
50
|
+
throw new Error(
|
|
51
|
+
`"${MEMORY_DIR_NAME}" is reserved for shared session memory; refusing to sync ${relPath}`
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
return rel;
|
|
55
|
+
}
|
|
@@ -66,6 +66,20 @@ export function buildCloudMemorySection(agentName: string): string {
|
|
|
66
66
|
].join("\n");
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
/**
|
|
70
|
+
* First-turn preamble section for cloud-runtime sessions with authored
|
|
71
|
+
* `agent/sandbox/workspace/**` seeds. Cloud VMs get no materialized
|
|
72
|
+
* workspace; the seeds are synced onto the store mount instead (see
|
|
73
|
+
* `syncWorkspaceToStore`), so the model has to be told where they are.
|
|
74
|
+
*/
|
|
75
|
+
export function buildCloudWorkspaceSection(dir: string): string {
|
|
76
|
+
return [
|
|
77
|
+
"## Workspace files",
|
|
78
|
+
"",
|
|
79
|
+
`The agent's authored workspace files live at \`${dir}\` on this machine. Relative paths in your instructions that name these files resolve under that directory rather than your working directory. Read them with your normal file tools. The directory is shared across sessions, so copy a file into your working directory before editing it.`,
|
|
80
|
+
].join("\n");
|
|
81
|
+
}
|
|
82
|
+
|
|
69
83
|
/** Relative path of an agent-side tool script inside the session workspace. */
|
|
70
84
|
export function agentToolScriptPath(toolName: string): string {
|
|
71
85
|
return `.agent-serve/tools/${toolName}.sh`;
|
package/src/otel.ts
CHANGED
|
@@ -9,9 +9,13 @@
|
|
|
9
9
|
* serviceName: "cursor",
|
|
10
10
|
* exporters: [{ url: "https://otel.example.com", protocol: "http/protobuf" }],
|
|
11
11
|
* });
|
|
12
|
+
*
|
|
13
|
+
* // Hosted v2: re-read env on flush after deployment secrets bind.
|
|
14
|
+
* export default defineOtel(() => resolveMyOtelConfig());
|
|
12
15
|
* ```
|
|
13
16
|
*/
|
|
14
17
|
|
|
18
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
15
19
|
import { context, trace } from "@opentelemetry/api";
|
|
16
20
|
import { brandDefinition } from "./internal/brand.js";
|
|
17
21
|
|
|
@@ -92,8 +96,47 @@ export interface OtelConfig {
|
|
|
92
96
|
|
|
93
97
|
export type OtelDefinition = OtelConfig & { readonly __agentServe: "otel" };
|
|
94
98
|
|
|
99
|
+
/** Re-read authored config after bake (hosted v2 binds secrets later). */
|
|
100
|
+
export type OtelConfigFactory = () => OtelConfig;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Hidden factory on {@link OtelDefinition}. Not enumerable so
|
|
104
|
+
* `pickAuthoredOtel` compares the bake-time snapshot, not the thunk.
|
|
105
|
+
*/
|
|
106
|
+
export const OTEL_CONFIG_RESOLVE: symbol = Symbol.for(
|
|
107
|
+
"anysphere.july.otel.configResolve"
|
|
108
|
+
);
|
|
109
|
+
|
|
95
110
|
/** Author OpenTelemetry export under `agent/otel.ts`. */
|
|
96
|
-
export function defineOtel(
|
|
111
|
+
export function defineOtel(
|
|
112
|
+
config: OtelConfig | OtelConfigFactory = {}
|
|
113
|
+
): OtelDefinition {
|
|
114
|
+
const resolve: OtelConfigFactory =
|
|
115
|
+
typeof config === "function" ? config : () => config;
|
|
116
|
+
const snapshot = resolve();
|
|
117
|
+
validateOtelConfig(snapshot);
|
|
118
|
+
const def = brandDefinition("otel", snapshot);
|
|
119
|
+
Object.defineProperty(def, OTEL_CONFIG_RESOLVE, {
|
|
120
|
+
value: resolve,
|
|
121
|
+
enumerable: false,
|
|
122
|
+
});
|
|
123
|
+
return def;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** Invoke a `defineOtel(() => …)` factory, or return the static snapshot. */
|
|
127
|
+
export function resolveOtelDefinition(def: OtelConfig): OtelConfig {
|
|
128
|
+
const resolve = (
|
|
129
|
+
def as unknown as Record<symbol, OtelConfigFactory | undefined>
|
|
130
|
+
)[OTEL_CONFIG_RESOLVE];
|
|
131
|
+
if (resolve === undefined) {
|
|
132
|
+
return def;
|
|
133
|
+
}
|
|
134
|
+
const next = resolve();
|
|
135
|
+
validateOtelConfig(next);
|
|
136
|
+
return next;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function validateOtelConfig(config: OtelConfig): void {
|
|
97
140
|
if (config.exporters !== undefined) {
|
|
98
141
|
for (const exporter of config.exporters) {
|
|
99
142
|
if (typeof exporter.url !== "string" || exporter.url.length === 0) {
|
|
@@ -123,7 +166,6 @@ export function defineOtel(config: OtelConfig = {}): OtelDefinition {
|
|
|
123
166
|
}
|
|
124
167
|
}
|
|
125
168
|
assertSampleRatio(config.traces);
|
|
126
|
-
return brandDefinition("otel", config);
|
|
127
169
|
}
|
|
128
170
|
|
|
129
171
|
function assertSignals(signals: OtelSignal[] | undefined): void {
|
|
@@ -175,12 +217,17 @@ export function formatTraceparent(spanContext: {
|
|
|
175
217
|
/**
|
|
176
218
|
* Copy the active span onto outbound headers as W3C `traceparent` and
|
|
177
219
|
* Cursor `backend-traceparent`. No-op when no valid span is active.
|
|
220
|
+
*
|
|
221
|
+
* Prefers the Agent SDK ALS (`instrumentHttp`, `runInTurn`,
|
|
222
|
+
* `runInCall`). Falls back to the `@anysphere/context` process-wide
|
|
223
|
+
* ALS: `createSpan` does not bind OTel API context, and SPAN keys
|
|
224
|
+
* are per `@opentelemetry/api` copy.
|
|
178
225
|
*/
|
|
179
226
|
export function injectActiveTraceContext(headers: {
|
|
180
227
|
get(name: string): string | null;
|
|
181
228
|
set(name: string, value: string): void;
|
|
182
229
|
}): void {
|
|
183
|
-
const span = trace.getSpan(context.active());
|
|
230
|
+
const span = trace.getSpan(context.active()) ?? getContextTracerSpan();
|
|
184
231
|
if (span === undefined) {
|
|
185
232
|
return;
|
|
186
233
|
}
|
|
@@ -191,3 +238,96 @@ export function injectActiveTraceContext(headers: {
|
|
|
191
238
|
headers.set(TRACEPARENT_HEADER, traceparent);
|
|
192
239
|
headers.set(BACKEND_TRACEPARENT_HEADER, traceparent);
|
|
193
240
|
}
|
|
241
|
+
|
|
242
|
+
/** W3C `traceparent` for the active span, or undefined if none. */
|
|
243
|
+
export function activeTraceparent(): string | undefined {
|
|
244
|
+
const headers = new Headers();
|
|
245
|
+
injectActiveTraceContext(headers);
|
|
246
|
+
return headers.get(TRACEPARENT_HEADER) ?? undefined;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Copy the active span onto every outbound `fetch`. Agents should not
|
|
251
|
+
* wrap their own Connect / MCP clients for this — `createOtelRuntime`
|
|
252
|
+
* installs it on `globalThis.fetch` when traces are on.
|
|
253
|
+
*/
|
|
254
|
+
function headersForFetch(
|
|
255
|
+
input: RequestInfo | URL,
|
|
256
|
+
init?: RequestInit
|
|
257
|
+
): Headers {
|
|
258
|
+
// Fetch: `init.headers` replaces `Request` headers. If `init` omits
|
|
259
|
+
// headers (`fetch(request, { signal })`), keep the Request's.
|
|
260
|
+
const headers = new Headers(
|
|
261
|
+
init?.headers !== undefined
|
|
262
|
+
? init.headers
|
|
263
|
+
: input instanceof Request
|
|
264
|
+
? input.headers
|
|
265
|
+
: undefined
|
|
266
|
+
);
|
|
267
|
+
injectActiveTraceContext(headers);
|
|
268
|
+
return headers;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export function instrumentedFetch(base: typeof fetch = fetch): typeof fetch {
|
|
272
|
+
return (input, init) => {
|
|
273
|
+
const headers = headersForFetch(input, init);
|
|
274
|
+
if (input instanceof Request && init === undefined) {
|
|
275
|
+
return base(new Request(input, { headers }));
|
|
276
|
+
}
|
|
277
|
+
return base(input, { ...init, headers });
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
const OUTBOUND_FETCH_INSTALLED = Symbol.for(
|
|
282
|
+
"anysphere.july.otel.outboundFetch"
|
|
283
|
+
);
|
|
284
|
+
|
|
285
|
+
/** Idempotent. Safe to call from `createOtelRuntime` on every serve. */
|
|
286
|
+
export function installOutboundFetchInstrumentation(): void {
|
|
287
|
+
const slots = globalThis as unknown as Record<symbol, boolean>;
|
|
288
|
+
if (slots[OUTBOUND_FETCH_INSTALLED] === true) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
slots[OUTBOUND_FETCH_INSTALLED] = true;
|
|
292
|
+
globalThis.fetch = instrumentedFetch(globalThis.fetch);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/** Must match `@anysphere/context` `ACTIVE_OTEL_SPAN_ALS`. */
|
|
296
|
+
const ACTIVE_OTEL_SPAN_ALS = Symbol.for("anysphere.context.activeOtelSpanAls");
|
|
297
|
+
|
|
298
|
+
function ensureContextTracerAls(): void {
|
|
299
|
+
const slots = globalThis as unknown as Record<symbol, unknown>;
|
|
300
|
+
if (slots[ACTIVE_OTEL_SPAN_ALS] === undefined) {
|
|
301
|
+
slots[ACTIVE_OTEL_SPAN_ALS] = new AsyncLocalStorage();
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
ensureContextTracerAls();
|
|
306
|
+
|
|
307
|
+
function getContextTracerSpan():
|
|
308
|
+
| {
|
|
309
|
+
spanContext: () => {
|
|
310
|
+
traceId: string;
|
|
311
|
+
spanId: string;
|
|
312
|
+
traceFlags: number;
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
| undefined {
|
|
316
|
+
const als = (
|
|
317
|
+
globalThis as unknown as Record<
|
|
318
|
+
symbol,
|
|
319
|
+
{
|
|
320
|
+
getStore?: () =>
|
|
321
|
+
| {
|
|
322
|
+
spanContext: () => {
|
|
323
|
+
traceId: string;
|
|
324
|
+
spanId: string;
|
|
325
|
+
traceFlags: number;
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
| undefined;
|
|
329
|
+
}
|
|
330
|
+
>
|
|
331
|
+
)[ACTIVE_OTEL_SPAN_ALS];
|
|
332
|
+
return als?.getStore?.();
|
|
333
|
+
}
|
package/src/result.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `defineResult` — authored at `agent/result.ts`.
|
|
3
|
+
*
|
|
4
|
+
* After the model finishes, `commit` runs on the serving host with the
|
|
5
|
+
* full assistant text. Throw to fail the turn. Parse `ctx.text` however
|
|
6
|
+
* the agent needs.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { defineResult } from "@cursor/july/result";
|
|
10
|
+
*
|
|
11
|
+
* export default defineResult({
|
|
12
|
+
* async commit(ctx) {
|
|
13
|
+
* if (ctx.session.purpose === "eval") {
|
|
14
|
+
* return;
|
|
15
|
+
* }
|
|
16
|
+
* await applyDecision(parseDecision(ctx.text), ctx.host);
|
|
17
|
+
* },
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { brandDefinition } from "./internal/brand.js";
|
|
23
|
+
import type { ResultConfig, ResultDefinition } from "./types.js";
|
|
24
|
+
|
|
25
|
+
export type {
|
|
26
|
+
ResultConfig,
|
|
27
|
+
ResultContext,
|
|
28
|
+
ResultDefinition,
|
|
29
|
+
} from "./types.js";
|
|
30
|
+
|
|
31
|
+
export function defineResult(config: ResultConfig): ResultDefinition {
|
|
32
|
+
if (typeof config.commit !== "function") {
|
|
33
|
+
throw new Error("defineResult: commit is required");
|
|
34
|
+
}
|
|
35
|
+
return brandDefinition("result", config);
|
|
36
|
+
}
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
import type { ABSnapshot } from "../ab.js";
|
|
26
26
|
import type { EvalRunSnapshot } from "../evals.js";
|
|
27
|
+
import { injectActiveTraceContext } from "../otel.js";
|
|
27
28
|
import type {
|
|
28
29
|
StorageABTable,
|
|
29
30
|
StorageCasTable,
|
|
@@ -223,12 +224,14 @@ export async function storageRpc<T>(
|
|
|
223
224
|
if (typeof fetchImpl !== "function") {
|
|
224
225
|
throw new Error("cursorHostedStorage requires fetch");
|
|
225
226
|
}
|
|
227
|
+
const headers = new Headers({
|
|
228
|
+
Authorization: `Bearer ${apiKey}`,
|
|
229
|
+
"Content-Type": "application/json",
|
|
230
|
+
});
|
|
231
|
+
injectActiveTraceContext(headers);
|
|
226
232
|
const response = await fetchImpl(`${baseUrl}${path}`, {
|
|
227
233
|
method: "POST",
|
|
228
|
-
headers
|
|
229
|
-
Authorization: `Bearer ${apiKey}`,
|
|
230
|
-
"Content-Type": "application/json",
|
|
231
|
-
},
|
|
234
|
+
headers,
|
|
232
235
|
body: JSON.stringify(body),
|
|
233
236
|
});
|
|
234
237
|
const text = await response.text();
|
package/src/storage-protocol.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
|
+
import { isRecord } from "./internal/is-record.js";
|
|
10
11
|
|
|
11
12
|
/** Legacy architecture-v1 storage root. */
|
|
12
13
|
export const STORAGE_KEY_ROOT = "agentkit/v1" as const;
|
|
@@ -205,10 +206,6 @@ export type DurableSessionSummary = {
|
|
|
205
206
|
running: boolean | undefined;
|
|
206
207
|
};
|
|
207
208
|
|
|
208
|
-
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
209
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
209
|
function stringValue(value: unknown): string | undefined {
|
|
213
210
|
return typeof value === "string" ? value : undefined;
|
|
214
211
|
}
|