@codexhost/cli-win32-x64 0.33.0 → 0.35.0
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 +2 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +670 -116
- package/app/console-web.js +2032 -309
- package/app/desktop-controller.mjs +621 -74
- package/app/desktop-mcp-client.mjs +619 -0
- package/app/host-runtime.mjs +7134 -3865
- package/app/plugins/antigravity/plugin.mjs +1411 -121
- package/app/plugins/claude-code/plugin.mjs +527 -70
- package/app/plugins/codebuddy/plugin.mjs +592 -98
- package/app/plugins/codex-usage/plugin.mjs +659 -74
- package/app/plugins/copilot/plugin.mjs +527 -72
- package/app/plugins/cursor-cli/plugin.mjs +527 -70
- package/app/plugins/deepseek-harness/plugin.mjs +527 -70
- package/app/plugins/devin/plugin.mjs +527 -70
- package/app/plugins/enabled.json +1 -0
- package/app/plugins/grok/plugin.mjs +580 -92
- package/app/plugins/hermes/plugin.mjs +526 -69
- package/app/plugins/kimi-code/plugin.mjs +527 -70
- package/app/plugins/kiro-cli/plugin.mjs +527 -70
- package/app/plugins/omp/plugin.mjs +1338 -301
- package/app/plugins/opencode/plugin.mjs +527 -70
- package/app/plugins/pi/plugin.mjs +527 -70
- package/app/plugins/qoder/plugin.mjs +528 -71
- package/app/plugins/qoder-cn/plugin.mjs +528 -71
- package/app/plugins/qwen-code/plugin.mjs +526 -69
- package/app/plugins/workbuddy/plugin.mjs +1231 -546
- package/app/plugins/workbuddy-cn/assets/icon.svg +27 -0
- package/app/plugins/workbuddy-cn/manifest.json +32 -0
- package/app/plugins/workbuddy-cn/plugin.mjs +36524 -0
- package/app/plugins/zcode/plugin.mjs +528 -70
- package/app/renderer-extension.js +3898 -478
- package/app/web/assets/{abnfDiagram-XWFEHMT6-VnfRaHM6.js → abnfDiagram-XWFEHMT6-CGkBtBVj.js} +1 -1
- package/app/web/assets/{architectureDiagram-CSQXQB3N-BA1ehtvi.js → architectureDiagram-CSQXQB3N-Byv-cZeH.js} +1 -1
- package/app/web/assets/{blockDiagram-BEDRHYPZ-31BZSfd4.js → blockDiagram-BEDRHYPZ-DjLzUtwg.js} +1 -1
- package/app/web/assets/{c4Diagram-M2UUVUY5-CNzGWc5k.js → c4Diagram-M2UUVUY5-CJlsb6QO.js} +1 -1
- package/app/web/assets/{chunk-2Q5K7J3B-ahAIR-NM.js → chunk-2Q5K7J3B-CWm537bw.js} +1 -1
- package/app/web/assets/{chunk-3GCGMST5-BIV5YeRJ.js → chunk-3GCGMST5-NpcInIx4.js} +1 -1
- package/app/web/assets/{chunk-5VM5RSS4-CluTMPJG.js → chunk-5VM5RSS4-CeyyP0dm.js} +1 -1
- package/app/web/assets/{chunk-7U7NFRK5-4NIQuFbE.js → chunk-7U7NFRK5-Bto5OgbF.js} +1 -1
- package/app/web/assets/{chunk-CNRTWJTD-_0bEfGn3.js → chunk-CNRTWJTD-CuRMFCjT.js} +1 -1
- package/app/web/assets/{chunk-D5HYT7QG-_kTC6f8F.js → chunk-D5HYT7QG-DtQM1-2k.js} +1 -1
- package/app/web/assets/{chunk-EBZ3SEQC-CykaYOrL.js → chunk-EBZ3SEQC-DbUb3ZJ4.js} +2 -2
- package/app/web/assets/{chunk-JWPE2WC7-3vVOQ_py.js → chunk-JWPE2WC7-Dxh3d9Ag.js} +1 -1
- package/app/web/assets/{chunk-KTR4FSNJ-aVg5vgrm.js → chunk-KTR4FSNJ-BfwavXUO.js} +1 -1
- package/app/web/assets/{chunk-XXDRQBXY-_gVwGeSp.js → chunk-XXDRQBXY-CxR1flID.js} +1 -1
- package/app/web/assets/{classDiagram-v2-KXABOMEV-fI1LfeBf.js → classDiagram-v2-KXABOMEV-2WV2q_X2.js} +1 -1
- package/app/web/assets/{cose-bilkent-JH36ORCC-DFXMlWov.js → cose-bilkent-JH36ORCC-C-ENrCL_.js} +1 -1
- package/app/web/assets/{cynefin-EF2NZ3EQ-lZy7X6FO.js → cynefin-EF2NZ3EQ-Bg5LeTZO.js} +1 -1
- package/app/web/assets/{cynefinDiagram-NJNITYFG-N4DwFSW1.js → cynefinDiagram-NJNITYFG-CRAdbGGt.js} +1 -1
- package/app/web/assets/{dagre-KIHZ2IZ3-B7-8baTH.js → dagre-KIHZ2IZ3-dNHEvUqL.js} +1 -1
- package/app/web/assets/{diagram-7YQZDPLS-DLfjiBXV.js → diagram-7YQZDPLS-7F4O37o5.js} +1 -1
- package/app/web/assets/{diagram-QBROCOUO-CQnRzSTi.js → diagram-QBROCOUO-B-5KpeI2.js} +1 -1
- package/app/web/assets/{diagram-RJJCUUZO-DPnxazRT.js → diagram-RJJCUUZO-DqDsyDaL.js} +1 -1
- package/app/web/assets/{diagram-WERXNKYE-BBuEFRvD.js → diagram-WERXNKYE-f1oaPKos.js} +1 -1
- package/app/web/assets/{diagram-YHHI257C-BQ92JNJs.js → diagram-YHHI257C-DVMtl9Bt.js} +1 -1
- package/app/web/assets/{diagram-YR4HJLHV-Ce6BQO3J.js → diagram-YR4HJLHV-BWFCNFFF.js} +1 -1
- package/app/web/assets/{ebnfDiagram-N527522P-DYknE2Jy.js → ebnfDiagram-N527522P-B4N7d-Bi.js} +1 -1
- package/app/web/assets/{elk-O5DQBFGD-4S6_JJFF.js → elk-O5DQBFGD-DRdfF_UQ.js} +1 -1
- package/app/web/assets/{erDiagram-K3K3BIDK-DRtF7JVQ.js → erDiagram-K3K3BIDK-BW4-_5sZ.js} +1 -1
- package/app/web/assets/{flowDiagram-Z6JWZHQI-7Ho8CyR9.js → flowDiagram-Z6JWZHQI-DIQa5yEv.js} +1 -1
- package/app/web/assets/{ganttDiagram-3PRQTZWP-CW8Ig5y4.js → ganttDiagram-3PRQTZWP-JBK9PM7A.js} +1 -1
- package/app/web/assets/{gitGraphDiagram-VXDFKS5L-CzS8Xg2D.js → gitGraphDiagram-VXDFKS5L-TPI9Su0g.js} +1 -1
- package/app/web/assets/{grid-E2QIVN74-Cq284lCe.js → grid-E2QIVN74-DmHbunuP.js} +1 -1
- package/app/web/assets/index-BKDmniRf.js +209 -0
- package/app/web/assets/index-BPMnQdGr.css +1 -0
- package/app/web/assets/{infoDiagram-EZ3ZOAHP-BZgN6qlY.js → infoDiagram-EZ3ZOAHP-BeFwO9PI.js} +1 -1
- package/app/web/assets/{ishikawaDiagram-S3EKX5GW-BH9YHc-1.js → ishikawaDiagram-S3EKX5GW-BTbrKF_p.js} +1 -1
- package/app/web/assets/{journeyDiagram-POQNLL5X-D50KYOLe.js → journeyDiagram-POQNLL5X-DR0yWxJi.js} +1 -1
- package/app/web/assets/{kanban-definition-BH5XI6FM-Crw_5mMP.js → kanban-definition-BH5XI6FM-DMHrC9oV.js} +1 -1
- package/app/web/assets/{mermaid.core-o2Qjrppc.js → mermaid.core-Brmc1kJw.js} +4 -4
- package/app/web/assets/{mindmap-definition-WVAN44T4-B_bEbpAH.js → mindmap-definition-WVAN44T4-NT_XVwlI.js} +1 -1
- package/app/web/assets/{pegDiagram-D4NLKWP3-VecAHoyw.js → pegDiagram-D4NLKWP3-K67_THcc.js} +1 -1
- package/app/web/assets/{pieDiagram-36ENHN4W-o3ei2T-6.js → pieDiagram-36ENHN4W-GlTgKnTi.js} +1 -1
- package/app/web/assets/{quadrantDiagram-ZQUDMS73-DHndOAcn.js → quadrantDiagram-ZQUDMS73-yMEZ6-Nr.js} +1 -1
- package/app/web/assets/{railroadDiagram-JIZHGYPL-DRd_lfii.js → railroadDiagram-JIZHGYPL-MXCqwbuq.js} +1 -1
- package/app/web/assets/{render-VIF2ZAQL-awM3hUqB.js → render-VIF2ZAQL-BRUlhHPG.js} +2 -2
- package/app/web/assets/{requirementDiagram-AXW2TVFA-Ce1ePsOe.js → requirementDiagram-AXW2TVFA-Dqx4p0Bz.js} +1 -1
- package/app/web/assets/{sankeyDiagram-FBCJTAIF-cP-LtgW-.js → sankeyDiagram-FBCJTAIF-COp3IWvs.js} +1 -1
- package/app/web/assets/{sequenceDiagram-3LA2ROMG-C3JStTuW.js → sequenceDiagram-3LA2ROMG-j1xwrmp8.js} +1 -1
- package/app/web/assets/{sizeCapture-2Q2CQKSF-Dyyelr9K.js → sizeCapture-2Q2CQKSF-ZEXdxLeY.js} +1 -1
- package/app/web/assets/{stateDiagram-v2-ATKHQDJO-DkYRBVTd.js → stateDiagram-v2-ATKHQDJO-2pt2L-Zd.js} +1 -1
- package/app/web/assets/{swimlanes-YQL5WMAO-B2FwJU5_.js → swimlanes-YQL5WMAO-BHpgfPPd.js} +1 -1
- package/app/web/assets/swimlanesDiagram-UCCPES4V-BrYKheZO.js +8 -0
- package/app/web/assets/{timeline-definition-7Z437IG3-Di-qRIIi.js → timeline-definition-7Z437IG3-Cw4F_3FM.js} +1 -1
- package/app/web/assets/{usecaseDiagram-RDK6N6HP-yAImn62t.js → usecaseDiagram-RDK6N6HP-DefiMBIg.js} +1 -1
- package/app/web/assets/{vennDiagram-SHRQU5PJ-BEv8jpfv.js → vennDiagram-SHRQU5PJ-D30EMFrI.js} +1 -1
- package/app/web/assets/{wardleyDiagram-F3OXNVQS-7irksA0b.js → wardleyDiagram-F3OXNVQS-4ok25PKp.js} +1 -1
- package/app/web/assets/{xychartDiagram-GDYJKCDI-BokJGG2y.js → xychartDiagram-GDYJKCDI-BB0uAQX5.js} +1 -1
- package/app/web/codexhost-settings.js +429 -159
- package/app/web/index.html +2 -2
- package/app/web/plugins/deepseek-ai__dsh-api-gateway/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +63 -63
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +70 -70
- package/app/web/plugins/deepseek-ai__dsh-client-file-upload/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +75 -75
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +172 -77
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +104 -100
- package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +65 -65
- package/app/web/plugins/deepseek-ai__dsh-client-ui-session/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +5 -5
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.js +6 -6
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.pdf.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-right/client.js +62 -62
- package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +72 -72
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +70 -70
- package/app/web/plugins.json +1 -0
- package/app/web/role-avatars/builtin/advisor-otter.webp +0 -0
- package/app/web/role-avatars/builtin/builder-otter.webp +0 -0
- package/app/web/role-avatars/builtin/sailor-otter.webp +0 -0
- package/app/web/role-avatars/builtin/wizard-otter.webp +0 -0
- package/app/web-modules/server.mjs +7262 -2970
- package/bin/codexhost.exe +0 -0
- package/libexec/codexhost-node-repl.exe +0 -0
- package/libexec/codexhost-screenshot.exe +0 -0
- package/libexec/codexhost-shell.exe +0 -0
- package/libexec/codexhost-shim.exe +0 -0
- package/libexec/codexhost-updater.exe +0 -0
- package/package.json +1 -1
- package/app/web/assets/index-CINZ6P-q.css +0 -1
- package/app/web/assets/index-CvV6veuY.js +0 -208
- package/app/web/assets/swimlanesDiagram-UCCPES4V-BkMsxCPb.js +0 -8
|
@@ -27517,26 +27517,51 @@ var jsonPrimitiveSchema = external_exports.union([
|
|
|
27517
27517
|
external_exports.boolean(),
|
|
27518
27518
|
external_exports.null()
|
|
27519
27519
|
]);
|
|
27520
|
-
function
|
|
27521
|
-
const
|
|
27522
|
-
|
|
27520
|
+
function isPlainObject2(value) {
|
|
27521
|
+
const prototype = Object.getPrototypeOf(value);
|
|
27522
|
+
return prototype === Object.prototype || prototype === null;
|
|
27523
|
+
}
|
|
27524
|
+
var JSON_VALIDATION_LEAVE = /* @__PURE__ */ Symbol("json-validation-leave");
|
|
27525
|
+
function isValidJsonValue(value) {
|
|
27526
|
+
if (value === null || typeof value === "string" || typeof value === "boolean" || typeof value === "number" && Number.isFinite(value)) {
|
|
27527
|
+
return true;
|
|
27528
|
+
}
|
|
27529
|
+
if (typeof value !== "object")
|
|
27530
|
+
return false;
|
|
27531
|
+
const ancestors = /* @__PURE__ */ new Set();
|
|
27532
|
+
const stack = [value];
|
|
27523
27533
|
try {
|
|
27524
27534
|
while (stack.length > 0) {
|
|
27525
|
-
const
|
|
27526
|
-
if (
|
|
27527
|
-
|
|
27528
|
-
if (frame.leaving) {
|
|
27529
|
-
ancestors.delete(frame.value);
|
|
27535
|
+
const current = stack.pop();
|
|
27536
|
+
if (current === JSON_VALIDATION_LEAVE) {
|
|
27537
|
+
ancestors.delete(stack.pop());
|
|
27530
27538
|
continue;
|
|
27531
27539
|
}
|
|
27532
|
-
if (typeof
|
|
27540
|
+
if (current === null || typeof current === "string" || typeof current === "boolean" || typeof current === "number" && Number.isFinite(current)) {
|
|
27533
27541
|
continue;
|
|
27534
|
-
|
|
27542
|
+
}
|
|
27543
|
+
if (typeof current !== "object")
|
|
27535
27544
|
return false;
|
|
27536
|
-
ancestors.
|
|
27537
|
-
|
|
27538
|
-
|
|
27539
|
-
|
|
27545
|
+
if (ancestors.has(current))
|
|
27546
|
+
return false;
|
|
27547
|
+
if (Array.isArray(current)) {
|
|
27548
|
+
ancestors.add(current);
|
|
27549
|
+
stack.push(current, JSON_VALIDATION_LEAVE);
|
|
27550
|
+
for (let index = current.length - 1; index >= 0; index -= 1) {
|
|
27551
|
+
stack.push(current[index]);
|
|
27552
|
+
}
|
|
27553
|
+
continue;
|
|
27554
|
+
}
|
|
27555
|
+
if (!isPlainObject2(current))
|
|
27556
|
+
return false;
|
|
27557
|
+
ancestors.add(current);
|
|
27558
|
+
stack.push(current, JSON_VALIDATION_LEAVE);
|
|
27559
|
+
for (const key in current) {
|
|
27560
|
+
if (Object.hasOwn(current, key)) {
|
|
27561
|
+
if (key === "__proto__")
|
|
27562
|
+
return false;
|
|
27563
|
+
stack.push(current[key]);
|
|
27564
|
+
}
|
|
27540
27565
|
}
|
|
27541
27566
|
}
|
|
27542
27567
|
} catch {
|
|
@@ -27544,17 +27569,11 @@ function hasNoCircularReferences(value) {
|
|
|
27544
27569
|
}
|
|
27545
27570
|
return true;
|
|
27546
27571
|
}
|
|
27547
|
-
var
|
|
27548
|
-
message: "JSON value
|
|
27572
|
+
var jsonValueSchema = external_exports.custom(isValidJsonValue, {
|
|
27573
|
+
message: "Invalid JSON value"
|
|
27549
27574
|
});
|
|
27550
|
-
var
|
|
27551
|
-
|
|
27552
|
-
external_exports.array(recursiveJsonValueSchema),
|
|
27553
|
-
external_exports.record(external_exports.string(), recursiveJsonValueSchema)
|
|
27554
|
-
]));
|
|
27555
|
-
var jsonValueSchema = nonCircularSchema.pipe(recursiveJsonValueSchema);
|
|
27556
|
-
var jsonArraySchema = nonCircularSchema.pipe(external_exports.array(recursiveJsonValueSchema));
|
|
27557
|
-
var jsonObjectSchema = nonCircularSchema.pipe(external_exports.record(external_exports.string(), recursiveJsonValueSchema));
|
|
27575
|
+
var jsonArraySchema = external_exports.custom((value) => Array.isArray(value) && isValidJsonValue(value), { message: "Invalid JSON array" });
|
|
27576
|
+
var jsonObjectSchema = external_exports.custom((value) => typeof value === "object" && value !== null && !Array.isArray(value) && isValidJsonValue(value), { message: "Invalid JSON object" });
|
|
27558
27577
|
|
|
27559
27578
|
// ../../shared-contracts/dist/errors.js
|
|
27560
27579
|
var codexhostErrorSchema = external_exports.strictObject({
|
|
@@ -27687,7 +27706,11 @@ var BUILTIN_ROLE_AVATAR_IDS = [
|
|
|
27687
27706
|
"security-otter",
|
|
27688
27707
|
"audio-otter",
|
|
27689
27708
|
"scholar-otter",
|
|
27690
|
-
"data-otter"
|
|
27709
|
+
"data-otter",
|
|
27710
|
+
"advisor-otter",
|
|
27711
|
+
"builder-otter",
|
|
27712
|
+
"wizard-otter",
|
|
27713
|
+
"sailor-otter"
|
|
27691
27714
|
];
|
|
27692
27715
|
var builtinRoleAvatarSchema = external_exports.templateLiteral([
|
|
27693
27716
|
"builtin:",
|
|
@@ -28674,6 +28697,7 @@ var hostExtensionCatalogEntrySchema = external_exports.object({
|
|
|
28674
28697
|
backend: external_exports.int().positive().optional()
|
|
28675
28698
|
}),
|
|
28676
28699
|
downloadUrl: downloadUrl.refine((url2) => url2.startsWith("https://"), "Expected HTTPS"),
|
|
28700
|
+
downloads7d: external_exports.number().int().min(0).optional(),
|
|
28677
28701
|
featured: external_exports.boolean().optional(),
|
|
28678
28702
|
featuredOrder: external_exports.int().nonnegative().optional(),
|
|
28679
28703
|
changelog: external_exports.array(hostExtensionChangelogEntrySchema).max(20).optional()
|
|
@@ -28743,24 +28767,42 @@ var hostExtensionInstallationSchema = external_exports.strictObject({
|
|
|
28743
28767
|
var rasterDataUrlSchema = (maxBytes) => external_exports.string().max("data:image/jpeg;base64,".length + 4 * Math.ceil(maxBytes / 3)).regex(/^data:image\/(?:png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$/u);
|
|
28744
28768
|
var desktopConflict = { desktopConflictWith: hostExtensionIdSchema.optional() };
|
|
28745
28769
|
var backendState = external_exports.enum(["none", "inactive", "starting", "running", "failed"]);
|
|
28770
|
+
var HOST_EXTENSION_OPERATION_ERROR_MAX_LENGTH = 512;
|
|
28771
|
+
var hostExtensionOperationStatusSchema = external_exports.discriminatedUnion("state", [
|
|
28772
|
+
external_exports.object({
|
|
28773
|
+
state: external_exports.literal("updating"),
|
|
28774
|
+
targetVersion: external_exports.string().trim().min(1).max(128).optional(),
|
|
28775
|
+
startedAt: external_exports.iso.datetime()
|
|
28776
|
+
}),
|
|
28777
|
+
external_exports.object({
|
|
28778
|
+
state: external_exports.literal("failed"),
|
|
28779
|
+
targetVersion: external_exports.string().trim().min(1).max(128).optional(),
|
|
28780
|
+
startedAt: external_exports.iso.datetime(),
|
|
28781
|
+
updatedAt: external_exports.iso.datetime(),
|
|
28782
|
+
error: external_exports.string().min(1).max(HOST_EXTENSION_OPERATION_ERROR_MAX_LENGTH),
|
|
28783
|
+
interruptedByShutdown: external_exports.boolean().optional()
|
|
28784
|
+
})
|
|
28785
|
+
]);
|
|
28746
28786
|
var hostExtensionListItemSchema = external_exports.discriminatedUnion("state", [
|
|
28747
|
-
|
|
28787
|
+
external_exports.object({
|
|
28788
|
+
...hostExtensionInstallationSchema.shape,
|
|
28748
28789
|
state: external_exports.literal("valid"),
|
|
28749
28790
|
enabled: external_exports.boolean(),
|
|
28750
28791
|
...desktopConflict,
|
|
28751
28792
|
iconDataUrl: rasterDataUrlSchema(DESKTOP_EXTENSION_ICON_MAX_BYTES).optional(),
|
|
28752
28793
|
screenshotDataUrls: external_exports.array(rasterDataUrlSchema(DESKTOP_EXTENSION_SCREENSHOT_MAX_BYTES)).max(DESKTOP_EXTENSION_SCREENSHOT_LIMIT).optional(),
|
|
28753
28794
|
backendState: backendState.optional(),
|
|
28754
|
-
backendError: external_exports.string().optional()
|
|
28795
|
+
backendError: external_exports.string().optional(),
|
|
28796
|
+
operation: hostExtensionOperationStatusSchema.optional()
|
|
28755
28797
|
}),
|
|
28756
|
-
external_exports.
|
|
28798
|
+
external_exports.object({
|
|
28757
28799
|
state: external_exports.enum(["invalid", "incompatible"]),
|
|
28758
28800
|
id: external_exports.string().min(1),
|
|
28759
28801
|
enabled: external_exports.boolean(),
|
|
28760
28802
|
error: external_exports.string()
|
|
28761
28803
|
})
|
|
28762
28804
|
]);
|
|
28763
|
-
var hostExtensionsListResultSchema = external_exports.
|
|
28805
|
+
var hostExtensionsListResultSchema = external_exports.object({
|
|
28764
28806
|
revision: hostExtensionRevisionSchema,
|
|
28765
28807
|
configuration: hostExtensionConfigurationSchema,
|
|
28766
28808
|
diagnostics: external_exports.array(external_exports.string()),
|
|
@@ -28799,7 +28841,10 @@ var methods = new Set(HOST_EXTENSION_MANAGEMENT_METHODS);
|
|
|
28799
28841
|
var noParams = external_exports.strictObject({});
|
|
28800
28842
|
var expectedRevision = { expectedRevision: hostExtensionRevisionSchema };
|
|
28801
28843
|
var selection = external_exports.strictObject({ ...id, ...expectedRevision });
|
|
28802
|
-
var installationResult =
|
|
28844
|
+
var installationResult = external_exports.object({
|
|
28845
|
+
...hostExtensionInstallationSchema.shape,
|
|
28846
|
+
replaced: external_exports.boolean()
|
|
28847
|
+
});
|
|
28803
28848
|
var mutationResult = external_exports.discriminatedUnion("state", [
|
|
28804
28849
|
external_exports.strictObject({ state: external_exports.literal("saved"), configuration: hostExtensionConfigurationSchema }),
|
|
28805
28850
|
external_exports.strictObject({ state: external_exports.literal("revision-conflict"), revision: hostExtensionRevisionSchema })
|
|
@@ -28828,7 +28873,12 @@ var hostExtensionSettingsSchema = external_exports.strictObject({
|
|
|
28828
28873
|
values: jsonObjectSchema
|
|
28829
28874
|
});
|
|
28830
28875
|
var hostExtensionsRpcSchemas = {
|
|
28831
|
-
[HOST_EXTENSIONS_RPC.list]: {
|
|
28876
|
+
[HOST_EXTENSIONS_RPC.list]: {
|
|
28877
|
+
params: external_exports.object({
|
|
28878
|
+
includeOperations: external_exports.boolean().optional()
|
|
28879
|
+
}),
|
|
28880
|
+
result: hostExtensionsListResultSchema
|
|
28881
|
+
},
|
|
28832
28882
|
[HOST_EXTENSIONS_RPC.snapshot]: { params: noParams, result: hostExtensionsSnapshotResultSchema },
|
|
28833
28883
|
[HOST_EXTENSIONS_RPC.catalog]: {
|
|
28834
28884
|
params: external_exports.strictObject({
|
|
@@ -28854,6 +28904,7 @@ var hostExtensionsRpcSchemas = {
|
|
|
28854
28904
|
...id,
|
|
28855
28905
|
expectedDigest: active.digest,
|
|
28856
28906
|
expectedActivationId: active.activationId.optional(),
|
|
28907
|
+
expectedVersion: external_exports.string().trim().min(1).max(128).optional(),
|
|
28857
28908
|
source: hostExtensionInstallSourceSchema.optional()
|
|
28858
28909
|
}),
|
|
28859
28910
|
result: installationResult
|
|
@@ -28903,8 +28954,39 @@ var hostExtensionsRpcSchemas = {
|
|
|
28903
28954
|
};
|
|
28904
28955
|
|
|
28905
28956
|
// ../../shared-contracts/dist/group-chat.js
|
|
28906
|
-
var
|
|
28907
|
-
var
|
|
28957
|
+
var GROUP_MEMORY_MAX_BYTES = 4096;
|
|
28958
|
+
var DEFAULT_GROUP_MAX_AGENT_HOPS = 10;
|
|
28959
|
+
var MAX_GROUP_AGENT_HOPS = 200;
|
|
28960
|
+
var GROUP_NOTICE_MAX_LENGTH = 2e3;
|
|
28961
|
+
var cachedUtf8Encoder;
|
|
28962
|
+
function groupUtf8ByteLength(text3) {
|
|
28963
|
+
if (cachedUtf8Encoder === void 0) {
|
|
28964
|
+
cachedUtf8Encoder = typeof TextEncoder === "function" ? new TextEncoder() : null;
|
|
28965
|
+
}
|
|
28966
|
+
if (cachedUtf8Encoder !== null) {
|
|
28967
|
+
return cachedUtf8Encoder.encode(text3).length;
|
|
28968
|
+
}
|
|
28969
|
+
let bytes = 0;
|
|
28970
|
+
for (let i = 0; i < text3.length; i += 1) {
|
|
28971
|
+
const code = text3.charCodeAt(i);
|
|
28972
|
+
if (code <= 127) {
|
|
28973
|
+
bytes += 1;
|
|
28974
|
+
} else if (code <= 2047) {
|
|
28975
|
+
bytes += 2;
|
|
28976
|
+
} else if (code >= 55296 && code <= 56319 && i + 1 < text3.length) {
|
|
28977
|
+
const next = text3.charCodeAt(i + 1);
|
|
28978
|
+
if (next >= 56320 && next <= 57343) {
|
|
28979
|
+
bytes += 4;
|
|
28980
|
+
i += 1;
|
|
28981
|
+
} else {
|
|
28982
|
+
bytes += 3;
|
|
28983
|
+
}
|
|
28984
|
+
} else {
|
|
28985
|
+
bytes += 3;
|
|
28986
|
+
}
|
|
28987
|
+
}
|
|
28988
|
+
return bytes;
|
|
28989
|
+
}
|
|
28908
28990
|
var remoteGroupRoomIdSchema = external_exports.string().regex(/^remote:[A-Za-z0-9_-]{8,512}$/u);
|
|
28909
28991
|
var groupRoomIdSchema = external_exports.union([external_exports.uuidv4(), remoteGroupRoomIdSchema]);
|
|
28910
28992
|
var groupMemberIdSchema = external_exports.uuidv4();
|
|
@@ -28913,7 +28995,7 @@ var groupUnmentionedPolicySchema = external_exports.enum(["none", "last_speaker"
|
|
|
28913
28995
|
var groupMemberStatusSchema = external_exports.enum(["active", "muted", "removed"]);
|
|
28914
28996
|
var nonnegativeInteger = external_exports.int().nonnegative();
|
|
28915
28997
|
var positiveInteger = external_exports.int().positive();
|
|
28916
|
-
var maxAgentHopsSchema =
|
|
28998
|
+
var maxAgentHopsSchema = nonnegativeInteger.max(MAX_GROUP_AGENT_HOPS);
|
|
28917
28999
|
var nonblankString = external_exports.string().refine((value) => value.trim().length > 0);
|
|
28918
29000
|
var timestamp = external_exports.iso.datetime();
|
|
28919
29001
|
var optionalMemberEdits = {
|
|
@@ -28931,28 +29013,42 @@ var groupMemberSchema = external_exports.object({
|
|
|
28931
29013
|
roleSnapshot: threadRoleSnapshotSchema.optional(),
|
|
28932
29014
|
harnessId: harnessIdSchema,
|
|
28933
29015
|
status: groupMemberStatusSchema,
|
|
29016
|
+
projectless: external_exports.boolean().optional(),
|
|
29017
|
+
showInSidebar: external_exports.boolean().optional(),
|
|
28934
29018
|
joinedAtSeq: nonnegativeInteger,
|
|
28935
29019
|
lastDeliveredSeq: nonnegativeInteger,
|
|
28936
29020
|
lastRosterVersion: nonnegativeInteger,
|
|
29021
|
+
lastMemoryVersion: nonnegativeInteger.default(0),
|
|
28937
29022
|
createdAt: timestamp
|
|
28938
29023
|
});
|
|
29024
|
+
var groupProjectlessWorkspaceSchema = external_exports.object({
|
|
29025
|
+
workspaceRoot: nonblankString,
|
|
29026
|
+
outputDirectory: nonblankString
|
|
29027
|
+
});
|
|
28939
29028
|
var groupRoomRemoteHostSchema = external_exports.object({
|
|
28940
29029
|
hostId: nonblankString,
|
|
28941
29030
|
displayName: nonblankString,
|
|
28942
29031
|
state: nonblankString.optional(),
|
|
28943
29032
|
color: external_exports.string().optional(),
|
|
28944
|
-
filePreview: external_exports.boolean().optional()
|
|
29033
|
+
filePreview: external_exports.boolean().optional(),
|
|
29034
|
+
memberSidebarVisibility: external_exports.boolean().optional(),
|
|
29035
|
+
sharedMemory: external_exports.boolean().optional()
|
|
28945
29036
|
});
|
|
28946
|
-
var
|
|
29037
|
+
var groupRoomObjectSchema = external_exports.object({
|
|
28947
29038
|
roomId: groupRoomIdSchema,
|
|
28948
29039
|
title: nonblankString,
|
|
28949
29040
|
defaultCwd: nonblankString,
|
|
29041
|
+
projectlessWorkspace: groupProjectlessWorkspaceSchema.optional(),
|
|
28950
29042
|
unmentionedPolicy: groupUnmentionedPolicySchema.default("none"),
|
|
29043
|
+
unmentionedMemberId: groupMemberIdSchema.optional(),
|
|
28951
29044
|
allowAgentMentions: external_exports.boolean().default(true),
|
|
28952
29045
|
maxAgentHops: maxAgentHopsSchema.default(DEFAULT_GROUP_MAX_AGENT_HOPS),
|
|
29046
|
+
relayHopLimit: maxAgentHopsSchema.optional(),
|
|
28953
29047
|
lastSeq: nonnegativeInteger,
|
|
28954
29048
|
lastSpeakerMemberId: groupMemberIdSchema.optional(),
|
|
28955
29049
|
rosterVersion: nonnegativeInteger,
|
|
29050
|
+
memoryVersion: nonnegativeInteger.default(0),
|
|
29051
|
+
memorySha256: external_exports.string().regex(/^[0-9a-f]{64}$/u).optional(),
|
|
28956
29052
|
humanEpoch: nonnegativeInteger,
|
|
28957
29053
|
relayPaused: external_exports.boolean(),
|
|
28958
29054
|
pinned: external_exports.boolean(),
|
|
@@ -28960,7 +29056,14 @@ var groupRoomSchema = external_exports.object({
|
|
|
28960
29056
|
updatedAt: timestamp,
|
|
28961
29057
|
members: external_exports.array(groupMemberSchema),
|
|
28962
29058
|
remote: groupRoomRemoteHostSchema.optional()
|
|
28963
|
-
}).superRefine(({ members: members2 }, context) => {
|
|
29059
|
+
}).superRefine(({ members: members2, unmentionedPolicy, unmentionedMemberId }, context) => {
|
|
29060
|
+
if (unmentionedMemberId !== void 0 && unmentionedPolicy !== "none") {
|
|
29061
|
+
context.addIssue({
|
|
29062
|
+
code: "custom",
|
|
29063
|
+
path: ["unmentionedMemberId"],
|
|
29064
|
+
message: 'A default member can only be set when unmentionedPolicy is "none"'
|
|
29065
|
+
});
|
|
29066
|
+
}
|
|
28964
29067
|
const handles = /* @__PURE__ */ new Set();
|
|
28965
29068
|
for (const [index, { handle, status }] of members2.entries()) {
|
|
28966
29069
|
if (status === "removed")
|
|
@@ -28975,6 +29078,15 @@ var groupRoomSchema = external_exports.object({
|
|
|
28975
29078
|
handles.add(handle);
|
|
28976
29079
|
}
|
|
28977
29080
|
});
|
|
29081
|
+
var groupRoomSchema = external_exports.preprocess((value) => {
|
|
29082
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
29083
|
+
const record4 = value;
|
|
29084
|
+
if (record4.unmentionedPolicy === "member" && record4.unmentionedMemberId !== void 0) {
|
|
29085
|
+
return { ...record4, unmentionedPolicy: "none" };
|
|
29086
|
+
}
|
|
29087
|
+
}
|
|
29088
|
+
return value;
|
|
29089
|
+
}, groupRoomObjectSchema);
|
|
28978
29090
|
var groupAttachmentSchema = external_exports.object({
|
|
28979
29091
|
kind: external_exports.enum(["image", "file"]),
|
|
28980
29092
|
attachmentId: nonblankString.max(256),
|
|
@@ -29001,6 +29113,7 @@ var groupMessageSchema = external_exports.object({
|
|
|
29001
29113
|
mentionedMemberIds: external_exports.array(groupMemberIdSchema),
|
|
29002
29114
|
mentionAll: external_exports.boolean().optional(),
|
|
29003
29115
|
hopCount: nonnegativeInteger,
|
|
29116
|
+
durationMs: nonnegativeInteger.optional(),
|
|
29004
29117
|
createdAt: timestamp
|
|
29005
29118
|
});
|
|
29006
29119
|
var newThreadOptions = {
|
|
@@ -29027,8 +29140,12 @@ var GROUPS_DELETE_METHOD = "codexhost/groups/delete";
|
|
|
29027
29140
|
var GROUPS_ADD_MEMBER_METHOD = "codexhost/groups/member/add";
|
|
29028
29141
|
var GROUPS_UPDATE_MEMBER_METHOD = "codexhost/groups/member/update";
|
|
29029
29142
|
var GROUPS_REMOVE_MEMBER_METHOD = "codexhost/groups/member/remove";
|
|
29143
|
+
var GROUPS_REBIND_MEMBER_METHOD = "codexhost/groups/member/rebind";
|
|
29030
29144
|
var GROUPS_POST_MESSAGE_METHOD = "codexhost/groups/message/post";
|
|
29031
29145
|
var GROUPS_READ_MESSAGES_METHOD = "codexhost/groups/messages/read";
|
|
29146
|
+
var GROUPS_READ_MEMORY_METHOD = "codexhost/groups/memory/read";
|
|
29147
|
+
var GROUPS_UPDATE_MEMORY_METHOD = "codexhost/groups/memory/update";
|
|
29148
|
+
var GROUPS_INSPECT_CWD_METHOD = "codexhost/groups/cwd/inspect";
|
|
29032
29149
|
var roomIdentity = { roomId: groupRoomIdSchema };
|
|
29033
29150
|
var memberIdentity = { ...roomIdentity, memberId: groupMemberIdSchema };
|
|
29034
29151
|
var roomEdits = {
|
|
@@ -29051,15 +29168,24 @@ var groupsGetResultSchema = external_exports.object({
|
|
|
29051
29168
|
});
|
|
29052
29169
|
var groupsCreateParamsSchema = external_exports.strictObject({
|
|
29053
29170
|
...roomEdits,
|
|
29054
|
-
defaultCwd: nonblankString,
|
|
29171
|
+
defaultCwd: nonblankString.optional(),
|
|
29055
29172
|
members: external_exports.array(groupCreateMemberInputSchema)
|
|
29056
29173
|
});
|
|
29057
29174
|
var groupsCreateResultSchema = external_exports.object({ room: groupRoomSchema });
|
|
29058
29175
|
var groupsUpdateParamsSchema = external_exports.strictObject({
|
|
29059
29176
|
...roomIdentity,
|
|
29060
29177
|
...roomEdits,
|
|
29178
|
+
unmentionedMemberId: groupMemberIdSchema.nullable().optional(),
|
|
29061
29179
|
pinned: external_exports.boolean().optional(),
|
|
29062
29180
|
relayPaused: external_exports.boolean().optional()
|
|
29181
|
+
}).superRefine(({ unmentionedPolicy, unmentionedMemberId }, context) => {
|
|
29182
|
+
if (unmentionedMemberId !== void 0 && unmentionedMemberId !== null && unmentionedPolicy !== void 0 && unmentionedPolicy !== "none") {
|
|
29183
|
+
context.addIssue({
|
|
29184
|
+
code: "custom",
|
|
29185
|
+
path: ["unmentionedMemberId"],
|
|
29186
|
+
message: 'A default member can only be set when unmentionedPolicy is "none"'
|
|
29187
|
+
});
|
|
29188
|
+
}
|
|
29063
29189
|
});
|
|
29064
29190
|
var groupsDeleteParamsSchema = external_exports.strictObject(roomIdentity);
|
|
29065
29191
|
var groupsDeleteResultSchema = external_exports.object({ deleted: external_exports.boolean() });
|
|
@@ -29074,17 +29200,94 @@ var groupsAddMemberResultSchema = external_exports.object({
|
|
|
29074
29200
|
var groupsUpdateMemberParamsSchema = external_exports.strictObject({
|
|
29075
29201
|
...memberIdentity,
|
|
29076
29202
|
...optionalMemberEdits,
|
|
29077
|
-
status: groupMemberStatusSchema.optional()
|
|
29203
|
+
status: groupMemberStatusSchema.optional(),
|
|
29204
|
+
showInSidebar: external_exports.boolean().optional()
|
|
29078
29205
|
});
|
|
29079
29206
|
var groupsRemoveMemberParamsSchema = external_exports.strictObject(memberIdentity);
|
|
29207
|
+
var groupsRebindMemberParamsSchema = external_exports.strictObject({
|
|
29208
|
+
...memberIdentity,
|
|
29209
|
+
threadId: hostThreadIdSchema,
|
|
29210
|
+
redeliverFrom: positiveInteger.optional(),
|
|
29211
|
+
note: external_exports.string().optional()
|
|
29212
|
+
});
|
|
29213
|
+
var groupCliRebindMemberParamsSchema = external_exports.strictObject({
|
|
29214
|
+
...roomIdentity,
|
|
29215
|
+
memberId: groupMemberIdSchema.optional(),
|
|
29216
|
+
memberHandle: groupMemberHandleSchema.optional(),
|
|
29217
|
+
threadId: hostThreadIdSchema,
|
|
29218
|
+
redeliverFrom: positiveInteger.optional(),
|
|
29219
|
+
note: external_exports.string().optional()
|
|
29220
|
+
}).refine((value) => value.memberId !== void 0 !== (value.memberHandle !== void 0), "Provide exactly one of memberId or memberHandle");
|
|
29221
|
+
var groupsRebindMemberResultSchema = external_exports.object({
|
|
29222
|
+
room: groupRoomSchema,
|
|
29223
|
+
member: groupMemberSchema,
|
|
29224
|
+
previousThreadId: hostThreadIdSchema,
|
|
29225
|
+
awakened: external_exports.boolean()
|
|
29226
|
+
});
|
|
29227
|
+
var groupCliListMemberSchema = external_exports.object({
|
|
29228
|
+
memberId: groupMemberIdSchema,
|
|
29229
|
+
threadId: hostThreadIdSchema,
|
|
29230
|
+
handle: groupMemberHandleSchema,
|
|
29231
|
+
displayName: nonblankString,
|
|
29232
|
+
status: groupMemberStatusSchema,
|
|
29233
|
+
harnessId: harnessIdSchema,
|
|
29234
|
+
roleSlug: roleSlugSchema.optional(),
|
|
29235
|
+
roleName: nonblankString.optional()
|
|
29236
|
+
});
|
|
29237
|
+
var groupCliListEntrySchema = external_exports.object({
|
|
29238
|
+
roomId: groupRoomIdSchema,
|
|
29239
|
+
title: nonblankString,
|
|
29240
|
+
memberCount: nonnegativeInteger,
|
|
29241
|
+
updatedAt: timestamp,
|
|
29242
|
+
member: groupCliListMemberSchema.optional()
|
|
29243
|
+
});
|
|
29244
|
+
var groupCliListParamsSchema = external_exports.strictObject({
|
|
29245
|
+
threadId: hostThreadIdSchema.optional()
|
|
29246
|
+
});
|
|
29247
|
+
var groupCliListResultSchema = external_exports.object({
|
|
29248
|
+
rooms: external_exports.array(groupCliListEntrySchema)
|
|
29249
|
+
});
|
|
29080
29250
|
var groupsPostMessageParamsSchema = external_exports.strictObject({
|
|
29081
29251
|
...roomIdentity,
|
|
29082
29252
|
content: external_exports.string().max(64e3),
|
|
29083
29253
|
attachments: external_exports.array(groupAttachmentSchema).max(12).optional(),
|
|
29084
29254
|
replyToSeq: positiveInteger.optional(),
|
|
29085
29255
|
targetMemberIds: external_exports.array(groupMemberIdSchema).optional(),
|
|
29086
|
-
mentionAll: external_exports.boolean().optional()
|
|
29087
|
-
|
|
29256
|
+
mentionAll: external_exports.boolean().optional(),
|
|
29257
|
+
notice: external_exports.boolean().optional()
|
|
29258
|
+
}).superRefine((value, context) => {
|
|
29259
|
+
if (value.notice === true) {
|
|
29260
|
+
if (value.content.trim().length === 0) {
|
|
29261
|
+
context.addIssue({
|
|
29262
|
+
code: "custom",
|
|
29263
|
+
path: ["content"],
|
|
29264
|
+
message: "Notice content is required"
|
|
29265
|
+
});
|
|
29266
|
+
}
|
|
29267
|
+
if (value.content.length > GROUP_NOTICE_MAX_LENGTH) {
|
|
29268
|
+
context.addIssue({
|
|
29269
|
+
code: "custom",
|
|
29270
|
+
path: ["content"],
|
|
29271
|
+
message: `Notice content must be at most ${GROUP_NOTICE_MAX_LENGTH} characters`
|
|
29272
|
+
});
|
|
29273
|
+
}
|
|
29274
|
+
if ((value.targetMemberIds?.length ?? 0) > 0 || value.mentionAll === true || (value.attachments?.length ?? 0) > 0) {
|
|
29275
|
+
context.addIssue({
|
|
29276
|
+
code: "custom",
|
|
29277
|
+
path: ["notice"],
|
|
29278
|
+
message: "System notices cannot target members or include attachments"
|
|
29279
|
+
});
|
|
29280
|
+
}
|
|
29281
|
+
return;
|
|
29282
|
+
}
|
|
29283
|
+
if (value.content.trim().length === 0 && (value.attachments?.length ?? 0) === 0) {
|
|
29284
|
+
context.addIssue({
|
|
29285
|
+
code: "custom",
|
|
29286
|
+
path: ["content"],
|
|
29287
|
+
message: "Message content or at least one attachment is required"
|
|
29288
|
+
});
|
|
29289
|
+
}
|
|
29290
|
+
});
|
|
29088
29291
|
var groupsPostMessageResultSchema = external_exports.object({
|
|
29089
29292
|
room: groupRoomSchema,
|
|
29090
29293
|
message: groupMessageSchema,
|
|
@@ -29101,6 +29304,31 @@ var groupsReadMessagesResultSchema = external_exports.object({
|
|
|
29101
29304
|
messages: external_exports.array(groupMessageSchema),
|
|
29102
29305
|
totalSeq: nonnegativeInteger
|
|
29103
29306
|
});
|
|
29307
|
+
var groupsReadMemoryParamsSchema = external_exports.strictObject(roomIdentity);
|
|
29308
|
+
var groupsReadMemoryResultSchema = external_exports.object({
|
|
29309
|
+
...roomIdentity,
|
|
29310
|
+
memoryVersion: nonnegativeInteger,
|
|
29311
|
+
content: external_exports.string(),
|
|
29312
|
+
updatedAt: timestamp
|
|
29313
|
+
});
|
|
29314
|
+
var groupsUpdateMemoryParamsSchema = external_exports.strictObject({
|
|
29315
|
+
...roomIdentity,
|
|
29316
|
+
content: external_exports.string().refine((value) => groupUtf8ByteLength(value) <= GROUP_MEMORY_MAX_BYTES, `Shared room memory must be at most ${GROUP_MEMORY_MAX_BYTES} UTF-8 bytes`),
|
|
29317
|
+
expectedVersion: nonnegativeInteger.optional()
|
|
29318
|
+
});
|
|
29319
|
+
var groupsUpdateMemoryResultSchema = external_exports.object({
|
|
29320
|
+
room: groupRoomSchema,
|
|
29321
|
+
memoryVersion: nonnegativeInteger,
|
|
29322
|
+
content: external_exports.string(),
|
|
29323
|
+
updatedAt: timestamp
|
|
29324
|
+
});
|
|
29325
|
+
var groupsInspectCwdParamsSchema = external_exports.strictObject({
|
|
29326
|
+
cwd: nonblankString,
|
|
29327
|
+
roomId: groupRoomIdSchema.optional()
|
|
29328
|
+
});
|
|
29329
|
+
var groupsInspectCwdResultSchema = external_exports.object({
|
|
29330
|
+
isGitRepo: external_exports.boolean()
|
|
29331
|
+
});
|
|
29104
29332
|
|
|
29105
29333
|
// ../../shared-contracts/dist/thread-archive-confirm.js
|
|
29106
29334
|
var THREAD_ARCHIVE_CONFIRM_METHOD = "codexhost/thread/archive/confirm";
|
|
@@ -29147,6 +29375,7 @@ var TELEMETRY_OFFICIAL_HARNESSES = [
|
|
|
29147
29375
|
"kiro-cli",
|
|
29148
29376
|
"codebuddy",
|
|
29149
29377
|
"workbuddy",
|
|
29378
|
+
"workbuddy-cn",
|
|
29150
29379
|
"devin",
|
|
29151
29380
|
"hermes",
|
|
29152
29381
|
"qoder",
|
|
@@ -29228,6 +29457,149 @@ var nativeCodexGoalResultSchema = external_exports.object({
|
|
|
29228
29457
|
}).nullable()
|
|
29229
29458
|
});
|
|
29230
29459
|
|
|
29460
|
+
// ../../shared-contracts/dist/voice.js
|
|
29461
|
+
var VOICE_AUDIO_MAX_BYTES = 10 * 1024 * 1024;
|
|
29462
|
+
var VOICE_CONFIG_GET_METHOD = "codexhost/voice/config/get";
|
|
29463
|
+
var VOICE_CONFIG_SET_METHOD = "codexhost/voice/config/set";
|
|
29464
|
+
var voiceProviderModeSchema = external_exports.enum([
|
|
29465
|
+
"codex",
|
|
29466
|
+
"openai-compatible",
|
|
29467
|
+
"deepseek-asr",
|
|
29468
|
+
"openai-chat-audio"
|
|
29469
|
+
]);
|
|
29470
|
+
var voiceAudioFormatSchema = external_exports.enum(["native", "wav"]);
|
|
29471
|
+
var SENSITIVE_VOICE_QUERY_PARAM = /(?:^|[_-])(?:key|token|secret|password|passwd|pwd|auth|authorization|credential|signature|sig)(?:$|[_-])|(?:api|access|auth|client|app|private|bearer)[_-]?(?:key|token|secret)/i;
|
|
29472
|
+
function isLoopbackVoiceHost(hostname3) {
|
|
29473
|
+
const bare = hostname3.trim().toLowerCase().replace(/^\[|\]$/g, "");
|
|
29474
|
+
if (bare === "localhost" || bare.endsWith(".localhost") || bare === "::1")
|
|
29475
|
+
return true;
|
|
29476
|
+
return /^127(?:\.(?:25[0-5]|2[0-4]\d|1?\d?\d)){3}$/.test(bare);
|
|
29477
|
+
}
|
|
29478
|
+
function isValidVoiceBaseUrl(value) {
|
|
29479
|
+
const trimmed = value.trim();
|
|
29480
|
+
if (!trimmed)
|
|
29481
|
+
return false;
|
|
29482
|
+
try {
|
|
29483
|
+
const parsed = new URL(trimmed);
|
|
29484
|
+
if (!parsed.hostname)
|
|
29485
|
+
return false;
|
|
29486
|
+
if (parsed.username !== "" || parsed.password !== "" || parsed.hash !== "")
|
|
29487
|
+
return false;
|
|
29488
|
+
if (parsed.protocol === "https:") {
|
|
29489
|
+
} else if (parsed.protocol === "http:") {
|
|
29490
|
+
if (!isLoopbackVoiceHost(parsed.hostname))
|
|
29491
|
+
return false;
|
|
29492
|
+
} else {
|
|
29493
|
+
return false;
|
|
29494
|
+
}
|
|
29495
|
+
for (const key of parsed.searchParams.keys()) {
|
|
29496
|
+
if (SENSITIVE_VOICE_QUERY_PARAM.test(key))
|
|
29497
|
+
return false;
|
|
29498
|
+
}
|
|
29499
|
+
return true;
|
|
29500
|
+
} catch {
|
|
29501
|
+
return false;
|
|
29502
|
+
}
|
|
29503
|
+
}
|
|
29504
|
+
var voiceBaseUrlSchema = external_exports.string().max(2048).refine((value) => value === "" || isValidVoiceBaseUrl(value), {
|
|
29505
|
+
message: "Base URL must be empty or a valid https:// URL (http:// is allowed only for localhost/127.0.0.1/[::1]) without embedded credentials"
|
|
29506
|
+
});
|
|
29507
|
+
var voiceProviderConfigSnapshotSchema = external_exports.object({
|
|
29508
|
+
baseUrl: voiceBaseUrlSchema,
|
|
29509
|
+
model: external_exports.string().max(256),
|
|
29510
|
+
hasApiKey: external_exports.boolean(),
|
|
29511
|
+
apiKeyHint: external_exports.string().max(64).optional(),
|
|
29512
|
+
apiKey: external_exports.never().optional()
|
|
29513
|
+
});
|
|
29514
|
+
var voiceConfigSnapshotSchema = external_exports.object({
|
|
29515
|
+
mode: voiceProviderModeSchema,
|
|
29516
|
+
baseUrl: voiceBaseUrlSchema,
|
|
29517
|
+
model: external_exports.string().max(256),
|
|
29518
|
+
hasApiKey: external_exports.boolean(),
|
|
29519
|
+
apiKeyHint: external_exports.string().max(64).optional(),
|
|
29520
|
+
apiKey: external_exports.never().optional(),
|
|
29521
|
+
audioFormat: voiceAudioFormatSchema.optional(),
|
|
29522
|
+
providers: external_exports.object({
|
|
29523
|
+
"openai-compatible": voiceProviderConfigSnapshotSchema,
|
|
29524
|
+
"deepseek-asr": voiceProviderConfigSnapshotSchema,
|
|
29525
|
+
"openai-chat-audio": voiceProviderConfigSnapshotSchema
|
|
29526
|
+
}).optional(),
|
|
29527
|
+
codexAvailable: external_exports.boolean(),
|
|
29528
|
+
available: external_exports.boolean()
|
|
29529
|
+
});
|
|
29530
|
+
var voiceConfigUpdateParamsSchema = external_exports.object({
|
|
29531
|
+
mode: voiceProviderModeSchema,
|
|
29532
|
+
baseUrl: external_exports.string().max(2048).optional(),
|
|
29533
|
+
model: external_exports.string().max(256).optional(),
|
|
29534
|
+
apiKey: external_exports.string().max(4096).nullable().optional()
|
|
29535
|
+
}).strict().superRefine((value, ctx) => {
|
|
29536
|
+
const trimmedBaseUrl = value.baseUrl?.trim() ?? "";
|
|
29537
|
+
const trimmedModel = value.model?.trim() ?? "";
|
|
29538
|
+
if (value.mode === "openai-compatible") {
|
|
29539
|
+
if (!isValidVoiceBaseUrl(trimmedBaseUrl)) {
|
|
29540
|
+
ctx.addIssue({
|
|
29541
|
+
code: external_exports.ZodIssueCode.custom,
|
|
29542
|
+
path: ["baseUrl"],
|
|
29543
|
+
message: "OpenAI-compatible mode requires a valid https:// base URL (http:// is allowed only for loopback hosts)"
|
|
29544
|
+
});
|
|
29545
|
+
}
|
|
29546
|
+
return;
|
|
29547
|
+
}
|
|
29548
|
+
if (value.mode === "openai-chat-audio") {
|
|
29549
|
+
if (!isValidVoiceBaseUrl(trimmedBaseUrl)) {
|
|
29550
|
+
ctx.addIssue({
|
|
29551
|
+
code: external_exports.ZodIssueCode.custom,
|
|
29552
|
+
path: ["baseUrl"],
|
|
29553
|
+
message: "Multimodal Chat Audio mode requires a valid https:// base URL (http:// is allowed only for loopback hosts)"
|
|
29554
|
+
});
|
|
29555
|
+
}
|
|
29556
|
+
if (!trimmedModel) {
|
|
29557
|
+
ctx.addIssue({
|
|
29558
|
+
code: external_exports.ZodIssueCode.custom,
|
|
29559
|
+
path: ["model"],
|
|
29560
|
+
message: "Multimodal Chat Audio mode requires a model name"
|
|
29561
|
+
});
|
|
29562
|
+
}
|
|
29563
|
+
return;
|
|
29564
|
+
}
|
|
29565
|
+
if (trimmedBaseUrl !== "" && !isValidVoiceBaseUrl(trimmedBaseUrl)) {
|
|
29566
|
+
ctx.addIssue({
|
|
29567
|
+
code: external_exports.ZodIssueCode.custom,
|
|
29568
|
+
path: ["baseUrl"],
|
|
29569
|
+
message: "Base URL must be empty or a valid https:// URL (http:// is allowed only for loopback hosts)"
|
|
29570
|
+
});
|
|
29571
|
+
}
|
|
29572
|
+
});
|
|
29573
|
+
var voiceAudioMimeTypeSchema = external_exports.string().regex(/^audio\/[a-z0-9.+-]+(?:\s*;[^\r\n]*)?$/i);
|
|
29574
|
+
var voiceStatusResultSchema = external_exports.object({
|
|
29575
|
+
available: external_exports.boolean(),
|
|
29576
|
+
audioFormat: voiceAudioFormatSchema.optional()
|
|
29577
|
+
});
|
|
29578
|
+
var voiceTranscribeParamsSchema = external_exports.object({ path: external_exports.string().min(1), mimeType: voiceAudioMimeTypeSchema }).strict();
|
|
29579
|
+
var voiceErrorCodeSchema = external_exports.enum([
|
|
29580
|
+
"credentials-unavailable",
|
|
29581
|
+
"login-expired",
|
|
29582
|
+
"rate-limited",
|
|
29583
|
+
"service-rejected",
|
|
29584
|
+
"host-incompatible",
|
|
29585
|
+
"network",
|
|
29586
|
+
"timeout",
|
|
29587
|
+
"audio-empty",
|
|
29588
|
+
"audio-too-large",
|
|
29589
|
+
"audio-format",
|
|
29590
|
+
"audio-invalid"
|
|
29591
|
+
]);
|
|
29592
|
+
var voiceTranscribeResultSchema = external_exports.discriminatedUnion("ok", [
|
|
29593
|
+
external_exports.object({ ok: external_exports.literal(true), text: external_exports.string() }).strict(),
|
|
29594
|
+
external_exports.object({ ok: external_exports.literal(false), error: external_exports.object({ code: voiceErrorCodeSchema }).strict() }).strict()
|
|
29595
|
+
]);
|
|
29596
|
+
|
|
29597
|
+
// ../../shared-contracts/dist/github-star.js
|
|
29598
|
+
var GITHUB_STAR_STATUS_METHOD = "codexhost/githubStar/status";
|
|
29599
|
+
var GITHUB_STAR_ADD_METHOD = "codexhost/githubStar/star";
|
|
29600
|
+
var githubStarParamsSchema = external_exports.object({}).strict();
|
|
29601
|
+
var githubStarStateSchema = external_exports.object({ ghAvailable: external_exports.boolean(), starred: external_exports.boolean() });
|
|
29602
|
+
|
|
29231
29603
|
// ../../shared-contracts/dist/client-channel.js
|
|
29232
29604
|
var CLIENT_CHANNEL_VERSION = 1;
|
|
29233
29605
|
var CLIENT_REQUEST_LIMIT_BYTES = 128 * 1024 * 1024;
|
|
@@ -29286,10 +29658,16 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
29286
29658
|
GROUPS_ADD_MEMBER_METHOD,
|
|
29287
29659
|
GROUPS_UPDATE_MEMBER_METHOD,
|
|
29288
29660
|
GROUPS_REMOVE_MEMBER_METHOD,
|
|
29661
|
+
GROUPS_REBIND_MEMBER_METHOD,
|
|
29289
29662
|
GROUPS_POST_MESSAGE_METHOD,
|
|
29290
29663
|
GROUPS_READ_MESSAGES_METHOD,
|
|
29664
|
+
GROUPS_READ_MEMORY_METHOD,
|
|
29665
|
+
GROUPS_UPDATE_MEMORY_METHOD,
|
|
29666
|
+
GROUPS_INSPECT_CWD_METHOD,
|
|
29291
29667
|
"codexhost/voice/status",
|
|
29292
29668
|
"codexhost/voice/transcribe",
|
|
29669
|
+
VOICE_CONFIG_GET_METHOD,
|
|
29670
|
+
VOICE_CONFIG_SET_METHOD,
|
|
29293
29671
|
"codexhost/harness/display-settings/get",
|
|
29294
29672
|
"codexhost/harness/display-settings/set",
|
|
29295
29673
|
"codexhost/harness/display-settings/capabilities",
|
|
@@ -29355,6 +29733,8 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
29355
29733
|
"codexhost/harness/session-import/list",
|
|
29356
29734
|
"codexhost/harness/session-import/import",
|
|
29357
29735
|
// Host settings shared across Desktop and Web.
|
|
29736
|
+
GITHUB_STAR_STATUS_METHOD,
|
|
29737
|
+
GITHUB_STAR_ADD_METHOD,
|
|
29358
29738
|
...HOST_EXTENSION_MANAGEMENT_METHODS,
|
|
29359
29739
|
"codexhost/harness/installation",
|
|
29360
29740
|
"codexhost/harness/installation/start",
|
|
@@ -29694,28 +30074,16 @@ var extensionActivitySchema = external_exports.strictObject({
|
|
|
29694
30074
|
})).max(256)
|
|
29695
30075
|
});
|
|
29696
30076
|
|
|
29697
|
-
// ../../shared-contracts/dist/
|
|
29698
|
-
var
|
|
29699
|
-
var
|
|
29700
|
-
|
|
29701
|
-
|
|
29702
|
-
|
|
29703
|
-
"
|
|
29704
|
-
"
|
|
29705
|
-
"
|
|
29706
|
-
|
|
29707
|
-
"host-incompatible",
|
|
29708
|
-
"network",
|
|
29709
|
-
"timeout",
|
|
29710
|
-
"audio-empty",
|
|
29711
|
-
"audio-too-large",
|
|
29712
|
-
"audio-format",
|
|
29713
|
-
"audio-invalid"
|
|
29714
|
-
]);
|
|
29715
|
-
var voiceTranscribeResultSchema = external_exports.discriminatedUnion("ok", [
|
|
29716
|
-
external_exports.object({ ok: external_exports.literal(true), text: external_exports.string() }).strict(),
|
|
29717
|
-
external_exports.object({ ok: external_exports.literal(false), error: external_exports.object({ code: voiceErrorCodeSchema }).strict() }).strict()
|
|
29718
|
-
]);
|
|
30077
|
+
// ../../shared-contracts/dist/host-extension-ranking.js
|
|
30078
|
+
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
30079
|
+
var CATEGORY_SEARCH_LABELS = Object.freeze({
|
|
30080
|
+
appearance: ["appearance", "外观主题"],
|
|
30081
|
+
interface: ["interface", "界面增强"],
|
|
30082
|
+
workflow: ["workflow", "效率与协作"],
|
|
30083
|
+
analytics: ["analytics", "数据与统计"],
|
|
30084
|
+
integrations: ["integrations", "外部集成"],
|
|
30085
|
+
tools: ["tools", "实用工具"]
|
|
30086
|
+
});
|
|
29719
30087
|
|
|
29720
30088
|
// ../../shared-contracts/dist/skills.js
|
|
29721
30089
|
var skillsListParamsSchema = external_exports.object({
|
|
@@ -29852,7 +30220,23 @@ var REMOTE_PEER_ID_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/u;
|
|
|
29852
30220
|
var remotePeerIdSchema = external_exports.string().regex(REMOTE_PEER_ID_PATTERN);
|
|
29853
30221
|
var remotePeerNodeIdSchema = external_exports.string().regex(REMOTE_PEER_ID_PATTERN);
|
|
29854
30222
|
var remotePeerHostIdSchema = external_exports.string().regex(/^remote-peer:[a-zA-Z0-9_-]{1,64}$/u);
|
|
29855
|
-
var remotePeerTransportKindSchema = external_exports.enum(["relay", "tailscale", "lan", "custom"]);
|
|
30223
|
+
var remotePeerTransportKindSchema = external_exports.enum(["relay", "tailscale", "lan", "ssh", "custom"]);
|
|
30224
|
+
var remotePeerSshAuthModeSchema = external_exports.enum(["auto", "key", "password"]);
|
|
30225
|
+
var remotePeerSshConfigSchema = external_exports.object({
|
|
30226
|
+
host: external_exports.string().trim().min(1).max(255),
|
|
30227
|
+
port: external_exports.number().int().min(1).max(65535).optional(),
|
|
30228
|
+
user: external_exports.string().trim().min(1).max(128).optional(),
|
|
30229
|
+
identityFile: external_exports.string().trim().min(1).max(1024).optional(),
|
|
30230
|
+
authMode: remotePeerSshAuthModeSchema.default("auto"),
|
|
30231
|
+
remoteDataDir: external_exports.string().trim().min(1).max(1024).optional()
|
|
30232
|
+
});
|
|
30233
|
+
var remotePeerSshSummarySchema = external_exports.object({
|
|
30234
|
+
host: external_exports.string().min(1).max(255),
|
|
30235
|
+
port: external_exports.number().int().min(1).max(65535).optional(),
|
|
30236
|
+
user: external_exports.string().min(1).max(128).optional(),
|
|
30237
|
+
authMode: remotePeerSshAuthModeSchema,
|
|
30238
|
+
keyInstalled: external_exports.boolean().optional()
|
|
30239
|
+
});
|
|
29856
30240
|
var REMOTE_PEER_COLORS = [
|
|
29857
30241
|
"blue",
|
|
29858
30242
|
"purple",
|
|
@@ -29879,6 +30263,7 @@ var remotePeerSummarySchema = external_exports.object({
|
|
|
29879
30263
|
color: remotePeerColorSchema.optional(),
|
|
29880
30264
|
origin: external_exports.string().min(1).max(2048),
|
|
29881
30265
|
transportKind: remotePeerTransportKindSchema,
|
|
30266
|
+
ssh: remotePeerSshSummarySchema.optional(),
|
|
29882
30267
|
encrypted: external_exports.boolean(),
|
|
29883
30268
|
enabled: external_exports.boolean(),
|
|
29884
30269
|
state: remotePeerStateSchema,
|
|
@@ -30007,7 +30392,13 @@ var remotePeerCapabilitiesSchema = external_exports.object({
|
|
|
30007
30392
|
/** /api/peer/v1/delegation is available for fixed-whitelist cross-host delegation. */
|
|
30008
30393
|
delegation: external_exports.literal(1).optional(),
|
|
30009
30394
|
/** POST /api/peer/v1/peers is available. */
|
|
30010
|
-
peerPairing: external_exports.literal(1).optional()
|
|
30395
|
+
peerPairing: external_exports.literal(1).optional(),
|
|
30396
|
+
/** Host supports includeOperations on extensions/list and expectedVersion on extensions/update. */
|
|
30397
|
+
extensionUpdateTracking: external_exports.literal(1).optional(),
|
|
30398
|
+
/** Peer supports per-member `showInSidebar` in `codexhost/groups/member/update`. */
|
|
30399
|
+
groupMemberSidebarVisibility: external_exports.literal(1).optional(),
|
|
30400
|
+
/** Peer supports `codexhost/groups/memory/read` and `codexhost/groups/memory/update`. */
|
|
30401
|
+
groupSharedMemory: external_exports.literal(1).optional()
|
|
30011
30402
|
});
|
|
30012
30403
|
var remotePeerManifestSchema = external_exports.object({
|
|
30013
30404
|
version: external_exports.string().max(128),
|
|
@@ -30126,8 +30517,66 @@ var delegationHostHarnessOptionSchema = external_exports.object({
|
|
|
30126
30517
|
var delegationHostHarnessesResultSchema = external_exports.object({
|
|
30127
30518
|
harnesses: external_exports.array(delegationHostHarnessOptionSchema)
|
|
30128
30519
|
});
|
|
30520
|
+
var sshConfigHostEntrySchema = external_exports.object({
|
|
30521
|
+
alias: external_exports.string().min(1).max(255),
|
|
30522
|
+
hostName: external_exports.string().max(255).optional(),
|
|
30523
|
+
user: external_exports.string().max(128).optional(),
|
|
30524
|
+
port: external_exports.number().int().min(1).max(65535).optional(),
|
|
30525
|
+
identityFile: external_exports.string().max(1024).optional()
|
|
30526
|
+
});
|
|
30527
|
+
var remotePeerListSshConfigHostsResultSchema = external_exports.object({
|
|
30528
|
+
hosts: external_exports.array(sshConfigHostEntrySchema)
|
|
30529
|
+
});
|
|
30530
|
+
var remotePeerSshConnectParamsSchema = external_exports.object({
|
|
30531
|
+
host: external_exports.string().trim().min(1).max(255),
|
|
30532
|
+
port: external_exports.number().int().min(1).max(65535).optional(),
|
|
30533
|
+
user: external_exports.string().trim().min(1).max(128).optional(),
|
|
30534
|
+
identityFile: external_exports.string().trim().min(1).max(1024).optional(),
|
|
30535
|
+
authMode: remotePeerSshAuthModeSchema.default("auto"),
|
|
30536
|
+
password: external_exports.string().max(1024).optional(),
|
|
30537
|
+
installAuthorizedKey: external_exports.boolean().optional(),
|
|
30538
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
30539
|
+
color: remotePeerColorSchema.optional(),
|
|
30540
|
+
remoteDataDir: external_exports.string().trim().min(1).max(1024).optional(),
|
|
30541
|
+
sessionId: external_exports.string().min(1).max(128).optional()
|
|
30542
|
+
});
|
|
30543
|
+
var remotePeerSshTestResultSchema = external_exports.object({
|
|
30544
|
+
ok: external_exports.boolean(),
|
|
30545
|
+
codexhostInstalled: external_exports.boolean(),
|
|
30546
|
+
version: external_exports.string().max(128).optional(),
|
|
30547
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
30548
|
+
platform: external_exports.string().max(64).optional(),
|
|
30549
|
+
hostname: external_exports.string().max(255).optional(),
|
|
30550
|
+
latencyMs: external_exports.number().int().nonnegative().optional(),
|
|
30551
|
+
errorCode: external_exports.string().max(128).optional(),
|
|
30552
|
+
error: external_exports.string().max(1e3).optional()
|
|
30553
|
+
});
|
|
30554
|
+
var remotePeerSshInstallResultSchema = external_exports.object({
|
|
30555
|
+
ok: external_exports.boolean(),
|
|
30556
|
+
version: external_exports.string().max(128).optional(),
|
|
30557
|
+
message: external_exports.string().max(1e3).optional()
|
|
30558
|
+
});
|
|
30559
|
+
var remotePeerSshAuthPromptSchema = external_exports.object({
|
|
30560
|
+
promptId: external_exports.string().min(1).max(128),
|
|
30561
|
+
sessionId: external_exports.string().min(1).max(128).optional(),
|
|
30562
|
+
peerId: remotePeerIdSchema.optional(),
|
|
30563
|
+
host: external_exports.string().min(1).max(255),
|
|
30564
|
+
kind: external_exports.enum(["host-key", "password", "passphrase", "otp", "generic"]),
|
|
30565
|
+
prompt: external_exports.string().min(1).max(1e3),
|
|
30566
|
+
echo: external_exports.boolean()
|
|
30567
|
+
});
|
|
30568
|
+
var remotePeerSshRespondAuthParamsSchema = external_exports.object({
|
|
30569
|
+
promptId: external_exports.string().min(1).max(128),
|
|
30570
|
+
sessionId: external_exports.string().min(1).max(128).optional(),
|
|
30571
|
+
response: external_exports.string().max(1024).optional(),
|
|
30572
|
+
cancel: external_exports.boolean().optional()
|
|
30573
|
+
});
|
|
30129
30574
|
|
|
30130
30575
|
// ../../shared-contracts/dist/peer-delegation.js
|
|
30576
|
+
var peerWatchNudgeParamsSchema = external_exports.strictObject({
|
|
30577
|
+
hostId: remotePeerHostIdSchema,
|
|
30578
|
+
threadId: external_exports.string().min(1).max(1024).optional()
|
|
30579
|
+
});
|
|
30131
30580
|
var PEER_DELEGATION_BRIDGE_VERSION = 1;
|
|
30132
30581
|
var PEER_DELEGATION_OPERATIONS = [
|
|
30133
30582
|
"listHarnesses",
|
|
@@ -30311,11 +30760,12 @@ var delegationDefaultsSchema = external_exports.strictObject({
|
|
|
30311
30760
|
byHarness: external_exports.record(preferenceHarnessKey, harnessDelegationDefaultSchema)
|
|
30312
30761
|
});
|
|
30313
30762
|
var modelId = external_exports.string().min(1).max(1024);
|
|
30314
|
-
var harnessPreferenceValuesSchema = external_exports.
|
|
30763
|
+
var harnessPreferenceValuesSchema = external_exports.object({
|
|
30315
30764
|
idleRelease: idleReleaseSettingsSchema.optional(),
|
|
30316
30765
|
favorites: external_exports.record(preferenceHarnessKey, external_exports.array(modelId).max(2048)).default({}),
|
|
30317
30766
|
newThread: newThreadDefaultsSchema.optional(),
|
|
30318
|
-
delegation: delegationDefaultsSchema.optional()
|
|
30767
|
+
delegation: delegationDefaultsSchema.optional(),
|
|
30768
|
+
showGroupChatsInSidebar: external_exports.boolean().optional()
|
|
30319
30769
|
});
|
|
30320
30770
|
var harnessPreferenceSnapshotSchema = external_exports.strictObject({
|
|
30321
30771
|
scope: harnessPreferenceScopeSchema,
|
|
@@ -30348,6 +30798,10 @@ var harnessPreferenceOperationSchema = external_exports.discriminatedUnion("kind
|
|
|
30348
30798
|
kind: external_exports.literal("delegation"),
|
|
30349
30799
|
harnessId: harnessIdSchema,
|
|
30350
30800
|
configuration: harnessDelegationDefaultSchema.nullable()
|
|
30801
|
+
}),
|
|
30802
|
+
external_exports.strictObject({
|
|
30803
|
+
kind: external_exports.literal("groupChatsSidebar"),
|
|
30804
|
+
visible: external_exports.boolean()
|
|
30351
30805
|
})
|
|
30352
30806
|
]);
|
|
30353
30807
|
var harnessPreferencePatchSchema = external_exports.strictObject({
|
|
@@ -31184,7 +31638,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
31184
31638
|
"unreadable",
|
|
31185
31639
|
"notFound"
|
|
31186
31640
|
];
|
|
31187
|
-
var ENTRY_PATTERN = new RegExp(String.raw`^- \[([^\]\n]+)\]\(thread://([^\s()<>"?#/]+)
|
|
31641
|
+
var ENTRY_PATTERN = new RegExp(String.raw`^- \[([^\]\n]+)\]\(thread://([^\s()<>"?#/]+)(?:\?hostId=([^\s()<>"?#/&]+))?\): ` + `(${THREAD_WATCH_NOTICE_OUTCOMES.join("|")})(?:. (.+))?$`, "u");
|
|
31188
31642
|
|
|
31189
31643
|
// ../../shared-contracts/dist/remote-runtime.js
|
|
31190
31644
|
var remoteUpdatePhaseSchema = external_exports.enum([
|
|
@@ -31213,7 +31667,7 @@ var remoteSshSetupParamsSchema = external_exports.object({
|
|
|
31213
31667
|
hostname: external_exports.string().min(1).max(1024).refine((value) => !value.startsWith("-") && !/\s/u.test(value)),
|
|
31214
31668
|
port: external_exports.number().int().min(1).max(65535).nullable(),
|
|
31215
31669
|
identity: external_exports.string().max(4096).nullable(),
|
|
31216
|
-
action: external_exports.enum(["inspect", "install", "update", "repair", "uninstall"]),
|
|
31670
|
+
action: external_exports.enum(["inspect", "install", "update", "restart", "repair", "uninstall"]),
|
|
31217
31671
|
uninstallPackage: external_exports.boolean().optional(),
|
|
31218
31672
|
version: external_exports.string().regex(/^\d+\.\d+\.\d+$/u).nullable()
|
|
31219
31673
|
}).strict();
|
|
@@ -31229,6 +31683,7 @@ var target = {
|
|
|
31229
31683
|
var thread2 = { ...target, threadId: identity };
|
|
31230
31684
|
var text = external_exports.string().min(1).max(8e3);
|
|
31231
31685
|
var input2 = { text, requestId: identity };
|
|
31686
|
+
var queueReorderItemIdsSchema = external_exports.array(identity).min(2).max(100).refine((ids) => new Set(ids).size === ids.length, "Queued submission IDs must be distinct");
|
|
31232
31687
|
var remoteDeliveryReplySchema = external_exports.discriminatedUnion("accepted", [
|
|
31233
31688
|
external_exports.object({ accepted: external_exports.literal(true), startQueuedItemId: identity.optional() }),
|
|
31234
31689
|
external_exports.object({
|
|
@@ -31248,6 +31703,7 @@ var remoteQueueSnapshotSchema = external_exports.discriminatedUnion("available",
|
|
|
31248
31703
|
external_exports.object({ available: external_exports.literal(false) }),
|
|
31249
31704
|
external_exports.object({
|
|
31250
31705
|
available: external_exports.literal(true),
|
|
31706
|
+
canReorder: external_exports.literal(true).optional(),
|
|
31251
31707
|
items: external_exports.array(external_exports.object({ id: identity, clientUserMessageId: identity, preview: external_exports.string().max(801) })).max(100)
|
|
31252
31708
|
})
|
|
31253
31709
|
]);
|
|
@@ -31325,6 +31781,7 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
|
31325
31781
|
external_exports.strictObject({ kind: external_exports.literal("enqueue"), ...input2 }),
|
|
31326
31782
|
external_exports.strictObject({ kind: external_exports.literal("steer"), ...input2, turnId: identity }),
|
|
31327
31783
|
external_exports.strictObject({ kind: external_exports.literal("remove"), itemId: identity }),
|
|
31784
|
+
external_exports.strictObject({ kind: external_exports.literal("reorder"), itemIds: queueReorderItemIdsSchema }),
|
|
31328
31785
|
external_exports.strictObject({
|
|
31329
31786
|
kind: external_exports.literal("start"),
|
|
31330
31787
|
itemId: identity,
|
|
@@ -39059,9 +39516,12 @@ import path11 from "node:path";
|
|
|
39059
39516
|
import { setTimeout as delay2 } from "node:timers/promises";
|
|
39060
39517
|
|
|
39061
39518
|
// dist/usage-statistics.js
|
|
39519
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
39520
|
+
import { realpathSync } from "node:fs";
|
|
39062
39521
|
import { lstat, readdir } from "node:fs/promises";
|
|
39063
39522
|
import os3 from "node:os";
|
|
39064
39523
|
import path10 from "node:path";
|
|
39524
|
+
import { fileURLToPath } from "node:url";
|
|
39065
39525
|
|
|
39066
39526
|
// ../../harness-adapter/dist/usage-statistics.js
|
|
39067
39527
|
import { createReadStream as createReadStream2 } from "node:fs";
|
|
@@ -39214,6 +39674,158 @@ async function transcriptFingerprint(file2) {
|
|
|
39214
39674
|
return info?.isFile() && info.size > 0 ? `${info.ino}:${info.size}:${info.mtimeMs}` : null;
|
|
39215
39675
|
}
|
|
39216
39676
|
var LIST_CONCURRENCY = 32;
|
|
39677
|
+
var WINDOWS_DRIVE_URI_PATH = /^\/[A-Za-z](?::|%3[Aa])(?:\/|$)/u;
|
|
39678
|
+
var WINDOWS_DRIVE_PATH = /^[A-Za-z]:[\\/]/u;
|
|
39679
|
+
var POSIX_TEMP_DIR_PREFIXES = [
|
|
39680
|
+
"/tmp/",
|
|
39681
|
+
"/private/tmp/",
|
|
39682
|
+
"/var/tmp/",
|
|
39683
|
+
"/private/var/tmp/",
|
|
39684
|
+
"/var/folders/",
|
|
39685
|
+
"/private/var/folders/"
|
|
39686
|
+
];
|
|
39687
|
+
var WINDOWS_TEMP_DIR_PATTERNS = [
|
|
39688
|
+
/^[a-z]:\/users\/[^/]+\/appdata\/local\/temp\//u,
|
|
39689
|
+
/^[a-z]:\/windows\/temp\//u
|
|
39690
|
+
];
|
|
39691
|
+
function normalizeForFilter(target2) {
|
|
39692
|
+
const slashed = target2.replaceAll("\\", "/");
|
|
39693
|
+
return slashed.endsWith("/") ? slashed : `${slashed}/`;
|
|
39694
|
+
}
|
|
39695
|
+
function isFilesystemRoot(target2) {
|
|
39696
|
+
return target2 === "/" || /^[A-Za-z]:\\$/u.test(target2);
|
|
39697
|
+
}
|
|
39698
|
+
function runtimeTempPrefixes(environment) {
|
|
39699
|
+
const prefixes = /* @__PURE__ */ new Set();
|
|
39700
|
+
const add = (directory) => {
|
|
39701
|
+
if (!directory)
|
|
39702
|
+
return;
|
|
39703
|
+
const trimmed = directory.trim();
|
|
39704
|
+
if (!trimmed)
|
|
39705
|
+
return;
|
|
39706
|
+
const normalized = normalizeForFilter(trimmed).toLowerCase();
|
|
39707
|
+
if (normalized === "/" || /^[a-z]:\/$/u.test(normalized))
|
|
39708
|
+
return;
|
|
39709
|
+
prefixes.add(normalized);
|
|
39710
|
+
};
|
|
39711
|
+
const candidates = [os3.tmpdir(), environment.TMPDIR, environment.TEMP, environment.TMP];
|
|
39712
|
+
for (const candidate of candidates) {
|
|
39713
|
+
if (!candidate)
|
|
39714
|
+
continue;
|
|
39715
|
+
add(candidate);
|
|
39716
|
+
try {
|
|
39717
|
+
add(realpathSync(candidate));
|
|
39718
|
+
} catch {
|
|
39719
|
+
}
|
|
39720
|
+
}
|
|
39721
|
+
return [...prefixes];
|
|
39722
|
+
}
|
|
39723
|
+
function decodeWorkspaceUri(raw) {
|
|
39724
|
+
if (typeof raw !== "string" || raw.length === 0 || raw.includes("\0"))
|
|
39725
|
+
return null;
|
|
39726
|
+
let candidate = raw.trim();
|
|
39727
|
+
if (!candidate)
|
|
39728
|
+
return null;
|
|
39729
|
+
if (/^file:/iu.test(candidate)) {
|
|
39730
|
+
let url2;
|
|
39731
|
+
try {
|
|
39732
|
+
url2 = new URL(candidate);
|
|
39733
|
+
} catch {
|
|
39734
|
+
return null;
|
|
39735
|
+
}
|
|
39736
|
+
if (url2.protocol !== "file:")
|
|
39737
|
+
return null;
|
|
39738
|
+
if (url2.hostname && url2.hostname.toLowerCase() !== "localhost")
|
|
39739
|
+
return null;
|
|
39740
|
+
try {
|
|
39741
|
+
const windows = WINDOWS_DRIVE_URI_PATH.test(url2.pathname);
|
|
39742
|
+
candidate = fileURLToPath(url2, { windows });
|
|
39743
|
+
} catch {
|
|
39744
|
+
return null;
|
|
39745
|
+
}
|
|
39746
|
+
}
|
|
39747
|
+
if (candidate.includes("\0"))
|
|
39748
|
+
return null;
|
|
39749
|
+
if (WINDOWS_DRIVE_PATH.test(candidate)) {
|
|
39750
|
+
return path10.win32.resolve(candidate);
|
|
39751
|
+
}
|
|
39752
|
+
if (candidate.startsWith("/")) {
|
|
39753
|
+
return path10.posix.resolve(candidate);
|
|
39754
|
+
}
|
|
39755
|
+
return null;
|
|
39756
|
+
}
|
|
39757
|
+
function isIgnoredWorkspacePath(cwd, tempPrefixes) {
|
|
39758
|
+
const lower = normalizeForFilter(cwd).toLowerCase();
|
|
39759
|
+
if (lower.includes("/antigravity-history/hooks/"))
|
|
39760
|
+
return true;
|
|
39761
|
+
if (POSIX_TEMP_DIR_PREFIXES.some((prefix) => lower.startsWith(prefix)))
|
|
39762
|
+
return true;
|
|
39763
|
+
if (WINDOWS_TEMP_DIR_PATTERNS.some((pattern) => pattern.test(lower)))
|
|
39764
|
+
return true;
|
|
39765
|
+
return tempPrefixes.some((prefix) => lower.startsWith(prefix));
|
|
39766
|
+
}
|
|
39767
|
+
function selectWorkspaceCwd(raw, tempPrefixes) {
|
|
39768
|
+
if (typeof raw !== "string" || raw.length === 0)
|
|
39769
|
+
return void 0;
|
|
39770
|
+
let uris;
|
|
39771
|
+
try {
|
|
39772
|
+
uris = JSON.parse(raw);
|
|
39773
|
+
} catch {
|
|
39774
|
+
return void 0;
|
|
39775
|
+
}
|
|
39776
|
+
if (!Array.isArray(uris))
|
|
39777
|
+
return void 0;
|
|
39778
|
+
let rootFallback;
|
|
39779
|
+
for (const uri of uris) {
|
|
39780
|
+
const cwd = decodeWorkspaceUri(uri);
|
|
39781
|
+
if (!cwd || isIgnoredWorkspacePath(cwd, tempPrefixes))
|
|
39782
|
+
continue;
|
|
39783
|
+
if (!isFilesystemRoot(cwd))
|
|
39784
|
+
return cwd;
|
|
39785
|
+
rootFallback ??= cwd;
|
|
39786
|
+
}
|
|
39787
|
+
return rootFallback;
|
|
39788
|
+
}
|
|
39789
|
+
async function readSummaryWorkspaces(dbPath, environment, signal) {
|
|
39790
|
+
signal.throwIfAborted();
|
|
39791
|
+
let info;
|
|
39792
|
+
try {
|
|
39793
|
+
info = await lstatIfPresent(dbPath);
|
|
39794
|
+
} catch {
|
|
39795
|
+
return { workspaces: /* @__PURE__ */ new Map(), cacheable: false };
|
|
39796
|
+
}
|
|
39797
|
+
if (!info?.isFile())
|
|
39798
|
+
return { workspaces: /* @__PURE__ */ new Map(), cacheable: true };
|
|
39799
|
+
let db;
|
|
39800
|
+
try {
|
|
39801
|
+
const { DatabaseSync } = await import("node:sqlite");
|
|
39802
|
+
signal.throwIfAborted();
|
|
39803
|
+
db = new DatabaseSync(dbPath, { readOnly: true });
|
|
39804
|
+
const tempPrefixes = runtimeTempPrefixes(environment);
|
|
39805
|
+
const workspaces = /* @__PURE__ */ new Map();
|
|
39806
|
+
for (const row of db.prepare("SELECT conversation_id, workspace_uris FROM conversation_summaries").iterate()) {
|
|
39807
|
+
if (typeof row.conversation_id !== "string" || row.conversation_id.length === 0)
|
|
39808
|
+
continue;
|
|
39809
|
+
const cwd = selectWorkspaceCwd(row.workspace_uris, tempPrefixes);
|
|
39810
|
+
if (cwd !== void 0)
|
|
39811
|
+
workspaces.set(row.conversation_id, cwd);
|
|
39812
|
+
}
|
|
39813
|
+
return { workspaces, cacheable: true };
|
|
39814
|
+
} catch {
|
|
39815
|
+
signal.throwIfAborted();
|
|
39816
|
+
return { workspaces: /* @__PURE__ */ new Map(), cacheable: false };
|
|
39817
|
+
} finally {
|
|
39818
|
+
db?.close();
|
|
39819
|
+
}
|
|
39820
|
+
}
|
|
39821
|
+
function combineFingerprint(fileFingerprint, cwd) {
|
|
39822
|
+
if (cwd === void 0)
|
|
39823
|
+
return fileFingerprint;
|
|
39824
|
+
return `${fileFingerprint}:cwd:${createHash2("sha256").update(cwd).digest("hex")}`;
|
|
39825
|
+
}
|
|
39826
|
+
function conversationIdFromTranscript(file2) {
|
|
39827
|
+
return path10.basename(path10.resolve(file2, "..", "..", ".."));
|
|
39828
|
+
}
|
|
39217
39829
|
async function listTranscripts(brainRoot, signal) {
|
|
39218
39830
|
signal.throwIfAborted();
|
|
39219
39831
|
const entries = await readdir(brainRoot, { withFileTypes: true }).catch((error62) => {
|
|
@@ -39230,8 +39842,8 @@ async function listTranscripts(brainRoot, signal) {
|
|
|
39230
39842
|
const batch = directories.slice(offset, offset + LIST_CONCURRENCY);
|
|
39231
39843
|
const inspected = await Promise.all(batch.map(async (entry) => {
|
|
39232
39844
|
const file2 = transcriptPath(brainRoot, entry.name);
|
|
39233
|
-
const
|
|
39234
|
-
return
|
|
39845
|
+
const fileFingerprint = await transcriptFingerprint(file2);
|
|
39846
|
+
return fileFingerprint ? { id: file2, conversationId: entry.name, fileFingerprint } : null;
|
|
39235
39847
|
}));
|
|
39236
39848
|
for (const source of inspected) {
|
|
39237
39849
|
if (source)
|
|
@@ -39241,8 +39853,9 @@ async function listTranscripts(brainRoot, signal) {
|
|
|
39241
39853
|
signal.throwIfAborted();
|
|
39242
39854
|
return sources;
|
|
39243
39855
|
}
|
|
39244
|
-
async function readAntigravityUsage(file2, signal) {
|
|
39245
|
-
const sessionId =
|
|
39856
|
+
async function readAntigravityUsage(file2, signal, options) {
|
|
39857
|
+
const sessionId = conversationIdFromTranscript(file2);
|
|
39858
|
+
const cwd = options?.cwd;
|
|
39246
39859
|
const requests = /* @__PURE__ */ new Map();
|
|
39247
39860
|
for await (const record4 of jsonlRecords(file2, '"input_tokens"', signal)) {
|
|
39248
39861
|
if (record4.type !== "PLANNER_RESPONSE")
|
|
@@ -39265,32 +39878,81 @@ async function readAntigravityUsage(file2, signal) {
|
|
|
39265
39878
|
...hasImplicitZeroCacheWrite(identity2) ? { cacheWriteInputTokens: 0 } : {}
|
|
39266
39879
|
} : {},
|
|
39267
39880
|
outputTokens: output2
|
|
39268
|
-
}, { sessionId }));
|
|
39881
|
+
}, { sessionId, cwd }));
|
|
39269
39882
|
}
|
|
39270
39883
|
return [...requests.values()];
|
|
39271
39884
|
}
|
|
39272
39885
|
function createAntigravityUsageStatistics(environment) {
|
|
39273
|
-
const
|
|
39886
|
+
const home = antigravityHome(environment);
|
|
39887
|
+
const brainRoot = nativeBrainRoot(home);
|
|
39888
|
+
const summaryDbPath = nativeConversationSummariesDbPath(home);
|
|
39274
39889
|
let listed = /* @__PURE__ */ new Map();
|
|
39890
|
+
let summaryCache = null;
|
|
39891
|
+
let summaryLoading = null;
|
|
39892
|
+
async function loadWorkspaces(signal) {
|
|
39893
|
+
signal.throwIfAborted();
|
|
39894
|
+
const dbFingerprint = await readNativeDbFingerprint(summaryDbPath);
|
|
39895
|
+
signal.throwIfAborted();
|
|
39896
|
+
if (dbFingerprint !== null && summaryCache?.dbFingerprint === dbFingerprint) {
|
|
39897
|
+
return summaryCache.workspaces;
|
|
39898
|
+
}
|
|
39899
|
+
if (dbFingerprint !== null && summaryLoading?.dbFingerprint === dbFingerprint && summaryLoading.signal === signal) {
|
|
39900
|
+
return summaryLoading.promise;
|
|
39901
|
+
}
|
|
39902
|
+
const promise2 = readSummaryWorkspaces(summaryDbPath, environment, signal).then((result) => {
|
|
39903
|
+
if (result.cacheable && dbFingerprint !== null) {
|
|
39904
|
+
summaryCache = { dbFingerprint, workspaces: result.workspaces };
|
|
39905
|
+
} else {
|
|
39906
|
+
summaryCache = null;
|
|
39907
|
+
}
|
|
39908
|
+
return result.workspaces;
|
|
39909
|
+
});
|
|
39910
|
+
if (dbFingerprint === null)
|
|
39911
|
+
return promise2;
|
|
39912
|
+
const entry = { dbFingerprint, signal, promise: promise2 };
|
|
39913
|
+
summaryLoading = entry;
|
|
39914
|
+
try {
|
|
39915
|
+
return await promise2;
|
|
39916
|
+
} finally {
|
|
39917
|
+
if (summaryLoading === entry)
|
|
39918
|
+
summaryLoading = null;
|
|
39919
|
+
}
|
|
39920
|
+
}
|
|
39275
39921
|
return Object.freeze({
|
|
39276
39922
|
async listSources(signal) {
|
|
39277
|
-
const
|
|
39278
|
-
|
|
39923
|
+
const transcripts = await listTranscripts(brainRoot, signal);
|
|
39924
|
+
const workspaces = transcripts.length > 0 ? await loadWorkspaces(signal) : /* @__PURE__ */ new Map();
|
|
39925
|
+
const nextListed = /* @__PURE__ */ new Map();
|
|
39926
|
+
const sources = [];
|
|
39927
|
+
for (const { id: id2, conversationId, fileFingerprint } of transcripts) {
|
|
39928
|
+
const cwd = workspaces.get(conversationId);
|
|
39929
|
+
nextListed.set(id2, { fileFingerprint, cwd });
|
|
39930
|
+
sources.push({ id: id2, fingerprint: combineFingerprint(fileFingerprint, cwd) });
|
|
39931
|
+
}
|
|
39932
|
+
listed = nextListed;
|
|
39279
39933
|
return sources;
|
|
39280
39934
|
},
|
|
39281
39935
|
async readSource(id2, signal) {
|
|
39282
39936
|
const expected = listed.get(id2);
|
|
39937
|
+
const sessionId = conversationIdFromTranscript(id2);
|
|
39938
|
+
const cwd = expected !== void 0 ? expected.cwd : (await loadWorkspaces(signal)).get(sessionId);
|
|
39283
39939
|
let entries;
|
|
39284
39940
|
try {
|
|
39285
|
-
entries = await readAntigravityUsage(id2, signal);
|
|
39941
|
+
entries = await readAntigravityUsage(id2, signal, cwd !== void 0 ? { cwd } : void 0);
|
|
39286
39942
|
} catch (error62) {
|
|
39287
39943
|
if (expected !== void 0 && isMissing2(error62)) {
|
|
39288
39944
|
throw new HarnessUsageSourceChangedError("Antigravity transcript disappeared before reading; refresh to retry");
|
|
39289
39945
|
}
|
|
39290
39946
|
throw error62;
|
|
39291
39947
|
}
|
|
39292
|
-
if (expected !== void 0
|
|
39293
|
-
|
|
39948
|
+
if (expected !== void 0) {
|
|
39949
|
+
if (await transcriptFingerprint(id2) !== expected.fileFingerprint) {
|
|
39950
|
+
throw new HarnessUsageSourceChangedError("Antigravity transcript changed while reading; refresh to retry");
|
|
39951
|
+
}
|
|
39952
|
+
const currentCwd = (await loadWorkspaces(signal)).get(sessionId);
|
|
39953
|
+
if (currentCwd !== expected.cwd) {
|
|
39954
|
+
throw new HarnessUsageSourceChangedError("Antigravity conversation workspace changed while reading; refresh to retry");
|
|
39955
|
+
}
|
|
39294
39956
|
}
|
|
39295
39957
|
return entries;
|
|
39296
39958
|
}
|
|
@@ -40495,8 +41157,140 @@ var EFFORT_LABELS = /* @__PURE__ */ new Map([
|
|
|
40495
41157
|
["high", "High"],
|
|
40496
41158
|
["xhigh", "XHigh"]
|
|
40497
41159
|
]);
|
|
40498
|
-
var EFFORT_SUFFIX_PATTERN = /^(?<base>.+)
|
|
41160
|
+
var EFFORT_SUFFIX_PATTERN = /^(?<base>.+)[:-](?<effort>low|medium|high|xhigh)$/u;
|
|
40499
41161
|
var EFFORT_LABEL_SUFFIX_PATTERN = /\s*\((?:low|medium|high|xhigh)\)$/iu;
|
|
41162
|
+
function stripEffortLabel(label) {
|
|
41163
|
+
const trimmed = label.trim();
|
|
41164
|
+
return trimmed.replace(EFFORT_LABEL_SUFFIX_PATTERN, "").trim() || trimmed;
|
|
41165
|
+
}
|
|
41166
|
+
function normalizeModelNameKey(name) {
|
|
41167
|
+
return name.trim().replace(/\s+/gu, " ").toLowerCase();
|
|
41168
|
+
}
|
|
41169
|
+
function toAcpModelSlug(name) {
|
|
41170
|
+
return name.trim().toLowerCase().replace(/\s+/gu, "-");
|
|
41171
|
+
}
|
|
41172
|
+
function stripRouteGroupSuffix(value) {
|
|
41173
|
+
return value.replace(/(?:\s+|-)·.*$/u, "").trim();
|
|
41174
|
+
}
|
|
41175
|
+
function stripProviderPrefix(id2) {
|
|
41176
|
+
const slash = id2.indexOf("/");
|
|
41177
|
+
return slash >= 0 ? id2.slice(slash + 1) : id2;
|
|
41178
|
+
}
|
|
41179
|
+
function groupAvailableModels(availableModels) {
|
|
41180
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
41181
|
+
for (const entry of availableModels) {
|
|
41182
|
+
const split = safeSplitAntigravityModelAndEffort(entry.modelId);
|
|
41183
|
+
if (!split)
|
|
41184
|
+
continue;
|
|
41185
|
+
const list = grouped.get(split.modelRef.id) ?? [];
|
|
41186
|
+
list.push(entry);
|
|
41187
|
+
grouped.set(split.modelRef.id, list);
|
|
41188
|
+
}
|
|
41189
|
+
const groups = [];
|
|
41190
|
+
for (const [baseId, entries] of grouped) {
|
|
41191
|
+
const sole = entries.length === 1 ? entries[0] : void 0;
|
|
41192
|
+
const soleSplit = sole ? safeSplitAntigravityModelAndEffort(sole.modelId) : void 0;
|
|
41193
|
+
const canonicalId = sole && soleSplit?.effort ? sole.modelId : baseId;
|
|
41194
|
+
const baseNames = /* @__PURE__ */ new Set();
|
|
41195
|
+
const rawNames = /* @__PURE__ */ new Set();
|
|
41196
|
+
for (const entry of entries) {
|
|
41197
|
+
const trimmed = entry.name.trim();
|
|
41198
|
+
if (trimmed) {
|
|
41199
|
+
rawNames.add(trimmed);
|
|
41200
|
+
baseNames.add(stripEffortLabel(trimmed));
|
|
41201
|
+
}
|
|
41202
|
+
}
|
|
41203
|
+
groups.push({ canonicalId, baseNames, rawNames });
|
|
41204
|
+
}
|
|
41205
|
+
return groups;
|
|
41206
|
+
}
|
|
41207
|
+
function canonicalModelIdForAcpChoice(acpValue, acpName, availableModels = [], catalog) {
|
|
41208
|
+
const trimmedValue = acpValue.trim();
|
|
41209
|
+
if (!trimmedValue)
|
|
41210
|
+
return acpValue;
|
|
41211
|
+
const trimmedName = acpName?.trim();
|
|
41212
|
+
const isBakedInChoice = Boolean(safeSplitAntigravityModelAndEffort(trimmedValue)?.effort) || trimmedName !== void 0 && stripEffortLabel(trimmedName) !== trimmedName;
|
|
41213
|
+
if (availableModels.length > 0) {
|
|
41214
|
+
const groups = groupAvailableModels(availableModels);
|
|
41215
|
+
if (groups.some((group) => group.canonicalId === trimmedValue)) {
|
|
41216
|
+
return trimmedValue;
|
|
41217
|
+
}
|
|
41218
|
+
if (isBakedInChoice) {
|
|
41219
|
+
return trimmedValue;
|
|
41220
|
+
}
|
|
41221
|
+
const exactAvailable = availableModels.find((entry) => entry.modelId === trimmedValue);
|
|
41222
|
+
if (exactAvailable) {
|
|
41223
|
+
const split = safeSplitAntigravityModelAndEffort(exactAvailable.modelId);
|
|
41224
|
+
const group = split ? groups.find((candidate) => candidate.canonicalId === split.modelRef.id || candidate.canonicalId === exactAvailable.modelId) : void 0;
|
|
41225
|
+
if (group)
|
|
41226
|
+
return group.canonicalId;
|
|
41227
|
+
}
|
|
41228
|
+
const targetNameKey = trimmedName ? normalizeModelNameKey(trimmedName) : void 0;
|
|
41229
|
+
const targetBaseNameKey = trimmedName ? normalizeModelNameKey(stripEffortLabel(trimmedName)) : void 0;
|
|
41230
|
+
const targetValueSlug = trimmedValue.toLowerCase();
|
|
41231
|
+
const matchedIds = /* @__PURE__ */ new Set();
|
|
41232
|
+
for (const group of groups) {
|
|
41233
|
+
const nameMatched = targetNameKey !== void 0 && ([...group.rawNames].some((name) => normalizeModelNameKey(name) === targetNameKey) || [...group.baseNames].some((name) => normalizeModelNameKey(name) === targetNameKey)) || targetBaseNameKey !== void 0 && [...group.baseNames].some((name) => normalizeModelNameKey(name) === targetBaseNameKey);
|
|
41234
|
+
const slugMatched = [...group.baseNames].some((name) => toAcpModelSlug(name) === targetValueSlug) || [...group.rawNames].some((name) => toAcpModelSlug(name) === targetValueSlug);
|
|
41235
|
+
if (nameMatched || slugMatched) {
|
|
41236
|
+
matchedIds.add(group.canonicalId);
|
|
41237
|
+
}
|
|
41238
|
+
}
|
|
41239
|
+
if (matchedIds.size === 1) {
|
|
41240
|
+
const [only] = matchedIds;
|
|
41241
|
+
if (only)
|
|
41242
|
+
return only;
|
|
41243
|
+
}
|
|
41244
|
+
}
|
|
41245
|
+
if (isBakedInChoice) {
|
|
41246
|
+
return trimmedValue;
|
|
41247
|
+
}
|
|
41248
|
+
if (catalog) {
|
|
41249
|
+
if (catalog.models.some(({ ref }) => ref.id === trimmedValue)) {
|
|
41250
|
+
return trimmedValue;
|
|
41251
|
+
}
|
|
41252
|
+
const targetNameKey = trimmedName ? normalizeModelNameKey(trimmedName) : void 0;
|
|
41253
|
+
const targetBaseNameKey = trimmedName ? normalizeModelNameKey(stripEffortLabel(trimmedName)) : void 0;
|
|
41254
|
+
const targetValueSlug = trimmedValue.toLowerCase();
|
|
41255
|
+
const matchedIds = /* @__PURE__ */ new Set();
|
|
41256
|
+
for (const model2 of catalog.models) {
|
|
41257
|
+
const label = model2.label.trim();
|
|
41258
|
+
const baseLabel = stripEffortLabel(label);
|
|
41259
|
+
const nameMatched = targetNameKey !== void 0 && (normalizeModelNameKey(label) === targetNameKey || normalizeModelNameKey(baseLabel) === targetNameKey) || targetBaseNameKey !== void 0 && normalizeModelNameKey(baseLabel) === targetBaseNameKey;
|
|
41260
|
+
const slugMatched = toAcpModelSlug(baseLabel) === targetValueSlug || toAcpModelSlug(label) === targetValueSlug;
|
|
41261
|
+
if (nameMatched || slugMatched) {
|
|
41262
|
+
matchedIds.add(model2.ref.id);
|
|
41263
|
+
}
|
|
41264
|
+
}
|
|
41265
|
+
if (matchedIds.size === 1) {
|
|
41266
|
+
const [only] = matchedIds;
|
|
41267
|
+
if (only)
|
|
41268
|
+
return only;
|
|
41269
|
+
}
|
|
41270
|
+
}
|
|
41271
|
+
return trimmedValue;
|
|
41272
|
+
}
|
|
41273
|
+
function buildCanonicalAcpChoiceMap(options, availableModels = [], catalog) {
|
|
41274
|
+
const tentative = options.map(({ value, name }) => ({
|
|
41275
|
+
value,
|
|
41276
|
+
canonicalId: canonicalModelIdForAcpChoice(value, name, availableModels, catalog)
|
|
41277
|
+
}));
|
|
41278
|
+
const counts = /* @__PURE__ */ new Map();
|
|
41279
|
+
for (const entry of tentative) {
|
|
41280
|
+
counts.set(entry.canonicalId, (counts.get(entry.canonicalId) ?? 0) + 1);
|
|
41281
|
+
}
|
|
41282
|
+
const resolved = /* @__PURE__ */ new Map();
|
|
41283
|
+
for (const entry of tentative) {
|
|
41284
|
+
const trimmedValue = entry.value.trim();
|
|
41285
|
+
const candidateId = (counts.get(entry.canonicalId) ?? 0) === 1 ? entry.canonicalId : trimmedValue;
|
|
41286
|
+
if (candidateId !== trimmedValue && availableModels.length > 0 && resolveAntigravityAcpModelSelection(options, availableModels, candidateId)?.targetValue !== entry.value) {
|
|
41287
|
+
resolved.set(entry.value, trimmedValue);
|
|
41288
|
+
continue;
|
|
41289
|
+
}
|
|
41290
|
+
resolved.set(entry.value, candidateId);
|
|
41291
|
+
}
|
|
41292
|
+
return resolved;
|
|
41293
|
+
}
|
|
40500
41294
|
function listedModel(line) {
|
|
40501
41295
|
const separator = line.indexOf(" ");
|
|
40502
41296
|
if (separator <= 0)
|
|
@@ -40513,7 +41307,7 @@ function listedModel(line) {
|
|
|
40513
41307
|
rawId: id2,
|
|
40514
41308
|
rawLabel: label,
|
|
40515
41309
|
baseId: match.groups.base,
|
|
40516
|
-
baseLabel: label
|
|
41310
|
+
baseLabel: stripEffortLabel(label),
|
|
40517
41311
|
effort: match.groups.effort
|
|
40518
41312
|
};
|
|
40519
41313
|
}
|
|
@@ -40598,11 +41392,16 @@ function parseAntigravityAcpModelCatalog(availableModels, configOptions = []) {
|
|
|
40598
41392
|
id: harnessThinkingOptionIdSchema.parse(value),
|
|
40599
41393
|
label: name
|
|
40600
41394
|
}));
|
|
40601
|
-
const
|
|
41395
|
+
const canonicalChoices = modelOption ? buildCanonicalAcpChoiceMap(modelOption.options, availableModels) : void 0;
|
|
41396
|
+
const listed = modelOption?.options.map(({ value, name }) => ({
|
|
41397
|
+
modelId: canonicalChoices?.get(value) ?? value,
|
|
41398
|
+
name
|
|
41399
|
+
})) ?? availableModels;
|
|
40602
41400
|
const first = listed[0];
|
|
40603
41401
|
if (!first)
|
|
40604
41402
|
throw new Error("Antigravity ACP returned no usable Models");
|
|
40605
|
-
const
|
|
41403
|
+
const currentChoice = modelOption?.options.find(({ value }) => value === modelOption.currentValue);
|
|
41404
|
+
const currentModelId = modelOption ? canonicalChoices?.get(modelOption.currentValue) ?? canonicalModelIdForAcpChoice(modelOption.currentValue, currentChoice?.name, availableModels) : first.modelId;
|
|
40606
41405
|
return harnessModelCatalogSchema.parse({
|
|
40607
41406
|
models: listed.map(({ modelId: modelId2, name }) => ({
|
|
40608
41407
|
ref: { id: modelId2 },
|
|
@@ -40615,11 +41414,15 @@ function parseAntigravityAcpModelCatalog(availableModels, configOptions = []) {
|
|
|
40615
41414
|
...thoughtOption && thinkingOptions.some(({ id: id2 }) => id2 === thoughtOption.currentValue) ? { defaultThinkingOptionId: thoughtOption.currentValue } : {}
|
|
40616
41415
|
});
|
|
40617
41416
|
}
|
|
40618
|
-
function readAcpEffectiveModelState(configOptions, catalog) {
|
|
41417
|
+
function readAcpEffectiveModelState(configOptions, catalog, availableModels = []) {
|
|
40619
41418
|
const model2 = configOptions?.find(({ id: id2 }) => id2 === "model");
|
|
40620
41419
|
const thought = configOptions?.find(({ id: id2 }) => id2 === "thought_level");
|
|
40621
|
-
const
|
|
40622
|
-
const
|
|
41420
|
+
const currentChoice = model2?.options.find(({ value }) => value === model2.currentValue);
|
|
41421
|
+
const canonicalChoices = model2 ? buildCanonicalAcpChoiceMap(model2.options, availableModels, catalog) : void 0;
|
|
41422
|
+
const effectiveModel = model2 ? harnessModelRefSchema.parse({
|
|
41423
|
+
id: canonicalChoices?.get(model2.currentValue) ?? canonicalModelIdForAcpChoice(model2.currentValue, currentChoice?.name, availableModels, catalog)
|
|
41424
|
+
}) : void 0;
|
|
41425
|
+
const resolvedModelLabel = currentChoice?.name ?? catalog?.models.find(({ ref }) => ref.id === effectiveModel?.id)?.resolvedModelLabel;
|
|
40623
41426
|
const availableThinkingOptions = thought ? thought.options.map(({ value, name }) => ({
|
|
40624
41427
|
id: harnessThinkingOptionIdSchema.parse(value),
|
|
40625
41428
|
label: name
|
|
@@ -40632,8 +41435,12 @@ function readAcpEffectiveModelState(configOptions, catalog) {
|
|
|
40632
41435
|
...availableThinkingOptions ? { availableThinkingOptions } : {}
|
|
40633
41436
|
};
|
|
40634
41437
|
}
|
|
40635
|
-
function
|
|
40636
|
-
const
|
|
41438
|
+
function safeSplitAntigravityModelAndEffort(rawModelId) {
|
|
41439
|
+
const trimmed = rawModelId.trim();
|
|
41440
|
+
const parsed = harnessModelRefSchema.safeParse({ id: trimmed });
|
|
41441
|
+
if (!parsed.success)
|
|
41442
|
+
return void 0;
|
|
41443
|
+
const match = EFFORT_SUFFIX_PATTERN.exec(trimmed);
|
|
40637
41444
|
if (match?.groups?.base && match.groups.effort) {
|
|
40638
41445
|
const baseRef = harnessModelRefSchema.safeParse({ id: match.groups.base });
|
|
40639
41446
|
const effortId = harnessThinkingOptionIdSchema.safeParse(match.groups.effort);
|
|
@@ -40641,8 +41448,474 @@ function splitAntigravityModelAndEffort(rawModelId) {
|
|
|
40641
41448
|
return { modelRef: baseRef.data, effort: effortId.data };
|
|
40642
41449
|
}
|
|
40643
41450
|
}
|
|
41451
|
+
return { modelRef: parsed.data };
|
|
41452
|
+
}
|
|
41453
|
+
function splitAntigravityModelAndEffort(rawModelId) {
|
|
41454
|
+
const parsed = safeSplitAntigravityModelAndEffort(rawModelId);
|
|
41455
|
+
if (parsed)
|
|
41456
|
+
return parsed;
|
|
40644
41457
|
return { modelRef: harnessModelRefSchema.parse({ id: rawModelId.trim() }) };
|
|
40645
41458
|
}
|
|
41459
|
+
function normalizeAntigravityStoredModelRef(ref, catalog) {
|
|
41460
|
+
const exact = catalog.models.find(({ ref: candidate }) => candidate.id === ref.id);
|
|
41461
|
+
if (exact)
|
|
41462
|
+
return exact.ref;
|
|
41463
|
+
const split = splitAntigravityModelAndEffort(ref.id);
|
|
41464
|
+
if (split.effort) {
|
|
41465
|
+
const byBase = catalog.models.find(({ ref: candidate }) => candidate.id === split.modelRef.id);
|
|
41466
|
+
if (byBase)
|
|
41467
|
+
return byBase.ref;
|
|
41468
|
+
}
|
|
41469
|
+
if (split.modelRef.id.includes("/")) {
|
|
41470
|
+
return void 0;
|
|
41471
|
+
}
|
|
41472
|
+
const targetKeys = /* @__PURE__ */ new Set([ref.id.trim().toLowerCase()]);
|
|
41473
|
+
if (split.effort) {
|
|
41474
|
+
targetKeys.add(split.modelRef.id.trim().toLowerCase());
|
|
41475
|
+
}
|
|
41476
|
+
const slugMatches = catalog.models.filter((model2) => {
|
|
41477
|
+
const label = model2.label.trim();
|
|
41478
|
+
const baseLabel = stripEffortLabel(label);
|
|
41479
|
+
return targetKeys.has(toAcpModelSlug(label)) || targetKeys.has(toAcpModelSlug(baseLabel)) || targetKeys.has(normalizeModelNameKey(label)) || targetKeys.has(normalizeModelNameKey(baseLabel));
|
|
41480
|
+
});
|
|
41481
|
+
if (slugMatches.length === 1 && slugMatches[0]) {
|
|
41482
|
+
return slugMatches[0].ref;
|
|
41483
|
+
}
|
|
41484
|
+
if (slugMatches.length > 1) {
|
|
41485
|
+
return void 0;
|
|
41486
|
+
}
|
|
41487
|
+
const strippedBase = toAcpModelSlug(stripRouteGroupSuffix(split.modelRef.id));
|
|
41488
|
+
if (!strippedBase)
|
|
41489
|
+
return void 0;
|
|
41490
|
+
const renamedGroupMatches = catalog.models.filter((model2) => {
|
|
41491
|
+
const candidateIdBase = toAcpModelSlug(stripRouteGroupSuffix(stripProviderPrefix(splitAntigravityModelAndEffort(model2.ref.id).modelRef.id)));
|
|
41492
|
+
const candidateLabelBase = toAcpModelSlug(stripRouteGroupSuffix(stripEffortLabel(model2.label)));
|
|
41493
|
+
return candidateIdBase === strippedBase || candidateLabelBase === strippedBase;
|
|
41494
|
+
});
|
|
41495
|
+
if (renamedGroupMatches.length === 1 && renamedGroupMatches[0]) {
|
|
41496
|
+
return renamedGroupMatches[0].ref;
|
|
41497
|
+
}
|
|
41498
|
+
return void 0;
|
|
41499
|
+
}
|
|
41500
|
+
function collectCatalogBaseIds(availableModels) {
|
|
41501
|
+
const baseIds = /* @__PURE__ */ new Set();
|
|
41502
|
+
for (const entry of availableModels) {
|
|
41503
|
+
const split = safeSplitAntigravityModelAndEffort(entry.modelId);
|
|
41504
|
+
if (split?.effort) {
|
|
41505
|
+
baseIds.add(split.modelRef.id);
|
|
41506
|
+
}
|
|
41507
|
+
}
|
|
41508
|
+
return baseIds;
|
|
41509
|
+
}
|
|
41510
|
+
function catalogEntryBaseId(entry, baseIdsWithVariants) {
|
|
41511
|
+
const trimmedId = entry.modelId.trim();
|
|
41512
|
+
if (baseIdsWithVariants.has(trimmedId)) {
|
|
41513
|
+
return trimmedId;
|
|
41514
|
+
}
|
|
41515
|
+
return safeSplitAntigravityModelAndEffort(entry.modelId)?.modelRef.id;
|
|
41516
|
+
}
|
|
41517
|
+
function catalogEntryEffortForBase(entry, baseId, baseIdsWithVariants) {
|
|
41518
|
+
const trimmedId = entry.modelId.trim();
|
|
41519
|
+
if (trimmedId === baseId || baseIdsWithVariants?.has(trimmedId))
|
|
41520
|
+
return void 0;
|
|
41521
|
+
const entrySplit = safeSplitAntigravityModelAndEffort(entry.modelId);
|
|
41522
|
+
return entrySplit?.effort && entrySplit.modelRef.id === baseId ? entrySplit.effort : void 0;
|
|
41523
|
+
}
|
|
41524
|
+
function collectGroupEfforts(entries, baseId, baseIdsWithVariants) {
|
|
41525
|
+
const efforts = /* @__PURE__ */ new Set();
|
|
41526
|
+
for (const entry of entries) {
|
|
41527
|
+
const effort = catalogEntryEffortForBase(entry, baseId, baseIdsWithVariants);
|
|
41528
|
+
if (effort) {
|
|
41529
|
+
efforts.add(effort);
|
|
41530
|
+
}
|
|
41531
|
+
}
|
|
41532
|
+
return efforts;
|
|
41533
|
+
}
|
|
41534
|
+
function hasCatalogDisplayNameConflict(availableModels, baseIdsWithVariants, displayName, expectedBaseId, mode) {
|
|
41535
|
+
const targetKey = normalizeModelNameKey(displayName);
|
|
41536
|
+
if (!targetKey)
|
|
41537
|
+
return false;
|
|
41538
|
+
const targetBaseKey = normalizeModelNameKey(stripEffortLabel(displayName));
|
|
41539
|
+
const matchingBaseIds = /* @__PURE__ */ new Set();
|
|
41540
|
+
const matchingExactModelIds = /* @__PURE__ */ new Set();
|
|
41541
|
+
for (const entry of availableModels) {
|
|
41542
|
+
const entryBaseId = catalogEntryBaseId(entry, baseIdsWithVariants);
|
|
41543
|
+
if (!entryBaseId)
|
|
41544
|
+
continue;
|
|
41545
|
+
const entryNameKey = normalizeModelNameKey(entry.name);
|
|
41546
|
+
const entryBaseKey = normalizeModelNameKey(stripEffortLabel(entry.name));
|
|
41547
|
+
if (mode === "base") {
|
|
41548
|
+
if (entryBaseKey === targetKey) {
|
|
41549
|
+
matchingBaseIds.add(entryBaseId);
|
|
41550
|
+
}
|
|
41551
|
+
} else if (entryNameKey === targetKey) {
|
|
41552
|
+
matchingBaseIds.add(entryBaseId);
|
|
41553
|
+
matchingExactModelIds.add(entry.modelId);
|
|
41554
|
+
} else if (entryBaseKey === targetKey) {
|
|
41555
|
+
matchingBaseIds.add(entryBaseId);
|
|
41556
|
+
}
|
|
41557
|
+
}
|
|
41558
|
+
if (matchingBaseIds.size > 1)
|
|
41559
|
+
return true;
|
|
41560
|
+
if (matchingBaseIds.size === 1 && !matchingBaseIds.has(expectedBaseId))
|
|
41561
|
+
return true;
|
|
41562
|
+
if (mode === "exact" && targetBaseKey !== targetKey && matchingExactModelIds.size > 1) {
|
|
41563
|
+
return true;
|
|
41564
|
+
}
|
|
41565
|
+
return false;
|
|
41566
|
+
}
|
|
41567
|
+
function hasCatalogSlugConflict(availableModels, baseIdsWithVariants, displayName, expectedBaseId, mode) {
|
|
41568
|
+
const targetSlug = toAcpModelSlug(displayName);
|
|
41569
|
+
if (!targetSlug)
|
|
41570
|
+
return false;
|
|
41571
|
+
const targetBaseSlug = toAcpModelSlug(stripEffortLabel(displayName));
|
|
41572
|
+
const matchingBaseIds = /* @__PURE__ */ new Set();
|
|
41573
|
+
const matchingExactModelIds = /* @__PURE__ */ new Set();
|
|
41574
|
+
for (const entry of availableModels) {
|
|
41575
|
+
const entryBaseId = catalogEntryBaseId(entry, baseIdsWithVariants);
|
|
41576
|
+
if (!entryBaseId)
|
|
41577
|
+
continue;
|
|
41578
|
+
const entrySlug = toAcpModelSlug(entry.name);
|
|
41579
|
+
const entryBaseSlug = toAcpModelSlug(stripEffortLabel(entry.name));
|
|
41580
|
+
if (mode === "base") {
|
|
41581
|
+
if (entryBaseSlug === targetSlug) {
|
|
41582
|
+
matchingBaseIds.add(entryBaseId);
|
|
41583
|
+
}
|
|
41584
|
+
} else if (entrySlug === targetSlug) {
|
|
41585
|
+
matchingBaseIds.add(entryBaseId);
|
|
41586
|
+
matchingExactModelIds.add(entry.modelId);
|
|
41587
|
+
} else if (entryBaseSlug === targetSlug) {
|
|
41588
|
+
matchingBaseIds.add(entryBaseId);
|
|
41589
|
+
}
|
|
41590
|
+
}
|
|
41591
|
+
if (matchingBaseIds.size > 1)
|
|
41592
|
+
return true;
|
|
41593
|
+
if (matchingBaseIds.size === 1 && !matchingBaseIds.has(expectedBaseId))
|
|
41594
|
+
return true;
|
|
41595
|
+
if (mode === "exact" && targetBaseSlug !== targetSlug && matchingExactModelIds.size > 1) {
|
|
41596
|
+
return true;
|
|
41597
|
+
}
|
|
41598
|
+
return false;
|
|
41599
|
+
}
|
|
41600
|
+
function isChoiceClaimedByOtherCatalogModel(choice, availableModels, baseIdsWithVariants, expectedBaseId) {
|
|
41601
|
+
const choiceValue = choice.value.trim();
|
|
41602
|
+
const choiceName = choice.name.trim();
|
|
41603
|
+
const choiceKey = normalizeModelNameKey(choiceName);
|
|
41604
|
+
const choiceHasEffortLabel = choiceKey !== "" && stripEffortLabel(choiceName) !== choiceName;
|
|
41605
|
+
for (const entry of availableModels) {
|
|
41606
|
+
const entryBaseId = catalogEntryBaseId(entry, baseIdsWithVariants);
|
|
41607
|
+
if (!entryBaseId || entryBaseId === expectedBaseId)
|
|
41608
|
+
continue;
|
|
41609
|
+
const entryModelId = entry.modelId.trim();
|
|
41610
|
+
if (choiceValue && (entryModelId === choiceValue || entryBaseId === choiceValue)) {
|
|
41611
|
+
return true;
|
|
41612
|
+
}
|
|
41613
|
+
if (!choiceKey)
|
|
41614
|
+
continue;
|
|
41615
|
+
const entryKey = normalizeModelNameKey(entry.name);
|
|
41616
|
+
const entryBaseKey = normalizeModelNameKey(stripEffortLabel(entry.name));
|
|
41617
|
+
if (entryKey === choiceKey || !choiceHasEffortLabel && entryBaseKey === choiceKey) {
|
|
41618
|
+
return true;
|
|
41619
|
+
}
|
|
41620
|
+
}
|
|
41621
|
+
return false;
|
|
41622
|
+
}
|
|
41623
|
+
function isNonBakedInBaseChoice(choice, baseIdsWithVariants) {
|
|
41624
|
+
const choiceValue = choice.value.trim();
|
|
41625
|
+
const choiceName = choice.name.trim();
|
|
41626
|
+
return stripEffortLabel(choiceName) === choiceName && (baseIdsWithVariants.has(choiceValue) || !safeSplitAntigravityModelAndEffort(choiceValue)?.effort);
|
|
41627
|
+
}
|
|
41628
|
+
function matchModelChoiceByName(options, availableModels, baseIdsWithVariants, name, expectedBaseId, mode) {
|
|
41629
|
+
const targetKey = normalizeModelNameKey(name);
|
|
41630
|
+
if (!targetKey)
|
|
41631
|
+
return { ambiguous: false };
|
|
41632
|
+
if (hasCatalogDisplayNameConflict(availableModels, baseIdsWithVariants, name, expectedBaseId, mode)) {
|
|
41633
|
+
return { ambiguous: true };
|
|
41634
|
+
}
|
|
41635
|
+
const targetSlug = toAcpModelSlug(name);
|
|
41636
|
+
const nameMatches = options.filter((choice) => {
|
|
41637
|
+
if (normalizeModelNameKey(choice.name) !== targetKey)
|
|
41638
|
+
return false;
|
|
41639
|
+
if (mode === "base") {
|
|
41640
|
+
return isNonBakedInBaseChoice(choice, baseIdsWithVariants);
|
|
41641
|
+
}
|
|
41642
|
+
return true;
|
|
41643
|
+
});
|
|
41644
|
+
if (nameMatches.length > 0) {
|
|
41645
|
+
if (nameMatches.length === 1 && nameMatches[0]) {
|
|
41646
|
+
return { matched: nameMatches[0], ambiguous: false };
|
|
41647
|
+
}
|
|
41648
|
+
return { ambiguous: true };
|
|
41649
|
+
}
|
|
41650
|
+
const slugMatches = options.filter((choice) => {
|
|
41651
|
+
const choiceValue = choice.value.trim();
|
|
41652
|
+
if (choiceValue.toLowerCase() !== targetSlug)
|
|
41653
|
+
return false;
|
|
41654
|
+
if (isChoiceClaimedByOtherCatalogModel(choice, availableModels, baseIdsWithVariants, expectedBaseId)) {
|
|
41655
|
+
return false;
|
|
41656
|
+
}
|
|
41657
|
+
if (mode === "base") {
|
|
41658
|
+
return isNonBakedInBaseChoice(choice, baseIdsWithVariants);
|
|
41659
|
+
}
|
|
41660
|
+
return true;
|
|
41661
|
+
});
|
|
41662
|
+
if (slugMatches.length === 0)
|
|
41663
|
+
return { ambiguous: false };
|
|
41664
|
+
if (hasCatalogSlugConflict(availableModels, baseIdsWithVariants, name, expectedBaseId, mode)) {
|
|
41665
|
+
return { ambiguous: true };
|
|
41666
|
+
}
|
|
41667
|
+
if (slugMatches.length === 1 && slugMatches[0]) {
|
|
41668
|
+
return { matched: slugMatches[0], ambiguous: false };
|
|
41669
|
+
}
|
|
41670
|
+
return { ambiguous: true };
|
|
41671
|
+
}
|
|
41672
|
+
function findBakedInVariants(options, baseId, baseIdsWithVariants = /* @__PURE__ */ new Set()) {
|
|
41673
|
+
return options.filter((choice) => {
|
|
41674
|
+
const choiceValue = choice.value.trim();
|
|
41675
|
+
if (baseIdsWithVariants.has(choiceValue))
|
|
41676
|
+
return false;
|
|
41677
|
+
const separator = choiceValue[baseId.length];
|
|
41678
|
+
return choiceValue.startsWith(baseId) && (separator === "-" || separator === ":") && /^(?:low|medium|high|xhigh)$/u.test(choiceValue.slice(baseId.length + 1));
|
|
41679
|
+
});
|
|
41680
|
+
}
|
|
41681
|
+
function findBakedInOption(options, baseId, effort, baseIdsWithVariants = /* @__PURE__ */ new Set()) {
|
|
41682
|
+
return options.find((choice) => {
|
|
41683
|
+
const choiceValue = choice.value.trim();
|
|
41684
|
+
if (baseIdsWithVariants.has(choiceValue))
|
|
41685
|
+
return false;
|
|
41686
|
+
return choiceValue === `${baseId}-${effort}` || choiceValue === `${baseId}:${effort}`;
|
|
41687
|
+
});
|
|
41688
|
+
}
|
|
41689
|
+
function resolveExactOptionSelection(context) {
|
|
41690
|
+
const { options, baseIdsWithVariants, requestedModelId, requestedThinking, split, hasExplicitEffortConflict, splitGroupEntries } = context;
|
|
41691
|
+
const exactOption = options.find((choice) => choice.value === requestedModelId);
|
|
41692
|
+
if (!exactOption)
|
|
41693
|
+
return void 0;
|
|
41694
|
+
if (!hasExplicitEffortConflict || !requestedThinking) {
|
|
41695
|
+
return { targetValue: exactOption.value, bakedInThinking: false };
|
|
41696
|
+
}
|
|
41697
|
+
const siblingBaked = findBakedInOption(options, split.modelRef.id, requestedThinking, baseIdsWithVariants);
|
|
41698
|
+
if (siblingBaked) {
|
|
41699
|
+
return { targetValue: siblingBaked.value, bakedInThinking: true };
|
|
41700
|
+
}
|
|
41701
|
+
const requestedTrimmed = requestedModelId.trim();
|
|
41702
|
+
const hasSiblingCatalogEntry = splitGroupEntries.some((entry) => entry.modelId.trim() !== requestedTrimmed);
|
|
41703
|
+
const isStandaloneCatalogVariant = splitGroupEntries.length === 1 && splitGroupEntries[0]?.modelId.trim() === requestedTrimmed;
|
|
41704
|
+
const isBakedInExactOption = requestedModelId.includes(":") && !isStandaloneCatalogVariant || options.some((choice) => choice.value === split.modelRef.id) || findBakedInVariants(options, split.modelRef.id, baseIdsWithVariants).length > 1 || hasSiblingCatalogEntry;
|
|
41705
|
+
if (!isBakedInExactOption) {
|
|
41706
|
+
return { targetValue: exactOption.value, bakedInThinking: false };
|
|
41707
|
+
}
|
|
41708
|
+
return void 0;
|
|
41709
|
+
}
|
|
41710
|
+
function resolveExplicitEffortOverride(context) {
|
|
41711
|
+
const { options, availableModels, baseIdsWithVariants, requestedThinking, split, hasExplicitEffortConflict, splitGroupEntries } = context;
|
|
41712
|
+
if (!hasExplicitEffortConflict || !requestedThinking) {
|
|
41713
|
+
return { handled: false };
|
|
41714
|
+
}
|
|
41715
|
+
const bakedOverride = findBakedInOption(options, split.modelRef.id, requestedThinking, baseIdsWithVariants);
|
|
41716
|
+
if (bakedOverride) {
|
|
41717
|
+
return {
|
|
41718
|
+
handled: true,
|
|
41719
|
+
resolution: { targetValue: bakedOverride.value, bakedInThinking: true }
|
|
41720
|
+
};
|
|
41721
|
+
}
|
|
41722
|
+
if (splitGroupEntries.length === 0) {
|
|
41723
|
+
return { handled: false };
|
|
41724
|
+
}
|
|
41725
|
+
const matchingEntries = splitGroupEntries.filter((entry) => catalogEntryEffortForBase(entry, split.modelRef.id, baseIdsWithVariants) === requestedThinking);
|
|
41726
|
+
if (matchingEntries.length !== 1 || !matchingEntries[0]) {
|
|
41727
|
+
return { handled: true };
|
|
41728
|
+
}
|
|
41729
|
+
const targetRawName = matchingEntries[0].name.trim();
|
|
41730
|
+
const targetExactMatch = matchModelChoiceByName(options, availableModels, baseIdsWithVariants, targetRawName, split.modelRef.id, "exact");
|
|
41731
|
+
if (targetExactMatch.matched) {
|
|
41732
|
+
const bakedIn = stripEffortLabel(targetRawName) !== targetRawName || Boolean(safeSplitAntigravityModelAndEffort(targetExactMatch.matched.value)?.effort);
|
|
41733
|
+
return {
|
|
41734
|
+
handled: true,
|
|
41735
|
+
resolution: {
|
|
41736
|
+
targetValue: targetExactMatch.matched.value,
|
|
41737
|
+
bakedInThinking: bakedIn
|
|
41738
|
+
}
|
|
41739
|
+
};
|
|
41740
|
+
}
|
|
41741
|
+
if (!targetExactMatch.ambiguous) {
|
|
41742
|
+
const targetBaseName = stripEffortLabel(targetRawName);
|
|
41743
|
+
if (targetBaseName !== targetRawName) {
|
|
41744
|
+
const targetBaseMatch = matchModelChoiceByName(options, availableModels, baseIdsWithVariants, targetBaseName, split.modelRef.id, "base");
|
|
41745
|
+
if (targetBaseMatch.matched) {
|
|
41746
|
+
return {
|
|
41747
|
+
handled: true,
|
|
41748
|
+
resolution: {
|
|
41749
|
+
targetValue: targetBaseMatch.matched.value,
|
|
41750
|
+
bakedInThinking: false
|
|
41751
|
+
}
|
|
41752
|
+
};
|
|
41753
|
+
}
|
|
41754
|
+
}
|
|
41755
|
+
}
|
|
41756
|
+
return { handled: true };
|
|
41757
|
+
}
|
|
41758
|
+
function resolveExactAvailableSelection(context) {
|
|
41759
|
+
const { options, availableModels, baseIdsWithVariants, requestedModelId, split, isRequestedBaseModel } = context;
|
|
41760
|
+
const exactAvailable = availableModels.find((entry) => entry.modelId === requestedModelId);
|
|
41761
|
+
if (!exactAvailable)
|
|
41762
|
+
return { ambiguous: false };
|
|
41763
|
+
const expectedBaseId = catalogEntryBaseId(exactAvailable, baseIdsWithVariants);
|
|
41764
|
+
if (!expectedBaseId)
|
|
41765
|
+
return { ambiguous: false };
|
|
41766
|
+
const rawName = exactAvailable.name.trim();
|
|
41767
|
+
const exactNameMatch = matchModelChoiceByName(options, availableModels, baseIdsWithVariants, rawName, expectedBaseId, "exact");
|
|
41768
|
+
if (exactNameMatch.matched) {
|
|
41769
|
+
const bakedIn = !isRequestedBaseModel && Boolean(split.effort) && (stripEffortLabel(rawName) !== rawName || Boolean(safeSplitAntigravityModelAndEffort(exactNameMatch.matched.value)?.effort));
|
|
41770
|
+
return {
|
|
41771
|
+
ambiguous: false,
|
|
41772
|
+
resolution: {
|
|
41773
|
+
targetValue: exactNameMatch.matched.value,
|
|
41774
|
+
...!bakedIn && !isRequestedBaseModel && split.effort ? { impliedThinking: split.effort } : {},
|
|
41775
|
+
bakedInThinking: bakedIn
|
|
41776
|
+
}
|
|
41777
|
+
};
|
|
41778
|
+
}
|
|
41779
|
+
if (exactNameMatch.ambiguous) {
|
|
41780
|
+
return { ambiguous: true };
|
|
41781
|
+
}
|
|
41782
|
+
const baseName = stripEffortLabel(rawName);
|
|
41783
|
+
if (baseName !== rawName) {
|
|
41784
|
+
const baseNameMatch = matchModelChoiceByName(options, availableModels, baseIdsWithVariants, baseName, expectedBaseId, "base");
|
|
41785
|
+
if (baseNameMatch.matched) {
|
|
41786
|
+
return {
|
|
41787
|
+
ambiguous: false,
|
|
41788
|
+
resolution: {
|
|
41789
|
+
targetValue: baseNameMatch.matched.value,
|
|
41790
|
+
...!isRequestedBaseModel && split.effort ? { impliedThinking: split.effort } : {},
|
|
41791
|
+
bakedInThinking: false
|
|
41792
|
+
}
|
|
41793
|
+
};
|
|
41794
|
+
}
|
|
41795
|
+
if (baseNameMatch.ambiguous) {
|
|
41796
|
+
return { ambiguous: true };
|
|
41797
|
+
}
|
|
41798
|
+
}
|
|
41799
|
+
return { ambiguous: false };
|
|
41800
|
+
}
|
|
41801
|
+
function resolveGroupedCatalogSelection(context) {
|
|
41802
|
+
const { options, availableModels, baseIdsWithVariants, requestedModelId, requestedThinking, split, requestedGroupEntries, splitGroupEntries } = context;
|
|
41803
|
+
const matchedRequestedGroup = requestedGroupEntries.length > 0;
|
|
41804
|
+
const groupEntries = matchedRequestedGroup ? requestedGroupEntries : splitGroupEntries;
|
|
41805
|
+
const expectedBaseId = matchedRequestedGroup ? requestedModelId : split.modelRef.id;
|
|
41806
|
+
if (groupEntries.length === 0)
|
|
41807
|
+
return void 0;
|
|
41808
|
+
const impliedThinking = !matchedRequestedGroup ? split.effort : void 0;
|
|
41809
|
+
const targetEffort = requestedThinking ?? impliedThinking;
|
|
41810
|
+
const offeredEfforts = collectGroupEfforts(groupEntries, expectedBaseId, baseIdsWithVariants);
|
|
41811
|
+
if (!matchedRequestedGroup && targetEffort && offeredEfforts.size > 0 && !offeredEfforts.has(targetEffort)) {
|
|
41812
|
+
return void 0;
|
|
41813
|
+
}
|
|
41814
|
+
const baseNames = /* @__PURE__ */ new Map();
|
|
41815
|
+
for (const entry of groupEntries) {
|
|
41816
|
+
const baseName = stripEffortLabel(entry.name);
|
|
41817
|
+
const key = normalizeModelNameKey(baseName);
|
|
41818
|
+
if (key && !baseNames.has(key)) {
|
|
41819
|
+
baseNames.set(key, baseName);
|
|
41820
|
+
}
|
|
41821
|
+
}
|
|
41822
|
+
if (baseNames.size === 1) {
|
|
41823
|
+
const [baseName] = baseNames.values();
|
|
41824
|
+
const baseNameMatch = baseName ? matchModelChoiceByName(options, availableModels, baseIdsWithVariants, baseName, expectedBaseId, "base") : void 0;
|
|
41825
|
+
if (baseNameMatch?.matched) {
|
|
41826
|
+
return {
|
|
41827
|
+
targetValue: baseNameMatch.matched.value,
|
|
41828
|
+
...impliedThinking && !requestedThinking ? { impliedThinking } : {},
|
|
41829
|
+
bakedInThinking: false
|
|
41830
|
+
};
|
|
41831
|
+
}
|
|
41832
|
+
}
|
|
41833
|
+
if (targetEffort && offeredEfforts.size > 0 && !offeredEfforts.has(targetEffort)) {
|
|
41834
|
+
return void 0;
|
|
41835
|
+
}
|
|
41836
|
+
const targetEntry = targetEffort ? (() => {
|
|
41837
|
+
const matching = groupEntries.filter((entry) => catalogEntryEffortForBase(entry, expectedBaseId, baseIdsWithVariants) === targetEffort);
|
|
41838
|
+
return matching.length === 1 ? matching[0] : void 0;
|
|
41839
|
+
})() : groupEntries.length === 1 ? groupEntries[0] : void 0;
|
|
41840
|
+
if (!targetEntry)
|
|
41841
|
+
return void 0;
|
|
41842
|
+
const targetEntryEffort = catalogEntryEffortForBase(targetEntry, expectedBaseId, baseIdsWithVariants);
|
|
41843
|
+
const targetNameMatch = matchModelChoiceByName(options, availableModels, baseIdsWithVariants, targetEntry.name, expectedBaseId, "exact");
|
|
41844
|
+
if (!targetNameMatch.matched)
|
|
41845
|
+
return void 0;
|
|
41846
|
+
return {
|
|
41847
|
+
targetValue: targetNameMatch.matched.value,
|
|
41848
|
+
bakedInThinking: Boolean(targetEntryEffort)
|
|
41849
|
+
};
|
|
41850
|
+
}
|
|
41851
|
+
function resolveAntigravityAcpModelSelection(options, availableModels, requestedModelId, requestedThinking) {
|
|
41852
|
+
const split = splitAntigravityModelAndEffort(requestedModelId);
|
|
41853
|
+
const baseIdsWithVariants = collectCatalogBaseIds(availableModels);
|
|
41854
|
+
const requestedVariants = findBakedInVariants(options, requestedModelId, baseIdsWithVariants);
|
|
41855
|
+
const requestedHasVariantEntries = availableModels.some((entry) => Boolean(catalogEntryEffortForBase(entry, requestedModelId, baseIdsWithVariants)));
|
|
41856
|
+
const isRequestedBaseModel = requestedVariants.length > 0 || requestedHasVariantEntries;
|
|
41857
|
+
const requestedGroupEntries = availableModels.filter((entry) => catalogEntryBaseId(entry, baseIdsWithVariants) === requestedModelId);
|
|
41858
|
+
const splitGroupEntries = !isRequestedBaseModel && split.effort ? availableModels.filter((entry) => catalogEntryBaseId(entry, baseIdsWithVariants) === split.modelRef.id) : [];
|
|
41859
|
+
const splitOfferedEfforts = collectGroupEfforts(splitGroupEntries, split.modelRef.id, baseIdsWithVariants);
|
|
41860
|
+
const hasExplicitEffortConflict = !isRequestedBaseModel && Boolean(split.effort) && Boolean(requestedThinking) && requestedThinking !== split.effort;
|
|
41861
|
+
const context = {
|
|
41862
|
+
options,
|
|
41863
|
+
availableModels,
|
|
41864
|
+
baseIdsWithVariants,
|
|
41865
|
+
requestedModelId,
|
|
41866
|
+
requestedThinking,
|
|
41867
|
+
split,
|
|
41868
|
+
isRequestedBaseModel,
|
|
41869
|
+
hasExplicitEffortConflict,
|
|
41870
|
+
requestedGroupEntries,
|
|
41871
|
+
splitGroupEntries,
|
|
41872
|
+
splitOfferedEfforts
|
|
41873
|
+
};
|
|
41874
|
+
const exactOptionResolution = resolveExactOptionSelection(context);
|
|
41875
|
+
if (exactOptionResolution)
|
|
41876
|
+
return exactOptionResolution;
|
|
41877
|
+
if (split.effort && !isRequestedBaseModel && options.some((choice) => choice.value === split.modelRef.id)) {
|
|
41878
|
+
const targetEffort = requestedThinking ?? split.effort;
|
|
41879
|
+
if (splitOfferedEfforts.size > 0 && !splitOfferedEfforts.has(targetEffort)) {
|
|
41880
|
+
return void 0;
|
|
41881
|
+
}
|
|
41882
|
+
return {
|
|
41883
|
+
targetValue: split.modelRef.id,
|
|
41884
|
+
...requestedThinking ? {} : { impliedThinking: split.effort },
|
|
41885
|
+
bakedInThinking: false
|
|
41886
|
+
};
|
|
41887
|
+
}
|
|
41888
|
+
const overrideResult = resolveExplicitEffortOverride(context);
|
|
41889
|
+
if (overrideResult.handled)
|
|
41890
|
+
return overrideResult.resolution;
|
|
41891
|
+
const exactAvailableResult = resolveExactAvailableSelection(context);
|
|
41892
|
+
if (exactAvailableResult.resolution)
|
|
41893
|
+
return exactAvailableResult.resolution;
|
|
41894
|
+
if (!exactAvailableResult.ambiguous) {
|
|
41895
|
+
const groupedResolution = resolveGroupedCatalogSelection(context);
|
|
41896
|
+
if (groupedResolution)
|
|
41897
|
+
return groupedResolution;
|
|
41898
|
+
}
|
|
41899
|
+
if (requestedVariants.length > 0) {
|
|
41900
|
+
if (requestedThinking) {
|
|
41901
|
+
const baked = findBakedInOption(requestedVariants, requestedModelId, requestedThinking, baseIdsWithVariants);
|
|
41902
|
+
if (baked) {
|
|
41903
|
+
return { targetValue: baked.value, bakedInThinking: true };
|
|
41904
|
+
}
|
|
41905
|
+
} else if (requestedVariants.length === 1 && requestedVariants[0]) {
|
|
41906
|
+
return { targetValue: requestedVariants[0].value, bakedInThinking: true };
|
|
41907
|
+
}
|
|
41908
|
+
return void 0;
|
|
41909
|
+
}
|
|
41910
|
+
if (split.effort && !isRequestedBaseModel) {
|
|
41911
|
+
const bakedEffort = requestedThinking ?? split.effort;
|
|
41912
|
+
const baked = findBakedInOption(options, split.modelRef.id, bakedEffort, baseIdsWithVariants);
|
|
41913
|
+
if (baked) {
|
|
41914
|
+
return { targetValue: baked.value, bakedInThinking: true };
|
|
41915
|
+
}
|
|
41916
|
+
}
|
|
41917
|
+
return void 0;
|
|
41918
|
+
}
|
|
40646
41919
|
|
|
40647
41920
|
// dist/wake-observer.js
|
|
40648
41921
|
var WAKE_COMMIT_POLL_DELAYS_MS = [150, 250, 400, 600, 1e3];
|
|
@@ -41206,7 +42479,7 @@ import { constants, createReadStream as createReadStream3 } from "node:fs";
|
|
|
41206
42479
|
import { access as access3, stat as stat3 } from "node:fs/promises";
|
|
41207
42480
|
import path13 from "node:path";
|
|
41208
42481
|
import { createInterface as createInterface2 } from "node:readline";
|
|
41209
|
-
import { fileURLToPath } from "node:url";
|
|
42482
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
41210
42483
|
var SESSION_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu;
|
|
41211
42484
|
function workspacePaths(raw) {
|
|
41212
42485
|
if (typeof raw !== "string")
|
|
@@ -41229,7 +42502,7 @@ function workspacePaths(raw) {
|
|
|
41229
42502
|
const url2 = new URL(uri);
|
|
41230
42503
|
if (url2.hostname && url2.hostname !== "localhost")
|
|
41231
42504
|
continue;
|
|
41232
|
-
cwd =
|
|
42505
|
+
cwd = fileURLToPath2(url2);
|
|
41233
42506
|
}
|
|
41234
42507
|
if (!path13.isAbsolute(cwd))
|
|
41235
42508
|
continue;
|
|
@@ -41879,6 +43152,7 @@ var AntigravitySession = class {
|
|
|
41879
43152
|
#unsavedPromptWindows = [];
|
|
41880
43153
|
#promptWindowWrites = Promise.resolve();
|
|
41881
43154
|
#toolOwners = /* @__PURE__ */ new Map();
|
|
43155
|
+
#settledToolCallIds = /* @__PURE__ */ new Set();
|
|
41882
43156
|
#pending = /* @__PURE__ */ new Map();
|
|
41883
43157
|
#usage;
|
|
41884
43158
|
#usageWork;
|
|
@@ -42132,9 +43406,18 @@ var AntigravitySession = class {
|
|
|
42132
43406
|
if (this.#requested.model) {
|
|
42133
43407
|
const applied = await this.#setModelConfig(this.#requested.model.id, this.#requested.thinkingOptionId);
|
|
42134
43408
|
if (!applied.bakedInThinking) {
|
|
42135
|
-
|
|
42136
|
-
|
|
42137
|
-
|
|
43409
|
+
if (this.#requested.thinkingOptionId) {
|
|
43410
|
+
const desiredThinking = this.#resolveThinkingChoice(this.#requested.thinkingOptionId);
|
|
43411
|
+
if (desiredThinking) {
|
|
43412
|
+
await this.#setConfig("thinking", desiredThinking);
|
|
43413
|
+
}
|
|
43414
|
+
} else if (applied.impliedThinking) {
|
|
43415
|
+
await this.#setConfig("thinking", applied.impliedThinking);
|
|
43416
|
+
} else {
|
|
43417
|
+
const desiredThinking = this.#resolveThinkingChoice();
|
|
43418
|
+
if (desiredThinking) {
|
|
43419
|
+
await this.#setConfig("thinking", desiredThinking);
|
|
43420
|
+
}
|
|
42138
43421
|
}
|
|
42139
43422
|
}
|
|
42140
43423
|
} else if (this.#requested.thinkingOptionId && this.#hasConfigChoice("thinking", this.#requested.thinkingOptionId)) {
|
|
@@ -42197,7 +43480,7 @@ var AntigravitySession = class {
|
|
|
42197
43480
|
executionPolicy: this.#options.unattended ? "unattended-full-access" : "default",
|
|
42198
43481
|
permissionModeId: skip ? SKIP : opened.modes?.currentModeId ?? "default"
|
|
42199
43482
|
};
|
|
42200
|
-
const effective = readAcpEffectiveModelState(this.#configOptions, this.#catalog);
|
|
43483
|
+
const effective = readAcpEffectiveModelState(this.#configOptions, this.#catalog, this.#availableModels);
|
|
42201
43484
|
if (!effective.effectiveModel && opened.models?.currentModelId) {
|
|
42202
43485
|
const current = splitAntigravityModelAndEffort(opened.models.currentModelId);
|
|
42203
43486
|
effective.effectiveModel = current.modelRef;
|
|
@@ -42223,7 +43506,7 @@ var AntigravitySession = class {
|
|
|
42223
43506
|
this.#state = {
|
|
42224
43507
|
...nativeRef ? { nativeRef } : {},
|
|
42225
43508
|
...effectivePermissionModeId ? { effectivePermissionModeId } : {},
|
|
42226
|
-
...readAcpEffectiveModelState(config2, this.#catalog)
|
|
43509
|
+
...readAcpEffectiveModelState(config2, this.#catalog, this.#availableModels)
|
|
42227
43510
|
};
|
|
42228
43511
|
this.#syncUsageModel(true);
|
|
42229
43512
|
}
|
|
@@ -42247,29 +43530,14 @@ var AntigravitySession = class {
|
|
|
42247
43530
|
if (!option) {
|
|
42248
43531
|
throw new AntigravityTransportError("unsupported", `Antigravity does not offer model=${requestedModelId}`);
|
|
42249
43532
|
}
|
|
42250
|
-
|
|
42251
|
-
|
|
42252
|
-
|
|
42253
|
-
if (!option.options.some((choice) => choice.value === requestedModelId)) {
|
|
42254
|
-
const split = splitAntigravityModelAndEffort(requestedModelId);
|
|
42255
|
-
if (split.effort && option.options.some((choice) => choice.value === split.modelRef.id)) {
|
|
42256
|
-
targetValue = split.modelRef.id;
|
|
42257
|
-
impliedThinking = split.effort;
|
|
42258
|
-
} else if (requestedThinking && option.options.some((choice) => choice.value === `${requestedModelId}-${requestedThinking}`)) {
|
|
42259
|
-
targetValue = `${requestedModelId}-${requestedThinking}`;
|
|
42260
|
-
bakedInThinking = true;
|
|
42261
|
-
} else {
|
|
42262
|
-
const variants = option.options.filter((choice) => choice.value.startsWith(`${requestedModelId}-`) && /^(?:low|medium|high|xhigh)$/u.test(choice.value.slice(requestedModelId.length + 1)));
|
|
42263
|
-
if (!requestedThinking && variants.length === 1 && variants[0]) {
|
|
42264
|
-
targetValue = variants[0].value;
|
|
42265
|
-
bakedInThinking = true;
|
|
42266
|
-
}
|
|
42267
|
-
}
|
|
43533
|
+
const resolved = resolveAntigravityAcpModelSelection(option.options, this.#availableModels, requestedModelId, requestedThinking);
|
|
43534
|
+
if (!resolved) {
|
|
43535
|
+
throw new AntigravityTransportError("unsupported", `Antigravity does not offer model=${requestedModelId}`);
|
|
42268
43536
|
}
|
|
42269
|
-
await this.#setConfig("model", targetValue);
|
|
43537
|
+
await this.#setConfig("model", resolved.targetValue);
|
|
42270
43538
|
return {
|
|
42271
|
-
...impliedThinking ? { impliedThinking } : {},
|
|
42272
|
-
bakedInThinking
|
|
43539
|
+
...resolved.impliedThinking ? { impliedThinking: resolved.impliedThinking } : {},
|
|
43540
|
+
bakedInThinking: resolved.bakedInThinking
|
|
42273
43541
|
};
|
|
42274
43542
|
}
|
|
42275
43543
|
async #setConfig(category, value) {
|
|
@@ -42291,6 +43559,10 @@ var AntigravitySession = class {
|
|
|
42291
43559
|
this.#handleToolEvent(owner, event);
|
|
42292
43560
|
return;
|
|
42293
43561
|
}
|
|
43562
|
+
if (event.type === "tool.call")
|
|
43563
|
+
this.#settledToolCallIds.delete(event.toolCallId);
|
|
43564
|
+
else if (this.#settledToolCallIds.has(event.toolCallId))
|
|
43565
|
+
return;
|
|
42294
43566
|
}
|
|
42295
43567
|
if ((event.type === "agent.text" || event.type === "agent.thought") && event.text.trim() || event.type === "tool.call" || event.type === "tool.update") {
|
|
42296
43568
|
if (this.#opening || this.#historyOperation || this.#active?.cancelled)
|
|
@@ -42727,9 +43999,13 @@ var AntigravitySession = class {
|
|
|
42727
43999
|
const applied = await this.#setModelConfig(command.model.id);
|
|
42728
44000
|
try {
|
|
42729
44001
|
if (!applied.bakedInThinking) {
|
|
42730
|
-
|
|
42731
|
-
|
|
42732
|
-
|
|
44002
|
+
if (applied.impliedThinking) {
|
|
44003
|
+
await this.#setConfig("thinking", applied.impliedThinking);
|
|
44004
|
+
} else {
|
|
44005
|
+
const desiredThinking = this.#resolveThinkingChoice();
|
|
44006
|
+
if (desiredThinking) {
|
|
44007
|
+
await this.#setConfig("thinking", desiredThinking);
|
|
44008
|
+
}
|
|
42733
44009
|
}
|
|
42734
44010
|
}
|
|
42735
44011
|
} finally {
|
|
@@ -42985,9 +44261,19 @@ var AntigravitySession = class {
|
|
|
42985
44261
|
#isCurrent(turn) {
|
|
42986
44262
|
return this.#active === turn && !turn.ended;
|
|
42987
44263
|
}
|
|
44264
|
+
#markToolSettled(toolCallId) {
|
|
44265
|
+
this.#settledToolCallIds.delete(toolCallId);
|
|
44266
|
+
this.#settledToolCallIds.add(toolCallId);
|
|
44267
|
+
if (this.#settledToolCallIds.size > 256) {
|
|
44268
|
+
const oldest = this.#settledToolCallIds.values().next().value;
|
|
44269
|
+
if (oldest !== void 0)
|
|
44270
|
+
this.#settledToolCallIds.delete(oldest);
|
|
44271
|
+
}
|
|
44272
|
+
}
|
|
42988
44273
|
#handleToolEvent(turn, event) {
|
|
42989
44274
|
if (!event.toolCallId || !turn.tracker || turn.cancelled || turn.ended && !turn.detachedToolCallIds.has(event.toolCallId))
|
|
42990
44275
|
return;
|
|
44276
|
+
this.#settledToolCallIds.delete(event.toolCallId);
|
|
42991
44277
|
this.#toolOwners.set(event.toolCallId, turn);
|
|
42992
44278
|
turn.hasToolCalls = true;
|
|
42993
44279
|
if (event.status === "completed" || event.status === "failed")
|
|
@@ -42996,6 +44282,7 @@ var AntigravitySession = class {
|
|
|
42996
44282
|
if (event.status === "completed" || event.status === "failed") {
|
|
42997
44283
|
turn.detachedToolCallIds.delete(event.toolCallId);
|
|
42998
44284
|
this.#toolOwners.delete(event.toolCallId);
|
|
44285
|
+
this.#markToolSettled(event.toolCallId);
|
|
42999
44286
|
}
|
|
43000
44287
|
}
|
|
43001
44288
|
#appendText(turn, type, text3) {
|
|
@@ -43116,8 +44403,10 @@ var AntigravitySession = class {
|
|
|
43116
44403
|
this.#closeInteractions("cancelled", turn, outcome.status === "succeeded");
|
|
43117
44404
|
turn.tracker?.finishPending(outcome);
|
|
43118
44405
|
for (const [toolCallId, owner] of this.#toolOwners) {
|
|
43119
|
-
if (owner === turn && !turn.detachedToolCallIds.has(toolCallId))
|
|
44406
|
+
if (owner === turn && !turn.detachedToolCallIds.has(toolCallId)) {
|
|
43120
44407
|
this.#toolOwners.delete(toolCallId);
|
|
44408
|
+
this.#markToolSettled(toolCallId);
|
|
44409
|
+
}
|
|
43121
44410
|
}
|
|
43122
44411
|
turn.ended = true;
|
|
43123
44412
|
this.#active = void 0;
|
|
@@ -43365,6 +44654,7 @@ var AntigravityAdapter = class {
|
|
|
43365
44654
|
harnessId = harnessId;
|
|
43366
44655
|
commandCatalog = ANTIGRAVITY_COMMAND_CATALOG;
|
|
43367
44656
|
liveCommandCatalog = true;
|
|
44657
|
+
normalizeStoredModelRef = normalizeAntigravityStoredModelRef;
|
|
43368
44658
|
sessionImport;
|
|
43369
44659
|
usageStatistics;
|
|
43370
44660
|
#environment;
|