@karlorz/codexhost-cli-win32-x64 0.15.0-1 → 0.16.1-2
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 +122 -33
- package/app/desktop-controller.mjs +733 -53
- package/app/host-runtime.mjs +11173 -10140
- 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 +1621 -504
- 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 +1907 -222
- 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);
|
|
@@ -16481,9 +16515,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16481
16515
|
const matchesMetadata = (profile) => (version2 === void 0 || profile.version === version2) && (platform === void 0 || profile.platform === platform);
|
|
16482
16516
|
if (present.length > 0) {
|
|
16483
16517
|
const profile = present.length === 1 ? present[0] : void 0;
|
|
16484
|
-
|
|
16485
|
-
|
|
16486
|
-
|
|
16518
|
+
if (!profile || !matchesMetadata(profile)) return void 0;
|
|
16519
|
+
const initialPresent = auditedAppInitialAssetPresent(names, profile.initial);
|
|
16520
|
+
const sharedPresent = auditedAppInitialAssetPresent(names, profile.shared);
|
|
16521
|
+
return sharedPresent && (initialPresent || version2 !== void 0 && platform !== void 0) ? profile : void 0;
|
|
16487
16522
|
}
|
|
16488
16523
|
if (version2 === void 0) return void 0;
|
|
16489
16524
|
const candidates = profiles.filter(matchesMetadata);
|
|
@@ -16660,10 +16695,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16660
16695
|
return [];
|
|
16661
16696
|
seen.add(entry.node);
|
|
16662
16697
|
if (entry.node === first || entry.node === alternate) {
|
|
16663
|
-
const
|
|
16698
|
+
const ancestors2 = [];
|
|
16664
16699
|
for (let cursor = entry; cursor; cursor = cursor.parent)
|
|
16665
|
-
|
|
16666
|
-
return
|
|
16700
|
+
ancestors2.push(cursor.node);
|
|
16701
|
+
return ancestors2;
|
|
16667
16702
|
}
|
|
16668
16703
|
const sibling = entry.parent && fiber(entry.node.sibling);
|
|
16669
16704
|
if (sibling)
|
|
@@ -16675,6 +16710,593 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16675
16710
|
return stack.length > 0 ? exhausted() : [];
|
|
16676
16711
|
}
|
|
16677
16712
|
|
|
16713
|
+
// ../desktop-control/dist/renderer-native-schedule-sidebar.js
|
|
16714
|
+
var NATIVE_SCHEDULE_SIDEBAR_ROW_SELECTOR = 'aside [data-sidebar-cycle-item][role="button"][aria-labelledby]';
|
|
16715
|
+
function readNativeScheduleSidebarThread(element) {
|
|
16716
|
+
if (!element.matches(NATIVE_SCHEDULE_SIDEBAR_ROW_SELECTOR))
|
|
16717
|
+
return null;
|
|
16718
|
+
const keys = Object.keys(element).filter((key2) => key2.startsWith("__reactFiber$"));
|
|
16719
|
+
const key = keys[0];
|
|
16720
|
+
if (keys.length !== 1 || !key)
|
|
16721
|
+
return null;
|
|
16722
|
+
let scheduledContainer = false;
|
|
16723
|
+
const candidates = /* @__PURE__ */ new Set();
|
|
16724
|
+
let depth = 0;
|
|
16725
|
+
for (const fiber of committedReactAncestors(Reflect.get(element, key))) {
|
|
16726
|
+
if (++depth > 12)
|
|
16727
|
+
break;
|
|
16728
|
+
const props = fiber.memoizedProps;
|
|
16729
|
+
if (!props || typeof props !== "object")
|
|
16730
|
+
continue;
|
|
16731
|
+
if (Object.hasOwn(props, "data-selected-scheduled-task"))
|
|
16732
|
+
scheduledContainer = true;
|
|
16733
|
+
if (!scheduledContainer || !Object.hasOwn(props, "automation"))
|
|
16734
|
+
continue;
|
|
16735
|
+
const automation = props.automation;
|
|
16736
|
+
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")
|
|
16737
|
+
return null;
|
|
16738
|
+
const parsed = hostThreadIdSchema.safeParse(automation.targetThreadId);
|
|
16739
|
+
if (!parsed.success)
|
|
16740
|
+
return null;
|
|
16741
|
+
candidates.add(parsed.data);
|
|
16742
|
+
}
|
|
16743
|
+
return candidates.size === 1 ? candidates.values().next().value ?? null : null;
|
|
16744
|
+
}
|
|
16745
|
+
|
|
16746
|
+
// ../desktop-control/dist/renderer-scoped-draft-model.js
|
|
16747
|
+
function findScopedDraftModelBinding(composer, draftId) {
|
|
16748
|
+
let element = composer.querySelector?.('[data-codex-composer], [contenteditable="true"][role="textbox"]') ?? composer;
|
|
16749
|
+
let fiber;
|
|
16750
|
+
while (element && !fiber) {
|
|
16751
|
+
const key = Object.getOwnPropertyNames(element).find((name) => name.startsWith("__reactFiber$"));
|
|
16752
|
+
if (key)
|
|
16753
|
+
fiber = Object.getOwnPropertyDescriptor(element, key)?.value;
|
|
16754
|
+
element = element.parentElement;
|
|
16755
|
+
}
|
|
16756
|
+
const rows = [];
|
|
16757
|
+
const previousRows = /* @__PURE__ */ new Map();
|
|
16758
|
+
const updates = /* @__PURE__ */ new Set();
|
|
16759
|
+
for (const ancestor of committedReactAncestors(fiber)) {
|
|
16760
|
+
const queue = ancestor.updateQueue;
|
|
16761
|
+
const data = (queue?.memoCache?.data ?? []).filter((value) => Array.isArray(value));
|
|
16762
|
+
for (const [index, row] of data.entries()) {
|
|
16763
|
+
rows.push(row);
|
|
16764
|
+
previousRows.set(row, data[index - 1]);
|
|
16765
|
+
if (!Array.isArray(row) || row.length !== 14 || row[6] !== draftId || row[7] !== draftId)
|
|
16766
|
+
continue;
|
|
16767
|
+
const result = row[13];
|
|
16768
|
+
if (result?.isNewThreadDraft === true && row[11] === true && result.draftSettings === row[10] && result.updateDraftSettings === row[9] && row[9] === row[12] && typeof row[9] === "function")
|
|
16769
|
+
updates.add(row[9]);
|
|
16770
|
+
}
|
|
16771
|
+
}
|
|
16772
|
+
let update;
|
|
16773
|
+
const modes = /* @__PURE__ */ new Set();
|
|
16774
|
+
const creationModes = /* @__PURE__ */ new Set();
|
|
16775
|
+
for (const row of rows) {
|
|
16776
|
+
if (row.length !== 24 || row[7] !== null || row[10] !== true || !updates.has(row[13]))
|
|
16777
|
+
continue;
|
|
16778
|
+
const context = row[12];
|
|
16779
|
+
const result = row[23];
|
|
16780
|
+
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]) {
|
|
16781
|
+
update ??= row[13];
|
|
16782
|
+
modes.add(context.usesAccountPreferences);
|
|
16783
|
+
const settings = result.modelSettings;
|
|
16784
|
+
const candidate = previousRows.get(row);
|
|
16785
|
+
const mode2 = candidate?.[44];
|
|
16786
|
+
const value = candidate?.[51];
|
|
16787
|
+
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)
|
|
16788
|
+
creationModes.add(mode2);
|
|
16789
|
+
}
|
|
16790
|
+
}
|
|
16791
|
+
const [usesAccountPreferences] = modes;
|
|
16792
|
+
return update && modes.size === 1 && usesAccountPreferences !== void 0 ? {
|
|
16793
|
+
update,
|
|
16794
|
+
usesAccountPreferences,
|
|
16795
|
+
...creationModes.size ? { creationModes: [...creationModes] } : {}
|
|
16796
|
+
} : null;
|
|
16797
|
+
}
|
|
16798
|
+
function createScopedDraftModelWriter() {
|
|
16799
|
+
const captured = /* @__PURE__ */ new Map();
|
|
16800
|
+
const restore = (key) => {
|
|
16801
|
+
const entry = captured.get(key);
|
|
16802
|
+
if (!entry)
|
|
16803
|
+
return;
|
|
16804
|
+
entry.update((current) => {
|
|
16805
|
+
const settings = current.modelSettings;
|
|
16806
|
+
return settings?.model === entry.model && current.modelSettingsPersistAsDefault === false ? {
|
|
16807
|
+
...current,
|
|
16808
|
+
modelSettings: entry.original.modelSettings,
|
|
16809
|
+
modelSettingsPersistAsDefault: entry.original.modelSettingsPersistAsDefault,
|
|
16810
|
+
isManuallyChanged: entry.original.isManuallyChanged
|
|
16811
|
+
} : current;
|
|
16812
|
+
});
|
|
16813
|
+
captured.delete(key);
|
|
16814
|
+
};
|
|
16815
|
+
return {
|
|
16816
|
+
has(key) {
|
|
16817
|
+
return captured.has(key);
|
|
16818
|
+
},
|
|
16819
|
+
apply(key, binding, model2) {
|
|
16820
|
+
if (model2 === null) {
|
|
16821
|
+
restore(key);
|
|
16822
|
+
return;
|
|
16823
|
+
}
|
|
16824
|
+
const { update, usesAccountPreferences } = binding;
|
|
16825
|
+
update((current) => {
|
|
16826
|
+
const previous = captured.get(key);
|
|
16827
|
+
captured.set(key, { update, original: previous?.original ?? current, model: model2 });
|
|
16828
|
+
const settings = current.modelSettings;
|
|
16829
|
+
if (settings?.model === model2 && settings.usesAccountPreferences === usesAccountPreferences && current.modelSettingsPersistAsDefault === false)
|
|
16830
|
+
return current;
|
|
16831
|
+
return {
|
|
16832
|
+
...current,
|
|
16833
|
+
isManuallyChanged: true,
|
|
16834
|
+
modelSettingsPersistAsDefault: false,
|
|
16835
|
+
modelSettings: {
|
|
16836
|
+
...settings,
|
|
16837
|
+
model: model2,
|
|
16838
|
+
reasoningEffort: settings?.reasoningEffort ?? null,
|
|
16839
|
+
profile: settings?.profile ?? null,
|
|
16840
|
+
usesAccountPreferences
|
|
16841
|
+
}
|
|
16842
|
+
};
|
|
16843
|
+
});
|
|
16844
|
+
},
|
|
16845
|
+
dispose() {
|
|
16846
|
+
for (const key of captured.keys())
|
|
16847
|
+
restore(key);
|
|
16848
|
+
}
|
|
16849
|
+
};
|
|
16850
|
+
}
|
|
16851
|
+
|
|
16852
|
+
// ../desktop-control/dist/renderer-native-schedule-form.js
|
|
16853
|
+
var record2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
16854
|
+
function ancestors(element) {
|
|
16855
|
+
if (!record2(element))
|
|
16856
|
+
return [];
|
|
16857
|
+
const key = Object.getOwnPropertyNames(element).find((name) => name.startsWith("__reactFiber$"));
|
|
16858
|
+
return committedReactAncestors(key ? Object.getOwnPropertyDescriptor(element, key)?.value : null);
|
|
16859
|
+
}
|
|
16860
|
+
function readNativeScheduleForm(form) {
|
|
16861
|
+
const candidates = ancestors(form).flatMap(({ memoizedProps: props2 }) => {
|
|
16862
|
+
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")
|
|
16863
|
+
return [];
|
|
16864
|
+
return [props2];
|
|
16865
|
+
});
|
|
16866
|
+
const props = candidates[0];
|
|
16867
|
+
if (!props || candidates.some((other) => other.draft !== props.draft || other.onChange !== props.onChange || other.onSubmit !== props.onSubmit))
|
|
16868
|
+
return null;
|
|
16869
|
+
const draft = props.draft;
|
|
16870
|
+
const change = props.onChange;
|
|
16871
|
+
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);
|
|
16872
|
+
return {
|
|
16873
|
+
selection: {
|
|
16874
|
+
model: draft.model,
|
|
16875
|
+
reasoningEffort: draft.reasoningEffort
|
|
16876
|
+
},
|
|
16877
|
+
supportsExternal,
|
|
16878
|
+
hasTarget: draft.targetThreadId != null,
|
|
16879
|
+
isSaving: props.isSaving,
|
|
16880
|
+
title: (typeof draft.name === "string" ? draft.name.trim() : "") || String(draft.prompt).trim().replace(/\s+/gu, " ").slice(0, 80),
|
|
16881
|
+
targetThreadId: typeof draft.targetThreadId === "string" ? draft.targetThreadId : null,
|
|
16882
|
+
setTargetThread(threadId, expectedModel) {
|
|
16883
|
+
if (!supportsExternal || props.isSaving || draft.targetThreadId != null || !threadId || !expectedModel.startsWith("codexhost/plugin-v1@"))
|
|
16884
|
+
return;
|
|
16885
|
+
change((current) => current.id == null && current.targetThreadId == null && current.kind === "heartbeat" && current.cloudTeam == null && current.model === expectedModel ? { ...current, targetThreadId: threadId } : current);
|
|
16886
|
+
},
|
|
16887
|
+
setModel(selection) {
|
|
16888
|
+
if (props.isSaving || draft.targetThreadId != null)
|
|
16889
|
+
return;
|
|
16890
|
+
change((current) => current.id == null && current.targetThreadId == null && current.kind === draft.kind ? { ...current, ...selection } : current);
|
|
16891
|
+
}
|
|
16892
|
+
};
|
|
16893
|
+
}
|
|
16894
|
+
function nativeScheduleModelRows(form) {
|
|
16895
|
+
const rows = /* @__PURE__ */ new Set();
|
|
16896
|
+
for (const button2 of form.querySelectorAll("button")) {
|
|
16897
|
+
let host = null;
|
|
16898
|
+
for (const fiber of ancestors(button2)) {
|
|
16899
|
+
const node = fiber.stateNode;
|
|
16900
|
+
if (node === form)
|
|
16901
|
+
break;
|
|
16902
|
+
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))
|
|
16903
|
+
host = node;
|
|
16904
|
+
const props = fiber.memoizedProps;
|
|
16905
|
+
const label = record2(props) && record2(props.label) ? props.label.props : null;
|
|
16906
|
+
if (record2(label) && ["inbox.automations.model.label", "automations.configuration.effort"].includes(String(label.id))) {
|
|
16907
|
+
if (host)
|
|
16908
|
+
rows.add(host);
|
|
16909
|
+
break;
|
|
16910
|
+
}
|
|
16911
|
+
}
|
|
16912
|
+
}
|
|
16913
|
+
return [...rows];
|
|
16914
|
+
}
|
|
16915
|
+
|
|
16916
|
+
// ../desktop-control/dist/renderer-host-discovery.js
|
|
16917
|
+
function requestManagerFromHookState(value, hostId2) {
|
|
16918
|
+
const record15 = (candidate) => typeof candidate === "object" && candidate !== null;
|
|
16919
|
+
const manager = (candidate) => {
|
|
16920
|
+
if (!record15(candidate) || !record15(candidate.requestClient) || !record15(candidate.prewarmedThreadManager))
|
|
16921
|
+
return null;
|
|
16922
|
+
const bridge = candidate.requestClient;
|
|
16923
|
+
return typeof candidate.sendRequest === "function" && typeof bridge.sendRequest === "function" && typeof bridge.prewarmThreadStart === "function" && typeof bridge.enqueueRequest === "function" && typeof candidate.prewarmedThreadManager.discardAllPrewarmedThreads === "function" ? candidate : null;
|
|
16924
|
+
};
|
|
16925
|
+
if (!record15(value))
|
|
16926
|
+
return null;
|
|
16927
|
+
const direct = manager(value) ?? manager(value.manager);
|
|
16928
|
+
if (direct)
|
|
16929
|
+
return direct;
|
|
16930
|
+
if (!hostId2 || typeof value.addManager !== "function" || typeof value.getForHostId !== "function")
|
|
16931
|
+
return null;
|
|
16932
|
+
try {
|
|
16933
|
+
return manager(value.getForHostId(hostId2));
|
|
16934
|
+
} catch {
|
|
16935
|
+
return null;
|
|
16936
|
+
}
|
|
16937
|
+
}
|
|
16938
|
+
function discoverRendererHosts(root, ancestors2 = committedReactAncestors, managerFrom = requestManagerFromHookState) {
|
|
16939
|
+
const editors = [
|
|
16940
|
+
...root.querySelectorAll('[data-codex-composer], [contenteditable="true"][role="textbox"]')
|
|
16941
|
+
];
|
|
16942
|
+
const hostIds = /* @__PURE__ */ new Set();
|
|
16943
|
+
const managers = /* @__PURE__ */ new Set();
|
|
16944
|
+
const registries = /* @__PURE__ */ new Set();
|
|
16945
|
+
const fibers = /* @__PURE__ */ new Set();
|
|
16946
|
+
for (const editor of editors) {
|
|
16947
|
+
let element = editor;
|
|
16948
|
+
let fiber;
|
|
16949
|
+
while (element && !fiber) {
|
|
16950
|
+
const key = Object.getOwnPropertyNames(element).find((name) => name.startsWith("__reactFiber$"));
|
|
16951
|
+
if (key)
|
|
16952
|
+
fiber = Object.getOwnPropertyDescriptor(element, key)?.value;
|
|
16953
|
+
element = element.parentElement ?? null;
|
|
16954
|
+
}
|
|
16955
|
+
for (const current of ancestors2(fiber)) {
|
|
16956
|
+
fibers.add(current);
|
|
16957
|
+
const props = current.memoizedProps;
|
|
16958
|
+
for (const key of ["executionTargetHostId", "permissionsHostId"]) {
|
|
16959
|
+
const hostId2 = props?.[key];
|
|
16960
|
+
if (typeof hostId2 === "string" && hostId2)
|
|
16961
|
+
hostIds.add(hostId2);
|
|
16962
|
+
}
|
|
16963
|
+
}
|
|
16964
|
+
}
|
|
16965
|
+
for (const fiber of fibers) {
|
|
16966
|
+
let hook = fiber.memoizedState;
|
|
16967
|
+
for (let index = 0; hook && index < 120; index += 1) {
|
|
16968
|
+
const value = hook.memoizedState;
|
|
16969
|
+
const manager = managerFrom(value);
|
|
16970
|
+
if (manager)
|
|
16971
|
+
managers.add(manager);
|
|
16972
|
+
if (value && typeof value === "object" && "addManager" in value && typeof value.addManager === "function" && "getForHostId" in value && typeof value.getForHostId === "function") {
|
|
16973
|
+
registries.add(value);
|
|
16974
|
+
}
|
|
16975
|
+
hook = hook.next && typeof hook.next === "object" ? hook.next : null;
|
|
16976
|
+
}
|
|
16977
|
+
}
|
|
16978
|
+
return {
|
|
16979
|
+
editorCount: editors.length,
|
|
16980
|
+
hostIds: [...hostIds],
|
|
16981
|
+
managers: [...managers],
|
|
16982
|
+
registries: [...registries]
|
|
16983
|
+
};
|
|
16984
|
+
}
|
|
16985
|
+
|
|
16986
|
+
// ../desktop-control/dist/renderer-host-rpc-discovery.js
|
|
16987
|
+
function findRendererHostRpcFamily(store) {
|
|
16988
|
+
const record15 = (value) => typeof value === "object" && value !== null;
|
|
16989
|
+
const families = /* @__PURE__ */ new Set();
|
|
16990
|
+
for (const [definition, members] of store.familyBindings) {
|
|
16991
|
+
if (!record15(definition) || definition.kind !== "signal-family")
|
|
16992
|
+
continue;
|
|
16993
|
+
if (!record15(members) || typeof members.get !== "function")
|
|
16994
|
+
continue;
|
|
16995
|
+
for (const [hostId2, member] of members) {
|
|
16996
|
+
if (typeof hostId2 !== "string" || !record15(member))
|
|
16997
|
+
continue;
|
|
16998
|
+
const signal = member.value;
|
|
16999
|
+
if (!record15(signal) || typeof signal.get !== "function")
|
|
17000
|
+
continue;
|
|
17001
|
+
let value;
|
|
17002
|
+
try {
|
|
17003
|
+
value = signal.get();
|
|
17004
|
+
} catch {
|
|
17005
|
+
continue;
|
|
17006
|
+
}
|
|
17007
|
+
if (record15(value) && Object.keys(value).length === 2 && typeof value.status === "string" && record15(value.client) && value.client.hostId === hostId2 && "rpc" in value.client) {
|
|
17008
|
+
families.add(members);
|
|
17009
|
+
break;
|
|
17010
|
+
}
|
|
17011
|
+
}
|
|
17012
|
+
}
|
|
17013
|
+
if (families.size !== 1)
|
|
17014
|
+
return null;
|
|
17015
|
+
return { store, family: families.values().next().value };
|
|
17016
|
+
}
|
|
17017
|
+
function resolveRendererHostRpc(discovery, hostId2) {
|
|
17018
|
+
const record15 = (value2) => typeof value2 === "object" && value2 !== null;
|
|
17019
|
+
const signal = discovery.family.get(hostId2)?.value;
|
|
17020
|
+
if (!record15(signal) || typeof signal.get !== "function")
|
|
17021
|
+
return null;
|
|
17022
|
+
let value;
|
|
17023
|
+
try {
|
|
17024
|
+
value = signal.get();
|
|
17025
|
+
} catch {
|
|
17026
|
+
return null;
|
|
17027
|
+
}
|
|
17028
|
+
if (!record15(value) || value.status !== "ready" || !record15(value.client) || value.client.hostId !== hostId2)
|
|
17029
|
+
return null;
|
|
17030
|
+
const rpc = value.client.rpc;
|
|
17031
|
+
return typeof rpc === "function" || record15(rpc) ? rpc : null;
|
|
17032
|
+
}
|
|
17033
|
+
|
|
17034
|
+
// ../desktop-control/dist/renderer-schedule-workspace-rpc.js
|
|
17035
|
+
var record3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
17036
|
+
function localAppScope(root) {
|
|
17037
|
+
const scopes = /* @__PURE__ */ new Map();
|
|
17038
|
+
const seen = /* @__PURE__ */ new Set();
|
|
17039
|
+
for (const main of root.querySelectorAll("main")) {
|
|
17040
|
+
const keys = Object.getOwnPropertyNames(main).filter((key2) => key2.startsWith("__reactFiber$"));
|
|
17041
|
+
const key = keys[0];
|
|
17042
|
+
if (keys.length !== 1 || !key)
|
|
17043
|
+
continue;
|
|
17044
|
+
for (const fiber of committedReactAncestors(Reflect.get(main, key))) {
|
|
17045
|
+
if (seen.has(fiber))
|
|
17046
|
+
break;
|
|
17047
|
+
seen.add(fiber);
|
|
17048
|
+
let hook = fiber.memoizedState;
|
|
17049
|
+
for (let n = 0; record3(hook) && "next" in hook && n < 150; n++, hook = hook.next) {
|
|
17050
|
+
const handle = record3(hook.memoizedState) ? hook.memoizedState.current : null;
|
|
17051
|
+
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))
|
|
17052
|
+
continue;
|
|
17053
|
+
scopes.set(handle.node, { handle, store: handle.node });
|
|
17054
|
+
}
|
|
17055
|
+
}
|
|
17056
|
+
}
|
|
17057
|
+
const scope = scopes.values().next().value;
|
|
17058
|
+
if (scopes.size !== 1 || !scope)
|
|
17059
|
+
throw new Error("Native local app scope is missing or ambiguous");
|
|
17060
|
+
const discovery = findRendererHostRpcFamily(scope.store);
|
|
17061
|
+
const rpc = discovery && resolveRendererHostRpc(discovery, "local");
|
|
17062
|
+
if (!discovery || !rpc)
|
|
17063
|
+
throw new Error("Native local app RPC is unavailable");
|
|
17064
|
+
return { ...scope, discovery, rpc };
|
|
17065
|
+
}
|
|
17066
|
+
async function createRpcScheduleWorkspaceThread(root, routing, route, createThread, input, signal) {
|
|
17067
|
+
if (!route.policy.scopedCreation)
|
|
17068
|
+
throw new Error("Native local chat creation is unavailable");
|
|
17069
|
+
const scope = localAppScope(root);
|
|
17070
|
+
const assertConnection = () => {
|
|
17071
|
+
if (routing.forHost("local")?.manager !== route.manager || resolveRendererHostRpc(scope.discovery, "local") !== scope.rpc)
|
|
17072
|
+
throw new Error("The local connection changed. Reopen the task dialog.");
|
|
17073
|
+
};
|
|
17074
|
+
const assertCurrent = () => {
|
|
17075
|
+
signal.throwIfAborted();
|
|
17076
|
+
assertConnection();
|
|
17077
|
+
};
|
|
17078
|
+
const request = async (method, params) => {
|
|
17079
|
+
assertConnection();
|
|
17080
|
+
return route.manager.sendRequest(method, params);
|
|
17081
|
+
};
|
|
17082
|
+
const readEmpty = async (threadId) => {
|
|
17083
|
+
const read = await request("thread/read", { threadId, includeTurns: false });
|
|
17084
|
+
if (!record3(read) || !record3(read.thread) || read.thread.id !== threadId || !record3(read.thread.status))
|
|
17085
|
+
throw new Error("The created chat could not be read");
|
|
17086
|
+
const turns = await request("thread/turns/list", { threadId, cursor: null, limit: 1 });
|
|
17087
|
+
const queue = await request("thread/queue/list", { threadId, cursor: null, limit: 1 });
|
|
17088
|
+
if (!record3(turns) || !Array.isArray(turns.data) || !("nextCursor" in turns) || !record3(queue) || !Array.isArray(queue.data) || !("nextCursor" in queue))
|
|
17089
|
+
throw new Error("The created chat's history or queue could not be confirmed");
|
|
17090
|
+
return {
|
|
17091
|
+
thread: read.thread,
|
|
17092
|
+
empty: read.thread.status.type === "idle" && turns.data.length === 0 && turns.nextCursor === null && queue.data.length === 0 && queue.nextCursor === null
|
|
17093
|
+
};
|
|
17094
|
+
};
|
|
17095
|
+
assertCurrent();
|
|
17096
|
+
let createdId = null;
|
|
17097
|
+
let retained = false;
|
|
17098
|
+
let failed = false;
|
|
17099
|
+
let cleanup;
|
|
17100
|
+
const discard = () => {
|
|
17101
|
+
if (!createdId || retained)
|
|
17102
|
+
return Promise.resolve();
|
|
17103
|
+
const threadId = createdId;
|
|
17104
|
+
return cleanup ??= (async () => {
|
|
17105
|
+
const { empty } = await readEmpty(threadId);
|
|
17106
|
+
if (!empty || retained)
|
|
17107
|
+
return;
|
|
17108
|
+
await request("thread/archive", { threadId });
|
|
17109
|
+
})();
|
|
17110
|
+
};
|
|
17111
|
+
const discardAfterDismissal = () => {
|
|
17112
|
+
void discard().catch((error51) => {
|
|
17113
|
+
console.error("Could not discard the unsubmitted schedule chat. Check the chat list.", error51);
|
|
17114
|
+
});
|
|
17115
|
+
};
|
|
17116
|
+
signal.addEventListener("abort", discardAfterDismissal, { once: true });
|
|
17117
|
+
const remember = (result) => {
|
|
17118
|
+
if (!record3(result) || result.status !== "created")
|
|
17119
|
+
return;
|
|
17120
|
+
const id = hostThreadIdSchema.safeParse(result.conversationId);
|
|
17121
|
+
if (!id.success)
|
|
17122
|
+
return;
|
|
17123
|
+
if (createdId && createdId !== id.data)
|
|
17124
|
+
throw new Error("Chat creation returned conflicting identities");
|
|
17125
|
+
createdId = id.data;
|
|
17126
|
+
if (signal.aborted || failed)
|
|
17127
|
+
discardAfterDismissal();
|
|
17128
|
+
};
|
|
17129
|
+
try {
|
|
17130
|
+
const output = await createThread({
|
|
17131
|
+
scope: scope.handle,
|
|
17132
|
+
target: { type: "project", projectId: input.workspace.id, environment: { type: "local" } },
|
|
17133
|
+
model: input.model,
|
|
17134
|
+
title: input.title,
|
|
17135
|
+
prompt: "",
|
|
17136
|
+
startWithoutFirstTurn: true,
|
|
17137
|
+
assertRequestCurrent: assertCurrent,
|
|
17138
|
+
onSettled: remember
|
|
17139
|
+
});
|
|
17140
|
+
const result = record3(output) && output.kind === "creation" ? output.result : null;
|
|
17141
|
+
remember(result);
|
|
17142
|
+
assertCurrent();
|
|
17143
|
+
if (!record3(result) || result.status !== "created" || !createdId || !record3(result.firstTurn) || result.firstTurn.status !== "not-requested")
|
|
17144
|
+
throw new Error("Chat creation was not confirmed. Check the chat list before creating another task.");
|
|
17145
|
+
const { thread, empty } = await readEmpty(createdId);
|
|
17146
|
+
const inspection = threadInspectionSchema.parse(await request("codexhost/thread/inspect", { threadId: createdId }));
|
|
17147
|
+
assertCurrent();
|
|
17148
|
+
if (!empty || thread.cwd !== input.workspace.cwd || inspection.owner !== "external" || inspection.transportModelId !== input.model)
|
|
17149
|
+
throw new Error("The created chat's workspace, Model or empty state could not be confirmed");
|
|
17150
|
+
return {
|
|
17151
|
+
threadId: createdId,
|
|
17152
|
+
discard,
|
|
17153
|
+
retain() {
|
|
17154
|
+
retained = true;
|
|
17155
|
+
signal.removeEventListener("abort", discardAfterDismissal);
|
|
17156
|
+
}
|
|
17157
|
+
};
|
|
17158
|
+
} catch (error51) {
|
|
17159
|
+
failed = true;
|
|
17160
|
+
try {
|
|
17161
|
+
await discard();
|
|
17162
|
+
} catch (cleanupError) {
|
|
17163
|
+
throw new Error(`${error51 instanceof Error ? error51.message : String(error51)}; Chat cleanup failed: ${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)}. Check the chat list.`);
|
|
17164
|
+
}
|
|
17165
|
+
throw error51;
|
|
17166
|
+
}
|
|
17167
|
+
}
|
|
17168
|
+
|
|
17169
|
+
// ../desktop-control/dist/renderer-schedule-workspace.js
|
|
17170
|
+
var record4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
17171
|
+
function readNativeScheduleWorkspaces(root) {
|
|
17172
|
+
const projects = /* @__PURE__ */ new Map();
|
|
17173
|
+
const ambiguous = /* @__PURE__ */ new Set();
|
|
17174
|
+
const seen = /* @__PURE__ */ new Set();
|
|
17175
|
+
const add = (value) => {
|
|
17176
|
+
if (!record4(value) || value.source !== "codex" || !record4(value.group))
|
|
17177
|
+
return;
|
|
17178
|
+
const group = value.group;
|
|
17179
|
+
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"))
|
|
17180
|
+
return;
|
|
17181
|
+
const next = { id: group.projectId, label: group.label || group.path, cwd: group.path };
|
|
17182
|
+
const previous = projects.get(next.id);
|
|
17183
|
+
if (previous && previous.cwd !== next.cwd)
|
|
17184
|
+
ambiguous.add(next.id);
|
|
17185
|
+
else
|
|
17186
|
+
projects.set(next.id, next);
|
|
17187
|
+
};
|
|
17188
|
+
for (const element of root.querySelectorAll("aside [data-sidebar-cycle-item]")) {
|
|
17189
|
+
const keys = Object.getOwnPropertyNames(element).filter((key2) => key2.startsWith("__reactFiber$"));
|
|
17190
|
+
const key = keys[0];
|
|
17191
|
+
if (keys.length !== 1 || !key)
|
|
17192
|
+
continue;
|
|
17193
|
+
for (const fiber of committedReactAncestors(Reflect.get(element, key))) {
|
|
17194
|
+
if (seen.has(fiber))
|
|
17195
|
+
break;
|
|
17196
|
+
seen.add(fiber);
|
|
17197
|
+
const props = fiber.memoizedProps;
|
|
17198
|
+
if (!record4(props))
|
|
17199
|
+
continue;
|
|
17200
|
+
add(props.project);
|
|
17201
|
+
if (props.projectByKey instanceof Map)
|
|
17202
|
+
for (const project3 of props.projectByKey.values())
|
|
17203
|
+
add(project3);
|
|
17204
|
+
}
|
|
17205
|
+
}
|
|
17206
|
+
return [...projects.values()].filter(({ id }) => !ambiguous.has(id));
|
|
17207
|
+
}
|
|
17208
|
+
function isNativeProjectThreadCreator(value) {
|
|
17209
|
+
try {
|
|
17210
|
+
if (typeof value !== "function" || value.length !== 1)
|
|
17211
|
+
return false;
|
|
17212
|
+
const source = Function.prototype.toString.call(value);
|
|
17213
|
+
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");
|
|
17214
|
+
} catch {
|
|
17215
|
+
return false;
|
|
17216
|
+
}
|
|
17217
|
+
}
|
|
17218
|
+
async function createNativeScheduleWorkspaceThread(root, routing, createThread, input, signal) {
|
|
17219
|
+
if (!decodeHarnessPluginRoute(input.model))
|
|
17220
|
+
throw new Error("An external Harness is required");
|
|
17221
|
+
const route = routing.forHost("local");
|
|
17222
|
+
if (route && Reflect.get(route.manager, "kind") === "main-process-rpc") {
|
|
17223
|
+
if (!readNativeScheduleWorkspaces(root).some(({ id, cwd }) => id === input.workspace.id && cwd === input.workspace.cwd))
|
|
17224
|
+
throw new Error("The selected workspace is no longer available");
|
|
17225
|
+
return createRpcScheduleWorkspaceThread(root, routing, route, createThread, input, signal);
|
|
17226
|
+
}
|
|
17227
|
+
const manager = route?.manager;
|
|
17228
|
+
if (!route?.policy.scopedCreation || !manager || typeof manager.getConversation !== "function" || typeof manager.archiveConversation !== "function")
|
|
17229
|
+
throw new Error("Native local chat creation is unavailable");
|
|
17230
|
+
const discovery = discoverRendererHosts({
|
|
17231
|
+
querySelectorAll: () => root.querySelectorAll("main")
|
|
17232
|
+
});
|
|
17233
|
+
const scopes = new Set(discovery.registries.flatMap((registry2) => {
|
|
17234
|
+
try {
|
|
17235
|
+
return registry2.getForHostId("local") === manager ? [Reflect.get(registry2, "scope")] : [];
|
|
17236
|
+
} catch {
|
|
17237
|
+
return [];
|
|
17238
|
+
}
|
|
17239
|
+
}));
|
|
17240
|
+
const scope = scopes.values().next().value;
|
|
17241
|
+
if (scopes.size !== 1 || !record4(scope) || typeof scope.get !== "function")
|
|
17242
|
+
throw new Error("Native local chat scope is missing or ambiguous");
|
|
17243
|
+
if (!readNativeScheduleWorkspaces(root).some(({ id, cwd }) => id === input.workspace.id && cwd === input.workspace.cwd))
|
|
17244
|
+
throw new Error("The selected workspace is no longer available");
|
|
17245
|
+
signal.throwIfAborted();
|
|
17246
|
+
let createdId = null;
|
|
17247
|
+
let released = false;
|
|
17248
|
+
const discard = () => {
|
|
17249
|
+
if (!createdId || released)
|
|
17250
|
+
return;
|
|
17251
|
+
const id = createdId;
|
|
17252
|
+
released = true;
|
|
17253
|
+
const conversation2 = manager.getConversation(id);
|
|
17254
|
+
if (!record4(conversation2) || !Array.isArray(conversation2.turns) || conversation2.turns.length || Array.isArray(conversation2.requests) && conversation2.requests.length > 0 || conversation2.pendingRequest != null)
|
|
17255
|
+
return;
|
|
17256
|
+
void Promise.resolve().then(() => manager.archiveConversation(id, {
|
|
17257
|
+
useAppServerPins: false,
|
|
17258
|
+
source: "automation_history"
|
|
17259
|
+
})).catch(() => void 0);
|
|
17260
|
+
};
|
|
17261
|
+
signal.addEventListener("abort", discard, { once: true });
|
|
17262
|
+
const remember = (result2) => {
|
|
17263
|
+
if (!record4(result2) || result2.status !== "created")
|
|
17264
|
+
return;
|
|
17265
|
+
const id = hostThreadIdSchema.safeParse(result2.conversationId);
|
|
17266
|
+
if (id.success)
|
|
17267
|
+
createdId = id.data;
|
|
17268
|
+
if (signal.aborted)
|
|
17269
|
+
discard();
|
|
17270
|
+
};
|
|
17271
|
+
const output = await createThread({
|
|
17272
|
+
scope,
|
|
17273
|
+
target: { type: "project", projectId: input.workspace.id, environment: { type: "local" } },
|
|
17274
|
+
model: input.model,
|
|
17275
|
+
title: input.title,
|
|
17276
|
+
prompt: "",
|
|
17277
|
+
startWithoutFirstTurn: true,
|
|
17278
|
+
onSettled: remember
|
|
17279
|
+
});
|
|
17280
|
+
const result = record4(output) && output.kind === "creation" ? output.result : null;
|
|
17281
|
+
remember(result);
|
|
17282
|
+
signal.throwIfAborted();
|
|
17283
|
+
if (!record4(result) || result.status !== "created" || !createdId || !record4(result.firstTurn) || result.firstTurn.status !== "not-requested")
|
|
17284
|
+
throw new Error("Chat creation was not confirmed. Check the chat list before creating another task.");
|
|
17285
|
+
if (routing.forHost("local")?.manager !== route.manager)
|
|
17286
|
+
throw new Error("The local connection changed. Reopen the task dialog.");
|
|
17287
|
+
const conversation = manager.getConversation(createdId);
|
|
17288
|
+
const mode2 = record4(conversation) ? conversation.latestCollaborationMode : null;
|
|
17289
|
+
if (!record4(conversation) || conversation.cwd !== input.workspace.cwd || !record4(mode2) || !record4(mode2.settings) || mode2.settings.model !== input.model)
|
|
17290
|
+
throw new Error("The created chat's workspace or Model could not be confirmed");
|
|
17291
|
+
return {
|
|
17292
|
+
threadId: createdId,
|
|
17293
|
+
retain() {
|
|
17294
|
+
released = true;
|
|
17295
|
+
signal.removeEventListener("abort", discard);
|
|
17296
|
+
}
|
|
17297
|
+
};
|
|
17298
|
+
}
|
|
17299
|
+
|
|
16678
17300
|
// src/renderer-chat-voice-debug.ts
|
|
16679
17301
|
var CHAT_VOICE_DEBUG_GLOBAL = "__codexhostChatVoiceDebug";
|
|
16680
17302
|
var CHAT_VOICE_DEBUG_STORAGE_KEY = "codexhost.chat-voice-debug.v1";
|
|
@@ -16817,16 +17439,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16817
17439
|
var HOOK_GLOBAL = "__codexhostNativeChatVoiceV1";
|
|
16818
17440
|
var BUTTON = "data-codexhost-chat-voice-start";
|
|
16819
17441
|
var CONVERSATION_UUID = /^[a-f\d]{8}(?:-[a-f\d]{4}){3}-[a-f\d]{12}$/i;
|
|
16820
|
-
var
|
|
17442
|
+
var record5 = (value) => value !== null && typeof value === "object";
|
|
16821
17443
|
function scopeRefs(owner, definition) {
|
|
16822
17444
|
const scopes = /* @__PURE__ */ new Map();
|
|
16823
17445
|
let hook = owner.memoizedState;
|
|
16824
17446
|
const seen = /* @__PURE__ */ new Set();
|
|
16825
|
-
while (
|
|
17447
|
+
while (record5(hook) && seen.size < 4096 && !seen.has(hook)) {
|
|
16826
17448
|
seen.add(hook);
|
|
16827
17449
|
const state = hook.memoizedState;
|
|
16828
|
-
const scope =
|
|
16829
|
-
if (
|
|
17450
|
+
const scope = record5(state) ? state.current : void 0;
|
|
17451
|
+
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
17452
|
scopes.set(scope.node, scope);
|
|
16831
17453
|
hook = hook.next;
|
|
16832
17454
|
}
|
|
@@ -16835,41 +17457,41 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16835
17457
|
function detectNativeChatVoiceBinding(composer, native) {
|
|
16836
17458
|
const key = Object.getOwnPropertyNames(composer).find((key2) => key2.startsWith("__reactFiber$"));
|
|
16837
17459
|
if (!key) return;
|
|
16838
|
-
const
|
|
16839
|
-
for (const owner of
|
|
17460
|
+
const ancestors2 = committedReactAncestors(Object.getOwnPropertyDescriptor(composer, key)?.value);
|
|
17461
|
+
for (const owner of ancestors2) {
|
|
16840
17462
|
const props = owner.memoizedProps;
|
|
16841
|
-
if (!
|
|
17463
|
+
if (!record5(props) || typeof props.isWorkConversation !== "boolean" || typeof props.isTemporaryChat !== "boolean" || typeof props.conversationId !== "string")
|
|
16842
17464
|
continue;
|
|
16843
|
-
if (props.isWorkConversation || props.isTemporaryChat || props.shouldBlockExternalEgress !== false || props.readOnly === true || !
|
|
17465
|
+
if (props.isWorkConversation || props.isTemporaryChat || props.shouldBlockExternalEgress !== false || props.readOnly === true || !record5(props.composerSelectionContext) || props.composerSelectionContext.conversationId !== props.conversationId)
|
|
16844
17466
|
return;
|
|
16845
17467
|
const scopes = scopeRefs(owner, native.ownerScopeDefinition);
|
|
16846
17468
|
if (scopes.size !== 1) return;
|
|
16847
17469
|
const scope = [...scopes.values()][0];
|
|
16848
17470
|
if (!scope) return;
|
|
16849
17471
|
const appNode = scope.chain.get(native.scopeDefinition.id);
|
|
16850
|
-
if (!
|
|
17472
|
+
if (!record5(appNode)) return;
|
|
16851
17473
|
const backendId = scope.get(native.backendConversationId, props.conversationId);
|
|
16852
17474
|
const hasBackendId = typeof backendId === "string" && CONVERSATION_UUID.test(backendId);
|
|
16853
17475
|
const isDraft = backendId == null && props.conversationId.startsWith("local-chatgpt:") && CONVERSATION_UUID.test(props.conversationId.slice("local-chatgpt:".length));
|
|
16854
17476
|
if (!hasBackendId && !isDraft) return;
|
|
16855
|
-
const provider =
|
|
16856
|
-
(fiber) => fiber.tag === 10 &&
|
|
17477
|
+
const provider = ancestors2.slice(0, ancestors2.indexOf(owner)).find(
|
|
17478
|
+
(fiber) => fiber.tag === 10 && record5(fiber.type) && fiber.type.displayName === native.composerScopeDefinition.__scopeBrand
|
|
16857
17479
|
);
|
|
16858
17480
|
if (!provider) return;
|
|
16859
|
-
const composerChain =
|
|
17481
|
+
const composerChain = record5(provider.memoizedProps) ? provider.memoizedProps.value : void 0;
|
|
16860
17482
|
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 || !
|
|
17483
|
+
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
17484
|
return;
|
|
16863
17485
|
const composerContext = { context: provider.type, chain: composerChain };
|
|
16864
17486
|
const contexts = /* @__PURE__ */ new Set();
|
|
16865
|
-
for (const fiber of
|
|
16866
|
-
let dependency =
|
|
17487
|
+
for (const fiber of ancestors2) {
|
|
17488
|
+
let dependency = record5(fiber.dependencies) ? fiber.dependencies.firstContext : void 0;
|
|
16867
17489
|
const seenDependencies = /* @__PURE__ */ new Set();
|
|
16868
|
-
while (
|
|
17490
|
+
while (record5(dependency) && seenDependencies.size < 4096 && !seenDependencies.has(dependency)) {
|
|
16869
17491
|
seenDependencies.add(dependency);
|
|
16870
17492
|
const context = dependency.context;
|
|
16871
17493
|
const chain = dependency.memoizedValue;
|
|
16872
|
-
if (
|
|
17494
|
+
if (record5(context) && context.displayName === native.scopeDefinition.__scopeBrand && chain instanceof Map && chain.get(native.scopeDefinition.id) === appNode)
|
|
16873
17495
|
contexts.add(context);
|
|
16874
17496
|
dependency = dependency.next;
|
|
16875
17497
|
}
|
|
@@ -16887,7 +17509,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16887
17509
|
}
|
|
16888
17510
|
}
|
|
16889
17511
|
function startNativeChatVoiceForRequest(request, target = globalThis) {
|
|
16890
|
-
if (!
|
|
17512
|
+
if (!record5(request) || request.productExperience !== "chat" || !nativeChatVoicePreferenceAllowsStart(target))
|
|
16891
17513
|
return;
|
|
16892
17514
|
const hook = target[HOOK_GLOBAL];
|
|
16893
17515
|
if (!hook || hook.status === "disabled" || hook.status === "unsupported")
|
|
@@ -17518,10 +18140,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17518
18140
|
}
|
|
17519
18141
|
|
|
17520
18142
|
// src/renderer-client-owned-voice.ts
|
|
17521
|
-
var CLIENT_OWNED_VOICE_VERSION = "26.
|
|
17522
|
-
var CLIENT_OWNED_VOICE_INITIAL_ASSET = "app-initial-
|
|
17523
|
-
var CLIENT_OWNED_VOICE_SHARED_ASSET = "app-shared-
|
|
17524
|
-
var CLIENT_OWNED_VOICE_OVERLAY_ASSET = "avatar-overlay-native-page-
|
|
18143
|
+
var CLIENT_OWNED_VOICE_VERSION = "26.1027.30824";
|
|
18144
|
+
var CLIENT_OWNED_VOICE_INITIAL_ASSET = "app-initial-60f141238751.js";
|
|
18145
|
+
var CLIENT_OWNED_VOICE_SHARED_ASSET = "app-shared-7815d5a1a42a.js";
|
|
18146
|
+
var CLIENT_OWNED_VOICE_OVERLAY_ASSET = "avatar-overlay-native-page-d9d400e751cd.js";
|
|
17525
18147
|
var CLIENT_OWNED_VOICE_ASSETS = [
|
|
17526
18148
|
{
|
|
17527
18149
|
platform: "darwin",
|
|
@@ -17529,6 +18151,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17529
18151
|
initial: CLIENT_OWNED_VOICE_INITIAL_ASSET,
|
|
17530
18152
|
shared: CLIENT_OWNED_VOICE_SHARED_ASSET,
|
|
17531
18153
|
overlay: CLIENT_OWNED_VOICE_OVERLAY_ASSET,
|
|
18154
|
+
init: "Edr",
|
|
18155
|
+
fetch: "wdr",
|
|
18156
|
+
fetchFrom: "initial",
|
|
18157
|
+
bridge: "LRt",
|
|
18158
|
+
services: "Vct",
|
|
18159
|
+
responseError: "Adr",
|
|
18160
|
+
responseErrorFrom: "initial",
|
|
18161
|
+
capabilityInit: "Ner",
|
|
18162
|
+
capabilityFamily: "Mer",
|
|
18163
|
+
inferenceGateFamily: "Lfr"
|
|
18164
|
+
},
|
|
18165
|
+
{
|
|
18166
|
+
platform: "darwin",
|
|
18167
|
+
version: "26.1023.51421",
|
|
18168
|
+
initial: "app-initial-bc8256c3cccb.js",
|
|
18169
|
+
shared: "app-shared-e9f258fd3588.js",
|
|
18170
|
+
overlay: "avatar-overlay-native-page-af6c3662f64f.js",
|
|
17532
18171
|
init: "xir",
|
|
17533
18172
|
fetch: "yir",
|
|
17534
18173
|
fetchFrom: "initial",
|
|
@@ -17850,7 +18489,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17850
18489
|
if (!object2(bridgeClass) && typeof bridgeClass !== "function") throw new Error();
|
|
17851
18490
|
const client = Reflect.get(fetchClass, "getInstance").call(fetchClass);
|
|
17852
18491
|
const bridge = Reflect.get(bridgeClass, "getInstance").call(bridgeClass);
|
|
17853
|
-
const
|
|
18492
|
+
const errorModule = "responseErrorFrom" in assets && assets.responseErrorFrom === "initial" ? fetchModule : sharedModule;
|
|
18493
|
+
const responseError = typeof errorName === "string" && typeof errorModule[errorName] === "function" ? errorModule[errorName] : async (response) => {
|
|
17854
18494
|
throw Object.assign(new Error(await response.text()), { status: response.status });
|
|
17855
18495
|
};
|
|
17856
18496
|
if (typeof client?.fetch !== "function" || typeof bridge?.dispatchMessage !== "function" || typeof bridge?.subscribe !== "function")
|
|
@@ -17939,8 +18579,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17939
18579
|
if (!ownerWindow.document || !ownerWindow.location) return null;
|
|
17940
18580
|
const page = new URL(ownerWindow.location.href);
|
|
17941
18581
|
const urls = /* @__PURE__ */ new Set();
|
|
17942
|
-
|
|
17943
|
-
|
|
18582
|
+
const catalog = Reflect.get(ownerWindow, "__codexhostLoadedModulesV1");
|
|
18583
|
+
let sources;
|
|
18584
|
+
if (catalog !== void 0) {
|
|
18585
|
+
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"))
|
|
18586
|
+
throw new Error("Codex loaded module catalog is unavailable in this window");
|
|
18587
|
+
sources = catalog.urls;
|
|
18588
|
+
} else {
|
|
18589
|
+
sources = [...ownerWindow.document.querySelectorAll('link[rel="modulepreload"][href]')].map(
|
|
18590
|
+
(link) => link.getAttribute("href") ?? ""
|
|
18591
|
+
);
|
|
18592
|
+
}
|
|
18593
|
+
for (const source of sources) {
|
|
18594
|
+
let url2;
|
|
18595
|
+
try {
|
|
18596
|
+
url2 = new URL(source, page);
|
|
18597
|
+
} catch {
|
|
18598
|
+
continue;
|
|
18599
|
+
}
|
|
17944
18600
|
if (url2.protocol === page.protocol && url2.host === page.host && url2.pathname.endsWith(".js") && !url2.search && !url2.hash)
|
|
17945
18601
|
urls.add(url2.href);
|
|
17946
18602
|
}
|
|
@@ -17958,13 +18614,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17958
18614
|
for (const value of Object.values(module).filter(matchesServices)) matches.add(value);
|
|
17959
18615
|
if (matches.size > 1) throw new Error("Codex native services are unavailable in this window");
|
|
17960
18616
|
}
|
|
18617
|
+
if (catalog !== void 0 && Reflect.get(ownerWindow, "__codexhostLoadedModulesV1") !== catalog)
|
|
18618
|
+
throw new Error("Codex loaded module catalog changed during discovery. Try again once ready.");
|
|
17961
18619
|
return [...matches][0] ?? null;
|
|
17962
18620
|
}
|
|
17963
18621
|
|
|
17964
18622
|
// src/codex-ssh-services.ts
|
|
17965
|
-
var
|
|
18623
|
+
var record6 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
17966
18624
|
function isSshServices(value) {
|
|
17967
|
-
if (!
|
|
18625
|
+
if (!record6(value) || !Object.hasOwn(value, "sshConnections") || !Object.hasOwn(value, "remoteConnections"))
|
|
17968
18626
|
return false;
|
|
17969
18627
|
const ssh = value.sshConnections;
|
|
17970
18628
|
const remote = value.remoteConnections;
|
|
@@ -17975,7 +18633,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17975
18633
|
}
|
|
17976
18634
|
|
|
17977
18635
|
// src/codex-ssh-adapter.ts
|
|
17978
|
-
var
|
|
18636
|
+
var record7 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
17979
18637
|
function createCodexSshClient(ownerWindow) {
|
|
17980
18638
|
let nativeServices;
|
|
17981
18639
|
function services() {
|
|
@@ -18011,7 +18669,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18011
18669
|
const abort = () => finish(new DOMException("Aborted", "AbortError"));
|
|
18012
18670
|
const receive = (event) => {
|
|
18013
18671
|
const message2 = event.data;
|
|
18014
|
-
if (!
|
|
18672
|
+
if (!record7(message2) || message2.type !== "fetch-response" || message2.requestId !== requestId2)
|
|
18015
18673
|
return;
|
|
18016
18674
|
if (message2.responseType !== "success" || typeof message2.status !== "number" || message2.status < 200 || message2.status >= 300 || typeof message2.bodyJsonString !== "string") {
|
|
18017
18675
|
const detail = typeof message2.error === "string" ? `: ${message2.error}` : "";
|
|
@@ -18067,12 +18725,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18067
18725
|
}
|
|
18068
18726
|
async function list(signal) {
|
|
18069
18727
|
const result = await request("refresh-remote-connections", {}, signal);
|
|
18070
|
-
if (!
|
|
18728
|
+
if (!record7(result) || !Array.isArray(result.remoteConnections))
|
|
18071
18729
|
throw new Error("Invalid Codex SSH connection list");
|
|
18072
18730
|
return result.remoteConnections.filter(
|
|
18073
|
-
(item) => !(
|
|
18731
|
+
(item) => !(record7(item) && ["wsl", "remote-control"].includes(String(item.source)))
|
|
18074
18732
|
).map((item) => {
|
|
18075
|
-
if (!
|
|
18733
|
+
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
18734
|
throw new Error(
|
|
18077
18735
|
"This Codex version uses an unsupported SSH configuration; open native settings"
|
|
18078
18736
|
);
|
|
@@ -18144,11 +18802,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18144
18802
|
},
|
|
18145
18803
|
async state(hostId2, signal) {
|
|
18146
18804
|
const result = await request("app-server-connection-state", { hostId: hostId2 }, signal);
|
|
18147
|
-
if (!
|
|
18805
|
+
if (!record7(result) || typeof result.state !== "string")
|
|
18148
18806
|
throw new Error("Invalid Codex connection state");
|
|
18149
18807
|
return {
|
|
18150
18808
|
state: result.state,
|
|
18151
|
-
error: typeof result.error === "string" ? result.error :
|
|
18809
|
+
error: typeof result.error === "string" ? result.error : record7(result.error) && typeof result.error.message === "string" ? result.error.message : null
|
|
18152
18810
|
};
|
|
18153
18811
|
}
|
|
18154
18812
|
};
|
|
@@ -19160,6 +19818,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19160
19818
|
["path", { d: "M12 13.5V8" }]
|
|
19161
19819
|
];
|
|
19162
19820
|
|
|
19821
|
+
// ../../node_modules/lucide/dist/esm/icons/calendar-clock.mjs
|
|
19822
|
+
var CalendarClock = [
|
|
19823
|
+
["path", { d: "M16 14v2.2l1.6 1" }],
|
|
19824
|
+
["path", { d: "M16 2v3" }],
|
|
19825
|
+
["path", { d: "M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338" }],
|
|
19826
|
+
["path", { d: "M3 9h5.859" }],
|
|
19827
|
+
["path", { d: "M8 2v3" }],
|
|
19828
|
+
["circle", { cx: "16", cy: "16", r: "6" }]
|
|
19829
|
+
];
|
|
19830
|
+
|
|
19163
19831
|
// ../../node_modules/lucide/dist/esm/icons/circle-check.mjs
|
|
19164
19832
|
var CircleCheck = [
|
|
19165
19833
|
["circle", { cx: "12", cy: "12", r: "10" }],
|
|
@@ -19465,6 +20133,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19465
20133
|
"routes",
|
|
19466
20134
|
"gateway",
|
|
19467
20135
|
"updates",
|
|
20136
|
+
"schedules",
|
|
19468
20137
|
"about",
|
|
19469
20138
|
"info",
|
|
19470
20139
|
"external-link",
|
|
@@ -19516,6 +20185,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19516
20185
|
routes: Route,
|
|
19517
20186
|
gateway: Network,
|
|
19518
20187
|
updates: CircleArrowUp,
|
|
20188
|
+
schedules: CalendarClock,
|
|
19519
20189
|
about: Info,
|
|
19520
20190
|
info: Info,
|
|
19521
20191
|
"external-link": ExternalLink,
|
|
@@ -20272,14 +20942,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20272
20942
|
return {
|
|
20273
20943
|
createControls(hostId2, panels) {
|
|
20274
20944
|
const batch = batches.get(hostId2);
|
|
20275
|
-
const
|
|
20945
|
+
const count4 = eligible(panels).length;
|
|
20276
20946
|
const button2 = document2.createElement("button");
|
|
20277
20947
|
button2.type = "button";
|
|
20278
20948
|
button2.className = "settings-command-button settings-command-button--secondary settings-connection-update-all";
|
|
20279
20949
|
button2.dataset.connectionAction = "update-all";
|
|
20280
|
-
button2.disabled = signal.aborted || Boolean(batch?.running) || !
|
|
20950
|
+
button2.disabled = signal.aborted || Boolean(batch?.running) || !count4;
|
|
20281
20951
|
button2.title = messages.harnessUpdateAllDescription;
|
|
20282
|
-
const label = batch?.running ? `${messages.harnessUpdateAllProgress} ${batch.succeeded + batch.failed}/${batch.total}` :
|
|
20952
|
+
const label = batch?.running ? `${messages.harnessUpdateAllProgress} ${batch.succeeded + batch.failed}/${batch.total}` : count4 ? `${messages.harnessUpdateAll} (${count4})` : messages.harnessUpdateAll;
|
|
20283
20953
|
button2.append(createRendererSettingsIcon("download", 15), label);
|
|
20284
20954
|
button2.addEventListener("click", () => {
|
|
20285
20955
|
if (!button2.disabled) void start(hostId2, panels);
|
|
@@ -20758,11 +21428,11 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
20758
21428
|
function requestConnectionsPageFocus(agentKey) {
|
|
20759
21429
|
pendingFocusAgent = agentKey;
|
|
20760
21430
|
}
|
|
20761
|
-
function createGroupDivider(document2, messages,
|
|
21431
|
+
function createGroupDivider(document2, messages, count4) {
|
|
20762
21432
|
const divider = document2.createElement("div");
|
|
20763
21433
|
divider.className = "settings-connection-group-divider";
|
|
20764
21434
|
divider.setAttribute("role", "presentation");
|
|
20765
|
-
divider.textContent = `${messages.connectionGroupMoreLabel} (${
|
|
21435
|
+
divider.textContent = `${messages.connectionGroupMoreLabel} (${count4})`;
|
|
20766
21436
|
return divider;
|
|
20767
21437
|
}
|
|
20768
21438
|
function createGroupMoreHint(document2, messages) {
|
|
@@ -21580,7 +22250,6 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
21580
22250
|
updateLatestVersion: "Latest version",
|
|
21581
22251
|
updateUpToDate: "You are up to date.",
|
|
21582
22252
|
updateAvailable: "A new version is available.",
|
|
21583
|
-
updateWindowsManualRequired: "Automatic updates are unavailable on Windows. Update manually below.",
|
|
21584
22253
|
updateAndRestart: "Update",
|
|
21585
22254
|
updateChecking: "Checking for updates...",
|
|
21586
22255
|
updateDownloading: "Downloading update...",
|
|
@@ -21595,8 +22264,7 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
21595
22264
|
updateFailed: "Update failed.",
|
|
21596
22265
|
updateRetry: "Retry",
|
|
21597
22266
|
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.",
|
|
22267
|
+
updateWindowsInstallerDescription: "To update manually, download and run the installer for this system.",
|
|
21600
22268
|
updateManualTitle: "Manual update",
|
|
21601
22269
|
updateManualFallbackDescription: "The automatic update did not complete. Run this command in a terminal instead, then quit Codex and relaunch it with codexhost.",
|
|
21602
22270
|
updateCopyCommand: "Copy",
|
|
@@ -21890,7 +22558,6 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
21890
22558
|
updateLatestVersion: "\u6700\u65B0\u7248\u672C",
|
|
21891
22559
|
updateUpToDate: "\u5F53\u524D\u5DF2\u662F\u6700\u65B0\u7248\u672C\u3002",
|
|
21892
22560
|
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
22561
|
updateAndRestart: "\u66F4\u65B0",
|
|
21895
22562
|
updateChecking: "\u6B63\u5728\u68C0\u67E5\u66F4\u65B0...",
|
|
21896
22563
|
updateDownloading: "\u6B63\u5728\u4E0B\u8F7D\u66F4\u65B0...",
|
|
@@ -21905,8 +22572,7 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
21905
22572
|
updateFailed: "\u66F4\u65B0\u5931\u8D25\u3002",
|
|
21906
22573
|
updateRetry: "\u91CD\u8BD5",
|
|
21907
22574
|
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",
|
|
22575
|
+
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
22576
|
updateManualTitle: "\u624B\u52A8\u66F4\u65B0",
|
|
21911
22577
|
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
22578
|
updateCopyCommand: "\u590D\u5236",
|
|
@@ -22964,20 +23630,20 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
22964
23630
|
}
|
|
22965
23631
|
addGroup(popover, messages.turnGroup, turn);
|
|
22966
23632
|
const tokens = [];
|
|
22967
|
-
const
|
|
23633
|
+
const count4 = (value) => value === void 0 ? "-" : formatRendererTokenCount(value);
|
|
22968
23634
|
if (usage?.inputTokens !== void 0 || usage?.outputTokens !== void 0) {
|
|
22969
23635
|
tokens.push([
|
|
22970
23636
|
messages.inputOutput,
|
|
22971
|
-
`${
|
|
23637
|
+
`${count4(usage.inputTokens)} / ${count4(usage.outputTokens)}`
|
|
22972
23638
|
]);
|
|
22973
23639
|
}
|
|
22974
23640
|
if (usage?.cacheWriteInputTokens !== void 0 && usage.cacheWriteInputTokens > 0) {
|
|
22975
23641
|
tokens.push([
|
|
22976
23642
|
messages.cacheReadWrite,
|
|
22977
|
-
`${
|
|
23643
|
+
`${count4(usage.cachedInputTokens)} / ${count4(usage.cacheWriteInputTokens)}`
|
|
22978
23644
|
]);
|
|
22979
23645
|
} else if (usage?.cachedInputTokens !== void 0) {
|
|
22980
|
-
tokens.push([messages.cacheRead,
|
|
23646
|
+
tokens.push([messages.cacheRead, count4(usage.cachedInputTokens)]);
|
|
22981
23647
|
}
|
|
22982
23648
|
if (usage?.totalTokens !== void 0) {
|
|
22983
23649
|
tokens.push([messages.totalTokens, formatRendererTokenCount(usage.totalTokens)]);
|
|
@@ -26104,13 +26770,13 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
26104
26770
|
(name) => name.startsWith("__reactFiber$")
|
|
26105
26771
|
);
|
|
26106
26772
|
if (key) {
|
|
26107
|
-
const
|
|
26773
|
+
const ancestors2 = committedReactAncestors(
|
|
26108
26774
|
Object.getOwnPropertyDescriptor(element, key)?.value
|
|
26109
26775
|
);
|
|
26110
26776
|
const scopes = [];
|
|
26111
|
-
|
|
26777
|
+
ancestors2.forEach(({ memoizedProps: props }, index) => {
|
|
26112
26778
|
if (isRecord5(props) && "onLocalSubmitStart" in props && typeof props.submitDisabled === "boolean") {
|
|
26113
|
-
scopes.push({ owner:
|
|
26779
|
+
scopes.push({ owner: ancestors2[index], fibers: ancestors2.slice(0, index + 1) });
|
|
26114
26780
|
}
|
|
26115
26781
|
});
|
|
26116
26782
|
const valid = scopes.filter((scope) => {
|
|
@@ -27069,6 +27735,17 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
27069
27735
|
function isRecord9(value) {
|
|
27070
27736
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
27071
27737
|
}
|
|
27738
|
+
function conversationIdFrom(request) {
|
|
27739
|
+
if (typeof request === "string" && request) return request;
|
|
27740
|
+
if (!isRecord9(request)) return null;
|
|
27741
|
+
if (typeof request.conversationId === "string" && request.conversationId)
|
|
27742
|
+
return request.conversationId;
|
|
27743
|
+
if (typeof request.threadId === "string" && request.threadId) return request.threadId;
|
|
27744
|
+
return null;
|
|
27745
|
+
}
|
|
27746
|
+
function isHostExternalConversation(conversation, threadId) {
|
|
27747
|
+
return isRecord9(conversation) && conversation.id === threadId && conversation.modelProvider === "codexhost";
|
|
27748
|
+
}
|
|
27072
27749
|
function isManager(value) {
|
|
27073
27750
|
return isRecord9(value) && ["sendRequest", "steerTurn", "startTurn", "getTurnCoordinator"].every(
|
|
27074
27751
|
(key) => typeof value[key] === "function"
|
|
@@ -27104,6 +27781,27 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
27104
27781
|
if (!text) return params;
|
|
27105
27782
|
return { ...params, input: [{ type: "text", text, text_elements: [] }] };
|
|
27106
27783
|
}
|
|
27784
|
+
function installExternalQueueUi(manager) {
|
|
27785
|
+
const coordinator = manager.getTurnCoordinator();
|
|
27786
|
+
const options = isRecord9(coordinator) ? coordinator.options : null;
|
|
27787
|
+
if (!isRecord9(options) || typeof options.getMessageQueueMode !== "function") return null;
|
|
27788
|
+
const descriptor = Object.getOwnPropertyDescriptor(options, "getMessageQueueMode");
|
|
27789
|
+
if (!descriptor?.writable) return null;
|
|
27790
|
+
const original = options.getMessageQueueMode;
|
|
27791
|
+
const getMessageQueueMode = (...args) => {
|
|
27792
|
+
const threadId = conversationIdFrom(args[0]);
|
|
27793
|
+
if (threadId && typeof manager.getConversation === "function" && isHostExternalConversation(manager.getConversation(threadId), threadId)) {
|
|
27794
|
+
return Promise.resolve("queue");
|
|
27795
|
+
}
|
|
27796
|
+
return original.apply(options, args);
|
|
27797
|
+
};
|
|
27798
|
+
options.getMessageQueueMode = getMessageQueueMode;
|
|
27799
|
+
return () => {
|
|
27800
|
+
if (options.getMessageQueueMode === getMessageQueueMode) {
|
|
27801
|
+
Object.defineProperty(options, "getMessageQueueMode", descriptor);
|
|
27802
|
+
}
|
|
27803
|
+
};
|
|
27804
|
+
}
|
|
27107
27805
|
function submissionHost(manager) {
|
|
27108
27806
|
const coordinator = manager.getTurnCoordinator();
|
|
27109
27807
|
const options = isRecord9(coordinator) ? coordinator.options : null;
|
|
@@ -27177,6 +27875,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
27177
27875
|
function installRendererExternalSteering(target, sendTurnStart, prepareTurnInput) {
|
|
27178
27876
|
if (!isManager(target)) return null;
|
|
27179
27877
|
const manager = target;
|
|
27878
|
+
const restoreQueueUi = installExternalQueueUi(manager);
|
|
27180
27879
|
const originalSteer = manager.steerTurn;
|
|
27181
27880
|
const originalSend = manager.sendRequest;
|
|
27182
27881
|
const routes = /* @__PURE__ */ new Map();
|
|
@@ -27187,7 +27886,9 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
27187
27886
|
if ((method === "turn/start" || method === "turn/steer") && prepareTurnInput) {
|
|
27188
27887
|
params = prepareTurnInput(params);
|
|
27189
27888
|
}
|
|
27190
|
-
if (method === "turn/start"
|
|
27889
|
+
if (method === "turn/start" || method === "turn/steer") {
|
|
27890
|
+
params = restoreQueuedTurnStartText(manager, params);
|
|
27891
|
+
}
|
|
27191
27892
|
const messageId = isRecord9(params) ? params.clientUserMessageId : null;
|
|
27192
27893
|
const route = typeof messageId === "string" && isRecord9(params) ? routes.get(`${params.threadId}\0${messageId}`) : void 0;
|
|
27193
27894
|
if (method !== "turn/start" || !isRecord9(params) || !route || route.threadId !== params.threadId) {
|
|
@@ -27394,6 +28095,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
27394
28095
|
});
|
|
27395
28096
|
return () => {
|
|
27396
28097
|
disposed = true;
|
|
28098
|
+
restoreQueueUi?.();
|
|
27397
28099
|
restoreMethod("steerTurn");
|
|
27398
28100
|
if (getStreamRole) restoreMethod("getStreamRole");
|
|
27399
28101
|
if (pending.size === 0) {
|
|
@@ -27561,10 +28263,72 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27561
28263
|
};
|
|
27562
28264
|
}
|
|
27563
28265
|
|
|
28266
|
+
// src/renderer-thread-reference-persistence.ts
|
|
28267
|
+
var record8 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
28268
|
+
var SYNC_TIMEOUT_MS = 2e3;
|
|
28269
|
+
function restoreRpcThreadReferenceCapability(client, messages, isCurrent) {
|
|
28270
|
+
if (!record8(messages) || !record8(messages.electronBridge)) return client;
|
|
28271
|
+
const bridge = messages.electronBridge;
|
|
28272
|
+
const send = bridge.sendMessageFromView;
|
|
28273
|
+
if (typeof send !== "function") return client;
|
|
28274
|
+
const inspect = client.inspectThread.bind(client);
|
|
28275
|
+
const checked = /* @__PURE__ */ new Set();
|
|
28276
|
+
const isMissing = (key) => new Promise((resolve) => {
|
|
28277
|
+
const finish = (missing) => {
|
|
28278
|
+
clearTimeout(timer);
|
|
28279
|
+
messages.removeEventListener("message", listener);
|
|
28280
|
+
resolve(missing);
|
|
28281
|
+
};
|
|
28282
|
+
const listener = (event) => {
|
|
28283
|
+
if (event.source != null && event.source !== messages) return;
|
|
28284
|
+
const message2 = event.data;
|
|
28285
|
+
if (!record8(message2) || message2.type !== "persisted-atom-sync" || !record8(message2.state))
|
|
28286
|
+
return;
|
|
28287
|
+
finish(!Object.hasOwn(message2.state, key));
|
|
28288
|
+
};
|
|
28289
|
+
const timer = setTimeout(() => finish(false), SYNC_TIMEOUT_MS);
|
|
28290
|
+
messages.addEventListener("message", listener);
|
|
28291
|
+
try {
|
|
28292
|
+
Promise.resolve(
|
|
28293
|
+
send.call(bridge, { type: "persisted-atom-sync-request", responsePriority: "critical" })
|
|
28294
|
+
).catch(() => finish(false));
|
|
28295
|
+
} catch {
|
|
28296
|
+
finish(false);
|
|
28297
|
+
}
|
|
28298
|
+
});
|
|
28299
|
+
const inspectThread = async (input) => {
|
|
28300
|
+
if (!isCurrent() || checked.has(input.threadId)) return inspect(input);
|
|
28301
|
+
checked.add(input.threadId);
|
|
28302
|
+
const key = `thread-reference-capability:${input.threadId}`;
|
|
28303
|
+
if (!await isMissing(key) || !isCurrent()) return inspect(input);
|
|
28304
|
+
let proven = true;
|
|
28305
|
+
const result = await inspect({ ...input, includeReferenceCapability: true }).catch(() => {
|
|
28306
|
+
proven = false;
|
|
28307
|
+
return inspect(input);
|
|
28308
|
+
});
|
|
28309
|
+
if (proven && result.owner === "codex" && result.supportsThreadReferences === true && isCurrent() && await isMissing(key) && isCurrent()) {
|
|
28310
|
+
try {
|
|
28311
|
+
await send.call(bridge, {
|
|
28312
|
+
type: "persisted-atom-update",
|
|
28313
|
+
key,
|
|
28314
|
+
value: true,
|
|
28315
|
+
deleted: false
|
|
28316
|
+
});
|
|
28317
|
+
} catch {
|
|
28318
|
+
}
|
|
28319
|
+
}
|
|
28320
|
+
return result;
|
|
28321
|
+
};
|
|
28322
|
+
return Object.freeze({ ...client, inspectThread });
|
|
28323
|
+
}
|
|
28324
|
+
|
|
27564
28325
|
// src/renderer-thread-reference-capability.ts
|
|
27565
|
-
var
|
|
27566
|
-
function restoreThreadReferenceCapability(client, manager, isCurrent) {
|
|
27567
|
-
if (
|
|
28326
|
+
var record9 = (value) => typeof value === "object" && value !== null;
|
|
28327
|
+
function restoreThreadReferenceCapability(client, manager, isCurrent, messages = null) {
|
|
28328
|
+
if (record9(manager) && manager.kind === "main-process-rpc") {
|
|
28329
|
+
return restoreRpcThreadReferenceCapability(client, messages, isCurrent);
|
|
28330
|
+
}
|
|
28331
|
+
if (!record9(manager) || !record9(manager.storage)) return client;
|
|
27568
28332
|
const storage = manager.storage;
|
|
27569
28333
|
const read = storage.readValue;
|
|
27570
28334
|
const write = storage.writeValue;
|
|
@@ -27599,14 +28363,14 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27599
28363
|
}
|
|
27600
28364
|
|
|
27601
28365
|
// src/renderer-thread-reference-context.ts
|
|
27602
|
-
var
|
|
28366
|
+
var record10 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
27603
28367
|
function createThreadReferenceContext(manager, hostId2, isCurrent) {
|
|
27604
28368
|
const prepared = /* @__PURE__ */ new WeakMap();
|
|
27605
28369
|
return (params) => {
|
|
27606
|
-
if (hostId2 === "local" || !
|
|
28370
|
+
if (hostId2 === "local" || !record10(manager) || typeof manager.getConversation !== "function" || !record10(params) || typeof params.threadId !== "string")
|
|
27607
28371
|
return params;
|
|
27608
28372
|
const conversation = manager.getConversation.call(manager, params.threadId);
|
|
27609
|
-
if (!
|
|
28373
|
+
if (!record10(conversation) || conversation.id !== params.threadId || conversation.modelProvider !== "codexhost")
|
|
27610
28374
|
return params;
|
|
27611
28375
|
if (!isCurrent()) throw new Error("Thread reference connection is no longer available");
|
|
27612
28376
|
const cached2 = prepared.get(params);
|
|
@@ -27712,7 +28476,8 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27712
28476
|
const client = restoreThreadReferenceCapability(
|
|
27713
28477
|
nativeClient,
|
|
27714
28478
|
target,
|
|
27715
|
-
() => !disposed && readRouting()?.forHost(route.hostId) === route
|
|
28479
|
+
() => !disposed && readRouting()?.forHost(route.hostId) === route,
|
|
28480
|
+
messages
|
|
27716
28481
|
);
|
|
27717
28482
|
entries.set(route.hostId, { route, client, cleanups });
|
|
27718
28483
|
try {
|
|
@@ -27856,6 +28621,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27856
28621
|
var SIDEBAR_THREAD_ID_ATTRIBUTE = "data-app-action-sidebar-thread-id";
|
|
27857
28622
|
var SIDEBAR_THREAD_HOST_ID_ATTRIBUTE = "data-app-action-sidebar-thread-host-id";
|
|
27858
28623
|
var SIDEBAR_AGENT_ICON_ATTRIBUTE = "data-codexhost-sidebar-agent-icon";
|
|
28624
|
+
var SIDEBAR_AGENT_ICON_ROW_SELECTOR = `${SIDEBAR_THREAD_ROW_SELECTOR}, ${NATIVE_SCHEDULE_SIDEBAR_ROW_SELECTOR}`;
|
|
27859
28625
|
var OWNERSHIP_RETRY_DELAYS_MS = [100, 300, 800, 1500, 3e3];
|
|
27860
28626
|
function isRecord12(value) {
|
|
27861
28627
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -27901,7 +28667,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27901
28667
|
return candidates.size === 1 ? candidates.values().next().value ?? null : null;
|
|
27902
28668
|
}
|
|
27903
28669
|
function rendererAgentForThreadOwnership(ownership) {
|
|
27904
|
-
if (ownership.owner === "codex") return
|
|
28670
|
+
if (ownership.owner === "codex") return "codex";
|
|
27905
28671
|
return ownership.harnessId;
|
|
27906
28672
|
}
|
|
27907
28673
|
function sidebarAgentIconAnchor(titleTrigger, title) {
|
|
@@ -27919,22 +28685,30 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27919
28685
|
this.element = element;
|
|
27920
28686
|
}
|
|
27921
28687
|
element;
|
|
28688
|
+
#scheduledThread;
|
|
27922
28689
|
isConnected() {
|
|
27923
28690
|
return this.element.isConnected;
|
|
27924
28691
|
}
|
|
27925
28692
|
hostId() {
|
|
27926
|
-
|
|
28693
|
+
const attributes = sidebarThreadAttributes(this.element);
|
|
28694
|
+
this.#scheduledThread = attributes ? void 0 : readNativeScheduleSidebarThread(this.element);
|
|
28695
|
+
return attributes?.hostId ?? (this.#scheduledThread ? "local" : null);
|
|
27927
28696
|
}
|
|
27928
28697
|
threadId() {
|
|
27929
|
-
|
|
28698
|
+
const threadId = sidebarThreadAttributes(this.element) ? threadIdFromSidebarRowElement(this.element) : this.#scheduledThread !== void 0 ? this.#scheduledThread : readNativeScheduleSidebarThread(this.element);
|
|
28699
|
+
this.#scheduledThread = void 0;
|
|
28700
|
+
return threadId;
|
|
27930
28701
|
}
|
|
27931
28702
|
draftId() {
|
|
27932
28703
|
return draftIdFromSidebarRowElement(this.element);
|
|
27933
28704
|
}
|
|
27934
28705
|
render(agent, plugin) {
|
|
27935
28706
|
const presentation = JSON.stringify([agent, plugin?.name, plugin?.icon, plugin?.iconStyle]);
|
|
27936
|
-
const
|
|
27937
|
-
const
|
|
28707
|
+
const scheduled = !this.element.hasAttribute(SIDEBAR_THREAD_ROW_ATTRIBUTE) && this.element.matches(NATIVE_SCHEDULE_SIDEBAR_ROW_SELECTOR);
|
|
28708
|
+
const titleTrigger = scheduled ? this.element : this.element.querySelector("[data-thread-title-trigger]");
|
|
28709
|
+
const title = scheduled ? [...this.element.querySelectorAll("[data-thread-title][id]")].find(
|
|
28710
|
+
(node) => node.id === this.element.getAttribute("aria-labelledby")
|
|
28711
|
+
) : titleTrigger?.querySelector("[data-thread-title]");
|
|
27938
28712
|
if (!titleTrigger || !title) {
|
|
27939
28713
|
this.clear();
|
|
27940
28714
|
return;
|
|
@@ -27983,7 +28757,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27983
28757
|
row = new BrowserSidebarAgentIconRow(element);
|
|
27984
28758
|
this.#rowsByElement.set(element, row);
|
|
27985
28759
|
}
|
|
27986
|
-
if (element.isConnected && element.matches(
|
|
28760
|
+
if (element.isConnected && element.matches(SIDEBAR_AGENT_ICON_ROW_SELECTOR))
|
|
27987
28761
|
this.#trackedRows.add(row);
|
|
27988
28762
|
else this.#trackedRows.delete(row);
|
|
27989
28763
|
return row;
|
|
@@ -27992,7 +28766,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27992
28766
|
for (const row of this.#trackedRows) {
|
|
27993
28767
|
if (!row.isConnected()) this.#trackedRows.delete(row);
|
|
27994
28768
|
}
|
|
27995
|
-
return [...this.root.querySelectorAll(
|
|
28769
|
+
return [...this.root.querySelectorAll(SIDEBAR_AGENT_ICON_ROW_SELECTOR)].map(
|
|
27996
28770
|
(element) => this.#row(element)
|
|
27997
28771
|
);
|
|
27998
28772
|
}
|
|
@@ -28001,13 +28775,14 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28001
28775
|
const changed = /* @__PURE__ */ new Set();
|
|
28002
28776
|
const collect = (node) => {
|
|
28003
28777
|
if (!(node instanceof Element)) return;
|
|
28004
|
-
if (node.matches(
|
|
28005
|
-
|
|
28778
|
+
if (node.matches(SIDEBAR_AGENT_ICON_ROW_SELECTOR))
|
|
28779
|
+
changed.add(this.#row(node));
|
|
28780
|
+
for (const element of node.querySelectorAll(SIDEBAR_AGENT_ICON_ROW_SELECTOR))
|
|
28006
28781
|
changed.add(this.#row(element));
|
|
28007
28782
|
};
|
|
28008
28783
|
for (const mutation of mutations) {
|
|
28009
28784
|
const target = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
|
|
28010
|
-
const row = target?.closest(
|
|
28785
|
+
const row = target?.closest(SIDEBAR_AGENT_ICON_ROW_SELECTOR);
|
|
28011
28786
|
if (row) changed.add(this.#row(row));
|
|
28012
28787
|
else if (target && this.#rowsByElement.has(target))
|
|
28013
28788
|
changed.add(this.#row(target));
|
|
@@ -28021,7 +28796,10 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28021
28796
|
attributeFilter: [
|
|
28022
28797
|
SIDEBAR_THREAD_ROW_ATTRIBUTE,
|
|
28023
28798
|
SIDEBAR_THREAD_ID_ATTRIBUTE,
|
|
28024
|
-
SIDEBAR_THREAD_HOST_ID_ATTRIBUTE
|
|
28799
|
+
SIDEBAR_THREAD_HOST_ID_ATTRIBUTE,
|
|
28800
|
+
"data-sidebar-cycle-item",
|
|
28801
|
+
"aria-labelledby",
|
|
28802
|
+
"role"
|
|
28025
28803
|
],
|
|
28026
28804
|
childList: true,
|
|
28027
28805
|
subtree: true
|
|
@@ -28091,7 +28869,8 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28091
28869
|
ownershipRetryTimers.delete(key);
|
|
28092
28870
|
if (disposed) return;
|
|
28093
28871
|
failed.delete(key);
|
|
28094
|
-
ownershipByThread.
|
|
28872
|
+
const cached2 = ownershipByThread.get(key);
|
|
28873
|
+
if (cached2) cached2.stale = true;
|
|
28095
28874
|
scheduleScan(rowsByThread.get(key) ?? []);
|
|
28096
28875
|
}, delay);
|
|
28097
28876
|
ownershipRetryTimers.set(key, timer);
|
|
@@ -28104,7 +28883,10 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28104
28883
|
if (disposed) return;
|
|
28105
28884
|
for (const ownership of threads) {
|
|
28106
28885
|
const key = ownershipKey(hostId2, ownership.threadId);
|
|
28107
|
-
ownershipByThread.set(key,
|
|
28886
|
+
ownershipByThread.set(key, {
|
|
28887
|
+
agent: rendererAgentForThreadOwnership(ownership),
|
|
28888
|
+
stale: false
|
|
28889
|
+
});
|
|
28108
28890
|
failed.delete(key);
|
|
28109
28891
|
if (ownership.owner === "codex") {
|
|
28110
28892
|
provisionalCodex.add(key);
|
|
@@ -28137,6 +28919,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28137
28919
|
const unresolvedByHost = /* @__PURE__ */ new Map();
|
|
28138
28920
|
const pluginsByHost = /* @__PURE__ */ new Map();
|
|
28139
28921
|
const getPlugin = (hostId2, agent) => {
|
|
28922
|
+
if (agent === "codex") return void 0;
|
|
28140
28923
|
if (!pluginsByHost.has(hostId2)) pluginsByHost.set(hostId2, options.getPlugins?.(hostId2));
|
|
28141
28924
|
return pluginsByHost.get(hostId2)?.find(({ id }) => id === agent);
|
|
28142
28925
|
};
|
|
@@ -28162,11 +28945,10 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28162
28945
|
if (localAgent !== null && localAgent !== void 0) {
|
|
28163
28946
|
if (threadId.success) {
|
|
28164
28947
|
const key2 = ownershipKey(hostId2, threadId.data);
|
|
28165
|
-
ownershipByThread.set(key2,
|
|
28948
|
+
ownershipByThread.set(key2, { agent: localAgent, stale: false });
|
|
28166
28949
|
clearOwnershipRetry(key2);
|
|
28167
28950
|
}
|
|
28168
|
-
|
|
28169
|
-
else row.render(localAgent, getPlugin(hostId2, localAgent));
|
|
28951
|
+
row.render(localAgent, getPlugin(hostId2, localAgent));
|
|
28170
28952
|
continue;
|
|
28171
28953
|
}
|
|
28172
28954
|
if (!threadId.success) {
|
|
@@ -28174,13 +28956,11 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28174
28956
|
continue;
|
|
28175
28957
|
}
|
|
28176
28958
|
const key = ownershipKey(hostId2, threadId.data);
|
|
28177
|
-
|
|
28178
|
-
|
|
28179
|
-
|
|
28180
|
-
|
|
28181
|
-
|
|
28182
|
-
}
|
|
28183
|
-
row.clear();
|
|
28959
|
+
const cached2 = ownershipByThread.get(key);
|
|
28960
|
+
if (cached2) {
|
|
28961
|
+
row.render(cached2.agent, getPlugin(hostId2, cached2.agent));
|
|
28962
|
+
if (!cached2.stale) continue;
|
|
28963
|
+
} else row.clear();
|
|
28184
28964
|
if (!pending.has(key) && !failed.has(key)) {
|
|
28185
28965
|
let unresolved = unresolvedByHost.get(hostId2);
|
|
28186
28966
|
if (!unresolved) {
|
|
@@ -28220,7 +29000,10 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28220
29000
|
for (const timer of ownershipRetryTimers.values()) clearTimeout(timer);
|
|
28221
29001
|
ownershipRetryTimers.clear();
|
|
28222
29002
|
ownershipRetryAttempts.clear();
|
|
28223
|
-
for (const key of provisionalCodex)
|
|
29003
|
+
for (const key of provisionalCodex) {
|
|
29004
|
+
const cached2 = ownershipByThread.get(key);
|
|
29005
|
+
if (cached2) cached2.stale = true;
|
|
29006
|
+
}
|
|
28224
29007
|
provisionalCodex.clear();
|
|
28225
29008
|
scheduleScan(dom.rows());
|
|
28226
29009
|
},
|
|
@@ -28319,16 +29102,16 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28319
29102
|
return isRecord13(value) ? value : null;
|
|
28320
29103
|
}
|
|
28321
29104
|
function directForkAncestors(first) {
|
|
28322
|
-
const
|
|
29105
|
+
const ancestors2 = [];
|
|
28323
29106
|
const seen = /* @__PURE__ */ new Set();
|
|
28324
29107
|
let fiber = first;
|
|
28325
|
-
while (fiber &&
|
|
29108
|
+
while (fiber && ancestors2.length < FAST_FORK_OWNER_DEPTH) {
|
|
28326
29109
|
if (seen.has(fiber)) return [];
|
|
28327
29110
|
seen.add(fiber);
|
|
28328
|
-
|
|
29111
|
+
ancestors2.push(fiber);
|
|
28329
29112
|
fiber = isRecord13(fiber.return) ? fiber.return : null;
|
|
28330
29113
|
}
|
|
28331
|
-
return
|
|
29114
|
+
return ancestors2;
|
|
28332
29115
|
}
|
|
28333
29116
|
function ownsOtherCallback(fiber, props) {
|
|
28334
29117
|
if (typeof fiber.type === "string") return false;
|
|
@@ -28336,13 +29119,13 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28336
29119
|
(name) => /^on[A-Z]/.test(name) && name !== "onClick" && name !== "onFork" && typeof props[name] === "function"
|
|
28337
29120
|
);
|
|
28338
29121
|
}
|
|
28339
|
-
function forkTargetFromAncestors(button2, threadId, turnId,
|
|
29122
|
+
function forkTargetFromAncestors(button2, threadId, turnId, ancestors2) {
|
|
28340
29123
|
const conversationIds = /* @__PURE__ */ new Set();
|
|
28341
29124
|
const turnIds = /* @__PURE__ */ new Set();
|
|
28342
29125
|
const hostIds = /* @__PURE__ */ new Set();
|
|
28343
29126
|
const projectlessStates = /* @__PURE__ */ new Set();
|
|
28344
29127
|
let hasForkCallback = false;
|
|
28345
|
-
for (const fiber of
|
|
29128
|
+
for (const fiber of ancestors2) {
|
|
28346
29129
|
const props = fiber.memoizedProps;
|
|
28347
29130
|
if (!isRecord13(props)) continue;
|
|
28348
29131
|
if (!hasForkCallback && typeof props.onFork !== "function" && ownsOtherCallback(fiber, props)) {
|
|
@@ -28879,6 +29662,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28879
29662
|
}
|
|
28880
29663
|
});
|
|
28881
29664
|
const selectedPolicies = /* @__PURE__ */ new Map();
|
|
29665
|
+
const draftModels = createScopedDraftModelWriter();
|
|
28882
29666
|
const handleRoutingPolicyChange = () => {
|
|
28883
29667
|
currentRequestRoute();
|
|
28884
29668
|
};
|
|
@@ -28899,7 +29683,16 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28899
29683
|
const route = window.__codexhostHostRoutingV1?.forComposer(composer);
|
|
28900
29684
|
if (!route) return false;
|
|
28901
29685
|
try {
|
|
28902
|
-
|
|
29686
|
+
const target = composer ? findComposerModelTarget(composer) : null;
|
|
29687
|
+
if (target?.[0] === "conversation") return true;
|
|
29688
|
+
if (target?.[0] !== "default" || typeof target[1] !== "string" || !composer)
|
|
29689
|
+
return agent === "codex";
|
|
29690
|
+
const binding = findScopedDraftModelBinding(composer, target[1]);
|
|
29691
|
+
const draftKey = target[1];
|
|
29692
|
+
if (!binding || !route.policy.scopedCreation)
|
|
29693
|
+
return agent === "codex" && !draftModels.has(draftKey);
|
|
29694
|
+
draftModels.apply(draftKey, binding, carrier ?? null);
|
|
29695
|
+
if (route.policy.select(carrier ?? null, draftKey, binding.creationModes)) {
|
|
28903
29696
|
modelUpdates += 1;
|
|
28904
29697
|
liveStatus.modelUpdates = modelUpdates;
|
|
28905
29698
|
}
|
|
@@ -28917,6 +29710,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28917
29710
|
dispose() {
|
|
28918
29711
|
if (disposed) return;
|
|
28919
29712
|
disposed = true;
|
|
29713
|
+
draftModels.dispose();
|
|
28920
29714
|
window.removeEventListener(
|
|
28921
29715
|
"codexhost:draft-prewarm-policy-changed",
|
|
28922
29716
|
handleRoutingPolicyChange
|
|
@@ -29694,6 +30488,8 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
29694
30488
|
cachedInputTokens: 0,
|
|
29695
30489
|
cacheWriteInputTokens: 0,
|
|
29696
30490
|
cacheKnownInputTokens: 0,
|
|
30491
|
+
cacheHitCachedInputTokens: 0,
|
|
30492
|
+
cacheHitInputTokens: 0,
|
|
29697
30493
|
outputTokens: 0,
|
|
29698
30494
|
reasoningOutputTokens: 0,
|
|
29699
30495
|
costUsd: 0,
|
|
@@ -29707,6 +30503,8 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
29707
30503
|
target.cachedInputTokens += source.cachedInputTokens;
|
|
29708
30504
|
target.cacheWriteInputTokens += source.cacheWriteInputTokens;
|
|
29709
30505
|
target.cacheKnownInputTokens += source.cacheKnownInputTokens;
|
|
30506
|
+
target.cacheHitCachedInputTokens += source.cacheHitCachedInputTokens;
|
|
30507
|
+
target.cacheHitInputTokens += source.cacheHitInputTokens;
|
|
29710
30508
|
target.outputTokens += source.outputTokens;
|
|
29711
30509
|
target.reasoningOutputTokens += source.reasoningOutputTokens;
|
|
29712
30510
|
target.costUsd += source.costUsd;
|
|
@@ -29740,12 +30538,12 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
29740
30538
|
return unmetered(totals2) || allUnpriced(totals2) ? "\u2014" : money(totals2.costUsd);
|
|
29741
30539
|
}
|
|
29742
30540
|
function tokenCount(totals2, value, locale = "en") {
|
|
29743
|
-
return unmetered(totals2) ? "\u2014" :
|
|
30541
|
+
return unmetered(totals2) ? "\u2014" : count3(value, locale);
|
|
29744
30542
|
}
|
|
29745
30543
|
function isChinese(locale) {
|
|
29746
30544
|
return /^zh(?:-|$)/iu.test(locale);
|
|
29747
30545
|
}
|
|
29748
|
-
function
|
|
30546
|
+
function count3(value, locale = "en") {
|
|
29749
30547
|
if (!isChinese(locale)) return formatRendererTokenCount(value);
|
|
29750
30548
|
const absolute = Math.abs(value);
|
|
29751
30549
|
if (absolute < 1e4) return value.toLocaleString(locale, { maximumFractionDigits: 0 });
|
|
@@ -29754,21 +30552,23 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
29754
30552
|
return `${Number((value / divisor).toFixed(2))} ${hundredMillions ? "\u4EBF" : "\u4E07"}`;
|
|
29755
30553
|
}
|
|
29756
30554
|
function tokenSummary(value, locale = "en") {
|
|
29757
|
-
if (!isChinese(locale)) return { value:
|
|
30555
|
+
if (!isChinese(locale)) return { value: count3(value), approximation: null };
|
|
29758
30556
|
return {
|
|
29759
30557
|
value: value.toLocaleString(locale, { maximumFractionDigits: 0 }),
|
|
29760
|
-
approximation: Math.abs(value) >= 1e4 ? `\u2248 ${
|
|
30558
|
+
approximation: Math.abs(value) >= 1e4 ? `\u2248 ${count3(value, locale)}` : null
|
|
29761
30559
|
};
|
|
29762
30560
|
}
|
|
29763
30561
|
function cacheHitRate(totals2) {
|
|
29764
|
-
return totals2.
|
|
30562
|
+
return totals2.cacheHitInputTokens > 0 ? formatRendererCacheHitRate(
|
|
30563
|
+
totals2.cacheHitCachedInputTokens / totals2.cacheHitInputTokens * 100
|
|
30564
|
+
) : "\u2014";
|
|
29765
30565
|
}
|
|
29766
30566
|
function formatMeasure(measure, value, locale = "en") {
|
|
29767
|
-
return measure === "cost" ? money(value) :
|
|
30567
|
+
return measure === "cost" ? money(value) : count3(value, locale);
|
|
29768
30568
|
}
|
|
29769
30569
|
function axisValue(measure, value, locale = "en") {
|
|
29770
|
-
if (measure !== "cost") return
|
|
29771
|
-
if (value >= 1e3) return `$${
|
|
30570
|
+
if (measure !== "cost") return count3(value, locale);
|
|
30571
|
+
if (value >= 1e3) return `$${count3(value)}`;
|
|
29772
30572
|
return `$${Number(value.toFixed(2))}`;
|
|
29773
30573
|
}
|
|
29774
30574
|
function percent(share) {
|
|
@@ -31023,7 +31823,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
31023
31823
|
const document2 = context.content.ownerDocument;
|
|
31024
31824
|
const locale = pageLocale ?? (document2.documentElement.lang || "en");
|
|
31025
31825
|
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
31026
|
-
const
|
|
31826
|
+
const count4 = (value) => count3(value, locale);
|
|
31027
31827
|
const tokenCount2 = (totals2, value) => tokenCount(totals2, value, locale);
|
|
31028
31828
|
const saved = readView();
|
|
31029
31829
|
const view = {
|
|
@@ -31604,7 +32404,7 @@ ${messages.creditsCoverage}: ${value.reportedRequests} / ${row.requests}` : void
|
|
|
31604
32404
|
key: "requests",
|
|
31605
32405
|
label: messages.requests,
|
|
31606
32406
|
sort: (row) => row.requests,
|
|
31607
|
-
cell: (row) =>
|
|
32407
|
+
cell: (row) => count4(row.requests)
|
|
31608
32408
|
},
|
|
31609
32409
|
{
|
|
31610
32410
|
key: "input",
|
|
@@ -31628,7 +32428,7 @@ ${messages.creditsCoverage}: ${value.reportedRequests} / ${row.requests}` : void
|
|
|
31628
32428
|
{
|
|
31629
32429
|
key: "hit",
|
|
31630
32430
|
label: messages.cacheHit,
|
|
31631
|
-
sort: (row) => row.
|
|
32431
|
+
sort: (row) => row.cacheHitInputTokens > 0 ? row.cacheHitCachedInputTokens / row.cacheHitInputTokens : -1,
|
|
31632
32432
|
cell: (row) => cacheHitRate(row)
|
|
31633
32433
|
},
|
|
31634
32434
|
{
|
|
@@ -31763,7 +32563,7 @@ ${detail}` : ""}`
|
|
|
31763
32563
|
document2,
|
|
31764
32564
|
"span",
|
|
31765
32565
|
{ className: "console-badge is-warn" },
|
|
31766
|
-
fill(messages.unpriced, { count:
|
|
32566
|
+
fill(messages.unpriced, { count: count4(row.unpricedRequests) })
|
|
31767
32567
|
)
|
|
31768
32568
|
);
|
|
31769
32569
|
}
|
|
@@ -34802,7 +35602,7 @@ ${detail}` : ""}`
|
|
|
34802
35602
|
}
|
|
34803
35603
|
function defaultImportName(source, existing) {
|
|
34804
35604
|
const base = source.provider === "openai-codex" ? "codex" : "grok";
|
|
34805
|
-
const used = new Set(existing.map((
|
|
35605
|
+
const used = new Set(existing.map((record15) => record15.name));
|
|
34806
35606
|
const valid = (name) => credentialImportNameSchema.safeParse(name).success;
|
|
34807
35607
|
if (!used.has(base)) return base;
|
|
34808
35608
|
const local = source.label.includes("@") ? source.label.split("@")[0] ?? "" : "";
|
|
@@ -34825,7 +35625,7 @@ ${detail}` : ""}`
|
|
|
34825
35625
|
const shown = (text) => accountDisplayText(text, hideEmails);
|
|
34826
35626
|
const targetButtons = /* @__PURE__ */ new Map();
|
|
34827
35627
|
const importedRecords = () => snapshot.targets.find((target) => target.harnessId === TARGET_HARNESS_ID)?.imports ?? [];
|
|
34828
|
-
const sourceOf = (
|
|
35628
|
+
const sourceOf = (record15) => snapshot.sources.find((source) => source.id === record15.source.id);
|
|
34829
35629
|
const piTarget = () => snapshot.targets.find((candidate) => candidate.harnessId === TARGET_HARNESS_ID);
|
|
34830
35630
|
const compatibleSources = () => {
|
|
34831
35631
|
const target = piTarget();
|
|
@@ -34863,7 +35663,7 @@ ${detail}` : ""}`
|
|
|
34863
35663
|
sectionImport.addEventListener("click", () => {
|
|
34864
35664
|
const sources = compatibleSources();
|
|
34865
35665
|
const free = sources.find(
|
|
34866
|
-
(source2) => !importedRecords().some((
|
|
35666
|
+
(source2) => !importedRecords().some((record15) => record15.source.id === source2.id)
|
|
34867
35667
|
);
|
|
34868
35668
|
const source = free ?? sources[0];
|
|
34869
35669
|
if (source) openDialog("add", { source, choose: true }, SECTION_IMPORT_KEY);
|
|
@@ -34913,30 +35713,30 @@ ${detail}` : ""}`
|
|
|
34913
35713
|
mark.append(createRendererAgentIcon(agent ?? "pi", 26, document2, pluginFor(agent ?? "pi")));
|
|
34914
35714
|
return mark;
|
|
34915
35715
|
};
|
|
34916
|
-
const renderRow = (
|
|
35716
|
+
const renderRow = (record15) => {
|
|
34917
35717
|
const row = document2.createElement("div");
|
|
34918
35718
|
row.className = "settings-pi-accounts__row";
|
|
34919
35719
|
row.tabIndex = -1;
|
|
34920
|
-
row.dataset.importName =
|
|
34921
|
-
row.setAttribute("aria-label", shown(
|
|
34922
|
-
const agent =
|
|
35720
|
+
row.dataset.importName = record15.name;
|
|
35721
|
+
row.setAttribute("aria-label", shown(record15.source.label));
|
|
35722
|
+
const agent = record15.source.harnessId;
|
|
34923
35723
|
const mark = createMark(agent);
|
|
34924
35724
|
const identity = document2.createElement("div");
|
|
34925
35725
|
identity.className = "settings-pi-accounts__identity";
|
|
34926
35726
|
const label = document2.createElement("strong");
|
|
34927
35727
|
label.className = "settings-account-email";
|
|
34928
|
-
label.textContent = shown(
|
|
35728
|
+
label.textContent = shown(record15.source.label);
|
|
34929
35729
|
label.title = label.textContent;
|
|
34930
35730
|
label.translate = false;
|
|
34931
35731
|
const meta3 = document2.createElement("div");
|
|
34932
35732
|
meta3.className = "settings-account-metadata";
|
|
34933
|
-
const source = sourceOf(
|
|
35733
|
+
const source = sourceOf(record15);
|
|
34934
35734
|
const parts = [
|
|
34935
35735
|
metaPart(rendererAgentLabel(agent, pluginFor(agent)), "settings-pi-accounts__agent"),
|
|
34936
|
-
metaPart(`${
|
|
35736
|
+
metaPart(`${record15.name}/\u2026`, void 0, true),
|
|
34937
35737
|
metaPart(messages.copied)
|
|
34938
35738
|
];
|
|
34939
|
-
const time3 = formatImportedAt(
|
|
35739
|
+
const time3 = formatImportedAt(record15.importedAt);
|
|
34940
35740
|
if (time3) parts.push(metaPart(time3));
|
|
34941
35741
|
parts.forEach((part, index) => {
|
|
34942
35742
|
if (index > 0) {
|
|
@@ -34953,23 +35753,23 @@ ${detail}` : ""}`
|
|
|
34953
35753
|
reimport.type = "button";
|
|
34954
35754
|
reimport.className = "settings-account-action";
|
|
34955
35755
|
reimport.textContent = messages.rowReimport;
|
|
34956
|
-
reimport.setAttribute("aria-label", `${messages.reimport}: ${shown(
|
|
35756
|
+
reimport.setAttribute("aria-label", `${messages.reimport}: ${shown(record15.source.label)}`);
|
|
34957
35757
|
reimport.disabled = busy || !source;
|
|
34958
35758
|
reimport.title = messages.reimport;
|
|
34959
35759
|
reimport.addEventListener("click", () => {
|
|
34960
|
-
if (source) openDialog("reimport", { source, record:
|
|
35760
|
+
if (source) openDialog("reimport", { source, record: record15 }, `row:${record15.name}`);
|
|
34961
35761
|
});
|
|
34962
35762
|
const remove = document2.createElement("button");
|
|
34963
35763
|
remove.type = "button";
|
|
34964
35764
|
remove.className = "settings-account-action settings-pi-accounts__remove";
|
|
34965
35765
|
remove.textContent = messages.rowRemove;
|
|
34966
|
-
remove.setAttribute("aria-label", `${messages.remove}: ${shown(
|
|
35766
|
+
remove.setAttribute("aria-label", `${messages.remove}: ${shown(record15.source.label)}`);
|
|
34967
35767
|
remove.disabled = busy;
|
|
34968
|
-
remove.addEventListener("click", () => openDialog("remove", { record:
|
|
35768
|
+
remove.addEventListener("click", () => openDialog("remove", { record: record15 }, `row:${record15.name}`));
|
|
34969
35769
|
if (source) actions.append(reimport);
|
|
34970
35770
|
actions.append(remove);
|
|
34971
35771
|
row.append(mark, identity, actions);
|
|
34972
|
-
rows.set(
|
|
35772
|
+
rows.set(record15.name, row);
|
|
34973
35773
|
return row;
|
|
34974
35774
|
};
|
|
34975
35775
|
const loginTypeLabel = (type) => type === "oauth" ? messages.typeOauth : type === "api_key" ? messages.typeApiKey : messages.typeOther;
|
|
@@ -35122,7 +35922,7 @@ ${detail}` : ""}`
|
|
|
35122
35922
|
const label = document2.createElement("strong");
|
|
35123
35923
|
label.textContent = shown(choice.label);
|
|
35124
35924
|
label.translate = false;
|
|
35125
|
-
const existing = importedRecords().find((
|
|
35925
|
+
const existing = importedRecords().find((record15) => record15.source.id === choice.id);
|
|
35126
35926
|
const agent = choice.harnessId;
|
|
35127
35927
|
const detail = document2.createElement("span");
|
|
35128
35928
|
detail.textContent = [
|
|
@@ -35163,7 +35963,7 @@ ${detail}` : ""}`
|
|
|
35163
35963
|
const name = request.action === "list" ? void 0 : request.name;
|
|
35164
35964
|
state = {
|
|
35165
35965
|
source: state.source,
|
|
35166
|
-
record: importedRecords().find((
|
|
35966
|
+
record: importedRecords().find((record15) => record15.name === name) ?? state.record
|
|
35167
35967
|
};
|
|
35168
35968
|
show(next);
|
|
35169
35969
|
} else {
|
|
@@ -35177,12 +35977,12 @@ ${detail}` : ""}`
|
|
|
35177
35977
|
sourceRadios = [];
|
|
35178
35978
|
body.replaceChildren();
|
|
35179
35979
|
controls.replaceChildren();
|
|
35180
|
-
const { source, record:
|
|
35980
|
+
const { source, record: record15 } = state;
|
|
35181
35981
|
const close = () => modal.close();
|
|
35182
35982
|
if (mode2 === "add" || mode2 === "reimport") {
|
|
35183
35983
|
title.textContent = mode2 === "add" ? messages.add : messages.reimport;
|
|
35184
35984
|
modal.setAttribute("aria-label", title.textContent);
|
|
35185
|
-
const active = source ??
|
|
35985
|
+
const active = source ?? record15?.source;
|
|
35186
35986
|
const choices = mode2 === "add" && state.choose ? compatibleSources() : [];
|
|
35187
35987
|
if (choices.length > 1) body.append(sourcePicker(choices));
|
|
35188
35988
|
else if (active) body.append(line(messages.source, shown(active.label)));
|
|
@@ -35191,8 +35991,8 @@ ${detail}` : ""}`
|
|
|
35191
35991
|
input.maxLength = 48;
|
|
35192
35992
|
input.autocomplete = "off";
|
|
35193
35993
|
input.spellcheck = false;
|
|
35194
|
-
input.value =
|
|
35195
|
-
input.readOnly = Boolean(
|
|
35994
|
+
input.value = record15?.name ?? (source ? defaultImportName(source, importedRecords()) : "codex");
|
|
35995
|
+
input.readOnly = Boolean(record15);
|
|
35196
35996
|
input.addEventListener("input", () => {
|
|
35197
35997
|
nameEdited = true;
|
|
35198
35998
|
});
|
|
@@ -35226,7 +36026,7 @@ ${detail}` : ""}`
|
|
|
35226
36026
|
{
|
|
35227
36027
|
action: mode2 === "reimport" ? "reimport" : "import",
|
|
35228
36028
|
sourceId: source2.id,
|
|
35229
|
-
name:
|
|
36029
|
+
name: record15?.name ?? input.value,
|
|
35230
36030
|
confirmed: true
|
|
35231
36031
|
},
|
|
35232
36032
|
"done"
|
|
@@ -35236,16 +36036,16 @@ ${detail}` : ""}`
|
|
|
35236
36036
|
)
|
|
35237
36037
|
);
|
|
35238
36038
|
(mode2 === "add" ? input : controls.children[0]).focus();
|
|
35239
|
-
} else if (mode2 === "remove" &&
|
|
36039
|
+
} else if (mode2 === "remove" && record15) {
|
|
35240
36040
|
title.textContent = messages.remove;
|
|
35241
36041
|
modal.setAttribute("aria-label", title.textContent);
|
|
35242
|
-
body.append(note(messages.removeWarning.replace("{name}",
|
|
36042
|
+
body.append(note(messages.removeWarning.replace("{name}", record15.name)));
|
|
35243
36043
|
const cancel = command(messages.cancel, close);
|
|
35244
36044
|
controls.append(
|
|
35245
36045
|
cancel,
|
|
35246
36046
|
command(
|
|
35247
36047
|
messages.remove,
|
|
35248
|
-
() => submit({ action: "remove", name:
|
|
36048
|
+
() => submit({ action: "remove", name: record15.name, confirmed: true }, null),
|
|
35249
36049
|
"danger"
|
|
35250
36050
|
)
|
|
35251
36051
|
);
|
|
@@ -35253,7 +36053,7 @@ ${detail}` : ""}`
|
|
|
35253
36053
|
} else {
|
|
35254
36054
|
title.textContent = messages.doneTitle;
|
|
35255
36055
|
modal.setAttribute("aria-label", title.textContent);
|
|
35256
|
-
const name =
|
|
36056
|
+
const name = record15?.name;
|
|
35257
36057
|
if (name) body.append(line(messages.entry, `${name}/\u2026`, true));
|
|
35258
36058
|
body.append(note(messages.done));
|
|
35259
36059
|
const done = command(messages.close, close, "primary");
|
|
@@ -35300,21 +36100,21 @@ ${detail}` : ""}`
|
|
|
35300
36100
|
(candidate) => candidate.harnessId === TARGET_HARNESS_ID && source && candidate.providers.includes(source.provider)
|
|
35301
36101
|
);
|
|
35302
36102
|
if (!source || !target) return null;
|
|
35303
|
-
const
|
|
36103
|
+
const record15 = target.imports.find((candidate) => candidate.source.id === source.id);
|
|
35304
36104
|
const key = `${harnessId}:${accountLabel}:import`;
|
|
35305
36105
|
const button2 = document2.createElement("button");
|
|
35306
36106
|
button2.type = "button";
|
|
35307
36107
|
button2.className = "settings-account-pi-import";
|
|
35308
36108
|
button2.dataset.accountFocus = key;
|
|
35309
36109
|
button2.disabled = busy;
|
|
35310
|
-
const hint =
|
|
36110
|
+
const hint = record15 ? messages.importedHint.replace("{name}", record15.name) : messages.add;
|
|
35311
36111
|
button2.title = hint;
|
|
35312
36112
|
button2.setAttribute("aria-label", hint);
|
|
35313
36113
|
button2.append(createRendererAgentIcon("pi", 12, document2, pluginFor("pi")));
|
|
35314
|
-
if (
|
|
36114
|
+
if (record15) {
|
|
35315
36115
|
button2.dataset.state = "imported";
|
|
35316
36116
|
const name = document2.createElement("code");
|
|
35317
|
-
name.textContent = `${
|
|
36117
|
+
name.textContent = `${record15.name}/\u2026`;
|
|
35318
36118
|
name.translate = false;
|
|
35319
36119
|
button2.append(name, createRendererSettingsIcon("check", 12));
|
|
35320
36120
|
} else {
|
|
@@ -35322,7 +36122,7 @@ ${detail}` : ""}`
|
|
|
35322
36122
|
button2.append(messages.add);
|
|
35323
36123
|
}
|
|
35324
36124
|
button2.addEventListener("click", () => {
|
|
35325
|
-
if (!
|
|
36125
|
+
if (!record15) {
|
|
35326
36126
|
openDialog("add", { source }, key);
|
|
35327
36127
|
return;
|
|
35328
36128
|
}
|
|
@@ -35331,7 +36131,7 @@ ${detail}` : ""}`
|
|
|
35331
36131
|
renderSection();
|
|
35332
36132
|
sectionToggle.setAttribute("aria-expanded", "true");
|
|
35333
36133
|
}
|
|
35334
|
-
const row = rows.get(
|
|
36134
|
+
const row = rows.get(record15.name);
|
|
35335
36135
|
row?.scrollIntoView({ block: "nearest", behavior: "smooth" });
|
|
35336
36136
|
row?.focus();
|
|
35337
36137
|
});
|
|
@@ -35637,14 +36437,14 @@ ${detail}` : ""}`
|
|
|
35637
36437
|
summary.className = "settings-account-reset-summary";
|
|
35638
36438
|
summary.setAttribute("aria-label", messages.accountResetCreditsDetails);
|
|
35639
36439
|
summary.title = messages.accountResetCreditsDetails;
|
|
35640
|
-
const
|
|
35641
|
-
|
|
36440
|
+
const count4 = document2.createElement("span");
|
|
36441
|
+
count4.textContent = messages.locale === "zh-CN" ? `${resetCredits.availableCount} \u5F20` : String(resetCredits.availableCount);
|
|
35642
36442
|
const label = document2.createElement("span");
|
|
35643
36443
|
label.textContent = messages.accountResetCredits;
|
|
35644
36444
|
summary.append(
|
|
35645
36445
|
createRendererSettingsIcon("ticket", 16),
|
|
35646
36446
|
label,
|
|
35647
|
-
|
|
36447
|
+
count4,
|
|
35648
36448
|
createRendererSettingsIcon("chevron-right", 14)
|
|
35649
36449
|
);
|
|
35650
36450
|
const details = document2.createElement("div");
|
|
@@ -36326,6 +37126,43 @@ ${detail}` : ""}`
|
|
|
36326
37126
|
});
|
|
36327
37127
|
}
|
|
36328
37128
|
|
|
37129
|
+
// src/settings/harness-schedules-page.ts
|
|
37130
|
+
function createHarnessSchedulesPage(messages, options) {
|
|
37131
|
+
const t = (zh, en) => messages.locale === "zh-CN" ? zh : en;
|
|
37132
|
+
return {
|
|
37133
|
+
id: "harness-schedules",
|
|
37134
|
+
label: t("\u5B9A\u65F6\u4EFB\u52A1", "Schedules"),
|
|
37135
|
+
icon: "schedules",
|
|
37136
|
+
mount(context) {
|
|
37137
|
+
const navigate = () => {
|
|
37138
|
+
context.content.replaceChildren();
|
|
37139
|
+
void context.runLatest((signal) => options.openSchedules(signal), {
|
|
37140
|
+
success() {
|
|
37141
|
+
},
|
|
37142
|
+
failure() {
|
|
37143
|
+
const document2 = context.content.ownerDocument;
|
|
37144
|
+
const status = document2.createElement("p");
|
|
37145
|
+
status.setAttribute("role", "status");
|
|
37146
|
+
status.className = "text-sm text-settings-muted";
|
|
37147
|
+
status.textContent = t(
|
|
37148
|
+
"\u65E0\u6CD5\u6253\u5F00\u5B98\u65B9\u5B9A\u65F6\u4EFB\u52A1\u9875\uFF0C\u8BF7\u91CD\u8BD5\u6216\u4ECE\u5B98\u65B9\u4FA7\u680F\u8FDB\u5165\u3002",
|
|
37149
|
+
"Could not open the official schedules page. Retry or use the Desktop sidebar."
|
|
37150
|
+
);
|
|
37151
|
+
const retry = document2.createElement("button");
|
|
37152
|
+
retry.type = "button";
|
|
37153
|
+
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";
|
|
37154
|
+
retry.textContent = t("\u91CD\u8BD5", "Retry");
|
|
37155
|
+
retry.addEventListener("click", navigate);
|
|
37156
|
+
context.content.replaceChildren(status, retry);
|
|
37157
|
+
}
|
|
37158
|
+
});
|
|
37159
|
+
};
|
|
37160
|
+
navigate();
|
|
37161
|
+
return void 0;
|
|
37162
|
+
}
|
|
37163
|
+
};
|
|
37164
|
+
}
|
|
37165
|
+
|
|
36329
37166
|
// src/settings/update-request.ts
|
|
36330
37167
|
var RENDERER_UPDATE_REQUEST_TIMEOUT_MS = 15e3;
|
|
36331
37168
|
var RendererUpdateRequestTimeoutError = class extends Error {
|
|
@@ -36653,8 +37490,8 @@ ${detail}` : ""}`
|
|
|
36653
37490
|
const starBanner = updateStarBanner(document2, messages);
|
|
36654
37491
|
context.content.append(heading, metadata, panel, controls, starBanner, notes);
|
|
36655
37492
|
const setManualFallback = (fallback) => {
|
|
36656
|
-
controls.className =
|
|
36657
|
-
manualNpmDescription.textContent =
|
|
37493
|
+
controls.className = fallback ? "settings-update-controls" : "settings-update-controls is-quiet";
|
|
37494
|
+
manualNpmDescription.textContent = fallback ? messages.updateManualFallbackDescription : messages.updateManualNpmDescription;
|
|
36658
37495
|
manualNpmDescription.className = fallback ? "settings-update-manual-description is-fallback" : "settings-update-manual-description";
|
|
36659
37496
|
};
|
|
36660
37497
|
let pollTimer;
|
|
@@ -36804,14 +37641,14 @@ ${detail}` : ""}`
|
|
|
36804
37641
|
panel.dataset.updateState = view;
|
|
36805
37642
|
panel.replaceChildren();
|
|
36806
37643
|
setManualFallback(Boolean(result.error) || actionableStatus !== null);
|
|
36807
|
-
const inlineUpdate = !result.error && !
|
|
37644
|
+
const inlineUpdate = !result.error && !actionableStatus && result.updateAvailable;
|
|
36808
37645
|
if (inlineUpdate) panel.dataset.inline = "";
|
|
36809
37646
|
else delete panel.dataset.inline;
|
|
36810
37647
|
panel.append(
|
|
36811
37648
|
createPanelHead(
|
|
36812
37649
|
document2,
|
|
36813
37650
|
view,
|
|
36814
|
-
actionableStatus ? statusMessage(actionableStatus, messages) ?? messages.updateFailed : result.error ? messages.updateFailed : result.updateAvailable ?
|
|
37651
|
+
actionableStatus ? statusMessage(actionableStatus, messages) ?? messages.updateFailed : result.error ? messages.updateFailed : result.updateAvailable ? messages.updateAvailable : messages.updateUpToDate
|
|
36815
37652
|
)
|
|
36816
37653
|
);
|
|
36817
37654
|
if (actionableStatus?.error) {
|
|
@@ -36827,7 +37664,7 @@ ${detail}` : ""}`
|
|
|
36827
37664
|
panel.append(error51);
|
|
36828
37665
|
}
|
|
36829
37666
|
const buttons = [];
|
|
36830
|
-
if (
|
|
37667
|
+
if (result.updateAvailable && result.installationAvailable) {
|
|
36831
37668
|
const update = document2.createElement("button");
|
|
36832
37669
|
update.type = "button";
|
|
36833
37670
|
update.className = "settings-command-button";
|
|
@@ -36876,11 +37713,12 @@ ${detail}` : ""}`
|
|
|
36876
37713
|
}
|
|
36877
37714
|
});
|
|
36878
37715
|
}
|
|
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"))) {
|
|
37716
|
+
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
37717
|
return Object.freeze([
|
|
36881
37718
|
createConnectionsSettingsPage(messages, getDiagnostics, void 0, getRemoteConnections),
|
|
36882
37719
|
createRemoteConnectionsPage(messages, getRemoteConnections),
|
|
36883
37720
|
createAccountsSettingsPage(messages, getAccountClient),
|
|
37721
|
+
...harnessSchedules ? [createHarnessSchedulesPage(messages, harnessSchedules)] : [],
|
|
36884
37722
|
createSessionImportSettingsPage(
|
|
36885
37723
|
messages,
|
|
36886
37724
|
getSessionImportClient,
|
|
@@ -41760,7 +42598,7 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
41760
42598
|
`;
|
|
41761
42599
|
|
|
41762
42600
|
// 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';
|
|
42601
|
+
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
42602
|
|
|
41765
42603
|
// src/settings/trigger.ts
|
|
41766
42604
|
var SETTINGS_TRIGGER_ATTRIBUTE = "data-codexhost-settings-trigger";
|
|
@@ -42005,7 +42843,7 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
42005
42843
|
place();
|
|
42006
42844
|
const observer = ownerWindow ? new ownerWindow.MutationObserver((records) => {
|
|
42007
42845
|
const titlebar = source?.closest("[data-app-shell-titlebar]");
|
|
42008
|
-
if (!source?.isConnected || records.some((
|
|
42846
|
+
if (!source?.isConnected || records.some((record15) => titlebar?.contains(record15.target))) {
|
|
42009
42847
|
place();
|
|
42010
42848
|
}
|
|
42011
42849
|
}) : null;
|
|
@@ -42427,6 +43265,7 @@ ${usage_default}`;
|
|
|
42427
43265
|
let disposed = false;
|
|
42428
43266
|
const mount = () => {
|
|
42429
43267
|
const messages = rendererSettingsMessages(locale);
|
|
43268
|
+
const schedules = options.harnessSchedules;
|
|
42430
43269
|
const definitions = createDefaultRendererSettingsPages(
|
|
42431
43270
|
messages,
|
|
42432
43271
|
options.getUpdateClient ?? (() => null),
|
|
@@ -42444,7 +43283,13 @@ ${usage_default}`;
|
|
|
42444
43283
|
options.getRemoteConnections ?? (() => null),
|
|
42445
43284
|
options.requestUsageStatistics,
|
|
42446
43285
|
options.usageStatisticsHosts,
|
|
42447
|
-
options.requestVoiceSettings
|
|
43286
|
+
options.requestVoiceSettings,
|
|
43287
|
+
schedules ? {
|
|
43288
|
+
openSchedules: async (signal) => {
|
|
43289
|
+
await schedules.openSchedules(signal);
|
|
43290
|
+
if (!disposed && !signal.aborted) shell?.close();
|
|
43291
|
+
}
|
|
43292
|
+
} : void 0
|
|
42448
43293
|
);
|
|
42449
43294
|
const nextShell = installRendererSettingsShell(definitions, messages, ownerWindow.document, {
|
|
42450
43295
|
onOpenChange(open) {
|
|
@@ -43178,6 +44023,815 @@ ${usage_default}`;
|
|
|
43178
44023
|
return event.defaultPrevented;
|
|
43179
44024
|
}
|
|
43180
44025
|
|
|
44026
|
+
// src/codex-schedule-navigation.ts
|
|
44027
|
+
function isNavigationBus(value) {
|
|
44028
|
+
if (typeof value !== "object" || value === null) return false;
|
|
44029
|
+
const bus = value;
|
|
44030
|
+
return bus.handlers instanceof Map && bus.handlers.has("navigate-to-route") && typeof bus.dispatchHostMessage === "function";
|
|
44031
|
+
}
|
|
44032
|
+
function hasArrived(ownerWindow) {
|
|
44033
|
+
const paths = ["/automations", "/scheduled"];
|
|
44034
|
+
const pages = ownerWindow.document.querySelectorAll('[data-app-shell-active-page="true"]');
|
|
44035
|
+
if (pages.length > 0) {
|
|
44036
|
+
const page = pages[0];
|
|
44037
|
+
if (pages.length !== 1 || !page) return false;
|
|
44038
|
+
const fiberKey = Object.keys(page).find((key) => key.startsWith("__reactFiber$"));
|
|
44039
|
+
if (!fiberKey) return false;
|
|
44040
|
+
for (const ancestor of committedReactAncestors(Reflect.get(page, fiberKey))) {
|
|
44041
|
+
const props = ancestor.memoizedProps;
|
|
44042
|
+
const value = props?.value;
|
|
44043
|
+
if (value?.navigationType === "POP" || value?.navigationType === "PUSH" || value?.navigationType === "REPLACE") {
|
|
44044
|
+
return typeof value.location?.pathname === "string" && paths.includes(value.location.pathname);
|
|
44045
|
+
}
|
|
44046
|
+
}
|
|
44047
|
+
return false;
|
|
44048
|
+
}
|
|
44049
|
+
return paths.includes(ownerWindow.location.pathname);
|
|
44050
|
+
}
|
|
44051
|
+
async function openCodexSchedules(signal, ownerWindow = window) {
|
|
44052
|
+
signal.throwIfAborted();
|
|
44053
|
+
const bus = await loadCodexNativeServices(ownerWindow, isNavigationBus);
|
|
44054
|
+
signal.throwIfAborted();
|
|
44055
|
+
if (!bus) throw new Error("Codex navigation is unavailable");
|
|
44056
|
+
await new Promise((resolve, reject) => {
|
|
44057
|
+
let settled2 = false;
|
|
44058
|
+
const finish = (error51) => {
|
|
44059
|
+
if (settled2) return;
|
|
44060
|
+
settled2 = true;
|
|
44061
|
+
ownerWindow.clearInterval(poll);
|
|
44062
|
+
ownerWindow.clearTimeout(timeout);
|
|
44063
|
+
signal.removeEventListener("abort", onAbort);
|
|
44064
|
+
if (error51) reject(error51);
|
|
44065
|
+
else resolve();
|
|
44066
|
+
};
|
|
44067
|
+
const arrived = () => hasArrived(ownerWindow);
|
|
44068
|
+
const onAbort = () => finish(arrived() ? void 0 : signal.reason);
|
|
44069
|
+
const poll = ownerWindow.setInterval(() => {
|
|
44070
|
+
if (arrived()) finish();
|
|
44071
|
+
}, 25);
|
|
44072
|
+
const timeout = ownerWindow.setTimeout(
|
|
44073
|
+
() => finish(new Error("Codex did not open the requested page")),
|
|
44074
|
+
5e3
|
|
44075
|
+
);
|
|
44076
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
44077
|
+
try {
|
|
44078
|
+
bus.dispatchHostMessage({ type: "navigate-to-route", path: "/automations" });
|
|
44079
|
+
if (arrived()) finish();
|
|
44080
|
+
} catch (error51) {
|
|
44081
|
+
finish(error51);
|
|
44082
|
+
}
|
|
44083
|
+
});
|
|
44084
|
+
}
|
|
44085
|
+
|
|
44086
|
+
// src/renderer-native-schedule-picker.ts
|
|
44087
|
+
var schedulePickerStyles = `
|
|
44088
|
+
.picker { position:relative; display:flex; justify-content:flex-end; min-width:0; max-width:100%; }
|
|
44089
|
+
.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; }
|
|
44090
|
+
.trigger:hover:not(:disabled), .trigger[aria-expanded="true"] { color:var(--text); background:var(--hover); }
|
|
44091
|
+
.trigger:focus-visible { outline:2px solid var(--focus); outline-offset:1px; }
|
|
44092
|
+
.trigger:disabled { cursor:default; }
|
|
44093
|
+
.trigger > svg, .trigger > img, .trigger > span.icon, .item > svg, .item > img, .item > span.icon { flex:none; }
|
|
44094
|
+
.label { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
|
44095
|
+
.trigger[data-stale] .label { opacity:.6; }
|
|
44096
|
+
.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; }
|
|
44097
|
+
.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; }
|
|
44098
|
+
.trigger[aria-expanded="true"] .chevron { transform:translateY(2px) rotate(225deg); }
|
|
44099
|
+
.trigger[aria-busy="true"] .chevron { display:none; }
|
|
44100
|
+
.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; }
|
|
44101
|
+
.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; }
|
|
44102
|
+
.menu:not(:popover-open):not([data-open]) { display:none; }
|
|
44103
|
+
.item { display:flex; align-items:center; gap:10px; min-height:36px; padding:6px 8px; border-radius:8px; cursor:pointer; outline:none; }
|
|
44104
|
+
.item:hover:not([aria-disabled="true"]), .item:focus-visible { background:var(--hover); }
|
|
44105
|
+
.item:focus-visible { box-shadow:inset 0 0 0 2px var(--focus); }
|
|
44106
|
+
.item[aria-disabled="true"] { opacity:.45; cursor:default; }
|
|
44107
|
+
.item .label { flex:1; }
|
|
44108
|
+
.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; }
|
|
44109
|
+
.item[aria-selected="true"] .check { visibility:visible; }
|
|
44110
|
+
@keyframes shimmer { to { background-position:-100% 0; } }
|
|
44111
|
+
@keyframes spin { to { transform:rotate(360deg); } }
|
|
44112
|
+
@media(prefers-reduced-motion:reduce) { .spinner, .trigger[data-shimmer] .label { animation:none; } .trigger, .chevron { transition:none; } }
|
|
44113
|
+
`;
|
|
44114
|
+
function createSchedulePicker(document2, options) {
|
|
44115
|
+
const view = document2.defaultView ?? window;
|
|
44116
|
+
const root = document2.createElement("div");
|
|
44117
|
+
root.className = "picker";
|
|
44118
|
+
const trigger = document2.createElement("button");
|
|
44119
|
+
trigger.type = "button";
|
|
44120
|
+
trigger.className = "trigger";
|
|
44121
|
+
trigger.setAttribute("aria-label", options.label);
|
|
44122
|
+
trigger.setAttribute("aria-haspopup", "listbox");
|
|
44123
|
+
trigger.setAttribute("aria-expanded", "false");
|
|
44124
|
+
const menu = document2.createElement("div");
|
|
44125
|
+
menu.className = "menu";
|
|
44126
|
+
menu.setAttribute("role", "listbox");
|
|
44127
|
+
menu.setAttribute("aria-label", options.listLabel);
|
|
44128
|
+
const supportsPopover = typeof menu.showPopover === "function";
|
|
44129
|
+
if (supportsPopover) menu.setAttribute("popover", "manual");
|
|
44130
|
+
root.append(trigger, menu);
|
|
44131
|
+
let items = [];
|
|
44132
|
+
let stale = null;
|
|
44133
|
+
let value = "";
|
|
44134
|
+
let disabled = false;
|
|
44135
|
+
let busy = false;
|
|
44136
|
+
let placeholder = "";
|
|
44137
|
+
let shimmer = false;
|
|
44138
|
+
let isOpen = false;
|
|
44139
|
+
let isDisabled = () => false;
|
|
44140
|
+
const optionElements = /* @__PURE__ */ new Map();
|
|
44141
|
+
const selectedItem = () => items.find((item) => item.value === value) ?? stale;
|
|
44142
|
+
const cloneIcon = (item) => item.icon?.cloneNode(true) ?? null;
|
|
44143
|
+
const renderTrigger = () => {
|
|
44144
|
+
const item = selectedItem();
|
|
44145
|
+
const label = document2.createElement("span");
|
|
44146
|
+
label.className = "label";
|
|
44147
|
+
label.textContent = item?.label ?? placeholder;
|
|
44148
|
+
const icon2 = item ? cloneIcon(item) : null;
|
|
44149
|
+
const tail = document2.createElement("span");
|
|
44150
|
+
tail.className = busy ? "spinner" : "chevron";
|
|
44151
|
+
tail.setAttribute("aria-hidden", "true");
|
|
44152
|
+
trigger.replaceChildren(...icon2 ? [icon2] : [], label, tail);
|
|
44153
|
+
trigger.toggleAttribute("data-stale", Boolean(item && !items.includes(item)));
|
|
44154
|
+
trigger.toggleAttribute("data-shimmer", shimmer && !item);
|
|
44155
|
+
trigger.dataset.value = item ? value : "";
|
|
44156
|
+
trigger.setAttribute("aria-busy", String(busy));
|
|
44157
|
+
trigger.disabled = disabled;
|
|
44158
|
+
if (disabled && isOpen) close();
|
|
44159
|
+
};
|
|
44160
|
+
const renderItems = () => {
|
|
44161
|
+
optionElements.clear();
|
|
44162
|
+
const elements = items.map((item) => {
|
|
44163
|
+
const option = document2.createElement("div");
|
|
44164
|
+
option.className = "item";
|
|
44165
|
+
option.setAttribute("role", "option");
|
|
44166
|
+
option.tabIndex = -1;
|
|
44167
|
+
option.dataset.value = item.value;
|
|
44168
|
+
option.setAttribute("aria-selected", String(item.value === value));
|
|
44169
|
+
if (item.disabled || isDisabled(item.value)) option.setAttribute("aria-disabled", "true");
|
|
44170
|
+
const icon2 = cloneIcon(item);
|
|
44171
|
+
const label = document2.createElement("span");
|
|
44172
|
+
label.className = "label";
|
|
44173
|
+
label.textContent = item.label;
|
|
44174
|
+
const check2 = document2.createElement("span");
|
|
44175
|
+
check2.className = "check";
|
|
44176
|
+
check2.setAttribute("aria-hidden", "true");
|
|
44177
|
+
option.append(...icon2 ? [icon2] : [], label, check2);
|
|
44178
|
+
optionElements.set(item.value, option);
|
|
44179
|
+
return option;
|
|
44180
|
+
});
|
|
44181
|
+
menu.replaceChildren(...elements);
|
|
44182
|
+
};
|
|
44183
|
+
const enabledOptions = () => [...optionElements.values()].filter((el) => el.getAttribute("aria-disabled") !== "true");
|
|
44184
|
+
const focusOption = (el) => {
|
|
44185
|
+
el?.focus();
|
|
44186
|
+
el?.scrollIntoView({ block: "nearest" });
|
|
44187
|
+
};
|
|
44188
|
+
const position = () => {
|
|
44189
|
+
const rect = trigger.getBoundingClientRect();
|
|
44190
|
+
const margin = 8;
|
|
44191
|
+
menu.style.minWidth = `${Math.max(200, Math.min(rect.width, view.innerWidth - 2 * margin))}px`;
|
|
44192
|
+
menu.style.maxHeight = "";
|
|
44193
|
+
const height = menu.offsetHeight;
|
|
44194
|
+
const below = view.innerHeight - rect.bottom - margin - 4;
|
|
44195
|
+
const above = rect.top - margin - 4;
|
|
44196
|
+
const placeBelow = height <= below || below >= above;
|
|
44197
|
+
const room = Math.max(120, placeBelow ? below : above);
|
|
44198
|
+
menu.style.maxHeight = `${room}px`;
|
|
44199
|
+
const used = Math.min(height, room);
|
|
44200
|
+
menu.style.top = `${placeBelow ? rect.bottom + 4 : rect.top - 4 - used}px`;
|
|
44201
|
+
const width = menu.offsetWidth;
|
|
44202
|
+
const left = Math.min(Math.max(margin, rect.right - width), view.innerWidth - width - margin);
|
|
44203
|
+
menu.style.left = `${Math.max(margin, left)}px`;
|
|
44204
|
+
};
|
|
44205
|
+
const onWindowKey = (event) => {
|
|
44206
|
+
if (event.key !== "Escape") return;
|
|
44207
|
+
event.preventDefault();
|
|
44208
|
+
event.stopImmediatePropagation();
|
|
44209
|
+
close();
|
|
44210
|
+
trigger.focus();
|
|
44211
|
+
};
|
|
44212
|
+
const onOutside = (event) => {
|
|
44213
|
+
if (!event.composedPath().includes(root)) close();
|
|
44214
|
+
};
|
|
44215
|
+
const onDismiss = () => close();
|
|
44216
|
+
function open() {
|
|
44217
|
+
if (isOpen || disabled) return;
|
|
44218
|
+
options.onOpen?.();
|
|
44219
|
+
if (!items.length) return;
|
|
44220
|
+
isOpen = true;
|
|
44221
|
+
trigger.setAttribute("aria-expanded", "true");
|
|
44222
|
+
if (supportsPopover) menu.showPopover();
|
|
44223
|
+
else menu.setAttribute("data-open", "");
|
|
44224
|
+
position();
|
|
44225
|
+
focusOption(optionElements.get(value) ?? enabledOptions()[0]);
|
|
44226
|
+
view.addEventListener("keydown", onWindowKey, true);
|
|
44227
|
+
document2.addEventListener("pointerdown", onOutside, true);
|
|
44228
|
+
view.addEventListener("resize", onDismiss);
|
|
44229
|
+
view.addEventListener("blur", onDismiss);
|
|
44230
|
+
document2.addEventListener("scroll", onDismiss, true);
|
|
44231
|
+
}
|
|
44232
|
+
function close() {
|
|
44233
|
+
if (!isOpen) return;
|
|
44234
|
+
isOpen = false;
|
|
44235
|
+
trigger.setAttribute("aria-expanded", "false");
|
|
44236
|
+
if (supportsPopover && menu.matches(":popover-open")) menu.hidePopover();
|
|
44237
|
+
menu.removeAttribute("data-open");
|
|
44238
|
+
view.removeEventListener("keydown", onWindowKey, true);
|
|
44239
|
+
document2.removeEventListener("pointerdown", onOutside, true);
|
|
44240
|
+
view.removeEventListener("resize", onDismiss);
|
|
44241
|
+
view.removeEventListener("blur", onDismiss);
|
|
44242
|
+
document2.removeEventListener("scroll", onDismiss, true);
|
|
44243
|
+
}
|
|
44244
|
+
const choose = (el) => {
|
|
44245
|
+
if (el.getAttribute("aria-disabled") === "true") return;
|
|
44246
|
+
const next = el.dataset.value ?? "";
|
|
44247
|
+
close();
|
|
44248
|
+
trigger.focus();
|
|
44249
|
+
if (next === value) return;
|
|
44250
|
+
picker.value = next;
|
|
44251
|
+
options.onChange(next);
|
|
44252
|
+
};
|
|
44253
|
+
trigger.addEventListener("click", () => isOpen ? close() : open());
|
|
44254
|
+
trigger.addEventListener("keydown", (event) => {
|
|
44255
|
+
if (event.key !== "ArrowDown" && event.key !== "ArrowUp") return;
|
|
44256
|
+
event.preventDefault();
|
|
44257
|
+
open();
|
|
44258
|
+
});
|
|
44259
|
+
menu.addEventListener("click", (event) => {
|
|
44260
|
+
const el = event.target.closest('[role="option"]');
|
|
44261
|
+
if (el) choose(el);
|
|
44262
|
+
});
|
|
44263
|
+
menu.addEventListener("keydown", (event) => {
|
|
44264
|
+
const list = enabledOptions();
|
|
44265
|
+
const active = menu.getRootNode().activeElement;
|
|
44266
|
+
const at = active ? list.indexOf(active) : -1;
|
|
44267
|
+
if (event.key === "ArrowDown") focusOption(list[Math.min(list.length - 1, at + 1)]);
|
|
44268
|
+
else if (event.key === "ArrowUp") focusOption(list[Math.max(0, at - 1)]);
|
|
44269
|
+
else if (event.key === "Home") focusOption(list[0]);
|
|
44270
|
+
else if (event.key === "End") focusOption(list.at(-1));
|
|
44271
|
+
else if (event.key === "Enter" || event.key === " ") {
|
|
44272
|
+
if (active?.getAttribute("role") === "option") choose(active);
|
|
44273
|
+
} else if (event.key === "Tab") {
|
|
44274
|
+
close();
|
|
44275
|
+
trigger.focus();
|
|
44276
|
+
return;
|
|
44277
|
+
} else return;
|
|
44278
|
+
event.preventDefault();
|
|
44279
|
+
});
|
|
44280
|
+
const picker = {
|
|
44281
|
+
root,
|
|
44282
|
+
trigger,
|
|
44283
|
+
get value() {
|
|
44284
|
+
return value;
|
|
44285
|
+
},
|
|
44286
|
+
set value(next) {
|
|
44287
|
+
if (next === value) return;
|
|
44288
|
+
stale = null;
|
|
44289
|
+
value = next;
|
|
44290
|
+
for (const [key, el] of optionElements)
|
|
44291
|
+
el.setAttribute("aria-selected", String(key === next));
|
|
44292
|
+
renderTrigger();
|
|
44293
|
+
},
|
|
44294
|
+
get disabled() {
|
|
44295
|
+
return disabled;
|
|
44296
|
+
},
|
|
44297
|
+
set disabled(next) {
|
|
44298
|
+
if (next === disabled) return;
|
|
44299
|
+
disabled = next;
|
|
44300
|
+
renderTrigger();
|
|
44301
|
+
},
|
|
44302
|
+
get busy() {
|
|
44303
|
+
return busy;
|
|
44304
|
+
},
|
|
44305
|
+
set busy(next) {
|
|
44306
|
+
if (next === busy) return;
|
|
44307
|
+
busy = next;
|
|
44308
|
+
renderTrigger();
|
|
44309
|
+
},
|
|
44310
|
+
setItems(next) {
|
|
44311
|
+
const previous = selectedItem();
|
|
44312
|
+
stale = options.retainMissing && previous && !next.some((item) => item.value === value) ? { ...previous, disabled: true } : null;
|
|
44313
|
+
items = next;
|
|
44314
|
+
renderItems();
|
|
44315
|
+
renderTrigger();
|
|
44316
|
+
},
|
|
44317
|
+
setDisabledValues(next) {
|
|
44318
|
+
isDisabled = next;
|
|
44319
|
+
for (const item of items) {
|
|
44320
|
+
const el = optionElements.get(item.value);
|
|
44321
|
+
if (!el) continue;
|
|
44322
|
+
if (item.disabled || next(item.value)) el.setAttribute("aria-disabled", "true");
|
|
44323
|
+
else el.removeAttribute("aria-disabled");
|
|
44324
|
+
}
|
|
44325
|
+
},
|
|
44326
|
+
setPlaceholder(text, shimmerText = false) {
|
|
44327
|
+
if (text === placeholder && shimmerText === shimmer) return;
|
|
44328
|
+
placeholder = text;
|
|
44329
|
+
shimmer = shimmerText;
|
|
44330
|
+
renderTrigger();
|
|
44331
|
+
},
|
|
44332
|
+
close
|
|
44333
|
+
};
|
|
44334
|
+
renderTrigger();
|
|
44335
|
+
return picker;
|
|
44336
|
+
}
|
|
44337
|
+
|
|
44338
|
+
// src/renderer-native-schedule-controls.ts
|
|
44339
|
+
function restoreRow(row, appearance) {
|
|
44340
|
+
row.hidden = appearance.hidden;
|
|
44341
|
+
row.style.setProperty("display", appearance.display, appearance.priority);
|
|
44342
|
+
}
|
|
44343
|
+
function installRendererNativeScheduleControls(document2, options) {
|
|
44344
|
+
const view = document2.defaultView ?? window;
|
|
44345
|
+
const mounted = /* @__PURE__ */ new Map();
|
|
44346
|
+
let disposed = false;
|
|
44347
|
+
let frame = null;
|
|
44348
|
+
const text = (zh, en) => options.locale() === "zh-CN" ? zh : en;
|
|
44349
|
+
const schedule = () => {
|
|
44350
|
+
if (!disposed && frame === null) frame = view.requestAnimationFrame(scan);
|
|
44351
|
+
};
|
|
44352
|
+
function mount(form) {
|
|
44353
|
+
const root = document2.createElement("div");
|
|
44354
|
+
root.dataset.codexhostScheduleControls = "true";
|
|
44355
|
+
const shadow = root.attachShadow({ mode: "open" });
|
|
44356
|
+
const style = document2.createElement("style");
|
|
44357
|
+
style.textContent = `
|
|
44358
|
+
: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); }
|
|
44359
|
+
* { box-sizing:border-box; }
|
|
44360
|
+
fieldset { border:1px solid var(--border); border-radius:16px; padding:0 12px; margin:0; min-width:0; }
|
|
44361
|
+
.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; }
|
|
44362
|
+
.row + .row { border-top:1px solid var(--border); }
|
|
44363
|
+
.name { flex:none; }
|
|
44364
|
+
.value { display:flex; justify-content:flex-end; min-width:0; max-width:72%; }
|
|
44365
|
+
fieldset:disabled { opacity:.6; }
|
|
44366
|
+
${schedulePickerStyles}
|
|
44367
|
+
.message { display:flex; align-items:baseline; gap:8px; margin:8px 4px 0; color:var(--muted); font-size:12px; line-height:1.5; }
|
|
44368
|
+
p { margin:0; min-width:0; overflow-wrap:anywhere; }
|
|
44369
|
+
button.retry { border:0; border-radius:4px; padding:2px 4px; color:inherit; background:transparent; font:inherit; text-decoration:underline; cursor:pointer; flex-shrink:0; }
|
|
44370
|
+
button.retry:focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
|
|
44371
|
+
[hidden] { display:none!important; }
|
|
44372
|
+
`;
|
|
44373
|
+
const fields = document2.createElement("fieldset");
|
|
44374
|
+
const harness2 = createSchedulePicker(document2, {
|
|
44375
|
+
label: "Harness",
|
|
44376
|
+
listLabel: text("\u9009\u62E9 Harness", "Choose a Harness"),
|
|
44377
|
+
retainMissing: true,
|
|
44378
|
+
onChange: () => onHarness()
|
|
44379
|
+
});
|
|
44380
|
+
const model2 = createSchedulePicker(document2, {
|
|
44381
|
+
label: text("\u6A21\u578B", "Model"),
|
|
44382
|
+
listLabel: text("\u9009\u62E9\u6A21\u578B", "Choose a Model"),
|
|
44383
|
+
retainMissing: true,
|
|
44384
|
+
onChange: () => applyModel()
|
|
44385
|
+
});
|
|
44386
|
+
const workspace = createSchedulePicker(document2, {
|
|
44387
|
+
label: text("\u5DE5\u4F5C\u533A", "Workspace"),
|
|
44388
|
+
listLabel: text("\u9009\u62E9\u5DE5\u4F5C\u533A", "Choose a workspace"),
|
|
44389
|
+
retainMissing: true,
|
|
44390
|
+
onOpen: () => refreshWorkspaces(),
|
|
44391
|
+
onChange: () => {
|
|
44392
|
+
const next = workspaces.find(({ id }) => id === workspace.value) ?? null;
|
|
44393
|
+
if (next?.id === selectedWorkspace?.id && next?.cwd === selectedWorkspace?.cwd) return;
|
|
44394
|
+
selectedWorkspace = next;
|
|
44395
|
+
void loadModels({ preserveSelection: models.length > 0 });
|
|
44396
|
+
}
|
|
44397
|
+
});
|
|
44398
|
+
const label = (name, picker) => {
|
|
44399
|
+
const row = document2.createElement("div");
|
|
44400
|
+
row.className = "row";
|
|
44401
|
+
const title = document2.createElement("span");
|
|
44402
|
+
title.className = "name";
|
|
44403
|
+
title.textContent = name;
|
|
44404
|
+
const value = document2.createElement("div");
|
|
44405
|
+
value.className = "value";
|
|
44406
|
+
value.append(picker.root);
|
|
44407
|
+
row.append(title, value);
|
|
44408
|
+
fields.append(row);
|
|
44409
|
+
return row;
|
|
44410
|
+
};
|
|
44411
|
+
label("Harness", harness2);
|
|
44412
|
+
const modelRow = label(text("\u6A21\u578B", "Model"), model2);
|
|
44413
|
+
const workspaceRow = label(text("\u5DE5\u4F5C\u533A", "Workspace"), workspace);
|
|
44414
|
+
const status = document2.createElement("p");
|
|
44415
|
+
status.setAttribute("role", "status");
|
|
44416
|
+
const retry = document2.createElement("button");
|
|
44417
|
+
retry.type = "button";
|
|
44418
|
+
retry.className = "retry";
|
|
44419
|
+
retry.textContent = text("\u91CD\u8BD5", "Retry");
|
|
44420
|
+
retry.hidden = true;
|
|
44421
|
+
const messageRow = document2.createElement("div");
|
|
44422
|
+
messageRow.className = "message";
|
|
44423
|
+
messageRow.append(status, retry);
|
|
44424
|
+
shadow.append(style, fields, messageRow);
|
|
44425
|
+
const editor = form.querySelector('[contenteditable="true"][role="textbox"], textarea');
|
|
44426
|
+
const container = editor?.closest("fieldset")?.querySelector(":scope > div") ?? form;
|
|
44427
|
+
container.prepend(root);
|
|
44428
|
+
let retired = false;
|
|
44429
|
+
let client = options.getClient();
|
|
44430
|
+
let selectedHarness = "codex";
|
|
44431
|
+
let availablePlugins = [];
|
|
44432
|
+
let generation = 0;
|
|
44433
|
+
let loading = false;
|
|
44434
|
+
let confirming = false;
|
|
44435
|
+
let confirmationTimer;
|
|
44436
|
+
let error51 = "";
|
|
44437
|
+
let models = [];
|
|
44438
|
+
let workspaces = [];
|
|
44439
|
+
let selectedWorkspace = null;
|
|
44440
|
+
let workspaceCreation = null;
|
|
44441
|
+
let carrier = null;
|
|
44442
|
+
let original = null;
|
|
44443
|
+
let restoring = null;
|
|
44444
|
+
const hiddenRows = /* @__PURE__ */ new Map();
|
|
44445
|
+
const external = () => selectedHarness !== "codex";
|
|
44446
|
+
const available = () => options.getAvailablePlugins().some((plugin) => plugin.id === selectedHarness);
|
|
44447
|
+
const harnessItem = (id, name, plugin) => ({
|
|
44448
|
+
value: id,
|
|
44449
|
+
label: name,
|
|
44450
|
+
icon: createRendererAgentIcon(id, 18, document2, plugin)
|
|
44451
|
+
});
|
|
44452
|
+
harness2.setItems([harnessItem("codex", "Codex")]);
|
|
44453
|
+
harness2.value = "codex";
|
|
44454
|
+
const syncAvailablePlugins = () => {
|
|
44455
|
+
const next = options.getAvailablePlugins();
|
|
44456
|
+
if (next.length === availablePlugins.length && next.every(
|
|
44457
|
+
(plugin, index) => plugin.id === availablePlugins[index]?.id && plugin.name === availablePlugins[index]?.name
|
|
44458
|
+
))
|
|
44459
|
+
return;
|
|
44460
|
+
availablePlugins = next;
|
|
44461
|
+
harness2.setItems([
|
|
44462
|
+
harnessItem("codex", "Codex"),
|
|
44463
|
+
...next.map((plugin) => harnessItem(plugin.id, plugin.name, plugin))
|
|
44464
|
+
]);
|
|
44465
|
+
harness2.value = selectedHarness;
|
|
44466
|
+
};
|
|
44467
|
+
function refreshWorkspaces() {
|
|
44468
|
+
workspaces = readNativeScheduleWorkspaces(document2);
|
|
44469
|
+
workspace.setItems([
|
|
44470
|
+
{ value: "", label: text("\u81EA\u52A8\u5206\u914D", "Automatic") },
|
|
44471
|
+
...workspaces.map(({ id, label: label2, cwd }) => ({ value: id, label: `${label2} \xB7 ${cwd}` }))
|
|
44472
|
+
]);
|
|
44473
|
+
workspace.value = selectedWorkspace?.id ?? "";
|
|
44474
|
+
update();
|
|
44475
|
+
}
|
|
44476
|
+
const cancelConfirmation = () => {
|
|
44477
|
+
if (confirmationTimer !== void 0) view.clearTimeout(confirmationTimer);
|
|
44478
|
+
confirmationTimer = void 0;
|
|
44479
|
+
confirming = false;
|
|
44480
|
+
};
|
|
44481
|
+
const restoredSelection = (selection) => restoring && (restoring.model === null ? !selection.model?.startsWith("codexhost/") : selection.model === restoring.model && selection.reasoningEffort === restoring.reasoningEffort);
|
|
44482
|
+
const confirmSelection = () => {
|
|
44483
|
+
cancelConfirmation();
|
|
44484
|
+
confirming = true;
|
|
44485
|
+
const deadline = Date.now() + 5e3;
|
|
44486
|
+
const check2 = () => {
|
|
44487
|
+
if (retired) return;
|
|
44488
|
+
const binding = readNativeScheduleForm(form);
|
|
44489
|
+
const confirmed = binding && (external() ? binding.selection.model === carrier : !restoring || restoredSelection(binding.selection));
|
|
44490
|
+
if (!binding || !options.canRouteExternal() || client !== options.getClient() || confirmed || Date.now() >= deadline)
|
|
44491
|
+
cancelConfirmation();
|
|
44492
|
+
else confirmationTimer = view.setTimeout(check2, 50);
|
|
44493
|
+
update();
|
|
44494
|
+
};
|
|
44495
|
+
confirmationTimer = view.setTimeout(check2, 0);
|
|
44496
|
+
};
|
|
44497
|
+
const restore = () => {
|
|
44498
|
+
const binding = readNativeScheduleForm(form);
|
|
44499
|
+
if (original && carrier && (!binding || binding.selection.model === carrier || confirming)) {
|
|
44500
|
+
restoring = original;
|
|
44501
|
+
binding?.setModel(original);
|
|
44502
|
+
confirmSelection();
|
|
44503
|
+
}
|
|
44504
|
+
carrier = null;
|
|
44505
|
+
original = null;
|
|
44506
|
+
selectedWorkspace = null;
|
|
44507
|
+
workspace.value = "";
|
|
44508
|
+
};
|
|
44509
|
+
const applyModel = () => {
|
|
44510
|
+
const binding = readNativeScheduleForm(form);
|
|
44511
|
+
const selected = models.find((entry) => entry.ref.id === model2.value);
|
|
44512
|
+
if (!external() || workspaceCreation !== null || !binding?.supportsExternal || !available() || binding.hasTarget || binding.isSaving || !selected)
|
|
44513
|
+
return;
|
|
44514
|
+
original ??= restoring ?? binding.selection;
|
|
44515
|
+
restoring = null;
|
|
44516
|
+
carrier = encodeHarnessPluginRoute({
|
|
44517
|
+
harnessId: selectedHarness,
|
|
44518
|
+
model: selected.ref
|
|
44519
|
+
});
|
|
44520
|
+
binding.setModel({ model: carrier, reasoningEffort: null });
|
|
44521
|
+
confirmSelection();
|
|
44522
|
+
update();
|
|
44523
|
+
};
|
|
44524
|
+
const loadModels = async ({ preserveSelection = false } = {}) => {
|
|
44525
|
+
const request = ++generation;
|
|
44526
|
+
const previousModel = model2.value;
|
|
44527
|
+
if (!preserveSelection) {
|
|
44528
|
+
cancelConfirmation();
|
|
44529
|
+
models = [];
|
|
44530
|
+
model2.setItems([]);
|
|
44531
|
+
model2.value = "";
|
|
44532
|
+
model2.setPlaceholder(text("\u6B63\u5728\u52A0\u8F7D\u6A21\u578B\u2026", "Loading models\u2026"), true);
|
|
44533
|
+
}
|
|
44534
|
+
error51 = "";
|
|
44535
|
+
loading = true;
|
|
44536
|
+
update();
|
|
44537
|
+
const requestedHarness = selectedHarness;
|
|
44538
|
+
const selectedClient = client;
|
|
44539
|
+
try {
|
|
44540
|
+
if (!selectedClient) throw Error(text("\u672C\u5730\u8FDE\u63A5\u4E0D\u53EF\u7528\u3002", "Local connection unavailable."));
|
|
44541
|
+
const result = await selectedClient.inspectHarness({
|
|
44542
|
+
harnessId: requestedHarness,
|
|
44543
|
+
...selectedWorkspace ? { cwd: selectedWorkspace.cwd } : {}
|
|
44544
|
+
});
|
|
44545
|
+
if (retired || request !== generation || selectedClient !== options.getClient()) return;
|
|
44546
|
+
if (result.status !== "ready")
|
|
44547
|
+
throw Error(text("\u6240\u9009 Harness \u4E0D\u53EF\u7528\u3002", "The selected Harness is unavailable."));
|
|
44548
|
+
const selectedModel = preserveSelection ? model2.value : previousModel;
|
|
44549
|
+
const next = result.catalog.models;
|
|
44550
|
+
const changed = next.length !== models.length || next.some(
|
|
44551
|
+
(entry, index) => entry.ref.id !== models[index]?.ref.id || entry.label !== models[index]?.label
|
|
44552
|
+
);
|
|
44553
|
+
models = next;
|
|
44554
|
+
if (changed || !preserveSelection)
|
|
44555
|
+
model2.setItems(models.map((entry) => ({ value: entry.ref.id, label: entry.label })));
|
|
44556
|
+
const defaultModel = result.catalog.defaultModel;
|
|
44557
|
+
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 ?? "";
|
|
44558
|
+
model2.setPlaceholder("");
|
|
44559
|
+
if (!models.length) throw Error(text("\u6CA1\u6709\u53EF\u7528\u6A21\u578B\u3002", "No models are available."));
|
|
44560
|
+
if (!preserveSelection) applyModel();
|
|
44561
|
+
} catch (cause) {
|
|
44562
|
+
if (retired || request !== generation) return;
|
|
44563
|
+
error51 = cause instanceof Error ? cause.message : text("\u6A21\u578B\u8BFB\u53D6\u5931\u8D25\u3002", "Could not read models.");
|
|
44564
|
+
if (!preserveSelection) model2.setPlaceholder(text("\u6A21\u578B\u52A0\u8F7D\u5931\u8D25", "Models unavailable"));
|
|
44565
|
+
} finally {
|
|
44566
|
+
if (!retired && request === generation) {
|
|
44567
|
+
loading = false;
|
|
44568
|
+
update();
|
|
44569
|
+
}
|
|
44570
|
+
}
|
|
44571
|
+
};
|
|
44572
|
+
const onHarness = () => {
|
|
44573
|
+
const binding = readNativeScheduleForm(form);
|
|
44574
|
+
if (binding?.hasTarget || binding?.isSaving || workspaceCreation) return;
|
|
44575
|
+
selectedHarness = harness2.value;
|
|
44576
|
+
client = options.getClient();
|
|
44577
|
+
if (!external()) restore();
|
|
44578
|
+
generation++;
|
|
44579
|
+
models = [];
|
|
44580
|
+
model2.setItems([]);
|
|
44581
|
+
model2.value = "";
|
|
44582
|
+
model2.setPlaceholder("");
|
|
44583
|
+
error51 = "";
|
|
44584
|
+
loading = false;
|
|
44585
|
+
if (external()) {
|
|
44586
|
+
refreshWorkspaces();
|
|
44587
|
+
void loadModels();
|
|
44588
|
+
}
|
|
44589
|
+
update();
|
|
44590
|
+
};
|
|
44591
|
+
retry.addEventListener("click", () => {
|
|
44592
|
+
if (error51) void loadModels({ preserveSelection: models.length > 0 });
|
|
44593
|
+
else applyModel();
|
|
44594
|
+
});
|
|
44595
|
+
function blockedReason() {
|
|
44596
|
+
const binding = readNativeScheduleForm(form);
|
|
44597
|
+
if (!external()) {
|
|
44598
|
+
const restored = binding && restoredSelection(binding.selection);
|
|
44599
|
+
if (restoring && !restored)
|
|
44600
|
+
return text(
|
|
44601
|
+
"\u6B63\u5728\u6062\u590D Codex \u914D\u7F6E\uFF0C\u8BF7\u7A0D\u540E\u63D0\u4EA4\u3002",
|
|
44602
|
+
"Restoring Codex settings. Submit again once ready."
|
|
44603
|
+
);
|
|
44604
|
+
restoring = null;
|
|
44605
|
+
if (binding?.selection.model?.startsWith("codexhost/"))
|
|
44606
|
+
return text(
|
|
44607
|
+
"\u4EFB\u52A1\u4ECD\u643A\u5E26\u5916\u90E8 Model\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u5F39\u7A97\u3002",
|
|
44608
|
+
"The task still carries an external Model. Reopen the dialog."
|
|
44609
|
+
);
|
|
44610
|
+
return "";
|
|
44611
|
+
}
|
|
44612
|
+
if (!binding || !options.canRouteExternal() || client !== options.getClient())
|
|
44613
|
+
return text(
|
|
44614
|
+
"\u4EFB\u52A1\u63A5\u5165\u6216\u672C\u5730\u8FDE\u63A5\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u5F39\u7A97\u3002",
|
|
44615
|
+
"Task binding or local connection unavailable. Reopen the dialog."
|
|
44616
|
+
);
|
|
44617
|
+
if (!available())
|
|
44618
|
+
return text(
|
|
44619
|
+
"\u6240\u9009 Harness \u5DF2\u4E0D\u5728\u672C\u5730\u53EF\u7528\u5217\u8868\u4E2D\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002",
|
|
44620
|
+
"The selected Harness is no longer available locally. Choose another Harness."
|
|
44621
|
+
);
|
|
44622
|
+
if (!binding.supportsExternal)
|
|
44623
|
+
return text(
|
|
44624
|
+
"\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",
|
|
44625
|
+
"External Harnesses require a personal local task in the same chat. Enable Run on this computer and disable Start each run in new chat."
|
|
44626
|
+
);
|
|
44627
|
+
if (workspaceCreation?.error) return workspaceCreation.error;
|
|
44628
|
+
if (workspaceCreation?.pending)
|
|
44629
|
+
return text("\u6B63\u5728\u521B\u5EFA\u5DE5\u4F5C\u533A\u4F1A\u8BDD\u2026", "Creating workspace chat\u2026");
|
|
44630
|
+
const chosen = selectedWorkspace;
|
|
44631
|
+
if (chosen && !binding.hasTarget && !workspaces.some(({ id, cwd }) => id === chosen.id && cwd === chosen.cwd))
|
|
44632
|
+
return text(
|
|
44633
|
+
"\u6240\u9009\u5DE5\u4F5C\u533A\u5DF2\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002",
|
|
44634
|
+
"The selected workspace is no longer available. Choose another workspace."
|
|
44635
|
+
);
|
|
44636
|
+
if (error51) return error51;
|
|
44637
|
+
if (loading)
|
|
44638
|
+
return models.length > 0 ? text(
|
|
44639
|
+
"\u6B63\u5728\u786E\u8BA4\u5DE5\u4F5C\u533A\u7684\u6A21\u578B\u914D\u7F6E\uFF0C\u8BF7\u7A0D\u540E\u63D0\u4EA4\u3002",
|
|
44640
|
+
"Checking workspace models. Submit again once ready."
|
|
44641
|
+
) : text("\u8BF7\u7B49\u5F85\u5E76\u9009\u62E9\u53EF\u7528\u7684 Model\u3002", "Wait for an available Model and select it.");
|
|
44642
|
+
if (!carrier || !models.some((entry) => entry.ref.id === model2.value))
|
|
44643
|
+
return text(
|
|
44644
|
+
"\u5F53\u524D\u6A21\u578B\u5728\u6B64\u5DE5\u4F5C\u533A\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6A21\u578B\u3002",
|
|
44645
|
+
"The selected Model is unavailable in this workspace. Choose another Model."
|
|
44646
|
+
);
|
|
44647
|
+
if (binding.selection.model !== carrier && confirming)
|
|
44648
|
+
return text("\u6B63\u5728\u5E94\u7528\u6A21\u578B\u2026", "Applying Model\u2026");
|
|
44649
|
+
if (binding.selection.model !== carrier)
|
|
44650
|
+
return text(
|
|
44651
|
+
"\u4EFB\u52A1\u7684 Model \u5C1A\u672A\u786E\u8BA4\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9 Model\u3002",
|
|
44652
|
+
"The task Model is not confirmed. Select the Model again."
|
|
44653
|
+
);
|
|
44654
|
+
return "";
|
|
44655
|
+
}
|
|
44656
|
+
function update() {
|
|
44657
|
+
if (retired) return;
|
|
44658
|
+
syncAvailablePlugins();
|
|
44659
|
+
const binding = readNativeScheduleForm(form);
|
|
44660
|
+
const active = external();
|
|
44661
|
+
modelRow.hidden = !active;
|
|
44662
|
+
workspaceRow.hidden = !active;
|
|
44663
|
+
fields.disabled = Boolean(binding?.isSaving || binding?.hasTarget || workspaceCreation);
|
|
44664
|
+
workspace.disabled = loading && models.length === 0 || confirming || !binding?.supportsExternal || !available();
|
|
44665
|
+
const modelBusy = loading && models.length === 0 || confirming && active;
|
|
44666
|
+
model2.disabled = modelBusy || models.length === 0 || !binding?.supportsExternal || !available();
|
|
44667
|
+
model2.busy = modelBusy;
|
|
44668
|
+
harness2.busy = confirming && !active;
|
|
44669
|
+
harness2.disabled = fields.disabled;
|
|
44670
|
+
const externalBlocked = !binding?.supportsExternal || !options.canRouteExternal();
|
|
44671
|
+
harness2.setDisabledValues(externalBlocked ? (id) => id !== "codex" : () => false);
|
|
44672
|
+
const blocked = blockedReason();
|
|
44673
|
+
const message2 = loading && models.length === 0 || confirming ? "" : active ? blocked : blocked || error51 || (!binding?.supportsExternal ? text(
|
|
44674
|
+
"\u5916\u90E8 Harness \u9700\u8981\u5728\u9AD8\u7EA7\u8BBE\u7F6E\u4E2D\u9009\u62E9\u672C\u5730\u3001\u56FA\u5B9A\u804A\u5929\u3002",
|
|
44675
|
+
"For external Harnesses, choose local execution in the same chat under Advanced."
|
|
44676
|
+
) : "");
|
|
44677
|
+
if (status.textContent !== message2) status.textContent = message2;
|
|
44678
|
+
messageRow.hidden = !message2;
|
|
44679
|
+
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();
|
|
44680
|
+
const rows = active ? new Set(nativeScheduleModelRows(form)) : /* @__PURE__ */ new Set();
|
|
44681
|
+
for (const [row, appearance] of hiddenRows) {
|
|
44682
|
+
if (rows.has(row)) continue;
|
|
44683
|
+
restoreRow(row, appearance);
|
|
44684
|
+
hiddenRows.delete(row);
|
|
44685
|
+
}
|
|
44686
|
+
for (const row of rows) {
|
|
44687
|
+
if (!hiddenRows.has(row))
|
|
44688
|
+
hiddenRows.set(row, {
|
|
44689
|
+
hidden: row.hidden,
|
|
44690
|
+
display: row.style.getPropertyValue("display"),
|
|
44691
|
+
priority: row.style.getPropertyPriority("display")
|
|
44692
|
+
});
|
|
44693
|
+
row.hidden = true;
|
|
44694
|
+
row.style.setProperty("display", "none", "important");
|
|
44695
|
+
}
|
|
44696
|
+
}
|
|
44697
|
+
async function prepareWorkspace(chosen, routeModel) {
|
|
44698
|
+
if (workspaceCreation) return;
|
|
44699
|
+
const attempt = {
|
|
44700
|
+
controller: new AbortController(),
|
|
44701
|
+
pending: true,
|
|
44702
|
+
error: "",
|
|
44703
|
+
thread: void 0
|
|
44704
|
+
};
|
|
44705
|
+
workspaceCreation = attempt;
|
|
44706
|
+
update();
|
|
44707
|
+
try {
|
|
44708
|
+
const binding = readNativeScheduleForm(form);
|
|
44709
|
+
if (!binding) throw Error("Task binding unavailable");
|
|
44710
|
+
attempt.thread = await options.createWorkspaceThread(
|
|
44711
|
+
{ workspace: chosen, model: routeModel, title: binding.title },
|
|
44712
|
+
attempt.controller.signal
|
|
44713
|
+
);
|
|
44714
|
+
attempt.controller.signal.throwIfAborted();
|
|
44715
|
+
if (retired || !form.isConnected) throw Error("Task dialog closed");
|
|
44716
|
+
const current = readNativeScheduleForm(form);
|
|
44717
|
+
if (!current?.supportsExternal || current.selection.model !== routeModel || client !== options.getClient())
|
|
44718
|
+
throw Error("Task configuration or connection changed. Reopen the dialog.");
|
|
44719
|
+
current.setTargetThread(attempt.thread.threadId, routeModel);
|
|
44720
|
+
const deadline = Date.now() + 5e3;
|
|
44721
|
+
while (readNativeScheduleForm(form)?.targetThreadId !== attempt.thread.threadId) {
|
|
44722
|
+
attempt.controller.signal.throwIfAborted();
|
|
44723
|
+
if (Date.now() >= deadline)
|
|
44724
|
+
throw Error("The task's target chat was not confirmed. Reopen the dialog.");
|
|
44725
|
+
await new Promise((resolve) => view.setTimeout(resolve, 25));
|
|
44726
|
+
}
|
|
44727
|
+
attempt.controller.signal.throwIfAborted();
|
|
44728
|
+
attempt.pending = false;
|
|
44729
|
+
update();
|
|
44730
|
+
form.requestSubmit();
|
|
44731
|
+
} catch (cause) {
|
|
44732
|
+
let cleanupError = "";
|
|
44733
|
+
if (attempt.thread?.discard) {
|
|
44734
|
+
if (readNativeScheduleForm(form)?.targetThreadId === attempt.thread.threadId)
|
|
44735
|
+
attempt.thread.retain();
|
|
44736
|
+
else {
|
|
44737
|
+
try {
|
|
44738
|
+
await attempt.thread.discard();
|
|
44739
|
+
} catch (error52) {
|
|
44740
|
+
cleanupError = ` ${text("\u4F1A\u8BDD\u6E05\u7406\u5931\u8D25\uFF1A", "Chat cleanup failed:")} ${error52 instanceof Error ? error52.message : String(error52)}`;
|
|
44741
|
+
}
|
|
44742
|
+
}
|
|
44743
|
+
}
|
|
44744
|
+
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.")}`;
|
|
44745
|
+
} finally {
|
|
44746
|
+
attempt.pending = false;
|
|
44747
|
+
if (!retired) update();
|
|
44748
|
+
}
|
|
44749
|
+
}
|
|
44750
|
+
const onSubmit = (event) => {
|
|
44751
|
+
if (external() && selectedWorkspace) refreshWorkspaces();
|
|
44752
|
+
const reason = blockedReason();
|
|
44753
|
+
if (!reason) {
|
|
44754
|
+
if (external() && selectedWorkspace) {
|
|
44755
|
+
const binding = readNativeScheduleForm(form);
|
|
44756
|
+
const button2 = form.querySelector('button[type="submit"]');
|
|
44757
|
+
if (!button2 || button2.matches(":disabled") || binding?.isSaving) {
|
|
44758
|
+
event.preventDefault();
|
|
44759
|
+
event.stopImmediatePropagation();
|
|
44760
|
+
return;
|
|
44761
|
+
}
|
|
44762
|
+
if (!binding?.hasTarget && carrier) {
|
|
44763
|
+
event.preventDefault();
|
|
44764
|
+
event.stopImmediatePropagation();
|
|
44765
|
+
void prepareWorkspace(selectedWorkspace, carrier);
|
|
44766
|
+
return;
|
|
44767
|
+
}
|
|
44768
|
+
workspaceCreation?.thread?.retain();
|
|
44769
|
+
}
|
|
44770
|
+
return;
|
|
44771
|
+
}
|
|
44772
|
+
event.preventDefault();
|
|
44773
|
+
event.stopImmediatePropagation();
|
|
44774
|
+
messageRow.hidden = loading && models.length === 0 || confirming;
|
|
44775
|
+
status.textContent = reason;
|
|
44776
|
+
};
|
|
44777
|
+
form.addEventListener("submit", onSubmit, true);
|
|
44778
|
+
update();
|
|
44779
|
+
return {
|
|
44780
|
+
root,
|
|
44781
|
+
update,
|
|
44782
|
+
dispose() {
|
|
44783
|
+
retired = true;
|
|
44784
|
+
generation++;
|
|
44785
|
+
if (form.isConnected) restore();
|
|
44786
|
+
cancelConfirmation();
|
|
44787
|
+
harness2.close();
|
|
44788
|
+
model2.close();
|
|
44789
|
+
workspace.close();
|
|
44790
|
+
if (form.isConnected && workspaceCreation?.thread && readNativeScheduleForm(form)?.targetThreadId === workspaceCreation.thread.threadId)
|
|
44791
|
+
workspaceCreation.thread.retain();
|
|
44792
|
+
workspaceCreation?.controller.abort();
|
|
44793
|
+
for (const [row, appearance] of hiddenRows) restoreRow(row, appearance);
|
|
44794
|
+
form.removeEventListener("submit", onSubmit, true);
|
|
44795
|
+
root.remove();
|
|
44796
|
+
}
|
|
44797
|
+
};
|
|
44798
|
+
}
|
|
44799
|
+
function scan() {
|
|
44800
|
+
frame = null;
|
|
44801
|
+
if (disposed) return;
|
|
44802
|
+
for (const [form, control] of mounted) {
|
|
44803
|
+
if (!form.isConnected || !control.root.isConnected) {
|
|
44804
|
+
control.dispose();
|
|
44805
|
+
mounted.delete(form);
|
|
44806
|
+
} else control.update();
|
|
44807
|
+
}
|
|
44808
|
+
for (const form of document2.querySelectorAll('form[data-density="form"]')) {
|
|
44809
|
+
if (!mounted.has(form) && readNativeScheduleForm(form)) mounted.set(form, mount(form));
|
|
44810
|
+
}
|
|
44811
|
+
}
|
|
44812
|
+
const unsubscribeAvailability = options.subscribeAvailability(schedule);
|
|
44813
|
+
const observer = new MutationObserver(schedule);
|
|
44814
|
+
observer.observe(document2.documentElement, { childList: true, subtree: true });
|
|
44815
|
+
document2.addEventListener("change", schedule, true);
|
|
44816
|
+
document2.addEventListener("click", schedule, true);
|
|
44817
|
+
view.addEventListener("codexhost:draft-prewarm-policy-changed", schedule);
|
|
44818
|
+
scan();
|
|
44819
|
+
return {
|
|
44820
|
+
refresh: schedule,
|
|
44821
|
+
dispose() {
|
|
44822
|
+
disposed = true;
|
|
44823
|
+
if (frame !== null) view.cancelAnimationFrame(frame);
|
|
44824
|
+
observer.disconnect();
|
|
44825
|
+
unsubscribeAvailability();
|
|
44826
|
+
document2.removeEventListener("change", schedule, true);
|
|
44827
|
+
document2.removeEventListener("click", schedule, true);
|
|
44828
|
+
view.removeEventListener("codexhost:draft-prewarm-policy-changed", schedule);
|
|
44829
|
+
for (const control of mounted.values()) control.dispose();
|
|
44830
|
+
mounted.clear();
|
|
44831
|
+
}
|
|
44832
|
+
};
|
|
44833
|
+
}
|
|
44834
|
+
|
|
43181
44835
|
// src/renderer-binding-probe.ts
|
|
43182
44836
|
var EMPTY_PLUGINS = [];
|
|
43183
44837
|
function isRetryableHarnessAvailability(availability2, error51) {
|
|
@@ -43562,6 +45216,9 @@ ${usage_default}`;
|
|
|
43562
45216
|
});
|
|
43563
45217
|
const settingsLifecycle = installRendererSettingsLifecycle(window, {
|
|
43564
45218
|
requestVoiceSettings: (params) => requestLocalSettings("codexhost/voice/settings", params),
|
|
45219
|
+
harnessSchedules: {
|
|
45220
|
+
openSchedules: (signal) => openCodexSchedules(signal)
|
|
45221
|
+
},
|
|
43565
45222
|
getRemoteConnections: () => remoteConnections,
|
|
43566
45223
|
getUpdateClient: () => modelControl,
|
|
43567
45224
|
getAccountClient: () => modelControl,
|
|
@@ -45061,6 +46718,30 @@ ${usage_default}`;
|
|
|
45061
46718
|
return () => connectionListeners.delete(listener);
|
|
45062
46719
|
}
|
|
45063
46720
|
};
|
|
46721
|
+
const nativeScheduleControls = installRendererNativeScheduleControls(document, {
|
|
46722
|
+
getClient: () => modelClientForHost("local"),
|
|
46723
|
+
getAvailablePlugins: () => {
|
|
46724
|
+
const client = modelClientForHost("local");
|
|
46725
|
+
const state = hostHarnessAvailabilityState("local");
|
|
46726
|
+
if (!client || state.directoryClient !== client) return [];
|
|
46727
|
+
return (state.plugins ?? []).filter((plugin) => plugin.kind !== "usage" && state.availability[plugin.id] === "ready").map((plugin) => pluginForHost("local", plugin.id) ?? plugin);
|
|
46728
|
+
},
|
|
46729
|
+
subscribeAvailability: (listener) => {
|
|
46730
|
+
connectionListeners.add(listener);
|
|
46731
|
+
return () => connectionListeners.delete(listener);
|
|
46732
|
+
},
|
|
46733
|
+
canRouteExternal: () => window.__codexhostHostRoutingV1?.forHost("local")?.policy.scopedCreation === true,
|
|
46734
|
+
async createWorkspaceThread(input, signal) {
|
|
46735
|
+
const routing = window.__codexhostHostRoutingV1;
|
|
46736
|
+
const manager = routing?.forHost("local")?.manager;
|
|
46737
|
+
const create = await loadCodexNativeServices(window, isNativeProjectThreadCreator);
|
|
46738
|
+
signal.throwIfAborted();
|
|
46739
|
+
if (!routing || !manager || routing.forHost("local")?.manager !== manager || !create)
|
|
46740
|
+
throw new Error("Native workspace chat creation is unavailable. Reopen the task dialog.");
|
|
46741
|
+
return createNativeScheduleWorkspaceThread(document, routing, create, input, signal);
|
|
46742
|
+
},
|
|
46743
|
+
locale: () => settingsLifecycle.locale
|
|
46744
|
+
});
|
|
45064
46745
|
const mount = (composer) => {
|
|
45065
46746
|
if (mountedByComposer.has(composer) || !composer.isConnected || hasNativeComposerRequest(composer) || orbitComposerKind(composer) !== "codex" || !composer.matches(CODEX_COMPOSER_SELECTOR)) {
|
|
45066
46747
|
return;
|
|
@@ -45395,6 +47076,7 @@ ${usage_default}`;
|
|
|
45395
47076
|
const onAdapterStatus = () => {
|
|
45396
47077
|
publishConnectionStatus();
|
|
45397
47078
|
if (shouldRefreshCodexAccountsForAdapterState(adapterStatus.state)) {
|
|
47079
|
+
reconcileHarnessAvailabilityHost();
|
|
45398
47080
|
void loadCodexAccounts();
|
|
45399
47081
|
sidebarAgentIcons.refresh();
|
|
45400
47082
|
void refreshHarnessAvailabilityForHost("local");
|
|
@@ -45587,6 +47269,7 @@ ${usage_default}`;
|
|
|
45587
47269
|
if (disposed || modelControl !== installedModelControl) return;
|
|
45588
47270
|
try {
|
|
45589
47271
|
settingsLifecycle.refresh();
|
|
47272
|
+
nativeScheduleControls.refresh();
|
|
45590
47273
|
} catch {
|
|
45591
47274
|
}
|
|
45592
47275
|
});
|
|
@@ -45638,6 +47321,7 @@ ${usage_default}`;
|
|
|
45638
47321
|
delegationMention?.dispose();
|
|
45639
47322
|
sidebarAgentIcons.dispose();
|
|
45640
47323
|
stopVoiceSync();
|
|
47324
|
+
nativeScheduleControls.dispose();
|
|
45641
47325
|
settingsLifecycle.dispose();
|
|
45642
47326
|
document.removeEventListener("beforeinput", onBeforeInput, true);
|
|
45643
47327
|
document.removeEventListener("submit", onSubmit, true);
|
|
@@ -45834,8 +47518,8 @@ ${usage_default}`;
|
|
|
45834
47518
|
// src/renderer-voice-capability.ts
|
|
45835
47519
|
var GLOBAL = "__codexhostVoiceCapabilityV1";
|
|
45836
47520
|
var INFERENCE_GATE = "3683713372";
|
|
45837
|
-
var
|
|
45838
|
-
var capable = (value) =>
|
|
47521
|
+
var record11 = (value) => value !== null && typeof value === "object";
|
|
47522
|
+
var capable = (value) => record11(value) && typeof value.isLoading === "boolean" && typeof value.isError === "boolean" && typeof value.isCapable === "boolean";
|
|
45839
47523
|
var equal = (a, b) => a.isLoading === b.isLoading && a.isError === b.isError && a.isCapable === b.isCapable;
|
|
45840
47524
|
function replayVoiceCapability(store, atom, gate) {
|
|
45841
47525
|
const evaluate = (override) => {
|
|
@@ -45873,7 +47557,7 @@ ${usage_default}`;
|
|
|
45873
47557
|
}
|
|
45874
47558
|
}
|
|
45875
47559
|
function isFamily(value) {
|
|
45876
|
-
return
|
|
47560
|
+
return record11(value) && record11(value.scope) && typeof value.resolve === "function";
|
|
45877
47561
|
}
|
|
45878
47562
|
function initializeVoiceCapabilityFamilies(module, assets) {
|
|
45879
47563
|
const initialize = module[assets.capabilityInit];
|
|
@@ -45889,7 +47573,7 @@ ${usage_default}`;
|
|
|
45889
47573
|
const result = [];
|
|
45890
47574
|
const seen = /* @__PURE__ */ new Set();
|
|
45891
47575
|
let hook = fiber.memoizedState;
|
|
45892
|
-
while (
|
|
47576
|
+
while (record11(hook) && result.length < 4096 && !seen.has(hook)) {
|
|
45893
47577
|
seen.add(hook);
|
|
45894
47578
|
result.push(hook);
|
|
45895
47579
|
hook = hook.next;
|
|
@@ -45901,11 +47585,11 @@ ${usage_default}`;
|
|
|
45901
47585
|
const rootKey = Object.getOwnPropertyNames(composer).find(
|
|
45902
47586
|
(key) => key.startsWith("__reactFiber$")
|
|
45903
47587
|
);
|
|
45904
|
-
const
|
|
45905
|
-
let root =
|
|
47588
|
+
const ancestors2 = rootKey ? committedReactAncestors(Object.getOwnPropertyDescriptor(composer, rootKey)?.value) : [];
|
|
47589
|
+
let root = ancestors2[0];
|
|
45906
47590
|
if (chat) {
|
|
45907
|
-
const owners =
|
|
45908
|
-
({ memoizedProps: props }) =>
|
|
47591
|
+
const owners = ancestors2.filter(
|
|
47592
|
+
({ 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
47593
|
);
|
|
45910
47594
|
if (owners.length !== 1) return fibers;
|
|
45911
47595
|
root = owners[0];
|
|
@@ -45914,10 +47598,10 @@ ${usage_default}`;
|
|
|
45914
47598
|
for (const element of [composer, ...composer.querySelectorAll("*")].slice(0, 2048)) {
|
|
45915
47599
|
const key = Object.getOwnPropertyNames(element).find((key2) => key2.startsWith("__reactFiber$"));
|
|
45916
47600
|
if (!key) continue;
|
|
45917
|
-
const
|
|
45918
|
-
const boundary =
|
|
47601
|
+
const ancestors3 = committedReactAncestors(Object.getOwnPropertyDescriptor(element, key)?.value);
|
|
47602
|
+
const boundary = ancestors3.indexOf(root);
|
|
45919
47603
|
if (boundary < 0) continue;
|
|
45920
|
-
for (const fiber of
|
|
47604
|
+
for (const fiber of ancestors3.slice(0, boundary + 1)) if (record11(fiber)) fibers.add(fiber);
|
|
45921
47605
|
}
|
|
45922
47606
|
return fibers;
|
|
45923
47607
|
}
|
|
@@ -45938,7 +47622,7 @@ ${usage_default}`;
|
|
|
45938
47622
|
const list = hooks(fiber);
|
|
45939
47623
|
for (const memo of list) {
|
|
45940
47624
|
const [signal, deps] = Array.isArray(memo.memoizedState) ? memo.memoizedState : [];
|
|
45941
|
-
if (!
|
|
47625
|
+
if (!record11(signal) || !Array.isArray(deps) || deps.length !== 5 || deps[3] !== family || !(deps[1] instanceof Map) || deps[2] !== void 0)
|
|
45942
47626
|
continue;
|
|
45943
47627
|
const chain = deps[1];
|
|
45944
47628
|
const node = chain.get(family.scope.id);
|
|
@@ -45947,7 +47631,7 @@ ${usage_default}`;
|
|
|
45947
47631
|
const matches = [...members].filter(([, member]) => member.cacheKey === deps[0]);
|
|
45948
47632
|
if (matches.length !== 1 || typeof matches[0]?.[0] !== "string") continue;
|
|
45949
47633
|
const parameter = JSON.parse(matches[0][0]);
|
|
45950
|
-
if (!
|
|
47634
|
+
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
47635
|
continue;
|
|
45952
47636
|
const subscriptions = list.filter((hook2) => {
|
|
45953
47637
|
const state = hook2.memoizedState;
|
|
@@ -45960,7 +47644,7 @@ ${usage_default}`;
|
|
|
45960
47644
|
const effect = hook.next?.next?.memoizedState;
|
|
45961
47645
|
const store = signal.store;
|
|
45962
47646
|
const gate = gates.resolve(node, chain, INFERENCE_GATE)?.atom;
|
|
45963
|
-
if (!gate || !instance || !
|
|
47647
|
+
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
47648
|
store.get(signal.atom),
|
|
45965
47649
|
subscriber.getSnapshot()
|
|
45966
47650
|
) || !equal(subscriber.getSnapshot(), instance.getSnapshot()) || subscriber.createRender?.() != null)
|
|
@@ -46072,7 +47756,7 @@ ${usage_default}`;
|
|
|
46072
47756
|
target[GLOBAL] = handle;
|
|
46073
47757
|
const hookActive = (key) => {
|
|
46074
47758
|
const hook = target[key];
|
|
46075
|
-
return
|
|
47759
|
+
return record11(hook) && hook.status === "active";
|
|
46076
47760
|
};
|
|
46077
47761
|
const currentRoute = () => {
|
|
46078
47762
|
try {
|
|
@@ -46148,7 +47832,7 @@ ${usage_default}`;
|
|
|
46148
47832
|
}
|
|
46149
47833
|
|
|
46150
47834
|
// src/renderer-voice-settings-availability.ts
|
|
46151
|
-
var
|
|
47835
|
+
var record12 = (value) => value !== null && typeof value === "object";
|
|
46152
47836
|
function voiceSettingsSurface(doc, page, appScope) {
|
|
46153
47837
|
const pages = /* @__PURE__ */ new Set();
|
|
46154
47838
|
const fibers = /* @__PURE__ */ new Set();
|
|
@@ -46159,20 +47843,20 @@ ${usage_default}`;
|
|
|
46159
47843
|
}
|
|
46160
47844
|
for (const element of [...elements].slice(0, 512)) {
|
|
46161
47845
|
const key = Object.getOwnPropertyNames(element).find((key2) => key2.startsWith("__reactFiber$"));
|
|
46162
|
-
const
|
|
47846
|
+
const ancestors2 = committedReactAncestors(
|
|
46163
47847
|
key && Object.getOwnPropertyDescriptor(element, key)?.value
|
|
46164
47848
|
);
|
|
46165
|
-
const boundary =
|
|
47849
|
+
const boundary = ancestors2.findIndex((fiber) => fiber.type === page);
|
|
46166
47850
|
if (boundary < 0) continue;
|
|
46167
|
-
pages.add(
|
|
46168
|
-
for (const fiber of
|
|
47851
|
+
pages.add(ancestors2[boundary]);
|
|
47852
|
+
for (const fiber of ancestors2.slice(0, boundary + 1)) fibers.add(fiber);
|
|
46169
47853
|
}
|
|
46170
47854
|
if (pages.size !== 1) return;
|
|
46171
47855
|
const scopes = /* @__PURE__ */ new Map();
|
|
46172
47856
|
for (const fiber of fibers)
|
|
46173
47857
|
for (const hook of hooks(fiber)) {
|
|
46174
|
-
const scope2 =
|
|
46175
|
-
if (
|
|
47858
|
+
const scope2 = record12(hook.memoizedState) ? hook.memoizedState.current : void 0;
|
|
47859
|
+
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
47860
|
scopes.set(scope2.node, scope2);
|
|
46177
47861
|
}
|
|
46178
47862
|
const scope = [...scopes.values()][0];
|
|
@@ -46216,7 +47900,7 @@ ${usage_default}`;
|
|
|
46216
47900
|
for (const fiber of currentFibers())
|
|
46217
47901
|
for (const hook2 of hooks(fiber)) {
|
|
46218
47902
|
const [subscriber2, deps] = Array.isArray(hook2.memoizedState) ? hook2.memoizedState : [];
|
|
46219
|
-
if (!
|
|
47903
|
+
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
47904
|
continue;
|
|
46221
47905
|
const atom2 = deps[1];
|
|
46222
47906
|
if (availability(store, atom2, voice, gate) === true)
|
|
@@ -46229,7 +47913,7 @@ ${usage_default}`;
|
|
|
46229
47913
|
const instance = hook.next?.queue;
|
|
46230
47914
|
const effect = hook.next?.next?.memoizedState;
|
|
46231
47915
|
const native = store.get(atom);
|
|
46232
|
-
if (!instance || typeof instance.getSnapshot !== "function" || !
|
|
47916
|
+
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
47917
|
throw new Error("Unsupported Settings availability subscription");
|
|
46234
47918
|
for (const [object3, key] of [
|
|
46235
47919
|
[store, "sub"],
|
|
@@ -46288,7 +47972,7 @@ ${usage_default}`;
|
|
|
46288
47972
|
}
|
|
46289
47973
|
|
|
46290
47974
|
// src/renderer-dictation-settings.ts
|
|
46291
|
-
var
|
|
47975
|
+
var record13 = (value) => value !== null && typeof value === "object";
|
|
46292
47976
|
var mode = (value) => value === null || value === "os-global" || value === "app";
|
|
46293
47977
|
function replayDictationSettingsMode(store, atom, capabilities, gate) {
|
|
46294
47978
|
try {
|
|
@@ -46331,7 +48015,7 @@ ${usage_default}`;
|
|
|
46331
48015
|
function bindDictationSettingsMode(currentFibers, store, atom, capabilities, gate, allowed) {
|
|
46332
48016
|
const readers = () => [...currentFibers()].flatMap(hooks).filter((hook) => {
|
|
46333
48017
|
const [subscriber, deps] = Array.isArray(hook.memoizedState) ? hook.memoizedState : [];
|
|
46334
|
-
return
|
|
48018
|
+
return record13(subscriber) && typeof subscriber.getSnapshot === "function" && Array.isArray(deps) && deps.length === 2 && deps[0] === store && deps[1] === atom;
|
|
46335
48019
|
});
|
|
46336
48020
|
const subscriptions = readers();
|
|
46337
48021
|
if (!subscriptions.length || replayDictationSettingsMode(store, atom, capabilities, gate) === void 0)
|
|
@@ -46344,7 +48028,7 @@ ${usage_default}`;
|
|
|
46344
48028
|
const instance = hook.next?.queue;
|
|
46345
48029
|
const effect = hook.next?.next?.memoizedState;
|
|
46346
48030
|
const native = store.get(atom);
|
|
46347
|
-
if (!instance || typeof instance.getSnapshot !== "function" || !
|
|
48031
|
+
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
48032
|
throw new Error("Unsupported Settings dictation mode subscription");
|
|
46349
48033
|
for (const [object3, key] of [
|
|
46350
48034
|
[store, "sub"],
|
|
@@ -46416,8 +48100,8 @@ ${usage_default}`;
|
|
|
46416
48100
|
var MESSAGE_ID = "settings.general.realtimeVoice.unavailable.description";
|
|
46417
48101
|
var LABEL = "Voice settings unavailable with this provider";
|
|
46418
48102
|
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) =>
|
|
48103
|
+
var record14 = (value) => value !== null && typeof value === "object";
|
|
48104
|
+
var settled = (value, isCapable) => record14(value) && value.isLoading === false && value.isError === false && value.isCapable === isCapable;
|
|
46421
48105
|
function realtimeAtoms(scope, modules) {
|
|
46422
48106
|
const atom = modules.capability.resolve(scope.node, scope.chain, { name: "voice.realtime" }).resolve(scope.node, scope.chain);
|
|
46423
48107
|
return {
|
|
@@ -46428,7 +48112,7 @@ ${usage_default}`;
|
|
|
46428
48112
|
function providerBlocksVoiceSettings(scope, modules) {
|
|
46429
48113
|
try {
|
|
46430
48114
|
const access = scope.get(modules.access);
|
|
46431
|
-
if (!
|
|
48115
|
+
if (!record14(access) || access.status !== "allowed" || !settled(scope.get(modules.capability, { name: "voice" }), true) || !settled(scope.get(modules.capability, { name: "voice.realtime" }), false))
|
|
46432
48116
|
return false;
|
|
46433
48117
|
const { atom, gate } = realtimeAtoms(scope, modules);
|
|
46434
48118
|
return replayVoiceCapability(scope.node.store, atom, gate)?.isCapable === true;
|
|
@@ -46441,19 +48125,19 @@ ${usage_default}`;
|
|
|
46441
48125
|
for (const element of doc.querySelectorAll("section div")) {
|
|
46442
48126
|
if (element.childNodes.length !== 1 || element.firstChild?.nodeType !== 3) continue;
|
|
46443
48127
|
const key = Object.getOwnPropertyNames(element).find((key2) => key2.startsWith("__reactFiber$"));
|
|
46444
|
-
const
|
|
48128
|
+
const ancestors2 = committedReactAncestors(
|
|
46445
48129
|
key && Object.getOwnPropertyDescriptor(element, key)?.value
|
|
46446
48130
|
);
|
|
46447
|
-
if (!
|
|
46448
|
-
const owner =
|
|
46449
|
-
({ memoizedProps: props2 }) =>
|
|
48131
|
+
if (!ancestors2.some((fiber) => fiber.type === modules.page)) continue;
|
|
48132
|
+
const owner = ancestors2.find(
|
|
48133
|
+
({ memoizedProps: props2 }) => record14(props2) && record14(props2.description) && record14(props2.description.props) && props2.description.props.id === MESSAGE_ID && props2.control === null
|
|
46450
48134
|
);
|
|
46451
48135
|
const props = owner?.memoizedProps;
|
|
46452
|
-
if (!
|
|
48136
|
+
if (!record14(props) || !record14(props.description) || !record14(props.description.props) || !record14(props.label) || !record14(props.label.props) || element.textContent !== props.description.props.defaultMessage)
|
|
46453
48137
|
continue;
|
|
46454
48138
|
const labelText = props.label.props.defaultMessage;
|
|
46455
48139
|
if (typeof labelText !== "string") continue;
|
|
46456
|
-
const row =
|
|
48140
|
+
const row = ancestors2.find((fiber) => {
|
|
46457
48141
|
const host2 = fiber.stateNode;
|
|
46458
48142
|
return fiber.tag === 5 && host2 !== element && typeof host2?.contains === "function" && host2.contains(element) && host2.textContent?.includes(labelText);
|
|
46459
48143
|
});
|
|
@@ -46463,13 +48147,13 @@ ${usage_default}`;
|
|
|
46463
48147
|
) : [];
|
|
46464
48148
|
if (labels.length !== 1) continue;
|
|
46465
48149
|
const scopes = /* @__PURE__ */ new Map();
|
|
46466
|
-
for (const fiber of
|
|
48150
|
+
for (const fiber of ancestors2) {
|
|
46467
48151
|
let hook = fiber.memoizedState;
|
|
46468
48152
|
const seen = /* @__PURE__ */ new Set();
|
|
46469
|
-
while (
|
|
48153
|
+
while (record14(hook) && seen.size < 4096 && !seen.has(hook)) {
|
|
46470
48154
|
seen.add(hook);
|
|
46471
|
-
const scope2 =
|
|
46472
|
-
if (
|
|
48155
|
+
const scope2 = record14(hook.memoizedState) ? hook.memoizedState.current : void 0;
|
|
48156
|
+
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
48157
|
scopes.set(scope2.node, scope2);
|
|
46474
48158
|
hook = hook.next;
|
|
46475
48159
|
}
|
|
@@ -46680,6 +48364,7 @@ lucide/dist/esm/icons/message-circle-question-mark.mjs:
|
|
|
46680
48364
|
lucide/dist/esm/icons/pencil.mjs:
|
|
46681
48365
|
lucide/dist/esm/icons/x.mjs:
|
|
46682
48366
|
lucide/dist/esm/icons/boxes.mjs:
|
|
48367
|
+
lucide/dist/esm/icons/calendar-clock.mjs:
|
|
46683
48368
|
lucide/dist/esm/icons/circle-check.mjs:
|
|
46684
48369
|
lucide/dist/esm/icons/chevron-down.mjs:
|
|
46685
48370
|
lucide/dist/esm/icons/chevron-left.mjs:
|