@cursor/july 0.1.97 → 0.1.100
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 +5 -3
- package/dist/bin/agent-serve.js +6 -7
- package/dist/channels/github/defaults.d.ts.map +1 -1
- package/dist/channels/github/defaults.js +28 -3
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +16 -0
- package/dist/channels/github/progress.d.ts +7 -0
- package/dist/channels/github/progress.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.d.ts +2 -0
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +37 -4
- package/dist/channels/slack/api.d.ts +16 -7
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +29 -13
- package/dist/channels/slack/constants.d.ts +6 -0
- package/dist/channels/slack/constants.d.ts.map +1 -1
- package/dist/channels/slack/constants.js +6 -0
- package/dist/channels/slack/defaults.d.ts +9 -4
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +221 -122
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +3 -3
- package/dist/channels/slack/inbound.d.ts +9 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +14 -0
- package/dist/channels/slack/index.d.ts +1 -0
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +1 -0
- package/dist/channels/slack/live-delivery.d.ts +6 -1
- package/dist/channels/slack/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +110 -20
- package/dist/channels/slack/progress-delivery.d.ts +28 -0
- package/dist/channels/slack/progress-delivery.d.ts.map +1 -0
- package/dist/channels/slack/progress-delivery.js +115 -0
- package/dist/channels/slack/reasoning-card.d.ts +38 -0
- package/dist/channels/slack/reasoning-card.d.ts.map +1 -0
- package/dist/channels/slack/reasoning-card.js +104 -0
- package/dist/channels/slack/redact.d.ts +2 -0
- package/dist/channels/slack/redact.d.ts.map +1 -0
- package/dist/channels/slack/redact.js +5 -0
- package/dist/channels/slack/reply-options.d.ts +40 -0
- package/dist/channels/slack/reply-options.d.ts.map +1 -0
- package/dist/channels/slack/reply-options.js +150 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +8 -4
- package/dist/channels/slack/stream.d.ts +22 -10
- package/dist/channels/slack/stream.d.ts.map +1 -1
- package/dist/channels/slack/stream.js +9 -16
- package/dist/channels/slack/tool-cards.d.ts +22 -0
- package/dist/channels/slack/tool-cards.d.ts.map +1 -0
- package/dist/channels/slack/tool-cards.js +178 -0
- package/dist/channels/slack/types.d.ts +154 -7
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +6 -6
- package/dist/docs/ab.md +1 -1
- package/dist/docs/assets/{ab.md.DJo5r4R-.js → ab.md.mlVgqvSk.js} +1 -1
- package/dist/docs/assets/{app.B3rWNYE1.js → app.DZ1e0Ycq.js} +1 -1
- package/dist/docs/assets/{building-with-agents.md.DI4mEzlt.js → building-with-agents.md.CUSWxlP_.js} +2 -2
- package/dist/docs/assets/chunks/@localSearchIndexroot.j70vvPL4.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.C1lhqJJR.js → VPLocalSearchBox.l8omwc6D.js} +1 -1
- package/dist/docs/assets/chunks/{theme.B40_SXuv.js → theme.JVcD6gel.js} +2 -2
- package/dist/docs/assets/{evals.md.lfJoEVc8.js → evals.md.CPzDAwoH.js} +1 -1
- package/dist/docs/assets/{guides_github.md.Cnh2mL4a.js → guides_github.md.BtPr9GaP.js} +1 -1
- package/dist/docs/assets/{guides_mcp-oauth.md.CN-6YmTJ.js → guides_mcp-oauth.md.Dp6cDP7f.js} +1 -1
- package/dist/docs/assets/{guides_opentelemetry.md.bmPmkvJu.js → guides_opentelemetry.md.BVTXDCRg.js} +2 -2
- package/dist/docs/assets/{guides_slack.md.VDXQV3ja.js → guides_slack.md.9oHPye9o.js} +19 -3
- package/dist/docs/assets/{guides_slack.md.VDXQV3ja.lean.js → guides_slack.md.9oHPye9o.lean.js} +1 -1
- package/dist/docs/assets/hillclimbing.md.CpTGTCle.js +4 -0
- package/dist/docs/assets/{index.md.CVeRUOeZ.js → index.md.Bb4k8kUm.js} +1 -1
- package/dist/docs/assets/{quickstart.md.Nj_LjW_a.js → quickstart.md.DdQOF7Y8.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.RyZf5OTE.js → reference_cli.md.DfoeyvL0.js} +4 -4
- package/dist/docs/assets/{reference_cli.md.RyZf5OTE.lean.js → reference_cli.md.DfoeyvL0.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.DxldvyIB.js → reference_connections.md.BiGoBAk2.js} +1 -1
- package/dist/docs/assets/{reference_http-api.md.5zOAbV86.js → reference_http-api.md.BEJx9XVj.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.B84gw9Ii.js → reference_tools.md.CvAHsdSp.js} +10 -2
- package/dist/docs/assets/{reference_tools.md.B84gw9Ii.lean.js → reference_tools.md.CvAHsdSp.lean.js} +1 -1
- package/dist/docs/assets/scaffolding-agents.md.em43xlY1.js +1 -0
- package/dist/docs/assets/skills_ab.md.CsFNatVx.js +26 -0
- package/dist/docs/assets/skills_ab.md.CsFNatVx.lean.js +1 -0
- package/dist/docs/assets/skills_create-agent.md.BVoWPcan.js +8 -0
- package/dist/docs/assets/skills_create-agent.md.BVoWPcan.lean.js +1 -0
- package/dist/docs/assets/skills_debug.md.CDbPhHfg.js +1 -0
- package/dist/docs/assets/skills_debug.md.CDbPhHfg.lean.js +1 -0
- package/dist/docs/assets/skills_evals.md.723kpUmA.js +25 -0
- package/dist/docs/assets/skills_evals.md.723kpUmA.lean.js +1 -0
- package/dist/docs/assets/skills_framework-map.md.BTi817yv.js +1 -0
- package/dist/docs/assets/skills_framework-map.md.BTi817yv.lean.js +1 -0
- package/dist/docs/assets/skills_github.md.D0JahM8c.js +16 -0
- package/dist/docs/assets/skills_github.md.D0JahM8c.lean.js +1 -0
- package/dist/docs/assets/skills_hillclimb.md.B_zJerxA.js +7 -0
- package/dist/docs/assets/skills_hillclimb.md.B_zJerxA.lean.js +1 -0
- package/dist/docs/assets/skills_index.md.DKwIxzGg.js +1 -0
- package/dist/docs/assets/skills_index.md.DKwIxzGg.lean.js +1 -0
- package/dist/docs/assets/skills_mcp-auth.md.DGvFP3HE.js +18 -0
- package/dist/docs/assets/skills_mcp-auth.md.DGvFP3HE.lean.js +1 -0
- package/dist/docs/assets/skills_otel.md.CgiZryR3.js +8 -0
- package/dist/docs/assets/skills_otel.md.CgiZryR3.lean.js +1 -0
- package/dist/docs/assets/skills_setup-slack.md.BBgx8lUz.js +20 -0
- package/dist/docs/assets/skills_setup-slack.md.BBgx8lUz.lean.js +1 -0
- package/dist/docs/assets/{troubleshooting.md.DCiPBhYs.js → troubleshooting.md.Cus_YZga.js} +1 -1
- package/dist/docs/building-with-agents.html +6 -6
- package/dist/docs/building-with-agents.md +14 -11
- package/dist/docs/concepts.html +4 -4
- package/dist/docs/deployment.html +4 -4
- package/dist/docs/design/runtime-abstraction.md +1757 -0
- package/dist/docs/evals.html +6 -6
- package/dist/docs/evals.md +1 -1
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-runtime.html +4 -4
- package/dist/docs/guides/convert-automation.html +4 -4
- package/dist/docs/guides/github.html +5 -5
- package/dist/docs/guides/github.md +1 -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/mcp-oauth.md +1 -1
- package/dist/docs/guides/opentelemetry.html +7 -7
- package/dist/docs/guides/opentelemetry.md +2 -2
- package/dist/docs/guides/slack.html +22 -6
- package/dist/docs/guides/slack.md +80 -1
- package/dist/docs/guides/webhooks.html +5 -5
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +6 -6
- package/dist/docs/hillclimbing.md +5 -5
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +1 -1
- package/dist/docs/llms-full.txt +2830 -37
- package/dist/docs/llms.txt +15 -0
- package/dist/docs/quickstart.html +5 -5
- package/dist/docs/quickstart.md +1 -1
- package/dist/docs/reference/agent-config.html +4 -4
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +4 -4
- package/dist/docs/reference/cli.html +7 -7
- package/dist/docs/reference/cli.md +1 -7
- package/dist/docs/reference/connections.html +6 -6
- package/dist/docs/reference/connections.md +1 -1
- package/dist/docs/reference/hooks.html +4 -4
- package/dist/docs/reference/http-api.html +6 -6
- package/dist/docs/reference/http-api.md +1 -0
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +4 -4
- package/dist/docs/reference/project-layout.html +4 -4
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +4 -4
- package/dist/docs/reference/skills.html +4 -4
- package/dist/docs/reference/subagents.html +4 -4
- package/dist/docs/reference/tools.html +14 -6
- package/dist/docs/reference/tools.md +25 -0
- package/dist/docs/scaffolding-agents.html +5 -5
- package/dist/docs/scaffolding-agents.md +3 -3
- package/dist/docs/skills/ab.html +52 -0
- package/dist/docs/skills/ab.md +50 -0
- package/dist/docs/skills/create-agent.html +34 -0
- package/dist/docs/skills/create-agent.md +160 -0
- package/dist/docs/skills/debug.html +27 -0
- package/dist/docs/skills/debug.md +36 -0
- package/dist/docs/skills/evals.html +51 -0
- package/dist/docs/skills/evals.md +99 -0
- package/dist/docs/skills/framework-map.html +27 -0
- package/dist/docs/skills/framework-map.md +95 -0
- package/dist/docs/skills/github.html +42 -0
- package/dist/docs/skills/github.md +93 -0
- package/dist/docs/skills/hillclimb.html +33 -0
- package/dist/docs/skills/hillclimb.md +55 -0
- package/dist/docs/skills/index.html +27 -0
- package/dist/docs/skills/index.md +21 -0
- package/dist/docs/skills/mcp-auth.html +44 -0
- package/dist/docs/skills/mcp-auth.md +76 -0
- package/dist/docs/skills/otel.html +34 -0
- package/dist/docs/skills/otel.md +48 -0
- package/dist/docs/skills/setup-slack.html +46 -0
- package/dist/docs/skills/setup-slack.md +141 -0
- 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 +4 -4
- package/dist/docs/templates/security-help.html +4 -4
- package/dist/docs/templates/security-reviewer.html +4 -4
- package/dist/docs/templates/triage.html +4 -4
- package/dist/docs/troubleshooting.html +5 -5
- package/dist/docs/troubleshooting.md +1 -1
- package/dist/files-backends/cursor-hosted.d.ts +9 -2
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +9 -11
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/internal/as-of.d.ts +19 -0
- package/dist/internal/as-of.d.ts.map +1 -0
- package/dist/internal/as-of.js +82 -0
- package/dist/internal/cli-deploy.d.ts +2 -1
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +102 -7
- package/dist/internal/conversation-mirror.d.ts.map +1 -1
- package/dist/internal/conversation-mirror.js +3 -4
- package/dist/internal/cursor/hosted-store-secrets.d.ts +15 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-store-secrets.js +48 -0
- package/dist/internal/cursor-event-relay.d.ts.map +1 -1
- package/dist/internal/cursor-event-relay.js +5 -6
- package/dist/internal/deploy-client.d.ts +6 -6
- package/dist/internal/deploy-client.js +7 -7
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +11 -1
- package/dist/internal/framework-file-storage.d.ts +5 -4
- package/dist/internal/framework-file-storage.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.js +6 -4
- package/dist/internal/framework-storage-selection.d.ts +13 -11
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +28 -23
- package/dist/internal/hosted-admission-adapter.d.ts +28 -0
- package/dist/internal/hosted-admission-adapter.d.ts.map +1 -0
- package/dist/internal/hosted-admission-adapter.js +7 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +6 -1
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +1 -1
- package/dist/internal/hosted-delivery.d.ts +15 -1
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +47 -21
- package/dist/internal/hosted-execution-diag.d.ts +11 -0
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
- package/dist/internal/hosted-execution-diag.js +39 -2
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +4 -1
- package/dist/internal/server.d.ts +3 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +82 -19
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +24 -4
- package/dist/internal/session-run-log.d.ts +120 -0
- package/dist/internal/session-run-log.d.ts.map +1 -0
- package/dist/internal/session-run-log.js +358 -0
- package/dist/internal/tool-policy.d.ts +20 -8
- package/dist/internal/tool-policy.d.ts.map +1 -1
- package/dist/internal/tool-policy.js +11 -0
- package/dist/playground/assets/index-BszoQDc6.css +1 -0
- package/dist/playground/assets/index-DVs98vPL.js +69 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted-v2.d.ts +83 -0
- package/dist/storage-backends/cursor-hosted-v2.d.ts.map +1 -0
- package/dist/storage-backends/cursor-hosted-v2.js +164 -0
- package/dist/storage-backends/cursor-hosted.d.ts +6 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +6 -1
- package/dist/storage-protocol.d.ts +8 -0
- package/dist/storage-protocol.d.ts.map +1 -1
- package/dist/storage-protocol.js +8 -0
- package/dist/tools.d.ts +12 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/types.d.ts +30 -0
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +1 -1
- package/docs/ab.md +1 -1
- package/docs/building-with-agents.md +14 -11
- package/docs/design/runtime-abstraction.md +1757 -0
- package/docs/evals.md +1 -1
- package/docs/guides/github.md +1 -1
- package/docs/guides/mcp-oauth.md +1 -1
- package/docs/guides/opentelemetry.md +2 -2
- package/docs/guides/slack.md +80 -1
- package/docs/hillclimbing.md +5 -5
- package/docs/quickstart.md +1 -1
- package/docs/reference/cli.md +1 -7
- package/docs/reference/connections.md +1 -1
- package/docs/reference/http-api.md +1 -0
- package/docs/reference/tools.md +25 -0
- package/docs/scaffolding-agents.md +3 -3
- package/docs/skills/index.md +26 -0
- package/docs/troubleshooting.md +1 -1
- package/package.json +1 -1
- package/src/bin/agent-serve.ts +6 -7
- package/src/channels/github/defaults.ts +36 -3
- package/src/channels/github/github-channel.ts +17 -0
- package/src/channels/github/progress.ts +7 -0
- package/src/channels/origin/origin-channel.ts +74 -10
- package/src/channels/slack/api.ts +35 -17
- package/src/channels/slack/constants.ts +6 -0
- package/src/channels/slack/defaults.ts +253 -144
- package/src/channels/slack/dispatch.ts +10 -1
- package/src/channels/slack/inbound.ts +17 -0
- package/src/channels/slack/index.ts +1 -0
- package/src/channels/slack/live-delivery.ts +135 -22
- package/src/channels/slack/progress-delivery.ts +133 -0
- package/src/channels/slack/reasoning-card.ts +140 -0
- package/src/channels/slack/redact.ts +6 -0
- package/src/channels/slack/reply-options.ts +229 -0
- package/src/channels/slack/slack-channel.ts +7 -2
- package/src/channels/slack/stream.ts +31 -24
- package/src/channels/slack/tool-cards.ts +221 -0
- package/src/channels/slack/types.ts +168 -7
- package/src/files-backends/cursor-hosted.ts +18 -7
- package/src/index.ts +4 -0
- package/src/internal/as-of.ts +107 -0
- package/src/internal/cli-deploy.ts +130 -10
- package/src/internal/conversation-mirror.ts +3 -8
- package/src/internal/cursor/hosted-store-secrets.ts +72 -0
- package/src/internal/cursor-event-relay.ts +5 -6
- package/src/internal/deploy-client.ts +10 -10
- package/src/internal/discovery.ts +9 -1
- package/src/internal/framework-file-storage.ts +6 -4
- package/src/internal/framework-storage-selection.ts +28 -25
- package/src/internal/hosted-admission-adapter.ts +42 -0
- package/src/internal/hosted-delivery-protocol.ts +7 -2
- package/src/internal/hosted-delivery.ts +88 -36
- package/src/internal/hosted-execution-diag.ts +45 -0
- package/src/internal/http-channel.ts +8 -0
- package/src/internal/server.ts +100 -2
- package/src/internal/session-engine.ts +32 -1
- package/src/internal/session-run-log.ts +579 -0
- package/src/internal/tool-policy.ts +31 -9
- package/src/storage-backends/cursor-hosted-v2.ts +219 -0
- package/src/storage-backends/cursor-hosted.ts +6 -1
- package/src/storage-protocol.ts +10 -0
- package/src/tools.ts +12 -2
- package/src/types.ts +30 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.BU9nHdnQ.js +0 -1
- package/dist/docs/assets/hillclimbing.md.DhESf3OO.js +0 -4
- package/dist/docs/assets/scaffolding-agents.md.D7UUkWw0.js +0 -1
- package/dist/playground/assets/index-DrkI6y5O.js +0 -88
- package/dist/playground/assets/index-DzNGwm7q.css +0 -1
- /package/dist/docs/assets/{ab.md.DJo5r4R-.lean.js → ab.md.mlVgqvSk.lean.js} +0 -0
- /package/dist/docs/assets/{building-with-agents.md.DI4mEzlt.lean.js → building-with-agents.md.CUSWxlP_.lean.js} +0 -0
- /package/dist/docs/assets/{evals.md.lfJoEVc8.lean.js → evals.md.CPzDAwoH.lean.js} +0 -0
- /package/dist/docs/assets/{guides_github.md.Cnh2mL4a.lean.js → guides_github.md.BtPr9GaP.lean.js} +0 -0
- /package/dist/docs/assets/{guides_mcp-oauth.md.CN-6YmTJ.lean.js → guides_mcp-oauth.md.Dp6cDP7f.lean.js} +0 -0
- /package/dist/docs/assets/{guides_opentelemetry.md.bmPmkvJu.lean.js → guides_opentelemetry.md.BVTXDCRg.lean.js} +0 -0
- /package/dist/docs/assets/{hillclimbing.md.DhESf3OO.lean.js → hillclimbing.md.CpTGTCle.lean.js} +0 -0
- /package/dist/docs/assets/{index.md.CVeRUOeZ.lean.js → index.md.Bb4k8kUm.lean.js} +0 -0
- /package/dist/docs/assets/{quickstart.md.Nj_LjW_a.lean.js → quickstart.md.DdQOF7Y8.lean.js} +0 -0
- /package/dist/docs/assets/{reference_connections.md.DxldvyIB.lean.js → reference_connections.md.BiGoBAk2.lean.js} +0 -0
- /package/dist/docs/assets/{reference_http-api.md.5zOAbV86.lean.js → reference_http-api.md.BEJx9XVj.lean.js} +0 -0
- /package/dist/docs/assets/{scaffolding-agents.md.D7UUkWw0.lean.js → scaffolding-agents.md.em43xlY1.lean.js} +0 -0
- /package/dist/docs/assets/{troubleshooting.md.DCiPBhYs.lean.js → troubleshooting.md.Cus_YZga.lean.js} +0 -0
|
@@ -46,6 +46,8 @@ export type HostedExecutionDiag = {
|
|
|
46
46
|
turnStatus: string;
|
|
47
47
|
durationMs: number;
|
|
48
48
|
message?: string;
|
|
49
|
+
/** First frames of a thrown Error; omitted on soft turn failures. */
|
|
50
|
+
stack?: string;
|
|
49
51
|
signalAborted?: boolean;
|
|
50
52
|
requestId?: string;
|
|
51
53
|
abortReason?: HostedExecutionDiagAbortReason;
|
|
@@ -63,6 +65,7 @@ const DIAG_KEYS = new Set([
|
|
|
63
65
|
"turnStatus",
|
|
64
66
|
"durationMs",
|
|
65
67
|
"message",
|
|
68
|
+
"stack",
|
|
66
69
|
"signalAborted",
|
|
67
70
|
"requestId",
|
|
68
71
|
"abortReason",
|
|
@@ -86,6 +89,42 @@ function boundedOptionalString(
|
|
|
86
89
|
: undefined;
|
|
87
90
|
}
|
|
88
91
|
|
|
92
|
+
/** First line + frames; factory `last_error` is 1024 chars with a TAS prefix. */
|
|
93
|
+
export const HOSTED_ERROR_STACK_LINE_COUNT = 5;
|
|
94
|
+
export const HOSTED_ERROR_SNIPPET_MAX_CHARS = 700;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Bounded throw text for the hosted 500 body and the on-disk diag `stack`.
|
|
98
|
+
* Prefers `Error.stack` (message line + `at` frames) so `last_error` is not
|
|
99
|
+
* the generic "Internal server error." when the throw has a stack.
|
|
100
|
+
*/
|
|
101
|
+
export function hostedErrorStackSnippet(error: unknown): string {
|
|
102
|
+
if (error instanceof Error) {
|
|
103
|
+
const stack = error.stack?.trim();
|
|
104
|
+
if (stack !== undefined && stack.length > 0) {
|
|
105
|
+
const lines = stack
|
|
106
|
+
.split("\n")
|
|
107
|
+
.map((line) => line.trimEnd())
|
|
108
|
+
.filter((line) => line.trim().length > 0)
|
|
109
|
+
.slice(0, HOSTED_ERROR_STACK_LINE_COUNT);
|
|
110
|
+
const text = lines.join("\n");
|
|
111
|
+
return text.length > HOSTED_ERROR_SNIPPET_MAX_CHARS
|
|
112
|
+
? `${text.slice(0, HOSTED_ERROR_SNIPPET_MAX_CHARS)}…`
|
|
113
|
+
: text;
|
|
114
|
+
}
|
|
115
|
+
return error.message.length > HOSTED_ERROR_SNIPPET_MAX_CHARS
|
|
116
|
+
? `${error.message.slice(0, HOSTED_ERROR_SNIPPET_MAX_CHARS)}…`
|
|
117
|
+
: error.message;
|
|
118
|
+
}
|
|
119
|
+
const text = String(error);
|
|
120
|
+
if (text.length === 0) {
|
|
121
|
+
return "";
|
|
122
|
+
}
|
|
123
|
+
return text.length > HOSTED_ERROR_SNIPPET_MAX_CHARS
|
|
124
|
+
? `${text.slice(0, HOSTED_ERROR_SNIPPET_MAX_CHARS)}…`
|
|
125
|
+
: text;
|
|
126
|
+
}
|
|
127
|
+
|
|
89
128
|
export function hostedExecutionDiagPath(stateRoot: string): string {
|
|
90
129
|
return join(stateRoot, HOSTED_EXECUTION_DIAG_FILENAME);
|
|
91
130
|
}
|
|
@@ -147,6 +186,10 @@ export function parseHostedExecutionDiag(
|
|
|
147
186
|
return undefined;
|
|
148
187
|
}
|
|
149
188
|
const message = boundedOptionalString(body.message, 1024);
|
|
189
|
+
const stack = boundedOptionalString(
|
|
190
|
+
body.stack,
|
|
191
|
+
HOSTED_ERROR_SNIPPET_MAX_CHARS
|
|
192
|
+
);
|
|
150
193
|
const requestId = boundedOptionalString(body.requestId, 128);
|
|
151
194
|
const abortReason =
|
|
152
195
|
body.abortReason === undefined
|
|
@@ -173,6 +216,7 @@ export function parseHostedExecutionDiag(
|
|
|
173
216
|
turnStatus: body.turnStatus,
|
|
174
217
|
durationMs: body.durationMs,
|
|
175
218
|
...(message === undefined ? {} : { message }),
|
|
219
|
+
...(stack === undefined ? {} : { stack }),
|
|
176
220
|
...(body.signalAborted === true ? { signalAborted: true } : {}),
|
|
177
221
|
...(requestId === undefined ? {} : { requestId }),
|
|
178
222
|
...(abortReason === undefined ? {} : { abortReason }),
|
|
@@ -196,6 +240,7 @@ export async function writeHostedExecutionDiag(
|
|
|
196
240
|
serialized.length > HOSTED_EXECUTION_DIAG_MAX_BYTES
|
|
197
241
|
? JSON.stringify({
|
|
198
242
|
...diag,
|
|
243
|
+
stack: undefined,
|
|
199
244
|
message: boundedOptionalString(diag.message, 256),
|
|
200
245
|
})
|
|
201
246
|
: serialized;
|
|
@@ -95,6 +95,13 @@ export function buildHttpChannelRoutes(args: {
|
|
|
95
95
|
"Expected a JSON body with a string `message`."
|
|
96
96
|
);
|
|
97
97
|
}
|
|
98
|
+
if (body.asOf !== undefined && typeof body.asOf !== "string") {
|
|
99
|
+
return errorResponse(
|
|
100
|
+
400,
|
|
101
|
+
"invalid_request",
|
|
102
|
+
"`asOf` must be an ISO-8601 instant with a timezone when provided."
|
|
103
|
+
);
|
|
104
|
+
}
|
|
98
105
|
const message = await transformMessage(body.message, ctx.auth);
|
|
99
106
|
const workspaceFiles = readWorkspaceFiles(body.workspaceFiles);
|
|
100
107
|
// Per-session cloud attach (create only). Eval harness uses this to pin
|
|
@@ -105,6 +112,7 @@ export function buildHttpChannelRoutes(args: {
|
|
|
105
112
|
...(typeof body.title === "string" ? { title: body.title } : {}),
|
|
106
113
|
...(body.purpose === "eval" ? { purpose: "eval" as const } : {}),
|
|
107
114
|
...(body.dryRun === true ? { dryRun: true } : {}),
|
|
115
|
+
asOf: body.asOf,
|
|
108
116
|
...(workspaceFiles === undefined ? {} : { workspaceFiles }),
|
|
109
117
|
...(cloud === undefined ? {} : { cloud }),
|
|
110
118
|
});
|
package/src/internal/server.ts
CHANGED
|
@@ -50,6 +50,7 @@ import type {
|
|
|
50
50
|
ReminderInfo,
|
|
51
51
|
ServeOptions,
|
|
52
52
|
} from "../types.js";
|
|
53
|
+
import { InvalidAsOfError, VacuousTimeArgsError } from "./as-of.js";
|
|
53
54
|
import { V2EngineError } from "./continuation-identity.js";
|
|
54
55
|
import { selectConversationMirror } from "./conversation-mirror.js";
|
|
55
56
|
import {
|
|
@@ -109,6 +110,7 @@ import {
|
|
|
109
110
|
} from "./handleAgentServeTrigger.js";
|
|
110
111
|
import { createHostPlatforms, warmupHostGitHubAuth } from "./host-platforms.js";
|
|
111
112
|
import { registerHostedDeliveryRoute } from "./hosted-delivery.js";
|
|
113
|
+
import { hostedErrorStackSnippet } from "./hosted-execution-diag.js";
|
|
112
114
|
import {
|
|
113
115
|
buildHttpChannelRoutes,
|
|
114
116
|
errorResponse,
|
|
@@ -186,6 +188,11 @@ import {
|
|
|
186
188
|
UnknownToolError,
|
|
187
189
|
WorkspaceUnavailableError,
|
|
188
190
|
} from "./session-engine.js";
|
|
191
|
+
import {
|
|
192
|
+
registerSessionRunFatalFlush,
|
|
193
|
+
selectSessionRunLogStore,
|
|
194
|
+
unregisterSessionRunFatalFlush,
|
|
195
|
+
} from "./session-run-log.js";
|
|
189
196
|
import { sessionUrlsForRequest } from "./session-urls.js";
|
|
190
197
|
import { catalogDetailEntry, catalogListEntry } from "./tool-catalog.js";
|
|
191
198
|
|
|
@@ -247,6 +254,8 @@ export interface StartServerInternalOptions {
|
|
|
247
254
|
runner?: AgentRunner;
|
|
248
255
|
/** Test seam: bind the `--store` secrets client for on-demand MCP OAuth. */
|
|
249
256
|
mcpOauthSecrets?: McpOauthSecretsTarget;
|
|
257
|
+
/** Test seam: persist hosted-execution run logs without a live store. */
|
|
258
|
+
sessionRunLog?: ReturnType<typeof selectSessionRunLogStore>;
|
|
250
259
|
}
|
|
251
260
|
|
|
252
261
|
/**
|
|
@@ -532,6 +541,20 @@ export async function startServer(
|
|
|
532
541
|
mounts.length === 1 && mounts[0] !== undefined
|
|
533
542
|
? selectConversationMirror({ project: mounts[0].project, logger })
|
|
534
543
|
: undefined;
|
|
544
|
+
const sessionRunLog =
|
|
545
|
+
options.sessionRunLog ??
|
|
546
|
+
(mounts.length === 1 && mounts[0] !== undefined
|
|
547
|
+
? selectSessionRunLogStore({
|
|
548
|
+
project: mounts[0].project,
|
|
549
|
+
logger,
|
|
550
|
+
snapshotLogs: () => logRing.since(),
|
|
551
|
+
})
|
|
552
|
+
: undefined);
|
|
553
|
+
if (sessionRunLog !== undefined) {
|
|
554
|
+
registerSessionRunFatalFlush((error) =>
|
|
555
|
+
sessionRunLog.flushProcessDeath("uncaught_exception", error)
|
|
556
|
+
);
|
|
557
|
+
}
|
|
535
558
|
const sdkRunner =
|
|
536
559
|
options.runner ??
|
|
537
560
|
new CursorSdkRunner({
|
|
@@ -746,6 +769,7 @@ export async function startServer(
|
|
|
746
769
|
logger,
|
|
747
770
|
logRing,
|
|
748
771
|
diagStateRoot: baseStateRoot,
|
|
772
|
+
sessionRunLog,
|
|
749
773
|
...(options.authToken === undefined
|
|
750
774
|
? {}
|
|
751
775
|
: { authToken: options.authToken }),
|
|
@@ -1199,6 +1223,10 @@ export async function startServer(
|
|
|
1199
1223
|
return runtime.engine.callTool(toolName, input, callOptions);
|
|
1200
1224
|
},
|
|
1201
1225
|
close: async () => {
|
|
1226
|
+
if (sessionRunLog !== undefined) {
|
|
1227
|
+
await sessionRunLog.flushProcessDeath("process_exit");
|
|
1228
|
+
unregisterSessionRunFatalFlush();
|
|
1229
|
+
}
|
|
1202
1230
|
playgroundDev?.stop();
|
|
1203
1231
|
await cursorDeploymentRelay?.stop();
|
|
1204
1232
|
await cursorEventRelay?.stop();
|
|
@@ -1253,6 +1281,7 @@ function mountAgentRoutes(
|
|
|
1253
1281
|
multi: boolean;
|
|
1254
1282
|
logger: (line: string) => void;
|
|
1255
1283
|
logRing: LogRing;
|
|
1284
|
+
sessionRunLog?: ReturnType<typeof selectSessionRunLogStore>;
|
|
1256
1285
|
authToken?: string;
|
|
1257
1286
|
allowAnonymous?: boolean;
|
|
1258
1287
|
/** Cursor account bridge + this mount's account MCP connections, when authored. */
|
|
@@ -1266,7 +1295,15 @@ function mountAgentRoutes(
|
|
|
1266
1295
|
}
|
|
1267
1296
|
): void {
|
|
1268
1297
|
const { slug, project, engine, scheduleRunner, reminderRunner } = runtime;
|
|
1269
|
-
const {
|
|
1298
|
+
const {
|
|
1299
|
+
dev,
|
|
1300
|
+
playground,
|
|
1301
|
+
noControlPlane,
|
|
1302
|
+
multi,
|
|
1303
|
+
logger,
|
|
1304
|
+
logRing,
|
|
1305
|
+
sessionRunLog,
|
|
1306
|
+
} = args;
|
|
1270
1307
|
// "" (single) -> "/v1/..."; "my-agent" (multi) -> "/my-agent/v1/...".
|
|
1271
1308
|
const base = slug === "" ? "" : `/${slug}`;
|
|
1272
1309
|
|
|
@@ -1327,6 +1364,10 @@ function mountAgentRoutes(
|
|
|
1327
1364
|
...(args.diagStateRoot === undefined
|
|
1328
1365
|
? {}
|
|
1329
1366
|
: { stateRoot: args.diagStateRoot }),
|
|
1367
|
+
...(sessionRunLog === undefined
|
|
1368
|
+
? {}
|
|
1369
|
+
: { persistSessionRun: (document) => sessionRunLog.persist(document) }),
|
|
1370
|
+
snapshotLogs: () => logRing.since(),
|
|
1330
1371
|
});
|
|
1331
1372
|
}
|
|
1332
1373
|
// Playground lists/opens Slack (and other channel) sessions across
|
|
@@ -1433,6 +1474,51 @@ function mountAgentRoutes(
|
|
|
1433
1474
|
},
|
|
1434
1475
|
});
|
|
1435
1476
|
|
|
1477
|
+
// v2 only: one session-level hosted-execution log on the framework
|
|
1478
|
+
// store. Distinct from GET /v1/logs (process-wide ring). Keyed by the
|
|
1479
|
+
// factory session public id so an execute_throw that never minted a
|
|
1480
|
+
// July session is still readable after the pod parks.
|
|
1481
|
+
if (isV2Project(project) && sessionRunLog !== undefined) {
|
|
1482
|
+
router.add({
|
|
1483
|
+
method: "GET",
|
|
1484
|
+
pattern: `${base}/v1/session/:sessionId/runs`,
|
|
1485
|
+
auth: httpAuth,
|
|
1486
|
+
handler: async (_request, ctx) => {
|
|
1487
|
+
const sessionId = ctx.params.sessionId ?? "";
|
|
1488
|
+
if (sessionId.length === 0 || sessionId.includes("/")) {
|
|
1489
|
+
return errorResponse(
|
|
1490
|
+
400,
|
|
1491
|
+
"invalid_request",
|
|
1492
|
+
"Expected a session id."
|
|
1493
|
+
);
|
|
1494
|
+
}
|
|
1495
|
+
const record = await engine.getOrRestoreSession(sessionId);
|
|
1496
|
+
if (record === undefined) {
|
|
1497
|
+
return errorResponse(
|
|
1498
|
+
404,
|
|
1499
|
+
"session_not_found",
|
|
1500
|
+
`Unknown session ${sessionId}.`
|
|
1501
|
+
);
|
|
1502
|
+
}
|
|
1503
|
+
const ownership = requireSessionOwner(record, ctx.auth, {
|
|
1504
|
+
relax: relaxSessionReadAuth,
|
|
1505
|
+
beyondLoopback: relaxSessionReadAuthBeyondLoopback,
|
|
1506
|
+
requestIp: ctx.requestIp,
|
|
1507
|
+
});
|
|
1508
|
+
if (ownership !== undefined) {
|
|
1509
|
+
return ownership;
|
|
1510
|
+
}
|
|
1511
|
+
const document = await sessionRunLog.read(sessionId);
|
|
1512
|
+
return jsonResponse({
|
|
1513
|
+
sessionId,
|
|
1514
|
+
updatedAt: document?.updatedAt,
|
|
1515
|
+
lastFailure: document?.lastFailure ?? null,
|
|
1516
|
+
executions: document?.executions ?? [],
|
|
1517
|
+
});
|
|
1518
|
+
},
|
|
1519
|
+
});
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1436
1522
|
router.add({
|
|
1437
1523
|
method: "GET",
|
|
1438
1524
|
pattern: `${base}/v1/sessions`,
|
|
@@ -2829,6 +2915,11 @@ async function handleRequest(
|
|
|
2829
2915
|
);
|
|
2830
2916
|
} else if (error instanceof SessionAuthError) {
|
|
2831
2917
|
response = errorResponse(403, "forbidden", error.message);
|
|
2918
|
+
} else if (
|
|
2919
|
+
error instanceof InvalidAsOfError ||
|
|
2920
|
+
error instanceof VacuousTimeArgsError
|
|
2921
|
+
) {
|
|
2922
|
+
response = errorResponse(400, "invalid_request", error.message);
|
|
2832
2923
|
} else {
|
|
2833
2924
|
logger(
|
|
2834
2925
|
`[agent-sdk] request failed: ${
|
|
@@ -2837,7 +2928,14 @@ async function handleRequest(
|
|
|
2837
2928
|
: String(error)
|
|
2838
2929
|
}`
|
|
2839
2930
|
);
|
|
2840
|
-
|
|
2931
|
+
const snippet = hostedErrorStackSnippet(error);
|
|
2932
|
+
response = errorResponse(
|
|
2933
|
+
500,
|
|
2934
|
+
"internal_error",
|
|
2935
|
+
snippet.length > 0
|
|
2936
|
+
? `Internal server error: ${snippet}`
|
|
2937
|
+
: "Internal server error."
|
|
2938
|
+
);
|
|
2841
2939
|
}
|
|
2842
2940
|
}
|
|
2843
2941
|
|
|
@@ -89,6 +89,7 @@ import {
|
|
|
89
89
|
} from "./advertise-tools.js";
|
|
90
90
|
import { ApprovalGate } from "./approval-gate.js";
|
|
91
91
|
import { ArtifactsStore } from "./artifacts-store.js";
|
|
92
|
+
import { assertTimeArgs, normalizeAsOf, sessionClock } from "./as-of.js";
|
|
92
93
|
import { SessionAuthError, samePrincipal } from "./auth.js";
|
|
93
94
|
import { mergeCloudOptions, resolveSessionRuntime } from "./cloud-merge.js";
|
|
94
95
|
import {
|
|
@@ -1023,12 +1024,15 @@ export class SessionEngine {
|
|
|
1023
1024
|
const now = new Date().toISOString();
|
|
1024
1025
|
const channelState = this.initialChannelState(channelId, sendOptions.state);
|
|
1025
1026
|
const purpose = sendOptions.purpose === "eval" ? "eval" : "live";
|
|
1027
|
+
const frozenAsOf = normalizeAsOf(sendOptions.asOf);
|
|
1028
|
+
assertTimeArgs(this.project.agent.tools, frozenAsOf);
|
|
1026
1029
|
let record: SessionRecord = {
|
|
1027
1030
|
sessionId: sendOptions.hostedSessionId ?? newSessionId(),
|
|
1028
1031
|
channelId,
|
|
1029
1032
|
mode: sendOptions.mode ?? "chat",
|
|
1030
1033
|
purpose,
|
|
1031
1034
|
dryRun: sendOptions.dryRun === true ? true : undefined,
|
|
1035
|
+
asOf: frozenAsOf,
|
|
1032
1036
|
continuationKey: sendOptions.continuationToken ?? newContinuationKey(),
|
|
1033
1037
|
auth,
|
|
1034
1038
|
title: sendOptions.title,
|
|
@@ -2207,6 +2211,8 @@ export class SessionEngine {
|
|
|
2207
2211
|
channelId: record.channelId,
|
|
2208
2212
|
channelKind: this.channelsById.get(record.channelId)?.meta?.kind,
|
|
2209
2213
|
environment: isDevMode() ? "local dev server" : "hosted deployment",
|
|
2214
|
+
now:
|
|
2215
|
+
record.asOf === undefined ? undefined : sessionClock(record.asOf)(),
|
|
2210
2216
|
});
|
|
2211
2217
|
turnPrompt = `${contextBlock}\n\n${prompt}`;
|
|
2212
2218
|
}
|
|
@@ -2727,6 +2733,7 @@ export class SessionEngine {
|
|
|
2727
2733
|
getSession: (channelId, sessionId) =>
|
|
2728
2734
|
this.getChannelSession(channelId, sessionId),
|
|
2729
2735
|
emit: args.emit,
|
|
2736
|
+
now: sessionClock(args.record.asOf),
|
|
2730
2737
|
};
|
|
2731
2738
|
try {
|
|
2732
2739
|
// Before the approval gate: a dry run is unattended, so parking a write
|
|
@@ -2744,6 +2751,8 @@ export class SessionEngine {
|
|
|
2744
2751
|
: {}),
|
|
2745
2752
|
dryRunResult: args.tool.definition.dryRunResult,
|
|
2746
2753
|
input: validation.value,
|
|
2754
|
+
asOf: args.record.asOf,
|
|
2755
|
+
timeArgs: args.tool.definition.timeArgs,
|
|
2747
2756
|
});
|
|
2748
2757
|
if (decision.kind === "answer") {
|
|
2749
2758
|
this.stubbedCallIds.get(args.record.sessionId)?.add(toolCallId);
|
|
@@ -2752,6 +2761,12 @@ export class SessionEngine {
|
|
|
2752
2761
|
);
|
|
2753
2762
|
return normalizeToolResult(decision.result);
|
|
2754
2763
|
}
|
|
2764
|
+
if (decision.kind === "unbounded") {
|
|
2765
|
+
this.logger(
|
|
2766
|
+
`[session] tool ${args.tool.name} refused, unbounded_time (${toolCallId})`
|
|
2767
|
+
);
|
|
2768
|
+
return toolErrorResult(decision.message);
|
|
2769
|
+
}
|
|
2755
2770
|
if (decision.kind === "refuse") {
|
|
2756
2771
|
this.logger(
|
|
2757
2772
|
`[session] tool ${args.tool.name} refused, effect unclassified (${toolCallId})`
|
|
@@ -3615,6 +3630,8 @@ export class SessionEngine {
|
|
|
3615
3630
|
: {}),
|
|
3616
3631
|
dryRunResult: tool.definition.dryRunResult,
|
|
3617
3632
|
input: validation.value,
|
|
3633
|
+
asOf: record?.asOf,
|
|
3634
|
+
timeArgs: tool.definition.timeArgs,
|
|
3618
3635
|
});
|
|
3619
3636
|
|
|
3620
3637
|
const started = Date.now();
|
|
@@ -3633,7 +3650,13 @@ export class SessionEngine {
|
|
|
3633
3650
|
}).catch(() => {});
|
|
3634
3651
|
};
|
|
3635
3652
|
try {
|
|
3636
|
-
if (decision.kind === "
|
|
3653
|
+
if (decision.kind === "unbounded") {
|
|
3654
|
+
this.logger(
|
|
3655
|
+
`[session] tool ${toolName} refused, unbounded_time (direct ${callId})`
|
|
3656
|
+
);
|
|
3657
|
+
result = normalizeToolResult(toolErrorResult(decision.message));
|
|
3658
|
+
isError = true;
|
|
3659
|
+
} else if (decision.kind === "refuse") {
|
|
3637
3660
|
this.logger(
|
|
3638
3661
|
`[session] tool ${toolName} refused, effect unclassified (direct ${callId})`
|
|
3639
3662
|
);
|
|
@@ -3676,6 +3699,7 @@ export class SessionEngine {
|
|
|
3676
3699
|
getSession: (channelId, sessionId) =>
|
|
3677
3700
|
this.getChannelSession(channelId, sessionId),
|
|
3678
3701
|
emit,
|
|
3702
|
+
now: sessionClock(record?.asOf),
|
|
3679
3703
|
});
|
|
3680
3704
|
result = normalizeToolResult(
|
|
3681
3705
|
record !== undefined && emit !== undefined
|
|
@@ -3787,6 +3811,12 @@ export class SessionEngine {
|
|
|
3787
3811
|
if (decision.kind === "run") {
|
|
3788
3812
|
return { answered: false };
|
|
3789
3813
|
}
|
|
3814
|
+
if (decision.kind === "unbounded") {
|
|
3815
|
+
this.logger(
|
|
3816
|
+
`[session] bridged tool ${args.toolName} refused, unbounded_time (${args.sessionId})`
|
|
3817
|
+
);
|
|
3818
|
+
return { answered: true, result: toolErrorResult(decision.message) };
|
|
3819
|
+
}
|
|
3790
3820
|
if (decision.kind === "refuse") {
|
|
3791
3821
|
this.logger(
|
|
3792
3822
|
`[session] bridged tool ${args.toolName} refused, effect unclassified (${args.sessionId})`
|
|
@@ -4562,6 +4592,7 @@ export class SessionEngine {
|
|
|
4562
4592
|
mode: record.mode,
|
|
4563
4593
|
purpose: record.purpose === "eval" ? "eval" : "live",
|
|
4564
4594
|
dryRun: record.dryRun === true ? true : undefined,
|
|
4595
|
+
asOf: record.asOf,
|
|
4565
4596
|
auth: record.auth,
|
|
4566
4597
|
continuationKey: record.continuationKey,
|
|
4567
4598
|
...(record.abs === undefined ? {} : { abs: record.abs }),
|