@cursor/july 0.1.112 → 0.1.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/bin/agent-serve.js +2 -3
- package/dist/channels/checks.d.ts +10 -0
- package/dist/channels/checks.d.ts.map +1 -1
- package/dist/channels/origin/checks.d.ts +1 -1
- package/dist/channels/origin/checks.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +6 -2
- package/dist/docs/404.html +2 -2
- package/dist/docs/assets/{app.DxTdhphC.js → app.CAeK13eM.js} +4 -4
- package/dist/docs/assets/chunks/@localSearchIndexroot.Ck9E52Ls.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.CR3KTF0X.js → VPLocalSearchBox.C9LbPHod.js} +1 -1
- package/dist/docs/assets/chunks/{arc.CVVqBOdS.js → arc.CmMq2zmS.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.CJHGP4ki.js → architectureDiagram-Q4EWVU46.CCXB8Uj5.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.r7UVVRBP.js → baseUniq.CyQo6eLe.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.DKmMaTre.js → blockDiagram-DXYQGD6D.JYq6w91N.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.DDJsntUO.js → c4Diagram-AHTNJAMY.BRV8GPJJ.js} +1 -1
- package/dist/docs/assets/chunks/channel.BHiYmnZ4.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.BK2rKt6W.js → chunk-4BX2VUAB.Bv4ooYQR.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.DRLV8RnF.js → chunk-4TB4RGXK.t4JtKPcj.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.DaKjxtb7.js → chunk-55IACEB6.34lCHj9Y.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.C5sPCIT1.js → chunk-EDXVE4YY.BSwrPNrt.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.CSGWyNTB.js → chunk-FMBD7UC4.Beeun-R-.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.D5tK9XEr.js → chunk-OYMX7WX6.BUUFUcJc.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.BeZGd1UZ.js → chunk-QZHKN3VN.B2XjHzN_.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.U_tfWwQR.js → chunk-YZCP3GAM.CLYG8znk.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.Degh8l90.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.Degh8l90.js +1 -0
- package/dist/docs/assets/chunks/clone.BIywbczV.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.DVeRXIb6.js → cose-bilkent-S5V4N54A.DVEa6fZp.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.BpKJAeRZ.js → dagre-KV5264BT.C9PZQK-S.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.BQOtrd1Z.js → diagram-5BDNPKRD.DoN0uv3Y.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.CSDAhjPI.js → diagram-G4DWMVQ6.Czv3duqx.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.Dpztst2S.js → diagram-MMDJMWI5.BinJ5kWb.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.qJHRizHR.js → diagram-TYMM5635.DW326M4K.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.vbDotH3l.js → erDiagram-SMLLAGMA.U2pR_OA7.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.CqS_ZQr4.js → flowDiagram-DWJPFMVM.ByWJXeYK.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.DTLdR4pN.js → ganttDiagram-T4ZO3ILL.OquF0Rtg.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.D04lnbnr.js → gitGraphDiagram-UUTBAWPF.Bpn01P7X.js} +1 -1
- package/dist/docs/assets/chunks/{graph.BlfqLJsM.js → graph.CNRB6ETL.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.tAooImWA.js → infoDiagram-42DDH7IO.CqhknMWi.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.ClUsVqnJ.js → ishikawaDiagram-UXIWVN3A.C6xpR2af.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.C3tUgyCg.js → journeyDiagram-VCZTEJTY.Cg5f7oB3.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.CtD9-QCe.js → kanban-definition-6JOO6SKY.Cx9YTwlU.js} +1 -1
- package/dist/docs/assets/chunks/{layout.D38U-LnT.js → layout.ljS-wFtK.js} +1 -1
- package/dist/docs/assets/chunks/{linear.BJmssyhN.js → linear.jSxNrsFC.js} +1 -1
- package/dist/docs/assets/chunks/{min.DNgXoouU.js → min.Cum8AlQw.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.Dcp6cxeu.js → mindmap-definition-QFDTVHPH.BLiysLpe.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.CLDw6zIs.js → pieDiagram-DEJITSTG.BoIDyuKF.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.CYaeeY4c.js → quadrantDiagram-34T5L4WZ.DLkpDytR.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.gMYuRpq2.js → requirementDiagram-MS252O5E.DqTVqSu2.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.CZqyHFbc.js → sankeyDiagram-XADWPNL6.CG_6FF7j.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.BTsCjUDN.js → sequenceDiagram-FGHM5R23.BIp9602K.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.CftT9mLJ.js → stateDiagram-FHFEXIEX.COSXsD9I.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.qrxrbFsX.js +1 -0
- package/dist/docs/assets/chunks/{theme.B_7J9ZsV.js → theme.CXJ7PNwy.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.DbU3WUNw.js → timeline-definition-GMOUNBTQ.CXdVqkLq.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.ixsq-q2u.js → vennDiagram-DHZGUBPP.CZxGuc4r.js} +1 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.3oVgfqQk.js +162 -0
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.C0ewvgbp.js → wardleyDiagram-NUSXRM2D.6_irCgGJ.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.nAEhF4bO.js → xychartDiagram-5P7HB3ND.TRPe92m3.js} +1 -1
- package/dist/docs/assets/{evals.md.BYvfZ-PO.js → evals.md.D3Y3Aixt.js} +2 -2
- package/dist/docs/assets/{evals.md.BYvfZ-PO.lean.js → evals.md.D3Y3Aixt.lean.js} +1 -1
- package/dist/docs/assets/guides_agent-to-agent.md.CD4T5FIl.js +41 -0
- package/dist/docs/assets/guides_agent-to-agent.md.CD4T5FIl.lean.js +1 -0
- package/dist/docs/assets/guides_jev.md.F5fAkkfN.js +189 -0
- package/dist/docs/assets/guides_jev.md.F5fAkkfN.lean.js +1 -0
- package/dist/docs/assets/{reference_connections.md.CmyrlXfY.js → reference_connections.md.Je9dMsdd.js} +1 -1
- package/dist/docs/assets/{reference_extensions.md.Ceq-qT8d.js → reference_extensions.md.Cv5aLCz_.js} +1 -1
- package/dist/docs/assets/{reference_subagents.md.BHsSMMyO.js → reference_subagents.md.Dl16gcBj.js} +2 -2
- package/dist/docs/assets/{reference_subagents.md.BHsSMMyO.lean.js → reference_subagents.md.Dl16gcBj.lean.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.BYzUTeVA.js → reference_tools.md.B1dH1lpa.js} +2 -2
- package/dist/docs/assets/{reference_tools.md.BYzUTeVA.lean.js → reference_tools.md.B1dH1lpa.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +35 -35
- package/dist/docs/deployment.html +36 -36
- package/dist/docs/evals.html +36 -36
- package/dist/docs/evals.md +3 -0
- package/dist/docs/guides/agent-to-agent.html +65 -54
- package/dist/docs/guides/agent-to-agent.md +73 -68
- package/dist/docs/guides/bitbucket.html +35 -35
- package/dist/docs/guides/cloud-agents.html +35 -35
- package/dist/docs/guides/convert-automation.html +35 -35
- package/dist/docs/guides/github.html +35 -35
- package/dist/docs/guides/gitlab.html +35 -35
- package/dist/docs/guides/grokbot-agents.html +35 -35
- package/dist/docs/guides/improve.html +36 -36
- package/dist/docs/guides/jev.html +248 -0
- package/dist/docs/guides/jev.md +348 -0
- package/dist/docs/guides/mcp-oauth.html +36 -36
- package/dist/docs/guides/opentelemetry.html +35 -35
- package/dist/docs/guides/slack.html +35 -35
- package/dist/docs/guides/webhooks.html +35 -35
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +35 -35
- package/dist/docs/index.html +35 -35
- package/dist/docs/llms-full.txt +434 -68
- package/dist/docs/llms.txt +2 -1
- package/dist/docs/quickstart.html +35 -35
- package/dist/docs/reference/agent-config.html +35 -35
- package/dist/docs/reference/artifacts.html +35 -35
- package/dist/docs/reference/channels.html +35 -35
- package/dist/docs/reference/cli.html +35 -35
- package/dist/docs/reference/connections.html +37 -37
- package/dist/docs/reference/connections.md +1 -1
- package/dist/docs/reference/evals.html +35 -35
- package/dist/docs/reference/extensions.html +37 -37
- package/dist/docs/reference/extensions.md +1 -0
- package/dist/docs/reference/hooks.html +35 -35
- package/dist/docs/reference/http-api.html +35 -35
- package/dist/docs/reference/instructions.html +35 -35
- package/dist/docs/reference/playground.html +35 -35
- package/dist/docs/reference/project-layout.html +35 -35
- package/dist/docs/reference/prompt.html +35 -35
- package/dist/docs/reference/schedules.html +35 -35
- package/dist/docs/reference/sessions.html +35 -35
- package/dist/docs/reference/skills.html +35 -35
- package/dist/docs/reference/subagents.html +37 -37
- package/dist/docs/reference/subagents.md +1 -1
- package/dist/docs/reference/tools.html +37 -37
- package/dist/docs/reference/tools.md +4 -0
- package/dist/docs/templates/agentic-owners.html +35 -35
- package/dist/docs/templates/pr-autofixer.html +35 -35
- package/dist/docs/templates/security-reviewer.html +35 -35
- package/dist/docs/templates/thermo-quality-review.html +35 -35
- package/dist/docs/templates/thermo-review.html +35 -35
- package/dist/docs/templates/triage.html +35 -35
- package/dist/docs/troubleshooting.html +35 -35
- package/dist/extensions/jev/extension.d.ts +43 -0
- package/dist/extensions/jev/extension.d.ts.map +1 -0
- package/dist/extensions/jev/extension.js +47 -0
- package/dist/extensions/jev/lib/evaluate.d.ts +101 -0
- package/dist/extensions/jev/lib/evaluate.d.ts.map +1 -0
- package/dist/extensions/jev/lib/evaluate.js +167 -0
- package/dist/extensions/jev/skills/gated-write.md +25 -0
- package/dist/extensions/jev/skills/questions.md +33 -0
- package/dist/extensions/jev/tools/evaluate.d.ts +4 -0
- package/dist/extensions/jev/tools/evaluate.d.ts.map +1 -0
- package/dist/extensions/jev/tools/evaluate.js +88 -0
- package/dist/extensions.d.ts +1 -1
- package/dist/extensions.d.ts.map +1 -1
- package/dist/extensions.js +2 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +6 -0
- package/dist/internal/discovery/connections.d.ts.map +1 -1
- package/dist/internal/discovery/connections.js +18 -0
- package/dist/internal/discovery/extensions.d.ts.map +1 -1
- package/dist/internal/discovery/extensions.js +8 -4
- package/dist/internal/discovery/info.d.ts.map +1 -1
- package/dist/internal/discovery/info.js +1 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +3 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +1 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +15 -25
- package/dist/internal/hosted-execution-diag.d.ts +12 -4
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
- package/dist/internal/hosted-execution-diag.js +26 -4
- package/dist/internal/hosted-execution-flush.d.ts +1 -0
- package/dist/internal/hosted-execution-flush.d.ts.map +1 -1
- package/dist/internal/hosted-execution-flush.js +4 -2
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +17 -9
- package/dist/internal/session-engine.d.ts +4 -1
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +28 -4
- package/dist/playground/assets/index-DSMAewbx.css +1 -0
- package/dist/playground/assets/{index-B1c1LeIf.js → index-De_lpFxE.js} +43 -43
- package/dist/playground/index.html +2 -2
- package/dist/types.d.ts +23 -3
- package/dist/types.d.ts.map +1 -1
- package/docs/evals.md +3 -0
- package/docs/guides/agent-to-agent.md +74 -69
- package/docs/guides/jev.md +353 -0
- package/docs/reference/connections.md +1 -1
- package/docs/reference/extensions.md +1 -0
- package/docs/reference/subagents.md +1 -1
- package/docs/reference/tools.md +4 -0
- package/package.json +8 -1
- package/src/bin/agent-serve.ts +2 -3
- package/src/channels/checks.ts +8 -0
- package/src/channels/origin/checks.ts +3 -1
- package/src/channels/slack/dispatch.ts +7 -2
- package/src/extensions/jev/extension.ts +95 -0
- package/src/extensions/jev/lib/evaluate.ts +289 -0
- package/src/extensions/jev/skills/gated-write.md +25 -0
- package/src/extensions/jev/skills/questions.md +33 -0
- package/src/extensions/jev/tools/evaluate.ts +90 -0
- package/src/extensions.ts +2 -0
- package/src/internal/advertise-tools.ts +6 -0
- package/src/internal/discovery/connections.ts +21 -0
- package/src/internal/discovery/extensions.ts +12 -4
- package/src/internal/discovery/info.ts +1 -0
- package/src/internal/hosted-delivery-protocol.ts +4 -0
- package/src/internal/hosted-delivery.ts +15 -0
- package/src/internal/hosted-execution-diag.ts +33 -4
- package/src/internal/hosted-execution-flush.ts +4 -0
- package/src/internal/server.ts +26 -12
- package/src/internal/session-engine.ts +30 -4
- package/src/types.ts +24 -3
- package/dist/docs/assets/chunks/@localSearchIndexroot.QmjDU6Jh.js +0 -1
- package/dist/docs/assets/chunks/channel.BjpoSbz_.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.BgxOlMHw.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.BgxOlMHw.js +0 -1
- package/dist/docs/assets/chunks/clone.DRuGBKZC.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.-43J68xB.js +0 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.WRXz-Dux.js +0 -162
- package/dist/docs/assets/guides_agent-to-agent.md.8oDTfu-E.js +0 -30
- package/dist/docs/assets/guides_agent-to-agent.md.8oDTfu-E.lean.js +0 -1
- package/dist/playground/assets/index-CK2LX3iD.css +0 -1
- /package/dist/docs/assets/{reference_connections.md.CmyrlXfY.lean.js → reference_connections.md.Je9dMsdd.lean.js} +0 -0
- /package/dist/docs/assets/{reference_extensions.md.Ceq-qT8d.lean.js → reference_extensions.md.Cv5aLCz_.lean.js} +0 -0
|
@@ -43,7 +43,8 @@ export type HostedExecutionDiagAbortReason =
|
|
|
43
43
|
/**
|
|
44
44
|
* Bounded guest-side record of one hosted-execution attempt. No prompt,
|
|
45
45
|
* tool content, or API key — the host copies known keys onto the Temporal
|
|
46
|
-
* activity span for Datadog.
|
|
46
|
+
* activity span for Datadog. `errorCode` and `message` are logged ungated;
|
|
47
|
+
* `stack` stays behind the internal-diag gate.
|
|
47
48
|
*/
|
|
48
49
|
export type HostedExecutionDiag = {
|
|
49
50
|
v: typeof HOSTED_EXECUTION_DIAG_VERSION;
|
|
@@ -62,6 +63,8 @@ export type HostedExecutionDiag = {
|
|
|
62
63
|
requestId?: string;
|
|
63
64
|
abortReason?: HostedExecutionDiagAbortReason;
|
|
64
65
|
failureCode?: string;
|
|
66
|
+
/** Runner/SDK code for the unfinished turn. Distinct from {@link failureCode}. */
|
|
67
|
+
errorCode?: string;
|
|
65
68
|
classification?: HostedFailureClassification;
|
|
66
69
|
};
|
|
67
70
|
|
|
@@ -82,6 +85,7 @@ const DIAG_KEYS = new Set([
|
|
|
82
85
|
"requestId",
|
|
83
86
|
"abortReason",
|
|
84
87
|
"failureCode",
|
|
88
|
+
"errorCode",
|
|
85
89
|
"classification",
|
|
86
90
|
]);
|
|
87
91
|
|
|
@@ -108,9 +112,9 @@ export const HOSTED_ERROR_STACK_LINE_COUNT = 5;
|
|
|
108
112
|
export const HOSTED_ERROR_SNIPPET_MAX_CHARS = 700;
|
|
109
113
|
|
|
110
114
|
/**
|
|
111
|
-
* Bounded throw text for
|
|
112
|
-
* Prefers `Error.stack` (message line + `at` frames)
|
|
113
|
-
*
|
|
115
|
+
* Bounded throw text for on-disk diag `stack` (and non-hosted 500 bodies).
|
|
116
|
+
* Prefers `Error.stack` (message line + `at` frames). Hosted HTTP `message`
|
|
117
|
+
* uses {@link hostedErrorMessageOnly} so customer Datadog stays frame-free.
|
|
114
118
|
*/
|
|
115
119
|
export function hostedErrorStackSnippet(error: unknown): string {
|
|
116
120
|
if (error instanceof Error) {
|
|
@@ -139,6 +143,29 @@ export function hostedErrorStackSnippet(error: unknown): string {
|
|
|
139
143
|
: text;
|
|
140
144
|
}
|
|
141
145
|
|
|
146
|
+
/**
|
|
147
|
+
* Guest throw text without `at` frames. Hosted 500 `message` is ungated on
|
|
148
|
+
* TAS (`hostedGuestMessage` / `last_error`); stack frames stay on `stack`.
|
|
149
|
+
*/
|
|
150
|
+
export function hostedErrorMessageOnly(error: unknown): string {
|
|
151
|
+
const text =
|
|
152
|
+
error instanceof Error && error.message.trim().length > 0
|
|
153
|
+
? error.message.trim()
|
|
154
|
+
: String(error).trim();
|
|
155
|
+
if (text.length === 0) {
|
|
156
|
+
return "Internal server error.";
|
|
157
|
+
}
|
|
158
|
+
const firstFrame = text.search(/\n\s+at\s/);
|
|
159
|
+
const message =
|
|
160
|
+
firstFrame === -1 ? text : text.slice(0, firstFrame).trimEnd();
|
|
161
|
+
if (message.length === 0) {
|
|
162
|
+
return "Internal server error.";
|
|
163
|
+
}
|
|
164
|
+
return message.length > HOSTED_ERROR_SNIPPET_MAX_CHARS
|
|
165
|
+
? `${message.slice(0, HOSTED_ERROR_SNIPPET_MAX_CHARS)}…`
|
|
166
|
+
: message;
|
|
167
|
+
}
|
|
168
|
+
|
|
142
169
|
export function hostedExecutionDiagPath(stateRoot: string): string {
|
|
143
170
|
return join(stateRoot, HOSTED_EXECUTION_DIAG_FILENAME);
|
|
144
171
|
}
|
|
@@ -206,6 +233,7 @@ export function parseHostedExecutionDiag(
|
|
|
206
233
|
);
|
|
207
234
|
const requestId = boundedOptionalString(body.requestId, 128);
|
|
208
235
|
const failureCode = boundedOptionalString(body.failureCode, 64);
|
|
236
|
+
const errorCode = boundedOptionalString(body.errorCode, 64);
|
|
209
237
|
const classification =
|
|
210
238
|
body.classification === undefined
|
|
211
239
|
? undefined
|
|
@@ -243,6 +271,7 @@ export function parseHostedExecutionDiag(
|
|
|
243
271
|
...(requestId === undefined ? {} : { requestId }),
|
|
244
272
|
...(abortReason === undefined ? {} : { abortReason }),
|
|
245
273
|
...(failureCode === undefined ? {} : { failureCode }),
|
|
274
|
+
...(errorCode === undefined ? {} : { errorCode }),
|
|
246
275
|
...(classification === undefined ? {} : { classification }),
|
|
247
276
|
};
|
|
248
277
|
}
|
|
@@ -48,6 +48,7 @@ export type HostedExecutionFlushFields = {
|
|
|
48
48
|
message?: string;
|
|
49
49
|
abortReason?: HostedExecutionDiagAbortReason;
|
|
50
50
|
failureCode?: string;
|
|
51
|
+
errorCode?: string;
|
|
51
52
|
classification?: HostedFailureClassification;
|
|
52
53
|
error?: unknown;
|
|
53
54
|
};
|
|
@@ -83,6 +84,9 @@ export async function flushHostedExecutionRecord(
|
|
|
83
84
|
? {}
|
|
84
85
|
: { abortReason: fields.abortReason }),
|
|
85
86
|
failureCode: fields.failureCode,
|
|
87
|
+
...(fields.errorCode === undefined
|
|
88
|
+
? {}
|
|
89
|
+
: { errorCode: fields.errorCode }),
|
|
86
90
|
classification: fields.classification,
|
|
87
91
|
});
|
|
88
92
|
}
|
package/src/internal/server.ts
CHANGED
|
@@ -137,7 +137,10 @@ import {
|
|
|
137
137
|
HOSTED_GUEST_RETRY_TERMINAL,
|
|
138
138
|
hostedGuestErrorResponse,
|
|
139
139
|
} from "./hosted-delivery-protocol.js";
|
|
140
|
-
import {
|
|
140
|
+
import {
|
|
141
|
+
hostedErrorMessageOnly,
|
|
142
|
+
hostedErrorStackSnippet,
|
|
143
|
+
} from "./hosted-execution-diag.js";
|
|
141
144
|
import { flushHostedExecutionProcessDeath } from "./hosted-execution-flush.js";
|
|
142
145
|
import {
|
|
143
146
|
buildHttpChannelRoutes,
|
|
@@ -1321,11 +1324,18 @@ export async function startServer(
|
|
|
1321
1324
|
);
|
|
1322
1325
|
}
|
|
1323
1326
|
} else {
|
|
1327
|
+
const resolveCloudToolsHeaders =
|
|
1328
|
+
options.cloudToolsUrl === undefined
|
|
1329
|
+
? undefined
|
|
1330
|
+
: (): Record<string, string> | undefined => {
|
|
1331
|
+
const apiKey = liveCursorApiKey();
|
|
1332
|
+
return apiKey === undefined
|
|
1333
|
+
? undefined
|
|
1334
|
+
: { authorization: `Bearer ${apiKey}` };
|
|
1335
|
+
};
|
|
1324
1336
|
const headers =
|
|
1325
1337
|
options.cloudToolsUrl !== undefined
|
|
1326
|
-
?
|
|
1327
|
-
? undefined
|
|
1328
|
-
: { authorization: `Bearer ${accountKey.apiKey}` }
|
|
1338
|
+
? resolveCloudToolsHeaders?.()
|
|
1329
1339
|
: options.authToken === undefined
|
|
1330
1340
|
? undefined
|
|
1331
1341
|
: { authorization: `Bearer ${options.authToken}` };
|
|
@@ -1336,14 +1346,17 @@ export async function startServer(
|
|
|
1336
1346
|
);
|
|
1337
1347
|
}
|
|
1338
1348
|
logger(
|
|
1339
|
-
`[agent-sdk] --cloud-tools-url: listening unsigned; Bearer
|
|
1349
|
+
`[agent-sdk] --cloud-tools-url: listening unsigned; Bearer resolves after task-time credential binding`
|
|
1340
1350
|
);
|
|
1341
1351
|
}
|
|
1342
|
-
runtime.engine.setCloudServerToolsConnection(
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1352
|
+
runtime.engine.setCloudServerToolsConnection(
|
|
1353
|
+
{
|
|
1354
|
+
type: "http",
|
|
1355
|
+
url: publicToolsUrl,
|
|
1356
|
+
...(headers === undefined ? {} : { headers }),
|
|
1357
|
+
},
|
|
1358
|
+
resolveCloudToolsHeaders
|
|
1359
|
+
);
|
|
1347
1360
|
}
|
|
1348
1361
|
}
|
|
1349
1362
|
}
|
|
@@ -3150,8 +3163,9 @@ async function handleRequest(
|
|
|
3150
3163
|
}`
|
|
3151
3164
|
);
|
|
3152
3165
|
const snippet = hostedErrorStackSnippet(error);
|
|
3153
|
-
const message =
|
|
3154
|
-
|
|
3166
|
+
const message = hostedDeliveryRequest
|
|
3167
|
+
? hostedErrorMessageOnly(error)
|
|
3168
|
+
: snippet.length > 0
|
|
3155
3169
|
? `Internal server error: ${snippet}`
|
|
3156
3170
|
: "Internal server error.";
|
|
3157
3171
|
response = hostedDeliveryRequest
|
|
@@ -591,6 +591,10 @@ export class SessionEngine {
|
|
|
591
591
|
private resolvedConnections: EngineResolvedConnection[] = [];
|
|
592
592
|
/** Direct server-tool HTTP MCP transport exposed only to cloud turns. */
|
|
593
593
|
private cloudServerToolsConnection: ConnectionTransport | undefined;
|
|
594
|
+
/** Re-resolved after hosted v2 task binding writes the Cursor credential. */
|
|
595
|
+
private cloudServerToolsHeaders:
|
|
596
|
+
| (() => Record<string, string> | undefined)
|
|
597
|
+
| undefined;
|
|
594
598
|
private readonly getCloudUsage: (
|
|
595
599
|
sdkAgentId: string
|
|
596
600
|
) => Promise<CloudAgentUsage | undefined>;
|
|
@@ -756,8 +760,30 @@ export class SessionEngine {
|
|
|
756
760
|
);
|
|
757
761
|
}
|
|
758
762
|
|
|
759
|
-
setCloudServerToolsConnection(
|
|
763
|
+
setCloudServerToolsConnection(
|
|
764
|
+
connection: ConnectionTransport,
|
|
765
|
+
resolveHeaders?: () => Record<string, string> | undefined
|
|
766
|
+
): void {
|
|
760
767
|
this.cloudServerToolsConnection = connection;
|
|
768
|
+
this.cloudServerToolsHeaders = resolveHeaders;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
private currentCloudServerToolsConnection(): ConnectionTransport | undefined {
|
|
772
|
+
const connection = this.cloudServerToolsConnection;
|
|
773
|
+
const resolveHeaders = this.cloudServerToolsHeaders;
|
|
774
|
+
if (
|
|
775
|
+
connection === undefined ||
|
|
776
|
+
!("url" in connection) ||
|
|
777
|
+
resolveHeaders === undefined
|
|
778
|
+
) {
|
|
779
|
+
return connection;
|
|
780
|
+
}
|
|
781
|
+
const { headers: _headers, ...withoutHeaders } = connection;
|
|
782
|
+
const headers = resolveHeaders();
|
|
783
|
+
return {
|
|
784
|
+
...withoutHeaders,
|
|
785
|
+
...(headers === undefined ? {} : { headers }),
|
|
786
|
+
};
|
|
761
787
|
}
|
|
762
788
|
|
|
763
789
|
setMcpOauthCallbackUrl(url: string): void {
|
|
@@ -3196,7 +3222,7 @@ export class SessionEngine {
|
|
|
3196
3222
|
sessionId: string,
|
|
3197
3223
|
connectionName: string
|
|
3198
3224
|
): ConnectionTransport | undefined {
|
|
3199
|
-
const connection = this.
|
|
3225
|
+
const connection = this.currentCloudServerToolsConnection();
|
|
3200
3226
|
if (connection === undefined || !("url" in connection)) {
|
|
3201
3227
|
return undefined;
|
|
3202
3228
|
}
|
|
@@ -3350,8 +3376,8 @@ export class SessionEngine {
|
|
|
3350
3376
|
`MCP connection name "${SERVER_TOOLS_MCP_SERVER_NAME}" is reserved for authored server tools on cloud turns.`
|
|
3351
3377
|
);
|
|
3352
3378
|
}
|
|
3353
|
-
const connection = this.
|
|
3354
|
-
if ("url" in connection) {
|
|
3379
|
+
const connection = this.currentCloudServerToolsConnection();
|
|
3380
|
+
if (connection !== undefined && "url" in connection) {
|
|
3355
3381
|
const url = new URL(connection.url);
|
|
3356
3382
|
url.searchParams.set("agentkitSessionId", sessionId);
|
|
3357
3383
|
servers[SERVER_TOOLS_MCP_SERVER_NAME] = {
|
package/src/types.ts
CHANGED
|
@@ -1147,6 +1147,16 @@ export interface ExtensionOptions<TConfig, TInput = TConfig> {
|
|
|
1147
1147
|
description?: string;
|
|
1148
1148
|
/** Mount configuration schema. A consumer's settings are validated at mount. */
|
|
1149
1149
|
config?: z.ZodType<TConfig, z.ZodTypeDef, TInput>;
|
|
1150
|
+
/** Choose which contribution groups this mount includes. */
|
|
1151
|
+
contributions?: (config: TConfig) => ExtensionContributionSelection;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
/** Contribution groups a configured extension mount may include or omit. */
|
|
1155
|
+
export interface ExtensionContributionSelection {
|
|
1156
|
+
/** Include tools from the extension tree. Defaults to true. */
|
|
1157
|
+
tools?: boolean;
|
|
1158
|
+
/** Include skills from the extension tree. Defaults to true. */
|
|
1159
|
+
skills?: boolean;
|
|
1150
1160
|
}
|
|
1151
1161
|
|
|
1152
1162
|
/**
|
|
@@ -1181,6 +1191,7 @@ export interface CursorPluginDeclaration extends ExtensionDeclaration {
|
|
|
1181
1191
|
export interface ExtensionMount extends BrandedDefinition<"extension"> {
|
|
1182
1192
|
readonly extension: ExtensionDeclaration | CursorPluginDeclaration;
|
|
1183
1193
|
readonly config: unknown;
|
|
1194
|
+
readonly contributions?: ExtensionContributionSelection;
|
|
1184
1195
|
}
|
|
1185
1196
|
|
|
1186
1197
|
/** `cursorPlugin({ ... })`: mount a Cursor plugin directory as an extension. */
|
|
@@ -1479,13 +1490,20 @@ export type ConnectionConfig = (
|
|
|
1479
1490
|
* Fail-closed: a `listTools` failure, an invalid tool name, or a name
|
|
1480
1491
|
* collision (with an authored tool or another advertised connection)
|
|
1481
1492
|
* fails the turn — a turn never silently runs with a shrunken toolset.
|
|
1482
|
-
*
|
|
1483
|
-
*
|
|
1484
|
-
*
|
|
1493
|
+
* Set {@link optional} to skip this connection instead of failing the
|
|
1494
|
+
* turn. Local runtime only, like all server tools: a `runtime: "cloud"`
|
|
1495
|
+
* agent fails discovery, and hybrid per-send cloud sessions refuse the
|
|
1496
|
+
* turn. The listing runs once per turn; point this at endpoints that can
|
|
1485
1497
|
* answer `tools/list` cheaply. Tools whose MCP `annotations.title` is
|
|
1486
1498
|
* `do-not-call` are omitted (vendor host-UI / MCP Apps helpers).
|
|
1487
1499
|
*/
|
|
1488
1500
|
advertiseTools?: boolean;
|
|
1501
|
+
/**
|
|
1502
|
+
* With {@link advertiseTools}, a `listTools` or `auth` failure skips this
|
|
1503
|
+
* connection (zero tools from it) instead of failing the turn. Other
|
|
1504
|
+
* advertised connections still fail closed. Requires `advertiseTools`.
|
|
1505
|
+
*/
|
|
1506
|
+
optional?: boolean;
|
|
1489
1507
|
/**
|
|
1490
1508
|
* Intended effects of tools this connection serves. When set, only
|
|
1491
1509
|
* tools whose classified effect is in this set are advertised — a
|
|
@@ -3246,6 +3264,8 @@ export interface DiscoveredConnection {
|
|
|
3246
3264
|
auth?: ConnectionAuthProvider;
|
|
3247
3265
|
/** Advertise-by-name from {@link ConnectionConfig.advertiseTools}. */
|
|
3248
3266
|
advertiseTools?: boolean;
|
|
3267
|
+
/** Skip a listing failure instead of failing the turn. */
|
|
3268
|
+
optional?: boolean;
|
|
3249
3269
|
/**
|
|
3250
3270
|
* Normalized intended effects from {@link ConnectionConfig.effects}.
|
|
3251
3271
|
* Absent means every listed tool is advertised.
|
|
@@ -3424,6 +3444,7 @@ export interface AgentProjectInfo {
|
|
|
3424
3444
|
name: string;
|
|
3425
3445
|
transport: string;
|
|
3426
3446
|
advertiseTools?: boolean;
|
|
3447
|
+
optional?: boolean;
|
|
3427
3448
|
effects?: readonly ToolEffect[];
|
|
3428
3449
|
tools?: readonly string[];
|
|
3429
3450
|
disallowedTools?: readonly string[];
|