@karlorz/codexhost-cli-win32-x64 0.15.0-1 → 0.16.1-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 +60 -25
- package/app/console-web.js +143 -57
- package/app/cpa-live-voice-hook.js +58 -24
- package/app/desktop-controller.mjs +649 -53
- package/app/host-runtime.mjs +10959 -10075
- package/app/plugins/antigravity/plugin.mjs +73 -29
- package/app/plugins/claude-code/plugin.mjs +104 -72
- package/app/plugins/codebuddy/plugin.mjs +113 -34
- package/app/plugins/codex-usage/plugin.mjs +65 -31
- package/app/plugins/copilot/plugin.mjs +73 -29
- package/app/plugins/cursor-cli/plugin.mjs +70 -26
- package/app/plugins/deepseek-harness/plugin.mjs +88 -34
- package/app/plugins/grok/plugin.mjs +1505 -502
- package/app/plugins/hermes/plugin.mjs +68 -24
- package/app/plugins/kimi-code/plugin.mjs +70 -26
- package/app/plugins/kiro-cli/plugin.mjs +70 -26
- package/app/plugins/omp/plugin.mjs +71 -27
- package/app/plugins/opencode/plugin.mjs +84 -30
- package/app/plugins/pi/plugin.mjs +87 -31
- package/app/plugins/qoder/plugin.mjs +96 -52
- package/app/plugins/qoder-cn/plugin.mjs +96 -52
- package/app/plugins/workbuddy/plugin.mjs +113 -34
- package/app/plugins/zcode/plugin.mjs +144 -47
- package/app/renderer-extension.js +1843 -213
- package/bin/codexhost.exe +0 -0
- package/libexec/codexhost-node-repl.exe +0 -0
- package/libexec/codexhost-shim.exe +0 -0
- package/libexec/codexhost-updater.exe +0 -0
- package/package.json +1 -1
|
@@ -4642,8 +4642,8 @@
|
|
|
4642
4642
|
}
|
|
4643
4643
|
|
|
4644
4644
|
// ../../node_modules/zod/v4/locales/be.js
|
|
4645
|
-
function getBelarusianPlural(
|
|
4646
|
-
const absCount = Math.abs(
|
|
4645
|
+
function getBelarusianPlural(count4, one, few, many) {
|
|
4646
|
+
const absCount = Math.abs(count4);
|
|
4647
4647
|
const lastDigit = absCount % 10;
|
|
4648
4648
|
const lastTwoDigits = absCount % 100;
|
|
4649
4649
|
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
|
@@ -6721,8 +6721,8 @@
|
|
|
6721
6721
|
}
|
|
6722
6722
|
|
|
6723
6723
|
// ../../node_modules/zod/v4/locales/hy.js
|
|
6724
|
-
function getArmenianPlural(
|
|
6725
|
-
return Math.abs(
|
|
6724
|
+
function getArmenianPlural(count4, one, many) {
|
|
6725
|
+
return Math.abs(count4) === 1 ? one : many;
|
|
6726
6726
|
}
|
|
6727
6727
|
function withDefiniteArticle(word) {
|
|
6728
6728
|
if (!word)
|
|
@@ -8850,8 +8850,8 @@
|
|
|
8850
8850
|
}
|
|
8851
8851
|
|
|
8852
8852
|
// ../../node_modules/zod/v4/locales/ru.js
|
|
8853
|
-
function getRussianPlural(
|
|
8854
|
-
const absCount = Math.abs(
|
|
8853
|
+
function getRussianPlural(count4, one, few, many) {
|
|
8854
|
+
const absCount = Math.abs(count4);
|
|
8855
8855
|
const lastDigit = absCount % 10;
|
|
8856
8856
|
const lastTwoDigits = absCount % 100;
|
|
8857
8857
|
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
|
@@ -14520,6 +14520,33 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14520
14520
|
// ../../node_modules/zod/v4/classic/external.js
|
|
14521
14521
|
config(en_default());
|
|
14522
14522
|
|
|
14523
|
+
// ../shared-contracts/dist/goals.js
|
|
14524
|
+
var harnessGoalStatusSchema = external_exports.enum([
|
|
14525
|
+
"active",
|
|
14526
|
+
"paused",
|
|
14527
|
+
"blocked",
|
|
14528
|
+
"usageLimited",
|
|
14529
|
+
"budgetLimited",
|
|
14530
|
+
"complete"
|
|
14531
|
+
]);
|
|
14532
|
+
var count = external_exports.number().int().nonnegative().safe();
|
|
14533
|
+
var harnessGoalSchema = external_exports.object({
|
|
14534
|
+
objective: external_exports.string().min(1),
|
|
14535
|
+
status: harnessGoalStatusSchema,
|
|
14536
|
+
tokenBudget: count.positive().nullable(),
|
|
14537
|
+
tokensUsed: count,
|
|
14538
|
+
timeUsedSeconds: count,
|
|
14539
|
+
createdAt: count,
|
|
14540
|
+
updatedAt: count
|
|
14541
|
+
});
|
|
14542
|
+
var goalOriginSchema = external_exports.enum(["user", "automatic"]).nullable();
|
|
14543
|
+
var harnessGoalSetSchema = external_exports.object({
|
|
14544
|
+
objective: external_exports.string().min(1).optional(),
|
|
14545
|
+
status: external_exports.enum(["active", "paused"]).optional(),
|
|
14546
|
+
tokenBudget: count.positive().nullable().optional(),
|
|
14547
|
+
origin: goalOriginSchema
|
|
14548
|
+
});
|
|
14549
|
+
|
|
14523
14550
|
// ../shared-contracts/dist/delegation-read.js
|
|
14524
14551
|
var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
|
|
14525
14552
|
var REMOTE_THREAD_READ_TIMEOUT_MS = 35e3;
|
|
@@ -14693,7 +14720,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14693
14720
|
// ../shared-contracts/dist/usage-statistics.js
|
|
14694
14721
|
var USAGE_STATISTICS_METHOD = "codexhost/usage/statistics/get";
|
|
14695
14722
|
var USAGE_STATISTICS_RANGES = ["today", "7d", "30d", "90d", "all"];
|
|
14696
|
-
var
|
|
14723
|
+
var count2 = external_exports.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
14697
14724
|
var localDate = external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/u);
|
|
14698
14725
|
var harness = external_exports.string().min(1).max(128);
|
|
14699
14726
|
var model = external_exports.string().min(1).max(512);
|
|
@@ -14716,22 +14743,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14716
14743
|
date: localDate.optional()
|
|
14717
14744
|
});
|
|
14718
14745
|
var usageStatisticsTotalsSchema = external_exports.strictObject({
|
|
14719
|
-
requests:
|
|
14720
|
-
inputTokens:
|
|
14721
|
-
cachedInputTokens:
|
|
14722
|
-
cacheWriteInputTokens:
|
|
14723
|
-
cacheKnownInputTokens:
|
|
14724
|
-
|
|
14725
|
-
|
|
14746
|
+
requests: count2,
|
|
14747
|
+
inputTokens: count2,
|
|
14748
|
+
cachedInputTokens: count2,
|
|
14749
|
+
cacheWriteInputTokens: count2,
|
|
14750
|
+
cacheKnownInputTokens: count2,
|
|
14751
|
+
cacheHitCachedInputTokens: count2,
|
|
14752
|
+
cacheHitInputTokens: count2,
|
|
14753
|
+
outputTokens: count2,
|
|
14754
|
+
reasoningOutputTokens: count2,
|
|
14726
14755
|
/** USD at the public price, summed over the priced requests only. */
|
|
14727
14756
|
costUsd: external_exports.number().finite().min(0),
|
|
14728
14757
|
/** Requests without a price (or the cache data the price needs); not in `costUsd`. */
|
|
14729
|
-
unpricedRequests:
|
|
14758
|
+
unpricedRequests: count2,
|
|
14730
14759
|
/**
|
|
14731
14760
|
* Requests whose storage gave no token counts: counted as requests, with neither tokens nor
|
|
14732
14761
|
* cost, and not as unpriced.
|
|
14733
14762
|
*/
|
|
14734
|
-
unmeteredRequests:
|
|
14763
|
+
unmeteredRequests: count2
|
|
14735
14764
|
});
|
|
14736
14765
|
var totals = usageStatisticsTotalsSchema.shape;
|
|
14737
14766
|
var usageStatisticsSessionSchema = external_exports.strictObject({
|
|
@@ -14742,8 +14771,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14742
14771
|
title: external_exports.string().min(1).max(200).optional(),
|
|
14743
14772
|
/** Models the session used, most requests first. */
|
|
14744
14773
|
models: external_exports.array(model).max(16),
|
|
14745
|
-
firstAtMs:
|
|
14746
|
-
lastAtMs:
|
|
14774
|
+
firstAtMs: count2,
|
|
14775
|
+
lastAtMs: count2,
|
|
14747
14776
|
...totals
|
|
14748
14777
|
});
|
|
14749
14778
|
var usageStatisticsResultSchema = external_exports.strictObject({
|
|
@@ -14761,7 +14790,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14761
14790
|
date: localDate.nullable()
|
|
14762
14791
|
}),
|
|
14763
14792
|
/** Reading of native storage: incomplete while the first read, or a refresh, is under way. */
|
|
14764
|
-
reading: external_exports.strictObject({ complete: external_exports.boolean(), sources:
|
|
14793
|
+
reading: external_exports.strictObject({ complete: external_exports.boolean(), sources: count2, read: count2 }),
|
|
14765
14794
|
/** Harnesses whose storage could not be read; their part is missing, the rest is complete. */
|
|
14766
14795
|
failures: external_exports.array(external_exports.strictObject({ harness, message: external_exports.string().max(2048) })).max(256),
|
|
14767
14796
|
/** Every value seen in the range, ignoring the filters, to choose filters from. */
|
|
@@ -14781,8 +14810,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14781
14810
|
harness,
|
|
14782
14811
|
model: model.nullable(),
|
|
14783
14812
|
credits: external_exports.number().finite().min(0),
|
|
14784
|
-
reportedRequests:
|
|
14785
|
-
requests:
|
|
14813
|
+
reportedRequests: count2,
|
|
14814
|
+
requests: count2
|
|
14786
14815
|
})).max(4096).optional(),
|
|
14787
14816
|
/** All filters applied. */
|
|
14788
14817
|
totals: usageStatisticsTotalsSchema,
|
|
@@ -14799,7 +14828,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14799
14828
|
model: model.nullable(),
|
|
14800
14829
|
...totals,
|
|
14801
14830
|
/** Requests priced by what the Harness recorded they cost, not by a price list. */
|
|
14802
|
-
harnessPricedRequests:
|
|
14831
|
+
harnessPricedRequests: count2
|
|
14803
14832
|
})).max(4096),
|
|
14804
14833
|
byProject: external_exports.array(external_exports.strictObject({ project: project.nullable(), ...totals })).max(4096),
|
|
14805
14834
|
/**
|
|
@@ -15243,7 +15272,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15243
15272
|
external_exports.null()
|
|
15244
15273
|
]);
|
|
15245
15274
|
function hasNoCircularReferences(value) {
|
|
15246
|
-
const
|
|
15275
|
+
const ancestors2 = /* @__PURE__ */ new WeakSet();
|
|
15247
15276
|
const stack = [{ value, leaving: false }];
|
|
15248
15277
|
try {
|
|
15249
15278
|
while (stack.length > 0) {
|
|
@@ -15251,14 +15280,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15251
15280
|
if (!frame)
|
|
15252
15281
|
break;
|
|
15253
15282
|
if (frame.leaving) {
|
|
15254
|
-
|
|
15283
|
+
ancestors2.delete(frame.value);
|
|
15255
15284
|
continue;
|
|
15256
15285
|
}
|
|
15257
15286
|
if (typeof frame.value !== "object" || frame.value === null)
|
|
15258
15287
|
continue;
|
|
15259
|
-
if (
|
|
15288
|
+
if (ancestors2.has(frame.value))
|
|
15260
15289
|
return false;
|
|
15261
|
-
|
|
15290
|
+
ancestors2.add(frame.value);
|
|
15262
15291
|
stack.push({ value: frame.value, leaving: true });
|
|
15263
15292
|
for (const child of Object.values(frame.value)) {
|
|
15264
15293
|
stack.push({ value: child, leaving: false });
|
|
@@ -15444,7 +15473,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15444
15473
|
var harnessHistoryCapabilitiesSchema = external_exports.object({
|
|
15445
15474
|
fork: external_exports.boolean(),
|
|
15446
15475
|
forkAcrossCwd: external_exports.boolean(),
|
|
15447
|
-
rollbackLastTurn: external_exports.boolean()
|
|
15476
|
+
rollbackLastTurn: external_exports.boolean(),
|
|
15477
|
+
/** Remove the selected checkpoint's Turn and every later Turn, without restoring files. */
|
|
15478
|
+
rollbackToCheckpoint: external_exports.boolean().optional()
|
|
15448
15479
|
}).strict().refine((history) => history.fork || !history.forkAcrossCwd, {
|
|
15449
15480
|
path: ["forkAcrossCwd"],
|
|
15450
15481
|
message: "Cross-cwd Fork requires exact history Fork support"
|
|
@@ -15689,7 +15720,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15689
15720
|
harnessId: harnessPluginIdSchema,
|
|
15690
15721
|
model: harnessModelRefSchema.optional(),
|
|
15691
15722
|
thinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
15692
|
-
permissionModeId: harnessPermissionModeIdSchema.optional()
|
|
15723
|
+
permissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
15724
|
+
/** A draft prewarm create: stays unsubmitted until the user's first Turn.
|
|
15725
|
+
* Desktop forwards only the Model of a main-process prewarm to thread/start. */
|
|
15726
|
+
prewarm: external_exports.literal(true).optional()
|
|
15693
15727
|
}).strict();
|
|
15694
15728
|
function encodeHarnessPluginRoute(route) {
|
|
15695
15729
|
const parsed = harnessPluginRouteSchema.parse(route);
|
|
@@ -16660,10 +16694,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16660
16694
|
return [];
|
|
16661
16695
|
seen.add(entry.node);
|
|
16662
16696
|
if (entry.node === first || entry.node === alternate) {
|
|
16663
|
-
const
|
|
16697
|
+
const ancestors2 = [];
|
|
16664
16698
|
for (let cursor = entry; cursor; cursor = cursor.parent)
|
|
16665
|
-
|
|
16666
|
-
return
|
|
16699
|
+
ancestors2.push(cursor.node);
|
|
16700
|
+
return ancestors2;
|
|
16667
16701
|
}
|
|
16668
16702
|
const sibling = entry.parent && fiber(entry.node.sibling);
|
|
16669
16703
|
if (sibling)
|
|
@@ -16675,6 +16709,593 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16675
16709
|
return stack.length > 0 ? exhausted() : [];
|
|
16676
16710
|
}
|
|
16677
16711
|
|
|
16712
|
+
// ../desktop-control/dist/renderer-native-schedule-sidebar.js
|
|
16713
|
+
var NATIVE_SCHEDULE_SIDEBAR_ROW_SELECTOR = 'aside [data-sidebar-cycle-item][role="button"][aria-labelledby]';
|
|
16714
|
+
function readNativeScheduleSidebarThread(element) {
|
|
16715
|
+
if (!element.matches(NATIVE_SCHEDULE_SIDEBAR_ROW_SELECTOR))
|
|
16716
|
+
return null;
|
|
16717
|
+
const keys = Object.keys(element).filter((key2) => key2.startsWith("__reactFiber$"));
|
|
16718
|
+
const key = keys[0];
|
|
16719
|
+
if (keys.length !== 1 || !key)
|
|
16720
|
+
return null;
|
|
16721
|
+
let scheduledContainer = false;
|
|
16722
|
+
const candidates = /* @__PURE__ */ new Set();
|
|
16723
|
+
let depth = 0;
|
|
16724
|
+
for (const fiber of committedReactAncestors(Reflect.get(element, key))) {
|
|
16725
|
+
if (++depth > 12)
|
|
16726
|
+
break;
|
|
16727
|
+
const props = fiber.memoizedProps;
|
|
16728
|
+
if (!props || typeof props !== "object")
|
|
16729
|
+
continue;
|
|
16730
|
+
if (Object.hasOwn(props, "data-selected-scheduled-task"))
|
|
16731
|
+
scheduledContainer = true;
|
|
16732
|
+
if (!scheduledContainer || !Object.hasOwn(props, "automation"))
|
|
16733
|
+
continue;
|
|
16734
|
+
const automation = props.automation;
|
|
16735
|
+
if (!automation || typeof automation !== "object" || automation.kind !== "heartbeat" || typeof automation.id !== "string" || !automation.id || props.hostId != null && props.hostId !== "local" || automation.hostId != null && automation.hostId !== "local")
|
|
16736
|
+
return null;
|
|
16737
|
+
const parsed = hostThreadIdSchema.safeParse(automation.targetThreadId);
|
|
16738
|
+
if (!parsed.success)
|
|
16739
|
+
return null;
|
|
16740
|
+
candidates.add(parsed.data);
|
|
16741
|
+
}
|
|
16742
|
+
return candidates.size === 1 ? candidates.values().next().value ?? null : null;
|
|
16743
|
+
}
|
|
16744
|
+
|
|
16745
|
+
// ../desktop-control/dist/renderer-scoped-draft-model.js
|
|
16746
|
+
function findScopedDraftModelBinding(composer, draftId) {
|
|
16747
|
+
let element = composer.querySelector?.('[data-codex-composer], [contenteditable="true"][role="textbox"]') ?? composer;
|
|
16748
|
+
let fiber;
|
|
16749
|
+
while (element && !fiber) {
|
|
16750
|
+
const key = Object.getOwnPropertyNames(element).find((name) => name.startsWith("__reactFiber$"));
|
|
16751
|
+
if (key)
|
|
16752
|
+
fiber = Object.getOwnPropertyDescriptor(element, key)?.value;
|
|
16753
|
+
element = element.parentElement;
|
|
16754
|
+
}
|
|
16755
|
+
const rows = [];
|
|
16756
|
+
const previousRows = /* @__PURE__ */ new Map();
|
|
16757
|
+
const updates = /* @__PURE__ */ new Set();
|
|
16758
|
+
for (const ancestor of committedReactAncestors(fiber)) {
|
|
16759
|
+
const queue = ancestor.updateQueue;
|
|
16760
|
+
const data = (queue?.memoCache?.data ?? []).filter((value) => Array.isArray(value));
|
|
16761
|
+
for (const [index, row] of data.entries()) {
|
|
16762
|
+
rows.push(row);
|
|
16763
|
+
previousRows.set(row, data[index - 1]);
|
|
16764
|
+
if (!Array.isArray(row) || row.length !== 14 || row[6] !== draftId || row[7] !== draftId)
|
|
16765
|
+
continue;
|
|
16766
|
+
const result = row[13];
|
|
16767
|
+
if (result?.isNewThreadDraft === true && row[11] === true && result.draftSettings === row[10] && result.updateDraftSettings === row[9] && row[9] === row[12] && typeof row[9] === "function")
|
|
16768
|
+
updates.add(row[9]);
|
|
16769
|
+
}
|
|
16770
|
+
}
|
|
16771
|
+
let update;
|
|
16772
|
+
const modes = /* @__PURE__ */ new Set();
|
|
16773
|
+
const creationModes = /* @__PURE__ */ new Set();
|
|
16774
|
+
for (const row of rows) {
|
|
16775
|
+
if (row.length !== 24 || row[7] !== null || row[10] !== true || !updates.has(row[13]))
|
|
16776
|
+
continue;
|
|
16777
|
+
const context = row[12];
|
|
16778
|
+
const result = row[23];
|
|
16779
|
+
if (context && context === row[21] && typeof context.usesAccountPreferences === "boolean" && result?.usesAccountPreferences === context.usesAccountPreferences && typeof row[14] === "function" && row[14] === row[20] && result.setModelAndReasoningEffort === row[14]) {
|
|
16780
|
+
update ??= row[13];
|
|
16781
|
+
modes.add(context.usesAccountPreferences);
|
|
16782
|
+
const settings = result.modelSettings;
|
|
16783
|
+
const candidate = previousRows.get(row);
|
|
16784
|
+
const mode2 = candidate?.[44];
|
|
16785
|
+
const value = candidate?.[51];
|
|
16786
|
+
if (candidate?.length === 52 && settings && candidate[39] === settings.model && candidate[40] === settings.reasoningEffort && mode2 && mode2 === candidate[49] && mode2.settings === candidate[41] && mode2.settings?.model === settings.model && value?.activeMode === mode2)
|
|
16787
|
+
creationModes.add(mode2);
|
|
16788
|
+
}
|
|
16789
|
+
}
|
|
16790
|
+
const [usesAccountPreferences] = modes;
|
|
16791
|
+
return update && modes.size === 1 && usesAccountPreferences !== void 0 ? {
|
|
16792
|
+
update,
|
|
16793
|
+
usesAccountPreferences,
|
|
16794
|
+
...creationModes.size ? { creationModes: [...creationModes] } : {}
|
|
16795
|
+
} : null;
|
|
16796
|
+
}
|
|
16797
|
+
function createScopedDraftModelWriter() {
|
|
16798
|
+
const captured = /* @__PURE__ */ new Map();
|
|
16799
|
+
const restore = (key) => {
|
|
16800
|
+
const entry = captured.get(key);
|
|
16801
|
+
if (!entry)
|
|
16802
|
+
return;
|
|
16803
|
+
entry.update((current) => {
|
|
16804
|
+
const settings = current.modelSettings;
|
|
16805
|
+
return settings?.model === entry.model && current.modelSettingsPersistAsDefault === false ? {
|
|
16806
|
+
...current,
|
|
16807
|
+
modelSettings: entry.original.modelSettings,
|
|
16808
|
+
modelSettingsPersistAsDefault: entry.original.modelSettingsPersistAsDefault,
|
|
16809
|
+
isManuallyChanged: entry.original.isManuallyChanged
|
|
16810
|
+
} : current;
|
|
16811
|
+
});
|
|
16812
|
+
captured.delete(key);
|
|
16813
|
+
};
|
|
16814
|
+
return {
|
|
16815
|
+
has(key) {
|
|
16816
|
+
return captured.has(key);
|
|
16817
|
+
},
|
|
16818
|
+
apply(key, binding, model2) {
|
|
16819
|
+
if (model2 === null) {
|
|
16820
|
+
restore(key);
|
|
16821
|
+
return;
|
|
16822
|
+
}
|
|
16823
|
+
const { update, usesAccountPreferences } = binding;
|
|
16824
|
+
update((current) => {
|
|
16825
|
+
const previous = captured.get(key);
|
|
16826
|
+
captured.set(key, { update, original: previous?.original ?? current, model: model2 });
|
|
16827
|
+
const settings = current.modelSettings;
|
|
16828
|
+
if (settings?.model === model2 && settings.usesAccountPreferences === usesAccountPreferences && current.modelSettingsPersistAsDefault === false)
|
|
16829
|
+
return current;
|
|
16830
|
+
return {
|
|
16831
|
+
...current,
|
|
16832
|
+
isManuallyChanged: true,
|
|
16833
|
+
modelSettingsPersistAsDefault: false,
|
|
16834
|
+
modelSettings: {
|
|
16835
|
+
...settings,
|
|
16836
|
+
model: model2,
|
|
16837
|
+
reasoningEffort: settings?.reasoningEffort ?? null,
|
|
16838
|
+
profile: settings?.profile ?? null,
|
|
16839
|
+
usesAccountPreferences
|
|
16840
|
+
}
|
|
16841
|
+
};
|
|
16842
|
+
});
|
|
16843
|
+
},
|
|
16844
|
+
dispose() {
|
|
16845
|
+
for (const key of captured.keys())
|
|
16846
|
+
restore(key);
|
|
16847
|
+
}
|
|
16848
|
+
};
|
|
16849
|
+
}
|
|
16850
|
+
|
|
16851
|
+
// ../desktop-control/dist/renderer-native-schedule-form.js
|
|
16852
|
+
var record2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
16853
|
+
function ancestors(element) {
|
|
16854
|
+
if (!record2(element))
|
|
16855
|
+
return [];
|
|
16856
|
+
const key = Object.getOwnPropertyNames(element).find((name) => name.startsWith("__reactFiber$"));
|
|
16857
|
+
return committedReactAncestors(key ? Object.getOwnPropertyDescriptor(element, key)?.value : null);
|
|
16858
|
+
}
|
|
16859
|
+
function readNativeScheduleForm(form) {
|
|
16860
|
+
const candidates = ancestors(form).flatMap(({ memoizedProps: props2 }) => {
|
|
16861
|
+
if (!record2(props2) || !record2(props2.setup) || props2.setup.triggerMode !== "create" || !record2(props2.draft) || !record2(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")
|
|
16862
|
+
return [];
|
|
16863
|
+
return [props2];
|
|
16864
|
+
});
|
|
16865
|
+
const props = candidates[0];
|
|
16866
|
+
if (!props || candidates.some((other) => other.draft !== props.draft || other.onChange !== props.onChange || other.onSubmit !== props.onSubmit))
|
|
16867
|
+
return null;
|
|
16868
|
+
const draft = props.draft;
|
|
16869
|
+
const change = props.onChange;
|
|
16870
|
+
const supportsExternal = props.executionLocation === "local" && draft.kind === "heartbeat" && draft.cloudTeam == null && (!record2(props.creation) || props.creation.type === "task") && (!record2(draft.eventTrigger) || draft.eventTrigger.selected !== true) && (!Array.isArray(draft.webhookTriggers) || draft.webhookTriggers.length === 0);
|
|
16871
|
+
return {
|
|
16872
|
+
selection: {
|
|
16873
|
+
model: draft.model,
|
|
16874
|
+
reasoningEffort: draft.reasoningEffort
|
|
16875
|
+
},
|
|
16876
|
+
supportsExternal,
|
|
16877
|
+
hasTarget: draft.targetThreadId != null,
|
|
16878
|
+
isSaving: props.isSaving,
|
|
16879
|
+
title: (typeof draft.name === "string" ? draft.name.trim() : "") || String(draft.prompt).trim().replace(/\s+/gu, " ").slice(0, 80),
|
|
16880
|
+
targetThreadId: typeof draft.targetThreadId === "string" ? draft.targetThreadId : null,
|
|
16881
|
+
setTargetThread(threadId, expectedModel) {
|
|
16882
|
+
if (!supportsExternal || props.isSaving || draft.targetThreadId != null || !threadId || !expectedModel.startsWith("codexhost/plugin-v1@"))
|
|
16883
|
+
return;
|
|
16884
|
+
change((current) => current.id == null && current.targetThreadId == null && current.kind === "heartbeat" && current.cloudTeam == null && current.model === expectedModel ? { ...current, targetThreadId: threadId } : current);
|
|
16885
|
+
},
|
|
16886
|
+
setModel(selection) {
|
|
16887
|
+
if (props.isSaving || draft.targetThreadId != null)
|
|
16888
|
+
return;
|
|
16889
|
+
change((current) => current.id == null && current.targetThreadId == null && current.kind === draft.kind ? { ...current, ...selection } : current);
|
|
16890
|
+
}
|
|
16891
|
+
};
|
|
16892
|
+
}
|
|
16893
|
+
function nativeScheduleModelRows(form) {
|
|
16894
|
+
const rows = /* @__PURE__ */ new Set();
|
|
16895
|
+
for (const button2 of form.querySelectorAll("button")) {
|
|
16896
|
+
let host = null;
|
|
16897
|
+
for (const fiber of ancestors(button2)) {
|
|
16898
|
+
const node = fiber.stateNode;
|
|
16899
|
+
if (node === form)
|
|
16900
|
+
break;
|
|
16901
|
+
if (record2(node) && node.nodeType === 1 && typeof node.hidden === "boolean" && record2(node.style) && ["getPropertyValue", "getPropertyPriority", "setProperty"].every((method) => typeof node.style[method] === "function") && form.contains(node))
|
|
16902
|
+
host = node;
|
|
16903
|
+
const props = fiber.memoizedProps;
|
|
16904
|
+
const label = record2(props) && record2(props.label) ? props.label.props : null;
|
|
16905
|
+
if (record2(label) && ["inbox.automations.model.label", "automations.configuration.effort"].includes(String(label.id))) {
|
|
16906
|
+
if (host)
|
|
16907
|
+
rows.add(host);
|
|
16908
|
+
break;
|
|
16909
|
+
}
|
|
16910
|
+
}
|
|
16911
|
+
}
|
|
16912
|
+
return [...rows];
|
|
16913
|
+
}
|
|
16914
|
+
|
|
16915
|
+
// ../desktop-control/dist/renderer-host-discovery.js
|
|
16916
|
+
function requestManagerFromHookState(value, hostId2) {
|
|
16917
|
+
const record15 = (candidate) => typeof candidate === "object" && candidate !== null;
|
|
16918
|
+
const manager = (candidate) => {
|
|
16919
|
+
if (!record15(candidate) || !record15(candidate.requestClient) || !record15(candidate.prewarmedThreadManager))
|
|
16920
|
+
return null;
|
|
16921
|
+
const bridge = candidate.requestClient;
|
|
16922
|
+
return typeof candidate.sendRequest === "function" && typeof bridge.sendRequest === "function" && typeof bridge.prewarmThreadStart === "function" && typeof bridge.enqueueRequest === "function" && typeof candidate.prewarmedThreadManager.discardAllPrewarmedThreads === "function" ? candidate : null;
|
|
16923
|
+
};
|
|
16924
|
+
if (!record15(value))
|
|
16925
|
+
return null;
|
|
16926
|
+
const direct = manager(value) ?? manager(value.manager);
|
|
16927
|
+
if (direct)
|
|
16928
|
+
return direct;
|
|
16929
|
+
if (!hostId2 || typeof value.addManager !== "function" || typeof value.getForHostId !== "function")
|
|
16930
|
+
return null;
|
|
16931
|
+
try {
|
|
16932
|
+
return manager(value.getForHostId(hostId2));
|
|
16933
|
+
} catch {
|
|
16934
|
+
return null;
|
|
16935
|
+
}
|
|
16936
|
+
}
|
|
16937
|
+
function discoverRendererHosts(root, ancestors2 = committedReactAncestors, managerFrom = requestManagerFromHookState) {
|
|
16938
|
+
const editors = [
|
|
16939
|
+
...root.querySelectorAll('[data-codex-composer], [contenteditable="true"][role="textbox"]')
|
|
16940
|
+
];
|
|
16941
|
+
const hostIds = /* @__PURE__ */ new Set();
|
|
16942
|
+
const managers = /* @__PURE__ */ new Set();
|
|
16943
|
+
const registries = /* @__PURE__ */ new Set();
|
|
16944
|
+
const fibers = /* @__PURE__ */ new Set();
|
|
16945
|
+
for (const editor of editors) {
|
|
16946
|
+
let element = editor;
|
|
16947
|
+
let fiber;
|
|
16948
|
+
while (element && !fiber) {
|
|
16949
|
+
const key = Object.getOwnPropertyNames(element).find((name) => name.startsWith("__reactFiber$"));
|
|
16950
|
+
if (key)
|
|
16951
|
+
fiber = Object.getOwnPropertyDescriptor(element, key)?.value;
|
|
16952
|
+
element = element.parentElement ?? null;
|
|
16953
|
+
}
|
|
16954
|
+
for (const current of ancestors2(fiber)) {
|
|
16955
|
+
fibers.add(current);
|
|
16956
|
+
const props = current.memoizedProps;
|
|
16957
|
+
for (const key of ["executionTargetHostId", "permissionsHostId"]) {
|
|
16958
|
+
const hostId2 = props?.[key];
|
|
16959
|
+
if (typeof hostId2 === "string" && hostId2)
|
|
16960
|
+
hostIds.add(hostId2);
|
|
16961
|
+
}
|
|
16962
|
+
}
|
|
16963
|
+
}
|
|
16964
|
+
for (const fiber of fibers) {
|
|
16965
|
+
let hook = fiber.memoizedState;
|
|
16966
|
+
for (let index = 0; hook && index < 120; index += 1) {
|
|
16967
|
+
const value = hook.memoizedState;
|
|
16968
|
+
const manager = managerFrom(value);
|
|
16969
|
+
if (manager)
|
|
16970
|
+
managers.add(manager);
|
|
16971
|
+
if (value && typeof value === "object" && "addManager" in value && typeof value.addManager === "function" && "getForHostId" in value && typeof value.getForHostId === "function") {
|
|
16972
|
+
registries.add(value);
|
|
16973
|
+
}
|
|
16974
|
+
hook = hook.next && typeof hook.next === "object" ? hook.next : null;
|
|
16975
|
+
}
|
|
16976
|
+
}
|
|
16977
|
+
return {
|
|
16978
|
+
editorCount: editors.length,
|
|
16979
|
+
hostIds: [...hostIds],
|
|
16980
|
+
managers: [...managers],
|
|
16981
|
+
registries: [...registries]
|
|
16982
|
+
};
|
|
16983
|
+
}
|
|
16984
|
+
|
|
16985
|
+
// ../desktop-control/dist/renderer-host-rpc-discovery.js
|
|
16986
|
+
function findRendererHostRpcFamily(store) {
|
|
16987
|
+
const record15 = (value) => typeof value === "object" && value !== null;
|
|
16988
|
+
const families = /* @__PURE__ */ new Set();
|
|
16989
|
+
for (const [definition, members] of store.familyBindings) {
|
|
16990
|
+
if (!record15(definition) || definition.kind !== "signal-family")
|
|
16991
|
+
continue;
|
|
16992
|
+
if (!record15(members) || typeof members.get !== "function")
|
|
16993
|
+
continue;
|
|
16994
|
+
for (const [hostId2, member] of members) {
|
|
16995
|
+
if (typeof hostId2 !== "string" || !record15(member))
|
|
16996
|
+
continue;
|
|
16997
|
+
const signal = member.value;
|
|
16998
|
+
if (!record15(signal) || typeof signal.get !== "function")
|
|
16999
|
+
continue;
|
|
17000
|
+
let value;
|
|
17001
|
+
try {
|
|
17002
|
+
value = signal.get();
|
|
17003
|
+
} catch {
|
|
17004
|
+
continue;
|
|
17005
|
+
}
|
|
17006
|
+
if (record15(value) && Object.keys(value).length === 2 && typeof value.status === "string" && record15(value.client) && value.client.hostId === hostId2 && "rpc" in value.client) {
|
|
17007
|
+
families.add(members);
|
|
17008
|
+
break;
|
|
17009
|
+
}
|
|
17010
|
+
}
|
|
17011
|
+
}
|
|
17012
|
+
if (families.size !== 1)
|
|
17013
|
+
return null;
|
|
17014
|
+
return { store, family: families.values().next().value };
|
|
17015
|
+
}
|
|
17016
|
+
function resolveRendererHostRpc(discovery, hostId2) {
|
|
17017
|
+
const record15 = (value2) => typeof value2 === "object" && value2 !== null;
|
|
17018
|
+
const signal = discovery.family.get(hostId2)?.value;
|
|
17019
|
+
if (!record15(signal) || typeof signal.get !== "function")
|
|
17020
|
+
return null;
|
|
17021
|
+
let value;
|
|
17022
|
+
try {
|
|
17023
|
+
value = signal.get();
|
|
17024
|
+
} catch {
|
|
17025
|
+
return null;
|
|
17026
|
+
}
|
|
17027
|
+
if (!record15(value) || value.status !== "ready" || !record15(value.client) || value.client.hostId !== hostId2)
|
|
17028
|
+
return null;
|
|
17029
|
+
const rpc = value.client.rpc;
|
|
17030
|
+
return typeof rpc === "function" || record15(rpc) ? rpc : null;
|
|
17031
|
+
}
|
|
17032
|
+
|
|
17033
|
+
// ../desktop-control/dist/renderer-schedule-workspace-rpc.js
|
|
17034
|
+
var record3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
17035
|
+
function localAppScope(root) {
|
|
17036
|
+
const scopes = /* @__PURE__ */ new Map();
|
|
17037
|
+
const seen = /* @__PURE__ */ new Set();
|
|
17038
|
+
for (const main of root.querySelectorAll("main")) {
|
|
17039
|
+
const keys = Object.getOwnPropertyNames(main).filter((key2) => key2.startsWith("__reactFiber$"));
|
|
17040
|
+
const key = keys[0];
|
|
17041
|
+
if (keys.length !== 1 || !key)
|
|
17042
|
+
continue;
|
|
17043
|
+
for (const fiber of committedReactAncestors(Reflect.get(main, key))) {
|
|
17044
|
+
if (seen.has(fiber))
|
|
17045
|
+
break;
|
|
17046
|
+
seen.add(fiber);
|
|
17047
|
+
let hook = fiber.memoizedState;
|
|
17048
|
+
for (let n = 0; record3(hook) && "next" in hook && n < 150; n++, hook = hook.next) {
|
|
17049
|
+
const handle = record3(hook.memoizedState) ? hook.memoizedState.current : null;
|
|
17050
|
+
if (!record3(handle) || !record3(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))
|
|
17051
|
+
continue;
|
|
17052
|
+
scopes.set(handle.node, { handle, store: handle.node });
|
|
17053
|
+
}
|
|
17054
|
+
}
|
|
17055
|
+
}
|
|
17056
|
+
const scope = scopes.values().next().value;
|
|
17057
|
+
if (scopes.size !== 1 || !scope)
|
|
17058
|
+
throw new Error("Native local app scope is missing or ambiguous");
|
|
17059
|
+
const discovery = findRendererHostRpcFamily(scope.store);
|
|
17060
|
+
const rpc = discovery && resolveRendererHostRpc(discovery, "local");
|
|
17061
|
+
if (!discovery || !rpc)
|
|
17062
|
+
throw new Error("Native local app RPC is unavailable");
|
|
17063
|
+
return { ...scope, discovery, rpc };
|
|
17064
|
+
}
|
|
17065
|
+
async function createRpcScheduleWorkspaceThread(root, routing, route, createThread, input, signal) {
|
|
17066
|
+
if (!route.policy.scopedCreation)
|
|
17067
|
+
throw new Error("Native local chat creation is unavailable");
|
|
17068
|
+
const scope = localAppScope(root);
|
|
17069
|
+
const assertConnection = () => {
|
|
17070
|
+
if (routing.forHost("local")?.manager !== route.manager || resolveRendererHostRpc(scope.discovery, "local") !== scope.rpc)
|
|
17071
|
+
throw new Error("The local connection changed. Reopen the task dialog.");
|
|
17072
|
+
};
|
|
17073
|
+
const assertCurrent = () => {
|
|
17074
|
+
signal.throwIfAborted();
|
|
17075
|
+
assertConnection();
|
|
17076
|
+
};
|
|
17077
|
+
const request = async (method, params) => {
|
|
17078
|
+
assertConnection();
|
|
17079
|
+
return route.manager.sendRequest(method, params);
|
|
17080
|
+
};
|
|
17081
|
+
const readEmpty = async (threadId) => {
|
|
17082
|
+
const read = await request("thread/read", { threadId, includeTurns: false });
|
|
17083
|
+
if (!record3(read) || !record3(read.thread) || read.thread.id !== threadId || !record3(read.thread.status))
|
|
17084
|
+
throw new Error("The created chat could not be read");
|
|
17085
|
+
const turns = await request("thread/turns/list", { threadId, cursor: null, limit: 1 });
|
|
17086
|
+
const queue = await request("thread/queue/list", { threadId, cursor: null, limit: 1 });
|
|
17087
|
+
if (!record3(turns) || !Array.isArray(turns.data) || !("nextCursor" in turns) || !record3(queue) || !Array.isArray(queue.data) || !("nextCursor" in queue))
|
|
17088
|
+
throw new Error("The created chat's history or queue could not be confirmed");
|
|
17089
|
+
return {
|
|
17090
|
+
thread: read.thread,
|
|
17091
|
+
empty: read.thread.status.type === "idle" && turns.data.length === 0 && turns.nextCursor === null && queue.data.length === 0 && queue.nextCursor === null
|
|
17092
|
+
};
|
|
17093
|
+
};
|
|
17094
|
+
assertCurrent();
|
|
17095
|
+
let createdId = null;
|
|
17096
|
+
let retained = false;
|
|
17097
|
+
let failed = false;
|
|
17098
|
+
let cleanup;
|
|
17099
|
+
const discard = () => {
|
|
17100
|
+
if (!createdId || retained)
|
|
17101
|
+
return Promise.resolve();
|
|
17102
|
+
const threadId = createdId;
|
|
17103
|
+
return cleanup ??= (async () => {
|
|
17104
|
+
const { empty } = await readEmpty(threadId);
|
|
17105
|
+
if (!empty || retained)
|
|
17106
|
+
return;
|
|
17107
|
+
await request("thread/archive", { threadId });
|
|
17108
|
+
})();
|
|
17109
|
+
};
|
|
17110
|
+
const discardAfterDismissal = () => {
|
|
17111
|
+
void discard().catch((error51) => {
|
|
17112
|
+
console.error("Could not discard the unsubmitted schedule chat. Check the chat list.", error51);
|
|
17113
|
+
});
|
|
17114
|
+
};
|
|
17115
|
+
signal.addEventListener("abort", discardAfterDismissal, { once: true });
|
|
17116
|
+
const remember = (result) => {
|
|
17117
|
+
if (!record3(result) || result.status !== "created")
|
|
17118
|
+
return;
|
|
17119
|
+
const id = hostThreadIdSchema.safeParse(result.conversationId);
|
|
17120
|
+
if (!id.success)
|
|
17121
|
+
return;
|
|
17122
|
+
if (createdId && createdId !== id.data)
|
|
17123
|
+
throw new Error("Chat creation returned conflicting identities");
|
|
17124
|
+
createdId = id.data;
|
|
17125
|
+
if (signal.aborted || failed)
|
|
17126
|
+
discardAfterDismissal();
|
|
17127
|
+
};
|
|
17128
|
+
try {
|
|
17129
|
+
const output = await createThread({
|
|
17130
|
+
scope: scope.handle,
|
|
17131
|
+
target: { type: "project", projectId: input.workspace.id, environment: { type: "local" } },
|
|
17132
|
+
model: input.model,
|
|
17133
|
+
title: input.title,
|
|
17134
|
+
prompt: "",
|
|
17135
|
+
startWithoutFirstTurn: true,
|
|
17136
|
+
assertRequestCurrent: assertCurrent,
|
|
17137
|
+
onSettled: remember
|
|
17138
|
+
});
|
|
17139
|
+
const result = record3(output) && output.kind === "creation" ? output.result : null;
|
|
17140
|
+
remember(result);
|
|
17141
|
+
assertCurrent();
|
|
17142
|
+
if (!record3(result) || result.status !== "created" || !createdId || !record3(result.firstTurn) || result.firstTurn.status !== "not-requested")
|
|
17143
|
+
throw new Error("Chat creation was not confirmed. Check the chat list before creating another task.");
|
|
17144
|
+
const { thread, empty } = await readEmpty(createdId);
|
|
17145
|
+
const inspection = threadInspectionSchema.parse(await request("codexhost/thread/inspect", { threadId: createdId }));
|
|
17146
|
+
assertCurrent();
|
|
17147
|
+
if (!empty || thread.cwd !== input.workspace.cwd || inspection.owner !== "external" || inspection.transportModelId !== input.model)
|
|
17148
|
+
throw new Error("The created chat's workspace, Model or empty state could not be confirmed");
|
|
17149
|
+
return {
|
|
17150
|
+
threadId: createdId,
|
|
17151
|
+
discard,
|
|
17152
|
+
retain() {
|
|
17153
|
+
retained = true;
|
|
17154
|
+
signal.removeEventListener("abort", discardAfterDismissal);
|
|
17155
|
+
}
|
|
17156
|
+
};
|
|
17157
|
+
} catch (error51) {
|
|
17158
|
+
failed = true;
|
|
17159
|
+
try {
|
|
17160
|
+
await discard();
|
|
17161
|
+
} catch (cleanupError) {
|
|
17162
|
+
throw new Error(`${error51 instanceof Error ? error51.message : String(error51)}; Chat cleanup failed: ${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)}. Check the chat list.`);
|
|
17163
|
+
}
|
|
17164
|
+
throw error51;
|
|
17165
|
+
}
|
|
17166
|
+
}
|
|
17167
|
+
|
|
17168
|
+
// ../desktop-control/dist/renderer-schedule-workspace.js
|
|
17169
|
+
var record4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
17170
|
+
function readNativeScheduleWorkspaces(root) {
|
|
17171
|
+
const projects = /* @__PURE__ */ new Map();
|
|
17172
|
+
const ambiguous = /* @__PURE__ */ new Set();
|
|
17173
|
+
const seen = /* @__PURE__ */ new Set();
|
|
17174
|
+
const add = (value) => {
|
|
17175
|
+
if (!record4(value) || value.source !== "codex" || !record4(value.group))
|
|
17176
|
+
return;
|
|
17177
|
+
const group = value.group;
|
|
17178
|
+
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"))
|
|
17179
|
+
return;
|
|
17180
|
+
const next = { id: group.projectId, label: group.label || group.path, cwd: group.path };
|
|
17181
|
+
const previous = projects.get(next.id);
|
|
17182
|
+
if (previous && previous.cwd !== next.cwd)
|
|
17183
|
+
ambiguous.add(next.id);
|
|
17184
|
+
else
|
|
17185
|
+
projects.set(next.id, next);
|
|
17186
|
+
};
|
|
17187
|
+
for (const element of root.querySelectorAll("aside [data-sidebar-cycle-item]")) {
|
|
17188
|
+
const keys = Object.getOwnPropertyNames(element).filter((key2) => key2.startsWith("__reactFiber$"));
|
|
17189
|
+
const key = keys[0];
|
|
17190
|
+
if (keys.length !== 1 || !key)
|
|
17191
|
+
continue;
|
|
17192
|
+
for (const fiber of committedReactAncestors(Reflect.get(element, key))) {
|
|
17193
|
+
if (seen.has(fiber))
|
|
17194
|
+
break;
|
|
17195
|
+
seen.add(fiber);
|
|
17196
|
+
const props = fiber.memoizedProps;
|
|
17197
|
+
if (!record4(props))
|
|
17198
|
+
continue;
|
|
17199
|
+
add(props.project);
|
|
17200
|
+
if (props.projectByKey instanceof Map)
|
|
17201
|
+
for (const project3 of props.projectByKey.values())
|
|
17202
|
+
add(project3);
|
|
17203
|
+
}
|
|
17204
|
+
}
|
|
17205
|
+
return [...projects.values()].filter(({ id }) => !ambiguous.has(id));
|
|
17206
|
+
}
|
|
17207
|
+
function isNativeProjectThreadCreator(value) {
|
|
17208
|
+
try {
|
|
17209
|
+
if (typeof value !== "function" || value.length !== 1)
|
|
17210
|
+
return false;
|
|
17211
|
+
const source = Function.prototype.toString.call(value);
|
|
17212
|
+
return /^async function/u.test(source) && source.includes("startWithoutFirstTurn:") && source.includes("onSettled:") && source.includes("createThread config is not supported for delegated thread creation") && source.includes("createThread serviceName is only supported for local Electron root threads outside worktrees");
|
|
17213
|
+
} catch {
|
|
17214
|
+
return false;
|
|
17215
|
+
}
|
|
17216
|
+
}
|
|
17217
|
+
async function createNativeScheduleWorkspaceThread(root, routing, createThread, input, signal) {
|
|
17218
|
+
if (!decodeHarnessPluginRoute(input.model))
|
|
17219
|
+
throw new Error("An external Harness is required");
|
|
17220
|
+
const route = routing.forHost("local");
|
|
17221
|
+
if (route && Reflect.get(route.manager, "kind") === "main-process-rpc") {
|
|
17222
|
+
if (!readNativeScheduleWorkspaces(root).some(({ id, cwd }) => id === input.workspace.id && cwd === input.workspace.cwd))
|
|
17223
|
+
throw new Error("The selected workspace is no longer available");
|
|
17224
|
+
return createRpcScheduleWorkspaceThread(root, routing, route, createThread, input, signal);
|
|
17225
|
+
}
|
|
17226
|
+
const manager = route?.manager;
|
|
17227
|
+
if (!route?.policy.scopedCreation || !manager || typeof manager.getConversation !== "function" || typeof manager.archiveConversation !== "function")
|
|
17228
|
+
throw new Error("Native local chat creation is unavailable");
|
|
17229
|
+
const discovery = discoverRendererHosts({
|
|
17230
|
+
querySelectorAll: () => root.querySelectorAll("main")
|
|
17231
|
+
});
|
|
17232
|
+
const scopes = new Set(discovery.registries.flatMap((registry2) => {
|
|
17233
|
+
try {
|
|
17234
|
+
return registry2.getForHostId("local") === manager ? [Reflect.get(registry2, "scope")] : [];
|
|
17235
|
+
} catch {
|
|
17236
|
+
return [];
|
|
17237
|
+
}
|
|
17238
|
+
}));
|
|
17239
|
+
const scope = scopes.values().next().value;
|
|
17240
|
+
if (scopes.size !== 1 || !record4(scope) || typeof scope.get !== "function")
|
|
17241
|
+
throw new Error("Native local chat scope is missing or ambiguous");
|
|
17242
|
+
if (!readNativeScheduleWorkspaces(root).some(({ id, cwd }) => id === input.workspace.id && cwd === input.workspace.cwd))
|
|
17243
|
+
throw new Error("The selected workspace is no longer available");
|
|
17244
|
+
signal.throwIfAborted();
|
|
17245
|
+
let createdId = null;
|
|
17246
|
+
let released = false;
|
|
17247
|
+
const discard = () => {
|
|
17248
|
+
if (!createdId || released)
|
|
17249
|
+
return;
|
|
17250
|
+
const id = createdId;
|
|
17251
|
+
released = true;
|
|
17252
|
+
const conversation2 = manager.getConversation(id);
|
|
17253
|
+
if (!record4(conversation2) || !Array.isArray(conversation2.turns) || conversation2.turns.length || Array.isArray(conversation2.requests) && conversation2.requests.length > 0 || conversation2.pendingRequest != null)
|
|
17254
|
+
return;
|
|
17255
|
+
void Promise.resolve().then(() => manager.archiveConversation(id, {
|
|
17256
|
+
useAppServerPins: false,
|
|
17257
|
+
source: "automation_history"
|
|
17258
|
+
})).catch(() => void 0);
|
|
17259
|
+
};
|
|
17260
|
+
signal.addEventListener("abort", discard, { once: true });
|
|
17261
|
+
const remember = (result2) => {
|
|
17262
|
+
if (!record4(result2) || result2.status !== "created")
|
|
17263
|
+
return;
|
|
17264
|
+
const id = hostThreadIdSchema.safeParse(result2.conversationId);
|
|
17265
|
+
if (id.success)
|
|
17266
|
+
createdId = id.data;
|
|
17267
|
+
if (signal.aborted)
|
|
17268
|
+
discard();
|
|
17269
|
+
};
|
|
17270
|
+
const output = await createThread({
|
|
17271
|
+
scope,
|
|
17272
|
+
target: { type: "project", projectId: input.workspace.id, environment: { type: "local" } },
|
|
17273
|
+
model: input.model,
|
|
17274
|
+
title: input.title,
|
|
17275
|
+
prompt: "",
|
|
17276
|
+
startWithoutFirstTurn: true,
|
|
17277
|
+
onSettled: remember
|
|
17278
|
+
});
|
|
17279
|
+
const result = record4(output) && output.kind === "creation" ? output.result : null;
|
|
17280
|
+
remember(result);
|
|
17281
|
+
signal.throwIfAborted();
|
|
17282
|
+
if (!record4(result) || result.status !== "created" || !createdId || !record4(result.firstTurn) || result.firstTurn.status !== "not-requested")
|
|
17283
|
+
throw new Error("Chat creation was not confirmed. Check the chat list before creating another task.");
|
|
17284
|
+
if (routing.forHost("local")?.manager !== route.manager)
|
|
17285
|
+
throw new Error("The local connection changed. Reopen the task dialog.");
|
|
17286
|
+
const conversation = manager.getConversation(createdId);
|
|
17287
|
+
const mode2 = record4(conversation) ? conversation.latestCollaborationMode : null;
|
|
17288
|
+
if (!record4(conversation) || conversation.cwd !== input.workspace.cwd || !record4(mode2) || !record4(mode2.settings) || mode2.settings.model !== input.model)
|
|
17289
|
+
throw new Error("The created chat's workspace or Model could not be confirmed");
|
|
17290
|
+
return {
|
|
17291
|
+
threadId: createdId,
|
|
17292
|
+
retain() {
|
|
17293
|
+
released = true;
|
|
17294
|
+
signal.removeEventListener("abort", discard);
|
|
17295
|
+
}
|
|
17296
|
+
};
|
|
17297
|
+
}
|
|
17298
|
+
|
|
16678
17299
|
// src/renderer-chat-voice-debug.ts
|
|
16679
17300
|
var CHAT_VOICE_DEBUG_GLOBAL = "__codexhostChatVoiceDebug";
|
|
16680
17301
|
var CHAT_VOICE_DEBUG_STORAGE_KEY = "codexhost.chat-voice-debug.v1";
|
|
@@ -16817,16 +17438,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16817
17438
|
var HOOK_GLOBAL = "__codexhostNativeChatVoiceV1";
|
|
16818
17439
|
var BUTTON = "data-codexhost-chat-voice-start";
|
|
16819
17440
|
var CONVERSATION_UUID = /^[a-f\d]{8}(?:-[a-f\d]{4}){3}-[a-f\d]{12}$/i;
|
|
16820
|
-
var
|
|
17441
|
+
var record5 = (value) => value !== null && typeof value === "object";
|
|
16821
17442
|
function scopeRefs(owner, definition) {
|
|
16822
17443
|
const scopes = /* @__PURE__ */ new Map();
|
|
16823
17444
|
let hook = owner.memoizedState;
|
|
16824
17445
|
const seen = /* @__PURE__ */ new Set();
|
|
16825
|
-
while (
|
|
17446
|
+
while (record5(hook) && seen.size < 4096 && !seen.has(hook)) {
|
|
16826
17447
|
seen.add(hook);
|
|
16827
17448
|
const state = hook.memoizedState;
|
|
16828
|
-
const scope =
|
|
16829
|
-
if (
|
|
17449
|
+
const scope = record5(state) ? state.current : void 0;
|
|
17450
|
+
if (record5(scope) && scope.scope === definition && typeof scope.get === "function" && typeof scope.set === "function" && scope.chain instanceof Map && scope.chain.get(definition.id) === scope.node)
|
|
16830
17451
|
scopes.set(scope.node, scope);
|
|
16831
17452
|
hook = hook.next;
|
|
16832
17453
|
}
|
|
@@ -16835,41 +17456,41 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16835
17456
|
function detectNativeChatVoiceBinding(composer, native) {
|
|
16836
17457
|
const key = Object.getOwnPropertyNames(composer).find((key2) => key2.startsWith("__reactFiber$"));
|
|
16837
17458
|
if (!key) return;
|
|
16838
|
-
const
|
|
16839
|
-
for (const owner of
|
|
17459
|
+
const ancestors2 = committedReactAncestors(Object.getOwnPropertyDescriptor(composer, key)?.value);
|
|
17460
|
+
for (const owner of ancestors2) {
|
|
16840
17461
|
const props = owner.memoizedProps;
|
|
16841
|
-
if (!
|
|
17462
|
+
if (!record5(props) || typeof props.isWorkConversation !== "boolean" || typeof props.isTemporaryChat !== "boolean" || typeof props.conversationId !== "string")
|
|
16842
17463
|
continue;
|
|
16843
|
-
if (props.isWorkConversation || props.isTemporaryChat || props.shouldBlockExternalEgress !== false || props.readOnly === true || !
|
|
17464
|
+
if (props.isWorkConversation || props.isTemporaryChat || props.shouldBlockExternalEgress !== false || props.readOnly === true || !record5(props.composerSelectionContext) || props.composerSelectionContext.conversationId !== props.conversationId)
|
|
16844
17465
|
return;
|
|
16845
17466
|
const scopes = scopeRefs(owner, native.ownerScopeDefinition);
|
|
16846
17467
|
if (scopes.size !== 1) return;
|
|
16847
17468
|
const scope = [...scopes.values()][0];
|
|
16848
17469
|
if (!scope) return;
|
|
16849
17470
|
const appNode = scope.chain.get(native.scopeDefinition.id);
|
|
16850
|
-
if (!
|
|
17471
|
+
if (!record5(appNode)) return;
|
|
16851
17472
|
const backendId = scope.get(native.backendConversationId, props.conversationId);
|
|
16852
17473
|
const hasBackendId = typeof backendId === "string" && CONVERSATION_UUID.test(backendId);
|
|
16853
17474
|
const isDraft = backendId == null && props.conversationId.startsWith("local-chatgpt:") && CONVERSATION_UUID.test(props.conversationId.slice("local-chatgpt:".length));
|
|
16854
17475
|
if (!hasBackendId && !isDraft) return;
|
|
16855
|
-
const provider =
|
|
16856
|
-
(fiber) => fiber.tag === 10 &&
|
|
17476
|
+
const provider = ancestors2.slice(0, ancestors2.indexOf(owner)).find(
|
|
17477
|
+
(fiber) => fiber.tag === 10 && record5(fiber.type) && fiber.type.displayName === native.composerScopeDefinition.__scopeBrand
|
|
16857
17478
|
);
|
|
16858
17479
|
if (!provider) return;
|
|
16859
|
-
const composerChain =
|
|
17480
|
+
const composerChain = record5(provider.memoizedProps) ? provider.memoizedProps.value : void 0;
|
|
16860
17481
|
const composerNode = composerChain instanceof Map ? composerChain.get(native.composerScopeDefinition.id) : void 0;
|
|
16861
|
-
if (!(composerChain instanceof Map) || composerChain.get(native.scopeDefinition.id) !== appNode || composerChain.get(native.ownerScopeDefinition.id) !== scope.node || !
|
|
17482
|
+
if (!(composerChain instanceof Map) || composerChain.get(native.scopeDefinition.id) !== appNode || composerChain.get(native.ownerScopeDefinition.id) !== scope.node || !record5(composerNode) || composerNode.token !== native.composerScopeDefinition || !record5(composerNode.value) || composerNode.value.kind !== "chatgpt" || !record5(composerNode.value.chatGptSelectionContext) || composerNode.value.chatGptSelectionContext.conversationId !== props.conversationId)
|
|
16862
17483
|
return;
|
|
16863
17484
|
const composerContext = { context: provider.type, chain: composerChain };
|
|
16864
17485
|
const contexts = /* @__PURE__ */ new Set();
|
|
16865
|
-
for (const fiber of
|
|
16866
|
-
let dependency =
|
|
17486
|
+
for (const fiber of ancestors2) {
|
|
17487
|
+
let dependency = record5(fiber.dependencies) ? fiber.dependencies.firstContext : void 0;
|
|
16867
17488
|
const seenDependencies = /* @__PURE__ */ new Set();
|
|
16868
|
-
while (
|
|
17489
|
+
while (record5(dependency) && seenDependencies.size < 4096 && !seenDependencies.has(dependency)) {
|
|
16869
17490
|
seenDependencies.add(dependency);
|
|
16870
17491
|
const context = dependency.context;
|
|
16871
17492
|
const chain = dependency.memoizedValue;
|
|
16872
|
-
if (
|
|
17493
|
+
if (record5(context) && context.displayName === native.scopeDefinition.__scopeBrand && chain instanceof Map && chain.get(native.scopeDefinition.id) === appNode)
|
|
16873
17494
|
contexts.add(context);
|
|
16874
17495
|
dependency = dependency.next;
|
|
16875
17496
|
}
|
|
@@ -16887,7 +17508,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16887
17508
|
}
|
|
16888
17509
|
}
|
|
16889
17510
|
function startNativeChatVoiceForRequest(request, target = globalThis) {
|
|
16890
|
-
if (!
|
|
17511
|
+
if (!record5(request) || request.productExperience !== "chat" || !nativeChatVoicePreferenceAllowsStart(target))
|
|
16891
17512
|
return;
|
|
16892
17513
|
const hook = target[HOOK_GLOBAL];
|
|
16893
17514
|
if (!hook || hook.status === "disabled" || hook.status === "unsupported")
|
|
@@ -17939,8 +18560,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17939
18560
|
if (!ownerWindow.document || !ownerWindow.location) return null;
|
|
17940
18561
|
const page = new URL(ownerWindow.location.href);
|
|
17941
18562
|
const urls = /* @__PURE__ */ new Set();
|
|
17942
|
-
|
|
17943
|
-
|
|
18563
|
+
const catalog = Reflect.get(ownerWindow, "__codexhostLoadedModulesV1");
|
|
18564
|
+
let sources;
|
|
18565
|
+
if (catalog !== void 0) {
|
|
18566
|
+
if (typeof catalog !== "object" || catalog === null || !("complete" in catalog) || catalog.complete !== true || !("documentUrl" in catalog) || catalog.documentUrl !== page.href || !("urls" in catalog) || !Array.isArray(catalog.urls) || catalog.urls.length > 4096 || catalog.urls.some((url2) => typeof url2 !== "string"))
|
|
18567
|
+
throw new Error("Codex loaded module catalog is unavailable in this window");
|
|
18568
|
+
sources = catalog.urls;
|
|
18569
|
+
} else {
|
|
18570
|
+
sources = [...ownerWindow.document.querySelectorAll('link[rel="modulepreload"][href]')].map(
|
|
18571
|
+
(link) => link.getAttribute("href") ?? ""
|
|
18572
|
+
);
|
|
18573
|
+
}
|
|
18574
|
+
for (const source of sources) {
|
|
18575
|
+
let url2;
|
|
18576
|
+
try {
|
|
18577
|
+
url2 = new URL(source, page);
|
|
18578
|
+
} catch {
|
|
18579
|
+
continue;
|
|
18580
|
+
}
|
|
17944
18581
|
if (url2.protocol === page.protocol && url2.host === page.host && url2.pathname.endsWith(".js") && !url2.search && !url2.hash)
|
|
17945
18582
|
urls.add(url2.href);
|
|
17946
18583
|
}
|
|
@@ -17958,13 +18595,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17958
18595
|
for (const value of Object.values(module).filter(matchesServices)) matches.add(value);
|
|
17959
18596
|
if (matches.size > 1) throw new Error("Codex native services are unavailable in this window");
|
|
17960
18597
|
}
|
|
18598
|
+
if (catalog !== void 0 && Reflect.get(ownerWindow, "__codexhostLoadedModulesV1") !== catalog)
|
|
18599
|
+
throw new Error("Codex loaded module catalog changed during discovery. Try again once ready.");
|
|
17961
18600
|
return [...matches][0] ?? null;
|
|
17962
18601
|
}
|
|
17963
18602
|
|
|
17964
18603
|
// src/codex-ssh-services.ts
|
|
17965
|
-
var
|
|
18604
|
+
var record6 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
17966
18605
|
function isSshServices(value) {
|
|
17967
|
-
if (!
|
|
18606
|
+
if (!record6(value) || !Object.hasOwn(value, "sshConnections") || !Object.hasOwn(value, "remoteConnections"))
|
|
17968
18607
|
return false;
|
|
17969
18608
|
const ssh = value.sshConnections;
|
|
17970
18609
|
const remote = value.remoteConnections;
|
|
@@ -17975,7 +18614,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17975
18614
|
}
|
|
17976
18615
|
|
|
17977
18616
|
// src/codex-ssh-adapter.ts
|
|
17978
|
-
var
|
|
18617
|
+
var record7 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
17979
18618
|
function createCodexSshClient(ownerWindow) {
|
|
17980
18619
|
let nativeServices;
|
|
17981
18620
|
function services() {
|
|
@@ -18011,7 +18650,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18011
18650
|
const abort = () => finish(new DOMException("Aborted", "AbortError"));
|
|
18012
18651
|
const receive = (event) => {
|
|
18013
18652
|
const message2 = event.data;
|
|
18014
|
-
if (!
|
|
18653
|
+
if (!record7(message2) || message2.type !== "fetch-response" || message2.requestId !== requestId2)
|
|
18015
18654
|
return;
|
|
18016
18655
|
if (message2.responseType !== "success" || typeof message2.status !== "number" || message2.status < 200 || message2.status >= 300 || typeof message2.bodyJsonString !== "string") {
|
|
18017
18656
|
const detail = typeof message2.error === "string" ? `: ${message2.error}` : "";
|
|
@@ -18067,12 +18706,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18067
18706
|
}
|
|
18068
18707
|
async function list(signal) {
|
|
18069
18708
|
const result = await request("refresh-remote-connections", {}, signal);
|
|
18070
|
-
if (!
|
|
18709
|
+
if (!record7(result) || !Array.isArray(result.remoteConnections))
|
|
18071
18710
|
throw new Error("Invalid Codex SSH connection list");
|
|
18072
18711
|
return result.remoteConnections.filter(
|
|
18073
|
-
(item) => !(
|
|
18712
|
+
(item) => !(record7(item) && ["wsl", "remote-control"].includes(String(item.source)))
|
|
18074
18713
|
).map((item) => {
|
|
18075
|
-
if (!
|
|
18714
|
+
if (!record7(item) || typeof item.hostId !== "string" || typeof item.displayName !== "string" || !["codex-managed", "discovered"].includes(String(item.source)) || typeof item.sshHost !== "string" || typeof item.autoConnect !== "boolean" || !(item.sshAlias == null || typeof item.sshAlias === "string") || !(item.identity == null || typeof item.identity === "string") || !(item.sshPort == null || Number.isInteger(item.sshPort) && Number(item.sshPort) > 0 && Number(item.sshPort) <= 65535)) {
|
|
18076
18715
|
throw new Error(
|
|
18077
18716
|
"This Codex version uses an unsupported SSH configuration; open native settings"
|
|
18078
18717
|
);
|
|
@@ -18144,11 +18783,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18144
18783
|
},
|
|
18145
18784
|
async state(hostId2, signal) {
|
|
18146
18785
|
const result = await request("app-server-connection-state", { hostId: hostId2 }, signal);
|
|
18147
|
-
if (!
|
|
18786
|
+
if (!record7(result) || typeof result.state !== "string")
|
|
18148
18787
|
throw new Error("Invalid Codex connection state");
|
|
18149
18788
|
return {
|
|
18150
18789
|
state: result.state,
|
|
18151
|
-
error: typeof result.error === "string" ? result.error :
|
|
18790
|
+
error: typeof result.error === "string" ? result.error : record7(result.error) && typeof result.error.message === "string" ? result.error.message : null
|
|
18152
18791
|
};
|
|
18153
18792
|
}
|
|
18154
18793
|
};
|
|
@@ -19160,6 +19799,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19160
19799
|
["path", { d: "M12 13.5V8" }]
|
|
19161
19800
|
];
|
|
19162
19801
|
|
|
19802
|
+
// ../../node_modules/lucide/dist/esm/icons/calendar-clock.mjs
|
|
19803
|
+
var CalendarClock = [
|
|
19804
|
+
["path", { d: "M16 14v2.2l1.6 1" }],
|
|
19805
|
+
["path", { d: "M16 2v3" }],
|
|
19806
|
+
["path", { d: "M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338" }],
|
|
19807
|
+
["path", { d: "M3 9h5.859" }],
|
|
19808
|
+
["path", { d: "M8 2v3" }],
|
|
19809
|
+
["circle", { cx: "16", cy: "16", r: "6" }]
|
|
19810
|
+
];
|
|
19811
|
+
|
|
19163
19812
|
// ../../node_modules/lucide/dist/esm/icons/circle-check.mjs
|
|
19164
19813
|
var CircleCheck = [
|
|
19165
19814
|
["circle", { cx: "12", cy: "12", r: "10" }],
|
|
@@ -19465,6 +20114,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19465
20114
|
"routes",
|
|
19466
20115
|
"gateway",
|
|
19467
20116
|
"updates",
|
|
20117
|
+
"schedules",
|
|
19468
20118
|
"about",
|
|
19469
20119
|
"info",
|
|
19470
20120
|
"external-link",
|
|
@@ -19516,6 +20166,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19516
20166
|
routes: Route,
|
|
19517
20167
|
gateway: Network,
|
|
19518
20168
|
updates: CircleArrowUp,
|
|
20169
|
+
schedules: CalendarClock,
|
|
19519
20170
|
about: Info,
|
|
19520
20171
|
info: Info,
|
|
19521
20172
|
"external-link": ExternalLink,
|
|
@@ -20272,14 +20923,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20272
20923
|
return {
|
|
20273
20924
|
createControls(hostId2, panels) {
|
|
20274
20925
|
const batch = batches.get(hostId2);
|
|
20275
|
-
const
|
|
20926
|
+
const count4 = eligible(panels).length;
|
|
20276
20927
|
const button2 = document2.createElement("button");
|
|
20277
20928
|
button2.type = "button";
|
|
20278
20929
|
button2.className = "settings-command-button settings-command-button--secondary settings-connection-update-all";
|
|
20279
20930
|
button2.dataset.connectionAction = "update-all";
|
|
20280
|
-
button2.disabled = signal.aborted || Boolean(batch?.running) || !
|
|
20931
|
+
button2.disabled = signal.aborted || Boolean(batch?.running) || !count4;
|
|
20281
20932
|
button2.title = messages.harnessUpdateAllDescription;
|
|
20282
|
-
const label = batch?.running ? `${messages.harnessUpdateAllProgress} ${batch.succeeded + batch.failed}/${batch.total}` :
|
|
20933
|
+
const label = batch?.running ? `${messages.harnessUpdateAllProgress} ${batch.succeeded + batch.failed}/${batch.total}` : count4 ? `${messages.harnessUpdateAll} (${count4})` : messages.harnessUpdateAll;
|
|
20283
20934
|
button2.append(createRendererSettingsIcon("download", 15), label);
|
|
20284
20935
|
button2.addEventListener("click", () => {
|
|
20285
20936
|
if (!button2.disabled) void start(hostId2, panels);
|
|
@@ -20758,11 +21409,11 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
20758
21409
|
function requestConnectionsPageFocus(agentKey) {
|
|
20759
21410
|
pendingFocusAgent = agentKey;
|
|
20760
21411
|
}
|
|
20761
|
-
function createGroupDivider(document2, messages,
|
|
21412
|
+
function createGroupDivider(document2, messages, count4) {
|
|
20762
21413
|
const divider = document2.createElement("div");
|
|
20763
21414
|
divider.className = "settings-connection-group-divider";
|
|
20764
21415
|
divider.setAttribute("role", "presentation");
|
|
20765
|
-
divider.textContent = `${messages.connectionGroupMoreLabel} (${
|
|
21416
|
+
divider.textContent = `${messages.connectionGroupMoreLabel} (${count4})`;
|
|
20766
21417
|
return divider;
|
|
20767
21418
|
}
|
|
20768
21419
|
function createGroupMoreHint(document2, messages) {
|
|
@@ -21580,7 +22231,6 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
21580
22231
|
updateLatestVersion: "Latest version",
|
|
21581
22232
|
updateUpToDate: "You are up to date.",
|
|
21582
22233
|
updateAvailable: "A new version is available.",
|
|
21583
|
-
updateWindowsManualRequired: "Automatic updates are unavailable on Windows. Update manually below.",
|
|
21584
22234
|
updateAndRestart: "Update",
|
|
21585
22235
|
updateChecking: "Checking for updates...",
|
|
21586
22236
|
updateDownloading: "Downloading update...",
|
|
@@ -21595,8 +22245,7 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
21595
22245
|
updateFailed: "Update failed.",
|
|
21596
22246
|
updateRetry: "Retry",
|
|
21597
22247
|
updateManualNpmDescription: "To update manually, quit codexhost and run this command:",
|
|
21598
|
-
|
|
21599
|
-
updateWindowsInstallerDescription: "Automatic updates are unavailable on Windows. Download and run the installer for this system.",
|
|
22248
|
+
updateWindowsInstallerDescription: "To update manually, download and run the installer for this system.",
|
|
21600
22249
|
updateManualTitle: "Manual update",
|
|
21601
22250
|
updateManualFallbackDescription: "The automatic update did not complete. Run this command in a terminal instead, then quit Codex and relaunch it with codexhost.",
|
|
21602
22251
|
updateCopyCommand: "Copy",
|
|
@@ -21890,7 +22539,6 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
21890
22539
|
updateLatestVersion: "\u6700\u65B0\u7248\u672C",
|
|
21891
22540
|
updateUpToDate: "\u5F53\u524D\u5DF2\u662F\u6700\u65B0\u7248\u672C\u3002",
|
|
21892
22541
|
updateAvailable: "\u6709\u65B0\u7248\u672C\u53EF\u7528\u3002",
|
|
21893
|
-
updateWindowsManualRequired: "Windows \u6682\u4E0D\u652F\u6301\u81EA\u52A8\u66F4\u65B0\uFF0C\u8BF7\u5728\u4E0B\u65B9\u624B\u52A8\u66F4\u65B0\u3002",
|
|
21894
22542
|
updateAndRestart: "\u66F4\u65B0",
|
|
21895
22543
|
updateChecking: "\u6B63\u5728\u68C0\u67E5\u66F4\u65B0...",
|
|
21896
22544
|
updateDownloading: "\u6B63\u5728\u4E0B\u8F7D\u66F4\u65B0...",
|
|
@@ -21905,8 +22553,7 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
21905
22553
|
updateFailed: "\u66F4\u65B0\u5931\u8D25\u3002",
|
|
21906
22554
|
updateRetry: "\u91CD\u8BD5",
|
|
21907
22555
|
updateManualNpmDescription: "\u5982\u9700\u624B\u52A8\u66F4\u65B0\uFF0C\u8BF7\u5728\u7EC8\u7AEF\u8FD0\u884C\u4EE5\u4E0B\u547D\u4EE4\u3002\u66F4\u65B0\u5B8C\u6210\u540E\uFF0C\u8BF7\u9000\u51FA Codex \u5E76\u901A\u8FC7 codexhost \u91CD\u65B0\u542F\u52A8\u3002",
|
|
21908
|
-
|
|
21909
|
-
updateWindowsInstallerDescription: "Windows \u6682\u4E0D\u652F\u6301\u81EA\u52A8\u66F4\u65B0\u3002\u8BF7\u4E0B\u8F7D\u5E76\u8FD0\u884C\u9002\u7528\u4E8E\u5F53\u524D\u7CFB\u7EDF\u7684\u5B89\u88C5\u5305\u3002",
|
|
22556
|
+
updateWindowsInstallerDescription: "\u5982\u9700\u624B\u52A8\u66F4\u65B0\uFF0C\u8BF7\u4E0B\u8F7D\u5E76\u8FD0\u884C\u9002\u7528\u4E8E\u5F53\u524D\u7CFB\u7EDF\u7684\u5B89\u88C5\u5305\u3002",
|
|
21910
22557
|
updateManualTitle: "\u624B\u52A8\u66F4\u65B0",
|
|
21911
22558
|
updateManualFallbackDescription: "\u81EA\u52A8\u66F4\u65B0\u672A\u80FD\u5B8C\u6210\uFF0C\u8BF7\u6539\u7528\u4E0B\u5217\u547D\u4EE4\u5728\u7EC8\u7AEF\u624B\u52A8\u66F4\u65B0\u3002\u5B8C\u6210\u540E\u8BF7\u9000\u51FA Codex \u5E76\u901A\u8FC7 codexhost \u91CD\u65B0\u542F\u52A8\u3002",
|
|
21912
22559
|
updateCopyCommand: "\u590D\u5236",
|
|
@@ -22964,20 +23611,20 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
22964
23611
|
}
|
|
22965
23612
|
addGroup(popover, messages.turnGroup, turn);
|
|
22966
23613
|
const tokens = [];
|
|
22967
|
-
const
|
|
23614
|
+
const count4 = (value) => value === void 0 ? "-" : formatRendererTokenCount(value);
|
|
22968
23615
|
if (usage?.inputTokens !== void 0 || usage?.outputTokens !== void 0) {
|
|
22969
23616
|
tokens.push([
|
|
22970
23617
|
messages.inputOutput,
|
|
22971
|
-
`${
|
|
23618
|
+
`${count4(usage.inputTokens)} / ${count4(usage.outputTokens)}`
|
|
22972
23619
|
]);
|
|
22973
23620
|
}
|
|
22974
23621
|
if (usage?.cacheWriteInputTokens !== void 0 && usage.cacheWriteInputTokens > 0) {
|
|
22975
23622
|
tokens.push([
|
|
22976
23623
|
messages.cacheReadWrite,
|
|
22977
|
-
`${
|
|
23624
|
+
`${count4(usage.cachedInputTokens)} / ${count4(usage.cacheWriteInputTokens)}`
|
|
22978
23625
|
]);
|
|
22979
23626
|
} else if (usage?.cachedInputTokens !== void 0) {
|
|
22980
|
-
tokens.push([messages.cacheRead,
|
|
23627
|
+
tokens.push([messages.cacheRead, count4(usage.cachedInputTokens)]);
|
|
22981
23628
|
}
|
|
22982
23629
|
if (usage?.totalTokens !== void 0) {
|
|
22983
23630
|
tokens.push([messages.totalTokens, formatRendererTokenCount(usage.totalTokens)]);
|
|
@@ -26104,13 +26751,13 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
26104
26751
|
(name) => name.startsWith("__reactFiber$")
|
|
26105
26752
|
);
|
|
26106
26753
|
if (key) {
|
|
26107
|
-
const
|
|
26754
|
+
const ancestors2 = committedReactAncestors(
|
|
26108
26755
|
Object.getOwnPropertyDescriptor(element, key)?.value
|
|
26109
26756
|
);
|
|
26110
26757
|
const scopes = [];
|
|
26111
|
-
|
|
26758
|
+
ancestors2.forEach(({ memoizedProps: props }, index) => {
|
|
26112
26759
|
if (isRecord5(props) && "onLocalSubmitStart" in props && typeof props.submitDisabled === "boolean") {
|
|
26113
|
-
scopes.push({ owner:
|
|
26760
|
+
scopes.push({ owner: ancestors2[index], fibers: ancestors2.slice(0, index + 1) });
|
|
26114
26761
|
}
|
|
26115
26762
|
});
|
|
26116
26763
|
const valid = scopes.filter((scope) => {
|
|
@@ -27561,10 +28208,72 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27561
28208
|
};
|
|
27562
28209
|
}
|
|
27563
28210
|
|
|
28211
|
+
// src/renderer-thread-reference-persistence.ts
|
|
28212
|
+
var record8 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
28213
|
+
var SYNC_TIMEOUT_MS = 2e3;
|
|
28214
|
+
function restoreRpcThreadReferenceCapability(client, messages, isCurrent) {
|
|
28215
|
+
if (!record8(messages) || !record8(messages.electronBridge)) return client;
|
|
28216
|
+
const bridge = messages.electronBridge;
|
|
28217
|
+
const send = bridge.sendMessageFromView;
|
|
28218
|
+
if (typeof send !== "function") return client;
|
|
28219
|
+
const inspect = client.inspectThread.bind(client);
|
|
28220
|
+
const checked = /* @__PURE__ */ new Set();
|
|
28221
|
+
const isMissing = (key) => new Promise((resolve) => {
|
|
28222
|
+
const finish = (missing) => {
|
|
28223
|
+
clearTimeout(timer);
|
|
28224
|
+
messages.removeEventListener("message", listener);
|
|
28225
|
+
resolve(missing);
|
|
28226
|
+
};
|
|
28227
|
+
const listener = (event) => {
|
|
28228
|
+
if (event.source != null && event.source !== messages) return;
|
|
28229
|
+
const message2 = event.data;
|
|
28230
|
+
if (!record8(message2) || message2.type !== "persisted-atom-sync" || !record8(message2.state))
|
|
28231
|
+
return;
|
|
28232
|
+
finish(!Object.hasOwn(message2.state, key));
|
|
28233
|
+
};
|
|
28234
|
+
const timer = setTimeout(() => finish(false), SYNC_TIMEOUT_MS);
|
|
28235
|
+
messages.addEventListener("message", listener);
|
|
28236
|
+
try {
|
|
28237
|
+
Promise.resolve(
|
|
28238
|
+
send.call(bridge, { type: "persisted-atom-sync-request", responsePriority: "critical" })
|
|
28239
|
+
).catch(() => finish(false));
|
|
28240
|
+
} catch {
|
|
28241
|
+
finish(false);
|
|
28242
|
+
}
|
|
28243
|
+
});
|
|
28244
|
+
const inspectThread = async (input) => {
|
|
28245
|
+
if (!isCurrent() || checked.has(input.threadId)) return inspect(input);
|
|
28246
|
+
checked.add(input.threadId);
|
|
28247
|
+
const key = `thread-reference-capability:${input.threadId}`;
|
|
28248
|
+
if (!await isMissing(key) || !isCurrent()) return inspect(input);
|
|
28249
|
+
let proven = true;
|
|
28250
|
+
const result = await inspect({ ...input, includeReferenceCapability: true }).catch(() => {
|
|
28251
|
+
proven = false;
|
|
28252
|
+
return inspect(input);
|
|
28253
|
+
});
|
|
28254
|
+
if (proven && result.owner === "codex" && result.supportsThreadReferences === true && isCurrent() && await isMissing(key) && isCurrent()) {
|
|
28255
|
+
try {
|
|
28256
|
+
await send.call(bridge, {
|
|
28257
|
+
type: "persisted-atom-update",
|
|
28258
|
+
key,
|
|
28259
|
+
value: true,
|
|
28260
|
+
deleted: false
|
|
28261
|
+
});
|
|
28262
|
+
} catch {
|
|
28263
|
+
}
|
|
28264
|
+
}
|
|
28265
|
+
return result;
|
|
28266
|
+
};
|
|
28267
|
+
return Object.freeze({ ...client, inspectThread });
|
|
28268
|
+
}
|
|
28269
|
+
|
|
27564
28270
|
// src/renderer-thread-reference-capability.ts
|
|
27565
|
-
var
|
|
27566
|
-
function restoreThreadReferenceCapability(client, manager, isCurrent) {
|
|
27567
|
-
if (
|
|
28271
|
+
var record9 = (value) => typeof value === "object" && value !== null;
|
|
28272
|
+
function restoreThreadReferenceCapability(client, manager, isCurrent, messages = null) {
|
|
28273
|
+
if (record9(manager) && manager.kind === "main-process-rpc") {
|
|
28274
|
+
return restoreRpcThreadReferenceCapability(client, messages, isCurrent);
|
|
28275
|
+
}
|
|
28276
|
+
if (!record9(manager) || !record9(manager.storage)) return client;
|
|
27568
28277
|
const storage = manager.storage;
|
|
27569
28278
|
const read = storage.readValue;
|
|
27570
28279
|
const write = storage.writeValue;
|
|
@@ -27599,14 +28308,14 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27599
28308
|
}
|
|
27600
28309
|
|
|
27601
28310
|
// src/renderer-thread-reference-context.ts
|
|
27602
|
-
var
|
|
28311
|
+
var record10 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
27603
28312
|
function createThreadReferenceContext(manager, hostId2, isCurrent) {
|
|
27604
28313
|
const prepared = /* @__PURE__ */ new WeakMap();
|
|
27605
28314
|
return (params) => {
|
|
27606
|
-
if (hostId2 === "local" || !
|
|
28315
|
+
if (hostId2 === "local" || !record10(manager) || typeof manager.getConversation !== "function" || !record10(params) || typeof params.threadId !== "string")
|
|
27607
28316
|
return params;
|
|
27608
28317
|
const conversation = manager.getConversation.call(manager, params.threadId);
|
|
27609
|
-
if (!
|
|
28318
|
+
if (!record10(conversation) || conversation.id !== params.threadId || conversation.modelProvider !== "codexhost")
|
|
27610
28319
|
return params;
|
|
27611
28320
|
if (!isCurrent()) throw new Error("Thread reference connection is no longer available");
|
|
27612
28321
|
const cached2 = prepared.get(params);
|
|
@@ -27712,7 +28421,8 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27712
28421
|
const client = restoreThreadReferenceCapability(
|
|
27713
28422
|
nativeClient,
|
|
27714
28423
|
target,
|
|
27715
|
-
() => !disposed && readRouting()?.forHost(route.hostId) === route
|
|
28424
|
+
() => !disposed && readRouting()?.forHost(route.hostId) === route,
|
|
28425
|
+
messages
|
|
27716
28426
|
);
|
|
27717
28427
|
entries.set(route.hostId, { route, client, cleanups });
|
|
27718
28428
|
try {
|
|
@@ -27856,6 +28566,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27856
28566
|
var SIDEBAR_THREAD_ID_ATTRIBUTE = "data-app-action-sidebar-thread-id";
|
|
27857
28567
|
var SIDEBAR_THREAD_HOST_ID_ATTRIBUTE = "data-app-action-sidebar-thread-host-id";
|
|
27858
28568
|
var SIDEBAR_AGENT_ICON_ATTRIBUTE = "data-codexhost-sidebar-agent-icon";
|
|
28569
|
+
var SIDEBAR_AGENT_ICON_ROW_SELECTOR = `${SIDEBAR_THREAD_ROW_SELECTOR}, ${NATIVE_SCHEDULE_SIDEBAR_ROW_SELECTOR}`;
|
|
27859
28570
|
var OWNERSHIP_RETRY_DELAYS_MS = [100, 300, 800, 1500, 3e3];
|
|
27860
28571
|
function isRecord12(value) {
|
|
27861
28572
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -27901,7 +28612,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27901
28612
|
return candidates.size === 1 ? candidates.values().next().value ?? null : null;
|
|
27902
28613
|
}
|
|
27903
28614
|
function rendererAgentForThreadOwnership(ownership) {
|
|
27904
|
-
if (ownership.owner === "codex") return
|
|
28615
|
+
if (ownership.owner === "codex") return "codex";
|
|
27905
28616
|
return ownership.harnessId;
|
|
27906
28617
|
}
|
|
27907
28618
|
function sidebarAgentIconAnchor(titleTrigger, title) {
|
|
@@ -27919,22 +28630,30 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27919
28630
|
this.element = element;
|
|
27920
28631
|
}
|
|
27921
28632
|
element;
|
|
28633
|
+
#scheduledThread;
|
|
27922
28634
|
isConnected() {
|
|
27923
28635
|
return this.element.isConnected;
|
|
27924
28636
|
}
|
|
27925
28637
|
hostId() {
|
|
27926
|
-
|
|
28638
|
+
const attributes = sidebarThreadAttributes(this.element);
|
|
28639
|
+
this.#scheduledThread = attributes ? void 0 : readNativeScheduleSidebarThread(this.element);
|
|
28640
|
+
return attributes?.hostId ?? (this.#scheduledThread ? "local" : null);
|
|
27927
28641
|
}
|
|
27928
28642
|
threadId() {
|
|
27929
|
-
|
|
28643
|
+
const threadId = sidebarThreadAttributes(this.element) ? threadIdFromSidebarRowElement(this.element) : this.#scheduledThread !== void 0 ? this.#scheduledThread : readNativeScheduleSidebarThread(this.element);
|
|
28644
|
+
this.#scheduledThread = void 0;
|
|
28645
|
+
return threadId;
|
|
27930
28646
|
}
|
|
27931
28647
|
draftId() {
|
|
27932
28648
|
return draftIdFromSidebarRowElement(this.element);
|
|
27933
28649
|
}
|
|
27934
28650
|
render(agent, plugin) {
|
|
27935
28651
|
const presentation = JSON.stringify([agent, plugin?.name, plugin?.icon, plugin?.iconStyle]);
|
|
27936
|
-
const
|
|
27937
|
-
const
|
|
28652
|
+
const scheduled = !this.element.hasAttribute(SIDEBAR_THREAD_ROW_ATTRIBUTE) && this.element.matches(NATIVE_SCHEDULE_SIDEBAR_ROW_SELECTOR);
|
|
28653
|
+
const titleTrigger = scheduled ? this.element : this.element.querySelector("[data-thread-title-trigger]");
|
|
28654
|
+
const title = scheduled ? [...this.element.querySelectorAll("[data-thread-title][id]")].find(
|
|
28655
|
+
(node) => node.id === this.element.getAttribute("aria-labelledby")
|
|
28656
|
+
) : titleTrigger?.querySelector("[data-thread-title]");
|
|
27938
28657
|
if (!titleTrigger || !title) {
|
|
27939
28658
|
this.clear();
|
|
27940
28659
|
return;
|
|
@@ -27983,7 +28702,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27983
28702
|
row = new BrowserSidebarAgentIconRow(element);
|
|
27984
28703
|
this.#rowsByElement.set(element, row);
|
|
27985
28704
|
}
|
|
27986
|
-
if (element.isConnected && element.matches(
|
|
28705
|
+
if (element.isConnected && element.matches(SIDEBAR_AGENT_ICON_ROW_SELECTOR))
|
|
27987
28706
|
this.#trackedRows.add(row);
|
|
27988
28707
|
else this.#trackedRows.delete(row);
|
|
27989
28708
|
return row;
|
|
@@ -27992,7 +28711,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27992
28711
|
for (const row of this.#trackedRows) {
|
|
27993
28712
|
if (!row.isConnected()) this.#trackedRows.delete(row);
|
|
27994
28713
|
}
|
|
27995
|
-
return [...this.root.querySelectorAll(
|
|
28714
|
+
return [...this.root.querySelectorAll(SIDEBAR_AGENT_ICON_ROW_SELECTOR)].map(
|
|
27996
28715
|
(element) => this.#row(element)
|
|
27997
28716
|
);
|
|
27998
28717
|
}
|
|
@@ -28001,13 +28720,14 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28001
28720
|
const changed = /* @__PURE__ */ new Set();
|
|
28002
28721
|
const collect = (node) => {
|
|
28003
28722
|
if (!(node instanceof Element)) return;
|
|
28004
|
-
if (node.matches(
|
|
28005
|
-
|
|
28723
|
+
if (node.matches(SIDEBAR_AGENT_ICON_ROW_SELECTOR))
|
|
28724
|
+
changed.add(this.#row(node));
|
|
28725
|
+
for (const element of node.querySelectorAll(SIDEBAR_AGENT_ICON_ROW_SELECTOR))
|
|
28006
28726
|
changed.add(this.#row(element));
|
|
28007
28727
|
};
|
|
28008
28728
|
for (const mutation of mutations) {
|
|
28009
28729
|
const target = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
|
|
28010
|
-
const row = target?.closest(
|
|
28730
|
+
const row = target?.closest(SIDEBAR_AGENT_ICON_ROW_SELECTOR);
|
|
28011
28731
|
if (row) changed.add(this.#row(row));
|
|
28012
28732
|
else if (target && this.#rowsByElement.has(target))
|
|
28013
28733
|
changed.add(this.#row(target));
|
|
@@ -28021,7 +28741,10 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28021
28741
|
attributeFilter: [
|
|
28022
28742
|
SIDEBAR_THREAD_ROW_ATTRIBUTE,
|
|
28023
28743
|
SIDEBAR_THREAD_ID_ATTRIBUTE,
|
|
28024
|
-
SIDEBAR_THREAD_HOST_ID_ATTRIBUTE
|
|
28744
|
+
SIDEBAR_THREAD_HOST_ID_ATTRIBUTE,
|
|
28745
|
+
"data-sidebar-cycle-item",
|
|
28746
|
+
"aria-labelledby",
|
|
28747
|
+
"role"
|
|
28025
28748
|
],
|
|
28026
28749
|
childList: true,
|
|
28027
28750
|
subtree: true
|
|
@@ -28091,7 +28814,8 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28091
28814
|
ownershipRetryTimers.delete(key);
|
|
28092
28815
|
if (disposed) return;
|
|
28093
28816
|
failed.delete(key);
|
|
28094
|
-
ownershipByThread.
|
|
28817
|
+
const cached2 = ownershipByThread.get(key);
|
|
28818
|
+
if (cached2) cached2.stale = true;
|
|
28095
28819
|
scheduleScan(rowsByThread.get(key) ?? []);
|
|
28096
28820
|
}, delay);
|
|
28097
28821
|
ownershipRetryTimers.set(key, timer);
|
|
@@ -28104,7 +28828,10 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28104
28828
|
if (disposed) return;
|
|
28105
28829
|
for (const ownership of threads) {
|
|
28106
28830
|
const key = ownershipKey(hostId2, ownership.threadId);
|
|
28107
|
-
ownershipByThread.set(key,
|
|
28831
|
+
ownershipByThread.set(key, {
|
|
28832
|
+
agent: rendererAgentForThreadOwnership(ownership),
|
|
28833
|
+
stale: false
|
|
28834
|
+
});
|
|
28108
28835
|
failed.delete(key);
|
|
28109
28836
|
if (ownership.owner === "codex") {
|
|
28110
28837
|
provisionalCodex.add(key);
|
|
@@ -28137,6 +28864,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28137
28864
|
const unresolvedByHost = /* @__PURE__ */ new Map();
|
|
28138
28865
|
const pluginsByHost = /* @__PURE__ */ new Map();
|
|
28139
28866
|
const getPlugin = (hostId2, agent) => {
|
|
28867
|
+
if (agent === "codex") return void 0;
|
|
28140
28868
|
if (!pluginsByHost.has(hostId2)) pluginsByHost.set(hostId2, options.getPlugins?.(hostId2));
|
|
28141
28869
|
return pluginsByHost.get(hostId2)?.find(({ id }) => id === agent);
|
|
28142
28870
|
};
|
|
@@ -28162,11 +28890,10 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28162
28890
|
if (localAgent !== null && localAgent !== void 0) {
|
|
28163
28891
|
if (threadId.success) {
|
|
28164
28892
|
const key2 = ownershipKey(hostId2, threadId.data);
|
|
28165
|
-
ownershipByThread.set(key2,
|
|
28893
|
+
ownershipByThread.set(key2, { agent: localAgent, stale: false });
|
|
28166
28894
|
clearOwnershipRetry(key2);
|
|
28167
28895
|
}
|
|
28168
|
-
|
|
28169
|
-
else row.render(localAgent, getPlugin(hostId2, localAgent));
|
|
28896
|
+
row.render(localAgent, getPlugin(hostId2, localAgent));
|
|
28170
28897
|
continue;
|
|
28171
28898
|
}
|
|
28172
28899
|
if (!threadId.success) {
|
|
@@ -28174,13 +28901,11 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28174
28901
|
continue;
|
|
28175
28902
|
}
|
|
28176
28903
|
const key = ownershipKey(hostId2, threadId.data);
|
|
28177
|
-
|
|
28178
|
-
|
|
28179
|
-
|
|
28180
|
-
|
|
28181
|
-
|
|
28182
|
-
}
|
|
28183
|
-
row.clear();
|
|
28904
|
+
const cached2 = ownershipByThread.get(key);
|
|
28905
|
+
if (cached2) {
|
|
28906
|
+
row.render(cached2.agent, getPlugin(hostId2, cached2.agent));
|
|
28907
|
+
if (!cached2.stale) continue;
|
|
28908
|
+
} else row.clear();
|
|
28184
28909
|
if (!pending.has(key) && !failed.has(key)) {
|
|
28185
28910
|
let unresolved = unresolvedByHost.get(hostId2);
|
|
28186
28911
|
if (!unresolved) {
|
|
@@ -28220,7 +28945,10 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28220
28945
|
for (const timer of ownershipRetryTimers.values()) clearTimeout(timer);
|
|
28221
28946
|
ownershipRetryTimers.clear();
|
|
28222
28947
|
ownershipRetryAttempts.clear();
|
|
28223
|
-
for (const key of provisionalCodex)
|
|
28948
|
+
for (const key of provisionalCodex) {
|
|
28949
|
+
const cached2 = ownershipByThread.get(key);
|
|
28950
|
+
if (cached2) cached2.stale = true;
|
|
28951
|
+
}
|
|
28224
28952
|
provisionalCodex.clear();
|
|
28225
28953
|
scheduleScan(dom.rows());
|
|
28226
28954
|
},
|
|
@@ -28319,16 +29047,16 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28319
29047
|
return isRecord13(value) ? value : null;
|
|
28320
29048
|
}
|
|
28321
29049
|
function directForkAncestors(first) {
|
|
28322
|
-
const
|
|
29050
|
+
const ancestors2 = [];
|
|
28323
29051
|
const seen = /* @__PURE__ */ new Set();
|
|
28324
29052
|
let fiber = first;
|
|
28325
|
-
while (fiber &&
|
|
29053
|
+
while (fiber && ancestors2.length < FAST_FORK_OWNER_DEPTH) {
|
|
28326
29054
|
if (seen.has(fiber)) return [];
|
|
28327
29055
|
seen.add(fiber);
|
|
28328
|
-
|
|
29056
|
+
ancestors2.push(fiber);
|
|
28329
29057
|
fiber = isRecord13(fiber.return) ? fiber.return : null;
|
|
28330
29058
|
}
|
|
28331
|
-
return
|
|
29059
|
+
return ancestors2;
|
|
28332
29060
|
}
|
|
28333
29061
|
function ownsOtherCallback(fiber, props) {
|
|
28334
29062
|
if (typeof fiber.type === "string") return false;
|
|
@@ -28336,13 +29064,13 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28336
29064
|
(name) => /^on[A-Z]/.test(name) && name !== "onClick" && name !== "onFork" && typeof props[name] === "function"
|
|
28337
29065
|
);
|
|
28338
29066
|
}
|
|
28339
|
-
function forkTargetFromAncestors(button2, threadId, turnId,
|
|
29067
|
+
function forkTargetFromAncestors(button2, threadId, turnId, ancestors2) {
|
|
28340
29068
|
const conversationIds = /* @__PURE__ */ new Set();
|
|
28341
29069
|
const turnIds = /* @__PURE__ */ new Set();
|
|
28342
29070
|
const hostIds = /* @__PURE__ */ new Set();
|
|
28343
29071
|
const projectlessStates = /* @__PURE__ */ new Set();
|
|
28344
29072
|
let hasForkCallback = false;
|
|
28345
|
-
for (const fiber of
|
|
29073
|
+
for (const fiber of ancestors2) {
|
|
28346
29074
|
const props = fiber.memoizedProps;
|
|
28347
29075
|
if (!isRecord13(props)) continue;
|
|
28348
29076
|
if (!hasForkCallback && typeof props.onFork !== "function" && ownsOtherCallback(fiber, props)) {
|
|
@@ -28879,6 +29607,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28879
29607
|
}
|
|
28880
29608
|
});
|
|
28881
29609
|
const selectedPolicies = /* @__PURE__ */ new Map();
|
|
29610
|
+
const draftModels = createScopedDraftModelWriter();
|
|
28882
29611
|
const handleRoutingPolicyChange = () => {
|
|
28883
29612
|
currentRequestRoute();
|
|
28884
29613
|
};
|
|
@@ -28899,7 +29628,16 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28899
29628
|
const route = window.__codexhostHostRoutingV1?.forComposer(composer);
|
|
28900
29629
|
if (!route) return false;
|
|
28901
29630
|
try {
|
|
28902
|
-
|
|
29631
|
+
const target = composer ? findComposerModelTarget(composer) : null;
|
|
29632
|
+
if (target?.[0] === "conversation") return true;
|
|
29633
|
+
if (target?.[0] !== "default" || typeof target[1] !== "string" || !composer)
|
|
29634
|
+
return agent === "codex";
|
|
29635
|
+
const binding = findScopedDraftModelBinding(composer, target[1]);
|
|
29636
|
+
const draftKey = target[1];
|
|
29637
|
+
if (!binding || !route.policy.scopedCreation)
|
|
29638
|
+
return agent === "codex" && !draftModels.has(draftKey);
|
|
29639
|
+
draftModels.apply(draftKey, binding, carrier ?? null);
|
|
29640
|
+
if (route.policy.select(carrier ?? null, draftKey, binding.creationModes)) {
|
|
28903
29641
|
modelUpdates += 1;
|
|
28904
29642
|
liveStatus.modelUpdates = modelUpdates;
|
|
28905
29643
|
}
|
|
@@ -28917,6 +29655,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28917
29655
|
dispose() {
|
|
28918
29656
|
if (disposed) return;
|
|
28919
29657
|
disposed = true;
|
|
29658
|
+
draftModels.dispose();
|
|
28920
29659
|
window.removeEventListener(
|
|
28921
29660
|
"codexhost:draft-prewarm-policy-changed",
|
|
28922
29661
|
handleRoutingPolicyChange
|
|
@@ -29694,6 +30433,8 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
29694
30433
|
cachedInputTokens: 0,
|
|
29695
30434
|
cacheWriteInputTokens: 0,
|
|
29696
30435
|
cacheKnownInputTokens: 0,
|
|
30436
|
+
cacheHitCachedInputTokens: 0,
|
|
30437
|
+
cacheHitInputTokens: 0,
|
|
29697
30438
|
outputTokens: 0,
|
|
29698
30439
|
reasoningOutputTokens: 0,
|
|
29699
30440
|
costUsd: 0,
|
|
@@ -29707,6 +30448,8 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
29707
30448
|
target.cachedInputTokens += source.cachedInputTokens;
|
|
29708
30449
|
target.cacheWriteInputTokens += source.cacheWriteInputTokens;
|
|
29709
30450
|
target.cacheKnownInputTokens += source.cacheKnownInputTokens;
|
|
30451
|
+
target.cacheHitCachedInputTokens += source.cacheHitCachedInputTokens;
|
|
30452
|
+
target.cacheHitInputTokens += source.cacheHitInputTokens;
|
|
29710
30453
|
target.outputTokens += source.outputTokens;
|
|
29711
30454
|
target.reasoningOutputTokens += source.reasoningOutputTokens;
|
|
29712
30455
|
target.costUsd += source.costUsd;
|
|
@@ -29740,12 +30483,12 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
29740
30483
|
return unmetered(totals2) || allUnpriced(totals2) ? "\u2014" : money(totals2.costUsd);
|
|
29741
30484
|
}
|
|
29742
30485
|
function tokenCount(totals2, value, locale = "en") {
|
|
29743
|
-
return unmetered(totals2) ? "\u2014" :
|
|
30486
|
+
return unmetered(totals2) ? "\u2014" : count3(value, locale);
|
|
29744
30487
|
}
|
|
29745
30488
|
function isChinese(locale) {
|
|
29746
30489
|
return /^zh(?:-|$)/iu.test(locale);
|
|
29747
30490
|
}
|
|
29748
|
-
function
|
|
30491
|
+
function count3(value, locale = "en") {
|
|
29749
30492
|
if (!isChinese(locale)) return formatRendererTokenCount(value);
|
|
29750
30493
|
const absolute = Math.abs(value);
|
|
29751
30494
|
if (absolute < 1e4) return value.toLocaleString(locale, { maximumFractionDigits: 0 });
|
|
@@ -29754,21 +30497,23 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
29754
30497
|
return `${Number((value / divisor).toFixed(2))} ${hundredMillions ? "\u4EBF" : "\u4E07"}`;
|
|
29755
30498
|
}
|
|
29756
30499
|
function tokenSummary(value, locale = "en") {
|
|
29757
|
-
if (!isChinese(locale)) return { value:
|
|
30500
|
+
if (!isChinese(locale)) return { value: count3(value), approximation: null };
|
|
29758
30501
|
return {
|
|
29759
30502
|
value: value.toLocaleString(locale, { maximumFractionDigits: 0 }),
|
|
29760
|
-
approximation: Math.abs(value) >= 1e4 ? `\u2248 ${
|
|
30503
|
+
approximation: Math.abs(value) >= 1e4 ? `\u2248 ${count3(value, locale)}` : null
|
|
29761
30504
|
};
|
|
29762
30505
|
}
|
|
29763
30506
|
function cacheHitRate(totals2) {
|
|
29764
|
-
return totals2.
|
|
30507
|
+
return totals2.cacheHitInputTokens > 0 ? formatRendererCacheHitRate(
|
|
30508
|
+
totals2.cacheHitCachedInputTokens / totals2.cacheHitInputTokens * 100
|
|
30509
|
+
) : "\u2014";
|
|
29765
30510
|
}
|
|
29766
30511
|
function formatMeasure(measure, value, locale = "en") {
|
|
29767
|
-
return measure === "cost" ? money(value) :
|
|
30512
|
+
return measure === "cost" ? money(value) : count3(value, locale);
|
|
29768
30513
|
}
|
|
29769
30514
|
function axisValue(measure, value, locale = "en") {
|
|
29770
|
-
if (measure !== "cost") return
|
|
29771
|
-
if (value >= 1e3) return `$${
|
|
30515
|
+
if (measure !== "cost") return count3(value, locale);
|
|
30516
|
+
if (value >= 1e3) return `$${count3(value)}`;
|
|
29772
30517
|
return `$${Number(value.toFixed(2))}`;
|
|
29773
30518
|
}
|
|
29774
30519
|
function percent(share) {
|
|
@@ -31023,7 +31768,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
31023
31768
|
const document2 = context.content.ownerDocument;
|
|
31024
31769
|
const locale = pageLocale ?? (document2.documentElement.lang || "en");
|
|
31025
31770
|
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
31026
|
-
const
|
|
31771
|
+
const count4 = (value) => count3(value, locale);
|
|
31027
31772
|
const tokenCount2 = (totals2, value) => tokenCount(totals2, value, locale);
|
|
31028
31773
|
const saved = readView();
|
|
31029
31774
|
const view = {
|
|
@@ -31604,7 +32349,7 @@ ${messages.creditsCoverage}: ${value.reportedRequests} / ${row.requests}` : void
|
|
|
31604
32349
|
key: "requests",
|
|
31605
32350
|
label: messages.requests,
|
|
31606
32351
|
sort: (row) => row.requests,
|
|
31607
|
-
cell: (row) =>
|
|
32352
|
+
cell: (row) => count4(row.requests)
|
|
31608
32353
|
},
|
|
31609
32354
|
{
|
|
31610
32355
|
key: "input",
|
|
@@ -31628,7 +32373,7 @@ ${messages.creditsCoverage}: ${value.reportedRequests} / ${row.requests}` : void
|
|
|
31628
32373
|
{
|
|
31629
32374
|
key: "hit",
|
|
31630
32375
|
label: messages.cacheHit,
|
|
31631
|
-
sort: (row) => row.
|
|
32376
|
+
sort: (row) => row.cacheHitInputTokens > 0 ? row.cacheHitCachedInputTokens / row.cacheHitInputTokens : -1,
|
|
31632
32377
|
cell: (row) => cacheHitRate(row)
|
|
31633
32378
|
},
|
|
31634
32379
|
{
|
|
@@ -31763,7 +32508,7 @@ ${detail}` : ""}`
|
|
|
31763
32508
|
document2,
|
|
31764
32509
|
"span",
|
|
31765
32510
|
{ className: "console-badge is-warn" },
|
|
31766
|
-
fill(messages.unpriced, { count:
|
|
32511
|
+
fill(messages.unpriced, { count: count4(row.unpricedRequests) })
|
|
31767
32512
|
)
|
|
31768
32513
|
);
|
|
31769
32514
|
}
|
|
@@ -34802,7 +35547,7 @@ ${detail}` : ""}`
|
|
|
34802
35547
|
}
|
|
34803
35548
|
function defaultImportName(source, existing) {
|
|
34804
35549
|
const base = source.provider === "openai-codex" ? "codex" : "grok";
|
|
34805
|
-
const used = new Set(existing.map((
|
|
35550
|
+
const used = new Set(existing.map((record15) => record15.name));
|
|
34806
35551
|
const valid = (name) => credentialImportNameSchema.safeParse(name).success;
|
|
34807
35552
|
if (!used.has(base)) return base;
|
|
34808
35553
|
const local = source.label.includes("@") ? source.label.split("@")[0] ?? "" : "";
|
|
@@ -34825,7 +35570,7 @@ ${detail}` : ""}`
|
|
|
34825
35570
|
const shown = (text) => accountDisplayText(text, hideEmails);
|
|
34826
35571
|
const targetButtons = /* @__PURE__ */ new Map();
|
|
34827
35572
|
const importedRecords = () => snapshot.targets.find((target) => target.harnessId === TARGET_HARNESS_ID)?.imports ?? [];
|
|
34828
|
-
const sourceOf = (
|
|
35573
|
+
const sourceOf = (record15) => snapshot.sources.find((source) => source.id === record15.source.id);
|
|
34829
35574
|
const piTarget = () => snapshot.targets.find((candidate) => candidate.harnessId === TARGET_HARNESS_ID);
|
|
34830
35575
|
const compatibleSources = () => {
|
|
34831
35576
|
const target = piTarget();
|
|
@@ -34863,7 +35608,7 @@ ${detail}` : ""}`
|
|
|
34863
35608
|
sectionImport.addEventListener("click", () => {
|
|
34864
35609
|
const sources = compatibleSources();
|
|
34865
35610
|
const free = sources.find(
|
|
34866
|
-
(source2) => !importedRecords().some((
|
|
35611
|
+
(source2) => !importedRecords().some((record15) => record15.source.id === source2.id)
|
|
34867
35612
|
);
|
|
34868
35613
|
const source = free ?? sources[0];
|
|
34869
35614
|
if (source) openDialog("add", { source, choose: true }, SECTION_IMPORT_KEY);
|
|
@@ -34913,30 +35658,30 @@ ${detail}` : ""}`
|
|
|
34913
35658
|
mark.append(createRendererAgentIcon(agent ?? "pi", 26, document2, pluginFor(agent ?? "pi")));
|
|
34914
35659
|
return mark;
|
|
34915
35660
|
};
|
|
34916
|
-
const renderRow = (
|
|
35661
|
+
const renderRow = (record15) => {
|
|
34917
35662
|
const row = document2.createElement("div");
|
|
34918
35663
|
row.className = "settings-pi-accounts__row";
|
|
34919
35664
|
row.tabIndex = -1;
|
|
34920
|
-
row.dataset.importName =
|
|
34921
|
-
row.setAttribute("aria-label", shown(
|
|
34922
|
-
const agent =
|
|
35665
|
+
row.dataset.importName = record15.name;
|
|
35666
|
+
row.setAttribute("aria-label", shown(record15.source.label));
|
|
35667
|
+
const agent = record15.source.harnessId;
|
|
34923
35668
|
const mark = createMark(agent);
|
|
34924
35669
|
const identity = document2.createElement("div");
|
|
34925
35670
|
identity.className = "settings-pi-accounts__identity";
|
|
34926
35671
|
const label = document2.createElement("strong");
|
|
34927
35672
|
label.className = "settings-account-email";
|
|
34928
|
-
label.textContent = shown(
|
|
35673
|
+
label.textContent = shown(record15.source.label);
|
|
34929
35674
|
label.title = label.textContent;
|
|
34930
35675
|
label.translate = false;
|
|
34931
35676
|
const meta3 = document2.createElement("div");
|
|
34932
35677
|
meta3.className = "settings-account-metadata";
|
|
34933
|
-
const source = sourceOf(
|
|
35678
|
+
const source = sourceOf(record15);
|
|
34934
35679
|
const parts = [
|
|
34935
35680
|
metaPart(rendererAgentLabel(agent, pluginFor(agent)), "settings-pi-accounts__agent"),
|
|
34936
|
-
metaPart(`${
|
|
35681
|
+
metaPart(`${record15.name}/\u2026`, void 0, true),
|
|
34937
35682
|
metaPart(messages.copied)
|
|
34938
35683
|
];
|
|
34939
|
-
const time3 = formatImportedAt(
|
|
35684
|
+
const time3 = formatImportedAt(record15.importedAt);
|
|
34940
35685
|
if (time3) parts.push(metaPart(time3));
|
|
34941
35686
|
parts.forEach((part, index) => {
|
|
34942
35687
|
if (index > 0) {
|
|
@@ -34953,23 +35698,23 @@ ${detail}` : ""}`
|
|
|
34953
35698
|
reimport.type = "button";
|
|
34954
35699
|
reimport.className = "settings-account-action";
|
|
34955
35700
|
reimport.textContent = messages.rowReimport;
|
|
34956
|
-
reimport.setAttribute("aria-label", `${messages.reimport}: ${shown(
|
|
35701
|
+
reimport.setAttribute("aria-label", `${messages.reimport}: ${shown(record15.source.label)}`);
|
|
34957
35702
|
reimport.disabled = busy || !source;
|
|
34958
35703
|
reimport.title = messages.reimport;
|
|
34959
35704
|
reimport.addEventListener("click", () => {
|
|
34960
|
-
if (source) openDialog("reimport", { source, record:
|
|
35705
|
+
if (source) openDialog("reimport", { source, record: record15 }, `row:${record15.name}`);
|
|
34961
35706
|
});
|
|
34962
35707
|
const remove = document2.createElement("button");
|
|
34963
35708
|
remove.type = "button";
|
|
34964
35709
|
remove.className = "settings-account-action settings-pi-accounts__remove";
|
|
34965
35710
|
remove.textContent = messages.rowRemove;
|
|
34966
|
-
remove.setAttribute("aria-label", `${messages.remove}: ${shown(
|
|
35711
|
+
remove.setAttribute("aria-label", `${messages.remove}: ${shown(record15.source.label)}`);
|
|
34967
35712
|
remove.disabled = busy;
|
|
34968
|
-
remove.addEventListener("click", () => openDialog("remove", { record:
|
|
35713
|
+
remove.addEventListener("click", () => openDialog("remove", { record: record15 }, `row:${record15.name}`));
|
|
34969
35714
|
if (source) actions.append(reimport);
|
|
34970
35715
|
actions.append(remove);
|
|
34971
35716
|
row.append(mark, identity, actions);
|
|
34972
|
-
rows.set(
|
|
35717
|
+
rows.set(record15.name, row);
|
|
34973
35718
|
return row;
|
|
34974
35719
|
};
|
|
34975
35720
|
const loginTypeLabel = (type) => type === "oauth" ? messages.typeOauth : type === "api_key" ? messages.typeApiKey : messages.typeOther;
|
|
@@ -35122,7 +35867,7 @@ ${detail}` : ""}`
|
|
|
35122
35867
|
const label = document2.createElement("strong");
|
|
35123
35868
|
label.textContent = shown(choice.label);
|
|
35124
35869
|
label.translate = false;
|
|
35125
|
-
const existing = importedRecords().find((
|
|
35870
|
+
const existing = importedRecords().find((record15) => record15.source.id === choice.id);
|
|
35126
35871
|
const agent = choice.harnessId;
|
|
35127
35872
|
const detail = document2.createElement("span");
|
|
35128
35873
|
detail.textContent = [
|
|
@@ -35163,7 +35908,7 @@ ${detail}` : ""}`
|
|
|
35163
35908
|
const name = request.action === "list" ? void 0 : request.name;
|
|
35164
35909
|
state = {
|
|
35165
35910
|
source: state.source,
|
|
35166
|
-
record: importedRecords().find((
|
|
35911
|
+
record: importedRecords().find((record15) => record15.name === name) ?? state.record
|
|
35167
35912
|
};
|
|
35168
35913
|
show(next);
|
|
35169
35914
|
} else {
|
|
@@ -35177,12 +35922,12 @@ ${detail}` : ""}`
|
|
|
35177
35922
|
sourceRadios = [];
|
|
35178
35923
|
body.replaceChildren();
|
|
35179
35924
|
controls.replaceChildren();
|
|
35180
|
-
const { source, record:
|
|
35925
|
+
const { source, record: record15 } = state;
|
|
35181
35926
|
const close = () => modal.close();
|
|
35182
35927
|
if (mode2 === "add" || mode2 === "reimport") {
|
|
35183
35928
|
title.textContent = mode2 === "add" ? messages.add : messages.reimport;
|
|
35184
35929
|
modal.setAttribute("aria-label", title.textContent);
|
|
35185
|
-
const active = source ??
|
|
35930
|
+
const active = source ?? record15?.source;
|
|
35186
35931
|
const choices = mode2 === "add" && state.choose ? compatibleSources() : [];
|
|
35187
35932
|
if (choices.length > 1) body.append(sourcePicker(choices));
|
|
35188
35933
|
else if (active) body.append(line(messages.source, shown(active.label)));
|
|
@@ -35191,8 +35936,8 @@ ${detail}` : ""}`
|
|
|
35191
35936
|
input.maxLength = 48;
|
|
35192
35937
|
input.autocomplete = "off";
|
|
35193
35938
|
input.spellcheck = false;
|
|
35194
|
-
input.value =
|
|
35195
|
-
input.readOnly = Boolean(
|
|
35939
|
+
input.value = record15?.name ?? (source ? defaultImportName(source, importedRecords()) : "codex");
|
|
35940
|
+
input.readOnly = Boolean(record15);
|
|
35196
35941
|
input.addEventListener("input", () => {
|
|
35197
35942
|
nameEdited = true;
|
|
35198
35943
|
});
|
|
@@ -35226,7 +35971,7 @@ ${detail}` : ""}`
|
|
|
35226
35971
|
{
|
|
35227
35972
|
action: mode2 === "reimport" ? "reimport" : "import",
|
|
35228
35973
|
sourceId: source2.id,
|
|
35229
|
-
name:
|
|
35974
|
+
name: record15?.name ?? input.value,
|
|
35230
35975
|
confirmed: true
|
|
35231
35976
|
},
|
|
35232
35977
|
"done"
|
|
@@ -35236,16 +35981,16 @@ ${detail}` : ""}`
|
|
|
35236
35981
|
)
|
|
35237
35982
|
);
|
|
35238
35983
|
(mode2 === "add" ? input : controls.children[0]).focus();
|
|
35239
|
-
} else if (mode2 === "remove" &&
|
|
35984
|
+
} else if (mode2 === "remove" && record15) {
|
|
35240
35985
|
title.textContent = messages.remove;
|
|
35241
35986
|
modal.setAttribute("aria-label", title.textContent);
|
|
35242
|
-
body.append(note(messages.removeWarning.replace("{name}",
|
|
35987
|
+
body.append(note(messages.removeWarning.replace("{name}", record15.name)));
|
|
35243
35988
|
const cancel = command(messages.cancel, close);
|
|
35244
35989
|
controls.append(
|
|
35245
35990
|
cancel,
|
|
35246
35991
|
command(
|
|
35247
35992
|
messages.remove,
|
|
35248
|
-
() => submit({ action: "remove", name:
|
|
35993
|
+
() => submit({ action: "remove", name: record15.name, confirmed: true }, null),
|
|
35249
35994
|
"danger"
|
|
35250
35995
|
)
|
|
35251
35996
|
);
|
|
@@ -35253,7 +35998,7 @@ ${detail}` : ""}`
|
|
|
35253
35998
|
} else {
|
|
35254
35999
|
title.textContent = messages.doneTitle;
|
|
35255
36000
|
modal.setAttribute("aria-label", title.textContent);
|
|
35256
|
-
const name =
|
|
36001
|
+
const name = record15?.name;
|
|
35257
36002
|
if (name) body.append(line(messages.entry, `${name}/\u2026`, true));
|
|
35258
36003
|
body.append(note(messages.done));
|
|
35259
36004
|
const done = command(messages.close, close, "primary");
|
|
@@ -35300,21 +36045,21 @@ ${detail}` : ""}`
|
|
|
35300
36045
|
(candidate) => candidate.harnessId === TARGET_HARNESS_ID && source && candidate.providers.includes(source.provider)
|
|
35301
36046
|
);
|
|
35302
36047
|
if (!source || !target) return null;
|
|
35303
|
-
const
|
|
36048
|
+
const record15 = target.imports.find((candidate) => candidate.source.id === source.id);
|
|
35304
36049
|
const key = `${harnessId}:${accountLabel}:import`;
|
|
35305
36050
|
const button2 = document2.createElement("button");
|
|
35306
36051
|
button2.type = "button";
|
|
35307
36052
|
button2.className = "settings-account-pi-import";
|
|
35308
36053
|
button2.dataset.accountFocus = key;
|
|
35309
36054
|
button2.disabled = busy;
|
|
35310
|
-
const hint =
|
|
36055
|
+
const hint = record15 ? messages.importedHint.replace("{name}", record15.name) : messages.add;
|
|
35311
36056
|
button2.title = hint;
|
|
35312
36057
|
button2.setAttribute("aria-label", hint);
|
|
35313
36058
|
button2.append(createRendererAgentIcon("pi", 12, document2, pluginFor("pi")));
|
|
35314
|
-
if (
|
|
36059
|
+
if (record15) {
|
|
35315
36060
|
button2.dataset.state = "imported";
|
|
35316
36061
|
const name = document2.createElement("code");
|
|
35317
|
-
name.textContent = `${
|
|
36062
|
+
name.textContent = `${record15.name}/\u2026`;
|
|
35318
36063
|
name.translate = false;
|
|
35319
36064
|
button2.append(name, createRendererSettingsIcon("check", 12));
|
|
35320
36065
|
} else {
|
|
@@ -35322,7 +36067,7 @@ ${detail}` : ""}`
|
|
|
35322
36067
|
button2.append(messages.add);
|
|
35323
36068
|
}
|
|
35324
36069
|
button2.addEventListener("click", () => {
|
|
35325
|
-
if (!
|
|
36070
|
+
if (!record15) {
|
|
35326
36071
|
openDialog("add", { source }, key);
|
|
35327
36072
|
return;
|
|
35328
36073
|
}
|
|
@@ -35331,7 +36076,7 @@ ${detail}` : ""}`
|
|
|
35331
36076
|
renderSection();
|
|
35332
36077
|
sectionToggle.setAttribute("aria-expanded", "true");
|
|
35333
36078
|
}
|
|
35334
|
-
const row = rows.get(
|
|
36079
|
+
const row = rows.get(record15.name);
|
|
35335
36080
|
row?.scrollIntoView({ block: "nearest", behavior: "smooth" });
|
|
35336
36081
|
row?.focus();
|
|
35337
36082
|
});
|
|
@@ -35637,14 +36382,14 @@ ${detail}` : ""}`
|
|
|
35637
36382
|
summary.className = "settings-account-reset-summary";
|
|
35638
36383
|
summary.setAttribute("aria-label", messages.accountResetCreditsDetails);
|
|
35639
36384
|
summary.title = messages.accountResetCreditsDetails;
|
|
35640
|
-
const
|
|
35641
|
-
|
|
36385
|
+
const count4 = document2.createElement("span");
|
|
36386
|
+
count4.textContent = messages.locale === "zh-CN" ? `${resetCredits.availableCount} \u5F20` : String(resetCredits.availableCount);
|
|
35642
36387
|
const label = document2.createElement("span");
|
|
35643
36388
|
label.textContent = messages.accountResetCredits;
|
|
35644
36389
|
summary.append(
|
|
35645
36390
|
createRendererSettingsIcon("ticket", 16),
|
|
35646
36391
|
label,
|
|
35647
|
-
|
|
36392
|
+
count4,
|
|
35648
36393
|
createRendererSettingsIcon("chevron-right", 14)
|
|
35649
36394
|
);
|
|
35650
36395
|
const details = document2.createElement("div");
|
|
@@ -36326,6 +37071,43 @@ ${detail}` : ""}`
|
|
|
36326
37071
|
});
|
|
36327
37072
|
}
|
|
36328
37073
|
|
|
37074
|
+
// src/settings/harness-schedules-page.ts
|
|
37075
|
+
function createHarnessSchedulesPage(messages, options) {
|
|
37076
|
+
const t = (zh, en) => messages.locale === "zh-CN" ? zh : en;
|
|
37077
|
+
return {
|
|
37078
|
+
id: "harness-schedules",
|
|
37079
|
+
label: t("\u5B9A\u65F6\u4EFB\u52A1", "Schedules"),
|
|
37080
|
+
icon: "schedules",
|
|
37081
|
+
mount(context) {
|
|
37082
|
+
const navigate = () => {
|
|
37083
|
+
context.content.replaceChildren();
|
|
37084
|
+
void context.runLatest((signal) => options.openSchedules(signal), {
|
|
37085
|
+
success() {
|
|
37086
|
+
},
|
|
37087
|
+
failure() {
|
|
37088
|
+
const document2 = context.content.ownerDocument;
|
|
37089
|
+
const status = document2.createElement("p");
|
|
37090
|
+
status.setAttribute("role", "status");
|
|
37091
|
+
status.className = "text-sm text-settings-muted";
|
|
37092
|
+
status.textContent = t(
|
|
37093
|
+
"\u65E0\u6CD5\u6253\u5F00\u5B98\u65B9\u5B9A\u65F6\u4EFB\u52A1\u9875\uFF0C\u8BF7\u91CD\u8BD5\u6216\u4ECE\u5B98\u65B9\u4FA7\u680F\u8FDB\u5165\u3002",
|
|
37094
|
+
"Could not open the official schedules page. Retry or use the Desktop sidebar."
|
|
37095
|
+
);
|
|
37096
|
+
const retry = document2.createElement("button");
|
|
37097
|
+
retry.type = "button";
|
|
37098
|
+
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";
|
|
37099
|
+
retry.textContent = t("\u91CD\u8BD5", "Retry");
|
|
37100
|
+
retry.addEventListener("click", navigate);
|
|
37101
|
+
context.content.replaceChildren(status, retry);
|
|
37102
|
+
}
|
|
37103
|
+
});
|
|
37104
|
+
};
|
|
37105
|
+
navigate();
|
|
37106
|
+
return void 0;
|
|
37107
|
+
}
|
|
37108
|
+
};
|
|
37109
|
+
}
|
|
37110
|
+
|
|
36329
37111
|
// src/settings/update-request.ts
|
|
36330
37112
|
var RENDERER_UPDATE_REQUEST_TIMEOUT_MS = 15e3;
|
|
36331
37113
|
var RendererUpdateRequestTimeoutError = class extends Error {
|
|
@@ -36653,8 +37435,8 @@ ${detail}` : ""}`
|
|
|
36653
37435
|
const starBanner = updateStarBanner(document2, messages);
|
|
36654
37436
|
context.content.append(heading, metadata, panel, controls, starBanner, notes);
|
|
36655
37437
|
const setManualFallback = (fallback) => {
|
|
36656
|
-
controls.className =
|
|
36657
|
-
manualNpmDescription.textContent =
|
|
37438
|
+
controls.className = fallback ? "settings-update-controls" : "settings-update-controls is-quiet";
|
|
37439
|
+
manualNpmDescription.textContent = fallback ? messages.updateManualFallbackDescription : messages.updateManualNpmDescription;
|
|
36658
37440
|
manualNpmDescription.className = fallback ? "settings-update-manual-description is-fallback" : "settings-update-manual-description";
|
|
36659
37441
|
};
|
|
36660
37442
|
let pollTimer;
|
|
@@ -36804,14 +37586,14 @@ ${detail}` : ""}`
|
|
|
36804
37586
|
panel.dataset.updateState = view;
|
|
36805
37587
|
panel.replaceChildren();
|
|
36806
37588
|
setManualFallback(Boolean(result.error) || actionableStatus !== null);
|
|
36807
|
-
const inlineUpdate = !result.error && !
|
|
37589
|
+
const inlineUpdate = !result.error && !actionableStatus && result.updateAvailable;
|
|
36808
37590
|
if (inlineUpdate) panel.dataset.inline = "";
|
|
36809
37591
|
else delete panel.dataset.inline;
|
|
36810
37592
|
panel.append(
|
|
36811
37593
|
createPanelHead(
|
|
36812
37594
|
document2,
|
|
36813
37595
|
view,
|
|
36814
|
-
actionableStatus ? statusMessage(actionableStatus, messages) ?? messages.updateFailed : result.error ? messages.updateFailed : result.updateAvailable ?
|
|
37596
|
+
actionableStatus ? statusMessage(actionableStatus, messages) ?? messages.updateFailed : result.error ? messages.updateFailed : result.updateAvailable ? messages.updateAvailable : messages.updateUpToDate
|
|
36815
37597
|
)
|
|
36816
37598
|
);
|
|
36817
37599
|
if (actionableStatus?.error) {
|
|
@@ -36827,7 +37609,7 @@ ${detail}` : ""}`
|
|
|
36827
37609
|
panel.append(error51);
|
|
36828
37610
|
}
|
|
36829
37611
|
const buttons = [];
|
|
36830
|
-
if (
|
|
37612
|
+
if (result.updateAvailable && result.installationAvailable) {
|
|
36831
37613
|
const update = document2.createElement("button");
|
|
36832
37614
|
update.type = "button";
|
|
36833
37615
|
update.className = "settings-command-button";
|
|
@@ -36876,11 +37658,12 @@ ${detail}` : ""}`
|
|
|
36876
37658
|
}
|
|
36877
37659
|
});
|
|
36878
37660
|
}
|
|
36879
|
-
function createDefaultRendererSettingsPages(messages = DEFAULT_RENDERER_SETTINGS_MESSAGES, getUpdateClient = () => null, getDiagnostics = () => null, getAccountClient = () => null, getSessionImportClient = () => null, openImportedThread = () => Promise.reject(new Error("Imported Thread navigation is unavailable")), getLoadedSessionsClient = () => null, getRemoteConnections = () => null, requestUsageStatistics = () => Promise.reject(new Error("Local Host connection is unavailable")), usageStatisticsHosts, requestVoiceSettings = () => Promise.reject(new Error("Local Host connection is unavailable"))) {
|
|
37661
|
+
function createDefaultRendererSettingsPages(messages = DEFAULT_RENDERER_SETTINGS_MESSAGES, getUpdateClient = () => null, getDiagnostics = () => null, getAccountClient = () => null, getSessionImportClient = () => null, openImportedThread = () => Promise.reject(new Error("Imported Thread navigation is unavailable")), getLoadedSessionsClient = () => null, getRemoteConnections = () => null, requestUsageStatistics = () => Promise.reject(new Error("Local Host connection is unavailable")), usageStatisticsHosts, requestVoiceSettings = () => Promise.reject(new Error("Local Host connection is unavailable")), harnessSchedules) {
|
|
36880
37662
|
return Object.freeze([
|
|
36881
37663
|
createConnectionsSettingsPage(messages, getDiagnostics, void 0, getRemoteConnections),
|
|
36882
37664
|
createRemoteConnectionsPage(messages, getRemoteConnections),
|
|
36883
37665
|
createAccountsSettingsPage(messages, getAccountClient),
|
|
37666
|
+
...harnessSchedules ? [createHarnessSchedulesPage(messages, harnessSchedules)] : [],
|
|
36884
37667
|
createSessionImportSettingsPage(
|
|
36885
37668
|
messages,
|
|
36886
37669
|
getSessionImportClient,
|
|
@@ -41760,7 +42543,7 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
41760
42543
|
`;
|
|
41761
42544
|
|
|
41762
42545
|
// src/settings/tailwind.css
|
|
41763
|
-
var tailwind_default = '@layer properties, theme, base, components, utilities;\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-content:"";--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}@layer theme{:root,:host{--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.top-full{top:100%}.left-0{left:0}.z-20{z-index:20}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-7{margin-top:calc(var(--spacing) * 7)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-16{margin-top:calc(var(--spacing) * 16)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-1{margin-left:var(--spacing)}.ml-\\[45px\\]{margin-left:45px}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.list-item{display:list-item}.table{display:table}.size-1\\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-8{height:calc(var(--spacing) * 8)}.min-h-6{min-height:calc(var(--spacing) * 6)}.min-h-\\[60px\\]{min-height:60px}.w-9{width:calc(var(--spacing) * 9)}.w-14{width:calc(var(--spacing) * 14)}.w-80{width:calc(var(--spacing) * 80)}.w-full{width:100%}.w-px{width:1px}.max-w-64{max-width:calc(var(--spacing) * 64)}.min-w-0{min-width:0}.flex-shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-help{cursor:help}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-disc{list-style-type:disc}.appearance-none{appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.overflow-x-auto{overflow-x:auto}.rounded-\\[10px\\]{border-radius:10px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-settings-border{border-color:var(--settings-border)}.border-settings-divider{border-color:var(--settings-divider)}.bg-settings-panel{background-color:var(--settings-panel)}.bg-settings-subtle{background-color:var(--settings-subtle)}.bg-settings-surface{background-color:var(--settings-surface)}.bg-settings-surface-hover{background-color:var(--settings-surface-hover)}.bg-transparent{background-color:#0000}.p-0{padding:0}.p-4{padding:calc(var(--spacing) * 4)}.\\!px-0{padding-inline:0!important}.px-1{padding-inline:var(--spacing)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pl-4{padding-left:calc(var(--spacing) * 4)}.\\!text-right{text-align:right!important}.text-left{text-align:left}.text-right{text-align:right}.align-top{vertical-align:top}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[11px\\]{font-size:11px}.text-\\[13px\\]{font-size:13px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-7{--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.leading-\\[18px\\]{--tw-leading:18px;line-height:18px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-pre-wrap{white-space:pre-wrap}.text-settings-muted{color:var(--settings-muted)}.text-settings-subtle{color:var(--settings-subtle)}.text-settings-text{color:var(--settings-text)}.lowercase{text-transform:lowercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_10px_30px_rgb\\(0_0_0\\/0\\.22\\)\\]{--tw-shadow:0 10px 30px var(--tw-shadow-color,#00000038);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring,.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-settings-border{--tw-ring-color:var(--settings-border)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.outline-none{--tw-outline-style:none;outline-style:none}.ring-inset{--tw-ring-inset:inset}.group-focus-within\\:visible:is(:where(.group):focus-within *){visibility:visible}.group-focus-within\\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media (hover:hover){.group-hover\\:visible:is(:where(.group):hover *){visibility:visible}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-data-\\[state\\=failed\\]\\/status\\:bg-settings-danger:is(:where(.group\\/status)[data-state=failed] *){background-color:var(--settings-danger)}.group-data-\\[state\\=unavailable\\]\\/status\\:bg-settings-warning:is(:where(.group\\/status)[data-state=unavailable] *){background-color:var(--settings-warning)}.marker\\:text-settings-subtle ::marker{color:var(--settings-subtle)}.marker\\:text-settings-subtle::marker{color:var(--settings-subtle)}.marker\\:text-settings-subtle ::-webkit-details-marker{color:var(--settings-subtle)}.marker\\:text-settings-subtle::-webkit-details-marker{color:var(--settings-subtle)}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:top-0\\.5:before{content:var(--tw-content);top:calc(var(--spacing) * .5)}.before\\:left-0\\.5:before{content:var(--tw-content);left:calc(var(--spacing) * .5)}.before\\:size-4:before{content:var(--tw-content);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.before\\:rounded-full:before{content:var(--tw-content);border-radius:3.40282e38px}.before\\:bg-white:before{content:var(--tw-content);background-color:#fff}.before\\:shadow-\\[0_1px_2px_rgb\\(0_0_0\\/0\\.3\\)\\]:before{content:var(--tw-content);--tw-shadow:0 1px 2px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.before\\:transition-transform:before{content:var(--tw-content);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.first\\:border-t-0:first-child{border-top-style:var(--tw-border-style);border-top-width:0}.first-of-type\\:mt-0:first-of-type{margin-top:0}.checked\\:bg-settings-focus:checked{background-color:var(--settings-focus)}.checked\\:ring-transparent:checked{--tw-ring-color:transparent}.checked\\:before\\:translate-x-4:checked:before{content:var(--tw-content);--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.focus-within\\:border-settings-focus:focus-within{border-color:var(--settings-focus)}@media (hover:hover){.hover\\:text-settings-text:hover{color:var(--settings-text)}}.focus-visible\\:text-settings-text:focus-visible{color:var(--settings-text)}.focus-visible\\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-settings-focus:focus-visible{outline-color:var(--settings-focus)}.data-\\[invalid\\=true\\]\\:border-settings-danger[data-invalid=true]{border-color:var(--settings-danger)}.data-\\[invalid\\=true\\]\\:text-settings-danger[data-invalid=true],.data-\\[state\\=failed\\]\\:text-settings-danger[data-state=failed]{color:var(--settings-danger)}.data-\\[state\\=unavailable\\]\\:text-settings-warning[data-state=unavailable]{color:var(--settings-warning)}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@layer properties{\n *, ::before, ::after, ::backdrop{--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-alpha:100%;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-offset-width:0;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-drop-shadow-alpha:100%;--tw-content:"";--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}\n';
|
|
42546
|
+
var tailwind_default = '@layer properties, theme, base, components, utilities;\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-content:"";--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}@layer theme{:root,:host{--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.top-full{top:100%}.left-0{left:0}.z-20{z-index:20}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-7{margin-top:calc(var(--spacing) * 7)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-16{margin-top:calc(var(--spacing) * 16)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-1{margin-left:var(--spacing)}.ml-\\[45px\\]{margin-left:45px}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.list-item{display:list-item}.table{display:table}.size-1\\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-8{height:calc(var(--spacing) * 8)}.min-h-6{min-height:calc(var(--spacing) * 6)}.min-h-\\[60px\\]{min-height:60px}.w-9{width:calc(var(--spacing) * 9)}.w-14{width:calc(var(--spacing) * 14)}.w-80{width:calc(var(--spacing) * 80)}.w-full{width:100%}.w-px{width:1px}.max-w-64{max-width:calc(var(--spacing) * 64)}.min-w-0{min-width:0}.flex-shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-help{cursor:help}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-disc{list-style-type:disc}.appearance-none{appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.overflow-x-auto{overflow-x:auto}.rounded-\\[10px\\]{border-radius:10px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-settings-border{border-color:var(--settings-border)}.border-settings-divider{border-color:var(--settings-divider)}.bg-settings-panel{background-color:var(--settings-panel)}.bg-settings-subtle{background-color:var(--settings-subtle)}.bg-settings-surface{background-color:var(--settings-surface)}.bg-settings-surface-hover{background-color:var(--settings-surface-hover)}.bg-transparent{background-color:#0000}.p-0{padding:0}.p-4{padding:calc(var(--spacing) * 4)}.\\!px-0{padding-inline:0!important}.px-1{padding-inline:var(--spacing)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pl-4{padding-left:calc(var(--spacing) * 4)}.\\!text-right{text-align:right!important}.text-left{text-align:left}.text-right{text-align:right}.align-top{vertical-align:top}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[11px\\]{font-size:11px}.text-\\[13px\\]{font-size:13px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-7{--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.leading-\\[18px\\]{--tw-leading:18px;line-height:18px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-pre-wrap{white-space:pre-wrap}.text-settings-muted{color:var(--settings-muted)}.text-settings-subtle{color:var(--settings-subtle)}.text-settings-text{color:var(--settings-text)}.lowercase{text-transform:lowercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_10px_30px_rgb\\(0_0_0\\/0\\.22\\)\\]{--tw-shadow:0 10px 30px var(--tw-shadow-color,#00000038);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring,.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-settings-border{--tw-ring-color:var(--settings-border)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.outline-none{--tw-outline-style:none;outline-style:none}.ring-inset{--tw-ring-inset:inset}.group-focus-within\\:visible:is(:where(.group):focus-within *){visibility:visible}.group-focus-within\\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media (hover:hover){.group-hover\\:visible:is(:where(.group):hover *){visibility:visible}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-data-\\[state\\=failed\\]\\/status\\:bg-settings-danger:is(:where(.group\\/status)[data-state=failed] *){background-color:var(--settings-danger)}.group-data-\\[state\\=unavailable\\]\\/status\\:bg-settings-warning:is(:where(.group\\/status)[data-state=unavailable] *){background-color:var(--settings-warning)}.marker\\:text-settings-subtle ::marker{color:var(--settings-subtle)}.marker\\:text-settings-subtle::marker{color:var(--settings-subtle)}.marker\\:text-settings-subtle ::-webkit-details-marker{color:var(--settings-subtle)}.marker\\:text-settings-subtle::-webkit-details-marker{color:var(--settings-subtle)}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:top-0\\.5:before{content:var(--tw-content);top:calc(var(--spacing) * .5)}.before\\:left-0\\.5:before{content:var(--tw-content);left:calc(var(--spacing) * .5)}.before\\:size-4:before{content:var(--tw-content);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.before\\:rounded-full:before{content:var(--tw-content);border-radius:3.40282e38px}.before\\:bg-white:before{content:var(--tw-content);background-color:#fff}.before\\:shadow-\\[0_1px_2px_rgb\\(0_0_0\\/0\\.3\\)\\]:before{content:var(--tw-content);--tw-shadow:0 1px 2px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.before\\:transition-transform:before{content:var(--tw-content);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.first\\:border-t-0:first-child{border-top-style:var(--tw-border-style);border-top-width:0}.first-of-type\\:mt-0:first-of-type{margin-top:0}.checked\\:bg-settings-focus:checked{background-color:var(--settings-focus)}.checked\\:ring-transparent:checked{--tw-ring-color:transparent}.checked\\:before\\:translate-x-4:checked:before{content:var(--tw-content);--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.focus-within\\:border-settings-focus:focus-within{border-color:var(--settings-focus)}@media (hover:hover){.hover\\:bg-settings-hover:hover{background-color:var(--settings-hover)}.hover\\:text-settings-text:hover{color:var(--settings-text)}}.focus-visible\\:text-settings-text:focus-visible{color:var(--settings-text)}.focus-visible\\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-settings-focus:focus-visible{outline-color:var(--settings-focus)}.data-\\[invalid\\=true\\]\\:border-settings-danger[data-invalid=true]{border-color:var(--settings-danger)}.data-\\[invalid\\=true\\]\\:text-settings-danger[data-invalid=true],.data-\\[state\\=failed\\]\\:text-settings-danger[data-state=failed]{color:var(--settings-danger)}.data-\\[state\\=unavailable\\]\\:text-settings-warning[data-state=unavailable]{color:var(--settings-warning)}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@layer properties{\n *, ::before, ::after, ::backdrop{--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-alpha:100%;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-offset-width:0;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-drop-shadow-alpha:100%;--tw-content:"";--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}\n';
|
|
41764
42547
|
|
|
41765
42548
|
// src/settings/trigger.ts
|
|
41766
42549
|
var SETTINGS_TRIGGER_ATTRIBUTE = "data-codexhost-settings-trigger";
|
|
@@ -42005,7 +42788,7 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
42005
42788
|
place();
|
|
42006
42789
|
const observer = ownerWindow ? new ownerWindow.MutationObserver((records) => {
|
|
42007
42790
|
const titlebar = source?.closest("[data-app-shell-titlebar]");
|
|
42008
|
-
if (!source?.isConnected || records.some((
|
|
42791
|
+
if (!source?.isConnected || records.some((record15) => titlebar?.contains(record15.target))) {
|
|
42009
42792
|
place();
|
|
42010
42793
|
}
|
|
42011
42794
|
}) : null;
|
|
@@ -42427,6 +43210,7 @@ ${usage_default}`;
|
|
|
42427
43210
|
let disposed = false;
|
|
42428
43211
|
const mount = () => {
|
|
42429
43212
|
const messages = rendererSettingsMessages(locale);
|
|
43213
|
+
const schedules = options.harnessSchedules;
|
|
42430
43214
|
const definitions = createDefaultRendererSettingsPages(
|
|
42431
43215
|
messages,
|
|
42432
43216
|
options.getUpdateClient ?? (() => null),
|
|
@@ -42444,7 +43228,13 @@ ${usage_default}`;
|
|
|
42444
43228
|
options.getRemoteConnections ?? (() => null),
|
|
42445
43229
|
options.requestUsageStatistics,
|
|
42446
43230
|
options.usageStatisticsHosts,
|
|
42447
|
-
options.requestVoiceSettings
|
|
43231
|
+
options.requestVoiceSettings,
|
|
43232
|
+
schedules ? {
|
|
43233
|
+
openSchedules: async (signal) => {
|
|
43234
|
+
await schedules.openSchedules(signal);
|
|
43235
|
+
if (!disposed && !signal.aborted) shell?.close();
|
|
43236
|
+
}
|
|
43237
|
+
} : void 0
|
|
42448
43238
|
);
|
|
42449
43239
|
const nextShell = installRendererSettingsShell(definitions, messages, ownerWindow.document, {
|
|
42450
43240
|
onOpenChange(open) {
|
|
@@ -43178,6 +43968,815 @@ ${usage_default}`;
|
|
|
43178
43968
|
return event.defaultPrevented;
|
|
43179
43969
|
}
|
|
43180
43970
|
|
|
43971
|
+
// src/codex-schedule-navigation.ts
|
|
43972
|
+
function isNavigationBus(value) {
|
|
43973
|
+
if (typeof value !== "object" || value === null) return false;
|
|
43974
|
+
const bus = value;
|
|
43975
|
+
return bus.handlers instanceof Map && bus.handlers.has("navigate-to-route") && typeof bus.dispatchHostMessage === "function";
|
|
43976
|
+
}
|
|
43977
|
+
function hasArrived(ownerWindow) {
|
|
43978
|
+
const paths = ["/automations", "/scheduled"];
|
|
43979
|
+
const pages = ownerWindow.document.querySelectorAll('[data-app-shell-active-page="true"]');
|
|
43980
|
+
if (pages.length > 0) {
|
|
43981
|
+
const page = pages[0];
|
|
43982
|
+
if (pages.length !== 1 || !page) return false;
|
|
43983
|
+
const fiberKey = Object.keys(page).find((key) => key.startsWith("__reactFiber$"));
|
|
43984
|
+
if (!fiberKey) return false;
|
|
43985
|
+
for (const ancestor of committedReactAncestors(Reflect.get(page, fiberKey))) {
|
|
43986
|
+
const props = ancestor.memoizedProps;
|
|
43987
|
+
const value = props?.value;
|
|
43988
|
+
if (value?.navigationType === "POP" || value?.navigationType === "PUSH" || value?.navigationType === "REPLACE") {
|
|
43989
|
+
return typeof value.location?.pathname === "string" && paths.includes(value.location.pathname);
|
|
43990
|
+
}
|
|
43991
|
+
}
|
|
43992
|
+
return false;
|
|
43993
|
+
}
|
|
43994
|
+
return paths.includes(ownerWindow.location.pathname);
|
|
43995
|
+
}
|
|
43996
|
+
async function openCodexSchedules(signal, ownerWindow = window) {
|
|
43997
|
+
signal.throwIfAborted();
|
|
43998
|
+
const bus = await loadCodexNativeServices(ownerWindow, isNavigationBus);
|
|
43999
|
+
signal.throwIfAborted();
|
|
44000
|
+
if (!bus) throw new Error("Codex navigation is unavailable");
|
|
44001
|
+
await new Promise((resolve, reject) => {
|
|
44002
|
+
let settled2 = false;
|
|
44003
|
+
const finish = (error51) => {
|
|
44004
|
+
if (settled2) return;
|
|
44005
|
+
settled2 = true;
|
|
44006
|
+
ownerWindow.clearInterval(poll);
|
|
44007
|
+
ownerWindow.clearTimeout(timeout);
|
|
44008
|
+
signal.removeEventListener("abort", onAbort);
|
|
44009
|
+
if (error51) reject(error51);
|
|
44010
|
+
else resolve();
|
|
44011
|
+
};
|
|
44012
|
+
const arrived = () => hasArrived(ownerWindow);
|
|
44013
|
+
const onAbort = () => finish(arrived() ? void 0 : signal.reason);
|
|
44014
|
+
const poll = ownerWindow.setInterval(() => {
|
|
44015
|
+
if (arrived()) finish();
|
|
44016
|
+
}, 25);
|
|
44017
|
+
const timeout = ownerWindow.setTimeout(
|
|
44018
|
+
() => finish(new Error("Codex did not open the requested page")),
|
|
44019
|
+
5e3
|
|
44020
|
+
);
|
|
44021
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
44022
|
+
try {
|
|
44023
|
+
bus.dispatchHostMessage({ type: "navigate-to-route", path: "/automations" });
|
|
44024
|
+
if (arrived()) finish();
|
|
44025
|
+
} catch (error51) {
|
|
44026
|
+
finish(error51);
|
|
44027
|
+
}
|
|
44028
|
+
});
|
|
44029
|
+
}
|
|
44030
|
+
|
|
44031
|
+
// src/renderer-native-schedule-picker.ts
|
|
44032
|
+
var schedulePickerStyles = `
|
|
44033
|
+
.picker { position:relative; display:flex; justify-content:flex-end; min-width:0; max-width:100%; }
|
|
44034
|
+
.trigger { display:flex; align-items:center; gap:8px; min-width:0; max-width:100%; height:32px; padding:0 8px 0 10px; border:0; border-radius:10px; color:var(--muted); background:transparent; font:inherit; text-align:right; cursor:pointer; transition:background-color .12s, color .12s; }
|
|
44035
|
+
.trigger:hover:not(:disabled), .trigger[aria-expanded="true"] { color:var(--text); background:var(--hover); }
|
|
44036
|
+
.trigger:focus-visible { outline:2px solid var(--focus); outline-offset:1px; }
|
|
44037
|
+
.trigger:disabled { cursor:default; }
|
|
44038
|
+
.trigger > svg, .trigger > img, .trigger > span.icon, .item > svg, .item > img, .item > span.icon { flex:none; }
|
|
44039
|
+
.label { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
|
44040
|
+
.trigger[data-stale] .label { opacity:.6; }
|
|
44041
|
+
.trigger[data-shimmer] .label { background:linear-gradient(90deg,var(--muted) 0%,var(--muted) 35%,color-mix(in srgb,var(--muted) 30%,transparent) 50%,var(--muted) 65%,var(--muted) 100%) 100% 0/250% 100%; -webkit-background-clip:text; background-clip:text; color:transparent; animation:shimmer 1.4s ease-in-out infinite; }
|
|
44042
|
+
.chevron { flex:none; width:6px; height:6px; margin:0 3px 2px 2px; border-right:1.5px solid; border-bottom:1.5px solid; transform:rotate(45deg); transition:transform .12s; }
|
|
44043
|
+
.trigger[aria-expanded="true"] .chevron { transform:translateY(2px) rotate(225deg); }
|
|
44044
|
+
.trigger[aria-busy="true"] .chevron { display:none; }
|
|
44045
|
+
.spinner { flex:none; width:12px; height:12px; margin:0 1px; border:1.5px solid color-mix(in srgb,currentColor 25%,transparent); border-top-color:currentColor; border-radius:50%; animation:spin .8s linear infinite; }
|
|
44046
|
+
.menu { position:fixed; inset:auto; margin:0; padding:4px; min-width:200px; max-width:calc(100vw - 16px); overflow:auto; overscroll-behavior:contain; border:1px solid var(--border); border-radius:12px; color:var(--text); background:var(--surface); box-shadow:0 8px 28px rgba(0,0,0,.22),0 1px 3px rgba(0,0,0,.12); font:inherit; }
|
|
44047
|
+
.menu:not(:popover-open):not([data-open]) { display:none; }
|
|
44048
|
+
.item { display:flex; align-items:center; gap:10px; min-height:36px; padding:6px 8px; border-radius:8px; cursor:pointer; outline:none; }
|
|
44049
|
+
.item:hover:not([aria-disabled="true"]), .item:focus-visible { background:var(--hover); }
|
|
44050
|
+
.item:focus-visible { box-shadow:inset 0 0 0 2px var(--focus); }
|
|
44051
|
+
.item[aria-disabled="true"] { opacity:.45; cursor:default; }
|
|
44052
|
+
.item .label { flex:1; }
|
|
44053
|
+
.check { flex:none; width:5px; height:9px; margin:0 6px 2px 4px; border-right:1.5px solid; border-bottom:1.5px solid; transform:rotate(45deg); visibility:hidden; }
|
|
44054
|
+
.item[aria-selected="true"] .check { visibility:visible; }
|
|
44055
|
+
@keyframes shimmer { to { background-position:-100% 0; } }
|
|
44056
|
+
@keyframes spin { to { transform:rotate(360deg); } }
|
|
44057
|
+
@media(prefers-reduced-motion:reduce) { .spinner, .trigger[data-shimmer] .label { animation:none; } .trigger, .chevron { transition:none; } }
|
|
44058
|
+
`;
|
|
44059
|
+
function createSchedulePicker(document2, options) {
|
|
44060
|
+
const view = document2.defaultView ?? window;
|
|
44061
|
+
const root = document2.createElement("div");
|
|
44062
|
+
root.className = "picker";
|
|
44063
|
+
const trigger = document2.createElement("button");
|
|
44064
|
+
trigger.type = "button";
|
|
44065
|
+
trigger.className = "trigger";
|
|
44066
|
+
trigger.setAttribute("aria-label", options.label);
|
|
44067
|
+
trigger.setAttribute("aria-haspopup", "listbox");
|
|
44068
|
+
trigger.setAttribute("aria-expanded", "false");
|
|
44069
|
+
const menu = document2.createElement("div");
|
|
44070
|
+
menu.className = "menu";
|
|
44071
|
+
menu.setAttribute("role", "listbox");
|
|
44072
|
+
menu.setAttribute("aria-label", options.listLabel);
|
|
44073
|
+
const supportsPopover = typeof menu.showPopover === "function";
|
|
44074
|
+
if (supportsPopover) menu.setAttribute("popover", "manual");
|
|
44075
|
+
root.append(trigger, menu);
|
|
44076
|
+
let items = [];
|
|
44077
|
+
let stale = null;
|
|
44078
|
+
let value = "";
|
|
44079
|
+
let disabled = false;
|
|
44080
|
+
let busy = false;
|
|
44081
|
+
let placeholder = "";
|
|
44082
|
+
let shimmer = false;
|
|
44083
|
+
let isOpen = false;
|
|
44084
|
+
let isDisabled = () => false;
|
|
44085
|
+
const optionElements = /* @__PURE__ */ new Map();
|
|
44086
|
+
const selectedItem = () => items.find((item) => item.value === value) ?? stale;
|
|
44087
|
+
const cloneIcon = (item) => item.icon?.cloneNode(true) ?? null;
|
|
44088
|
+
const renderTrigger = () => {
|
|
44089
|
+
const item = selectedItem();
|
|
44090
|
+
const label = document2.createElement("span");
|
|
44091
|
+
label.className = "label";
|
|
44092
|
+
label.textContent = item?.label ?? placeholder;
|
|
44093
|
+
const icon2 = item ? cloneIcon(item) : null;
|
|
44094
|
+
const tail = document2.createElement("span");
|
|
44095
|
+
tail.className = busy ? "spinner" : "chevron";
|
|
44096
|
+
tail.setAttribute("aria-hidden", "true");
|
|
44097
|
+
trigger.replaceChildren(...icon2 ? [icon2] : [], label, tail);
|
|
44098
|
+
trigger.toggleAttribute("data-stale", Boolean(item && !items.includes(item)));
|
|
44099
|
+
trigger.toggleAttribute("data-shimmer", shimmer && !item);
|
|
44100
|
+
trigger.dataset.value = item ? value : "";
|
|
44101
|
+
trigger.setAttribute("aria-busy", String(busy));
|
|
44102
|
+
trigger.disabled = disabled;
|
|
44103
|
+
if (disabled && isOpen) close();
|
|
44104
|
+
};
|
|
44105
|
+
const renderItems = () => {
|
|
44106
|
+
optionElements.clear();
|
|
44107
|
+
const elements = items.map((item) => {
|
|
44108
|
+
const option = document2.createElement("div");
|
|
44109
|
+
option.className = "item";
|
|
44110
|
+
option.setAttribute("role", "option");
|
|
44111
|
+
option.tabIndex = -1;
|
|
44112
|
+
option.dataset.value = item.value;
|
|
44113
|
+
option.setAttribute("aria-selected", String(item.value === value));
|
|
44114
|
+
if (item.disabled || isDisabled(item.value)) option.setAttribute("aria-disabled", "true");
|
|
44115
|
+
const icon2 = cloneIcon(item);
|
|
44116
|
+
const label = document2.createElement("span");
|
|
44117
|
+
label.className = "label";
|
|
44118
|
+
label.textContent = item.label;
|
|
44119
|
+
const check2 = document2.createElement("span");
|
|
44120
|
+
check2.className = "check";
|
|
44121
|
+
check2.setAttribute("aria-hidden", "true");
|
|
44122
|
+
option.append(...icon2 ? [icon2] : [], label, check2);
|
|
44123
|
+
optionElements.set(item.value, option);
|
|
44124
|
+
return option;
|
|
44125
|
+
});
|
|
44126
|
+
menu.replaceChildren(...elements);
|
|
44127
|
+
};
|
|
44128
|
+
const enabledOptions = () => [...optionElements.values()].filter((el) => el.getAttribute("aria-disabled") !== "true");
|
|
44129
|
+
const focusOption = (el) => {
|
|
44130
|
+
el?.focus();
|
|
44131
|
+
el?.scrollIntoView({ block: "nearest" });
|
|
44132
|
+
};
|
|
44133
|
+
const position = () => {
|
|
44134
|
+
const rect = trigger.getBoundingClientRect();
|
|
44135
|
+
const margin = 8;
|
|
44136
|
+
menu.style.minWidth = `${Math.max(200, Math.min(rect.width, view.innerWidth - 2 * margin))}px`;
|
|
44137
|
+
menu.style.maxHeight = "";
|
|
44138
|
+
const height = menu.offsetHeight;
|
|
44139
|
+
const below = view.innerHeight - rect.bottom - margin - 4;
|
|
44140
|
+
const above = rect.top - margin - 4;
|
|
44141
|
+
const placeBelow = height <= below || below >= above;
|
|
44142
|
+
const room = Math.max(120, placeBelow ? below : above);
|
|
44143
|
+
menu.style.maxHeight = `${room}px`;
|
|
44144
|
+
const used = Math.min(height, room);
|
|
44145
|
+
menu.style.top = `${placeBelow ? rect.bottom + 4 : rect.top - 4 - used}px`;
|
|
44146
|
+
const width = menu.offsetWidth;
|
|
44147
|
+
const left = Math.min(Math.max(margin, rect.right - width), view.innerWidth - width - margin);
|
|
44148
|
+
menu.style.left = `${Math.max(margin, left)}px`;
|
|
44149
|
+
};
|
|
44150
|
+
const onWindowKey = (event) => {
|
|
44151
|
+
if (event.key !== "Escape") return;
|
|
44152
|
+
event.preventDefault();
|
|
44153
|
+
event.stopImmediatePropagation();
|
|
44154
|
+
close();
|
|
44155
|
+
trigger.focus();
|
|
44156
|
+
};
|
|
44157
|
+
const onOutside = (event) => {
|
|
44158
|
+
if (!event.composedPath().includes(root)) close();
|
|
44159
|
+
};
|
|
44160
|
+
const onDismiss = () => close();
|
|
44161
|
+
function open() {
|
|
44162
|
+
if (isOpen || disabled) return;
|
|
44163
|
+
options.onOpen?.();
|
|
44164
|
+
if (!items.length) return;
|
|
44165
|
+
isOpen = true;
|
|
44166
|
+
trigger.setAttribute("aria-expanded", "true");
|
|
44167
|
+
if (supportsPopover) menu.showPopover();
|
|
44168
|
+
else menu.setAttribute("data-open", "");
|
|
44169
|
+
position();
|
|
44170
|
+
focusOption(optionElements.get(value) ?? enabledOptions()[0]);
|
|
44171
|
+
view.addEventListener("keydown", onWindowKey, true);
|
|
44172
|
+
document2.addEventListener("pointerdown", onOutside, true);
|
|
44173
|
+
view.addEventListener("resize", onDismiss);
|
|
44174
|
+
view.addEventListener("blur", onDismiss);
|
|
44175
|
+
document2.addEventListener("scroll", onDismiss, true);
|
|
44176
|
+
}
|
|
44177
|
+
function close() {
|
|
44178
|
+
if (!isOpen) return;
|
|
44179
|
+
isOpen = false;
|
|
44180
|
+
trigger.setAttribute("aria-expanded", "false");
|
|
44181
|
+
if (supportsPopover && menu.matches(":popover-open")) menu.hidePopover();
|
|
44182
|
+
menu.removeAttribute("data-open");
|
|
44183
|
+
view.removeEventListener("keydown", onWindowKey, true);
|
|
44184
|
+
document2.removeEventListener("pointerdown", onOutside, true);
|
|
44185
|
+
view.removeEventListener("resize", onDismiss);
|
|
44186
|
+
view.removeEventListener("blur", onDismiss);
|
|
44187
|
+
document2.removeEventListener("scroll", onDismiss, true);
|
|
44188
|
+
}
|
|
44189
|
+
const choose = (el) => {
|
|
44190
|
+
if (el.getAttribute("aria-disabled") === "true") return;
|
|
44191
|
+
const next = el.dataset.value ?? "";
|
|
44192
|
+
close();
|
|
44193
|
+
trigger.focus();
|
|
44194
|
+
if (next === value) return;
|
|
44195
|
+
picker.value = next;
|
|
44196
|
+
options.onChange(next);
|
|
44197
|
+
};
|
|
44198
|
+
trigger.addEventListener("click", () => isOpen ? close() : open());
|
|
44199
|
+
trigger.addEventListener("keydown", (event) => {
|
|
44200
|
+
if (event.key !== "ArrowDown" && event.key !== "ArrowUp") return;
|
|
44201
|
+
event.preventDefault();
|
|
44202
|
+
open();
|
|
44203
|
+
});
|
|
44204
|
+
menu.addEventListener("click", (event) => {
|
|
44205
|
+
const el = event.target.closest('[role="option"]');
|
|
44206
|
+
if (el) choose(el);
|
|
44207
|
+
});
|
|
44208
|
+
menu.addEventListener("keydown", (event) => {
|
|
44209
|
+
const list = enabledOptions();
|
|
44210
|
+
const active = menu.getRootNode().activeElement;
|
|
44211
|
+
const at = active ? list.indexOf(active) : -1;
|
|
44212
|
+
if (event.key === "ArrowDown") focusOption(list[Math.min(list.length - 1, at + 1)]);
|
|
44213
|
+
else if (event.key === "ArrowUp") focusOption(list[Math.max(0, at - 1)]);
|
|
44214
|
+
else if (event.key === "Home") focusOption(list[0]);
|
|
44215
|
+
else if (event.key === "End") focusOption(list.at(-1));
|
|
44216
|
+
else if (event.key === "Enter" || event.key === " ") {
|
|
44217
|
+
if (active?.getAttribute("role") === "option") choose(active);
|
|
44218
|
+
} else if (event.key === "Tab") {
|
|
44219
|
+
close();
|
|
44220
|
+
trigger.focus();
|
|
44221
|
+
return;
|
|
44222
|
+
} else return;
|
|
44223
|
+
event.preventDefault();
|
|
44224
|
+
});
|
|
44225
|
+
const picker = {
|
|
44226
|
+
root,
|
|
44227
|
+
trigger,
|
|
44228
|
+
get value() {
|
|
44229
|
+
return value;
|
|
44230
|
+
},
|
|
44231
|
+
set value(next) {
|
|
44232
|
+
if (next === value) return;
|
|
44233
|
+
stale = null;
|
|
44234
|
+
value = next;
|
|
44235
|
+
for (const [key, el] of optionElements)
|
|
44236
|
+
el.setAttribute("aria-selected", String(key === next));
|
|
44237
|
+
renderTrigger();
|
|
44238
|
+
},
|
|
44239
|
+
get disabled() {
|
|
44240
|
+
return disabled;
|
|
44241
|
+
},
|
|
44242
|
+
set disabled(next) {
|
|
44243
|
+
if (next === disabled) return;
|
|
44244
|
+
disabled = next;
|
|
44245
|
+
renderTrigger();
|
|
44246
|
+
},
|
|
44247
|
+
get busy() {
|
|
44248
|
+
return busy;
|
|
44249
|
+
},
|
|
44250
|
+
set busy(next) {
|
|
44251
|
+
if (next === busy) return;
|
|
44252
|
+
busy = next;
|
|
44253
|
+
renderTrigger();
|
|
44254
|
+
},
|
|
44255
|
+
setItems(next) {
|
|
44256
|
+
const previous = selectedItem();
|
|
44257
|
+
stale = options.retainMissing && previous && !next.some((item) => item.value === value) ? { ...previous, disabled: true } : null;
|
|
44258
|
+
items = next;
|
|
44259
|
+
renderItems();
|
|
44260
|
+
renderTrigger();
|
|
44261
|
+
},
|
|
44262
|
+
setDisabledValues(next) {
|
|
44263
|
+
isDisabled = next;
|
|
44264
|
+
for (const item of items) {
|
|
44265
|
+
const el = optionElements.get(item.value);
|
|
44266
|
+
if (!el) continue;
|
|
44267
|
+
if (item.disabled || next(item.value)) el.setAttribute("aria-disabled", "true");
|
|
44268
|
+
else el.removeAttribute("aria-disabled");
|
|
44269
|
+
}
|
|
44270
|
+
},
|
|
44271
|
+
setPlaceholder(text, shimmerText = false) {
|
|
44272
|
+
if (text === placeholder && shimmerText === shimmer) return;
|
|
44273
|
+
placeholder = text;
|
|
44274
|
+
shimmer = shimmerText;
|
|
44275
|
+
renderTrigger();
|
|
44276
|
+
},
|
|
44277
|
+
close
|
|
44278
|
+
};
|
|
44279
|
+
renderTrigger();
|
|
44280
|
+
return picker;
|
|
44281
|
+
}
|
|
44282
|
+
|
|
44283
|
+
// src/renderer-native-schedule-controls.ts
|
|
44284
|
+
function restoreRow(row, appearance) {
|
|
44285
|
+
row.hidden = appearance.hidden;
|
|
44286
|
+
row.style.setProperty("display", appearance.display, appearance.priority);
|
|
44287
|
+
}
|
|
44288
|
+
function installRendererNativeScheduleControls(document2, options) {
|
|
44289
|
+
const view = document2.defaultView ?? window;
|
|
44290
|
+
const mounted = /* @__PURE__ */ new Map();
|
|
44291
|
+
let disposed = false;
|
|
44292
|
+
let frame = null;
|
|
44293
|
+
const text = (zh, en) => options.locale() === "zh-CN" ? zh : en;
|
|
44294
|
+
const schedule = () => {
|
|
44295
|
+
if (!disposed && frame === null) frame = view.requestAnimationFrame(scan);
|
|
44296
|
+
};
|
|
44297
|
+
function mount(form) {
|
|
44298
|
+
const root = document2.createElement("div");
|
|
44299
|
+
root.dataset.codexhostScheduleControls = "true";
|
|
44300
|
+
const shadow = root.attachShadow({ mode: "open" });
|
|
44301
|
+
const style = document2.createElement("style");
|
|
44302
|
+
style.textContent = `
|
|
44303
|
+
:host { display:block; contain:inline-size; margin:0 0 16px; color:inherit; font:inherit; --text:var(--color-text-primary,CanvasText); --muted:var(--color-text-secondary,light-dark(#6b6b6b,#b5b5b5)); --border:var(--color-border-default,light-dark(#e1e1e1,#454545)); --hover:var(--color-token-list-hover-background,light-dark(rgba(0,0,0,.05),rgba(255,255,255,.08))); --surface:var(--color-token-dropdown-background,var(--color-background-surface,Canvas)); --focus:var(--color-text-info,#387aff); }
|
|
44304
|
+
* { box-sizing:border-box; }
|
|
44305
|
+
fieldset { border:1px solid var(--border); border-radius:16px; padding:0 12px; margin:0; min-width:0; }
|
|
44306
|
+
.row { display:flex; align-items:center; justify-content:space-between; gap:16px; min-width:0; min-height:52px; padding:8px 0 8px 4px; font:inherit; }
|
|
44307
|
+
.row + .row { border-top:1px solid var(--border); }
|
|
44308
|
+
.name { flex:none; }
|
|
44309
|
+
.value { display:flex; justify-content:flex-end; min-width:0; max-width:72%; }
|
|
44310
|
+
fieldset:disabled { opacity:.6; }
|
|
44311
|
+
${schedulePickerStyles}
|
|
44312
|
+
.message { display:flex; align-items:baseline; gap:8px; margin:8px 4px 0; color:var(--muted); font-size:12px; line-height:1.5; }
|
|
44313
|
+
p { margin:0; min-width:0; overflow-wrap:anywhere; }
|
|
44314
|
+
button.retry { border:0; border-radius:4px; padding:2px 4px; color:inherit; background:transparent; font:inherit; text-decoration:underline; cursor:pointer; flex-shrink:0; }
|
|
44315
|
+
button.retry:focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
|
|
44316
|
+
[hidden] { display:none!important; }
|
|
44317
|
+
`;
|
|
44318
|
+
const fields = document2.createElement("fieldset");
|
|
44319
|
+
const harness2 = createSchedulePicker(document2, {
|
|
44320
|
+
label: "Harness",
|
|
44321
|
+
listLabel: text("\u9009\u62E9 Harness", "Choose a Harness"),
|
|
44322
|
+
retainMissing: true,
|
|
44323
|
+
onChange: () => onHarness()
|
|
44324
|
+
});
|
|
44325
|
+
const model2 = createSchedulePicker(document2, {
|
|
44326
|
+
label: text("\u6A21\u578B", "Model"),
|
|
44327
|
+
listLabel: text("\u9009\u62E9\u6A21\u578B", "Choose a Model"),
|
|
44328
|
+
retainMissing: true,
|
|
44329
|
+
onChange: () => applyModel()
|
|
44330
|
+
});
|
|
44331
|
+
const workspace = createSchedulePicker(document2, {
|
|
44332
|
+
label: text("\u5DE5\u4F5C\u533A", "Workspace"),
|
|
44333
|
+
listLabel: text("\u9009\u62E9\u5DE5\u4F5C\u533A", "Choose a workspace"),
|
|
44334
|
+
retainMissing: true,
|
|
44335
|
+
onOpen: () => refreshWorkspaces(),
|
|
44336
|
+
onChange: () => {
|
|
44337
|
+
const next = workspaces.find(({ id }) => id === workspace.value) ?? null;
|
|
44338
|
+
if (next?.id === selectedWorkspace?.id && next?.cwd === selectedWorkspace?.cwd) return;
|
|
44339
|
+
selectedWorkspace = next;
|
|
44340
|
+
void loadModels({ preserveSelection: models.length > 0 });
|
|
44341
|
+
}
|
|
44342
|
+
});
|
|
44343
|
+
const label = (name, picker) => {
|
|
44344
|
+
const row = document2.createElement("div");
|
|
44345
|
+
row.className = "row";
|
|
44346
|
+
const title = document2.createElement("span");
|
|
44347
|
+
title.className = "name";
|
|
44348
|
+
title.textContent = name;
|
|
44349
|
+
const value = document2.createElement("div");
|
|
44350
|
+
value.className = "value";
|
|
44351
|
+
value.append(picker.root);
|
|
44352
|
+
row.append(title, value);
|
|
44353
|
+
fields.append(row);
|
|
44354
|
+
return row;
|
|
44355
|
+
};
|
|
44356
|
+
label("Harness", harness2);
|
|
44357
|
+
const modelRow = label(text("\u6A21\u578B", "Model"), model2);
|
|
44358
|
+
const workspaceRow = label(text("\u5DE5\u4F5C\u533A", "Workspace"), workspace);
|
|
44359
|
+
const status = document2.createElement("p");
|
|
44360
|
+
status.setAttribute("role", "status");
|
|
44361
|
+
const retry = document2.createElement("button");
|
|
44362
|
+
retry.type = "button";
|
|
44363
|
+
retry.className = "retry";
|
|
44364
|
+
retry.textContent = text("\u91CD\u8BD5", "Retry");
|
|
44365
|
+
retry.hidden = true;
|
|
44366
|
+
const messageRow = document2.createElement("div");
|
|
44367
|
+
messageRow.className = "message";
|
|
44368
|
+
messageRow.append(status, retry);
|
|
44369
|
+
shadow.append(style, fields, messageRow);
|
|
44370
|
+
const editor = form.querySelector('[contenteditable="true"][role="textbox"], textarea');
|
|
44371
|
+
const container = editor?.closest("fieldset")?.querySelector(":scope > div") ?? form;
|
|
44372
|
+
container.prepend(root);
|
|
44373
|
+
let retired = false;
|
|
44374
|
+
let client = options.getClient();
|
|
44375
|
+
let selectedHarness = "codex";
|
|
44376
|
+
let availablePlugins = [];
|
|
44377
|
+
let generation = 0;
|
|
44378
|
+
let loading = false;
|
|
44379
|
+
let confirming = false;
|
|
44380
|
+
let confirmationTimer;
|
|
44381
|
+
let error51 = "";
|
|
44382
|
+
let models = [];
|
|
44383
|
+
let workspaces = [];
|
|
44384
|
+
let selectedWorkspace = null;
|
|
44385
|
+
let workspaceCreation = null;
|
|
44386
|
+
let carrier = null;
|
|
44387
|
+
let original = null;
|
|
44388
|
+
let restoring = null;
|
|
44389
|
+
const hiddenRows = /* @__PURE__ */ new Map();
|
|
44390
|
+
const external = () => selectedHarness !== "codex";
|
|
44391
|
+
const available = () => options.getAvailablePlugins().some((plugin) => plugin.id === selectedHarness);
|
|
44392
|
+
const harnessItem = (id, name, plugin) => ({
|
|
44393
|
+
value: id,
|
|
44394
|
+
label: name,
|
|
44395
|
+
icon: createRendererAgentIcon(id, 18, document2, plugin)
|
|
44396
|
+
});
|
|
44397
|
+
harness2.setItems([harnessItem("codex", "Codex")]);
|
|
44398
|
+
harness2.value = "codex";
|
|
44399
|
+
const syncAvailablePlugins = () => {
|
|
44400
|
+
const next = options.getAvailablePlugins();
|
|
44401
|
+
if (next.length === availablePlugins.length && next.every(
|
|
44402
|
+
(plugin, index) => plugin.id === availablePlugins[index]?.id && plugin.name === availablePlugins[index]?.name
|
|
44403
|
+
))
|
|
44404
|
+
return;
|
|
44405
|
+
availablePlugins = next;
|
|
44406
|
+
harness2.setItems([
|
|
44407
|
+
harnessItem("codex", "Codex"),
|
|
44408
|
+
...next.map((plugin) => harnessItem(plugin.id, plugin.name, plugin))
|
|
44409
|
+
]);
|
|
44410
|
+
harness2.value = selectedHarness;
|
|
44411
|
+
};
|
|
44412
|
+
function refreshWorkspaces() {
|
|
44413
|
+
workspaces = readNativeScheduleWorkspaces(document2);
|
|
44414
|
+
workspace.setItems([
|
|
44415
|
+
{ value: "", label: text("\u81EA\u52A8\u5206\u914D", "Automatic") },
|
|
44416
|
+
...workspaces.map(({ id, label: label2, cwd }) => ({ value: id, label: `${label2} \xB7 ${cwd}` }))
|
|
44417
|
+
]);
|
|
44418
|
+
workspace.value = selectedWorkspace?.id ?? "";
|
|
44419
|
+
update();
|
|
44420
|
+
}
|
|
44421
|
+
const cancelConfirmation = () => {
|
|
44422
|
+
if (confirmationTimer !== void 0) view.clearTimeout(confirmationTimer);
|
|
44423
|
+
confirmationTimer = void 0;
|
|
44424
|
+
confirming = false;
|
|
44425
|
+
};
|
|
44426
|
+
const restoredSelection = (selection) => restoring && (restoring.model === null ? !selection.model?.startsWith("codexhost/") : selection.model === restoring.model && selection.reasoningEffort === restoring.reasoningEffort);
|
|
44427
|
+
const confirmSelection = () => {
|
|
44428
|
+
cancelConfirmation();
|
|
44429
|
+
confirming = true;
|
|
44430
|
+
const deadline = Date.now() + 5e3;
|
|
44431
|
+
const check2 = () => {
|
|
44432
|
+
if (retired) return;
|
|
44433
|
+
const binding = readNativeScheduleForm(form);
|
|
44434
|
+
const confirmed = binding && (external() ? binding.selection.model === carrier : !restoring || restoredSelection(binding.selection));
|
|
44435
|
+
if (!binding || !options.canRouteExternal() || client !== options.getClient() || confirmed || Date.now() >= deadline)
|
|
44436
|
+
cancelConfirmation();
|
|
44437
|
+
else confirmationTimer = view.setTimeout(check2, 50);
|
|
44438
|
+
update();
|
|
44439
|
+
};
|
|
44440
|
+
confirmationTimer = view.setTimeout(check2, 0);
|
|
44441
|
+
};
|
|
44442
|
+
const restore = () => {
|
|
44443
|
+
const binding = readNativeScheduleForm(form);
|
|
44444
|
+
if (original && carrier && (!binding || binding.selection.model === carrier || confirming)) {
|
|
44445
|
+
restoring = original;
|
|
44446
|
+
binding?.setModel(original);
|
|
44447
|
+
confirmSelection();
|
|
44448
|
+
}
|
|
44449
|
+
carrier = null;
|
|
44450
|
+
original = null;
|
|
44451
|
+
selectedWorkspace = null;
|
|
44452
|
+
workspace.value = "";
|
|
44453
|
+
};
|
|
44454
|
+
const applyModel = () => {
|
|
44455
|
+
const binding = readNativeScheduleForm(form);
|
|
44456
|
+
const selected = models.find((entry) => entry.ref.id === model2.value);
|
|
44457
|
+
if (!external() || workspaceCreation !== null || !binding?.supportsExternal || !available() || binding.hasTarget || binding.isSaving || !selected)
|
|
44458
|
+
return;
|
|
44459
|
+
original ??= restoring ?? binding.selection;
|
|
44460
|
+
restoring = null;
|
|
44461
|
+
carrier = encodeHarnessPluginRoute({
|
|
44462
|
+
harnessId: selectedHarness,
|
|
44463
|
+
model: selected.ref
|
|
44464
|
+
});
|
|
44465
|
+
binding.setModel({ model: carrier, reasoningEffort: null });
|
|
44466
|
+
confirmSelection();
|
|
44467
|
+
update();
|
|
44468
|
+
};
|
|
44469
|
+
const loadModels = async ({ preserveSelection = false } = {}) => {
|
|
44470
|
+
const request = ++generation;
|
|
44471
|
+
const previousModel = model2.value;
|
|
44472
|
+
if (!preserveSelection) {
|
|
44473
|
+
cancelConfirmation();
|
|
44474
|
+
models = [];
|
|
44475
|
+
model2.setItems([]);
|
|
44476
|
+
model2.value = "";
|
|
44477
|
+
model2.setPlaceholder(text("\u6B63\u5728\u52A0\u8F7D\u6A21\u578B\u2026", "Loading models\u2026"), true);
|
|
44478
|
+
}
|
|
44479
|
+
error51 = "";
|
|
44480
|
+
loading = true;
|
|
44481
|
+
update();
|
|
44482
|
+
const requestedHarness = selectedHarness;
|
|
44483
|
+
const selectedClient = client;
|
|
44484
|
+
try {
|
|
44485
|
+
if (!selectedClient) throw Error(text("\u672C\u5730\u8FDE\u63A5\u4E0D\u53EF\u7528\u3002", "Local connection unavailable."));
|
|
44486
|
+
const result = await selectedClient.inspectHarness({
|
|
44487
|
+
harnessId: requestedHarness,
|
|
44488
|
+
...selectedWorkspace ? { cwd: selectedWorkspace.cwd } : {}
|
|
44489
|
+
});
|
|
44490
|
+
if (retired || request !== generation || selectedClient !== options.getClient()) return;
|
|
44491
|
+
if (result.status !== "ready")
|
|
44492
|
+
throw Error(text("\u6240\u9009 Harness \u4E0D\u53EF\u7528\u3002", "The selected Harness is unavailable."));
|
|
44493
|
+
const selectedModel = preserveSelection ? model2.value : previousModel;
|
|
44494
|
+
const next = result.catalog.models;
|
|
44495
|
+
const changed = next.length !== models.length || next.some(
|
|
44496
|
+
(entry, index) => entry.ref.id !== models[index]?.ref.id || entry.label !== models[index]?.label
|
|
44497
|
+
);
|
|
44498
|
+
models = next;
|
|
44499
|
+
if (changed || !preserveSelection)
|
|
44500
|
+
model2.setItems(models.map((entry) => ({ value: entry.ref.id, label: entry.label })));
|
|
44501
|
+
const defaultModel = result.catalog.defaultModel;
|
|
44502
|
+
model2.value = preserveSelection || models.some((entry) => entry.ref.id === selectedModel) ? selectedModel : defaultModel && models.some((entry) => entry.ref.id === defaultModel.id) ? defaultModel.id : models[0]?.ref.id ?? "";
|
|
44503
|
+
model2.setPlaceholder("");
|
|
44504
|
+
if (!models.length) throw Error(text("\u6CA1\u6709\u53EF\u7528\u6A21\u578B\u3002", "No models are available."));
|
|
44505
|
+
if (!preserveSelection) applyModel();
|
|
44506
|
+
} catch (cause) {
|
|
44507
|
+
if (retired || request !== generation) return;
|
|
44508
|
+
error51 = cause instanceof Error ? cause.message : text("\u6A21\u578B\u8BFB\u53D6\u5931\u8D25\u3002", "Could not read models.");
|
|
44509
|
+
if (!preserveSelection) model2.setPlaceholder(text("\u6A21\u578B\u52A0\u8F7D\u5931\u8D25", "Models unavailable"));
|
|
44510
|
+
} finally {
|
|
44511
|
+
if (!retired && request === generation) {
|
|
44512
|
+
loading = false;
|
|
44513
|
+
update();
|
|
44514
|
+
}
|
|
44515
|
+
}
|
|
44516
|
+
};
|
|
44517
|
+
const onHarness = () => {
|
|
44518
|
+
const binding = readNativeScheduleForm(form);
|
|
44519
|
+
if (binding?.hasTarget || binding?.isSaving || workspaceCreation) return;
|
|
44520
|
+
selectedHarness = harness2.value;
|
|
44521
|
+
client = options.getClient();
|
|
44522
|
+
if (!external()) restore();
|
|
44523
|
+
generation++;
|
|
44524
|
+
models = [];
|
|
44525
|
+
model2.setItems([]);
|
|
44526
|
+
model2.value = "";
|
|
44527
|
+
model2.setPlaceholder("");
|
|
44528
|
+
error51 = "";
|
|
44529
|
+
loading = false;
|
|
44530
|
+
if (external()) {
|
|
44531
|
+
refreshWorkspaces();
|
|
44532
|
+
void loadModels();
|
|
44533
|
+
}
|
|
44534
|
+
update();
|
|
44535
|
+
};
|
|
44536
|
+
retry.addEventListener("click", () => {
|
|
44537
|
+
if (error51) void loadModels({ preserveSelection: models.length > 0 });
|
|
44538
|
+
else applyModel();
|
|
44539
|
+
});
|
|
44540
|
+
function blockedReason() {
|
|
44541
|
+
const binding = readNativeScheduleForm(form);
|
|
44542
|
+
if (!external()) {
|
|
44543
|
+
const restored = binding && restoredSelection(binding.selection);
|
|
44544
|
+
if (restoring && !restored)
|
|
44545
|
+
return text(
|
|
44546
|
+
"\u6B63\u5728\u6062\u590D Codex \u914D\u7F6E\uFF0C\u8BF7\u7A0D\u540E\u63D0\u4EA4\u3002",
|
|
44547
|
+
"Restoring Codex settings. Submit again once ready."
|
|
44548
|
+
);
|
|
44549
|
+
restoring = null;
|
|
44550
|
+
if (binding?.selection.model?.startsWith("codexhost/"))
|
|
44551
|
+
return text(
|
|
44552
|
+
"\u4EFB\u52A1\u4ECD\u643A\u5E26\u5916\u90E8 Model\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u5F39\u7A97\u3002",
|
|
44553
|
+
"The task still carries an external Model. Reopen the dialog."
|
|
44554
|
+
);
|
|
44555
|
+
return "";
|
|
44556
|
+
}
|
|
44557
|
+
if (!binding || !options.canRouteExternal() || client !== options.getClient())
|
|
44558
|
+
return text(
|
|
44559
|
+
"\u4EFB\u52A1\u63A5\u5165\u6216\u672C\u5730\u8FDE\u63A5\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u5F39\u7A97\u3002",
|
|
44560
|
+
"Task binding or local connection unavailable. Reopen the dialog."
|
|
44561
|
+
);
|
|
44562
|
+
if (!available())
|
|
44563
|
+
return text(
|
|
44564
|
+
"\u6240\u9009 Harness \u5DF2\u4E0D\u5728\u672C\u5730\u53EF\u7528\u5217\u8868\u4E2D\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002",
|
|
44565
|
+
"The selected Harness is no longer available locally. Choose another Harness."
|
|
44566
|
+
);
|
|
44567
|
+
if (!binding.supportsExternal)
|
|
44568
|
+
return text(
|
|
44569
|
+
"\u5916\u90E8 Harness \u4EC5\u652F\u6301\u672C\u5730\u56FA\u5B9A\u804A\u5929\uFF1A\u8BF7\u542F\u7528\u201C\u5728\u6B64\u7535\u8111\u4E0A\u8FD0\u884C\u201D\uFF0C\u5173\u95ED\u201C\u6BCF\u6B21\u8FD0\u884C\u90FD\u5F00\u542F\u65B0\u804A\u5929\u201D\uFF0C\u5E76\u9009\u62E9\u4E2A\u4EBA\u5B9A\u65F6\u4EFB\u52A1\u3002",
|
|
44570
|
+
"External Harnesses require a personal local task in the same chat. Enable Run on this computer and disable Start each run in new chat."
|
|
44571
|
+
);
|
|
44572
|
+
if (workspaceCreation?.error) return workspaceCreation.error;
|
|
44573
|
+
if (workspaceCreation?.pending)
|
|
44574
|
+
return text("\u6B63\u5728\u521B\u5EFA\u5DE5\u4F5C\u533A\u4F1A\u8BDD\u2026", "Creating workspace chat\u2026");
|
|
44575
|
+
const chosen = selectedWorkspace;
|
|
44576
|
+
if (chosen && !binding.hasTarget && !workspaces.some(({ id, cwd }) => id === chosen.id && cwd === chosen.cwd))
|
|
44577
|
+
return text(
|
|
44578
|
+
"\u6240\u9009\u5DE5\u4F5C\u533A\u5DF2\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002",
|
|
44579
|
+
"The selected workspace is no longer available. Choose another workspace."
|
|
44580
|
+
);
|
|
44581
|
+
if (error51) return error51;
|
|
44582
|
+
if (loading)
|
|
44583
|
+
return models.length > 0 ? text(
|
|
44584
|
+
"\u6B63\u5728\u786E\u8BA4\u5DE5\u4F5C\u533A\u7684\u6A21\u578B\u914D\u7F6E\uFF0C\u8BF7\u7A0D\u540E\u63D0\u4EA4\u3002",
|
|
44585
|
+
"Checking workspace models. Submit again once ready."
|
|
44586
|
+
) : text("\u8BF7\u7B49\u5F85\u5E76\u9009\u62E9\u53EF\u7528\u7684 Model\u3002", "Wait for an available Model and select it.");
|
|
44587
|
+
if (!carrier || !models.some((entry) => entry.ref.id === model2.value))
|
|
44588
|
+
return text(
|
|
44589
|
+
"\u5F53\u524D\u6A21\u578B\u5728\u6B64\u5DE5\u4F5C\u533A\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6A21\u578B\u3002",
|
|
44590
|
+
"The selected Model is unavailable in this workspace. Choose another Model."
|
|
44591
|
+
);
|
|
44592
|
+
if (binding.selection.model !== carrier && confirming)
|
|
44593
|
+
return text("\u6B63\u5728\u5E94\u7528\u6A21\u578B\u2026", "Applying Model\u2026");
|
|
44594
|
+
if (binding.selection.model !== carrier)
|
|
44595
|
+
return text(
|
|
44596
|
+
"\u4EFB\u52A1\u7684 Model \u5C1A\u672A\u786E\u8BA4\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9 Model\u3002",
|
|
44597
|
+
"The task Model is not confirmed. Select the Model again."
|
|
44598
|
+
);
|
|
44599
|
+
return "";
|
|
44600
|
+
}
|
|
44601
|
+
function update() {
|
|
44602
|
+
if (retired) return;
|
|
44603
|
+
syncAvailablePlugins();
|
|
44604
|
+
const binding = readNativeScheduleForm(form);
|
|
44605
|
+
const active = external();
|
|
44606
|
+
modelRow.hidden = !active;
|
|
44607
|
+
workspaceRow.hidden = !active;
|
|
44608
|
+
fields.disabled = Boolean(binding?.isSaving || binding?.hasTarget || workspaceCreation);
|
|
44609
|
+
workspace.disabled = loading && models.length === 0 || confirming || !binding?.supportsExternal || !available();
|
|
44610
|
+
const modelBusy = loading && models.length === 0 || confirming && active;
|
|
44611
|
+
model2.disabled = modelBusy || models.length === 0 || !binding?.supportsExternal || !available();
|
|
44612
|
+
model2.busy = modelBusy;
|
|
44613
|
+
harness2.busy = confirming && !active;
|
|
44614
|
+
harness2.disabled = fields.disabled;
|
|
44615
|
+
const externalBlocked = !binding?.supportsExternal || !options.canRouteExternal();
|
|
44616
|
+
harness2.setDisabledValues(externalBlocked ? (id) => id !== "codex" : () => false);
|
|
44617
|
+
const blocked = blockedReason();
|
|
44618
|
+
const message2 = loading && models.length === 0 || confirming ? "" : active ? blocked : blocked || error51 || (!binding?.supportsExternal ? text(
|
|
44619
|
+
"\u5916\u90E8 Harness \u9700\u8981\u5728\u9AD8\u7EA7\u8BBE\u7F6E\u4E2D\u9009\u62E9\u672C\u5730\u3001\u56FA\u5B9A\u804A\u5929\u3002",
|
|
44620
|
+
"For external Harnesses, choose local execution in the same chat under Advanced."
|
|
44621
|
+
) : "");
|
|
44622
|
+
if (status.textContent !== message2) status.textContent = message2;
|
|
44623
|
+
messageRow.hidden = !message2;
|
|
44624
|
+
retry.hidden = !active || loading || confirming || Boolean(workspaceCreation) || !error51 && models.length > 0 && !models.some((entry) => entry.ref.id === model2.value) || !message2 || !binding?.supportsExternal || Boolean(binding.hasTarget || binding.isSaving) || client !== options.getClient() || !options.canRouteExternal() || !available();
|
|
44625
|
+
const rows = active ? new Set(nativeScheduleModelRows(form)) : /* @__PURE__ */ new Set();
|
|
44626
|
+
for (const [row, appearance] of hiddenRows) {
|
|
44627
|
+
if (rows.has(row)) continue;
|
|
44628
|
+
restoreRow(row, appearance);
|
|
44629
|
+
hiddenRows.delete(row);
|
|
44630
|
+
}
|
|
44631
|
+
for (const row of rows) {
|
|
44632
|
+
if (!hiddenRows.has(row))
|
|
44633
|
+
hiddenRows.set(row, {
|
|
44634
|
+
hidden: row.hidden,
|
|
44635
|
+
display: row.style.getPropertyValue("display"),
|
|
44636
|
+
priority: row.style.getPropertyPriority("display")
|
|
44637
|
+
});
|
|
44638
|
+
row.hidden = true;
|
|
44639
|
+
row.style.setProperty("display", "none", "important");
|
|
44640
|
+
}
|
|
44641
|
+
}
|
|
44642
|
+
async function prepareWorkspace(chosen, routeModel) {
|
|
44643
|
+
if (workspaceCreation) return;
|
|
44644
|
+
const attempt = {
|
|
44645
|
+
controller: new AbortController(),
|
|
44646
|
+
pending: true,
|
|
44647
|
+
error: "",
|
|
44648
|
+
thread: void 0
|
|
44649
|
+
};
|
|
44650
|
+
workspaceCreation = attempt;
|
|
44651
|
+
update();
|
|
44652
|
+
try {
|
|
44653
|
+
const binding = readNativeScheduleForm(form);
|
|
44654
|
+
if (!binding) throw Error("Task binding unavailable");
|
|
44655
|
+
attempt.thread = await options.createWorkspaceThread(
|
|
44656
|
+
{ workspace: chosen, model: routeModel, title: binding.title },
|
|
44657
|
+
attempt.controller.signal
|
|
44658
|
+
);
|
|
44659
|
+
attempt.controller.signal.throwIfAborted();
|
|
44660
|
+
if (retired || !form.isConnected) throw Error("Task dialog closed");
|
|
44661
|
+
const current = readNativeScheduleForm(form);
|
|
44662
|
+
if (!current?.supportsExternal || current.selection.model !== routeModel || client !== options.getClient())
|
|
44663
|
+
throw Error("Task configuration or connection changed. Reopen the dialog.");
|
|
44664
|
+
current.setTargetThread(attempt.thread.threadId, routeModel);
|
|
44665
|
+
const deadline = Date.now() + 5e3;
|
|
44666
|
+
while (readNativeScheduleForm(form)?.targetThreadId !== attempt.thread.threadId) {
|
|
44667
|
+
attempt.controller.signal.throwIfAborted();
|
|
44668
|
+
if (Date.now() >= deadline)
|
|
44669
|
+
throw Error("The task's target chat was not confirmed. Reopen the dialog.");
|
|
44670
|
+
await new Promise((resolve) => view.setTimeout(resolve, 25));
|
|
44671
|
+
}
|
|
44672
|
+
attempt.controller.signal.throwIfAborted();
|
|
44673
|
+
attempt.pending = false;
|
|
44674
|
+
update();
|
|
44675
|
+
form.requestSubmit();
|
|
44676
|
+
} catch (cause) {
|
|
44677
|
+
let cleanupError = "";
|
|
44678
|
+
if (attempt.thread?.discard) {
|
|
44679
|
+
if (readNativeScheduleForm(form)?.targetThreadId === attempt.thread.threadId)
|
|
44680
|
+
attempt.thread.retain();
|
|
44681
|
+
else {
|
|
44682
|
+
try {
|
|
44683
|
+
await attempt.thread.discard();
|
|
44684
|
+
} catch (error52) {
|
|
44685
|
+
cleanupError = ` ${text("\u4F1A\u8BDD\u6E05\u7406\u5931\u8D25\uFF1A", "Chat cleanup failed:")} ${error52 instanceof Error ? error52.message : String(error52)}`;
|
|
44686
|
+
}
|
|
44687
|
+
}
|
|
44688
|
+
}
|
|
44689
|
+
attempt.error = `${cause instanceof Error ? cause.message : text("\u4F1A\u8BDD\u521B\u5EFA\u5931\u8D25\u3002", "Chat creation failed.")}${cleanupError} ${text("\u8BF7\u5148\u68C0\u67E5\u4F1A\u8BDD\u5217\u8868\uFF0C\u52FF\u91CD\u590D\u521B\u5EFA\u3002", "Check the chat list before creating another task.")}`;
|
|
44690
|
+
} finally {
|
|
44691
|
+
attempt.pending = false;
|
|
44692
|
+
if (!retired) update();
|
|
44693
|
+
}
|
|
44694
|
+
}
|
|
44695
|
+
const onSubmit = (event) => {
|
|
44696
|
+
if (external() && selectedWorkspace) refreshWorkspaces();
|
|
44697
|
+
const reason = blockedReason();
|
|
44698
|
+
if (!reason) {
|
|
44699
|
+
if (external() && selectedWorkspace) {
|
|
44700
|
+
const binding = readNativeScheduleForm(form);
|
|
44701
|
+
const button2 = form.querySelector('button[type="submit"]');
|
|
44702
|
+
if (!button2 || button2.matches(":disabled") || binding?.isSaving) {
|
|
44703
|
+
event.preventDefault();
|
|
44704
|
+
event.stopImmediatePropagation();
|
|
44705
|
+
return;
|
|
44706
|
+
}
|
|
44707
|
+
if (!binding?.hasTarget && carrier) {
|
|
44708
|
+
event.preventDefault();
|
|
44709
|
+
event.stopImmediatePropagation();
|
|
44710
|
+
void prepareWorkspace(selectedWorkspace, carrier);
|
|
44711
|
+
return;
|
|
44712
|
+
}
|
|
44713
|
+
workspaceCreation?.thread?.retain();
|
|
44714
|
+
}
|
|
44715
|
+
return;
|
|
44716
|
+
}
|
|
44717
|
+
event.preventDefault();
|
|
44718
|
+
event.stopImmediatePropagation();
|
|
44719
|
+
messageRow.hidden = loading && models.length === 0 || confirming;
|
|
44720
|
+
status.textContent = reason;
|
|
44721
|
+
};
|
|
44722
|
+
form.addEventListener("submit", onSubmit, true);
|
|
44723
|
+
update();
|
|
44724
|
+
return {
|
|
44725
|
+
root,
|
|
44726
|
+
update,
|
|
44727
|
+
dispose() {
|
|
44728
|
+
retired = true;
|
|
44729
|
+
generation++;
|
|
44730
|
+
if (form.isConnected) restore();
|
|
44731
|
+
cancelConfirmation();
|
|
44732
|
+
harness2.close();
|
|
44733
|
+
model2.close();
|
|
44734
|
+
workspace.close();
|
|
44735
|
+
if (form.isConnected && workspaceCreation?.thread && readNativeScheduleForm(form)?.targetThreadId === workspaceCreation.thread.threadId)
|
|
44736
|
+
workspaceCreation.thread.retain();
|
|
44737
|
+
workspaceCreation?.controller.abort();
|
|
44738
|
+
for (const [row, appearance] of hiddenRows) restoreRow(row, appearance);
|
|
44739
|
+
form.removeEventListener("submit", onSubmit, true);
|
|
44740
|
+
root.remove();
|
|
44741
|
+
}
|
|
44742
|
+
};
|
|
44743
|
+
}
|
|
44744
|
+
function scan() {
|
|
44745
|
+
frame = null;
|
|
44746
|
+
if (disposed) return;
|
|
44747
|
+
for (const [form, control] of mounted) {
|
|
44748
|
+
if (!form.isConnected || !control.root.isConnected) {
|
|
44749
|
+
control.dispose();
|
|
44750
|
+
mounted.delete(form);
|
|
44751
|
+
} else control.update();
|
|
44752
|
+
}
|
|
44753
|
+
for (const form of document2.querySelectorAll('form[data-density="form"]')) {
|
|
44754
|
+
if (!mounted.has(form) && readNativeScheduleForm(form)) mounted.set(form, mount(form));
|
|
44755
|
+
}
|
|
44756
|
+
}
|
|
44757
|
+
const unsubscribeAvailability = options.subscribeAvailability(schedule);
|
|
44758
|
+
const observer = new MutationObserver(schedule);
|
|
44759
|
+
observer.observe(document2.documentElement, { childList: true, subtree: true });
|
|
44760
|
+
document2.addEventListener("change", schedule, true);
|
|
44761
|
+
document2.addEventListener("click", schedule, true);
|
|
44762
|
+
view.addEventListener("codexhost:draft-prewarm-policy-changed", schedule);
|
|
44763
|
+
scan();
|
|
44764
|
+
return {
|
|
44765
|
+
refresh: schedule,
|
|
44766
|
+
dispose() {
|
|
44767
|
+
disposed = true;
|
|
44768
|
+
if (frame !== null) view.cancelAnimationFrame(frame);
|
|
44769
|
+
observer.disconnect();
|
|
44770
|
+
unsubscribeAvailability();
|
|
44771
|
+
document2.removeEventListener("change", schedule, true);
|
|
44772
|
+
document2.removeEventListener("click", schedule, true);
|
|
44773
|
+
view.removeEventListener("codexhost:draft-prewarm-policy-changed", schedule);
|
|
44774
|
+
for (const control of mounted.values()) control.dispose();
|
|
44775
|
+
mounted.clear();
|
|
44776
|
+
}
|
|
44777
|
+
};
|
|
44778
|
+
}
|
|
44779
|
+
|
|
43181
44780
|
// src/renderer-binding-probe.ts
|
|
43182
44781
|
var EMPTY_PLUGINS = [];
|
|
43183
44782
|
function isRetryableHarnessAvailability(availability2, error51) {
|
|
@@ -43562,6 +45161,9 @@ ${usage_default}`;
|
|
|
43562
45161
|
});
|
|
43563
45162
|
const settingsLifecycle = installRendererSettingsLifecycle(window, {
|
|
43564
45163
|
requestVoiceSettings: (params) => requestLocalSettings("codexhost/voice/settings", params),
|
|
45164
|
+
harnessSchedules: {
|
|
45165
|
+
openSchedules: (signal) => openCodexSchedules(signal)
|
|
45166
|
+
},
|
|
43565
45167
|
getRemoteConnections: () => remoteConnections,
|
|
43566
45168
|
getUpdateClient: () => modelControl,
|
|
43567
45169
|
getAccountClient: () => modelControl,
|
|
@@ -45061,6 +46663,30 @@ ${usage_default}`;
|
|
|
45061
46663
|
return () => connectionListeners.delete(listener);
|
|
45062
46664
|
}
|
|
45063
46665
|
};
|
|
46666
|
+
const nativeScheduleControls = installRendererNativeScheduleControls(document, {
|
|
46667
|
+
getClient: () => modelClientForHost("local"),
|
|
46668
|
+
getAvailablePlugins: () => {
|
|
46669
|
+
const client = modelClientForHost("local");
|
|
46670
|
+
const state = hostHarnessAvailabilityState("local");
|
|
46671
|
+
if (!client || state.directoryClient !== client) return [];
|
|
46672
|
+
return (state.plugins ?? []).filter((plugin) => plugin.kind !== "usage" && state.availability[plugin.id] === "ready").map((plugin) => pluginForHost("local", plugin.id) ?? plugin);
|
|
46673
|
+
},
|
|
46674
|
+
subscribeAvailability: (listener) => {
|
|
46675
|
+
connectionListeners.add(listener);
|
|
46676
|
+
return () => connectionListeners.delete(listener);
|
|
46677
|
+
},
|
|
46678
|
+
canRouteExternal: () => window.__codexhostHostRoutingV1?.forHost("local")?.policy.scopedCreation === true,
|
|
46679
|
+
async createWorkspaceThread(input, signal) {
|
|
46680
|
+
const routing = window.__codexhostHostRoutingV1;
|
|
46681
|
+
const manager = routing?.forHost("local")?.manager;
|
|
46682
|
+
const create = await loadCodexNativeServices(window, isNativeProjectThreadCreator);
|
|
46683
|
+
signal.throwIfAborted();
|
|
46684
|
+
if (!routing || !manager || routing.forHost("local")?.manager !== manager || !create)
|
|
46685
|
+
throw new Error("Native workspace chat creation is unavailable. Reopen the task dialog.");
|
|
46686
|
+
return createNativeScheduleWorkspaceThread(document, routing, create, input, signal);
|
|
46687
|
+
},
|
|
46688
|
+
locale: () => settingsLifecycle.locale
|
|
46689
|
+
});
|
|
45064
46690
|
const mount = (composer) => {
|
|
45065
46691
|
if (mountedByComposer.has(composer) || !composer.isConnected || hasNativeComposerRequest(composer) || orbitComposerKind(composer) !== "codex" || !composer.matches(CODEX_COMPOSER_SELECTOR)) {
|
|
45066
46692
|
return;
|
|
@@ -45395,6 +47021,7 @@ ${usage_default}`;
|
|
|
45395
47021
|
const onAdapterStatus = () => {
|
|
45396
47022
|
publishConnectionStatus();
|
|
45397
47023
|
if (shouldRefreshCodexAccountsForAdapterState(adapterStatus.state)) {
|
|
47024
|
+
reconcileHarnessAvailabilityHost();
|
|
45398
47025
|
void loadCodexAccounts();
|
|
45399
47026
|
sidebarAgentIcons.refresh();
|
|
45400
47027
|
void refreshHarnessAvailabilityForHost("local");
|
|
@@ -45587,6 +47214,7 @@ ${usage_default}`;
|
|
|
45587
47214
|
if (disposed || modelControl !== installedModelControl) return;
|
|
45588
47215
|
try {
|
|
45589
47216
|
settingsLifecycle.refresh();
|
|
47217
|
+
nativeScheduleControls.refresh();
|
|
45590
47218
|
} catch {
|
|
45591
47219
|
}
|
|
45592
47220
|
});
|
|
@@ -45638,6 +47266,7 @@ ${usage_default}`;
|
|
|
45638
47266
|
delegationMention?.dispose();
|
|
45639
47267
|
sidebarAgentIcons.dispose();
|
|
45640
47268
|
stopVoiceSync();
|
|
47269
|
+
nativeScheduleControls.dispose();
|
|
45641
47270
|
settingsLifecycle.dispose();
|
|
45642
47271
|
document.removeEventListener("beforeinput", onBeforeInput, true);
|
|
45643
47272
|
document.removeEventListener("submit", onSubmit, true);
|
|
@@ -45834,8 +47463,8 @@ ${usage_default}`;
|
|
|
45834
47463
|
// src/renderer-voice-capability.ts
|
|
45835
47464
|
var GLOBAL = "__codexhostVoiceCapabilityV1";
|
|
45836
47465
|
var INFERENCE_GATE = "3683713372";
|
|
45837
|
-
var
|
|
45838
|
-
var capable = (value) =>
|
|
47466
|
+
var record11 = (value) => value !== null && typeof value === "object";
|
|
47467
|
+
var capable = (value) => record11(value) && typeof value.isLoading === "boolean" && typeof value.isError === "boolean" && typeof value.isCapable === "boolean";
|
|
45839
47468
|
var equal = (a, b) => a.isLoading === b.isLoading && a.isError === b.isError && a.isCapable === b.isCapable;
|
|
45840
47469
|
function replayVoiceCapability(store, atom, gate) {
|
|
45841
47470
|
const evaluate = (override) => {
|
|
@@ -45873,7 +47502,7 @@ ${usage_default}`;
|
|
|
45873
47502
|
}
|
|
45874
47503
|
}
|
|
45875
47504
|
function isFamily(value) {
|
|
45876
|
-
return
|
|
47505
|
+
return record11(value) && record11(value.scope) && typeof value.resolve === "function";
|
|
45877
47506
|
}
|
|
45878
47507
|
function initializeVoiceCapabilityFamilies(module, assets) {
|
|
45879
47508
|
const initialize = module[assets.capabilityInit];
|
|
@@ -45889,7 +47518,7 @@ ${usage_default}`;
|
|
|
45889
47518
|
const result = [];
|
|
45890
47519
|
const seen = /* @__PURE__ */ new Set();
|
|
45891
47520
|
let hook = fiber.memoizedState;
|
|
45892
|
-
while (
|
|
47521
|
+
while (record11(hook) && result.length < 4096 && !seen.has(hook)) {
|
|
45893
47522
|
seen.add(hook);
|
|
45894
47523
|
result.push(hook);
|
|
45895
47524
|
hook = hook.next;
|
|
@@ -45901,11 +47530,11 @@ ${usage_default}`;
|
|
|
45901
47530
|
const rootKey = Object.getOwnPropertyNames(composer).find(
|
|
45902
47531
|
(key) => key.startsWith("__reactFiber$")
|
|
45903
47532
|
);
|
|
45904
|
-
const
|
|
45905
|
-
let root =
|
|
47533
|
+
const ancestors2 = rootKey ? committedReactAncestors(Object.getOwnPropertyDescriptor(composer, rootKey)?.value) : [];
|
|
47534
|
+
let root = ancestors2[0];
|
|
45906
47535
|
if (chat) {
|
|
45907
|
-
const owners =
|
|
45908
|
-
({ memoizedProps: props }) =>
|
|
47536
|
+
const owners = ancestors2.filter(
|
|
47537
|
+
({ memoizedProps: props }) => record11(props) && props.isWorkConversation === false && props.isTemporaryChat === false && props.shouldBlockExternalEgress === false && props.readOnly !== true && typeof props.conversationId === "string" && record11(props.composerSelectionContext) && props.composerSelectionContext.conversationId === props.conversationId
|
|
45909
47538
|
);
|
|
45910
47539
|
if (owners.length !== 1) return fibers;
|
|
45911
47540
|
root = owners[0];
|
|
@@ -45914,10 +47543,10 @@ ${usage_default}`;
|
|
|
45914
47543
|
for (const element of [composer, ...composer.querySelectorAll("*")].slice(0, 2048)) {
|
|
45915
47544
|
const key = Object.getOwnPropertyNames(element).find((key2) => key2.startsWith("__reactFiber$"));
|
|
45916
47545
|
if (!key) continue;
|
|
45917
|
-
const
|
|
45918
|
-
const boundary =
|
|
47546
|
+
const ancestors3 = committedReactAncestors(Object.getOwnPropertyDescriptor(element, key)?.value);
|
|
47547
|
+
const boundary = ancestors3.indexOf(root);
|
|
45919
47548
|
if (boundary < 0) continue;
|
|
45920
|
-
for (const fiber of
|
|
47549
|
+
for (const fiber of ancestors3.slice(0, boundary + 1)) if (record11(fiber)) fibers.add(fiber);
|
|
45921
47550
|
}
|
|
45922
47551
|
return fibers;
|
|
45923
47552
|
}
|
|
@@ -45938,7 +47567,7 @@ ${usage_default}`;
|
|
|
45938
47567
|
const list = hooks(fiber);
|
|
45939
47568
|
for (const memo of list) {
|
|
45940
47569
|
const [signal, deps] = Array.isArray(memo.memoizedState) ? memo.memoizedState : [];
|
|
45941
|
-
if (!
|
|
47570
|
+
if (!record11(signal) || !Array.isArray(deps) || deps.length !== 5 || deps[3] !== family || !(deps[1] instanceof Map) || deps[2] !== void 0)
|
|
45942
47571
|
continue;
|
|
45943
47572
|
const chain = deps[1];
|
|
45944
47573
|
const node = chain.get(family.scope.id);
|
|
@@ -45947,7 +47576,7 @@ ${usage_default}`;
|
|
|
45947
47576
|
const matches = [...members].filter(([, member]) => member.cacheKey === deps[0]);
|
|
45948
47577
|
if (matches.length !== 1 || typeof matches[0]?.[0] !== "string") continue;
|
|
45949
47578
|
const parameter = JSON.parse(matches[0][0]);
|
|
45950
|
-
if (!
|
|
47579
|
+
if (!record11(parameter) || Object.keys(parameter).some((key) => key !== "name" && key !== "hostId") || !names.some((name) => parameter.name === name) || realtimeOnly && parameter.name !== "voice.realtime" || parameter.hostId !== void 0 && parameter.hostId !== "local" || parameter.name === "voice.thread" && parameter.hostId !== "local")
|
|
45951
47580
|
continue;
|
|
45952
47581
|
const subscriptions = list.filter((hook2) => {
|
|
45953
47582
|
const state = hook2.memoizedState;
|
|
@@ -45960,7 +47589,7 @@ ${usage_default}`;
|
|
|
45960
47589
|
const effect = hook.next?.next?.memoizedState;
|
|
45961
47590
|
const store = signal.store;
|
|
45962
47591
|
const gate = gates.resolve(node, chain, INFERENCE_GATE)?.atom;
|
|
45963
|
-
if (!gate || !instance || !
|
|
47592
|
+
if (!gate || !instance || !record11(effect) || !Array.isArray(effect.deps) || effect.deps[0] !== subscriber.subscribe || typeof effect.create !== "function" || typeof instance.getSnapshot !== "function" || !capable(store.get(signal.atom)) || !capable(subscriber.getSnapshot()) || !capable(instance.getSnapshot()) || !equal(
|
|
45964
47593
|
store.get(signal.atom),
|
|
45965
47594
|
subscriber.getSnapshot()
|
|
45966
47595
|
) || !equal(subscriber.getSnapshot(), instance.getSnapshot()) || subscriber.createRender?.() != null)
|
|
@@ -46072,7 +47701,7 @@ ${usage_default}`;
|
|
|
46072
47701
|
target[GLOBAL] = handle;
|
|
46073
47702
|
const hookActive = (key) => {
|
|
46074
47703
|
const hook = target[key];
|
|
46075
|
-
return
|
|
47704
|
+
return record11(hook) && hook.status === "active";
|
|
46076
47705
|
};
|
|
46077
47706
|
const currentRoute = () => {
|
|
46078
47707
|
try {
|
|
@@ -46148,7 +47777,7 @@ ${usage_default}`;
|
|
|
46148
47777
|
}
|
|
46149
47778
|
|
|
46150
47779
|
// src/renderer-voice-settings-availability.ts
|
|
46151
|
-
var
|
|
47780
|
+
var record12 = (value) => value !== null && typeof value === "object";
|
|
46152
47781
|
function voiceSettingsSurface(doc, page, appScope) {
|
|
46153
47782
|
const pages = /* @__PURE__ */ new Set();
|
|
46154
47783
|
const fibers = /* @__PURE__ */ new Set();
|
|
@@ -46159,20 +47788,20 @@ ${usage_default}`;
|
|
|
46159
47788
|
}
|
|
46160
47789
|
for (const element of [...elements].slice(0, 512)) {
|
|
46161
47790
|
const key = Object.getOwnPropertyNames(element).find((key2) => key2.startsWith("__reactFiber$"));
|
|
46162
|
-
const
|
|
47791
|
+
const ancestors2 = committedReactAncestors(
|
|
46163
47792
|
key && Object.getOwnPropertyDescriptor(element, key)?.value
|
|
46164
47793
|
);
|
|
46165
|
-
const boundary =
|
|
47794
|
+
const boundary = ancestors2.findIndex((fiber) => fiber.type === page);
|
|
46166
47795
|
if (boundary < 0) continue;
|
|
46167
|
-
pages.add(
|
|
46168
|
-
for (const fiber of
|
|
47796
|
+
pages.add(ancestors2[boundary]);
|
|
47797
|
+
for (const fiber of ancestors2.slice(0, boundary + 1)) fibers.add(fiber);
|
|
46169
47798
|
}
|
|
46170
47799
|
if (pages.size !== 1) return;
|
|
46171
47800
|
const scopes = /* @__PURE__ */ new Map();
|
|
46172
47801
|
for (const fiber of fibers)
|
|
46173
47802
|
for (const hook of hooks(fiber)) {
|
|
46174
|
-
const scope2 =
|
|
46175
|
-
if (
|
|
47803
|
+
const scope2 = record12(hook.memoizedState) ? hook.memoizedState.current : void 0;
|
|
47804
|
+
if (record12(scope2) && scope2.scope === appScope && record12(scope2.node) && scope2.chain instanceof Map && scope2.chain.get(appScope.id) === scope2.node && typeof scope2.get === "function")
|
|
46176
47805
|
scopes.set(scope2.node, scope2);
|
|
46177
47806
|
}
|
|
46178
47807
|
const scope = [...scopes.values()][0];
|
|
@@ -46216,7 +47845,7 @@ ${usage_default}`;
|
|
|
46216
47845
|
for (const fiber of currentFibers())
|
|
46217
47846
|
for (const hook2 of hooks(fiber)) {
|
|
46218
47847
|
const [subscriber2, deps] = Array.isArray(hook2.memoizedState) ? hook2.memoizedState : [];
|
|
46219
|
-
if (!
|
|
47848
|
+
if (!record12(subscriber2) || typeof subscriber2.getSnapshot !== "function" || !Array.isArray(deps) || deps.length !== 2 || deps[0] !== store || !record12(deps[1]) || typeof deps[1].read !== "function")
|
|
46220
47849
|
continue;
|
|
46221
47850
|
const atom2 = deps[1];
|
|
46222
47851
|
if (availability(store, atom2, voice, gate) === true)
|
|
@@ -46229,7 +47858,7 @@ ${usage_default}`;
|
|
|
46229
47858
|
const instance = hook.next?.queue;
|
|
46230
47859
|
const effect = hook.next?.next?.memoizedState;
|
|
46231
47860
|
const native = store.get(atom);
|
|
46232
|
-
if (!instance || typeof instance.getSnapshot !== "function" || !
|
|
47861
|
+
if (!instance || typeof instance.getSnapshot !== "function" || !record12(effect) || !Array.isArray(effect.deps) || effect.deps.length !== 1 || effect.deps[0] !== subscriber.subscribe || typeof effect.create !== "function" || subscriber.getSnapshot() !== native || instance.getSnapshot() !== native || subscriber.createRender?.() != null)
|
|
46233
47862
|
throw new Error("Unsupported Settings availability subscription");
|
|
46234
47863
|
for (const [object3, key] of [
|
|
46235
47864
|
[store, "sub"],
|
|
@@ -46288,7 +47917,7 @@ ${usage_default}`;
|
|
|
46288
47917
|
}
|
|
46289
47918
|
|
|
46290
47919
|
// src/renderer-dictation-settings.ts
|
|
46291
|
-
var
|
|
47920
|
+
var record13 = (value) => value !== null && typeof value === "object";
|
|
46292
47921
|
var mode = (value) => value === null || value === "os-global" || value === "app";
|
|
46293
47922
|
function replayDictationSettingsMode(store, atom, capabilities, gate) {
|
|
46294
47923
|
try {
|
|
@@ -46331,7 +47960,7 @@ ${usage_default}`;
|
|
|
46331
47960
|
function bindDictationSettingsMode(currentFibers, store, atom, capabilities, gate, allowed) {
|
|
46332
47961
|
const readers = () => [...currentFibers()].flatMap(hooks).filter((hook) => {
|
|
46333
47962
|
const [subscriber, deps] = Array.isArray(hook.memoizedState) ? hook.memoizedState : [];
|
|
46334
|
-
return
|
|
47963
|
+
return record13(subscriber) && typeof subscriber.getSnapshot === "function" && Array.isArray(deps) && deps.length === 2 && deps[0] === store && deps[1] === atom;
|
|
46335
47964
|
});
|
|
46336
47965
|
const subscriptions = readers();
|
|
46337
47966
|
if (!subscriptions.length || replayDictationSettingsMode(store, atom, capabilities, gate) === void 0)
|
|
@@ -46344,7 +47973,7 @@ ${usage_default}`;
|
|
|
46344
47973
|
const instance = hook.next?.queue;
|
|
46345
47974
|
const effect = hook.next?.next?.memoizedState;
|
|
46346
47975
|
const native = store.get(atom);
|
|
46347
|
-
if (!instance || typeof instance.getSnapshot !== "function" || !
|
|
47976
|
+
if (!instance || typeof instance.getSnapshot !== "function" || !record13(effect) || !Array.isArray(effect.deps) || effect.deps.length !== 1 || effect.deps[0] !== subscriber.subscribe || typeof effect.create !== "function" || subscriber.getSnapshot() !== native || instance.getSnapshot() !== native || subscriber.createRender?.() != null)
|
|
46348
47977
|
throw new Error("Unsupported Settings dictation mode subscription");
|
|
46349
47978
|
for (const [object3, key] of [
|
|
46350
47979
|
[store, "sub"],
|
|
@@ -46416,8 +48045,8 @@ ${usage_default}`;
|
|
|
46416
48045
|
var MESSAGE_ID = "settings.general.realtimeVoice.unavailable.description";
|
|
46417
48046
|
var LABEL = "Voice settings unavailable with this provider";
|
|
46418
48047
|
var DESCRIPTION = "Your account allows voice chat. These Desktop settings require the default inference provider. Start ChatGPT Chat voice from the Chat composer.";
|
|
46419
|
-
var
|
|
46420
|
-
var settled = (value, isCapable) =>
|
|
48048
|
+
var record14 = (value) => value !== null && typeof value === "object";
|
|
48049
|
+
var settled = (value, isCapable) => record14(value) && value.isLoading === false && value.isError === false && value.isCapable === isCapable;
|
|
46421
48050
|
function realtimeAtoms(scope, modules) {
|
|
46422
48051
|
const atom = modules.capability.resolve(scope.node, scope.chain, { name: "voice.realtime" }).resolve(scope.node, scope.chain);
|
|
46423
48052
|
return {
|
|
@@ -46428,7 +48057,7 @@ ${usage_default}`;
|
|
|
46428
48057
|
function providerBlocksVoiceSettings(scope, modules) {
|
|
46429
48058
|
try {
|
|
46430
48059
|
const access = scope.get(modules.access);
|
|
46431
|
-
if (!
|
|
48060
|
+
if (!record14(access) || access.status !== "allowed" || !settled(scope.get(modules.capability, { name: "voice" }), true) || !settled(scope.get(modules.capability, { name: "voice.realtime" }), false))
|
|
46432
48061
|
return false;
|
|
46433
48062
|
const { atom, gate } = realtimeAtoms(scope, modules);
|
|
46434
48063
|
return replayVoiceCapability(scope.node.store, atom, gate)?.isCapable === true;
|
|
@@ -46441,19 +48070,19 @@ ${usage_default}`;
|
|
|
46441
48070
|
for (const element of doc.querySelectorAll("section div")) {
|
|
46442
48071
|
if (element.childNodes.length !== 1 || element.firstChild?.nodeType !== 3) continue;
|
|
46443
48072
|
const key = Object.getOwnPropertyNames(element).find((key2) => key2.startsWith("__reactFiber$"));
|
|
46444
|
-
const
|
|
48073
|
+
const ancestors2 = committedReactAncestors(
|
|
46445
48074
|
key && Object.getOwnPropertyDescriptor(element, key)?.value
|
|
46446
48075
|
);
|
|
46447
|
-
if (!
|
|
46448
|
-
const owner =
|
|
46449
|
-
({ memoizedProps: props2 }) =>
|
|
48076
|
+
if (!ancestors2.some((fiber) => fiber.type === modules.page)) continue;
|
|
48077
|
+
const owner = ancestors2.find(
|
|
48078
|
+
({ memoizedProps: props2 }) => record14(props2) && record14(props2.description) && record14(props2.description.props) && props2.description.props.id === MESSAGE_ID && props2.control === null
|
|
46450
48079
|
);
|
|
46451
48080
|
const props = owner?.memoizedProps;
|
|
46452
|
-
if (!
|
|
48081
|
+
if (!record14(props) || !record14(props.description) || !record14(props.description.props) || !record14(props.label) || !record14(props.label.props) || element.textContent !== props.description.props.defaultMessage)
|
|
46453
48082
|
continue;
|
|
46454
48083
|
const labelText = props.label.props.defaultMessage;
|
|
46455
48084
|
if (typeof labelText !== "string") continue;
|
|
46456
|
-
const row =
|
|
48085
|
+
const row = ancestors2.find((fiber) => {
|
|
46457
48086
|
const host2 = fiber.stateNode;
|
|
46458
48087
|
return fiber.tag === 5 && host2 !== element && typeof host2?.contains === "function" && host2.contains(element) && host2.textContent?.includes(labelText);
|
|
46459
48088
|
});
|
|
@@ -46463,13 +48092,13 @@ ${usage_default}`;
|
|
|
46463
48092
|
) : [];
|
|
46464
48093
|
if (labels.length !== 1) continue;
|
|
46465
48094
|
const scopes = /* @__PURE__ */ new Map();
|
|
46466
|
-
for (const fiber of
|
|
48095
|
+
for (const fiber of ancestors2) {
|
|
46467
48096
|
let hook = fiber.memoizedState;
|
|
46468
48097
|
const seen = /* @__PURE__ */ new Set();
|
|
46469
|
-
while (
|
|
48098
|
+
while (record14(hook) && seen.size < 4096 && !seen.has(hook)) {
|
|
46470
48099
|
seen.add(hook);
|
|
46471
|
-
const scope2 =
|
|
46472
|
-
if (
|
|
48100
|
+
const scope2 = record14(hook.memoizedState) ? hook.memoizedState.current : void 0;
|
|
48101
|
+
if (record14(scope2) && scope2.scope === modules.appScope && record14(scope2.node) && scope2.chain instanceof Map && scope2.chain.get(modules.appScope.id) === scope2.node && typeof scope2.get === "function")
|
|
46473
48102
|
scopes.set(scope2.node, scope2);
|
|
46474
48103
|
hook = hook.next;
|
|
46475
48104
|
}
|
|
@@ -46680,6 +48309,7 @@ lucide/dist/esm/icons/message-circle-question-mark.mjs:
|
|
|
46680
48309
|
lucide/dist/esm/icons/pencil.mjs:
|
|
46681
48310
|
lucide/dist/esm/icons/x.mjs:
|
|
46682
48311
|
lucide/dist/esm/icons/boxes.mjs:
|
|
48312
|
+
lucide/dist/esm/icons/calendar-clock.mjs:
|
|
46683
48313
|
lucide/dist/esm/icons/circle-check.mjs:
|
|
46684
48314
|
lucide/dist/esm/icons/chevron-down.mjs:
|
|
46685
48315
|
lucide/dist/esm/icons/chevron-left.mjs:
|