@codexhost/cli-win32-x64 0.34.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 +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +479 -107
- package/app/console-web.js +1106 -145
- package/app/desktop-controller.mjs +356 -63
- package/app/host-runtime.mjs +4345 -1470
- package/app/plugins/antigravity/plugin.mjs +1002 -99
- package/app/plugins/claude-code/plugin.mjs +336 -61
- package/app/plugins/codebuddy/plugin.mjs +389 -84
- package/app/plugins/codex-usage/plugin.mjs +468 -65
- package/app/plugins/copilot/plugin.mjs +336 -63
- package/app/plugins/cursor-cli/plugin.mjs +336 -61
- package/app/plugins/deepseek-harness/plugin.mjs +336 -61
- package/app/plugins/devin/plugin.mjs +336 -61
- package/app/plugins/grok/plugin.mjs +389 -83
- package/app/plugins/hermes/plugin.mjs +335 -60
- package/app/plugins/kimi-code/plugin.mjs +336 -61
- package/app/plugins/kiro-cli/plugin.mjs +336 -61
- package/app/plugins/omp/plugin.mjs +336 -61
- package/app/plugins/opencode/plugin.mjs +336 -61
- package/app/plugins/pi/plugin.mjs +336 -61
- package/app/plugins/qoder/plugin.mjs +337 -62
- package/app/plugins/qoder-cn/plugin.mjs +337 -62
- package/app/plugins/qwen-code/plugin.mjs +335 -60
- package/app/plugins/workbuddy/plugin.mjs +408 -95
- package/app/plugins/workbuddy-cn/plugin.mjs +408 -95
- package/app/plugins/zcode/plugin.mjs +337 -61
- package/app/renderer-extension.js +1516 -346
- package/app/web/assets/{abnfDiagram-XWFEHMT6-Cg-E7mc4.js → abnfDiagram-XWFEHMT6-CGkBtBVj.js} +1 -1
- package/app/web/assets/{architectureDiagram-CSQXQB3N-B__CwXjW.js → architectureDiagram-CSQXQB3N-Byv-cZeH.js} +1 -1
- package/app/web/assets/{blockDiagram-BEDRHYPZ-Bk2gCIVM.js → blockDiagram-BEDRHYPZ-DjLzUtwg.js} +1 -1
- package/app/web/assets/{c4Diagram-M2UUVUY5-DU_TpjJ3.js → c4Diagram-M2UUVUY5-CJlsb6QO.js} +1 -1
- package/app/web/assets/{chunk-2Q5K7J3B-DnJEi6e4.js → chunk-2Q5K7J3B-CWm537bw.js} +1 -1
- package/app/web/assets/{chunk-3GCGMST5-Dia9jGkf.js → chunk-3GCGMST5-NpcInIx4.js} +1 -1
- package/app/web/assets/{chunk-5VM5RSS4-2PGDiDvK.js → chunk-5VM5RSS4-CeyyP0dm.js} +1 -1
- package/app/web/assets/{chunk-7U7NFRK5-BLPm3d5H.js → chunk-7U7NFRK5-Bto5OgbF.js} +1 -1
- package/app/web/assets/{chunk-CNRTWJTD-GH_nAEXs.js → chunk-CNRTWJTD-CuRMFCjT.js} +1 -1
- package/app/web/assets/{chunk-D5HYT7QG-DnIm-Ely.js → chunk-D5HYT7QG-DtQM1-2k.js} +1 -1
- package/app/web/assets/{chunk-EBZ3SEQC-C6N5qLCR.js → chunk-EBZ3SEQC-DbUb3ZJ4.js} +2 -2
- package/app/web/assets/{chunk-JWPE2WC7-D_kMgdmr.js → chunk-JWPE2WC7-Dxh3d9Ag.js} +1 -1
- package/app/web/assets/{chunk-KTR4FSNJ-BRb9femQ.js → chunk-KTR4FSNJ-BfwavXUO.js} +1 -1
- package/app/web/assets/{chunk-XXDRQBXY-BFaK95zq.js → chunk-XXDRQBXY-CxR1flID.js} +1 -1
- package/app/web/assets/{classDiagram-v2-KXABOMEV--_hR_XrU.js → classDiagram-v2-KXABOMEV-2WV2q_X2.js} +1 -1
- package/app/web/assets/{cose-bilkent-JH36ORCC-C7ghEB3_.js → cose-bilkent-JH36ORCC-C-ENrCL_.js} +1 -1
- package/app/web/assets/{cynefin-EF2NZ3EQ-Ce1lURwZ.js → cynefin-EF2NZ3EQ-Bg5LeTZO.js} +1 -1
- package/app/web/assets/{cynefinDiagram-NJNITYFG-Cgr5aSTS.js → cynefinDiagram-NJNITYFG-CRAdbGGt.js} +1 -1
- package/app/web/assets/{dagre-KIHZ2IZ3-BBFKmRP1.js → dagre-KIHZ2IZ3-dNHEvUqL.js} +1 -1
- package/app/web/assets/{diagram-7YQZDPLS-CJQih32K.js → diagram-7YQZDPLS-7F4O37o5.js} +1 -1
- package/app/web/assets/{diagram-QBROCOUO-Cl3S7IUT.js → diagram-QBROCOUO-B-5KpeI2.js} +1 -1
- package/app/web/assets/{diagram-RJJCUUZO-B6C8N2cV.js → diagram-RJJCUUZO-DqDsyDaL.js} +1 -1
- package/app/web/assets/{diagram-WERXNKYE-NkciBSQl.js → diagram-WERXNKYE-f1oaPKos.js} +1 -1
- package/app/web/assets/{diagram-YHHI257C-DlEvljeY.js → diagram-YHHI257C-DVMtl9Bt.js} +1 -1
- package/app/web/assets/{diagram-YR4HJLHV-e4_Gzbt6.js → diagram-YR4HJLHV-BWFCNFFF.js} +1 -1
- package/app/web/assets/{ebnfDiagram-N527522P-WvQEFmPi.js → ebnfDiagram-N527522P-B4N7d-Bi.js} +1 -1
- package/app/web/assets/{elk-O5DQBFGD-CkyJsjzf.js → elk-O5DQBFGD-DRdfF_UQ.js} +1 -1
- package/app/web/assets/{erDiagram-K3K3BIDK-B93gK3X0.js → erDiagram-K3K3BIDK-BW4-_5sZ.js} +1 -1
- package/app/web/assets/{flowDiagram-Z6JWZHQI-NFaGX6B4.js → flowDiagram-Z6JWZHQI-DIQa5yEv.js} +1 -1
- package/app/web/assets/{ganttDiagram-3PRQTZWP-Czh68CQm.js → ganttDiagram-3PRQTZWP-JBK9PM7A.js} +1 -1
- package/app/web/assets/{gitGraphDiagram-VXDFKS5L-t95UHKja.js → gitGraphDiagram-VXDFKS5L-TPI9Su0g.js} +1 -1
- package/app/web/assets/{grid-E2QIVN74-C87DucDN.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-CxFlfQbY.js → infoDiagram-EZ3ZOAHP-BeFwO9PI.js} +1 -1
- package/app/web/assets/{ishikawaDiagram-S3EKX5GW-D4IwQJde.js → ishikawaDiagram-S3EKX5GW-BTbrKF_p.js} +1 -1
- package/app/web/assets/{journeyDiagram-POQNLL5X-C0Bf5W4T.js → journeyDiagram-POQNLL5X-DR0yWxJi.js} +1 -1
- package/app/web/assets/{kanban-definition-BH5XI6FM-Cda7r2yr.js → kanban-definition-BH5XI6FM-DMHrC9oV.js} +1 -1
- package/app/web/assets/{mermaid.core-f4LJm6AC.js → mermaid.core-Brmc1kJw.js} +4 -4
- package/app/web/assets/{mindmap-definition-WVAN44T4-DKapinG7.js → mindmap-definition-WVAN44T4-NT_XVwlI.js} +1 -1
- package/app/web/assets/{pegDiagram-D4NLKWP3-D7iEZGN2.js → pegDiagram-D4NLKWP3-K67_THcc.js} +1 -1
- package/app/web/assets/{pieDiagram-36ENHN4W-CopXZ5qt.js → pieDiagram-36ENHN4W-GlTgKnTi.js} +1 -1
- package/app/web/assets/{quadrantDiagram-ZQUDMS73-mmkKPDGK.js → quadrantDiagram-ZQUDMS73-yMEZ6-Nr.js} +1 -1
- package/app/web/assets/{railroadDiagram-JIZHGYPL-BAGwIIkV.js → railroadDiagram-JIZHGYPL-MXCqwbuq.js} +1 -1
- package/app/web/assets/{render-VIF2ZAQL-dXxGa09y.js → render-VIF2ZAQL-BRUlhHPG.js} +2 -2
- package/app/web/assets/{requirementDiagram-AXW2TVFA-C35tmLFs.js → requirementDiagram-AXW2TVFA-Dqx4p0Bz.js} +1 -1
- package/app/web/assets/{sankeyDiagram-FBCJTAIF-BbSo5yeK.js → sankeyDiagram-FBCJTAIF-COp3IWvs.js} +1 -1
- package/app/web/assets/{sequenceDiagram-3LA2ROMG-Cgm2unNy.js → sequenceDiagram-3LA2ROMG-j1xwrmp8.js} +1 -1
- package/app/web/assets/{sizeCapture-2Q2CQKSF-DCXFjl2x.js → sizeCapture-2Q2CQKSF-ZEXdxLeY.js} +1 -1
- package/app/web/assets/{stateDiagram-v2-ATKHQDJO-B349iAao.js → stateDiagram-v2-ATKHQDJO-2pt2L-Zd.js} +1 -1
- package/app/web/assets/{swimlanes-YQL5WMAO-6OvL1sEz.js → swimlanes-YQL5WMAO-BHpgfPPd.js} +1 -1
- package/app/web/assets/swimlanesDiagram-UCCPES4V-BrYKheZO.js +8 -0
- package/app/web/assets/{timeline-definition-7Z437IG3-Bh1E3mhW.js → timeline-definition-7Z437IG3-Cw4F_3FM.js} +1 -1
- package/app/web/assets/{usecaseDiagram-RDK6N6HP-Dr5A05lL.js → usecaseDiagram-RDK6N6HP-DefiMBIg.js} +1 -1
- package/app/web/assets/{vennDiagram-SHRQU5PJ-CQPPBa27.js → vennDiagram-SHRQU5PJ-D30EMFrI.js} +1 -1
- package/app/web/assets/{wardleyDiagram-F3OXNVQS-BHin00q8.js → wardleyDiagram-F3OXNVQS-4ok25PKp.js} +1 -1
- package/app/web/assets/{xychartDiagram-GDYJKCDI-D4BAWlQZ.js → xychartDiagram-GDYJKCDI-BB0uAQX5.js} +1 -1
- package/app/web/codexhost-settings.js +157 -87
- 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 +90 -78
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +98 -98
- 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 +1 -1
- 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 +80 -80
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +70 -70
- package/app/web/plugins.json +1 -0
- package/app/web-modules/server.mjs +1862 -1096
- 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-CGI50Nfg.css +0 -1
- package/app/web/assets/index-Dr6wHi0A.js +0 -208
- package/app/web/assets/swimlanesDiagram-UCCPES4V-CIKaQUvP.js +0 -8
package/app/console-server.mjs
CHANGED
|
@@ -21365,26 +21365,51 @@ var jsonPrimitiveSchema = external_exports.union([
|
|
|
21365
21365
|
external_exports.boolean(),
|
|
21366
21366
|
external_exports.null()
|
|
21367
21367
|
]);
|
|
21368
|
-
function
|
|
21369
|
-
const
|
|
21370
|
-
|
|
21368
|
+
function isPlainObject2(value) {
|
|
21369
|
+
const prototype = Object.getPrototypeOf(value);
|
|
21370
|
+
return prototype === Object.prototype || prototype === null;
|
|
21371
|
+
}
|
|
21372
|
+
var JSON_VALIDATION_LEAVE = /* @__PURE__ */ Symbol("json-validation-leave");
|
|
21373
|
+
function isValidJsonValue(value) {
|
|
21374
|
+
if (value === null || typeof value === "string" || typeof value === "boolean" || typeof value === "number" && Number.isFinite(value)) {
|
|
21375
|
+
return true;
|
|
21376
|
+
}
|
|
21377
|
+
if (typeof value !== "object")
|
|
21378
|
+
return false;
|
|
21379
|
+
const ancestors = /* @__PURE__ */ new Set();
|
|
21380
|
+
const stack = [value];
|
|
21371
21381
|
try {
|
|
21372
21382
|
while (stack.length > 0) {
|
|
21373
|
-
const
|
|
21374
|
-
if (
|
|
21375
|
-
|
|
21376
|
-
if (frame.leaving) {
|
|
21377
|
-
ancestors.delete(frame.value);
|
|
21383
|
+
const current = stack.pop();
|
|
21384
|
+
if (current === JSON_VALIDATION_LEAVE) {
|
|
21385
|
+
ancestors.delete(stack.pop());
|
|
21378
21386
|
continue;
|
|
21379
21387
|
}
|
|
21380
|
-
if (typeof
|
|
21388
|
+
if (current === null || typeof current === "string" || typeof current === "boolean" || typeof current === "number" && Number.isFinite(current)) {
|
|
21381
21389
|
continue;
|
|
21382
|
-
|
|
21390
|
+
}
|
|
21391
|
+
if (typeof current !== "object")
|
|
21383
21392
|
return false;
|
|
21384
|
-
ancestors.
|
|
21385
|
-
|
|
21386
|
-
|
|
21387
|
-
|
|
21393
|
+
if (ancestors.has(current))
|
|
21394
|
+
return false;
|
|
21395
|
+
if (Array.isArray(current)) {
|
|
21396
|
+
ancestors.add(current);
|
|
21397
|
+
stack.push(current, JSON_VALIDATION_LEAVE);
|
|
21398
|
+
for (let index = current.length - 1; index >= 0; index -= 1) {
|
|
21399
|
+
stack.push(current[index]);
|
|
21400
|
+
}
|
|
21401
|
+
continue;
|
|
21402
|
+
}
|
|
21403
|
+
if (!isPlainObject2(current))
|
|
21404
|
+
return false;
|
|
21405
|
+
ancestors.add(current);
|
|
21406
|
+
stack.push(current, JSON_VALIDATION_LEAVE);
|
|
21407
|
+
for (const key in current) {
|
|
21408
|
+
if (Object.hasOwn(current, key)) {
|
|
21409
|
+
if (key === "__proto__")
|
|
21410
|
+
return false;
|
|
21411
|
+
stack.push(current[key]);
|
|
21412
|
+
}
|
|
21388
21413
|
}
|
|
21389
21414
|
}
|
|
21390
21415
|
} catch {
|
|
@@ -21392,17 +21417,11 @@ function hasNoCircularReferences(value) {
|
|
|
21392
21417
|
}
|
|
21393
21418
|
return true;
|
|
21394
21419
|
}
|
|
21395
|
-
var
|
|
21396
|
-
message: "JSON value
|
|
21397
|
-
});
|
|
21398
|
-
var
|
|
21399
|
-
|
|
21400
|
-
external_exports.array(recursiveJsonValueSchema),
|
|
21401
|
-
external_exports.record(external_exports.string(), recursiveJsonValueSchema)
|
|
21402
|
-
]));
|
|
21403
|
-
var jsonValueSchema = nonCircularSchema.pipe(recursiveJsonValueSchema);
|
|
21404
|
-
var jsonArraySchema = nonCircularSchema.pipe(external_exports.array(recursiveJsonValueSchema));
|
|
21405
|
-
var jsonObjectSchema = nonCircularSchema.pipe(external_exports.record(external_exports.string(), recursiveJsonValueSchema));
|
|
21420
|
+
var jsonValueSchema = external_exports.custom(isValidJsonValue, {
|
|
21421
|
+
message: "Invalid JSON value"
|
|
21422
|
+
});
|
|
21423
|
+
var jsonArraySchema = external_exports.custom((value) => Array.isArray(value) && isValidJsonValue(value), { message: "Invalid JSON array" });
|
|
21424
|
+
var jsonObjectSchema = external_exports.custom((value) => typeof value === "object" && value !== null && !Array.isArray(value) && isValidJsonValue(value), { message: "Invalid JSON object" });
|
|
21406
21425
|
|
|
21407
21426
|
// packages/shared-contracts/dist/errors.js
|
|
21408
21427
|
var codexhostErrorSchema = external_exports.strictObject({
|
|
@@ -22591,6 +22610,7 @@ var hostExtensionCatalogEntrySchema = external_exports.object({
|
|
|
22591
22610
|
backend: external_exports.int().positive().optional()
|
|
22592
22611
|
}),
|
|
22593
22612
|
downloadUrl: downloadUrl.refine((url2) => url2.startsWith("https://"), "Expected HTTPS"),
|
|
22613
|
+
downloads7d: external_exports.number().int().min(0).optional(),
|
|
22594
22614
|
featured: external_exports.boolean().optional(),
|
|
22595
22615
|
featuredOrder: external_exports.int().nonnegative().optional(),
|
|
22596
22616
|
changelog: external_exports.array(hostExtensionChangelogEntrySchema).max(20).optional()
|
|
@@ -22660,24 +22680,42 @@ var hostExtensionInstallationSchema = external_exports.strictObject({
|
|
|
22660
22680
|
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);
|
|
22661
22681
|
var desktopConflict = { desktopConflictWith: hostExtensionIdSchema.optional() };
|
|
22662
22682
|
var backendState = external_exports.enum(["none", "inactive", "starting", "running", "failed"]);
|
|
22683
|
+
var HOST_EXTENSION_OPERATION_ERROR_MAX_LENGTH = 512;
|
|
22684
|
+
var hostExtensionOperationStatusSchema = external_exports.discriminatedUnion("state", [
|
|
22685
|
+
external_exports.object({
|
|
22686
|
+
state: external_exports.literal("updating"),
|
|
22687
|
+
targetVersion: external_exports.string().trim().min(1).max(128).optional(),
|
|
22688
|
+
startedAt: external_exports.iso.datetime()
|
|
22689
|
+
}),
|
|
22690
|
+
external_exports.object({
|
|
22691
|
+
state: external_exports.literal("failed"),
|
|
22692
|
+
targetVersion: external_exports.string().trim().min(1).max(128).optional(),
|
|
22693
|
+
startedAt: external_exports.iso.datetime(),
|
|
22694
|
+
updatedAt: external_exports.iso.datetime(),
|
|
22695
|
+
error: external_exports.string().min(1).max(HOST_EXTENSION_OPERATION_ERROR_MAX_LENGTH),
|
|
22696
|
+
interruptedByShutdown: external_exports.boolean().optional()
|
|
22697
|
+
})
|
|
22698
|
+
]);
|
|
22663
22699
|
var hostExtensionListItemSchema = external_exports.discriminatedUnion("state", [
|
|
22664
|
-
|
|
22700
|
+
external_exports.object({
|
|
22701
|
+
...hostExtensionInstallationSchema.shape,
|
|
22665
22702
|
state: external_exports.literal("valid"),
|
|
22666
22703
|
enabled: external_exports.boolean(),
|
|
22667
22704
|
...desktopConflict,
|
|
22668
22705
|
iconDataUrl: rasterDataUrlSchema(DESKTOP_EXTENSION_ICON_MAX_BYTES).optional(),
|
|
22669
22706
|
screenshotDataUrls: external_exports.array(rasterDataUrlSchema(DESKTOP_EXTENSION_SCREENSHOT_MAX_BYTES)).max(DESKTOP_EXTENSION_SCREENSHOT_LIMIT).optional(),
|
|
22670
22707
|
backendState: backendState.optional(),
|
|
22671
|
-
backendError: external_exports.string().optional()
|
|
22708
|
+
backendError: external_exports.string().optional(),
|
|
22709
|
+
operation: hostExtensionOperationStatusSchema.optional()
|
|
22672
22710
|
}),
|
|
22673
|
-
external_exports.
|
|
22711
|
+
external_exports.object({
|
|
22674
22712
|
state: external_exports.enum(["invalid", "incompatible"]),
|
|
22675
22713
|
id: external_exports.string().min(1),
|
|
22676
22714
|
enabled: external_exports.boolean(),
|
|
22677
22715
|
error: external_exports.string()
|
|
22678
22716
|
})
|
|
22679
22717
|
]);
|
|
22680
|
-
var hostExtensionsListResultSchema = external_exports.
|
|
22718
|
+
var hostExtensionsListResultSchema = external_exports.object({
|
|
22681
22719
|
revision: hostExtensionRevisionSchema,
|
|
22682
22720
|
configuration: hostExtensionConfigurationSchema,
|
|
22683
22721
|
diagnostics: external_exports.array(external_exports.string()),
|
|
@@ -22716,7 +22754,10 @@ var methods = new Set(HOST_EXTENSION_MANAGEMENT_METHODS);
|
|
|
22716
22754
|
var noParams = external_exports.strictObject({});
|
|
22717
22755
|
var expectedRevision = { expectedRevision: hostExtensionRevisionSchema };
|
|
22718
22756
|
var selection = external_exports.strictObject({ ...id, ...expectedRevision });
|
|
22719
|
-
var installationResult =
|
|
22757
|
+
var installationResult = external_exports.object({
|
|
22758
|
+
...hostExtensionInstallationSchema.shape,
|
|
22759
|
+
replaced: external_exports.boolean()
|
|
22760
|
+
});
|
|
22720
22761
|
var mutationResult = external_exports.discriminatedUnion("state", [
|
|
22721
22762
|
external_exports.strictObject({ state: external_exports.literal("saved"), configuration: hostExtensionConfigurationSchema }),
|
|
22722
22763
|
external_exports.strictObject({ state: external_exports.literal("revision-conflict"), revision: hostExtensionRevisionSchema })
|
|
@@ -22745,7 +22786,12 @@ var hostExtensionSettingsSchema = external_exports.strictObject({
|
|
|
22745
22786
|
values: jsonObjectSchema
|
|
22746
22787
|
});
|
|
22747
22788
|
var hostExtensionsRpcSchemas = {
|
|
22748
|
-
[HOST_EXTENSIONS_RPC.list]: {
|
|
22789
|
+
[HOST_EXTENSIONS_RPC.list]: {
|
|
22790
|
+
params: external_exports.object({
|
|
22791
|
+
includeOperations: external_exports.boolean().optional()
|
|
22792
|
+
}),
|
|
22793
|
+
result: hostExtensionsListResultSchema
|
|
22794
|
+
},
|
|
22749
22795
|
[HOST_EXTENSIONS_RPC.snapshot]: { params: noParams, result: hostExtensionsSnapshotResultSchema },
|
|
22750
22796
|
[HOST_EXTENSIONS_RPC.catalog]: {
|
|
22751
22797
|
params: external_exports.strictObject({
|
|
@@ -22771,6 +22817,7 @@ var hostExtensionsRpcSchemas = {
|
|
|
22771
22817
|
...id,
|
|
22772
22818
|
expectedDigest: active.digest,
|
|
22773
22819
|
expectedActivationId: active.activationId.optional(),
|
|
22820
|
+
expectedVersion: external_exports.string().trim().min(1).max(128).optional(),
|
|
22774
22821
|
source: hostExtensionInstallSourceSchema.optional()
|
|
22775
22822
|
}),
|
|
22776
22823
|
result: installationResult
|
|
@@ -22820,9 +22867,39 @@ var hostExtensionsRpcSchemas = {
|
|
|
22820
22867
|
};
|
|
22821
22868
|
|
|
22822
22869
|
// packages/shared-contracts/dist/group-chat.js
|
|
22823
|
-
var
|
|
22824
|
-
var
|
|
22870
|
+
var GROUP_MEMORY_MAX_BYTES = 4096;
|
|
22871
|
+
var DEFAULT_GROUP_MAX_AGENT_HOPS = 10;
|
|
22872
|
+
var MAX_GROUP_AGENT_HOPS = 200;
|
|
22825
22873
|
var GROUP_NOTICE_MAX_LENGTH = 2e3;
|
|
22874
|
+
var cachedUtf8Encoder;
|
|
22875
|
+
function groupUtf8ByteLength(text2) {
|
|
22876
|
+
if (cachedUtf8Encoder === void 0) {
|
|
22877
|
+
cachedUtf8Encoder = typeof TextEncoder === "function" ? new TextEncoder() : null;
|
|
22878
|
+
}
|
|
22879
|
+
if (cachedUtf8Encoder !== null) {
|
|
22880
|
+
return cachedUtf8Encoder.encode(text2).length;
|
|
22881
|
+
}
|
|
22882
|
+
let bytes = 0;
|
|
22883
|
+
for (let i = 0; i < text2.length; i += 1) {
|
|
22884
|
+
const code = text2.charCodeAt(i);
|
|
22885
|
+
if (code <= 127) {
|
|
22886
|
+
bytes += 1;
|
|
22887
|
+
} else if (code <= 2047) {
|
|
22888
|
+
bytes += 2;
|
|
22889
|
+
} else if (code >= 55296 && code <= 56319 && i + 1 < text2.length) {
|
|
22890
|
+
const next = text2.charCodeAt(i + 1);
|
|
22891
|
+
if (next >= 56320 && next <= 57343) {
|
|
22892
|
+
bytes += 4;
|
|
22893
|
+
i += 1;
|
|
22894
|
+
} else {
|
|
22895
|
+
bytes += 3;
|
|
22896
|
+
}
|
|
22897
|
+
} else {
|
|
22898
|
+
bytes += 3;
|
|
22899
|
+
}
|
|
22900
|
+
}
|
|
22901
|
+
return bytes;
|
|
22902
|
+
}
|
|
22826
22903
|
var remoteGroupRoomIdSchema = external_exports.string().regex(/^remote:[A-Za-z0-9_-]{8,512}$/u);
|
|
22827
22904
|
var groupRoomIdSchema = external_exports.union([external_exports.uuidv4(), remoteGroupRoomIdSchema]);
|
|
22828
22905
|
var groupMemberIdSchema = external_exports.uuidv4();
|
|
@@ -22831,7 +22908,7 @@ var groupUnmentionedPolicySchema = external_exports.enum(["none", "last_speaker"
|
|
|
22831
22908
|
var groupMemberStatusSchema = external_exports.enum(["active", "muted", "removed"]);
|
|
22832
22909
|
var nonnegativeInteger = external_exports.int().nonnegative();
|
|
22833
22910
|
var positiveInteger = external_exports.int().positive();
|
|
22834
|
-
var maxAgentHopsSchema =
|
|
22911
|
+
var maxAgentHopsSchema = nonnegativeInteger.max(MAX_GROUP_AGENT_HOPS);
|
|
22835
22912
|
var nonblankString = external_exports.string().refine((value) => value.trim().length > 0);
|
|
22836
22913
|
var timestamp = external_exports.iso.datetime();
|
|
22837
22914
|
var optionalMemberEdits = {
|
|
@@ -22850,9 +22927,11 @@ var groupMemberSchema = external_exports.object({
|
|
|
22850
22927
|
harnessId: harnessIdSchema,
|
|
22851
22928
|
status: groupMemberStatusSchema,
|
|
22852
22929
|
projectless: external_exports.boolean().optional(),
|
|
22930
|
+
showInSidebar: external_exports.boolean().optional(),
|
|
22853
22931
|
joinedAtSeq: nonnegativeInteger,
|
|
22854
22932
|
lastDeliveredSeq: nonnegativeInteger,
|
|
22855
22933
|
lastRosterVersion: nonnegativeInteger,
|
|
22934
|
+
lastMemoryVersion: nonnegativeInteger.default(0),
|
|
22856
22935
|
createdAt: timestamp
|
|
22857
22936
|
});
|
|
22858
22937
|
var groupProjectlessWorkspaceSchema = external_exports.object({
|
|
@@ -22864,19 +22943,25 @@ var groupRoomRemoteHostSchema = external_exports.object({
|
|
|
22864
22943
|
displayName: nonblankString,
|
|
22865
22944
|
state: nonblankString.optional(),
|
|
22866
22945
|
color: external_exports.string().optional(),
|
|
22867
|
-
filePreview: external_exports.boolean().optional()
|
|
22946
|
+
filePreview: external_exports.boolean().optional(),
|
|
22947
|
+
memberSidebarVisibility: external_exports.boolean().optional(),
|
|
22948
|
+
sharedMemory: external_exports.boolean().optional()
|
|
22868
22949
|
});
|
|
22869
|
-
var
|
|
22950
|
+
var groupRoomObjectSchema = external_exports.object({
|
|
22870
22951
|
roomId: groupRoomIdSchema,
|
|
22871
22952
|
title: nonblankString,
|
|
22872
22953
|
defaultCwd: nonblankString,
|
|
22873
22954
|
projectlessWorkspace: groupProjectlessWorkspaceSchema.optional(),
|
|
22874
22955
|
unmentionedPolicy: groupUnmentionedPolicySchema.default("none"),
|
|
22956
|
+
unmentionedMemberId: groupMemberIdSchema.optional(),
|
|
22875
22957
|
allowAgentMentions: external_exports.boolean().default(true),
|
|
22876
22958
|
maxAgentHops: maxAgentHopsSchema.default(DEFAULT_GROUP_MAX_AGENT_HOPS),
|
|
22959
|
+
relayHopLimit: maxAgentHopsSchema.optional(),
|
|
22877
22960
|
lastSeq: nonnegativeInteger,
|
|
22878
22961
|
lastSpeakerMemberId: groupMemberIdSchema.optional(),
|
|
22879
22962
|
rosterVersion: nonnegativeInteger,
|
|
22963
|
+
memoryVersion: nonnegativeInteger.default(0),
|
|
22964
|
+
memorySha256: external_exports.string().regex(/^[0-9a-f]{64}$/u).optional(),
|
|
22880
22965
|
humanEpoch: nonnegativeInteger,
|
|
22881
22966
|
relayPaused: external_exports.boolean(),
|
|
22882
22967
|
pinned: external_exports.boolean(),
|
|
@@ -22884,7 +22969,14 @@ var groupRoomSchema = external_exports.object({
|
|
|
22884
22969
|
updatedAt: timestamp,
|
|
22885
22970
|
members: external_exports.array(groupMemberSchema),
|
|
22886
22971
|
remote: groupRoomRemoteHostSchema.optional()
|
|
22887
|
-
}).superRefine(({ members: members2 }, context) => {
|
|
22972
|
+
}).superRefine(({ members: members2, unmentionedPolicy, unmentionedMemberId }, context) => {
|
|
22973
|
+
if (unmentionedMemberId !== void 0 && unmentionedPolicy !== "none") {
|
|
22974
|
+
context.addIssue({
|
|
22975
|
+
code: "custom",
|
|
22976
|
+
path: ["unmentionedMemberId"],
|
|
22977
|
+
message: 'A default member can only be set when unmentionedPolicy is "none"'
|
|
22978
|
+
});
|
|
22979
|
+
}
|
|
22888
22980
|
const handles = /* @__PURE__ */ new Set();
|
|
22889
22981
|
for (const [index, { handle, status }] of members2.entries()) {
|
|
22890
22982
|
if (status === "removed")
|
|
@@ -22899,6 +22991,15 @@ var groupRoomSchema = external_exports.object({
|
|
|
22899
22991
|
handles.add(handle);
|
|
22900
22992
|
}
|
|
22901
22993
|
});
|
|
22994
|
+
var groupRoomSchema = external_exports.preprocess((value) => {
|
|
22995
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
22996
|
+
const record4 = value;
|
|
22997
|
+
if (record4.unmentionedPolicy === "member" && record4.unmentionedMemberId !== void 0) {
|
|
22998
|
+
return { ...record4, unmentionedPolicy: "none" };
|
|
22999
|
+
}
|
|
23000
|
+
}
|
|
23001
|
+
return value;
|
|
23002
|
+
}, groupRoomObjectSchema);
|
|
22902
23003
|
var groupAttachmentSchema = external_exports.object({
|
|
22903
23004
|
kind: external_exports.enum(["image", "file"]),
|
|
22904
23005
|
attachmentId: nonblankString.max(256),
|
|
@@ -22925,6 +23026,7 @@ var groupMessageSchema = external_exports.object({
|
|
|
22925
23026
|
mentionedMemberIds: external_exports.array(groupMemberIdSchema),
|
|
22926
23027
|
mentionAll: external_exports.boolean().optional(),
|
|
22927
23028
|
hopCount: nonnegativeInteger,
|
|
23029
|
+
durationMs: nonnegativeInteger.optional(),
|
|
22928
23030
|
createdAt: timestamp
|
|
22929
23031
|
});
|
|
22930
23032
|
var newThreadOptions = {
|
|
@@ -22954,6 +23056,8 @@ var GROUPS_REMOVE_MEMBER_METHOD = "codexhost/groups/member/remove";
|
|
|
22954
23056
|
var GROUPS_REBIND_MEMBER_METHOD = "codexhost/groups/member/rebind";
|
|
22955
23057
|
var GROUPS_POST_MESSAGE_METHOD = "codexhost/groups/message/post";
|
|
22956
23058
|
var GROUPS_READ_MESSAGES_METHOD = "codexhost/groups/messages/read";
|
|
23059
|
+
var GROUPS_READ_MEMORY_METHOD = "codexhost/groups/memory/read";
|
|
23060
|
+
var GROUPS_UPDATE_MEMORY_METHOD = "codexhost/groups/memory/update";
|
|
22957
23061
|
var GROUPS_INSPECT_CWD_METHOD = "codexhost/groups/cwd/inspect";
|
|
22958
23062
|
var roomIdentity = { roomId: groupRoomIdSchema };
|
|
22959
23063
|
var memberIdentity = { ...roomIdentity, memberId: groupMemberIdSchema };
|
|
@@ -22984,8 +23088,17 @@ var groupsCreateResultSchema = external_exports.object({ room: groupRoomSchema }
|
|
|
22984
23088
|
var groupsUpdateParamsSchema = external_exports.strictObject({
|
|
22985
23089
|
...roomIdentity,
|
|
22986
23090
|
...roomEdits,
|
|
23091
|
+
unmentionedMemberId: groupMemberIdSchema.nullable().optional(),
|
|
22987
23092
|
pinned: external_exports.boolean().optional(),
|
|
22988
23093
|
relayPaused: external_exports.boolean().optional()
|
|
23094
|
+
}).superRefine(({ unmentionedPolicy, unmentionedMemberId }, context) => {
|
|
23095
|
+
if (unmentionedMemberId !== void 0 && unmentionedMemberId !== null && unmentionedPolicy !== void 0 && unmentionedPolicy !== "none") {
|
|
23096
|
+
context.addIssue({
|
|
23097
|
+
code: "custom",
|
|
23098
|
+
path: ["unmentionedMemberId"],
|
|
23099
|
+
message: 'A default member can only be set when unmentionedPolicy is "none"'
|
|
23100
|
+
});
|
|
23101
|
+
}
|
|
22989
23102
|
});
|
|
22990
23103
|
var groupsDeleteParamsSchema = external_exports.strictObject(roomIdentity);
|
|
22991
23104
|
var groupsDeleteResultSchema = external_exports.object({ deleted: external_exports.boolean() });
|
|
@@ -23000,7 +23113,8 @@ var groupsAddMemberResultSchema = external_exports.object({
|
|
|
23000
23113
|
var groupsUpdateMemberParamsSchema = external_exports.strictObject({
|
|
23001
23114
|
...memberIdentity,
|
|
23002
23115
|
...optionalMemberEdits,
|
|
23003
|
-
status: groupMemberStatusSchema.optional()
|
|
23116
|
+
status: groupMemberStatusSchema.optional(),
|
|
23117
|
+
showInSidebar: external_exports.boolean().optional()
|
|
23004
23118
|
});
|
|
23005
23119
|
var groupsRemoveMemberParamsSchema = external_exports.strictObject(memberIdentity);
|
|
23006
23120
|
var groupsRebindMemberParamsSchema = external_exports.strictObject({
|
|
@@ -23103,6 +23217,24 @@ var groupsReadMessagesResultSchema = external_exports.object({
|
|
|
23103
23217
|
messages: external_exports.array(groupMessageSchema),
|
|
23104
23218
|
totalSeq: nonnegativeInteger
|
|
23105
23219
|
});
|
|
23220
|
+
var groupsReadMemoryParamsSchema = external_exports.strictObject(roomIdentity);
|
|
23221
|
+
var groupsReadMemoryResultSchema = external_exports.object({
|
|
23222
|
+
...roomIdentity,
|
|
23223
|
+
memoryVersion: nonnegativeInteger,
|
|
23224
|
+
content: external_exports.string(),
|
|
23225
|
+
updatedAt: timestamp
|
|
23226
|
+
});
|
|
23227
|
+
var groupsUpdateMemoryParamsSchema = external_exports.strictObject({
|
|
23228
|
+
...roomIdentity,
|
|
23229
|
+
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`),
|
|
23230
|
+
expectedVersion: nonnegativeInteger.optional()
|
|
23231
|
+
});
|
|
23232
|
+
var groupsUpdateMemoryResultSchema = external_exports.object({
|
|
23233
|
+
room: groupRoomSchema,
|
|
23234
|
+
memoryVersion: nonnegativeInteger,
|
|
23235
|
+
content: external_exports.string(),
|
|
23236
|
+
updatedAt: timestamp
|
|
23237
|
+
});
|
|
23106
23238
|
var groupsInspectCwdParamsSchema = external_exports.strictObject({
|
|
23107
23239
|
cwd: nonblankString,
|
|
23108
23240
|
roomId: groupRoomIdSchema.optional()
|
|
@@ -23238,6 +23370,149 @@ var nativeCodexGoalResultSchema = external_exports.object({
|
|
|
23238
23370
|
}).nullable()
|
|
23239
23371
|
});
|
|
23240
23372
|
|
|
23373
|
+
// packages/shared-contracts/dist/voice.js
|
|
23374
|
+
var VOICE_AUDIO_MAX_BYTES = 10 * 1024 * 1024;
|
|
23375
|
+
var VOICE_CONFIG_GET_METHOD = "codexhost/voice/config/get";
|
|
23376
|
+
var VOICE_CONFIG_SET_METHOD = "codexhost/voice/config/set";
|
|
23377
|
+
var voiceProviderModeSchema = external_exports.enum([
|
|
23378
|
+
"codex",
|
|
23379
|
+
"openai-compatible",
|
|
23380
|
+
"deepseek-asr",
|
|
23381
|
+
"openai-chat-audio"
|
|
23382
|
+
]);
|
|
23383
|
+
var voiceAudioFormatSchema = external_exports.enum(["native", "wav"]);
|
|
23384
|
+
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;
|
|
23385
|
+
function isLoopbackVoiceHost(hostname3) {
|
|
23386
|
+
const bare = hostname3.trim().toLowerCase().replace(/^\[|\]$/g, "");
|
|
23387
|
+
if (bare === "localhost" || bare.endsWith(".localhost") || bare === "::1")
|
|
23388
|
+
return true;
|
|
23389
|
+
return /^127(?:\.(?:25[0-5]|2[0-4]\d|1?\d?\d)){3}$/.test(bare);
|
|
23390
|
+
}
|
|
23391
|
+
function isValidVoiceBaseUrl(value) {
|
|
23392
|
+
const trimmed = value.trim();
|
|
23393
|
+
if (!trimmed)
|
|
23394
|
+
return false;
|
|
23395
|
+
try {
|
|
23396
|
+
const parsed = new URL(trimmed);
|
|
23397
|
+
if (!parsed.hostname)
|
|
23398
|
+
return false;
|
|
23399
|
+
if (parsed.username !== "" || parsed.password !== "" || parsed.hash !== "")
|
|
23400
|
+
return false;
|
|
23401
|
+
if (parsed.protocol === "https:") {
|
|
23402
|
+
} else if (parsed.protocol === "http:") {
|
|
23403
|
+
if (!isLoopbackVoiceHost(parsed.hostname))
|
|
23404
|
+
return false;
|
|
23405
|
+
} else {
|
|
23406
|
+
return false;
|
|
23407
|
+
}
|
|
23408
|
+
for (const key of parsed.searchParams.keys()) {
|
|
23409
|
+
if (SENSITIVE_VOICE_QUERY_PARAM.test(key))
|
|
23410
|
+
return false;
|
|
23411
|
+
}
|
|
23412
|
+
return true;
|
|
23413
|
+
} catch {
|
|
23414
|
+
return false;
|
|
23415
|
+
}
|
|
23416
|
+
}
|
|
23417
|
+
var voiceBaseUrlSchema = external_exports.string().max(2048).refine((value) => value === "" || isValidVoiceBaseUrl(value), {
|
|
23418
|
+
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"
|
|
23419
|
+
});
|
|
23420
|
+
var voiceProviderConfigSnapshotSchema = external_exports.object({
|
|
23421
|
+
baseUrl: voiceBaseUrlSchema,
|
|
23422
|
+
model: external_exports.string().max(256),
|
|
23423
|
+
hasApiKey: external_exports.boolean(),
|
|
23424
|
+
apiKeyHint: external_exports.string().max(64).optional(),
|
|
23425
|
+
apiKey: external_exports.never().optional()
|
|
23426
|
+
});
|
|
23427
|
+
var voiceConfigSnapshotSchema = external_exports.object({
|
|
23428
|
+
mode: voiceProviderModeSchema,
|
|
23429
|
+
baseUrl: voiceBaseUrlSchema,
|
|
23430
|
+
model: external_exports.string().max(256),
|
|
23431
|
+
hasApiKey: external_exports.boolean(),
|
|
23432
|
+
apiKeyHint: external_exports.string().max(64).optional(),
|
|
23433
|
+
apiKey: external_exports.never().optional(),
|
|
23434
|
+
audioFormat: voiceAudioFormatSchema.optional(),
|
|
23435
|
+
providers: external_exports.object({
|
|
23436
|
+
"openai-compatible": voiceProviderConfigSnapshotSchema,
|
|
23437
|
+
"deepseek-asr": voiceProviderConfigSnapshotSchema,
|
|
23438
|
+
"openai-chat-audio": voiceProviderConfigSnapshotSchema
|
|
23439
|
+
}).optional(),
|
|
23440
|
+
codexAvailable: external_exports.boolean(),
|
|
23441
|
+
available: external_exports.boolean()
|
|
23442
|
+
});
|
|
23443
|
+
var voiceConfigUpdateParamsSchema = external_exports.object({
|
|
23444
|
+
mode: voiceProviderModeSchema,
|
|
23445
|
+
baseUrl: external_exports.string().max(2048).optional(),
|
|
23446
|
+
model: external_exports.string().max(256).optional(),
|
|
23447
|
+
apiKey: external_exports.string().max(4096).nullable().optional()
|
|
23448
|
+
}).strict().superRefine((value, ctx) => {
|
|
23449
|
+
const trimmedBaseUrl = value.baseUrl?.trim() ?? "";
|
|
23450
|
+
const trimmedModel = value.model?.trim() ?? "";
|
|
23451
|
+
if (value.mode === "openai-compatible") {
|
|
23452
|
+
if (!isValidVoiceBaseUrl(trimmedBaseUrl)) {
|
|
23453
|
+
ctx.addIssue({
|
|
23454
|
+
code: external_exports.ZodIssueCode.custom,
|
|
23455
|
+
path: ["baseUrl"],
|
|
23456
|
+
message: "OpenAI-compatible mode requires a valid https:// base URL (http:// is allowed only for loopback hosts)"
|
|
23457
|
+
});
|
|
23458
|
+
}
|
|
23459
|
+
return;
|
|
23460
|
+
}
|
|
23461
|
+
if (value.mode === "openai-chat-audio") {
|
|
23462
|
+
if (!isValidVoiceBaseUrl(trimmedBaseUrl)) {
|
|
23463
|
+
ctx.addIssue({
|
|
23464
|
+
code: external_exports.ZodIssueCode.custom,
|
|
23465
|
+
path: ["baseUrl"],
|
|
23466
|
+
message: "Multimodal Chat Audio mode requires a valid https:// base URL (http:// is allowed only for loopback hosts)"
|
|
23467
|
+
});
|
|
23468
|
+
}
|
|
23469
|
+
if (!trimmedModel) {
|
|
23470
|
+
ctx.addIssue({
|
|
23471
|
+
code: external_exports.ZodIssueCode.custom,
|
|
23472
|
+
path: ["model"],
|
|
23473
|
+
message: "Multimodal Chat Audio mode requires a model name"
|
|
23474
|
+
});
|
|
23475
|
+
}
|
|
23476
|
+
return;
|
|
23477
|
+
}
|
|
23478
|
+
if (trimmedBaseUrl !== "" && !isValidVoiceBaseUrl(trimmedBaseUrl)) {
|
|
23479
|
+
ctx.addIssue({
|
|
23480
|
+
code: external_exports.ZodIssueCode.custom,
|
|
23481
|
+
path: ["baseUrl"],
|
|
23482
|
+
message: "Base URL must be empty or a valid https:// URL (http:// is allowed only for loopback hosts)"
|
|
23483
|
+
});
|
|
23484
|
+
}
|
|
23485
|
+
});
|
|
23486
|
+
var voiceAudioMimeTypeSchema = external_exports.string().regex(/^audio\/[a-z0-9.+-]+(?:\s*;[^\r\n]*)?$/i);
|
|
23487
|
+
var voiceStatusResultSchema = external_exports.object({
|
|
23488
|
+
available: external_exports.boolean(),
|
|
23489
|
+
audioFormat: voiceAudioFormatSchema.optional()
|
|
23490
|
+
});
|
|
23491
|
+
var voiceTranscribeParamsSchema = external_exports.object({ path: external_exports.string().min(1), mimeType: voiceAudioMimeTypeSchema }).strict();
|
|
23492
|
+
var voiceErrorCodeSchema = external_exports.enum([
|
|
23493
|
+
"credentials-unavailable",
|
|
23494
|
+
"login-expired",
|
|
23495
|
+
"rate-limited",
|
|
23496
|
+
"service-rejected",
|
|
23497
|
+
"host-incompatible",
|
|
23498
|
+
"network",
|
|
23499
|
+
"timeout",
|
|
23500
|
+
"audio-empty",
|
|
23501
|
+
"audio-too-large",
|
|
23502
|
+
"audio-format",
|
|
23503
|
+
"audio-invalid"
|
|
23504
|
+
]);
|
|
23505
|
+
var voiceTranscribeResultSchema = external_exports.discriminatedUnion("ok", [
|
|
23506
|
+
external_exports.object({ ok: external_exports.literal(true), text: external_exports.string() }).strict(),
|
|
23507
|
+
external_exports.object({ ok: external_exports.literal(false), error: external_exports.object({ code: voiceErrorCodeSchema }).strict() }).strict()
|
|
23508
|
+
]);
|
|
23509
|
+
|
|
23510
|
+
// packages/shared-contracts/dist/github-star.js
|
|
23511
|
+
var GITHUB_STAR_STATUS_METHOD = "codexhost/githubStar/status";
|
|
23512
|
+
var GITHUB_STAR_ADD_METHOD = "codexhost/githubStar/star";
|
|
23513
|
+
var githubStarParamsSchema = external_exports.object({}).strict();
|
|
23514
|
+
var githubStarStateSchema = external_exports.object({ ghAvailable: external_exports.boolean(), starred: external_exports.boolean() });
|
|
23515
|
+
|
|
23241
23516
|
// packages/shared-contracts/dist/client-channel.js
|
|
23242
23517
|
var CLIENT_CHANNEL_VERSION = 1;
|
|
23243
23518
|
var CLIENT_REQUEST_LIMIT_BYTES = 128 * 1024 * 1024;
|
|
@@ -23299,9 +23574,13 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
23299
23574
|
GROUPS_REBIND_MEMBER_METHOD,
|
|
23300
23575
|
GROUPS_POST_MESSAGE_METHOD,
|
|
23301
23576
|
GROUPS_READ_MESSAGES_METHOD,
|
|
23577
|
+
GROUPS_READ_MEMORY_METHOD,
|
|
23578
|
+
GROUPS_UPDATE_MEMORY_METHOD,
|
|
23302
23579
|
GROUPS_INSPECT_CWD_METHOD,
|
|
23303
23580
|
"codexhost/voice/status",
|
|
23304
23581
|
"codexhost/voice/transcribe",
|
|
23582
|
+
VOICE_CONFIG_GET_METHOD,
|
|
23583
|
+
VOICE_CONFIG_SET_METHOD,
|
|
23305
23584
|
"codexhost/harness/display-settings/get",
|
|
23306
23585
|
"codexhost/harness/display-settings/set",
|
|
23307
23586
|
"codexhost/harness/display-settings/capabilities",
|
|
@@ -23367,6 +23646,8 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
23367
23646
|
"codexhost/harness/session-import/list",
|
|
23368
23647
|
"codexhost/harness/session-import/import",
|
|
23369
23648
|
// Host settings shared across Desktop and Web.
|
|
23649
|
+
GITHUB_STAR_STATUS_METHOD,
|
|
23650
|
+
GITHUB_STAR_ADD_METHOD,
|
|
23370
23651
|
...HOST_EXTENSION_MANAGEMENT_METHODS,
|
|
23371
23652
|
"codexhost/harness/installation",
|
|
23372
23653
|
"codexhost/harness/installation/start",
|
|
@@ -23706,28 +23987,16 @@ var extensionActivitySchema = external_exports.strictObject({
|
|
|
23706
23987
|
})).max(256)
|
|
23707
23988
|
});
|
|
23708
23989
|
|
|
23709
|
-
// packages/shared-contracts/dist/
|
|
23710
|
-
var
|
|
23711
|
-
var
|
|
23712
|
-
|
|
23713
|
-
|
|
23714
|
-
|
|
23715
|
-
"
|
|
23716
|
-
"
|
|
23717
|
-
"
|
|
23718
|
-
|
|
23719
|
-
"host-incompatible",
|
|
23720
|
-
"network",
|
|
23721
|
-
"timeout",
|
|
23722
|
-
"audio-empty",
|
|
23723
|
-
"audio-too-large",
|
|
23724
|
-
"audio-format",
|
|
23725
|
-
"audio-invalid"
|
|
23726
|
-
]);
|
|
23727
|
-
var voiceTranscribeResultSchema = external_exports.discriminatedUnion("ok", [
|
|
23728
|
-
external_exports.object({ ok: external_exports.literal(true), text: external_exports.string() }).strict(),
|
|
23729
|
-
external_exports.object({ ok: external_exports.literal(false), error: external_exports.object({ code: voiceErrorCodeSchema }).strict() }).strict()
|
|
23730
|
-
]);
|
|
23990
|
+
// packages/shared-contracts/dist/host-extension-ranking.js
|
|
23991
|
+
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
23992
|
+
var CATEGORY_SEARCH_LABELS = Object.freeze({
|
|
23993
|
+
appearance: ["appearance", "外观主题"],
|
|
23994
|
+
interface: ["interface", "界面增强"],
|
|
23995
|
+
workflow: ["workflow", "效率与协作"],
|
|
23996
|
+
analytics: ["analytics", "数据与统计"],
|
|
23997
|
+
integrations: ["integrations", "外部集成"],
|
|
23998
|
+
tools: ["tools", "实用工具"]
|
|
23999
|
+
});
|
|
23731
24000
|
|
|
23732
24001
|
// packages/shared-contracts/dist/skills.js
|
|
23733
24002
|
var skillsListParamsSchema = external_exports.object({
|
|
@@ -24036,7 +24305,13 @@ var remotePeerCapabilitiesSchema = external_exports.object({
|
|
|
24036
24305
|
/** /api/peer/v1/delegation is available for fixed-whitelist cross-host delegation. */
|
|
24037
24306
|
delegation: external_exports.literal(1).optional(),
|
|
24038
24307
|
/** POST /api/peer/v1/peers is available. */
|
|
24039
|
-
peerPairing: external_exports.literal(1).optional()
|
|
24308
|
+
peerPairing: external_exports.literal(1).optional(),
|
|
24309
|
+
/** Host supports includeOperations on extensions/list and expectedVersion on extensions/update. */
|
|
24310
|
+
extensionUpdateTracking: external_exports.literal(1).optional(),
|
|
24311
|
+
/** Peer supports per-member `showInSidebar` in `codexhost/groups/member/update`. */
|
|
24312
|
+
groupMemberSidebarVisibility: external_exports.literal(1).optional(),
|
|
24313
|
+
/** Peer supports `codexhost/groups/memory/read` and `codexhost/groups/memory/update`. */
|
|
24314
|
+
groupSharedMemory: external_exports.literal(1).optional()
|
|
24040
24315
|
});
|
|
24041
24316
|
var remotePeerManifestSchema = external_exports.object({
|
|
24042
24317
|
version: external_exports.string().max(128),
|
|
@@ -28192,6 +28467,21 @@ async function discoverHostExtensions(dataDir, options = {}) {
|
|
|
28192
28467
|
// packages/harness-plugin-files/dist/host-extension-default-seeds.js
|
|
28193
28468
|
var MAX_DEFAULT_SEEDS_BYTES = 32 * 1024;
|
|
28194
28469
|
|
|
28470
|
+
// packages/harness-plugin-files/dist/host-extension-update-status.js
|
|
28471
|
+
var MAX_UPDATE_STATUS_BYTES = 64 * 1024;
|
|
28472
|
+
var persistedFailedOperationSchema = external_exports.object({
|
|
28473
|
+
state: external_exports.literal("failed"),
|
|
28474
|
+
targetVersion: external_exports.string().trim().min(1).max(128).optional(),
|
|
28475
|
+
startedAt: external_exports.iso.datetime(),
|
|
28476
|
+
updatedAt: external_exports.iso.datetime(),
|
|
28477
|
+
error: external_exports.string().min(1).max(HOST_EXTENSION_OPERATION_ERROR_MAX_LENGTH),
|
|
28478
|
+
interruptedByShutdown: external_exports.boolean().optional()
|
|
28479
|
+
});
|
|
28480
|
+
var persistedUpdateStatusFileSchema = external_exports.object({
|
|
28481
|
+
version: external_exports.literal(1),
|
|
28482
|
+
entries: external_exports.record(hostExtensionIdSchema, persistedFailedOperationSchema)
|
|
28483
|
+
});
|
|
28484
|
+
|
|
28195
28485
|
// packages/harness-plugin-files/dist/host-extension-sources.js
|
|
28196
28486
|
import { lstat as lstat7, mkdir as mkdir7, readFile as readFile7, realpath as realpath6, stat as stat3, unlink, writeFile as writeFile7 } from "node:fs/promises";
|
|
28197
28487
|
import { isIP } from "node:net";
|
|
@@ -28438,6 +28728,12 @@ async function readDiskCatalogCache(dataDir) {
|
|
|
28438
28728
|
async function writeDiskCatalogCache(dataDir, result) {
|
|
28439
28729
|
if (!dataDir)
|
|
28440
28730
|
return;
|
|
28731
|
+
const nextMs = catalogGeneratedAtMs(result);
|
|
28732
|
+
if (nextMs > 0) {
|
|
28733
|
+
const existing = await readDiskCatalogCache(dataDir);
|
|
28734
|
+
if (existing && catalogGeneratedAtMs(existing) > nextMs)
|
|
28735
|
+
return;
|
|
28736
|
+
}
|
|
28441
28737
|
await atomicWriteFile(catalogDiskCachePath(dataDir), JSON.stringify(result));
|
|
28442
28738
|
}
|
|
28443
28739
|
function raceWithSignal(promise2, signal) {
|
|
@@ -28478,11 +28774,36 @@ async function fetchCatalogFrom(catalogUrl, signal, forceRefresh) {
|
|
|
28478
28774
|
cached: false
|
|
28479
28775
|
};
|
|
28480
28776
|
}
|
|
28481
|
-
|
|
28777
|
+
function resolveCatalogUrls(environment = process.env) {
|
|
28778
|
+
const configuredPrimary = environment.CODEXHOST_DESKTOP_EXTENSIONS_CATALOG_URL?.trim();
|
|
28779
|
+
if (configuredPrimary) {
|
|
28780
|
+
const parsedPrimary = desktopExtensionHttpUrlSchema.safeParse(configuredPrimary);
|
|
28781
|
+
if (parsedPrimary.success && httpsDownload(new URL(parsedPrimary.data))) {
|
|
28782
|
+
const configuredMirror = environment.CODEXHOST_DESKTOP_EXTENSIONS_CATALOG_MIRROR_URL?.trim();
|
|
28783
|
+
const parsedMirror = configuredMirror ? desktopExtensionHttpUrlSchema.safeParse(configuredMirror) : void 0;
|
|
28784
|
+
const mirrorUrl = parsedMirror?.success && httpsDownload(new URL(parsedMirror.data)) ? parsedMirror.data : void 0;
|
|
28785
|
+
return { primaryUrl: parsedPrimary.data, mirrorUrl };
|
|
28786
|
+
}
|
|
28787
|
+
}
|
|
28788
|
+
return {
|
|
28789
|
+
primaryUrl: HOST_EXTENSION_CATALOG_URL,
|
|
28790
|
+
mirrorUrl: HOST_EXTENSION_CATALOG_MIRROR_URL
|
|
28791
|
+
};
|
|
28792
|
+
}
|
|
28793
|
+
async function raceCatalog(forceRefresh, onPrimaryFresher, acceptCandidate) {
|
|
28794
|
+
const { primaryUrl, mirrorUrl } = resolveCatalogUrls();
|
|
28482
28795
|
const primaryController = new AbortController();
|
|
28796
|
+
const primaryPromise = fetchCatalogFrom(primaryUrl, primaryController.signal, forceRefresh);
|
|
28797
|
+
if (!mirrorUrl) {
|
|
28798
|
+
try {
|
|
28799
|
+
return { result: await primaryPromise, fromMirror: false };
|
|
28800
|
+
} catch (cause) {
|
|
28801
|
+
primaryController.abort();
|
|
28802
|
+
throw new Error("Host extension catalog unavailable", { cause });
|
|
28803
|
+
}
|
|
28804
|
+
}
|
|
28483
28805
|
const mirrorController = new AbortController();
|
|
28484
|
-
const
|
|
28485
|
-
const mirrorPromise = fetchCatalogFrom(HOST_EXTENSION_CATALOG_MIRROR_URL, mirrorController.signal, forceRefresh);
|
|
28806
|
+
const mirrorPromise = fetchCatalogFrom(mirrorUrl, mirrorController.signal, forceRefresh);
|
|
28486
28807
|
primaryPromise.catch(() => void 0);
|
|
28487
28808
|
mirrorPromise.catch(() => void 0);
|
|
28488
28809
|
try {
|
|
@@ -28491,8 +28812,26 @@ async function raceCatalog(forceRefresh, onPrimaryFresher) {
|
|
|
28491
28812
|
mirrorPromise.then((result) => ({ source: "mirror", result }))
|
|
28492
28813
|
]);
|
|
28493
28814
|
if (first.source === "primary") {
|
|
28494
|
-
|
|
28495
|
-
|
|
28815
|
+
if (!acceptCandidate || acceptCandidate(first.result)) {
|
|
28816
|
+
mirrorController.abort();
|
|
28817
|
+
return { result: first.result, fromMirror: false };
|
|
28818
|
+
}
|
|
28819
|
+
try {
|
|
28820
|
+
const mirrorResult = await mirrorPromise;
|
|
28821
|
+
if (acceptCandidate(mirrorResult)) {
|
|
28822
|
+
return { result: mirrorResult, fromMirror: true };
|
|
28823
|
+
}
|
|
28824
|
+
} catch {
|
|
28825
|
+
}
|
|
28826
|
+
return { result: first.result, fromMirror: false };
|
|
28827
|
+
}
|
|
28828
|
+
if (acceptCandidate && !acceptCandidate(first.result)) {
|
|
28829
|
+
try {
|
|
28830
|
+
const primaryResult = await primaryPromise;
|
|
28831
|
+
return { result: primaryResult, fromMirror: false };
|
|
28832
|
+
} catch (cause) {
|
|
28833
|
+
throw new Error("Host extension catalog unavailable", { cause });
|
|
28834
|
+
}
|
|
28496
28835
|
}
|
|
28497
28836
|
if (onPrimaryFresher) {
|
|
28498
28837
|
void primaryPromise.then((primaryResult) => {
|
|
@@ -28503,13 +28842,24 @@ async function raceCatalog(forceRefresh, onPrimaryFresher) {
|
|
|
28503
28842
|
} else {
|
|
28504
28843
|
primaryController.abort();
|
|
28505
28844
|
}
|
|
28506
|
-
return first.result;
|
|
28845
|
+
return { result: first.result, fromMirror: true };
|
|
28507
28846
|
} catch (cause) {
|
|
28508
28847
|
primaryController.abort();
|
|
28509
28848
|
mirrorController.abort();
|
|
28510
28849
|
throw new Error("Host extension catalog unavailable", { cause });
|
|
28511
28850
|
}
|
|
28512
28851
|
}
|
|
28852
|
+
function parseDownloadCountMap(raw) {
|
|
28853
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
28854
|
+
return void 0;
|
|
28855
|
+
const counts = /* @__PURE__ */ new Map();
|
|
28856
|
+
for (const [id2, count2] of Object.entries(raw)) {
|
|
28857
|
+
if (typeof count2 === "number" && Number.isSafeInteger(count2) && count2 >= 0) {
|
|
28858
|
+
counts.set(id2, count2);
|
|
28859
|
+
}
|
|
28860
|
+
}
|
|
28861
|
+
return counts;
|
|
28862
|
+
}
|
|
28513
28863
|
async function fetchLiveDownloadStats(statsUrl, forceRefresh) {
|
|
28514
28864
|
try {
|
|
28515
28865
|
const parsed = desktopExtensionHttpUrlSchema.safeParse(statsUrl);
|
|
@@ -28529,57 +28879,77 @@ async function fetchLiveDownloadStats(statsUrl, forceRefresh) {
|
|
|
28529
28879
|
const payload = JSON.parse(utf8.decode(bytes));
|
|
28530
28880
|
if (!payload || typeof payload !== "object" || !("downloads" in payload))
|
|
28531
28881
|
return void 0;
|
|
28532
|
-
const
|
|
28533
|
-
if (!
|
|
28882
|
+
const downloads = parseDownloadCountMap(payload.downloads);
|
|
28883
|
+
if (!downloads)
|
|
28534
28884
|
return void 0;
|
|
28535
|
-
const
|
|
28536
|
-
|
|
28537
|
-
if (typeof count2 === "number" && Number.isSafeInteger(count2) && count2 >= 0) {
|
|
28538
|
-
downloads.set(id2, count2);
|
|
28539
|
-
}
|
|
28540
|
-
}
|
|
28541
|
-
return downloads;
|
|
28885
|
+
const downloads7d = "downloads7d" in payload ? parseDownloadCountMap(payload.downloads7d) : void 0;
|
|
28886
|
+
return downloads7d ? { downloads, downloads7d } : { downloads };
|
|
28542
28887
|
} catch {
|
|
28543
28888
|
return void 0;
|
|
28544
28889
|
}
|
|
28545
28890
|
}
|
|
28546
|
-
function mergeLiveDownloadStats(catalog,
|
|
28547
|
-
|
|
28891
|
+
function mergeLiveDownloadStats(catalog, liveStats) {
|
|
28892
|
+
const hasLiveDownloads7d = (liveStats?.downloads7d?.size ?? 0) > 0;
|
|
28893
|
+
if (!liveStats || liveStats.downloads.size === 0 && !hasLiveDownloads7d)
|
|
28548
28894
|
return catalog;
|
|
28549
28895
|
return {
|
|
28550
28896
|
...catalog,
|
|
28551
28897
|
extensions: catalog.extensions.map((entry) => {
|
|
28552
|
-
const
|
|
28553
|
-
|
|
28898
|
+
const liveDownloads = liveStats.downloads.get(entry.id);
|
|
28899
|
+
const liveDownloads7d = hasLiveDownloads7d ? liveStats.downloads7d.get(entry.id) ?? 0 : void 0;
|
|
28900
|
+
if (liveDownloads === void 0 && liveDownloads7d === void 0)
|
|
28901
|
+
return entry;
|
|
28902
|
+
return {
|
|
28903
|
+
...entry,
|
|
28904
|
+
...liveDownloads !== void 0 ? { downloads: liveDownloads } : {},
|
|
28905
|
+
...liveDownloads7d !== void 0 ? { downloads7d: liveDownloads7d } : {}
|
|
28906
|
+
};
|
|
28554
28907
|
})
|
|
28555
28908
|
};
|
|
28556
28909
|
}
|
|
28557
|
-
function startCatalogFetch(forceRefresh, dataDir) {
|
|
28558
|
-
if (pending && (!forceRefresh || pending.forceRefresh)) {
|
|
28910
|
+
function startCatalogFetch(forceRefresh, dataDir, acceptCandidate) {
|
|
28911
|
+
if (!acceptCandidate && pending && (!forceRefresh || pending.forceRefresh)) {
|
|
28559
28912
|
return pending.promise;
|
|
28560
28913
|
}
|
|
28561
28914
|
const generation = ++catalogGeneration;
|
|
28562
28915
|
const statsUrl = resolveHostExtensionStatsUrl();
|
|
28563
28916
|
const statsPromise = fetchLiveDownloadStats(statsUrl, forceRefresh);
|
|
28564
|
-
const
|
|
28565
|
-
|
|
28917
|
+
const created = (async () => {
|
|
28918
|
+
const diskBaseline = !cache && dataDir ? await readDiskCatalogCache(dataDir) : void 0;
|
|
28919
|
+
const baselineGeneratedAtMs = Math.max(cache ? catalogGeneratedAtMs(cache.result) : 0, diskBaseline ? catalogGeneratedAtMs(diskBaseline) : 0);
|
|
28920
|
+
const knownGeneratedAtMs = () => Math.max(baselineGeneratedAtMs, cache ? catalogGeneratedAtMs(cache.result) : 0);
|
|
28921
|
+
const effectiveAcceptCandidate = (candidate) => {
|
|
28922
|
+
const candidateMs = catalogGeneratedAtMs(candidate);
|
|
28923
|
+
const knownMs = knownGeneratedAtMs();
|
|
28924
|
+
if (knownMs > 0 && candidateMs > 0 && candidateMs < knownMs) {
|
|
28925
|
+
return false;
|
|
28926
|
+
}
|
|
28927
|
+
return acceptCandidate ? acceptCandidate(candidate) : true;
|
|
28928
|
+
};
|
|
28929
|
+
const commitCache = (merged2) => {
|
|
28930
|
+
if (generation < cacheWrittenGeneration)
|
|
28931
|
+
return;
|
|
28932
|
+
const mergedMs = catalogGeneratedAtMs(merged2);
|
|
28933
|
+
const knownMs = knownGeneratedAtMs();
|
|
28934
|
+
if (knownMs > 0 && mergedMs > 0 && mergedMs < knownMs) {
|
|
28935
|
+
return;
|
|
28936
|
+
}
|
|
28566
28937
|
cacheWrittenGeneration = generation;
|
|
28567
28938
|
const now = Date.now();
|
|
28568
28939
|
cache = {
|
|
28569
|
-
result:
|
|
28940
|
+
result: merged2,
|
|
28570
28941
|
expires: now + TTL,
|
|
28571
28942
|
staleUntil: now + STALE_FALLBACK_MAX_AGE_MS
|
|
28572
28943
|
};
|
|
28573
|
-
void writeDiskCatalogCache(dataDir,
|
|
28574
|
-
}
|
|
28575
|
-
|
|
28576
|
-
|
|
28577
|
-
|
|
28578
|
-
|
|
28579
|
-
}).then(async (catalog) => {
|
|
28944
|
+
void writeDiskCatalogCache(dataDir, merged2);
|
|
28945
|
+
};
|
|
28946
|
+
const { result: catalog } = await raceCatalog(forceRefresh, (fresherPrimary) => {
|
|
28947
|
+
const knownStats = statsUrl && lastKnownDownloadStats?.url === statsUrl ? lastKnownDownloadStats.stats : void 0;
|
|
28948
|
+
commitCache(mergeLiveDownloadStats(fresherPrimary, knownStats));
|
|
28949
|
+
}, effectiveAcceptCandidate);
|
|
28580
28950
|
let timer;
|
|
28581
28951
|
const statsOutcome = await Promise.race([
|
|
28582
|
-
statsPromise.then((
|
|
28952
|
+
statsPromise.then((stats) => ({ settled: true, stats })),
|
|
28583
28953
|
new Promise((resolve) => {
|
|
28584
28954
|
timer = setTimeout(() => resolve({ settled: false }), STATS_INLINE_GRACE_MS);
|
|
28585
28955
|
})
|
|
@@ -28587,47 +28957,49 @@ function startCatalogFetch(forceRefresh, dataDir) {
|
|
|
28587
28957
|
if (timer !== void 0)
|
|
28588
28958
|
clearTimeout(timer);
|
|
28589
28959
|
});
|
|
28590
|
-
let
|
|
28960
|
+
let initialStats;
|
|
28591
28961
|
if (statsOutcome.settled) {
|
|
28592
|
-
if (statsOutcome.
|
|
28962
|
+
if (statsOutcome.stats && statsUrl) {
|
|
28593
28963
|
lastKnownDownloadStats = {
|
|
28594
28964
|
url: statsUrl,
|
|
28595
|
-
|
|
28965
|
+
stats: statsOutcome.stats,
|
|
28596
28966
|
expires: Date.now() + TTL
|
|
28597
28967
|
};
|
|
28598
28968
|
}
|
|
28599
|
-
|
|
28969
|
+
initialStats = statsOutcome.stats;
|
|
28600
28970
|
} else {
|
|
28601
28971
|
if (!forceRefresh && statsUrl && lastKnownDownloadStats?.url === statsUrl && Date.now() < lastKnownDownloadStats.expires) {
|
|
28602
|
-
|
|
28972
|
+
initialStats = lastKnownDownloadStats.stats;
|
|
28603
28973
|
}
|
|
28604
|
-
void statsPromise.then((
|
|
28605
|
-
if (!
|
|
28974
|
+
void statsPromise.then((lateStats) => {
|
|
28975
|
+
if (!lateStats || !statsUrl)
|
|
28606
28976
|
return;
|
|
28607
28977
|
lastKnownDownloadStats = {
|
|
28608
28978
|
url: statsUrl,
|
|
28609
|
-
|
|
28979
|
+
stats: lateStats,
|
|
28610
28980
|
expires: Date.now() + TTL
|
|
28611
28981
|
};
|
|
28612
28982
|
if (cache && generation >= cacheWrittenGeneration) {
|
|
28613
|
-
const updated = mergeLiveDownloadStats(cache.result,
|
|
28983
|
+
const updated = mergeLiveDownloadStats(cache.result, lateStats);
|
|
28614
28984
|
cache = { ...cache, result: updated };
|
|
28615
28985
|
void writeDiskCatalogCache(dataDir, updated);
|
|
28616
28986
|
}
|
|
28617
28987
|
});
|
|
28618
28988
|
}
|
|
28619
|
-
const merged = mergeLiveDownloadStats(catalog,
|
|
28989
|
+
const merged = mergeLiveDownloadStats(catalog, initialStats);
|
|
28620
28990
|
commitCache(merged);
|
|
28621
28991
|
return merged;
|
|
28622
|
-
}).finally(() => {
|
|
28992
|
+
})().finally(() => {
|
|
28623
28993
|
if (pending?.promise === created)
|
|
28624
28994
|
pending = void 0;
|
|
28625
28995
|
});
|
|
28626
28996
|
created.catch(() => void 0);
|
|
28627
|
-
|
|
28997
|
+
if (!acceptCandidate) {
|
|
28998
|
+
pending = { forceRefresh, promise: created };
|
|
28999
|
+
}
|
|
28628
29000
|
return created;
|
|
28629
29001
|
}
|
|
28630
|
-
async function fetchHostExtensionCatalog({ dataDir, forceRefresh = false, fallbackToCache = false, staleWhileRevalidate = false, signal } = {}) {
|
|
29002
|
+
async function fetchHostExtensionCatalog({ dataDir, forceRefresh = false, fallbackToCache = false, staleWhileRevalidate = false, acceptMirror, signal } = {}) {
|
|
28631
29003
|
if (!forceRefresh && cache && Date.now() < cache.expires)
|
|
28632
29004
|
return { ...structuredClone(cache.result), cached: true };
|
|
28633
29005
|
if (signal?.aborted)
|
|
@@ -28647,7 +29019,7 @@ async function fetchHostExtensionCatalog({ dataDir, forceRefresh = false, fallba
|
|
|
28647
29019
|
return { ...structuredClone(staleEntry), cached: true, stale: true };
|
|
28648
29020
|
}
|
|
28649
29021
|
}
|
|
28650
|
-
const request = startCatalogFetch(forceRefresh, dataDir);
|
|
29022
|
+
const request = startCatalogFetch(forceRefresh, dataDir, acceptMirror);
|
|
28651
29023
|
try {
|
|
28652
29024
|
const result = await raceWithSignal(request, signal);
|
|
28653
29025
|
return structuredClone(result);
|