@karlorz/codexhost-cli-win32-x64 0.16.1-2 → 0.16.1-3
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 +31 -0
- package/app/console-web.js +31 -0
- package/app/cpa-live-voice-hook.js +31 -0
- package/app/desktop-controller.mjs +31 -0
- package/app/host-runtime.mjs +175 -49
- package/app/plugins/antigravity/plugin.mjs +31 -0
- package/app/plugins/claude-code/plugin.mjs +31 -0
- package/app/plugins/codebuddy/plugin.mjs +31 -0
- package/app/plugins/codex-usage/plugin.mjs +31 -0
- package/app/plugins/copilot/plugin.mjs +31 -0
- package/app/plugins/cursor-cli/plugin.mjs +31 -0
- package/app/plugins/deepseek-harness/plugin.mjs +31 -0
- package/app/plugins/grok/plugin.mjs +1155 -121
- package/app/plugins/hermes/plugin.mjs +31 -0
- package/app/plugins/kimi-code/plugin.mjs +31 -0
- package/app/plugins/kiro-cli/plugin.mjs +31 -0
- package/app/plugins/omp/plugin.mjs +31 -0
- package/app/plugins/opencode/plugin.mjs +31 -0
- package/app/plugins/pi/plugin.mjs +31 -0
- package/app/plugins/qoder/plugin.mjs +31 -0
- package/app/plugins/qoder-cn/plugin.mjs +31 -0
- package/app/plugins/workbuddy/plugin.mjs +31 -0
- package/app/plugins/zcode/plugin.mjs +31 -0
- package/app/renderer-extension.js +753 -169
- 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
|
@@ -16277,6 +16277,40 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16277
16277
|
})
|
|
16278
16278
|
});
|
|
16279
16279
|
|
|
16280
|
+
// ../shared-contracts/dist/background-activity.js
|
|
16281
|
+
var THREAD_ACTIVITY_LIST_METHOD = "codexhost/thread/activity/list";
|
|
16282
|
+
var THREAD_ACTIVITY_READ_METHOD = "codexhost/thread/activity/read";
|
|
16283
|
+
var THREAD_ACTIVITY_STOP_METHOD = "codexhost/thread/activity/stop";
|
|
16284
|
+
var backgroundActivitySchema = external_exports.strictObject({
|
|
16285
|
+
id: external_exports.string().min(1),
|
|
16286
|
+
kind: external_exports.enum(["task", "monitor", "loop", "subagent"]),
|
|
16287
|
+
label: external_exports.string(),
|
|
16288
|
+
status: external_exports.enum(["running", "scheduled", "completed", "failed", "cancelled", "unknown"]),
|
|
16289
|
+
canStop: external_exports.boolean(),
|
|
16290
|
+
/** Existing detached command Item presented by Desktop's native process UI. */
|
|
16291
|
+
commandItemId: hostItemIdSchema.optional(),
|
|
16292
|
+
schedule: external_exports.string().optional(),
|
|
16293
|
+
nextRunAt: external_exports.string().datetime({ offset: true }).optional(),
|
|
16294
|
+
relatedActivityId: external_exports.string().optional(),
|
|
16295
|
+
threadId: hostThreadIdSchema.optional()
|
|
16296
|
+
});
|
|
16297
|
+
var backgroundActivityDetailSchema = external_exports.strictObject({
|
|
16298
|
+
activity: backgroundActivitySchema,
|
|
16299
|
+
output: external_exports.string(),
|
|
16300
|
+
truncated: external_exports.boolean()
|
|
16301
|
+
});
|
|
16302
|
+
var threadActivityParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
|
|
16303
|
+
var threadActivityItemParamsSchema = threadActivityParamsSchema.extend({
|
|
16304
|
+
activityId: external_exports.string().min(1)
|
|
16305
|
+
});
|
|
16306
|
+
var threadActivityListResultSchema = external_exports.strictObject({
|
|
16307
|
+
supported: external_exports.boolean(),
|
|
16308
|
+
activities: external_exports.array(backgroundActivitySchema)
|
|
16309
|
+
});
|
|
16310
|
+
var threadActivityStopResultSchema = external_exports.strictObject({
|
|
16311
|
+
outcome: external_exports.enum(["stopped", "alreadyStopped", "notFound"])
|
|
16312
|
+
});
|
|
16313
|
+
|
|
16280
16314
|
// ../shared-contracts/dist/index.js
|
|
16281
16315
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
16282
16316
|
|
|
@@ -16526,17 +16560,26 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16526
16560
|
}
|
|
16527
16561
|
|
|
16528
16562
|
// src/renderer-native-chat-voice-assets.ts
|
|
16529
|
-
var NATIVE_CHAT_VOICE_VERSION = "26.
|
|
16530
|
-
var NATIVE_CHAT_INITIAL_ASSET = "app-initial-
|
|
16531
|
-
var START_ASSET = "start-voice-
|
|
16563
|
+
var NATIVE_CHAT_VOICE_VERSION = "26.1027.30824";
|
|
16564
|
+
var NATIVE_CHAT_INITIAL_ASSET = "app-initial-60f141238751.js";
|
|
16565
|
+
var START_ASSET = "start-voice-4c77215aa289.js";
|
|
16532
16566
|
var NATIVE_CHAT_VOICE_ASSETS = [
|
|
16533
16567
|
{
|
|
16534
16568
|
platform: "darwin",
|
|
16535
16569
|
version: NATIVE_CHAT_VOICE_VERSION,
|
|
16536
16570
|
initial: NATIVE_CHAT_INITIAL_ASSET,
|
|
16571
|
+
shared: "app-shared-7815d5a1a42a.js",
|
|
16572
|
+
primary: "app-primary-95a0e6d83f1e.js",
|
|
16573
|
+
start: START_ASSET,
|
|
16574
|
+
prewarm: "voice-prewarm-e49220ad61bd.js"
|
|
16575
|
+
},
|
|
16576
|
+
{
|
|
16577
|
+
platform: "darwin",
|
|
16578
|
+
version: "26.1023.51421",
|
|
16579
|
+
initial: "app-initial-bc8256c3cccb.js",
|
|
16537
16580
|
shared: "app-shared-e9f258fd3588.js",
|
|
16538
16581
|
primary: "app-primary-b7f335b763ca.js",
|
|
16539
|
-
start:
|
|
16582
|
+
start: "start-voice-a0564cefdc95.js",
|
|
16540
16583
|
prewarm: "voice-prewarm-53aefded152c.js",
|
|
16541
16584
|
settings: "voice-settings-1a9f68eb7ae8.js"
|
|
16542
16585
|
},
|
|
@@ -16584,15 +16627,28 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16584
16627
|
)
|
|
16585
16628
|
);
|
|
16586
16629
|
if (!sharedModule || !initialModule || !startModule || !prewarm) throw new Error();
|
|
16587
|
-
const
|
|
16630
|
+
const newest = assets.version === NATIVE_CHAT_VOICE_VERSION;
|
|
16631
|
+
const latest = newest || assets.version === "26.1023.51421";
|
|
16588
16632
|
const current = latest || assets.version === "26.1021.31345";
|
|
16589
|
-
const initialize = latest ? primary?.gm : current ? primary?.um : initialModule.oT;
|
|
16633
|
+
const initialize = newest ? primary?.Yp : latest ? primary?.gm : current ? primary?.um : initialModule.oT;
|
|
16590
16634
|
const start = current && !latest ? { t: startModule.r, n: startModule.i } : startModule;
|
|
16591
|
-
if (typeof start.t !== "function" || typeof start.n !== "function" || typeof initialize !== "function" || typeof (latest ? initialModule["s$t"] : current ? initialModule.qXt : initialModule.SPn) !== "function" || typeof (latest ? sharedModule.OHt : current ? sharedModule.XVt : sharedModule.FBt) !== "function" || typeof (latest ? sharedModule.wPt : current ? sharedModule.KNt : sharedModule.PNt) !== "function" || typeof prewarm.VoiceInstantConnectCacheController !== "function")
|
|
16635
|
+
if (typeof start.t !== "function" || typeof start.n !== "function" || typeof initialize !== "function" || typeof (newest ? initialModule.Xen : latest ? initialModule["s$t"] : current ? initialModule.qXt : initialModule.SPn) !== "function" || typeof (newest ? sharedModule.pWt : latest ? sharedModule.OHt : current ? sharedModule.XVt : sharedModule.FBt) !== "function" || typeof (newest ? sharedModule.GFt : latest ? sharedModule.wPt : current ? sharedModule.KNt : sharedModule.PNt) !== "function" || typeof prewarm.VoiceInstantConnectCacheController !== "function")
|
|
16592
16636
|
throw new Error();
|
|
16593
16637
|
initialize();
|
|
16594
16638
|
start.t();
|
|
16595
|
-
const initial =
|
|
16639
|
+
const initial = newest ? {
|
|
16640
|
+
MOr: initialModule.l5n,
|
|
16641
|
+
CDr: initialModule.b6n,
|
|
16642
|
+
B1n: initialModule.pOn,
|
|
16643
|
+
SPn: initialModule.Xen,
|
|
16644
|
+
oT: primary?.Yp,
|
|
16645
|
+
aT: primary?.Jp,
|
|
16646
|
+
Ycr: initialModule.nfr,
|
|
16647
|
+
Nir: initialModule.hEn,
|
|
16648
|
+
n0n: initialModule.jOn,
|
|
16649
|
+
Y1n: initialModule.wOn,
|
|
16650
|
+
HJt: initialModule.J6
|
|
16651
|
+
} : latest ? {
|
|
16596
16652
|
MOr: initialModule.x1n,
|
|
16597
16653
|
CDr: initialModule.MQn,
|
|
16598
16654
|
B1n: initialModule.Opn,
|
|
@@ -16617,7 +16673,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16617
16673
|
Y1n: initialModule.fdn,
|
|
16618
16674
|
HJt: initialModule.R2
|
|
16619
16675
|
} : initialModule;
|
|
16620
|
-
const shared =
|
|
16676
|
+
const shared = newest ? { Qst: sharedModule.klt, FBt: sharedModule.pWt, PNt: sharedModule.GFt, Vot: sharedModule._ct } : latest ? {
|
|
16677
|
+
Qst: sharedModule.uct,
|
|
16678
|
+
FBt: sharedModule.OHt,
|
|
16679
|
+
PNt: sharedModule.wPt,
|
|
16680
|
+
Vot: sharedModule.ast
|
|
16681
|
+
} : current ? {
|
|
16621
16682
|
Qst: sharedModule.Bst,
|
|
16622
16683
|
FBt: sharedModule.XVt,
|
|
16623
16684
|
PNt: sharedModule.KNt,
|
|
@@ -16915,14 +16976,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16915
16976
|
|
|
16916
16977
|
// ../desktop-control/dist/renderer-host-discovery.js
|
|
16917
16978
|
function requestManagerFromHookState(value, hostId2) {
|
|
16918
|
-
const
|
|
16979
|
+
const record16 = (candidate) => typeof candidate === "object" && candidate !== null;
|
|
16919
16980
|
const manager = (candidate) => {
|
|
16920
|
-
if (!
|
|
16981
|
+
if (!record16(candidate) || !record16(candidate.requestClient) || !record16(candidate.prewarmedThreadManager))
|
|
16921
16982
|
return null;
|
|
16922
16983
|
const bridge = candidate.requestClient;
|
|
16923
16984
|
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
16985
|
};
|
|
16925
|
-
if (!
|
|
16986
|
+
if (!record16(value))
|
|
16926
16987
|
return null;
|
|
16927
16988
|
const direct = manager(value) ?? manager(value.manager);
|
|
16928
16989
|
if (direct)
|
|
@@ -16985,18 +17046,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16985
17046
|
|
|
16986
17047
|
// ../desktop-control/dist/renderer-host-rpc-discovery.js
|
|
16987
17048
|
function findRendererHostRpcFamily(store) {
|
|
16988
|
-
const
|
|
17049
|
+
const record16 = (value) => typeof value === "object" && value !== null;
|
|
16989
17050
|
const families = /* @__PURE__ */ new Set();
|
|
16990
17051
|
for (const [definition, members] of store.familyBindings) {
|
|
16991
|
-
if (!
|
|
17052
|
+
if (!record16(definition) || definition.kind !== "signal-family")
|
|
16992
17053
|
continue;
|
|
16993
|
-
if (!
|
|
17054
|
+
if (!record16(members) || typeof members.get !== "function")
|
|
16994
17055
|
continue;
|
|
16995
17056
|
for (const [hostId2, member] of members) {
|
|
16996
|
-
if (typeof hostId2 !== "string" || !
|
|
17057
|
+
if (typeof hostId2 !== "string" || !record16(member))
|
|
16997
17058
|
continue;
|
|
16998
17059
|
const signal = member.value;
|
|
16999
|
-
if (!
|
|
17060
|
+
if (!record16(signal) || typeof signal.get !== "function")
|
|
17000
17061
|
continue;
|
|
17001
17062
|
let value;
|
|
17002
17063
|
try {
|
|
@@ -17004,7 +17065,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17004
17065
|
} catch {
|
|
17005
17066
|
continue;
|
|
17006
17067
|
}
|
|
17007
|
-
if (
|
|
17068
|
+
if (record16(value) && Object.keys(value).length === 2 && typeof value.status === "string" && record16(value.client) && value.client.hostId === hostId2 && "rpc" in value.client) {
|
|
17008
17069
|
families.add(members);
|
|
17009
17070
|
break;
|
|
17010
17071
|
}
|
|
@@ -17015,9 +17076,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17015
17076
|
return { store, family: families.values().next().value };
|
|
17016
17077
|
}
|
|
17017
17078
|
function resolveRendererHostRpc(discovery, hostId2) {
|
|
17018
|
-
const
|
|
17079
|
+
const record16 = (value2) => typeof value2 === "object" && value2 !== null;
|
|
17019
17080
|
const signal = discovery.family.get(hostId2)?.value;
|
|
17020
|
-
if (!
|
|
17081
|
+
if (!record16(signal) || typeof signal.get !== "function")
|
|
17021
17082
|
return null;
|
|
17022
17083
|
let value;
|
|
17023
17084
|
try {
|
|
@@ -17025,10 +17086,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17025
17086
|
} catch {
|
|
17026
17087
|
return null;
|
|
17027
17088
|
}
|
|
17028
|
-
if (!
|
|
17089
|
+
if (!record16(value) || value.status !== "ready" || !record16(value.client) || value.client.hostId !== hostId2)
|
|
17029
17090
|
return null;
|
|
17030
17091
|
const rpc = value.client.rpc;
|
|
17031
|
-
return typeof rpc === "function" ||
|
|
17092
|
+
return typeof rpc === "function" || record16(rpc) ? rpc : null;
|
|
17032
17093
|
}
|
|
17033
17094
|
|
|
17034
17095
|
// ../desktop-control/dist/renderer-schedule-workspace-rpc.js
|
|
@@ -18293,11 +18354,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18293
18354
|
function visibleWorkComposer(owner) {
|
|
18294
18355
|
const document2 = owner.document;
|
|
18295
18356
|
if (!document2?.querySelectorAll) return false;
|
|
18296
|
-
const
|
|
18357
|
+
const visible2 = (element) => {
|
|
18297
18358
|
const box = element.getBoundingClientRect?.() ?? { width: 0 };
|
|
18298
18359
|
return box.width > 0 && !element.closest?.("[hidden], [inert]");
|
|
18299
18360
|
};
|
|
18300
|
-
return [...document2.querySelectorAll("[data-codex-composer-root]")].some(
|
|
18361
|
+
return [...document2.querySelectorAll("[data-codex-composer-root]")].some(visible2) && ![...document2.querySelectorAll("[data-chatgpt-composer]")].some(visible2);
|
|
18301
18362
|
}
|
|
18302
18363
|
function selectedWorkTab(owner) {
|
|
18303
18364
|
const document2 = owner.document;
|
|
@@ -18519,6 +18580,546 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18519
18580
|
return handle;
|
|
18520
18581
|
}
|
|
18521
18582
|
|
|
18583
|
+
// src/renderer-request-sender.ts
|
|
18584
|
+
var RendererMethodUnavailableError = class extends Error {
|
|
18585
|
+
constructor(method, cause) {
|
|
18586
|
+
super(`${method} is unsupported on this Host connection`, { cause });
|
|
18587
|
+
this.method = method;
|
|
18588
|
+
this.name = "RendererMethodUnavailableError";
|
|
18589
|
+
}
|
|
18590
|
+
method;
|
|
18591
|
+
code = -32601;
|
|
18592
|
+
};
|
|
18593
|
+
function isUnsupportedMethod(error51, method) {
|
|
18594
|
+
if (typeof error51 !== "object" || error51 === null) return false;
|
|
18595
|
+
const code = "code" in error51 ? error51.code : void 0;
|
|
18596
|
+
const message2 = "message" in error51 ? error51.message : void 0;
|
|
18597
|
+
return code === -32601 || code === -32600 && typeof message2 === "string" && message2.startsWith(`Invalid request: unknown variant \`${method}\``);
|
|
18598
|
+
}
|
|
18599
|
+
function createRendererRequestSender(send) {
|
|
18600
|
+
const unsupported = /* @__PURE__ */ new Map();
|
|
18601
|
+
return async (method, params, options) => {
|
|
18602
|
+
const known = unsupported.get(method);
|
|
18603
|
+
if (known) throw known;
|
|
18604
|
+
try {
|
|
18605
|
+
return await (options === void 0 ? send(method, params) : send(method, params, options));
|
|
18606
|
+
} catch (error51) {
|
|
18607
|
+
if (!method.startsWith("codexhost/") || !isUnsupportedMethod(error51, method)) throw error51;
|
|
18608
|
+
const unavailable = new RendererMethodUnavailableError(method, error51);
|
|
18609
|
+
unsupported.set(method, unavailable);
|
|
18610
|
+
throw unavailable;
|
|
18611
|
+
}
|
|
18612
|
+
};
|
|
18613
|
+
}
|
|
18614
|
+
|
|
18615
|
+
// src/renderer-activity-navigation.ts
|
|
18616
|
+
var record6 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
18617
|
+
function openRendererActivityChild(owner, child) {
|
|
18618
|
+
if (!owner.composer.isConnected || child.kind !== "subagent" || !child.threadId)
|
|
18619
|
+
throw Error("Native child conversation is unavailable");
|
|
18620
|
+
const callbacks = /* @__PURE__ */ new Set();
|
|
18621
|
+
const seen = /* @__PURE__ */ new Set();
|
|
18622
|
+
const anchors = [owner.composer, ...owner.composer.querySelectorAll("[contenteditable]")];
|
|
18623
|
+
for (const anchor of anchors) {
|
|
18624
|
+
const keys = Object.getOwnPropertyNames(anchor).filter(
|
|
18625
|
+
(key2) => key2.startsWith("__reactFiber$")
|
|
18626
|
+
);
|
|
18627
|
+
const key = keys[0];
|
|
18628
|
+
if (keys.length !== 1 || !key) continue;
|
|
18629
|
+
const first = Object.getOwnPropertyDescriptor(anchor, key)?.value;
|
|
18630
|
+
for (const fiber of committedReactAncestors(first)) {
|
|
18631
|
+
if (seen.has(fiber)) break;
|
|
18632
|
+
seen.add(fiber);
|
|
18633
|
+
const props = fiber.memoizedProps;
|
|
18634
|
+
if (!record6(props) || typeof props.onOpenBackgroundAgent !== "function") continue;
|
|
18635
|
+
if (typeof props.hostId !== "string" || typeof props.conversationId !== "string") continue;
|
|
18636
|
+
if (props.hostId !== owner.hostId || props.conversationId !== owner.threadId)
|
|
18637
|
+
throw Error("Native child navigation belongs to another chat or Host");
|
|
18638
|
+
callbacks.add(props.onOpenBackgroundAgent);
|
|
18639
|
+
}
|
|
18640
|
+
}
|
|
18641
|
+
const callback = callbacks.values().next().value;
|
|
18642
|
+
if (callbacks.size !== 1 || !callback)
|
|
18643
|
+
throw Error("Native child navigation is unavailable or ambiguous");
|
|
18644
|
+
callback({ conversationId: child.threadId, displayName: child.label, canInteract: false });
|
|
18645
|
+
}
|
|
18646
|
+
|
|
18647
|
+
// src/renderer-activity-detail.ts
|
|
18648
|
+
function appendActivityOutput(parent, detail, expanded, onExpanded) {
|
|
18649
|
+
const document2 = parent.ownerDocument;
|
|
18650
|
+
if (detail.activity.kind !== "loop") {
|
|
18651
|
+
const output = document2.createElement("pre");
|
|
18652
|
+
output.className = "activity-process-output";
|
|
18653
|
+
output.textContent = detail.output || "No native output available yet.";
|
|
18654
|
+
parent.append(output);
|
|
18655
|
+
return;
|
|
18656
|
+
}
|
|
18657
|
+
const prompt = detail.output || "No native prompt available yet.";
|
|
18658
|
+
const firstBreak = /\r\n|[\r\n]/.exec(prompt);
|
|
18659
|
+
const title = firstBreak ? prompt.slice(0, firstBreak.index) : prompt;
|
|
18660
|
+
const instructions = firstBreak ? prompt.slice(firstBreak.index + firstBreak[0].length) : "";
|
|
18661
|
+
const heading = document2.createElement("h4");
|
|
18662
|
+
heading.className = "activity-prompt-title text-sm font-medium";
|
|
18663
|
+
heading.textContent = title;
|
|
18664
|
+
parent.append(heading);
|
|
18665
|
+
if (!instructions) return;
|
|
18666
|
+
const disclosure = document2.createElement("details");
|
|
18667
|
+
disclosure.open = expanded;
|
|
18668
|
+
const summary = document2.createElement("summary");
|
|
18669
|
+
summary.className = "text-sm text-secondary";
|
|
18670
|
+
summary.textContent = "Schedule instructions";
|
|
18671
|
+
const body = document2.createElement("div");
|
|
18672
|
+
body.className = "activity-prompt-instructions text-sm";
|
|
18673
|
+
body.textContent = instructions;
|
|
18674
|
+
disclosure.append(summary, body);
|
|
18675
|
+
disclosure.addEventListener("toggle", () => {
|
|
18676
|
+
if (disclosure.isConnected) onExpanded(disclosure.open);
|
|
18677
|
+
});
|
|
18678
|
+
parent.append(disclosure);
|
|
18679
|
+
}
|
|
18680
|
+
|
|
18681
|
+
// src/renderer-activity-section.ts
|
|
18682
|
+
var PANEL = "[data-summary-panel-variant]";
|
|
18683
|
+
var OWNED = "[data-codexhost-background-activity]";
|
|
18684
|
+
function visible(window2, node) {
|
|
18685
|
+
if (!node.isConnected || node.getClientRects().length === 0) return false;
|
|
18686
|
+
for (let ancestor = node; ancestor; ancestor = ancestor.parentElement) {
|
|
18687
|
+
const style = window2.getComputedStyle(ancestor);
|
|
18688
|
+
if (ancestor.hidden || style.display === "none" || style.visibility === "hidden") return false;
|
|
18689
|
+
}
|
|
18690
|
+
return true;
|
|
18691
|
+
}
|
|
18692
|
+
function activitySectionTarget(window2, composer, previous) {
|
|
18693
|
+
const viewport = composer.closest("[data-app-shell-main-content-layout]");
|
|
18694
|
+
const workspace = viewport?.parentElement;
|
|
18695
|
+
if (!composer.isConnected) return { target: null, reason: "detached-composer" };
|
|
18696
|
+
if (!workspace) return { target: null, reason: "missing-workspace" };
|
|
18697
|
+
const roots = Array.from(workspace.querySelectorAll(PANEL)).filter(
|
|
18698
|
+
(node) => node.classList.contains("group/summary-panel") && visible(window2, node)
|
|
18699
|
+
);
|
|
18700
|
+
if (roots.length !== 1)
|
|
18701
|
+
return { target: null, reason: roots.length ? "ambiguous-panel" : "missing-panel" };
|
|
18702
|
+
const root = roots[0];
|
|
18703
|
+
if (!root) return { target: null, reason: "missing-panel" };
|
|
18704
|
+
const nativeSections = Array.from(root.querySelectorAll("section")).filter(
|
|
18705
|
+
(node) => {
|
|
18706
|
+
const parentSection = node.parentElement?.closest("section");
|
|
18707
|
+
return !node.closest(OWNED) && node.closest(PANEL) === root && node.classList.contains("flex") && node.classList.contains("flex-col") && (!parentSection || parentSection === root || !root.contains(parentSection));
|
|
18708
|
+
}
|
|
18709
|
+
);
|
|
18710
|
+
const containers = new Set(nativeSections.map((node) => node.parentElement));
|
|
18711
|
+
const target = nativeSections[0]?.parentElement;
|
|
18712
|
+
if (containers.size === 1 && target) return { target, reason: null };
|
|
18713
|
+
if (containers.size === 0 && previous?.isConnected && previous.closest(PANEL) === root)
|
|
18714
|
+
return { target: previous, reason: null };
|
|
18715
|
+
return { target: null, reason: containers.size ? "ambiguous-sections" : "missing-sections" };
|
|
18716
|
+
}
|
|
18717
|
+
var ACTIVITY_SECTION_CLASS = "relative z-0 flex flex-col pb-2 group-data-[summary-panel-variant=dynamic-isle]/summary-panel:py-2";
|
|
18718
|
+
var ACTIVITY_SECTION_CONTENT_CLASS = "flex flex-col gap-0.5 px-5 group-data-[summary-panel-variant=dynamic-isle]/summary-panel:gap-0 group-data-[summary-panel-variant=dynamic-isle]/summary-panel:px-4 group-data-[summary-panel-variant=dynamic-isle]/summary-panel:group-data-[summary-panel-density=comfortable]/summary-panel:px-5";
|
|
18719
|
+
var ACTIVITY_SECTION_HEADING_CLASS = "activity-heading sticky top-2 z-10 flex h-7 w-full min-w-0 items-center justify-start gap-2 pb-0.5 text-sm font-normal text-secondary bg-surface-elevated-secondary before:bg-surface-elevated-secondary before:pointer-events-none before:absolute before:inset-x-0 before:-top-2 before:h-2 before:content-[''] ps-5 pe-3.5 group-data-[summary-panel-variant=dynamic-isle]/summary-panel:h-6 group-data-[summary-panel-variant=dynamic-isle]/summary-panel:group-data-[summary-panel-density=comfortable]/summary-panel:h-7 group-data-[summary-panel-variant=dynamic-isle]/summary-panel:pb-0 group-data-[summary-panel-variant=dynamic-isle]/summary-panel:text-dynamic-isle-row group-data-[summary-panel-variant=dynamic-isle]/summary-panel:ps-4 group-data-[summary-panel-variant=dynamic-isle]/summary-panel:group-data-[summary-panel-density=comfortable]/summary-panel:ps-5";
|
|
18720
|
+
var ACTIVITY_SECTION_TOGGLE_CLASS = "group/section-toggle -ms-[3.5px] inline-flex min-w-0 flex-1 cursor-interaction items-center gap-1 rounded-xl py-0.5 ps-[3.5px] pe-1 text-start focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring";
|
|
18721
|
+
var ACTIVITY_SECTION_LABEL_CLASS = "activity-title min-w-0 flex-1 text-sm group-data-[summary-panel-variant=dynamic-isle]/summary-panel:text-dynamic-isle-row";
|
|
18722
|
+
|
|
18723
|
+
// src/renderer-background-activity.ts
|
|
18724
|
+
function activityCountdown(nextRunAt, now = Date.now()) {
|
|
18725
|
+
if (!nextRunAt) return "";
|
|
18726
|
+
const seconds = Math.ceil((Date.parse(nextRunAt) - now) / 1e3);
|
|
18727
|
+
if (!Number.isFinite(seconds)) return "";
|
|
18728
|
+
if (seconds <= 0) return "Waiting for Harness";
|
|
18729
|
+
return "Next in " + Math.floor(seconds / 60) + ":" + String(seconds % 60).padStart(2, "0");
|
|
18730
|
+
}
|
|
18731
|
+
function activitySummaryLabel(activity) {
|
|
18732
|
+
const firstLine = activity.label.trim().split(/[\r\n]/, 1)[0]?.replace(/\s+/g, " ") ?? "";
|
|
18733
|
+
if (!firstLine) return activity.kind === "loop" ? "Loop schedule" : "Background process";
|
|
18734
|
+
const characters = Array.from(firstLine);
|
|
18735
|
+
return characters.length > 72 ? characters.slice(0, 71).join("") + "\u2026" : firstLine;
|
|
18736
|
+
}
|
|
18737
|
+
function supplementalBackgroundActivities(activities) {
|
|
18738
|
+
const rows = activities.filter(
|
|
18739
|
+
(item) => item.kind === "loop" || item.kind !== "subagent" && !item.commandItemId
|
|
18740
|
+
);
|
|
18741
|
+
return rows.some((item) => !["completed", "failed", "cancelled"].includes(item.status)) ? rows : [];
|
|
18742
|
+
}
|
|
18743
|
+
function same(a, b) {
|
|
18744
|
+
return a?.hostId === b?.hostId && a?.threadId === b?.threadId && a?.composer === b?.composer && a?.route === b?.route;
|
|
18745
|
+
}
|
|
18746
|
+
var CSS2 = [
|
|
18747
|
+
"[data-codexhost-background-activity]{font:inherit;color:var(--color-text-primary,inherit);min-width:0}",
|
|
18748
|
+
"[data-codexhost-background-activity] button{font:inherit;color:inherit;cursor:pointer;background:transparent;border:0;text-align:left}",
|
|
18749
|
+
"[data-codexhost-background-activity] button:disabled{opacity:.6;cursor:wait}",
|
|
18750
|
+
"[data-codexhost-background-activity] button:focus-visible{outline:2px solid var(--color-ring,#779cff);outline-offset:2px}",
|
|
18751
|
+
"[data-codexhost-background-activity] [hidden]{display:none}",
|
|
18752
|
+
"[data-codexhost-background-activity] .activity-heading{margin:0}",
|
|
18753
|
+
"[data-codexhost-background-activity] .activity-disclosure{flex-shrink:0;transition:transform .15s}",
|
|
18754
|
+
"[data-codexhost-background-activity] button[aria-expanded=true]>.activity-disclosure{opacity:0}",
|
|
18755
|
+
"[data-codexhost-background-activity] button:hover>.activity-disclosure,[data-codexhost-background-activity] button:focus-visible>.activity-disclosure{opacity:1}",
|
|
18756
|
+
"[data-codexhost-background-activity] .activity-row{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0;padding:7px 0}",
|
|
18757
|
+
"[data-codexhost-background-activity] .activity-title{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
18758
|
+
"[data-codexhost-background-activity] .activity-meta{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
18759
|
+
"[data-codexhost-background-activity] .activity-detail{padding:4px 0 10px;min-width:0}",
|
|
18760
|
+
"[data-codexhost-background-activity] .activity-prompt-title{margin:0 0 6px;overflow-wrap:anywhere}",
|
|
18761
|
+
"[data-codexhost-background-activity] summary{cursor:pointer;padding:4px 0}",
|
|
18762
|
+
"[data-codexhost-background-activity] .activity-prompt-instructions{white-space:pre-wrap;overflow-wrap:anywhere;max-height:40vh;overflow:auto;padding:6px 0}",
|
|
18763
|
+
"[data-codexhost-background-activity] pre{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;max-height:40vh;overflow:auto}",
|
|
18764
|
+
"[data-codexhost-background-activity] pre.activity-process-output{font:12px/1.5 ui-monospace,monospace}",
|
|
18765
|
+
"[data-codexhost-background-activity] .activity-action{padding:5px 0;text-decoration:underline;margin-right:12px}",
|
|
18766
|
+
"[data-codexhost-background-activity] .activity-error{font-size:12px;padding:0 20px;color:var(--color-text-danger,light-dark(#a32020,#ffaaa0))}"
|
|
18767
|
+
].join("\n");
|
|
18768
|
+
function installRendererBackgroundActivity(window2, readContext) {
|
|
18769
|
+
let context = null;
|
|
18770
|
+
let revision = 0;
|
|
18771
|
+
let disposed = false;
|
|
18772
|
+
let inFlight = null;
|
|
18773
|
+
let root = null;
|
|
18774
|
+
let container = null;
|
|
18775
|
+
let body = null;
|
|
18776
|
+
let errorNode = null;
|
|
18777
|
+
let activities = [];
|
|
18778
|
+
let allActivities = [];
|
|
18779
|
+
let selected = null;
|
|
18780
|
+
let expanded = true;
|
|
18781
|
+
let instructionsExpanded = false;
|
|
18782
|
+
let detail = null;
|
|
18783
|
+
let renderKey = "";
|
|
18784
|
+
let renderedOutput;
|
|
18785
|
+
let navigation = null;
|
|
18786
|
+
const unsupported = /* @__PURE__ */ new WeakSet();
|
|
18787
|
+
const valid = (owner, token) => !disposed && token === revision && same(owner, context) && same(owner, readContext());
|
|
18788
|
+
const message2 = (error51) => error51 instanceof Error ? error51.message : "Native activity is unavailable";
|
|
18789
|
+
const setError = (text) => {
|
|
18790
|
+
if (errorNode && errorNode.textContent !== text) errorNode.textContent = text;
|
|
18791
|
+
};
|
|
18792
|
+
const unmount = () => {
|
|
18793
|
+
root?.remove();
|
|
18794
|
+
root = null;
|
|
18795
|
+
body = null;
|
|
18796
|
+
errorNode = null;
|
|
18797
|
+
renderKey = "";
|
|
18798
|
+
renderedOutput = void 0;
|
|
18799
|
+
};
|
|
18800
|
+
const clear = () => {
|
|
18801
|
+
navigation?.abort();
|
|
18802
|
+
navigation = null;
|
|
18803
|
+
unmount();
|
|
18804
|
+
container = null;
|
|
18805
|
+
selected = null;
|
|
18806
|
+
expanded = true;
|
|
18807
|
+
instructionsExpanded = false;
|
|
18808
|
+
detail = null;
|
|
18809
|
+
activities = [];
|
|
18810
|
+
allActivities = [];
|
|
18811
|
+
};
|
|
18812
|
+
const button2 = (text, action, className) => {
|
|
18813
|
+
const node = window2.document.createElement("button");
|
|
18814
|
+
node.type = "button";
|
|
18815
|
+
node.className = className;
|
|
18816
|
+
node.textContent = text;
|
|
18817
|
+
node.addEventListener("click", action);
|
|
18818
|
+
return node;
|
|
18819
|
+
};
|
|
18820
|
+
const clocks = () => {
|
|
18821
|
+
for (const clock of root?.querySelectorAll("[data-next-run]") ?? []) {
|
|
18822
|
+
const text = activityCountdown(clock.dataset.nextRun);
|
|
18823
|
+
if (clock.textContent !== text) clock.textContent = text;
|
|
18824
|
+
}
|
|
18825
|
+
};
|
|
18826
|
+
const metadata = (parent, activity) => {
|
|
18827
|
+
const meta3 = window2.document.createElement("span");
|
|
18828
|
+
meta3.className = "activity-meta text-xs text-secondary";
|
|
18829
|
+
meta3.textContent = [
|
|
18830
|
+
activity.kind === "loop" ? "Schedule" : "Process",
|
|
18831
|
+
activity.status,
|
|
18832
|
+
activity.schedule
|
|
18833
|
+
].filter(Boolean).join(" \xB7 ");
|
|
18834
|
+
parent.append(meta3);
|
|
18835
|
+
if (activity.nextRunAt) {
|
|
18836
|
+
const clock = window2.document.createElement("span");
|
|
18837
|
+
clock.className = "activity-meta text-xs text-secondary";
|
|
18838
|
+
clock.dataset.nextRun = activity.nextRunAt;
|
|
18839
|
+
parent.append(clock);
|
|
18840
|
+
}
|
|
18841
|
+
};
|
|
18842
|
+
const openChild = async (owner, token, id) => {
|
|
18843
|
+
navigation?.abort();
|
|
18844
|
+
const request = new AbortController();
|
|
18845
|
+
navigation = request;
|
|
18846
|
+
let child = allActivities.find((item) => item.id === id);
|
|
18847
|
+
if (!child?.threadId) {
|
|
18848
|
+
let raw;
|
|
18849
|
+
try {
|
|
18850
|
+
raw = await owner.route.sendRequest(
|
|
18851
|
+
THREAD_ACTIVITY_READ_METHOD,
|
|
18852
|
+
{ threadId: owner.threadId, activityId: id },
|
|
18853
|
+
{ priority: "interactive", timeoutMs: 1e4 }
|
|
18854
|
+
);
|
|
18855
|
+
} catch (error51) {
|
|
18856
|
+
if (request.signal.aborted) return;
|
|
18857
|
+
throw error51;
|
|
18858
|
+
}
|
|
18859
|
+
if (!valid(owner, token) || request.signal.aborted) return;
|
|
18860
|
+
child = backgroundActivityDetailSchema.parse(raw).activity;
|
|
18861
|
+
}
|
|
18862
|
+
if (!valid(owner, token) || request.signal.aborted) return;
|
|
18863
|
+
if (child.kind !== "subagent" || !child.threadId)
|
|
18864
|
+
throw Error("Native child conversation is unavailable");
|
|
18865
|
+
openRendererActivityChild(owner, child);
|
|
18866
|
+
};
|
|
18867
|
+
const showDetail = async (id) => {
|
|
18868
|
+
const owner = context;
|
|
18869
|
+
if (!owner) return;
|
|
18870
|
+
const token = revision;
|
|
18871
|
+
selected = selected === id ? null : id;
|
|
18872
|
+
instructionsExpanded = false;
|
|
18873
|
+
detail = null;
|
|
18874
|
+
setError("");
|
|
18875
|
+
render();
|
|
18876
|
+
if (!selected) return;
|
|
18877
|
+
try {
|
|
18878
|
+
const raw = await owner.route.sendRequest(
|
|
18879
|
+
THREAD_ACTIVITY_READ_METHOD,
|
|
18880
|
+
{ threadId: owner.threadId, activityId: id },
|
|
18881
|
+
{ priority: "interactive", timeoutMs: 1e4 }
|
|
18882
|
+
);
|
|
18883
|
+
if (!valid(owner, token) || selected !== id) return;
|
|
18884
|
+
detail = backgroundActivityDetailSchema.parse(raw);
|
|
18885
|
+
render();
|
|
18886
|
+
} catch (error51) {
|
|
18887
|
+
if (valid(owner, token) && selected === id) setError(message2(error51));
|
|
18888
|
+
}
|
|
18889
|
+
};
|
|
18890
|
+
const render = () => {
|
|
18891
|
+
if (!body || !context) return;
|
|
18892
|
+
const key = JSON.stringify([
|
|
18893
|
+
activities,
|
|
18894
|
+
selected,
|
|
18895
|
+
detail && [detail.activity, detail.truncated]
|
|
18896
|
+
]);
|
|
18897
|
+
if (key === renderKey && detail?.output === renderedOutput) return;
|
|
18898
|
+
renderKey = key;
|
|
18899
|
+
renderedOutput = detail?.output;
|
|
18900
|
+
body.replaceChildren();
|
|
18901
|
+
for (const activity of activities) {
|
|
18902
|
+
const row = window2.document.createElement("div");
|
|
18903
|
+
const trigger = button2("", () => void showDetail(activity.id), "activity-row");
|
|
18904
|
+
const title = window2.document.createElement("span");
|
|
18905
|
+
title.className = ACTIVITY_SECTION_LABEL_CLASS;
|
|
18906
|
+
title.textContent = activitySummaryLabel(activity);
|
|
18907
|
+
trigger.append(title);
|
|
18908
|
+
trigger.setAttribute("aria-expanded", String(selected === activity.id));
|
|
18909
|
+
metadata(trigger, activity);
|
|
18910
|
+
row.append(trigger);
|
|
18911
|
+
body.append(row);
|
|
18912
|
+
if (selected !== activity.id) continue;
|
|
18913
|
+
const content = window2.document.createElement("div");
|
|
18914
|
+
content.className = "activity-detail";
|
|
18915
|
+
row.append(content);
|
|
18916
|
+
if (!detail) {
|
|
18917
|
+
content.textContent = "Loading native details\u2026";
|
|
18918
|
+
continue;
|
|
18919
|
+
}
|
|
18920
|
+
appendActivityOutput(content, detail, instructionsExpanded, (value) => {
|
|
18921
|
+
instructionsExpanded = value;
|
|
18922
|
+
});
|
|
18923
|
+
if (detail.truncated) {
|
|
18924
|
+
const note = window2.document.createElement("span");
|
|
18925
|
+
note.className = "activity-meta text-xs text-secondary";
|
|
18926
|
+
note.textContent = "Native output is truncated.";
|
|
18927
|
+
content.append(note);
|
|
18928
|
+
}
|
|
18929
|
+
const owner = context;
|
|
18930
|
+
const token = revision;
|
|
18931
|
+
if (activity.relatedActivityId) {
|
|
18932
|
+
const id = activity.relatedActivityId;
|
|
18933
|
+
const open = button2(
|
|
18934
|
+
"Open latest run",
|
|
18935
|
+
() => {
|
|
18936
|
+
if (!valid(owner, token)) return;
|
|
18937
|
+
open.disabled = true;
|
|
18938
|
+
setError("");
|
|
18939
|
+
void openChild(owner, token, id).catch((error51) => {
|
|
18940
|
+
if (valid(owner, token)) setError(message2(error51));
|
|
18941
|
+
}).finally(() => {
|
|
18942
|
+
if (valid(owner, token)) open.disabled = false;
|
|
18943
|
+
});
|
|
18944
|
+
},
|
|
18945
|
+
"activity-action"
|
|
18946
|
+
);
|
|
18947
|
+
content.append(open);
|
|
18948
|
+
}
|
|
18949
|
+
if (detail.activity.canStop) {
|
|
18950
|
+
const stop = button2(
|
|
18951
|
+
activity.kind === "loop" ? "Delete schedule" : "Stop task",
|
|
18952
|
+
() => {
|
|
18953
|
+
if (!valid(owner, token)) return;
|
|
18954
|
+
stop.disabled = true;
|
|
18955
|
+
void (async () => {
|
|
18956
|
+
try {
|
|
18957
|
+
const raw = await owner.route.sendRequest(
|
|
18958
|
+
THREAD_ACTIVITY_STOP_METHOD,
|
|
18959
|
+
{ threadId: owner.threadId, activityId: activity.id },
|
|
18960
|
+
{ priority: "interactive", timeoutMs: 1e4 }
|
|
18961
|
+
);
|
|
18962
|
+
if (!valid(owner, token)) return;
|
|
18963
|
+
const result = threadActivityStopResultSchema.parse(raw);
|
|
18964
|
+
setError(result.outcome === "notFound" ? "Native activity was not found." : "");
|
|
18965
|
+
await refresh();
|
|
18966
|
+
} catch (error51) {
|
|
18967
|
+
if (valid(owner, token)) setError(message2(error51));
|
|
18968
|
+
} finally {
|
|
18969
|
+
if (valid(owner, token)) stop.disabled = false;
|
|
18970
|
+
}
|
|
18971
|
+
})();
|
|
18972
|
+
},
|
|
18973
|
+
"activity-action"
|
|
18974
|
+
);
|
|
18975
|
+
content.append(stop);
|
|
18976
|
+
}
|
|
18977
|
+
}
|
|
18978
|
+
clocks();
|
|
18979
|
+
};
|
|
18980
|
+
const mount = (owner, target) => {
|
|
18981
|
+
root = window2.document.createElement("section");
|
|
18982
|
+
root.dataset.codexhostBackgroundActivity = owner.threadId;
|
|
18983
|
+
root.className = ACTIVITY_SECTION_CLASS;
|
|
18984
|
+
const style = window2.document.createElement("style");
|
|
18985
|
+
style.textContent = CSS2;
|
|
18986
|
+
const heading = window2.document.createElement("header");
|
|
18987
|
+
heading.className = ACTIVITY_SECTION_HEADING_CLASS;
|
|
18988
|
+
const toggle = button2(
|
|
18989
|
+
"",
|
|
18990
|
+
() => {
|
|
18991
|
+
expanded = !expanded;
|
|
18992
|
+
syncExpanded();
|
|
18993
|
+
},
|
|
18994
|
+
ACTIVITY_SECTION_TOGGLE_CLASS
|
|
18995
|
+
);
|
|
18996
|
+
const label = window2.document.createElement("span");
|
|
18997
|
+
label.className = "truncate";
|
|
18998
|
+
label.textContent = "Background activity";
|
|
18999
|
+
const disclosure = window2.document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
19000
|
+
disclosure.setAttribute("class", "activity-disclosure");
|
|
19001
|
+
disclosure.setAttribute("width", "12");
|
|
19002
|
+
disclosure.setAttribute("height", "12");
|
|
19003
|
+
disclosure.setAttribute("viewBox", "0 0 24 24");
|
|
19004
|
+
disclosure.setAttribute("aria-hidden", "true");
|
|
19005
|
+
const path = window2.document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
19006
|
+
path.setAttribute("d", "m9 5 7 7-7 7");
|
|
19007
|
+
path.setAttribute("fill", "none");
|
|
19008
|
+
path.setAttribute("stroke", "currentColor");
|
|
19009
|
+
path.setAttribute("stroke-width", "2");
|
|
19010
|
+
disclosure.append(path);
|
|
19011
|
+
toggle.append(label, disclosure);
|
|
19012
|
+
heading.append(toggle);
|
|
19013
|
+
errorNode = window2.document.createElement("div");
|
|
19014
|
+
errorNode.className = "activity-error";
|
|
19015
|
+
errorNode.setAttribute("role", "status");
|
|
19016
|
+
body = window2.document.createElement("div");
|
|
19017
|
+
body.className = ACTIVITY_SECTION_CONTENT_CLASS;
|
|
19018
|
+
const syncExpanded = () => {
|
|
19019
|
+
toggle.setAttribute("aria-expanded", String(expanded));
|
|
19020
|
+
disclosure.style.transform = expanded ? "rotate(90deg)" : "";
|
|
19021
|
+
if (body) body.hidden = !expanded;
|
|
19022
|
+
if (errorNode) errorNode.hidden = !expanded;
|
|
19023
|
+
};
|
|
19024
|
+
syncExpanded();
|
|
19025
|
+
root.append(style, heading, errorNode, body);
|
|
19026
|
+
root.addEventListener("click", (event) => event.stopPropagation());
|
|
19027
|
+
target.append(root);
|
|
19028
|
+
renderKey = "";
|
|
19029
|
+
};
|
|
19030
|
+
const syncTarget = (owner) => {
|
|
19031
|
+
const { target } = activitySectionTarget(window2, owner.composer, container);
|
|
19032
|
+
if (!target) {
|
|
19033
|
+
unmount();
|
|
19034
|
+
if (!container?.isConnected) container = null;
|
|
19035
|
+
return;
|
|
19036
|
+
}
|
|
19037
|
+
container = target;
|
|
19038
|
+
if (!activities.length) {
|
|
19039
|
+
unmount();
|
|
19040
|
+
return;
|
|
19041
|
+
}
|
|
19042
|
+
if (!root?.isConnected) mount(owner, target);
|
|
19043
|
+
else if (root.parentElement !== target) target.append(root);
|
|
19044
|
+
render();
|
|
19045
|
+
};
|
|
19046
|
+
const refresh = async () => {
|
|
19047
|
+
if (disposed) return;
|
|
19048
|
+
const next = readContext();
|
|
19049
|
+
if (!same(context, next)) {
|
|
19050
|
+
revision++;
|
|
19051
|
+
inFlight = null;
|
|
19052
|
+
clear();
|
|
19053
|
+
context = next;
|
|
19054
|
+
}
|
|
19055
|
+
const owner = context;
|
|
19056
|
+
if (!owner) return;
|
|
19057
|
+
if (inFlight || unsupported.has(owner.route)) return;
|
|
19058
|
+
const token = revision;
|
|
19059
|
+
const request = {};
|
|
19060
|
+
inFlight = request;
|
|
19061
|
+
try {
|
|
19062
|
+
const raw = await owner.route.sendRequest(
|
|
19063
|
+
THREAD_ACTIVITY_LIST_METHOD,
|
|
19064
|
+
{ threadId: owner.threadId },
|
|
19065
|
+
{ priority: "background", timeoutMs: 5e3 }
|
|
19066
|
+
);
|
|
19067
|
+
if (!valid(owner, token)) return;
|
|
19068
|
+
const result = threadActivityListResultSchema.parse(raw);
|
|
19069
|
+
if (!result.supported) {
|
|
19070
|
+
clear();
|
|
19071
|
+
return;
|
|
19072
|
+
}
|
|
19073
|
+
allActivities = result.activities;
|
|
19074
|
+
activities = supplementalBackgroundActivities(allActivities);
|
|
19075
|
+
if (selected && !activities.some((item) => item.id === selected)) {
|
|
19076
|
+
selected = null;
|
|
19077
|
+
instructionsExpanded = false;
|
|
19078
|
+
detail = null;
|
|
19079
|
+
}
|
|
19080
|
+
syncTarget(owner);
|
|
19081
|
+
if (selected) {
|
|
19082
|
+
const id = selected;
|
|
19083
|
+
const rawDetail = await owner.route.sendRequest(
|
|
19084
|
+
THREAD_ACTIVITY_READ_METHOD,
|
|
19085
|
+
{ threadId: owner.threadId, activityId: id },
|
|
19086
|
+
{ priority: "background", timeoutMs: 5e3 }
|
|
19087
|
+
);
|
|
19088
|
+
if (!valid(owner, token) || selected !== id) return;
|
|
19089
|
+
detail = backgroundActivityDetailSchema.parse(rawDetail);
|
|
19090
|
+
render();
|
|
19091
|
+
}
|
|
19092
|
+
} catch (error51) {
|
|
19093
|
+
if (!valid(owner, token)) return;
|
|
19094
|
+
if (isUnsupportedMethod(error51, THREAD_ACTIVITY_LIST_METHOD)) {
|
|
19095
|
+
unsupported.add(owner.route);
|
|
19096
|
+
clear();
|
|
19097
|
+
} else {
|
|
19098
|
+
syncTarget(owner);
|
|
19099
|
+
setError(message2(error51));
|
|
19100
|
+
}
|
|
19101
|
+
} finally {
|
|
19102
|
+
if (inFlight === request) inFlight = null;
|
|
19103
|
+
}
|
|
19104
|
+
};
|
|
19105
|
+
const timer = window2.setInterval(() => {
|
|
19106
|
+
clocks();
|
|
19107
|
+
void refresh();
|
|
19108
|
+
}, 1e3);
|
|
19109
|
+
void refresh();
|
|
19110
|
+
return {
|
|
19111
|
+
refreshContext() {
|
|
19112
|
+
if (!same(context, readContext()) || root && !root.isConnected) void refresh();
|
|
19113
|
+
},
|
|
19114
|
+
dispose() {
|
|
19115
|
+
disposed = true;
|
|
19116
|
+
revision++;
|
|
19117
|
+
window2.clearInterval(timer);
|
|
19118
|
+
clear();
|
|
19119
|
+
}
|
|
19120
|
+
};
|
|
19121
|
+
}
|
|
19122
|
+
|
|
18522
19123
|
// src/voice-settings-sync.ts
|
|
18523
19124
|
function desktopVoiceCallActive(owner) {
|
|
18524
19125
|
const hook = Reflect.get(owner, "__codexhostNativeChatVoiceV1");
|
|
@@ -18620,9 +19221,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18620
19221
|
}
|
|
18621
19222
|
|
|
18622
19223
|
// src/codex-ssh-services.ts
|
|
18623
|
-
var
|
|
19224
|
+
var record7 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
18624
19225
|
function isSshServices(value) {
|
|
18625
|
-
if (!
|
|
19226
|
+
if (!record7(value) || !Object.hasOwn(value, "sshConnections") || !Object.hasOwn(value, "remoteConnections"))
|
|
18626
19227
|
return false;
|
|
18627
19228
|
const ssh = value.sshConnections;
|
|
18628
19229
|
const remote = value.remoteConnections;
|
|
@@ -18633,7 +19234,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18633
19234
|
}
|
|
18634
19235
|
|
|
18635
19236
|
// src/codex-ssh-adapter.ts
|
|
18636
|
-
var
|
|
19237
|
+
var record8 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
18637
19238
|
function createCodexSshClient(ownerWindow) {
|
|
18638
19239
|
let nativeServices;
|
|
18639
19240
|
function services() {
|
|
@@ -18669,7 +19270,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18669
19270
|
const abort = () => finish(new DOMException("Aborted", "AbortError"));
|
|
18670
19271
|
const receive = (event) => {
|
|
18671
19272
|
const message2 = event.data;
|
|
18672
|
-
if (!
|
|
19273
|
+
if (!record8(message2) || message2.type !== "fetch-response" || message2.requestId !== requestId2)
|
|
18673
19274
|
return;
|
|
18674
19275
|
if (message2.responseType !== "success" || typeof message2.status !== "number" || message2.status < 200 || message2.status >= 300 || typeof message2.bodyJsonString !== "string") {
|
|
18675
19276
|
const detail = typeof message2.error === "string" ? `: ${message2.error}` : "";
|
|
@@ -18725,12 +19326,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18725
19326
|
}
|
|
18726
19327
|
async function list(signal) {
|
|
18727
19328
|
const result = await request("refresh-remote-connections", {}, signal);
|
|
18728
|
-
if (!
|
|
19329
|
+
if (!record8(result) || !Array.isArray(result.remoteConnections))
|
|
18729
19330
|
throw new Error("Invalid Codex SSH connection list");
|
|
18730
19331
|
return result.remoteConnections.filter(
|
|
18731
|
-
(item) => !(
|
|
19332
|
+
(item) => !(record8(item) && ["wsl", "remote-control"].includes(String(item.source)))
|
|
18732
19333
|
).map((item) => {
|
|
18733
|
-
if (!
|
|
19334
|
+
if (!record8(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)) {
|
|
18734
19335
|
throw new Error(
|
|
18735
19336
|
"This Codex version uses an unsupported SSH configuration; open native settings"
|
|
18736
19337
|
);
|
|
@@ -18802,11 +19403,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18802
19403
|
},
|
|
18803
19404
|
async state(hostId2, signal) {
|
|
18804
19405
|
const result = await request("app-server-connection-state", { hostId: hostId2 }, signal);
|
|
18805
|
-
if (!
|
|
19406
|
+
if (!record8(result) || typeof result.state !== "string")
|
|
18806
19407
|
throw new Error("Invalid Codex connection state");
|
|
18807
19408
|
return {
|
|
18808
19409
|
state: result.state,
|
|
18809
|
-
error: typeof result.error === "string" ? result.error :
|
|
19410
|
+
error: typeof result.error === "string" ? result.error : record8(result.error) && typeof result.error.message === "string" ? result.error.message : null
|
|
18810
19411
|
};
|
|
18811
19412
|
}
|
|
18812
19413
|
};
|
|
@@ -19370,40 +19971,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19370
19971
|
};
|
|
19371
19972
|
}
|
|
19372
19973
|
|
|
19373
|
-
// src/renderer-request-sender.ts
|
|
19374
|
-
var RendererMethodUnavailableError = class extends Error {
|
|
19375
|
-
constructor(method, cause) {
|
|
19376
|
-
super(`${method} is unsupported on this Host connection`, { cause });
|
|
19377
|
-
this.method = method;
|
|
19378
|
-
this.name = "RendererMethodUnavailableError";
|
|
19379
|
-
}
|
|
19380
|
-
method;
|
|
19381
|
-
code = -32601;
|
|
19382
|
-
};
|
|
19383
|
-
function isUnsupportedMethod(error51, method) {
|
|
19384
|
-
if (typeof error51 !== "object" || error51 === null) return false;
|
|
19385
|
-
const code = "code" in error51 ? error51.code : void 0;
|
|
19386
|
-
const message2 = "message" in error51 ? error51.message : void 0;
|
|
19387
|
-
return code === -32601 || code === -32600 && typeof message2 === "string" && message2.startsWith(`Invalid request: unknown variant \`${method}\``);
|
|
19388
|
-
}
|
|
19389
|
-
function createRendererRequestSender(send) {
|
|
19390
|
-
const unsupported = /* @__PURE__ */ new Map();
|
|
19391
|
-
return async (method, params, options) => {
|
|
19392
|
-
const known = unsupported.get(method);
|
|
19393
|
-
if (known) throw known;
|
|
19394
|
-
try {
|
|
19395
|
-
return await (options === void 0 ? send(method, params) : send(method, params, options));
|
|
19396
|
-
} catch (error51) {
|
|
19397
|
-
if (!method.startsWith("codexhost/") || !isUnsupportedMethod(error51, method)) throw error51;
|
|
19398
|
-
const unavailable = new RendererMethodUnavailableError(method, error51);
|
|
19399
|
-
unsupported.set(method, unavailable);
|
|
19400
|
-
throw unavailable;
|
|
19401
|
-
}
|
|
19402
|
-
};
|
|
19403
|
-
}
|
|
19404
|
-
|
|
19405
19974
|
// src/renderer-questions.ts
|
|
19406
|
-
function
|
|
19975
|
+
function same2(a, b) {
|
|
19407
19976
|
return a?.hostId === b?.hostId && a?.threadId === b?.threadId && a?.composer === b?.composer && a?.route === b?.route;
|
|
19408
19977
|
}
|
|
19409
19978
|
function installRendererQuestions(window2, readContext) {
|
|
@@ -19431,7 +20000,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19431
20000
|
const refresh = async () => {
|
|
19432
20001
|
if (disposed) return;
|
|
19433
20002
|
const next = readContext();
|
|
19434
|
-
if (!
|
|
20003
|
+
if (!same2(context, next)) {
|
|
19435
20004
|
clear();
|
|
19436
20005
|
context = next;
|
|
19437
20006
|
revision++;
|
|
@@ -19446,7 +20015,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19446
20015
|
{ threadId: current.threadId },
|
|
19447
20016
|
{ priority: "background", timeoutMs: 5e3 }
|
|
19448
20017
|
);
|
|
19449
|
-
if (disposed || revision !== startedRevision || !
|
|
20018
|
+
if (disposed || revision !== startedRevision || !same2(current, readContext())) return;
|
|
19450
20019
|
const question = threadQuestionsResultSchema.parse(raw).questions[0];
|
|
19451
20020
|
if (!question || !question.questions.some(
|
|
19452
20021
|
(field2) => field2.type === "choice" && (field2.multiple || field2.allowOther)
|
|
@@ -19471,7 +20040,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19471
20040
|
current.composer.ownerDocument,
|
|
19472
20041
|
question,
|
|
19473
20042
|
async (answers, cancelled) => {
|
|
19474
|
-
if (disposed || !
|
|
20043
|
+
if (disposed || !same2(current, readContext()) || cardKey !== key)
|
|
19475
20044
|
throw new Error("Question owner changed");
|
|
19476
20045
|
const raw2 = await current.route.sendRequest(
|
|
19477
20046
|
THREAD_QUESTION_RESPOND_METHOD,
|
|
@@ -19486,7 +20055,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19486
20055
|
);
|
|
19487
20056
|
threadQuestionRespondResultSchema.parse(raw2);
|
|
19488
20057
|
drafts.delete(key);
|
|
19489
|
-
if (
|
|
20058
|
+
if (same2(current, context)) {
|
|
19490
20059
|
revision++;
|
|
19491
20060
|
if (cardKey === key) clear(false);
|
|
19492
20061
|
}
|
|
@@ -19498,7 +20067,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19498
20067
|
stopActivity = installQuestionActivity(
|
|
19499
20068
|
window2,
|
|
19500
20069
|
card.root,
|
|
19501
|
-
() =>
|
|
20070
|
+
() => same2(current, readContext()) && card === mounted && mounted.autoResolution?.resetOnActivity === true,
|
|
19502
20071
|
async () => {
|
|
19503
20072
|
const raw2 = await current.route.sendRequest(
|
|
19504
20073
|
THREAD_QUESTION_ACTIVITY_METHOD,
|
|
@@ -19509,14 +20078,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19509
20078
|
},
|
|
19510
20079
|
{ priority: "background", timeoutMs: 4e3 }
|
|
19511
20080
|
);
|
|
19512
|
-
if (disposed || card !== mounted || !
|
|
20081
|
+
if (disposed || card !== mounted || !same2(current, readContext())) return;
|
|
19513
20082
|
const ack = threadQuestionActivityResultSchema.parse(raw2).autoResolution;
|
|
19514
20083
|
if (ack) mounted.updateAutoResolution(ack);
|
|
19515
20084
|
}
|
|
19516
20085
|
);
|
|
19517
20086
|
} catch (error51) {
|
|
19518
20087
|
if (isUnsupportedMethod(error51, THREAD_QUESTIONS_LIST_METHOD)) unsupported.add(current.route);
|
|
19519
|
-
if (revision === startedRevision &&
|
|
20088
|
+
if (revision === startedRevision && same2(current, context)) clear();
|
|
19520
20089
|
} finally {
|
|
19521
20090
|
inFlight = false;
|
|
19522
20091
|
}
|
|
@@ -19528,7 +20097,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19528
20097
|
return {
|
|
19529
20098
|
refresh,
|
|
19530
20099
|
refreshContext() {
|
|
19531
|
-
if (!
|
|
20100
|
+
if (!same2(context, readContext()) || card && !card.root.isConnected) void refresh();
|
|
19532
20101
|
},
|
|
19533
20102
|
dispose() {
|
|
19534
20103
|
disposed = true;
|
|
@@ -23181,12 +23750,12 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
23181
23750
|
const externalAgent = agent;
|
|
23182
23751
|
const showInstall = view.downloadVisible[externalAgent] === true;
|
|
23183
23752
|
const showError = view.errorVisible[externalAgent] === true;
|
|
23184
|
-
const
|
|
23753
|
+
const visible2 = showInstall || showError;
|
|
23185
23754
|
option.action.hidden = false;
|
|
23186
|
-
option.action.disabled = !
|
|
23755
|
+
option.action.disabled = !visible2;
|
|
23187
23756
|
option.action.style.display = "inline-flex";
|
|
23188
|
-
option.action.style.visibility =
|
|
23189
|
-
option.action.style.pointerEvents =
|
|
23757
|
+
option.action.style.visibility = visible2 ? "visible" : "hidden";
|
|
23758
|
+
option.action.style.pointerEvents = visible2 ? "auto" : "none";
|
|
23190
23759
|
if (showError) {
|
|
23191
23760
|
option.action.dataset.mode = "error";
|
|
23192
23761
|
option.action.textContent = "!";
|
|
@@ -23212,7 +23781,7 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
23212
23781
|
option.action.setAttribute("aria-label", label);
|
|
23213
23782
|
option.action.title = label;
|
|
23214
23783
|
}
|
|
23215
|
-
option.action.setAttribute("aria-hidden", String(!
|
|
23784
|
+
option.action.setAttribute("aria-hidden", String(!visible2));
|
|
23216
23785
|
}
|
|
23217
23786
|
}
|
|
23218
23787
|
return view;
|
|
@@ -23261,19 +23830,30 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
23261
23830
|
trigger.style.overflow = "hidden";
|
|
23262
23831
|
}
|
|
23263
23832
|
function observeRendererCompactComposer(composer) {
|
|
23833
|
+
let compact;
|
|
23834
|
+
let frame = null;
|
|
23264
23835
|
const update = () => {
|
|
23265
23836
|
const width = composer.getBoundingClientRect().width;
|
|
23266
|
-
if (width
|
|
23267
|
-
|
|
23268
|
-
|
|
23837
|
+
if (width <= 0) return;
|
|
23838
|
+
const next = width <= COMPACT_COMPOSER_WIDTH;
|
|
23839
|
+
if (next === compact) return;
|
|
23840
|
+
compact = next;
|
|
23841
|
+
composer.toggleAttribute(COMPACT_COMPOSER_ATTRIBUTE, next);
|
|
23269
23842
|
};
|
|
23270
23843
|
update();
|
|
23271
23844
|
if (typeof ResizeObserver === "undefined")
|
|
23272
23845
|
return () => composer.removeAttribute(COMPACT_COMPOSER_ATTRIBUTE);
|
|
23273
|
-
const observer = new ResizeObserver(
|
|
23846
|
+
const observer = new ResizeObserver(() => {
|
|
23847
|
+
if (frame !== null) return;
|
|
23848
|
+
frame = requestAnimationFrame(() => {
|
|
23849
|
+
frame = null;
|
|
23850
|
+
update();
|
|
23851
|
+
});
|
|
23852
|
+
});
|
|
23274
23853
|
observer.observe(composer, { box: "border-box" });
|
|
23275
23854
|
return () => {
|
|
23276
23855
|
observer.disconnect();
|
|
23856
|
+
if (frame !== null) cancelAnimationFrame(frame);
|
|
23277
23857
|
composer.removeAttribute(COMPACT_COMPOSER_ATTRIBUTE);
|
|
23278
23858
|
};
|
|
23279
23859
|
}
|
|
@@ -23819,9 +24399,9 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
23819
24399
|
const totalCostUsd = usage?.totalCostUsd;
|
|
23820
24400
|
const hasContext = usage?.contextUsedTokens !== void 0 && usage.contextWindowTokens !== void 0;
|
|
23821
24401
|
const hasTokenUsage = usage?.totalTokens !== void 0 || usage?.inputTokens !== void 0 || usage?.cachedInputTokens !== void 0 || usage?.cacheWriteInputTokens !== void 0 || usage?.outputTokens !== void 0;
|
|
23822
|
-
const
|
|
23823
|
-
control.root.style.display =
|
|
23824
|
-
if (!
|
|
24402
|
+
const visible2 = rendererUsageHasDisplayData(usage);
|
|
24403
|
+
control.root.style.display = visible2 ? "inline-flex" : "none";
|
|
24404
|
+
if (!visible2) {
|
|
23825
24405
|
closePopover(control);
|
|
23826
24406
|
return false;
|
|
23827
24407
|
}
|
|
@@ -24966,7 +25546,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
24966
25546
|
const content = rendererModelSelectionNoticeContent(view, locale);
|
|
24967
25547
|
control.selectionNotice.show(content.heading, content.message);
|
|
24968
25548
|
}
|
|
24969
|
-
function renderRendererModelPicker(control, view,
|
|
25549
|
+
function renderRendererModelPicker(control, view, visible2, harnessId = "", locale = "en") {
|
|
24970
25550
|
if (control.harnessId !== harnessId) {
|
|
24971
25551
|
control.close();
|
|
24972
25552
|
control.selectionNotice.hide();
|
|
@@ -24974,13 +25554,13 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
24974
25554
|
control.favorites = readModelFavorites(harnessId);
|
|
24975
25555
|
delete control.root.dataset.catalogSignature;
|
|
24976
25556
|
}
|
|
24977
|
-
control.root.style.display =
|
|
25557
|
+
control.root.style.display = visible2 ? "inline-flex" : "none";
|
|
24978
25558
|
control.root.style.alignItems = "center";
|
|
24979
25559
|
control.root.style.alignSelf = "center";
|
|
24980
25560
|
control.root.style.height = "28px";
|
|
24981
25561
|
control.root.style.verticalAlign = "middle";
|
|
24982
25562
|
applyRendererTriggerChipSqueezeRoot(control.root, rendererModelTriggerMaxWidth());
|
|
24983
|
-
if (!
|
|
25563
|
+
if (!visible2) {
|
|
24984
25564
|
control.close();
|
|
24985
25565
|
control.fast.close();
|
|
24986
25566
|
control.selectionNotice.hide();
|
|
@@ -25337,17 +25917,17 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
25337
25917
|
control.menu.append(button2);
|
|
25338
25918
|
}
|
|
25339
25919
|
}
|
|
25340
|
-
function renderRendererPermissionModePicker(control, view,
|
|
25920
|
+
function renderRendererPermissionModePicker(control, view, visible2, locale = control.locale) {
|
|
25341
25921
|
control.locale = locale;
|
|
25342
25922
|
const messages = rendererHarnessMessages(locale);
|
|
25343
25923
|
control.menu.setAttribute("aria-label", messages.permissionMode);
|
|
25344
|
-
control.root.style.display =
|
|
25924
|
+
control.root.style.display = visible2 ? "inline-flex" : "none";
|
|
25345
25925
|
control.root.style.alignItems = "center";
|
|
25346
25926
|
control.root.style.alignSelf = "center";
|
|
25347
25927
|
control.root.style.height = "28px";
|
|
25348
25928
|
control.root.style.verticalAlign = "middle";
|
|
25349
25929
|
applyRendererTriggerChipSqueezeRoot(control.root, rendererPermissionModeTriggerMaxWidth());
|
|
25350
|
-
if (!
|
|
25930
|
+
if (!visible2) {
|
|
25351
25931
|
control.close();
|
|
25352
25932
|
return;
|
|
25353
25933
|
}
|
|
@@ -25841,9 +26421,9 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
25841
26421
|
root.append(chip);
|
|
25842
26422
|
}
|
|
25843
26423
|
}
|
|
25844
|
-
const
|
|
25845
|
-
if (root.hidden ===
|
|
25846
|
-
const display =
|
|
26424
|
+
const visible2 = active.length > 0 && anchor !== null;
|
|
26425
|
+
if (root.hidden === visible2) root.hidden = !visible2;
|
|
26426
|
+
const display = visible2 ? "inline-flex" : "none";
|
|
25847
26427
|
if (root.style.display !== display) root.style.display = display;
|
|
25848
26428
|
const visibility = root.scrollWidth > root.clientWidth ? "hidden" : "visible";
|
|
25849
26429
|
if (root.style.visibility !== visibility) root.style.visibility = visibility;
|
|
@@ -28264,10 +28844,10 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28264
28844
|
}
|
|
28265
28845
|
|
|
28266
28846
|
// src/renderer-thread-reference-persistence.ts
|
|
28267
|
-
var
|
|
28847
|
+
var record9 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
28268
28848
|
var SYNC_TIMEOUT_MS = 2e3;
|
|
28269
28849
|
function restoreRpcThreadReferenceCapability(client, messages, isCurrent) {
|
|
28270
|
-
if (!
|
|
28850
|
+
if (!record9(messages) || !record9(messages.electronBridge)) return client;
|
|
28271
28851
|
const bridge = messages.electronBridge;
|
|
28272
28852
|
const send = bridge.sendMessageFromView;
|
|
28273
28853
|
if (typeof send !== "function") return client;
|
|
@@ -28282,7 +28862,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28282
28862
|
const listener = (event) => {
|
|
28283
28863
|
if (event.source != null && event.source !== messages) return;
|
|
28284
28864
|
const message2 = event.data;
|
|
28285
|
-
if (!
|
|
28865
|
+
if (!record9(message2) || message2.type !== "persisted-atom-sync" || !record9(message2.state))
|
|
28286
28866
|
return;
|
|
28287
28867
|
finish(!Object.hasOwn(message2.state, key));
|
|
28288
28868
|
};
|
|
@@ -28323,12 +28903,12 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28323
28903
|
}
|
|
28324
28904
|
|
|
28325
28905
|
// src/renderer-thread-reference-capability.ts
|
|
28326
|
-
var
|
|
28906
|
+
var record10 = (value) => typeof value === "object" && value !== null;
|
|
28327
28907
|
function restoreThreadReferenceCapability(client, manager, isCurrent, messages = null) {
|
|
28328
|
-
if (
|
|
28908
|
+
if (record10(manager) && manager.kind === "main-process-rpc") {
|
|
28329
28909
|
return restoreRpcThreadReferenceCapability(client, messages, isCurrent);
|
|
28330
28910
|
}
|
|
28331
|
-
if (!
|
|
28911
|
+
if (!record10(manager) || !record10(manager.storage)) return client;
|
|
28332
28912
|
const storage = manager.storage;
|
|
28333
28913
|
const read = storage.readValue;
|
|
28334
28914
|
const write = storage.writeValue;
|
|
@@ -28363,14 +28943,14 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28363
28943
|
}
|
|
28364
28944
|
|
|
28365
28945
|
// src/renderer-thread-reference-context.ts
|
|
28366
|
-
var
|
|
28946
|
+
var record11 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
28367
28947
|
function createThreadReferenceContext(manager, hostId2, isCurrent) {
|
|
28368
28948
|
const prepared = /* @__PURE__ */ new WeakMap();
|
|
28369
28949
|
return (params) => {
|
|
28370
|
-
if (hostId2 === "local" || !
|
|
28950
|
+
if (hostId2 === "local" || !record11(manager) || typeof manager.getConversation !== "function" || !record11(params) || typeof params.threadId !== "string")
|
|
28371
28951
|
return params;
|
|
28372
28952
|
const conversation = manager.getConversation.call(manager, params.threadId);
|
|
28373
|
-
if (!
|
|
28953
|
+
if (!record11(conversation) || conversation.id !== params.threadId || conversation.modelProvider !== "codexhost")
|
|
28374
28954
|
return params;
|
|
28375
28955
|
if (!isCurrent()) throw new Error("Thread reference connection is no longer available");
|
|
28376
28956
|
const cached2 = prepared.get(params);
|
|
@@ -35602,7 +36182,7 @@ ${detail}` : ""}`
|
|
|
35602
36182
|
}
|
|
35603
36183
|
function defaultImportName(source, existing) {
|
|
35604
36184
|
const base = source.provider === "openai-codex" ? "codex" : "grok";
|
|
35605
|
-
const used = new Set(existing.map((
|
|
36185
|
+
const used = new Set(existing.map((record16) => record16.name));
|
|
35606
36186
|
const valid = (name) => credentialImportNameSchema.safeParse(name).success;
|
|
35607
36187
|
if (!used.has(base)) return base;
|
|
35608
36188
|
const local = source.label.includes("@") ? source.label.split("@")[0] ?? "" : "";
|
|
@@ -35625,7 +36205,7 @@ ${detail}` : ""}`
|
|
|
35625
36205
|
const shown = (text) => accountDisplayText(text, hideEmails);
|
|
35626
36206
|
const targetButtons = /* @__PURE__ */ new Map();
|
|
35627
36207
|
const importedRecords = () => snapshot.targets.find((target) => target.harnessId === TARGET_HARNESS_ID)?.imports ?? [];
|
|
35628
|
-
const sourceOf = (
|
|
36208
|
+
const sourceOf = (record16) => snapshot.sources.find((source) => source.id === record16.source.id);
|
|
35629
36209
|
const piTarget = () => snapshot.targets.find((candidate) => candidate.harnessId === TARGET_HARNESS_ID);
|
|
35630
36210
|
const compatibleSources = () => {
|
|
35631
36211
|
const target = piTarget();
|
|
@@ -35663,7 +36243,7 @@ ${detail}` : ""}`
|
|
|
35663
36243
|
sectionImport.addEventListener("click", () => {
|
|
35664
36244
|
const sources = compatibleSources();
|
|
35665
36245
|
const free = sources.find(
|
|
35666
|
-
(source2) => !importedRecords().some((
|
|
36246
|
+
(source2) => !importedRecords().some((record16) => record16.source.id === source2.id)
|
|
35667
36247
|
);
|
|
35668
36248
|
const source = free ?? sources[0];
|
|
35669
36249
|
if (source) openDialog("add", { source, choose: true }, SECTION_IMPORT_KEY);
|
|
@@ -35713,30 +36293,30 @@ ${detail}` : ""}`
|
|
|
35713
36293
|
mark.append(createRendererAgentIcon(agent ?? "pi", 26, document2, pluginFor(agent ?? "pi")));
|
|
35714
36294
|
return mark;
|
|
35715
36295
|
};
|
|
35716
|
-
const renderRow = (
|
|
36296
|
+
const renderRow = (record16) => {
|
|
35717
36297
|
const row = document2.createElement("div");
|
|
35718
36298
|
row.className = "settings-pi-accounts__row";
|
|
35719
36299
|
row.tabIndex = -1;
|
|
35720
|
-
row.dataset.importName =
|
|
35721
|
-
row.setAttribute("aria-label", shown(
|
|
35722
|
-
const agent =
|
|
36300
|
+
row.dataset.importName = record16.name;
|
|
36301
|
+
row.setAttribute("aria-label", shown(record16.source.label));
|
|
36302
|
+
const agent = record16.source.harnessId;
|
|
35723
36303
|
const mark = createMark(agent);
|
|
35724
36304
|
const identity = document2.createElement("div");
|
|
35725
36305
|
identity.className = "settings-pi-accounts__identity";
|
|
35726
36306
|
const label = document2.createElement("strong");
|
|
35727
36307
|
label.className = "settings-account-email";
|
|
35728
|
-
label.textContent = shown(
|
|
36308
|
+
label.textContent = shown(record16.source.label);
|
|
35729
36309
|
label.title = label.textContent;
|
|
35730
36310
|
label.translate = false;
|
|
35731
36311
|
const meta3 = document2.createElement("div");
|
|
35732
36312
|
meta3.className = "settings-account-metadata";
|
|
35733
|
-
const source = sourceOf(
|
|
36313
|
+
const source = sourceOf(record16);
|
|
35734
36314
|
const parts = [
|
|
35735
36315
|
metaPart(rendererAgentLabel(agent, pluginFor(agent)), "settings-pi-accounts__agent"),
|
|
35736
|
-
metaPart(`${
|
|
36316
|
+
metaPart(`${record16.name}/\u2026`, void 0, true),
|
|
35737
36317
|
metaPart(messages.copied)
|
|
35738
36318
|
];
|
|
35739
|
-
const time3 = formatImportedAt(
|
|
36319
|
+
const time3 = formatImportedAt(record16.importedAt);
|
|
35740
36320
|
if (time3) parts.push(metaPart(time3));
|
|
35741
36321
|
parts.forEach((part, index) => {
|
|
35742
36322
|
if (index > 0) {
|
|
@@ -35753,23 +36333,23 @@ ${detail}` : ""}`
|
|
|
35753
36333
|
reimport.type = "button";
|
|
35754
36334
|
reimport.className = "settings-account-action";
|
|
35755
36335
|
reimport.textContent = messages.rowReimport;
|
|
35756
|
-
reimport.setAttribute("aria-label", `${messages.reimport}: ${shown(
|
|
36336
|
+
reimport.setAttribute("aria-label", `${messages.reimport}: ${shown(record16.source.label)}`);
|
|
35757
36337
|
reimport.disabled = busy || !source;
|
|
35758
36338
|
reimport.title = messages.reimport;
|
|
35759
36339
|
reimport.addEventListener("click", () => {
|
|
35760
|
-
if (source) openDialog("reimport", { source, record:
|
|
36340
|
+
if (source) openDialog("reimport", { source, record: record16 }, `row:${record16.name}`);
|
|
35761
36341
|
});
|
|
35762
36342
|
const remove = document2.createElement("button");
|
|
35763
36343
|
remove.type = "button";
|
|
35764
36344
|
remove.className = "settings-account-action settings-pi-accounts__remove";
|
|
35765
36345
|
remove.textContent = messages.rowRemove;
|
|
35766
|
-
remove.setAttribute("aria-label", `${messages.remove}: ${shown(
|
|
36346
|
+
remove.setAttribute("aria-label", `${messages.remove}: ${shown(record16.source.label)}`);
|
|
35767
36347
|
remove.disabled = busy;
|
|
35768
|
-
remove.addEventListener("click", () => openDialog("remove", { record:
|
|
36348
|
+
remove.addEventListener("click", () => openDialog("remove", { record: record16 }, `row:${record16.name}`));
|
|
35769
36349
|
if (source) actions.append(reimport);
|
|
35770
36350
|
actions.append(remove);
|
|
35771
36351
|
row.append(mark, identity, actions);
|
|
35772
|
-
rows.set(
|
|
36352
|
+
rows.set(record16.name, row);
|
|
35773
36353
|
return row;
|
|
35774
36354
|
};
|
|
35775
36355
|
const loginTypeLabel = (type) => type === "oauth" ? messages.typeOauth : type === "api_key" ? messages.typeApiKey : messages.typeOther;
|
|
@@ -35922,7 +36502,7 @@ ${detail}` : ""}`
|
|
|
35922
36502
|
const label = document2.createElement("strong");
|
|
35923
36503
|
label.textContent = shown(choice.label);
|
|
35924
36504
|
label.translate = false;
|
|
35925
|
-
const existing = importedRecords().find((
|
|
36505
|
+
const existing = importedRecords().find((record16) => record16.source.id === choice.id);
|
|
35926
36506
|
const agent = choice.harnessId;
|
|
35927
36507
|
const detail = document2.createElement("span");
|
|
35928
36508
|
detail.textContent = [
|
|
@@ -35963,7 +36543,7 @@ ${detail}` : ""}`
|
|
|
35963
36543
|
const name = request.action === "list" ? void 0 : request.name;
|
|
35964
36544
|
state = {
|
|
35965
36545
|
source: state.source,
|
|
35966
|
-
record: importedRecords().find((
|
|
36546
|
+
record: importedRecords().find((record16) => record16.name === name) ?? state.record
|
|
35967
36547
|
};
|
|
35968
36548
|
show(next);
|
|
35969
36549
|
} else {
|
|
@@ -35977,12 +36557,12 @@ ${detail}` : ""}`
|
|
|
35977
36557
|
sourceRadios = [];
|
|
35978
36558
|
body.replaceChildren();
|
|
35979
36559
|
controls.replaceChildren();
|
|
35980
|
-
const { source, record:
|
|
36560
|
+
const { source, record: record16 } = state;
|
|
35981
36561
|
const close = () => modal.close();
|
|
35982
36562
|
if (mode2 === "add" || mode2 === "reimport") {
|
|
35983
36563
|
title.textContent = mode2 === "add" ? messages.add : messages.reimport;
|
|
35984
36564
|
modal.setAttribute("aria-label", title.textContent);
|
|
35985
|
-
const active = source ??
|
|
36565
|
+
const active = source ?? record16?.source;
|
|
35986
36566
|
const choices = mode2 === "add" && state.choose ? compatibleSources() : [];
|
|
35987
36567
|
if (choices.length > 1) body.append(sourcePicker(choices));
|
|
35988
36568
|
else if (active) body.append(line(messages.source, shown(active.label)));
|
|
@@ -35991,8 +36571,8 @@ ${detail}` : ""}`
|
|
|
35991
36571
|
input.maxLength = 48;
|
|
35992
36572
|
input.autocomplete = "off";
|
|
35993
36573
|
input.spellcheck = false;
|
|
35994
|
-
input.value =
|
|
35995
|
-
input.readOnly = Boolean(
|
|
36574
|
+
input.value = record16?.name ?? (source ? defaultImportName(source, importedRecords()) : "codex");
|
|
36575
|
+
input.readOnly = Boolean(record16);
|
|
35996
36576
|
input.addEventListener("input", () => {
|
|
35997
36577
|
nameEdited = true;
|
|
35998
36578
|
});
|
|
@@ -36026,7 +36606,7 @@ ${detail}` : ""}`
|
|
|
36026
36606
|
{
|
|
36027
36607
|
action: mode2 === "reimport" ? "reimport" : "import",
|
|
36028
36608
|
sourceId: source2.id,
|
|
36029
|
-
name:
|
|
36609
|
+
name: record16?.name ?? input.value,
|
|
36030
36610
|
confirmed: true
|
|
36031
36611
|
},
|
|
36032
36612
|
"done"
|
|
@@ -36036,16 +36616,16 @@ ${detail}` : ""}`
|
|
|
36036
36616
|
)
|
|
36037
36617
|
);
|
|
36038
36618
|
(mode2 === "add" ? input : controls.children[0]).focus();
|
|
36039
|
-
} else if (mode2 === "remove" &&
|
|
36619
|
+
} else if (mode2 === "remove" && record16) {
|
|
36040
36620
|
title.textContent = messages.remove;
|
|
36041
36621
|
modal.setAttribute("aria-label", title.textContent);
|
|
36042
|
-
body.append(note(messages.removeWarning.replace("{name}",
|
|
36622
|
+
body.append(note(messages.removeWarning.replace("{name}", record16.name)));
|
|
36043
36623
|
const cancel = command(messages.cancel, close);
|
|
36044
36624
|
controls.append(
|
|
36045
36625
|
cancel,
|
|
36046
36626
|
command(
|
|
36047
36627
|
messages.remove,
|
|
36048
|
-
() => submit({ action: "remove", name:
|
|
36628
|
+
() => submit({ action: "remove", name: record16.name, confirmed: true }, null),
|
|
36049
36629
|
"danger"
|
|
36050
36630
|
)
|
|
36051
36631
|
);
|
|
@@ -36053,7 +36633,7 @@ ${detail}` : ""}`
|
|
|
36053
36633
|
} else {
|
|
36054
36634
|
title.textContent = messages.doneTitle;
|
|
36055
36635
|
modal.setAttribute("aria-label", title.textContent);
|
|
36056
|
-
const name =
|
|
36636
|
+
const name = record16?.name;
|
|
36057
36637
|
if (name) body.append(line(messages.entry, `${name}/\u2026`, true));
|
|
36058
36638
|
body.append(note(messages.done));
|
|
36059
36639
|
const done = command(messages.close, close, "primary");
|
|
@@ -36100,21 +36680,21 @@ ${detail}` : ""}`
|
|
|
36100
36680
|
(candidate) => candidate.harnessId === TARGET_HARNESS_ID && source && candidate.providers.includes(source.provider)
|
|
36101
36681
|
);
|
|
36102
36682
|
if (!source || !target) return null;
|
|
36103
|
-
const
|
|
36683
|
+
const record16 = target.imports.find((candidate) => candidate.source.id === source.id);
|
|
36104
36684
|
const key = `${harnessId}:${accountLabel}:import`;
|
|
36105
36685
|
const button2 = document2.createElement("button");
|
|
36106
36686
|
button2.type = "button";
|
|
36107
36687
|
button2.className = "settings-account-pi-import";
|
|
36108
36688
|
button2.dataset.accountFocus = key;
|
|
36109
36689
|
button2.disabled = busy;
|
|
36110
|
-
const hint =
|
|
36690
|
+
const hint = record16 ? messages.importedHint.replace("{name}", record16.name) : messages.add;
|
|
36111
36691
|
button2.title = hint;
|
|
36112
36692
|
button2.setAttribute("aria-label", hint);
|
|
36113
36693
|
button2.append(createRendererAgentIcon("pi", 12, document2, pluginFor("pi")));
|
|
36114
|
-
if (
|
|
36694
|
+
if (record16) {
|
|
36115
36695
|
button2.dataset.state = "imported";
|
|
36116
36696
|
const name = document2.createElement("code");
|
|
36117
|
-
name.textContent = `${
|
|
36697
|
+
name.textContent = `${record16.name}/\u2026`;
|
|
36118
36698
|
name.translate = false;
|
|
36119
36699
|
button2.append(name, createRendererSettingsIcon("check", 12));
|
|
36120
36700
|
} else {
|
|
@@ -36122,7 +36702,7 @@ ${detail}` : ""}`
|
|
|
36122
36702
|
button2.append(messages.add);
|
|
36123
36703
|
}
|
|
36124
36704
|
button2.addEventListener("click", () => {
|
|
36125
|
-
if (!
|
|
36705
|
+
if (!record16) {
|
|
36126
36706
|
openDialog("add", { source }, key);
|
|
36127
36707
|
return;
|
|
36128
36708
|
}
|
|
@@ -36131,7 +36711,7 @@ ${detail}` : ""}`
|
|
|
36131
36711
|
renderSection();
|
|
36132
36712
|
sectionToggle.setAttribute("aria-expanded", "true");
|
|
36133
36713
|
}
|
|
36134
|
-
const row = rows.get(
|
|
36714
|
+
const row = rows.get(record16.name);
|
|
36135
36715
|
row?.scrollIntoView({ block: "nearest", behavior: "smooth" });
|
|
36136
36716
|
row?.focus();
|
|
36137
36717
|
});
|
|
@@ -42843,7 +43423,7 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
42843
43423
|
place();
|
|
42844
43424
|
const observer = ownerWindow ? new ownerWindow.MutationObserver((records) => {
|
|
42845
43425
|
const titlebar = source?.closest("[data-app-shell-titlebar]");
|
|
42846
|
-
if (!source?.isConnected || records.some((
|
|
43426
|
+
if (!source?.isConnected || records.some((record16) => titlebar?.contains(record16.target))) {
|
|
42847
43427
|
place();
|
|
42848
43428
|
}
|
|
42849
43429
|
}) : null;
|
|
@@ -46908,6 +47488,7 @@ ${usage_default}`;
|
|
|
46908
47488
|
}
|
|
46909
47489
|
pendingReplacements.clear();
|
|
46910
47490
|
questions.refreshContext();
|
|
47491
|
+
backgroundActivity.refreshContext();
|
|
46911
47492
|
};
|
|
46912
47493
|
const scheduleScan = (refreshTargets = false) => {
|
|
46913
47494
|
refreshTargetsOnNextScan ||= refreshTargets;
|
|
@@ -47208,16 +47789,18 @@ ${usage_default}`;
|
|
|
47208
47789
|
const connectedComposers = () => [...mountedByComposer.values()].filter(
|
|
47209
47790
|
(mounted) => isMountedComposer(mounted.composer) && mounted.control.root.isConnected
|
|
47210
47791
|
);
|
|
47211
|
-
const
|
|
47212
|
-
const
|
|
47792
|
+
const readActivityContext = () => {
|
|
47793
|
+
const visible2 = connectedComposers().filter(
|
|
47213
47794
|
(mounted2) => mounted2.composer.getClientRects().length > 0 && window.getComputedStyle(mounted2.composer).visibility === "visible" && !mounted2.composer.closest('[hidden], [inert], [aria-hidden="true"]') && controller.get(mounted2.composer).agent !== "codex"
|
|
47214
47795
|
);
|
|
47215
|
-
const mounted =
|
|
47796
|
+
const mounted = visible2.length === 1 ? visible2[0] : void 0;
|
|
47216
47797
|
const threadId = mounted ? threadIdFromComposerModelTarget(findComposerModelTarget(mounted.composer)) : null;
|
|
47217
47798
|
const hostId2 = mounted?.hostId;
|
|
47218
47799
|
const route = hostId2 ? window.__codexhostHostRoutingV1?.forHost(hostId2) : null;
|
|
47219
47800
|
return mounted && threadId && hostId2 && route ? { hostId: hostId2, threadId, composer: mounted.composer, route: route.manager } : null;
|
|
47220
|
-
}
|
|
47801
|
+
};
|
|
47802
|
+
const questions = installRendererQuestions(window, readActivityContext);
|
|
47803
|
+
const backgroundActivity = installRendererBackgroundActivity(window, readActivityContext);
|
|
47221
47804
|
const api = {
|
|
47222
47805
|
remoteConnections: (request) => handleRemoteConnectionsRequest(remoteConnections, request),
|
|
47223
47806
|
currentThreadId() {
|
|
@@ -47311,6 +47894,7 @@ ${usage_default}`;
|
|
|
47311
47894
|
if (disposed) return;
|
|
47312
47895
|
disposed = true;
|
|
47313
47896
|
questions.dispose();
|
|
47897
|
+
backgroundActivity.dispose();
|
|
47314
47898
|
usageNotificationDispose();
|
|
47315
47899
|
adapterDispose?.();
|
|
47316
47900
|
adapterDispose = null;
|
|
@@ -47518,8 +48102,8 @@ ${usage_default}`;
|
|
|
47518
48102
|
// src/renderer-voice-capability.ts
|
|
47519
48103
|
var GLOBAL = "__codexhostVoiceCapabilityV1";
|
|
47520
48104
|
var INFERENCE_GATE = "3683713372";
|
|
47521
|
-
var
|
|
47522
|
-
var capable = (value) =>
|
|
48105
|
+
var record12 = (value) => value !== null && typeof value === "object";
|
|
48106
|
+
var capable = (value) => record12(value) && typeof value.isLoading === "boolean" && typeof value.isError === "boolean" && typeof value.isCapable === "boolean";
|
|
47523
48107
|
var equal = (a, b) => a.isLoading === b.isLoading && a.isError === b.isError && a.isCapable === b.isCapable;
|
|
47524
48108
|
function replayVoiceCapability(store, atom, gate) {
|
|
47525
48109
|
const evaluate = (override) => {
|
|
@@ -47557,7 +48141,7 @@ ${usage_default}`;
|
|
|
47557
48141
|
}
|
|
47558
48142
|
}
|
|
47559
48143
|
function isFamily(value) {
|
|
47560
|
-
return
|
|
48144
|
+
return record12(value) && record12(value.scope) && typeof value.resolve === "function";
|
|
47561
48145
|
}
|
|
47562
48146
|
function initializeVoiceCapabilityFamilies(module, assets) {
|
|
47563
48147
|
const initialize = module[assets.capabilityInit];
|
|
@@ -47573,7 +48157,7 @@ ${usage_default}`;
|
|
|
47573
48157
|
const result = [];
|
|
47574
48158
|
const seen = /* @__PURE__ */ new Set();
|
|
47575
48159
|
let hook = fiber.memoizedState;
|
|
47576
|
-
while (
|
|
48160
|
+
while (record12(hook) && result.length < 4096 && !seen.has(hook)) {
|
|
47577
48161
|
seen.add(hook);
|
|
47578
48162
|
result.push(hook);
|
|
47579
48163
|
hook = hook.next;
|
|
@@ -47589,7 +48173,7 @@ ${usage_default}`;
|
|
|
47589
48173
|
let root = ancestors2[0];
|
|
47590
48174
|
if (chat) {
|
|
47591
48175
|
const owners = ancestors2.filter(
|
|
47592
|
-
({ memoizedProps: props }) =>
|
|
48176
|
+
({ memoizedProps: props }) => record12(props) && props.isWorkConversation === false && props.isTemporaryChat === false && props.shouldBlockExternalEgress === false && props.readOnly !== true && typeof props.conversationId === "string" && record12(props.composerSelectionContext) && props.composerSelectionContext.conversationId === props.conversationId
|
|
47593
48177
|
);
|
|
47594
48178
|
if (owners.length !== 1) return fibers;
|
|
47595
48179
|
root = owners[0];
|
|
@@ -47601,7 +48185,7 @@ ${usage_default}`;
|
|
|
47601
48185
|
const ancestors3 = committedReactAncestors(Object.getOwnPropertyDescriptor(element, key)?.value);
|
|
47602
48186
|
const boundary = ancestors3.indexOf(root);
|
|
47603
48187
|
if (boundary < 0) continue;
|
|
47604
|
-
for (const fiber of ancestors3.slice(0, boundary + 1)) if (
|
|
48188
|
+
for (const fiber of ancestors3.slice(0, boundary + 1)) if (record12(fiber)) fibers.add(fiber);
|
|
47605
48189
|
}
|
|
47606
48190
|
return fibers;
|
|
47607
48191
|
}
|
|
@@ -47622,7 +48206,7 @@ ${usage_default}`;
|
|
|
47622
48206
|
const list = hooks(fiber);
|
|
47623
48207
|
for (const memo of list) {
|
|
47624
48208
|
const [signal, deps] = Array.isArray(memo.memoizedState) ? memo.memoizedState : [];
|
|
47625
|
-
if (!
|
|
48209
|
+
if (!record12(signal) || !Array.isArray(deps) || deps.length !== 5 || deps[3] !== family || !(deps[1] instanceof Map) || deps[2] !== void 0)
|
|
47626
48210
|
continue;
|
|
47627
48211
|
const chain = deps[1];
|
|
47628
48212
|
const node = chain.get(family.scope.id);
|
|
@@ -47631,7 +48215,7 @@ ${usage_default}`;
|
|
|
47631
48215
|
const matches = [...members].filter(([, member]) => member.cacheKey === deps[0]);
|
|
47632
48216
|
if (matches.length !== 1 || typeof matches[0]?.[0] !== "string") continue;
|
|
47633
48217
|
const parameter = JSON.parse(matches[0][0]);
|
|
47634
|
-
if (!
|
|
48218
|
+
if (!record12(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")
|
|
47635
48219
|
continue;
|
|
47636
48220
|
const subscriptions = list.filter((hook2) => {
|
|
47637
48221
|
const state = hook2.memoizedState;
|
|
@@ -47644,7 +48228,7 @@ ${usage_default}`;
|
|
|
47644
48228
|
const effect = hook.next?.next?.memoizedState;
|
|
47645
48229
|
const store = signal.store;
|
|
47646
48230
|
const gate = gates.resolve(node, chain, INFERENCE_GATE)?.atom;
|
|
47647
|
-
if (!gate || !instance || !
|
|
48231
|
+
if (!gate || !instance || !record12(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(
|
|
47648
48232
|
store.get(signal.atom),
|
|
47649
48233
|
subscriber.getSnapshot()
|
|
47650
48234
|
) || !equal(subscriber.getSnapshot(), instance.getSnapshot()) || subscriber.createRender?.() != null)
|
|
@@ -47756,7 +48340,7 @@ ${usage_default}`;
|
|
|
47756
48340
|
target[GLOBAL] = handle;
|
|
47757
48341
|
const hookActive = (key) => {
|
|
47758
48342
|
const hook = target[key];
|
|
47759
|
-
return
|
|
48343
|
+
return record12(hook) && hook.status === "active";
|
|
47760
48344
|
};
|
|
47761
48345
|
const currentRoute = () => {
|
|
47762
48346
|
try {
|
|
@@ -47832,7 +48416,7 @@ ${usage_default}`;
|
|
|
47832
48416
|
}
|
|
47833
48417
|
|
|
47834
48418
|
// src/renderer-voice-settings-availability.ts
|
|
47835
|
-
var
|
|
48419
|
+
var record13 = (value) => value !== null && typeof value === "object";
|
|
47836
48420
|
function voiceSettingsSurface(doc, page, appScope) {
|
|
47837
48421
|
const pages = /* @__PURE__ */ new Set();
|
|
47838
48422
|
const fibers = /* @__PURE__ */ new Set();
|
|
@@ -47855,8 +48439,8 @@ ${usage_default}`;
|
|
|
47855
48439
|
const scopes = /* @__PURE__ */ new Map();
|
|
47856
48440
|
for (const fiber of fibers)
|
|
47857
48441
|
for (const hook of hooks(fiber)) {
|
|
47858
|
-
const scope2 =
|
|
47859
|
-
if (
|
|
48442
|
+
const scope2 = record13(hook.memoizedState) ? hook.memoizedState.current : void 0;
|
|
48443
|
+
if (record13(scope2) && scope2.scope === appScope && record13(scope2.node) && scope2.chain instanceof Map && scope2.chain.get(appScope.id) === scope2.node && typeof scope2.get === "function")
|
|
47860
48444
|
scopes.set(scope2.node, scope2);
|
|
47861
48445
|
}
|
|
47862
48446
|
const scope = [...scopes.values()][0];
|
|
@@ -47900,7 +48484,7 @@ ${usage_default}`;
|
|
|
47900
48484
|
for (const fiber of currentFibers())
|
|
47901
48485
|
for (const hook2 of hooks(fiber)) {
|
|
47902
48486
|
const [subscriber2, deps] = Array.isArray(hook2.memoizedState) ? hook2.memoizedState : [];
|
|
47903
|
-
if (!
|
|
48487
|
+
if (!record13(subscriber2) || typeof subscriber2.getSnapshot !== "function" || !Array.isArray(deps) || deps.length !== 2 || deps[0] !== store || !record13(deps[1]) || typeof deps[1].read !== "function")
|
|
47904
48488
|
continue;
|
|
47905
48489
|
const atom2 = deps[1];
|
|
47906
48490
|
if (availability(store, atom2, voice, gate) === true)
|
|
@@ -47913,7 +48497,7 @@ ${usage_default}`;
|
|
|
47913
48497
|
const instance = hook.next?.queue;
|
|
47914
48498
|
const effect = hook.next?.next?.memoizedState;
|
|
47915
48499
|
const native = store.get(atom);
|
|
47916
|
-
if (!instance || typeof instance.getSnapshot !== "function" || !
|
|
48500
|
+
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)
|
|
47917
48501
|
throw new Error("Unsupported Settings availability subscription");
|
|
47918
48502
|
for (const [object3, key] of [
|
|
47919
48503
|
[store, "sub"],
|
|
@@ -47972,7 +48556,7 @@ ${usage_default}`;
|
|
|
47972
48556
|
}
|
|
47973
48557
|
|
|
47974
48558
|
// src/renderer-dictation-settings.ts
|
|
47975
|
-
var
|
|
48559
|
+
var record14 = (value) => value !== null && typeof value === "object";
|
|
47976
48560
|
var mode = (value) => value === null || value === "os-global" || value === "app";
|
|
47977
48561
|
function replayDictationSettingsMode(store, atom, capabilities, gate) {
|
|
47978
48562
|
try {
|
|
@@ -48015,7 +48599,7 @@ ${usage_default}`;
|
|
|
48015
48599
|
function bindDictationSettingsMode(currentFibers, store, atom, capabilities, gate, allowed) {
|
|
48016
48600
|
const readers = () => [...currentFibers()].flatMap(hooks).filter((hook) => {
|
|
48017
48601
|
const [subscriber, deps] = Array.isArray(hook.memoizedState) ? hook.memoizedState : [];
|
|
48018
|
-
return
|
|
48602
|
+
return record14(subscriber) && typeof subscriber.getSnapshot === "function" && Array.isArray(deps) && deps.length === 2 && deps[0] === store && deps[1] === atom;
|
|
48019
48603
|
});
|
|
48020
48604
|
const subscriptions = readers();
|
|
48021
48605
|
if (!subscriptions.length || replayDictationSettingsMode(store, atom, capabilities, gate) === void 0)
|
|
@@ -48028,7 +48612,7 @@ ${usage_default}`;
|
|
|
48028
48612
|
const instance = hook.next?.queue;
|
|
48029
48613
|
const effect = hook.next?.next?.memoizedState;
|
|
48030
48614
|
const native = store.get(atom);
|
|
48031
|
-
if (!instance || typeof instance.getSnapshot !== "function" || !
|
|
48615
|
+
if (!instance || typeof instance.getSnapshot !== "function" || !record14(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)
|
|
48032
48616
|
throw new Error("Unsupported Settings dictation mode subscription");
|
|
48033
48617
|
for (const [object3, key] of [
|
|
48034
48618
|
[store, "sub"],
|
|
@@ -48100,8 +48684,8 @@ ${usage_default}`;
|
|
|
48100
48684
|
var MESSAGE_ID = "settings.general.realtimeVoice.unavailable.description";
|
|
48101
48685
|
var LABEL = "Voice settings unavailable with this provider";
|
|
48102
48686
|
var DESCRIPTION = "Your account allows voice chat. These Desktop settings require the default inference provider. Start ChatGPT Chat voice from the Chat composer.";
|
|
48103
|
-
var
|
|
48104
|
-
var settled = (value, isCapable) =>
|
|
48687
|
+
var record15 = (value) => value !== null && typeof value === "object";
|
|
48688
|
+
var settled = (value, isCapable) => record15(value) && value.isLoading === false && value.isError === false && value.isCapable === isCapable;
|
|
48105
48689
|
function realtimeAtoms(scope, modules) {
|
|
48106
48690
|
const atom = modules.capability.resolve(scope.node, scope.chain, { name: "voice.realtime" }).resolve(scope.node, scope.chain);
|
|
48107
48691
|
return {
|
|
@@ -48112,7 +48696,7 @@ ${usage_default}`;
|
|
|
48112
48696
|
function providerBlocksVoiceSettings(scope, modules) {
|
|
48113
48697
|
try {
|
|
48114
48698
|
const access = scope.get(modules.access);
|
|
48115
|
-
if (!
|
|
48699
|
+
if (!record15(access) || access.status !== "allowed" || !settled(scope.get(modules.capability, { name: "voice" }), true) || !settled(scope.get(modules.capability, { name: "voice.realtime" }), false))
|
|
48116
48700
|
return false;
|
|
48117
48701
|
const { atom, gate } = realtimeAtoms(scope, modules);
|
|
48118
48702
|
return replayVoiceCapability(scope.node.store, atom, gate)?.isCapable === true;
|
|
@@ -48130,10 +48714,10 @@ ${usage_default}`;
|
|
|
48130
48714
|
);
|
|
48131
48715
|
if (!ancestors2.some((fiber) => fiber.type === modules.page)) continue;
|
|
48132
48716
|
const owner = ancestors2.find(
|
|
48133
|
-
({ memoizedProps: props2 }) =>
|
|
48717
|
+
({ memoizedProps: props2 }) => record15(props2) && record15(props2.description) && record15(props2.description.props) && props2.description.props.id === MESSAGE_ID && props2.control === null
|
|
48134
48718
|
);
|
|
48135
48719
|
const props = owner?.memoizedProps;
|
|
48136
|
-
if (!
|
|
48720
|
+
if (!record15(props) || !record15(props.description) || !record15(props.description.props) || !record15(props.label) || !record15(props.label.props) || element.textContent !== props.description.props.defaultMessage)
|
|
48137
48721
|
continue;
|
|
48138
48722
|
const labelText = props.label.props.defaultMessage;
|
|
48139
48723
|
if (typeof labelText !== "string") continue;
|
|
@@ -48150,10 +48734,10 @@ ${usage_default}`;
|
|
|
48150
48734
|
for (const fiber of ancestors2) {
|
|
48151
48735
|
let hook = fiber.memoizedState;
|
|
48152
48736
|
const seen = /* @__PURE__ */ new Set();
|
|
48153
|
-
while (
|
|
48737
|
+
while (record15(hook) && seen.size < 4096 && !seen.has(hook)) {
|
|
48154
48738
|
seen.add(hook);
|
|
48155
|
-
const scope2 =
|
|
48156
|
-
if (
|
|
48739
|
+
const scope2 = record15(hook.memoizedState) ? hook.memoizedState.current : void 0;
|
|
48740
|
+
if (record15(scope2) && scope2.scope === modules.appScope && record15(scope2.node) && scope2.chain instanceof Map && scope2.chain.get(modules.appScope.id) === scope2.node && typeof scope2.get === "function")
|
|
48157
48741
|
scopes.set(scope2.node, scope2);
|
|
48158
48742
|
hook = hook.next;
|
|
48159
48743
|
}
|
|
@@ -48310,7 +48894,7 @@ ${usage_default}`;
|
|
|
48310
48894
|
)
|
|
48311
48895
|
);
|
|
48312
48896
|
if (disposed) return;
|
|
48313
|
-
const latest = assets.version ===
|
|
48897
|
+
const latest = assets.version === "26.1023.51421";
|
|
48314
48898
|
const initialize = latest ? initial.N4n : initial.l0n;
|
|
48315
48899
|
if (typeof initialize !== "function" || typeof settings.VoiceSettings !== "function")
|
|
48316
48900
|
return;
|