@cursor/bdk 0.2.17 → 0.2.18
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/dist/bin/agent-serve.js +7 -0
- package/dist/channels/runs/index.d.ts +4 -0
- package/dist/channels/runs/index.d.ts.map +1 -0
- package/dist/channels/runs/index.js +2 -0
- package/dist/channels/runs/runs-channel.d.ts +5 -0
- package/dist/channels/runs/runs-channel.d.ts.map +1 -0
- package/dist/channels/runs/runs-channel.js +34 -0
- package/dist/channels/runs/types.d.ts +34 -0
- package/dist/channels/runs/types.d.ts.map +1 -0
- package/dist/channels/runs/types.js +1 -0
- package/dist/docs/404.html +2 -2
- package/dist/docs/assets/{app.CUNuFTSm.js → app.CJ-XZTK5.js} +4 -4
- package/dist/docs/assets/chunks/@localSearchIndexroot.ylB4B_Ud.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.Dez74k0W.js → VPLocalSearchBox.CpbYgURZ.js} +1 -1
- package/dist/docs/assets/chunks/{arc.CJ3FhK7H.js → arc.B081PemO.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.CfUdbHsa.js → architectureDiagram-Q4EWVU46.DPaT_hi-.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.D93LawU9.js → baseUniq.Buu61NLg.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.Zvsd6UHP.js → blockDiagram-DXYQGD6D.C6t63owh.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.CGX5xZ9d.js → c4Diagram-AHTNJAMY.BtKabdXR.js} +1 -1
- package/dist/docs/assets/chunks/channel.BgjgeSqp.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.CCIf0QCo.js → chunk-4BX2VUAB.DQpNaR8N.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.D_N1RPyi.js → chunk-4TB4RGXK.DrhL-6Rv.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.B1oecjzx.js → chunk-55IACEB6.DRLIBfNR.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.BzUNVPGX.js → chunk-EDXVE4YY.kuUuFkIg.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.DheI8WSO.js → chunk-FMBD7UC4.BlrVxprw.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.Bg4iL0sM.js → chunk-OYMX7WX6.CZCfYeQA.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.CSQjDhAD.js → chunk-QZHKN3VN.C7rwVEMV.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.BDdxnPU4.js → chunk-YZCP3GAM.CGseJtT_.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.CIVv63wE.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.CIVv63wE.js +1 -0
- package/dist/docs/assets/chunks/clone.HcW7h-70.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.AT0weO8r.js → cose-bilkent-S5V4N54A.BWlczAK4.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.CJ30TxV0.js → dagre-KV5264BT.Cw0tT0bB.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.KtE--1fW.js → diagram-5BDNPKRD.Cm96ah9V.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.BFGygSUQ.js → diagram-G4DWMVQ6.Cl0AoWYM.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.BLU-79eb.js → diagram-MMDJMWI5.Bp7mlzKs.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.CdjfJdVG.js → diagram-TYMM5635.ClVeqpcW.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.Dj1Iwypl.js → erDiagram-SMLLAGMA.Bi8dojF9.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.BXqj_Su2.js → flowDiagram-DWJPFMVM.Bb4urpfG.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.CNfgGSst.js → ganttDiagram-T4ZO3ILL.whR4wFze.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.2tgvFDBr.js → gitGraphDiagram-UUTBAWPF.6oVMi6-3.js} +1 -1
- package/dist/docs/assets/chunks/{graph.CWHZMxx6.js → graph.D8AJDOFK.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.DhLIK8m1.js → infoDiagram-42DDH7IO.nTpsf5Vk.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.BIN11n1G.js → ishikawaDiagram-UXIWVN3A.DhYDOwyB.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.BARmNJ0n.js → journeyDiagram-VCZTEJTY.Bg7Rudw3.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.BrTJYFyF.js → kanban-definition-6JOO6SKY.D80D_ZAR.js} +1 -1
- package/dist/docs/assets/chunks/{layout.CPZIIywK.js → layout.e9hmuC-K.js} +1 -1
- package/dist/docs/assets/chunks/{linear.DTpmzI5S.js → linear.D6hEyqVB.js} +1 -1
- package/dist/docs/assets/chunks/{min.BBLQmXwZ.js → min.BPAdvB9D.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.5qkWJvdl.js → mindmap-definition-QFDTVHPH.tm2Sov2Q.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.-4wufv_f.js → pieDiagram-DEJITSTG.BKHZ497m.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.C0jrp1-8.js → quadrantDiagram-34T5L4WZ.CPj7gSp6.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.DUDpANfe.js → requirementDiagram-MS252O5E._U68yVUd.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.74Lvg6Gu.js → sankeyDiagram-XADWPNL6._6jrIQPb.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.BHDIH286.js → sequenceDiagram-FGHM5R23.D9UlmB6F.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.Dr-HIuLb.js → stateDiagram-FHFEXIEX.BQSaiJCe.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.B5d7jT7E.js +1 -0
- package/dist/docs/assets/chunks/{theme.H8zSBhlM.js → theme.25ZC61Iy.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.GtyCaSiL.js → timeline-definition-GMOUNBTQ.d-17NZ3L.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.DLId0rxH.js → vennDiagram-DHZGUBPP.DE9AGEjG.js} +1 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.BcY0KddE.js +162 -0
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.CI6mGYNG.js → wardleyDiagram-NUSXRM2D.D9SDNipV.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.CG1n865F.js → xychartDiagram-5P7HB3ND.DM1sIMf8.js} +1 -1
- package/dist/docs/building-with-agents.html +35 -35
- package/dist/docs/deployment.html +35 -35
- package/dist/docs/evals.html +35 -35
- package/dist/docs/guides/agent-to-agent.html +35 -35
- 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/hooks.html +35 -35
- package/dist/docs/guides/improve.html +35 -35
- package/dist/docs/guides/jev.html +35 -35
- package/dist/docs/guides/mcp-oauth.html +35 -35
- package/dist/docs/guides/migrate.html +35 -35
- 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/hillclimbing.html +35 -35
- package/dist/docs/index.html +35 -35
- 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 +35 -35
- package/dist/docs/reference/evals.html +35 -35
- package/dist/docs/reference/extensions.html +35 -35
- 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 +35 -35
- package/dist/docs/reference/tools.html +35 -35
- package/dist/docs/templates/agentic-owners.html +35 -35
- package/dist/docs/templates/grokbot-agents.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/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +0 -14
- package/dist/internal/cloud-turn-cost.js +2 -2
- package/dist/internal/continuation-channel.d.ts.map +1 -1
- package/dist/internal/continuation-channel.js +6 -0
- package/dist/internal/continuation-identity.d.ts +6 -3
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +43 -0
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +20 -1
- package/dist/internal/http-control-plane-session.d.ts +5 -2
- package/dist/internal/http-control-plane-session.d.ts.map +1 -1
- package/dist/internal/http-control-plane-session.js +38 -2
- package/dist/internal/model-config.d.ts +7 -0
- package/dist/internal/model-config.d.ts.map +1 -0
- package/dist/internal/model-config.js +67 -0
- package/dist/internal/peer-connections.d.ts +17 -8
- package/dist/internal/peer-connections.d.ts.map +1 -1
- package/dist/internal/peer-connections.js +41 -10
- package/dist/internal/request-error-status.d.ts.map +1 -1
- package/dist/internal/request-error-status.js +4 -1
- package/dist/internal/resolved-connections.d.ts +4 -1
- package/dist/internal/resolved-connections.d.ts.map +1 -1
- package/dist/internal/resolved-connections.js +9 -4
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +11 -1
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +2 -1
- package/dist/internal/session-engine.d.ts +3 -1
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +74 -19
- package/dist/internal/storage-coordinator.d.ts +9 -9
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +116 -36
- package/dist/internal/testing/factory-resource-fixtures.d.ts +16 -0
- package/dist/internal/testing/factory-resource-fixtures.d.ts.map +1 -1
- package/dist/internal/testing/factory-resource-fixtures.js +14 -0
- package/dist/internal/turn-cost.d.ts +1 -1
- package/dist/internal/turn-cost.d.ts.map +1 -1
- package/dist/internal/turn-cost.js +8 -8
- package/dist/playground/assets/cursor-icons-16-DBmD_cqy.woff2 +0 -0
- package/dist/playground/assets/index-BDPd0Sec.css +1 -0
- package/dist/playground/assets/{index-U3TRnwAP.js → index-BrXDwbrN.js} +1 -1
- package/dist/playground/index.html +2 -2
- package/dist/types.d.ts +44 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -4
- package/dist/docs/assets/chunks/@localSearchIndexroot.3c56VHUt.js +0 -1
- package/dist/docs/assets/chunks/channel.S8-FFjmE.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.BB98tFjZ.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.BB98tFjZ.js +0 -1
- package/dist/docs/assets/chunks/clone.B98w8OEv.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.DW_lwpZY.js +0 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.CSlECTHi.js +0 -162
- package/dist/playground/assets/cursor-icons-16-4RnoYH3n.woff2 +0 -0
- package/dist/playground/assets/index-7fVUOA5l.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"continuation-identity.d.ts","sourceRoot":"","sources":["../../src/internal/continuation-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,MAAM,MAAM,gBAAgB,GACxB,IAAI,GACJ,OAAO,GACP,QAAQ,GACR,WAAW,GACX,WAAW,GACX,cAAc,GACd,YAAY,GACZ,2BAA2B,GAC3B,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"continuation-identity.d.ts","sourceRoot":"","sources":["../../src/internal/continuation-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,MAAM,MAAM,gBAAgB,GACxB,IAAI,GACJ,OAAO,GACP,QAAQ,GACR,WAAW,GACX,WAAW,GACX,cAAc,GACd,YAAY,GACZ,2BAA2B,GAC3B,eAAe,GACf,KAAK,CAAC;AAEV,MAAM,MAAM,gBAAgB,GACxB,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,aAAa,GACb,iBAAiB,GACjB,QAAQ,GACR,MAAM,GACN,MAAM,CAAC;AAEX,eAAO,MAAM,sBAAsB,YACjC,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB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C,EAAE,QAAQ,KAAK,OAAO,CAAC,QAAQ,CAAC,CAS5D"}
|
|
@@ -39,6 +39,7 @@ export const CONTINUATION_SELECTORS = [
|
|
|
39
39
|
"deployments.deployment/v2",
|
|
40
40
|
"change_monitors.checkpoint/v2",
|
|
41
41
|
"issues.issue/v2",
|
|
42
|
+
"runs.run/v2",
|
|
42
43
|
"none/v1",
|
|
43
44
|
"none/v2",
|
|
44
45
|
];
|
|
@@ -132,6 +133,12 @@ export const BUILTINS = [
|
|
|
132
133
|
events: ["issue.created"],
|
|
133
134
|
format: "issues:{issueName}",
|
|
134
135
|
},
|
|
136
|
+
{
|
|
137
|
+
type: "run",
|
|
138
|
+
kind: "runs",
|
|
139
|
+
events: ["run.created"],
|
|
140
|
+
format: "runs:{monitorId}:{runId}",
|
|
141
|
+
},
|
|
135
142
|
];
|
|
136
143
|
export class V2EngineError extends Error {
|
|
137
144
|
constructor(message) {
|
|
@@ -172,6 +179,11 @@ const SELECTOR_FIELDS = {
|
|
|
172
179
|
type: "factory-issue",
|
|
173
180
|
kind: "issues",
|
|
174
181
|
},
|
|
182
|
+
"runs.run/v2": {
|
|
183
|
+
version: 2,
|
|
184
|
+
type: "run",
|
|
185
|
+
kind: "runs",
|
|
186
|
+
},
|
|
175
187
|
"none/v1": { version: 1, type: "none", kind: "http" },
|
|
176
188
|
"none/v2": { version: 2, type: "none", kind: "http" },
|
|
177
189
|
};
|
|
@@ -210,6 +222,8 @@ export function defaultContinuationSelector(kind, version = "v1", eventTypes) {
|
|
|
210
222
|
return membershipOrNone(eventTypes, "change-monitor-checkpoint", "change_monitors.checkpoint/v2", "none/v2");
|
|
211
223
|
case "issues":
|
|
212
224
|
return membershipOrNone(eventTypes, "factory-issue", "issues.issue/v2", "none/v2");
|
|
225
|
+
case "runs":
|
|
226
|
+
return membershipOrNone(eventTypes, "run", "runs.run/v2", "none/v2");
|
|
213
227
|
default:
|
|
214
228
|
return "none/v2";
|
|
215
229
|
}
|
|
@@ -240,6 +254,7 @@ const OMITTED_V2_TYPED_TYPE = {
|
|
|
240
254
|
deployments: "deployment",
|
|
241
255
|
change_monitors: "change-monitor-checkpoint",
|
|
242
256
|
issues: "factory-issue",
|
|
257
|
+
runs: "run",
|
|
243
258
|
};
|
|
244
259
|
/** Typed membership used when an omitted `/v2` selector becomes type `none`. */
|
|
245
260
|
export function omittedV2TypedType(kind) {
|
|
@@ -325,6 +340,8 @@ function formatConversationKey(type, fields) {
|
|
|
325
340
|
return `change_monitors:${fields.checkpointName}`;
|
|
326
341
|
case "factory-issue":
|
|
327
342
|
return `issues:${fields.issueName}`;
|
|
343
|
+
case "run":
|
|
344
|
+
return `runs:${fields.monitorId}:${fields.runId}`;
|
|
328
345
|
}
|
|
329
346
|
}
|
|
330
347
|
export function mintClaim(claim) {
|
|
@@ -357,6 +374,13 @@ export function mintClaim(claim) {
|
|
|
357
374
|
}
|
|
358
375
|
return `cont:${formatConversationKey("factory-issue", resource)}`;
|
|
359
376
|
}
|
|
377
|
+
case "run": {
|
|
378
|
+
const resource = claim.resource;
|
|
379
|
+
if (!("monitorId" in resource && "runId" in resource)) {
|
|
380
|
+
throw new V2EngineError("v2: run claim requires monitorId and runId");
|
|
381
|
+
}
|
|
382
|
+
return `cont:${formatConversationKey("run", resource)}`;
|
|
383
|
+
}
|
|
360
384
|
case "pr":
|
|
361
385
|
case "issue":
|
|
362
386
|
case "origin-pr":
|
|
@@ -454,6 +478,8 @@ export function extractContinuation(type, eventName, payload) {
|
|
|
454
478
|
return extractNamedResource("change-monitor-checkpoint", "checkpointName", payload, "checkpoint");
|
|
455
479
|
case "factory-issue":
|
|
456
480
|
return extractNamedResource("factory-issue", "issueName", payload, "issue");
|
|
481
|
+
case "run":
|
|
482
|
+
return extractRun(payload);
|
|
457
483
|
}
|
|
458
484
|
}
|
|
459
485
|
/**
|
|
@@ -718,6 +744,23 @@ function bitbucketFullName(repository) {
|
|
|
718
744
|
}
|
|
719
745
|
return `${projectKey}/${slug}`.toLowerCase();
|
|
720
746
|
}
|
|
747
|
+
const RUN_NAME = /^changeMonitors\/([^/]+)\/runs\/([^/]+)$/;
|
|
748
|
+
function extractRun(payload) {
|
|
749
|
+
const record = asRecord(payload);
|
|
750
|
+
const run = asRecord(record?.run);
|
|
751
|
+
const name = nonEmpty(run?.name);
|
|
752
|
+
if (name === undefined) {
|
|
753
|
+
return undefined;
|
|
754
|
+
}
|
|
755
|
+
const match = RUN_NAME.exec(name);
|
|
756
|
+
if (match === null) {
|
|
757
|
+
return undefined;
|
|
758
|
+
}
|
|
759
|
+
return `cont:${formatConversationKey("run", {
|
|
760
|
+
monitorId: match[1],
|
|
761
|
+
runId: match[2],
|
|
762
|
+
})}`;
|
|
763
|
+
}
|
|
721
764
|
function extractNamedResource(type, field, payload, wrapper) {
|
|
722
765
|
const record = asRecord(payload);
|
|
723
766
|
const source = wrapper === undefined ? record : asRecord(record?.[wrapper]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-channel.d.ts","sourceRoot":"","sources":["../../src/internal/http-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAEV,WAAW,EACX,UAAU,EACV,qBAAqB,EACrB,aAAa,EACd,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"http-channel.d.ts","sourceRoot":"","sources":["../../src/internal/http-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAEV,WAAW,EACX,UAAU,EACV,qBAAqB,EACrB,aAAa,EACd,MAAM,aAAa,CAAC;AAMrB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,qBAAqB,CAAC;AAK7B,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,EAAE,qBAAqB,CAAC;IAC9B,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;OAGG;IACH,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC,GAAG,WAAW,EAAE,CAgehB;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,WAAW,GAAG,IAAI,EAC1B,OAAO,CAAC,EAAE;IACR,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,GACA,QAAQ,GAAG,SAAS,CAYtB;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,OAAO,EACb,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAO,GAC/D,QAAQ,CAQV;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,QAAQ,CAErF;AAkFD,8FAA8F;AAC9F,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,CAc9C"}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import { samePrincipal } from "./auth.js";
|
|
13
13
|
import { formatContinuationToken, parseContinuationToken } from "./ids.js";
|
|
14
14
|
import { isRecord } from "./is-record.js";
|
|
15
|
+
import { InvalidModelConfigError, modelConfigForDryRun } from "./model-config.js";
|
|
15
16
|
import { isLoopbackAddress } from "./net.js";
|
|
16
17
|
import { ApprovalInterruptedError, ApprovalNotFoundError, AuthInterruptedError, AuthNotFoundError, HTTP_CHANNEL_ID, SessionAuthError, } from "./session-engine.js";
|
|
17
18
|
import { eventsUrlForSession, playgroundUrlForSession } from "./session-urls.js";
|
|
@@ -40,6 +41,15 @@ export function buildHttpChannelRoutes(args) {
|
|
|
40
41
|
if (body.asOf !== undefined && typeof body.asOf !== "string") {
|
|
41
42
|
return errorResponse(400, "invalid_request", "`asOf` must be an ISO-8601 instant with a timezone when provided.");
|
|
42
43
|
}
|
|
44
|
+
let modelConfig;
|
|
45
|
+
try {
|
|
46
|
+
modelConfig = modelConfigForDryRun(body.modelConfig, body.dryRun === true ? true : undefined);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
if (!(error instanceof InvalidModelConfigError))
|
|
50
|
+
throw error;
|
|
51
|
+
return errorResponse(400, "invalid_request", error.message);
|
|
52
|
+
}
|
|
43
53
|
const message = await transformMessage(body.message, ctx.auth);
|
|
44
54
|
const workspaceFiles = readWorkspaceFiles(body.workspaceFiles);
|
|
45
55
|
// Per-session cloud attach (create only). Eval harness uses this to pin
|
|
@@ -51,6 +61,7 @@ export function buildHttpChannelRoutes(args) {
|
|
|
51
61
|
...(body.purpose === "eval" ? { purpose: "eval" } : {}),
|
|
52
62
|
...(body.dryRun === true ? { dryRun: true } : {}),
|
|
53
63
|
asOf: body.asOf,
|
|
64
|
+
modelConfig,
|
|
54
65
|
...(workspaceFiles === undefined ? {} : { workspaceFiles }),
|
|
55
66
|
...(cloud === undefined ? {} : { cloud }),
|
|
56
67
|
});
|
|
@@ -98,7 +109,15 @@ export function buildHttpChannelRoutes(args) {
|
|
|
98
109
|
return errorResponse(409, "stale_continuation_token", "The continuation token does not address this session's active continuation.");
|
|
99
110
|
}
|
|
100
111
|
const message = await transformMessage(body.message, ctx.auth);
|
|
101
|
-
|
|
112
|
+
let rotated;
|
|
113
|
+
try {
|
|
114
|
+
rotated = await engine.followUpHttp(sessionId, presented, message, body.modelConfig);
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
if (!(error instanceof InvalidModelConfigError))
|
|
118
|
+
throw error;
|
|
119
|
+
return errorResponse(400, "invalid_request", error.message);
|
|
120
|
+
}
|
|
102
121
|
if (rotated === undefined) {
|
|
103
122
|
return errorResponse(409, "stale_continuation_token", "The continuation token does not address this session's active continuation.");
|
|
104
123
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* `agent-sdk run --prod` reaches the authenticated CP start route, which
|
|
5
5
|
* delivers `agentsdk.session` to the built-in `http` channel of every v2
|
|
6
|
-
* agent. The wake is `send(message, { dryRun, asOf })`; the session id,
|
|
6
|
+
* agent. The wake is `send(message, { dryRun, asOf, modelConfig, instructions })`; the session id,
|
|
7
7
|
* when the caller resumed an explicit `ses_…`, arrives through the hosted
|
|
8
8
|
* execution (never through this payload), so authored code cannot pick
|
|
9
9
|
* one. {@link HttpChannelDefinition.onAdmit} runs against the mailbox
|
|
@@ -13,11 +13,14 @@
|
|
|
13
13
|
* hosted execution runs the case body there instead of a single turn. The
|
|
14
14
|
* case body writes every message, so it skips `onAdmit` and `onMessage`.
|
|
15
15
|
*/
|
|
16
|
-
import type { ChannelHandlerArgs, HttpChannelDefinition, SendMessageOptions } from "../types.js";
|
|
16
|
+
import type { ChannelHandlerArgs, HttpChannelDefinition, SendMessageOptions, SessionModelConfig } from "../types.js";
|
|
17
17
|
export type ControlPlaneSessionPayload = {
|
|
18
18
|
message: string;
|
|
19
19
|
dryRun?: boolean | undefined;
|
|
20
20
|
asOf?: string | undefined;
|
|
21
|
+
modelConfig?: SessionModelConfig | undefined;
|
|
22
|
+
/** Dry-run replacement for the agent's instructions.md. */
|
|
23
|
+
instructions?: string | undefined;
|
|
21
24
|
};
|
|
22
25
|
export type EvalCaseRef = {
|
|
23
26
|
runId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-control-plane-session.d.ts","sourceRoot":"","sources":["../../src/internal/http-control-plane-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"http-control-plane-session.d.ts","sourceRoot":"","sources":["../../src/internal/http-control-plane-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAWrB,MAAM,MAAM,0BAA0B,GAAG;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAC7C,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAe5D,8EAA8E;AAC9E,wBAAgB,UAAU,CAAC,OAAO,EAAE,kBAAkB,GAAG,WAAW,GAAG,SAAS,CAE/E;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,OAAO,GACf;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,0BAA0B,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CA0D/E;AAED,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,OAAO,GACf;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,WAAW,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAiBhE;AAeD,wBAAsB,+BAA+B,CAAC,KAAK,EAAE;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,kBAAkB,CAAC;IACzB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;CAC5C,GAAG,OAAO,CAAC,QAAQ,CAAC,CAgCpB;AAED,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,qBAAqB,GAAG,IAAI,CAavF"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* `agent-sdk run --prod` reaches the authenticated CP start route, which
|
|
5
5
|
* delivers `agentsdk.session` to the built-in `http` channel of every v2
|
|
6
|
-
* agent. The wake is `send(message, { dryRun, asOf })`; the session id,
|
|
6
|
+
* agent. The wake is `send(message, { dryRun, asOf, modelConfig, instructions })`; the session id,
|
|
7
7
|
* when the caller resumed an explicit `ses_…`, arrives through the hosted
|
|
8
8
|
* execution (never through this payload), so authored code cannot pick
|
|
9
9
|
* one. {@link HttpChannelDefinition.onAdmit} runs against the mailbox
|
|
@@ -17,9 +17,12 @@ import { skipped, turnStarted } from "./channel-dispatch.js";
|
|
|
17
17
|
import { attachHostedAdmissionAdapter } from "./hosted-admission-adapter.js";
|
|
18
18
|
import { AGENT_SDK_EVAL_CASE_EVENT_TYPE, AGENT_SDK_HTTP_CHANNEL_KIND, AGENT_SDK_SESSION_EVENT_TYPE, } from "./hosted-catch-protocol.js";
|
|
19
19
|
import { isRecord } from "./is-record.js";
|
|
20
|
-
|
|
20
|
+
import { InvalidModelConfigError, modelConfigForDryRun } from "./model-config.js";
|
|
21
|
+
const PAYLOAD_KEYS = new Set(["message", "dryRun", "asOf", "modelConfig", "instructions"]);
|
|
21
22
|
const EVAL_CASE_PAYLOAD_KEYS = new Set(["runId", "caseId"]);
|
|
22
23
|
const MAX_MESSAGE_CHARS = 64 * 1024;
|
|
24
|
+
const MAX_INSTRUCTIONS_CHARS = 256 * 1024;
|
|
25
|
+
const INSTRUCTIONS_REQUIRE_DRY_RUN = "invalid argument: instructions is only allowed when dryRun is true";
|
|
23
26
|
const MAX_EVAL_ID_CHARS = 512;
|
|
24
27
|
/** Symbol-keyed so authored channels cannot forge an eval-case send. */
|
|
25
28
|
const EVAL_CASE = Symbol("agentsdk.eval-case");
|
|
@@ -45,12 +48,41 @@ export function parseControlPlaneSessionPayload(payload) {
|
|
|
45
48
|
(typeof payload.asOf !== "string" || payload.asOf.trim().length === 0)) {
|
|
46
49
|
return { ok: false, error: "payload.asOf must be a non-empty string" };
|
|
47
50
|
}
|
|
51
|
+
let modelConfig;
|
|
52
|
+
if (payload.modelConfig !== undefined) {
|
|
53
|
+
try {
|
|
54
|
+
modelConfig = modelConfigForDryRun(payload.modelConfig, payload.dryRun === true ? true : undefined);
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
if (!(error instanceof InvalidModelConfigError))
|
|
58
|
+
throw error;
|
|
59
|
+
return { ok: false, error: error.message };
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
let instructions;
|
|
63
|
+
if (payload.instructions !== undefined) {
|
|
64
|
+
if (typeof payload.instructions !== "string") {
|
|
65
|
+
return { ok: false, error: "payload.instructions must be a string" };
|
|
66
|
+
}
|
|
67
|
+
instructions = payload.instructions.trim();
|
|
68
|
+
if (instructions.length === 0) {
|
|
69
|
+
return { ok: false, error: "payload.instructions must be a non-empty string" };
|
|
70
|
+
}
|
|
71
|
+
if (instructions.length > MAX_INSTRUCTIONS_CHARS) {
|
|
72
|
+
return { ok: false, error: "payload.instructions is too long" };
|
|
73
|
+
}
|
|
74
|
+
if (payload.dryRun !== true) {
|
|
75
|
+
return { ok: false, error: INSTRUCTIONS_REQUIRE_DRY_RUN };
|
|
76
|
+
}
|
|
77
|
+
}
|
|
48
78
|
return {
|
|
49
79
|
ok: true,
|
|
50
80
|
data: {
|
|
51
81
|
message,
|
|
52
82
|
dryRun: payload.dryRun === true ? true : undefined,
|
|
53
83
|
asOf: typeof payload.asOf === "string" ? payload.asOf.trim() : undefined,
|
|
84
|
+
modelConfig,
|
|
85
|
+
instructions,
|
|
54
86
|
},
|
|
55
87
|
};
|
|
56
88
|
}
|
|
@@ -102,6 +134,8 @@ export async function dispatchHttpControlPlaneSession(input) {
|
|
|
102
134
|
sessionKey: input.mailboxContinuationKey,
|
|
103
135
|
dryRun: parsed.data.dryRun,
|
|
104
136
|
asOf: parsed.data.asOf,
|
|
137
|
+
modelConfig: parsed.data.modelConfig,
|
|
138
|
+
instructions: parsed.data.instructions,
|
|
105
139
|
host: input.args.host,
|
|
106
140
|
});
|
|
107
141
|
}
|
|
@@ -109,6 +143,8 @@ export async function dispatchHttpControlPlaneSession(input) {
|
|
|
109
143
|
const session = await input.args.send(message, {
|
|
110
144
|
dryRun: parsed.data.dryRun,
|
|
111
145
|
asOf: parsed.data.asOf,
|
|
146
|
+
modelConfig: parsed.data.modelConfig,
|
|
147
|
+
instructions: parsed.data.instructions,
|
|
112
148
|
});
|
|
113
149
|
return turnStarted(session);
|
|
114
150
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SessionModelConfig } from "../types.js";
|
|
2
|
+
export declare const MODEL_CONFIG_REQUIRES_DRY_RUN = "invalid argument: modelConfig requires dryRun";
|
|
3
|
+
export declare class InvalidModelConfigError extends Error {
|
|
4
|
+
constructor(message: string);
|
|
5
|
+
}
|
|
6
|
+
export declare function modelConfigForDryRun(modelConfig: unknown, dryRun: boolean | undefined): SessionModelConfig | undefined;
|
|
7
|
+
//# sourceMappingURL=model-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-config.d.ts","sourceRoot":"","sources":["../../src/internal/model-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAKtD,eAAO,MAAM,6BAA6B,kDAAkD,CAAC;AAE7F,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAyCD,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,OAAO,EACpB,MAAM,EAAE,OAAO,GAAG,SAAS,GAC1B,kBAAkB,GAAG,SAAS,CAehC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { isRecord } from "./is-record.js";
|
|
2
|
+
const MODEL_ID = /^[a-z0-9][a-z0-9.-]{0,127}$/;
|
|
3
|
+
const LEVELS = new Set(["low", "medium", "high", "xhigh"]);
|
|
4
|
+
export const MODEL_CONFIG_REQUIRES_DRY_RUN = "invalid argument: modelConfig requires dryRun";
|
|
5
|
+
export class InvalidModelConfigError extends Error {
|
|
6
|
+
constructor(message) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.name = "InvalidModelConfigError";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function invalid(message) {
|
|
12
|
+
throw new InvalidModelConfigError(message);
|
|
13
|
+
}
|
|
14
|
+
function setting(value, where) {
|
|
15
|
+
if (!isRecord(value))
|
|
16
|
+
invalid(`invalid argument: ${where}.id is not a model id`);
|
|
17
|
+
const id = value.id;
|
|
18
|
+
if (typeof id !== "string" || !MODEL_ID.test(id)) {
|
|
19
|
+
invalid(`invalid argument: ${where}.id is not a model id`);
|
|
20
|
+
}
|
|
21
|
+
const rawParams = value.params;
|
|
22
|
+
if (!Array.isArray(rawParams))
|
|
23
|
+
invalid(`invalid argument: ${where} requires params`);
|
|
24
|
+
const effortId = id.includes("gpt") ? "reasoning" : "effort";
|
|
25
|
+
const params = [];
|
|
26
|
+
const seen = new Set();
|
|
27
|
+
for (const param of rawParams) {
|
|
28
|
+
if (!isRecord(param))
|
|
29
|
+
invalid(`invalid argument: ${where} param "" is not allowed`);
|
|
30
|
+
const paramId = typeof param.id === "string" ? param.id : "";
|
|
31
|
+
const paramValue = typeof param.value === "string" ? param.value : "";
|
|
32
|
+
if (paramId === "" ||
|
|
33
|
+
paramValue === "" ||
|
|
34
|
+
(paramId !== effortId && paramId !== "fast") ||
|
|
35
|
+
seen.has(paramId)) {
|
|
36
|
+
invalid(`invalid argument: ${where} param ${JSON.stringify(paramId)} is not allowed`);
|
|
37
|
+
}
|
|
38
|
+
const valueOk = paramId === "fast" ? paramValue === "true" || paramValue === "false" : LEVELS.has(paramValue);
|
|
39
|
+
if (!valueOk)
|
|
40
|
+
invalid(`invalid argument: ${where} param ${JSON.stringify(paramId)} bad value`);
|
|
41
|
+
seen.add(paramId);
|
|
42
|
+
params.push({ id: paramId, value: paramValue });
|
|
43
|
+
}
|
|
44
|
+
if (!seen.has(effortId) || !seen.has("fast")) {
|
|
45
|
+
invalid(`invalid argument: ${where} requires params ${effortId} and fast`);
|
|
46
|
+
}
|
|
47
|
+
return { id, params };
|
|
48
|
+
}
|
|
49
|
+
export function modelConfigForDryRun(modelConfig, dryRun) {
|
|
50
|
+
if (modelConfig === undefined)
|
|
51
|
+
return undefined;
|
|
52
|
+
if (dryRun !== true)
|
|
53
|
+
invalid(MODEL_CONFIG_REQUIRES_DRY_RUN);
|
|
54
|
+
if (!isRecord(modelConfig)) {
|
|
55
|
+
invalid("invalid argument: modelConfig must be { model, fallbacks? }");
|
|
56
|
+
}
|
|
57
|
+
const model = setting(modelConfig.model, "modelConfig.model");
|
|
58
|
+
const fallbacks = modelConfig.fallbacks;
|
|
59
|
+
if (fallbacks === undefined)
|
|
60
|
+
return { model, fallbacks: [] };
|
|
61
|
+
if (!Array.isArray(fallbacks))
|
|
62
|
+
invalid("invalid argument: modelConfig.fallbacks must be an array");
|
|
63
|
+
return {
|
|
64
|
+
model,
|
|
65
|
+
fallbacks: fallbacks.map((item, i) => setting(item, `modelConfig.fallbacks[${i}]`)),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
* server URL. Cloud-runtime turns run on a VM that cannot reach loopback,
|
|
10
10
|
* so they use the serve `publicUrl` when configured — and omit the peer
|
|
11
11
|
* (with a startup warning) when it is not.
|
|
12
|
+
*
|
|
13
|
+
* A single-agent serve has no peers mounted beside it. Given a peers URL,
|
|
14
|
+
* it resolves every peer there for both runtimes instead of omitting them.
|
|
12
15
|
*/
|
|
13
16
|
import { type AgentProject } from "../types.js";
|
|
14
17
|
import type { EngineResolvedConnection } from "./session-engine.js";
|
|
@@ -21,23 +24,19 @@ export interface PeerConnectionRef {
|
|
|
21
24
|
}
|
|
22
25
|
/** Every peer connection an agent declares, host connections included. */
|
|
23
26
|
export declare function peerConnectionRefs(project: AgentProject): PeerConnectionRef[];
|
|
24
|
-
/**
|
|
25
|
-
* Deploy slugs of every peer an agent declares, deduped and sorted.
|
|
26
|
-
* `bdk deploy` lowercases directory names into slugs, so
|
|
27
|
-
* `{ agent: "Builder" }` names the `builder` deployment.
|
|
28
|
-
*/
|
|
27
|
+
/** Deploy slugs of every peer an agent declares, deduped and sorted. */
|
|
29
28
|
export declare function peerDeploySlugs(project: AgentProject): string[];
|
|
30
29
|
/**
|
|
31
30
|
* Validate every peer MCP connection across `mounts` and return them grouped by
|
|
32
31
|
* the referencing mount's slug. Throws on references to unknown slugs and on
|
|
33
32
|
* self-references (an agent asking itself recurses forever). A single-mode
|
|
34
|
-
* serve
|
|
35
|
-
* omitted with a warning instead of failing boot.
|
|
33
|
+
* serve mounts no other agents: with a `peersUrl` its peers resolve there,
|
|
34
|
+
* and without one they are omitted with a warning instead of failing boot.
|
|
36
35
|
*/
|
|
37
36
|
export declare function collectPeerConnections(mounts: Array<{
|
|
38
37
|
slug: string;
|
|
39
38
|
project: AgentProject;
|
|
40
|
-
}>, logger: (line: string) => void): Map<string, PeerConnectionRef[]>;
|
|
39
|
+
}>, logger: (line: string) => void, peersUrl?: string): Map<string, PeerConnectionRef[]>;
|
|
41
40
|
/**
|
|
42
41
|
* Resolve validated peer refs to concrete MCP URLs once the server is
|
|
43
42
|
* listening. `serverUrl` is the loopback base (`http://127.0.0.1:<port>`);
|
|
@@ -51,4 +50,14 @@ export declare function resolvePeerConnections(args: {
|
|
|
51
50
|
publicUrl?: string;
|
|
52
51
|
authToken?: string;
|
|
53
52
|
}): EngineResolvedConnection[];
|
|
53
|
+
/**
|
|
54
|
+
* Resolve a single-agent serve's peers against a host that serves each agent
|
|
55
|
+
* at `<peersUrl>/<slug>/v1/mcp`. Local and cloud turns share the URL. The
|
|
56
|
+
* bearer is the Cursor API key bound to this host, expanded each time a
|
|
57
|
+
* client opens, so a key bound after listen still authenticates.
|
|
58
|
+
*/
|
|
59
|
+
export declare function resolveHostedPeerConnections(args: {
|
|
60
|
+
refs: PeerConnectionRef[];
|
|
61
|
+
peersUrl: string;
|
|
62
|
+
}): EngineResolvedConnection[];
|
|
54
63
|
//# sourceMappingURL=peer-connections.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peer-connections.d.ts","sourceRoot":"","sources":["../../src/internal/peer-connections.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"peer-connections.d.ts","sourceRoot":"","sources":["../../src/internal/peer-connections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,YAAY,EAA6B,MAAM,aAAa,CAAC;AAE3E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAEpE,2EAA2E;AAC3E,MAAM,WAAW,iBAAiB;IAChC,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,iBAAiB,EAAE,CAK7E;AAUD,wEAAwE;AACxE,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,EAAE,CAG/D;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC,EACtD,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAC9B,QAAQ,CAAC,EAAE,MAAM,GAChB,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAyClC;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,IAAI,EAAE,iBAAiB,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,wBAAwB,EAAE,CAa7B;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE;IACjD,IAAI,EAAE,iBAAiB,EAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,wBAAwB,EAAE,CAW7B"}
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
* server URL. Cloud-runtime turns run on a VM that cannot reach loopback,
|
|
10
10
|
* so they use the serve `publicUrl` when configured — and omit the peer
|
|
11
11
|
* (with a startup warning) when it is not.
|
|
12
|
+
*
|
|
13
|
+
* A single-agent serve has no peers mounted beside it. Given a peers URL,
|
|
14
|
+
* it resolves every peer there for both runtimes instead of omitting them.
|
|
12
15
|
*/
|
|
13
16
|
import { isPeerConnectionTransport } from "../types.js";
|
|
14
17
|
import { MCP_ENDPOINT_PATH } from "./mcp-endpoint.js";
|
|
@@ -17,30 +20,40 @@ export function peerConnectionRefs(project) {
|
|
|
17
20
|
return [...project.agent.connections, ...(project.agent.hostConnections ?? [])].flatMap(({ name, transport }) => isPeerConnectionTransport(transport) ? [{ name, targetSlug: transport.agent }] : []);
|
|
18
21
|
}
|
|
19
22
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* `{ agent: "Builder" }` names the `builder` deployment.
|
|
23
|
+
* The slug a deployed peer answers to. `bdk deploy` lowercases directory
|
|
24
|
+
* names into slugs, so `{ agent: "Builder" }` names the `builder` deployment.
|
|
23
25
|
*/
|
|
26
|
+
function peerDeploySlug(targetSlug) {
|
|
27
|
+
return targetSlug.toLowerCase();
|
|
28
|
+
}
|
|
29
|
+
/** Deploy slugs of every peer an agent declares, deduped and sorted. */
|
|
24
30
|
export function peerDeploySlugs(project) {
|
|
25
|
-
const slugs = peerConnectionRefs(project).map(({ targetSlug }) => targetSlug
|
|
31
|
+
const slugs = peerConnectionRefs(project).map(({ targetSlug }) => peerDeploySlug(targetSlug));
|
|
26
32
|
return [...new Set(slugs)].sort();
|
|
27
33
|
}
|
|
28
34
|
/**
|
|
29
35
|
* Validate every peer MCP connection across `mounts` and return them grouped by
|
|
30
36
|
* the referencing mount's slug. Throws on references to unknown slugs and on
|
|
31
37
|
* self-references (an agent asking itself recurses forever). A single-mode
|
|
32
|
-
* serve
|
|
33
|
-
* omitted with a warning instead of failing boot.
|
|
38
|
+
* serve mounts no other agents: with a `peersUrl` its peers resolve there,
|
|
39
|
+
* and without one they are omitted with a warning instead of failing boot.
|
|
34
40
|
*/
|
|
35
|
-
export function collectPeerConnections(mounts, logger) {
|
|
41
|
+
export function collectPeerConnections(mounts, logger, peersUrl) {
|
|
36
42
|
const [solo] = mounts;
|
|
37
43
|
if (mounts.length === 1 && solo?.slug === "") {
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
|
|
44
|
+
const refs = peerConnectionRefs(solo.project);
|
|
45
|
+
if (refs.length === 0) {
|
|
46
|
+
return new Map();
|
|
41
47
|
}
|
|
48
|
+
if (peersUrl !== undefined) {
|
|
49
|
+
return new Map([["", refs]]);
|
|
50
|
+
}
|
|
51
|
+
logger(`[bdk] warning: agent "${solo.project.name}" has peer MCP connections (${refs.map(({ name }) => name).join(", ")}) but --mode single mounts no other agents, so they are omitted; peers resolve only in multi-agent serve.`);
|
|
42
52
|
return new Map();
|
|
43
53
|
}
|
|
54
|
+
if (peersUrl !== undefined) {
|
|
55
|
+
throw new Error("--peers-url resolves the peers of a single-agent serve (--mode single); a multi-agent serve resolves them among its mounted agents.");
|
|
56
|
+
}
|
|
44
57
|
const knownSlugs = new Set(mounts.map(({ slug }) => slug));
|
|
45
58
|
const bySlug = new Map();
|
|
46
59
|
for (const { slug, project } of mounts) {
|
|
@@ -79,6 +92,24 @@ export function resolvePeerConnections(args) {
|
|
|
79
92
|
...(headers === undefined ? {} : { headers }),
|
|
80
93
|
}));
|
|
81
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Resolve a single-agent serve's peers against a host that serves each agent
|
|
97
|
+
* at `<peersUrl>/<slug>/v1/mcp`. Local and cloud turns share the URL. The
|
|
98
|
+
* bearer is the Cursor API key bound to this host, expanded each time a
|
|
99
|
+
* client opens, so a key bound after listen still authenticates.
|
|
100
|
+
*/
|
|
101
|
+
export function resolveHostedPeerConnections(args) {
|
|
102
|
+
const base = trimTrailingSlash(args.peersUrl);
|
|
103
|
+
return args.refs.map((ref) => {
|
|
104
|
+
const url = `${base}/${peerDeploySlug(ref.targetSlug)}${MCP_ENDPOINT_PATH}`;
|
|
105
|
+
return {
|
|
106
|
+
name: ref.name,
|
|
107
|
+
localUrl: url,
|
|
108
|
+
cloudUrl: url,
|
|
109
|
+
headers: { authorization: "Bearer ${CURSOR_API_KEY}" },
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
}
|
|
82
113
|
function trimTrailingSlash(url) {
|
|
83
114
|
return url.endsWith("/") ? url.slice(0, -1) : url;
|
|
84
115
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-error-status.d.ts","sourceRoot":"","sources":["../../src/internal/request-error-status.ts"],"names":[],"mappings":"AAUA,OAAO,EAGL,KAAK,2BAA2B,EACjC,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"request-error-status.d.ts","sourceRoot":"","sources":["../../src/internal/request-error-status.ts"],"names":[],"mappings":"AAUA,OAAO,EAGL,KAAK,2BAA2B,EACjC,MAAM,+BAA+B,CAAC;AAIvC,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,2BAA2B,CAAC;CACpC;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS,CAkEpF;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAElE"}
|
|
@@ -3,6 +3,7 @@ import { InvalidAsOfError, VacuousTimeArgsError } from "./as-of.js";
|
|
|
3
3
|
import { V2EngineError } from "./continuation-identity.js";
|
|
4
4
|
import { GUEST_CONNECT_STALLED, GUEST_NETWORK_UNAVAILABLE, GuestNetworkUnavailableError, hasGuestNetworkErrno, isQuietGuestConnectStall, } from "./guest-network.js";
|
|
5
5
|
import { HOSTED_GUEST_RETRY_TERMINAL, HOSTED_GUEST_RETRY_TRANSIENT, } from "./hosted-delivery-protocol.js";
|
|
6
|
+
import { InvalidModelConfigError } from "./model-config.js";
|
|
6
7
|
import { SessionAuthError, SessionBusyError } from "./session-engine.js";
|
|
7
8
|
/**
|
|
8
9
|
* Expected throw → HTTP mapping used by `handleRequest` and hosted flush.
|
|
@@ -41,7 +42,9 @@ export function mapThrownRequestError(error) {
|
|
|
41
42
|
retry: HOSTED_GUEST_RETRY_TERMINAL,
|
|
42
43
|
};
|
|
43
44
|
}
|
|
44
|
-
if (error instanceof InvalidAsOfError ||
|
|
45
|
+
if (error instanceof InvalidAsOfError ||
|
|
46
|
+
error instanceof VacuousTimeArgsError ||
|
|
47
|
+
error instanceof InvalidModelConfigError) {
|
|
45
48
|
return {
|
|
46
49
|
status: 400,
|
|
47
50
|
code: "invalid_request",
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* account bridge — resolve to concrete URLs and join the engine's
|
|
5
5
|
* resolved-connection set. Local turns call both over loopback; cloud
|
|
6
6
|
* turns use the serve `publicUrl` for peers and the account's native
|
|
7
|
-
* connectors instead of the bridge.
|
|
7
|
+
* connectors instead of the bridge. A single-agent serve with a peers URL
|
|
8
|
+
* reaches its peers there from both runtimes.
|
|
8
9
|
*/
|
|
9
10
|
import { type AgentProject } from "../types.js";
|
|
10
11
|
import { type CursorAccountConnectionRef, type CursorAccountMcpBridge } from "./cursor/account-mcp.js";
|
|
@@ -55,6 +56,8 @@ export declare function resolveMountConnections(args: {
|
|
|
55
56
|
accountBridge?: CursorAccountMcpBridge;
|
|
56
57
|
publicUrl?: string;
|
|
57
58
|
authToken?: string;
|
|
59
|
+
/** Resolves `peerRefs` on another host; see `resolveHostedPeerConnections`. */
|
|
60
|
+
peersUrl?: string;
|
|
58
61
|
/** See {@link validateMountConnectionsConfig}. */
|
|
59
62
|
cloudToolsBridge?: boolean;
|
|
60
63
|
logger: (line: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolved-connections.d.ts","sourceRoot":"","sources":["../../src/internal/resolved-connections.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"resolved-connections.d.ts","sourceRoot":"","sources":["../../src/internal/resolved-connections.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAkC,MAAM,aAAa,CAAC;AAChF,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAE5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,KAAK,iBAAiB,EAGvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAEpE,+EAA+E;AAC/E,wBAAgB,8BAA8B,CAAC,IAAI,EAAE;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,YAAY,CAAC;IACtB,WAAW,CAAC,EAAE,0BAA0B,EAAE,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,GAAG,IAAI,CA0BP;AAED,qEAAqE;AACrE,wBAAgB,wCAAwC,CAAC,IAAI,EAAE;IAC7D,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;IAC3B,mBAAmB,EAAE,SAAS,wBAAwB,EAAE,CAAC;IACzD;;;;OAIG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACpC,GAAG,IAAI,CAoBP;AAED,iFAAiF;AACjF,wBAAgB,oCAAoC,CAAC,IAAI,EAAE;IACzD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;OAIG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;IACzC,qBAAqB,EAAE,OAAO,CAAC;CAChC,GAAG,IAAI,CAUP;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,YAAY,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC/B,WAAW,CAAC,EAAE,0BAA0B,EAAE,CAAC;IAC3C,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,GAAG,wBAAwB,EAAE,CAmE7B"}
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
* account bridge — resolve to concrete URLs and join the engine's
|
|
5
5
|
* resolved-connection set. Local turns call both over loopback; cloud
|
|
6
6
|
* turns use the serve `publicUrl` for peers and the account's native
|
|
7
|
-
* connectors instead of the bridge.
|
|
7
|
+
* connectors instead of the bridge. A single-agent serve with a peers URL
|
|
8
|
+
* reaches its peers there from both runtimes.
|
|
8
9
|
*/
|
|
9
10
|
import { isHostOauthConnectionTransport } from "../types.js";
|
|
10
11
|
import { resolveCursorAccountConnections, } from "./cursor/account-mcp.js";
|
|
11
|
-
import { resolvePeerConnections } from "./peer-connections.js";
|
|
12
|
+
import { resolveHostedPeerConnections, resolvePeerConnections, } from "./peer-connections.js";
|
|
12
13
|
/** Fail fast before listen when static cloud config cannot honor `servers`. */
|
|
13
14
|
export function validateMountConnectionsConfig(args) {
|
|
14
15
|
if (args.accountRefs === undefined || args.accountRefs.length === 0) {
|
|
@@ -69,9 +70,13 @@ export function resolveMountConnections(args) {
|
|
|
69
70
|
: `[bdk] warning: agent "${label}" has host-OAuth MCP connections (${hostOauthNames.join(", ")}) whose tokens live on this serve host; cloud-runtime turns omit them. Serve with a cloud tools URL so they reach turns through the host connection bridge, or drop \`oauth\` and authorize the server another way.`);
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
+
const peerRefs = args.peerRefs ?? [];
|
|
74
|
+
if (args.peersUrl !== undefined) {
|
|
75
|
+
resolved.push(...resolveHostedPeerConnections({ refs: peerRefs, peersUrl: args.peersUrl }));
|
|
76
|
+
}
|
|
77
|
+
else if (peerRefs.length > 0) {
|
|
73
78
|
const peers = resolvePeerConnections({
|
|
74
|
-
refs:
|
|
79
|
+
refs: peerRefs,
|
|
75
80
|
serverUrl: args.serverUrl,
|
|
76
81
|
...(args.publicUrl === undefined ? {} : { publicUrl: args.publicUrl }),
|
|
77
82
|
...(args.authToken === undefined ? {} : { authToken: args.authToken }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk-runner.d.ts","sourceRoot":"","sources":["../../src/internal/sdk-runner.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,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