@karlorz/codexhost-cli-darwin-x64 0.21.0-0 → 0.22.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +1 -0
- package/app/console-web.js +2 -1
- package/app/cpa-live-voice-hook.js +213 -178
- package/app/desktop-controller.mjs +8 -2
- package/app/host-runtime.mjs +96 -26
- package/app/overlay-voice-bootstrap.js +1 -1616
- package/app/plugins/antigravity/plugin.mjs +1144 -1254
- package/app/plugins/claude-code/plugin.mjs +389 -80
- package/app/plugins/codebuddy/plugin.mjs +1 -0
- package/app/plugins/codex-usage/plugin.mjs +1 -0
- package/app/plugins/copilot/plugin.mjs +1 -0
- package/app/plugins/cursor-cli/plugin.mjs +1 -0
- package/app/plugins/deepseek-harness/plugin.mjs +1 -0
- package/app/plugins/devin/plugin.mjs +1 -0
- package/app/plugins/grok/plugin.mjs +232 -217
- package/app/plugins/hermes/plugin.mjs +1 -0
- package/app/plugins/kimi-code/plugin.mjs +1 -0
- package/app/plugins/kiro-cli/plugin.mjs +1 -0
- package/app/plugins/omp/plugin.mjs +108 -22
- package/app/plugins/opencode/plugin.mjs +1 -0
- package/app/plugins/pi/plugin.mjs +119 -23
- package/app/plugins/qoder/plugin.mjs +1 -0
- package/app/plugins/qoder-cn/plugin.mjs +1 -0
- package/app/plugins/qwen-code/plugin.mjs +1 -0
- package/app/plugins/workbuddy/plugin.mjs +1 -0
- package/app/plugins/zcode/plugin.mjs +1 -0
- package/app/renderer-extension.js +799 -476
- package/app/voice-qualification.json +13 -13
- package/app/web/assets/index-CYo5zTz_.js +201 -0
- package/app/web/codexhost-settings.js +2 -1
- package/app/web/index.html +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +3 -3
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +9 -9
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +1 -1
- package/app/web-modules/server.mjs +130 -74
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
- package/app/web/assets/index-DLXdvkWR.js +0 -201
|
@@ -291,15 +291,15 @@
|
|
|
291
291
|
function parseRealtimeCallResponse(value) {
|
|
292
292
|
if (value === null || typeof value !== "object")
|
|
293
293
|
throw new Error("Invalid voice gateway response");
|
|
294
|
-
const
|
|
295
|
-
if (typeof
|
|
294
|
+
const record27 = value;
|
|
295
|
+
if (typeof record27.status !== "number" || !Number.isInteger(record27.status) || record27.status < 200 || record27.status > 599 || typeof record27.body !== "string" || record27.headers === null || typeof record27.headers !== "object" || Array.isArray(record27.headers)) {
|
|
296
296
|
throw new Error("Invalid voice gateway response");
|
|
297
297
|
}
|
|
298
298
|
const headers = {};
|
|
299
|
-
for (const [name, header] of Object.entries(
|
|
299
|
+
for (const [name, header] of Object.entries(record27.headers)) {
|
|
300
300
|
if (typeof header === "string") headers[name] = header;
|
|
301
301
|
}
|
|
302
|
-
return { status:
|
|
302
|
+
return { status: record27.status, body: record27.body, headers };
|
|
303
303
|
}
|
|
304
304
|
function backendModelName(headers) {
|
|
305
305
|
const raw = new Headers(headers).get("x-codex-turn-metadata");
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
function lastVoiceLaunchProductExperience(owner = globalThis) {
|
|
346
346
|
return lastVoiceProductExperience ?? storedVoiceProductExperience(owner);
|
|
347
347
|
}
|
|
348
|
-
function wrapClientOwnedVoiceFetch(client, bridge, workOverride, responseError, chatOverride = () => false, workSurface = () => false, externalHarness = () => false, overlayExistingCall = () => false, externalLane = () => true,
|
|
348
|
+
function wrapClientOwnedVoiceFetch(client, bridge, workOverride, responseError, chatOverride = () => false, workSurface = () => false, externalHarness = () => false, overlayExistingCall = () => false, externalLane = () => true, workLane2 = () => true, unavailableReason = (kind) => kind === "chat" ? "Chat voice is not qualified on this Desktop." : "Work voice is not qualified on this Desktop.", chatLane = () => true, allowChatNativeWham = () => true, chatgptInstantConnect = () => true) {
|
|
349
349
|
const original = client.fetch;
|
|
350
350
|
const wrapped = async function(url2, options) {
|
|
351
351
|
if (typeof url2 !== "string" || url2.split("?")[0] !== "/wham/realtime/calls" || options?.method !== "POST")
|
|
@@ -360,7 +360,7 @@
|
|
|
360
360
|
const external = !chat && (model2.startsWith("codexhost/") || externalHarness());
|
|
361
361
|
const intendedGateway = external ? true : work ? workOverride() : chatOverride();
|
|
362
362
|
const chatQualified = chatLane();
|
|
363
|
-
const qualified = external ? externalLane() : work ?
|
|
363
|
+
const qualified = external ? externalLane() : work ? workLane2() : chat ? chatQualified : true;
|
|
364
364
|
const chatgptNative = chat && chatgptInstantConnect();
|
|
365
365
|
const nativeChatWham = chatgptNative && !intendedGateway && allowChatNativeWham() && chatQualified;
|
|
366
366
|
let route;
|
|
@@ -450,6 +450,54 @@
|
|
|
450
450
|
};
|
|
451
451
|
}
|
|
452
452
|
|
|
453
|
+
// src/renderer-work-composer-surface.ts
|
|
454
|
+
var HOME_COMPOSER_MODE_STORAGE_KEY = "home-composer-mode-v1";
|
|
455
|
+
function visibleWorkComposer(owner) {
|
|
456
|
+
const document2 = owner.document;
|
|
457
|
+
if (!document2?.querySelectorAll) return false;
|
|
458
|
+
const visible2 = (element) => {
|
|
459
|
+
const box = element.getBoundingClientRect?.() ?? { width: 0 };
|
|
460
|
+
return box.width > 0 && !element.closest?.("[hidden], [inert]");
|
|
461
|
+
};
|
|
462
|
+
return [...document2.querySelectorAll("[data-codex-composer-root]")].some(visible2) && ![...document2.querySelectorAll("[data-chatgpt-composer]")].some(visible2);
|
|
463
|
+
}
|
|
464
|
+
function selectedWorkTab(owner) {
|
|
465
|
+
const document2 = owner.document;
|
|
466
|
+
if (!document2?.querySelectorAll) return false;
|
|
467
|
+
const controls = document2.querySelectorAll("button, [role='tab'], a");
|
|
468
|
+
let workSelected = false;
|
|
469
|
+
let chatSelected = false;
|
|
470
|
+
for (const element of controls) {
|
|
471
|
+
const name = (element.textContent ?? "").replace(/\s+/gu, " ").trim();
|
|
472
|
+
if (name !== "Chat" && name !== "Work") continue;
|
|
473
|
+
const selected = element.getAttribute("aria-selected") === "true" || element.getAttribute("aria-pressed") === "true" || element.getAttribute("data-state") === "active" || element.getAttribute("data-state") === "on";
|
|
474
|
+
if (!selected) continue;
|
|
475
|
+
if (name === "Work") workSelected = true;
|
|
476
|
+
if (name === "Chat") chatSelected = true;
|
|
477
|
+
}
|
|
478
|
+
return workSelected && !chatSelected;
|
|
479
|
+
}
|
|
480
|
+
function isWorkComposerSurface(owner = globalThis) {
|
|
481
|
+
const storage = owner.localStorage;
|
|
482
|
+
try {
|
|
483
|
+
const raw = storage?.getItem(HOME_COMPOSER_MODE_STORAGE_KEY);
|
|
484
|
+
if (raw != null && raw !== "") {
|
|
485
|
+
let value = raw;
|
|
486
|
+
if (raw.startsWith("{") || raw.startsWith('"') || raw.startsWith("[")) {
|
|
487
|
+
try {
|
|
488
|
+
value = JSON.parse(raw);
|
|
489
|
+
} catch {
|
|
490
|
+
value = raw;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
if (value === "work") return true;
|
|
494
|
+
if (value === "chat") return false;
|
|
495
|
+
}
|
|
496
|
+
} catch {
|
|
497
|
+
}
|
|
498
|
+
return selectedWorkTab(owner) || visibleWorkComposer(owner);
|
|
499
|
+
}
|
|
500
|
+
|
|
453
501
|
// src/renderer-voice-routes-cache.ts
|
|
454
502
|
var SHARED_VOICE_CACHE = "codexhost.voice-routes-cache.v1";
|
|
455
503
|
var CPA_LIVE_VOICE_STORAGE_KEY = "codexhost.cpa-live-voice.v1";
|
|
@@ -463,13 +511,13 @@
|
|
|
463
511
|
}
|
|
464
512
|
function parseVoiceRoutes(value) {
|
|
465
513
|
if (value === null || typeof value !== "object") return;
|
|
466
|
-
const
|
|
467
|
-
if (
|
|
514
|
+
const record27 = value;
|
|
515
|
+
if (record27.chatExperience !== "chatgpt" && record27.chatExperience !== "codex" || record27.chatConnection !== "desktop" && record27.chatConnection !== "gateway" || record27.workConnection !== "desktop" && record27.workConnection !== "gateway")
|
|
468
516
|
return;
|
|
469
517
|
return {
|
|
470
|
-
chatExperience:
|
|
471
|
-
chatConnection:
|
|
472
|
-
workConnection:
|
|
518
|
+
chatExperience: record27.chatExperience,
|
|
519
|
+
chatConnection: record27.chatConnection,
|
|
520
|
+
workConnection: record27.workConnection
|
|
473
521
|
};
|
|
474
522
|
}
|
|
475
523
|
function cachedVoiceRoutes(owner) {
|
|
@@ -502,6 +550,20 @@
|
|
|
502
550
|
const routes = cachedVoiceRoutes(owner);
|
|
503
551
|
return routes ? routes.chatExperience === "chatgpt" : !readVoiceStorageFlag(owner, CHAT_LIVE_VOICE_STORAGE_KEY, false);
|
|
504
552
|
}
|
|
553
|
+
function readCpaLiveVoicePreference(owner) {
|
|
554
|
+
const routes = cachedVoiceRoutes(owner);
|
|
555
|
+
return routes ? routes.workConnection === "gateway" : readVoiceStorageFlag(owner, CPA_LIVE_VOICE_STORAGE_KEY, true);
|
|
556
|
+
}
|
|
557
|
+
function readChatLiveVoicePreference(owner) {
|
|
558
|
+
const routes = cachedVoiceRoutes(owner);
|
|
559
|
+
return routes ? routes.chatExperience === "codex" && routes.chatConnection === "gateway" : readVoiceStorageFlag(owner, CHAT_LIVE_VOICE_STORAGE_KEY, false);
|
|
560
|
+
}
|
|
561
|
+
function cpaLiveVoicePreferenceAllowsInstall(globalObject) {
|
|
562
|
+
return readCpaLiveVoicePreference(globalObject);
|
|
563
|
+
}
|
|
564
|
+
function chatLiveVoicePreferenceAllowsOverride(globalObject) {
|
|
565
|
+
return readChatLiveVoicePreference(globalObject);
|
|
566
|
+
}
|
|
505
567
|
|
|
506
568
|
// src/renderer-native-chat-voice-selection.ts
|
|
507
569
|
var UUID = /^[a-f\d]{8}(?:-[a-f\d]{4}){3}-[a-f\d]{12}$/i;
|
|
@@ -604,7 +666,7 @@
|
|
|
604
666
|
}
|
|
605
667
|
|
|
606
668
|
// src/renderer-voice-implementation-revision.generated.ts
|
|
607
|
-
var VOICE_IMPLEMENTATION_REVISION = "
|
|
669
|
+
var VOICE_IMPLEMENTATION_REVISION = "af0ca16ef25a57ae";
|
|
608
670
|
|
|
609
671
|
// src/renderer-voice-profiles.ts
|
|
610
672
|
var NATIVE_CHAT_VOICE_VERSION = "26.1027.61615";
|
|
@@ -1205,106 +1267,106 @@
|
|
|
1205
1267
|
function recordObject(value) {
|
|
1206
1268
|
return value !== null && typeof value === "object";
|
|
1207
1269
|
}
|
|
1208
|
-
function missingStages(
|
|
1209
|
-
return REQUIRED_STAGES.filter((stage) =>
|
|
1270
|
+
function missingStages(record27) {
|
|
1271
|
+
return REQUIRED_STAGES.filter((stage) => record27.stages[stage] !== true);
|
|
1210
1272
|
}
|
|
1211
1273
|
function productForPath(path) {
|
|
1212
1274
|
return path === "chat" ? "chat" : "work";
|
|
1213
1275
|
}
|
|
1214
|
-
function evaluateVoiceEvidence(
|
|
1276
|
+
function evaluateVoiceEvidence(record27) {
|
|
1215
1277
|
const expectedKey = profileIdentityKey(
|
|
1216
|
-
productForPath(
|
|
1217
|
-
|
|
1218
|
-
|
|
1278
|
+
productForPath(record27.path),
|
|
1279
|
+
record27.platform,
|
|
1280
|
+
record27.desktopVersion
|
|
1219
1281
|
);
|
|
1220
|
-
if (
|
|
1282
|
+
if (record27.profileKey !== expectedKey) {
|
|
1221
1283
|
return {
|
|
1222
1284
|
outcome: "mismatch",
|
|
1223
1285
|
qualified: false,
|
|
1224
|
-
missing: missingStages(
|
|
1286
|
+
missing: missingStages(record27),
|
|
1225
1287
|
reason: "evidence-profile-mismatch"
|
|
1226
1288
|
};
|
|
1227
1289
|
}
|
|
1228
|
-
if (typeof
|
|
1290
|
+
if (typeof record27.implementationRevision !== "string" || record27.implementationRevision === "") {
|
|
1229
1291
|
return {
|
|
1230
1292
|
outcome: "mismatch",
|
|
1231
1293
|
qualified: false,
|
|
1232
|
-
missing: missingStages(
|
|
1294
|
+
missing: missingStages(record27),
|
|
1233
1295
|
reason: "missing-implementation-revision"
|
|
1234
1296
|
};
|
|
1235
1297
|
}
|
|
1236
|
-
if (
|
|
1298
|
+
if (record27.policy !== "legacy-retained" && record27.implementationRevision !== voiceImplementationRevision()) {
|
|
1237
1299
|
return {
|
|
1238
1300
|
outcome: "mismatch",
|
|
1239
1301
|
qualified: false,
|
|
1240
|
-
missing: missingStages(
|
|
1302
|
+
missing: missingStages(record27),
|
|
1241
1303
|
reason: "implementation-revision-mismatch"
|
|
1242
1304
|
};
|
|
1243
1305
|
}
|
|
1244
|
-
if (
|
|
1245
|
-
if (typeof
|
|
1306
|
+
if (record27.policy !== "legacy-retained") {
|
|
1307
|
+
if (typeof record27.desktopBuild !== "string" || record27.desktopBuild === "" || typeof record27.asarDigest !== "string" || record27.asarDigest === "") {
|
|
1246
1308
|
return {
|
|
1247
1309
|
outcome: "mismatch",
|
|
1248
1310
|
qualified: false,
|
|
1249
|
-
missing: missingStages(
|
|
1311
|
+
missing: missingStages(record27),
|
|
1250
1312
|
reason: "missing-native-identity"
|
|
1251
1313
|
};
|
|
1252
1314
|
}
|
|
1253
1315
|
}
|
|
1254
|
-
if (typeof
|
|
1316
|
+
if (typeof record27.profileDigest !== "string" || record27.profileDigest === "") {
|
|
1255
1317
|
return {
|
|
1256
1318
|
outcome: "mismatch",
|
|
1257
1319
|
qualified: false,
|
|
1258
|
-
missing: missingStages(
|
|
1320
|
+
missing: missingStages(record27),
|
|
1259
1321
|
reason: "missing-profile-digest"
|
|
1260
1322
|
};
|
|
1261
1323
|
}
|
|
1262
1324
|
const expectedDigest = voiceProfileDigest(
|
|
1263
|
-
productForPath(
|
|
1264
|
-
|
|
1265
|
-
|
|
1325
|
+
productForPath(record27.path),
|
|
1326
|
+
record27.platform,
|
|
1327
|
+
record27.desktopVersion
|
|
1266
1328
|
);
|
|
1267
|
-
if (!expectedDigest ||
|
|
1329
|
+
if (!expectedDigest || record27.profileDigest !== expectedDigest) {
|
|
1268
1330
|
return {
|
|
1269
1331
|
outcome: "mismatch",
|
|
1270
1332
|
qualified: false,
|
|
1271
|
-
missing: missingStages(
|
|
1333
|
+
missing: missingStages(record27),
|
|
1272
1334
|
reason: "stale-profile-digest"
|
|
1273
1335
|
};
|
|
1274
1336
|
}
|
|
1275
|
-
if (
|
|
1337
|
+
if (record27.startAcknowledged === true && record27.connected !== true) {
|
|
1276
1338
|
return {
|
|
1277
1339
|
outcome: "incomplete",
|
|
1278
1340
|
qualified: false,
|
|
1279
|
-
missing: missingStages(
|
|
1341
|
+
missing: missingStages(record27).length > 0 ? missingStages(record27) : ["connection"],
|
|
1280
1342
|
reason: "start-acknowledged-without-connection"
|
|
1281
1343
|
};
|
|
1282
1344
|
}
|
|
1283
|
-
if (
|
|
1345
|
+
if (record27.path !== "chat" && record27.gatewayOwned !== true && record27.stages.connection === true) {
|
|
1284
1346
|
return {
|
|
1285
1347
|
outcome: "incomplete",
|
|
1286
1348
|
qualified: false,
|
|
1287
|
-
missing: missingStages(
|
|
1349
|
+
missing: missingStages(record27).length > 0 ? missingStages(record27) : ["connection"],
|
|
1288
1350
|
reason: "route-only-without-connected-gateway"
|
|
1289
1351
|
};
|
|
1290
1352
|
}
|
|
1291
|
-
if (
|
|
1353
|
+
if (record27.speech?.attended === true && (!record27.speech.witness || !record27.speech.run)) {
|
|
1292
1354
|
return {
|
|
1293
1355
|
outcome: "incomplete",
|
|
1294
1356
|
qualified: false,
|
|
1295
|
-
missing: missingStages(
|
|
1357
|
+
missing: missingStages(record27).includes("speech") ? missingStages(record27) : ["speech"],
|
|
1296
1358
|
reason: "attended-speech-missing-provenance"
|
|
1297
1359
|
};
|
|
1298
1360
|
}
|
|
1299
|
-
if (
|
|
1361
|
+
if (record27.speech && record27.speech.attended !== true) {
|
|
1300
1362
|
return {
|
|
1301
1363
|
outcome: "incomplete",
|
|
1302
1364
|
qualified: false,
|
|
1303
|
-
missing: missingStages(
|
|
1365
|
+
missing: missingStages(record27),
|
|
1304
1366
|
reason: "synthetic-speech-is-not-qualification"
|
|
1305
1367
|
};
|
|
1306
1368
|
}
|
|
1307
|
-
const missing = missingStages(
|
|
1369
|
+
const missing = missingStages(record27);
|
|
1308
1370
|
if (missing.length > 0) {
|
|
1309
1371
|
return {
|
|
1310
1372
|
outcome: "incomplete",
|
|
@@ -1313,7 +1375,7 @@
|
|
|
1313
1375
|
reason: `missing:${missing.join(",")}`
|
|
1314
1376
|
};
|
|
1315
1377
|
}
|
|
1316
|
-
if (
|
|
1378
|
+
if (record27.connected !== true || record27.conversationMatched !== true || (record27.path === "chat" ? record27.harnessMatched !== void 0 && record27.harnessMatched !== true : record27.harnessMatched !== true) || record27.speech?.attended !== true || record27.speech.bothDirections !== true || record27.cleanup?.ended !== true || record27.cleanup.microphoneReleased !== true) {
|
|
1317
1379
|
return {
|
|
1318
1380
|
outcome: "fail",
|
|
1319
1381
|
qualified: false,
|
|
@@ -1323,15 +1385,15 @@
|
|
|
1323
1385
|
}
|
|
1324
1386
|
return { outcome: "pass", qualified: true, missing: [], reason: "qualified" };
|
|
1325
1387
|
}
|
|
1326
|
-
function evidenceMatchesRuntime(
|
|
1327
|
-
if (
|
|
1328
|
-
if (
|
|
1329
|
-
if (
|
|
1330
|
-
if (
|
|
1331
|
-
if (typeof
|
|
1388
|
+
function evidenceMatchesRuntime(record27, config2) {
|
|
1389
|
+
if (record27.platform !== config2.desktopPlatform) return false;
|
|
1390
|
+
if (record27.desktopVersion !== config2.desktopVersion) return false;
|
|
1391
|
+
if (record27.implementationRevision !== config2.implementationRevision) return false;
|
|
1392
|
+
if (record27.policy === "legacy-retained") return true;
|
|
1393
|
+
if (typeof record27.desktopBuild !== "string" || record27.desktopBuild === "" || typeof record27.asarDigest !== "string" || record27.asarDigest === "" || typeof config2.desktopBuild !== "string" || config2.desktopBuild === "" || typeof config2.asarDigest !== "string" || config2.asarDigest === "" || typeof config2.implementationRevision !== "string" || config2.implementationRevision === "") {
|
|
1332
1394
|
return false;
|
|
1333
1395
|
}
|
|
1334
|
-
return
|
|
1396
|
+
return record27.desktopBuild === config2.desktopBuild && record27.asarDigest === config2.asarDigest;
|
|
1335
1397
|
}
|
|
1336
1398
|
function isolatedVoicePathEnabled(config2, path) {
|
|
1337
1399
|
return isolatedQualificationMatches(path, config2);
|
|
@@ -1355,27 +1417,27 @@
|
|
|
1355
1417
|
if (!config2.desktopVersion || !config2.desktopPlatform) {
|
|
1356
1418
|
return { enabled: false, policy: "unreviewed", reason: "waiting-for-identity" };
|
|
1357
1419
|
}
|
|
1358
|
-
const pathRecords = records.filter((
|
|
1420
|
+
const pathRecords = records.filter((record27) => record27.path === path);
|
|
1359
1421
|
if (pathRecords.length > 0) {
|
|
1360
|
-
const matching = pathRecords.filter((
|
|
1422
|
+
const matching = pathRecords.filter((record28) => evidenceMatchesRuntime(record28, config2));
|
|
1361
1423
|
if (matching.length === 0) {
|
|
1362
1424
|
return { enabled: false, policy: "unreviewed", reason: "stale-or-wrong-platform-evidence" };
|
|
1363
1425
|
}
|
|
1364
|
-
for (const
|
|
1365
|
-
const evaluation = evaluateVoiceEvidence(
|
|
1426
|
+
for (const record28 of matching) {
|
|
1427
|
+
const evaluation = evaluateVoiceEvidence(record28);
|
|
1366
1428
|
if (!evaluation.qualified) {
|
|
1367
1429
|
return { enabled: false, policy: "unreviewed", reason: evaluation.reason };
|
|
1368
1430
|
}
|
|
1369
1431
|
}
|
|
1370
|
-
const
|
|
1371
|
-
if (!
|
|
1432
|
+
const record27 = matching[0];
|
|
1433
|
+
if (!record27) {
|
|
1372
1434
|
return { enabled: false, policy: "unreviewed", reason: "missing-evidence" };
|
|
1373
1435
|
}
|
|
1374
1436
|
if (hashedVoiceCandidateOwner(config2) && !hashedVoiceProfileSupported(config2)) {
|
|
1375
1437
|
} else {
|
|
1376
1438
|
return {
|
|
1377
1439
|
enabled: true,
|
|
1378
|
-
policy:
|
|
1440
|
+
policy: record27.policy === "legacy-retained" ? "legacy-retained" : "reviewed"
|
|
1379
1441
|
};
|
|
1380
1442
|
}
|
|
1381
1443
|
}
|
|
@@ -2233,6 +2295,28 @@
|
|
|
2233
2295
|
};
|
|
2234
2296
|
}
|
|
2235
2297
|
}
|
|
2298
|
+
function detectWorkInstantConnectBinding(composer, native) {
|
|
2299
|
+
const key = Object.getOwnPropertyNames(composer).find((key2) => key2.startsWith("__reactFiber$"));
|
|
2300
|
+
if (!key) return;
|
|
2301
|
+
const ancestors2 = committedReactAncestors(Object.getOwnPropertyDescriptor(composer, key)?.value);
|
|
2302
|
+
for (const owner of ancestors2) {
|
|
2303
|
+
const scopes = scopeRefs(owner, native.scopeDefinition);
|
|
2304
|
+
if (scopes.size !== 1) continue;
|
|
2305
|
+
const scope = [...scopes.values()][0];
|
|
2306
|
+
if (!scope) continue;
|
|
2307
|
+
const appNode = scope.chain.get(native.scopeDefinition.id);
|
|
2308
|
+
if (!record2(appNode)) continue;
|
|
2309
|
+
return {
|
|
2310
|
+
composer,
|
|
2311
|
+
appNode,
|
|
2312
|
+
props: { conversationId: "work" },
|
|
2313
|
+
scope,
|
|
2314
|
+
context: {},
|
|
2315
|
+
composerContext: { context: {}, chain: scope.chain },
|
|
2316
|
+
backendConversationId: void 0
|
|
2317
|
+
};
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2236
2320
|
function startNativeChatVoiceForRequest(request, target2 = globalThis) {
|
|
2237
2321
|
if (!record2(request) || request.productExperience !== "chat" || !nativeChatVoicePreferenceAllowsStart(target2))
|
|
2238
2322
|
return;
|
|
@@ -2313,6 +2397,31 @@
|
|
|
2313
2397
|
);
|
|
2314
2398
|
return forms.length === 1 ? forms[0] : void 0;
|
|
2315
2399
|
};
|
|
2400
|
+
const leftoverInstantConnectStarting = () => {
|
|
2401
|
+
if (lastVoiceLaunchProductExperience(target2) !== "chat" || !boundScope || !modules || typeof modules.initial.SPn !== "function")
|
|
2402
|
+
return false;
|
|
2403
|
+
try {
|
|
2404
|
+
const state = modules.initial.SPn(boundScope).getState();
|
|
2405
|
+
if (state.isVoiceModeActive !== true) return false;
|
|
2406
|
+
const connection = state.server?.connectionState;
|
|
2407
|
+
if (connection === "connected" || connection === "reconnecting" || connection === "signalReconnecting")
|
|
2408
|
+
return false;
|
|
2409
|
+
if (state.hasConnectedOnce === true || state.hasVoiceSessionStarted === true) return false;
|
|
2410
|
+
return true;
|
|
2411
|
+
} catch {
|
|
2412
|
+
return false;
|
|
2413
|
+
}
|
|
2414
|
+
};
|
|
2415
|
+
const endLeftoverInstantConnect = () => {
|
|
2416
|
+
starting = false;
|
|
2417
|
+
const end = doc.querySelector(
|
|
2418
|
+
'button[aria-label="End Voice"], button[aria-label="End voice"]'
|
|
2419
|
+
);
|
|
2420
|
+
end?.click();
|
|
2421
|
+
};
|
|
2422
|
+
const releaseChatLaunchOwnership = () => {
|
|
2423
|
+
rememberVoiceProductExperience({ productExperience: "" }, target2);
|
|
2424
|
+
};
|
|
2316
2425
|
const findBinding = () => {
|
|
2317
2426
|
if (!modules || !nativeChatVoicePreferenceAllowsStart(target2)) return;
|
|
2318
2427
|
const form = visibleComposer();
|
|
@@ -2531,10 +2640,29 @@
|
|
|
2531
2640
|
try {
|
|
2532
2641
|
if (hashed && !visibleComposer()) {
|
|
2533
2642
|
selectDraft?.();
|
|
2643
|
+
if (starting) return;
|
|
2644
|
+
const workSurface = isWorkComposerSurface(target2);
|
|
2645
|
+
if (leftoverInstantConnectStarting()) {
|
|
2646
|
+
endLeftoverInstantConnect();
|
|
2647
|
+
if (workSurface) {
|
|
2648
|
+
rememberVoiceProductExperience({ productExperience: "work" }, target2);
|
|
2649
|
+
handle.status = "pending";
|
|
2650
|
+
return;
|
|
2651
|
+
}
|
|
2652
|
+
releaseChatLaunchOwnership();
|
|
2653
|
+
release();
|
|
2654
|
+
handle.status = "pending";
|
|
2655
|
+
return;
|
|
2656
|
+
}
|
|
2534
2657
|
if (handle.activeCall) return;
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2658
|
+
if (workSurface) {
|
|
2659
|
+
rememberVoiceProductExperience({ productExperience: "work" }, target2);
|
|
2660
|
+
} else {
|
|
2661
|
+
releaseChatLaunchOwnership();
|
|
2662
|
+
release();
|
|
2663
|
+
handle.status = "pending";
|
|
2664
|
+
return;
|
|
2665
|
+
}
|
|
2538
2666
|
}
|
|
2539
2667
|
if (renderFailed) throw new Error();
|
|
2540
2668
|
if (!modules) {
|
|
@@ -2574,6 +2702,32 @@
|
|
|
2574
2702
|
return;
|
|
2575
2703
|
}
|
|
2576
2704
|
}
|
|
2705
|
+
if (hashed && !visibleComposer() && isWorkComposerSurface(target2)) {
|
|
2706
|
+
const work = [...doc.querySelectorAll("[data-codex-composer-root]")].find((element) => {
|
|
2707
|
+
const box = element.getBoundingClientRect?.() ?? { width: 0 };
|
|
2708
|
+
return box.width > 0 && !element.closest?.("[hidden], [inert]");
|
|
2709
|
+
});
|
|
2710
|
+
const current2 = work ? detectWorkInstantConnectBinding(work, {
|
|
2711
|
+
scopeDefinition: modules.shared.Qst
|
|
2712
|
+
}) : void 0;
|
|
2713
|
+
if (current2) {
|
|
2714
|
+
if (mounted && current2.appNode !== mounted.node) release();
|
|
2715
|
+
boundScope = current2.scope;
|
|
2716
|
+
if (!mounted) {
|
|
2717
|
+
mounted = mountNativeChatVoiceRuntime({
|
|
2718
|
+
adapter,
|
|
2719
|
+
binding: current2,
|
|
2720
|
+
modules,
|
|
2721
|
+
document: doc,
|
|
2722
|
+
onRenderFailed() {
|
|
2723
|
+
renderFailed = true;
|
|
2724
|
+
}
|
|
2725
|
+
});
|
|
2726
|
+
}
|
|
2727
|
+
}
|
|
2728
|
+
handle.status = "pending";
|
|
2729
|
+
return;
|
|
2730
|
+
}
|
|
2577
2731
|
const current = findBinding();
|
|
2578
2732
|
selectDraft?.();
|
|
2579
2733
|
if (mounted && current && current.appNode !== mounted.node) {
|
|
@@ -2588,7 +2742,10 @@
|
|
|
2588
2742
|
}
|
|
2589
2743
|
if (!current) {
|
|
2590
2744
|
showHeadline();
|
|
2591
|
-
if (
|
|
2745
|
+
if (leftoverInstantConnectStarting()) {
|
|
2746
|
+
endLeftoverInstantConnect();
|
|
2747
|
+
} else if (handle.activeCall) return;
|
|
2748
|
+
releaseChatLaunchOwnership();
|
|
2592
2749
|
if (showHashedComposerWave()) return;
|
|
2593
2750
|
release();
|
|
2594
2751
|
handle.status = "pending";
|
|
@@ -19924,6 +20081,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19924
20081
|
message: "A history continuation requires its connection epoch"
|
|
19925
20082
|
}).optional()
|
|
19926
20083
|
}),
|
|
20084
|
+
external_exports.strictObject({ kind: external_exports.literal("usage"), ...thread, epoch: identity }),
|
|
19927
20085
|
external_exports.strictObject({
|
|
19928
20086
|
kind: external_exports.literal("configure"),
|
|
19929
20087
|
...thread,
|
|
@@ -20118,20 +20276,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20118
20276
|
workConnection: readVoiceStorageFlag(owner, CPA_LIVE_VOICE_STORAGE_KEY, true) ? "gateway" : "desktop"
|
|
20119
20277
|
};
|
|
20120
20278
|
}
|
|
20121
|
-
function readCpaLiveVoicePreference(owner) {
|
|
20122
|
-
const routes = cachedVoiceRoutes(owner);
|
|
20123
|
-
return routes ? routes.workConnection === "gateway" : readVoiceStorageFlag(owner, CPA_LIVE_VOICE_STORAGE_KEY, true);
|
|
20124
|
-
}
|
|
20125
|
-
function readChatLiveVoicePreference(owner) {
|
|
20126
|
-
const routes = cachedVoiceRoutes(owner);
|
|
20127
|
-
return routes ? routes.chatExperience === "codex" && routes.chatConnection === "gateway" : readVoiceStorageFlag(owner, CHAT_LIVE_VOICE_STORAGE_KEY, false);
|
|
20128
|
-
}
|
|
20129
|
-
function cpaLiveVoicePreferenceAllowsInstall(globalObject) {
|
|
20130
|
-
return readCpaLiveVoicePreference(globalObject);
|
|
20131
|
-
}
|
|
20132
|
-
function chatLiveVoicePreferenceAllowsOverride(globalObject) {
|
|
20133
|
-
return readChatLiveVoicePreference(globalObject);
|
|
20134
|
-
}
|
|
20135
20279
|
|
|
20136
20280
|
// src/renderer-cpa-live-voice-hook.ts
|
|
20137
20281
|
var AUDITED_CPA_LIVE_VOICE_DESKTOP_VERSION = HISTORICAL_CPA_LIVE_VOICE_DESKTOP_VERSION;
|
|
@@ -20226,54 +20370,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20226
20370
|
return handle;
|
|
20227
20371
|
}
|
|
20228
20372
|
|
|
20229
|
-
// src/renderer-work-composer-surface.ts
|
|
20230
|
-
var HOME_COMPOSER_MODE_STORAGE_KEY = "home-composer-mode-v1";
|
|
20231
|
-
function visibleWorkComposer(owner) {
|
|
20232
|
-
const document2 = owner.document;
|
|
20233
|
-
if (!document2?.querySelectorAll) return false;
|
|
20234
|
-
const visible2 = (element) => {
|
|
20235
|
-
const box = element.getBoundingClientRect?.() ?? { width: 0 };
|
|
20236
|
-
return box.width > 0 && !element.closest?.("[hidden], [inert]");
|
|
20237
|
-
};
|
|
20238
|
-
return [...document2.querySelectorAll("[data-codex-composer-root]")].some(visible2) && ![...document2.querySelectorAll("[data-chatgpt-composer]")].some(visible2);
|
|
20239
|
-
}
|
|
20240
|
-
function selectedWorkTab(owner) {
|
|
20241
|
-
const document2 = owner.document;
|
|
20242
|
-
if (!document2?.querySelectorAll) return false;
|
|
20243
|
-
const controls = document2.querySelectorAll("button, [role='tab'], a");
|
|
20244
|
-
let workSelected = false;
|
|
20245
|
-
let chatSelected = false;
|
|
20246
|
-
for (const element of controls) {
|
|
20247
|
-
const name = (element.textContent ?? "").replace(/\s+/gu, " ").trim();
|
|
20248
|
-
if (name !== "Chat" && name !== "Work") continue;
|
|
20249
|
-
const selected = element.getAttribute("aria-selected") === "true" || element.getAttribute("aria-pressed") === "true" || element.getAttribute("data-state") === "active" || element.getAttribute("data-state") === "on";
|
|
20250
|
-
if (!selected) continue;
|
|
20251
|
-
if (name === "Work") workSelected = true;
|
|
20252
|
-
if (name === "Chat") chatSelected = true;
|
|
20253
|
-
}
|
|
20254
|
-
return workSelected && !chatSelected;
|
|
20255
|
-
}
|
|
20256
|
-
function isWorkComposerSurface(owner = globalThis) {
|
|
20257
|
-
const storage = owner.localStorage;
|
|
20258
|
-
try {
|
|
20259
|
-
const raw = storage?.getItem(HOME_COMPOSER_MODE_STORAGE_KEY);
|
|
20260
|
-
if (raw != null && raw !== "") {
|
|
20261
|
-
let value = raw;
|
|
20262
|
-
if (raw.startsWith("{") || raw.startsWith('"') || raw.startsWith("[")) {
|
|
20263
|
-
try {
|
|
20264
|
-
value = JSON.parse(raw);
|
|
20265
|
-
} catch {
|
|
20266
|
-
value = raw;
|
|
20267
|
-
}
|
|
20268
|
-
}
|
|
20269
|
-
if (value === "work") return true;
|
|
20270
|
-
if (value === "chat") return false;
|
|
20271
|
-
}
|
|
20272
|
-
} catch {
|
|
20273
|
-
}
|
|
20274
|
-
return selectedWorkTab(owner) || visibleWorkComposer(owner);
|
|
20275
|
-
}
|
|
20276
|
-
|
|
20277
20373
|
// src/renderer-hashed-overlay-voice.ts
|
|
20278
20374
|
var HOOK_GLOBAL2 = "__codexhostClientOwnedVoiceV1";
|
|
20279
20375
|
var SHARED_VOICE_CACHE2 = "codexhost.voice-routes-cache.v1";
|
|
@@ -20426,19 +20522,29 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20426
20522
|
function hookWebpackVoiceFactory(req, onExports) {
|
|
20427
20523
|
const modules = req.m;
|
|
20428
20524
|
const factoryId = HASHED_OVERLAY_VOICE_ROLES.fetchFactoryId;
|
|
20429
|
-
const
|
|
20430
|
-
if (!modules || typeof
|
|
20431
|
-
|
|
20432
|
-
const
|
|
20525
|
+
const installed = modules?.[factoryId];
|
|
20526
|
+
if (!modules || typeof installed !== "function") return void 0;
|
|
20527
|
+
const owned = installed.__codexhostVoiceFactory === true && typeof installed.__codexhostVoiceOriginal === "function";
|
|
20528
|
+
const original = owned ? installed.__codexhostVoiceOriginal : installed;
|
|
20529
|
+
const wrapped = owned ? installed : function(module, exports, webpackRequire) {
|
|
20433
20530
|
try {
|
|
20434
20531
|
return original.apply(this, [module, exports, webpackRequire]);
|
|
20435
20532
|
} finally {
|
|
20436
|
-
|
|
20533
|
+
try {
|
|
20534
|
+
wrapped.__codexhostVoiceSubscriber?.(exports ?? module?.exports);
|
|
20535
|
+
} catch {
|
|
20536
|
+
}
|
|
20437
20537
|
}
|
|
20438
20538
|
};
|
|
20439
20539
|
wrapped.__codexhostVoiceFactory = true;
|
|
20440
|
-
|
|
20441
|
-
|
|
20540
|
+
wrapped.__codexhostVoiceOriginal = original;
|
|
20541
|
+
wrapped.__codexhostVoiceSubscriber = onExports;
|
|
20542
|
+
if (!owned) modules[factoryId] = wrapped;
|
|
20543
|
+
return () => {
|
|
20544
|
+
if (wrapped.__codexhostVoiceSubscriber !== onExports) return;
|
|
20545
|
+
Reflect.deleteProperty(wrapped, "__codexhostVoiceSubscriber");
|
|
20546
|
+
if (modules[factoryId] === wrapped) modules[factoryId] = original;
|
|
20547
|
+
};
|
|
20442
20548
|
}
|
|
20443
20549
|
async function resolveHashedWebpackVoice(importModule) {
|
|
20444
20550
|
const runtime = await importModule(`app://-/assets/${HASHED_WEBPACK_VOICE_RUNTIME_ASSET}`);
|
|
@@ -20458,7 +20564,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20458
20564
|
return {
|
|
20459
20565
|
client,
|
|
20460
20566
|
bridge: bridged,
|
|
20461
|
-
responseError
|
|
20567
|
+
responseError,
|
|
20568
|
+
require: req
|
|
20462
20569
|
};
|
|
20463
20570
|
if (typeof req.m?.[HASHED_OVERLAY_VOICE_ROLES.fetchFactoryId] !== "function") return null;
|
|
20464
20571
|
return {
|
|
@@ -20481,6 +20588,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20481
20588
|
let timer;
|
|
20482
20589
|
let surfaceTimer;
|
|
20483
20590
|
let restore;
|
|
20591
|
+
let restoreFactory;
|
|
20592
|
+
const wrappedClients = /* @__PURE__ */ new WeakSet();
|
|
20484
20593
|
const started = Date.now();
|
|
20485
20594
|
const activation = {
|
|
20486
20595
|
assetSeen: false,
|
|
@@ -20499,6 +20608,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20499
20608
|
if (timer !== void 0) target2.clearTimeout(timer);
|
|
20500
20609
|
if (surfaceTimer !== void 0) target2.clearTimeout(surfaceTimer);
|
|
20501
20610
|
pointerTarget?.removeEventListener?.("pointerdown", onPointerDown, true);
|
|
20611
|
+
restoreFactory?.();
|
|
20502
20612
|
restore?.();
|
|
20503
20613
|
if (target2[HOOK_GLOBAL2] === handle) Reflect.deleteProperty(target2, HOOK_GLOBAL2);
|
|
20504
20614
|
}
|
|
@@ -20512,7 +20622,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20512
20622
|
};
|
|
20513
20623
|
publishLoop();
|
|
20514
20624
|
const activate = (client, bridge, responseError) => {
|
|
20515
|
-
|
|
20625
|
+
if (wrappedClients.has(client)) {
|
|
20626
|
+
activation.wrapperActive = true;
|
|
20627
|
+
handle.status = "active";
|
|
20628
|
+
return;
|
|
20629
|
+
}
|
|
20630
|
+
wrappedClients.add(client);
|
|
20631
|
+
const disposeWrap = wrapClientOwnedVoiceFetch(
|
|
20516
20632
|
client,
|
|
20517
20633
|
bridge,
|
|
20518
20634
|
() => workGatewayPreference(target2),
|
|
@@ -20531,11 +20647,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20531
20647
|
() => false,
|
|
20532
20648
|
() => nativeChatVoicePreferenceAllowsStart(target2)
|
|
20533
20649
|
);
|
|
20650
|
+
const previous = restore;
|
|
20651
|
+
restore = () => {
|
|
20652
|
+
disposeWrap();
|
|
20653
|
+
previous?.();
|
|
20654
|
+
};
|
|
20534
20655
|
activation.wrapperActive = true;
|
|
20535
20656
|
handle.status = "active";
|
|
20536
20657
|
};
|
|
20537
20658
|
const attempt = async () => {
|
|
20538
|
-
if (disposed ||
|
|
20659
|
+
if (disposed || activation.wrapperActive && activation.factoryHooked) return;
|
|
20539
20660
|
publishComposerLaunchExperience(target2);
|
|
20540
20661
|
const names = loadedAssetNames(target2.document, target2.performance);
|
|
20541
20662
|
const hashedAssetSeen = names.some((name) => name.includes(HASHED_WEBPACK_VOICE_RUNTIME_ASSET));
|
|
@@ -20544,38 +20665,43 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20544
20665
|
activation.importStarted = true;
|
|
20545
20666
|
try {
|
|
20546
20667
|
const resolved = await resolveHashedWebpackVoice(importModule);
|
|
20547
|
-
if (disposed ||
|
|
20548
|
-
|
|
20549
|
-
|
|
20550
|
-
|
|
20551
|
-
|
|
20552
|
-
|
|
20553
|
-
|
|
20554
|
-
const webpackRequire = resolved?.require;
|
|
20555
|
-
if (webpackRequire && hookWebpackVoiceFactory(webpackRequire, (exports) => {
|
|
20556
|
-
if (disposed || activation.wrapperActive) return;
|
|
20557
|
-
const client = nativeVoiceFetch(
|
|
20558
|
-
object4(exports) ? exports[HASHED_OVERLAY_VOICE_ROLES.fetchExport] : void 0
|
|
20559
|
-
);
|
|
20560
|
-
if (!client) {
|
|
20561
|
-
unpoisonIncompleteWebpackModule(
|
|
20562
|
-
webpackRequire,
|
|
20563
|
-
HASHED_OVERLAY_VOICE_ROLES.fetchFactoryId,
|
|
20564
|
-
(value) => Boolean(
|
|
20565
|
-
nativeVoiceFetch(
|
|
20566
|
-
object4(value) ? value[HASHED_OVERLAY_VOICE_ROLES.fetchExport] : void 0
|
|
20567
|
-
)
|
|
20568
|
-
)
|
|
20668
|
+
if (disposed || !resolved) {
|
|
20669
|
+
if (!disposed) activation.importFailed = "hashed-exports-missing";
|
|
20670
|
+
} else {
|
|
20671
|
+
const wrapExports = (exports) => {
|
|
20672
|
+
if (disposed) return;
|
|
20673
|
+
const client = nativeVoiceFetch(
|
|
20674
|
+
object4(exports) ? exports[HASHED_OVERLAY_VOICE_ROLES.fetchExport] : void 0
|
|
20569
20675
|
);
|
|
20570
|
-
|
|
20676
|
+
if (!client) {
|
|
20677
|
+
if (resolved.require)
|
|
20678
|
+
unpoisonIncompleteWebpackModule(
|
|
20679
|
+
resolved.require,
|
|
20680
|
+
HASHED_OVERLAY_VOICE_ROLES.fetchFactoryId,
|
|
20681
|
+
(value) => Boolean(
|
|
20682
|
+
nativeVoiceFetch(
|
|
20683
|
+
object4(value) ? value[HASHED_OVERLAY_VOICE_ROLES.fetchExport] : void 0
|
|
20684
|
+
)
|
|
20685
|
+
)
|
|
20686
|
+
);
|
|
20687
|
+
return;
|
|
20688
|
+
}
|
|
20689
|
+
activate(client, resolved.bridge, resolved.responseError);
|
|
20690
|
+
};
|
|
20691
|
+
if (resolved.client) {
|
|
20692
|
+
activation.importResolved = true;
|
|
20693
|
+
delete activation.importFailed;
|
|
20694
|
+
activate(resolved.client, resolved.bridge, resolved.responseError);
|
|
20695
|
+
}
|
|
20696
|
+
const disposeFactory = resolved.require ? hookWebpackVoiceFactory(resolved.require, wrapExports) : void 0;
|
|
20697
|
+
if (disposeFactory) {
|
|
20698
|
+
restoreFactory = disposeFactory;
|
|
20699
|
+
activation.importResolved = true;
|
|
20700
|
+
activation.factoryHooked = true;
|
|
20701
|
+
delete activation.importFailed;
|
|
20571
20702
|
}
|
|
20572
|
-
activate(client, resolved.bridge, resolved.responseError);
|
|
20573
|
-
})) {
|
|
20574
|
-
activation.importResolved = true;
|
|
20575
|
-
activation.factoryHooked = true;
|
|
20576
|
-
delete activation.importFailed;
|
|
20577
|
-
return;
|
|
20578
20703
|
}
|
|
20704
|
+
if (activation.wrapperActive || activation.factoryHooked) return;
|
|
20579
20705
|
activation.importFailed = "hashed-exports-missing";
|
|
20580
20706
|
} catch {
|
|
20581
20707
|
activation.importFailed = "hashed-import-failed";
|
|
@@ -20995,15 +21121,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20995
21121
|
// ../desktop-control/dist/renderer-host-rpc-discovery.js
|
|
20996
21122
|
function findRendererAppScopeStore(root) {
|
|
20997
21123
|
const MAX_VISITED_FIBERS = 5e4;
|
|
20998
|
-
const
|
|
21124
|
+
const record27 = (value) => typeof value === "object" && value !== null;
|
|
20999
21125
|
const container = root.getElementById?.("root");
|
|
21000
|
-
if (!
|
|
21126
|
+
if (!record27(container))
|
|
21001
21127
|
return null;
|
|
21002
21128
|
const key = Object.getOwnPropertyNames(container).find((name) => name.startsWith("__reactContainer$"));
|
|
21003
21129
|
const first = key ? container[key] : null;
|
|
21004
|
-
if (!
|
|
21130
|
+
if (!record27(first))
|
|
21005
21131
|
return null;
|
|
21006
|
-
const isScopeHandle = (value) =>
|
|
21132
|
+
const isScopeHandle = (value) => record27(value) && record27(value.node) && "chain" in value && "scope" in value && typeof value.get === "function" && typeof value.set === "function" && typeof value.watch === "function";
|
|
21007
21133
|
const stack = [first];
|
|
21008
21134
|
const seen = /* @__PURE__ */ new Set();
|
|
21009
21135
|
while (stack.length && seen.size < MAX_VISITED_FIBERS) {
|
|
@@ -21012,43 +21138,43 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21012
21138
|
continue;
|
|
21013
21139
|
seen.add(fiber);
|
|
21014
21140
|
let hook = fiber.memoizedState;
|
|
21015
|
-
for (let index = 0;
|
|
21141
|
+
for (let index = 0; record27(hook) && "next" in hook && index < 150; index += 1) {
|
|
21016
21142
|
const state = hook.memoizedState;
|
|
21017
|
-
const handle =
|
|
21143
|
+
const handle = record27(state) ? state.current : null;
|
|
21018
21144
|
if (isScopeHandle(handle)) {
|
|
21019
21145
|
let node = handle.node;
|
|
21020
21146
|
const nodes = /* @__PURE__ */ new Set();
|
|
21021
|
-
while (
|
|
21147
|
+
while (record27(node.parent) && !nodes.has(node.parent)) {
|
|
21022
21148
|
nodes.add(node);
|
|
21023
21149
|
node = node.parent;
|
|
21024
21150
|
}
|
|
21025
21151
|
const bindings = node.familyBindings;
|
|
21026
|
-
return
|
|
21152
|
+
return record27(bindings) && typeof bindings.get === "function" && typeof bindings.entries === "function" ? node : null;
|
|
21027
21153
|
}
|
|
21028
21154
|
hook = hook.next;
|
|
21029
21155
|
}
|
|
21030
|
-
if (
|
|
21156
|
+
if (record27(fiber.sibling))
|
|
21031
21157
|
stack.push(fiber.sibling);
|
|
21032
|
-
if (
|
|
21158
|
+
if (record27(fiber.child))
|
|
21033
21159
|
stack.push(fiber.child);
|
|
21034
21160
|
}
|
|
21035
21161
|
return null;
|
|
21036
21162
|
}
|
|
21037
21163
|
function findRendererHostRpcFamily(store) {
|
|
21038
|
-
const
|
|
21164
|
+
const record27 = (value) => typeof value === "object" && value !== null;
|
|
21039
21165
|
const families = /* @__PURE__ */ new Set();
|
|
21040
21166
|
for (const [definition, members] of store.familyBindings) {
|
|
21041
|
-
if (!
|
|
21167
|
+
if (!record27(definition) || definition.kind !== "signal-family")
|
|
21042
21168
|
continue;
|
|
21043
|
-
if (!
|
|
21169
|
+
if (!record27(members) || typeof members.get !== "function")
|
|
21044
21170
|
continue;
|
|
21045
21171
|
for (const [hostId2, member] of members) {
|
|
21046
21172
|
if (typeof hostId2 !== "string" || !/^(?:local$|durable$|remote[-:]|ssh:)/u.test(hostId2))
|
|
21047
21173
|
continue;
|
|
21048
|
-
if (!
|
|
21174
|
+
if (!record27(member))
|
|
21049
21175
|
continue;
|
|
21050
21176
|
const signal = member.value;
|
|
21051
|
-
if (!
|
|
21177
|
+
if (!record27(signal) || typeof signal.get !== "function")
|
|
21052
21178
|
continue;
|
|
21053
21179
|
let value;
|
|
21054
21180
|
try {
|
|
@@ -21056,7 +21182,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21056
21182
|
} catch {
|
|
21057
21183
|
continue;
|
|
21058
21184
|
}
|
|
21059
|
-
if (
|
|
21185
|
+
if (record27(value) && Object.keys(value).length === 2 && typeof value.status === "string" && record27(value.client) && value.client.hostId === hostId2 && "rpc" in value.client) {
|
|
21060
21186
|
families.add(members);
|
|
21061
21187
|
break;
|
|
21062
21188
|
}
|
|
@@ -21069,9 +21195,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21069
21195
|
function resolveRendererHostRpc(discovery, hostId2) {
|
|
21070
21196
|
if (hostId2 === "durable")
|
|
21071
21197
|
return null;
|
|
21072
|
-
const
|
|
21198
|
+
const record27 = (value2) => typeof value2 === "object" && value2 !== null;
|
|
21073
21199
|
const signal = discovery.family.get(hostId2)?.value;
|
|
21074
|
-
if (!
|
|
21200
|
+
if (!record27(signal) || typeof signal.get !== "function")
|
|
21075
21201
|
return null;
|
|
21076
21202
|
let value;
|
|
21077
21203
|
try {
|
|
@@ -21079,10 +21205,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21079
21205
|
} catch {
|
|
21080
21206
|
return null;
|
|
21081
21207
|
}
|
|
21082
|
-
if (!
|
|
21208
|
+
if (!record27(value) || value.status !== "ready" || !record27(value.client) || value.client.hostId !== hostId2)
|
|
21083
21209
|
return null;
|
|
21084
21210
|
const rpc = value.client.rpc;
|
|
21085
|
-
return typeof rpc === "function" ||
|
|
21211
|
+
return typeof rpc === "function" || record27(rpc) ? rpc : null;
|
|
21086
21212
|
}
|
|
21087
21213
|
function rendererHostRpcUsesExternalQueue(store, conversationId) {
|
|
21088
21214
|
const providers = /* @__PURE__ */ new Map();
|
|
@@ -21570,14 +21696,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21570
21696
|
|
|
21571
21697
|
// ../desktop-control/dist/renderer-host-discovery.js
|
|
21572
21698
|
function requestManagerFromHookState(value, hostId2) {
|
|
21573
|
-
const
|
|
21699
|
+
const record27 = (candidate) => typeof candidate === "object" && candidate !== null;
|
|
21574
21700
|
const manager = (candidate) => {
|
|
21575
|
-
if (!
|
|
21701
|
+
if (!record27(candidate) || !record27(candidate.requestClient) || !record27(candidate.prewarmedThreadManager))
|
|
21576
21702
|
return null;
|
|
21577
21703
|
const bridge = candidate.requestClient;
|
|
21578
21704
|
return typeof candidate.sendRequest === "function" && typeof bridge.sendRequest === "function" && typeof bridge.prewarmThreadStart === "function" && typeof bridge.enqueueRequest === "function" && typeof candidate.prewarmedThreadManager.discardAllPrewarmedThreads === "function" ? candidate : null;
|
|
21579
21705
|
};
|
|
21580
|
-
if (!
|
|
21706
|
+
if (!record27(value))
|
|
21581
21707
|
return null;
|
|
21582
21708
|
const direct = manager(value) ?? manager(value.manager);
|
|
21583
21709
|
if (direct)
|
|
@@ -23380,7 +23506,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
23380
23506
|
body.append(group);
|
|
23381
23507
|
}
|
|
23382
23508
|
}
|
|
23383
|
-
function createQuestionCard(document2, question, submit, initial = {},
|
|
23509
|
+
function createQuestionCard(document2, question, submit, initial = {}, record27) {
|
|
23384
23510
|
const icon2 = (node) => document2.adoptNode(
|
|
23385
23511
|
createElement(node, {
|
|
23386
23512
|
width: 16,
|
|
@@ -23397,9 +23523,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
23397
23523
|
return selected;
|
|
23398
23524
|
};
|
|
23399
23525
|
const root = document2.createElement("section");
|
|
23400
|
-
if (
|
|
23526
|
+
if (record27) {
|
|
23401
23527
|
root.dataset.codexhostQuestionRecord = question.interactionId;
|
|
23402
|
-
root.dataset.outcome =
|
|
23528
|
+
root.dataset.outcome = record27.outcome;
|
|
23403
23529
|
} else {
|
|
23404
23530
|
root.dataset.codexhostQuestion = question.interactionId;
|
|
23405
23531
|
}
|
|
@@ -23466,8 +23592,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
23466
23592
|
style.textContent = QUESTION_CARD_CSS;
|
|
23467
23593
|
const surface = document2.createElement("div");
|
|
23468
23594
|
surface.className = "card";
|
|
23469
|
-
const historyMode =
|
|
23470
|
-
if (
|
|
23595
|
+
const historyMode = record27?.history ?? (record27 ? "selected" : void 0);
|
|
23596
|
+
if (record27) {
|
|
23471
23597
|
root.dataset.history = historyMode ?? "selected";
|
|
23472
23598
|
surface.classList.add("record");
|
|
23473
23599
|
if (historyMode === "selected") surface.classList.add("compact");
|
|
@@ -23505,8 +23631,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
23505
23631
|
dismiss.setAttribute("aria-label", "Dismiss question");
|
|
23506
23632
|
const outcome = document2.createElement("span");
|
|
23507
23633
|
outcome.className = "outcome";
|
|
23508
|
-
if (
|
|
23509
|
-
outcome.textContent = RECORD_OUTCOME_LABEL[
|
|
23634
|
+
if (record27) {
|
|
23635
|
+
outcome.textContent = RECORD_OUTCOME_LABEL[record27.outcome];
|
|
23510
23636
|
title.append(titleIcon, titleText, outcome);
|
|
23511
23637
|
} else {
|
|
23512
23638
|
title.append(titleIcon, titleText, countdown, dismiss);
|
|
@@ -23628,7 +23754,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
23628
23754
|
actions.className = "actions";
|
|
23629
23755
|
const readAnswers = () => Object.fromEntries([...readers].map(([id, read]) => [id, read()]));
|
|
23630
23756
|
const interaction = { restoreFocus, bodyScrollTop, setBodyScrollTop };
|
|
23631
|
-
if (
|
|
23757
|
+
if (record27) {
|
|
23632
23758
|
for (const control of controls) control.disabled = true;
|
|
23633
23759
|
if (footer.childNodes.length > 0) surface.append(footer);
|
|
23634
23760
|
return {
|
|
@@ -24427,30 +24553,30 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
24427
24553
|
const syncRecords = (current, closed, liveId) => {
|
|
24428
24554
|
const document2 = current.composer.ownerDocument;
|
|
24429
24555
|
const visible2 = /* @__PURE__ */ new Set();
|
|
24430
|
-
for (const
|
|
24431
|
-
if (
|
|
24432
|
-
const mount = findVisibleHistoryMount(document2,
|
|
24556
|
+
for (const record27 of closed) {
|
|
24557
|
+
if (record27.interactionId === liveId) continue;
|
|
24558
|
+
const mount = findVisibleHistoryMount(document2, record27.itemId, record27.turnId);
|
|
24433
24559
|
if (!mount) continue;
|
|
24434
24560
|
const host = ensureQuestionHistorySlot(document2, mount);
|
|
24435
|
-
visible2.add(
|
|
24436
|
-
const existing = records.get(
|
|
24561
|
+
visible2.add(record27.interactionId);
|
|
24562
|
+
const existing = records.get(record27.interactionId);
|
|
24437
24563
|
if (existing?.root.isConnected && existing.root.parentElement === host && existing.historyMode === historyMode)
|
|
24438
24564
|
continue;
|
|
24439
24565
|
existing?.dispose();
|
|
24440
24566
|
const view = createQuestionCard(
|
|
24441
24567
|
document2,
|
|
24442
24568
|
{
|
|
24443
|
-
interactionId:
|
|
24444
|
-
turnId:
|
|
24445
|
-
...
|
|
24446
|
-
questions:
|
|
24569
|
+
interactionId: record27.interactionId,
|
|
24570
|
+
turnId: record27.turnId,
|
|
24571
|
+
...record27.title !== void 0 ? { title: record27.title } : {},
|
|
24572
|
+
questions: record27.questions
|
|
24447
24573
|
},
|
|
24448
24574
|
async () => void 0,
|
|
24449
|
-
|
|
24450
|
-
{ outcome:
|
|
24575
|
+
record27.answers,
|
|
24576
|
+
{ outcome: record27.outcome, history: historyMode }
|
|
24451
24577
|
);
|
|
24452
24578
|
host.append(view.root);
|
|
24453
|
-
records.set(
|
|
24579
|
+
records.set(record27.interactionId, view);
|
|
24454
24580
|
}
|
|
24455
24581
|
for (const [id, view] of records) {
|
|
24456
24582
|
if (visible2.has(id) && view.root.isConnected) continue;
|
|
@@ -42094,7 +42220,7 @@ ${detail}` : ""}`
|
|
|
42094
42220
|
}
|
|
42095
42221
|
function defaultImportName(source, existing) {
|
|
42096
42222
|
const base = source.provider === "openai-codex" ? "codex" : "grok";
|
|
42097
|
-
const used = new Set(existing.map((
|
|
42223
|
+
const used = new Set(existing.map((record27) => record27.name));
|
|
42098
42224
|
const valid = (name) => credentialImportNameSchema.safeParse(name).success;
|
|
42099
42225
|
if (!used.has(base)) return base;
|
|
42100
42226
|
const local = source.label.includes("@") ? source.label.split("@")[0] ?? "" : "";
|
|
@@ -42117,7 +42243,7 @@ ${detail}` : ""}`
|
|
|
42117
42243
|
const shown = (text) => accountDisplayText(text, hideEmails);
|
|
42118
42244
|
const targetButtons = /* @__PURE__ */ new Map();
|
|
42119
42245
|
const importedRecords = () => snapshot.targets.find((target2) => target2.harnessId === TARGET_HARNESS_ID)?.imports ?? [];
|
|
42120
|
-
const sourceOf = (
|
|
42246
|
+
const sourceOf = (record27) => snapshot.sources.find((source) => source.id === record27.source.id);
|
|
42121
42247
|
const piTarget = () => snapshot.targets.find((candidate) => candidate.harnessId === TARGET_HARNESS_ID);
|
|
42122
42248
|
const compatibleSources = () => {
|
|
42123
42249
|
const target2 = piTarget();
|
|
@@ -42155,7 +42281,7 @@ ${detail}` : ""}`
|
|
|
42155
42281
|
sectionImport.addEventListener("click", () => {
|
|
42156
42282
|
const sources = compatibleSources();
|
|
42157
42283
|
const free = sources.find(
|
|
42158
|
-
(source2) => !importedRecords().some((
|
|
42284
|
+
(source2) => !importedRecords().some((record27) => record27.source.id === source2.id)
|
|
42159
42285
|
);
|
|
42160
42286
|
const source = free ?? sources[0];
|
|
42161
42287
|
if (source) openDialog("add", { source, choose: true }, SECTION_IMPORT_KEY);
|
|
@@ -42205,30 +42331,30 @@ ${detail}` : ""}`
|
|
|
42205
42331
|
mark.append(createRendererAgentIcon(agent ?? "pi", 26, document2, pluginFor(agent ?? "pi")));
|
|
42206
42332
|
return mark;
|
|
42207
42333
|
};
|
|
42208
|
-
const renderRow = (
|
|
42334
|
+
const renderRow = (record27) => {
|
|
42209
42335
|
const row = document2.createElement("div");
|
|
42210
42336
|
row.className = "settings-pi-accounts__row";
|
|
42211
42337
|
row.tabIndex = -1;
|
|
42212
|
-
row.dataset.importName =
|
|
42213
|
-
row.setAttribute("aria-label", shown(
|
|
42214
|
-
const agent =
|
|
42338
|
+
row.dataset.importName = record27.name;
|
|
42339
|
+
row.setAttribute("aria-label", shown(record27.source.label));
|
|
42340
|
+
const agent = record27.source.harnessId;
|
|
42215
42341
|
const mark = createMark(agent);
|
|
42216
42342
|
const identity3 = document2.createElement("div");
|
|
42217
42343
|
identity3.className = "settings-pi-accounts__identity";
|
|
42218
42344
|
const label = document2.createElement("strong");
|
|
42219
42345
|
label.className = "settings-account-email";
|
|
42220
|
-
label.textContent = shown(
|
|
42346
|
+
label.textContent = shown(record27.source.label);
|
|
42221
42347
|
label.title = label.textContent;
|
|
42222
42348
|
label.translate = false;
|
|
42223
42349
|
const meta3 = document2.createElement("div");
|
|
42224
42350
|
meta3.className = "settings-account-metadata";
|
|
42225
|
-
const source = sourceOf(
|
|
42351
|
+
const source = sourceOf(record27);
|
|
42226
42352
|
const parts = [
|
|
42227
42353
|
metaPart(rendererAgentLabel(agent, pluginFor(agent)), "settings-pi-accounts__agent"),
|
|
42228
|
-
metaPart(`${
|
|
42354
|
+
metaPart(`${record27.name}/\u2026`, void 0, true),
|
|
42229
42355
|
metaPart(messages.copied)
|
|
42230
42356
|
];
|
|
42231
|
-
const time3 = formatImportedAt(
|
|
42357
|
+
const time3 = formatImportedAt(record27.importedAt);
|
|
42232
42358
|
if (time3) parts.push(metaPart(time3));
|
|
42233
42359
|
parts.forEach((part, index) => {
|
|
42234
42360
|
if (index > 0) {
|
|
@@ -42245,23 +42371,23 @@ ${detail}` : ""}`
|
|
|
42245
42371
|
reimport.type = "button";
|
|
42246
42372
|
reimport.className = "settings-account-action";
|
|
42247
42373
|
reimport.textContent = messages.rowReimport;
|
|
42248
|
-
reimport.setAttribute("aria-label", `${messages.reimport}: ${shown(
|
|
42374
|
+
reimport.setAttribute("aria-label", `${messages.reimport}: ${shown(record27.source.label)}`);
|
|
42249
42375
|
reimport.disabled = busy || !source;
|
|
42250
42376
|
reimport.title = messages.reimport;
|
|
42251
42377
|
reimport.addEventListener("click", () => {
|
|
42252
|
-
if (source) openDialog("reimport", { source, record:
|
|
42378
|
+
if (source) openDialog("reimport", { source, record: record27 }, `row:${record27.name}`);
|
|
42253
42379
|
});
|
|
42254
42380
|
const remove = document2.createElement("button");
|
|
42255
42381
|
remove.type = "button";
|
|
42256
42382
|
remove.className = "settings-account-action settings-pi-accounts__remove";
|
|
42257
42383
|
remove.textContent = messages.rowRemove;
|
|
42258
|
-
remove.setAttribute("aria-label", `${messages.remove}: ${shown(
|
|
42384
|
+
remove.setAttribute("aria-label", `${messages.remove}: ${shown(record27.source.label)}`);
|
|
42259
42385
|
remove.disabled = busy;
|
|
42260
|
-
remove.addEventListener("click", () => openDialog("remove", { record:
|
|
42386
|
+
remove.addEventListener("click", () => openDialog("remove", { record: record27 }, `row:${record27.name}`));
|
|
42261
42387
|
if (source) actions.append(reimport);
|
|
42262
42388
|
actions.append(remove);
|
|
42263
42389
|
row.append(mark, identity3, actions);
|
|
42264
|
-
rows.set(
|
|
42390
|
+
rows.set(record27.name, row);
|
|
42265
42391
|
return row;
|
|
42266
42392
|
};
|
|
42267
42393
|
const loginTypeLabel = (type) => type === "oauth" ? messages.typeOauth : type === "api_key" ? messages.typeApiKey : messages.typeOther;
|
|
@@ -42414,7 +42540,7 @@ ${detail}` : ""}`
|
|
|
42414
42540
|
const label = document2.createElement("strong");
|
|
42415
42541
|
label.textContent = shown(choice.label);
|
|
42416
42542
|
label.translate = false;
|
|
42417
|
-
const existing = importedRecords().find((
|
|
42543
|
+
const existing = importedRecords().find((record27) => record27.source.id === choice.id);
|
|
42418
42544
|
const agent = choice.harnessId;
|
|
42419
42545
|
const detail = document2.createElement("span");
|
|
42420
42546
|
detail.textContent = [
|
|
@@ -42455,7 +42581,7 @@ ${detail}` : ""}`
|
|
|
42455
42581
|
const name = request.action === "list" ? void 0 : request.name;
|
|
42456
42582
|
state = {
|
|
42457
42583
|
source: state.source,
|
|
42458
|
-
record: importedRecords().find((
|
|
42584
|
+
record: importedRecords().find((record27) => record27.name === name) ?? state.record
|
|
42459
42585
|
};
|
|
42460
42586
|
show(next);
|
|
42461
42587
|
} else {
|
|
@@ -42469,12 +42595,12 @@ ${detail}` : ""}`
|
|
|
42469
42595
|
sourceRadios = [];
|
|
42470
42596
|
body.replaceChildren();
|
|
42471
42597
|
controls.replaceChildren();
|
|
42472
|
-
const { source, record:
|
|
42598
|
+
const { source, record: record27 } = state;
|
|
42473
42599
|
const close = () => modal.close();
|
|
42474
42600
|
if (mode2 === "add" || mode2 === "reimport") {
|
|
42475
42601
|
title.textContent = mode2 === "add" ? messages.add : messages.reimport;
|
|
42476
42602
|
modal.setAttribute("aria-label", title.textContent);
|
|
42477
|
-
const active = source ??
|
|
42603
|
+
const active = source ?? record27?.source;
|
|
42478
42604
|
const choices = mode2 === "add" && state.choose ? compatibleSources() : [];
|
|
42479
42605
|
if (choices.length > 1) body.append(sourcePicker(choices));
|
|
42480
42606
|
else if (active) body.append(line(messages.source, shown(active.label)));
|
|
@@ -42483,8 +42609,8 @@ ${detail}` : ""}`
|
|
|
42483
42609
|
input.maxLength = 48;
|
|
42484
42610
|
input.autocomplete = "off";
|
|
42485
42611
|
input.spellcheck = false;
|
|
42486
|
-
input.value =
|
|
42487
|
-
input.readOnly = Boolean(
|
|
42612
|
+
input.value = record27?.name ?? (source ? defaultImportName(source, importedRecords()) : "codex");
|
|
42613
|
+
input.readOnly = Boolean(record27);
|
|
42488
42614
|
input.addEventListener("input", () => {
|
|
42489
42615
|
nameEdited = true;
|
|
42490
42616
|
});
|
|
@@ -42518,7 +42644,7 @@ ${detail}` : ""}`
|
|
|
42518
42644
|
{
|
|
42519
42645
|
action: mode2 === "reimport" ? "reimport" : "import",
|
|
42520
42646
|
sourceId: source2.id,
|
|
42521
|
-
name:
|
|
42647
|
+
name: record27?.name ?? input.value,
|
|
42522
42648
|
confirmed: true
|
|
42523
42649
|
},
|
|
42524
42650
|
"done"
|
|
@@ -42528,16 +42654,16 @@ ${detail}` : ""}`
|
|
|
42528
42654
|
)
|
|
42529
42655
|
);
|
|
42530
42656
|
(mode2 === "add" ? input : controls.children[0]).focus();
|
|
42531
|
-
} else if (mode2 === "remove" &&
|
|
42657
|
+
} else if (mode2 === "remove" && record27) {
|
|
42532
42658
|
title.textContent = messages.remove;
|
|
42533
42659
|
modal.setAttribute("aria-label", title.textContent);
|
|
42534
|
-
body.append(note(messages.removeWarning.replace("{name}",
|
|
42660
|
+
body.append(note(messages.removeWarning.replace("{name}", record27.name)));
|
|
42535
42661
|
const cancel = command(messages.cancel, close);
|
|
42536
42662
|
controls.append(
|
|
42537
42663
|
cancel,
|
|
42538
42664
|
command(
|
|
42539
42665
|
messages.remove,
|
|
42540
|
-
() => submit({ action: "remove", name:
|
|
42666
|
+
() => submit({ action: "remove", name: record27.name, confirmed: true }, null),
|
|
42541
42667
|
"danger"
|
|
42542
42668
|
)
|
|
42543
42669
|
);
|
|
@@ -42545,7 +42671,7 @@ ${detail}` : ""}`
|
|
|
42545
42671
|
} else {
|
|
42546
42672
|
title.textContent = messages.doneTitle;
|
|
42547
42673
|
modal.setAttribute("aria-label", title.textContent);
|
|
42548
|
-
const name =
|
|
42674
|
+
const name = record27?.name;
|
|
42549
42675
|
if (name) body.append(line(messages.entry, `${name}/\u2026`, true));
|
|
42550
42676
|
body.append(note(messages.done));
|
|
42551
42677
|
const done = command(messages.close, close, "primary");
|
|
@@ -42592,21 +42718,21 @@ ${detail}` : ""}`
|
|
|
42592
42718
|
(candidate) => candidate.harnessId === TARGET_HARNESS_ID && source && candidate.providers.includes(source.provider)
|
|
42593
42719
|
);
|
|
42594
42720
|
if (!source || !target2) return null;
|
|
42595
|
-
const
|
|
42721
|
+
const record27 = target2.imports.find((candidate) => candidate.source.id === source.id);
|
|
42596
42722
|
const key = `${harnessId}:${accountLabel}:import`;
|
|
42597
42723
|
const button2 = document2.createElement("button");
|
|
42598
42724
|
button2.type = "button";
|
|
42599
42725
|
button2.className = "settings-account-pi-import";
|
|
42600
42726
|
button2.dataset.accountFocus = key;
|
|
42601
42727
|
button2.disabled = busy;
|
|
42602
|
-
const hint =
|
|
42728
|
+
const hint = record27 ? messages.importedHint.replace("{name}", record27.name) : messages.add;
|
|
42603
42729
|
button2.title = hint;
|
|
42604
42730
|
button2.setAttribute("aria-label", hint);
|
|
42605
42731
|
button2.append(createRendererAgentIcon("pi", 12, document2, pluginFor("pi")));
|
|
42606
|
-
if (
|
|
42732
|
+
if (record27) {
|
|
42607
42733
|
button2.dataset.state = "imported";
|
|
42608
42734
|
const name = document2.createElement("code");
|
|
42609
|
-
name.textContent = `${
|
|
42735
|
+
name.textContent = `${record27.name}/\u2026`;
|
|
42610
42736
|
name.translate = false;
|
|
42611
42737
|
button2.append(name, createRendererSettingsIcon("check", 12));
|
|
42612
42738
|
} else {
|
|
@@ -42614,7 +42740,7 @@ ${detail}` : ""}`
|
|
|
42614
42740
|
button2.append(messages.add);
|
|
42615
42741
|
}
|
|
42616
42742
|
button2.addEventListener("click", () => {
|
|
42617
|
-
if (!
|
|
42743
|
+
if (!record27) {
|
|
42618
42744
|
openDialog("add", { source }, key);
|
|
42619
42745
|
return;
|
|
42620
42746
|
}
|
|
@@ -42623,7 +42749,7 @@ ${detail}` : ""}`
|
|
|
42623
42749
|
renderSection();
|
|
42624
42750
|
sectionToggle.setAttribute("aria-expanded", "true");
|
|
42625
42751
|
}
|
|
42626
|
-
const row = rows.get(
|
|
42752
|
+
const row = rows.get(record27.name);
|
|
42627
42753
|
row?.scrollIntoView({ block: "nearest", behavior: "smooth" });
|
|
42628
42754
|
row?.focus();
|
|
42629
42755
|
});
|
|
@@ -49943,7 +50069,7 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
49943
50069
|
place();
|
|
49944
50070
|
const observer = ownerWindow ? new ownerWindow.MutationObserver((records) => {
|
|
49945
50071
|
const titlebar = source?.closest("[data-app-shell-titlebar]");
|
|
49946
|
-
if (!source?.isConnected || records.some((
|
|
50072
|
+
if (!source?.isConnected || records.some((record27) => titlebar?.contains(record27.target))) {
|
|
49947
50073
|
place();
|
|
49948
50074
|
}
|
|
49949
50075
|
}) : null;
|
|
@@ -55156,168 +55282,67 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55156
55282
|
return binding;
|
|
55157
55283
|
}
|
|
55158
55284
|
|
|
55159
|
-
// src/renderer-
|
|
55160
|
-
var
|
|
55161
|
-
|
|
55162
|
-
|
|
55163
|
-
|
|
55164
|
-
{
|
|
55165
|
-
|
|
55166
|
-
|
|
55167
|
-
|
|
55168
|
-
|
|
55169
|
-
services: "fN"
|
|
55170
|
-
}
|
|
55171
|
-
];
|
|
55172
|
-
function isRecord17(value) {
|
|
55173
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
55174
|
-
}
|
|
55175
|
-
function hashedAppServices(value) {
|
|
55176
|
-
return isRecord17(value) && isRecord17(value.appServices) ? value.appServices : void 0;
|
|
55177
|
-
}
|
|
55178
|
-
function routeExternalVoiceLaunch(request, routing, owner = globalThis) {
|
|
55179
|
-
rememberVoiceProductExperience(request, owner);
|
|
55180
|
-
if (!routing || !isRecord17(request) || request.source !== "composer_button_new_thread")
|
|
55181
|
-
return request;
|
|
55182
|
-
if (request.productExperience === "chat") return request;
|
|
55183
|
-
const hostId2 = request.hostId ?? "local";
|
|
55184
|
-
if (typeof hostId2 !== "string" || !hostId2) return request;
|
|
55185
|
-
const route = routing.forComposer();
|
|
55186
|
-
if (!route || route.hostId !== hostId2 || routing.forHost(hostId2) !== route) return request;
|
|
55187
|
-
const model2 = route.policy.selectedModel();
|
|
55188
|
-
if (typeof model2 !== "string" || !model2.startsWith("codexhost/")) return request;
|
|
55285
|
+
// src/renderer-voice-starter-core.ts
|
|
55286
|
+
var record18 = (v) => v !== null && typeof v === "object";
|
|
55287
|
+
function gatewayVoiceStartRequest(request, workGateway, chatGateway = false, externalHarness = false) {
|
|
55288
|
+
if (!record18(request) || request.productExperience !== "work" && request.productExperience !== "codex" && request.productExperience !== "chat")
|
|
55289
|
+
return false;
|
|
55290
|
+
if (request.source === "composer_button_existing_thread") {
|
|
55291
|
+
if (!record18(request.locator) || request.locator.hostId !== "local") return false;
|
|
55292
|
+
} else if (request.source !== "composer_button_new_thread" || (request.hostId ?? "local") !== "local")
|
|
55293
|
+
return false;
|
|
55294
|
+
if (request.productExperience === "chat") return chatGateway;
|
|
55189
55295
|
const mode2 = request.activeCollaborationMode;
|
|
55190
|
-
|
|
55191
|
-
const
|
|
55192
|
-
if (
|
|
55193
|
-
return
|
|
55194
|
-
...request,
|
|
55195
|
-
activeCollaborationMode: {
|
|
55196
|
-
...isRecord17(mode2) ? mode2 : { mode: "default" },
|
|
55197
|
-
settings: {
|
|
55198
|
-
reasoning_effort: null,
|
|
55199
|
-
developer_instructions: null,
|
|
55200
|
-
...isRecord17(settings) ? settings : {},
|
|
55201
|
-
model: model2
|
|
55202
|
-
}
|
|
55203
|
-
}
|
|
55204
|
-
};
|
|
55205
|
-
}
|
|
55206
|
-
function ownedChatgptChatStartUnavailable(request, owner = globalThis) {
|
|
55207
|
-
if (!isRecord17(request) || request.productExperience !== "chat") return;
|
|
55208
|
-
if (!nativeChatVoicePreferenceAllowsStart(owner)) return;
|
|
55209
|
-
if (!readCpaLiveVoiceHookConfig(owner)) return;
|
|
55210
|
-
return chatVoiceQualifiedOnOwner(owner) ? "Native Chat voice is unavailable" : chatVoiceUserFacingUnavailable(owner);
|
|
55296
|
+
const settings = record18(mode2) ? mode2.settings : void 0;
|
|
55297
|
+
const model2 = record18(settings) ? settings.model : void 0;
|
|
55298
|
+
if (typeof model2 === "string" && model2.startsWith("codexhost/")) return externalHarness;
|
|
55299
|
+
return workGateway || externalHarness;
|
|
55211
55300
|
}
|
|
55212
|
-
function
|
|
55213
|
-
|
|
55214
|
-
|
|
55215
|
-
|
|
55216
|
-
|
|
55217
|
-
|
|
55218
|
-
|
|
55219
|
-
|
|
55220
|
-
|
|
55221
|
-
|
|
55222
|
-
|
|
55223
|
-
const importModule = options.importModule ?? ((url2) => import(url2));
|
|
55224
|
-
let disposed = false;
|
|
55225
|
-
let timer;
|
|
55226
|
-
let restore;
|
|
55227
|
-
let module;
|
|
55228
|
-
const started = Date.now();
|
|
55229
|
-
const handle = {
|
|
55230
|
-
status: "pending",
|
|
55231
|
-
dispose() {
|
|
55232
|
-
disposed = true;
|
|
55233
|
-
if (timer !== void 0) target2.clearTimeout(timer);
|
|
55234
|
-
restore?.();
|
|
55235
|
-
if (target2[HOOK_GLOBAL4] === handle) Reflect.deleteProperty(target2, HOOK_GLOBAL4);
|
|
55236
|
-
}
|
|
55237
|
-
};
|
|
55238
|
-
target2[HOOK_GLOBAL4] = handle;
|
|
55239
|
-
const attempt = async () => {
|
|
55240
|
-
if (disposed) return;
|
|
55241
|
-
try {
|
|
55242
|
-
const names = loadedAssetNames(target2.document, target2.performance);
|
|
55243
|
-
const wrapRuntime = (services) => {
|
|
55244
|
-
const original = services.realtimeVoiceRuntime;
|
|
55245
|
-
if (typeof original !== "function" && !isRecord17(original)) return false;
|
|
55246
|
-
const start = Reflect.get(original, "requestRealtimeStart");
|
|
55247
|
-
if (typeof start !== "function") return false;
|
|
55248
|
-
const launch = (...args) => {
|
|
55249
|
-
let request = args[0];
|
|
55250
|
-
const chatStart = startNativeChatVoiceForRequest(request, target2);
|
|
55251
|
-
if (chatStart) return chatStart;
|
|
55252
|
-
const ownedChatUnavailable = ownedChatgptChatStartUnavailable(request, target2);
|
|
55253
|
-
if (ownedChatUnavailable) {
|
|
55254
|
-
rememberVoiceProductExperience(request, target2);
|
|
55255
|
-
throw new Error(ownedChatUnavailable);
|
|
55256
|
-
}
|
|
55257
|
-
try {
|
|
55258
|
-
request = routeExternalVoiceLaunch(request, target2.__codexhostHostRoutingV1, target2);
|
|
55259
|
-
} catch {
|
|
55260
|
-
}
|
|
55261
|
-
return Reflect.apply(start, original, [request, ...args.slice(1)]);
|
|
55262
|
-
};
|
|
55263
|
-
const wrapped = new Proxy(original, {
|
|
55264
|
-
get(service, key, receiver) {
|
|
55265
|
-
return key === "requestRealtimeStart" ? launch : Reflect.get(service, key, receiver);
|
|
55266
|
-
}
|
|
55267
|
-
});
|
|
55268
|
-
if (!Reflect.set(services, "realtimeVoiceRuntime", wrapped)) return false;
|
|
55269
|
-
restore = () => {
|
|
55270
|
-
if (services.realtimeVoiceRuntime === wrapped) services.realtimeVoiceRuntime = original;
|
|
55271
|
-
};
|
|
55272
|
-
handle.status = "active";
|
|
55273
|
-
return true;
|
|
55274
|
-
};
|
|
55275
|
-
if (hashed) {
|
|
55276
|
-
if (names.some((name) => name.includes(HASHED_WEBPACK_VOICE_RUNTIME_ASSET))) {
|
|
55277
|
-
const req = await resolveHashedWebpackRequire(importModule);
|
|
55278
|
-
if (disposed) return;
|
|
55279
|
-
let ga;
|
|
55280
|
-
try {
|
|
55281
|
-
ga = req?.("GaA7");
|
|
55282
|
-
} catch {
|
|
55283
|
-
ga = void 0;
|
|
55284
|
-
}
|
|
55285
|
-
const services = hashedAppServices(ga);
|
|
55286
|
-
if (services && wrapRuntime(services)) return;
|
|
55287
|
-
}
|
|
55288
|
-
} else {
|
|
55289
|
-
const assets = selectVoiceAssets(
|
|
55290
|
-
LAUNCH_ASSETS,
|
|
55291
|
-
names,
|
|
55292
|
-
config2.desktopVersion,
|
|
55293
|
-
config2.desktopPlatform
|
|
55301
|
+
function wrapGatewayVoiceStarter(start, options) {
|
|
55302
|
+
let active;
|
|
55303
|
+
return {
|
|
55304
|
+
async start(...args) {
|
|
55305
|
+
const request = args[0];
|
|
55306
|
+
const qualified = options.qualifies(request);
|
|
55307
|
+
const wantsGateway = options.configured?.(request) ?? qualified;
|
|
55308
|
+
if (!wantsGateway) return start(...args);
|
|
55309
|
+
if (!qualified) {
|
|
55310
|
+
throw new Error(
|
|
55311
|
+
options.unavailable?.(request) ?? "Work voice is not qualified on this Desktop."
|
|
55294
55312
|
);
|
|
55295
|
-
if (assets) {
|
|
55296
|
-
module ??= await importModule(`app://-/assets/${assets.shared}`);
|
|
55297
|
-
if (disposed) return;
|
|
55298
|
-
const services = module?.[assets.services];
|
|
55299
|
-
if (isRecord17(services) && wrapRuntime(services)) return;
|
|
55300
|
-
}
|
|
55301
55313
|
}
|
|
55302
|
-
|
|
55303
|
-
|
|
55304
|
-
|
|
55305
|
-
|
|
55306
|
-
|
|
55307
|
-
|
|
55308
|
-
|
|
55314
|
+
if (active) {
|
|
55315
|
+
active.binding?.dispose();
|
|
55316
|
+
active = void 0;
|
|
55317
|
+
}
|
|
55318
|
+
const attempt = {};
|
|
55319
|
+
active = attempt;
|
|
55320
|
+
const allowed = () => active === attempt && options.qualifies(args[0]);
|
|
55321
|
+
try {
|
|
55322
|
+
if (!await options.ready()) throw new Error("Voice gateway is not ready");
|
|
55323
|
+
if (!allowed()) throw new Error("Voice gateway start was cancelled");
|
|
55324
|
+
attempt.binding = await options.prepare(allowed);
|
|
55325
|
+
await options.committed(attempt.binding);
|
|
55326
|
+
if (!allowed()) throw new Error("Voice gateway start was cancelled");
|
|
55327
|
+
if (!attempt.binding.current()) throw new Error("Voice starter subscription changed");
|
|
55328
|
+
rememberVoiceProductExperience(args[0]);
|
|
55329
|
+
return await start(...args);
|
|
55330
|
+
} finally {
|
|
55331
|
+
attempt.binding?.dispose();
|
|
55332
|
+
if (active === attempt) active = void 0;
|
|
55333
|
+
}
|
|
55334
|
+
},
|
|
55335
|
+
cancel() {
|
|
55336
|
+
active?.binding?.dispose();
|
|
55337
|
+
active = void 0;
|
|
55309
55338
|
}
|
|
55310
|
-
timer = target2.setTimeout(() => void attempt(), 250);
|
|
55311
55339
|
};
|
|
55312
|
-
void attempt();
|
|
55313
|
-
return handle;
|
|
55314
55340
|
}
|
|
55315
55341
|
|
|
55316
|
-
// src/renderer-voice-capability.ts
|
|
55317
|
-
var GLOBAL = "__codexhostVoiceCapabilityV1";
|
|
55342
|
+
// src/renderer-voice-capability-subscriptions.ts
|
|
55318
55343
|
var INFERENCE_GATE = "3683713372";
|
|
55319
|
-
var
|
|
55320
|
-
var capable = (value) =>
|
|
55344
|
+
var record19 = (value) => value !== null && typeof value === "object";
|
|
55345
|
+
var capable = (value) => record19(value) && typeof value.isLoading === "boolean" && typeof value.isError === "boolean" && typeof value.isCapable === "boolean";
|
|
55321
55346
|
var equal = (a, b) => a.isLoading === b.isLoading && a.isError === b.isError && a.isCapable === b.isCapable;
|
|
55322
55347
|
function replayVoiceCapability(store, atom, gate) {
|
|
55323
55348
|
const evaluate = (override) => {
|
|
@@ -55355,7 +55380,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55355
55380
|
}
|
|
55356
55381
|
}
|
|
55357
55382
|
function isFamily(value) {
|
|
55358
|
-
return
|
|
55383
|
+
return record19(value) && record19(value.scope) && typeof value.resolve === "function";
|
|
55359
55384
|
}
|
|
55360
55385
|
function isReadableCapabilityFamily(value) {
|
|
55361
55386
|
return isFamily(value) && value.kind === "readable-family" && typeof value.read === "function";
|
|
@@ -55364,7 +55389,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55364
55389
|
return isFamily(value) && value.kind === "signal-family";
|
|
55365
55390
|
}
|
|
55366
55391
|
function isDerivedAccessFactory(value) {
|
|
55367
|
-
return
|
|
55392
|
+
return record19(value) && record19(value.scope) && (typeof value.cache === "string" || record19(value.cache)) && typeof value.resolve === "function" && typeof value.createSubscriberAtom === "function" && typeof value.read !== "function" && value.kind == null;
|
|
55368
55393
|
}
|
|
55369
55394
|
function hashedVoiceCapabilityFamilies(req) {
|
|
55370
55395
|
const roles = HASHED_OVERLAY_VOICE_ROLES;
|
|
@@ -55386,9 +55411,9 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55386
55411
|
} catch {
|
|
55387
55412
|
return { reason: "access-shape" };
|
|
55388
55413
|
}
|
|
55389
|
-
const family =
|
|
55390
|
-
const gates =
|
|
55391
|
-
const access =
|
|
55414
|
+
const family = record19(capabilityExports) ? capabilityExports[roles.capabilityExport] : void 0;
|
|
55415
|
+
const gates = record19(gateExports) ? gateExports[roles.inferenceGateExport] : void 0;
|
|
55416
|
+
const access = record19(accessExports) ? accessExports[roles.voiceAccessExport] : void 0;
|
|
55392
55417
|
if (!isReadableCapabilityFamily(family) || !isSignalGateFamily(gates)) return;
|
|
55393
55418
|
if (!isDerivedAccessFactory(access)) return { reason: "access-shape" };
|
|
55394
55419
|
return { family, gates, access };
|
|
@@ -55396,7 +55421,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55396
55421
|
function resolveDerivedAccessAtom(factory, node, chain) {
|
|
55397
55422
|
try {
|
|
55398
55423
|
const resolved = factory.resolve(node, chain);
|
|
55399
|
-
if (
|
|
55424
|
+
if (record19(resolved) && typeof resolved.read === "function" && !("atom" in resolved))
|
|
55400
55425
|
return resolved;
|
|
55401
55426
|
return void 0;
|
|
55402
55427
|
} catch {
|
|
@@ -55405,7 +55430,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55405
55430
|
}
|
|
55406
55431
|
var ALLOWED_ACCESS = { status: "allowed" };
|
|
55407
55432
|
function unsupportedAuthAccess(value) {
|
|
55408
|
-
return
|
|
55433
|
+
return record19(value) && value.status === "denied" && value.reason === HASHED_26_1106_VOICE_EVALUATOR.unsupportedAuthReason;
|
|
55409
55434
|
}
|
|
55410
55435
|
function replayHashedWorkAccessCapability(store, atom, access) {
|
|
55411
55436
|
const evaluate = (override) => {
|
|
@@ -55457,49 +55482,13 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55457
55482
|
const result = [];
|
|
55458
55483
|
const seen = /* @__PURE__ */ new Set();
|
|
55459
55484
|
let hook = fiber.memoizedState;
|
|
55460
|
-
while (
|
|
55485
|
+
while (record19(hook) && result.length < 4096 && !seen.has(hook)) {
|
|
55461
55486
|
seen.add(hook);
|
|
55462
55487
|
result.push(hook);
|
|
55463
55488
|
hook = hook.next;
|
|
55464
55489
|
}
|
|
55465
55490
|
return hook == null ? result : [];
|
|
55466
55491
|
}
|
|
55467
|
-
function composerFibers(composer, chat = false) {
|
|
55468
|
-
const fibers = /* @__PURE__ */ new Set();
|
|
55469
|
-
const rootKey = Object.getOwnPropertyNames(composer).find(
|
|
55470
|
-
(key) => key.startsWith("__reactFiber$")
|
|
55471
|
-
);
|
|
55472
|
-
const ancestors2 = rootKey ? committedReactAncestors(Object.getOwnPropertyDescriptor(composer, rootKey)?.value) : [];
|
|
55473
|
-
let root = ancestors2[0];
|
|
55474
|
-
if (chat) {
|
|
55475
|
-
const owners = ancestors2.filter(
|
|
55476
|
-
({ memoizedProps: props }) => record18(props) && props.isWorkConversation === false && props.isTemporaryChat === false && props.shouldBlockExternalEgress === false && props.readOnly !== true && typeof props.conversationId === "string" && record18(props.composerSelectionContext) && props.composerSelectionContext.conversationId === props.conversationId
|
|
55477
|
-
);
|
|
55478
|
-
if (owners.length !== 1) return fibers;
|
|
55479
|
-
root = owners[0];
|
|
55480
|
-
}
|
|
55481
|
-
if (!root) return fibers;
|
|
55482
|
-
for (const element of [composer, ...composer.querySelectorAll("*")].slice(0, 2048)) {
|
|
55483
|
-
const key = Object.getOwnPropertyNames(element).find((key2) => key2.startsWith("__reactFiber$"));
|
|
55484
|
-
if (!key) continue;
|
|
55485
|
-
const ancestors3 = committedReactAncestors(Object.getOwnPropertyDescriptor(element, key)?.value);
|
|
55486
|
-
const boundary = ancestors3.indexOf(root);
|
|
55487
|
-
if (boundary < 0) continue;
|
|
55488
|
-
for (const fiber of ancestors3.slice(0, boundary + 1)) if (record18(fiber)) fibers.add(fiber);
|
|
55489
|
-
}
|
|
55490
|
-
return fibers;
|
|
55491
|
-
}
|
|
55492
|
-
function bindComposerVoiceCapability(composer, family, gates, allowed, chat = false, project3) {
|
|
55493
|
-
return bindVoiceCapabilitySubscriptions(
|
|
55494
|
-
() => composerFibers(composer, chat),
|
|
55495
|
-
family,
|
|
55496
|
-
gates,
|
|
55497
|
-
allowed,
|
|
55498
|
-
false,
|
|
55499
|
-
["voice.realtime", "voice.thread"],
|
|
55500
|
-
project3
|
|
55501
|
-
);
|
|
55502
|
-
}
|
|
55503
55492
|
function bindVoiceCapabilitySubscriptions(currentFibers, family, gates, allowed, realtimeOnly = false, names = ["voice.realtime", "voice.thread"], project3) {
|
|
55504
55493
|
const fibers = currentFibers();
|
|
55505
55494
|
const restores = [];
|
|
@@ -55509,7 +55498,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55509
55498
|
const list = hooks2(fiber);
|
|
55510
55499
|
for (const memo of list) {
|
|
55511
55500
|
const [signal, deps] = Array.isArray(memo.memoizedState) ? memo.memoizedState : [];
|
|
55512
|
-
if (!
|
|
55501
|
+
if (!record19(signal) || !Array.isArray(deps) || deps.length !== 5 || deps[3] !== family || !(deps[1] instanceof Map) || deps[2] !== void 0)
|
|
55513
55502
|
continue;
|
|
55514
55503
|
const chain = deps[1];
|
|
55515
55504
|
const node = chain.get(family.scope.id);
|
|
@@ -55518,7 +55507,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55518
55507
|
const matches = [...members].filter(([, member]) => member.cacheKey === deps[0]);
|
|
55519
55508
|
if (matches.length !== 1 || typeof matches[0]?.[0] !== "string") continue;
|
|
55520
55509
|
const parameter = JSON.parse(matches[0][0]);
|
|
55521
|
-
if (!
|
|
55510
|
+
if (!record19(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")
|
|
55522
55511
|
continue;
|
|
55523
55512
|
const subscriptions = list.filter((hook2) => {
|
|
55524
55513
|
const state = hook2.memoizedState;
|
|
@@ -55531,7 +55520,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55531
55520
|
const effect = hook.next?.next?.memoizedState;
|
|
55532
55521
|
const store = signal.store;
|
|
55533
55522
|
const gate = gates.resolve(node, chain, INFERENCE_GATE)?.atom;
|
|
55534
|
-
if (!gate || !instance || !
|
|
55523
|
+
if (!gate || !instance || !record19(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(
|
|
55535
55524
|
store.get(signal.atom),
|
|
55536
55525
|
subscriber.getSnapshot()
|
|
55537
55526
|
) || !equal(subscriber.getSnapshot(), instance.getSnapshot()) || subscriber.createRender?.() != null)
|
|
@@ -55625,6 +55614,46 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55625
55614
|
}
|
|
55626
55615
|
};
|
|
55627
55616
|
}
|
|
55617
|
+
|
|
55618
|
+
// src/renderer-voice-capability.ts
|
|
55619
|
+
var GLOBAL = "__codexhostVoiceCapabilityV1";
|
|
55620
|
+
var record20 = (value) => value !== null && typeof value === "object";
|
|
55621
|
+
function composerFibers(composer, chat = false) {
|
|
55622
|
+
const fibers = /* @__PURE__ */ new Set();
|
|
55623
|
+
const rootKey = Object.getOwnPropertyNames(composer).find(
|
|
55624
|
+
(key) => key.startsWith("__reactFiber$")
|
|
55625
|
+
);
|
|
55626
|
+
const ancestors2 = rootKey ? committedReactAncestors(Object.getOwnPropertyDescriptor(composer, rootKey)?.value) : [];
|
|
55627
|
+
let root = ancestors2[0];
|
|
55628
|
+
if (chat) {
|
|
55629
|
+
const owners = ancestors2.filter(
|
|
55630
|
+
({ memoizedProps: props }) => record20(props) && props.isWorkConversation === false && props.isTemporaryChat === false && props.shouldBlockExternalEgress === false && props.readOnly !== true && typeof props.conversationId === "string" && record20(props.composerSelectionContext) && props.composerSelectionContext.conversationId === props.conversationId
|
|
55631
|
+
);
|
|
55632
|
+
if (owners.length !== 1) return fibers;
|
|
55633
|
+
root = owners[0];
|
|
55634
|
+
}
|
|
55635
|
+
if (!root) return fibers;
|
|
55636
|
+
for (const element of [composer, ...composer.querySelectorAll("*")].slice(0, 2048)) {
|
|
55637
|
+
const key = Object.getOwnPropertyNames(element).find((key2) => key2.startsWith("__reactFiber$"));
|
|
55638
|
+
if (!key) continue;
|
|
55639
|
+
const ancestors3 = committedReactAncestors(Object.getOwnPropertyDescriptor(element, key)?.value);
|
|
55640
|
+
const boundary = ancestors3.indexOf(root);
|
|
55641
|
+
if (boundary < 0) continue;
|
|
55642
|
+
for (const fiber of ancestors3.slice(0, boundary + 1)) if (record20(fiber)) fibers.add(fiber);
|
|
55643
|
+
}
|
|
55644
|
+
return fibers;
|
|
55645
|
+
}
|
|
55646
|
+
function bindComposerVoiceCapability(composer, family, gates, allowed, chat = false, project3) {
|
|
55647
|
+
return bindVoiceCapabilitySubscriptions(
|
|
55648
|
+
() => composerFibers(composer, chat),
|
|
55649
|
+
family,
|
|
55650
|
+
gates,
|
|
55651
|
+
allowed,
|
|
55652
|
+
false,
|
|
55653
|
+
["voice.realtime", "voice.thread"],
|
|
55654
|
+
project3
|
|
55655
|
+
);
|
|
55656
|
+
}
|
|
55628
55657
|
function installVoiceCapabilityProjection(options = {}) {
|
|
55629
55658
|
const target2 = options.target ?? globalThis;
|
|
55630
55659
|
const revision = voiceImplementationRevision();
|
|
@@ -55648,6 +55677,9 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55648
55677
|
status: "pending",
|
|
55649
55678
|
reason: "pending",
|
|
55650
55679
|
revision,
|
|
55680
|
+
current() {
|
|
55681
|
+
return !disposed && allowed() && binding?.current() === true;
|
|
55682
|
+
},
|
|
55651
55683
|
dispose() {
|
|
55652
55684
|
disposed = true;
|
|
55653
55685
|
target2.clearTimeout(timer);
|
|
@@ -55667,7 +55699,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55667
55699
|
target2[GLOBAL] = handle;
|
|
55668
55700
|
const hookActive = (key) => {
|
|
55669
55701
|
const hook = target2[key];
|
|
55670
|
-
return
|
|
55702
|
+
return record20(hook) && hook.status === "active";
|
|
55671
55703
|
};
|
|
55672
55704
|
const currentRoute = () => {
|
|
55673
55705
|
try {
|
|
@@ -55778,8 +55810,299 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55778
55810
|
return handle;
|
|
55779
55811
|
}
|
|
55780
55812
|
|
|
55813
|
+
// src/renderer-hashed-gateway-start.ts
|
|
55814
|
+
var record21 = (v) => v !== null && typeof v === "object";
|
|
55815
|
+
var OVERLAY_CAPABILITY = "__codexhostVoiceCapabilityV1";
|
|
55816
|
+
var COMMIT_POLL_MS = 50;
|
|
55817
|
+
var COMMIT_POLLS = 40;
|
|
55818
|
+
function committedCapability(target2) {
|
|
55819
|
+
const capability = target2[OVERLAY_CAPABILITY];
|
|
55820
|
+
if (!record21(capability) || capability.status !== "active" || typeof capability.current !== "function" || typeof capability.dispose !== "function")
|
|
55821
|
+
return;
|
|
55822
|
+
return capability;
|
|
55823
|
+
}
|
|
55824
|
+
function workLane(request) {
|
|
55825
|
+
const mode2 = record21(request) ? request.activeCollaborationMode : void 0;
|
|
55826
|
+
const settings = record21(mode2) ? mode2.settings : void 0;
|
|
55827
|
+
const model2 = record21(settings) ? settings.model : void 0;
|
|
55828
|
+
return typeof model2 === "string" && model2.startsWith("codexhost/") ? "work-grok" : "work-codex";
|
|
55829
|
+
}
|
|
55830
|
+
function hashedGatewayStarterOptions(target2, workGateway = () => cpaLiveVoicePreferenceAllowsInstall(target2), chatGateway = () => chatLiveVoicePreferenceAllowsOverride(target2), external = () => false) {
|
|
55831
|
+
const configured = (request) => gatewayVoiceStartRequest(
|
|
55832
|
+
request,
|
|
55833
|
+
workGateway(),
|
|
55834
|
+
chatGateway(),
|
|
55835
|
+
external() || workLane(request) === "work-grok"
|
|
55836
|
+
);
|
|
55837
|
+
return {
|
|
55838
|
+
configured,
|
|
55839
|
+
qualifies: (request) => {
|
|
55840
|
+
const lane = workLane(request);
|
|
55841
|
+
return gatewayVoiceStartRequest(
|
|
55842
|
+
request,
|
|
55843
|
+
lane === "work-codex" && workGateway() && workVoiceLaneEnabled(target2, "work-codex"),
|
|
55844
|
+
chatGateway(),
|
|
55845
|
+
lane === "work-grok" && workVoiceLaneEnabled(target2, "work-grok")
|
|
55846
|
+
);
|
|
55847
|
+
},
|
|
55848
|
+
unavailable: (request) => workVoiceUserFacingUnavailable(target2, workLane(request)),
|
|
55849
|
+
ready: async () => {
|
|
55850
|
+
for (let i = 0; i < COMMIT_POLLS; i += 1) {
|
|
55851
|
+
const client = target2.__codexhostClientOwnedVoiceV1;
|
|
55852
|
+
if (record21(client) && client.status === "active" && committedCapability(target2) !== void 0)
|
|
55853
|
+
return true;
|
|
55854
|
+
await new Promise((resolve) => target2.setTimeout(resolve, COMMIT_POLL_MS));
|
|
55855
|
+
}
|
|
55856
|
+
return false;
|
|
55857
|
+
},
|
|
55858
|
+
prepare: async () => {
|
|
55859
|
+
const capability = committedCapability(target2);
|
|
55860
|
+
if (!capability) throw new Error("Overlay voice capability is not ready");
|
|
55861
|
+
return {
|
|
55862
|
+
// The capability install owns the subscription; a start only reads it.
|
|
55863
|
+
dispose() {
|
|
55864
|
+
},
|
|
55865
|
+
current: () => target2[OVERLAY_CAPABILITY] === capability && capability.current()
|
|
55866
|
+
};
|
|
55867
|
+
},
|
|
55868
|
+
committed: async (binding) => {
|
|
55869
|
+
for (let i = 0; i < COMMIT_POLLS && !binding.current(); i += 1)
|
|
55870
|
+
await new Promise((resolve) => target2.setTimeout(resolve, COMMIT_POLL_MS));
|
|
55871
|
+
}
|
|
55872
|
+
};
|
|
55873
|
+
}
|
|
55874
|
+
|
|
55875
|
+
// src/renderer-external-voice-launch.ts
|
|
55876
|
+
var HOOK_GLOBAL4 = "__codexhostExternalVoiceLaunchV1";
|
|
55877
|
+
var SHARED_ASSET = "app-shared-8bd9d0399038.js";
|
|
55878
|
+
var LAUNCH_ASSETS = [
|
|
55879
|
+
...CLIENT_OWNED_VOICE_ASSETS,
|
|
55880
|
+
{
|
|
55881
|
+
platform: "darwin",
|
|
55882
|
+
version: AUDITED_CPA_LIVE_VOICE_DESKTOP_VERSION,
|
|
55883
|
+
initial: AUDITED_CPA_LIVE_VOICE_APP_INITIAL_ASSET,
|
|
55884
|
+
shared: SHARED_ASSET,
|
|
55885
|
+
services: "fN"
|
|
55886
|
+
}
|
|
55887
|
+
];
|
|
55888
|
+
function isRecord17(value) {
|
|
55889
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
55890
|
+
}
|
|
55891
|
+
function hashedAppServices(value) {
|
|
55892
|
+
return isRecord17(value) && isRecord17(value.appServices) ? value.appServices : void 0;
|
|
55893
|
+
}
|
|
55894
|
+
function routeExternalVoiceLaunch(request, routing, owner = globalThis) {
|
|
55895
|
+
rememberVoiceProductExperience(request, owner);
|
|
55896
|
+
if (!routing || !isRecord17(request) || request.source !== "composer_button_new_thread")
|
|
55897
|
+
return request;
|
|
55898
|
+
if (request.productExperience === "chat") return request;
|
|
55899
|
+
const hostId2 = request.hostId ?? "local";
|
|
55900
|
+
if (typeof hostId2 !== "string" || !hostId2) return request;
|
|
55901
|
+
const route = routing.forComposer();
|
|
55902
|
+
if (!route || route.hostId !== hostId2 || routing.forHost(hostId2) !== route) return request;
|
|
55903
|
+
const model2 = route.policy.selectedModel();
|
|
55904
|
+
if (typeof model2 !== "string" || !model2.startsWith("codexhost/")) return request;
|
|
55905
|
+
const mode2 = request.activeCollaborationMode;
|
|
55906
|
+
if (mode2 !== void 0 && mode2 !== null && !isRecord17(mode2)) return request;
|
|
55907
|
+
const settings = isRecord17(mode2) ? mode2.settings : void 0;
|
|
55908
|
+
if (settings !== void 0 && settings !== null && !isRecord17(settings)) return request;
|
|
55909
|
+
return {
|
|
55910
|
+
...request,
|
|
55911
|
+
activeCollaborationMode: {
|
|
55912
|
+
...isRecord17(mode2) ? mode2 : { mode: "default" },
|
|
55913
|
+
settings: {
|
|
55914
|
+
reasoning_effort: null,
|
|
55915
|
+
developer_instructions: null,
|
|
55916
|
+
...isRecord17(settings) ? settings : {},
|
|
55917
|
+
model: model2
|
|
55918
|
+
}
|
|
55919
|
+
}
|
|
55920
|
+
};
|
|
55921
|
+
}
|
|
55922
|
+
function ownedChatgptChatStartUnavailable(request, owner = globalThis) {
|
|
55923
|
+
if (!isRecord17(request) || request.productExperience !== "chat") return;
|
|
55924
|
+
if (!nativeChatVoicePreferenceAllowsStart(owner)) return;
|
|
55925
|
+
if (!readCpaLiveVoiceHookConfig(owner)) return;
|
|
55926
|
+
return chatVoiceQualifiedOnOwner(owner) ? "Native Chat voice is unavailable" : chatVoiceUserFacingUnavailable(owner);
|
|
55927
|
+
}
|
|
55928
|
+
function installExternalVoiceLaunchHook(options = {}) {
|
|
55929
|
+
const target2 = options.target ?? globalThis;
|
|
55930
|
+
const existing = target2[HOOK_GLOBAL4];
|
|
55931
|
+
if (existing) return existing;
|
|
55932
|
+
const config2 = readCpaLiveVoiceHookConfig(target2);
|
|
55933
|
+
if (!config2) return { status: "disabled", dispose() {
|
|
55934
|
+
} };
|
|
55935
|
+
const hashed = hashedNativeChatVoiceSupported(config2);
|
|
55936
|
+
if (!hashed && (config2.auditedDesktopVersion !== AUDITED_CPA_LIVE_VOICE_DESKTOP_VERSION || config2.auditedAppInitialAsset !== AUDITED_CPA_LIVE_VOICE_APP_INITIAL_ASSET || config2.desktopVersion !== void 0 && config2.desktopVersion !== config2.auditedDesktopVersion && !supportsVoiceVersion(CLIENT_OWNED_VOICE_ASSETS, config2.desktopVersion)))
|
|
55937
|
+
return { status: "unsupported", dispose() {
|
|
55938
|
+
} };
|
|
55939
|
+
const importModule = options.importModule ?? ((url2) => import(url2));
|
|
55940
|
+
let disposed = false;
|
|
55941
|
+
let timer;
|
|
55942
|
+
let restore;
|
|
55943
|
+
let module;
|
|
55944
|
+
const started = Date.now();
|
|
55945
|
+
const handle = {
|
|
55946
|
+
status: "pending",
|
|
55947
|
+
dispose() {
|
|
55948
|
+
disposed = true;
|
|
55949
|
+
if (timer !== void 0) target2.clearTimeout(timer);
|
|
55950
|
+
restore?.();
|
|
55951
|
+
if (target2[HOOK_GLOBAL4] === handle) Reflect.deleteProperty(target2, HOOK_GLOBAL4);
|
|
55952
|
+
}
|
|
55953
|
+
};
|
|
55954
|
+
target2[HOOK_GLOBAL4] = handle;
|
|
55955
|
+
const attempt = async () => {
|
|
55956
|
+
if (disposed) return;
|
|
55957
|
+
try {
|
|
55958
|
+
const names = loadedAssetNames(target2.document, target2.performance);
|
|
55959
|
+
const wrapRuntime = (services) => {
|
|
55960
|
+
const original = services.realtimeVoiceRuntime;
|
|
55961
|
+
if (typeof original !== "function" && !isRecord17(original)) return false;
|
|
55962
|
+
const start = Reflect.get(original, "requestRealtimeStart");
|
|
55963
|
+
if (typeof start !== "function") return false;
|
|
55964
|
+
const invoke2 = (...startArgs) => Reflect.apply(start, original, startArgs);
|
|
55965
|
+
const gatewayStarter = wrapGatewayVoiceStarter(
|
|
55966
|
+
invoke2,
|
|
55967
|
+
hashedGatewayStarterOptions(
|
|
55968
|
+
target2,
|
|
55969
|
+
() => cpaLiveVoicePreferenceAllowsInstall(target2),
|
|
55970
|
+
() => chatLiveVoicePreferenceAllowsOverride(target2),
|
|
55971
|
+
() => isExternalHarnessComposer(target2)
|
|
55972
|
+
)
|
|
55973
|
+
);
|
|
55974
|
+
const launch = (...args) => {
|
|
55975
|
+
let request = args[0];
|
|
55976
|
+
const chatStart = startNativeChatVoiceForRequest(request, target2);
|
|
55977
|
+
if (chatStart) return chatStart;
|
|
55978
|
+
const ownedChatUnavailable = ownedChatgptChatStartUnavailable(request, target2);
|
|
55979
|
+
if (ownedChatUnavailable) {
|
|
55980
|
+
rememberVoiceProductExperience(request, target2);
|
|
55981
|
+
throw new Error(ownedChatUnavailable);
|
|
55982
|
+
}
|
|
55983
|
+
try {
|
|
55984
|
+
request = routeExternalVoiceLaunch(request, target2.__codexhostHostRoutingV1, target2);
|
|
55985
|
+
} catch {
|
|
55986
|
+
}
|
|
55987
|
+
if (hashed && isRecord17(request) && request.productExperience === "codex" && request.source === "composer_button_new_thread") {
|
|
55988
|
+
request = { ...request, productExperience: "work" };
|
|
55989
|
+
}
|
|
55990
|
+
const experience = isRecord17(request) && typeof request.productExperience === "string" ? request.productExperience : "unset";
|
|
55991
|
+
if (hashed && gatewayVoiceStartRequest(
|
|
55992
|
+
request,
|
|
55993
|
+
cpaLiveVoicePreferenceAllowsInstall(target2),
|
|
55994
|
+
chatLiveVoicePreferenceAllowsOverride(target2),
|
|
55995
|
+
isExternalHarnessComposer(target2)
|
|
55996
|
+
)) {
|
|
55997
|
+
return gatewayStarter.start(request, ...args.slice(1)).then(
|
|
55998
|
+
(value) => {
|
|
55999
|
+
chatVoiceDebug("realtime-start", {
|
|
56000
|
+
productExperience: experience,
|
|
56001
|
+
outcome: "ok"
|
|
56002
|
+
});
|
|
56003
|
+
return value;
|
|
56004
|
+
},
|
|
56005
|
+
(error51) => {
|
|
56006
|
+
chatVoiceDebug("realtime-start", {
|
|
56007
|
+
productExperience: experience,
|
|
56008
|
+
outcome: "rejected"
|
|
56009
|
+
});
|
|
56010
|
+
throw error51;
|
|
56011
|
+
}
|
|
56012
|
+
);
|
|
56013
|
+
}
|
|
56014
|
+
try {
|
|
56015
|
+
const result = invoke2(request, ...args.slice(1));
|
|
56016
|
+
if (result && typeof result.then === "function") {
|
|
56017
|
+
return result.then(
|
|
56018
|
+
(value) => {
|
|
56019
|
+
chatVoiceDebug("realtime-start", {
|
|
56020
|
+
productExperience: experience,
|
|
56021
|
+
outcome: "ok"
|
|
56022
|
+
});
|
|
56023
|
+
return value;
|
|
56024
|
+
},
|
|
56025
|
+
(error51) => {
|
|
56026
|
+
chatVoiceDebug("realtime-start", {
|
|
56027
|
+
productExperience: experience,
|
|
56028
|
+
outcome: "rejected"
|
|
56029
|
+
});
|
|
56030
|
+
throw error51;
|
|
56031
|
+
}
|
|
56032
|
+
);
|
|
56033
|
+
}
|
|
56034
|
+
chatVoiceDebug("realtime-start", { productExperience: experience, outcome: "sync" });
|
|
56035
|
+
return result;
|
|
56036
|
+
} catch (error51) {
|
|
56037
|
+
chatVoiceDebug("realtime-start", { productExperience: experience, outcome: "throw" });
|
|
56038
|
+
throw error51;
|
|
56039
|
+
}
|
|
56040
|
+
};
|
|
56041
|
+
const wrapped = new Proxy(original, {
|
|
56042
|
+
get(service, key, receiver) {
|
|
56043
|
+
if (key === "requestRealtimeStart") return launch;
|
|
56044
|
+
if (key === "cancelRealtimeSessionStart") {
|
|
56045
|
+
const cancel = Reflect.get(service, key, receiver);
|
|
56046
|
+
if (typeof cancel === "function")
|
|
56047
|
+
return (...args) => {
|
|
56048
|
+
gatewayStarter.cancel();
|
|
56049
|
+
return Reflect.apply(cancel, original, args);
|
|
56050
|
+
};
|
|
56051
|
+
}
|
|
56052
|
+
return Reflect.get(service, key, receiver);
|
|
56053
|
+
}
|
|
56054
|
+
});
|
|
56055
|
+
if (!Reflect.set(services, "realtimeVoiceRuntime", wrapped)) return false;
|
|
56056
|
+
restore = () => {
|
|
56057
|
+
gatewayStarter.cancel();
|
|
56058
|
+
if (services.realtimeVoiceRuntime === wrapped) services.realtimeVoiceRuntime = original;
|
|
56059
|
+
};
|
|
56060
|
+
handle.status = "active";
|
|
56061
|
+
return true;
|
|
56062
|
+
};
|
|
56063
|
+
if (hashed) {
|
|
56064
|
+
if (names.some((name) => name.includes(HASHED_WEBPACK_VOICE_RUNTIME_ASSET))) {
|
|
56065
|
+
const req = await resolveHashedWebpackRequire(importModule);
|
|
56066
|
+
if (disposed) return;
|
|
56067
|
+
let ga;
|
|
56068
|
+
try {
|
|
56069
|
+
ga = req?.("GaA7");
|
|
56070
|
+
} catch {
|
|
56071
|
+
ga = void 0;
|
|
56072
|
+
}
|
|
56073
|
+
const services = hashedAppServices(ga);
|
|
56074
|
+
if (services && wrapRuntime(services)) return;
|
|
56075
|
+
}
|
|
56076
|
+
} else {
|
|
56077
|
+
const assets = selectVoiceAssets(
|
|
56078
|
+
LAUNCH_ASSETS,
|
|
56079
|
+
names,
|
|
56080
|
+
config2.desktopVersion,
|
|
56081
|
+
config2.desktopPlatform
|
|
56082
|
+
);
|
|
56083
|
+
if (assets) {
|
|
56084
|
+
module ??= await importModule(`app://-/assets/${assets.shared}`);
|
|
56085
|
+
if (disposed) return;
|
|
56086
|
+
const services = module?.[assets.services];
|
|
56087
|
+
if (isRecord17(services) && wrapRuntime(services)) return;
|
|
56088
|
+
}
|
|
56089
|
+
}
|
|
56090
|
+
} catch {
|
|
56091
|
+
handle.status = "unsupported";
|
|
56092
|
+
return;
|
|
56093
|
+
}
|
|
56094
|
+
if (Date.now() - started >= 6e4) {
|
|
56095
|
+
handle.status = "unsupported";
|
|
56096
|
+
return;
|
|
56097
|
+
}
|
|
56098
|
+
timer = target2.setTimeout(() => void attempt(), 250);
|
|
56099
|
+
};
|
|
56100
|
+
void attempt();
|
|
56101
|
+
return handle;
|
|
56102
|
+
}
|
|
56103
|
+
|
|
55781
56104
|
// src/renderer-voice-settings-availability.ts
|
|
55782
|
-
var
|
|
56105
|
+
var record22 = (value) => value !== null && typeof value === "object";
|
|
55783
56106
|
function voiceSettingsSurface(doc, page, appScope) {
|
|
55784
56107
|
const pages = /* @__PURE__ */ new Set();
|
|
55785
56108
|
const fibers = /* @__PURE__ */ new Set();
|
|
@@ -55802,8 +56125,8 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55802
56125
|
const scopes = /* @__PURE__ */ new Map();
|
|
55803
56126
|
for (const fiber of fibers)
|
|
55804
56127
|
for (const hook of hooks2(fiber)) {
|
|
55805
|
-
const scope2 =
|
|
55806
|
-
if (
|
|
56128
|
+
const scope2 = record22(hook.memoizedState) ? hook.memoizedState.current : void 0;
|
|
56129
|
+
if (record22(scope2) && scope2.scope === appScope && record22(scope2.node) && scope2.chain instanceof Map && scope2.chain.get(appScope.id) === scope2.node && typeof scope2.get === "function")
|
|
55807
56130
|
scopes.set(scope2.node, scope2);
|
|
55808
56131
|
}
|
|
55809
56132
|
const scope = [...scopes.values()][0];
|
|
@@ -55847,7 +56170,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55847
56170
|
for (const fiber of currentFibers())
|
|
55848
56171
|
for (const hook2 of hooks2(fiber)) {
|
|
55849
56172
|
const [subscriber2, deps] = Array.isArray(hook2.memoizedState) ? hook2.memoizedState : [];
|
|
55850
|
-
if (!
|
|
56173
|
+
if (!record22(subscriber2) || typeof subscriber2.getSnapshot !== "function" || !Array.isArray(deps) || deps.length !== 2 || deps[0] !== store || !record22(deps[1]) || typeof deps[1].read !== "function")
|
|
55851
56174
|
continue;
|
|
55852
56175
|
const atom2 = deps[1];
|
|
55853
56176
|
if (availability(store, atom2, voice, gate) === true)
|
|
@@ -55860,7 +56183,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55860
56183
|
const instance = hook.next?.queue;
|
|
55861
56184
|
const effect = hook.next?.next?.memoizedState;
|
|
55862
56185
|
const native = store.get(atom);
|
|
55863
|
-
if (!instance || typeof instance.getSnapshot !== "function" || !
|
|
56186
|
+
if (!instance || typeof instance.getSnapshot !== "function" || !record22(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)
|
|
55864
56187
|
throw new Error("Unsupported Settings availability subscription");
|
|
55865
56188
|
for (const [object6, key] of [
|
|
55866
56189
|
[store, "sub"],
|
|
@@ -55919,7 +56242,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55919
56242
|
}
|
|
55920
56243
|
|
|
55921
56244
|
// src/renderer-dictation-settings.ts
|
|
55922
|
-
var
|
|
56245
|
+
var record23 = (value) => value !== null && typeof value === "object";
|
|
55923
56246
|
var mode = (value) => value === null || value === "os-global" || value === "app";
|
|
55924
56247
|
function replayDictationSettingsMode(store, atom, capabilities, gate) {
|
|
55925
56248
|
try {
|
|
@@ -55962,7 +56285,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55962
56285
|
function bindDictationSettingsMode(currentFibers, store, atom, capabilities, gate, allowed) {
|
|
55963
56286
|
const readers = () => [...currentFibers()].flatMap(hooks2).filter((hook) => {
|
|
55964
56287
|
const [subscriber, deps] = Array.isArray(hook.memoizedState) ? hook.memoizedState : [];
|
|
55965
|
-
return
|
|
56288
|
+
return record23(subscriber) && typeof subscriber.getSnapshot === "function" && Array.isArray(deps) && deps.length === 2 && deps[0] === store && deps[1] === atom;
|
|
55966
56289
|
});
|
|
55967
56290
|
const subscriptions = readers();
|
|
55968
56291
|
if (!subscriptions.length || replayDictationSettingsMode(store, atom, capabilities, gate) === void 0)
|
|
@@ -55975,7 +56298,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55975
56298
|
const instance = hook.next?.queue;
|
|
55976
56299
|
const effect = hook.next?.next?.memoizedState;
|
|
55977
56300
|
const native = store.get(atom);
|
|
55978
|
-
if (!instance || typeof instance.getSnapshot !== "function" || !
|
|
56301
|
+
if (!instance || typeof instance.getSnapshot !== "function" || !record23(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)
|
|
55979
56302
|
throw new Error("Unsupported Settings dictation mode subscription");
|
|
55980
56303
|
for (const [object6, key] of [
|
|
55981
56304
|
[store, "sub"],
|
|
@@ -56047,8 +56370,8 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
56047
56370
|
var MESSAGE_ID = "settings.general.realtimeVoice.unavailable.description";
|
|
56048
56371
|
var LABEL = "Voice settings unavailable with this provider";
|
|
56049
56372
|
var DESCRIPTION = "Your account allows voice chat. These Desktop settings require the default inference provider. Start ChatGPT Chat voice from the Chat composer.";
|
|
56050
|
-
var
|
|
56051
|
-
var settled = (value, isCapable) =>
|
|
56373
|
+
var record24 = (value) => value !== null && typeof value === "object";
|
|
56374
|
+
var settled = (value, isCapable) => record24(value) && value.isLoading === false && value.isError === false && value.isCapable === isCapable;
|
|
56052
56375
|
function realtimeAtoms(scope, modules) {
|
|
56053
56376
|
const atom = modules.capability.resolve(scope.node, scope.chain, { name: "voice.realtime" }).resolve(scope.node, scope.chain);
|
|
56054
56377
|
return {
|
|
@@ -56059,7 +56382,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
56059
56382
|
function providerBlocksVoiceSettings(scope, modules) {
|
|
56060
56383
|
try {
|
|
56061
56384
|
const access = scope.get(modules.access);
|
|
56062
|
-
if (!
|
|
56385
|
+
if (!record24(access) || access.status !== "allowed" || !settled(scope.get(modules.capability, { name: "voice" }), true) || !settled(scope.get(modules.capability, { name: "voice.realtime" }), false))
|
|
56063
56386
|
return false;
|
|
56064
56387
|
const { atom, gate } = realtimeAtoms(scope, modules);
|
|
56065
56388
|
return replayVoiceCapability(scope.node.store, atom, gate)?.isCapable === true;
|
|
@@ -56077,10 +56400,10 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
56077
56400
|
);
|
|
56078
56401
|
if (!ancestors2.some((fiber) => fiber.type === modules.page)) continue;
|
|
56079
56402
|
const owner = ancestors2.find(
|
|
56080
|
-
({ memoizedProps: props2 }) =>
|
|
56403
|
+
({ memoizedProps: props2 }) => record24(props2) && record24(props2.description) && record24(props2.description.props) && props2.description.props.id === MESSAGE_ID && props2.control === null
|
|
56081
56404
|
);
|
|
56082
56405
|
const props = owner?.memoizedProps;
|
|
56083
|
-
if (!
|
|
56406
|
+
if (!record24(props) || !record24(props.description) || !record24(props.description.props) || !record24(props.label) || !record24(props.label.props) || element.textContent !== props.description.props.defaultMessage)
|
|
56084
56407
|
continue;
|
|
56085
56408
|
const labelText = props.label.props.defaultMessage;
|
|
56086
56409
|
if (typeof labelText !== "string") continue;
|
|
@@ -56097,10 +56420,10 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
56097
56420
|
for (const fiber of ancestors2) {
|
|
56098
56421
|
let hook = fiber.memoizedState;
|
|
56099
56422
|
const seen = /* @__PURE__ */ new Set();
|
|
56100
|
-
while (
|
|
56423
|
+
while (record24(hook) && seen.size < 4096 && !seen.has(hook)) {
|
|
56101
56424
|
seen.add(hook);
|
|
56102
|
-
const scope2 =
|
|
56103
|
-
if (
|
|
56425
|
+
const scope2 = record24(hook.memoizedState) ? hook.memoizedState.current : void 0;
|
|
56426
|
+
if (record24(scope2) && scope2.scope === modules.appScope && record24(scope2.node) && scope2.chain instanceof Map && scope2.chain.get(modules.appScope.id) === scope2.node && typeof scope2.get === "function")
|
|
56104
56427
|
scopes.set(scope2.node, scope2);
|
|
56105
56428
|
hook = hook.next;
|
|
56106
56429
|
}
|
|
@@ -56289,7 +56612,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
56289
56612
|
|
|
56290
56613
|
// src/renderer-rpc-steering-queue.ts
|
|
56291
56614
|
var INTERRUPTED = "Interrupted before the steer was accepted.";
|
|
56292
|
-
var
|
|
56615
|
+
var record25 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
56293
56616
|
async function prepareRpcSteeringQueue(hostId2, threadId, manager, coordinator, messageId) {
|
|
56294
56617
|
const snapshot = Promise.withResolvers();
|
|
56295
56618
|
let lease;
|
|
@@ -56323,7 +56646,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
56323
56646
|
for (const value of /* @__PURE__ */ new Set([pending2, lease])) dispose(value);
|
|
56324
56647
|
}
|
|
56325
56648
|
if (messages.some(
|
|
56326
|
-
(message2) =>
|
|
56649
|
+
(message2) => record25(message2) && message2.id !== messageId && message2.pausedReason === INTERRUPTED
|
|
56327
56650
|
))
|
|
56328
56651
|
throw new Error(
|
|
56329
56652
|
"Resume or remove the other previously paused messages before changing direction"
|
|
@@ -56331,23 +56654,23 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
56331
56654
|
return async (turnId) => {
|
|
56332
56655
|
await coordinator("removeQueuedMessage", threadId, messageId);
|
|
56333
56656
|
const state = await manager("getThreadExecutionState", threadId);
|
|
56334
|
-
const stillRunning =
|
|
56657
|
+
const stillRunning = record25(state) && state.inProgress === true && state.activeTurnId === turnId;
|
|
56335
56658
|
const turn = stillRunning ? null : await manager("getTurnById", threadId, turnId);
|
|
56336
|
-
if (stillRunning ||
|
|
56659
|
+
if (stillRunning || record25(turn) && turn.status === "completed")
|
|
56337
56660
|
await coordinator("resumeInterruptedQueuedMessages", threadId);
|
|
56338
56661
|
};
|
|
56339
56662
|
}
|
|
56340
56663
|
|
|
56341
56664
|
// src/renderer-rpc-steering.ts
|
|
56342
|
-
var
|
|
56665
|
+
var record26 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
56343
56666
|
var invoke = (target2, name, ...args) => Reflect.apply(Reflect.get(target2, name), target2, args);
|
|
56344
|
-
var running = (state) =>
|
|
56667
|
+
var running = (state) => record26(state) && (state.inProgress === true || !!state.activeTurnId);
|
|
56345
56668
|
var context = (previous, marker) => ({
|
|
56346
|
-
...
|
|
56669
|
+
...record26(previous) ? previous : {},
|
|
56347
56670
|
[THREAD_STEERING_CONTEXT_PARAM]: { kind: "application", value: JSON.stringify(marker) }
|
|
56348
56671
|
});
|
|
56349
56672
|
function installRendererRpcSteering(value) {
|
|
56350
|
-
if (!
|
|
56673
|
+
if (!record26(value) || typeof value.forHost !== "function") return null;
|
|
56351
56674
|
const descriptor = Object.getOwnPropertyDescriptor(value, "forHost");
|
|
56352
56675
|
if (!descriptor?.writable) return null;
|
|
56353
56676
|
const controller = value;
|
|
@@ -56362,7 +56685,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
56362
56685
|
throw new Error("Steering connection was retired");
|
|
56363
56686
|
};
|
|
56364
56687
|
const inspect = async (threadId, input) => {
|
|
56365
|
-
const text = Array.isArray(input) ? input.filter(
|
|
56688
|
+
const text = Array.isArray(input) ? input.filter(record26).map((item) => typeof item.text === "string" ? item.text : "").join("\n") : "";
|
|
56366
56689
|
current();
|
|
56367
56690
|
const delivery = await inspectRendererSteeringDelivery(
|
|
56368
56691
|
(method, params) => {
|
|
@@ -56378,19 +56701,19 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
56378
56701
|
const target2 = async (threadId, messageId, delivery) => {
|
|
56379
56702
|
const state = await invoke(rpc, "getThreadExecutionState", threadId);
|
|
56380
56703
|
current();
|
|
56381
|
-
if (!
|
|
56704
|
+
if (!record26(state) || typeof state.activeTurnId !== "string" || !state.activeTurnId || typeof messageId !== "string" || !messageId)
|
|
56382
56705
|
throw new Error("Native steering target or message identity is unavailable");
|
|
56383
56706
|
return { expectedTurnId: state.activeTurnId, clientUserMessageId: messageId, delivery };
|
|
56384
56707
|
};
|
|
56385
56708
|
const withoutQueueRow = async (request) => {
|
|
56386
|
-
if (!
|
|
56709
|
+
if (!record26(request) || request.acceptLocally !== true || typeof request.conversationId !== "string")
|
|
56387
56710
|
return request;
|
|
56388
56711
|
try {
|
|
56389
56712
|
const state = await invoke(rpc, "getThreadExecutionState", request.conversationId);
|
|
56390
56713
|
current();
|
|
56391
56714
|
if (!running(state)) return request;
|
|
56392
56715
|
const message2 = request.message;
|
|
56393
|
-
const text =
|
|
56716
|
+
const text = record26(message2) && typeof message2.text === "string" ? message2.text : "";
|
|
56394
56717
|
const delivery = await inspect(request.conversationId, [{ text }]);
|
|
56395
56718
|
return delivery === "newTurn" ? { ...request, acceptLocally: false } : request;
|
|
56396
56719
|
} catch {
|
|
@@ -56417,7 +56740,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
56417
56740
|
let messageId;
|
|
56418
56741
|
let finish;
|
|
56419
56742
|
const apply = (prepared) => {
|
|
56420
|
-
if (!marker || !
|
|
56743
|
+
if (!marker || !record26(prepared.steer)) return prepared;
|
|
56421
56744
|
const result2 = {
|
|
56422
56745
|
...prepared,
|
|
56423
56746
|
steer: {
|
|
@@ -56426,7 +56749,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
56426
56749
|
}
|
|
56427
56750
|
};
|
|
56428
56751
|
if (marker.delivery !== "newTurn") return result2;
|
|
56429
|
-
if (!
|
|
56752
|
+
if (!record26(prepared.start) || !record26(prepared.start.request))
|
|
56430
56753
|
throw new Error("Native start preparation is unavailable for steering");
|
|
56431
56754
|
return {
|
|
56432
56755
|
...result2,
|
|
@@ -56444,9 +56767,9 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
56444
56767
|
current();
|
|
56445
56768
|
const prepared = await callback(...input);
|
|
56446
56769
|
current();
|
|
56447
|
-
if (!
|
|
56770
|
+
if (!record26(prepared)) throw new Error("Native submission preparation is malformed");
|
|
56448
56771
|
if (marker) return apply(prepared);
|
|
56449
|
-
if (input[1] !== "steer" || !
|
|
56772
|
+
if (input[1] !== "steer" || !record26(prepared.steer) || typeof prepared.conversationId !== "string")
|
|
56450
56773
|
return prepared;
|
|
56451
56774
|
threadId = prepared.conversationId;
|
|
56452
56775
|
const execution = await invoke(rpc, "getThreadExecutionState", threadId);
|
|
@@ -56455,7 +56778,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
56455
56778
|
const delivery = await inspect(threadId, prepared.steer.input);
|
|
56456
56779
|
if (delivery === "official") return prepared;
|
|
56457
56780
|
const restore = prepared.steer.restoreMessage;
|
|
56458
|
-
messageId =
|
|
56781
|
+
messageId = record26(restore) && typeof restore.id === "string" ? restore.id : void 0;
|
|
56459
56782
|
const clientId = prepared.steer.clientUserMessageId ?? messageId;
|
|
56460
56783
|
marker = await target2(threadId, clientId, delivery);
|
|
56461
56784
|
if (delivery === "activeTurn") return apply(prepared);
|
|
@@ -56469,14 +56792,14 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
56469
56792
|
);
|
|
56470
56793
|
const start = await callback(input[0], "start");
|
|
56471
56794
|
current();
|
|
56472
|
-
if (!
|
|
56795
|
+
if (!record26(start)) throw new Error("Native start preparation is malformed");
|
|
56473
56796
|
return apply(start);
|
|
56474
56797
|
};
|
|
56475
56798
|
const forwarded = [...args];
|
|
56476
56799
|
forwarded[index] = prepare;
|
|
56477
56800
|
if (key === "sendMessage") forwarded[0] = await withoutQueueRow(args[0]);
|
|
56478
56801
|
const result = await invoke(handle, key, ...forwarded);
|
|
56479
|
-
if (finish &&
|
|
56802
|
+
if (finish && record26(result) && result.status === "sent" && typeof result.turnId === "string") {
|
|
56480
56803
|
await finish(result.turnId).catch(
|
|
56481
56804
|
() => console.error("codexhost could not reconcile native steering queue")
|
|
56482
56805
|
);
|