@codexhost/cli-win32-x64 0.30.0 → 0.31.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 +54 -5
- package/app/console-web.js +74 -7
- package/app/desktop-controller.mjs +60 -9
- package/app/host-runtime.mjs +1367 -322
- package/app/plugins/antigravity/plugin.mjs +54 -5
- package/app/plugins/claude-code/plugin.mjs +65 -13
- package/app/plugins/codebuddy/plugin.mjs +253 -93
- package/app/plugins/codex-usage/plugin.mjs +54 -5
- package/app/plugins/copilot/plugin.mjs +54 -5
- package/app/plugins/cursor-cli/plugin.mjs +54 -5
- package/app/plugins/deepseek-harness/plugin.mjs +54 -5
- package/app/plugins/devin/plugin.mjs +54 -5
- package/app/plugins/grok/plugin.mjs +54 -5
- package/app/plugins/hermes/plugin.mjs +54 -5
- package/app/plugins/kimi-code/plugin.mjs +54 -5
- package/app/plugins/kiro-cli/plugin.mjs +54 -5
- package/app/plugins/omp/plugin.mjs +54 -5
- package/app/plugins/opencode/plugin.mjs +54 -5
- package/app/plugins/pi/plugin.mjs +54 -5
- package/app/plugins/qoder/plugin.mjs +54 -5
- package/app/plugins/qoder-cn/plugin.mjs +54 -5
- package/app/plugins/qwen-code/plugin.mjs +54 -5
- package/app/plugins/workbuddy/plugin.mjs +253 -93
- package/app/plugins/zcode/plugin.mjs +54 -5
- package/app/renderer-extension.js +650 -413
- package/app/web/assets/{abnfDiagram-XWFEHMT6-BdinLox4.js → abnfDiagram-XWFEHMT6-Bqy7uOSy.js} +1 -1
- package/app/web/assets/{architectureDiagram-CSQXQB3N-DgPBbtvP.js → architectureDiagram-CSQXQB3N-6aaP1YoM.js} +1 -1
- package/app/web/assets/{blockDiagram-BEDRHYPZ-B4ENdwtZ.js → blockDiagram-BEDRHYPZ-B4QSFXe0.js} +1 -1
- package/app/web/assets/{c4Diagram-M2UUVUY5-DA6Owfyu.js → c4Diagram-M2UUVUY5-BYE-C8Gq.js} +1 -1
- package/app/web/assets/{chunk-2Q5K7J3B-Dvh3qOmo.js → chunk-2Q5K7J3B-CiEM-GTd.js} +1 -1
- package/app/web/assets/{chunk-3GCGMST5-VIkqueym.js → chunk-3GCGMST5-hzY9BiB1.js} +1 -1
- package/app/web/assets/{chunk-5VM5RSS4-DTYof_OI.js → chunk-5VM5RSS4-DYXznY0H.js} +1 -1
- package/app/web/assets/{chunk-7U7NFRK5-Dp7s2dg0.js → chunk-7U7NFRK5-Bzw5MDPr.js} +1 -1
- package/app/web/assets/{chunk-CNRTWJTD-TKBKxZLU.js → chunk-CNRTWJTD-DMbxMfi3.js} +1 -1
- package/app/web/assets/{chunk-D5HYT7QG-BRZDovSS.js → chunk-D5HYT7QG-By0ZVBtD.js} +1 -1
- package/app/web/assets/{chunk-EBZ3SEQC-C9USZ3tT.js → chunk-EBZ3SEQC-Yyu_sMV7.js} +2 -2
- package/app/web/assets/{chunk-JWPE2WC7-BrdvVNVo.js → chunk-JWPE2WC7-DDzqxIPT.js} +1 -1
- package/app/web/assets/{chunk-KTR4FSNJ-C7qwjGba.js → chunk-KTR4FSNJ-GlKqhtpl.js} +1 -1
- package/app/web/assets/{chunk-XXDRQBXY-DlSrRuwN.js → chunk-XXDRQBXY-DNc-CvYu.js} +1 -1
- package/app/web/assets/{classDiagram-v2-KXABOMEV-BFvB4kwX.js → classDiagram-v2-KXABOMEV-4_PFS2N_.js} +1 -1
- package/app/web/assets/{cose-bilkent-JH36ORCC-UyCAqNvj.js → cose-bilkent-JH36ORCC-BE3foHUY.js} +1 -1
- package/app/web/assets/{cynefin-EF2NZ3EQ-CwawUbjJ.js → cynefin-EF2NZ3EQ-D2PqrYZ3.js} +1 -1
- package/app/web/assets/{cynefinDiagram-NJNITYFG-BaWEIQJ0.js → cynefinDiagram-NJNITYFG-DOObpTbq.js} +1 -1
- package/app/web/assets/{dagre-KIHZ2IZ3-B7ENIjLG.js → dagre-KIHZ2IZ3-Znm2jin9.js} +1 -1
- package/app/web/assets/{diagram-7YQZDPLS-CxRMU8xq.js → diagram-7YQZDPLS-ByZMD-uA.js} +1 -1
- package/app/web/assets/{diagram-QBROCOUO-qo7sxm4K.js → diagram-QBROCOUO-BiRShpnN.js} +1 -1
- package/app/web/assets/{diagram-RJJCUUZO-CQiGMCMe.js → diagram-RJJCUUZO-D9wLVoK2.js} +1 -1
- package/app/web/assets/{diagram-WERXNKYE-D0Jps1As.js → diagram-WERXNKYE-BSbIh-yC.js} +1 -1
- package/app/web/assets/{diagram-YHHI257C-p4AB8cqK.js → diagram-YHHI257C-DMWrHMc8.js} +1 -1
- package/app/web/assets/{diagram-YR4HJLHV-Bh6JKT04.js → diagram-YR4HJLHV-C4sBAFb1.js} +1 -1
- package/app/web/assets/{ebnfDiagram-N527522P-DRac0k4W.js → ebnfDiagram-N527522P-BZLloaoQ.js} +1 -1
- package/app/web/assets/{elk-O5DQBFGD-CWTz5SZP.js → elk-O5DQBFGD-Da3e5tn5.js} +1 -1
- package/app/web/assets/{erDiagram-K3K3BIDK-DE3w4BEY.js → erDiagram-K3K3BIDK-B2lKAIZF.js} +1 -1
- package/app/web/assets/{flowDiagram-Z6JWZHQI-NYs8bi5t.js → flowDiagram-Z6JWZHQI-q2EY_kmB.js} +1 -1
- package/app/web/assets/{ganttDiagram-3PRQTZWP-Bspp9btW.js → ganttDiagram-3PRQTZWP-BGrNZ20b.js} +1 -1
- package/app/web/assets/{gitGraphDiagram-VXDFKS5L-ByGW1uvv.js → gitGraphDiagram-VXDFKS5L-DIZNXREy.js} +1 -1
- package/app/web/assets/{grid-E2QIVN74-CegebiIw.js → grid-E2QIVN74-0cUkPG69.js} +1 -1
- package/app/web/assets/{index-DFPOGLS4.js → index-PN7K-15_.js} +76 -76
- package/app/web/assets/{infoDiagram-EZ3ZOAHP-CexmsdZx.js → infoDiagram-EZ3ZOAHP-BHhUTQCn.js} +1 -1
- package/app/web/assets/{ishikawaDiagram-S3EKX5GW-BbWqKhg6.js → ishikawaDiagram-S3EKX5GW-DPOxtl4c.js} +1 -1
- package/app/web/assets/{journeyDiagram-POQNLL5X-27YlCe-1.js → journeyDiagram-POQNLL5X-D8RyXckG.js} +1 -1
- package/app/web/assets/{kanban-definition-BH5XI6FM-BAhOdeck.js → kanban-definition-BH5XI6FM-COJv3Hyh.js} +1 -1
- package/app/web/assets/{mermaid.core-sGgCbv5y.js → mermaid.core-DYdcDKIt.js} +4 -4
- package/app/web/assets/{mindmap-definition-WVAN44T4-CsMIX0Lj.js → mindmap-definition-WVAN44T4-DnYIM4ja.js} +1 -1
- package/app/web/assets/{pegDiagram-D4NLKWP3-Cs3LXqn_.js → pegDiagram-D4NLKWP3-Ds3GAEJ6.js} +1 -1
- package/app/web/assets/{pieDiagram-36ENHN4W-DdQsQX9I.js → pieDiagram-36ENHN4W-BhLUJGEB.js} +1 -1
- package/app/web/assets/{quadrantDiagram-ZQUDMS73-D1jOKqx_.js → quadrantDiagram-ZQUDMS73-DwtX-IxK.js} +1 -1
- package/app/web/assets/{railroadDiagram-JIZHGYPL-XulrgX5n.js → railroadDiagram-JIZHGYPL-D2vmTTnJ.js} +1 -1
- package/app/web/assets/{render-VIF2ZAQL-CSsGw-0I.js → render-VIF2ZAQL-DGU1ql-Z.js} +2 -2
- package/app/web/assets/{requirementDiagram-AXW2TVFA-CT66GXLN.js → requirementDiagram-AXW2TVFA-u3j1sKkI.js} +1 -1
- package/app/web/assets/{sankeyDiagram-FBCJTAIF-CNRKebNY.js → sankeyDiagram-FBCJTAIF-k-An9VHW.js} +1 -1
- package/app/web/assets/{sequenceDiagram-3LA2ROMG-DVl5y64e.js → sequenceDiagram-3LA2ROMG-DUjbYb4R.js} +1 -1
- package/app/web/assets/{sizeCapture-2Q2CQKSF-Kg0XxSga.js → sizeCapture-2Q2CQKSF-DATTL7FZ.js} +1 -1
- package/app/web/assets/{stateDiagram-v2-ATKHQDJO-DYQnfMsS.js → stateDiagram-v2-ATKHQDJO-cCJX5M2u.js} +1 -1
- package/app/web/assets/{swimlanes-YQL5WMAO-Chqt7pxD.js → swimlanes-YQL5WMAO-B7grWEWt.js} +1 -1
- package/app/web/assets/swimlanesDiagram-UCCPES4V-B8Jem9gq.js +8 -0
- package/app/web/assets/{timeline-definition-7Z437IG3-aHFxjIT6.js → timeline-definition-7Z437IG3-BhsLa6l1.js} +1 -1
- package/app/web/assets/{usecaseDiagram-RDK6N6HP-DsC5tFe4.js → usecaseDiagram-RDK6N6HP-CkPQYmQw.js} +1 -1
- package/app/web/assets/{vennDiagram-SHRQU5PJ-C65oZxFn.js → vennDiagram-SHRQU5PJ-CufZSwvw.js} +1 -1
- package/app/web/assets/{wardleyDiagram-F3OXNVQS-HTkq7DT0.js → wardleyDiagram-F3OXNVQS-CSkfpFOA.js} +1 -1
- package/app/web/assets/{xychartDiagram-GDYJKCDI-p1LpQ9MH.js → xychartDiagram-GDYJKCDI-BhZf9scK.js} +1 -1
- package/app/web/codexhost-settings.js +56 -56
- package/app/web/index.html +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +8 -8
- package/app/web/plugins/deepseek-ai__dsh-api-workspace-controller/client.js +3 -3
- 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 +16 -16
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +16 -16
- package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +70 -72
- package/app/web-modules/server.mjs +383 -148
- 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/swimlanesDiagram-UCCPES4V-BfREktNP.js +0 -8
|
@@ -16659,8 +16659,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16659
16659
|
bySchema.set(entry.schema, entry);
|
|
16660
16660
|
}
|
|
16661
16661
|
const rewrites = /* @__PURE__ */ new Map();
|
|
16662
|
-
for (const
|
|
16663
|
-
const seen = ctx.seen.get(
|
|
16662
|
+
for (const record19 of pendingRecords.get(ctx) ?? []) {
|
|
16663
|
+
const seen = ctx.seen.get(record19);
|
|
16664
16664
|
const names = (seen?.def ?? seen?.schema)?.propertyNames;
|
|
16665
16665
|
if (!names || names === true || rewrites.has(names))
|
|
16666
16666
|
continue;
|
|
@@ -19965,10 +19965,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19965
19965
|
|
|
19966
19966
|
// ../shared-contracts/dist/json-value.js
|
|
19967
19967
|
function rejectExplicitUndefined(keys) {
|
|
19968
|
-
return (value,
|
|
19968
|
+
return (value, context) => {
|
|
19969
19969
|
for (const key2 of keys) {
|
|
19970
19970
|
if (Object.hasOwn(value, key2) && value[key2] === void 0) {
|
|
19971
|
-
|
|
19971
|
+
context.addIssue({
|
|
19972
19972
|
code: "custom",
|
|
19973
19973
|
path: [key2],
|
|
19974
19974
|
message: "Explicit undefined is not valid JSON"
|
|
@@ -20092,11 +20092,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20092
20092
|
var harnessPermissionModeCatalogSchema = external_exports.object({
|
|
20093
20093
|
modes: external_exports.array(harnessPermissionModeSchema).min(1).max(HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH),
|
|
20094
20094
|
defaultModeId: harnessPermissionModeIdSchema
|
|
20095
|
-
}).strict().superRefine((catalog,
|
|
20095
|
+
}).strict().superRefine((catalog, context) => {
|
|
20096
20096
|
const ids = /* @__PURE__ */ new Set();
|
|
20097
20097
|
for (const [index, mode] of catalog.modes.entries()) {
|
|
20098
20098
|
if (ids.has(mode.id)) {
|
|
20099
|
-
|
|
20099
|
+
context.addIssue({
|
|
20100
20100
|
code: "custom",
|
|
20101
20101
|
message: "Permission Mode IDs must be unique",
|
|
20102
20102
|
path: ["modes", index, "id"]
|
|
@@ -20105,7 +20105,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20105
20105
|
ids.add(mode.id);
|
|
20106
20106
|
}
|
|
20107
20107
|
if (!ids.has(catalog.defaultModeId)) {
|
|
20108
|
-
|
|
20108
|
+
context.addIssue({
|
|
20109
20109
|
code: "custom",
|
|
20110
20110
|
message: "Default Permission Mode must exist in the catalog",
|
|
20111
20111
|
path: ["defaultModeId"]
|
|
@@ -20213,49 +20213,49 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20213
20213
|
latestRequestTimeToFirstOutputMs: nonNegativeSafeIntegerSchema.optional(),
|
|
20214
20214
|
costSource: external_exports.enum(["publicPrice", "native"]).optional(),
|
|
20215
20215
|
unpricedModels: external_exports.array(external_exports.string().min(1)).min(1).optional()
|
|
20216
|
-
}).strict().superRefine((usage,
|
|
20216
|
+
}).strict().superRefine((usage, context) => {
|
|
20217
20217
|
if (Object.keys(usage).length === 0) {
|
|
20218
|
-
|
|
20218
|
+
context.addIssue({ code: "custom", message: "Thread Usage must contain a reliable field" });
|
|
20219
20219
|
}
|
|
20220
20220
|
const hasContextUsed = usage.contextUsedTokens !== void 0;
|
|
20221
20221
|
const hasContextWindow = usage.contextWindowTokens !== void 0;
|
|
20222
20222
|
if (hasContextUsed !== hasContextWindow) {
|
|
20223
|
-
|
|
20223
|
+
context.addIssue({
|
|
20224
20224
|
code: "custom",
|
|
20225
20225
|
message: "Thread Usage context fields must be provided together",
|
|
20226
20226
|
path: [hasContextUsed ? "contextWindowTokens" : "contextUsedTokens"]
|
|
20227
20227
|
});
|
|
20228
20228
|
}
|
|
20229
20229
|
if (usage.contextWindowTokens === 0) {
|
|
20230
|
-
|
|
20230
|
+
context.addIssue({
|
|
20231
20231
|
code: "custom",
|
|
20232
20232
|
message: "Thread Usage contextWindowTokens must be greater than zero",
|
|
20233
20233
|
path: ["contextWindowTokens"]
|
|
20234
20234
|
});
|
|
20235
20235
|
}
|
|
20236
20236
|
if (usage.costSource !== void 0 && usage.totalCostUsd === void 0) {
|
|
20237
|
-
|
|
20237
|
+
context.addIssue({
|
|
20238
20238
|
code: "custom",
|
|
20239
20239
|
message: "Thread Usage costSource must be provided with totalCostUsd",
|
|
20240
20240
|
path: ["costSource"]
|
|
20241
20241
|
});
|
|
20242
20242
|
}
|
|
20243
20243
|
if (usage.unpricedModels !== void 0 && usage.costSource !== "publicPrice") {
|
|
20244
|
-
|
|
20244
|
+
context.addIssue({
|
|
20245
20245
|
code: "custom",
|
|
20246
20246
|
message: "Thread Usage unpricedModels must be provided with a publicPrice cost",
|
|
20247
20247
|
path: ["unpricedModels"]
|
|
20248
20248
|
});
|
|
20249
20249
|
}
|
|
20250
20250
|
if (usage.planFiveHourResetsAtUnix !== void 0 && usage.planFiveHourUsedPercent === void 0) {
|
|
20251
|
-
|
|
20251
|
+
context.addIssue({
|
|
20252
20252
|
code: "custom",
|
|
20253
20253
|
message: "Thread Usage planFiveHourResetsAtUnix must be provided with planFiveHourUsedPercent",
|
|
20254
20254
|
path: ["planFiveHourResetsAtUnix"]
|
|
20255
20255
|
});
|
|
20256
20256
|
}
|
|
20257
20257
|
if (usage.planSevenDayResetsAtUnix !== void 0 && usage.planSevenDayUsedPercent === void 0) {
|
|
20258
|
-
|
|
20258
|
+
context.addIssue({
|
|
20259
20259
|
code: "custom",
|
|
20260
20260
|
message: "Thread Usage planSevenDayResetsAtUnix must be provided with planSevenDayUsedPercent",
|
|
20261
20261
|
path: ["planSevenDayResetsAtUnix"]
|
|
@@ -20376,11 +20376,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20376
20376
|
return void 0;
|
|
20377
20377
|
return catalog?.models.find((model2) => sameHarnessModelRef(model2.ref, ref) || sameHarnessModelRef(model2.fastModel, ref));
|
|
20378
20378
|
}
|
|
20379
|
-
var harnessThinkingOptionsSchema = external_exports.array(harnessThinkingOptionSchema).superRefine((options,
|
|
20379
|
+
var harnessThinkingOptionsSchema = external_exports.array(harnessThinkingOptionSchema).superRefine((options, context) => {
|
|
20380
20380
|
const ids = /* @__PURE__ */ new Set();
|
|
20381
20381
|
for (const [index, option] of options.entries()) {
|
|
20382
20382
|
if (ids.has(option.id)) {
|
|
20383
|
-
|
|
20383
|
+
context.addIssue({
|
|
20384
20384
|
code: "custom",
|
|
20385
20385
|
message: "Thinking option IDs must be unique",
|
|
20386
20386
|
path: [index, "id"]
|
|
@@ -20404,12 +20404,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20404
20404
|
* validated by the Adapter after selecting the Model.
|
|
20405
20405
|
*/
|
|
20406
20406
|
thinkingOptionsScope: harnessThinkingOptionsScopeSchema.optional()
|
|
20407
|
-
}).strict().superRefine((catalog,
|
|
20407
|
+
}).strict().superRefine((catalog, context) => {
|
|
20408
20408
|
const refs = [];
|
|
20409
20409
|
const thinkingIds = new Set(catalog.thinkingOptions.map(({ id: id2 }) => id2));
|
|
20410
20410
|
for (const [index, model2] of catalog.models.entries()) {
|
|
20411
20411
|
if (refs.some((ref) => sameHarnessModelRef(ref, model2.ref))) {
|
|
20412
|
-
|
|
20412
|
+
context.addIssue({
|
|
20413
20413
|
code: "custom",
|
|
20414
20414
|
message: "Model Catalog refs must be unique",
|
|
20415
20415
|
path: ["models", index, "ref", "id"]
|
|
@@ -20418,7 +20418,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20418
20418
|
refs.push(model2.ref);
|
|
20419
20419
|
if (model2.fastModel) {
|
|
20420
20420
|
if (refs.some((ref) => sameHarnessModelRef(ref, model2.fastModel))) {
|
|
20421
|
-
|
|
20421
|
+
context.addIssue({
|
|
20422
20422
|
code: "custom",
|
|
20423
20423
|
message: "Fast Model refs must be distinct and unique",
|
|
20424
20424
|
path: ["models", index, "fastModel"]
|
|
@@ -20429,7 +20429,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20429
20429
|
const supportedThinkingIds = /* @__PURE__ */ new Set();
|
|
20430
20430
|
for (const [optionIndex, optionId] of (model2.supportedThinkingOptionIds ?? []).entries()) {
|
|
20431
20431
|
if (supportedThinkingIds.has(optionId)) {
|
|
20432
|
-
|
|
20432
|
+
context.addIssue({
|
|
20433
20433
|
code: "custom",
|
|
20434
20434
|
message: "Supported Thinking option IDs must be unique per Model",
|
|
20435
20435
|
path: ["models", index, "supportedThinkingOptionIds", optionIndex]
|
|
@@ -20437,7 +20437,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20437
20437
|
}
|
|
20438
20438
|
supportedThinkingIds.add(optionId);
|
|
20439
20439
|
if (!thinkingIds.has(optionId)) {
|
|
20440
|
-
|
|
20440
|
+
context.addIssue({
|
|
20441
20441
|
code: "custom",
|
|
20442
20442
|
message: "Supported Thinking option must exist in the catalog",
|
|
20443
20443
|
path: ["models", index, "supportedThinkingOptionIds", optionIndex]
|
|
@@ -20446,14 +20446,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20446
20446
|
}
|
|
20447
20447
|
}
|
|
20448
20448
|
if (catalog.defaultModel && !catalogModelForRef(catalog, catalog.defaultModel)) {
|
|
20449
|
-
|
|
20449
|
+
context.addIssue({
|
|
20450
20450
|
code: "custom",
|
|
20451
20451
|
message: "Default Model must exist in the Model Catalog",
|
|
20452
20452
|
path: ["defaultModel", "id"]
|
|
20453
20453
|
});
|
|
20454
20454
|
}
|
|
20455
20455
|
if (catalog.defaultThinkingOptionId && !thinkingIds.has(catalog.defaultThinkingOptionId)) {
|
|
20456
|
-
|
|
20456
|
+
context.addIssue({
|
|
20457
20457
|
code: "custom",
|
|
20458
20458
|
message: "Default Thinking option must exist in the catalog",
|
|
20459
20459
|
path: ["defaultThinkingOptionId"]
|
|
@@ -20501,9 +20501,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20501
20501
|
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
20502
20502
|
availableThinkingOptions: harnessThinkingOptionsSchema.optional(),
|
|
20503
20503
|
effectivePermissionModeId: harnessPermissionModeIdSchema.optional()
|
|
20504
|
-
}).strict().superRefine((state,
|
|
20504
|
+
}).strict().superRefine((state, context) => {
|
|
20505
20505
|
if (state.effectiveThinkingOptionId && state.availableThinkingOptions && !state.availableThinkingOptions.some(({ id: id2 }) => id2 === state.effectiveThinkingOptionId)) {
|
|
20506
|
-
|
|
20506
|
+
context.addIssue({
|
|
20507
20507
|
code: "custom",
|
|
20508
20508
|
message: "Effective Thinking option must be currently available",
|
|
20509
20509
|
path: ["effectiveThinkingOptionId"]
|
|
@@ -20520,10 +20520,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20520
20520
|
permissionModes: harnessPermissionModeCatalogSchema.optional(),
|
|
20521
20521
|
capabilities: harnessSessionCapabilitiesSchema,
|
|
20522
20522
|
webUi: harnessWebUiCapabilitySchema.optional()
|
|
20523
|
-
}).strict().superRefine((inspection,
|
|
20523
|
+
}).strict().superRefine((inspection, context) => {
|
|
20524
20524
|
const selectable = inspection.capabilities.configuration.selectPermissionMode;
|
|
20525
20525
|
if (selectable !== Boolean(inspection.permissionModes)) {
|
|
20526
|
-
|
|
20526
|
+
context.addIssue({
|
|
20527
20527
|
code: "custom",
|
|
20528
20528
|
message: "Permission Mode catalog and capability must agree",
|
|
20529
20529
|
path: selectable ? ["permissionModes"] : ["capabilities", "configuration", "selectPermissionMode"]
|
|
@@ -20595,11 +20595,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20595
20595
|
]);
|
|
20596
20596
|
var threadOwnershipListParamsSchema = external_exports.object({
|
|
20597
20597
|
threadIds: external_exports.array(hostThreadIdSchema).min(1).max(THREAD_OWNERSHIP_LIST_MAX_LENGTH)
|
|
20598
|
-
}).strict().superRefine(({ threadIds },
|
|
20598
|
+
}).strict().superRefine(({ threadIds }, context) => {
|
|
20599
20599
|
const seen = /* @__PURE__ */ new Set();
|
|
20600
20600
|
for (const [index, threadId] of threadIds.entries()) {
|
|
20601
20601
|
if (seen.has(threadId)) {
|
|
20602
|
-
|
|
20602
|
+
context.addIssue({
|
|
20603
20603
|
code: "custom",
|
|
20604
20604
|
message: "Thread ownership-list IDs must be unique",
|
|
20605
20605
|
path: ["threadIds", index]
|
|
@@ -20623,11 +20623,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20623
20623
|
]);
|
|
20624
20624
|
var threadOwnershipListResultSchema = external_exports.object({
|
|
20625
20625
|
threads: external_exports.array(threadOwnershipSchema).min(1).max(THREAD_OWNERSHIP_LIST_MAX_LENGTH)
|
|
20626
|
-
}).strict().superRefine(({ threads },
|
|
20626
|
+
}).strict().superRefine(({ threads }, context) => {
|
|
20627
20627
|
const seen = /* @__PURE__ */ new Set();
|
|
20628
20628
|
for (const [index, thread3] of threads.entries()) {
|
|
20629
20629
|
if (seen.has(thread3.threadId)) {
|
|
20630
|
-
|
|
20630
|
+
context.addIssue({
|
|
20631
20631
|
code: "custom",
|
|
20632
20632
|
message: "Thread ownership-list results must be unique",
|
|
20633
20633
|
path: ["threads", index, "threadId"]
|
|
@@ -20645,11 +20645,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20645
20645
|
var THREAD_STEERING_CONTEXT_PARAM = "codexhost_external_steering";
|
|
20646
20646
|
var threadSteeringContextSchema = external_exports.object({
|
|
20647
20647
|
kind: external_exports.literal("application"),
|
|
20648
|
-
value: external_exports.string().transform((text2,
|
|
20648
|
+
value: external_exports.string().transform((text2, context) => {
|
|
20649
20649
|
try {
|
|
20650
20650
|
return JSON.parse(text2);
|
|
20651
20651
|
} catch {
|
|
20652
|
-
|
|
20652
|
+
context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
|
|
20653
20653
|
return external_exports.NEVER;
|
|
20654
20654
|
}
|
|
20655
20655
|
}).pipe(external_exports.object({
|
|
@@ -20657,7 +20657,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20657
20657
|
clientUserMessageId: external_exports.string().min(1),
|
|
20658
20658
|
delivery: external_exports.enum(["newTurn", "activeTurn"])
|
|
20659
20659
|
}).strict())
|
|
20660
|
-
}).strict().transform((
|
|
20660
|
+
}).strict().transform((context) => context.value);
|
|
20661
20661
|
var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
|
|
20662
20662
|
var threadSteeringInspectResultSchema = external_exports.object({
|
|
20663
20663
|
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
@@ -21475,6 +21475,45 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21475
21475
|
// ../shared-contracts/dist/client-channel.js
|
|
21476
21476
|
var CLIENT_CHANNEL_VERSION = 1;
|
|
21477
21477
|
var CLIENT_REQUEST_LIMIT_BYTES = 128 * 1024 * 1024;
|
|
21478
|
+
var THREAD_SECTION_CAPABILITY = "threadSectionsV1";
|
|
21479
|
+
var threadSectionName = external_exports.string().trim().min(1);
|
|
21480
|
+
var threadSectionId = external_exports.string().min(1);
|
|
21481
|
+
var threadSectionAppearance = external_exports.object({
|
|
21482
|
+
icon: external_exports.string().nullable(),
|
|
21483
|
+
color: external_exports.string().nullable()
|
|
21484
|
+
});
|
|
21485
|
+
var clientThreadSectionAppearanceSchema = threadSectionAppearance.nullable();
|
|
21486
|
+
var CLIENT_THREAD_SECTION_MUTATIONS = {
|
|
21487
|
+
create: {
|
|
21488
|
+
method: "codexhost/thread/sections/create",
|
|
21489
|
+
params: external_exports.object({ name: threadSectionName }).strict()
|
|
21490
|
+
},
|
|
21491
|
+
update: {
|
|
21492
|
+
method: "codexhost/thread/sections/update",
|
|
21493
|
+
params: external_exports.object({
|
|
21494
|
+
sectionId: threadSectionId,
|
|
21495
|
+
name: threadSectionName,
|
|
21496
|
+
appearance: threadSectionAppearance.strict().nullable().optional()
|
|
21497
|
+
}).strict()
|
|
21498
|
+
},
|
|
21499
|
+
delete: {
|
|
21500
|
+
method: "codexhost/thread/sections/delete",
|
|
21501
|
+
params: external_exports.object({ sectionId: threadSectionId }).strict()
|
|
21502
|
+
}
|
|
21503
|
+
};
|
|
21504
|
+
var clientThreadSectionMutationResultSchema = external_exports.discriminatedUnion("status", [
|
|
21505
|
+
external_exports.object({ status: external_exports.literal("unknown") }),
|
|
21506
|
+
external_exports.object({
|
|
21507
|
+
status: external_exports.literal("confirmed"),
|
|
21508
|
+
sectionId: threadSectionId,
|
|
21509
|
+
section: external_exports.object({
|
|
21510
|
+
id: threadSectionId,
|
|
21511
|
+
name: external_exports.string().min(1),
|
|
21512
|
+
appearance: clientThreadSectionAppearanceSchema
|
|
21513
|
+
}).nullable(),
|
|
21514
|
+
syncPending: external_exports.boolean()
|
|
21515
|
+
})
|
|
21516
|
+
]);
|
|
21478
21517
|
var CLIENT_CHANNEL_METHODS = [
|
|
21479
21518
|
"codexhost/skills/list",
|
|
21480
21519
|
"codexhost/voice/status",
|
|
@@ -21521,6 +21560,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21521
21560
|
"codexhost/thread/pins/list",
|
|
21522
21561
|
"codexhost/thread/sections/list",
|
|
21523
21562
|
"codexhost/thread/sections/move",
|
|
21563
|
+
CLIENT_THREAD_SECTION_MUTATIONS.create.method,
|
|
21564
|
+
CLIENT_THREAD_SECTION_MUTATIONS.update.method,
|
|
21565
|
+
CLIENT_THREAD_SECTION_MUTATIONS.delete.method,
|
|
21524
21566
|
"codexhost/thread/pins/set",
|
|
21525
21567
|
"codexhost/harness/plugins/list",
|
|
21526
21568
|
"codexhost/harness/inspect",
|
|
@@ -21571,16 +21613,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21571
21613
|
"codexhost/sessions/loaded/list"
|
|
21572
21614
|
];
|
|
21573
21615
|
var clientThreadSectionsSchema = external_exports.object({
|
|
21616
|
+
[THREAD_SECTION_CAPABILITY]: external_exports.literal(true).optional(),
|
|
21617
|
+
complete: external_exports.literal(false).optional(),
|
|
21574
21618
|
sections: external_exports.array(external_exports.object({
|
|
21575
21619
|
id: external_exports.string().min(1),
|
|
21576
21620
|
name: external_exports.string().min(1),
|
|
21621
|
+
appearance: clientThreadSectionAppearanceSchema.optional(),
|
|
21577
21622
|
threads: external_exports.array(jsonObjectSchema)
|
|
21578
|
-
})
|
|
21579
|
-
})
|
|
21623
|
+
}))
|
|
21624
|
+
});
|
|
21580
21625
|
var clientThreadSectionMoveSchema = external_exports.object({
|
|
21581
21626
|
threadId: external_exports.string().min(1).max(1024),
|
|
21582
|
-
sectionId: external_exports.string().min(1).max(1024).nullable()
|
|
21583
|
-
|
|
21627
|
+
sectionId: external_exports.string().min(1).max(1024).nullable(),
|
|
21628
|
+
beforeThreadId: external_exports.string().min(1).max(1024).nullable().optional(),
|
|
21629
|
+
expectedSourceSectionId: external_exports.string().min(1).max(1024).optional()
|
|
21630
|
+
}).refine((move) => move.expectedSourceSectionId === void 0 || move.sectionId === null);
|
|
21584
21631
|
var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
|
|
21585
21632
|
var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
|
|
21586
21633
|
var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
|
|
@@ -21627,6 +21674,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21627
21674
|
harnessId: external_exports.string().min(1)
|
|
21628
21675
|
}),
|
|
21629
21676
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
21677
|
+
external_exports.object({ type: external_exports.literal("sections-changed"), cursor: clientChannelCursorSchema }),
|
|
21630
21678
|
external_exports.object({
|
|
21631
21679
|
type: external_exports.literal("preferences-changed"),
|
|
21632
21680
|
cursor: clientChannelCursorSchema,
|
|
@@ -21793,7 +21841,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21793
21841
|
startedAt: external_exports.number(),
|
|
21794
21842
|
epoch: external_exports.string().uuid(),
|
|
21795
21843
|
capabilities: external_exports.object({
|
|
21796
|
-
peerDelegation: external_exports.literal(1).optional()
|
|
21844
|
+
peerDelegation: external_exports.literal(1).optional(),
|
|
21845
|
+
threadReferenceContext: external_exports.literal(1).optional()
|
|
21797
21846
|
}).optional()
|
|
21798
21847
|
});
|
|
21799
21848
|
var clientChannelResponseSchema = external_exports.object({
|
|
@@ -22055,7 +22104,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
22055
22104
|
var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
|
|
22056
22105
|
var REMOTE_THREAD_READ_TIMEOUT_MS = 35e3;
|
|
22057
22106
|
var DELEGATION_READ_METHOD = "codexhost/thread/delegation-read";
|
|
22107
|
+
var THREAD_REFERENCE_CONTEXT_CAPABILITY_METHOD = "codexhost/thread/reference-context/capability";
|
|
22058
22108
|
var THREAD_REFERENCE_SOURCE_HOST_PARAM = "codexhostSourceHostId";
|
|
22109
|
+
function isDesktopSshHostId(hostId2) {
|
|
22110
|
+
return typeof hostId2 === "string" && hostId2.length <= 1024 && /^remote-ssh(?:-[^:\x00-\x20\x7f]+)?:[^\x00-\x20\x7f]+$/u.test(hostId2);
|
|
22111
|
+
}
|
|
22059
22112
|
var delegationReadParamsSchema = external_exports.strictObject({
|
|
22060
22113
|
threadId: external_exports.string().min(1).max(1024),
|
|
22061
22114
|
view: external_exports.enum(["result", "messages"]),
|
|
@@ -23363,11 +23416,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
23363
23416
|
* `live` once their Session's live catalog has loaded.
|
|
23364
23417
|
*/
|
|
23365
23418
|
source: external_exports.enum(["live", "static"]).optional()
|
|
23366
|
-
}).strict().superRefine((catalog,
|
|
23419
|
+
}).strict().superRefine((catalog, context) => {
|
|
23367
23420
|
const ids = /* @__PURE__ */ new Set();
|
|
23368
23421
|
for (const [index, command] of catalog.commands.entries()) {
|
|
23369
23422
|
if (ids.has(command.id)) {
|
|
23370
|
-
|
|
23423
|
+
context.addIssue({
|
|
23371
23424
|
code: "custom",
|
|
23372
23425
|
message: "Harness command IDs must be unique",
|
|
23373
23426
|
path: ["commands", index, "id"]
|
|
@@ -23504,9 +23557,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
23504
23557
|
npmDownload: npmDownloadProgressSchema.optional(),
|
|
23505
23558
|
error: external_exports.string().min(1).max(UPDATE_ERROR_MAX_LENGTH).nullable(),
|
|
23506
23559
|
serviceStopOutput: external_exports.string().optional()
|
|
23507
|
-
}).superRefine((status,
|
|
23560
|
+
}).superRefine((status, context) => {
|
|
23508
23561
|
if (status.downloadedBytes !== void 0 && status.totalBytes !== void 0 && status.downloadedBytes > status.totalBytes) {
|
|
23509
|
-
|
|
23562
|
+
context.addIssue({
|
|
23510
23563
|
code: "custom",
|
|
23511
23564
|
path: ["downloadedBytes"],
|
|
23512
23565
|
message: "downloadedBytes must not exceed totalBytes"
|
|
@@ -23638,10 +23691,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
23638
23691
|
var CONTROL_CHARACTER_PATTERN = /[\u0000-\u001f\u007f]/u;
|
|
23639
23692
|
function desktopImageAttachmentPaths(text2) {
|
|
23640
23693
|
const end = text2.search(REQUEST_HEADING);
|
|
23641
|
-
const
|
|
23642
|
-
if (!ATTACHED_FILES_HEADING.test(
|
|
23694
|
+
const context = end < 0 ? text2 : text2.slice(0, end);
|
|
23695
|
+
if (!ATTACHED_FILES_HEADING.test(context))
|
|
23643
23696
|
return [];
|
|
23644
|
-
return [...
|
|
23697
|
+
return [...context.matchAll(IMAGE_ATTACHMENT_PATTERN)].map((match) => match[1] ?? "").filter((path) => path.length > 0 && !CONTROL_CHARACTER_PATTERN.test(path));
|
|
23645
23698
|
}
|
|
23646
23699
|
|
|
23647
23700
|
// ../shared-contracts/dist/thread-watch-notice.js
|
|
@@ -24975,7 +25028,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
24975
25028
|
let disposed = false;
|
|
24976
25029
|
let inFlight = false;
|
|
24977
25030
|
let revision = 0;
|
|
24978
|
-
let
|
|
25031
|
+
let context = null;
|
|
24979
25032
|
let card = null;
|
|
24980
25033
|
let cardKey = null;
|
|
24981
25034
|
const unsupported = /* @__PURE__ */ new WeakSet();
|
|
@@ -24993,12 +25046,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
24993
25046
|
const refresh = async () => {
|
|
24994
25047
|
if (disposed) return;
|
|
24995
25048
|
const next = readContext();
|
|
24996
|
-
if (!same(
|
|
25049
|
+
if (!same(context, next)) {
|
|
24997
25050
|
clear();
|
|
24998
|
-
|
|
25051
|
+
context = next;
|
|
24999
25052
|
revision++;
|
|
25000
25053
|
}
|
|
25001
|
-
const current =
|
|
25054
|
+
const current = context;
|
|
25002
25055
|
if (!current || inFlight || unsupported.has(current.route)) return;
|
|
25003
25056
|
const startedRevision = revision;
|
|
25004
25057
|
inFlight = true;
|
|
@@ -25043,7 +25096,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25043
25096
|
);
|
|
25044
25097
|
threadQuestionRespondResultSchema.parse(raw2);
|
|
25045
25098
|
drafts.delete(key2);
|
|
25046
|
-
if (same(current,
|
|
25099
|
+
if (same(current, context)) {
|
|
25047
25100
|
revision++;
|
|
25048
25101
|
if (cardKey === key2) clear(false);
|
|
25049
25102
|
}
|
|
@@ -25053,7 +25106,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25053
25106
|
current.composer.before(card.root);
|
|
25054
25107
|
} catch (error62) {
|
|
25055
25108
|
if (isUnsupportedMethod(error62, THREAD_QUESTIONS_LIST_METHOD)) unsupported.add(current.route);
|
|
25056
|
-
if (revision === startedRevision && same(current,
|
|
25109
|
+
if (revision === startedRevision && same(current, context)) clear();
|
|
25057
25110
|
} finally {
|
|
25058
25111
|
inFlight = false;
|
|
25059
25112
|
}
|
|
@@ -25065,7 +25118,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25065
25118
|
return {
|
|
25066
25119
|
refresh,
|
|
25067
25120
|
refreshContext() {
|
|
25068
|
-
if (!same(
|
|
25121
|
+
if (!same(context, readContext()) || card && !card.root.isConnected) void refresh();
|
|
25069
25122
|
},
|
|
25070
25123
|
dispose() {
|
|
25071
25124
|
disposed = true;
|
|
@@ -25157,6 +25210,32 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25157
25210
|
return stack.length > 0 ? exhausted() : [];
|
|
25158
25211
|
}
|
|
25159
25212
|
|
|
25213
|
+
// ../desktop-control/dist/renderer-app-scope.js
|
|
25214
|
+
var record5 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
25215
|
+
function readRendererAppScope(root) {
|
|
25216
|
+
const scopes = /* @__PURE__ */ new Map();
|
|
25217
|
+
const seen = /* @__PURE__ */ new Set();
|
|
25218
|
+
for (const main of root.querySelectorAll("main")) {
|
|
25219
|
+
const keys = Object.getOwnPropertyNames(main).filter((key3) => key3.startsWith("__reactFiber$"));
|
|
25220
|
+
const key2 = keys[0];
|
|
25221
|
+
if (keys.length !== 1 || !key2)
|
|
25222
|
+
continue;
|
|
25223
|
+
for (const fiber of committedReactAncestors(Reflect.get(main, key2))) {
|
|
25224
|
+
if (seen.has(fiber))
|
|
25225
|
+
break;
|
|
25226
|
+
seen.add(fiber);
|
|
25227
|
+
let hook = fiber.memoizedState;
|
|
25228
|
+
for (let n = 0; record5(hook) && "next" in hook && n < 150; n++, hook = hook.next) {
|
|
25229
|
+
const handle = record5(hook.memoizedState) ? hook.memoizedState.current : null;
|
|
25230
|
+
if (!record5(handle) || !record5(handle.node) || handle.node.parent != null || !("chain" in handle) || !("scope" in handle) || typeof handle.get !== "function" || typeof handle.set !== "function" || typeof handle.watch !== "function" || !(handle.node.familyBindings instanceof Map))
|
|
25231
|
+
continue;
|
|
25232
|
+
scopes.set(handle.node, handle);
|
|
25233
|
+
}
|
|
25234
|
+
}
|
|
25235
|
+
}
|
|
25236
|
+
return scopes.size === 1 ? scopes.values().next().value ?? null : null;
|
|
25237
|
+
}
|
|
25238
|
+
|
|
25160
25239
|
// ../desktop-control/dist/renderer-native-schedule-sidebar.js
|
|
25161
25240
|
var NATIVE_SCHEDULE_SIDEBAR_ROW_SELECTOR = 'aside [data-sidebar-cycle-item][role="button"][aria-labelledby]';
|
|
25162
25241
|
function readNativeScheduleSidebarThread(element) {
|
|
@@ -25191,7 +25270,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25191
25270
|
}
|
|
25192
25271
|
|
|
25193
25272
|
// ../desktop-control/dist/renderer-scoped-draft-model.js
|
|
25194
|
-
function
|
|
25273
|
+
function record6(value) {
|
|
25195
25274
|
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
|
|
25196
25275
|
}
|
|
25197
25276
|
function isDraftId(value) {
|
|
@@ -25206,31 +25285,31 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25206
25285
|
if (!draftId || ids.length < 2 || ids.some((id2) => id2 !== draftId))
|
|
25207
25286
|
return [];
|
|
25208
25287
|
return [...new Set(row)].flatMap((value) => {
|
|
25209
|
-
const result =
|
|
25210
|
-
const draft =
|
|
25288
|
+
const result = record6(value);
|
|
25289
|
+
const draft = record6(result?.draftSettings);
|
|
25211
25290
|
const update = result?.updateDraftSettings;
|
|
25212
25291
|
return result?.isNewThreadDraft === true && draft && row.includes(draft) && typeof update === "function" && repeated(row, update) ? [{ draftId, draft, update }] : [];
|
|
25213
25292
|
});
|
|
25214
25293
|
}
|
|
25215
25294
|
function modelContexts(row) {
|
|
25216
25295
|
return [...new Set(row)].flatMap((value) => {
|
|
25217
|
-
const result =
|
|
25296
|
+
const result = record6(value);
|
|
25218
25297
|
const callback = result?.setModelAndReasoningEffort;
|
|
25219
25298
|
const usesAccountPreferences = result?.usesAccountPreferences;
|
|
25220
|
-
if (typeof callback !== "function" || !repeated(row, callback) || typeof usesAccountPreferences !== "boolean" || !row.some((
|
|
25299
|
+
if (typeof callback !== "function" || !repeated(row, callback) || typeof usesAccountPreferences !== "boolean" || !row.some((context) => context !== value && record6(context)?.usesAccountPreferences === usesAccountPreferences))
|
|
25221
25300
|
return [];
|
|
25222
|
-
return [{ row, usesAccountPreferences, settings:
|
|
25301
|
+
return [{ row, usesAccountPreferences, settings: record6(result?.modelSettings) }];
|
|
25223
25302
|
});
|
|
25224
25303
|
}
|
|
25225
25304
|
function collaborationMode(value) {
|
|
25226
|
-
const mode =
|
|
25227
|
-
const settings =
|
|
25305
|
+
const mode = record6(value);
|
|
25306
|
+
const settings = record6(mode?.settings);
|
|
25228
25307
|
return typeof mode?.mode === "string" && settings && typeof settings.model === "string" ? mode : null;
|
|
25229
25308
|
}
|
|
25230
25309
|
function activeModes(row) {
|
|
25231
25310
|
const modes = /* @__PURE__ */ new Set();
|
|
25232
25311
|
for (const value of row) {
|
|
25233
|
-
const mode = collaborationMode(
|
|
25312
|
+
const mode = collaborationMode(record6(value)?.activeMode);
|
|
25234
25313
|
if (mode && row.includes(mode) && row.includes(mode.settings))
|
|
25235
25314
|
modes.add(mode);
|
|
25236
25315
|
}
|
|
@@ -25240,7 +25319,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25240
25319
|
const modes = /* @__PURE__ */ new Set();
|
|
25241
25320
|
for (const row of rows) {
|
|
25242
25321
|
if (!row.includes(draftId) || row.some((value) => isDraftId(value) && value !== draftId) || !row.some((value) => {
|
|
25243
|
-
const result =
|
|
25322
|
+
const result = record6(value);
|
|
25244
25323
|
return typeof result?.handleSubmitLocal === "function" && typeof result.handleNewWorktreeConversation === "function";
|
|
25245
25324
|
}))
|
|
25246
25325
|
continue;
|
|
@@ -25267,7 +25346,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25267
25346
|
const submitModes = /* @__PURE__ */ new Set();
|
|
25268
25347
|
const owners = [];
|
|
25269
25348
|
for (const ancestor of committedReactAncestors(fiber)) {
|
|
25270
|
-
const data =
|
|
25349
|
+
const data = record6(record6(ancestor.updateQueue)?.memoCache)?.data;
|
|
25271
25350
|
if (!Array.isArray(data))
|
|
25272
25351
|
continue;
|
|
25273
25352
|
const rows = data.filter(Array.isArray);
|
|
@@ -25379,16 +25458,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25379
25458
|
}
|
|
25380
25459
|
|
|
25381
25460
|
// ../desktop-control/dist/renderer-native-schedule-form.js
|
|
25382
|
-
var
|
|
25461
|
+
var record7 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
25383
25462
|
function ancestors(element) {
|
|
25384
|
-
if (!
|
|
25463
|
+
if (!record7(element))
|
|
25385
25464
|
return [];
|
|
25386
25465
|
const key2 = Object.getOwnPropertyNames(element).find((name) => name.startsWith("__reactFiber$"));
|
|
25387
25466
|
return committedReactAncestors(key2 ? Object.getOwnPropertyDescriptor(element, key2)?.value : null);
|
|
25388
25467
|
}
|
|
25389
25468
|
function readNativeScheduleForm(form) {
|
|
25390
25469
|
const candidates = ancestors(form).flatMap(({ memoizedProps: props2 }) => {
|
|
25391
|
-
if (!
|
|
25470
|
+
if (!record7(props2) || !record7(props2.setup) || props2.setup.triggerMode !== "create" || !record7(props2.draft) || !record7(props2.draft.scheduleConfig) || typeof props2.draft.scheduleDirty !== "boolean" || typeof props2.draft.prompt !== "string" || props2.draft.id != null || !["heartbeat", "cron"].includes(String(props2.draft.kind)) || !["local", "cloud"].includes(String(props2.executionLocation)) || typeof props2.onChange !== "function" || typeof props2.onSubmit !== "function" || typeof props2.isSaving !== "boolean" || props2.draft.model !== null && typeof props2.draft.model !== "string" || props2.draft.reasoningEffort !== null && typeof props2.draft.reasoningEffort !== "string")
|
|
25392
25471
|
return [];
|
|
25393
25472
|
return [props2];
|
|
25394
25473
|
});
|
|
@@ -25397,7 +25476,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25397
25476
|
return null;
|
|
25398
25477
|
const draft = props.draft;
|
|
25399
25478
|
const change = props.onChange;
|
|
25400
|
-
const supportsExternal = props.executionLocation === "local" && draft.kind === "heartbeat" && draft.cloudTeam == null && (!
|
|
25479
|
+
const supportsExternal = props.executionLocation === "local" && draft.kind === "heartbeat" && draft.cloudTeam == null && (!record7(props.creation) || props.creation.type === "task") && (!record7(draft.eventTrigger) || draft.eventTrigger.selected !== true) && (!Array.isArray(draft.webhookTriggers) || draft.webhookTriggers.length === 0);
|
|
25401
25480
|
return {
|
|
25402
25481
|
selection: {
|
|
25403
25482
|
model: draft.model,
|
|
@@ -25428,11 +25507,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25428
25507
|
const node2 = fiber.stateNode;
|
|
25429
25508
|
if (node2 === form)
|
|
25430
25509
|
break;
|
|
25431
|
-
if (
|
|
25510
|
+
if (record7(node2) && node2.nodeType === 1 && typeof node2.hidden === "boolean" && record7(node2.style) && ["getPropertyValue", "getPropertyPriority", "setProperty"].every((method) => typeof node2.style[method] === "function") && form.contains(node2))
|
|
25432
25511
|
host = node2;
|
|
25433
25512
|
const props = fiber.memoizedProps;
|
|
25434
|
-
const label =
|
|
25435
|
-
if (
|
|
25513
|
+
const label = record7(props) && record7(props.label) ? props.label.props : null;
|
|
25514
|
+
if (record7(label) && ["inbox.automations.model.label", "automations.configuration.effort"].includes(String(label.id))) {
|
|
25436
25515
|
if (host)
|
|
25437
25516
|
rows.add(host);
|
|
25438
25517
|
break;
|
|
@@ -25444,14 +25523,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25444
25523
|
|
|
25445
25524
|
// ../desktop-control/dist/renderer-host-discovery.js
|
|
25446
25525
|
function requestManagerFromHookState(value, hostId2) {
|
|
25447
|
-
const
|
|
25526
|
+
const record19 = (candidate) => typeof candidate === "object" && candidate !== null;
|
|
25448
25527
|
const manager = (candidate) => {
|
|
25449
|
-
if (!
|
|
25528
|
+
if (!record19(candidate) || !record19(candidate.requestClient) || !record19(candidate.prewarmedThreadManager))
|
|
25450
25529
|
return null;
|
|
25451
25530
|
const bridge = candidate.requestClient;
|
|
25452
25531
|
return typeof candidate.sendRequest === "function" && typeof bridge.sendRequest === "function" && typeof bridge.prewarmThreadStart === "function" && typeof bridge.enqueueRequest === "function" && typeof candidate.prewarmedThreadManager.discardAllPrewarmedThreads === "function" ? candidate : null;
|
|
25453
25532
|
};
|
|
25454
|
-
if (!
|
|
25533
|
+
if (!record19(value))
|
|
25455
25534
|
return null;
|
|
25456
25535
|
const direct = manager(value) ?? manager(value.manager);
|
|
25457
25536
|
if (direct)
|
|
@@ -25514,20 +25593,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25514
25593
|
|
|
25515
25594
|
// ../desktop-control/dist/renderer-host-rpc-discovery.js
|
|
25516
25595
|
function findRendererHostRpcFamily(store) {
|
|
25517
|
-
const
|
|
25596
|
+
const record19 = (value) => typeof value === "object" && value !== null;
|
|
25518
25597
|
const families = /* @__PURE__ */ new Set();
|
|
25519
25598
|
for (const [definition, members2] of store.familyBindings) {
|
|
25520
|
-
if (!
|
|
25599
|
+
if (!record19(definition) || definition.kind !== "signal-family")
|
|
25521
25600
|
continue;
|
|
25522
|
-
if (!
|
|
25601
|
+
if (!record19(members2) || typeof members2.get !== "function")
|
|
25523
25602
|
continue;
|
|
25524
25603
|
for (const [hostId2, member] of members2) {
|
|
25525
25604
|
if (typeof hostId2 !== "string" || !/^(?:local$|durable$|remote[-:])/u.test(hostId2))
|
|
25526
25605
|
continue;
|
|
25527
|
-
if (!
|
|
25606
|
+
if (!record19(member))
|
|
25528
25607
|
continue;
|
|
25529
25608
|
const signal = member.value;
|
|
25530
|
-
if (!
|
|
25609
|
+
if (!record19(signal) || typeof signal.get !== "function")
|
|
25531
25610
|
continue;
|
|
25532
25611
|
let value;
|
|
25533
25612
|
try {
|
|
@@ -25535,7 +25614,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25535
25614
|
} catch {
|
|
25536
25615
|
continue;
|
|
25537
25616
|
}
|
|
25538
|
-
if (
|
|
25617
|
+
if (record19(value) && Object.keys(value).length === 2 && typeof value.status === "string" && record19(value.client) && value.client.hostId === hostId2 && "rpc" in value.client) {
|
|
25539
25618
|
families.add(members2);
|
|
25540
25619
|
break;
|
|
25541
25620
|
}
|
|
@@ -25548,9 +25627,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25548
25627
|
function resolveRendererHostRpc(discovery, hostId2) {
|
|
25549
25628
|
if (hostId2 === "durable")
|
|
25550
25629
|
return null;
|
|
25551
|
-
const
|
|
25630
|
+
const record19 = (value2) => typeof value2 === "object" && value2 !== null;
|
|
25552
25631
|
const signal = discovery.family.get(hostId2)?.value;
|
|
25553
|
-
if (!
|
|
25632
|
+
if (!record19(signal) || typeof signal.get !== "function")
|
|
25554
25633
|
return null;
|
|
25555
25634
|
let value;
|
|
25556
25635
|
try {
|
|
@@ -25558,43 +25637,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25558
25637
|
} catch {
|
|
25559
25638
|
return null;
|
|
25560
25639
|
}
|
|
25561
|
-
if (!
|
|
25640
|
+
if (!record19(value) || value.status !== "ready" || !record19(value.client) || value.client.hostId !== hostId2)
|
|
25562
25641
|
return null;
|
|
25563
25642
|
const rpc = value.client.rpc;
|
|
25564
|
-
return typeof rpc === "function" ||
|
|
25643
|
+
return typeof rpc === "function" || record19(rpc) ? rpc : null;
|
|
25565
25644
|
}
|
|
25566
25645
|
|
|
25567
25646
|
// ../desktop-control/dist/renderer-schedule-workspace-rpc.js
|
|
25568
|
-
var
|
|
25647
|
+
var record8 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
25569
25648
|
function localAppScope(root) {
|
|
25570
|
-
const
|
|
25571
|
-
|
|
25572
|
-
for (const main of root.querySelectorAll("main")) {
|
|
25573
|
-
const keys = Object.getOwnPropertyNames(main).filter((key3) => key3.startsWith("__reactFiber$"));
|
|
25574
|
-
const key2 = keys[0];
|
|
25575
|
-
if (keys.length !== 1 || !key2)
|
|
25576
|
-
continue;
|
|
25577
|
-
for (const fiber of committedReactAncestors(Reflect.get(main, key2))) {
|
|
25578
|
-
if (seen.has(fiber))
|
|
25579
|
-
break;
|
|
25580
|
-
seen.add(fiber);
|
|
25581
|
-
let hook = fiber.memoizedState;
|
|
25582
|
-
for (let n = 0; record7(hook) && "next" in hook && n < 150; n++, hook = hook.next) {
|
|
25583
|
-
const handle = record7(hook.memoizedState) ? hook.memoizedState.current : null;
|
|
25584
|
-
if (!record7(handle) || !record7(handle.node) || handle.node.parent != null || !("chain" in handle) || !("scope" in handle) || typeof handle.get !== "function" || typeof handle.set !== "function" || typeof handle.watch !== "function" || !(handle.node.familyBindings instanceof Map))
|
|
25585
|
-
continue;
|
|
25586
|
-
scopes.set(handle.node, { handle, store: handle.node });
|
|
25587
|
-
}
|
|
25588
|
-
}
|
|
25589
|
-
}
|
|
25590
|
-
const scope = scopes.values().next().value;
|
|
25591
|
-
if (scopes.size !== 1 || !scope)
|
|
25649
|
+
const handle = readRendererAppScope(root);
|
|
25650
|
+
if (!handle)
|
|
25592
25651
|
throw new Error("Native local app scope is missing or ambiguous");
|
|
25593
|
-
const discovery = findRendererHostRpcFamily(
|
|
25652
|
+
const discovery = findRendererHostRpcFamily(handle.node);
|
|
25594
25653
|
const rpc = discovery && resolveRendererHostRpc(discovery, "local");
|
|
25595
25654
|
if (!discovery || !rpc)
|
|
25596
25655
|
throw new Error("Native local app RPC is unavailable");
|
|
25597
|
-
return {
|
|
25656
|
+
return { handle, store: handle.node, discovery, rpc };
|
|
25598
25657
|
}
|
|
25599
25658
|
async function createRpcScheduleWorkspaceThread(root, routing, route, createThread, input3, signal) {
|
|
25600
25659
|
if (!route.policy.scopedCreation)
|
|
@@ -25614,11 +25673,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25614
25673
|
};
|
|
25615
25674
|
const readEmpty = async (threadId) => {
|
|
25616
25675
|
const read = await request("thread/read", { threadId, includeTurns: false });
|
|
25617
|
-
if (!
|
|
25676
|
+
if (!record8(read) || !record8(read.thread) || read.thread.id !== threadId || !record8(read.thread.status))
|
|
25618
25677
|
throw new Error("The created chat could not be read");
|
|
25619
25678
|
const turns = await request("thread/turns/list", { threadId, cursor: null, limit: 1 });
|
|
25620
25679
|
const queue = await request("thread/queue/list", { threadId, cursor: null, limit: 1 });
|
|
25621
|
-
if (!
|
|
25680
|
+
if (!record8(turns) || !Array.isArray(turns.data) || !("nextCursor" in turns) || !record8(queue) || !Array.isArray(queue.data) || !("nextCursor" in queue))
|
|
25622
25681
|
throw new Error("The created chat's history or queue could not be confirmed");
|
|
25623
25682
|
return {
|
|
25624
25683
|
thread: read.thread,
|
|
@@ -25648,7 +25707,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25648
25707
|
};
|
|
25649
25708
|
signal.addEventListener("abort", discardAfterDismissal, { once: true });
|
|
25650
25709
|
const remember = (result) => {
|
|
25651
|
-
if (!
|
|
25710
|
+
if (!record8(result) || result.status !== "created")
|
|
25652
25711
|
return;
|
|
25653
25712
|
const id2 = hostThreadIdSchema.safeParse(result.conversationId);
|
|
25654
25713
|
if (!id2.success)
|
|
@@ -25670,10 +25729,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25670
25729
|
assertRequestCurrent: assertCurrent,
|
|
25671
25730
|
onSettled: remember
|
|
25672
25731
|
});
|
|
25673
|
-
const result =
|
|
25732
|
+
const result = record8(output2) && output2.kind === "creation" ? output2.result : null;
|
|
25674
25733
|
remember(result);
|
|
25675
25734
|
assertCurrent();
|
|
25676
|
-
if (!
|
|
25735
|
+
if (!record8(result) || result.status !== "created" || !createdId || !record8(result.firstTurn) || result.firstTurn.status !== "not-requested")
|
|
25677
25736
|
throw new Error("Chat creation was not confirmed. Check the chat list before creating another task.");
|
|
25678
25737
|
const { thread: thread3, empty } = await readEmpty(createdId);
|
|
25679
25738
|
const inspection = threadInspectionSchema.parse(await request("codexhost/thread/inspect", { threadId: createdId }));
|
|
@@ -25700,13 +25759,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25700
25759
|
}
|
|
25701
25760
|
|
|
25702
25761
|
// ../desktop-control/dist/renderer-schedule-workspace.js
|
|
25703
|
-
var
|
|
25762
|
+
var record9 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
25704
25763
|
function readNativeScheduleWorkspaces(root) {
|
|
25705
25764
|
const projects = /* @__PURE__ */ new Map();
|
|
25706
25765
|
const ambiguous = /* @__PURE__ */ new Set();
|
|
25707
25766
|
const seen = /* @__PURE__ */ new Set();
|
|
25708
25767
|
const add = (value) => {
|
|
25709
|
-
if (!
|
|
25768
|
+
if (!record9(value) || value.source !== "codex" || !record9(value.group))
|
|
25710
25769
|
return;
|
|
25711
25770
|
const group = value.group;
|
|
25712
25771
|
if (group.projectKind !== "local" || group.hostId != null && group.hostId !== "local" || typeof group.projectId !== "string" || !group.projectId || typeof group.label !== "string" || typeof group.path !== "string" || !Array.isArray(group.rootPaths) || !group.rootPaths.includes(group.path) || !/^(?:\/|[A-Za-z]:[\\/]|\\\\)/u.test(group.path) || group.path.includes("\0"))
|
|
@@ -25728,7 +25787,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25728
25787
|
break;
|
|
25729
25788
|
seen.add(fiber);
|
|
25730
25789
|
const props = fiber.memoizedProps;
|
|
25731
|
-
if (!
|
|
25790
|
+
if (!record9(props))
|
|
25732
25791
|
continue;
|
|
25733
25792
|
add(props.project);
|
|
25734
25793
|
if (props.projectByKey instanceof Map)
|
|
@@ -25771,7 +25830,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25771
25830
|
}
|
|
25772
25831
|
}));
|
|
25773
25832
|
const scope = scopes.values().next().value;
|
|
25774
|
-
if (scopes.size !== 1 || !
|
|
25833
|
+
if (scopes.size !== 1 || !record9(scope) || typeof scope.get !== "function")
|
|
25775
25834
|
throw new Error("Native local chat scope is missing or ambiguous");
|
|
25776
25835
|
if (!readNativeScheduleWorkspaces(root).some(({ id: id2, cwd }) => id2 === input3.workspace.id && cwd === input3.workspace.cwd))
|
|
25777
25836
|
throw new Error("The selected workspace is no longer available");
|
|
@@ -25784,7 +25843,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25784
25843
|
const id2 = createdId;
|
|
25785
25844
|
released = true;
|
|
25786
25845
|
const conversation2 = manager.getConversation(id2);
|
|
25787
|
-
if (!
|
|
25846
|
+
if (!record9(conversation2) || !Array.isArray(conversation2.turns) || conversation2.turns.length || Array.isArray(conversation2.requests) && conversation2.requests.length > 0 || conversation2.pendingRequest != null)
|
|
25788
25847
|
return;
|
|
25789
25848
|
void Promise.resolve().then(() => manager.archiveConversation(id2, {
|
|
25790
25849
|
useAppServerPins: false,
|
|
@@ -25793,7 +25852,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25793
25852
|
};
|
|
25794
25853
|
signal.addEventListener("abort", discard, { once: true });
|
|
25795
25854
|
const remember = (result2) => {
|
|
25796
|
-
if (!
|
|
25855
|
+
if (!record9(result2) || result2.status !== "created")
|
|
25797
25856
|
return;
|
|
25798
25857
|
const id2 = hostThreadIdSchema.safeParse(result2.conversationId);
|
|
25799
25858
|
if (id2.success)
|
|
@@ -25810,16 +25869,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
25810
25869
|
startWithoutFirstTurn: true,
|
|
25811
25870
|
onSettled: remember
|
|
25812
25871
|
});
|
|
25813
|
-
const result =
|
|
25872
|
+
const result = record9(output2) && output2.kind === "creation" ? output2.result : null;
|
|
25814
25873
|
remember(result);
|
|
25815
25874
|
signal.throwIfAborted();
|
|
25816
|
-
if (!
|
|
25875
|
+
if (!record9(result) || result.status !== "created" || !createdId || !record9(result.firstTurn) || result.firstTurn.status !== "not-requested")
|
|
25817
25876
|
throw new Error("Chat creation was not confirmed. Check the chat list before creating another task.");
|
|
25818
25877
|
if (routing.forHost("local")?.manager !== route.manager)
|
|
25819
25878
|
throw new Error("The local connection changed. Reopen the task dialog.");
|
|
25820
25879
|
const conversation = manager.getConversation(createdId);
|
|
25821
|
-
const mode =
|
|
25822
|
-
if (!
|
|
25880
|
+
const mode = record9(conversation) ? conversation.latestCollaborationMode : null;
|
|
25881
|
+
if (!record9(conversation) || conversation.cwd !== input3.workspace.cwd || !record9(mode) || !record9(mode.settings) || mode.settings.model !== input3.model)
|
|
25823
25882
|
throw new Error("The created chat's workspace or Model could not be confirmed");
|
|
25824
25883
|
return {
|
|
25825
25884
|
threadId: createdId,
|
|
@@ -29842,8 +29901,8 @@ ${error62.stderrTail}`] : []
|
|
|
29842
29901
|
id: "connections",
|
|
29843
29902
|
label: messages.pageLabels.connections,
|
|
29844
29903
|
icon: "connections",
|
|
29845
|
-
mount(
|
|
29846
|
-
const document2 =
|
|
29904
|
+
mount(context) {
|
|
29905
|
+
const document2 = context.content.ownerDocument;
|
|
29847
29906
|
const header = document2.createElement("div");
|
|
29848
29907
|
header.className = "settings-connection-page-header";
|
|
29849
29908
|
const headingCopy = document2.createElement("div");
|
|
@@ -29865,7 +29924,7 @@ ${error62.stderrTail}`] : []
|
|
|
29865
29924
|
const syncMessage = document2.createElement("p");
|
|
29866
29925
|
syncMessage.className = "settings-page-description";
|
|
29867
29926
|
syncMessage.setAttribute("role", "status");
|
|
29868
|
-
|
|
29927
|
+
context.content.append(header, syncMessage, content);
|
|
29869
29928
|
let pending2 = false;
|
|
29870
29929
|
let selectedHostId = null;
|
|
29871
29930
|
let renderedHostId = null;
|
|
@@ -29879,12 +29938,12 @@ ${error62.stderrTail}`] : []
|
|
|
29879
29938
|
let renderQueued = false;
|
|
29880
29939
|
let renderFrame = null;
|
|
29881
29940
|
const scheduleRender = () => {
|
|
29882
|
-
if (disposed ||
|
|
29941
|
+
if (disposed || context.signal.aborted || renderQueued) return;
|
|
29883
29942
|
renderQueued = true;
|
|
29884
29943
|
const flush = () => {
|
|
29885
29944
|
renderFrame = null;
|
|
29886
29945
|
renderQueued = false;
|
|
29887
|
-
if (!disposed && !
|
|
29946
|
+
if (!disposed && !context.signal.aborted) {
|
|
29888
29947
|
render(diagnostics?.snapshot() ?? latestSnapshot);
|
|
29889
29948
|
}
|
|
29890
29949
|
};
|
|
@@ -29901,9 +29960,9 @@ ${error62.stderrTail}`] : []
|
|
|
29901
29960
|
};
|
|
29902
29961
|
const diagnostics = getDiagnostics();
|
|
29903
29962
|
const versions = createConnectionVersions(
|
|
29904
|
-
|
|
29963
|
+
context.content,
|
|
29905
29964
|
messages,
|
|
29906
|
-
|
|
29965
|
+
context.signal,
|
|
29907
29966
|
diagnostics,
|
|
29908
29967
|
scheduleRender
|
|
29909
29968
|
);
|
|
@@ -29911,7 +29970,7 @@ ${error62.stderrTail}`] : []
|
|
|
29911
29970
|
const updates = createConnectionUpdates(
|
|
29912
29971
|
document2,
|
|
29913
29972
|
messages,
|
|
29914
|
-
|
|
29973
|
+
context.signal,
|
|
29915
29974
|
scheduleRender,
|
|
29916
29975
|
diagnostics
|
|
29917
29976
|
);
|
|
@@ -30012,7 +30071,7 @@ ${error62.stderrTail}`] : []
|
|
|
30012
30071
|
createRendererSettingsIcon("diagnose", 16),
|
|
30013
30072
|
messages.connectionRefreshing
|
|
30014
30073
|
);
|
|
30015
|
-
void
|
|
30074
|
+
void context.runLatest(() => diagnostics.refresh(void 0, "retry"), {
|
|
30016
30075
|
success() {
|
|
30017
30076
|
installs?.clearErrors();
|
|
30018
30077
|
pending2 = false;
|
|
@@ -30376,9 +30435,9 @@ ${error62.stderrTail}`] : []
|
|
|
30376
30435
|
}
|
|
30377
30436
|
};
|
|
30378
30437
|
render(diagnostics?.snapshot() ?? null);
|
|
30379
|
-
void getRemoteConnections()?.ssh.list(
|
|
30438
|
+
void getRemoteConnections()?.ssh.list(context.signal).then(
|
|
30380
30439
|
(connections) => {
|
|
30381
|
-
if (
|
|
30440
|
+
if (context.signal.aborted) return;
|
|
30382
30441
|
for (const connection of connections) {
|
|
30383
30442
|
hostNames.set(connection.hostId, connection.displayName.trim());
|
|
30384
30443
|
}
|
|
@@ -34726,7 +34785,7 @@ ${messages.refreshModels}` : view.error ?? accessibleLabel;
|
|
|
34726
34785
|
}
|
|
34727
34786
|
|
|
34728
34787
|
// src/renderer-native-model-retry.ts
|
|
34729
|
-
function
|
|
34788
|
+
function record10(value) {
|
|
34730
34789
|
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
34731
34790
|
}
|
|
34732
34791
|
function containsMessage(children, id2) {
|
|
@@ -34737,7 +34796,7 @@ ${messages.refreshModels}` : view.error ?? accessibleLabel;
|
|
|
34737
34796
|
for (const item of child) pending2.push(item);
|
|
34738
34797
|
continue;
|
|
34739
34798
|
}
|
|
34740
|
-
const props =
|
|
34799
|
+
const props = record10(record10(child)?.props);
|
|
34741
34800
|
if (props?.id === id2) return true;
|
|
34742
34801
|
if (props?.children !== void 0) pending2.push(props.children);
|
|
34743
34802
|
}
|
|
@@ -34754,14 +34813,14 @@ ${messages.refreshModels}` : view.error ?? accessibleLabel;
|
|
|
34754
34813
|
Object.getOwnPropertyDescriptor(button2, fiberKey)?.value
|
|
34755
34814
|
);
|
|
34756
34815
|
const host = ancestors2[0];
|
|
34757
|
-
const props =
|
|
34758
|
-
const current =
|
|
34816
|
+
const props = record10(host?.memoizedProps);
|
|
34817
|
+
const current = record10(Object.getOwnPropertyDescriptor(button2, propsKey)?.value);
|
|
34759
34818
|
if (host?.stateNode !== button2 || props?.["data-composer-navigation-target"] !== "reasoning" || typeof props.onClick !== "function" || props.onClick !== current?.onClick || !containsMessage(props.children, "composer.modelPicker.retryModels"))
|
|
34760
34819
|
return false;
|
|
34761
34820
|
for (const owner of ancestors2.slice(1, 60)) {
|
|
34762
34821
|
if (owner.stateNode === composer) break;
|
|
34763
|
-
const tooltip =
|
|
34764
|
-
if (
|
|
34822
|
+
const tooltip = record10(owner.memoizedProps)?.content;
|
|
34823
|
+
if (record10(record10(tooltip)?.props)?.id === "composer.modelPicker.modelsUnavailable")
|
|
34765
34824
|
return true;
|
|
34766
34825
|
}
|
|
34767
34826
|
return false;
|
|
@@ -34976,8 +35035,8 @@ ${messages.refreshModels}` : view.error ?? accessibleLabel;
|
|
|
34976
35035
|
if (candidate) syncRendererModelTriggerClass(control.modelPicker);
|
|
34977
35036
|
}
|
|
34978
35037
|
function usagePlacementAnchor(control) {
|
|
34979
|
-
const
|
|
34980
|
-
const contextWrapper =
|
|
35038
|
+
const context = control.nativeContextUsageControl?.element;
|
|
35039
|
+
const contextWrapper = context?.parentElement;
|
|
34981
35040
|
if (contextWrapper?.parentElement) return contextWrapper;
|
|
34982
35041
|
const modelRoot = control.modelPicker?.root;
|
|
34983
35042
|
return modelRoot?.parentElement ? modelRoot : null;
|
|
@@ -37092,10 +37151,7 @@ ${messages.refreshModels}` : view.error ?? accessibleLabel;
|
|
|
37092
37151
|
const activeTurnSteers = /* @__PURE__ */ new Map();
|
|
37093
37152
|
const pending2 = /* @__PURE__ */ new Map();
|
|
37094
37153
|
let disposed = false;
|
|
37095
|
-
const
|
|
37096
|
-
if ((method === "turn/start" || method === "turn/steer") && prepareTurnInput) {
|
|
37097
|
-
params = prepareTurnInput(params);
|
|
37098
|
-
}
|
|
37154
|
+
const sendPrepared = function(method, params, options) {
|
|
37099
37155
|
const messageId = isRecord8(params) ? params.clientUserMessageId : null;
|
|
37100
37156
|
const route = typeof messageId === "string" && isRecord8(params) ? routes.get(`${params.threadId}\0${messageId}`) : void 0;
|
|
37101
37157
|
if (method !== "turn/start" || !isRecord8(params) || !route || route.threadId !== params.threadId) {
|
|
@@ -37145,6 +37201,9 @@ ${messages.refreshModels}` : view.error ?? accessibleLabel;
|
|
|
37145
37201
|
};
|
|
37146
37202
|
});
|
|
37147
37203
|
};
|
|
37204
|
+
const send = function(method, params, options) {
|
|
37205
|
+
return prepareTurnInput && (method === "turn/start" || method === "turn/steer") ? prepareTurnInput(params, (prepared) => sendPrepared(method, prepared, options)) : sendPrepared(method, params, options);
|
|
37206
|
+
};
|
|
37148
37207
|
const inspectDelivery = (threadId, text2) => inspectRendererSteeringDelivery(
|
|
37149
37208
|
(method, params) => originalSend.call(manager, method, params),
|
|
37150
37209
|
threadId,
|
|
@@ -37221,7 +37280,7 @@ ${messages.refreshModels}` : view.error ?? accessibleLabel;
|
|
|
37221
37280
|
if (expectedTurnId == null && host.hasPendingTurnStart(threadId)) {
|
|
37222
37281
|
throw new Error("Previous Turn submission has not been confirmed yet");
|
|
37223
37282
|
}
|
|
37224
|
-
const
|
|
37283
|
+
const context = restoreMessage.context;
|
|
37225
37284
|
const routeKey = `${threadId}\0${messageId}`;
|
|
37226
37285
|
if (typeof expectedTurnId === "string") routes.set(routeKey, { threadId, expectedTurnId });
|
|
37227
37286
|
const promise2 = Promise.resolve().then(async () => {
|
|
@@ -37241,12 +37300,12 @@ ${messages.refreshModels}` : view.error ?? accessibleLabel;
|
|
|
37241
37300
|
serviceTier,
|
|
37242
37301
|
model: null,
|
|
37243
37302
|
effort: null,
|
|
37244
|
-
collaborationMode:
|
|
37303
|
+
collaborationMode: context.collaborationMode ?? null
|
|
37245
37304
|
},
|
|
37246
37305
|
context: {
|
|
37247
37306
|
attachments: attachments ?? [],
|
|
37248
|
-
commentAttachments:
|
|
37249
|
-
mcpAppModelContextAttachments:
|
|
37307
|
+
commentAttachments: context.commentAttachments ?? [],
|
|
37308
|
+
mcpAppModelContextAttachments: context.mcpAppModelContextAttachments,
|
|
37250
37309
|
useAppServerPermissionDefault: true,
|
|
37251
37310
|
beforeSendRequest,
|
|
37252
37311
|
assertRequestCurrent
|
|
@@ -37430,10 +37489,10 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
37430
37489
|
}
|
|
37431
37490
|
|
|
37432
37491
|
// src/renderer-thread-reference-persistence.ts
|
|
37433
|
-
var
|
|
37492
|
+
var record11 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
37434
37493
|
var SYNC_TIMEOUT_MS = 2e3;
|
|
37435
37494
|
function restoreRpcThreadReferenceCapability(client, messages, isCurrent) {
|
|
37436
|
-
if (!
|
|
37495
|
+
if (!record11(messages) || !record11(messages.electronBridge)) return client;
|
|
37437
37496
|
const bridge = messages.electronBridge;
|
|
37438
37497
|
const send = bridge.sendMessageFromView;
|
|
37439
37498
|
if (typeof send !== "function") return client;
|
|
@@ -37448,7 +37507,7 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
37448
37507
|
const listener = (event) => {
|
|
37449
37508
|
if (event.source != null && event.source !== messages) return;
|
|
37450
37509
|
const message2 = event.data;
|
|
37451
|
-
if (!
|
|
37510
|
+
if (!record11(message2) || message2.type !== "persisted-atom-sync" || !record11(message2.state))
|
|
37452
37511
|
return;
|
|
37453
37512
|
finish(!Object.hasOwn(message2.state, key2));
|
|
37454
37513
|
};
|
|
@@ -37489,12 +37548,12 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
37489
37548
|
}
|
|
37490
37549
|
|
|
37491
37550
|
// src/renderer-thread-reference-capability.ts
|
|
37492
|
-
var
|
|
37551
|
+
var record12 = (value) => typeof value === "object" && value !== null;
|
|
37493
37552
|
function restoreThreadReferenceCapability(client, manager, isCurrent, messages = null) {
|
|
37494
|
-
if (
|
|
37553
|
+
if (record12(manager) && manager.kind === "main-process-rpc") {
|
|
37495
37554
|
return restoreRpcThreadReferenceCapability(client, messages, isCurrent);
|
|
37496
37555
|
}
|
|
37497
|
-
if (!
|
|
37556
|
+
if (!record12(manager) || !record12(manager.storage)) return client;
|
|
37498
37557
|
const storage = manager.storage;
|
|
37499
37558
|
const read = storage.readValue;
|
|
37500
37559
|
const write = storage.writeValue;
|
|
@@ -37529,21 +37588,56 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
37529
37588
|
}
|
|
37530
37589
|
|
|
37531
37590
|
// src/renderer-thread-reference-context.ts
|
|
37532
|
-
var
|
|
37533
|
-
function
|
|
37591
|
+
var record13 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
37592
|
+
function captureThreadReferenceGeneration(routing, hostId2) {
|
|
37593
|
+
const expected = routing?.connectionGeneration?.(hostId2);
|
|
37594
|
+
return () => {
|
|
37595
|
+
const current = routing?.connectionGeneration?.(hostId2);
|
|
37596
|
+
return expected !== null && current !== null && current?.owner === expected?.owner && current?.revision === expected?.revision;
|
|
37597
|
+
};
|
|
37598
|
+
}
|
|
37599
|
+
async function supportsThreadReferenceContext(send) {
|
|
37600
|
+
let timer;
|
|
37601
|
+
try {
|
|
37602
|
+
const result = await Promise.race([
|
|
37603
|
+
send(THREAD_REFERENCE_CONTEXT_CAPABILITY_METHOD, {}),
|
|
37604
|
+
new Promise((resolve) => {
|
|
37605
|
+
timer = setTimeout(() => resolve(null), 1500);
|
|
37606
|
+
})
|
|
37607
|
+
]);
|
|
37608
|
+
return record13(result) && result.threadReferenceContext === true;
|
|
37609
|
+
} catch {
|
|
37610
|
+
return false;
|
|
37611
|
+
} finally {
|
|
37612
|
+
clearTimeout(timer);
|
|
37613
|
+
}
|
|
37614
|
+
}
|
|
37615
|
+
function createThreadReferenceContext(manager, hostId2, isCurrent, readRouting) {
|
|
37534
37616
|
const prepared = /* @__PURE__ */ new WeakMap();
|
|
37535
|
-
return (params) => {
|
|
37536
|
-
if (hostId2 === "local" || !
|
|
37537
|
-
return params;
|
|
37617
|
+
return (params, send) => {
|
|
37618
|
+
if (hostId2 === "local" || !record13(manager) || typeof manager.getConversation !== "function" || !record13(params) || typeof params.threadId !== "string")
|
|
37619
|
+
return send(params);
|
|
37538
37620
|
const conversation = manager.getConversation.call(manager, params.threadId);
|
|
37539
|
-
if (!
|
|
37540
|
-
|
|
37621
|
+
if (!record13(conversation) || conversation.id !== params.threadId) return send(params);
|
|
37622
|
+
const external = conversation.modelProvider === "codexhost";
|
|
37623
|
+
if (!external && !isDesktopSshHostId(hostId2)) return send(params);
|
|
37624
|
+
const forward = (supported) => {
|
|
37625
|
+
if (!isCurrent()) throw new Error("Thread reference connection is no longer available");
|
|
37626
|
+
if (!supported) return send(params);
|
|
37627
|
+
let result = prepared.get(params);
|
|
37628
|
+
if (!result) {
|
|
37629
|
+
result = { ...params, [THREAD_REFERENCE_SOURCE_HOST_PARAM]: hostId2 };
|
|
37630
|
+
prepared.set(params, result);
|
|
37631
|
+
}
|
|
37632
|
+
return send(result);
|
|
37633
|
+
};
|
|
37634
|
+
const request = manager.sendRequest;
|
|
37635
|
+
if (external) return forward(true);
|
|
37541
37636
|
if (!isCurrent()) throw new Error("Thread reference connection is no longer available");
|
|
37542
|
-
const
|
|
37543
|
-
|
|
37544
|
-
|
|
37545
|
-
|
|
37546
|
-
return result;
|
|
37637
|
+
const isSameGeneration = captureThreadReferenceGeneration(readRouting?.(), hostId2);
|
|
37638
|
+
return typeof request === "function" ? supportsThreadReferenceContext(
|
|
37639
|
+
(method, input3) => request.call(manager, method, input3)
|
|
37640
|
+
).then((supported) => forward(supported && isSameGeneration())) : forward(false);
|
|
37547
37641
|
};
|
|
37548
37642
|
}
|
|
37549
37643
|
|
|
@@ -37671,7 +37765,8 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
37671
37765
|
createThreadReferenceContext(
|
|
37672
37766
|
target2,
|
|
37673
37767
|
route.hostId,
|
|
37674
|
-
() => !disposed && readRouting()?.forHost(route.hostId) === route
|
|
37768
|
+
() => !disposed && readRouting()?.forHost(route.hostId) === route,
|
|
37769
|
+
readRouting
|
|
37675
37770
|
)
|
|
37676
37771
|
),
|
|
37677
37772
|
() => installRendererManualCompaction(target2, route.hostId, messages)
|
|
@@ -40104,7 +40199,12 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
40104
40199
|
}
|
|
40105
40200
|
};
|
|
40106
40201
|
const track = (teardown) => {
|
|
40107
|
-
|
|
40202
|
+
try {
|
|
40203
|
+
guard();
|
|
40204
|
+
} catch (error62) {
|
|
40205
|
+
teardown();
|
|
40206
|
+
throw error62;
|
|
40207
|
+
}
|
|
40108
40208
|
teardowns.add(teardown);
|
|
40109
40209
|
return () => {
|
|
40110
40210
|
if (teardowns.delete(teardown)) teardown();
|
|
@@ -40153,7 +40253,20 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
40153
40253
|
watchTree(callback) {
|
|
40154
40254
|
guard();
|
|
40155
40255
|
return track(bridge.watchTree((snapshot) => delivery(callback, snapshot)));
|
|
40156
|
-
}
|
|
40256
|
+
},
|
|
40257
|
+
...bridge.watchUnread ? {
|
|
40258
|
+
watchUnread(threadIds, callback) {
|
|
40259
|
+
guard();
|
|
40260
|
+
if (!Array.isArray(threadIds) || threadIds.length > THREAD_TREE_MAX_NODES || threadIds.some((id3) => !hostThreadIdSchema.safeParse(id3).success))
|
|
40261
|
+
throw new Error("Invalid Desktop unread Thread ids");
|
|
40262
|
+
return track(
|
|
40263
|
+
bridge.watchUnread(
|
|
40264
|
+
[...new Set(threadIds)],
|
|
40265
|
+
(snapshot) => delivery(callback, Object.freeze({ ...snapshot }))
|
|
40266
|
+
)
|
|
40267
|
+
);
|
|
40268
|
+
}
|
|
40269
|
+
} : {}
|
|
40157
40270
|
},
|
|
40158
40271
|
navigate: {
|
|
40159
40272
|
async openThread(threadId) {
|
|
@@ -40493,11 +40606,11 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
40493
40606
|
}
|
|
40494
40607
|
};
|
|
40495
40608
|
const registerSettingsPage = (extensionId, page) => {
|
|
40496
|
-
const
|
|
40497
|
-
customSettingsPages.set(extensionId,
|
|
40609
|
+
const record19 = { page, revision: ++settingsPageRevision };
|
|
40610
|
+
customSettingsPages.set(extensionId, record19);
|
|
40498
40611
|
notifySettingsPages();
|
|
40499
40612
|
return () => {
|
|
40500
|
-
if (customSettingsPages.get(extensionId) !==
|
|
40613
|
+
if (customSettingsPages.get(extensionId) !== record19) return;
|
|
40501
40614
|
customSettingsPages.delete(extensionId);
|
|
40502
40615
|
notifySettingsPages();
|
|
40503
40616
|
};
|
|
@@ -40643,15 +40756,15 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
40643
40756
|
const getRegisteredSettingsPages = () => {
|
|
40644
40757
|
const pages = [];
|
|
40645
40758
|
const seen = /* @__PURE__ */ new Set();
|
|
40646
|
-
for (const [extensionId,
|
|
40759
|
+
for (const [extensionId, record19] of customSettingsPages) {
|
|
40647
40760
|
const instance = instances.get(extensionId);
|
|
40648
|
-
const title =
|
|
40761
|
+
const title = record19.page.title ?? instance?.name;
|
|
40649
40762
|
pages.push({
|
|
40650
40763
|
extensionId,
|
|
40651
40764
|
kind: "custom",
|
|
40652
|
-
revision:
|
|
40765
|
+
revision: record19.revision,
|
|
40653
40766
|
...title !== void 0 ? { title } : {},
|
|
40654
|
-
page:
|
|
40767
|
+
page: record19.page
|
|
40655
40768
|
});
|
|
40656
40769
|
seen.add(extensionId);
|
|
40657
40770
|
}
|
|
@@ -41815,15 +41928,15 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
41815
41928
|
id: pageId,
|
|
41816
41929
|
label: label.slice(0, 64),
|
|
41817
41930
|
icon: icon2 && isRendererSettingsIconName(icon2) ? icon2 : "extensions",
|
|
41818
|
-
mount(
|
|
41931
|
+
mount(context) {
|
|
41819
41932
|
const container = createEl(
|
|
41820
|
-
|
|
41933
|
+
context.content.ownerDocument,
|
|
41821
41934
|
"div",
|
|
41822
41935
|
"settings-extension-plugin-page"
|
|
41823
41936
|
);
|
|
41824
41937
|
container.dataset.extensionId = extensionId;
|
|
41825
41938
|
container.dataset.settingsMode = "custom";
|
|
41826
|
-
|
|
41939
|
+
context.content.append(container);
|
|
41827
41940
|
const cleanup = contribution.mount(container, {
|
|
41828
41941
|
locale: messages.locale,
|
|
41829
41942
|
storage: services.storage,
|
|
@@ -43388,8 +43501,8 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
43388
43501
|
id: "usage-statistics",
|
|
43389
43502
|
label: messages.label,
|
|
43390
43503
|
icon: "dashboard",
|
|
43391
|
-
mount(
|
|
43392
|
-
const document2 =
|
|
43504
|
+
mount(context) {
|
|
43505
|
+
const document2 = context.content.ownerDocument;
|
|
43393
43506
|
const locale = pageLocale ?? (document2.documentElement.lang || "en");
|
|
43394
43507
|
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
43395
43508
|
const count3 = (value) => count2(value, locale);
|
|
@@ -43447,7 +43560,7 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
43447
43560
|
document2,
|
|
43448
43561
|
consoleMessages2,
|
|
43449
43562
|
(method, params2) => request(method, params2, view.hostId),
|
|
43450
|
-
|
|
43563
|
+
context.signal,
|
|
43451
43564
|
load
|
|
43452
43565
|
);
|
|
43453
43566
|
let offeredHosts = usageHosts ? [] : void 0;
|
|
@@ -43455,7 +43568,7 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
43455
43568
|
label: messages.host,
|
|
43456
43569
|
searchLabel: messages.search,
|
|
43457
43570
|
emptyLabel: messages.noMatches,
|
|
43458
|
-
signal:
|
|
43571
|
+
signal: context.signal,
|
|
43459
43572
|
searchable: false,
|
|
43460
43573
|
display: (option) => `${messages.host} \xB7 ${option.label}`,
|
|
43461
43574
|
onChange: (key2) => {
|
|
@@ -43485,7 +43598,7 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
43485
43598
|
const offerHosts = () => {
|
|
43486
43599
|
if (!usageHosts) return;
|
|
43487
43600
|
void usageHosts().then((hosts) => {
|
|
43488
|
-
if (
|
|
43601
|
+
if (context.signal.aborted) return;
|
|
43489
43602
|
offeredHosts = hosts;
|
|
43490
43603
|
hostOptions();
|
|
43491
43604
|
}).catch(() => void 0);
|
|
@@ -43511,7 +43624,7 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
43511
43624
|
label: messages.autoRefresh,
|
|
43512
43625
|
searchLabel: messages.search,
|
|
43513
43626
|
emptyLabel: messages.noMatches,
|
|
43514
|
-
signal:
|
|
43627
|
+
signal: context.signal,
|
|
43515
43628
|
searchable: false,
|
|
43516
43629
|
display: (option) => `${messages.autoRefresh} \xB7 ${option.label}`,
|
|
43517
43630
|
onChange: (key2) => {
|
|
@@ -43556,7 +43669,7 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
43556
43669
|
label: messages.filterModel,
|
|
43557
43670
|
searchLabel: messages.search,
|
|
43558
43671
|
emptyLabel: messages.noMatches,
|
|
43559
|
-
signal:
|
|
43672
|
+
signal: context.signal,
|
|
43560
43673
|
onChange: (key2) => {
|
|
43561
43674
|
view.model = key2;
|
|
43562
43675
|
changed();
|
|
@@ -43566,7 +43679,7 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
43566
43679
|
label: messages.filterProject,
|
|
43567
43680
|
searchLabel: messages.search,
|
|
43568
43681
|
emptyLabel: messages.noMatches,
|
|
43569
|
-
signal:
|
|
43682
|
+
signal: context.signal,
|
|
43570
43683
|
onChange: (key2) => {
|
|
43571
43684
|
view.project = key2;
|
|
43572
43685
|
changed();
|
|
@@ -44354,7 +44467,7 @@ ${detail}` : ""}`
|
|
|
44354
44467
|
}
|
|
44355
44468
|
function schedule() {
|
|
44356
44469
|
window.clearTimeout(poll);
|
|
44357
|
-
if (
|
|
44470
|
+
if (context.signal.aborted) return;
|
|
44358
44471
|
if (result && !result.reading.complete) poll = window.setTimeout(load, POLL_MS);
|
|
44359
44472
|
else if (view.autoRefreshMs > 0) poll = window.setTimeout(load, view.autoRefreshMs);
|
|
44360
44473
|
}
|
|
@@ -44372,12 +44485,12 @@ ${detail}` : ""}`
|
|
|
44372
44485
|
} catch {
|
|
44373
44486
|
if (!isCurrent()) return;
|
|
44374
44487
|
}
|
|
44375
|
-
if (!
|
|
44488
|
+
if (!context.signal.aborted) render();
|
|
44376
44489
|
}
|
|
44377
44490
|
function load() {
|
|
44378
44491
|
window.clearTimeout(poll);
|
|
44379
44492
|
const requested = params();
|
|
44380
|
-
void
|
|
44493
|
+
void context.runLatest(() => request(USAGE_STATISTICS_METHOD, requested, view.hostId), {
|
|
44381
44494
|
success(value) {
|
|
44382
44495
|
const parsed = usageStatisticsResultSchema.safeParse(value);
|
|
44383
44496
|
if (parsed.success) {
|
|
@@ -44400,7 +44513,7 @@ ${detail}` : ""}`
|
|
|
44400
44513
|
}
|
|
44401
44514
|
});
|
|
44402
44515
|
}
|
|
44403
|
-
|
|
44516
|
+
context.content.replaceChildren(header, prices.element, filters, notices, body);
|
|
44404
44517
|
render();
|
|
44405
44518
|
offerHosts();
|
|
44406
44519
|
void refreshHarnessNames();
|
|
@@ -46299,8 +46412,8 @@ ${detail}` : ""}`
|
|
|
46299
46412
|
id: "session-import",
|
|
46300
46413
|
label: messages.pageLabels["session-import"],
|
|
46301
46414
|
icon: "session-import",
|
|
46302
|
-
mount(
|
|
46303
|
-
const document2 =
|
|
46415
|
+
mount(context) {
|
|
46416
|
+
const document2 = context.content.ownerDocument;
|
|
46304
46417
|
const header = document2.createElement("div");
|
|
46305
46418
|
header.className = "settings-session-import-header";
|
|
46306
46419
|
const heading = document2.createElement("h2");
|
|
@@ -46420,7 +46533,7 @@ ${detail}` : ""}`
|
|
|
46420
46533
|
const content = document2.createElement("section");
|
|
46421
46534
|
content.className = "settings-session-import-content";
|
|
46422
46535
|
const listControls = createSessionImportListControls(document2, messages, () => load());
|
|
46423
|
-
|
|
46536
|
+
context.content.append(
|
|
46424
46537
|
header,
|
|
46425
46538
|
hostLabel,
|
|
46426
46539
|
harness2,
|
|
@@ -46553,7 +46666,7 @@ ${detail}` : ""}`
|
|
|
46553
46666
|
retry.addEventListener("click", () => {
|
|
46554
46667
|
if (retry.disabled) return;
|
|
46555
46668
|
setRetrying(true);
|
|
46556
|
-
void
|
|
46669
|
+
void context.runLatest((signal) => openImportedThread(threadId, signal, hostId2), {
|
|
46557
46670
|
success() {
|
|
46558
46671
|
setRetrying(false);
|
|
46559
46672
|
},
|
|
@@ -46644,7 +46757,7 @@ ${detail}` : ""}`
|
|
|
46644
46757
|
refresh.disabled = true;
|
|
46645
46758
|
updateImportActions();
|
|
46646
46759
|
let committedThreadId = null;
|
|
46647
|
-
void
|
|
46760
|
+
void context.runLatest(
|
|
46648
46761
|
async (signal) => {
|
|
46649
46762
|
importStatus.replaceChildren();
|
|
46650
46763
|
const result = await client.importHarnessSession({
|
|
@@ -46688,7 +46801,7 @@ ${detail}` : ""}`
|
|
|
46688
46801
|
updateImportActions();
|
|
46689
46802
|
};
|
|
46690
46803
|
const load = (refreshDiagnostics = false) => {
|
|
46691
|
-
if (importingId !== null ||
|
|
46804
|
+
if (importingId !== null || context.signal.aborted) return;
|
|
46692
46805
|
loadedClient = null;
|
|
46693
46806
|
let client = getClient(selectedHostId);
|
|
46694
46807
|
if (client?.hostId === "durable") {
|
|
@@ -46704,7 +46817,7 @@ ${detail}` : ""}`
|
|
|
46704
46817
|
else renderUnavailable();
|
|
46705
46818
|
const requestedHarness = selectedHarness;
|
|
46706
46819
|
const pageParams = listControls.params();
|
|
46707
|
-
void
|
|
46820
|
+
void context.runLatest(
|
|
46708
46821
|
async (signal) => {
|
|
46709
46822
|
if (!client) throw new RendererSessionImportUnavailableError();
|
|
46710
46823
|
const harnesses = await loadSessionImportSources(
|
|
@@ -46770,8 +46883,8 @@ ${detail}` : ""}`
|
|
|
46770
46883
|
}
|
|
46771
46884
|
|
|
46772
46885
|
// src/settings/loaded-sessions-table.ts
|
|
46773
|
-
function mountLoadedSessionsTable(
|
|
46774
|
-
const document2 =
|
|
46886
|
+
function mountLoadedSessionsTable(context, messages, getClient) {
|
|
46887
|
+
const document2 = context.content.ownerDocument;
|
|
46775
46888
|
const owner = document2.defaultView;
|
|
46776
46889
|
if (!owner) return () => void 0;
|
|
46777
46890
|
const text2 = messages.loadedSessions;
|
|
@@ -46807,7 +46920,7 @@ ${detail}` : ""}`
|
|
|
46807
46920
|
scroll.hidden = true;
|
|
46808
46921
|
header.append(title, description);
|
|
46809
46922
|
container.append(header, status, scroll);
|
|
46810
|
-
|
|
46923
|
+
context.content.append(container);
|
|
46811
46924
|
let disposed = false;
|
|
46812
46925
|
let timer;
|
|
46813
46926
|
let requestTimer;
|
|
@@ -46829,7 +46942,7 @@ ${detail}` : ""}`
|
|
|
46829
46942
|
);
|
|
46830
46943
|
})
|
|
46831
46944
|
]);
|
|
46832
|
-
if (disposed ||
|
|
46945
|
+
if (disposed || context.signal.aborted) return;
|
|
46833
46946
|
body.replaceChildren();
|
|
46834
46947
|
for (const row of rows.toSorted(
|
|
46835
46948
|
(a, b) => b.inactiveMs - a.inactiveMs || a.harnessId.localeCompare(b.harnessId) || a.threadId.localeCompare(b.threadId)
|
|
@@ -46853,13 +46966,13 @@ ${detail}` : ""}`
|
|
|
46853
46966
|
status.hidden = rows.length > 0;
|
|
46854
46967
|
scroll.hidden = rows.length === 0;
|
|
46855
46968
|
} catch (error62) {
|
|
46856
|
-
if (disposed ||
|
|
46969
|
+
if (disposed || context.signal.aborted) return;
|
|
46857
46970
|
status.textContent = error62 instanceof RendererMethodUnavailableError ? text2.unavailable : text2.failed;
|
|
46858
46971
|
status.hidden = false;
|
|
46859
46972
|
scroll.hidden = true;
|
|
46860
46973
|
} finally {
|
|
46861
46974
|
owner.clearTimeout(requestTimer);
|
|
46862
|
-
if (!disposed && !
|
|
46975
|
+
if (!disposed && !context.signal.aborted)
|
|
46863
46976
|
timer = owner.setTimeout(() => void refresh(), 1e4);
|
|
46864
46977
|
}
|
|
46865
46978
|
};
|
|
@@ -46872,8 +46985,8 @@ ${detail}` : ""}`
|
|
|
46872
46985
|
}
|
|
46873
46986
|
|
|
46874
46987
|
// src/settings/idle-release-controls.ts
|
|
46875
|
-
function mountIdleReleaseControls(
|
|
46876
|
-
const { content } =
|
|
46988
|
+
function mountIdleReleaseControls(context, messages, getLoadedSessionsClient) {
|
|
46989
|
+
const { content } = context;
|
|
46877
46990
|
const document2 = content.ownerDocument;
|
|
46878
46991
|
const owner = document2.defaultView;
|
|
46879
46992
|
if (!owner) return () => void 0;
|
|
@@ -46915,7 +47028,7 @@ ${detail}` : ""}`
|
|
|
46915
47028
|
card.append(toggle.item, timeout.item);
|
|
46916
47029
|
content.append(group);
|
|
46917
47030
|
const disposeTable = mountLoadedSessionsTable(
|
|
46918
|
-
{ ...
|
|
47031
|
+
{ ...context, content: card },
|
|
46919
47032
|
messages,
|
|
46920
47033
|
getLoadedSessionsClient
|
|
46921
47034
|
);
|
|
@@ -46982,8 +47095,8 @@ ${detail}` : ""}`
|
|
|
46982
47095
|
id: "appearance",
|
|
46983
47096
|
label: messages.pageLabels.appearance,
|
|
46984
47097
|
icon: "settings",
|
|
46985
|
-
mount(
|
|
46986
|
-
const document2 =
|
|
47098
|
+
mount(context) {
|
|
47099
|
+
const document2 = context.content.ownerDocument;
|
|
46987
47100
|
const ownerWindow = document2.defaultView;
|
|
46988
47101
|
if (!ownerWindow) return;
|
|
46989
47102
|
const heading = document2.createElement("div");
|
|
@@ -47010,9 +47123,9 @@ ${detail}` : ""}`
|
|
|
47010
47123
|
ownerWindow.addEventListener(REASONING_SOFT_WRAP_CHANGE_EVENT, sync);
|
|
47011
47124
|
row.item.append(toggle);
|
|
47012
47125
|
card.append(row.item);
|
|
47013
|
-
|
|
47126
|
+
context.content.append(heading, description, group);
|
|
47014
47127
|
const disposeIdleRelease = mountIdleReleaseControls(
|
|
47015
|
-
|
|
47128
|
+
context,
|
|
47016
47129
|
messages,
|
|
47017
47130
|
getLoadedSessionsClient
|
|
47018
47131
|
);
|
|
@@ -49883,8 +49996,8 @@ ${detail}` : ""}`
|
|
|
49883
49996
|
id: "desktop-extensions",
|
|
49884
49997
|
label: messages.pageLabels["desktop-extensions"],
|
|
49885
49998
|
icon: "extensions",
|
|
49886
|
-
mount(
|
|
49887
|
-
const document2 =
|
|
49999
|
+
mount(context) {
|
|
50000
|
+
const document2 = context.content.ownerDocument;
|
|
49888
50001
|
const ownerWindow = document2.defaultView;
|
|
49889
50002
|
const root = createEl(document2, "div", "settings-extensions");
|
|
49890
50003
|
const listViewWrap = createEl(document2, "div", "settings-extensions__list-view");
|
|
@@ -50143,7 +50256,7 @@ ${detail}` : ""}`
|
|
|
50143
50256
|
const body = createEl(document2, "div", "settings-extensions__body");
|
|
50144
50257
|
listViewWrap.append(header, stickyBar, banner, diagnosticsPanel, body);
|
|
50145
50258
|
root.append(listViewWrap, pageViewHost);
|
|
50146
|
-
|
|
50259
|
+
context.content.append(root);
|
|
50147
50260
|
const initialHasCatalog = typeof resolveAvailableClient(getClient)?.listHostExtensionCatalog === "function";
|
|
50148
50261
|
let disposed = false;
|
|
50149
50262
|
let moreMenuOpen = false;
|
|
@@ -50210,7 +50323,7 @@ ${detail}` : ""}`
|
|
|
50210
50323
|
const pageHost = createDesktopExtensionPageHost({
|
|
50211
50324
|
document: document2,
|
|
50212
50325
|
host: pageViewHost,
|
|
50213
|
-
signal:
|
|
50326
|
+
signal: context.signal,
|
|
50214
50327
|
messages,
|
|
50215
50328
|
getClient: () => resolveAvailableClient(getClient),
|
|
50216
50329
|
getContentLocale: resolveContentLocale,
|
|
@@ -50221,13 +50334,13 @@ ${detail}` : ""}`
|
|
|
50221
50334
|
}
|
|
50222
50335
|
});
|
|
50223
50336
|
const openExtensionPage = (item) => {
|
|
50224
|
-
if (disposed ||
|
|
50337
|
+
if (disposed || context.signal.aborted || !item.enabled || !item.manifest.page) return;
|
|
50225
50338
|
closeHeaderMenus();
|
|
50226
50339
|
detailModal.close();
|
|
50227
50340
|
importModal.close();
|
|
50228
50341
|
createModal.close();
|
|
50229
50342
|
const pageId = pluginPages?.getPageIdForExtension(item.id);
|
|
50230
|
-
if (pageId &&
|
|
50343
|
+
if (pageId && context.navigateToPage?.(pageId)) return;
|
|
50231
50344
|
const catalogEntry = catalogById.get(item.id);
|
|
50232
50345
|
listViewWrap.hidden = true;
|
|
50233
50346
|
pageViewHost.hidden = false;
|
|
@@ -50251,7 +50364,7 @@ ${detail}` : ""}`
|
|
|
50251
50364
|
const detailModal = createDesktopExtensionDetailModal({
|
|
50252
50365
|
document: document2,
|
|
50253
50366
|
host: root,
|
|
50254
|
-
signal:
|
|
50367
|
+
signal: context.signal,
|
|
50255
50368
|
messages,
|
|
50256
50369
|
catalogIconLoader,
|
|
50257
50370
|
assetClient: {
|
|
@@ -50289,9 +50402,9 @@ ${detail}` : ""}`
|
|
|
50289
50402
|
onOpenPage: (item) => {
|
|
50290
50403
|
openExtensionPage(item);
|
|
50291
50404
|
},
|
|
50292
|
-
onOpenSettings: pluginPages &&
|
|
50405
|
+
onOpenSettings: pluginPages && context.navigateToPage ? (extensionId) => {
|
|
50293
50406
|
const pageId = pluginPages.getPageIdForExtension(extensionId);
|
|
50294
|
-
if (pageId)
|
|
50407
|
+
if (pageId) context.navigateToPage?.(pageId);
|
|
50295
50408
|
} : void 0,
|
|
50296
50409
|
onClose: () => {
|
|
50297
50410
|
modalFeedback = null;
|
|
@@ -50300,14 +50413,14 @@ ${detail}` : ""}`
|
|
|
50300
50413
|
const createModal = createDesktopExtensionCreateModal({
|
|
50301
50414
|
document: document2,
|
|
50302
50415
|
host: root,
|
|
50303
|
-
signal:
|
|
50416
|
+
signal: context.signal,
|
|
50304
50417
|
messages,
|
|
50305
50418
|
getCopy: () => contentLocaleMessages(resolveContentLocale())
|
|
50306
50419
|
});
|
|
50307
50420
|
const importModal = createDesktopExtensionImportModal({
|
|
50308
50421
|
document: document2,
|
|
50309
50422
|
host: root,
|
|
50310
|
-
signal:
|
|
50423
|
+
signal: context.signal,
|
|
50311
50424
|
messages,
|
|
50312
50425
|
onImport: async (source) => {
|
|
50313
50426
|
await importExtension(source);
|
|
@@ -50495,7 +50608,7 @@ ${detail}` : ""}`
|
|
|
50495
50608
|
if (filterMenuOpen) setFilterMenuOpen(false);
|
|
50496
50609
|
};
|
|
50497
50610
|
const openDetailModal = (extensionId) => {
|
|
50498
|
-
if (disposed ||
|
|
50611
|
+
if (disposed || context.signal.aborted || activeRecoveryDialog || importModal.isOpen) {
|
|
50499
50612
|
return;
|
|
50500
50613
|
}
|
|
50501
50614
|
closeHeaderMenus();
|
|
@@ -50849,9 +50962,9 @@ ${detail}` : ""}`
|
|
|
50849
50962
|
};
|
|
50850
50963
|
const schedulePoll = () => {
|
|
50851
50964
|
clearPollTimer();
|
|
50852
|
-
if (disposed ||
|
|
50965
|
+
if (disposed || context.signal.aborted || document2.visibilityState === "hidden") return;
|
|
50853
50966
|
pollTimer = setTimeout(() => {
|
|
50854
|
-
if (disposed ||
|
|
50967
|
+
if (disposed || context.signal.aborted || hasPendingMutations() || loading || activeRecoveryDialog || importModal.isOpen) {
|
|
50855
50968
|
schedulePoll();
|
|
50856
50969
|
return;
|
|
50857
50970
|
}
|
|
@@ -50876,7 +50989,7 @@ ${detail}` : ""}`
|
|
|
50876
50989
|
const token = ++listApplyToken;
|
|
50877
50990
|
try {
|
|
50878
50991
|
const refreshed = await client.listHostExtensions();
|
|
50879
|
-
if (disposed ||
|
|
50992
|
+
if (disposed || context.signal.aborted) return;
|
|
50880
50993
|
applyLoadedList(refreshed, token);
|
|
50881
50994
|
} catch {
|
|
50882
50995
|
}
|
|
@@ -50901,7 +51014,7 @@ ${detail}` : ""}`
|
|
|
50901
51014
|
}
|
|
50902
51015
|
const listHostExtensions = client.listHostExtensions.bind(client);
|
|
50903
51016
|
const token = ++listApplyToken;
|
|
50904
|
-
await
|
|
51017
|
+
await context.runLatest(async () => listHostExtensions(), {
|
|
50905
51018
|
success(result) {
|
|
50906
51019
|
loading = false;
|
|
50907
51020
|
unavailable = false;
|
|
@@ -50958,7 +51071,7 @@ ${detail}` : ""}`
|
|
|
50958
51071
|
try {
|
|
50959
51072
|
const params = forceRefresh ? { forceRefresh: true } : {};
|
|
50960
51073
|
const result = await client.listHostExtensionCatalog(params);
|
|
50961
|
-
if (disposed ||
|
|
51074
|
+
if (disposed || context.signal.aborted || token !== catalogRequestToken) return;
|
|
50962
51075
|
catalogLoading = false;
|
|
50963
51076
|
catalogUnavailable = false;
|
|
50964
51077
|
catalogError = null;
|
|
@@ -50966,7 +51079,7 @@ ${detail}` : ""}`
|
|
|
50966
51079
|
catalogById = new Map(result.extensions.map((entry) => [entry.id, entry]));
|
|
50967
51080
|
render();
|
|
50968
51081
|
} catch (error62) {
|
|
50969
|
-
if (disposed ||
|
|
51082
|
+
if (disposed || context.signal.aborted || token !== catalogRequestToken) return;
|
|
50970
51083
|
catalogLoading = false;
|
|
50971
51084
|
if (error62 instanceof RendererMethodUnavailableError) {
|
|
50972
51085
|
catalogUnavailable = true;
|
|
@@ -50987,7 +51100,7 @@ ${detail}` : ""}`
|
|
|
50987
51100
|
}
|
|
50988
51101
|
};
|
|
50989
51102
|
const installFromCatalog = async (entry, isUpdate) => {
|
|
50990
|
-
if (recovering || pendingMutations.has(entry.id) || disposed ||
|
|
51103
|
+
if (recovering || pendingMutations.has(entry.id) || disposed || context.signal.aborted)
|
|
50991
51104
|
return;
|
|
50992
51105
|
const client = resolveAvailableClient(getClient);
|
|
50993
51106
|
const installedItem = listing?.extensions.find((item) => item.id === entry.id);
|
|
@@ -51015,7 +51128,7 @@ ${detail}` : ""}`
|
|
|
51015
51128
|
} else {
|
|
51016
51129
|
return;
|
|
51017
51130
|
}
|
|
51018
|
-
if (disposed ||
|
|
51131
|
+
if (disposed || context.signal.aborted) return;
|
|
51019
51132
|
const displayName = result.manifest.name[messages.locale] || result.manifest.name.en || fallbackName;
|
|
51020
51133
|
const modalTargetId = detailModal.extensionId === entry.id ? entry.id : null;
|
|
51021
51134
|
setFeedback(
|
|
@@ -51030,7 +51143,7 @@ ${detail}` : ""}`
|
|
|
51030
51143
|
);
|
|
51031
51144
|
await refreshInstalledAfterMutation();
|
|
51032
51145
|
} catch (error62) {
|
|
51033
|
-
if (disposed ||
|
|
51146
|
+
if (disposed || context.signal.aborted) return;
|
|
51034
51147
|
const modalTargetId = detailModal.extensionId === entry.id ? entry.id : null;
|
|
51035
51148
|
setFeedback(
|
|
51036
51149
|
{
|
|
@@ -51041,7 +51154,7 @@ ${detail}` : ""}`
|
|
|
51041
51154
|
);
|
|
51042
51155
|
} finally {
|
|
51043
51156
|
pendingMutations.delete(entry.id);
|
|
51044
|
-
if (!disposed && !
|
|
51157
|
+
if (!disposed && !context.signal.aborted) {
|
|
51045
51158
|
render();
|
|
51046
51159
|
if (!hasPendingMutations()) schedulePoll();
|
|
51047
51160
|
}
|
|
@@ -51059,7 +51172,7 @@ ${detail}` : ""}`
|
|
|
51059
51172
|
syncToolbarState();
|
|
51060
51173
|
try {
|
|
51061
51174
|
const result = await install2({ source });
|
|
51062
|
-
if (disposed ||
|
|
51175
|
+
if (disposed || context.signal.aborted) return;
|
|
51063
51176
|
activeView = "installed";
|
|
51064
51177
|
selectedCapability = "all";
|
|
51065
51178
|
searchQuery = "";
|
|
@@ -51076,14 +51189,14 @@ ${detail}` : ""}`
|
|
|
51076
51189
|
await refreshInstalledAfterMutation();
|
|
51077
51190
|
} finally {
|
|
51078
51191
|
importing = false;
|
|
51079
|
-
if (!disposed && !
|
|
51192
|
+
if (!disposed && !context.signal.aborted) {
|
|
51080
51193
|
render();
|
|
51081
51194
|
if (!hasPendingMutations()) schedulePoll();
|
|
51082
51195
|
}
|
|
51083
51196
|
}
|
|
51084
51197
|
};
|
|
51085
51198
|
const uninstallExtension = async (item) => {
|
|
51086
|
-
if (recovering || pendingMutations.has(item.id) || disposed ||
|
|
51199
|
+
if (recovering || pendingMutations.has(item.id) || disposed || context.signal.aborted)
|
|
51087
51200
|
return;
|
|
51088
51201
|
const client = resolveAvailableClient(getClient);
|
|
51089
51202
|
const uninstall = client?.uninstallHostExtension?.bind(client);
|
|
@@ -51097,7 +51210,7 @@ ${detail}` : ""}`
|
|
|
51097
51210
|
id: item.id,
|
|
51098
51211
|
...item.state === "valid" ? { expectedDigest: item.digest } : {}
|
|
51099
51212
|
});
|
|
51100
|
-
if (disposed ||
|
|
51213
|
+
if (disposed || context.signal.aborted) return;
|
|
51101
51214
|
if (pageHost.extensionId === item.id) {
|
|
51102
51215
|
pageHost.close();
|
|
51103
51216
|
}
|
|
@@ -51110,7 +51223,7 @@ ${detail}` : ""}`
|
|
|
51110
51223
|
});
|
|
51111
51224
|
await refreshInstalledAfterMutation();
|
|
51112
51225
|
} catch (error62) {
|
|
51113
|
-
if (disposed ||
|
|
51226
|
+
if (disposed || context.signal.aborted) return;
|
|
51114
51227
|
const modalTargetId = detailModal.extensionId === item.id ? item.id : null;
|
|
51115
51228
|
setFeedback(
|
|
51116
51229
|
{
|
|
@@ -51121,14 +51234,14 @@ ${detail}` : ""}`
|
|
|
51121
51234
|
);
|
|
51122
51235
|
} finally {
|
|
51123
51236
|
pendingMutations.delete(item.id);
|
|
51124
|
-
if (!disposed && !
|
|
51237
|
+
if (!disposed && !context.signal.aborted) {
|
|
51125
51238
|
render();
|
|
51126
51239
|
if (!hasPendingMutations()) schedulePoll();
|
|
51127
51240
|
}
|
|
51128
51241
|
}
|
|
51129
51242
|
};
|
|
51130
51243
|
const toggleExtension = async (item, enable) => {
|
|
51131
|
-
if (recovering || pendingMutations.has(item.id) || disposed ||
|
|
51244
|
+
if (recovering || pendingMutations.has(item.id) || disposed || context.signal.aborted)
|
|
51132
51245
|
return;
|
|
51133
51246
|
const client = resolveAvailableClient(getClient);
|
|
51134
51247
|
const mutate = enable ? client?.enableHostExtension?.bind(client) : client?.disableHostExtension?.bind(client);
|
|
@@ -51143,10 +51256,10 @@ ${detail}` : ""}`
|
|
|
51143
51256
|
render();
|
|
51144
51257
|
let shouldReload = false;
|
|
51145
51258
|
const runQueued = toggleQueue.then(async () => {
|
|
51146
|
-
if (disposed ||
|
|
51259
|
+
if (disposed || context.signal.aborted) return;
|
|
51147
51260
|
const expectedRevision2 = listing?.configuration.revision ?? 0;
|
|
51148
51261
|
const result = await mutate({ id: item.id, expectedRevision: expectedRevision2 });
|
|
51149
|
-
if (disposed ||
|
|
51262
|
+
if (disposed || context.signal.aborted) return;
|
|
51150
51263
|
const modalTargetId = detailModal.extensionId === item.id ? item.id : null;
|
|
51151
51264
|
if (result.state === "saved") {
|
|
51152
51265
|
if (!enable && pageHost.extensionId === item.id) {
|
|
@@ -51198,7 +51311,7 @@ ${detail}` : ""}`
|
|
|
51198
51311
|
try {
|
|
51199
51312
|
await runQueued;
|
|
51200
51313
|
} catch (error62) {
|
|
51201
|
-
if (disposed ||
|
|
51314
|
+
if (disposed || context.signal.aborted) return;
|
|
51202
51315
|
if (error62 instanceof RendererMethodUnavailableError) {
|
|
51203
51316
|
unavailable = true;
|
|
51204
51317
|
listing = null;
|
|
@@ -51215,7 +51328,7 @@ ${detail}` : ""}`
|
|
|
51215
51328
|
);
|
|
51216
51329
|
} finally {
|
|
51217
51330
|
pendingMutations.delete(item.id);
|
|
51218
|
-
if (!disposed && !
|
|
51331
|
+
if (!disposed && !context.signal.aborted) {
|
|
51219
51332
|
render();
|
|
51220
51333
|
if (shouldReload) {
|
|
51221
51334
|
await loadInstalled({ silent: true, keepFeedback: true });
|
|
@@ -51226,7 +51339,7 @@ ${detail}` : ""}`
|
|
|
51226
51339
|
}
|
|
51227
51340
|
};
|
|
51228
51341
|
const openRecoveryDialog = () => {
|
|
51229
|
-
if (disposed ||
|
|
51342
|
+
if (disposed || context.signal.aborted || hasPendingMutations() || activeRecoveryDialog)
|
|
51230
51343
|
return;
|
|
51231
51344
|
const client = resolveAvailableClient(getClient);
|
|
51232
51345
|
if (!client?.recoverHostExtensions) return;
|
|
@@ -51272,7 +51385,7 @@ ${detail}` : ""}`
|
|
|
51272
51385
|
modal.setAttribute("aria-busy", String(next));
|
|
51273
51386
|
};
|
|
51274
51387
|
const cleanupDialog = () => {
|
|
51275
|
-
|
|
51388
|
+
context.signal.removeEventListener("abort", cleanupDialog);
|
|
51276
51389
|
if (activeRecoveryDialog === modal) activeRecoveryDialog = null;
|
|
51277
51390
|
modal.remove();
|
|
51278
51391
|
};
|
|
@@ -51283,7 +51396,7 @@ ${detail}` : ""}`
|
|
|
51283
51396
|
if (dialogBusy) event.preventDefault();
|
|
51284
51397
|
});
|
|
51285
51398
|
modal.addEventListener("close", cleanupDialog);
|
|
51286
|
-
|
|
51399
|
+
context.signal.addEventListener("abort", cleanupDialog, { once: true });
|
|
51287
51400
|
form.addEventListener("submit", (event) => {
|
|
51288
51401
|
event.preventDefault();
|
|
51289
51402
|
if (dialogBusy || hasPendingMutations()) return;
|
|
@@ -51301,7 +51414,7 @@ ${detail}` : ""}`
|
|
|
51301
51414
|
render();
|
|
51302
51415
|
const params = listing !== null ? { expectedRevision: listing.configuration.revision } : {};
|
|
51303
51416
|
void recover(params).then(async (result) => {
|
|
51304
|
-
if (disposed ||
|
|
51417
|
+
if (disposed || context.signal.aborted) return;
|
|
51305
51418
|
if (result.state === "saved") {
|
|
51306
51419
|
pageHost.close();
|
|
51307
51420
|
if (listing) {
|
|
@@ -51347,7 +51460,7 @@ ${detail}` : ""}`
|
|
|
51347
51460
|
render();
|
|
51348
51461
|
schedulePoll();
|
|
51349
51462
|
}).catch((error62) => {
|
|
51350
|
-
if (disposed ||
|
|
51463
|
+
if (disposed || context.signal.aborted) return;
|
|
51351
51464
|
recovering = false;
|
|
51352
51465
|
setDialogBusy(false);
|
|
51353
51466
|
render();
|
|
@@ -51382,7 +51495,7 @@ ${detail}` : ""}`
|
|
|
51382
51495
|
};
|
|
51383
51496
|
const onVisibilityChange = () => {
|
|
51384
51497
|
if (document2.visibilityState === "hidden") clearPollTimer();
|
|
51385
|
-
else if (!disposed && !
|
|
51498
|
+
else if (!disposed && !context.signal.aborted && !hasPendingMutations() && !loading && !activeRecoveryDialog && !importModal.isOpen) {
|
|
51386
51499
|
void loadInstalled({ silent: true });
|
|
51387
51500
|
}
|
|
51388
51501
|
};
|
|
@@ -51456,12 +51569,12 @@ ${detail}` : ""}`
|
|
|
51456
51569
|
}
|
|
51457
51570
|
void clipboard.writeText(EXTENSIONS_ROOT_DISPLAY).then(
|
|
51458
51571
|
() => {
|
|
51459
|
-
if (!disposed && !
|
|
51572
|
+
if (!disposed && !context.signal.aborted) {
|
|
51460
51573
|
setFeedback({ tone: "success", text: copy.copiedDirectoryPath });
|
|
51461
51574
|
}
|
|
51462
51575
|
},
|
|
51463
51576
|
() => {
|
|
51464
|
-
if (!disposed && !
|
|
51577
|
+
if (!disposed && !context.signal.aborted) {
|
|
51465
51578
|
setFeedback({ tone: "danger", text: copy.copyPathFailed });
|
|
51466
51579
|
}
|
|
51467
51580
|
}
|
|
@@ -51507,7 +51620,7 @@ ${detail}` : ""}`
|
|
|
51507
51620
|
}
|
|
51508
51621
|
});
|
|
51509
51622
|
const unsubscribePluginPages = pluginPages?.subscribe(() => {
|
|
51510
|
-
if (!disposed && !
|
|
51623
|
+
if (!disposed && !context.signal.aborted) {
|
|
51511
51624
|
detailModal.sync(buildDetailModalState());
|
|
51512
51625
|
}
|
|
51513
51626
|
}) ?? null;
|
|
@@ -52152,7 +52265,7 @@ ${detail}` : ""}`
|
|
|
52152
52265
|
}
|
|
52153
52266
|
function defaultImportName(source, existing) {
|
|
52154
52267
|
const base = source.provider === "openai-codex" ? "codex" : "grok";
|
|
52155
|
-
const used = new Set(existing.map((
|
|
52268
|
+
const used = new Set(existing.map((record19) => record19.name));
|
|
52156
52269
|
const valid = (name) => credentialImportNameSchema.safeParse(name).success;
|
|
52157
52270
|
if (!used.has(base)) return base;
|
|
52158
52271
|
const local = source.label.includes("@") ? source.label.split("@")[0] ?? "" : "";
|
|
@@ -52175,7 +52288,7 @@ ${detail}` : ""}`
|
|
|
52175
52288
|
const shown = (text2) => accountDisplayText(text2, hideEmails);
|
|
52176
52289
|
const targetButtons = /* @__PURE__ */ new Map();
|
|
52177
52290
|
const importedRecords = () => snapshot.targets.find((target2) => target2.harnessId === TARGET_HARNESS_ID)?.imports ?? [];
|
|
52178
|
-
const sourceOf = (
|
|
52291
|
+
const sourceOf = (record19) => snapshot.sources.find((source) => source.id === record19.source.id);
|
|
52179
52292
|
const piTarget = () => snapshot.targets.find((candidate) => candidate.harnessId === TARGET_HARNESS_ID);
|
|
52180
52293
|
const compatibleSources = () => {
|
|
52181
52294
|
const target2 = piTarget();
|
|
@@ -52213,7 +52326,7 @@ ${detail}` : ""}`
|
|
|
52213
52326
|
sectionImport.addEventListener("click", () => {
|
|
52214
52327
|
const sources = compatibleSources();
|
|
52215
52328
|
const free = sources.find(
|
|
52216
|
-
(source2) => !importedRecords().some((
|
|
52329
|
+
(source2) => !importedRecords().some((record19) => record19.source.id === source2.id)
|
|
52217
52330
|
);
|
|
52218
52331
|
const source = free ?? sources[0];
|
|
52219
52332
|
if (source) openDialog("add", { source, choose: true }, SECTION_IMPORT_KEY);
|
|
@@ -52263,30 +52376,30 @@ ${detail}` : ""}`
|
|
|
52263
52376
|
mark.append(createRendererAgentIcon(agent ?? "pi", 26, document2, pluginFor(agent ?? "pi")));
|
|
52264
52377
|
return mark;
|
|
52265
52378
|
};
|
|
52266
|
-
const renderRow = (
|
|
52379
|
+
const renderRow = (record19) => {
|
|
52267
52380
|
const row = document2.createElement("div");
|
|
52268
52381
|
row.className = "settings-pi-accounts__row";
|
|
52269
52382
|
row.tabIndex = -1;
|
|
52270
|
-
row.dataset.importName =
|
|
52271
|
-
row.setAttribute("aria-label", shown(
|
|
52272
|
-
const agent =
|
|
52383
|
+
row.dataset.importName = record19.name;
|
|
52384
|
+
row.setAttribute("aria-label", shown(record19.source.label));
|
|
52385
|
+
const agent = record19.source.harnessId;
|
|
52273
52386
|
const mark = createMark(agent);
|
|
52274
52387
|
const identity3 = document2.createElement("div");
|
|
52275
52388
|
identity3.className = "settings-pi-accounts__identity";
|
|
52276
52389
|
const label = document2.createElement("strong");
|
|
52277
52390
|
label.className = "settings-account-email";
|
|
52278
|
-
label.textContent = shown(
|
|
52391
|
+
label.textContent = shown(record19.source.label);
|
|
52279
52392
|
label.title = label.textContent;
|
|
52280
52393
|
label.translate = false;
|
|
52281
52394
|
const meta3 = document2.createElement("div");
|
|
52282
52395
|
meta3.className = "settings-account-metadata";
|
|
52283
|
-
const source = sourceOf(
|
|
52396
|
+
const source = sourceOf(record19);
|
|
52284
52397
|
const parts = [
|
|
52285
52398
|
metaPart(rendererAgentLabel(agent, pluginFor(agent)), "settings-pi-accounts__agent"),
|
|
52286
|
-
metaPart(`${
|
|
52399
|
+
metaPart(`${record19.name}/\u2026`, void 0, true),
|
|
52287
52400
|
metaPart(messages.copied)
|
|
52288
52401
|
];
|
|
52289
|
-
const time3 = formatImportedAt(
|
|
52402
|
+
const time3 = formatImportedAt(record19.importedAt);
|
|
52290
52403
|
if (time3) parts.push(metaPart(time3));
|
|
52291
52404
|
parts.forEach((part, index) => {
|
|
52292
52405
|
if (index > 0) {
|
|
@@ -52303,23 +52416,23 @@ ${detail}` : ""}`
|
|
|
52303
52416
|
reimport.type = "button";
|
|
52304
52417
|
reimport.className = "settings-account-action";
|
|
52305
52418
|
reimport.textContent = messages.rowReimport;
|
|
52306
|
-
reimport.setAttribute("aria-label", `${messages.reimport}: ${shown(
|
|
52419
|
+
reimport.setAttribute("aria-label", `${messages.reimport}: ${shown(record19.source.label)}`);
|
|
52307
52420
|
reimport.disabled = busy || !source;
|
|
52308
52421
|
reimport.title = messages.reimport;
|
|
52309
52422
|
reimport.addEventListener("click", () => {
|
|
52310
|
-
if (source) openDialog("reimport", { source, record:
|
|
52423
|
+
if (source) openDialog("reimport", { source, record: record19 }, `row:${record19.name}`);
|
|
52311
52424
|
});
|
|
52312
52425
|
const remove = document2.createElement("button");
|
|
52313
52426
|
remove.type = "button";
|
|
52314
52427
|
remove.className = "settings-account-action settings-pi-accounts__remove";
|
|
52315
52428
|
remove.textContent = messages.rowRemove;
|
|
52316
|
-
remove.setAttribute("aria-label", `${messages.remove}: ${shown(
|
|
52429
|
+
remove.setAttribute("aria-label", `${messages.remove}: ${shown(record19.source.label)}`);
|
|
52317
52430
|
remove.disabled = busy;
|
|
52318
|
-
remove.addEventListener("click", () => openDialog("remove", { record:
|
|
52431
|
+
remove.addEventListener("click", () => openDialog("remove", { record: record19 }, `row:${record19.name}`));
|
|
52319
52432
|
if (source) actions.append(reimport);
|
|
52320
52433
|
actions.append(remove);
|
|
52321
52434
|
row.append(mark, identity3, actions);
|
|
52322
|
-
rows.set(
|
|
52435
|
+
rows.set(record19.name, row);
|
|
52323
52436
|
return row;
|
|
52324
52437
|
};
|
|
52325
52438
|
const loginTypeLabel = (type) => type === "oauth" ? messages.typeOauth : type === "api_key" ? messages.typeApiKey : messages.typeOther;
|
|
@@ -52472,7 +52585,7 @@ ${detail}` : ""}`
|
|
|
52472
52585
|
const label = document2.createElement("strong");
|
|
52473
52586
|
label.textContent = shown(choice.label);
|
|
52474
52587
|
label.translate = false;
|
|
52475
|
-
const existing = importedRecords().find((
|
|
52588
|
+
const existing = importedRecords().find((record19) => record19.source.id === choice.id);
|
|
52476
52589
|
const agent = choice.harnessId;
|
|
52477
52590
|
const detail = document2.createElement("span");
|
|
52478
52591
|
detail.textContent = [
|
|
@@ -52513,7 +52626,7 @@ ${detail}` : ""}`
|
|
|
52513
52626
|
const name = request.action === "list" ? void 0 : request.name;
|
|
52514
52627
|
state = {
|
|
52515
52628
|
source: state.source,
|
|
52516
|
-
record: importedRecords().find((
|
|
52629
|
+
record: importedRecords().find((record19) => record19.name === name) ?? state.record
|
|
52517
52630
|
};
|
|
52518
52631
|
show(next);
|
|
52519
52632
|
} else {
|
|
@@ -52527,12 +52640,12 @@ ${detail}` : ""}`
|
|
|
52527
52640
|
sourceRadios = [];
|
|
52528
52641
|
body.replaceChildren();
|
|
52529
52642
|
controls.replaceChildren();
|
|
52530
|
-
const { source, record:
|
|
52643
|
+
const { source, record: record19 } = state;
|
|
52531
52644
|
const close = () => modal.close();
|
|
52532
52645
|
if (mode === "add" || mode === "reimport") {
|
|
52533
52646
|
title.textContent = mode === "add" ? messages.add : messages.reimport;
|
|
52534
52647
|
modal.setAttribute("aria-label", title.textContent);
|
|
52535
|
-
const active2 = source ??
|
|
52648
|
+
const active2 = source ?? record19?.source;
|
|
52536
52649
|
const choices = mode === "add" && state.choose ? compatibleSources() : [];
|
|
52537
52650
|
if (choices.length > 1) body.append(sourcePicker(choices));
|
|
52538
52651
|
else if (active2) body.append(line(messages.source, shown(active2.label)));
|
|
@@ -52541,8 +52654,8 @@ ${detail}` : ""}`
|
|
|
52541
52654
|
input3.maxLength = 48;
|
|
52542
52655
|
input3.autocomplete = "off";
|
|
52543
52656
|
input3.spellcheck = false;
|
|
52544
|
-
input3.value =
|
|
52545
|
-
input3.readOnly = Boolean(
|
|
52657
|
+
input3.value = record19?.name ?? (source ? defaultImportName(source, importedRecords()) : "codex");
|
|
52658
|
+
input3.readOnly = Boolean(record19);
|
|
52546
52659
|
input3.addEventListener("input", () => {
|
|
52547
52660
|
nameEdited = true;
|
|
52548
52661
|
});
|
|
@@ -52576,7 +52689,7 @@ ${detail}` : ""}`
|
|
|
52576
52689
|
{
|
|
52577
52690
|
action: mode === "reimport" ? "reimport" : "import",
|
|
52578
52691
|
sourceId: source2.id,
|
|
52579
|
-
name:
|
|
52692
|
+
name: record19?.name ?? input3.value,
|
|
52580
52693
|
confirmed: true
|
|
52581
52694
|
},
|
|
52582
52695
|
"done"
|
|
@@ -52586,16 +52699,16 @@ ${detail}` : ""}`
|
|
|
52586
52699
|
)
|
|
52587
52700
|
);
|
|
52588
52701
|
(mode === "add" ? input3 : controls.children[0]).focus();
|
|
52589
|
-
} else if (mode === "remove" &&
|
|
52702
|
+
} else if (mode === "remove" && record19) {
|
|
52590
52703
|
title.textContent = messages.remove;
|
|
52591
52704
|
modal.setAttribute("aria-label", title.textContent);
|
|
52592
|
-
body.append(note(messages.removeWarning.replace("{name}",
|
|
52705
|
+
body.append(note(messages.removeWarning.replace("{name}", record19.name)));
|
|
52593
52706
|
const cancel = command(messages.cancel, close);
|
|
52594
52707
|
controls.append(
|
|
52595
52708
|
cancel,
|
|
52596
52709
|
command(
|
|
52597
52710
|
messages.remove,
|
|
52598
|
-
() => submit({ action: "remove", name:
|
|
52711
|
+
() => submit({ action: "remove", name: record19.name, confirmed: true }, null),
|
|
52599
52712
|
"danger"
|
|
52600
52713
|
)
|
|
52601
52714
|
);
|
|
@@ -52603,7 +52716,7 @@ ${detail}` : ""}`
|
|
|
52603
52716
|
} else {
|
|
52604
52717
|
title.textContent = messages.doneTitle;
|
|
52605
52718
|
modal.setAttribute("aria-label", title.textContent);
|
|
52606
|
-
const name =
|
|
52719
|
+
const name = record19?.name;
|
|
52607
52720
|
if (name) body.append(line(messages.entry, `${name}/\u2026`, true));
|
|
52608
52721
|
body.append(note(messages.done));
|
|
52609
52722
|
const done = command(messages.close, close, "primary");
|
|
@@ -52650,21 +52763,21 @@ ${detail}` : ""}`
|
|
|
52650
52763
|
(candidate) => candidate.harnessId === TARGET_HARNESS_ID && source && candidate.providers.includes(source.provider)
|
|
52651
52764
|
);
|
|
52652
52765
|
if (!source || !target2) return null;
|
|
52653
|
-
const
|
|
52766
|
+
const record19 = target2.imports.find((candidate) => candidate.source.id === source.id);
|
|
52654
52767
|
const key2 = `${harnessId}:${accountLabel}:import`;
|
|
52655
52768
|
const button2 = document2.createElement("button");
|
|
52656
52769
|
button2.type = "button";
|
|
52657
52770
|
button2.className = "settings-account-pi-import";
|
|
52658
52771
|
button2.dataset.accountFocus = key2;
|
|
52659
52772
|
button2.disabled = busy;
|
|
52660
|
-
const hint =
|
|
52773
|
+
const hint = record19 ? messages.importedHint.replace("{name}", record19.name) : messages.add;
|
|
52661
52774
|
button2.title = hint;
|
|
52662
52775
|
button2.setAttribute("aria-label", hint);
|
|
52663
52776
|
button2.append(createRendererAgentIcon("pi", 12, document2, pluginFor("pi")));
|
|
52664
|
-
if (
|
|
52777
|
+
if (record19) {
|
|
52665
52778
|
button2.dataset.state = "imported";
|
|
52666
52779
|
const name = document2.createElement("code");
|
|
52667
|
-
name.textContent = `${
|
|
52780
|
+
name.textContent = `${record19.name}/\u2026`;
|
|
52668
52781
|
name.translate = false;
|
|
52669
52782
|
button2.append(name, createRendererSettingsIcon("check", 12));
|
|
52670
52783
|
} else {
|
|
@@ -52672,7 +52785,7 @@ ${detail}` : ""}`
|
|
|
52672
52785
|
button2.append(messages.add);
|
|
52673
52786
|
}
|
|
52674
52787
|
button2.addEventListener("click", () => {
|
|
52675
|
-
if (!
|
|
52788
|
+
if (!record19) {
|
|
52676
52789
|
openDialog("add", { source }, key2);
|
|
52677
52790
|
return;
|
|
52678
52791
|
}
|
|
@@ -52681,7 +52794,7 @@ ${detail}` : ""}`
|
|
|
52681
52794
|
renderSection();
|
|
52682
52795
|
sectionToggle.setAttribute("aria-expanded", "true");
|
|
52683
52796
|
}
|
|
52684
|
-
const row = rows.get(
|
|
52797
|
+
const row = rows.get(record19.name);
|
|
52685
52798
|
row?.scrollIntoView({ block: "nearest", behavior: "smooth" });
|
|
52686
52799
|
row?.focus();
|
|
52687
52800
|
});
|
|
@@ -53384,8 +53497,8 @@ ${detail}` : ""}`
|
|
|
53384
53497
|
id: "accounts",
|
|
53385
53498
|
label: messages.pageLabels.accounts,
|
|
53386
53499
|
icon: "accounts",
|
|
53387
|
-
mount(
|
|
53388
|
-
const document2 =
|
|
53500
|
+
mount(context) {
|
|
53501
|
+
const document2 = context.content.ownerDocument;
|
|
53389
53502
|
const header = document2.createElement("div");
|
|
53390
53503
|
header.className = "settings-account-header";
|
|
53391
53504
|
const copy = document2.createElement("div");
|
|
@@ -53470,15 +53583,15 @@ ${detail}` : ""}`
|
|
|
53470
53583
|
let plugins = [];
|
|
53471
53584
|
const pluginFor = (id2) => plugins.find((plugin) => plugin.id === id2);
|
|
53472
53585
|
const credentialImports = mountCredentialImports(
|
|
53473
|
-
|
|
53474
|
-
|
|
53586
|
+
context.content,
|
|
53587
|
+
context.signal,
|
|
53475
53588
|
getClient,
|
|
53476
53589
|
messages.credentialImports,
|
|
53477
53590
|
() => render(),
|
|
53478
53591
|
pluginFor
|
|
53479
53592
|
);
|
|
53480
|
-
|
|
53481
|
-
const stopCountdowns = mountAccountResetCountdowns(list, messages,
|
|
53593
|
+
context.content.append(header, status, toolbar, list, credentialImports.section);
|
|
53594
|
+
const stopCountdowns = mountAccountResetCountdowns(list, messages, context.signal);
|
|
53482
53595
|
let accounts = [];
|
|
53483
53596
|
let currentAccountId = null;
|
|
53484
53597
|
let accountPhase = "unavailable";
|
|
@@ -53584,7 +53697,7 @@ ${detail}` : ""}`
|
|
|
53584
53697
|
requests.map(async ({ account, loading }) => {
|
|
53585
53698
|
try {
|
|
53586
53699
|
const result = await inspect({ accountId: account.accountId });
|
|
53587
|
-
if (
|
|
53700
|
+
if (context.signal.aborted || usageByAccountId.get(account.accountId) !== loading)
|
|
53588
53701
|
return;
|
|
53589
53702
|
usageByAccountId.set(
|
|
53590
53703
|
account.accountId,
|
|
@@ -53596,7 +53709,7 @@ ${detail}` : ""}`
|
|
|
53596
53709
|
} : { status: "empty" }
|
|
53597
53710
|
);
|
|
53598
53711
|
} catch {
|
|
53599
|
-
if (
|
|
53712
|
+
if (context.signal.aborted || usageByAccountId.get(account.accountId) !== loading)
|
|
53600
53713
|
return;
|
|
53601
53714
|
usageByAccountId.set(account.accountId, { status: "error" });
|
|
53602
53715
|
}
|
|
@@ -53625,7 +53738,7 @@ ${detail}` : ""}`
|
|
|
53625
53738
|
};
|
|
53626
53739
|
const refreshInBackground = () => {
|
|
53627
53740
|
if (!client().refreshCodexAccounts) return;
|
|
53628
|
-
void
|
|
53741
|
+
void context.runLatest(
|
|
53629
53742
|
() => client().refreshCodexAccounts?.() ?? client().listCodexAccounts(),
|
|
53630
53743
|
{
|
|
53631
53744
|
success(result) {
|
|
@@ -53637,7 +53750,7 @@ ${detail}` : ""}`
|
|
|
53637
53750
|
);
|
|
53638
53751
|
};
|
|
53639
53752
|
const load = () => {
|
|
53640
|
-
void
|
|
53753
|
+
void context.runLatest(() => client().listCodexAccounts(), {
|
|
53641
53754
|
success(result) {
|
|
53642
53755
|
loadMessage = null;
|
|
53643
53756
|
setAccounts(result);
|
|
@@ -53657,10 +53770,10 @@ ${detail}` : ""}`
|
|
|
53657
53770
|
});
|
|
53658
53771
|
} catch {
|
|
53659
53772
|
}
|
|
53660
|
-
const harnessAccounts = createHarnessAccounts(
|
|
53773
|
+
const harnessAccounts = createHarnessAccounts(context.signal, getClient, render);
|
|
53661
53774
|
const directoryClient = getClient();
|
|
53662
53775
|
void directoryClient?.listHarnessPlugins?.().then(({ plugins: next }) => {
|
|
53663
|
-
if (
|
|
53776
|
+
if (context.signal.aborted || getClient() !== directoryClient) return;
|
|
53664
53777
|
plugins = next;
|
|
53665
53778
|
render();
|
|
53666
53779
|
void credentialImports.refresh();
|
|
@@ -54483,8 +54596,8 @@ ${detail}` : ""}`
|
|
|
54483
54596
|
id: "delegation",
|
|
54484
54597
|
label: messages.pageLabels.delegation,
|
|
54485
54598
|
icon: "delegation",
|
|
54486
|
-
mount(
|
|
54487
|
-
const doc =
|
|
54599
|
+
mount(context) {
|
|
54600
|
+
const doc = context.content.ownerDocument;
|
|
54488
54601
|
const ownerWindow = doc.defaultView;
|
|
54489
54602
|
const root = doc.createElement("div");
|
|
54490
54603
|
root.className = "settings-delegation";
|
|
@@ -54508,7 +54621,7 @@ ${detail}` : ""}`
|
|
|
54508
54621
|
const rowViews = /* @__PURE__ */ new Map();
|
|
54509
54622
|
let disposed = false;
|
|
54510
54623
|
let preferencesLoadGeneration = 0;
|
|
54511
|
-
const isActive = () => !disposed && !
|
|
54624
|
+
const isActive = () => !disposed && !context.signal.aborted;
|
|
54512
54625
|
const diagramAgents = () => readyAgents.map((agent) => {
|
|
54513
54626
|
const summary = formatEffectiveSummary(
|
|
54514
54627
|
agent.id,
|
|
@@ -54630,7 +54743,7 @@ ${detail}` : ""}`
|
|
|
54630
54743
|
footnote.textContent = copy.footnote;
|
|
54631
54744
|
modelsSection.append(sectionHead, unavailableNotice, group, footnote);
|
|
54632
54745
|
root.append(header, diagram.element, howto, modelsSection);
|
|
54633
|
-
|
|
54746
|
+
context.content.append(root);
|
|
54634
54747
|
const canPersist = () => {
|
|
54635
54748
|
const client = getClient();
|
|
54636
54749
|
return Boolean(client?.getHarnessPreferences && client?.patchHarnessPreferences);
|
|
@@ -55044,14 +55157,14 @@ ${detail}` : ""}`
|
|
|
55044
55157
|
id: "harness-schedules",
|
|
55045
55158
|
label: t("\u5B9A\u65F6\u4EFB\u52A1", "Schedules"),
|
|
55046
55159
|
icon: "schedules",
|
|
55047
|
-
mount(
|
|
55160
|
+
mount(context) {
|
|
55048
55161
|
const navigate = () => {
|
|
55049
|
-
|
|
55050
|
-
void
|
|
55162
|
+
context.content.replaceChildren();
|
|
55163
|
+
void context.runLatest((signal) => options.openSchedules(signal), {
|
|
55051
55164
|
success() {
|
|
55052
55165
|
},
|
|
55053
55166
|
failure() {
|
|
55054
|
-
const document2 =
|
|
55167
|
+
const document2 = context.content.ownerDocument;
|
|
55055
55168
|
const status = document2.createElement("p");
|
|
55056
55169
|
status.setAttribute("role", "status");
|
|
55057
55170
|
status.className = "text-sm text-settings-muted";
|
|
@@ -55064,7 +55177,7 @@ ${detail}` : ""}`
|
|
|
55064
55177
|
retry.className = "rounded-lg px-3 py-2 text-sm text-settings-text hover:bg-settings-hover focus-visible:outline-2 focus-visible:outline-settings-focus";
|
|
55065
55178
|
retry.textContent = t("\u91CD\u8BD5", "Retry");
|
|
55066
55179
|
retry.addEventListener("click", navigate);
|
|
55067
|
-
|
|
55180
|
+
context.content.replaceChildren(status, retry);
|
|
55068
55181
|
}
|
|
55069
55182
|
});
|
|
55070
55183
|
};
|
|
@@ -55120,12 +55233,12 @@ ${detail}` : ""}`
|
|
|
55120
55233
|
// src/settings/update-status-poll.ts
|
|
55121
55234
|
var RENDERER_UPDATE_STATUS_WAIT_MS = 10 * 6e4;
|
|
55122
55235
|
var STATUS_POLL_INTERVAL_MS = 750;
|
|
55123
|
-
function createRendererUpdateStatusPoll(
|
|
55124
|
-
const window2 =
|
|
55236
|
+
function createRendererUpdateStatusPoll(context, handlers) {
|
|
55237
|
+
const window2 = context.content.ownerDocument.defaultView;
|
|
55125
55238
|
let timer;
|
|
55126
55239
|
let deadline = 0;
|
|
55127
55240
|
let disposed = false;
|
|
55128
|
-
const active2 = () => !disposed && !
|
|
55241
|
+
const active2 = () => !disposed && !context.signal.aborted;
|
|
55129
55242
|
const clearTimer = () => {
|
|
55130
55243
|
if (timer !== void 0) window2?.clearTimeout(timer);
|
|
55131
55244
|
timer = void 0;
|
|
@@ -55147,7 +55260,7 @@ ${detail}` : ""}`
|
|
|
55147
55260
|
handlers.unavailable();
|
|
55148
55261
|
return;
|
|
55149
55262
|
}
|
|
55150
|
-
void
|
|
55263
|
+
void context.runLatest(
|
|
55151
55264
|
(signal) => runBoundedRendererUpdateRequest(
|
|
55152
55265
|
readStatus,
|
|
55153
55266
|
signal,
|
|
@@ -55391,8 +55504,8 @@ ${detail}` : ""}`
|
|
|
55391
55504
|
id: "about",
|
|
55392
55505
|
label: messages.pageLabels.about,
|
|
55393
55506
|
icon: "about",
|
|
55394
|
-
mount(
|
|
55395
|
-
const document2 =
|
|
55507
|
+
mount(context) {
|
|
55508
|
+
const document2 = context.content.ownerDocument;
|
|
55396
55509
|
const heading = document2.createElement("div");
|
|
55397
55510
|
heading.className = "settings-section-label";
|
|
55398
55511
|
heading.textContent = messages.pageLabels.about;
|
|
@@ -55434,7 +55547,7 @@ ${detail}` : ""}`
|
|
|
55434
55547
|
panel.append(product, tagline, introduction, starCallout, repositorySection);
|
|
55435
55548
|
const consoleEntry = consoleSection(document2, messages, getClient());
|
|
55436
55549
|
if (consoleEntry) panel.append(consoleEntry);
|
|
55437
|
-
|
|
55550
|
+
context.content.append(heading, panel);
|
|
55438
55551
|
return void 0;
|
|
55439
55552
|
}
|
|
55440
55553
|
});
|
|
@@ -55461,8 +55574,8 @@ ${detail}` : ""}`
|
|
|
55461
55574
|
id: "updates",
|
|
55462
55575
|
label: messages.pageLabels.updates,
|
|
55463
55576
|
icon: "updates",
|
|
55464
|
-
mount(
|
|
55465
|
-
const document2 =
|
|
55577
|
+
mount(context) {
|
|
55578
|
+
const document2 = context.content.ownerDocument;
|
|
55466
55579
|
const windows = isWindowsRenderer(document2.defaultView);
|
|
55467
55580
|
const header = document2.createElement("div");
|
|
55468
55581
|
header.className = "settings-update-header";
|
|
@@ -55481,8 +55594,8 @@ ${detail}` : ""}`
|
|
|
55481
55594
|
let currentAnnouncement = null;
|
|
55482
55595
|
let announcementDialog = null;
|
|
55483
55596
|
announcementButton.addEventListener("click", () => {
|
|
55484
|
-
if (!currentAnnouncement ||
|
|
55485
|
-
const rootNode =
|
|
55597
|
+
if (!currentAnnouncement || context.signal.aborted) return;
|
|
55598
|
+
const rootNode = context.content.getRootNode();
|
|
55486
55599
|
const hostScheme = rootNode instanceof ShadowRoot && rootNode.host instanceof HTMLElement ? rootNode.host.style.colorScheme : "";
|
|
55487
55600
|
const colorScheme2 = hostScheme === "light" || hostScheme === "dark" ? hostScheme : "inherit";
|
|
55488
55601
|
announcementDialog?.dispose();
|
|
@@ -55591,9 +55704,9 @@ ${detail}` : ""}`
|
|
|
55591
55704
|
controls.append(manualTitle, manualNpm, manualWindowsInstaller, actions);
|
|
55592
55705
|
const notes = document2.createElement("div");
|
|
55593
55706
|
notes.className = "settings-update-notes-section";
|
|
55594
|
-
const macosSigning = createMacOsSigningSection(document2, messages,
|
|
55707
|
+
const macosSigning = createMacOsSigningSection(document2, messages, context.signal);
|
|
55595
55708
|
const starBanner = updateStarBanner(document2, messages);
|
|
55596
|
-
|
|
55709
|
+
context.content.append(
|
|
55597
55710
|
header,
|
|
55598
55711
|
metadata,
|
|
55599
55712
|
panel,
|
|
@@ -55609,7 +55722,7 @@ ${detail}` : ""}`
|
|
|
55609
55722
|
};
|
|
55610
55723
|
let pending2 = false;
|
|
55611
55724
|
let checkedStatus = null;
|
|
55612
|
-
const statusPoll = createRendererUpdateStatusPoll(
|
|
55725
|
+
const statusPoll = createRendererUpdateStatusPoll(context, {
|
|
55613
55726
|
status(status) {
|
|
55614
55727
|
const message2 = statusMessage(status, messages);
|
|
55615
55728
|
if (message2) renderPendingStatus(status, message2);
|
|
@@ -55715,23 +55828,23 @@ ${detail}` : ""}`
|
|
|
55715
55828
|
try {
|
|
55716
55829
|
const fresh = await runBoundedRendererUpdateRequest(
|
|
55717
55830
|
() => client.checkUpdate(),
|
|
55718
|
-
|
|
55831
|
+
context.signal
|
|
55719
55832
|
);
|
|
55720
|
-
if (
|
|
55833
|
+
if (context.signal.aborted) return;
|
|
55721
55834
|
if (fresh) latestRunningTaskCount = fresh.runningTaskCount ?? 0;
|
|
55722
55835
|
} catch {
|
|
55723
|
-
if (
|
|
55836
|
+
if (context.signal.aborted) return;
|
|
55724
55837
|
}
|
|
55725
55838
|
if (latestRunningTaskCount > 0) {
|
|
55726
55839
|
const confirmed = await confirmUpdateWithRunningTasks(
|
|
55727
|
-
|
|
55840
|
+
context.content,
|
|
55728
55841
|
messages,
|
|
55729
|
-
|
|
55842
|
+
context.signal,
|
|
55730
55843
|
latestRunningTaskCount
|
|
55731
55844
|
);
|
|
55732
|
-
if (!confirmed ||
|
|
55845
|
+
if (!confirmed || context.signal.aborted) return;
|
|
55733
55846
|
}
|
|
55734
|
-
if (!
|
|
55847
|
+
if (!context.signal.aborted) start(client);
|
|
55735
55848
|
} finally {
|
|
55736
55849
|
confirming = false;
|
|
55737
55850
|
}
|
|
@@ -55742,7 +55855,7 @@ ${detail}` : ""}`
|
|
|
55742
55855
|
pending2 = true;
|
|
55743
55856
|
const previousStatus = checkedStatus;
|
|
55744
55857
|
renderPendingStatus(null, messages.updatePreparing);
|
|
55745
|
-
void
|
|
55858
|
+
void context.runLatest(
|
|
55746
55859
|
(signal) => runBoundedRendererUpdateRequest(() => client.startUpdate(), signal),
|
|
55747
55860
|
{
|
|
55748
55861
|
success(result) {
|
|
@@ -55922,7 +56035,7 @@ ${detail}` : ""}`
|
|
|
55922
56035
|
}
|
|
55923
56036
|
pending2 = true;
|
|
55924
56037
|
renderPendingStatus(null, messages.updateChecking);
|
|
55925
|
-
return
|
|
56038
|
+
return context.runLatest(
|
|
55926
56039
|
(signal) => runBoundedRendererUpdateRequest(() => client.checkUpdate(), signal),
|
|
55927
56040
|
{
|
|
55928
56041
|
success(result) {
|
|
@@ -55940,7 +56053,7 @@ ${detail}` : ""}`
|
|
|
55940
56053
|
const client = getClient();
|
|
55941
56054
|
if (!client?.getReleaseAnnouncement) return;
|
|
55942
56055
|
void client.getReleaseAnnouncement({ manual: true }).then((result) => {
|
|
55943
|
-
if (
|
|
56056
|
+
if (context.signal.aborted || !result?.announcement) return;
|
|
55944
56057
|
currentAnnouncement = result.announcement;
|
|
55945
56058
|
announcementButton.hidden = false;
|
|
55946
56059
|
}).catch(() => {
|
|
@@ -66373,13 +66486,13 @@ ${renderer_brand_mark_default}`;
|
|
|
66373
66486
|
var ROW = "data-app-action-sidebar-thread-row";
|
|
66374
66487
|
var ID = "data-app-action-sidebar-thread-id";
|
|
66375
66488
|
var HOST = "data-app-action-sidebar-thread-host-id";
|
|
66376
|
-
function
|
|
66489
|
+
function record14(value) {
|
|
66377
66490
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
66378
66491
|
}
|
|
66379
66492
|
function hooks(owner) {
|
|
66380
66493
|
const result = [];
|
|
66381
66494
|
let hook = owner.memoizedState;
|
|
66382
|
-
while (
|
|
66495
|
+
while (record14(hook) && result.length < 4096) {
|
|
66383
66496
|
result.push(hook);
|
|
66384
66497
|
hook = hook.next;
|
|
66385
66498
|
}
|
|
@@ -66387,7 +66500,7 @@ ${renderer_brand_mark_default}`;
|
|
|
66387
66500
|
}
|
|
66388
66501
|
function identity2(owner) {
|
|
66389
66502
|
const props = owner.memoizedProps;
|
|
66390
|
-
if (!
|
|
66503
|
+
if (!record14(props) || !record14(props.dataAttributes)) return null;
|
|
66391
66504
|
const { conversationId: threadId, hostId: hostId2, dataAttributes: attributes } = props;
|
|
66392
66505
|
if (typeof threadId !== "string" || !threadId || typeof hostId2 !== "string" || !hostId2 || !(ROW in attributes) || attributes[HOST] !== hostId2 || attributes[ID] !== threadId && attributes[ID] !== `${hostId2}:${threadId}`)
|
|
66393
66506
|
return null;
|
|
@@ -66399,10 +66512,10 @@ ${renderer_brand_mark_default}`;
|
|
|
66399
66512
|
const [subscriber, deps] = memo2;
|
|
66400
66513
|
const signal = deps[0];
|
|
66401
66514
|
const next = hook.next;
|
|
66402
|
-
const instance =
|
|
66403
|
-
const effectHook =
|
|
66404
|
-
const effect =
|
|
66405
|
-
if (deps.length !== 2 || deps[1] !== void 0 || !
|
|
66515
|
+
const instance = record14(next) ? next.queue : null;
|
|
66516
|
+
const effectHook = record14(next) ? next.next : null;
|
|
66517
|
+
const effect = record14(effectHook) ? effectHook.memoizedState : null;
|
|
66518
|
+
if (deps.length !== 2 || deps[1] !== void 0 || !record14(signal) || typeof signal.get !== "function" || typeof signal.subscribe !== "function" || !record14(signal.atom) || typeof signal.atom.read !== "function" || "write" in signal.atom || !record14(signal.store) || typeof signal.store.get !== "function" || typeof signal.store.sub !== "function" || !record14(subscriber) || typeof subscriber.getSnapshot !== "function" || typeof subscriber.subscribe !== "function" || !record14(instance) || typeof instance.getSnapshot !== "function" || !record14(effect) || typeof effect.create !== "function" || !Array.isArray(effect.deps) || effect.deps[0] !== subscriber.subscribe)
|
|
66406
66519
|
return null;
|
|
66407
66520
|
return {
|
|
66408
66521
|
atom: signal.atom,
|
|
@@ -66413,7 +66526,7 @@ ${renderer_brand_mark_default}`;
|
|
|
66413
66526
|
};
|
|
66414
66527
|
}
|
|
66415
66528
|
function repairSidebarThreadState(owner) {
|
|
66416
|
-
if (!
|
|
66529
|
+
if (!record14(owner)) return null;
|
|
66417
66530
|
const key2 = identity2(owner);
|
|
66418
66531
|
if (!key2) return null;
|
|
66419
66532
|
const candidates = [];
|
|
@@ -66425,7 +66538,7 @@ ${renderer_brand_mark_default}`;
|
|
|
66425
66538
|
if (instance2.value !== null || store2.get(atom2) !== null || subscriber2.getSnapshot() !== null || instance2.getSnapshot() !== null)
|
|
66426
66539
|
continue;
|
|
66427
66540
|
const value = atom2.read((dependency) => store2.get(dependency));
|
|
66428
|
-
if (
|
|
66541
|
+
if (record14(value) && record14(value.summary) && value.summary.modelProvider === "codexhost" && value.summary.conversationId === key2.threadId && value.summary.hostId === key2.hostId && Array.isArray(value.requests) && typeof value.resumeState === "string")
|
|
66429
66542
|
candidates.push(candidate2);
|
|
66430
66543
|
}
|
|
66431
66544
|
} catch {
|
|
@@ -66507,8 +66620,8 @@ ${renderer_brand_mark_default}`;
|
|
|
66507
66620
|
if (seen.has(fiber)) return /* @__PURE__ */ new Set();
|
|
66508
66621
|
seen.add(fiber);
|
|
66509
66622
|
if (identity2(fiber)) owners.add(fiber);
|
|
66510
|
-
if (fiber !== first &&
|
|
66511
|
-
if (
|
|
66623
|
+
if (fiber !== first && record14(fiber.sibling)) stack.push(fiber.sibling);
|
|
66624
|
+
if (record14(fiber.child)) stack.push(fiber.child);
|
|
66512
66625
|
}
|
|
66513
66626
|
if (stack.length) return /* @__PURE__ */ new Set();
|
|
66514
66627
|
}
|
|
@@ -66520,7 +66633,7 @@ ${renderer_brand_mark_default}`;
|
|
|
66520
66633
|
refresh() {
|
|
66521
66634
|
const owners = sidebarOwners(root);
|
|
66522
66635
|
for (const [owner, repair] of repairs) {
|
|
66523
|
-
const current = owners.has(owner) ? owner :
|
|
66636
|
+
const current = owners.has(owner) ? owner : record14(owner.alternate) && owners.has(owner.alternate) ? owner.alternate : null;
|
|
66524
66637
|
if (current && repair.isBound(current)) owners.delete(current);
|
|
66525
66638
|
else {
|
|
66526
66639
|
repair.dispose();
|
|
@@ -66597,10 +66710,10 @@ ${renderer_brand_mark_default}`;
|
|
|
66597
66710
|
// src/renderer-skill-library.ts
|
|
66598
66711
|
function createRendererSkillLibrary(options) {
|
|
66599
66712
|
let active2 = null;
|
|
66600
|
-
const key2 = (
|
|
66713
|
+
const key2 = (context) => JSON.stringify(context.params);
|
|
66601
66714
|
const current = (state) => {
|
|
66602
|
-
const
|
|
66603
|
-
return active2 === state &&
|
|
66715
|
+
const context = options.context(state.editor);
|
|
66716
|
+
return active2 === state && context?.client === state.context.client && key2(context) === state.key;
|
|
66604
66717
|
};
|
|
66605
66718
|
const close = () => {
|
|
66606
66719
|
active2?.unsubscribe?.();
|
|
@@ -66631,28 +66744,28 @@ ${renderer_brand_mark_default}`;
|
|
|
66631
66744
|
} while (state.dirty && current(state));
|
|
66632
66745
|
};
|
|
66633
66746
|
const open2 = (editor) => {
|
|
66634
|
-
const
|
|
66635
|
-
if (!
|
|
66747
|
+
const context = options.context(editor);
|
|
66748
|
+
if (!context) {
|
|
66636
66749
|
close();
|
|
66637
66750
|
return;
|
|
66638
66751
|
}
|
|
66639
|
-
if (active2?.context.client ===
|
|
66752
|
+
if (active2?.context.client === context.client && active2.key === key2(context)) {
|
|
66640
66753
|
active2.editor = editor;
|
|
66641
66754
|
return;
|
|
66642
66755
|
}
|
|
66643
66756
|
close();
|
|
66644
66757
|
const state = {
|
|
66645
66758
|
editor,
|
|
66646
|
-
context
|
|
66647
|
-
key: key2(
|
|
66759
|
+
context,
|
|
66760
|
+
key: key2(context),
|
|
66648
66761
|
pending: false,
|
|
66649
66762
|
dirty: false
|
|
66650
66763
|
};
|
|
66651
66764
|
active2 = state;
|
|
66652
|
-
if (
|
|
66653
|
-
state.unsubscribe =
|
|
66765
|
+
if (context.client.subscribeSkillsChanged) {
|
|
66766
|
+
state.unsubscribe = context.client.subscribeSkillsChanged((change) => {
|
|
66654
66767
|
if (!current(state)) return;
|
|
66655
|
-
if (change.cwd && !
|
|
66768
|
+
if (change.cwd && !context.params.threadId && change.cwd !== context.params.cwd) return;
|
|
66656
66769
|
void query(state);
|
|
66657
66770
|
});
|
|
66658
66771
|
}
|
|
@@ -66662,9 +66775,9 @@ ${renderer_brand_mark_default}`;
|
|
|
66662
66775
|
open: open2,
|
|
66663
66776
|
close,
|
|
66664
66777
|
read(editor) {
|
|
66665
|
-
const
|
|
66666
|
-
if (!
|
|
66667
|
-
if (!active2 || active2.context.client !==
|
|
66778
|
+
const context = options.context(editor);
|
|
66779
|
+
if (!context) return null;
|
|
66780
|
+
if (!active2 || active2.context.client !== context.client || active2.key !== key2(context))
|
|
66668
66781
|
open2(editor);
|
|
66669
66782
|
const state = active2;
|
|
66670
66783
|
if (!state) return null;
|
|
@@ -67583,8 +67696,109 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
67583
67696
|
return event.defaultPrevented;
|
|
67584
67697
|
}
|
|
67585
67698
|
|
|
67699
|
+
// src/codex-thread-unread.ts
|
|
67700
|
+
var record15 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
67701
|
+
function isNativeThreadReadState(value) {
|
|
67702
|
+
return record15(value) && Object.hasOwn(value, "identityKey") && Object.hasOwn(value, "isReady") && ["read", "identityKey", "isReady", "isUnread", "subscribe"].every(
|
|
67703
|
+
(key2) => typeof value[key2] === "function"
|
|
67704
|
+
);
|
|
67705
|
+
}
|
|
67706
|
+
function isNativeSidebarUnread(value) {
|
|
67707
|
+
if (typeof value !== "function" || value.length !== 2) return false;
|
|
67708
|
+
const source = Function.prototype.toString.call(value);
|
|
67709
|
+
return /^function\b/u.test(source) && source.includes(".byKey.get(") && source.includes(".summary.conversationId") && source.includes(".summary.hostId") && source.includes(".summary.hasUnreadTurn") && /\?\.[\w$]+\([^)]*\.summary.hostId\)\?\.has\([^)]*\.summary.conversationId\)/u.test(source) && /\?\?\s*[\w$]+\.summary\.hasUnreadTurn\s*:\s*[\w$]+\([\w$]+,\s*[\w$]+\);?\s*\}$/u.test(source);
|
|
67710
|
+
}
|
|
67711
|
+
function createDesktopThreadUnreadWatcher(ownerWindow, importModule) {
|
|
67712
|
+
let loading;
|
|
67713
|
+
const load = () => loading ??= Promise.all([
|
|
67714
|
+
loadCodexNativeServices(ownerWindow, isNativeThreadReadState, importModule),
|
|
67715
|
+
loadCodexNativeServices(ownerWindow, isNativeSidebarUnread, importModule)
|
|
67716
|
+
]).then(
|
|
67717
|
+
(services) => {
|
|
67718
|
+
if (services.some((service) => !service)) loading = void 0;
|
|
67719
|
+
return services;
|
|
67720
|
+
},
|
|
67721
|
+
() => {
|
|
67722
|
+
loading = void 0;
|
|
67723
|
+
return [null, null];
|
|
67724
|
+
}
|
|
67725
|
+
);
|
|
67726
|
+
return (threadIds, receive) => {
|
|
67727
|
+
const ids = [...new Set(threadIds)];
|
|
67728
|
+
let disposed = false;
|
|
67729
|
+
let revision = 0;
|
|
67730
|
+
let stopScope = () => {
|
|
67731
|
+
};
|
|
67732
|
+
let stopState = () => {
|
|
67733
|
+
};
|
|
67734
|
+
let previous;
|
|
67735
|
+
const unknown2 = () => Object.fromEntries(ids.map((id2) => [id2, null]));
|
|
67736
|
+
const publish = (snapshot) => {
|
|
67737
|
+
if (disposed || previous && ids.every((id2) => snapshot[id2] === previous?.[id2])) return;
|
|
67738
|
+
previous = snapshot;
|
|
67739
|
+
receive(Object.freeze(snapshot));
|
|
67740
|
+
};
|
|
67741
|
+
publish(unknown2());
|
|
67742
|
+
if (ids.length) {
|
|
67743
|
+
void load().then(([state, unread]) => {
|
|
67744
|
+
if (disposed || !state || !unread) return;
|
|
67745
|
+
const refresh = () => {
|
|
67746
|
+
const current = ++revision;
|
|
67747
|
+
stopScope();
|
|
67748
|
+
stopScope = () => {
|
|
67749
|
+
};
|
|
67750
|
+
if (disposed) return;
|
|
67751
|
+
const scope = readRendererAppScope(ownerWindow.document);
|
|
67752
|
+
if (!scope) return publish(unknown2());
|
|
67753
|
+
try {
|
|
67754
|
+
const ready = () => {
|
|
67755
|
+
const saved = state.read();
|
|
67756
|
+
return state.isReady() && record15(saved) && Array.isArray(saved.local);
|
|
67757
|
+
};
|
|
67758
|
+
if (!ready()) return publish(unknown2());
|
|
67759
|
+
const identity3 = state.identityKey();
|
|
67760
|
+
const closeScope = scope.watch(({ get }) => {
|
|
67761
|
+
if (disposed || current !== revision) return;
|
|
67762
|
+
try {
|
|
67763
|
+
if (!ready() || identity3 !== state.identityKey()) return publish(unknown2());
|
|
67764
|
+
const snapshot = Object.fromEntries(
|
|
67765
|
+
ids.map((id2) => {
|
|
67766
|
+
const value = unread(get, `local:${id2}`);
|
|
67767
|
+
return [id2, typeof value === "boolean" ? value : null];
|
|
67768
|
+
})
|
|
67769
|
+
);
|
|
67770
|
+
publish(snapshot);
|
|
67771
|
+
} catch {
|
|
67772
|
+
publish(unknown2());
|
|
67773
|
+
}
|
|
67774
|
+
});
|
|
67775
|
+
if (disposed || current !== revision) closeScope();
|
|
67776
|
+
else stopScope = closeScope;
|
|
67777
|
+
} catch {
|
|
67778
|
+
publish(unknown2());
|
|
67779
|
+
}
|
|
67780
|
+
};
|
|
67781
|
+
try {
|
|
67782
|
+
stopState = state.subscribe({ type: "snapshot", listener: refresh });
|
|
67783
|
+
refresh();
|
|
67784
|
+
} catch {
|
|
67785
|
+
stopScope();
|
|
67786
|
+
stopState();
|
|
67787
|
+
publish(unknown2());
|
|
67788
|
+
}
|
|
67789
|
+
});
|
|
67790
|
+
}
|
|
67791
|
+
return () => {
|
|
67792
|
+
disposed = true;
|
|
67793
|
+
revision++;
|
|
67794
|
+
stopScope();
|
|
67795
|
+
stopState();
|
|
67796
|
+
};
|
|
67797
|
+
};
|
|
67798
|
+
}
|
|
67799
|
+
|
|
67586
67800
|
// src/remote-sidebar-history.ts
|
|
67587
|
-
function
|
|
67801
|
+
function record16(value) {
|
|
67588
67802
|
return typeof value === "object" && value !== null;
|
|
67589
67803
|
}
|
|
67590
67804
|
function sidebarCatalogForWindow(load) {
|
|
@@ -67600,22 +67814,22 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
67600
67814
|
async function loadSidebarCatalog(view) {
|
|
67601
67815
|
const services = await loadCodexNativeServices(
|
|
67602
67816
|
view,
|
|
67603
|
-
(value) =>
|
|
67817
|
+
(value) => record16(value) && Object.hasOwn(value, "appServerManagers") && Object.hasOwn(value, "localThreadCatalog") && typeof value.localThreadCatalog?.notifyThread === "function" && typeof value.localThreadCatalog?.readEntries === "function"
|
|
67604
67818
|
);
|
|
67605
67819
|
return services?.localThreadCatalog ?? null;
|
|
67606
67820
|
}
|
|
67607
67821
|
function observeRemoteSidebarClosures(view, closed) {
|
|
67608
67822
|
const listen = ({ data, source }) => {
|
|
67609
|
-
if (source !== null && source !== view || !
|
|
67823
|
+
if (source !== null && source !== view || !record16(data) || data.type !== "mcp-notification" || typeof data.hostId !== "string" || !data.hostId.startsWith("remote-ssh") || !record16(data.params) || typeof data.params.threadId !== "string")
|
|
67610
67824
|
return;
|
|
67611
|
-
if (data.method === "thread/closed" || data.method === "thread/status/changed" &&
|
|
67825
|
+
if (data.method === "thread/closed" || data.method === "thread/status/changed" && record16(data.params.status) && data.params.status.type === "notLoaded")
|
|
67612
67826
|
closed(data.hostId, data.params.threadId);
|
|
67613
67827
|
};
|
|
67614
67828
|
view.addEventListener("message", listen);
|
|
67615
67829
|
return () => view.removeEventListener("message", listen);
|
|
67616
67830
|
}
|
|
67617
67831
|
function emptyCachedThread(value, key2, cwd) {
|
|
67618
|
-
return
|
|
67832
|
+
return record16(value) && value.id === key2.threadId && value.hostId === key2.hostId && value.cwd === cwd && (!value.title || value.title === cwd) && value.modelProvider !== "codexhost" && value.resumeState === "needs_resume" && record16(value.threadRuntimeStatus) && value.threadRuntimeStatus.type === "notLoaded" && Array.isArray(value.requests) && value.requests.length === 0 && Array.isArray(value.turns) && value.turns.length === 0;
|
|
67619
67833
|
}
|
|
67620
67834
|
async function reconcileRemoteSidebarThread(manager, key2, cwd, catalogForWindow, isCurrent) {
|
|
67621
67835
|
if (!manager.getConversation || !manager.discardConversationFromCache || !isCurrent()) return;
|
|
@@ -67623,7 +67837,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
67623
67837
|
await manager.sendRequest("thread/read", { threadId: key2.threadId, includeTurns: false });
|
|
67624
67838
|
return;
|
|
67625
67839
|
} catch (error62) {
|
|
67626
|
-
if (!
|
|
67840
|
+
if (!record16(error62) || (error62.jsonRpcCode ?? error62.code) !== -32600) throw error62;
|
|
67627
67841
|
if (error62.message !== `thread not loaded: ${key2.threadId}`) return;
|
|
67628
67842
|
}
|
|
67629
67843
|
if (!isCurrent()) return;
|
|
@@ -67632,7 +67846,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
67632
67846
|
const entries = await catalog.readEntries([key2]);
|
|
67633
67847
|
if (!Array.isArray(entries) || entries.length > 1) return;
|
|
67634
67848
|
const entry = entries[0];
|
|
67635
|
-
if (entry != null && (!
|
|
67849
|
+
if (entry != null && (!record16(entry) || entry.hostId !== key2.hostId || entry.threadId !== key2.threadId || entry.modelProvider === "codexhost" || entry.cwd !== cwd || entry.displayTitle !== cwd))
|
|
67636
67850
|
return;
|
|
67637
67851
|
const cached2 = await manager.getConversation(key2.threadId);
|
|
67638
67852
|
if (!isCurrent() || cached2 != null && !emptyCachedThread(cached2, key2, cwd)) return;
|
|
@@ -67763,10 +67977,10 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
67763
67977
|
getClient,
|
|
67764
67978
|
getLocale
|
|
67765
67979
|
});
|
|
67766
|
-
const
|
|
67767
|
-
instances.set(id2,
|
|
67980
|
+
const record19 = { module, surface };
|
|
67981
|
+
instances.set(id2, record19);
|
|
67768
67982
|
void surface.mount(() => document2.body.append(container)).catch(() => {
|
|
67769
|
-
if (instances.get(id2) ===
|
|
67983
|
+
if (instances.get(id2) === record19) delete record19.surface;
|
|
67770
67984
|
surface.dispose();
|
|
67771
67985
|
});
|
|
67772
67986
|
} catch (cause) {
|
|
@@ -71488,6 +71702,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
71488
71702
|
ready: () => !disposed && window.__codexhostRendererBindingProbeV1?.status().adapter.state === "ready",
|
|
71489
71703
|
sidebar: sidebarDom,
|
|
71490
71704
|
watchTree: treeRelay.subscribe,
|
|
71705
|
+
watchUnread: createDesktopThreadUnreadWatcher(window),
|
|
71491
71706
|
describe: (id2) => {
|
|
71492
71707
|
const plugin = pluginForHost("local", id2);
|
|
71493
71708
|
return plugin ? { name: plugin.name, ...plugin.icon ? { icon: plugin.icon } : {} } : id2 === "codex" ? { name: "Codex" } : void 0;
|
|
@@ -71729,7 +71944,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
71729
71944
|
|
|
71730
71945
|
// src/renderer-rpc-steering-queue.ts
|
|
71731
71946
|
var INTERRUPTED = "Interrupted before the steer was accepted.";
|
|
71732
|
-
var
|
|
71947
|
+
var record17 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
71733
71948
|
async function prepareRpcSteeringQueue(hostId2, threadId, manager, coordinator, messageId) {
|
|
71734
71949
|
const snapshot = Promise.withResolvers();
|
|
71735
71950
|
let lease;
|
|
@@ -71763,7 +71978,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
71763
71978
|
for (const value of /* @__PURE__ */ new Set([pending2, lease])) dispose(value);
|
|
71764
71979
|
}
|
|
71765
71980
|
if (messages.some(
|
|
71766
|
-
(message2) =>
|
|
71981
|
+
(message2) => record17(message2) && message2.id !== messageId && message2.pausedReason === INTERRUPTED
|
|
71767
71982
|
))
|
|
71768
71983
|
throw new Error(
|
|
71769
71984
|
"Resume or remove the other previously paused messages before changing direction"
|
|
@@ -71771,23 +71986,34 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
71771
71986
|
return async (turnId) => {
|
|
71772
71987
|
await coordinator("removeQueuedMessage", threadId, messageId);
|
|
71773
71988
|
const state = await manager("getThreadExecutionState", threadId);
|
|
71774
|
-
const stillRunning =
|
|
71989
|
+
const stillRunning = record17(state) && state.inProgress === true && state.activeTurnId === turnId;
|
|
71775
71990
|
const turn = stillRunning ? null : await manager("getTurnById", threadId, turnId);
|
|
71776
|
-
if (stillRunning ||
|
|
71991
|
+
if (stillRunning || record17(turn) && turn.status === "completed")
|
|
71777
71992
|
await coordinator("resumeInterruptedQueuedMessages", threadId);
|
|
71778
71993
|
};
|
|
71779
71994
|
}
|
|
71780
71995
|
|
|
71781
71996
|
// src/renderer-rpc-steering.ts
|
|
71782
|
-
var
|
|
71997
|
+
var record18 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
71783
71998
|
var invoke = (target2, name, ...args) => Reflect.apply(Reflect.get(target2, name), target2, args);
|
|
71784
|
-
var running = (state) =>
|
|
71785
|
-
var
|
|
71786
|
-
...
|
|
71787
|
-
|
|
71999
|
+
var running = (state) => record18(state) && (state.inProgress === true || !!state.activeTurnId);
|
|
72000
|
+
var withApplicationContext = (params, key2, value) => ({
|
|
72001
|
+
...params,
|
|
72002
|
+
additionalContext: {
|
|
72003
|
+
...record18(params.additionalContext) ? params.additionalContext : {},
|
|
72004
|
+
[key2]: { kind: "application", value }
|
|
72005
|
+
}
|
|
71788
72006
|
});
|
|
71789
|
-
function
|
|
71790
|
-
|
|
72007
|
+
function withReferenceHost(prepared, hostId2) {
|
|
72008
|
+
const stamp = (params) => withApplicationContext(params, THREAD_REFERENCE_SOURCE_HOST_PARAM, hostId2);
|
|
72009
|
+
return {
|
|
72010
|
+
...prepared,
|
|
72011
|
+
...record18(prepared.steer) ? { steer: stamp(prepared.steer) } : {},
|
|
72012
|
+
...record18(prepared.start) && record18(prepared.start.request) ? { start: { ...prepared.start, request: stamp(prepared.start.request) } } : {}
|
|
72013
|
+
};
|
|
72014
|
+
}
|
|
72015
|
+
function installRendererRpcSteering(value, routing) {
|
|
72016
|
+
if (!record18(value) || typeof value.forHost !== "function") return null;
|
|
71791
72017
|
const descriptor = Object.getOwnPropertyDescriptor(value, "forHost");
|
|
71792
72018
|
if (!descriptor?.writable) return null;
|
|
71793
72019
|
const controller = value;
|
|
@@ -71802,7 +72028,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
71802
72028
|
throw new Error("Steering connection was retired");
|
|
71803
72029
|
};
|
|
71804
72030
|
const inspect = async (threadId, input3) => {
|
|
71805
|
-
const text2 = Array.isArray(input3) ? input3.filter(
|
|
72031
|
+
const text2 = Array.isArray(input3) ? input3.filter(record18).map((item) => typeof item.text === "string" ? item.text : "").join("\n") : "";
|
|
71806
72032
|
current();
|
|
71807
72033
|
const delivery = await inspectRendererSteeringDelivery(
|
|
71808
72034
|
(method, params) => {
|
|
@@ -71818,19 +72044,19 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
71818
72044
|
const target2 = async (threadId, messageId, delivery) => {
|
|
71819
72045
|
const state = await invoke(rpc, "getThreadExecutionState", threadId);
|
|
71820
72046
|
current();
|
|
71821
|
-
if (!
|
|
72047
|
+
if (!record18(state) || typeof state.activeTurnId !== "string" || !state.activeTurnId || typeof messageId !== "string" || !messageId)
|
|
71822
72048
|
throw new Error("Native steering target or message identity is unavailable");
|
|
71823
72049
|
return { expectedTurnId: state.activeTurnId, clientUserMessageId: messageId, delivery };
|
|
71824
72050
|
};
|
|
71825
72051
|
const withoutQueueRow = async (request) => {
|
|
71826
|
-
if (!
|
|
72052
|
+
if (!record18(request) || request.acceptLocally !== true || typeof request.conversationId !== "string")
|
|
71827
72053
|
return request;
|
|
71828
72054
|
try {
|
|
71829
72055
|
const state = await invoke(rpc, "getThreadExecutionState", request.conversationId);
|
|
71830
72056
|
current();
|
|
71831
72057
|
if (!running(state)) return request;
|
|
71832
72058
|
const message2 = request.message;
|
|
71833
|
-
const text2 =
|
|
72059
|
+
const text2 = record18(message2) && typeof message2.text === "string" ? message2.text : "";
|
|
71834
72060
|
const delivery = await inspect(request.conversationId, [{ text: text2 }]);
|
|
71835
72061
|
return delivery === "newTurn" ? { ...request, acceptLocally: false } : request;
|
|
71836
72062
|
} catch {
|
|
@@ -71852,53 +72078,64 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
71852
72078
|
const callback = args[index];
|
|
71853
72079
|
if (typeof callback !== "function")
|
|
71854
72080
|
throw new Error("Native submission preparation is unavailable");
|
|
72081
|
+
const route = isDesktopSshHostId(hostId2) ? routing?.forHost(hostId2) : null;
|
|
72082
|
+
const isSameGeneration = route && captureThreadReferenceGeneration(routing, hostId2);
|
|
72083
|
+
let capability;
|
|
72084
|
+
const stamp = async (prepared) => {
|
|
72085
|
+
if (!isSameGeneration?.() || routing?.forHost(hostId2) !== route) return prepared;
|
|
72086
|
+
capability ??= supportsThreadReferenceContext(
|
|
72087
|
+
(method, params) => invoke(rpc, "sendRequest", method, params)
|
|
72088
|
+
);
|
|
72089
|
+
const supported = await capability;
|
|
72090
|
+
current();
|
|
72091
|
+
return supported && isSameGeneration() && routing?.forHost(hostId2) === route ? withReferenceHost(prepared, hostId2) : prepared;
|
|
72092
|
+
};
|
|
71855
72093
|
let marker = null;
|
|
71856
72094
|
let threadId;
|
|
71857
72095
|
let messageId;
|
|
71858
72096
|
let finish;
|
|
71859
72097
|
const apply = (prepared) => {
|
|
71860
|
-
if (!marker || !
|
|
72098
|
+
if (!marker || !record18(prepared.steer)) return prepared;
|
|
72099
|
+
const value2 = JSON.stringify(marker);
|
|
71861
72100
|
const result2 = {
|
|
71862
72101
|
...prepared,
|
|
71863
|
-
steer:
|
|
71864
|
-
...prepared.steer,
|
|
71865
|
-
additionalContext: context(prepared.steer.additionalContext, marker)
|
|
71866
|
-
}
|
|
72102
|
+
steer: withApplicationContext(prepared.steer, THREAD_STEERING_CONTEXT_PARAM, value2)
|
|
71867
72103
|
};
|
|
71868
72104
|
if (marker.delivery !== "newTurn") return result2;
|
|
71869
|
-
if (!
|
|
72105
|
+
if (!record18(prepared.start) || !record18(prepared.start.request))
|
|
71870
72106
|
throw new Error("Native start preparation is unavailable for steering");
|
|
71871
72107
|
return {
|
|
71872
72108
|
...result2,
|
|
71873
72109
|
afterInactiveTurnId: marker.expectedTurnId,
|
|
71874
72110
|
start: {
|
|
71875
72111
|
...prepared.start,
|
|
71876
|
-
request:
|
|
71877
|
-
|
|
71878
|
-
|
|
71879
|
-
|
|
72112
|
+
request: withApplicationContext(
|
|
72113
|
+
prepared.start.request,
|
|
72114
|
+
THREAD_STEERING_CONTEXT_PARAM,
|
|
72115
|
+
value2
|
|
72116
|
+
)
|
|
71880
72117
|
}
|
|
71881
72118
|
};
|
|
71882
72119
|
};
|
|
71883
72120
|
const prepare = async (...input3) => {
|
|
71884
72121
|
current();
|
|
71885
|
-
const
|
|
72122
|
+
const raw = await callback(...input3);
|
|
71886
72123
|
current();
|
|
71887
|
-
if (!
|
|
71888
|
-
if (marker) return apply(
|
|
71889
|
-
if (input3[1] !== "steer" || !
|
|
71890
|
-
return
|
|
71891
|
-
threadId =
|
|
72124
|
+
if (!record18(raw)) throw new Error("Native submission preparation is malformed");
|
|
72125
|
+
if (marker) return apply(await stamp(raw));
|
|
72126
|
+
if (input3[1] !== "steer" || !record18(raw.steer) || typeof raw.conversationId !== "string")
|
|
72127
|
+
return stamp(raw);
|
|
72128
|
+
threadId = raw.conversationId;
|
|
71892
72129
|
const execution = await invoke(rpc, "getThreadExecutionState", threadId);
|
|
71893
72130
|
current();
|
|
71894
|
-
if (!running(execution)) return
|
|
71895
|
-
const delivery = await inspect(threadId,
|
|
71896
|
-
if (delivery === "official") return
|
|
71897
|
-
const restore =
|
|
71898
|
-
messageId =
|
|
71899
|
-
const clientId =
|
|
72131
|
+
if (!running(execution)) return stamp(raw);
|
|
72132
|
+
const delivery = await inspect(threadId, raw.steer.input);
|
|
72133
|
+
if (delivery === "official") return stamp(raw);
|
|
72134
|
+
const restore = raw.steer.restoreMessage;
|
|
72135
|
+
messageId = record18(restore) && typeof restore.id === "string" ? restore.id : void 0;
|
|
72136
|
+
const clientId = raw.steer.clientUserMessageId ?? messageId;
|
|
71900
72137
|
marker = await target2(threadId, clientId, delivery);
|
|
71901
|
-
if (delivery === "activeTurn") return apply(
|
|
72138
|
+
if (delivery === "activeTurn") return apply(await stamp(raw));
|
|
71902
72139
|
if (!messageId) throw new Error("Native queued message identity is unavailable");
|
|
71903
72140
|
finish = await prepareRpcSteeringQueue(
|
|
71904
72141
|
hostId2,
|
|
@@ -71909,14 +72146,14 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
71909
72146
|
);
|
|
71910
72147
|
const start = await callback(input3[0], "start");
|
|
71911
72148
|
current();
|
|
71912
|
-
if (!
|
|
71913
|
-
return apply(start);
|
|
72149
|
+
if (!record18(start)) throw new Error("Native start preparation is malformed");
|
|
72150
|
+
return apply(await stamp(start));
|
|
71914
72151
|
};
|
|
71915
72152
|
const forwarded = [...args];
|
|
71916
72153
|
forwarded[index] = prepare;
|
|
71917
72154
|
if (key2 === "sendMessage") forwarded[0] = await withoutQueueRow(args[0]);
|
|
71918
72155
|
const result = await invoke(handle, key2, ...forwarded);
|
|
71919
|
-
if (finish &&
|
|
72156
|
+
if (finish && record18(result) && result.status === "sent" && typeof result.turnId === "string") {
|
|
71920
72157
|
await finish(result.turnId).catch(
|
|
71921
72158
|
() => console.error("codexhost could not reconcile native steering queue")
|
|
71922
72159
|
);
|
|
@@ -71964,7 +72201,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
71964
72201
|
return window.__codexhostRpcSteeringV1?.controller === controller;
|
|
71965
72202
|
const routing = window.__codexhostHostRoutingV1;
|
|
71966
72203
|
if (!routing) return false;
|
|
71967
|
-
const cleanup = installRendererRpcSteering(controller);
|
|
72204
|
+
const cleanup = installRendererRpcSteering(controller, routing);
|
|
71968
72205
|
if (!cleanup) return false;
|
|
71969
72206
|
const originalDispose = routing.dispose;
|
|
71970
72207
|
const dispose = () => {
|