@cursor/july 0.1.102 → 0.1.103
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/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/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/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/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.DW9pXkpL.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.nrl1ifBq.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.ifxv-cJV.js → VPLocalSearchBox.CdEIUwDg.js} +1 -1
- package/dist/docs/assets/chunks/{theme.DWCwM6p-.js → theme.YZMHgPgg.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.DKYiT9do.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.Dz8Cnudp.js} +2 -2
- package/dist/docs/assets/{reference_channels.md.Cd2f2iyV.lean.js → reference_channels.md.Dz8Cnudp.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/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 +0 -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 +501 -262
- package/dist/docs/llms.txt +2 -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 +18 -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/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -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 +14 -0
- package/dist/internal/continuation-channel.d.ts.map +1 -1
- package/dist/internal/continuation-channel.js +56 -3
- package/dist/internal/continuation-identity.d.ts +14 -15
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +182 -7
- 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 +65 -116
- 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 +7 -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/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 +101 -0
- package/dist/internal/guest-network.d.ts.map +1 -0
- package/dist/internal/guest-network.js +304 -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 +248 -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.map +1 -1
- package/dist/internal/sdk-runner.js +3 -6
- 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 +26 -11
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +146 -76
- 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/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-59KvgREd.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 +90 -23
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +2 -2
- package/docs/concepts.md +2 -4
- 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 +0 -1
- package/docs/guides/opentelemetry.md +41 -17
- package/docs/reference/agent-config.md +6 -10
- package/docs/reference/channels.md +18 -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 +29 -10
- 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/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/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/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/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/index.ts +20 -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 +82 -1
- package/src/internal/continuation-identity.ts +229 -11
- 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 +94 -135
- 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 +7 -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/framework-file-storage.ts +8 -8
- package/src/internal/github-fanout.ts +1 -1
- package/src/internal/guest-network.ts +383 -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 +376 -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 +3 -7
- package/src/internal/server.ts +153 -44
- package/src/internal/session-cost.ts +3 -3
- package/src/internal/session-engine.ts +182 -74
- 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/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 +105 -34
- 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/{guides_github.md.BtPr9GaP.lean.js → guides_github.md.DKYiT9do.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
|
@@ -23,7 +23,7 @@ import { SLACK_CHANNEL_ID } from "../channels/slack/constants.js";
|
|
|
23
23
|
import { materializeSlackNudgeCarrier } from "../channels/slack/nudge-carrier.js";
|
|
24
24
|
import { SlackAskDedupeStore, SlackNudgeStore, } from "../channels/slack/nudge-store.js";
|
|
25
25
|
import { resolveDedicatedSlackHostBinding } from "../channels/slack/slack-channel.js";
|
|
26
|
-
import { AGENT_SERVE_USER_STORE_FILES_SOURCE_ID, agentStoreKeys, } from "../files.js";
|
|
26
|
+
import { AGENT_SERVE_USER_STORE_FILES_SOURCE_ID, agentStoreKeys, DEPLOYMENT_STORE_MOUNT_PATH, USER_STORE_MOUNT_PATH, } from "../files.js";
|
|
27
27
|
import { cursorHostedFiles, isCursorHostedFilesAvailable, isCursorUserStoreFilesAvailable, } from "../files-backends/cursor-hosted.js";
|
|
28
28
|
import { storageKeysForArchitecture } from "../storage.js";
|
|
29
29
|
import { DEFAULT_MODEL, DIRECT_TOOL_CALL_CHANNEL_ID, isCursorAccountTransport, isHostOauthConnectionTransport, isSymbolicConnectionTransport, } from "../types.js";
|
|
@@ -39,6 +39,7 @@ import { mergeCloudOptions, resolveSessionRuntime } from "./cloud-merge.js";
|
|
|
39
39
|
import { applyCloudUsageToEvents, cloudSdkAgentIdFromEvents, isUnpricedCompletedTurn, mapSdkTokenUsage, } from "./cloud-turn-cost.js";
|
|
40
40
|
import { applyAgentContinuationDefaults, channelContinuationIdentity, httpContinuationIdentity, } from "./continuation-channel.js";
|
|
41
41
|
import { continuationSource, resolveV2Key, V2EngineError, } from "./continuation-identity.js";
|
|
42
|
+
import { describeError } from "./describe-error.js";
|
|
42
43
|
import { isDevMode } from "./dev-mode.js";
|
|
43
44
|
import { EventLogStore } from "./event-log.js";
|
|
44
45
|
import { TurnEventMapper } from "./event-mapper.js";
|
|
@@ -55,6 +56,7 @@ import { McpOauthOnDemandHub } from "./mcp-oauth-on-demand.js";
|
|
|
55
56
|
import { shouldStartProcessMemoryTelemetry, startProcessMemoryTelemetry, } from "./process-memory-telemetry.js";
|
|
56
57
|
import { buildSessionContextBlock, SCHEDULE_CHANNEL_PREFIX, } from "./prompt-context.js";
|
|
57
58
|
import { assertCloudCanHonorAccountServersFilters } from "./resolved-connections.js";
|
|
59
|
+
import { applyAuthoredResult } from "./result-output.js";
|
|
58
60
|
import { sessionExternalLinks } from "./session-links.js";
|
|
59
61
|
import { SessionStore } from "./session-store.js";
|
|
60
62
|
import { syncSkillsToStore } from "./skills-sync.js";
|
|
@@ -67,7 +69,8 @@ import { TurnGovernor } from "./turn-governor.js";
|
|
|
67
69
|
import { TurnLeaseStore } from "./turn-lease-store.js";
|
|
68
70
|
import { TurnOutbox } from "./turn-outbox.js";
|
|
69
71
|
import { resolveAgentV2Hosting } from "./v2-hosting.js";
|
|
70
|
-
import { buildAgentsMdContent, buildCloudMemorySection, ensureOwnGitRoot, isNestedInGitRepo, materializeWorkspace, SERVER_TOOLS_MCP_SERVER_NAME, writeWorkspaceFiles, } from "./workspace.js";
|
|
72
|
+
import { buildAgentsMdContent, buildCloudMemorySection, buildCloudWorkspaceSection, ensureOwnGitRoot, isNestedInGitRepo, materializeWorkspace, SERVER_TOOLS_MCP_SERVER_NAME, writeWorkspaceFiles, } from "./workspace.js";
|
|
73
|
+
import { syncWorkspaceToStore } from "./workspace-sync.js";
|
|
71
74
|
export const HTTP_CHANNEL_ID = "http";
|
|
72
75
|
export { SCHEDULE_CHANNEL_PREFIX } from "./prompt-context.js";
|
|
73
76
|
export class SessionBusyError extends Error {
|
|
@@ -158,6 +161,8 @@ export class SessionEngine {
|
|
|
158
161
|
var _a, _b, _c, _d, _e;
|
|
159
162
|
/** In-flight lazy restores, deduped per channel + continuation key. */
|
|
160
163
|
this.restoreInFlight = new Map();
|
|
164
|
+
/** In-flight authored files → Agent Store syncs (see syncToCloudStore). */
|
|
165
|
+
this.cloudSyncs = new Map();
|
|
161
166
|
this.channelsById = new Map();
|
|
162
167
|
/** Sessions with a turn being admitted (before the run promise exists). */
|
|
163
168
|
this.pendingTurns = new Set();
|
|
@@ -353,9 +358,9 @@ export class SessionEngine {
|
|
|
353
358
|
};
|
|
354
359
|
}
|
|
355
360
|
/**
|
|
356
|
-
* Host services with `files` bound to one session, so a relative
|
|
357
|
-
*
|
|
358
|
-
*
|
|
361
|
+
* Host services with `files` and `otel` bound to one session, so a relative
|
|
362
|
+
* path resolves to that session's scope and can never read another
|
|
363
|
+
* session's. Unbound (no session) keeps `host.files` usable for
|
|
359
364
|
* `{ scope: "deployment" }` and fails loudly on session-scoped calls.
|
|
360
365
|
*/
|
|
361
366
|
hostForSession(sessionId) {
|
|
@@ -1435,7 +1440,7 @@ export class SessionEngine {
|
|
|
1435
1440
|
this.activeToolContexts.set(sessionId, { record, turnId, emit });
|
|
1436
1441
|
this.stubbedCallIds.set(sessionId, stubbed);
|
|
1437
1442
|
try {
|
|
1438
|
-
outcome = yield this.runner.runTurn(request);
|
|
1443
|
+
outcome = yield this.runTurnExecute(record, turnId, () => this.runner.runTurn(request));
|
|
1439
1444
|
}
|
|
1440
1445
|
finally {
|
|
1441
1446
|
this.activeToolContexts.delete(sessionId);
|
|
@@ -1476,11 +1481,39 @@ export class SessionEngine {
|
|
|
1476
1481
|
if (finalCost !== undefined) {
|
|
1477
1482
|
outcome = Object.assign(Object.assign({}, outcome), { cost: finalCost });
|
|
1478
1483
|
}
|
|
1484
|
+
const authored = this.project.result;
|
|
1485
|
+
if (outcome.status === "finished" && authored !== undefined) {
|
|
1486
|
+
const settled = yield applyAuthoredResult({
|
|
1487
|
+
definition: authored,
|
|
1488
|
+
text: finalResult,
|
|
1489
|
+
dryRun: record.dryRun === true,
|
|
1490
|
+
ctx: {
|
|
1491
|
+
session: this.sessionInfo(record),
|
|
1492
|
+
host: this.hostForSession(sessionId),
|
|
1493
|
+
artifacts: this.artifactsApi({ sessionId, turnId }),
|
|
1494
|
+
stateRoot: this.stateRoot,
|
|
1495
|
+
workspaceDir: harnessCwd,
|
|
1496
|
+
},
|
|
1497
|
+
});
|
|
1498
|
+
if (!settled.ok) {
|
|
1499
|
+
outcome = {
|
|
1500
|
+
status: "error",
|
|
1501
|
+
result: finalResult,
|
|
1502
|
+
errorMessage: `turn output failed: ${settled.message}`,
|
|
1503
|
+
usage: finalUsage,
|
|
1504
|
+
cost: finalCost,
|
|
1505
|
+
};
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1479
1508
|
if (outcome.status === "finished") {
|
|
1480
1509
|
yield this.appendEvent(sessionId, {
|
|
1481
1510
|
type: "turn.completed",
|
|
1482
1511
|
turnId,
|
|
1483
|
-
data:
|
|
1512
|
+
data: {
|
|
1513
|
+
result: finalResult,
|
|
1514
|
+
usage: finalUsage,
|
|
1515
|
+
cost: finalCost,
|
|
1516
|
+
},
|
|
1484
1517
|
});
|
|
1485
1518
|
}
|
|
1486
1519
|
else {
|
|
@@ -1515,7 +1548,7 @@ export class SessionEngine {
|
|
|
1515
1548
|
data: {},
|
|
1516
1549
|
});
|
|
1517
1550
|
}
|
|
1518
|
-
return Object.assign(Object.assign(
|
|
1551
|
+
return Object.assign(Object.assign({}, outcome), { result: finalResult, usage: finalUsage });
|
|
1519
1552
|
});
|
|
1520
1553
|
}
|
|
1521
1554
|
/**
|
|
@@ -1525,75 +1558,89 @@ export class SessionEngine {
|
|
|
1525
1558
|
* first-turn S3 scan can discover them. False when the sync fails: the
|
|
1526
1559
|
* turn then runs without store skills rather than pointing discovery at
|
|
1527
1560
|
* paths that do not exist.
|
|
1528
|
-
|
|
1529
|
-
|
|
1561
|
+
*/
|
|
1562
|
+
ensureCloudSkillsSynced(store) {
|
|
1563
|
+
const skills = this.project.agent.skills;
|
|
1564
|
+
return this.syncToCloudStore("skills", store, skills.length > 0, () => syncSkillsToStore({
|
|
1565
|
+
sink: store.sink,
|
|
1566
|
+
agentName: this.project.name,
|
|
1567
|
+
skills,
|
|
1568
|
+
skillsPrefix: store.skillsPrefix,
|
|
1569
|
+
}));
|
|
1570
|
+
}
|
|
1571
|
+
/**
|
|
1572
|
+
* Sync `agent/sandbox/workspace/**` seeds onto the Agent Store at
|
|
1573
|
+
* `workspace/…` (hosted) or `agent-serve/<agent>/workspace/…`
|
|
1574
|
+
* (personal-key local+cloud) before the first cloud prompt, which names
|
|
1575
|
+
* the mounted directory (see buildCloudWorkspaceSection).
|
|
1576
|
+
*/
|
|
1577
|
+
ensureCloudWorkspaceSynced(store) {
|
|
1578
|
+
const seedFiles = this.project.agent.seedFiles;
|
|
1579
|
+
return this.syncToCloudStore("workspace", store, seedFiles.length > 0, () => syncWorkspaceToStore({
|
|
1580
|
+
sink: store.sink,
|
|
1581
|
+
seedFiles,
|
|
1582
|
+
workspacePrefix: store.workspacePrefix,
|
|
1583
|
+
}));
|
|
1584
|
+
}
|
|
1585
|
+
/**
|
|
1586
|
+
* With files authored, every first cloud turn re-copies the authored
|
|
1530
1587
|
* bytes and the memo only dedupes concurrent first turns. The mount is
|
|
1531
1588
|
* writable from cloud sessions, so a once-per-process copy would let one
|
|
1532
1589
|
* session's edits masquerade as agent definition for every later session
|
|
1533
1590
|
* until the engine restarts; re-syncing keeps the store true to discovery
|
|
1534
1591
|
* the same way local materialization always rewrites skills. Without
|
|
1535
|
-
*
|
|
1536
|
-
* process is enough, success or not — a deployment without the files
|
|
1592
|
+
* authored files the sync is best-effort stale cleanup and one attempt
|
|
1593
|
+
* per process is enough, success or not — a deployment without the files
|
|
1537
1594
|
* surface must not fail and log on every new session for a feature it
|
|
1538
1595
|
* does not use.
|
|
1539
1596
|
*/
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
const target = this.cloudSkillsStore();
|
|
1545
|
-
if (target === undefined) {
|
|
1546
|
-
this.cloudSkillsSync = Promise.resolve(false);
|
|
1547
|
-
return this.cloudSkillsSync;
|
|
1597
|
+
syncToCloudStore(surface, store, authored, run) {
|
|
1598
|
+
const inFlight = this.cloudSyncs.get(surface);
|
|
1599
|
+
if (inFlight !== undefined) {
|
|
1600
|
+
return inFlight;
|
|
1548
1601
|
}
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
sink: target.sink,
|
|
1552
|
-
agentName: this.project.name,
|
|
1553
|
-
skills,
|
|
1554
|
-
skillsPrefix: target.skillsPrefix,
|
|
1555
|
-
}).then(() => true, (error) => {
|
|
1556
|
-
this.logger(`[skills] ${target.label} sync failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
1602
|
+
let sync = run().then(() => true, (error) => {
|
|
1603
|
+
this.logger(`[${surface}] ${store.label} sync failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
1557
1604
|
return false;
|
|
1558
1605
|
});
|
|
1559
|
-
if (
|
|
1606
|
+
if (authored) {
|
|
1560
1607
|
sync = sync.finally(() => {
|
|
1561
|
-
this.
|
|
1608
|
+
this.cloudSyncs.delete(surface);
|
|
1562
1609
|
});
|
|
1563
1610
|
}
|
|
1564
|
-
this.
|
|
1611
|
+
this.cloudSyncs.set(surface, sync);
|
|
1565
1612
|
return sync;
|
|
1566
1613
|
}
|
|
1567
1614
|
/**
|
|
1568
1615
|
* Hosted deployments own the deployment store. Local `serve`/`run` with
|
|
1569
1616
|
* a personal API key writes into the USER store under `agent-serve/`.
|
|
1570
1617
|
*/
|
|
1571
|
-
|
|
1618
|
+
cloudStore() {
|
|
1572
1619
|
const v2Hosting = resolveAgentV2Hosting({
|
|
1573
1620
|
architecture: this.project.agent.architecture,
|
|
1574
1621
|
});
|
|
1622
|
+
const deployment = {
|
|
1623
|
+
mountPath: DEPLOYMENT_STORE_MOUNT_PATH,
|
|
1624
|
+
skillsPrefix: agentStoreKeys.skillsPrefix(),
|
|
1625
|
+
workspacePrefix: agentStoreKeys.workspacePrefix(),
|
|
1626
|
+
label: "deployment store",
|
|
1627
|
+
};
|
|
1575
1628
|
if (v2Hosting.kind === "cursor-managed") {
|
|
1576
|
-
return {
|
|
1577
|
-
sink: cursorHostedFiles({
|
|
1629
|
+
return Object.assign({ sink: cursorHostedFiles({
|
|
1578
1630
|
resolveStoreSourceId: () => v2Hosting.resolveStoreIds().deploymentStoreSourceId,
|
|
1579
|
-
}),
|
|
1580
|
-
skillsPrefix: agentStoreKeys.skillsPrefix(),
|
|
1581
|
-
label: "deployment store",
|
|
1582
|
-
};
|
|
1631
|
+
}) }, deployment);
|
|
1583
1632
|
}
|
|
1584
1633
|
if (v2Hosting.kind === "not-v2" && isCursorHostedFilesAvailable()) {
|
|
1585
|
-
return {
|
|
1586
|
-
sink: cursorHostedFiles(),
|
|
1587
|
-
skillsPrefix: agentStoreKeys.skillsPrefix(),
|
|
1588
|
-
label: "deployment store",
|
|
1589
|
-
};
|
|
1634
|
+
return Object.assign({ sink: cursorHostedFiles() }, deployment);
|
|
1590
1635
|
}
|
|
1591
1636
|
if (isCursorUserStoreFilesAvailable()) {
|
|
1592
1637
|
return {
|
|
1593
1638
|
sink: cursorHostedFiles({
|
|
1594
1639
|
storeSourceId: AGENT_SERVE_USER_STORE_FILES_SOURCE_ID,
|
|
1595
1640
|
}),
|
|
1641
|
+
mountPath: USER_STORE_MOUNT_PATH,
|
|
1596
1642
|
skillsPrefix: agentStoreKeys.userSkillsPrefix(this.project.name),
|
|
1643
|
+
workspacePrefix: agentStoreKeys.userWorkspacePrefix(this.project.name),
|
|
1597
1644
|
label: "user store",
|
|
1598
1645
|
};
|
|
1599
1646
|
}
|
|
@@ -1646,13 +1693,14 @@ export class SessionEngine {
|
|
|
1646
1693
|
if (isFirstTurn) {
|
|
1647
1694
|
if (runtime === "cloud") {
|
|
1648
1695
|
// Cloud VMs have no materialized workspace: ship the full context,
|
|
1649
|
-
// including agent tool script bodies.
|
|
1650
|
-
//
|
|
1651
|
-
//
|
|
1652
|
-
//
|
|
1653
|
-
//
|
|
1654
|
-
//
|
|
1655
|
-
//
|
|
1696
|
+
// including agent tool script bodies. Authored skills and workspace
|
|
1697
|
+
// seeds land on the store mount (skills for native discovery, seeds
|
|
1698
|
+
// for the model's file tools), and on hosted deployments the shared
|
|
1699
|
+
// memory journal is on that mount too — say where. When the turn
|
|
1700
|
+
// carries the session-bound server-tool MCP endpoint, the preamble
|
|
1701
|
+
// catalogs server tools under that MCP server name *before* the
|
|
1702
|
+
// agent-tool "write the script if missing" recipe, so a model told
|
|
1703
|
+
// to "use <server tool>" calls MCP instead of inventing a .sh.
|
|
1656
1704
|
const preamble = buildAgentsMdContent(agent, {
|
|
1657
1705
|
includeScripts: true,
|
|
1658
1706
|
serverToolsMcpName: this.cloudServerToolsConnection === undefined
|
|
@@ -1660,17 +1708,29 @@ export class SessionEngine {
|
|
|
1660
1708
|
: SERVER_TOOLS_MCP_SERVER_NAME,
|
|
1661
1709
|
});
|
|
1662
1710
|
const hosted = isCursorHostedFilesAvailable();
|
|
1663
|
-
// Synced whenever a store is reachable, not just when skills
|
|
1664
|
-
// removing the last
|
|
1665
|
-
//
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1711
|
+
// Synced whenever a store is reachable, not just when skills or
|
|
1712
|
+
// seeds exist: removing the last one has to delete its store copies
|
|
1713
|
+
// too.
|
|
1714
|
+
const store = hosted || isCursorUserStoreFilesAvailable()
|
|
1715
|
+
? this.cloudStore()
|
|
1716
|
+
: undefined;
|
|
1717
|
+
let sections = "";
|
|
1718
|
+
if (store !== undefined) {
|
|
1719
|
+
const [, seedsSynced] = yield Promise.all([
|
|
1720
|
+
this.ensureCloudSkillsSynced(store),
|
|
1721
|
+
this.ensureCloudWorkspaceSynced(store),
|
|
1722
|
+
]);
|
|
1723
|
+
// Only name the mount when the bytes landed; a failed sync must
|
|
1724
|
+
// not send the model looking for files that are not there.
|
|
1725
|
+
if (seedsSynced && agent.seedFiles.length > 0) {
|
|
1726
|
+
const dir = `${store.mountPath}/${store.workspacePrefix}`;
|
|
1727
|
+
sections += `\n\n${buildCloudWorkspaceSection(dir)}`;
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
if (hosted) {
|
|
1731
|
+
sections += `\n\n${buildCloudMemorySection(this.project.name)}`;
|
|
1669
1732
|
}
|
|
1670
|
-
|
|
1671
|
-
? `\n\n${buildCloudMemorySection(this.project.name)}`
|
|
1672
|
-
: "";
|
|
1673
|
-
turnPrompt = `${preamble}${memorySection}\n\n${turnPrompt}`;
|
|
1733
|
+
turnPrompt = `${preamble}${sections}\n\n${turnPrompt}`;
|
|
1674
1734
|
}
|
|
1675
1735
|
else if (runtime === "local" && instructionsInvisibleToHarness) {
|
|
1676
1736
|
// Local workspace whose AGENTS.md the harness will not load. With a
|
|
@@ -2091,6 +2151,23 @@ export class SessionEngine {
|
|
|
2091
2151
|
}
|
|
2092
2152
|
});
|
|
2093
2153
|
}
|
|
2154
|
+
/**
|
|
2155
|
+
* Bind outbound inject (Factory / Cursor API `traceparent`) to the
|
|
2156
|
+
* turn span for the whole harness run. Host files / VFS RPCs happen
|
|
2157
|
+
* here, not under `runInCall`. No-op when OTel is off.
|
|
2158
|
+
*/
|
|
2159
|
+
runTurnExecute(record, turnId, fn) {
|
|
2160
|
+
const otel = this.otel;
|
|
2161
|
+
const run = () => Promise.resolve(fn());
|
|
2162
|
+
if (otel === undefined) {
|
|
2163
|
+
return run();
|
|
2164
|
+
}
|
|
2165
|
+
return otel.runInTurn({
|
|
2166
|
+
sessionId: record.sessionId,
|
|
2167
|
+
session: this.sessionInfo(record),
|
|
2168
|
+
turnId,
|
|
2169
|
+
}, run);
|
|
2170
|
+
}
|
|
2094
2171
|
/**
|
|
2095
2172
|
* Bind outbound inject (Factory / Cursor API `traceparent`) to the
|
|
2096
2173
|
* tool span. No-op when OTel is off.
|
|
@@ -2946,7 +3023,10 @@ export class SessionEngine {
|
|
|
2946
3023
|
if (record === undefined) {
|
|
2947
3024
|
return;
|
|
2948
3025
|
}
|
|
2949
|
-
const sessionCtx = {
|
|
3026
|
+
const sessionCtx = {
|
|
3027
|
+
session: this.sessionInfo(record),
|
|
3028
|
+
host: this.hostForSession(record.sessionId),
|
|
3029
|
+
};
|
|
2950
3030
|
const channelEvents = this.channelEventHandlersFor(record.channelId);
|
|
2951
3031
|
if (channelEvents !== undefined) {
|
|
2952
3032
|
// Handlers are declared against the narrowed event for their key; the
|
|
@@ -2985,20 +3065,13 @@ export class SessionEngine {
|
|
|
2985
3065
|
continue;
|
|
2986
3066
|
}
|
|
2987
3067
|
try {
|
|
2988
|
-
yield handler(event, {
|
|
2989
|
-
agent: { name: this.project.name },
|
|
2990
|
-
channel: {
|
|
3068
|
+
yield handler(event, Object.assign(Object.assign({}, sessionCtx), { agent: { name: this.project.name }, channel: {
|
|
2991
3069
|
id: record.channelId,
|
|
2992
3070
|
continuationToken: record.continuationKey,
|
|
2993
|
-
},
|
|
2994
|
-
session: this.sessionInfo(record),
|
|
2995
|
-
stateRoot: this.stateRoot,
|
|
2996
|
-
host: this.hostForSession(record.sessionId),
|
|
2997
|
-
artifacts: this.artifactsApi({
|
|
3071
|
+
}, stateRoot: this.stateRoot, artifacts: this.artifactsApi({
|
|
2998
3072
|
sessionId: record.sessionId,
|
|
2999
3073
|
turnId: event.turnId,
|
|
3000
|
-
})
|
|
3001
|
-
});
|
|
3074
|
+
}) }));
|
|
3002
3075
|
}
|
|
3003
3076
|
catch (error) {
|
|
3004
3077
|
this.logger(`[agent-sdk] hook "${hook.name}" handler for ${event.type} threw: ${describeError(error)}`);
|
|
@@ -3006,9 +3079,9 @@ export class SessionEngine {
|
|
|
3006
3079
|
}
|
|
3007
3080
|
}
|
|
3008
3081
|
if (this.abCollector.enabled) {
|
|
3009
|
-
yield this.abCollector.onEvent(event,
|
|
3082
|
+
yield this.abCollector.onEvent(event, sessionCtx.session, this.project.name);
|
|
3010
3083
|
}
|
|
3011
|
-
(_a = this.otel) === null || _a === void 0 ? void 0 : _a.onEvent(event,
|
|
3084
|
+
(_a = this.otel) === null || _a === void 0 ? void 0 : _a.onEvent(event, sessionCtx.session);
|
|
3012
3085
|
});
|
|
3013
3086
|
}
|
|
3014
3087
|
channelEventHandlersFor(channelId) {
|
|
@@ -3910,9 +3983,6 @@ function subagentPrompt(subagent) {
|
|
|
3910
3983
|
function buildRunnerSubagents(agent) {
|
|
3911
3984
|
return agent.subagents.map((subagent) => { var _a; return (Object.assign({ name: subagent.name, description: (_a = subagent.description) !== null && _a !== void 0 ? _a : subagent.name, prompt: subagentPrompt(subagent) }, (subagent.model === undefined ? {} : { model: subagent.model }))); });
|
|
3912
3985
|
}
|
|
3913
|
-
function describeError(error) {
|
|
3914
|
-
return error instanceof Error ? error.message : String(error);
|
|
3915
|
-
}
|
|
3916
3986
|
function toolErrorResult(message) {
|
|
3917
3987
|
return {
|
|
3918
3988
|
content: [{ type: "text", text: message }],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-run-log.d.ts","sourceRoot":"","sources":["../../src/internal/session-run-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"session-run-log.d.ts","sourceRoot":"","sources":["../../src/internal/session-run-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAEjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAGlD,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,oDAAoD;AACpD,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAC/C,iEAAiE;AACjE,eAAO,MAAM,8BAA8B,OAAO,CAAC;AACnD,yEAAyE;AACzE,eAAO,MAAM,8BAA8B,KAAK,CAAC;AAIjD,yDAAyD;AACzD,eAAO,MAAM,kCAAkC,OAAQ,CAAC;AAExD,MAAM,MAAM,qBAAqB,GAC7B,8BAA8B,GAC9B,cAAc,GACd,oBAAoB,GACpB,qBAAqB,CAAC;AAE1B,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,qBAAqB,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,qEAAqE;IACrE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,EAAE,YAAY,EAAE,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,qBAAqB,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,qBAAqB,GAAG;IAClC,CAAC,EAAE,OAAO,uBAAuB,CAAC;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,qBAAqB,CAAC;IACpC,UAAU,EAAE,mBAAmB,EAAE,CAAC;CACnC,CAAC;AAEF,uEAAuE;AACvE,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,GAAG;IAC3D,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAAC;IAC1E;;;;OAIG;IACH,iBAAiB,CACf,MAAM,EAAE,OAAO,CACb,qBAAqB,EACrB,cAAc,GAAG,oBAAoB,GAAG,qBAAqB,CAC9D,EACD,KAAK,CAAC,EAAE,OAAO,GACd,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB;AAWD;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,GACvC,IAAI,CAEN;AAED,wBAAgB,8BAA8B,IAAI,IAAI,CAErD;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAUxE;AAgBD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,CAa3E;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,SAAS,YAAY,EAAE,GAC/B,YAAY,EAAE,CAOhB;AAyFD,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,SAAS,mBAAmB,EAAE,GACzC,qBAAqB,GAAG,SAAS,CAgBnC;AAuFD,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,GACb,qBAAqB,GAAG,SAAS,CAkCnC;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,SAAS,YAAY,EAAE,CAAC;CAC9C,GAAG,kBAAkB,CAiHrB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,SAAS,YAAY,EAAE,CAAC;CAC9C,GAAG,kBAAkB,GAAG,SAAS,CAoBjC"}
|
|
@@ -31,6 +31,7 @@ import { cursorHostedFiles } from "../files-backends/cursor-hosted.js";
|
|
|
31
31
|
import { agentSdkStorageKeys } from "../storage-protocol.js";
|
|
32
32
|
import { resolveApiKeySync } from "./cursor/credentials.js";
|
|
33
33
|
import { describeError } from "./describe-error.js";
|
|
34
|
+
import { isRecord } from "./is-record.js";
|
|
34
35
|
import { resolveAgentV2Hosting } from "./v2-hosting.js";
|
|
35
36
|
export const SESSION_RUN_LOG_VERSION = 1;
|
|
36
37
|
/** Last N log-ring lines kept on each execution. */
|
|
@@ -99,9 +100,6 @@ export function snapshotSessionRunLogs(entries) {
|
|
|
99
100
|
line: boundedText(entry.line, SESSION_RUN_LOG_MAX_LINE_CHARS),
|
|
100
101
|
}));
|
|
101
102
|
}
|
|
102
|
-
function isRecord(value) {
|
|
103
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
104
|
-
}
|
|
105
103
|
function decodeSinkBody(body) {
|
|
106
104
|
return body instanceof Uint8Array ? body : body.body;
|
|
107
105
|
}
|
|
@@ -11,10 +11,7 @@ import type { DiscoveredSkill } from "../types.js";
|
|
|
11
11
|
* Mirror the agent's skills onto the store: write every SKILL.md (with the
|
|
12
12
|
* same generated frontmatter local materialization uses) plus sibling files,
|
|
13
13
|
* and delete keys no authored skill claims so redeploys drop removed skills.
|
|
14
|
-
*
|
|
15
|
-
* Everything loads and validates before the store is touched, and writes
|
|
16
|
-
* land before stale deletes, so a failed sync never leaves a gap a
|
|
17
|
-
* concurrent cloud reader could see.
|
|
14
|
+
* Everything loads and validates before the store is touched.
|
|
18
15
|
*/
|
|
19
16
|
export declare function syncSkillsToStore(args: {
|
|
20
17
|
sink: FileSink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills-sync.d.ts","sourceRoot":"","sources":["../../src/internal/skills-sync.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"skills-sync.d.ts","sourceRoot":"","sources":["../../src/internal/skills-sync.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,KAAK,EAAE,eAAe,EAAmB,MAAM,aAAa,CAAC;AASpE;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,IAAI,EAAE,QAAQ,CAAC;IACf,qFAAqF;IACrF,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC;IACnC,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBhB"}
|
|
@@ -15,9 +15,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
import { readFile } from "node:fs/promises";
|
|
18
|
-
import {
|
|
19
|
-
import { agentStoreKeys, FileConflictError } from "../files.js";
|
|
18
|
+
import { agentStoreKeys } from "../files.js";
|
|
20
19
|
import { STORAGE_KEY_ROOT } from "../storage.js";
|
|
20
|
+
import { mirrorToStore, storeRelPath } from "./store-mirror.js";
|
|
21
21
|
import { buildSkillMd } from "./workspace.js";
|
|
22
22
|
/** Pre-native layout. Deleted on every sync so a rolled-forward deploy does not leave undiscoverable copies. */
|
|
23
23
|
function legacySkillsPrefix(agent) {
|
|
@@ -27,10 +27,7 @@ function legacySkillsPrefix(agent) {
|
|
|
27
27
|
* Mirror the agent's skills onto the store: write every SKILL.md (with the
|
|
28
28
|
* same generated frontmatter local materialization uses) plus sibling files,
|
|
29
29
|
* and delete keys no authored skill claims so redeploys drop removed skills.
|
|
30
|
-
*
|
|
31
|
-
* Everything loads and validates before the store is touched, and writes
|
|
32
|
-
* land before stale deletes, so a failed sync never leaves a gap a
|
|
33
|
-
* concurrent cloud reader could see.
|
|
30
|
+
* Everything loads and validates before the store is touched.
|
|
34
31
|
*/
|
|
35
32
|
export function syncSkillsToStore(args) {
|
|
36
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -41,52 +38,15 @@ export function syncSkillsToStore(args) {
|
|
|
41
38
|
const key = (relPath) => agentStoreKeys.skillFile(skill.name, relPath, skillsPrefix);
|
|
42
39
|
desired.set(key("SKILL.md"), Buffer.from(buildSkillMd(skill), "utf8"));
|
|
43
40
|
for (const [relPath, source] of Object.entries(skill.files)) {
|
|
44
|
-
desired.set(key(storeRelPath(relPath)), yield sourceBytes(source));
|
|
41
|
+
desired.set(key(storeRelPath(relPath, "skill file")), yield sourceBytes(source));
|
|
45
42
|
}
|
|
46
43
|
}
|
|
47
|
-
yield
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Same refusals as local materialization's `resolveInside`: a rel that
|
|
57
|
-
* escapes the skill directory or would not round-trip through the FUSE
|
|
58
|
-
* mount (`..`, `.`, `//`, absolute) fails the sync, exactly as it fails a
|
|
59
|
-
* local turn's workspace write. Backslashes are refused too — the store
|
|
60
|
-
* normalizes `\` to `/` on write, so the stored key would differ from the
|
|
61
|
-
* desired one and the stale pass would delete the file it just wrote.
|
|
62
|
-
*/
|
|
63
|
-
function storeRelPath(relPath) {
|
|
64
|
-
if (relPath.includes("\0") ||
|
|
65
|
-
relPath.includes("\\") ||
|
|
66
|
-
posix.isAbsolute(relPath) ||
|
|
67
|
-
relPath.endsWith("/") ||
|
|
68
|
-
relPath.split("/").some((seg) => seg === ".." || seg === ".") ||
|
|
69
|
-
posix.normalize(relPath) !== relPath) {
|
|
70
|
-
throw new Error(`Refusing skill file path "${relPath}" (must be a normalized relative path)`);
|
|
71
|
-
}
|
|
72
|
-
return relPath;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Last writer wins. A raced conditional put (dual engine pods during a
|
|
76
|
-
* deploy rollover) clears the sink's cached etag, so one retry re-learns
|
|
77
|
-
* the current version and lands.
|
|
78
|
-
*/
|
|
79
|
-
function putLastWriterWins(sink, key, body) {
|
|
80
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
-
try {
|
|
82
|
-
yield sink.put(key, body);
|
|
83
|
-
}
|
|
84
|
-
catch (error) {
|
|
85
|
-
if (!(error instanceof FileConflictError)) {
|
|
86
|
-
throw error;
|
|
87
|
-
}
|
|
88
|
-
yield sink.put(key, body);
|
|
89
|
-
}
|
|
44
|
+
yield mirrorToStore({
|
|
45
|
+
sink: args.sink,
|
|
46
|
+
prefix: skillsPrefix,
|
|
47
|
+
desired,
|
|
48
|
+
legacyPrefixes: [legacySkillsPrefix(args.agentName)],
|
|
49
|
+
});
|
|
90
50
|
});
|
|
91
51
|
}
|
|
92
52
|
function sourceBytes(source) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sleep.d.ts","sourceRoot":"","sources":["../../src/internal/sleep.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mirror an authored file tree onto an Agent Store prefix. Shared by the
|
|
3
|
+
* skills and workspace seed syncs so both keep the same write-then-sweep
|
|
4
|
+
* discipline and the same path refusals.
|
|
5
|
+
*/
|
|
6
|
+
import { type FileSink } from "../files.js";
|
|
7
|
+
/**
|
|
8
|
+
* Write every `desired` key, then delete keys under `prefix` (and the
|
|
9
|
+
* `legacyPrefixes`) that nothing claims, so a redeploy drops removed files.
|
|
10
|
+
* Writes land before stale deletes, so a failed sync never leaves a gap a
|
|
11
|
+
* concurrent cloud reader could see.
|
|
12
|
+
*/
|
|
13
|
+
export declare function mirrorToStore(args: {
|
|
14
|
+
sink: FileSink;
|
|
15
|
+
prefix: string;
|
|
16
|
+
desired: ReadonlyMap<string, Uint8Array>;
|
|
17
|
+
/** Pre-native layouts emptied on every sync so a rolled-forward deploy does not leave undiscoverable copies. */
|
|
18
|
+
legacyPrefixes?: readonly string[];
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Same refusals as local materialization's `resolveInside`: a rel that
|
|
22
|
+
* escapes its directory or would not round-trip through the FUSE mount
|
|
23
|
+
* (`..`, `.`, `//`, absolute) fails the sync, exactly as it fails a local
|
|
24
|
+
* turn's workspace write. Backslashes are refused too — the store
|
|
25
|
+
* normalizes `\` to `/` on write, so the stored key would differ from the
|
|
26
|
+
* desired one and the stale pass would delete the file it just wrote.
|
|
27
|
+
*/
|
|
28
|
+
export declare function storeRelPath(relPath: string, what: "skill file" | "workspace file"): string;
|
|
29
|
+
//# sourceMappingURL=store-mirror.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-mirror.d.ts","sourceRoot":"","sources":["../../src/internal/store-mirror.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE/D;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACzC,gHAAgH;IAChH,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBhB;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,YAAY,GAAG,gBAAgB,GACpC,MAAM,CAcR"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mirror an authored file tree onto an Agent Store prefix. Shared by the
|
|
3
|
+
* skills and workspace seed syncs so both keep the same write-then-sweep
|
|
4
|
+
* discipline and the same path refusals.
|
|
5
|
+
*/
|
|
6
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
9
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
10
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
11
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
12
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
import { posix } from "node:path";
|
|
16
|
+
import { FileConflictError } from "../files.js";
|
|
17
|
+
/**
|
|
18
|
+
* Write every `desired` key, then delete keys under `prefix` (and the
|
|
19
|
+
* `legacyPrefixes`) that nothing claims, so a redeploy drops removed files.
|
|
20
|
+
* Writes land before stale deletes, so a failed sync never leaves a gap a
|
|
21
|
+
* concurrent cloud reader could see.
|
|
22
|
+
*/
|
|
23
|
+
export function mirrorToStore(args) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
var _a;
|
|
26
|
+
yield Promise.all([...args.desired].map(([key, body]) => putLastWriterWins(args.sink, key, body)));
|
|
27
|
+
const listed = yield Promise.all([args.prefix, ...((_a = args.legacyPrefixes) !== null && _a !== void 0 ? _a : [])].map((prefix) => args.sink.list(prefix)));
|
|
28
|
+
yield Promise.all(listed
|
|
29
|
+
.flat()
|
|
30
|
+
.filter((entry) => !args.desired.has(entry.key))
|
|
31
|
+
.map((entry) => args.sink.delete(entry.key)));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Same refusals as local materialization's `resolveInside`: a rel that
|
|
36
|
+
* escapes its directory or would not round-trip through the FUSE mount
|
|
37
|
+
* (`..`, `.`, `//`, absolute) fails the sync, exactly as it fails a local
|
|
38
|
+
* turn's workspace write. Backslashes are refused too — the store
|
|
39
|
+
* normalizes `\` to `/` on write, so the stored key would differ from the
|
|
40
|
+
* desired one and the stale pass would delete the file it just wrote.
|
|
41
|
+
*/
|
|
42
|
+
export function storeRelPath(relPath, what) {
|
|
43
|
+
if (relPath.includes("\0") ||
|
|
44
|
+
relPath.includes("\\") ||
|
|
45
|
+
posix.isAbsolute(relPath) ||
|
|
46
|
+
relPath.endsWith("/") ||
|
|
47
|
+
relPath.split("/").some((seg) => seg === ".." || seg === ".") ||
|
|
48
|
+
posix.normalize(relPath) !== relPath) {
|
|
49
|
+
throw new Error(`Refusing ${what} path "${relPath}" (must be a normalized relative path)`);
|
|
50
|
+
}
|
|
51
|
+
return relPath;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Last writer wins. A raced conditional put (dual engine pods during a
|
|
55
|
+
* deploy rollover) clears the sink's cached etag, so one retry re-learns
|
|
56
|
+
* the current version and lands.
|
|
57
|
+
*/
|
|
58
|
+
function putLastWriterWins(sink, key, body) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
try {
|
|
61
|
+
yield sink.put(key, body);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
if (!(error instanceof FileConflictError)) {
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
67
|
+
yield sink.put(key, body);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|