@codex-app-sdk/vue 0.19.0 → 0.19.1
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/dist/chat/ChatModelReasoningSelector.vue.d.ts.map +1 -1
- package/dist/chat/ChatWorkGroup.vue.d.ts.map +1 -1
- package/dist/chat/CodexUltrafastIcon.vue.d.ts +7 -0
- package/dist/chat/CodexUltrafastIcon.vue.d.ts.map +1 -0
- package/dist/chat/chat-i18n.d.ts.map +1 -1
- package/dist/chat/message-work-state.d.ts +1 -0
- package/dist/chat/message-work-state.d.ts.map +1 -1
- package/dist/components/CodexComposerMenuList.vue.d.ts.map +1 -1
- package/dist/components/CodexMessage.vue.d.ts.map +1 -1
- package/dist/components/CodexMessageTurn.vue.d.ts.map +1 -1
- package/dist/components/composer-menu-items.d.ts.map +1 -1
- package/dist/composer-menu.d.ts +1 -1
- package/dist/composer-menu.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +950 -875
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -429,7 +429,7 @@ function Zt(e, t, n, r, i) {
|
|
|
429
429
|
key: e.id,
|
|
430
430
|
class: [
|
|
431
431
|
"codex-composer-menu-list__item",
|
|
432
|
-
e.type === "checkbox" && e.accessory
|
|
432
|
+
e.type === "checkbox" && e.accessory && e.accessory !== "check" ? "codex-composer-menu-list__item--switch" : null,
|
|
433
433
|
(e.type === "action" || e.type === "custom") && e.danger ? "codex-composer-menu-list__item--danger" : null
|
|
434
434
|
],
|
|
435
435
|
type: "button",
|
|
@@ -441,7 +441,10 @@ function Zt(e, t, n, r, i) {
|
|
|
441
441
|
}, [...a.nodes, e.type === "checkbox" && e.accessory === "switch" ? v("span", {
|
|
442
442
|
class: ["codex-composer-menu-list__switch", e.checked ? "codex-composer-menu-list__switch--checked" : null],
|
|
443
443
|
"aria-hidden": "true"
|
|
444
|
-
}, [v("span", { class: "codex-composer-menu-list__switch-thumb" })]) : e.type === "checkbox"
|
|
444
|
+
}, [v("span", { class: "codex-composer-menu-list__switch-thumb" })]) : e.type === "checkbox" && e.accessory && typeof e.accessory != "string" ? v("span", {
|
|
445
|
+
class: "codex-composer-menu-list__icon-toggle",
|
|
446
|
+
"aria-hidden": "true"
|
|
447
|
+
}, [v(e.accessory)]) : e.type === "checkbox" || e.type === "radio" && e.checked && !a.leadingRadioCheck ? v("span", {
|
|
445
448
|
class: "codex-composer-menu-list__selection",
|
|
446
449
|
"aria-hidden": "true"
|
|
447
450
|
}, e.checked ? "✓" : "") : null]);
|
|
@@ -1196,6 +1199,12 @@ var Jn = Symbol("codex-app-sdk-chat-translate"), Yn = {
|
|
|
1196
1199
|
"chat.files.hint": "Start typing to search files in this project.",
|
|
1197
1200
|
"chat.files.title": "Files",
|
|
1198
1201
|
"chat.message.emptyResponse": "Empty response",
|
|
1202
|
+
"chat.work.done": "Done",
|
|
1203
|
+
"chat.work.doneFor": "Done · {duration}",
|
|
1204
|
+
"chat.work.stopped": "Stopped",
|
|
1205
|
+
"chat.work.stoppedFor": "Stopped · {duration}",
|
|
1206
|
+
"chat.work.failed": "Failed",
|
|
1207
|
+
"chat.work.failedFor": "Failed · {duration}",
|
|
1199
1208
|
"chat.work.doneHideDetails": "Done · Hide details",
|
|
1200
1209
|
"chat.work.doneHideDetailsFor": "Done · {duration} · Hide details",
|
|
1201
1210
|
"chat.work.doneViewDetails": "Done · View details",
|
|
@@ -1267,12 +1276,47 @@ var $n = ["aria-label"], er = {
|
|
|
1267
1276
|
})), 1)
|
|
1268
1277
|
])], 12, $n)) : c("", !0);
|
|
1269
1278
|
}
|
|
1270
|
-
}), [["__scopeId", "data-v-
|
|
1279
|
+
}), [["__scopeId", "data-v-467bbb50"]]), rr = ["width", "height"], ir = "M13 3v7h6l-8 11v-7H5L13 3z", ar = /* @__PURE__ */ h({
|
|
1280
|
+
__name: "CodexUltrafastIcon",
|
|
1281
|
+
props: { size: { default: 16 } },
|
|
1282
|
+
setup(e) {
|
|
1283
|
+
return (t, n) => (k(), l("svg", {
|
|
1284
|
+
class: "codex-ultrafast-icon",
|
|
1285
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1286
|
+
width: e.size,
|
|
1287
|
+
height: e.size,
|
|
1288
|
+
viewBox: "0 0 24 24",
|
|
1289
|
+
stroke: "currentColor",
|
|
1290
|
+
"stroke-width": "2",
|
|
1291
|
+
"stroke-linecap": "round",
|
|
1292
|
+
"stroke-linejoin": "round",
|
|
1293
|
+
"aria-hidden": "true"
|
|
1294
|
+
}, [
|
|
1295
|
+
u("path", {
|
|
1296
|
+
d: ir,
|
|
1297
|
+
transform: "translate(-3 0)",
|
|
1298
|
+
fill: "none"
|
|
1299
|
+
}),
|
|
1300
|
+
u("path", {
|
|
1301
|
+
d: ir,
|
|
1302
|
+
transform: "translate(3 0)",
|
|
1303
|
+
fill: "none",
|
|
1304
|
+
stroke: "var(--color-surface-lowest, #fff)",
|
|
1305
|
+
"stroke-width": "5"
|
|
1306
|
+
}),
|
|
1307
|
+
u("path", {
|
|
1308
|
+
d: ir,
|
|
1309
|
+
transform: "translate(3 0)",
|
|
1310
|
+
fill: "currentColor"
|
|
1311
|
+
})
|
|
1312
|
+
], 8, rr));
|
|
1313
|
+
}
|
|
1314
|
+
}), or = ["title"], sr = { class: "chat-model-selector__label" }, cr = [
|
|
1271
1315
|
"title",
|
|
1272
1316
|
"aria-expanded",
|
|
1273
1317
|
"disabled",
|
|
1274
1318
|
"onClick"
|
|
1275
|
-
],
|
|
1319
|
+
], lr = { class: "chat-model-selector__label" }, ur = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
1276
1320
|
__name: "ChatModelReasoningSelector",
|
|
1277
1321
|
props: {
|
|
1278
1322
|
disabled: {
|
|
@@ -1301,9 +1345,9 @@ var $n = ["aria-label"], er = {
|
|
|
1301
1345
|
"update:serviceTier"
|
|
1302
1346
|
],
|
|
1303
1347
|
setup(e, { emit: t }) {
|
|
1304
|
-
let n = e, r = t, i = o(() => n.models.find((e) => e.id === n.modelId) ?? n.models.find((e) => e.isDefault) ?? n.models[0] ?? null), a = o(() => i.value?.supportedReasoningEfforts ?? []), d = o(() => n.showReasoning && a.value.length > 0), f = o(() => n.reasoningEffort ?? i.value?.defaultReasoningEffort ?? a.value[0]?.reasoningEffort ?? null), p = o(() => i.value?.serviceTiers ?? []), h = o(() => n.showServiceTier && p.value.length > 0), g = o(() => p.value.find((e) => /^(fast|priority)$/i.test(e.id) ||
|
|
1348
|
+
let n = e, r = t, i = o(() => n.models.find((e) => e.id === n.modelId) ?? n.models.find((e) => e.isDefault) ?? n.models[0] ?? null), a = o(() => i.value?.supportedReasoningEfforts ?? []), d = o(() => n.showReasoning && a.value.length > 0), f = o(() => n.reasoningEffort ?? i.value?.defaultReasoningEffort ?? a.value[0]?.reasoningEffort ?? null), p = o(() => i.value?.serviceTiers ?? []), h = o(() => n.showServiceTier && p.value.length > 0), g = o(() => p.value.find((e) => /^(fast|priority)$/i.test(e.id) || /\b(fast|priority)\b/i.test(e.name)) ?? null), _ = o(() => p.value.find((e) => /^ultrafast$/i.test(e.id) || /\bultra[ -]?fast\b/i.test(e.name)) ?? null), v = o(() => [g.value, _.value].filter((e) => e !== null)), y = o(() => v.value.find((e) => e.id === n.serviceTier)), b = (e) => e ? e === _.value?.id ? "Ultrafast" : "Fast mode" : "Normal speed", x = o(() => y.value && y.value === _.value ? ar : ue), S = o(() => y.value?.description ?? "Default processing for this model."), w = o(() => n.disabled), T = o(() => {
|
|
1305
1349
|
let e = [];
|
|
1306
|
-
n.menuItems.length > 0 && (e.push(...
|
|
1350
|
+
n.menuItems.length > 0 && (e.push(...N(n.menuItems)), e.push({
|
|
1307
1351
|
id: "host-model-menu-separator",
|
|
1308
1352
|
type: "separator"
|
|
1309
1353
|
}));
|
|
@@ -1343,13 +1387,13 @@ var $n = ["aria-label"], er = {
|
|
|
1343
1387
|
].find((e) => a.some((t) => t.reasoningEffort === e)) ?? a[0].reasoningEffort
|
|
1344
1388
|
}
|
|
1345
1389
|
},
|
|
1346
|
-
value: r && f.value ?
|
|
1390
|
+
value: r && f.value ? A(f.value) : void 0,
|
|
1347
1391
|
submenuAlignment: "bottom",
|
|
1348
1392
|
items: a.map((e) => ({
|
|
1349
1393
|
checked: r && e.reasoningEffort === f.value,
|
|
1350
1394
|
closeOnSelect: !0,
|
|
1351
1395
|
id: `model:${t.id}:reasoning:${e.reasoningEffort}`,
|
|
1352
|
-
label:
|
|
1396
|
+
label: A(e.reasoningEffort),
|
|
1353
1397
|
payload: {
|
|
1354
1398
|
source: "selector",
|
|
1355
1399
|
kind: "model",
|
|
@@ -1360,45 +1404,71 @@ var $n = ["aria-label"], er = {
|
|
|
1360
1404
|
}))
|
|
1361
1405
|
});
|
|
1362
1406
|
}
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1407
|
+
if (h.value && v.value.length > 0) {
|
|
1408
|
+
e.push({
|
|
1409
|
+
id: "model-service-tier-separator",
|
|
1410
|
+
type: "separator"
|
|
1411
|
+
});
|
|
1412
|
+
let t = {
|
|
1413
|
+
valueIcon: Ee,
|
|
1414
|
+
valueIconLabel: S.value
|
|
1415
|
+
};
|
|
1416
|
+
if (_.value) e.push({
|
|
1417
|
+
id: "model-speed",
|
|
1418
|
+
type: "submenu",
|
|
1419
|
+
label: b(y.value?.id),
|
|
1420
|
+
icon: x.value,
|
|
1421
|
+
...t,
|
|
1422
|
+
items: [null, ...v.value].map((e) => ({
|
|
1423
|
+
id: `service-tier:${e?.id ?? "default"}`,
|
|
1424
|
+
type: "radio",
|
|
1425
|
+
label: b(e?.id),
|
|
1426
|
+
checked: e ? e.id === n.serviceTier : !y.value,
|
|
1427
|
+
icon: e === _.value ? ar : e ? ue : void 0,
|
|
1428
|
+
payload: {
|
|
1429
|
+
source: "selector",
|
|
1430
|
+
kind: "serviceTier",
|
|
1431
|
+
value: e?.id ?? null
|
|
1432
|
+
}
|
|
1433
|
+
}))
|
|
1434
|
+
});
|
|
1435
|
+
else {
|
|
1436
|
+
let n = g.value;
|
|
1437
|
+
e.push({
|
|
1438
|
+
accessory: ue,
|
|
1439
|
+
checked: !!y.value,
|
|
1440
|
+
closeOnSelect: !1,
|
|
1441
|
+
...t,
|
|
1442
|
+
id: `service-tier:${n.id}`,
|
|
1443
|
+
label: b(y.value?.id),
|
|
1444
|
+
type: "checkbox",
|
|
1445
|
+
payload: {
|
|
1446
|
+
source: "selector",
|
|
1447
|
+
kind: "serviceTier",
|
|
1448
|
+
value: y.value ? null : n.id
|
|
1449
|
+
}
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
return e;
|
|
1454
|
+
}), E = o(() => {
|
|
1455
|
+
if (!i.value) return D.value;
|
|
1456
|
+
if (!d.value) return j(i.value.displayName);
|
|
1457
|
+
let e = f.value ? A(f.value) : O.value;
|
|
1458
|
+
return `${j(i.value.displayName)} ${e}`;
|
|
1459
|
+
}), D = o(() => n.modelCatalogStatus === "loading" ? "Loading models" : n.modelCatalogStatus === "error" ? "Models unavailable" : "Model"), O = o(() => n.modelCatalogStatus === "loading" ? "Loading" : "Reasoning");
|
|
1460
|
+
function A(e) {
|
|
1391
1461
|
let t = { xhigh: "Extra High" }, n = e.trim().toLowerCase();
|
|
1392
1462
|
return t[n] ? t[n] : e.split(/[-_\s]+/).filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
|
|
1393
1463
|
}
|
|
1394
|
-
function
|
|
1464
|
+
function j(e) {
|
|
1395
1465
|
return e.replace(/^gpt[-\s]*/i, "").trim() || e;
|
|
1396
1466
|
}
|
|
1397
|
-
function
|
|
1467
|
+
function M(e) {
|
|
1398
1468
|
let t = e.payload;
|
|
1399
|
-
t && (t.source === "host" ? r("menuSelect", t.item) : t.kind === "model" ? (n.modelId !== t.value && r("update:modelId", t.value), n.showReasoning && t.reasoningEffort !== void 0 && r("update:reasoningEffort", t.reasoningEffort)) : t.kind === "serviceTier" &&
|
|
1469
|
+
t && (t.source === "host" ? r("menuSelect", t.item) : t.kind === "model" ? (n.modelId !== t.value && r("update:modelId", t.value), n.showReasoning && t.reasoningEffort !== void 0 && r("update:reasoningEffort", t.reasoningEffort)) : t.kind === "serviceTier" && v.value.length > 0 && (t.value === null || v.value.some((e) => e.id === t.value)) && r("update:serviceTier", t.value));
|
|
1400
1470
|
}
|
|
1401
|
-
function
|
|
1471
|
+
function N(e, t = []) {
|
|
1402
1472
|
return e.map((e, n) => {
|
|
1403
1473
|
let r = [...t, n], i = `host:${r.join(".")}:${e.id}`;
|
|
1404
1474
|
if (e.type === "separator") return {
|
|
@@ -1422,7 +1492,7 @@ var $n = ["aria-label"], er = {
|
|
|
1422
1492
|
return {
|
|
1423
1493
|
...o,
|
|
1424
1494
|
id: i,
|
|
1425
|
-
items:
|
|
1495
|
+
items: N(t, r),
|
|
1426
1496
|
selectAction: a ? {
|
|
1427
1497
|
...a,
|
|
1428
1498
|
id: `${i}:select`,
|
|
@@ -1443,112 +1513,112 @@ var $n = ["aria-label"], er = {
|
|
|
1443
1513
|
};
|
|
1444
1514
|
});
|
|
1445
1515
|
}
|
|
1446
|
-
return (t,
|
|
1516
|
+
return (t, n) => (k(), l("div", { class: C(["codex-chat-theme chat-model-selector", { "chat-model-selector--accelerated": y.value }]) }, [e.models.length === 0 ? (k(), l("button", {
|
|
1447
1517
|
key: 0,
|
|
1448
1518
|
class: "chat-model-selector__button",
|
|
1449
1519
|
type: "button",
|
|
1450
1520
|
"aria-label": "Model and reasoning",
|
|
1451
|
-
title:
|
|
1521
|
+
title: E.value,
|
|
1452
1522
|
disabled: ""
|
|
1453
1523
|
}, [
|
|
1454
1524
|
m(H(de), {
|
|
1455
1525
|
class: "chat-model-selector__compact-icon",
|
|
1456
1526
|
"aria-hidden": "true"
|
|
1457
1527
|
}),
|
|
1458
|
-
u("span",
|
|
1528
|
+
u("span", sr, B(E.value), 1),
|
|
1459
1529
|
m(H(me), {
|
|
1460
1530
|
class: "chat-model-selector__chevron",
|
|
1461
1531
|
"aria-hidden": "true"
|
|
1462
1532
|
})
|
|
1463
|
-
], 8,
|
|
1533
|
+
], 8, or)) : (k(), s(sn, {
|
|
1464
1534
|
key: 1,
|
|
1465
1535
|
"aria-label": "Model and reasoning",
|
|
1466
1536
|
"button-label": "Model and reasoning",
|
|
1467
|
-
disabled:
|
|
1468
|
-
items:
|
|
1537
|
+
disabled: w.value,
|
|
1538
|
+
items: T.value,
|
|
1469
1539
|
"menu-class": "chat-model-selector__menu",
|
|
1470
|
-
onSelect:
|
|
1540
|
+
onSelect: M
|
|
1471
1541
|
}, {
|
|
1472
1542
|
trigger: G(({ open: e, toggle: t }) => [u("button", {
|
|
1473
1543
|
class: "chat-model-selector__button",
|
|
1474
1544
|
type: "button",
|
|
1475
1545
|
"aria-label": "Model and reasoning",
|
|
1476
|
-
title:
|
|
1546
|
+
title: E.value,
|
|
1477
1547
|
"aria-haspopup": "menu",
|
|
1478
1548
|
"aria-expanded": e,
|
|
1479
|
-
disabled:
|
|
1549
|
+
disabled: w.value,
|
|
1480
1550
|
onClick: t
|
|
1481
1551
|
}, [
|
|
1482
1552
|
m(H(de), {
|
|
1483
1553
|
class: "chat-model-selector__compact-icon",
|
|
1484
1554
|
"aria-hidden": "true"
|
|
1485
1555
|
}),
|
|
1486
|
-
|
|
1556
|
+
y.value ? (k(), s(R(x.value), {
|
|
1487
1557
|
key: 0,
|
|
1488
1558
|
class: "chat-model-selector__leading-icon",
|
|
1489
1559
|
"aria-hidden": "true"
|
|
1490
1560
|
})) : c("", !0),
|
|
1491
|
-
u("span",
|
|
1561
|
+
u("span", lr, B(E.value), 1),
|
|
1492
1562
|
m(H(me), {
|
|
1493
1563
|
class: "chat-model-selector__chevron",
|
|
1494
1564
|
"aria-hidden": "true"
|
|
1495
1565
|
})
|
|
1496
|
-
], 8,
|
|
1566
|
+
], 8, cr)]),
|
|
1497
1567
|
_: 1
|
|
1498
|
-
}, 8, ["disabled", "items"]))]));
|
|
1568
|
+
}, 8, ["disabled", "items"]))], 2));
|
|
1499
1569
|
}
|
|
1500
|
-
}), [["__scopeId", "data-v-
|
|
1570
|
+
}), [["__scopeId", "data-v-4702a143"]]);
|
|
1501
1571
|
//#endregion
|
|
1502
1572
|
//#region src/chat/composer-search.ts
|
|
1503
|
-
function
|
|
1573
|
+
function dr(e, t, n, r = -1) {
|
|
1504
1574
|
let i = t.trim().toLowerCase();
|
|
1505
|
-
return
|
|
1506
|
-
let t =
|
|
1575
|
+
return mr(i ? e.map((e) => {
|
|
1576
|
+
let t = fr(e, i, n);
|
|
1507
1577
|
return t ? {
|
|
1508
1578
|
item: e,
|
|
1509
1579
|
...t
|
|
1510
1580
|
} : null;
|
|
1511
1581
|
}).filter((e) => !!e).sort((e, t) => e.fieldIndex - t.fieldIndex || t.score - e.score).map((e) => e.item) : e, r);
|
|
1512
1582
|
}
|
|
1513
|
-
function
|
|
1583
|
+
function fr(e, t, n) {
|
|
1514
1584
|
let r = null;
|
|
1515
1585
|
return n.forEach((n, i) => {
|
|
1516
|
-
let a = Math.max(0, ...n.values(e).map((e) =>
|
|
1586
|
+
let a = Math.max(0, ...n.values(e).map((e) => pr(t, e ?? "")));
|
|
1517
1587
|
a > 0 && r === null && (r = {
|
|
1518
1588
|
fieldIndex: i,
|
|
1519
1589
|
score: a
|
|
1520
1590
|
});
|
|
1521
1591
|
}), r;
|
|
1522
1592
|
}
|
|
1523
|
-
function
|
|
1593
|
+
function pr(e, t) {
|
|
1524
1594
|
let n = t.toLowerCase();
|
|
1525
1595
|
if (!n.includes(e)) return 0;
|
|
1526
1596
|
if (n === e) return 3e4;
|
|
1527
1597
|
let r = n.split(/[^\p{L}\p{N}_]+/u);
|
|
1528
1598
|
return (r.includes(e) ? 2e4 : r.some((t) => t.startsWith(e)) ? 15e3 : 1e4) - n.indexOf(e);
|
|
1529
1599
|
}
|
|
1530
|
-
function
|
|
1600
|
+
function mr(e, t) {
|
|
1531
1601
|
return t >= 0 ? e.slice(0, t) : e;
|
|
1532
1602
|
}
|
|
1533
1603
|
//#endregion
|
|
1534
1604
|
//#region src/chat/composer-plugins.ts
|
|
1535
|
-
function
|
|
1536
|
-
return
|
|
1605
|
+
function hr(e, t, n = -1) {
|
|
1606
|
+
return dr(e, t, [
|
|
1537
1607
|
{ values: (e) => [e.id] },
|
|
1538
1608
|
{ values: (e) => [e.name, e.displayName] },
|
|
1539
1609
|
{ values: (e) => [e.shortDescription, e.longDescription] }
|
|
1540
1610
|
], n);
|
|
1541
1611
|
}
|
|
1542
|
-
function
|
|
1612
|
+
function gr(e) {
|
|
1543
1613
|
return e.displayName || e.name;
|
|
1544
1614
|
}
|
|
1545
|
-
function
|
|
1615
|
+
function _r(e) {
|
|
1546
1616
|
return e.shortDescription || e.longDescription || "";
|
|
1547
1617
|
}
|
|
1548
|
-
function
|
|
1618
|
+
function vr(e) {
|
|
1549
1619
|
return e.name || e.id;
|
|
1550
1620
|
}
|
|
1551
|
-
function
|
|
1621
|
+
function yr(e, t) {
|
|
1552
1622
|
let n = t.trim().toLowerCase();
|
|
1553
1623
|
return [
|
|
1554
1624
|
e.id,
|
|
@@ -1558,14 +1628,14 @@ function _r(e, t) {
|
|
|
1558
1628
|
}
|
|
1559
1629
|
//#endregion
|
|
1560
1630
|
//#region src/chat/ChatComposerAtMentionMenu.vue?vue&type=script&setup=true&lang.ts
|
|
1561
|
-
var
|
|
1631
|
+
var br = {
|
|
1562
1632
|
class: "codex-chat-theme chat-composer-at-menu",
|
|
1563
1633
|
role: "listbox",
|
|
1564
1634
|
"aria-label": "Mentions"
|
|
1565
|
-
},
|
|
1635
|
+
}, xr = { class: "chat-composer-at-menu__section" }, Sr = ["onMousedown"], Cr = { key: 0 }, wr = ["onMousedown"], Tr = ["onMousedown"], Er = { class: "chat-composer-at-menu__section" }, Dr = ["onMousedown"], Or = { key: 0 }, kr = {
|
|
1566
1636
|
key: 2,
|
|
1567
1637
|
class: "chat-composer-at-menu__hint"
|
|
1568
|
-
},
|
|
1638
|
+
}, Ar = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
1569
1639
|
__name: "ChatComposerAtMentionMenu",
|
|
1570
1640
|
props: {
|
|
1571
1641
|
activeIndex: {},
|
|
@@ -1594,8 +1664,8 @@ var vr = {
|
|
|
1594
1664
|
}
|
|
1595
1665
|
return -1;
|
|
1596
1666
|
}
|
|
1597
|
-
return (n, o) => (k(), l("div",
|
|
1598
|
-
(k(!0), l(t, null, F(r.value, (r) => (k(), l(t, { key: `custom:${r.id}` }, [u("div",
|
|
1667
|
+
return (n, o) => (k(), l("div", br, [
|
|
1668
|
+
(k(!0), l(t, null, F(r.value, (r) => (k(), l(t, { key: `custom:${r.id}` }, [u("div", xr, B(r.label), 1), (k(!0), l(t, null, F(r.items, (t) => (k(), l("button", {
|
|
1599
1669
|
key: `custom:${r.id}:${t.id}`,
|
|
1600
1670
|
class: C(["chat-composer-at-menu__item", { "chat-composer-at-menu__item--active": s(r.id, t.id) === e.activeIndex }]),
|
|
1601
1671
|
role: "option",
|
|
@@ -1608,7 +1678,7 @@ var vr = {
|
|
|
1608
1678
|
}, () => [m(H(He), {
|
|
1609
1679
|
class: "chat-composer-at-menu__icon",
|
|
1610
1680
|
"aria-hidden": "true"
|
|
1611
|
-
}), u("span", null, [u("strong", null, B(t.label), 1), t.description ? (k(), l("small",
|
|
1681
|
+
}), u("span", null, [u("strong", null, B(t.label), 1), t.description ? (k(), l("small", Cr, B(t.description), 1)) : c("", !0)])], !0)], 42, Sr))), 128))], 64))), 128)),
|
|
1612
1682
|
e.visiblePlugins.length ? (k(), l(t, { key: 0 }, [o[0] ||= u("div", { class: "chat-composer-at-menu__section" }, "Plugins", -1), (k(!0), l(t, null, F(e.visiblePlugins, (t, r) => (k(), l("button", {
|
|
1613
1683
|
key: `plugin:${t.id}`,
|
|
1614
1684
|
class: C(["chat-composer-at-menu__item", { "chat-composer-at-menu__item--active": a.value + r === e.activeIndex }]),
|
|
@@ -1618,7 +1688,7 @@ var vr = {
|
|
|
1618
1688
|
}, [m(H(Ie), {
|
|
1619
1689
|
class: "chat-composer-at-menu__icon",
|
|
1620
1690
|
"aria-hidden": "true"
|
|
1621
|
-
}), u("span", null, [u("strong", null, B(H(
|
|
1691
|
+
}), u("span", null, [u("strong", null, B(H(gr)(t)), 1), u("small", null, B(H(_r)(t)), 1)])], 42, wr))), 128))], 64)) : c("", !0),
|
|
1622
1692
|
e.visibleFiles.length ? (k(), l(t, { key: 1 }, [o[1] ||= u("div", { class: "chat-composer-at-menu__section" }, "Files", -1), (k(!0), l(t, null, F(e.visibleFiles, (t, r) => (k(), l("button", {
|
|
1623
1693
|
key: `file:${t.path}`,
|
|
1624
1694
|
class: C(["chat-composer-at-menu__item", { "chat-composer-at-menu__item--active": a.value + e.visiblePlugins.length + r === e.activeIndex }]),
|
|
@@ -1628,8 +1698,8 @@ var vr = {
|
|
|
1628
1698
|
}, [m(H(Ce), {
|
|
1629
1699
|
class: "chat-composer-at-menu__icon",
|
|
1630
1700
|
"aria-hidden": "true"
|
|
1631
|
-
}), u("span", null, [u("strong", null, B(t.name), 1), u("small", null, B(t.path), 1)])], 42,
|
|
1632
|
-
(k(!0), l(t, null, F(i.value, (r) => (k(), l(t, { key: `custom:${r.id}` }, [u("div",
|
|
1701
|
+
}), u("span", null, [u("strong", null, B(t.name), 1), u("small", null, B(t.path), 1)])], 42, Tr))), 128))], 64)) : c("", !0),
|
|
1702
|
+
(k(!0), l(t, null, F(i.value, (r) => (k(), l(t, { key: `custom:${r.id}` }, [u("div", Er, B(r.label), 1), (k(!0), l(t, null, F(r.items, (t) => (k(), l("button", {
|
|
1633
1703
|
key: `custom:${r.id}:${t.id}`,
|
|
1634
1704
|
class: C(["chat-composer-at-menu__item", { "chat-composer-at-menu__item--active": s(r.id, t.id) === e.activeIndex }]),
|
|
1635
1705
|
role: "option",
|
|
@@ -1642,14 +1712,14 @@ var vr = {
|
|
|
1642
1712
|
}, () => [m(H(He), {
|
|
1643
1713
|
class: "chat-composer-at-menu__icon",
|
|
1644
1714
|
"aria-hidden": "true"
|
|
1645
|
-
}), u("span", null, [u("strong", null, B(t.label), 1), t.description ? (k(), l("small",
|
|
1646
|
-
e.showFileHint && !e.visibleFiles.length ? (k(), l("div",
|
|
1715
|
+
}), u("span", null, [u("strong", null, B(t.label), 1), t.description ? (k(), l("small", Or, B(t.description), 1)) : c("", !0)])], !0)], 42, Dr))), 128))], 64))), 128)),
|
|
1716
|
+
e.showFileHint && !e.visibleFiles.length ? (k(), l("div", kr, "Type to search files")) : c("", !0)
|
|
1647
1717
|
]));
|
|
1648
1718
|
}
|
|
1649
1719
|
}), [["__scopeId", "data-v-b8e76cb2"]]);
|
|
1650
1720
|
//#endregion
|
|
1651
1721
|
//#region src/chat/composer-skills.ts
|
|
1652
|
-
function
|
|
1722
|
+
function jr(e, t, n = "$") {
|
|
1653
1723
|
let r = Math.max(0, Math.min(t, e.length)), i = e.slice(0, r), a = i.lastIndexOf(n);
|
|
1654
1724
|
if (a < 0) return null;
|
|
1655
1725
|
let o = a > 0 ? i[a - 1] : "";
|
|
@@ -1662,55 +1732,55 @@ function kr(e, t, n = "$") {
|
|
|
1662
1732
|
trigger: n
|
|
1663
1733
|
};
|
|
1664
1734
|
}
|
|
1665
|
-
function
|
|
1666
|
-
return
|
|
1735
|
+
function Mr(e, t, n = -1, r = []) {
|
|
1736
|
+
return dr(e, t, [{ values: (e) => [
|
|
1667
1737
|
e.id,
|
|
1668
|
-
|
|
1738
|
+
Fr(e),
|
|
1669
1739
|
e.name,
|
|
1670
1740
|
e.displayName,
|
|
1671
|
-
|
|
1741
|
+
Nr(e, r)
|
|
1672
1742
|
] }, { values: (e) => [e.shortDescription, e.description] }], n);
|
|
1673
1743
|
}
|
|
1674
|
-
function
|
|
1744
|
+
function Nr(e, t = []) {
|
|
1675
1745
|
if (e.displayName) return e.displayName;
|
|
1676
1746
|
let n = e.name.indexOf(":");
|
|
1677
1747
|
if (n <= 0 || n === e.name.length - 1) return e.name;
|
|
1678
1748
|
let r = e.name.slice(0, n), i = t.find((e) => e.id === r || e.name === r || e.id.startsWith(`${r}@`));
|
|
1679
1749
|
return i ? `${i.displayName.toLowerCase().replace(/[^a-z\d]+/g, "-").replace(/^-|-$/g, "") || i.name}:${e.name.slice(n + 1)}` : e.name;
|
|
1680
1750
|
}
|
|
1681
|
-
function
|
|
1751
|
+
function Pr(e) {
|
|
1682
1752
|
return e.shortDescription || e.description || "";
|
|
1683
1753
|
}
|
|
1684
|
-
function
|
|
1754
|
+
function Fr(e) {
|
|
1685
1755
|
return /\(([A-Za-z0-9_.-]+)\)\s*$/.exec(e.name)?.[1] || (/^[A-Za-z0-9_.-]+$/.test(e.name) ? e.name : e.path.replace(/[\\/]+SKILL\.md$/i, "").split(/[\\/]/).at(-1) || e.name.trim().replace(/\s+/g, "-").toLowerCase());
|
|
1686
1756
|
}
|
|
1687
|
-
function
|
|
1757
|
+
function Ir(e, t) {
|
|
1688
1758
|
let n = t.trim().toLowerCase(), r = e.path.replace(/[\\/]+SKILL\.md$/i, "").split(/[\\/]/).at(-1);
|
|
1689
1759
|
return [
|
|
1690
1760
|
e.id,
|
|
1691
1761
|
e.name,
|
|
1692
1762
|
e.displayName,
|
|
1693
1763
|
r,
|
|
1694
|
-
|
|
1764
|
+
Fr(e)
|
|
1695
1765
|
].some((e) => e?.trim().toLowerCase() === n);
|
|
1696
1766
|
}
|
|
1697
|
-
function
|
|
1767
|
+
function Lr(e, t) {
|
|
1698
1768
|
let n = /* @__PURE__ */ new Set(), r = /(?:^|[^\w.%+-])[$/]([A-Za-z0-9_.-]+)/g, i;
|
|
1699
1769
|
for (; (i = r.exec(e)) !== null;) n.add(i[1]);
|
|
1700
|
-
return t.filter((e) => [...n].some((t) =>
|
|
1770
|
+
return t.filter((e) => [...n].some((t) => Ir(e, t)) && !!e.path).map((e) => ({
|
|
1701
1771
|
name: e.name,
|
|
1702
1772
|
path: e.path
|
|
1703
1773
|
}));
|
|
1704
1774
|
}
|
|
1705
1775
|
//#endregion
|
|
1706
1776
|
//#region src/chat/ChatComposerSkillMenu.vue?vue&type=script&setup=true&lang.ts
|
|
1707
|
-
var
|
|
1777
|
+
var Rr = { class: "chat-composer-skill-menu__section" }, zr = ["onMousedown"], Br = {
|
|
1708
1778
|
class: "chat-composer-skill-menu__icon",
|
|
1709
1779
|
"aria-hidden": "true"
|
|
1710
|
-
},
|
|
1780
|
+
}, Vr = { class: "chat-composer-skill-menu__main" }, Hr = { class: "chat-composer-skill-menu__name" }, Ur = { class: "chat-composer-skill-menu__description" }, Wr = {
|
|
1711
1781
|
key: 0,
|
|
1712
1782
|
class: "chat-composer-skill-menu__empty"
|
|
1713
|
-
},
|
|
1783
|
+
}, Gr = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
1714
1784
|
__name: "ChatComposerSkillMenu",
|
|
1715
1785
|
props: {
|
|
1716
1786
|
activeIndex: {},
|
|
@@ -1731,21 +1801,21 @@ var Ir = { class: "chat-composer-skill-menu__section" }, Lr = ["onMousedown"], R
|
|
|
1731
1801
|
role: "listbox",
|
|
1732
1802
|
"aria-label": "Skills"
|
|
1733
1803
|
}, [
|
|
1734
|
-
u("div",
|
|
1804
|
+
u("div", Rr, B(H(r)("chat.skills.title")), 1),
|
|
1735
1805
|
(k(!0), l(t, null, F(e.visibleSkills, (t, r) => (k(), l("button", {
|
|
1736
1806
|
key: t.path,
|
|
1737
1807
|
class: C(["chat-composer-skill-menu__item", { "chat-composer-skill-menu__item--active": r === e.activeIndex }]),
|
|
1738
1808
|
role: "option",
|
|
1739
1809
|
type: "button",
|
|
1740
1810
|
onMousedown: q((e) => n.$emit("select", t), ["prevent"])
|
|
1741
|
-
}, [u("span",
|
|
1742
|
-
e.visibleSkills.length === 0 ? (k(), l("div",
|
|
1811
|
+
}, [u("span", Br, [m(H(He))]), u("span", Vr, [u("span", Hr, B(H(Nr)(t, e.plugins ?? [])), 1), u("span", Ur, B(H(Pr)(t)), 1)])], 42, zr))), 128)),
|
|
1812
|
+
e.visibleSkills.length === 0 ? (k(), l("div", Wr, B(H(r)("chat.skills.empty")), 1)) : c("", !0)
|
|
1743
1813
|
], 512));
|
|
1744
1814
|
}
|
|
1745
1815
|
}), [["__scopeId", "data-v-03636565"]]);
|
|
1746
1816
|
//#endregion
|
|
1747
1817
|
//#region src/chat/composer-commands.ts
|
|
1748
|
-
function
|
|
1818
|
+
function Kr(e, t) {
|
|
1749
1819
|
let n = Math.max(0, Math.min(t, e.length));
|
|
1750
1820
|
if (n === 0 || e[0] !== "/") return null;
|
|
1751
1821
|
let r = e.slice(0, n).slice(1);
|
|
@@ -1755,8 +1825,8 @@ function Wr(e, t) {
|
|
|
1755
1825
|
start: 0
|
|
1756
1826
|
};
|
|
1757
1827
|
}
|
|
1758
|
-
function
|
|
1759
|
-
return
|
|
1828
|
+
function qr(e, t, n = -1) {
|
|
1829
|
+
return dr(e, t, [
|
|
1760
1830
|
{ values: (e) => [e.id] },
|
|
1761
1831
|
{ values: (e) => [
|
|
1762
1832
|
e.name,
|
|
@@ -1766,18 +1836,18 @@ function Gr(e, t, n = -1) {
|
|
|
1766
1836
|
{ values: (e) => [e.description] }
|
|
1767
1837
|
], n);
|
|
1768
1838
|
}
|
|
1769
|
-
function
|
|
1839
|
+
function Jr(e) {
|
|
1770
1840
|
return e.description || "";
|
|
1771
1841
|
}
|
|
1772
1842
|
//#endregion
|
|
1773
1843
|
//#region src/chat/ChatComposerSlashMenu.vue?vue&type=script&setup=true&lang.ts
|
|
1774
|
-
var
|
|
1844
|
+
var Yr = { class: "chat-composer-slash-menu__section" }, Xr = ["onMousedown"], Zr = {
|
|
1775
1845
|
class: "chat-composer-slash-menu__icon",
|
|
1776
1846
|
"aria-hidden": "true"
|
|
1777
|
-
},
|
|
1847
|
+
}, Qr = { class: "chat-composer-slash-menu__main" }, $r = { class: "chat-composer-slash-menu__name" }, ei = { class: "chat-composer-slash-menu__description" }, ti = { class: "chat-composer-slash-menu__section" }, ni = ["onMousedown"], ri = {
|
|
1778
1848
|
class: "chat-composer-slash-menu__icon",
|
|
1779
1849
|
"aria-hidden": "true"
|
|
1780
|
-
},
|
|
1850
|
+
}, ii = { class: "chat-composer-slash-menu__main" }, ai = { class: "chat-composer-slash-menu__name" }, oi = { class: "chat-composer-slash-menu__description" }, si = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
1781
1851
|
__name: "ChatComposerSlashMenu",
|
|
1782
1852
|
props: {
|
|
1783
1853
|
activeIndex: {},
|
|
@@ -1801,21 +1871,21 @@ var qr = { class: "chat-composer-slash-menu__section" }, Jr = ["onMousedown"], Y
|
|
|
1801
1871
|
class: "codex-chat-theme chat-composer-slash-menu",
|
|
1802
1872
|
role: "listbox",
|
|
1803
1873
|
"aria-label": "Commands and skills"
|
|
1804
|
-
}, [e.visibleCommands.length > 0 ? (k(), l(t, { key: 0 }, [u("div",
|
|
1874
|
+
}, [e.visibleCommands.length > 0 ? (k(), l(t, { key: 0 }, [u("div", Yr, B(H(r)("chat.commands.title")), 1), (k(!0), l(t, null, F(e.visibleCommands, (t, r) => (k(), l("button", {
|
|
1805
1875
|
key: t.id,
|
|
1806
1876
|
class: C(["chat-composer-slash-menu__item", { "chat-composer-slash-menu__item--active": r === e.activeIndex }]),
|
|
1807
1877
|
role: "option",
|
|
1808
1878
|
type: "button",
|
|
1809
1879
|
onMousedown: q((e) => n.$emit("selectCommand", t), ["prevent"])
|
|
1810
|
-
}, [u("span",
|
|
1880
|
+
}, [u("span", Zr, [m(H(Ye))]), u("span", Qr, [u("span", $r, B(t.name), 1), u("span", ei, B(H(Jr)(t)), 1)])], 42, Xr))), 128))], 64)) : c("", !0), e.visibleSkills.length > 0 ? (k(), l(t, { key: 1 }, [u("div", ti, B(H(r)("chat.skills.title")), 1), (k(!0), l(t, null, F(e.visibleSkills, (t, r) => (k(), l("button", {
|
|
1811
1881
|
key: t.path,
|
|
1812
1882
|
class: C(["chat-composer-slash-menu__item", { "chat-composer-slash-menu__item--active": e.visibleCommands.length + r === e.activeIndex }]),
|
|
1813
1883
|
role: "option",
|
|
1814
1884
|
type: "button",
|
|
1815
1885
|
onMousedown: q((e) => n.$emit("selectSkill", t), ["prevent"])
|
|
1816
|
-
}, [u("span",
|
|
1886
|
+
}, [u("span", ri, [m(H(He))]), u("span", ii, [u("span", ai, B(t.name), 1), u("span", oi, B(H(Pr)(t)), 1)])], 42, ni))), 128))], 64)) : c("", !0)], 512));
|
|
1817
1887
|
}
|
|
1818
|
-
}), [["__scopeId", "data-v-7ac08005"]]),
|
|
1888
|
+
}), [["__scopeId", "data-v-7ac08005"]]), ci = { class: "chat-mention-chip" }, li = ["src"], ui = { class: "chat-mention-chip__label" }, di = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
1819
1889
|
__name: "ChatMentionChip",
|
|
1820
1890
|
props: {
|
|
1821
1891
|
iconUrl: { default: null },
|
|
@@ -1823,12 +1893,12 @@ var qr = { class: "chat-composer-slash-menu__section" }, Jr = ["onMousedown"], Y
|
|
|
1823
1893
|
name: {}
|
|
1824
1894
|
},
|
|
1825
1895
|
setup(e) {
|
|
1826
|
-
return (t, n) => (k(), l("span",
|
|
1896
|
+
return (t, n) => (k(), l("span", ci, [I(t.$slots, "icon", {}, () => [e.iconUrl ? (k(), l("img", {
|
|
1827
1897
|
key: 0,
|
|
1828
1898
|
class: "chat-mention-chip__icon",
|
|
1829
1899
|
src: e.iconUrl,
|
|
1830
1900
|
alt: ""
|
|
1831
|
-
}, null, 8,
|
|
1901
|
+
}, null, 8, li)) : e.kind === "file" ? (k(), s(H(Ce), {
|
|
1832
1902
|
key: 1,
|
|
1833
1903
|
class: "chat-mention-chip__icon",
|
|
1834
1904
|
"aria-hidden": "true"
|
|
@@ -1840,14 +1910,14 @@ var qr = { class: "chat-composer-slash-menu__section" }, Jr = ["onMousedown"], Y
|
|
|
1840
1910
|
key: 3,
|
|
1841
1911
|
class: "chat-mention-chip__icon",
|
|
1842
1912
|
"aria-hidden": "true"
|
|
1843
|
-
}))], !0), u("span",
|
|
1913
|
+
}))], !0), u("span", ui, B(e.name), 1)]));
|
|
1844
1914
|
}
|
|
1845
1915
|
}), [["__scopeId", "data-v-1c2c5c84"]]);
|
|
1846
1916
|
//#endregion
|
|
1847
1917
|
//#region src/chat/composer-mentions-custom.ts
|
|
1848
|
-
function
|
|
1918
|
+
function fi(e, t) {
|
|
1849
1919
|
return e.flatMap((e) => {
|
|
1850
|
-
let n =
|
|
1920
|
+
let n = dr([...e.items], t, [{ values: (e) => [
|
|
1851
1921
|
e.id,
|
|
1852
1922
|
e.value,
|
|
1853
1923
|
e.label
|
|
@@ -1858,7 +1928,7 @@ function ui(e, t) {
|
|
|
1858
1928
|
}] : [];
|
|
1859
1929
|
});
|
|
1860
1930
|
}
|
|
1861
|
-
function
|
|
1931
|
+
function pi(e, t) {
|
|
1862
1932
|
let n = t.trim().toLowerCase();
|
|
1863
1933
|
for (let t of e) {
|
|
1864
1934
|
let e = t.items.find((e) => e.value.trim().toLowerCase() === n);
|
|
@@ -1870,12 +1940,12 @@ function di(e, t) {
|
|
|
1870
1940
|
}
|
|
1871
1941
|
//#endregion
|
|
1872
1942
|
//#region src/chat/ChatRichTextEditor.vue?vue&type=script&setup=true&lang.ts
|
|
1873
|
-
var
|
|
1943
|
+
var mi = [
|
|
1874
1944
|
"aria-disabled",
|
|
1875
1945
|
"aria-label",
|
|
1876
1946
|
"contenteditable",
|
|
1877
1947
|
"data-placeholder"
|
|
1878
|
-
],
|
|
1948
|
+
], hi = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
1879
1949
|
__name: "ChatRichTextEditor",
|
|
1880
1950
|
props: {
|
|
1881
1951
|
ariaLabel: { default: "Prompt" },
|
|
@@ -2152,7 +2222,7 @@ var fi = [
|
|
|
2152
2222
|
}
|
|
2153
2223
|
function z(e, t) {
|
|
2154
2224
|
let n = document.createElement("span");
|
|
2155
|
-
return n.className = "chat-rich-text-editor__chip-token-host", n.contentEditable = "false", Object.assign(n.dataset, e), n.setAttribute("aria-label", t.name), P(v(
|
|
2225
|
+
return n.className = "chat-rich-text-editor__chip-token-host", n.contentEditable = "false", Object.assign(n.dataset, e), n.setAttribute("aria-label", t.name), P(v(di, t), n), n;
|
|
2156
2226
|
}
|
|
2157
2227
|
function B(e) {
|
|
2158
2228
|
let n = z(e.kind === "skill" ? { skillName: e.value } : e.kind === "plugin" ? { pluginName: e.value } : e.kind === "file" ? { fileMention: e.id } : {
|
|
@@ -2206,12 +2276,12 @@ var fi = [
|
|
|
2206
2276
|
"data-placeholder": e.placeholder,
|
|
2207
2277
|
role: "textbox",
|
|
2208
2278
|
onInput: d
|
|
2209
|
-
}, null, 40,
|
|
2279
|
+
}, null, 40, mi));
|
|
2210
2280
|
}
|
|
2211
2281
|
}), [["__scopeId", "data-v-53e809c1"]]);
|
|
2212
2282
|
//#endregion
|
|
2213
2283
|
//#region src/chat/composer-mentions.ts
|
|
2214
|
-
function
|
|
2284
|
+
function gi(e, t) {
|
|
2215
2285
|
let n = Math.max(0, Math.min(t, e.length)), r = e.slice(0, n), i = r.lastIndexOf("@"), a = r.lastIndexOf("$"), o = Math.max(i, a);
|
|
2216
2286
|
if (o < 0) return null;
|
|
2217
2287
|
let s = o > 0 ? r[o - 1] : "";
|
|
@@ -2224,7 +2294,7 @@ function mi(e, t) {
|
|
|
2224
2294
|
trigger: r[o]
|
|
2225
2295
|
};
|
|
2226
2296
|
}
|
|
2227
|
-
function
|
|
2297
|
+
function _i(e, t) {
|
|
2228
2298
|
let n = Math.max(0, Math.min(t, e.length)), r = e.slice(0, n), i = r.lastIndexOf("@");
|
|
2229
2299
|
if (i < 0) return null;
|
|
2230
2300
|
let a = i > 0 ? r[i - 1] : "";
|
|
@@ -2237,31 +2307,31 @@ function hi(e, t) {
|
|
|
2237
2307
|
trigger: "@"
|
|
2238
2308
|
};
|
|
2239
2309
|
}
|
|
2240
|
-
function
|
|
2310
|
+
function vi(e, t, n = 50) {
|
|
2241
2311
|
let r = t.trim().toLowerCase();
|
|
2242
2312
|
return r ? e.map((e) => ({
|
|
2243
2313
|
file: e,
|
|
2244
|
-
score: Math.max(
|
|
2314
|
+
score: Math.max(yi(r, e.name.toLowerCase()), yi(r, e.path.toLowerCase()))
|
|
2245
2315
|
})).filter((e) => e.score > 0).sort((e, t) => t.score - e.score).slice(0, n).map((e) => e.file) : e.slice(0, n);
|
|
2246
2316
|
}
|
|
2247
|
-
function
|
|
2317
|
+
function yi(e, t) {
|
|
2248
2318
|
let n = 0, r = 0, i = -1;
|
|
2249
2319
|
for (let a = 0; a < t.length && r < e.length; a += 1) t[a] === e[r] && (n += i === a - 1 ? 6 : 1, (a === 0 || "/-_.".includes(t[a - 1])) && (n += 4), i = a, r += 1);
|
|
2250
2320
|
return r === e.length ? n : 0;
|
|
2251
2321
|
}
|
|
2252
2322
|
//#endregion
|
|
2253
2323
|
//#region src/chat/use-chat-composer-suggestions.ts
|
|
2254
|
-
function
|
|
2255
|
-
let t = N(null), n = N(0), r = N(0), i = N(0), a = N(0), s = N(0), c = null, l = !1, u, d = o(() =>
|
|
2324
|
+
function bi(e) {
|
|
2325
|
+
let t = N(null), n = N(0), r = N(0), i = N(0), a = N(0), s = N(0), c = null, l = !1, u, d = o(() => _i(e.prompt.value, e.caretPosition.value)), f = o(() => {
|
|
2256
2326
|
let t = d.value;
|
|
2257
|
-
return t?.query ?
|
|
2258
|
-
}), p = o(() => d.value !== null && !d.value.query && e.files().length > 0), m = o(() => t.value === "at" && d.value !== null && e.files().length > 0 && !J()), h = o(() =>
|
|
2327
|
+
return t?.query ? vi([...e.files()], t.query, 5) : [];
|
|
2328
|
+
}), p = o(() => d.value !== null && !d.value.query && e.files().length > 0), m = o(() => t.value === "at" && d.value !== null && e.files().length > 0 && !J()), h = o(() => jr(e.prompt.value, e.caretPosition.value, "$")), g = o(() => gi(e.prompt.value, e.caretPosition.value)), _ = o(() => Mr([...e.skills()], h.value?.query ?? "", -1, e.plugins?.() ?? [])), v = o(() => t.value === "skill" && e.skillsEnabled() && h.value !== null && e.skills().length > 0 && !J()), y = o(() => hr([...e.plugins?.() ?? []], g.value?.query ?? "")), b = o(() => fi(e.mentionGroups?.() ?? [], d.value?.query ?? "")), x = o(() => b.value.filter((e) => e.placement !== "after").flatMap((e) => e.items.map((t) => ({
|
|
2259
2329
|
group: e,
|
|
2260
2330
|
item: t
|
|
2261
2331
|
})))), S = o(() => b.value.filter((e) => e.placement === "after").flatMap((e) => e.items.map((t) => ({
|
|
2262
2332
|
group: e,
|
|
2263
2333
|
item: t
|
|
2264
|
-
})))), C = o(() => !1), w = o(() => x.value.length + y.value.length + f.value.length + S.value.length), T = o(() => t.value === "at" && d.value !== null && (w.value > 0 || p.value) && !J()), E = o(() =>
|
|
2334
|
+
})))), C = o(() => !1), w = o(() => x.value.length + y.value.length + f.value.length + S.value.length), T = o(() => t.value === "at" && d.value !== null && (w.value > 0 || p.value) && !J()), E = o(() => Kr(e.prompt.value, e.caretPosition.value)), D = o(() => qr([...e.commands()], E.value?.query ?? "")), O = o(() => (e.skillsEnabled(), [])), k = o(() => D.value.length + O.value.length), A = o(() => t.value === "slash" && E.value !== null && k.value > 0 && !J());
|
|
2265
2335
|
W([_, h], () => {
|
|
2266
2336
|
r.value = 0;
|
|
2267
2337
|
}), W([y, g], () => {
|
|
@@ -2476,16 +2546,16 @@ function vi(e) {
|
|
|
2476
2546
|
}
|
|
2477
2547
|
//#endregion
|
|
2478
2548
|
//#region src/audio/browser-audio-recorder.ts
|
|
2479
|
-
function
|
|
2480
|
-
return !!(typeof navigator.mediaDevices?.getUserMedia == "function" && typeof MediaRecorder < "u" &&
|
|
2549
|
+
function xi() {
|
|
2550
|
+
return !!(typeof navigator.mediaDevices?.getUserMedia == "function" && typeof MediaRecorder < "u" && wi() && (MediaRecorder.isTypeSupported("audio/webm;codecs=opus") || MediaRecorder.isTypeSupported("audio/webm") || MediaRecorder.isTypeSupported("audio/mp4")));
|
|
2481
2551
|
}
|
|
2482
|
-
var
|
|
2552
|
+
var Si = class {
|
|
2483
2553
|
chunks = [];
|
|
2484
2554
|
mediaRecorder = null;
|
|
2485
2555
|
startTime = 0;
|
|
2486
2556
|
stream = null;
|
|
2487
2557
|
async start() {
|
|
2488
|
-
this.release(), this.stream = await navigator.mediaDevices.getUserMedia({ audio: !0 }), this.chunks = [], this.startTime = Date.now(), this.mediaRecorder = new MediaRecorder(this.stream,
|
|
2558
|
+
this.release(), this.stream = await navigator.mediaDevices.getUserMedia({ audio: !0 }), this.chunks = [], this.startTime = Date.now(), this.mediaRecorder = new MediaRecorder(this.stream, Ci()), this.mediaRecorder.ondataavailable = (e) => {
|
|
2489
2559
|
e.data.size > 0 && this.chunks.push(e.data);
|
|
2490
2560
|
}, this.mediaRecorder.start();
|
|
2491
2561
|
}
|
|
@@ -2509,36 +2579,36 @@ var bi = class {
|
|
|
2509
2579
|
}), this.stream = null, this.mediaRecorder = null, this.chunks = [], this.startTime = 0;
|
|
2510
2580
|
}
|
|
2511
2581
|
};
|
|
2512
|
-
function
|
|
2582
|
+
function Ci() {
|
|
2513
2583
|
return MediaRecorder.isTypeSupported("audio/webm;codecs=opus") ? { mimeType: "audio/webm;codecs=opus" } : MediaRecorder.isTypeSupported("audio/webm") ? { mimeType: "audio/webm" } : MediaRecorder.isTypeSupported("audio/mp4") ? { mimeType: "audio/mp4" } : {};
|
|
2514
2584
|
}
|
|
2515
|
-
function
|
|
2585
|
+
function wi() {
|
|
2516
2586
|
return window.AudioContext ?? window.webkitAudioContext ?? null;
|
|
2517
2587
|
}
|
|
2518
2588
|
//#endregion
|
|
2519
2589
|
//#region src/audio/apple-speech-transcription.ts
|
|
2520
|
-
async function
|
|
2590
|
+
async function Ti(e, t) {
|
|
2521
2591
|
if (!t?.transcribeAppleSpeech) throw Error("Apple speech transcription is not available.");
|
|
2522
|
-
let n = await
|
|
2592
|
+
let n = await Ei(e);
|
|
2523
2593
|
return t.transcribeAppleSpeech(n, { locale: navigator.language });
|
|
2524
2594
|
}
|
|
2525
|
-
async function
|
|
2526
|
-
let n = await
|
|
2527
|
-
return (n.type.includes("webm") ? await
|
|
2595
|
+
async function Ei(e, t = tt) {
|
|
2596
|
+
let n = await ji(e, t);
|
|
2597
|
+
return (n.type.includes("webm") ? await Di(n) : n).arrayBuffer();
|
|
2528
2598
|
}
|
|
2529
|
-
async function
|
|
2530
|
-
let t =
|
|
2599
|
+
async function Di(e) {
|
|
2600
|
+
let t = Ai();
|
|
2531
2601
|
if (!t) throw Error("WebM audio conversion is not supported in this browser.");
|
|
2532
2602
|
let n = new t();
|
|
2533
2603
|
try {
|
|
2534
|
-
return
|
|
2604
|
+
return Oi(await n.decodeAudioData(await e.arrayBuffer()));
|
|
2535
2605
|
} finally {
|
|
2536
2606
|
await n.close();
|
|
2537
2607
|
}
|
|
2538
2608
|
}
|
|
2539
|
-
function
|
|
2609
|
+
function Oi(e) {
|
|
2540
2610
|
let t = e.numberOfChannels, n = e.length * t * 2, r = new ArrayBuffer(44 + n), i = new DataView(r);
|
|
2541
|
-
|
|
2611
|
+
ki(i, 0, "RIFF"), i.setUint32(4, 36 + n, !0), ki(i, 8, "WAVE"), ki(i, 12, "fmt "), i.setUint32(16, 16, !0), i.setUint16(20, 1, !0), i.setUint16(22, t, !0), i.setUint32(24, e.sampleRate, !0), i.setUint32(28, e.sampleRate * t * 2, !0), i.setUint16(32, t * 2, !0), i.setUint16(34, 16, !0), ki(i, 36, "data"), i.setUint32(40, n, !0);
|
|
2542
2612
|
let a = Array.from({ length: t }, (t, n) => e.getChannelData(n)), o = 44;
|
|
2543
2613
|
for (let t = 0; t < e.length; t += 1) for (let e of a) {
|
|
2544
2614
|
let n = Math.max(-1, Math.min(1, e[t] ?? 0));
|
|
@@ -2546,21 +2616,21 @@ function Ei(e) {
|
|
|
2546
2616
|
}
|
|
2547
2617
|
return new Blob([r], { type: "audio/wav" });
|
|
2548
2618
|
}
|
|
2549
|
-
function
|
|
2619
|
+
function ki(e, t, n) {
|
|
2550
2620
|
for (let r = 0; r < n.length; r += 1) e.setUint8(t + r, n.charCodeAt(r));
|
|
2551
2621
|
}
|
|
2552
|
-
function
|
|
2622
|
+
function Ai() {
|
|
2553
2623
|
if (typeof AudioContext < "u") return AudioContext;
|
|
2554
2624
|
if (!(typeof window > "u")) return window.webkitAudioContext;
|
|
2555
2625
|
}
|
|
2556
|
-
async function
|
|
2626
|
+
async function ji(e, t) {
|
|
2557
2627
|
if (!e.blob.type.includes("webm")) return e.blob;
|
|
2558
2628
|
let n = await t(e.blob, e.durationMs);
|
|
2559
2629
|
return n.type === e.blob.type ? n : new Blob([n], { type: e.blob.type });
|
|
2560
2630
|
}
|
|
2561
2631
|
//#endregion
|
|
2562
2632
|
//#region src/chat/image-preview-pool.ts
|
|
2563
|
-
var
|
|
2633
|
+
var Mi = Symbol("image-preview-pool"), Ni = class {
|
|
2564
2634
|
read;
|
|
2565
2635
|
budget;
|
|
2566
2636
|
viewport;
|
|
@@ -2624,7 +2694,7 @@ var Ai = Symbol("image-preview-pool"), ji = class {
|
|
|
2624
2694
|
e.original.value = r, e.originalBytes = a, e.ownedOriginal = i, r = void 0;
|
|
2625
2695
|
}
|
|
2626
2696
|
if (!e.users || this.viewport && !e.near && !t) return;
|
|
2627
|
-
let n = await
|
|
2697
|
+
let n = await Pi(e.original.value, this.viewport ? e.width : void 0);
|
|
2628
2698
|
r = n.url, i = n.owned, e.dimensions.value = n.originalSize;
|
|
2629
2699
|
let a = n.bytes + n.width * n.height * 4;
|
|
2630
2700
|
if (!e.users || this.viewport && !e.near && !t || !this.room(a, e, t)) return;
|
|
@@ -2663,7 +2733,7 @@ var Ai = Symbol("image-preview-pool"), ji = class {
|
|
|
2663
2733
|
});
|
|
2664
2734
|
}
|
|
2665
2735
|
};
|
|
2666
|
-
function
|
|
2736
|
+
function Pi(e, t = Infinity) {
|
|
2667
2737
|
return new Promise((n, r) => {
|
|
2668
2738
|
let i = new Image(), a, o = !1, s = () => {
|
|
2669
2739
|
clearTimeout(l), i.onload = null, i.onerror = null, i.src = "", a &&= (a.width = 0, a.height = 0, void 0);
|
|
@@ -2706,29 +2776,29 @@ function Mi(e, t = Infinity) {
|
|
|
2706
2776
|
}
|
|
2707
2777
|
//#endregion
|
|
2708
2778
|
//#region src/native-capabilities.ts
|
|
2709
|
-
var
|
|
2710
|
-
function
|
|
2711
|
-
if (A(
|
|
2712
|
-
let n = new
|
|
2713
|
-
A(
|
|
2779
|
+
var Fi = Symbol("codex-app-sdk-host-capabilities");
|
|
2780
|
+
function Ii(e, t) {
|
|
2781
|
+
if (A(Fi, e), t && t.imagePreviewBudgetBytes > 0) {
|
|
2782
|
+
let n = new Ni((t) => /^(?:data:image\/|https?:|blob:|\/\/)/i.test(t) ? Promise.resolve(t) : e?.readImagePreview?.(t) ?? Promise.resolve(null), t.imagePreviewBudgetBytes, t.viewportImageLoading);
|
|
2783
|
+
A(Mi, n), O(() => n.clear());
|
|
2714
2784
|
}
|
|
2715
2785
|
return e;
|
|
2716
2786
|
}
|
|
2717
|
-
function
|
|
2718
|
-
let e =
|
|
2719
|
-
return y() ? b(
|
|
2787
|
+
function Li() {
|
|
2788
|
+
let e = Ri();
|
|
2789
|
+
return y() ? b(Fi, e) : e;
|
|
2720
2790
|
}
|
|
2721
|
-
function
|
|
2791
|
+
function Ri() {
|
|
2722
2792
|
if (!(typeof window > "u")) return window.codexAppSdkNative;
|
|
2723
2793
|
}
|
|
2724
|
-
function
|
|
2725
|
-
return
|
|
2794
|
+
function zi() {
|
|
2795
|
+
return Ri();
|
|
2726
2796
|
}
|
|
2727
|
-
async function
|
|
2797
|
+
async function Bi(e, t = Ri()) {
|
|
2728
2798
|
let n = e ?? t?.pickAttachments;
|
|
2729
2799
|
return n ? n() : [];
|
|
2730
2800
|
}
|
|
2731
|
-
async function
|
|
2801
|
+
async function Vi(e, t, n = Ri()) {
|
|
2732
2802
|
if (e.length === 0) return [];
|
|
2733
2803
|
let r = t ?? n?.ingestAttachments;
|
|
2734
2804
|
return r ? r(await Promise.all(e.map(async (e) => ({
|
|
@@ -2739,13 +2809,13 @@ async function zi(e, t, n = Ii()) {
|
|
|
2739
2809
|
}
|
|
2740
2810
|
//#endregion
|
|
2741
2811
|
//#region src/audio/pcm-capture.worklet.js?worker&url
|
|
2742
|
-
var
|
|
2812
|
+
var Hi = "" + new URL("assets/pcm-capture.worklet-CUbTfAMh.js", import.meta.url).href;
|
|
2743
2813
|
//#endregion
|
|
2744
2814
|
//#region src/audio/browser-speech-recorder.ts
|
|
2745
|
-
function
|
|
2815
|
+
function Ui() {
|
|
2746
2816
|
return typeof navigator.mediaDevices?.getUserMedia == "function" && typeof AudioContext < "u" && typeof AudioWorkletNode < "u";
|
|
2747
2817
|
}
|
|
2748
|
-
var
|
|
2818
|
+
var Wi = class {
|
|
2749
2819
|
stream;
|
|
2750
2820
|
context;
|
|
2751
2821
|
node;
|
|
@@ -2764,7 +2834,7 @@ var Hi = class {
|
|
|
2764
2834
|
}, a = () => i("Microphone access ended.");
|
|
2765
2835
|
r.getTracks().forEach((e) => e.addEventListener("ended", a)), this.unlisten = () => r.getTracks().forEach((e) => e.removeEventListener("ended", a));
|
|
2766
2836
|
let o = this.context = new AudioContext({ sampleRate: 16e3 });
|
|
2767
|
-
if (await o.audioWorklet.addModule(
|
|
2837
|
+
if (await o.audioWorklet.addModule(Hi), this.released || (this.source = o.createMediaStreamSource(r), this.node = new AudioWorkletNode(o, "codex-pcm-capture", {
|
|
2768
2838
|
channelCount: 1,
|
|
2769
2839
|
channelCountMode: "explicit"
|
|
2770
2840
|
}), this.node.onprocessorerror = () => i("Microphone audio processing failed."), this.node.connect(o.destination), this.node.port.onmessage = ({ data: t }) => {
|
|
@@ -2815,19 +2885,19 @@ var Hi = class {
|
|
|
2815
2885
|
};
|
|
2816
2886
|
//#endregion
|
|
2817
2887
|
//#region src/chat/use-chat-composer-voice.ts
|
|
2818
|
-
function
|
|
2819
|
-
let n =
|
|
2888
|
+
function Gi(e, t = {}) {
|
|
2889
|
+
let n = Li(), r = e.streamingTranscription ?? (e.transcribeAudio ? void 0 : n?.streamingTranscription), i = {
|
|
2820
2890
|
canTranscribe: () => !!r || n?.capabilities.transcription === !0,
|
|
2821
|
-
createRecorder: () => new
|
|
2822
|
-
createStreamRecorder: () => new
|
|
2823
|
-
isRecordingSupported: r ?
|
|
2824
|
-
transcribe: (e) =>
|
|
2891
|
+
createRecorder: () => new Si(),
|
|
2892
|
+
createStreamRecorder: () => new Wi(),
|
|
2893
|
+
isRecordingSupported: r ? Ui : xi,
|
|
2894
|
+
transcribe: (e) => Ti(e, { transcribeAppleSpeech: async (e, t) => n ? n.transcribeAudio(e, t) : {
|
|
2825
2895
|
error: "Speech transcription is not available.",
|
|
2826
2896
|
text: ""
|
|
2827
2897
|
} })
|
|
2828
2898
|
}, a = e.transcribeAudio ? {
|
|
2829
2899
|
canTranscribe: () => !0,
|
|
2830
|
-
transcribe: (t) =>
|
|
2900
|
+
transcribe: (t) => Ti(t, { transcribeAppleSpeech: e.transcribeAudio })
|
|
2831
2901
|
} : {}, s = {
|
|
2832
2902
|
...i,
|
|
2833
2903
|
...a,
|
|
@@ -2868,7 +2938,7 @@ function Ui(e, t = {}) {
|
|
|
2868
2938
|
};
|
|
2869
2939
|
}
|
|
2870
2940
|
});
|
|
2871
|
-
let n = await t.start((t) => r.append(e.id, t), (t) => T(e,
|
|
2941
|
+
let n = await t.start((t) => r.append(e.id, t), (t) => T(e, qi(t)), (t) => {
|
|
2872
2942
|
m === e && !e.stopping && (p.value = t);
|
|
2873
2943
|
});
|
|
2874
2944
|
if (m !== e) return;
|
|
@@ -2890,7 +2960,7 @@ function Ui(e, t = {}) {
|
|
|
2890
2960
|
}
|
|
2891
2961
|
c.value = !0;
|
|
2892
2962
|
} catch (t) {
|
|
2893
|
-
T(e,
|
|
2963
|
+
T(e, qi(t));
|
|
2894
2964
|
} finally {
|
|
2895
2965
|
m === e && (u.value = !1);
|
|
2896
2966
|
}
|
|
@@ -2914,7 +2984,7 @@ function Ui(e, t = {}) {
|
|
|
2914
2984
|
partialText: ""
|
|
2915
2985
|
}, n.text.trim() ? (await e.onTranscript(n.text), m === t) : !1) : !1;
|
|
2916
2986
|
} catch (e) {
|
|
2917
|
-
return m === t && (h.value =
|
|
2987
|
+
return m === t && (h.value = qi(e)), !1;
|
|
2918
2988
|
} finally {
|
|
2919
2989
|
t.unsubscribe?.(), m === t && (m = void 0, l.value = !1, r && r.cancel(t.id).catch(() => {}));
|
|
2920
2990
|
}
|
|
@@ -2949,15 +3019,15 @@ function Ui(e, t = {}) {
|
|
|
2949
3019
|
dispose: D
|
|
2950
3020
|
};
|
|
2951
3021
|
}
|
|
2952
|
-
function
|
|
2953
|
-
return
|
|
3022
|
+
function Ki(e) {
|
|
3023
|
+
return Gi(e);
|
|
2954
3024
|
}
|
|
2955
|
-
function
|
|
3025
|
+
function qi(e) {
|
|
2956
3026
|
return e instanceof Error ? e.message : String(e);
|
|
2957
3027
|
}
|
|
2958
3028
|
//#endregion
|
|
2959
3029
|
//#region src/composer-state.ts
|
|
2960
|
-
function
|
|
3030
|
+
function Ji(e) {
|
|
2961
3031
|
let t = e.text.length, n = Math.max(0, Math.min(e.selectionStart, t)), r = Math.max(n, Math.min(e.selectionEnd, t));
|
|
2962
3032
|
return {
|
|
2963
3033
|
text: e.text,
|
|
@@ -2969,7 +3039,7 @@ function Ki(e) {
|
|
|
2969
3039
|
}
|
|
2970
3040
|
//#endregion
|
|
2971
3041
|
//#region src/components/CodexComposer.vue?vue&type=script&setup=true&lang.ts
|
|
2972
|
-
var
|
|
3042
|
+
var Yi = { class: "chat-composer__input-row" }, Xi = { class: "chat-composer__meta" }, Zi = { class: "chat-composer__meta-leading" }, Qi = { class: "chat-composer__meta-trailing" }, $i = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
2973
3043
|
__name: "CodexComposer",
|
|
2974
3044
|
props: {
|
|
2975
3045
|
autofocus: { type: Boolean },
|
|
@@ -3028,7 +3098,7 @@ var qi = { class: "chat-composer__input-row" }, Ji = { class: "chat-composer__me
|
|
|
3028
3098
|
"update:serviceTier"
|
|
3029
3099
|
],
|
|
3030
3100
|
setup(e, { expose: t, emit: n }) {
|
|
3031
|
-
let r = e, i = n, a =
|
|
3101
|
+
let r = e, i = n, a = Li(), f = N(""), p = N([]), h = N(null), g = N(!1), v = N(null), y = N(0), b = N(0), T = N(0), E = N(0), { exit: O, recall: A, remember: j, seed: M } = It({
|
|
3032
3102
|
apply: bt,
|
|
3033
3103
|
currentPrompt: () => f.value
|
|
3034
3104
|
}), P = !1, F = null, L = 0, R = o(() => r.capabilities ?? Nt), ee = o(() => Mt(r.presentation)), z = o(() => Ft(r.commands ?? Pt, R.value.goals)), B = o(() => z.value.find((e) => e.id === h.value) ?? null), V = o(() => z.value.find((e) => (e.slashName ?? e.name) === "goal" && e.composerMode) ?? null), te = o(() => !!(V.value && h.value === V.value.id)), U = o(() => !!(R.value.planMode && r.planMode && !te.value)), ne = o(() => B.value?.composerMode?.placeholder ?? r.placeholder ?? "Ask Codex…"), re = o(() => ee.value.composer.voice && !!(r.transcribeAudio || a?.capabilities.transcription)), J = o(() => !!f.value.trim()), oe = o(() => r.emptySendPrompt?.trim() ?? ""), ce = o(() => !!((B.value ? J.value : J.value || r.hasAttachments || r.hasExternalContent) && !r.disabled)), le = o(() => !!(r.canContinueInterruptedTurn && !r.isSending && !J.value && !r.hasAttachments && !r.hasExternalContent && !r.disabled)), ue = o(() => !!(oe.value && !r.isSending && !r.disabled && !J.value && !r.hasAttachments && !r.hasExternalContent && !B.value && !le.value)), de = null, fe = o(() => !!(r.isSending && !J.value && !r.hasAttachments && !r.hasExternalContent && !r.disabled && !Se.value && !we.value)), pe = o(() => fe.value), me = o(() => r.followUpBehavior === "steer" && R.value.steerPrompt), he = o(() => r.interruptArmed ? !1 : Ce.value || we.value ? !0 : Se.value && !r.disabled ? !1 : !ce.value && !fe.value && !le.value), ge = o(() => le.value ? "Continue" : ue.value ? "Send default prompt" : r.isSending ? me.value ? "Steer prompt" : "Queue prompt" : "Send prompt"), _e = o(() => {
|
|
@@ -3036,7 +3106,7 @@ var qi = { class: "chat-composer__input-row" }, Ji = { class: "chat-composer__me
|
|
|
3036
3106
|
if (fe.value) return "Interrupt";
|
|
3037
3107
|
let e = `${ge.value} (Enter)`;
|
|
3038
3108
|
return !r.isSending || !R.value.steerPrompt ? e : `${e}. ${me.value ? "Queue" : "Steer"} prompt (Cmd/Ctrl+Enter)`;
|
|
3039
|
-
}), { buttonDisabled: ve, buttonLabel: ye, buttonTitle: be, error: xe, isRecording: Se, isStarting: Ce, isTranscribing: we, transcript: Te, audioLevel: Ee, cancel: De, stop: Oe, toggle: ke } =
|
|
3109
|
+
}), { buttonDisabled: ve, buttonLabel: ye, buttonTitle: be, error: xe, isRecording: Se, isStarting: Ce, isTranscribing: we, transcript: Te, audioLevel: Ee, cancel: De, stop: Oe, toggle: ke } = Gi({
|
|
3040
3110
|
isDisabled: () => r.disabled,
|
|
3041
3111
|
isSending: () => r.isSending,
|
|
3042
3112
|
onTranscript: ct,
|
|
@@ -3066,7 +3136,7 @@ var qi = { class: "chat-composer__input-row" }, Ji = { class: "chat-composer__me
|
|
|
3066
3136
|
Ne = 0;
|
|
3067
3137
|
for (let e = 0; e < n; e += 1) A("ArrowUp");
|
|
3068
3138
|
}, { immediate: !0 });
|
|
3069
|
-
let { activeAtIndex: Y, activeSkillIndex: Pe, activeSlashIndex: Fe, close: Ie, closeSoon: Le, resume: Re, fileMenuShowsHint: ze, atMenuVisible: Be, handleKeydown: Ve, selectCommand: He, selectFile: Ue, selectPlugin: We, selectMention: Ge, selectSkill: Ke, selectSlashSkill: qe, skillMenuVisible: Je, slashMenuVisible: Ye, suspend: Xe, updateCaretPosition: Ze, visibleFiles: Qe, visiblePlugins: $e, visibleMentionGroups: et, visibleSkills: tt, visibleSlashCommands: nt, visibleSlashSkills: rt } =
|
|
3139
|
+
let { activeAtIndex: Y, activeSkillIndex: Pe, activeSlashIndex: Fe, close: Ie, closeSoon: Le, resume: Re, fileMenuShowsHint: ze, atMenuVisible: Be, handleKeydown: Ve, selectCommand: He, selectFile: Ue, selectPlugin: We, selectMention: Ge, selectSkill: Ke, selectSlashSkill: qe, skillMenuVisible: Je, slashMenuVisible: Ye, suspend: Xe, updateCaretPosition: Ze, visibleFiles: Qe, visiblePlugins: $e, visibleMentionGroups: et, visibleSkills: tt, visibleSlashCommands: nt, visibleSlashSkills: rt } = bi({
|
|
3070
3140
|
caretPosition: b,
|
|
3071
3141
|
commands: () => z.value,
|
|
3072
3142
|
disabled: () => r.disabled,
|
|
@@ -3193,7 +3263,7 @@ var qi = { class: "chat-composer__input-row" }, Ji = { class: "chat-composer__me
|
|
|
3193
3263
|
e && te.value && dt(), i("update:planMode", e);
|
|
3194
3264
|
}
|
|
3195
3265
|
function ht(e) {
|
|
3196
|
-
let t =
|
|
3266
|
+
let t = Ji(e);
|
|
3197
3267
|
h.value = t.activeCommandId ?? null, gt(t, F) || O();
|
|
3198
3268
|
let n = ++L, r = v.value?.getSelectionRange();
|
|
3199
3269
|
if (v.value && JSON.stringify(p.value) === JSON.stringify(t.content ?? [{
|
|
@@ -3274,7 +3344,7 @@ var qi = { class: "chat-composer__input-row" }, Ji = { class: "chat-composer__me
|
|
|
3274
3344
|
}
|
|
3275
3345
|
function St() {
|
|
3276
3346
|
if (P) return;
|
|
3277
|
-
let e =
|
|
3347
|
+
let e = Ji({
|
|
3278
3348
|
text: f.value,
|
|
3279
3349
|
...ie(p.value) === f.value && p.value.some((e) => e.type === "mention") ? { content: p.value } : {},
|
|
3280
3350
|
selectionStart: T.value,
|
|
@@ -3307,7 +3377,7 @@ var qi = { class: "chat-composer__input-row" }, Ji = { class: "chat-composer__me
|
|
|
3307
3377
|
onKeydown: K(Me, ["esc"])
|
|
3308
3378
|
}, [
|
|
3309
3379
|
I(t.$slots, "before", {}, void 0, !0),
|
|
3310
|
-
H(Be) ? (k(), s(
|
|
3380
|
+
H(Be) ? (k(), s(Ar, {
|
|
3311
3381
|
key: 0,
|
|
3312
3382
|
"active-index": H(Y),
|
|
3313
3383
|
"show-file-hint": H(ze),
|
|
@@ -3331,7 +3401,7 @@ var qi = { class: "chat-composer__input-row" }, Ji = { class: "chat-composer__me
|
|
|
3331
3401
|
"onSelectPlugin",
|
|
3332
3402
|
"onSelectMention"
|
|
3333
3403
|
])) : c("", !0),
|
|
3334
|
-
H(Je) ? (k(), s(
|
|
3404
|
+
H(Je) ? (k(), s(Gr, {
|
|
3335
3405
|
key: 1,
|
|
3336
3406
|
"active-index": H(Pe),
|
|
3337
3407
|
plugins: e.plugins,
|
|
@@ -3343,7 +3413,7 @@ var qi = { class: "chat-composer__input-row" }, Ji = { class: "chat-composer__me
|
|
|
3343
3413
|
"visible-skills",
|
|
3344
3414
|
"onSelect"
|
|
3345
3415
|
])) : c("", !0),
|
|
3346
|
-
H(Ye) ? (k(), s(
|
|
3416
|
+
H(Ye) ? (k(), s(si, {
|
|
3347
3417
|
key: 2,
|
|
3348
3418
|
"active-index": H(Fe),
|
|
3349
3419
|
"visible-commands": H(nt),
|
|
@@ -3357,7 +3427,7 @@ var qi = { class: "chat-composer__input-row" }, Ji = { class: "chat-composer__me
|
|
|
3357
3427
|
"onSelectCommand",
|
|
3358
3428
|
"onSelectSkill"
|
|
3359
3429
|
])) : c("", !0),
|
|
3360
|
-
u("div",
|
|
3430
|
+
u("div", Yi, [re.value && (H(Ce) || H(Se) || H(we)) ? (k(), s(_n, {
|
|
3361
3431
|
key: 0,
|
|
3362
3432
|
class: "chat-composer__input",
|
|
3363
3433
|
recording: H(Se),
|
|
@@ -3373,7 +3443,7 @@ var qi = { class: "chat-composer__input-row" }, Ji = { class: "chat-composer__me
|
|
|
3373
3443
|
"audio-level",
|
|
3374
3444
|
"before",
|
|
3375
3445
|
"after"
|
|
3376
|
-
])) : (k(), s(
|
|
3446
|
+
])) : (k(), s(hi, {
|
|
3377
3447
|
key: y.value,
|
|
3378
3448
|
ref_key: "editorEl",
|
|
3379
3449
|
ref: v,
|
|
@@ -3412,7 +3482,7 @@ var qi = { class: "chat-composer__input-row" }, Ji = { class: "chat-composer__me
|
|
|
3412
3482
|
"onClick",
|
|
3413
3483
|
"onKeyup"
|
|
3414
3484
|
])), I(t.$slots, "after-input", {}, void 0, !0)]),
|
|
3415
|
-
u("div",
|
|
3485
|
+
u("div", Xi, [u("div", Zi, [
|
|
3416
3486
|
ee.value.composer.actionMenu ? (k(), s(ln, {
|
|
3417
3487
|
key: 0,
|
|
3418
3488
|
"attach-enabled": e.attachEnabled,
|
|
@@ -3459,12 +3529,12 @@ var qi = { class: "chat-composer__input-row" }, Ji = { class: "chat-composer__me
|
|
|
3459
3529
|
onDisablePlanMode: n[5] ||= (e) => mt(!1),
|
|
3460
3530
|
onRemoveCommand: ut
|
|
3461
3531
|
}, null, 8, ["plan-mode", "command"])
|
|
3462
|
-
]), u("div",
|
|
3532
|
+
]), u("div", Qi, [
|
|
3463
3533
|
ee.value.composer.contextUsage ? (k(), s(nr, {
|
|
3464
3534
|
key: 0,
|
|
3465
3535
|
"context-usage": e.contextUsage
|
|
3466
3536
|
}, null, 8, ["context-usage"])) : c("", !0),
|
|
3467
|
-
R.value.models ? (k(), s(
|
|
3537
|
+
R.value.models ? (k(), s(ur, {
|
|
3468
3538
|
key: 1,
|
|
3469
3539
|
disabled: e.disabled,
|
|
3470
3540
|
models: e.models,
|
|
@@ -3526,13 +3596,13 @@ var qi = { class: "chat-composer__input-row" }, Ji = { class: "chat-composer__me
|
|
|
3526
3596
|
])])
|
|
3527
3597
|
], 34));
|
|
3528
3598
|
}
|
|
3529
|
-
}), [["__scopeId", "data-v-1310bece"]]),
|
|
3599
|
+
}), [["__scopeId", "data-v-1310bece"]]), ea = { class: "codex-chat-theme codex-request-card chat-tool-confirmation" }, ta = { class: "codex-request-header chat-tool-confirmation__header" }, na = { class: "codex-request-eyebrow chat-tool-confirmation__tag" }, ra = { class: "codex-request-title chat-tool-confirmation__question" }, ia = {
|
|
3530
3600
|
key: 0,
|
|
3531
3601
|
class: "codex-request-description chat-tool-confirmation__description"
|
|
3532
|
-
},
|
|
3602
|
+
}, aa = {
|
|
3533
3603
|
key: 1,
|
|
3534
3604
|
class: "chat-tool-confirmation__details"
|
|
3535
|
-
},
|
|
3605
|
+
}, oa = { class: "chat-tool-confirmation__details-body" }, sa = { class: "codex-request-footer chat-tool-confirmation__actions" }, ca = ["disabled", "onClick"], la = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
3536
3606
|
__name: "ChatApprovalCard",
|
|
3537
3607
|
props: {
|
|
3538
3608
|
summary: {},
|
|
@@ -3543,15 +3613,15 @@ var qi = { class: "chat-composer__input-row" }, Ji = { class: "chat-composer__me
|
|
|
3543
3613
|
},
|
|
3544
3614
|
emits: ["decide"],
|
|
3545
3615
|
setup(e) {
|
|
3546
|
-
return (n, r) => (k(), l("section",
|
|
3547
|
-
u("header",
|
|
3616
|
+
return (n, r) => (k(), l("section", ea, [
|
|
3617
|
+
u("header", ta, [u("span", na, [m(H(Ve), {
|
|
3548
3618
|
size: 16,
|
|
3549
3619
|
"aria-hidden": "true"
|
|
3550
3620
|
}), r[0] ||= p(" Approve tool call ", -1)])]),
|
|
3551
|
-
u("span",
|
|
3552
|
-
e.description ? (k(), l("p",
|
|
3553
|
-
e.details || n.$slots.details ? (k(), l("details",
|
|
3554
|
-
u("footer",
|
|
3621
|
+
u("span", ra, B(e.summary), 1),
|
|
3622
|
+
e.description ? (k(), l("p", ia, B(e.description), 1)) : c("", !0),
|
|
3623
|
+
e.details || n.$slots.details ? (k(), l("details", aa, [r[1] ||= u("summary", { class: "chat-tool-confirmation__details-summary" }, "Details", -1), u("div", oa, [I(n.$slots, "details", {}, () => [u("pre", null, B(e.details), 1)], !0)])])) : c("", !0),
|
|
3624
|
+
u("footer", sa, [(k(!0), l(t, null, F(e.actions, (t) => (k(), l("button", {
|
|
3555
3625
|
key: t.id,
|
|
3556
3626
|
class: C(["codex-request-button chat-tool-confirmation__button", {
|
|
3557
3627
|
"codex-request-button--primary": t.primary,
|
|
@@ -3560,13 +3630,13 @@ var qi = { class: "chat-composer__input-row" }, Ji = { class: "chat-composer__me
|
|
|
3560
3630
|
type: "button",
|
|
3561
3631
|
disabled: e.disabled,
|
|
3562
3632
|
onClick: (e) => n.$emit("decide", t.id)
|
|
3563
|
-
}, B(t.label), 11,
|
|
3633
|
+
}, B(t.label), 11, ca))), 128))])
|
|
3564
3634
|
]));
|
|
3565
3635
|
}
|
|
3566
|
-
}), [["__scopeId", "data-v-d39db1b1"]]),
|
|
3636
|
+
}), [["__scopeId", "data-v-d39db1b1"]]), ua = { class: "codex-approval-prompt__details" }, da = { key: 0 }, fa = { key: 1 }, pa = {
|
|
3567
3637
|
key: 2,
|
|
3568
3638
|
"aria-label": "Requested permissions"
|
|
3569
|
-
},
|
|
3639
|
+
}, ma = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
3570
3640
|
__name: "CodexApprovalPrompt",
|
|
3571
3641
|
props: {
|
|
3572
3642
|
approval: {},
|
|
@@ -3598,7 +3668,7 @@ var qi = { class: "chat-composer__input-row" }, Ji = { class: "chat-composer__me
|
|
|
3598
3668
|
function h(e) {
|
|
3599
3669
|
return e.kind === "network" ? `Network access${e.host ? ` to ${e.protocol ? `${e.protocol}://` : ""}${e.host}` : ""}: ${e.enabled ? "enabled" : "disabled"}` : `${e.access[0]?.toUpperCase()}${e.access.slice(1)} access: ${e.path}`;
|
|
3600
3670
|
}
|
|
3601
|
-
return (n, r) => (k(), s(
|
|
3671
|
+
return (n, r) => (k(), s(la, {
|
|
3602
3672
|
class: "codex-approval-prompt",
|
|
3603
3673
|
role: "status",
|
|
3604
3674
|
summary: e.approval.title,
|
|
@@ -3608,10 +3678,10 @@ var qi = { class: "chat-composer__input-row" }, Ji = { class: "chat-composer__me
|
|
|
3608
3678
|
onDecide: m
|
|
3609
3679
|
}, d({ _: 2 }, [e.approval.command || e.approval.cwd || e.approval.requestedPermissions?.length ? {
|
|
3610
3680
|
name: "details",
|
|
3611
|
-
fn: G(() => [u("div",
|
|
3612
|
-
e.approval.command ? (k(), l("code",
|
|
3613
|
-
e.approval.cwd ? (k(), l("small",
|
|
3614
|
-
e.approval.requestedPermissions?.length ? (k(), l("ul",
|
|
3681
|
+
fn: G(() => [u("div", ua, [
|
|
3682
|
+
e.approval.command ? (k(), l("code", da, B(e.approval.command), 1)) : c("", !0),
|
|
3683
|
+
e.approval.cwd ? (k(), l("small", fa, B(e.approval.cwd), 1)) : c("", !0),
|
|
3684
|
+
e.approval.requestedPermissions?.length ? (k(), l("ul", pa, [(k(!0), l(t, null, F(e.approval.requestedPermissions, (e, t) => (k(), l("li", { key: t }, B(h(e)), 1))), 128))])) : c("", !0)
|
|
3615
3685
|
])]),
|
|
3616
3686
|
key: "0"
|
|
3617
3687
|
} : void 0]), 1032, [
|
|
@@ -3624,10 +3694,10 @@ var qi = { class: "chat-composer__input-row" }, Ji = { class: "chat-composer__me
|
|
|
3624
3694
|
}), [["__scopeId", "data-v-e29f65e1"]]);
|
|
3625
3695
|
//#endregion
|
|
3626
3696
|
//#region src/conversation-pane-controller.ts
|
|
3627
|
-
function
|
|
3697
|
+
function ha(e) {
|
|
3628
3698
|
return typeof e == "function" ? e() : typeof e == "object" && e && "value" in e ? e.value : e;
|
|
3629
3699
|
}
|
|
3630
|
-
function
|
|
3700
|
+
function ga(e) {
|
|
3631
3701
|
return {
|
|
3632
3702
|
state: e.state,
|
|
3633
3703
|
actions: e.actions
|
|
@@ -3635,12 +3705,12 @@ function ma(e) {
|
|
|
3635
3705
|
}
|
|
3636
3706
|
//#endregion
|
|
3637
3707
|
//#region src/chat/inline-html.ts
|
|
3638
|
-
function
|
|
3708
|
+
function _a(e, t) {
|
|
3639
3709
|
let n = [], r = /(^|\n)(?:(`{3,}|~{3,})([^\n]*)\n|[ \t]*<artifact\b([^>]*)>)/gi, i;
|
|
3640
3710
|
for (; i = r.exec(e);) {
|
|
3641
3711
|
let a = i.index + (i[1]?.length ?? 0), o = r.lastIndex;
|
|
3642
3712
|
if (i[2]) {
|
|
3643
|
-
let s =
|
|
3713
|
+
let s = va(e, o, i[2]);
|
|
3644
3714
|
if (r.lastIndex = s.end, i[3].trim().toLowerCase() !== "html" || !/^\s*(?:<!doctype\s+html\b|<html\b)/i.test(s.source)) continue;
|
|
3645
3715
|
n.push({
|
|
3646
3716
|
type: "html",
|
|
@@ -3652,9 +3722,9 @@ function ha(e, t) {
|
|
|
3652
3722
|
let s = /<\/artifact\s*>/gi;
|
|
3653
3723
|
s.lastIndex = o;
|
|
3654
3724
|
let c = s.exec(e), l = c ? s.lastIndex : e.length, u = e.slice(o, c?.index ?? e.length).replace(/^\s*\n/, "");
|
|
3655
|
-
c || (u =
|
|
3725
|
+
c || (u = ya(u));
|
|
3656
3726
|
let d = /^(`{3,}|~{3,})html[^\n]*\n/i.exec(u);
|
|
3657
|
-
if (d && (u =
|
|
3727
|
+
if (d && (u = va(u, d[0].length, d[1]).source), r.lastIndex = l, !/^\s*</.test(u)) continue;
|
|
3658
3728
|
let f = /\btitle\s*=\s*(?:"([^"]*)"|'([^']*)')/i.exec(i[4]);
|
|
3659
3729
|
n.push({
|
|
3660
3730
|
type: "html",
|
|
@@ -3668,7 +3738,7 @@ function ha(e, t) {
|
|
|
3668
3738
|
}
|
|
3669
3739
|
return n;
|
|
3670
3740
|
}
|
|
3671
|
-
function
|
|
3741
|
+
function va(e, t, n) {
|
|
3672
3742
|
let r = RegExp(`^${n[0]}{${n.length},}[ \\t]*(?=\\r?\\n|$)`, "gm");
|
|
3673
3743
|
r.lastIndex = t;
|
|
3674
3744
|
let i = r.exec(e), a = e.slice(t, i?.index ?? e.length);
|
|
@@ -3678,22 +3748,22 @@ function ga(e, t, n) {
|
|
|
3678
3748
|
complete: !!i
|
|
3679
3749
|
};
|
|
3680
3750
|
}
|
|
3681
|
-
function
|
|
3751
|
+
function ya(e) {
|
|
3682
3752
|
let t = e.lastIndexOf("</");
|
|
3683
3753
|
return t >= 0 && "</artifact>".startsWith(e.slice(t).toLowerCase()) ? e.slice(0, t) : e;
|
|
3684
3754
|
}
|
|
3685
3755
|
//#endregion
|
|
3686
3756
|
//#region src/chat/renderer-message-adapter.ts
|
|
3687
|
-
function
|
|
3757
|
+
function ba(e) {
|
|
3688
3758
|
return e.map($);
|
|
3689
3759
|
}
|
|
3690
3760
|
function $(e) {
|
|
3691
|
-
return
|
|
3761
|
+
return Sa("content" in e ? e : xa(e));
|
|
3692
3762
|
}
|
|
3693
|
-
function
|
|
3694
|
-
let t = [], n = [], r = [], i = e.turnId ??
|
|
3763
|
+
function xa(e) {
|
|
3764
|
+
let t = [], n = [], r = [], i = e.turnId ?? Ta(e.metadata, "turnId");
|
|
3695
3765
|
for (let i of e.parts) if (i.type === "tool") {
|
|
3696
|
-
let t =
|
|
3766
|
+
let t = wa(e, i, r.length);
|
|
3697
3767
|
r.push(t), n.push({
|
|
3698
3768
|
type: "tool",
|
|
3699
3769
|
toolCall: t
|
|
@@ -3718,7 +3788,7 @@ function ya(e) {
|
|
|
3718
3788
|
type: "text",
|
|
3719
3789
|
content: i.text
|
|
3720
3790
|
}));
|
|
3721
|
-
return
|
|
3791
|
+
return Sa({
|
|
3722
3792
|
content: t.join("\n\n"),
|
|
3723
3793
|
...e.metadata?.promptContent === void 0 ? {} : { promptContent: J(e.metadata.promptContent) },
|
|
3724
3794
|
createdAt: e.createdAt,
|
|
@@ -3732,7 +3802,7 @@ function ya(e) {
|
|
|
3732
3802
|
type: e.kind === "compaction" ? "compaction" : e.kind === "steer" ? "steer" : "text"
|
|
3733
3803
|
});
|
|
3734
3804
|
}
|
|
3735
|
-
function
|
|
3805
|
+
function Sa(e) {
|
|
3736
3806
|
if (e.streaming === !0) return e;
|
|
3737
3807
|
let t = /* @__PURE__ */ new Map(), n = !1, r = (e) => {
|
|
3738
3808
|
let r = t.get(e);
|
|
@@ -3744,7 +3814,7 @@ function ba(e) {
|
|
|
3744
3814
|
done: !0,
|
|
3745
3815
|
...e.state === "running" ? {
|
|
3746
3816
|
state: "error",
|
|
3747
|
-
status:
|
|
3817
|
+
status: Ca(e.status)
|
|
3748
3818
|
} : {}
|
|
3749
3819
|
};
|
|
3750
3820
|
return t.set(e, i), i;
|
|
@@ -3758,7 +3828,7 @@ function ba(e) {
|
|
|
3758
3828
|
toolCalls: i
|
|
3759
3829
|
} : e;
|
|
3760
3830
|
}
|
|
3761
|
-
function
|
|
3831
|
+
function Ca(e) {
|
|
3762
3832
|
if (e?.trim().startsWith("{")) try {
|
|
3763
3833
|
let t = JSON.parse(e);
|
|
3764
3834
|
return JSON.stringify({
|
|
@@ -3768,8 +3838,8 @@ function xa(e) {
|
|
|
3768
3838
|
} catch {}
|
|
3769
3839
|
return "failed";
|
|
3770
3840
|
}
|
|
3771
|
-
function
|
|
3772
|
-
let r = e.turnId ??
|
|
3841
|
+
function wa(e, t, n) {
|
|
3842
|
+
let r = e.turnId ?? Ta(e.metadata, "turnId");
|
|
3773
3843
|
return {
|
|
3774
3844
|
args: t.input ?? (t.body ? { output: t.body } : void 0),
|
|
3775
3845
|
done: t.status !== "running",
|
|
@@ -3779,28 +3849,28 @@ function Sa(e, t, n) {
|
|
|
3779
3849
|
itemId: t.id || `${e.id}-tool-${n}`,
|
|
3780
3850
|
messageId: e.id,
|
|
3781
3851
|
...t.metadata ? { metadata: { ...t.metadata } } : {},
|
|
3782
|
-
result:
|
|
3783
|
-
state:
|
|
3852
|
+
result: Ea(t),
|
|
3853
|
+
state: Da(t.status),
|
|
3784
3854
|
status: t.statusText ?? t.status,
|
|
3785
3855
|
...r ? { turnId: r } : {}
|
|
3786
3856
|
};
|
|
3787
3857
|
}
|
|
3788
|
-
function
|
|
3858
|
+
function Ta(e, t) {
|
|
3789
3859
|
let n = e?.[t];
|
|
3790
3860
|
return typeof n == "string" && n ? n : void 0;
|
|
3791
3861
|
}
|
|
3792
|
-
function
|
|
3793
|
-
return
|
|
3862
|
+
function Ea(e) {
|
|
3863
|
+
return Oa(e.output) && "structuredContent" in e.output ? e.output.structuredContent : e.body ?? e.output;
|
|
3794
3864
|
}
|
|
3795
|
-
function
|
|
3865
|
+
function Da(e) {
|
|
3796
3866
|
return e === "running" ? "running" : e === "failed" ? "error" : "completed";
|
|
3797
3867
|
}
|
|
3798
|
-
function
|
|
3868
|
+
function Oa(e) {
|
|
3799
3869
|
return typeof e == "object" && !!e;
|
|
3800
3870
|
}
|
|
3801
3871
|
//#endregion
|
|
3802
3872
|
//#region src/chat/message-blocks.ts
|
|
3803
|
-
function
|
|
3873
|
+
function ka(e) {
|
|
3804
3874
|
let t = /* @__PURE__ */ new Set();
|
|
3805
3875
|
return [...e].reverse().map((e) => {
|
|
3806
3876
|
let n = $(e);
|
|
@@ -3813,8 +3883,8 @@ function Da(e) {
|
|
|
3813
3883
|
};
|
|
3814
3884
|
}).reverse();
|
|
3815
3885
|
}
|
|
3816
|
-
var
|
|
3817
|
-
function
|
|
3886
|
+
var Aa = /<tool\s+(id|index)="([^"]*)"><\/tool>/g, ja = /(?<!\[)!\[([^\]]*)\]\(([^)\s]+)(?:\s+["']([^"']*)["'])?\)/g, Ma = /<context>[\s\S]*?<\/context>\s*/g, Na = /<in-app-browser-context(?:\s+[^>]*)?>[\s\S]*?<\/in-app-browser-context>\s*/g, Pa = /^[ \t]*## My request for Codex:[ \t]*(?:\r?\n|$)/m, Fa = /<follow-up>([\s\S]*?)<\/follow-up>/g, Ia = /\uE200visualize\uE202([\s\S]*?)\uE201/g, La = /* @__PURE__ */ new Set(["ask_user_question"]);
|
|
3887
|
+
function Ra(e) {
|
|
3818
3888
|
if (e.role !== "assistant") {
|
|
3819
3889
|
if (e.promptContent) return [{
|
|
3820
3890
|
type: "user-text",
|
|
@@ -3837,7 +3907,7 @@ function Ia(e) {
|
|
|
3837
3907
|
media: e.media
|
|
3838
3908
|
}];
|
|
3839
3909
|
if (e.type === "text") {
|
|
3840
|
-
let t =
|
|
3910
|
+
let t = Ga(e.content);
|
|
3841
3911
|
return t ? [{
|
|
3842
3912
|
type: "user-text",
|
|
3843
3913
|
content: t
|
|
@@ -3845,18 +3915,18 @@ function Ia(e) {
|
|
|
3845
3915
|
}
|
|
3846
3916
|
return [];
|
|
3847
3917
|
});
|
|
3848
|
-
let t =
|
|
3918
|
+
let t = Ga(e.content);
|
|
3849
3919
|
return t ? [{
|
|
3850
3920
|
type: "user-text",
|
|
3851
3921
|
content: t
|
|
3852
3922
|
}] : [];
|
|
3853
3923
|
}
|
|
3854
3924
|
let t = e.toolCalls ?? [], n = e.parts ?? [];
|
|
3855
|
-
if (n.length > 0) return
|
|
3856
|
-
let r = /* @__PURE__ */ new Set(), { blocks: i, prompts: a } =
|
|
3857
|
-
return
|
|
3925
|
+
if (n.length > 0) return Ba(n, t, e.streaming === !0);
|
|
3926
|
+
let r = /* @__PURE__ */ new Set(), { blocks: i, prompts: a } = Va(e.content, t, r, void 0, e.streaming === !0);
|
|
3927
|
+
return Ua(i, t, r), Wa(i, a);
|
|
3858
3928
|
}
|
|
3859
|
-
function
|
|
3929
|
+
function za(e, t, n = e.streaming === !0, r = Za(e), i) {
|
|
3860
3930
|
if (e.role !== "assistant" || !r) return t;
|
|
3861
3931
|
let a = e.parts?.some((e) => e.type === "text" && e.phase === "final_answer" && e.content.trim().length > 0) ?? !1, o = [], s = [], c = 0, l = () => {
|
|
3862
3932
|
s.length !== 0 && (o.push({
|
|
@@ -3868,7 +3938,7 @@ function La(e, t, n = e.streaming === !0, r = Ya(e), i) {
|
|
|
3868
3938
|
}), s = [], c += 1);
|
|
3869
3939
|
};
|
|
3870
3940
|
for (let e of t) {
|
|
3871
|
-
if (
|
|
3941
|
+
if (Qa(e, i)) {
|
|
3872
3942
|
s.push(e);
|
|
3873
3943
|
continue;
|
|
3874
3944
|
}
|
|
@@ -3876,7 +3946,7 @@ function La(e, t, n = e.streaming === !0, r = Ya(e), i) {
|
|
|
3876
3946
|
}
|
|
3877
3947
|
return l(), c > 0 ? o : t;
|
|
3878
3948
|
}
|
|
3879
|
-
function
|
|
3949
|
+
function Ba(e, t, n) {
|
|
3880
3950
|
let r = [], i = [], a = /* @__PURE__ */ new Set();
|
|
3881
3951
|
for (let [o, s] of e.entries()) {
|
|
3882
3952
|
if (s.type === "tool") {
|
|
@@ -3914,17 +3984,17 @@ function Ra(e, t, n) {
|
|
|
3914
3984
|
}
|
|
3915
3985
|
let c = e[o + 1];
|
|
3916
3986
|
if (c?.type === "question" && c.request.payload.request.questions.some((e) => e.question.trim() === s.content.trim())) continue;
|
|
3917
|
-
let l =
|
|
3987
|
+
let l = Va(s.content, t, a, s.phase, n);
|
|
3918
3988
|
r.push(...l.blocks), i.push(...l.prompts);
|
|
3919
3989
|
}
|
|
3920
|
-
return
|
|
3990
|
+
return Ua(r, t, a), Wa(r, i);
|
|
3921
3991
|
}
|
|
3922
|
-
function
|
|
3992
|
+
function Va(e, t, n, r, i = !1) {
|
|
3923
3993
|
let a = [], o = [], s = 0, c = (e) => {
|
|
3924
|
-
let i =
|
|
3994
|
+
let i = Ha(e, t, n, r);
|
|
3925
3995
|
a.push(...i.blocks), o.push(...i.prompts);
|
|
3926
3996
|
};
|
|
3927
|
-
for (let t of
|
|
3997
|
+
for (let t of _a(e, i)) {
|
|
3928
3998
|
c(e.slice(s, t.start));
|
|
3929
3999
|
let { start: n, end: i, ...o } = t;
|
|
3930
4000
|
a.push({
|
|
@@ -3937,10 +4007,10 @@ function za(e, t, n, r, i = !1) {
|
|
|
3937
4007
|
prompts: o
|
|
3938
4008
|
};
|
|
3939
4009
|
}
|
|
3940
|
-
function
|
|
3941
|
-
let { content: i, prompts: a } =
|
|
3942
|
-
for (let e of
|
|
3943
|
-
if (e.start > c &&
|
|
4010
|
+
function Ha(e, t, n, r) {
|
|
4011
|
+
let { content: i, prompts: a } = $a(eo(e)), o = fo(i), s = [], c = 0;
|
|
4012
|
+
for (let e of co(i, o)) {
|
|
4013
|
+
if (e.start > c && Xa(s, i.slice(c, e.start), r), e.type === "mermaid") s.push({
|
|
3944
4014
|
type: "mermaid",
|
|
3945
4015
|
code: e.code,
|
|
3946
4016
|
...r ? { phase: r } : {}
|
|
@@ -3952,18 +4022,18 @@ function Ba(e, t, n, r) {
|
|
|
3952
4022
|
...r ? { phase: r } : {}
|
|
3953
4023
|
});
|
|
3954
4024
|
else if (e.type === "tool") {
|
|
3955
|
-
let r =
|
|
4025
|
+
let r = ro(e.kind, e.value, t);
|
|
3956
4026
|
r && (n.add(r.id), s.push({
|
|
3957
4027
|
type: "tool",
|
|
3958
4028
|
toolCall: r
|
|
3959
4029
|
}));
|
|
3960
4030
|
} else {
|
|
3961
|
-
let i =
|
|
4031
|
+
let i = io(e.media, t);
|
|
3962
4032
|
i && n.add(i.id), s.push({
|
|
3963
4033
|
type: "media",
|
|
3964
4034
|
media: {
|
|
3965
4035
|
...e.media,
|
|
3966
|
-
prompt: e.media.prompt ??
|
|
4036
|
+
prompt: e.media.prompt ?? ao(i)
|
|
3967
4037
|
},
|
|
3968
4038
|
toolCall: i,
|
|
3969
4039
|
...r ? { phase: r } : {}
|
|
@@ -3971,29 +4041,29 @@ function Ba(e, t, n, r) {
|
|
|
3971
4041
|
}
|
|
3972
4042
|
c = e.end;
|
|
3973
4043
|
}
|
|
3974
|
-
return c < i.length &&
|
|
4044
|
+
return c < i.length && Xa(s, i.slice(c), r), {
|
|
3975
4045
|
blocks: s,
|
|
3976
4046
|
prompts: a
|
|
3977
4047
|
};
|
|
3978
4048
|
}
|
|
3979
|
-
function
|
|
4049
|
+
function Ua(e, t, n) {
|
|
3980
4050
|
for (let r of t) n.has(r.id) || e.push({
|
|
3981
4051
|
type: "tool",
|
|
3982
4052
|
toolCall: r
|
|
3983
4053
|
});
|
|
3984
4054
|
}
|
|
3985
|
-
function
|
|
3986
|
-
let n =
|
|
4055
|
+
function Wa(e, t) {
|
|
4056
|
+
let n = Ka(e);
|
|
3987
4057
|
return t.length > 0 && n.push({
|
|
3988
4058
|
type: "follow-ups",
|
|
3989
4059
|
prompts: t
|
|
3990
4060
|
}), n;
|
|
3991
4061
|
}
|
|
3992
|
-
function
|
|
3993
|
-
let t = e.replace(
|
|
3994
|
-
return (n === t ? n : n.replace(
|
|
4062
|
+
function Ga(e) {
|
|
4063
|
+
let t = e.replace(Ma, ""), n = t.replace(Na, "");
|
|
4064
|
+
return (n === t ? n : n.replace(Pa, "")).trim();
|
|
3995
4065
|
}
|
|
3996
|
-
function
|
|
4066
|
+
function Ka(e) {
|
|
3997
4067
|
let t = [], n = [], r, i = (e = !1) => {
|
|
3998
4068
|
if (n.length === 0) {
|
|
3999
4069
|
e && r && t.push({
|
|
@@ -4011,11 +4081,11 @@ function Wa(e) {
|
|
|
4011
4081
|
};
|
|
4012
4082
|
for (let a of e) {
|
|
4013
4083
|
if (a.type === "reasoning") {
|
|
4014
|
-
r =
|
|
4084
|
+
r = qa(a.content);
|
|
4015
4085
|
continue;
|
|
4016
4086
|
}
|
|
4017
4087
|
if (a.type === "tool") {
|
|
4018
|
-
if (
|
|
4088
|
+
if (Ja(a.toolCall)) {
|
|
4019
4089
|
i(), t.push(a);
|
|
4020
4090
|
continue;
|
|
4021
4091
|
}
|
|
@@ -4026,92 +4096,92 @@ function Wa(e) {
|
|
|
4026
4096
|
}
|
|
4027
4097
|
return i(!0), t;
|
|
4028
4098
|
}
|
|
4029
|
-
function
|
|
4099
|
+
function qa(e) {
|
|
4030
4100
|
let t = e.trim();
|
|
4031
4101
|
return (/^\*\*([\s\S]*)\*\*$/u.exec(t)?.[1] ?? /^__([\s\S]*)__$/u.exec(t)?.[1] ?? t).trim().replace(/\s+/gu, " ");
|
|
4032
4102
|
}
|
|
4033
|
-
function
|
|
4034
|
-
if (
|
|
4035
|
-
let t =
|
|
4103
|
+
function Ja(e) {
|
|
4104
|
+
if (La.has(Z(e))) return !0;
|
|
4105
|
+
let t = Ya(e.status);
|
|
4036
4106
|
return t?.source === "codex" && t.action === "plan" || (t?.source === "mcp" || t?.source === "home") && typeof t.params?.requestId == "string" && e.state === "running";
|
|
4037
4107
|
}
|
|
4038
|
-
function
|
|
4108
|
+
function Ya(e) {
|
|
4039
4109
|
if (!(typeof e != "string" || !e.startsWith("{"))) try {
|
|
4040
4110
|
return JSON.parse(e);
|
|
4041
4111
|
} catch {
|
|
4042
4112
|
return;
|
|
4043
4113
|
}
|
|
4044
4114
|
}
|
|
4045
|
-
function
|
|
4115
|
+
function Xa(e, t, n) {
|
|
4046
4116
|
t.trim() && e.push({
|
|
4047
4117
|
type: "text",
|
|
4048
4118
|
content: t,
|
|
4049
4119
|
...n ? { phase: n } : {}
|
|
4050
4120
|
});
|
|
4051
4121
|
}
|
|
4052
|
-
function
|
|
4122
|
+
function Za(e) {
|
|
4053
4123
|
return e.parts?.some((e) => e.type === "reasoning" || e.type === "text" && e.phase !== void 0) ?? !1;
|
|
4054
4124
|
}
|
|
4055
|
-
function
|
|
4125
|
+
function Qa(e, t) {
|
|
4056
4126
|
return e.type === "question" ? e.historical === !0 || t?.has(e.request.id) === !0 : e.type === "reasoning" || e.type === "tool" || e.type === "tool-group" || e.type !== "media" && "phase" in e && e.phase === "commentary";
|
|
4057
4127
|
}
|
|
4058
|
-
function
|
|
4128
|
+
function $a(e) {
|
|
4059
4129
|
let t = [];
|
|
4060
4130
|
return {
|
|
4061
|
-
content: e.replace(
|
|
4131
|
+
content: e.replace(Fa, (e, n) => {
|
|
4062
4132
|
let r = n.trim();
|
|
4063
4133
|
return r && t.push(r), "";
|
|
4064
4134
|
}),
|
|
4065
4135
|
prompts: t
|
|
4066
4136
|
};
|
|
4067
4137
|
}
|
|
4068
|
-
function
|
|
4069
|
-
return
|
|
4138
|
+
function eo(e) {
|
|
4139
|
+
return no(to(e, "follow-up"));
|
|
4070
4140
|
}
|
|
4071
|
-
function
|
|
4141
|
+
function to(e, t) {
|
|
4072
4142
|
let n = `<${t}>`, r = `</${t}>`, i = e.lastIndexOf(n);
|
|
4073
4143
|
if (i <= e.lastIndexOf(r)) return e;
|
|
4074
4144
|
let a = e.lastIndexOf("</");
|
|
4075
4145
|
return a > i && r.startsWith(e.slice(a)) ? `${e.slice(0, a)}${r}` : `${e}${r}`;
|
|
4076
4146
|
}
|
|
4077
|
-
function
|
|
4147
|
+
function no(e) {
|
|
4078
4148
|
let t = e.lastIndexOf("<tool");
|
|
4079
4149
|
if (t <= e.lastIndexOf("</tool>")) return e;
|
|
4080
4150
|
let n = e.slice(0, t), r = e.slice(t), i = "</tool>", a = r.lastIndexOf("</"), o = a >= 0 ? r.slice(0, a) : r, s = o.indexOf(">");
|
|
4081
4151
|
return s === -1 ? o.match(/^<tool\s+(id|index)="([^"]*)"$/) ? `${n}${o}>${i}` : n : `${n}${o.slice(0, s + 1)}${i}${o.slice(s + 1)}`;
|
|
4082
4152
|
}
|
|
4083
|
-
function
|
|
4153
|
+
function ro(e, t, n) {
|
|
4084
4154
|
return e === "id" ? n.find((e) => e.id === t) : n[Number.parseInt(t, 10)];
|
|
4085
4155
|
}
|
|
4086
|
-
function
|
|
4156
|
+
function io(e, t) {
|
|
4087
4157
|
return t.find((t) => {
|
|
4088
4158
|
if (Z(t) !== "image_generation") return !1;
|
|
4089
|
-
let n =
|
|
4159
|
+
let n = oo(t, "url"), r = oo(t, "externalUrl"), i = oo(t, "path");
|
|
4090
4160
|
return e.url === n || e.url === r || e.url === i;
|
|
4091
4161
|
});
|
|
4092
4162
|
}
|
|
4093
|
-
function
|
|
4094
|
-
return
|
|
4163
|
+
function ao(e) {
|
|
4164
|
+
return oo(e, "prompt") ?? so(e, "prompt");
|
|
4095
4165
|
}
|
|
4096
|
-
function
|
|
4166
|
+
function oo(e, t) {
|
|
4097
4167
|
let n = e?.result;
|
|
4098
4168
|
if (!n || typeof n != "object" || Array.isArray(n)) return;
|
|
4099
4169
|
let r = n[t];
|
|
4100
4170
|
return typeof r == "string" && r.trim() ? r.trim() : void 0;
|
|
4101
4171
|
}
|
|
4102
|
-
function
|
|
4172
|
+
function so(e, t) {
|
|
4103
4173
|
let n = e ? Cn(e) : void 0;
|
|
4104
4174
|
if (!n || typeof n != "object" || Array.isArray(n)) return;
|
|
4105
4175
|
let r = n[t];
|
|
4106
4176
|
return typeof r == "string" && r.trim() ? r.trim() : void 0;
|
|
4107
4177
|
}
|
|
4108
|
-
function
|
|
4178
|
+
function co(e, t) {
|
|
4109
4179
|
let n = [];
|
|
4110
|
-
for (let t of
|
|
4111
|
-
for (let r of e.matchAll(
|
|
4180
|
+
for (let t of uo(e)) n.push(t);
|
|
4181
|
+
for (let r of e.matchAll(Ia)) {
|
|
4112
4182
|
let e = r.index;
|
|
4113
|
-
if (
|
|
4114
|
-
let i =
|
|
4183
|
+
if (po(e, t)) continue;
|
|
4184
|
+
let i = lo(r[1]);
|
|
4115
4185
|
n.push({
|
|
4116
4186
|
end: e + r[0].length,
|
|
4117
4187
|
start: e,
|
|
@@ -4120,9 +4190,9 @@ function oo(e, t) {
|
|
|
4120
4190
|
type: "visualization"
|
|
4121
4191
|
});
|
|
4122
4192
|
}
|
|
4123
|
-
for (let r of e.matchAll(
|
|
4193
|
+
for (let r of e.matchAll(Aa)) {
|
|
4124
4194
|
let e = r.index;
|
|
4125
|
-
if (
|
|
4195
|
+
if (po(e, t)) continue;
|
|
4126
4196
|
let i = r[1], a = r[2];
|
|
4127
4197
|
!i || !a || n.push({
|
|
4128
4198
|
end: e + r[0].length,
|
|
@@ -4132,9 +4202,9 @@ function oo(e, t) {
|
|
|
4132
4202
|
value: a
|
|
4133
4203
|
});
|
|
4134
4204
|
}
|
|
4135
|
-
for (let r of e.matchAll(
|
|
4205
|
+
for (let r of e.matchAll(ja)) {
|
|
4136
4206
|
let e = r.index;
|
|
4137
|
-
if (
|
|
4207
|
+
if (po(e, t)) continue;
|
|
4138
4208
|
let i = r[1].trim(), a = r[2], o = r[3]?.trim();
|
|
4139
4209
|
n.push({
|
|
4140
4210
|
end: e + r[0].length,
|
|
@@ -4149,7 +4219,7 @@ function oo(e, t) {
|
|
|
4149
4219
|
}
|
|
4150
4220
|
return n.sort((e, t) => e.start - t.start);
|
|
4151
4221
|
}
|
|
4152
|
-
function
|
|
4222
|
+
function lo(e) {
|
|
4153
4223
|
try {
|
|
4154
4224
|
let t = JSON.parse(e), n = typeof t.title == "string" && t.title.trim() ? t.title.trim() : "Visualization", r = typeof t.path == "string" && t.path.trim() ? t.path.trim() : void 0;
|
|
4155
4225
|
return {
|
|
@@ -4160,10 +4230,10 @@ function so(e) {
|
|
|
4160
4230
|
return null;
|
|
4161
4231
|
}
|
|
4162
4232
|
}
|
|
4163
|
-
function
|
|
4233
|
+
function uo(e) {
|
|
4164
4234
|
let t = [], n = /(^|\n)(```|~~~)[ \t]*mermaid[^\n]*\n/gi, r;
|
|
4165
4235
|
for (; (r = n.exec(e)) !== null;) {
|
|
4166
|
-
let i = r[2], a = r[1], o = r.index + a.length, s = o + r[0].length - a.length, c = RegExp(`(^|\\n)${
|
|
4236
|
+
let i = r[2], a = r[1], o = r.index + a.length, s = o + r[0].length - a.length, c = RegExp(`(^|\\n)${mo(i)}[ \\t]*(?=\\n|$)`, "g");
|
|
4167
4237
|
c.lastIndex = s;
|
|
4168
4238
|
let l = c.exec(e);
|
|
4169
4239
|
if (!l) continue;
|
|
@@ -4177,10 +4247,10 @@ function co(e) {
|
|
|
4177
4247
|
}
|
|
4178
4248
|
return t;
|
|
4179
4249
|
}
|
|
4180
|
-
function
|
|
4250
|
+
function fo(e) {
|
|
4181
4251
|
let t = [], n = /(^|\n)(```|~~~)/g, r;
|
|
4182
4252
|
for (; (r = n.exec(e)) !== null;) {
|
|
4183
|
-
let i = r[2], a = r[1], o = r.index + a.length, s = RegExp(`(^|\\n)${
|
|
4253
|
+
let i = r[2], a = r[1], o = r.index + a.length, s = RegExp(`(^|\\n)${mo(i)}`, "g");
|
|
4184
4254
|
s.lastIndex = o + i.length;
|
|
4185
4255
|
let c = s.exec(e);
|
|
4186
4256
|
if (!c) {
|
|
@@ -4198,15 +4268,15 @@ function lo(e) {
|
|
|
4198
4268
|
}
|
|
4199
4269
|
return t;
|
|
4200
4270
|
}
|
|
4201
|
-
function
|
|
4271
|
+
function po(e, t) {
|
|
4202
4272
|
return t.some((t) => e >= t.start && e <= t.end);
|
|
4203
4273
|
}
|
|
4204
|
-
function
|
|
4274
|
+
function mo(e) {
|
|
4205
4275
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
4206
4276
|
}
|
|
4207
4277
|
//#endregion
|
|
4208
4278
|
//#region src/chat/use-conversation-escape-interrupt.ts
|
|
4209
|
-
function
|
|
4279
|
+
function ho(e) {
|
|
4210
4280
|
let t = N(!1), n = null, r = !1;
|
|
4211
4281
|
W([e.busy, e.enabled], () => {
|
|
4212
4282
|
c(), i();
|
|
@@ -4246,7 +4316,7 @@ function po(e) {
|
|
|
4246
4316
|
}
|
|
4247
4317
|
//#endregion
|
|
4248
4318
|
//#region src/chat/message-work-state.ts
|
|
4249
|
-
var
|
|
4319
|
+
var go = Symbol("codex-app-sdk-question-responses"), _o = Symbol("codex-app-sdk-assistant-work-turn"), vo = Symbol("codex-app-sdk-assistant-work-message-index"), yo = ["aria-label"], bo = { class: "chat-animated-diff-stat__sign" }, xo = { class: "chat-animated-diff-stat__digits" }, So = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
4250
4320
|
__name: "ChatAnimatedDiffStat",
|
|
4251
4321
|
props: {
|
|
4252
4322
|
kind: {},
|
|
@@ -4264,7 +4334,7 @@ var mo = Symbol("codex-app-sdk-question-responses"), ho = Symbol("codex-app-sdk-
|
|
|
4264
4334
|
return (n, a) => (k(), l("span", {
|
|
4265
4335
|
class: C(["codex-chat-theme chat-animated-diff-stat", `chat-animated-diff-stat--${e.kind}`]),
|
|
4266
4336
|
"aria-label": c.value
|
|
4267
|
-
}, [u("span",
|
|
4337
|
+
}, [u("span", bo, B(r.value), 1), u("span", xo, [(k(!0), l(t, null, F(s.value, (e) => (k(), l("span", {
|
|
4268
4338
|
key: e.place,
|
|
4269
4339
|
class: "chat-animated-diff-stat__digit-column"
|
|
4270
4340
|
}, [m(i, { name: "chat-animated-diff-stat__digit" }, {
|
|
@@ -4273,9 +4343,9 @@ var mo = Symbol("codex-app-sdk-question-responses"), ho = Symbol("codex-app-sdk-
|
|
|
4273
4343
|
class: "chat-animated-diff-stat__digit"
|
|
4274
4344
|
}, B(e.digit), 1))]),
|
|
4275
4345
|
_: 2
|
|
4276
|
-
}, 1024)]))), 128))])], 10,
|
|
4346
|
+
}, 1024)]))), 128))])], 10, yo));
|
|
4277
4347
|
}
|
|
4278
|
-
}), [["__scopeId", "data-v-79520036"]]),
|
|
4348
|
+
}), [["__scopeId", "data-v-79520036"]]), Co = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
4279
4349
|
__name: "ChatToolIcon",
|
|
4280
4350
|
props: {
|
|
4281
4351
|
presentation: {},
|
|
@@ -4313,30 +4383,30 @@ var mo = Symbol("codex-app-sdk-question-responses"), ho = Symbol("codex-app-sdk-
|
|
|
4313
4383
|
"aria-hidden": "true"
|
|
4314
4384
|
})) : c("", !0);
|
|
4315
4385
|
}
|
|
4316
|
-
}), [["__scopeId", "data-v-c245150b"]]),
|
|
4386
|
+
}), [["__scopeId", "data-v-c245150b"]]), wo = ["data-label"], To = {
|
|
4317
4387
|
key: 2,
|
|
4318
4388
|
class: "chat-tool-call__title-content chat-tool-call__title-text"
|
|
4319
|
-
},
|
|
4389
|
+
}, Eo = { class: "chat-tool-call__title-target-list" }, Do = {
|
|
4320
4390
|
key: 0,
|
|
4321
4391
|
class: "chat-tool-call__title-target-separator"
|
|
4322
|
-
},
|
|
4392
|
+
}, Oo = [
|
|
4323
4393
|
"href",
|
|
4324
4394
|
"onClick",
|
|
4325
4395
|
"onKeydown"
|
|
4326
|
-
],
|
|
4396
|
+
], ko = {
|
|
4327
4397
|
key: 2,
|
|
4328
4398
|
class: "chat-tool-call__title-target"
|
|
4329
|
-
},
|
|
4399
|
+
}, Ao = { key: 3 }, jo = ["href"], Mo = {
|
|
4330
4400
|
key: 2,
|
|
4331
4401
|
class: "chat-tool-call__title-target"
|
|
4332
|
-
},
|
|
4402
|
+
}, No = {
|
|
4333
4403
|
key: 3,
|
|
4334
4404
|
class: "chat-tool-call__title-content"
|
|
4335
|
-
},
|
|
4405
|
+
}, Po = {
|
|
4336
4406
|
key: 0,
|
|
4337
4407
|
class: "codex-chat-theme chat-tool-call__diff",
|
|
4338
4408
|
"aria-label": "Line changes"
|
|
4339
|
-
},
|
|
4409
|
+
}, Fo = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
4340
4410
|
__name: "ChatToolCallTitle",
|
|
4341
4411
|
props: {
|
|
4342
4412
|
lineDiff: {},
|
|
@@ -4359,77 +4429,77 @@ var mo = Symbol("codex-app-sdk-question-responses"), ho = Symbol("codex-app-sdk-
|
|
|
4359
4429
|
"codex-text-shimmer": e.running
|
|
4360
4430
|
}]),
|
|
4361
4431
|
"data-label": e.title
|
|
4362
|
-
}, [e.icon ? (k(), s(R(e.icon), { key: 0 })) : e.toolCall ? (k(), s(
|
|
4432
|
+
}, [e.icon ? (k(), s(R(e.icon), { key: 0 })) : e.toolCall ? (k(), s(Co, {
|
|
4363
4433
|
key: 1,
|
|
4364
4434
|
presentation: e.toolPresentation,
|
|
4365
4435
|
"tool-call": e.toolCall
|
|
4366
|
-
}, null, 8, ["presentation", "tool-call"])) : c("", !0), e.titlePrefix && e.titleTarget ? (k(), l("span",
|
|
4436
|
+
}, null, 8, ["presentation", "tool-call"])) : c("", !0), e.titlePrefix && e.titleTarget ? (k(), l("span", To, [
|
|
4367
4437
|
u("span", null, B(e.titlePrefix), 1),
|
|
4368
4438
|
i[3] ||= p(B(" "), -1),
|
|
4369
|
-
u("span",
|
|
4370
|
-
e.separator ? (k(), l("span",
|
|
4439
|
+
u("span", Eo, [e.titleTargetParts?.length ? (k(!0), l(t, { key: 0 }, F(e.titleTargetParts, (e, n) => (k(), l(t, { key: `${e.label}-${n}` }, [
|
|
4440
|
+
e.separator ? (k(), l("span", Do, B(e.separator), 1)) : c("", !0),
|
|
4371
4441
|
e.link ? (k(), l("a", {
|
|
4372
4442
|
key: 1,
|
|
4373
4443
|
class: "chat-tool-call__title-target chat-tool-call__title-target--link",
|
|
4374
4444
|
href: e.link.href,
|
|
4375
4445
|
onClick: q((t) => r("open-link", e.link), ["stop", "prevent"]),
|
|
4376
4446
|
onKeydown: [K(q((t) => r("open-link", e.link), ["stop", "prevent"]), ["enter"]), K(q((t) => r("open-link", e.link), ["stop", "prevent"]), ["space"])]
|
|
4377
|
-
}, B(e.label), 41,
|
|
4378
|
-
e.suffix ? (k(), l("span",
|
|
4447
|
+
}, B(e.label), 41, Oo)) : (k(), l("span", ko, B(e.label), 1)),
|
|
4448
|
+
e.suffix ? (k(), l("span", Ao, B(e.suffix), 1)) : c("", !0)
|
|
4379
4449
|
], 64))), 128)) : e.titleTargetLink ? (k(), l("a", {
|
|
4380
4450
|
key: 1,
|
|
4381
4451
|
class: "chat-tool-call__title-target chat-tool-call__title-target--link",
|
|
4382
4452
|
href: e.titleTargetLink.href,
|
|
4383
4453
|
onClick: i[0] ||= q((t) => r("open-link", e.titleTargetLink), ["stop", "prevent"]),
|
|
4384
4454
|
onKeydown: [i[1] ||= K(q((t) => r("open-link", e.titleTargetLink), ["stop", "prevent"]), ["enter"]), i[2] ||= K(q((t) => r("open-link", e.titleTargetLink), ["stop", "prevent"]), ["space"])]
|
|
4385
|
-
}, B(e.titleTarget), 41,
|
|
4386
|
-
])) : (k(), l("span",
|
|
4455
|
+
}, B(e.titleTarget), 41, jo)) : (k(), l("span", Mo, B(e.titleTarget), 1))])
|
|
4456
|
+
])) : (k(), l("span", No, B(e.title), 1))], 10, wo), e.lineDiff ? (k(), l("span", Po, [e.lineDiff.addedLines ? (k(), s(So, {
|
|
4387
4457
|
key: 0,
|
|
4388
4458
|
kind: "added",
|
|
4389
4459
|
label: "Added lines",
|
|
4390
4460
|
value: e.lineDiff.addedLines
|
|
4391
|
-
}, null, 8, ["value"])) : c("", !0), e.lineDiff.removedLines ? (k(), s(
|
|
4461
|
+
}, null, 8, ["value"])) : c("", !0), e.lineDiff.removedLines ? (k(), s(So, {
|
|
4392
4462
|
key: 1,
|
|
4393
4463
|
kind: "deleted",
|
|
4394
4464
|
label: "Removed lines",
|
|
4395
4465
|
value: e.lineDiff.removedLines
|
|
4396
4466
|
}, null, 8, ["value"])) : c("", !0)])) : c("", !0)], 64));
|
|
4397
4467
|
}
|
|
4398
|
-
}), [["__scopeId", "data-v-c9dcdacd"]]),
|
|
4468
|
+
}), [["__scopeId", "data-v-c9dcdacd"]]), Io = {
|
|
4399
4469
|
key: 0,
|
|
4400
4470
|
class: "codex-chat-theme chat-message__thinking codex-text-shimmer",
|
|
4401
4471
|
"data-label": "Thinking"
|
|
4402
|
-
},
|
|
4472
|
+
}, Lo = ["tabindex"], Ro = {
|
|
4403
4473
|
key: 0,
|
|
4404
4474
|
class: "chat-tool-user-input__summary chat-tool-user-input__summary--muted"
|
|
4405
|
-
},
|
|
4475
|
+
}, zo = {
|
|
4406
4476
|
key: 1,
|
|
4407
4477
|
class: "chat-tool-user-input__summary chat-tool-user-input__summary--answered"
|
|
4408
|
-
},
|
|
4478
|
+
}, Bo = { class: "chat-tool-user-input__answer-label" }, Vo = { class: "chat-tool-user-input__answer-value" }, Ho = { class: "codex-request-header chat-tool-user-input__header" }, Uo = { class: "codex-request-eyebrow chat-tool-user-input__eyebrow" }, Wo = { class: "chat-tool-user-input__eyebrow-text" }, Go = { class: "chat-tool-user-input__header-actions" }, Ko = {
|
|
4409
4479
|
key: 0,
|
|
4410
4480
|
class: "chat-tool-user-input__index",
|
|
4411
4481
|
"aria-label": "Question progress"
|
|
4412
|
-
},
|
|
4482
|
+
}, qo = { class: "codex-request-title chat-tool-user-input__question" }, Jo = {
|
|
4413
4483
|
key: 0,
|
|
4414
4484
|
class: "codex-request-description chat-tool-user-input__hint"
|
|
4415
|
-
},
|
|
4485
|
+
}, Yo = ["aria-label"], Xo = [
|
|
4416
4486
|
"aria-keyshortcuts",
|
|
4417
4487
|
"aria-label",
|
|
4418
4488
|
"aria-pressed",
|
|
4419
4489
|
"onClick"
|
|
4420
|
-
],
|
|
4490
|
+
], Zo = {
|
|
4421
4491
|
class: "chat-tool-user-input__key",
|
|
4422
4492
|
"aria-hidden": "true"
|
|
4423
|
-
},
|
|
4493
|
+
}, Qo = { class: "chat-tool-user-input__option-copy" }, $o = { class: "chat-tool-user-input__option-heading" }, es = { class: "chat-tool-user-input__option-label" }, ts = {
|
|
4424
4494
|
key: 0,
|
|
4425
4495
|
class: "chat-tool-user-input__recommended"
|
|
4426
|
-
},
|
|
4496
|
+
}, ns = {
|
|
4427
4497
|
key: 0,
|
|
4428
4498
|
class: "chat-tool-user-input__option-description"
|
|
4429
|
-
},
|
|
4499
|
+
}, rs = {
|
|
4430
4500
|
key: 0,
|
|
4431
4501
|
class: "chat-tool-user-input__write"
|
|
4432
|
-
},
|
|
4502
|
+
}, is = { class: "codex-request-footer chat-tool-user-input__actions" }, as = ["disabled"], os = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
4433
4503
|
__name: "ChatToolUserInputRequest",
|
|
4434
4504
|
props: {
|
|
4435
4505
|
answeredClientRequestIds: {},
|
|
@@ -4554,38 +4624,38 @@ var mo = Symbol("codex-app-sdk-question-responses"), ho = Symbol("codex-app-sdk-
|
|
|
4554
4624
|
options: Array.isArray(e.options) ? e.options : null
|
|
4555
4625
|
})) : [];
|
|
4556
4626
|
}
|
|
4557
|
-
return (n, r) => w.value.length === 0 ? (k(), l("span",
|
|
4627
|
+
return (n, r) => w.value.length === 0 ? (k(), l("span", Io, [m(H(Ge), { size: 15 }), r[1] ||= p(" Preparing question... ", -1)])) : (k(), l("section", {
|
|
4558
4628
|
key: 1,
|
|
4559
4629
|
ref_key: "root",
|
|
4560
4630
|
ref: g,
|
|
4561
4631
|
class: C(["codex-chat-theme codex-request-card chat-tool-user-input", { "chat-tool-user-input--resolved": P.value || M.value || e.historical }]),
|
|
4562
4632
|
tabindex: L.value ? -1 : void 0,
|
|
4563
4633
|
onKeydown: se
|
|
4564
|
-
}, [P.value ? (k(), l("div",
|
|
4634
|
+
}, [P.value ? (k(), l("div", Ro, [m(Fo, {
|
|
4565
4635
|
title: "Cancelled user question",
|
|
4566
4636
|
icon: H(Ke)
|
|
4567
|
-
}, null, 8, ["icon"])])) : M.value ? (k(), l("div",
|
|
4637
|
+
}, null, 8, ["icon"])])) : M.value ? (k(), l("div", zo, [m(Fo, {
|
|
4568
4638
|
title: "Answered user question",
|
|
4569
4639
|
icon: H(We)
|
|
4570
4640
|
}, null, 8, ["icon"]), (k(!0), l(t, null, F(w.value, (e) => (k(), l("div", {
|
|
4571
4641
|
key: e.id,
|
|
4572
4642
|
class: "chat-tool-user-input__answer"
|
|
4573
|
-
}, [u("span",
|
|
4643
|
+
}, [u("span", Bo, B(e.header), 1), u("span", Vo, B(I.value[e.id]), 1)]))), 128))])) : e.historical ? (k(!0), l(t, { key: 2 }, F(w.value, (e) => (k(), l("p", {
|
|
4574
4644
|
key: e.id,
|
|
4575
4645
|
class: "chat-tool-user-input__historical-question"
|
|
4576
4646
|
}, B(e.question), 1))), 128)) : T.value ? (k(), l(t, { key: 3 }, [
|
|
4577
|
-
u("header",
|
|
4647
|
+
u("header", Ho, [u("span", Uo, [m(H(je), {
|
|
4578
4648
|
size: 16,
|
|
4579
4649
|
"aria-hidden": "true"
|
|
4580
|
-
}), u("span",
|
|
4650
|
+
}), u("span", Wo, B(V.value), 1)]), u("div", Go, [w.value.length > 1 ? (k(), l("span", Ko, B(a.value + 1) + " / " + B(w.value.length), 1)) : c("", !0), u("button", {
|
|
4581
4651
|
class: "chat-tool-user-input__dismiss",
|
|
4582
4652
|
type: "button",
|
|
4583
4653
|
"aria-label": "Cancel question",
|
|
4584
4654
|
title: "Cancel question",
|
|
4585
4655
|
onClick: me
|
|
4586
4656
|
}, [m(H(et), { size: 17 })])])]),
|
|
4587
|
-
u("p",
|
|
4588
|
-
T.value.multiSelect && ee.value.length > 0 ? (k(), l("p",
|
|
4657
|
+
u("p", qo, B(T.value.question), 1),
|
|
4658
|
+
T.value.multiSelect && ee.value.length > 0 ? (k(), l("p", Jo, " Select all that apply ")) : c("", !0),
|
|
4589
4659
|
ee.value.length > 0 ? (k(), l("div", {
|
|
4590
4660
|
key: 1,
|
|
4591
4661
|
class: "chat-tool-user-input__options",
|
|
@@ -4599,12 +4669,12 @@ var mo = Symbol("codex-app-sdk-question-responses"), ho = Symbol("codex-app-sdk-
|
|
|
4599
4669
|
class: C(["chat-tool-user-input__option", { "chat-tool-user-input__option--selected": J(T.value.id, e.label) }]),
|
|
4600
4670
|
type: "button",
|
|
4601
4671
|
onClick: (t) => ie(T.value, e.label)
|
|
4602
|
-
}, [u("span",
|
|
4672
|
+
}, [u("span", Zo, [J(T.value.id, e.label) ? (k(), s(H(fe), {
|
|
4603
4673
|
key: 0,
|
|
4604
4674
|
size: 14,
|
|
4605
4675
|
"stroke-width": "3"
|
|
4606
|
-
})) : (k(), l(t, { key: 1 }, [p(B(n + 1), 1)], 64))]), u("span",
|
|
4607
|
-
u("footer", { class: C(["chat-tool-user-input__footer", { "chat-tool-user-input__footer--divided": ee.value.length > 0 }]) }, [z.value ? (k(), l("div",
|
|
4676
|
+
})) : (k(), l(t, { key: 1 }, [p(B(n + 1), 1)], 64))]), u("span", Qo, [u("span", $o, [u("span", es, B(K(e.label)), 1), q(e.label) ? (k(), l("span", ts, "Recommended")) : c("", !0)]), e.description ? (k(), l("span", ns, B(e.description), 1)) : c("", !0)])], 10, Xo))), 128))], 8, Yo)) : c("", !0),
|
|
4677
|
+
u("footer", { class: C(["chat-tool-user-input__footer", { "chat-tool-user-input__footer--divided": ee.value.length > 0 }]) }, [z.value ? (k(), l("div", rs, [m(H(Y), {
|
|
4608
4678
|
class: "chat-tool-user-input__write-icon",
|
|
4609
4679
|
size: 16,
|
|
4610
4680
|
"aria-hidden": "true"
|
|
@@ -4628,7 +4698,7 @@ var mo = Symbol("codex-app-sdk-question-responses"), ho = Symbol("codex-app-sdk-
|
|
|
4628
4698
|
"rows",
|
|
4629
4699
|
"type",
|
|
4630
4700
|
"value"
|
|
4631
|
-
]))])) : c("", !0), u("div",
|
|
4701
|
+
]))])) : c("", !0), u("div", is, [a.value > 0 ? (k(), l("button", {
|
|
4632
4702
|
key: 0,
|
|
4633
4703
|
class: "codex-request-button chat-tool-user-input__button",
|
|
4634
4704
|
type: "button",
|
|
@@ -4638,10 +4708,10 @@ var mo = Symbol("codex-app-sdk-question-responses"), ho = Symbol("codex-app-sdk-
|
|
|
4638
4708
|
disabled: !U.value,
|
|
4639
4709
|
type: "button",
|
|
4640
4710
|
onClick: le
|
|
4641
|
-
}, B(E.value ? "Send" : "Next"), 9,
|
|
4642
|
-
], 64)) : c("", !0)], 42,
|
|
4711
|
+
}, B(E.value ? "Send" : "Next"), 9, as)])], 2)
|
|
4712
|
+
], 64)) : c("", !0)], 42, Lo));
|
|
4643
4713
|
}
|
|
4644
|
-
}), [["__scopeId", "data-v-d031e6da"]]),
|
|
4714
|
+
}), [["__scopeId", "data-v-d031e6da"]]), ss = /* @__PURE__ */ h({
|
|
4645
4715
|
__name: "ChatQuestionRequest",
|
|
4646
4716
|
props: {
|
|
4647
4717
|
answeredClientRequestIds: {},
|
|
@@ -4650,7 +4720,7 @@ var mo = Symbol("codex-app-sdk-question-responses"), ho = Symbol("codex-app-sdk-
|
|
|
4650
4720
|
},
|
|
4651
4721
|
emits: ["client-response"],
|
|
4652
4722
|
setup(e, { emit: t }) {
|
|
4653
|
-
let n = e, r = t, i = b(
|
|
4723
|
+
let n = e, r = t, i = b(go, void 0);
|
|
4654
4724
|
function a(e) {
|
|
4655
4725
|
i?.set(e.id, e.payload), r("client-response", e);
|
|
4656
4726
|
}
|
|
@@ -4673,7 +4743,7 @@ var mo = Symbol("codex-app-sdk-question-responses"), ho = Symbol("codex-app-sdk-
|
|
|
4673
4743
|
}),
|
|
4674
4744
|
turnId: n.request.turnId
|
|
4675
4745
|
}));
|
|
4676
|
-
return (t, n) => (k(), s(
|
|
4746
|
+
return (t, n) => (k(), s(os, {
|
|
4677
4747
|
"answered-client-request-ids": e.answeredClientRequestIds,
|
|
4678
4748
|
historical: e.historical,
|
|
4679
4749
|
"tool-call": c.value,
|
|
@@ -4684,10 +4754,10 @@ var mo = Symbol("codex-app-sdk-question-responses"), ho = Symbol("codex-app-sdk-
|
|
|
4684
4754
|
"tool-call"
|
|
4685
4755
|
]));
|
|
4686
4756
|
}
|
|
4687
|
-
}),
|
|
4757
|
+
}), cs = {
|
|
4688
4758
|
key: 0,
|
|
4689
4759
|
class: "codex-chat-theme chat-tool-confirmation chat-tool-confirmation--resolved"
|
|
4690
|
-
},
|
|
4760
|
+
}, ls = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
4691
4761
|
__name: "ChatToolConfirmation",
|
|
4692
4762
|
props: {
|
|
4693
4763
|
answeredClientRequestIds: {},
|
|
@@ -4734,7 +4804,7 @@ var mo = Symbol("codex-app-sdk-question-responses"), ho = Symbol("codex-app-sdk-
|
|
|
4734
4804
|
payload: { decision: e }
|
|
4735
4805
|
}));
|
|
4736
4806
|
}
|
|
4737
|
-
return (e, t) => h.value ? (k(), l("div",
|
|
4807
|
+
return (e, t) => h.value ? (k(), l("div", cs, [m(Fo, { title: y.value }, null, 8, ["title"])])) : (k(), s(la, {
|
|
4738
4808
|
key: 1,
|
|
4739
4809
|
summary: d.value,
|
|
4740
4810
|
details: f.value,
|
|
@@ -4746,7 +4816,7 @@ var mo = Symbol("codex-app-sdk-question-responses"), ho = Symbol("codex-app-sdk-
|
|
|
4746
4816
|
"actions"
|
|
4747
4817
|
]));
|
|
4748
4818
|
}
|
|
4749
|
-
}), [["__scopeId", "data-v-57c288c3"]]),
|
|
4819
|
+
}), [["__scopeId", "data-v-57c288c3"]]), us = /* @__PURE__ */ h({
|
|
4750
4820
|
__name: "ChatConfirmationRequest",
|
|
4751
4821
|
props: { request: {} },
|
|
4752
4822
|
emits: ["client-response"],
|
|
@@ -4772,28 +4842,28 @@ var mo = Symbol("codex-app-sdk-question-responses"), ho = Symbol("codex-app-sdk-
|
|
|
4772
4842
|
}
|
|
4773
4843
|
})
|
|
4774
4844
|
}));
|
|
4775
|
-
return (e, t) => (k(), s(
|
|
4845
|
+
return (e, t) => (k(), s(ls, {
|
|
4776
4846
|
"tool-call": n.value,
|
|
4777
4847
|
onClientResponse: t[0] ||= (t) => e.$emit("client-response", t)
|
|
4778
4848
|
}, null, 8, ["tool-call"]));
|
|
4779
4849
|
}
|
|
4780
|
-
}),
|
|
4850
|
+
}), ds = {
|
|
4781
4851
|
key: 0,
|
|
4782
4852
|
class: "codex-chat-theme chat-goal",
|
|
4783
4853
|
"aria-label": "Current goal"
|
|
4784
|
-
},
|
|
4854
|
+
}, fs = { class: "chat-goal__copy" }, ps = { class: "chat-goal__objective" }, ms = { class: "chat-goal__actions" }, hs = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
4785
4855
|
__name: "ChatGoal",
|
|
4786
4856
|
props: { goal: {} },
|
|
4787
4857
|
emits: ["clear", "edit"],
|
|
4788
4858
|
setup(e, { emit: t }) {
|
|
4789
4859
|
let n = t;
|
|
4790
|
-
return (t, r) => e.goal ? (k(), l("div",
|
|
4860
|
+
return (t, r) => e.goal ? (k(), l("div", ds, [
|
|
4791
4861
|
m(H(Je), {
|
|
4792
4862
|
class: "chat-goal__icon",
|
|
4793
4863
|
"aria-hidden": "true"
|
|
4794
4864
|
}),
|
|
4795
|
-
u("div",
|
|
4796
|
-
u("div",
|
|
4865
|
+
u("div", fs, [r[2] ||= u("span", { class: "chat-goal__label" }, "Goal", -1), u("span", ps, B(e.goal.objective), 1)]),
|
|
4866
|
+
u("div", ms, [u("button", {
|
|
4797
4867
|
class: "chat-goal__action",
|
|
4798
4868
|
type: "button",
|
|
4799
4869
|
"aria-label": "Edit goal",
|
|
@@ -4808,26 +4878,26 @@ var mo = Symbol("codex-app-sdk-question-responses"), ho = Symbol("codex-app-sdk-
|
|
|
4808
4878
|
}, [m(H(Qe), { "aria-hidden": "true" })])])
|
|
4809
4879
|
])) : c("", !0);
|
|
4810
4880
|
}
|
|
4811
|
-
}), [["__scopeId", "data-v-1318cd28"]]),
|
|
4812
|
-
function
|
|
4813
|
-
return k(), l("div",
|
|
4881
|
+
}), [["__scopeId", "data-v-1318cd28"]]), gs = {}, _s = { class: "codex-chat-theme chat-composer-drawer" };
|
|
4882
|
+
function vs(e, t) {
|
|
4883
|
+
return k(), l("div", _s, [I(e.$slots, "default", {}, void 0, !0)]);
|
|
4814
4884
|
}
|
|
4815
|
-
var
|
|
4885
|
+
var ys = /*#__PURE__*/ X(gs, [["render", vs], ["__scopeId", "data-v-65051749"]]), bs = { class: "codex-chat-theme chat-composer-drawer-row" }, xs = {
|
|
4816
4886
|
key: 0,
|
|
4817
4887
|
class: "chat-composer-drawer-row__leading"
|
|
4818
|
-
},
|
|
4888
|
+
}, Ss = { class: "chat-composer-drawer-row__text" }, Cs = {
|
|
4819
4889
|
key: 1,
|
|
4820
4890
|
class: "chat-composer-drawer-row__actions"
|
|
4821
|
-
},
|
|
4891
|
+
}, ws = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
4822
4892
|
__name: "ChatComposerDrawerRow",
|
|
4823
4893
|
setup(e) {
|
|
4824
|
-
return (e, t) => (k(), l("div",
|
|
4825
|
-
e.$slots.leading ? (k(), l("div",
|
|
4826
|
-
u("div",
|
|
4827
|
-
e.$slots.actions ? (k(), l("div",
|
|
4894
|
+
return (e, t) => (k(), l("div", bs, [
|
|
4895
|
+
e.$slots.leading ? (k(), l("div", xs, [I(e.$slots, "leading", {}, void 0, !0)])) : c("", !0),
|
|
4896
|
+
u("div", Ss, [I(e.$slots, "default", {}, void 0, !0)]),
|
|
4897
|
+
e.$slots.actions ? (k(), l("div", Cs, [I(e.$slots, "actions", {}, void 0, !0)])) : c("", !0)
|
|
4828
4898
|
]));
|
|
4829
4899
|
}
|
|
4830
|
-
}), [["__scopeId", "data-v-fb2d2ef5"]]),
|
|
4900
|
+
}), [["__scopeId", "data-v-fb2d2ef5"]]), Ts = { class: "chat-queued-prompt__text" }, Es = { class: "chat-queued-prompt__actions" }, Ds = ["disabled"], Os = ["disabled"], ks = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
4831
4901
|
__name: "ChatQueuedPrompt",
|
|
4832
4902
|
props: {
|
|
4833
4903
|
prompt: {},
|
|
@@ -4841,7 +4911,7 @@ var _s = /*#__PURE__*/ X(ms, [["render", gs], ["__scopeId", "data-v-65051749"]])
|
|
|
4841
4911
|
],
|
|
4842
4912
|
setup(e, { emit: t }) {
|
|
4843
4913
|
let n = t;
|
|
4844
|
-
return (t, r) => (k(), s(
|
|
4914
|
+
return (t, r) => (k(), s(ws, {
|
|
4845
4915
|
class: "chat-queued-prompt",
|
|
4846
4916
|
"aria-label": "Queued prompt"
|
|
4847
4917
|
}, {
|
|
@@ -4849,7 +4919,7 @@ var _s = /*#__PURE__*/ X(ms, [["render", gs], ["__scopeId", "data-v-65051749"]])
|
|
|
4849
4919
|
class: "chat-queued-prompt__icon",
|
|
4850
4920
|
"aria-hidden": "true"
|
|
4851
4921
|
})]),
|
|
4852
|
-
actions: G(() => [u("div",
|
|
4922
|
+
actions: G(() => [u("div", Es, [
|
|
4853
4923
|
u("button", {
|
|
4854
4924
|
class: "chat-queued-prompt__action",
|
|
4855
4925
|
type: "button",
|
|
@@ -4857,7 +4927,7 @@ var _s = /*#__PURE__*/ X(ms, [["render", gs], ["__scopeId", "data-v-65051749"]])
|
|
|
4857
4927
|
title: "Steer now",
|
|
4858
4928
|
disabled: e.steerDisabled,
|
|
4859
4929
|
onClick: r[0] ||= (t) => n("steer", e.prompt.id)
|
|
4860
|
-
}, [m(H(qe), { "aria-hidden": "true" }), r[3] ||= u("span", null, "Steer", -1)], 8,
|
|
4930
|
+
}, [m(H(qe), { "aria-hidden": "true" }), r[3] ||= u("span", null, "Steer", -1)], 8, Ds),
|
|
4861
4931
|
u("button", {
|
|
4862
4932
|
class: "chat-queued-prompt__action",
|
|
4863
4933
|
type: "button",
|
|
@@ -4865,7 +4935,7 @@ var _s = /*#__PURE__*/ X(ms, [["render", gs], ["__scopeId", "data-v-65051749"]])
|
|
|
4865
4935
|
title: "Edit",
|
|
4866
4936
|
disabled: e.editDisabled,
|
|
4867
4937
|
onClick: r[1] ||= (t) => n("edit", e.prompt.id)
|
|
4868
|
-
}, [m(H(Y), { "aria-hidden": "true" })], 8,
|
|
4938
|
+
}, [m(H(Y), { "aria-hidden": "true" })], 8, Os),
|
|
4869
4939
|
u("button", {
|
|
4870
4940
|
class: "chat-queued-prompt__action",
|
|
4871
4941
|
type: "button",
|
|
@@ -4874,11 +4944,11 @@ var _s = /*#__PURE__*/ X(ms, [["render", gs], ["__scopeId", "data-v-65051749"]])
|
|
|
4874
4944
|
onClick: r[2] ||= (t) => n("delete", e.prompt.id)
|
|
4875
4945
|
}, [m(H(Qe), { "aria-hidden": "true" })])
|
|
4876
4946
|
])]),
|
|
4877
|
-
default: G(() => [u("span",
|
|
4947
|
+
default: G(() => [u("span", Ts, B(e.prompt.text), 1)]),
|
|
4878
4948
|
_: 1
|
|
4879
4949
|
}));
|
|
4880
4950
|
}
|
|
4881
|
-
}), [["__scopeId", "data-v-b90a893b"]]),
|
|
4951
|
+
}), [["__scopeId", "data-v-b90a893b"]]), As = /* @__PURE__ */ h({
|
|
4882
4952
|
__name: "ChatQueuedPrompts",
|
|
4883
4953
|
props: {
|
|
4884
4954
|
prompts: {},
|
|
@@ -4891,11 +4961,11 @@ var _s = /*#__PURE__*/ X(ms, [["render", gs], ["__scopeId", "data-v-65051749"]])
|
|
|
4891
4961
|
"steer"
|
|
4892
4962
|
],
|
|
4893
4963
|
setup(e) {
|
|
4894
|
-
return (n, r) => e.prompts.length ? (k(), s(
|
|
4964
|
+
return (n, r) => e.prompts.length ? (k(), s(ys, {
|
|
4895
4965
|
key: 0,
|
|
4896
4966
|
class: "chat-queued-prompts"
|
|
4897
4967
|
}, {
|
|
4898
|
-
default: G(() => [(k(!0), l(t, null, F(e.prompts, (t) => (k(), s(
|
|
4968
|
+
default: G(() => [(k(!0), l(t, null, F(e.prompts, (t) => (k(), s(ks, {
|
|
4899
4969
|
key: t.id,
|
|
4900
4970
|
"edit-disabled": e.editDisabled,
|
|
4901
4971
|
"steer-disabled": e.steerDisabled,
|
|
@@ -4911,32 +4981,32 @@ var _s = /*#__PURE__*/ X(ms, [["render", gs], ["__scopeId", "data-v-65051749"]])
|
|
|
4911
4981
|
_: 1
|
|
4912
4982
|
})) : c("", !0);
|
|
4913
4983
|
}
|
|
4914
|
-
}),
|
|
4984
|
+
}), js = {
|
|
4915
4985
|
class: "codex-chat-theme chat-turn-git-info",
|
|
4916
4986
|
"aria-label": "Current turn git changes"
|
|
4917
|
-
},
|
|
4987
|
+
}, Ms = { class: "chat-turn-git-info__diff" }, Ns = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
4918
4988
|
__name: "ChatTurnGitInfo",
|
|
4919
4989
|
props: { diff: {} },
|
|
4920
4990
|
setup(e) {
|
|
4921
|
-
return (t, n) => (k(), l("div",
|
|
4991
|
+
return (t, n) => (k(), l("div", js, [n[0] ||= u("span", { class: "chat-turn-git-info__label" }, "Current turn", -1), u("span", Ms, [e.diff.addedLines ? (k(), s(So, {
|
|
4922
4992
|
key: 0,
|
|
4923
4993
|
kind: "added",
|
|
4924
4994
|
label: "Added lines",
|
|
4925
4995
|
value: e.diff.addedLines
|
|
4926
|
-
}, null, 8, ["value"])) : c("", !0), e.diff.removedLines ? (k(), s(
|
|
4996
|
+
}, null, 8, ["value"])) : c("", !0), e.diff.removedLines ? (k(), s(So, {
|
|
4927
4997
|
key: 1,
|
|
4928
4998
|
kind: "deleted",
|
|
4929
4999
|
label: "Removed lines",
|
|
4930
5000
|
value: e.diff.removedLines
|
|
4931
5001
|
}, null, 8, ["value"])) : c("", !0)])]));
|
|
4932
5002
|
}
|
|
4933
|
-
}), [["__scopeId", "data-v-d7dd0aff"]]),
|
|
5003
|
+
}), [["__scopeId", "data-v-d7dd0aff"]]), Ps = {
|
|
4934
5004
|
key: 0,
|
|
4935
5005
|
class: "codex-chat-theme chat-composer-shelf"
|
|
4936
|
-
},
|
|
5006
|
+
}, Fs = {
|
|
4937
5007
|
key: 3,
|
|
4938
5008
|
class: "chat-composer-shelf__actions"
|
|
4939
|
-
},
|
|
5009
|
+
}, Is = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
4940
5010
|
__name: "ChatComposerShelf",
|
|
4941
5011
|
props: {
|
|
4942
5012
|
disabled: { type: Boolean },
|
|
@@ -4965,13 +5035,13 @@ var _s = /*#__PURE__*/ X(ms, [["render", gs], ["__scopeId", "data-v-65051749"]])
|
|
|
4965
5035
|
return i.type === e ? !1 : i.type === r ? String(i.children ?? "").trim().length > 0 : i.type !== t || _(i.children);
|
|
4966
5036
|
});
|
|
4967
5037
|
}
|
|
4968
|
-
return (e, t) => g.value ? (k(), l("div",
|
|
4969
|
-
f.value ? (k(), s(
|
|
5038
|
+
return (e, t) => g.value ? (k(), l("div", Ps, [
|
|
5039
|
+
f.value ? (k(), s(Ns, {
|
|
4970
5040
|
key: 0,
|
|
4971
5041
|
diff: f.value
|
|
4972
5042
|
}, null, 8, ["diff"])) : c("", !0),
|
|
4973
5043
|
I(e.$slots, "drawers", { disabled: p.value }, void 0, !0),
|
|
4974
|
-
d.value ? (k(), s(
|
|
5044
|
+
d.value ? (k(), s(As, {
|
|
4975
5045
|
key: 1,
|
|
4976
5046
|
"edit-disabled": n.queuedPromptEditDisabled,
|
|
4977
5047
|
"steer-disabled": n.queuedPromptSteerDisabled,
|
|
@@ -4984,28 +5054,28 @@ var _s = /*#__PURE__*/ X(ms, [["render", gs], ["__scopeId", "data-v-65051749"]])
|
|
|
4984
5054
|
"steer-disabled",
|
|
4985
5055
|
"prompts"
|
|
4986
5056
|
])) : c("", !0),
|
|
4987
|
-
u.value ? (k(), s(
|
|
5057
|
+
u.value ? (k(), s(hs, {
|
|
4988
5058
|
key: 2,
|
|
4989
5059
|
goal: n.goal,
|
|
4990
5060
|
onClear: t[3] ||= (t) => e.$emit("clearGoal"),
|
|
4991
5061
|
onEdit: t[4] ||= (t) => e.$emit("editGoal")
|
|
4992
5062
|
}, null, 8, ["goal"])) : c("", !0),
|
|
4993
|
-
h.value ? (k(), l("div",
|
|
5063
|
+
h.value ? (k(), l("div", Fs, [I(e.$slots, "actions", { disabled: p.value }, void 0, !0)])) : c("", !0)
|
|
4994
5064
|
])) : c("", !0);
|
|
4995
5065
|
}
|
|
4996
|
-
}), [["__scopeId", "data-v-9698c2ed"]]),
|
|
5066
|
+
}), [["__scopeId", "data-v-9698c2ed"]]), Ls = {}, Rs = {
|
|
4997
5067
|
class: "codex-chat-theme codex-conversation-history-loader",
|
|
4998
5068
|
role: "status",
|
|
4999
5069
|
"aria-live": "polite",
|
|
5000
5070
|
"aria-label": "Loading conversation"
|
|
5001
5071
|
};
|
|
5002
|
-
function
|
|
5003
|
-
return k(), l("div",
|
|
5072
|
+
function zs(e, t) {
|
|
5073
|
+
return k(), l("div", Rs, [...t[0] ||= [f("<div class=\"codex-conversation-history-loader__inner\" data-v-12645dc5><div class=\"codex-conversation-history-loader__block codex-conversation-history-loader__block--user\" data-v-12645dc5></div><div class=\"codex-conversation-history-loader__group\" data-v-12645dc5><div class=\"codex-conversation-history-loader__block codex-conversation-history-loader__block--wide\" data-v-12645dc5></div><div class=\"codex-conversation-history-loader__block codex-conversation-history-loader__block--medium\" data-v-12645dc5></div><div class=\"codex-conversation-history-loader__block codex-conversation-history-loader__block--short\" data-v-12645dc5></div></div><div class=\"codex-conversation-history-loader__group\" data-v-12645dc5><div class=\"codex-conversation-history-loader__block codex-conversation-history-loader__block--tool\" data-v-12645dc5></div><div class=\"codex-conversation-history-loader__block codex-conversation-history-loader__block--wide\" data-v-12645dc5></div><div class=\"codex-conversation-history-loader__block codex-conversation-history-loader__block--medium\" data-v-12645dc5></div></div></div>", 1)]]);
|
|
5004
5074
|
}
|
|
5005
|
-
var
|
|
5075
|
+
var Bs = /*#__PURE__*/ X(Ls, [["render", zs], ["__scopeId", "data-v-12645dc5"]]);
|
|
5006
5076
|
//#endregion
|
|
5007
5077
|
//#region src/chat/tool-visibility.ts
|
|
5008
|
-
function
|
|
5078
|
+
function Vs(e, t) {
|
|
5009
5079
|
if (!t) return e;
|
|
5010
5080
|
let n = $(e), r = /* @__PURE__ */ new Map(), i = (e) => (r.has(e.id) || r.set(e.id, t(e)), r.get(e.id)), a = n.toolCalls?.filter(i), o = n.parts?.filter((e) => e.type !== "tool" || i(e.toolCall));
|
|
5011
5081
|
if (a?.length === n.toolCalls?.length && o?.length === n.parts?.length) return e;
|
|
@@ -5014,19 +5084,19 @@ function zs(e, t) {
|
|
|
5014
5084
|
parts: o,
|
|
5015
5085
|
toolCalls: a
|
|
5016
5086
|
};
|
|
5017
|
-
return
|
|
5087
|
+
return Ra(s).length > 0 ? s : null;
|
|
5018
5088
|
}
|
|
5019
5089
|
//#endregion
|
|
5020
5090
|
//#region src/chat/image-viewport.ts
|
|
5021
|
-
var
|
|
5022
|
-
function
|
|
5091
|
+
var Hs = /* @__PURE__ */ new Map();
|
|
5092
|
+
function Us(e, t) {
|
|
5023
5093
|
if (typeof IntersectionObserver > "u") return t({
|
|
5024
5094
|
near: !0,
|
|
5025
5095
|
visible: !0
|
|
5026
5096
|
}), () => {};
|
|
5027
5097
|
let n = e.parentElement;
|
|
5028
5098
|
for (; n && !/(auto|scroll)/.test(getComputedStyle(n).overflowY);) n = n.parentElement;
|
|
5029
|
-
let r =
|
|
5099
|
+
let r = Hs.get(n);
|
|
5030
5100
|
if (!r) {
|
|
5031
5101
|
let e = /* @__PURE__ */ new Map(), t = (t, r) => new IntersectionObserver((n) => {
|
|
5032
5102
|
for (let r of n) {
|
|
@@ -5044,42 +5114,42 @@ function Vs(e, t) {
|
|
|
5044
5114
|
targets: e,
|
|
5045
5115
|
near: t("near", "400px 0px"),
|
|
5046
5116
|
visible: t("visible", "0px")
|
|
5047
|
-
},
|
|
5117
|
+
}, Hs.set(n, r);
|
|
5048
5118
|
}
|
|
5049
5119
|
return r.targets.set(e, {
|
|
5050
5120
|
near: !1,
|
|
5051
5121
|
visible: !1,
|
|
5052
5122
|
update: t
|
|
5053
5123
|
}), r.near.observe(e), r.visible.observe(e), () => {
|
|
5054
|
-
r.targets.delete(e), r.near.unobserve(e), r.visible.unobserve(e), r.targets.size || (r.near.disconnect(), r.visible.disconnect(),
|
|
5124
|
+
r.targets.delete(e), r.near.unobserve(e), r.visible.unobserve(e), r.targets.size || (r.near.disconnect(), r.visible.disconnect(), Hs.delete(n));
|
|
5055
5125
|
};
|
|
5056
5126
|
}
|
|
5057
5127
|
//#endregion
|
|
5058
5128
|
//#region src/chat/host-image-previews.ts
|
|
5059
|
-
function
|
|
5129
|
+
function Ws(e) {
|
|
5060
5130
|
return !!e && !/^(?:https?:|data:|blob:|\/\/)/i.test(e);
|
|
5061
5131
|
}
|
|
5062
|
-
function
|
|
5132
|
+
function Gs(e) {
|
|
5063
5133
|
return /^(?:https?:|blob:|data:image\/(?:avif|bmp|gif|heic|heif|jpe?g|png|webp);base64,)/i.test(e);
|
|
5064
5134
|
}
|
|
5065
|
-
function
|
|
5066
|
-
let t =
|
|
5135
|
+
function Ks(e) {
|
|
5136
|
+
let t = Li(), n = z();
|
|
5067
5137
|
return W(e, async (e, r, i) => {
|
|
5068
5138
|
let a = !0;
|
|
5069
5139
|
if (i(() => {
|
|
5070
5140
|
a = !1;
|
|
5071
|
-
}), n.value = void 0, !
|
|
5141
|
+
}), n.value = void 0, !Ws(e) || !t?.readImagePreview) {
|
|
5072
5142
|
n.value = e;
|
|
5073
5143
|
return;
|
|
5074
5144
|
}
|
|
5075
5145
|
try {
|
|
5076
5146
|
let r = await t.readImagePreview(e);
|
|
5077
|
-
a && r &&
|
|
5147
|
+
a && r && Gs(r) && (n.value = r);
|
|
5078
5148
|
} catch {}
|
|
5079
5149
|
}, { immediate: !0 }), o(() => n.value);
|
|
5080
5150
|
}
|
|
5081
|
-
function
|
|
5082
|
-
let n = b(
|
|
5151
|
+
function qs(e, t) {
|
|
5152
|
+
let n = b(Mi, void 0);
|
|
5083
5153
|
if (!n) return;
|
|
5084
5154
|
let r = z();
|
|
5085
5155
|
return W(e, (e, t, i) => {
|
|
@@ -5088,7 +5158,7 @@ function Gs(e, t) {
|
|
|
5088
5158
|
r.value = a, i(() => n.release(a)), n.viewport || n.load(a);
|
|
5089
5159
|
}, { immediate: !0 }), W([r, t], ([e, t], r, i) => {
|
|
5090
5160
|
if (!e || !t || !n.viewport) return;
|
|
5091
|
-
let a = !1, o = !1, s =
|
|
5161
|
+
let a = !1, o = !1, s = Us(t, (r) => {
|
|
5092
5162
|
let i = r.near && !a || r.visible && !o;
|
|
5093
5163
|
e.near += Number(r.near) - Number(a), e.visible += Number(r.visible) - Number(o), a = r.near, o = r.visible, n.visibilityChanged(e, t.clientWidth || 512), i && n.load(e);
|
|
5094
5164
|
});
|
|
@@ -5104,13 +5174,13 @@ function Gs(e, t) {
|
|
|
5104
5174
|
reload: () => r.value ? n.load(r.value, !0) : Promise.resolve()
|
|
5105
5175
|
};
|
|
5106
5176
|
}
|
|
5107
|
-
function
|
|
5177
|
+
function Js(e) {
|
|
5108
5178
|
let t = e?.width, n = e?.height;
|
|
5109
5179
|
return typeof t == "number" && typeof n == "number" && Number.isFinite(t) && Number.isFinite(n) && t > 0 && n > 0 ? `${t} / ${n}` : void 0;
|
|
5110
5180
|
}
|
|
5111
5181
|
//#endregion
|
|
5112
5182
|
//#region src/chat/ChatIconButton.vue
|
|
5113
|
-
var
|
|
5183
|
+
var Ys = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
5114
5184
|
__name: "ChatIconButton",
|
|
5115
5185
|
props: {
|
|
5116
5186
|
bordered: { type: Boolean },
|
|
@@ -5155,14 +5225,14 @@ var qs = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
|
5155
5225
|
"title"
|
|
5156
5226
|
]));
|
|
5157
5227
|
}
|
|
5158
|
-
}), [["__scopeId", "data-v-3a9d1fa8"]]),
|
|
5159
|
-
function
|
|
5228
|
+
}), [["__scopeId", "data-v-3a9d1fa8"]]), Xs = /* @__PURE__ */ "--color-background.--color-text.--color-text-muted.--color-border.--color-border-strong.--color-error.--color-warning.--color-success.--color-primary.--color-primary-container.--color-secondary.--color-secondary-container.--color-on-primary.--color-on-primary-container.--color-on-secondary-container.--color-overlay.--color-surface-lowest.--color-surface.--color-surface-base.--color-surface-low.--color-surface-high.--color-surface-highest.--color-shell-main.--font-family-base.--font-family-mono.--font-size-12.--font-size-13.--line-height-16.--line-height-20.--space-2.--space-4.--space-6.--space-8.--space-12.--space-16.--radius-md.--radius-lg.--shadow-lg".split(".");
|
|
5229
|
+
function Zs(e) {
|
|
5160
5230
|
if (!e || typeof getComputedStyle != "function") return {
|
|
5161
5231
|
mode: "light",
|
|
5162
5232
|
style: {}
|
|
5163
5233
|
};
|
|
5164
5234
|
let t = getComputedStyle(e), n = {};
|
|
5165
|
-
for (let e of
|
|
5235
|
+
for (let e of Xs) {
|
|
5166
5236
|
let r = t.getPropertyValue(e).trim();
|
|
5167
5237
|
r && (n[e] = r);
|
|
5168
5238
|
}
|
|
@@ -5173,7 +5243,7 @@ function Ys(e) {
|
|
|
5173
5243
|
}
|
|
5174
5244
|
//#endregion
|
|
5175
5245
|
//#region src/chat/ChatImageLightbox.vue?vue&type=script&setup=true&lang.ts
|
|
5176
|
-
var
|
|
5246
|
+
var Qs = ["data-codex-theme", "aria-label"], $s = ["alt", "src"], ec = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
5177
5247
|
__name: "ChatImageLightbox",
|
|
5178
5248
|
props: {
|
|
5179
5249
|
alt: {},
|
|
@@ -5190,7 +5260,7 @@ var Xs = ["data-codex-theme", "aria-label"], Zs = ["alt", "src"], Qs = /*#__PURE
|
|
|
5190
5260
|
style: {}
|
|
5191
5261
|
});
|
|
5192
5262
|
W(() => r.open, (e) => {
|
|
5193
|
-
e ? (a.value =
|
|
5263
|
+
e ? (a.value = Zs(r.themeSource), window.addEventListener("keydown", o)) : window.removeEventListener("keydown", o);
|
|
5194
5264
|
}, { immediate: !0 }), E(() => {
|
|
5195
5265
|
window.removeEventListener("keydown", o);
|
|
5196
5266
|
});
|
|
@@ -5206,7 +5276,7 @@ var Xs = ["data-codex-theme", "aria-label"], Zs = ["alt", "src"], Qs = /*#__PURE
|
|
|
5206
5276
|
"aria-modal": "true",
|
|
5207
5277
|
"aria-label": e.label,
|
|
5208
5278
|
onClick: r[1] ||= q((e) => i("close"), ["self"])
|
|
5209
|
-
}, [m(
|
|
5279
|
+
}, [m(Ys, {
|
|
5210
5280
|
bordered: "",
|
|
5211
5281
|
class: "chat-image-lightbox__close chat-media-block__fullscreen-close",
|
|
5212
5282
|
label: e.closeLabel,
|
|
@@ -5218,19 +5288,19 @@ var Xs = ["data-codex-theme", "aria-label"], Zs = ["alt", "src"], Qs = /*#__PURE
|
|
|
5218
5288
|
class: "chat-image-lightbox__image chat-media-block__fullscreen-image",
|
|
5219
5289
|
alt: e.alt,
|
|
5220
5290
|
src: e.src
|
|
5221
|
-
}, null, 8,
|
|
5291
|
+
}, null, 8, $s)], 12, Qs)) : c("", !0)]));
|
|
5222
5292
|
}
|
|
5223
|
-
}), [["__scopeId", "data-v-677575e5"]]),
|
|
5293
|
+
}), [["__scopeId", "data-v-677575e5"]]), tc = ["title"], nc = ["aria-label"], rc = ["alt", "src"], ic = {
|
|
5224
5294
|
key: 1,
|
|
5225
5295
|
class: "chat-attachment-block__placeholder"
|
|
5226
|
-
},
|
|
5296
|
+
}, ac = ["aria-label"], oc = { class: "chat-attachment-block__name" }, sc = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
5227
5297
|
__name: "ChatAttachmentBlock",
|
|
5228
5298
|
props: {
|
|
5229
5299
|
attachment: {},
|
|
5230
5300
|
openImage: { type: Function }
|
|
5231
5301
|
},
|
|
5232
5302
|
setup(e) {
|
|
5233
|
-
let t = e, n =
|
|
5303
|
+
let t = e, n = Li(), r = N(null), i = qs(() => t.attachment.kind === "image" && (t.attachment.url || t.attachment.path) || "", r), a = o(() => Js(t.attachment) ?? Js(i?.dimensions.value)), d = N(!1), f = N(), p = N(!1), h = o(() => i ? i.source.value : t.attachment.kind === "image" && x(t.attachment.url) ? t.attachment.url : f.value), g = o(() => i ? i.original.value : h.value), _ = o(() => w(t.attachment.path) || S(t.attachment.url));
|
|
5234
5304
|
W(h, () => {
|
|
5235
5305
|
d.value = !1;
|
|
5236
5306
|
});
|
|
@@ -5296,7 +5366,7 @@ var Xs = ["data-codex-theme", "aria-label"], Zs = ["alt", "src"], Qs = /*#__PURE
|
|
|
5296
5366
|
alt: e.attachment.name,
|
|
5297
5367
|
src: h.value,
|
|
5298
5368
|
onError: n[0] ||= (e) => d.value = !0
|
|
5299
|
-
}, null, 40,
|
|
5369
|
+
}, null, 40, rc)) : c("", !0), !h.value || d.value ? (k(), l("span", ic, B(H(i)?.loading.value ? "Loading image…" : e.attachment.name), 1)) : c("", !0)], 12, nc), m(ec, {
|
|
5300
5370
|
alt: e.attachment.name,
|
|
5301
5371
|
label: e.attachment.name,
|
|
5302
5372
|
open: p.value,
|
|
@@ -5309,13 +5379,13 @@ var Xs = ["data-codex-theme", "aria-label"], Zs = ["alt", "src"], Qs = /*#__PURE
|
|
|
5309
5379
|
"open",
|
|
5310
5380
|
"src",
|
|
5311
5381
|
"theme-source"
|
|
5312
|
-
])], 10,
|
|
5382
|
+
])], 10, tc)) : H(i) && e.attachment.kind === "image" ? (k(), l("button", {
|
|
5313
5383
|
key: 1,
|
|
5314
5384
|
class: "codex-chat-theme chat-attachment-block chat-attachment-block--chip",
|
|
5315
5385
|
type: "button",
|
|
5316
5386
|
"aria-label": `Load ${e.attachment.name}`,
|
|
5317
5387
|
onClick: y
|
|
5318
|
-
}, [m(H(Pe), { "aria-hidden": "true" }), u("span", null, B(e.attachment.name) + " · " + B(H(i).loading.value ? "Loading image…" : "Load image"), 1)], 8,
|
|
5388
|
+
}, [m(H(Pe), { "aria-hidden": "true" }), u("span", null, B(e.attachment.name) + " · " + B(H(i).loading.value ? "Loading image…" : "Load image"), 1)], 8, ac)) : (k(), s(R(_.value ? "a" : "span"), {
|
|
5319
5389
|
key: 2,
|
|
5320
5390
|
class: "codex-chat-theme chat-attachment-block chat-attachment-block--chip",
|
|
5321
5391
|
href: _.value,
|
|
@@ -5327,11 +5397,11 @@ var Xs = ["data-codex-theme", "aria-label"], Zs = ["alt", "src"], Qs = /*#__PURE
|
|
|
5327
5397
|
})) : (k(), s(H(Ne), {
|
|
5328
5398
|
key: 1,
|
|
5329
5399
|
"aria-hidden": "true"
|
|
5330
|
-
})), u("span",
|
|
5400
|
+
})), u("span", oc, B(e.attachment.name), 1)]),
|
|
5331
5401
|
_: 1
|
|
5332
5402
|
}, 8, ["href", "title"]));
|
|
5333
5403
|
}
|
|
5334
|
-
}), [["__scopeId", "data-v-bacdb5e1"]]),
|
|
5404
|
+
}), [["__scopeId", "data-v-bacdb5e1"]]), cc = { class: "codex-chat-theme chat-follow-ups" }, lc = ["disabled", "onClick"], uc = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
5335
5405
|
__name: "ChatFollowUps",
|
|
5336
5406
|
props: {
|
|
5337
5407
|
disabled: { type: Boolean },
|
|
@@ -5340,15 +5410,15 @@ var Xs = ["data-codex-theme", "aria-label"], Zs = ["alt", "src"], Qs = /*#__PURE
|
|
|
5340
5410
|
emits: ["send-follow-up"],
|
|
5341
5411
|
setup(e, { emit: n }) {
|
|
5342
5412
|
let r = n;
|
|
5343
|
-
return (n, i) => (k(), l("div",
|
|
5413
|
+
return (n, i) => (k(), l("div", cc, [(k(!0), l(t, null, F(e.prompts, (t) => (k(), l("button", {
|
|
5344
5414
|
key: t,
|
|
5345
5415
|
class: "chat-follow-ups__chip",
|
|
5346
5416
|
disabled: e.disabled,
|
|
5347
5417
|
type: "button",
|
|
5348
5418
|
onClick: (e) => r("send-follow-up", t)
|
|
5349
|
-
}, B(t), 9,
|
|
5419
|
+
}, B(t), 9, lc))), 128))]));
|
|
5350
5420
|
}
|
|
5351
|
-
}), [["__scopeId", "data-v-97d3281c"]]),
|
|
5421
|
+
}), [["__scopeId", "data-v-97d3281c"]]), dc = /* @__PURE__ */ h({
|
|
5352
5422
|
__name: "ChatCopyButton",
|
|
5353
5423
|
props: {
|
|
5354
5424
|
action: { type: Function },
|
|
@@ -5365,7 +5435,7 @@ var Xs = ["data-codex-theme", "aria-label"], Zs = ["alt", "src"], Qs = /*#__PURE
|
|
|
5365
5435
|
}
|
|
5366
5436
|
return E(() => {
|
|
5367
5437
|
r && clearTimeout(r);
|
|
5368
|
-
}), (t, r) => (k(), s(
|
|
5438
|
+
}), (t, r) => (k(), s(Ys, {
|
|
5369
5439
|
disabled: e.disabled,
|
|
5370
5440
|
label: n.value ? e.copiedLabel : e.label,
|
|
5371
5441
|
onClick: i
|
|
@@ -5374,32 +5444,32 @@ var Xs = ["data-codex-theme", "aria-label"], Zs = ["alt", "src"], Qs = /*#__PURE
|
|
|
5374
5444
|
_: 1
|
|
5375
5445
|
}, 8, ["disabled", "label"]));
|
|
5376
5446
|
}
|
|
5377
|
-
}),
|
|
5447
|
+
}), fc = { class: "chat-fold__inner" }, pc = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
5378
5448
|
__name: "ChatFoldTransition",
|
|
5379
5449
|
props: { open: { type: Boolean } },
|
|
5380
5450
|
setup(e) {
|
|
5381
|
-
return (t, n) => (k(), l("div", { class: C(["codex-chat-theme chat-fold", { "chat-fold--open": e.open }]) }, [u("div",
|
|
5451
|
+
return (t, n) => (k(), l("div", { class: C(["codex-chat-theme chat-fold", { "chat-fold--open": e.open }]) }, [u("div", fc, [I(t.$slots, "default", {}, void 0, !0)])], 2));
|
|
5382
5452
|
}
|
|
5383
|
-
}), [["__scopeId", "data-v-785f99e7"]]),
|
|
5453
|
+
}), [["__scopeId", "data-v-785f99e7"]]), mc = ["aria-label"], hc = ["alt", "src"], gc = {
|
|
5384
5454
|
key: 1,
|
|
5385
5455
|
class: "chat-media-block__placeholder"
|
|
5386
|
-
},
|
|
5456
|
+
}, _c = { class: "chat-media-block__footer" }, vc = { class: "chat-media-block__title" }, yc = { class: "chat-media-block__actions" }, bc = { class: "chat-media-block__details" }, xc = { class: "chat-media-block__prompt" }, Sc = "Download media", Cc = "Copy image", wc = "Image copied", Tc = "Open fullscreen", Ec = "Generated media", Dc = "Generated media", Oc = "Prompt", kc = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
5387
5457
|
__name: "ChatMediaBlock",
|
|
5388
5458
|
props: {
|
|
5389
5459
|
media: {},
|
|
5390
5460
|
openImage: { type: Function }
|
|
5391
5461
|
},
|
|
5392
5462
|
setup(e) {
|
|
5393
|
-
let t = e, n = o(() => `Open ${t.media.title || t.media.alt ||
|
|
5463
|
+
let t = e, n = o(() => `Open ${t.media.title || t.media.alt || Dc}`), r = N(null), i = qs(() => t.media.url, r), a = o(() => Js(t.media) ?? Js(i?.dimensions.value)), d = i?.source ?? Ks(() => t.media.url), f = o(() => i ? i.original.value : d.value), p = N(!1), h = N(!1), g = o(() => x(t.media));
|
|
5394
5464
|
async function _(e) {
|
|
5395
5465
|
if (i && !d.value && (await i.reload(), d.value)) return;
|
|
5396
5466
|
let n = {
|
|
5397
|
-
alt: t.media.alt ||
|
|
5467
|
+
alt: t.media.alt || Ec,
|
|
5398
5468
|
kind: "media",
|
|
5399
5469
|
mimeType: t.media.mimeType,
|
|
5400
5470
|
name: t.media.title,
|
|
5401
5471
|
src: f.value || t.media.url,
|
|
5402
|
-
title: t.media.title ||
|
|
5472
|
+
title: t.media.title || Dc
|
|
5403
5473
|
};
|
|
5404
5474
|
await t.openImage?.(n, { intent: e }) !== !0 && (h.value = !0);
|
|
5405
5475
|
}
|
|
@@ -5439,50 +5509,50 @@ var Xs = ["data-codex-theme", "aria-label"], Zs = ["alt", "src"], Qs = /*#__PURE
|
|
|
5439
5509
|
}, [H(d) || !H(i) ? (k(), l("img", {
|
|
5440
5510
|
key: 0,
|
|
5441
5511
|
class: "chat-media-block__image",
|
|
5442
|
-
alt: e.media.alt ||
|
|
5512
|
+
alt: e.media.alt || Ec,
|
|
5443
5513
|
src: H(d)
|
|
5444
|
-
}, null, 8,
|
|
5445
|
-
u("figcaption",
|
|
5446
|
-
m(
|
|
5447
|
-
label:
|
|
5514
|
+
}, null, 8, hc)) : c("", !0), H(i) && !H(d) ? (k(), l("span", gc, B(H(i)?.loading.value ? "Loading image…" : "Load image"), 1)) : c("", !0)], 14, mc),
|
|
5515
|
+
u("figcaption", _c, [u("span", vc, B(e.media.title || Dc), 1), u("span", yc, [
|
|
5516
|
+
m(Ys, {
|
|
5517
|
+
label: Tc,
|
|
5448
5518
|
onClick: o[1] ||= (e) => _("fullscreen")
|
|
5449
5519
|
}, {
|
|
5450
5520
|
default: G(() => [m(H(Ae))]),
|
|
5451
5521
|
_: 1
|
|
5452
5522
|
}),
|
|
5453
|
-
m(
|
|
5523
|
+
m(dc, {
|
|
5454
5524
|
action: y,
|
|
5455
|
-
"copied-label":
|
|
5456
|
-
label:
|
|
5525
|
+
"copied-label": wc,
|
|
5526
|
+
label: Cc
|
|
5457
5527
|
}),
|
|
5458
|
-
m(
|
|
5528
|
+
m(Ys, {
|
|
5459
5529
|
download: g.value,
|
|
5460
5530
|
href: f.value,
|
|
5461
|
-
label:
|
|
5531
|
+
label: Sc,
|
|
5462
5532
|
onClick: o[2] ||= q(() => {}, ["stop"])
|
|
5463
5533
|
}, {
|
|
5464
5534
|
default: G(() => [m(H(be))]),
|
|
5465
5535
|
_: 1
|
|
5466
5536
|
}, 8, ["download", "href"]),
|
|
5467
|
-
e.media.prompt ? (k(), s(
|
|
5537
|
+
e.media.prompt ? (k(), s(Ys, {
|
|
5468
5538
|
key: 0,
|
|
5469
|
-
label:
|
|
5539
|
+
label: Oc,
|
|
5470
5540
|
onClick: b
|
|
5471
5541
|
}, {
|
|
5472
5542
|
default: G(() => [m(H(Ee))]),
|
|
5473
5543
|
_: 1
|
|
5474
5544
|
})) : c("", !0)
|
|
5475
5545
|
])]),
|
|
5476
|
-
e.media.prompt ? (k(), s(
|
|
5546
|
+
e.media.prompt ? (k(), s(pc, {
|
|
5477
5547
|
key: 0,
|
|
5478
5548
|
open: p.value
|
|
5479
5549
|
}, {
|
|
5480
|
-
default: G(() => [u("div",
|
|
5550
|
+
default: G(() => [u("div", bc, [u("div", { class: "chat-media-block__details-title" }, B(Oc)), u("p", xc, B(e.media.prompt), 1)])]),
|
|
5481
5551
|
_: 1
|
|
5482
5552
|
}, 8, ["open"])) : c("", !0),
|
|
5483
|
-
m(
|
|
5484
|
-
alt: e.media.alt ||
|
|
5485
|
-
label: e.media.title ||
|
|
5553
|
+
m(ec, {
|
|
5554
|
+
alt: e.media.alt || Ec,
|
|
5555
|
+
label: e.media.title || Dc,
|
|
5486
5556
|
open: h.value,
|
|
5487
5557
|
src: f.value || e.media.url,
|
|
5488
5558
|
"theme-source": r.value,
|
|
@@ -5496,26 +5566,26 @@ var Xs = ["data-codex-theme", "aria-label"], Zs = ["alt", "src"], Qs = /*#__PURE
|
|
|
5496
5566
|
])
|
|
5497
5567
|
], 512));
|
|
5498
5568
|
}
|
|
5499
|
-
}), [["__scopeId", "data-v-d26fef15"]]),
|
|
5569
|
+
}), [["__scopeId", "data-v-d26fef15"]]), Ac = { class: "chat-mermaid-block__actions" }, jc = {
|
|
5500
5570
|
key: 0,
|
|
5501
5571
|
class: "chat-mermaid-block__code"
|
|
5502
|
-
},
|
|
5572
|
+
}, Mc = ["innerHTML"], Nc = {
|
|
5503
5573
|
key: 2,
|
|
5504
5574
|
class: "chat-mermaid-block__error"
|
|
5505
|
-
},
|
|
5575
|
+
}, Pc = ["data-codex-theme"], Fc = { class: "chat-mermaid-block__fullscreen-panel" }, Ic = { class: "chat-mermaid-block__actions chat-mermaid-block__actions--fullscreen" }, Lc = {
|
|
5506
5576
|
key: 0,
|
|
5507
5577
|
class: "chat-mermaid-block__code chat-mermaid-block__code--fullscreen"
|
|
5508
|
-
},
|
|
5578
|
+
}, Rc = ["innerHTML"], zc = {
|
|
5509
5579
|
key: 2,
|
|
5510
5580
|
class: "chat-mermaid-block__error"
|
|
5511
|
-
},
|
|
5581
|
+
}, Bc = "Close fullscreen", Vc = "Open fullscreen", Hc = "Render diagram", Uc = "Show source", Wc = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
5512
5582
|
__name: "ChatMermaidBlock",
|
|
5513
5583
|
props: { code: {} },
|
|
5514
5584
|
setup(e) {
|
|
5515
5585
|
let t = e, r = N(!1), i = N(!1), a = N(null), d = N({
|
|
5516
5586
|
mode: "light",
|
|
5517
5587
|
style: {}
|
|
5518
|
-
}), f = /@import\s+url\([^)]*\);\s*/g, p = /\sdata-label="[^"]*"/g, h = o(() => i.value ?
|
|
5588
|
+
}), f = /@import\s+url\([^)]*\);\s*/g, p = /\sdata-label="[^"]*"/g, h = o(() => i.value ? Hc : Uc), g = o(() => {
|
|
5519
5589
|
try {
|
|
5520
5590
|
return {
|
|
5521
5591
|
error: "",
|
|
@@ -5541,7 +5611,7 @@ var Xs = ["data-codex-theme", "aria-label"], Zs = ["alt", "src"], Qs = /*#__PURE
|
|
|
5541
5611
|
i.value = !i.value;
|
|
5542
5612
|
}
|
|
5543
5613
|
function v() {
|
|
5544
|
-
d.value =
|
|
5614
|
+
d.value = Zs(a.value), r.value = !0;
|
|
5545
5615
|
}
|
|
5546
5616
|
function y() {
|
|
5547
5617
|
r.value = !1;
|
|
@@ -5558,26 +5628,26 @@ var Xs = ["data-codex-theme", "aria-label"], Zs = ["alt", "src"], Qs = /*#__PURE
|
|
|
5558
5628
|
ref: a,
|
|
5559
5629
|
class: "codex-chat-theme chat-mermaid-block"
|
|
5560
5630
|
}, [
|
|
5561
|
-
u("div",
|
|
5631
|
+
u("div", Ac, [m(Ys, {
|
|
5562
5632
|
bordered: "",
|
|
5563
5633
|
label: h.value,
|
|
5564
5634
|
onClick: _
|
|
5565
5635
|
}, {
|
|
5566
5636
|
default: G(() => [i.value ? (k(), s(H(Se), { key: 0 })) : (k(), s(H(ve), { key: 1 }))]),
|
|
5567
5637
|
_: 1
|
|
5568
|
-
}, 8, ["label"]), m(
|
|
5638
|
+
}, 8, ["label"]), m(Ys, {
|
|
5569
5639
|
bordered: "",
|
|
5570
|
-
label:
|
|
5640
|
+
label: Vc,
|
|
5571
5641
|
onClick: v
|
|
5572
5642
|
}, {
|
|
5573
5643
|
default: G(() => [m(H(Ae))]),
|
|
5574
5644
|
_: 1
|
|
5575
5645
|
})]),
|
|
5576
|
-
i.value ? (k(), l("pre",
|
|
5646
|
+
i.value ? (k(), l("pre", jc, [u("code", null, B(t.code), 1)])) : g.value.svg ? (k(), l("div", {
|
|
5577
5647
|
key: 1,
|
|
5578
5648
|
class: "chat-mermaid-block__diagram",
|
|
5579
5649
|
innerHTML: g.value.svg
|
|
5580
|
-
}, null, 8,
|
|
5650
|
+
}, null, 8, Mc)) : (k(), l("pre", Nc, [u("code", null, B(g.value.error), 1)])),
|
|
5581
5651
|
(k(), s(n, { to: "body" }, [r.value ? (k(), l("div", {
|
|
5582
5652
|
key: 0,
|
|
5583
5653
|
class: "codex-chat-theme chat-mermaid-block__fullscreen",
|
|
@@ -5585,41 +5655,41 @@ var Xs = ["data-codex-theme", "aria-label"], Zs = ["alt", "src"], Qs = /*#__PURE
|
|
|
5585
5655
|
style: T(d.value.style),
|
|
5586
5656
|
role: "dialog",
|
|
5587
5657
|
"aria-modal": "true",
|
|
5588
|
-
"aria-label":
|
|
5658
|
+
"aria-label": Vc,
|
|
5589
5659
|
onClick: q(y, ["self"])
|
|
5590
|
-
}, [u("div",
|
|
5660
|
+
}, [u("div", Fc, [u("div", Ic, [m(Ys, {
|
|
5591
5661
|
bordered: "",
|
|
5592
5662
|
label: h.value,
|
|
5593
5663
|
onClick: _
|
|
5594
5664
|
}, {
|
|
5595
5665
|
default: G(() => [i.value ? (k(), s(H(Se), { key: 0 })) : (k(), s(H(ve), { key: 1 }))]),
|
|
5596
5666
|
_: 1
|
|
5597
|
-
}, 8, ["label"]), m(
|
|
5667
|
+
}, 8, ["label"]), m(Ys, {
|
|
5598
5668
|
bordered: "",
|
|
5599
|
-
label:
|
|
5669
|
+
label: Bc,
|
|
5600
5670
|
onClick: y
|
|
5601
5671
|
}, {
|
|
5602
5672
|
default: G(() => [m(H(et))]),
|
|
5603
5673
|
_: 1
|
|
5604
|
-
})]), i.value ? (k(), l("pre",
|
|
5674
|
+
})]), i.value ? (k(), l("pre", Lc, [u("code", null, B(t.code), 1)])) : g.value.svg ? (k(), l("div", {
|
|
5605
5675
|
key: 1,
|
|
5606
5676
|
class: "chat-mermaid-block__diagram chat-mermaid-block__diagram--fullscreen",
|
|
5607
5677
|
innerHTML: g.value.svg
|
|
5608
|
-
}, null, 8,
|
|
5678
|
+
}, null, 8, Rc)) : (k(), l("pre", zc, [u("code", null, B(g.value.error), 1)]))])], 12, Pc)) : c("", !0)]))
|
|
5609
5679
|
], 512));
|
|
5610
5680
|
}
|
|
5611
5681
|
}), [["__scopeId", "data-v-2356f49d"]]);
|
|
5612
5682
|
//#endregion
|
|
5613
5683
|
//#region src/chat/html-escape.ts
|
|
5614
|
-
function
|
|
5684
|
+
function Gc(e) {
|
|
5615
5685
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
5616
5686
|
}
|
|
5617
|
-
function
|
|
5618
|
-
return
|
|
5687
|
+
function Kc(e) {
|
|
5688
|
+
return Gc(e).replace(/`/g, "`");
|
|
5619
5689
|
}
|
|
5620
5690
|
//#endregion
|
|
5621
5691
|
//#region src/chat/syntax-highlighting.ts
|
|
5622
|
-
var
|
|
5692
|
+
var qc = st({
|
|
5623
5693
|
engine: ct(),
|
|
5624
5694
|
langs: [
|
|
5625
5695
|
lt,
|
|
@@ -5643,38 +5713,38 @@ var Gc = st({
|
|
|
5643
5713
|
Dt
|
|
5644
5714
|
],
|
|
5645
5715
|
themes: [kt, Ot]
|
|
5646
|
-
}),
|
|
5647
|
-
function
|
|
5648
|
-
|
|
5716
|
+
}), Jc = new Set(qc.getLoadedLanguages()), Yc = z(!1), Xc, Zc, Qc, $c;
|
|
5717
|
+
function el() {
|
|
5718
|
+
$c ??= Promise.all([
|
|
5649
5719
|
import("@pierre/highlights"),
|
|
5650
5720
|
import("@pierre/highlights/themes/light-plus"),
|
|
5651
5721
|
import("@pierre/highlights/themes/dark-plus")
|
|
5652
5722
|
]).then(([e, t, n]) => {
|
|
5653
|
-
|
|
5723
|
+
Xc = e, Zc = t.default, Qc = n.default, Yc.value = !0;
|
|
5654
5724
|
}).catch(() => {});
|
|
5655
5725
|
}
|
|
5656
|
-
function
|
|
5657
|
-
if (!
|
|
5658
|
-
let n =
|
|
5726
|
+
function tl(e, t) {
|
|
5727
|
+
if (!Xc || !Zc || !Qc || !Xc.isSupportedLanguage(t)) return;
|
|
5728
|
+
let n = Xc.codeToTokens(e, {
|
|
5659
5729
|
lang: t,
|
|
5660
5730
|
themes: {
|
|
5661
|
-
light:
|
|
5662
|
-
dark:
|
|
5731
|
+
light: Zc,
|
|
5732
|
+
dark: Qc
|
|
5663
5733
|
},
|
|
5664
5734
|
defaultColor: !1
|
|
5665
|
-
}), r = n.tokens.map((e) => `<span class="line">${e.map((e) => `<span style="${
|
|
5666
|
-
return `<pre class="highlights" style="${
|
|
5735
|
+
}), r = n.tokens.map((e) => `<span class="line">${e.map((e) => `<span style="${Kc(Object.entries(e.htmlStyle ?? {}).map(([e, t]) => `${e}:${t}`).join(";"))}">${Gc(e.content)}</span>`).join("")}</span>`).join("\n");
|
|
5736
|
+
return `<pre class="highlights" style="${Kc(n.rootStyle || "")}"><code>${r}</code></pre>`;
|
|
5667
5737
|
}
|
|
5668
|
-
function
|
|
5669
|
-
let n =
|
|
5670
|
-
if (!n || !
|
|
5671
|
-
|
|
5738
|
+
function nl(e, t) {
|
|
5739
|
+
let n = il(t);
|
|
5740
|
+
if (!n || !Jc.has(n)) return al(e, t);
|
|
5741
|
+
el(), Yc.value;
|
|
5672
5742
|
try {
|
|
5673
|
-
let t =
|
|
5743
|
+
let t = tl(e, n);
|
|
5674
5744
|
if (t !== void 0) return t;
|
|
5675
5745
|
} catch {}
|
|
5676
5746
|
try {
|
|
5677
|
-
return
|
|
5747
|
+
return qc.codeToHtml(e, {
|
|
5678
5748
|
defaultColor: !1,
|
|
5679
5749
|
lang: n,
|
|
5680
5750
|
themes: {
|
|
@@ -5683,10 +5753,10 @@ function el(e, t) {
|
|
|
5683
5753
|
}
|
|
5684
5754
|
});
|
|
5685
5755
|
} catch {
|
|
5686
|
-
return
|
|
5756
|
+
return al(e, t);
|
|
5687
5757
|
}
|
|
5688
5758
|
}
|
|
5689
|
-
function
|
|
5759
|
+
function rl(e) {
|
|
5690
5760
|
let t = (e ?? "").trim().toLowerCase(), n = t.match(/\.([^.\\/]+)$/)?.[1];
|
|
5691
5761
|
switch (n) {
|
|
5692
5762
|
case "patch": return "diff";
|
|
@@ -5711,38 +5781,38 @@ function tl(e) {
|
|
|
5711
5781
|
default: return t.endsWith("/dockerfile") || t === "dockerfile" ? "docker" : n;
|
|
5712
5782
|
}
|
|
5713
5783
|
}
|
|
5714
|
-
function
|
|
5784
|
+
function il(e) {
|
|
5715
5785
|
let [t] = (e ?? "").trim().toLowerCase().split(/\s+/);
|
|
5716
5786
|
return t || null;
|
|
5717
5787
|
}
|
|
5718
|
-
function
|
|
5719
|
-
let n =
|
|
5720
|
-
return `<pre><code${n ? ` class="language-${
|
|
5788
|
+
function al(e, t) {
|
|
5789
|
+
let n = il(t);
|
|
5790
|
+
return `<pre><code${n ? ` class="language-${Kc(n)}"` : ""}>${ol(e)}</code></pre>`;
|
|
5721
5791
|
}
|
|
5722
|
-
function
|
|
5723
|
-
return e.split("\n").map((e) => `<span class="line">${
|
|
5792
|
+
function ol(e) {
|
|
5793
|
+
return e.split("\n").map((e) => `<span class="line">${Gc(e)}</span>`).join("\n");
|
|
5724
5794
|
}
|
|
5725
5795
|
//#endregion
|
|
5726
5796
|
//#region src/chat/message-markdown.ts
|
|
5727
|
-
var
|
|
5728
|
-
|
|
5729
|
-
let r =
|
|
5797
|
+
var sl = new it();
|
|
5798
|
+
sl.html = ({ text: e }) => Gc(e), sl.code = ({ text: e, lang: t }) => nl(e, t), sl.link = ({ href: e, title: t, tokens: n }) => {
|
|
5799
|
+
let r = vl(n), i = hl(e);
|
|
5730
5800
|
if (!i) return `<span class="chat-message-link chat-message-link--blocked">${r}</span>`;
|
|
5731
|
-
let a = t ? ` title="${
|
|
5732
|
-
return `<a class="chat-message-link" href="${
|
|
5733
|
-
},
|
|
5734
|
-
let r =
|
|
5735
|
-
if (!r) return `<span class="chat-message-image chat-message-image--blocked">${
|
|
5736
|
-
let a = t ? ` title="${
|
|
5737
|
-
return `<img class="chat-message-image" src="${
|
|
5801
|
+
let a = t ? ` title="${Kc(t)}"` : "", o = _l(i), s = dl(i) ? " target=\"_blank\" rel=\"noopener noreferrer\"" : "";
|
|
5802
|
+
return `<a class="chat-message-link" href="${Kc(i)}"${a}${s}>${o}<span class="chat-message-link__label">${r}</span></a>`;
|
|
5803
|
+
}, sl.image = ({ href: e, title: t, text: n }) => {
|
|
5804
|
+
let r = gl(e), i = Kc(n);
|
|
5805
|
+
if (!r) return `<span class="chat-message-image chat-message-image--blocked">${Gc(n)}</span>`;
|
|
5806
|
+
let a = t ? ` title="${Kc(t)}"` : "";
|
|
5807
|
+
return `<img class="chat-message-image" src="${Kc(r)}" alt="${i}"${a} loading="lazy" decoding="async" referrerpolicy="no-referrer">`;
|
|
5738
5808
|
};
|
|
5739
|
-
var
|
|
5809
|
+
var cl = new rt({
|
|
5740
5810
|
async: !1,
|
|
5741
5811
|
breaks: !0,
|
|
5742
5812
|
gfm: !0,
|
|
5743
|
-
renderer:
|
|
5813
|
+
renderer: sl
|
|
5744
5814
|
});
|
|
5745
|
-
|
|
5815
|
+
cl.use(ot({
|
|
5746
5816
|
maxExpand: 1e3,
|
|
5747
5817
|
maxSize: 20,
|
|
5748
5818
|
nonStandard: !1,
|
|
@@ -5750,7 +5820,7 @@ ol.use(ot({
|
|
|
5750
5820
|
strict: "ignore",
|
|
5751
5821
|
throwOnError: !1,
|
|
5752
5822
|
trust: !1
|
|
5753
|
-
})),
|
|
5823
|
+
})), cl.use({ extensions: [{
|
|
5754
5824
|
name: "codexBlockKatex",
|
|
5755
5825
|
level: "block",
|
|
5756
5826
|
tokenizer(e) {
|
|
@@ -5762,7 +5832,7 @@ ol.use(ot({
|
|
|
5762
5832
|
};
|
|
5763
5833
|
},
|
|
5764
5834
|
renderer(e) {
|
|
5765
|
-
return `${
|
|
5835
|
+
return `${pl(e.text, !0)}\n`;
|
|
5766
5836
|
}
|
|
5767
5837
|
}, {
|
|
5768
5838
|
name: "codexInlineKatex",
|
|
@@ -5776,23 +5846,23 @@ ol.use(ot({
|
|
|
5776
5846
|
};
|
|
5777
5847
|
},
|
|
5778
5848
|
renderer(e) {
|
|
5779
|
-
return
|
|
5849
|
+
return pl(e.text, !1);
|
|
5780
5850
|
}
|
|
5781
5851
|
}] });
|
|
5782
|
-
function
|
|
5783
|
-
let n =
|
|
5784
|
-
return t.codeCopyLabel ?
|
|
5852
|
+
function ll(e, t = {}) {
|
|
5853
|
+
let n = cl.parse(e);
|
|
5854
|
+
return t.codeCopyLabel ? ul(n, t.codeCopyLabel) : n;
|
|
5785
5855
|
}
|
|
5786
|
-
function
|
|
5856
|
+
function ul(e, t) {
|
|
5787
5857
|
let n = [
|
|
5788
|
-
`<button class="chat-code-block__copy" type="button" data-chat-code-copy aria-label="${
|
|
5858
|
+
`<button class="chat-code-block__copy" type="button" data-chat-code-copy aria-label="${Kc(t)}" title="${Kc(t)}">`,
|
|
5789
5859
|
"<svg class=\"chat-code-block__copy-icon\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8 8m-2 0a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2z\"/><path d=\"M16 6V4a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h2\"/></svg>",
|
|
5790
5860
|
"<svg class=\"chat-code-block__check-icon\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"m5 12 5 5L20 7\"/></svg>",
|
|
5791
5861
|
"</button>"
|
|
5792
5862
|
].join("");
|
|
5793
5863
|
return e.replace(/(<pre\b[\s\S]*?<\/pre>)/g, `<div class="chat-code-block">${n}$1</div>`);
|
|
5794
5864
|
}
|
|
5795
|
-
function
|
|
5865
|
+
function dl(e) {
|
|
5796
5866
|
try {
|
|
5797
5867
|
let t = new URL(e);
|
|
5798
5868
|
return t.protocol === "http:" || t.protocol === "https:";
|
|
@@ -5800,14 +5870,14 @@ function ll(e) {
|
|
|
5800
5870
|
return !1;
|
|
5801
5871
|
}
|
|
5802
5872
|
}
|
|
5803
|
-
function
|
|
5873
|
+
function fl(e) {
|
|
5804
5874
|
try {
|
|
5805
5875
|
return new URL(e).protocol === "mailto:";
|
|
5806
5876
|
} catch {
|
|
5807
5877
|
return !1;
|
|
5808
5878
|
}
|
|
5809
5879
|
}
|
|
5810
|
-
function
|
|
5880
|
+
function pl(e, t) {
|
|
5811
5881
|
let n = at.renderToString(e, {
|
|
5812
5882
|
displayMode: t,
|
|
5813
5883
|
maxExpand: 1e3,
|
|
@@ -5819,14 +5889,14 @@ function dl(e, t) {
|
|
|
5819
5889
|
});
|
|
5820
5890
|
return t ? `<span class="katex-display">${n}</span>` : n;
|
|
5821
5891
|
}
|
|
5822
|
-
var
|
|
5892
|
+
var ml = /* @__PURE__ */ new Set([
|
|
5823
5893
|
"file:",
|
|
5824
5894
|
"http:",
|
|
5825
5895
|
"https:",
|
|
5826
5896
|
"mailto:",
|
|
5827
5897
|
"tel:"
|
|
5828
5898
|
]);
|
|
5829
|
-
function
|
|
5899
|
+
function hl(e) {
|
|
5830
5900
|
let t = e.trim();
|
|
5831
5901
|
if (!t || /[\u0000-\u001f\u007f]/.test(t)) return null;
|
|
5832
5902
|
if (/^[a-z]:[\\/]/i.test(t) || vn(t)) return t;
|
|
@@ -5834,15 +5904,15 @@ function pl(e) {
|
|
|
5834
5904
|
let n = /^([a-z][a-z\d+.-]*):/i.exec(t)?.[1];
|
|
5835
5905
|
if (!n) return t;
|
|
5836
5906
|
let r = `${n.toLowerCase()}:`;
|
|
5837
|
-
if (!
|
|
5907
|
+
if (!ml.has(r)) return null;
|
|
5838
5908
|
try {
|
|
5839
5909
|
return new URL(t), t;
|
|
5840
5910
|
} catch {
|
|
5841
5911
|
return null;
|
|
5842
5912
|
}
|
|
5843
5913
|
}
|
|
5844
|
-
function
|
|
5845
|
-
let t =
|
|
5914
|
+
function gl(e) {
|
|
5915
|
+
let t = hl(e);
|
|
5846
5916
|
if (!t || t.startsWith("#") || t.startsWith("?")) return null;
|
|
5847
5917
|
try {
|
|
5848
5918
|
let e = new URL(t).protocol;
|
|
@@ -5851,35 +5921,35 @@ function ml(e) {
|
|
|
5851
5921
|
return t;
|
|
5852
5922
|
}
|
|
5853
5923
|
}
|
|
5854
|
-
function
|
|
5855
|
-
return
|
|
5924
|
+
function _l(e) {
|
|
5925
|
+
return dl(e) ? "<svg class=\"chat-message-link__icon chat-message-link__icon--external\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M15 3h6v6\"></path><path d=\"m10 14 11-11\"></path><path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\"></path></svg>" : fl(e) ? "<svg class=\"chat-message-link__icon chat-message-link__icon--mail\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"20\" height=\"16\" x=\"2\" y=\"4\" rx=\"2\"></rect><path d=\"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7\"></path></svg>" : "<svg class=\"chat-message-link__icon chat-message-link__icon--file\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\"></path><path d=\"M14 2v4a2 2 0 0 0 2 2h4\"></path></svg>";
|
|
5856
5926
|
}
|
|
5857
|
-
function
|
|
5858
|
-
return e.map(
|
|
5927
|
+
function vl(e) {
|
|
5928
|
+
return e.map(yl).join("");
|
|
5859
5929
|
}
|
|
5860
|
-
function
|
|
5930
|
+
function yl(e) {
|
|
5861
5931
|
if (!e || typeof e != "object") return "";
|
|
5862
5932
|
let t = e;
|
|
5863
5933
|
if (Array.isArray(t.tokens)) {
|
|
5864
|
-
let e =
|
|
5934
|
+
let e = vl(t.tokens);
|
|
5865
5935
|
return t.type === "strong" ? `<strong>${e}</strong>` : t.type === "em" ? `<em>${e}</em>` : e;
|
|
5866
5936
|
}
|
|
5867
|
-
return t.type === "codespan" && typeof t.text == "string" ? `<code>${
|
|
5937
|
+
return t.type === "codespan" && typeof t.text == "string" ? `<code>${Gc(t.text)}</code>` : typeof t.text == "string" ? Gc(t.text) : typeof t.raw == "string" ? Gc(t.raw) : "";
|
|
5868
5938
|
}
|
|
5869
5939
|
//#endregion
|
|
5870
5940
|
//#region src/chat/message-actions.ts
|
|
5871
|
-
var
|
|
5872
|
-
function
|
|
5873
|
-
return
|
|
5941
|
+
var bl = /<tool\s+(id|index)="[^"]*"><\/tool>/g, xl = /<follow-up>[\s\S]*?<\/follow-up>/g, Sl = /<br\s*\/?>/gi;
|
|
5942
|
+
function Cl(e) {
|
|
5943
|
+
return Ga(e).replace(bl, "").replace(xl, "").trim();
|
|
5874
5944
|
}
|
|
5875
|
-
function
|
|
5876
|
-
return
|
|
5945
|
+
function wl(e) {
|
|
5946
|
+
return Ol(Cl(e));
|
|
5877
5947
|
}
|
|
5878
|
-
function
|
|
5879
|
-
return
|
|
5948
|
+
function Tl(e) {
|
|
5949
|
+
return ll(Cl(e)).trim();
|
|
5880
5950
|
}
|
|
5881
|
-
async function
|
|
5882
|
-
let n =
|
|
5951
|
+
async function El(e, t = Ri()) {
|
|
5952
|
+
let n = wl(e), r = Tl(e);
|
|
5883
5953
|
if (t) {
|
|
5884
5954
|
await t.copyToClipboard({
|
|
5885
5955
|
text: n,
|
|
@@ -5897,56 +5967,56 @@ async function wl(e, t = Ii()) {
|
|
|
5897
5967
|
}
|
|
5898
5968
|
await i.writeText(n);
|
|
5899
5969
|
}
|
|
5900
|
-
async function
|
|
5970
|
+
async function Dl(e, t = Ri()) {
|
|
5901
5971
|
if (t) {
|
|
5902
5972
|
await t.copyToClipboard({ text: e });
|
|
5903
5973
|
return;
|
|
5904
5974
|
}
|
|
5905
5975
|
await navigator.clipboard.writeText(e);
|
|
5906
5976
|
}
|
|
5907
|
-
function
|
|
5908
|
-
let t =
|
|
5977
|
+
function Ol(e) {
|
|
5978
|
+
let t = ll(e).replace(Sl, "\n"), n = document.createElement("template");
|
|
5909
5979
|
n.innerHTML = t;
|
|
5910
5980
|
let r = [];
|
|
5911
|
-
return n.content.childNodes.forEach((e) =>
|
|
5981
|
+
return n.content.childNodes.forEach((e) => kl(e, r)), r.join("\n");
|
|
5912
5982
|
}
|
|
5913
|
-
function
|
|
5983
|
+
function kl(e, t) {
|
|
5914
5984
|
if (e.nodeType === Node.TEXT_NODE) {
|
|
5915
5985
|
let n = e.textContent.trim();
|
|
5916
|
-
n && t.push(
|
|
5986
|
+
n && t.push(jl(n));
|
|
5917
5987
|
return;
|
|
5918
5988
|
}
|
|
5919
5989
|
if (!(e instanceof HTMLElement)) return;
|
|
5920
5990
|
let n = e.tagName.toLowerCase();
|
|
5921
5991
|
if (e.classList.contains("katex")) {
|
|
5922
|
-
let n =
|
|
5923
|
-
n && t.push(
|
|
5992
|
+
let n = Al(e).trim();
|
|
5993
|
+
n && t.push(jl(n));
|
|
5924
5994
|
return;
|
|
5925
5995
|
}
|
|
5926
5996
|
if (n === "pre") {
|
|
5927
5997
|
let n = [...e.querySelectorAll(":scope > code > .line")].map((e) => e.textContent ?? "").join("\n").trim();
|
|
5928
|
-
n && t.push(
|
|
5998
|
+
n && t.push(jl(n));
|
|
5929
5999
|
return;
|
|
5930
6000
|
}
|
|
5931
6001
|
if (n === "li" || n === "p" || /^h[1-6]$/.test(n)) {
|
|
5932
|
-
let n =
|
|
5933
|
-
n && t.push(
|
|
6002
|
+
let n = Al(e).trim();
|
|
6003
|
+
n && t.push(jl(n));
|
|
5934
6004
|
return;
|
|
5935
6005
|
}
|
|
5936
|
-
e.childNodes.forEach((e) =>
|
|
6006
|
+
e.childNodes.forEach((e) => kl(e, t));
|
|
5937
6007
|
}
|
|
5938
|
-
function
|
|
5939
|
-
return e.nodeType === Node.TEXT_NODE ? e.textContent : e instanceof HTMLElement ? e.classList.contains("katex") ? e.querySelector("annotation[encoding=\"application/x-tex\"]")?.textContent ?? "" : [...e.childNodes].map(
|
|
6008
|
+
function Al(e) {
|
|
6009
|
+
return e.nodeType === Node.TEXT_NODE ? e.textContent : e instanceof HTMLElement ? e.classList.contains("katex") ? e.querySelector("annotation[encoding=\"application/x-tex\"]")?.textContent ?? "" : [...e.childNodes].map(Al).join("") : "";
|
|
5940
6010
|
}
|
|
5941
|
-
function
|
|
6011
|
+
function jl(e) {
|
|
5942
6012
|
return e.replace(/[ \t]+\n/g, "\n").replace(/\n{3,}/g, "\n\n");
|
|
5943
6013
|
}
|
|
5944
6014
|
//#endregion
|
|
5945
6015
|
//#region src/chat/html-preview-document.ts
|
|
5946
|
-
var
|
|
6016
|
+
var Ml = "<!doctype html><html><head>\n<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'none'; script-src 'unsafe-inline' https:; style-src 'unsafe-inline'; img-src data: blob:; font-src data:; connect-src 'none'; frame-src 'none'; form-action 'none'; base-uri 'none'\">\n</head><body><script>\naddEventListener('load', () => {\n document.open();\n addEventListener('message', function connect(event) {\n if (event.source !== parent || event.data !== 'codex-html-connect' || !event.ports[0]) return;\n removeEventListener('message', connect);\n const port = event.ports[0];\n port.onmessage = ({ data }) => {\n if (typeof data.chunk !== 'string') return;\n if (data.chunk) document.write(data.chunk);\n if (data.complete) document.close();\n };\n });\n parent.postMessage('codex-html-ready', '*');\n}, { once: true });\n<\/script></body></html>", Nl = { class: "codex-chat-theme chat-html-block" }, Pl = { class: "chat-html-block__header" }, Fl = { class: "chat-html-block__title" }, Il = {
|
|
5947
6017
|
key: 0,
|
|
5948
6018
|
class: "chat-html-block__status"
|
|
5949
|
-
},
|
|
6019
|
+
}, Ll = { class: "chat-html-block__actions" }, Rl = { class: "chat-html-block__viewport" }, zl = ["srcdoc", "title"], Bl = { key: 0 }, Vl = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
5950
6020
|
__name: "ChatHtmlBlock",
|
|
5951
6021
|
props: {
|
|
5952
6022
|
source: {},
|
|
@@ -5954,7 +6024,7 @@ var Al = "<!doctype html><html><head>\n<meta http-equiv=\"Content-Security-Polic
|
|
|
5954
6024
|
complete: { type: Boolean }
|
|
5955
6025
|
},
|
|
5956
6026
|
setup(e) {
|
|
5957
|
-
let t = e, n = Zn(), r =
|
|
6027
|
+
let t = e, n = Zn(), r = Li(), i = N(), a = N(!1), o = N(0), d, f = !1, p = "", h = !1, g = /* @__PURE__ */ new Map();
|
|
5958
6028
|
function _() {
|
|
5959
6029
|
d?.port1.close(), d?.port2.close(), d = void 0, f = !1;
|
|
5960
6030
|
}
|
|
@@ -5975,7 +6045,7 @@ var Al = "<!doctype html><html><head>\n<meta http-equiv=\"Content-Security-Polic
|
|
|
5975
6045
|
}), f = !0, v());
|
|
5976
6046
|
}
|
|
5977
6047
|
function b() {
|
|
5978
|
-
return
|
|
6048
|
+
return Dl(t.source, r);
|
|
5979
6049
|
}
|
|
5980
6050
|
function x() {
|
|
5981
6051
|
let e = URL.createObjectURL(new Blob([t.source], { type: "text/html" })), n = document.createElement("a");
|
|
@@ -5986,23 +6056,23 @@ var Al = "<!doctype html><html><head>\n<meta http-equiv=\"Content-Security-Polic
|
|
|
5986
6056
|
return W(() => [t.source, t.complete], v), D(() => window.addEventListener("message", y)), E(() => {
|
|
5987
6057
|
window.removeEventListener("message", y), _();
|
|
5988
6058
|
for (let [e, t] of g) clearTimeout(t), URL.revokeObjectURL(e);
|
|
5989
|
-
}), (t, r) => (k(), l("section",
|
|
5990
|
-
u("span",
|
|
5991
|
-
e.complete ? c("", !0) : (k(), l("span",
|
|
5992
|
-
u("div",
|
|
5993
|
-
m(
|
|
6059
|
+
}), (t, r) => (k(), l("section", Nl, [u("header", Pl, [
|
|
6060
|
+
u("span", Fl, B(e.title || H(n)("chat.html.title")), 1),
|
|
6061
|
+
e.complete ? c("", !0) : (k(), l("span", Il, B(H(n)("chat.html.streaming")), 1)),
|
|
6062
|
+
u("div", Ll, [
|
|
6063
|
+
m(Ys, {
|
|
5994
6064
|
label: H(n)(a.value ? "chat.html.preview" : "chat.html.source"),
|
|
5995
6065
|
onClick: r[0] ||= (e) => a.value = !a.value
|
|
5996
6066
|
}, {
|
|
5997
6067
|
default: G(() => [a.value ? (k(), s(H(Se), { key: 0 })) : (k(), s(H(ve), { key: 1 }))]),
|
|
5998
6068
|
_: 1
|
|
5999
6069
|
}, 8, ["label"]),
|
|
6000
|
-
m(
|
|
6070
|
+
m(dc, {
|
|
6001
6071
|
action: b,
|
|
6002
6072
|
label: H(n)("chat.code.copy"),
|
|
6003
6073
|
"copied-label": H(n)("chat.code.copied")
|
|
6004
6074
|
}, null, 8, ["label", "copied-label"]),
|
|
6005
|
-
m(
|
|
6075
|
+
m(Ys, {
|
|
6006
6076
|
label: H(n)("chat.html.download"),
|
|
6007
6077
|
onClick: x
|
|
6008
6078
|
}, {
|
|
@@ -6010,69 +6080,69 @@ var Al = "<!doctype html><html><head>\n<meta http-equiv=\"Content-Security-Polic
|
|
|
6010
6080
|
_: 1
|
|
6011
6081
|
}, 8, ["label"])
|
|
6012
6082
|
])
|
|
6013
|
-
]), u("div",
|
|
6083
|
+
]), u("div", Rl, [re((k(), l("iframe", {
|
|
6014
6084
|
key: o.value,
|
|
6015
6085
|
ref_key: "frame",
|
|
6016
6086
|
ref: i,
|
|
6017
|
-
srcdoc: H(
|
|
6087
|
+
srcdoc: H(Ml),
|
|
6018
6088
|
title: e.title || H(n)("chat.html.title"),
|
|
6019
6089
|
sandbox: "allow-scripts",
|
|
6020
6090
|
referrerpolicy: "no-referrer"
|
|
6021
|
-
}, null, 8,
|
|
6091
|
+
}, null, 8, zl)), [[ne, !a.value]]), a.value ? (k(), l("pre", Bl, [u("code", null, B(e.source), 1)])) : c("", !0)])]));
|
|
6022
6092
|
}
|
|
6023
|
-
}), [["__scopeId", "data-v-f327ab9d"]]),
|
|
6024
|
-
function
|
|
6025
|
-
A(
|
|
6093
|
+
}), [["__scopeId", "data-v-f327ab9d"]]), Hl = () => void 0, Ul = Symbol("codex-app-sdk-tool-presentation");
|
|
6094
|
+
function Wl(e) {
|
|
6095
|
+
A(Ul, e);
|
|
6026
6096
|
}
|
|
6027
|
-
function
|
|
6028
|
-
return b(
|
|
6097
|
+
function Gl() {
|
|
6098
|
+
return b(Ul, Hl);
|
|
6029
6099
|
}
|
|
6030
6100
|
//#endregion
|
|
6031
6101
|
//#region src/chat/tool-call-details.ts
|
|
6032
|
-
var
|
|
6033
|
-
function
|
|
6034
|
-
A(
|
|
6102
|
+
var Kl = Symbol("codex-app-sdk-tool-call-details");
|
|
6103
|
+
function ql(e) {
|
|
6104
|
+
A(Kl, e);
|
|
6035
6105
|
}
|
|
6036
|
-
function
|
|
6037
|
-
let e = b(
|
|
6106
|
+
function Jl() {
|
|
6107
|
+
let e = b(Kl, !1);
|
|
6038
6108
|
return o(() => !!V(e));
|
|
6039
6109
|
}
|
|
6040
6110
|
//#endregion
|
|
6041
6111
|
//#region src/chat/ChatToolCall.vue?vue&type=script&setup=true&lang.ts
|
|
6042
|
-
var
|
|
6112
|
+
var Yl = {
|
|
6043
6113
|
key: 0,
|
|
6044
6114
|
class: "chat-tool-call__summary"
|
|
6045
|
-
},
|
|
6115
|
+
}, Xl = {
|
|
6046
6116
|
key: 1,
|
|
6047
6117
|
class: "chat-tool-call__header chat-tool-call__header--static"
|
|
6048
|
-
},
|
|
6118
|
+
}, Zl = {
|
|
6049
6119
|
key: 3,
|
|
6050
6120
|
class: "chat-tool-call__body"
|
|
6051
|
-
},
|
|
6121
|
+
}, Ql = {
|
|
6052
6122
|
key: 0,
|
|
6053
6123
|
class: "chat-tool-call__section"
|
|
6054
|
-
},
|
|
6124
|
+
}, $l = { class: "chat-tool-call__section-title" }, eu = {
|
|
6055
6125
|
key: 0,
|
|
6056
6126
|
class: "chat-tool-call__files"
|
|
6057
|
-
},
|
|
6127
|
+
}, tu = ["href", "onClick"], nu = {
|
|
6058
6128
|
key: 1,
|
|
6059
6129
|
class: "chat-tool-call__json"
|
|
6060
|
-
},
|
|
6130
|
+
}, ru = {
|
|
6061
6131
|
key: 1,
|
|
6062
6132
|
class: "chat-tool-call__section"
|
|
6063
|
-
},
|
|
6133
|
+
}, iu = { class: "chat-tool-call__json" }, au = { class: "chat-tool-call__body" }, ou = {
|
|
6064
6134
|
key: 0,
|
|
6065
6135
|
class: "chat-tool-call__section"
|
|
6066
|
-
},
|
|
6136
|
+
}, su = { class: "chat-tool-call__section-title" }, cu = {
|
|
6067
6137
|
key: 0,
|
|
6068
6138
|
class: "chat-tool-call__files"
|
|
6069
|
-
},
|
|
6139
|
+
}, lu = ["href", "onClick"], uu = {
|
|
6070
6140
|
key: 1,
|
|
6071
6141
|
class: "chat-tool-call__json"
|
|
6072
|
-
},
|
|
6142
|
+
}, du = {
|
|
6073
6143
|
key: 1,
|
|
6074
6144
|
class: "chat-tool-call__section"
|
|
6075
|
-
},
|
|
6145
|
+
}, fu = { class: "chat-tool-call__json" }, pu = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
6076
6146
|
__name: "ChatToolCall",
|
|
6077
6147
|
props: {
|
|
6078
6148
|
answeredClientRequestIds: {},
|
|
@@ -6091,7 +6161,7 @@ var ql = {
|
|
|
6091
6161
|
"open-link"
|
|
6092
6162
|
],
|
|
6093
6163
|
setup(e, { emit: n }) {
|
|
6094
|
-
let r = e, i = n, a = Zn(), d =
|
|
6164
|
+
let r = e, i = n, a = Zn(), d = Gl(), f = N(!1), p = Jl(), h = o(() => Cn(r.toolCall)), g = o(() => !r.toolCall.done && r.toolCall.state !== "completed"), _ = o(() => En(r.toolCall.status)), v = o(() => d({
|
|
6095
6165
|
descriptor: _.value,
|
|
6096
6166
|
...r.toolCall.kind ? { kind: r.toolCall.kind } : {},
|
|
6097
6167
|
...r.toolCall.metadata ? { metadata: r.toolCall.metadata } : {},
|
|
@@ -6114,13 +6184,13 @@ var ql = {
|
|
|
6114
6184
|
function P(e) {
|
|
6115
6185
|
return typeof e == "string" ? e : JSON.stringify(e, null, 2);
|
|
6116
6186
|
}
|
|
6117
|
-
return (n, r) => b.value ? (k(), s(
|
|
6187
|
+
return (n, r) => b.value ? (k(), s(ls, {
|
|
6118
6188
|
key: 0,
|
|
6119
6189
|
class: "codex-chat-theme",
|
|
6120
6190
|
"answered-client-request-ids": e.answeredClientRequestIds,
|
|
6121
6191
|
"tool-call": e.toolCall,
|
|
6122
6192
|
onClientResponse: r[0] ||= (e) => i("client-response", e)
|
|
6123
|
-
}, null, 8, ["answered-client-request-ids", "tool-call"])) : x.value ? (k(), s(
|
|
6193
|
+
}, null, 8, ["answered-client-request-ids", "tool-call"])) : x.value ? (k(), s(os, {
|
|
6124
6194
|
key: 1,
|
|
6125
6195
|
class: "codex-chat-theme",
|
|
6126
6196
|
"answered-client-request-ids": e.answeredClientRequestIds,
|
|
@@ -6132,7 +6202,7 @@ var ql = {
|
|
|
6132
6202
|
"chat-tool-call--open": f.value,
|
|
6133
6203
|
[`chat-tool-call--${e.toolCall.state}`]: !0
|
|
6134
6204
|
}])
|
|
6135
|
-
}, [e.summaryOnly ? (k(), l("div",
|
|
6205
|
+
}, [e.summaryOnly ? (k(), l("div", Yl, [m(Fo, {
|
|
6136
6206
|
"line-diff": E.value,
|
|
6137
6207
|
running: g.value,
|
|
6138
6208
|
title: S.value.title,
|
|
@@ -6160,7 +6230,7 @@ var ql = {
|
|
|
6160
6230
|
class: "chat-tool-call__header",
|
|
6161
6231
|
type: "button",
|
|
6162
6232
|
onClick: M
|
|
6163
|
-
}, [m(
|
|
6233
|
+
}, [m(Fo, {
|
|
6164
6234
|
"line-diff": E.value,
|
|
6165
6235
|
running: g.value,
|
|
6166
6236
|
title: S.value.title,
|
|
@@ -6182,7 +6252,7 @@ var ql = {
|
|
|
6182
6252
|
]), (k(), s(R(f.value ? H(ge) : H(me)), {
|
|
6183
6253
|
class: "chat-tool-call__chevron",
|
|
6184
6254
|
size: 15
|
|
6185
|
-
}))])) : (k(), l("div",
|
|
6255
|
+
}))])) : (k(), l("div", Xl, [m(Fo, {
|
|
6186
6256
|
"line-diff": E.value,
|
|
6187
6257
|
running: g.value,
|
|
6188
6258
|
title: S.value.title,
|
|
@@ -6201,30 +6271,30 @@ var ql = {
|
|
|
6201
6271
|
"title-target-parts",
|
|
6202
6272
|
"tool-call",
|
|
6203
6273
|
"tool-presentation"
|
|
6204
|
-
])])), e.headerless && (A.value || T.value.length) ? (k(), l("div",
|
|
6274
|
+
])])), e.headerless && (A.value || T.value.length) ? (k(), l("div", Zl, [D.value ? (k(), l("div", Ql, [u("div", $l, B(T.value.length ? "Files" : "Input"), 1), T.value.length ? (k(), l("div", eu, [(k(!0), l(t, null, F(T.value, (e) => (k(), l("a", {
|
|
6205
6275
|
key: e.href,
|
|
6206
6276
|
href: e.href,
|
|
6207
6277
|
onClick: q((t) => i("open-link", e), ["stop", "prevent"])
|
|
6208
|
-
}, B(e.path), 9,
|
|
6278
|
+
}, B(e.path), 9, tu))), 128))])) : (k(), l("pre", nu, B(P(h.value)), 1))])) : c("", !0), A.value && O.value ? (k(), l("div", ru, [r[5] ||= u("div", { class: "chat-tool-call__section-title" }, "Result", -1), u("pre", iu, B(P(e.toolCall.result)), 1)])) : c("", !0)])) : j.value ? (k(), s(pc, {
|
|
6209
6279
|
key: 4,
|
|
6210
6280
|
open: f.value
|
|
6211
6281
|
}, {
|
|
6212
|
-
default: G(() => [u("div",
|
|
6282
|
+
default: G(() => [u("div", au, [D.value ? (k(), l("div", ou, [u("div", su, B(T.value.length ? "Files" : "Input"), 1), T.value.length ? (k(), l("div", cu, [(k(!0), l(t, null, F(T.value, (e) => (k(), l("a", {
|
|
6213
6283
|
key: e.href,
|
|
6214
6284
|
href: e.href,
|
|
6215
6285
|
onClick: q((t) => i("open-link", e), ["stop", "prevent"])
|
|
6216
|
-
}, B(e.path), 9,
|
|
6286
|
+
}, B(e.path), 9, lu))), 128))])) : (k(), l("pre", uu, B(P(h.value)), 1))])) : c("", !0), A.value && O.value ? (k(), l("div", du, [r[6] ||= u("div", { class: "chat-tool-call__section-title" }, "Result", -1), u("pre", fu, B(P(e.toolCall.result)), 1)])) : c("", !0)])]),
|
|
6217
6287
|
_: 1
|
|
6218
6288
|
}, 8, ["open"])) : c("", !0)], 2));
|
|
6219
6289
|
}
|
|
6220
|
-
}), [["__scopeId", "data-v-6dba4f3e"]]),
|
|
6290
|
+
}), [["__scopeId", "data-v-6dba4f3e"]]), mu = {
|
|
6221
6291
|
key: 1,
|
|
6222
6292
|
class: "codex-chat-theme chat-tool-group"
|
|
6223
|
-
},
|
|
6293
|
+
}, hu = ["data-label"], gu = {
|
|
6224
6294
|
key: 0,
|
|
6225
6295
|
class: "chat-tool-group__diff",
|
|
6226
6296
|
"aria-label": "Total line changes"
|
|
6227
|
-
},
|
|
6297
|
+
}, _u = { class: "chat-tool-group__body" }, vu = { class: "chat-tool-group__running-item-content" }, yu = 3e3, bu = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
6228
6298
|
__name: "ChatToolGroup",
|
|
6229
6299
|
props: {
|
|
6230
6300
|
activityTitle: {},
|
|
@@ -6241,7 +6311,7 @@ var ql = {
|
|
|
6241
6311
|
"open-link"
|
|
6242
6312
|
],
|
|
6243
6313
|
setup(e, { emit: n }) {
|
|
6244
|
-
let r = e, i = n, d = N(!1), f = N(/* @__PURE__ */ new Set()), p = /* @__PURE__ */ new Map(), h = new Set(r.toolCalls.filter(L).map((e) => e.id)), g =
|
|
6314
|
+
let r = e, i = n, d = N(!1), f = N(/* @__PURE__ */ new Set()), p = /* @__PURE__ */ new Map(), h = new Set(r.toolCalls.filter(L).map((e) => e.id)), g = Jl(), _ = o(() => r.showToolDetails ?? g.value), v = o(() => r.toolCalls.length === 1), y = o(() => {
|
|
6245
6315
|
if (!(!v.value || !r.toolCalls[0] || !ee(r.toolCalls[0]))) return r.toolCalls[0];
|
|
6246
6316
|
}), b = o(() => r.toolCalls.filter((e) => !L(e))), x = o(() => !r.activityTitle && v.value && b.value.length === 1 ? r.toolCalls[0] : void 0), S = o(() => r.toolCalls.filter((e) => L(e) || !d.value && f.value.has(e.id) && x.value?.id !== e.id)), w = N(S.value.length > 0), T = o(() => On(r.toolCalls)), D = o(() => !!r.activityTitle || r.toolCalls.length > 1 || _.value && r.toolCalls.some(z)), O = o(() => {
|
|
6247
6317
|
if (b.value.length > 0) {
|
|
@@ -6276,7 +6346,7 @@ var ql = {
|
|
|
6276
6346
|
return `${e} ${e === 1 ? "action" : "actions"}`;
|
|
6277
6347
|
}
|
|
6278
6348
|
function M(e) {
|
|
6279
|
-
f.value = new Set(f.value).add(e), p.set(e, setTimeout(() => P(e),
|
|
6349
|
+
f.value = new Set(f.value).add(e), p.set(e, setTimeout(() => P(e), yu));
|
|
6280
6350
|
}
|
|
6281
6351
|
function P(e) {
|
|
6282
6352
|
let t = p.get(e);
|
|
@@ -6297,21 +6367,21 @@ var ql = {
|
|
|
6297
6367
|
function z(e) {
|
|
6298
6368
|
return Cn(e) !== void 0 || e.result !== void 0 && e.result !== null;
|
|
6299
6369
|
}
|
|
6300
|
-
return (n, o) => y.value ? (k(), s(
|
|
6370
|
+
return (n, o) => y.value ? (k(), s(pu, {
|
|
6301
6371
|
key: 0,
|
|
6302
6372
|
"answered-client-request-ids": e.answeredClientRequestIds,
|
|
6303
6373
|
"tool-call": y.value,
|
|
6304
6374
|
onCancel: o[0] ||= (e) => i("cancel"),
|
|
6305
6375
|
onClientResponse: o[1] ||= (e) => i("client-response", e),
|
|
6306
6376
|
onOpenLink: o[2] ||= (e) => i("open-link", e)
|
|
6307
|
-
}, null, 8, ["answered-client-request-ids", "tool-call"])) : (k(), l("section",
|
|
6377
|
+
}, null, 8, ["answered-client-request-ids", "tool-call"])) : (k(), l("section", mu, [
|
|
6308
6378
|
r.toolCalls.length === 0 || x.value || b.value.length > 0 ? (k(), s(R(D.value ? "button" : "div"), {
|
|
6309
6379
|
key: 0,
|
|
6310
6380
|
class: C(["chat-tool-group__header", { "chat-tool-group__header--static": !D.value }]),
|
|
6311
6381
|
type: D.value ? "button" : void 0,
|
|
6312
6382
|
onClick: A
|
|
6313
6383
|
}, {
|
|
6314
|
-
default: G(() => [x.value ? (k(), s(
|
|
6384
|
+
default: G(() => [x.value ? (k(), s(pu, {
|
|
6315
6385
|
key: 0,
|
|
6316
6386
|
class: "chat-tool-group__active",
|
|
6317
6387
|
"summary-only": "",
|
|
@@ -6331,13 +6401,13 @@ var ql = {
|
|
|
6331
6401
|
u("span", {
|
|
6332
6402
|
class: "chat-tool-group__title",
|
|
6333
6403
|
"data-label": O.value
|
|
6334
|
-
}, B(O.value), 9,
|
|
6335
|
-
T.value ? (k(), l("span",
|
|
6404
|
+
}, B(O.value), 9, hu),
|
|
6405
|
+
T.value ? (k(), l("span", gu, [T.value.addedLines ? (k(), s(So, {
|
|
6336
6406
|
key: 0,
|
|
6337
6407
|
kind: "added",
|
|
6338
6408
|
label: "Total added lines",
|
|
6339
6409
|
value: T.value.addedLines
|
|
6340
|
-
}, null, 8, ["value"])) : c("", !0), T.value.removedLines ? (k(), s(
|
|
6410
|
+
}, null, 8, ["value"])) : c("", !0), T.value.removedLines ? (k(), s(So, {
|
|
6341
6411
|
key: 1,
|
|
6342
6412
|
kind: "deleted",
|
|
6343
6413
|
label: "Total removed lines",
|
|
@@ -6351,8 +6421,8 @@ var ql = {
|
|
|
6351
6421
|
], 64))]),
|
|
6352
6422
|
_: 1
|
|
6353
6423
|
}, 8, ["class", "type"])) : c("", !0),
|
|
6354
|
-
m(
|
|
6355
|
-
default: G(() => [u("div",
|
|
6424
|
+
m(pc, { open: d.value }, {
|
|
6425
|
+
default: G(() => [u("div", _u, [(k(!0), l(t, null, F(b.value, (t) => (k(), s(pu, {
|
|
6356
6426
|
key: t.id,
|
|
6357
6427
|
"answered-client-request-ids": e.answeredClientRequestIds,
|
|
6358
6428
|
headerless: v.value,
|
|
@@ -6380,7 +6450,7 @@ var ql = {
|
|
|
6380
6450
|
default: G(() => [(k(!0), l(t, null, F(S.value, (t) => (k(), l("div", {
|
|
6381
6451
|
key: t.id,
|
|
6382
6452
|
class: "chat-tool-group__running-item"
|
|
6383
|
-
}, [u("div",
|
|
6453
|
+
}, [u("div", vu, [m(pu, {
|
|
6384
6454
|
class: "chat-tool-group__active",
|
|
6385
6455
|
"summary-only": !_.value,
|
|
6386
6456
|
"answered-client-request-ids": e.answeredClientRequestIds,
|
|
@@ -6402,8 +6472,8 @@ var ql = {
|
|
|
6402
6472
|
}), [["__scopeId", "data-v-7a9a4bb4"]]);
|
|
6403
6473
|
//#endregion
|
|
6404
6474
|
//#region src/chat/user-text.ts
|
|
6405
|
-
function
|
|
6406
|
-
return t === void 0 ?
|
|
6475
|
+
function xu(e, t, n = [], r = [], i = []) {
|
|
6476
|
+
return t === void 0 ? Cu(e, n, r, i, !1) : J(t).flatMap((e) => e.type === "text" ? e.text.split(/(`[^`\n]+`|\n)/g).filter(Boolean).map((e) => e === "\n" ? { type: "line-break" } : e.startsWith("`") && e.endsWith("`") ? {
|
|
6407
6477
|
type: "code",
|
|
6408
6478
|
text: e.slice(1, -1)
|
|
6409
6479
|
} : {
|
|
@@ -6426,9 +6496,9 @@ function yu(e, t, n = [], r = [], i = []) {
|
|
|
6426
6496
|
displayName: e.label,
|
|
6427
6497
|
label: e.label,
|
|
6428
6498
|
href: e.id
|
|
6429
|
-
}] : [
|
|
6499
|
+
}] : [Su(e, i)]);
|
|
6430
6500
|
}
|
|
6431
|
-
function
|
|
6501
|
+
function Su(e, t) {
|
|
6432
6502
|
let n = t.find((t) => t.id === e.groupId), r = n?.items.find((t) => t.id === e.id);
|
|
6433
6503
|
return {
|
|
6434
6504
|
type: "custom-mention",
|
|
@@ -6447,19 +6517,19 @@ function bu(e, t) {
|
|
|
6447
6517
|
}
|
|
6448
6518
|
};
|
|
6449
6519
|
}
|
|
6450
|
-
function
|
|
6520
|
+
function Cu(e, t = [], n = [], r = [], i = !0) {
|
|
6451
6521
|
let a = [], o = 0;
|
|
6452
|
-
for (let s of e.matchAll(
|
|
6522
|
+
for (let s of e.matchAll(Au())) {
|
|
6453
6523
|
let c = s.index ?? 0;
|
|
6454
6524
|
c > o && a.push({
|
|
6455
6525
|
type: "text",
|
|
6456
6526
|
text: e.slice(o, c)
|
|
6457
6527
|
});
|
|
6458
6528
|
let l = s[0], u = s[1], d = s[2], f = s[3], p = s[4], m = s[5];
|
|
6459
|
-
u === void 0 ? d === void 0 ? p === void 0 ? a.push({ type: "line-break" }) : a.push((i ?
|
|
6529
|
+
u === void 0 ? d === void 0 ? p === void 0 ? a.push({ type: "line-break" }) : a.push((i ? wu(p, m, t, n, r) : null) ?? {
|
|
6460
6530
|
type: "text",
|
|
6461
6531
|
text: l
|
|
6462
|
-
}) : a.push(
|
|
6532
|
+
}) : a.push(Tu(d, f, t, n, r) ?? {
|
|
6463
6533
|
type: "text",
|
|
6464
6534
|
text: l
|
|
6465
6535
|
}) : a.push({
|
|
@@ -6472,26 +6542,26 @@ function xu(e, t = [], n = [], r = [], i = !0) {
|
|
|
6472
6542
|
text: e.slice(o)
|
|
6473
6543
|
}), a;
|
|
6474
6544
|
}
|
|
6475
|
-
function
|
|
6545
|
+
function wu(e, t, n, r, i) {
|
|
6476
6546
|
if (e === "$") {
|
|
6477
|
-
let i = r.find((e) =>
|
|
6547
|
+
let i = r.find((e) => Ir(e, t));
|
|
6478
6548
|
if (i) return {
|
|
6479
6549
|
type: "skill-mention",
|
|
6480
|
-
displayName:
|
|
6550
|
+
displayName: Nr(i, n),
|
|
6481
6551
|
href: i.path,
|
|
6482
6552
|
label: `${e}${t}`,
|
|
6483
6553
|
skill: i
|
|
6484
6554
|
};
|
|
6485
6555
|
}
|
|
6486
6556
|
if (e !== "@") return null;
|
|
6487
|
-
let a =
|
|
6557
|
+
let a = pi(i.filter((e) => e.placement !== "after"), t);
|
|
6488
6558
|
if (a) return {
|
|
6489
6559
|
type: "custom-mention",
|
|
6490
6560
|
displayName: a.item.label,
|
|
6491
6561
|
label: `${e}${t}`,
|
|
6492
6562
|
...a
|
|
6493
6563
|
};
|
|
6494
|
-
let o = n.find((e) =>
|
|
6564
|
+
let o = n.find((e) => yr(e, t));
|
|
6495
6565
|
if (o) return {
|
|
6496
6566
|
type: "plugin-mention",
|
|
6497
6567
|
displayName: o.displayName || o.name,
|
|
@@ -6499,7 +6569,7 @@ function Su(e, t, n, r, i) {
|
|
|
6499
6569
|
label: `${e}${t}`,
|
|
6500
6570
|
plugin: o
|
|
6501
6571
|
};
|
|
6502
|
-
let s =
|
|
6572
|
+
let s = pi(i, t);
|
|
6503
6573
|
return s ? {
|
|
6504
6574
|
type: "custom-mention",
|
|
6505
6575
|
displayName: s.item.label,
|
|
@@ -6507,13 +6577,13 @@ function Su(e, t, n, r, i) {
|
|
|
6507
6577
|
...s
|
|
6508
6578
|
} : null;
|
|
6509
6579
|
}
|
|
6510
|
-
function
|
|
6511
|
-
let a = e.trim().replace(/\\([\\[\]])/g, "$1"), o =
|
|
6580
|
+
function Tu(e, t, n, r, i) {
|
|
6581
|
+
let a = e.trim().replace(/\\([\\[\]])/g, "$1"), o = Eu(t);
|
|
6512
6582
|
if (a.startsWith("@") && o.startsWith("mention://")) try {
|
|
6513
6583
|
let e = /^mention:\/\/([^/]+)\/([^?]+)\?value=(.+)$/.exec(o);
|
|
6514
6584
|
if (!e) return null;
|
|
6515
6585
|
let [t, n, r] = e.slice(1).map((e) => decodeURIComponent(e));
|
|
6516
|
-
return !t || !n || !r || a.length === 1 ? null :
|
|
6586
|
+
return !t || !n || !r || a.length === 1 ? null : Su({
|
|
6517
6587
|
type: "mention",
|
|
6518
6588
|
kind: "custom",
|
|
6519
6589
|
groupId: t,
|
|
@@ -6525,24 +6595,24 @@ function Cu(e, t, n, r, i) {
|
|
|
6525
6595
|
return null;
|
|
6526
6596
|
}
|
|
6527
6597
|
if (a.startsWith("@") && o.startsWith("plugin://")) {
|
|
6528
|
-
let e =
|
|
6598
|
+
let e = Ou(o.slice(9));
|
|
6529
6599
|
if (!e) return null;
|
|
6530
6600
|
let t = n.find((t) => t.id === e), r = a.slice(1) || e.split("@")[0];
|
|
6531
6601
|
return {
|
|
6532
6602
|
type: "plugin-mention",
|
|
6533
|
-
displayName: t?.displayName ||
|
|
6603
|
+
displayName: t?.displayName || ku(r, "App"),
|
|
6534
6604
|
href: o,
|
|
6535
6605
|
label: a,
|
|
6536
6606
|
...t ? { plugin: t } : {}
|
|
6537
6607
|
};
|
|
6538
6608
|
}
|
|
6539
6609
|
if (a.startsWith("$")) {
|
|
6540
|
-
let e =
|
|
6610
|
+
let e = Du(o);
|
|
6541
6611
|
if (!e) return null;
|
|
6542
6612
|
let t = r.find((t) => t.path === e);
|
|
6543
6613
|
return {
|
|
6544
6614
|
type: "skill-mention",
|
|
6545
|
-
displayName: t ?
|
|
6615
|
+
displayName: t ? Nr(t, n) : ku(a, "Skill"),
|
|
6546
6616
|
href: o,
|
|
6547
6617
|
label: a,
|
|
6548
6618
|
...t ? { skill: t } : {}
|
|
@@ -6550,12 +6620,12 @@ function Cu(e, t, n, r, i) {
|
|
|
6550
6620
|
}
|
|
6551
6621
|
return null;
|
|
6552
6622
|
}
|
|
6553
|
-
function
|
|
6623
|
+
function Eu(e) {
|
|
6554
6624
|
let t = e.trim();
|
|
6555
6625
|
return t.startsWith("<") && t.endsWith(">") ? t.slice(1, -1).trim() : t;
|
|
6556
6626
|
}
|
|
6557
|
-
function
|
|
6558
|
-
let t = e.split(/[?#]/, 1)[0], n =
|
|
6627
|
+
function Du(e) {
|
|
6628
|
+
let t = e.split(/[?#]/, 1)[0], n = Ou(t);
|
|
6559
6629
|
if (n.startsWith("file://")) try {
|
|
6560
6630
|
n = decodeURIComponent(new URL(n).pathname);
|
|
6561
6631
|
} catch {
|
|
@@ -6563,26 +6633,26 @@ function Tu(e) {
|
|
|
6563
6633
|
}
|
|
6564
6634
|
return /(?:^|[\\/])SKILL\.md$/i.test(n) ? n : null;
|
|
6565
6635
|
}
|
|
6566
|
-
function
|
|
6636
|
+
function Ou(e) {
|
|
6567
6637
|
try {
|
|
6568
6638
|
return decodeURIComponent(e);
|
|
6569
6639
|
} catch {
|
|
6570
6640
|
return e;
|
|
6571
6641
|
}
|
|
6572
6642
|
}
|
|
6573
|
-
function
|
|
6643
|
+
function ku(e, t) {
|
|
6574
6644
|
let n = e.trim().replace(/^[@$]/, "");
|
|
6575
|
-
return !n ||
|
|
6645
|
+
return !n || ju(n) ? t : n.split(/[-_:\s]/).filter(Boolean).map((e) => `${e.charAt(0).toUpperCase()}${e.slice(1)}`).join(" ");
|
|
6576
6646
|
}
|
|
6577
|
-
function
|
|
6647
|
+
function Au() {
|
|
6578
6648
|
return /`([^`\n]+)`|\[((?:\\.|[^\]\\\n])+)\]\(([^)\n]+)\)|(?<![\w.%+-])([$@/])([A-Za-z0-9_.:-]+(?:[ \t]+\([A-Za-z0-9_.-]+\))?)|(\n)/g;
|
|
6579
6649
|
}
|
|
6580
|
-
function
|
|
6650
|
+
function ju(e) {
|
|
6581
6651
|
return /^app[-_]?[a-f\d]{16,}$/i.test(e);
|
|
6582
6652
|
}
|
|
6583
6653
|
//#endregion
|
|
6584
6654
|
//#region src/chat/ChatUserText.vue?vue&type=script&setup=true&lang.ts
|
|
6585
|
-
var
|
|
6655
|
+
var Mu = { class: "codex-chat-theme chat-user-text codex-markdown" }, Nu = { key: 0 }, Pu = { key: 1 }, Fu = { key: 2 }, Iu = ["src", "onError"], Lu = ["src", "onError"], Ru = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
6586
6656
|
__name: "ChatUserText",
|
|
6587
6657
|
props: {
|
|
6588
6658
|
content: {},
|
|
@@ -6592,7 +6662,7 @@ var Au = { class: "codex-chat-theme chat-user-text codex-markdown" }, ju = { key
|
|
|
6592
6662
|
skills: { default: () => [] }
|
|
6593
6663
|
},
|
|
6594
6664
|
setup(e) {
|
|
6595
|
-
let n = e, r = j(/* @__PURE__ */ new Set()), i = o(() =>
|
|
6665
|
+
let n = e, r = j(/* @__PURE__ */ new Set()), i = o(() => xu(n.content, n.promptContent, n.plugins, n.skills, n.mentionGroups));
|
|
6596
6666
|
function a(e, t) {
|
|
6597
6667
|
let n = e.type === "plugin-mention" ? t === "dark" && e.plugin?.iconUrlDark !== e.plugin?.iconUrl ? e.plugin?.iconUrlDark : t === "light" ? e.plugin?.iconUrl : void 0 : t === "light" ? e.skill?.iconSmall : void 0;
|
|
6598
6668
|
return !n || r.has(n) ? null : n.startsWith("blob:") || n.startsWith("https://") || /^data:image\/(?:avif|bmp|gif|jpeg|png|svg\+xml|webp|x-icon);base64,/i.test(n) ? n : null;
|
|
@@ -6600,7 +6670,7 @@ var Au = { class: "codex-chat-theme chat-user-text codex-markdown" }, ju = { key
|
|
|
6600
6670
|
function d(e) {
|
|
6601
6671
|
return e.type === "plugin-mention" ? e.plugin?.shortDescription || e.displayName : e.skill?.shortDescription || e.skill?.description || e.displayName;
|
|
6602
6672
|
}
|
|
6603
|
-
return (e, n) => (k(), l("div",
|
|
6673
|
+
return (e, n) => (k(), l("div", Mu, [u("p", null, [(k(!0), l(t, null, F(i.value, (n, i) => (k(), l(t, { key: `${n.type}-${i}` }, [n.type === "text" ? (k(), l("span", Nu, B(n.text), 1)) : n.type === "code" ? (k(), l("code", Pu, B(n.text), 1)) : n.type === "line-break" ? (k(), l("br", Fu)) : n.type === "file-mention" ? (k(), s(di, {
|
|
6604
6674
|
key: 3,
|
|
6605
6675
|
kind: "file",
|
|
6606
6676
|
name: n.displayName,
|
|
@@ -6611,12 +6681,12 @@ var Au = { class: "codex-chat-theme chat-user-text codex-markdown" }, ju = { key
|
|
|
6611
6681
|
item: n.item,
|
|
6612
6682
|
token: n,
|
|
6613
6683
|
surface: "message"
|
|
6614
|
-
}, () => [m(
|
|
6684
|
+
}, () => [m(di, {
|
|
6615
6685
|
kind: "plugin",
|
|
6616
6686
|
name: n.displayName,
|
|
6617
6687
|
class: "chat-user-text__mention chat-user-text__mention--custom",
|
|
6618
6688
|
title: n.item.description || n.displayName
|
|
6619
|
-
}, null, 8, ["name", "title"])], !0, 4) : (k(), s(
|
|
6689
|
+
}, null, 8, ["name", "title"])], !0, 4) : (k(), s(di, {
|
|
6620
6690
|
key: 5,
|
|
6621
6691
|
kind: n.type === "plugin-mention" ? "plugin" : "skill",
|
|
6622
6692
|
name: n.displayName,
|
|
@@ -6637,7 +6707,7 @@ var Au = { class: "codex-chat-theme chat-user-text codex-markdown" }, ju = { key
|
|
|
6637
6707
|
loading: "lazy",
|
|
6638
6708
|
referrerpolicy: "no-referrer",
|
|
6639
6709
|
onError: (e) => r.add(a(n, "light"))
|
|
6640
|
-
}, null, 40,
|
|
6710
|
+
}, null, 40, Iu)) : c("", !0),
|
|
6641
6711
|
a(n, "dark") ? (k(), l("img", {
|
|
6642
6712
|
key: 1,
|
|
6643
6713
|
class: "chat-user-text__mention-image chat-user-text__mention-image--dark",
|
|
@@ -6648,7 +6718,7 @@ var Au = { class: "codex-chat-theme chat-user-text codex-markdown" }, ju = { key
|
|
|
6648
6718
|
loading: "lazy",
|
|
6649
6719
|
referrerpolicy: "no-referrer",
|
|
6650
6720
|
onError: (e) => r.add(a(n, "dark"))
|
|
6651
|
-
}, null, 40,
|
|
6721
|
+
}, null, 40, Lu)) : c("", !0),
|
|
6652
6722
|
n.type === "plugin-mention" ? (k(), s(H(Ie), {
|
|
6653
6723
|
key: 2,
|
|
6654
6724
|
class: "chat-user-text__mention-icon",
|
|
@@ -6667,10 +6737,10 @@ var Au = { class: "codex-chat-theme chat-user-text codex-markdown" }, ju = { key
|
|
|
6667
6737
|
"title"
|
|
6668
6738
|
]))], 64))), 128))])]));
|
|
6669
6739
|
}
|
|
6670
|
-
}), [["__scopeId", "data-v-afd01e4c"]]),
|
|
6740
|
+
}), [["__scopeId", "data-v-afd01e4c"]]), zu = {
|
|
6671
6741
|
key: 1,
|
|
6672
6742
|
class: "codex-chat-theme chat-visualization-block"
|
|
6673
|
-
},
|
|
6743
|
+
}, Bu = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
6674
6744
|
__name: "ChatVisualizationBlock",
|
|
6675
6745
|
props: {
|
|
6676
6746
|
path: {},
|
|
@@ -6694,28 +6764,31 @@ var Au = { class: "codex-chat-theme chat-user-text codex-markdown" }, ju = { key
|
|
|
6694
6764
|
m(H(De), { class: "chat-visualization-block__icon" }),
|
|
6695
6765
|
u("span", null, B(e.title), 1),
|
|
6696
6766
|
m(H(xe), { class: "chat-visualization-block__open" })
|
|
6697
|
-
])) : (k(), l("div",
|
|
6767
|
+
])) : (k(), l("div", zu, [m(H(De), { class: "chat-visualization-block__icon" }), u("span", null, B(e.title), 1)]));
|
|
6698
6768
|
}
|
|
6699
6769
|
}), [["__scopeId", "data-v-6aa2f6f0"]]);
|
|
6700
6770
|
//#endregion
|
|
6701
6771
|
//#region src/chat/work-duration.ts
|
|
6702
|
-
function
|
|
6772
|
+
function Vu(e) {
|
|
6703
6773
|
if (e == null || !Number.isFinite(e) || e < 1e3) return "";
|
|
6704
6774
|
let t = Math.floor(e / 1e3), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
|
|
6705
6775
|
return n > 0 ? r > 0 ? `${n}h ${r}m` : `${n}h` : r > 0 ? i > 0 ? `${r}m ${i}s` : `${r}m` : `${i}s`;
|
|
6706
6776
|
}
|
|
6707
6777
|
//#endregion
|
|
6708
6778
|
//#region src/chat/ChatWorkGroup.vue?vue&type=script&setup=true&lang.ts
|
|
6709
|
-
var
|
|
6779
|
+
var Hu = {
|
|
6780
|
+
key: 0,
|
|
6781
|
+
class: "chat-work-group__header"
|
|
6782
|
+
}, Uu = { class: "chat-work-group__title" }, Wu = ["aria-expanded", "disabled"], Gu = ["data-label"], Ku = { class: "chat-work-group__body" }, qu = {
|
|
6710
6783
|
key: 0,
|
|
6711
6784
|
role: "status"
|
|
6712
|
-
},
|
|
6785
|
+
}, Ju = {
|
|
6713
6786
|
key: 1,
|
|
6714
6787
|
role: "alert"
|
|
6715
|
-
},
|
|
6716
|
-
key:
|
|
6788
|
+
}, Yu = {
|
|
6789
|
+
key: 3,
|
|
6717
6790
|
class: "chat-work-group__body chat-work-group__body--continuation"
|
|
6718
|
-
},
|
|
6791
|
+
}, Xu = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
6719
6792
|
__name: "ChatWorkGroup",
|
|
6720
6793
|
props: {
|
|
6721
6794
|
active: { type: Boolean },
|
|
@@ -6723,21 +6796,22 @@ var Bu = ["aria-expanded", "disabled"], Vu = ["data-label"], Hu = { class: "chat
|
|
|
6723
6796
|
finalStarted: { type: Boolean }
|
|
6724
6797
|
},
|
|
6725
6798
|
setup(e) {
|
|
6726
|
-
let t = e, n = Zn(), r = b(
|
|
6799
|
+
let t = e, n = Zn(), r = b(_o, void 0), i = b(vo, void 0), a = o(() => r?.enabled.value === !0 && i !== void 0), d = o(() => a.value ? r.completedWithoutFinal.value : !t.active && !t.finalStarted), f = N(t.active && !t.finalStarted), m = N(!1), h = o(() => a.value ? r.active.value : t.active && !t.finalStarted), g = o(() => !a.value || h.value || r.hasDetails?.value !== !1), _ = o(() => h.value || d.value ? !0 : a.value ? r.expanded.value : f.value), v = o(() => !t.continuation && !d.value && (!a.value || r.headerMessageIndex.value === i.value)), y = N(Date.now()), x;
|
|
6727
6800
|
W(h, (e) => {
|
|
6728
|
-
clearInterval(
|
|
6729
|
-
|
|
6801
|
+
clearInterval(x), x = void 0, e && (y.value = Date.now(), x = setInterval(() => {
|
|
6802
|
+
y.value = Date.now();
|
|
6730
6803
|
}, 1e3));
|
|
6731
|
-
}, { immediate: !0 }), O(() => clearInterval(
|
|
6732
|
-
let
|
|
6804
|
+
}, { immediate: !0 }), O(() => clearInterval(x));
|
|
6805
|
+
let S = o(() => {
|
|
6733
6806
|
if (!a.value) return "";
|
|
6734
|
-
if (!h.value) return
|
|
6807
|
+
if (!h.value) return Vu(r.durationMs?.value);
|
|
6735
6808
|
let e = r.startedAt?.value;
|
|
6736
|
-
return e ?
|
|
6737
|
-
}),
|
|
6738
|
-
let e = { duration:
|
|
6809
|
+
return e ? Vu(y.value - Date.parse(e)) : "";
|
|
6810
|
+
}), w = o(() => {
|
|
6811
|
+
let e = { duration: S.value }, t = S.value !== "", i = h.value ? "working" : r?.status.value === "interrupted" ? "stopped" : r?.status.value === "failed" ? "failed" : "done";
|
|
6739
6812
|
if (i === "working") return n(t ? "chat.work.workingFor" : "chat.work.working", e);
|
|
6740
|
-
|
|
6813
|
+
if (!g.value) return n(`chat.work.${i}${t ? "For" : ""}`, e);
|
|
6814
|
+
let a = _.value ? "HideDetails" : "ViewDetails";
|
|
6741
6815
|
return n(`chat.work.${i}${a}${t ? "For" : ""}`, e);
|
|
6742
6816
|
});
|
|
6743
6817
|
W(() => t.finalStarted, (e, t) => {
|
|
@@ -6745,7 +6819,7 @@ var Bu = ["aria-expanded", "disabled"], Vu = ["data-label"], Hu = { class: "chat
|
|
|
6745
6819
|
}), W(() => t.active, (e) => {
|
|
6746
6820
|
!a.value && !m.value && (f.value = e && !t.finalStarted);
|
|
6747
6821
|
});
|
|
6748
|
-
function
|
|
6822
|
+
function T() {
|
|
6749
6823
|
if (!h.value) {
|
|
6750
6824
|
if (a.value) {
|
|
6751
6825
|
r.toggle();
|
|
@@ -6754,34 +6828,34 @@ var Bu = ["aria-expanded", "disabled"], Vu = ["data-label"], Hu = { class: "chat
|
|
|
6754
6828
|
m.value = !0, f.value = !f.value;
|
|
6755
6829
|
}
|
|
6756
6830
|
}
|
|
6757
|
-
return (e, t) =>
|
|
6758
|
-
key: 0,
|
|
6759
|
-
class: C(["codex-chat-theme chat-work-group", { "chat-work-group--continuation": !_.value }])
|
|
6760
|
-
}, [_.value ? (k(), l("button", {
|
|
6831
|
+
return (e, t) => v.value || _.value ? (k(), l("section", {
|
|
6761
6832
|
key: 0,
|
|
6833
|
+
class: C(["codex-chat-theme chat-work-group", { "chat-work-group--continuation": !v.value }])
|
|
6834
|
+
}, [v.value && !g.value ? (k(), l("div", Hu, [u("span", Uu, B(w.value), 1)])) : v.value ? (k(), l("button", {
|
|
6835
|
+
key: 1,
|
|
6762
6836
|
type: "button",
|
|
6763
6837
|
class: "chat-work-group__header",
|
|
6764
|
-
"aria-expanded":
|
|
6838
|
+
"aria-expanded": _.value,
|
|
6765
6839
|
disabled: h.value,
|
|
6766
|
-
onClick:
|
|
6840
|
+
onClick: T
|
|
6767
6841
|
}, [u("span", {
|
|
6768
6842
|
class: C(["chat-work-group__title", { "codex-text-shimmer": h.value }]),
|
|
6769
|
-
"data-label":
|
|
6770
|
-
}, B(
|
|
6843
|
+
"data-label": w.value
|
|
6844
|
+
}, B(w.value), 11, Gu), h.value ? c("", !0) : (k(), s(R(_.value ? H(me) : H(he)), {
|
|
6771
6845
|
key: 0,
|
|
6772
6846
|
size: 15
|
|
6773
|
-
}))], 8,
|
|
6774
|
-
key:
|
|
6775
|
-
open:
|
|
6847
|
+
}))], 8, Wu)) : c("", !0), v.value && g.value ? (k(), s(pc, {
|
|
6848
|
+
key: 2,
|
|
6849
|
+
open: _.value
|
|
6776
6850
|
}, {
|
|
6777
|
-
default: G(() => [u("div",
|
|
6851
|
+
default: G(() => [u("div", Ku, [H(r)?.detailsLoading?.value ? (k(), l("p", qu, B(H(n)("chat.work.loadingDetails")), 1)) : H(r)?.detailsError?.value ? (k(), l("div", Ju, [p(B(H(r).detailsError.value) + " ", 1), u("button", {
|
|
6778
6852
|
type: "button",
|
|
6779
6853
|
onClick: t[0] ||= (e) => H(r).reloadDetails?.()
|
|
6780
6854
|
}, B(H(n)("chat.actions.retry")), 1)])) : I(e.$slots, "default", {}, void 0, !0, 2)])]),
|
|
6781
6855
|
_: 3
|
|
6782
|
-
}, 8, ["open"])) : (k(), l("div",
|
|
6856
|
+
}, 8, ["open"])) : _.value && g.value ? (k(), l("div", Yu, [I(e.$slots, "default", {}, void 0, !0)])) : c("", !0)], 2)) : c("", !0);
|
|
6783
6857
|
}
|
|
6784
|
-
}), [["__scopeId", "data-v-
|
|
6858
|
+
}), [["__scopeId", "data-v-dd1605b0"]]), Zu = ["innerHTML"], Qu = ["innerHTML"], $u = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
6785
6859
|
__name: "ChatMessageBlock",
|
|
6786
6860
|
props: {
|
|
6787
6861
|
block: {},
|
|
@@ -6804,13 +6878,13 @@ var Bu = ["aria-expanded", "disabled"], Vu = ["data-label"], Hu = { class: "chat
|
|
|
6804
6878
|
"send-follow-up"
|
|
6805
6879
|
],
|
|
6806
6880
|
setup(e, { emit: n }) {
|
|
6807
|
-
let r = e, i = n, a = Zn(), f =
|
|
6881
|
+
let r = e, i = n, a = Zn(), f = Li(), p = o(() => r.block.type === "text" || r.block.type === "reasoning" ? ll(r.block.content, { codeCopyLabel: a("chat.code.copy") }) : ""), h = /* @__PURE__ */ new Map();
|
|
6808
6882
|
async function g(e) {
|
|
6809
6883
|
let t = (e.target instanceof Element ? e.target : null)?.closest("[data-chat-code-copy]");
|
|
6810
6884
|
if (!t) return;
|
|
6811
6885
|
let n = t.closest(".chat-code-block")?.querySelector("pre code")?.textContent;
|
|
6812
6886
|
if (n === void 0) return;
|
|
6813
|
-
await
|
|
6887
|
+
await Dl(n, f), t.dataset.copied = "true", t.setAttribute("aria-label", a("chat.code.copied")), t.title = a("chat.code.copied");
|
|
6814
6888
|
let r = h.get(t);
|
|
6815
6889
|
clearTimeout(r), h.set(t, setTimeout(() => {
|
|
6816
6890
|
t.removeAttribute("data-copied"), t.setAttribute("aria-label", a("chat.code.copy")), t.title = a("chat.code.copy"), h.delete(t);
|
|
@@ -6824,7 +6898,7 @@ var Bu = ["aria-expanded", "disabled"], Vu = ["data-label"], Hu = { class: "chat
|
|
|
6824
6898
|
return e.block.type === "user-text" ? I(n.$slots, "text", {
|
|
6825
6899
|
block: e.block,
|
|
6826
6900
|
content: e.block.content
|
|
6827
|
-
}, () => [m(
|
|
6901
|
+
}, () => [m(Ru, {
|
|
6828
6902
|
class: "chat-message-block chat-message-block--text",
|
|
6829
6903
|
content: e.block.content,
|
|
6830
6904
|
"prompt-content": e.block.promptContent,
|
|
@@ -6849,12 +6923,12 @@ var Bu = ["aria-expanded", "disabled"], Vu = ["data-label"], Hu = { class: "chat
|
|
|
6849
6923
|
class: "codex-chat-theme chat-message-block chat-message-block--text codex-markdown",
|
|
6850
6924
|
innerHTML: p.value,
|
|
6851
6925
|
onClick: g
|
|
6852
|
-
}, null, 8,
|
|
6926
|
+
}, null, 8, Zu)], !0, 1) : e.block.type === "reasoning" ? (k(), l("div", {
|
|
6853
6927
|
key: 2,
|
|
6854
6928
|
class: "codex-chat-theme chat-message-block chat-message-block--reasoning codex-markdown",
|
|
6855
6929
|
innerHTML: p.value,
|
|
6856
6930
|
onClick: g
|
|
6857
|
-
}, null, 8,
|
|
6931
|
+
}, null, 8, Qu)) : e.block.type === "html" ? (k(), s(Vl, {
|
|
6858
6932
|
key: 3,
|
|
6859
6933
|
source: e.block.source,
|
|
6860
6934
|
title: e.block.title,
|
|
@@ -6866,17 +6940,17 @@ var Bu = ["aria-expanded", "disabled"], Vu = ["data-label"], Hu = { class: "chat
|
|
|
6866
6940
|
])) : e.block.type === "mermaid" ? I(n.$slots, "mermaid", {
|
|
6867
6941
|
block: e.block,
|
|
6868
6942
|
code: e.block.code
|
|
6869
|
-
}, () => [m(
|
|
6943
|
+
}, () => [m(Wc, { code: e.block.code }, null, 8, ["code"])], !0, 4) : e.block.type === "visualization" ? I(n.$slots, "visualization", { block: e.block }, () => [m(Bu, {
|
|
6870
6944
|
path: e.block.path,
|
|
6871
6945
|
title: e.block.title,
|
|
6872
6946
|
onOpenVisualization: r[0] ||= (e) => i("open-visualization", e)
|
|
6873
6947
|
}, null, 8, ["path", "title"])], !0, 5) : e.block.type === "media" ? I(n.$slots, "media", {
|
|
6874
6948
|
block: e.block,
|
|
6875
6949
|
media: e.block.media
|
|
6876
|
-
}, () => [m(
|
|
6950
|
+
}, () => [m(kc, {
|
|
6877
6951
|
media: e.block.media,
|
|
6878
6952
|
"open-image": e.openImage
|
|
6879
|
-
}, null, 8, ["media", "open-image"])], !0, 6) : e.block.type === "question" ? (k(), s(
|
|
6953
|
+
}, null, 8, ["media", "open-image"])], !0, 6) : e.block.type === "question" ? (k(), s(ss, {
|
|
6880
6954
|
key: 7,
|
|
6881
6955
|
historical: e.block.historical,
|
|
6882
6956
|
"answered-client-request-ids": e.answeredClientRequestIds,
|
|
@@ -6889,13 +6963,13 @@ var Bu = ["aria-expanded", "disabled"], Vu = ["data-label"], Hu = { class: "chat
|
|
|
6889
6963
|
])) : e.block.type === "attachment" ? I(n.$slots, "attachment", {
|
|
6890
6964
|
attachment: e.block.attachment,
|
|
6891
6965
|
block: e.block
|
|
6892
|
-
}, () => [m(
|
|
6966
|
+
}, () => [m(sc, {
|
|
6893
6967
|
attachment: e.block.attachment,
|
|
6894
6968
|
"open-image": e.openImage
|
|
6895
6969
|
}, null, 8, ["attachment", "open-image"])], !0, 8) : e.block.type === "tool" ? I(n.$slots, "tool", {
|
|
6896
6970
|
block: e.block,
|
|
6897
6971
|
toolCall: e.block.toolCall
|
|
6898
|
-
}, () => [m(
|
|
6972
|
+
}, () => [m(pu, {
|
|
6899
6973
|
"answered-client-request-ids": e.answeredClientRequestIds,
|
|
6900
6974
|
"show-tool-details": e.showToolDetails,
|
|
6901
6975
|
"tool-call": e.block.toolCall,
|
|
@@ -6909,7 +6983,7 @@ var Bu = ["aria-expanded", "disabled"], Vu = ["data-label"], Hu = { class: "chat
|
|
|
6909
6983
|
])], !0, 9) : e.block.type === "tool-group" ? I(n.$slots, "tool", {
|
|
6910
6984
|
block: e.block,
|
|
6911
6985
|
toolCalls: e.block.toolCalls
|
|
6912
|
-
}, () => [m(
|
|
6986
|
+
}, () => [m(bu, {
|
|
6913
6987
|
"activity-title": e.block.activityTitle,
|
|
6914
6988
|
"answered-client-request-ids": e.answeredClientRequestIds,
|
|
6915
6989
|
"show-tool-details": e.showToolDetails,
|
|
@@ -6922,7 +6996,7 @@ var Bu = ["aria-expanded", "disabled"], Vu = ["data-label"], Hu = { class: "chat
|
|
|
6922
6996
|
"answered-client-request-ids",
|
|
6923
6997
|
"show-tool-details",
|
|
6924
6998
|
"tool-calls"
|
|
6925
|
-
])], !0, 10) : e.block.type === "work-group" ? (k(), s(
|
|
6999
|
+
])], !0, 10) : e.block.type === "work-group" ? (k(), s(Xu, {
|
|
6926
7000
|
key: 11,
|
|
6927
7001
|
active: e.block.active,
|
|
6928
7002
|
continuation: e.block.continuation,
|
|
@@ -6976,7 +7050,7 @@ var Bu = ["aria-expanded", "disabled"], Vu = ["data-label"], Hu = { class: "chat
|
|
|
6976
7050
|
"active",
|
|
6977
7051
|
"continuation",
|
|
6978
7052
|
"final-started"
|
|
6979
|
-
])) : e.block.type === "follow-ups" ? (k(), s(
|
|
7053
|
+
])) : e.block.type === "follow-ups" ? (k(), s(uc, {
|
|
6980
7054
|
key: 12,
|
|
6981
7055
|
disabled: e.followUpsDisabled,
|
|
6982
7056
|
prompts: e.block.prompts,
|
|
@@ -6984,15 +7058,15 @@ var Bu = ["aria-expanded", "disabled"], Vu = ["data-label"], Hu = { class: "chat
|
|
|
6984
7058
|
}, null, 8, ["disabled", "prompts"])) : c("", !0);
|
|
6985
7059
|
};
|
|
6986
7060
|
}
|
|
6987
|
-
}), [["__scopeId", "data-v-e5561e04"]]),
|
|
6988
|
-
function
|
|
7061
|
+
}), [["__scopeId", "data-v-e5561e04"]]), ed = 1440 * 60 * 1e3;
|
|
7062
|
+
function td(e, t = /* @__PURE__ */ new Date()) {
|
|
6989
7063
|
let n = new Date(e);
|
|
6990
7064
|
if (Number.isNaN(n.getTime())) return "";
|
|
6991
7065
|
let r = {
|
|
6992
7066
|
hour: "numeric",
|
|
6993
7067
|
minute: "2-digit"
|
|
6994
7068
|
};
|
|
6995
|
-
return
|
|
7069
|
+
return rd(n, t) ? new Intl.DateTimeFormat(void 0, r).format(n) : n.getTime() < t.getTime() && t.getTime() - n.getTime() < 7 * ed ? new Intl.DateTimeFormat(void 0, {
|
|
6996
7070
|
weekday: "short",
|
|
6997
7071
|
...r
|
|
6998
7072
|
}).format(n) : new Intl.DateTimeFormat(void 0, {
|
|
@@ -7000,19 +7074,19 @@ function Zu(e, t = /* @__PURE__ */ new Date()) {
|
|
|
7000
7074
|
timeStyle: "short"
|
|
7001
7075
|
}).format(n);
|
|
7002
7076
|
}
|
|
7003
|
-
function
|
|
7077
|
+
function nd(e) {
|
|
7004
7078
|
let t = new Date(e);
|
|
7005
7079
|
return Number.isNaN(t.getTime()) ? "" : new Intl.DateTimeFormat(void 0, {
|
|
7006
7080
|
dateStyle: "full",
|
|
7007
7081
|
timeStyle: "short"
|
|
7008
7082
|
}).format(t);
|
|
7009
7083
|
}
|
|
7010
|
-
function
|
|
7084
|
+
function rd(e, t) {
|
|
7011
7085
|
return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
|
|
7012
7086
|
}
|
|
7013
7087
|
//#endregion
|
|
7014
7088
|
//#region src/chat/ChatMessageActions.vue?vue&type=script&setup=true&lang.ts
|
|
7015
|
-
var
|
|
7089
|
+
var id = ["aria-busy", "aria-label"], ad = ["title"], od = ["title"], sd = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
7016
7090
|
__name: "ChatMessageActions",
|
|
7017
7091
|
props: {
|
|
7018
7092
|
canDelete: {
|
|
@@ -7046,7 +7120,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7046
7120
|
"retry"
|
|
7047
7121
|
],
|
|
7048
7122
|
setup(e, { emit: t }) {
|
|
7049
|
-
let n = e, r = t, i = Zn(), a = o(() => n.presentation?.copy !== !1), u = o(() => n.presentation?.delete !== !1), d = o(() => n.presentation?.edit !== !1), f = o(() => n.presentation?.fork !== !1), p = o(() => n.presentation?.quote !== !1), h = o(() => n.presentation?.retry !== !1), g = o(() => n.message.createdAt ?
|
|
7123
|
+
let n = e, r = t, i = Zn(), a = o(() => n.presentation?.copy !== !1), u = o(() => n.presentation?.delete !== !1), d = o(() => n.presentation?.edit !== !1), f = o(() => n.presentation?.fork !== !1), p = o(() => n.presentation?.quote !== !1), h = o(() => n.presentation?.retry !== !1), g = o(() => n.message.createdAt ? td(n.message.createdAt) : ""), _ = o(() => n.message.createdAt ? nd(n.message.createdAt) : void 0);
|
|
7050
7124
|
async function v() {
|
|
7051
7125
|
await n.copyAction?.(), r("copy");
|
|
7052
7126
|
}
|
|
@@ -7059,8 +7133,8 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7059
7133
|
key: 0,
|
|
7060
7134
|
class: "chat-message-actions__sent-at",
|
|
7061
7135
|
title: _.value
|
|
7062
|
-
}, B(g.value), 9,
|
|
7063
|
-
a.value ? (k(), s(
|
|
7136
|
+
}, B(g.value), 9, ad)) : c("", !0),
|
|
7137
|
+
a.value ? (k(), s(dc, {
|
|
7064
7138
|
key: 1,
|
|
7065
7139
|
action: v,
|
|
7066
7140
|
"copied-label": H(i)("chat.actions.copied"),
|
|
@@ -7071,7 +7145,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7071
7145
|
"disabled",
|
|
7072
7146
|
"label"
|
|
7073
7147
|
])) : c("", !0),
|
|
7074
|
-
e.message.role === "user" && e.canEdit && d.value ? (k(), s(
|
|
7148
|
+
e.message.role === "user" && e.canEdit && d.value ? (k(), s(Ys, {
|
|
7075
7149
|
key: 2,
|
|
7076
7150
|
disabled: e.deleting,
|
|
7077
7151
|
label: H(i)("chat.actions.edit"),
|
|
@@ -7080,7 +7154,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7080
7154
|
default: G(() => [m(H(Y))]),
|
|
7081
7155
|
_: 1
|
|
7082
7156
|
}, 8, ["disabled", "label"])) : c("", !0),
|
|
7083
|
-
e.message.role === "user" && p.value ? (k(), s(
|
|
7157
|
+
e.message.role === "user" && p.value ? (k(), s(Ys, {
|
|
7084
7158
|
key: 3,
|
|
7085
7159
|
disabled: e.deleting,
|
|
7086
7160
|
label: H(i)("chat.actions.quote"),
|
|
@@ -7089,7 +7163,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7089
7163
|
default: G(() => [m(H(Re))]),
|
|
7090
7164
|
_: 1
|
|
7091
7165
|
}, 8, ["disabled", "label"])) : c("", !0),
|
|
7092
|
-
e.message.role === "assistant" && e.canRetry && h.value ? (k(), s(
|
|
7166
|
+
e.message.role === "assistant" && e.canRetry && h.value ? (k(), s(Ys, {
|
|
7093
7167
|
key: 4,
|
|
7094
7168
|
disabled: e.mutationDisabled || e.deleting,
|
|
7095
7169
|
label: H(i)("chat.actions.retry"),
|
|
@@ -7098,7 +7172,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7098
7172
|
default: G(() => [m(H(ze))]),
|
|
7099
7173
|
_: 1
|
|
7100
7174
|
}, 8, ["disabled", "label"])) : c("", !0),
|
|
7101
|
-
e.canFork && f.value ? (k(), s(
|
|
7175
|
+
e.canFork && f.value ? (k(), s(Ys, {
|
|
7102
7176
|
key: 5,
|
|
7103
7177
|
disabled: e.mutationDisabled || e.deleting,
|
|
7104
7178
|
label: H(i)("chat.actions.fork"),
|
|
@@ -7107,7 +7181,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7107
7181
|
default: G(() => [m(H(le), { class: "chat-message-actions__fork-icon" })]),
|
|
7108
7182
|
_: 1
|
|
7109
7183
|
}, 8, ["disabled", "label"])) : c("", !0),
|
|
7110
|
-
e.canDelete && u.value ? (k(), s(
|
|
7184
|
+
e.canDelete && u.value ? (k(), s(Ys, {
|
|
7111
7185
|
key: 6,
|
|
7112
7186
|
danger: "",
|
|
7113
7187
|
disabled: e.mutationDisabled || e.deleting,
|
|
@@ -7124,10 +7198,10 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7124
7198
|
key: 7,
|
|
7125
7199
|
class: "chat-message-actions__sent-at",
|
|
7126
7200
|
title: _.value
|
|
7127
|
-
}, B(g.value), 9,
|
|
7128
|
-
], 10,
|
|
7201
|
+
}, B(g.value), 9, od)) : c("", !0)
|
|
7202
|
+
], 10, id));
|
|
7129
7203
|
}
|
|
7130
|
-
}), [["__scopeId", "data-v-704b28cf"]]),
|
|
7204
|
+
}), [["__scopeId", "data-v-704b28cf"]]), cd = ["data-label"], ld = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
7131
7205
|
__name: "ChatCompactionMessage",
|
|
7132
7206
|
props: {
|
|
7133
7207
|
completedTitle: {},
|
|
@@ -7139,9 +7213,9 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7139
7213
|
return (e, t) => (k(), l("div", { class: C(["codex-chat-theme chat-message chat-message--compaction", { "chat-message--compaction-running": n.value }]) }, [t[0] ||= u("div", { class: "chat-message__compaction-line" }, null, -1), u("span", {
|
|
7140
7214
|
class: "chat-message__compaction-title",
|
|
7141
7215
|
"data-label": r.value
|
|
7142
|
-
}, [u("span", { class: C(["chat-message__compaction-label", { "codex-text-shimmer": n.value }]) }, B(r.value), 3)], 8,
|
|
7216
|
+
}, [u("span", { class: C(["chat-message__compaction-label", { "codex-text-shimmer": n.value }]) }, B(r.value), 3)], 8, cd)], 2));
|
|
7143
7217
|
}
|
|
7144
|
-
}), [["__scopeId", "data-v-49449489"]]),
|
|
7218
|
+
}), [["__scopeId", "data-v-49449489"]]), ud = { class: "codex-chat-theme chat-message__edit-card" }, dd = ["aria-label", "onKeydown"], fd = { class: "chat-message__edit-actions" }, pd = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
7145
7219
|
__name: "ChatMessageEditor",
|
|
7146
7220
|
props: {
|
|
7147
7221
|
cancelLabel: {},
|
|
@@ -7183,7 +7257,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7183
7257
|
let e = i.value.trim();
|
|
7184
7258
|
e && (a.value ? r("save", e, { content: se(a.value.readContent()) }) : r("save", e));
|
|
7185
7259
|
}
|
|
7186
|
-
return (t, n) => (k(), l("div",
|
|
7260
|
+
return (t, n) => (k(), l("div", ud, [e.promptContent?.some((e) => e.type === "mention") ? (k(), s(hi, {
|
|
7187
7261
|
key: 0,
|
|
7188
7262
|
ref_key: "richInput",
|
|
7189
7263
|
ref: a,
|
|
@@ -7210,7 +7284,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7210
7284
|
K(q(m, ["meta", "prevent"]), ["enter"]),
|
|
7211
7285
|
K(q(m, ["ctrl", "prevent"]), ["enter"])
|
|
7212
7286
|
]
|
|
7213
|
-
}, null, 40,
|
|
7287
|
+
}, null, 40, dd)), [[U, i.value]]), u("div", fd, [u("button", {
|
|
7214
7288
|
type: "button",
|
|
7215
7289
|
class: "chat-message__edit-button",
|
|
7216
7290
|
onClick: d
|
|
@@ -7220,23 +7294,23 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7220
7294
|
onClick: m
|
|
7221
7295
|
}, B(e.saveLabel), 1)])]));
|
|
7222
7296
|
}
|
|
7223
|
-
}), [["__scopeId", "data-v-50787bcd"]]),
|
|
7297
|
+
}), [["__scopeId", "data-v-50787bcd"]]), md = { class: "chat-message__body" }, hd = {
|
|
7224
7298
|
key: 0,
|
|
7225
7299
|
class: "chat-message--steer chat-message--steer-above"
|
|
7226
|
-
},
|
|
7300
|
+
}, gd = {
|
|
7227
7301
|
key: 1,
|
|
7228
7302
|
class: "chat-message__attachments",
|
|
7229
7303
|
"aria-label": "Message attachments"
|
|
7230
|
-
},
|
|
7304
|
+
}, _d = {
|
|
7231
7305
|
key: 2,
|
|
7232
7306
|
class: "chat-message__stack"
|
|
7233
|
-
},
|
|
7307
|
+
}, vd = {
|
|
7234
7308
|
key: 0,
|
|
7235
7309
|
class: "chat-message__empty-response"
|
|
7236
|
-
},
|
|
7310
|
+
}, yd = ["data-label"], bd = {
|
|
7237
7311
|
key: 4,
|
|
7238
7312
|
class: "chat-message--steer chat-message--steer-below"
|
|
7239
|
-
},
|
|
7313
|
+
}, xd = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
7240
7314
|
__name: "CodexMessage",
|
|
7241
7315
|
props: {
|
|
7242
7316
|
activityState: {},
|
|
@@ -7289,17 +7363,17 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7289
7363
|
"send-follow-up"
|
|
7290
7364
|
],
|
|
7291
7365
|
setup(e, { emit: n }) {
|
|
7292
|
-
let r = e, i = n, a =
|
|
7293
|
-
A(
|
|
7366
|
+
let r = e, i = n, a = Li(), f = Zn(), p = o(() => r.activityState === "working" || g?.phased.value && g.active.value ? f("chat.work.working") : "Thinking"), h = o(() => $(r.message)), g = b(_o, void 0);
|
|
7367
|
+
A(vo, o(() => r.index));
|
|
7294
7368
|
let _ = o(() => h.value.turnId === g?.turnId.value ? g : void 0), v = o(() => _.value?.enabled.value ? _.value : void 0), y = o(() => v.value?.active.value), S = o(() => Mt(r.presentation));
|
|
7295
|
-
A(
|
|
7296
|
-
let w = o(() =>
|
|
7369
|
+
A(go, b(go, void 0) ?? ee(/* @__PURE__ */ new Map()));
|
|
7370
|
+
let w = o(() => Ra(h.value)), T = o(() => w.value.filter((e) => (e.type !== "question" || !r.hiddenClientRequestIds?.has(e.request.id)) && (S.value.messages.toolBlocks || e.type !== "tool" && e.type !== "tool-group"))), E = o(() => {
|
|
7297
7371
|
let e = v.value;
|
|
7298
7372
|
if (!e) return;
|
|
7299
7373
|
let t = w.value.length > 0 && w.value.every((e) => e.type === "tool" || e.type === "tool-group");
|
|
7300
|
-
return e.phased.value || e.active.value && t;
|
|
7374
|
+
return e.phased.value || e.itemsView?.value !== void 0 || e.active.value && t;
|
|
7301
7375
|
}), D = o(() => {
|
|
7302
|
-
let e =
|
|
7376
|
+
let e = za(h.value, T.value, y.value, E.value, r.answeredClientRequestIds), t = v.value;
|
|
7303
7377
|
return t?.itemsView?.value !== void 0 && t.headerMessageIndex.value === r.index && !e.some((e) => e.type === "work-group") ? [{
|
|
7304
7378
|
type: "work-group",
|
|
7305
7379
|
active: !1,
|
|
@@ -7309,14 +7383,14 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7309
7383
|
}), O = o(() => h.value.role === "assistant" && D.value.length > 0 && D.value.every((e) => e.type === "work-group" || e.type === "media") && (h.value.streaming === !0 || y.value === !0 || _.value?.finalStarted.value === !0 || !D.value.some((e) => e.type === "work-group"))), j = o(() => {
|
|
7310
7384
|
if (h.value.role === "assistant" && h.value.streaming !== !0 && w.value.length > 0 && T.value.length === 0) return !0;
|
|
7311
7385
|
let e = _.value;
|
|
7312
|
-
return !e?.enabled.value || e.active.value ? !1 : e.completedWithoutFinal.value ? h.value.type === "steer" : e.expanded.value ? !1 : h.value.type === "steer" || h.value.role === "assistant" && e.headerMessageIndex.value !== r.index && D.value.every((e) => e.type === "work-group");
|
|
7386
|
+
return !e?.enabled.value || e.active.value ? !1 : h.value.type === "steer" && e.itemsView?.value === "summary" ? !0 : e.completedWithoutFinal.value ? h.value.type === "steer" : e.expanded.value ? !1 : h.value.type === "steer" || h.value.role === "assistant" && e.headerMessageIndex.value !== r.index && D.value.every((e) => e.type === "work-group");
|
|
7313
7387
|
}), M = o(() => D.value.map((e, t) => ({
|
|
7314
7388
|
block: e,
|
|
7315
7389
|
blockIndex: t
|
|
7316
7390
|
}))), P = o(() => w.value.map((e, t) => ({
|
|
7317
7391
|
block: e,
|
|
7318
7392
|
blockIndex: t
|
|
7319
|
-
}))), L = o(() => h.value.role === "user" ? P.value.filter(({ block: e }) => e.type === "attachment") : []), R = o(() => h.value.role === "user" ? P.value.filter(({ block: e }) => e.type !== "attachment") : M.value), z = o(() =>
|
|
7393
|
+
}))), L = o(() => h.value.role === "user" ? P.value.filter(({ block: e }) => e.type === "attachment") : []), R = o(() => h.value.role === "user" ? P.value.filter(({ block: e }) => e.type !== "attachment") : M.value), z = o(() => Ga(h.value.content)), V = N(!1), te = o(() => h.value.type !== "compaction" && h.value.type !== "steer" && !O.value && !V.value), U = o(() => r.actionsDisabled || h.value.role === "assistant" && h.value.streaming === !0), ne = o(() => te.value), W = o(() => !!h.value.turnId && r.canDeleteTurn && S.value.messages.actions.delete), re = o(() => !!h.value.turnId && r.canEditTurn && S.value.messages.actions.edit), K = o(() => !!h.value.turnId && r.canForkTurn && S.value.messages.actions.fork), q = o(() => !!h.value.turnId && r.canRetryTurn && S.value.messages.actions.retry), J = o(() => D.value.some(ge)), ie = o(() => _.value?.latestStreamingAssistantIndex.value === void 0 || _.value.latestStreamingAssistantIndex.value === r.index), ae = o(() => h.value.role === "assistant" && h.value.streaming !== !0 && _.value?.itemsView?.value !== "summary" && w.value.length === 0), oe = o(() => h.value.role === "assistant" && h.value.streaming === !0 && ie.value && !J.value), se = o(() => h.value.role === "assistant" && h.value.streaming === !0 && ie.value && J.value);
|
|
7320
7394
|
function ce() {
|
|
7321
7395
|
h.value.role !== "user" || !re.value || (V.value = !0);
|
|
7322
7396
|
}
|
|
@@ -7354,12 +7428,12 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7354
7428
|
});
|
|
7355
7429
|
}
|
|
7356
7430
|
async function he() {
|
|
7357
|
-
await
|
|
7431
|
+
await El(h.value.content, a);
|
|
7358
7432
|
}
|
|
7359
7433
|
function ge(e) {
|
|
7360
7434
|
return e.type === "text" ? e.content.trim().length > 0 : e.type === "attachment" || e.type === "media" || e.type === "mermaid" || e.type === "html" || e.type === "reasoning" || e.type === "tool" || e.type === "tool-group" || e.type === "visualization" || e.type === "work-group";
|
|
7361
7435
|
}
|
|
7362
|
-
return (n, r) => h.value.type === "compaction" ? (k(), s(
|
|
7436
|
+
return (n, r) => h.value.type === "compaction" ? (k(), s(ld, {
|
|
7363
7437
|
key: 0,
|
|
7364
7438
|
class: "codex-chat-theme",
|
|
7365
7439
|
"completed-title": H(f)("chat.compaction.completed"),
|
|
@@ -7375,17 +7449,17 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7375
7449
|
"chat-message--actions-visible": e.actionsAlwaysVisible && !U.value,
|
|
7376
7450
|
"chat-message--editing": V.value
|
|
7377
7451
|
}]])
|
|
7378
|
-
}, [u("div",
|
|
7379
|
-
n.$slots.header ? (k(), l("div",
|
|
7452
|
+
}, [u("div", md, [
|
|
7453
|
+
n.$slots.header ? (k(), l("div", hd, [I(n.$slots, "header", {
|
|
7380
7454
|
index: e.index,
|
|
7381
7455
|
message: h.value
|
|
7382
7456
|
}, void 0, !0)])) : c("", !0),
|
|
7383
|
-
L.value.length > 0 ? (k(), l("div",
|
|
7457
|
+
L.value.length > 0 ? (k(), l("div", gd, [(k(!0), l(t, null, F(L.value, ({ block: t, blockIndex: r }) => I(n.$slots, "block", {
|
|
7384
7458
|
block: t,
|
|
7385
7459
|
blockIndex: r,
|
|
7386
7460
|
index: e.index,
|
|
7387
7461
|
message: h.value
|
|
7388
|
-
}, () => [m(
|
|
7462
|
+
}, () => [m($u, {
|
|
7389
7463
|
block: t,
|
|
7390
7464
|
"open-image": me
|
|
7391
7465
|
}, d({ _: 2 }, [n.$slots.attachment ? {
|
|
@@ -7396,7 +7470,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7396
7470
|
}), void 0, !0)]),
|
|
7397
7471
|
key: "0"
|
|
7398
7472
|
} : void 0]), 1032, ["block"])], !0, `attachment-${r}`)), 128))])) : c("", !0),
|
|
7399
|
-
V.value || R.value.length > 0 || ae.value || oe.value || se.value ? (k(), l("div",
|
|
7473
|
+
V.value || R.value.length > 0 || ae.value || oe.value || se.value ? (k(), l("div", _d, [V.value ? (k(), s(pd, {
|
|
7400
7474
|
key: 0,
|
|
7401
7475
|
"cancel-label": H(f)("chat.actions.cancel"),
|
|
7402
7476
|
content: z.value,
|
|
@@ -7412,7 +7486,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7412
7486
|
"input-label",
|
|
7413
7487
|
"save-label"
|
|
7414
7488
|
])) : (k(), l(t, { key: 1 }, [
|
|
7415
|
-
(k(!0), l(t, null, F(R.value, ({ block: a, blockIndex: o }) => (k(), l(t, { key: a.type === "tool" ? a.toolCall.id : `${a.type}-${o}` }, [a.type === "work-group" ? (k(), s(
|
|
7489
|
+
(k(!0), l(t, null, F(R.value, ({ block: a, blockIndex: o }) => (k(), l(t, { key: a.type === "tool" ? a.toolCall.id : `${a.type}-${o}` }, [a.type === "work-group" ? (k(), s($u, {
|
|
7416
7490
|
key: 0,
|
|
7417
7491
|
"answered-client-request-ids": e.answeredClientRequestIds,
|
|
7418
7492
|
block: a,
|
|
@@ -7465,7 +7539,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7465
7539
|
blockIndex: o,
|
|
7466
7540
|
index: e.index,
|
|
7467
7541
|
message: h.value
|
|
7468
|
-
}, () => [m(
|
|
7542
|
+
}, () => [m($u, {
|
|
7469
7543
|
"answered-client-request-ids": e.answeredClientRequestIds,
|
|
7470
7544
|
block: a,
|
|
7471
7545
|
"follow-ups-disabled": e.followUpsDisabled,
|
|
@@ -7521,14 +7595,14 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7521
7595
|
"show-tool-details",
|
|
7522
7596
|
"skills"
|
|
7523
7597
|
])], !0, 1)], 64))), 128)),
|
|
7524
|
-
ae.value ? (k(), l("span",
|
|
7598
|
+
ae.value ? (k(), l("span", vd, B(H(f)("chat.message.emptyResponse")), 1)) : c("", !0),
|
|
7525
7599
|
oe.value ? I(n.$slots, "thinking", {
|
|
7526
7600
|
index: e.index,
|
|
7527
7601
|
message: h.value
|
|
7528
7602
|
}, () => [u("span", {
|
|
7529
7603
|
class: "chat-message__thinking codex-text-shimmer",
|
|
7530
7604
|
"data-label": p.value
|
|
7531
|
-
}, B(p.value), 9,
|
|
7605
|
+
}, B(p.value), 9, yd)], !0, 1) : se.value ? I(n.$slots, "status", {
|
|
7532
7606
|
index: e.index,
|
|
7533
7607
|
message: h.value,
|
|
7534
7608
|
status: "streaming"
|
|
@@ -7541,7 +7615,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7541
7615
|
disabled: U.value,
|
|
7542
7616
|
index: e.index,
|
|
7543
7617
|
message: h.value
|
|
7544
|
-
}, () => [m(
|
|
7618
|
+
}, () => [m(sd, {
|
|
7545
7619
|
class: C(["chat-message__actions", { "chat-message__actions--reserved": U.value }]),
|
|
7546
7620
|
"aria-hidden": U.value ? "true" : void 0,
|
|
7547
7621
|
inert: U.value ? "" : void 0,
|
|
@@ -7573,10 +7647,10 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7573
7647
|
"mutation-disabled",
|
|
7574
7648
|
"presentation"
|
|
7575
7649
|
])], !0, 3) : c("", !0),
|
|
7576
|
-
h.value.type === "steer" ? (k(), l("div",
|
|
7650
|
+
h.value.type === "steer" ? (k(), l("div", bd, " Steered conversation ")) : c("", !0)
|
|
7577
7651
|
])], 2));
|
|
7578
7652
|
}
|
|
7579
|
-
}), [["__scopeId", "data-v-
|
|
7653
|
+
}), [["__scopeId", "data-v-a03004b9"]]), Sd = { class: "codex-message-turn" }, Cd = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
7580
7654
|
__name: "CodexMessageTurn",
|
|
7581
7655
|
props: {
|
|
7582
7656
|
active: { type: Boolean },
|
|
@@ -7593,26 +7667,27 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7593
7667
|
},
|
|
7594
7668
|
emits: ["loadTurnHistory"],
|
|
7595
7669
|
setup(e, { emit: t }) {
|
|
7596
|
-
A(
|
|
7670
|
+
A(go, b(go, void 0) ?? ee(/* @__PURE__ */ new Map()));
|
|
7597
7671
|
let n = e, r = t, i = o(() => n.entries.map((e) => ({
|
|
7598
7672
|
entry: e,
|
|
7599
7673
|
message: $(e.message)
|
|
7600
|
-
}))), a = o(() => n.turnId), s = o(() => i.value.some(({ message: e }) => e.role === "assistant" &&
|
|
7674
|
+
}))), a = o(() => n.turnId), s = o(() => i.value.some(({ message: e }) => e.role === "assistant" && Za(e))), c = o(() => [...i.value].reverse().find(({ message: e }) => e.role === "assistant" && e.streaming === !0)?.entry.index), u = o(() => n.active === !1 ? void 0 : [...i.value].reverse().find(({ message: e }) => e.role === "assistant" && e.streaming === !0 && (e.parts?.length ?? 0) > 0)?.entry.index), d = o(() => i.value.some(({ entry: e, message: t }) => t.role === "assistant" && (u.value === void 0 || e.index >= u.value) && (t.parts?.some((e) => e.type === "text" && e.phase === "final_answer" && e.content.trim().length > 0) ?? !1))), f = o(() => !d.value && (n.active ?? i.value.some(({ message: e }) => e.role === "assistant" && e.streaming === !0))), p = o(() => n.status), m = o(() => n.startedAt), h = o(() => n.durationMs), g = o(() => !f.value && !d.value && (p.value === "interrupted" || p.value === "failed")), _ = o(() => n.itemsView === void 0 && s.value && !f.value && !d.value && (p.value === void 0 || p.value === "completed")), v = o(() => i.value.find(({ message: e }) => e.role === "assistant" && (n.itemsView !== void 0 || w(e)))?.entry.index), y = o(() => n.itemsView === "summary" || i.value.some(({ message: e }) => e.type === "steer" && Ra(e).length > 0 || e.role === "assistant" && Ra(e).some((e) => (n.showToolBlocks || e.type !== "tool" && e.type !== "tool-group") && Qa(e, n.answeredClientRequestIds)))), x = o(() => !!(a.value && v.value !== void 0)), S = N(f.value && !d.value || g.value), C = N(!1);
|
|
7601
7675
|
W(d, (e, t) => {
|
|
7602
|
-
e && !t && (
|
|
7676
|
+
e && !t && !C.value && (S.value = !1);
|
|
7603
7677
|
}), W([f, g], ([e, t]) => {
|
|
7604
|
-
|
|
7605
|
-
}), A(
|
|
7678
|
+
C.value || (S.value = e && !d.value || t);
|
|
7679
|
+
}), A(_o, {
|
|
7606
7680
|
active: f,
|
|
7607
7681
|
completedWithoutFinal: _,
|
|
7608
|
-
enabled:
|
|
7609
|
-
expanded:
|
|
7682
|
+
enabled: x,
|
|
7683
|
+
expanded: S,
|
|
7610
7684
|
finalStarted: d,
|
|
7611
7685
|
headerMessageIndex: v,
|
|
7612
7686
|
latestStreamingAssistantIndex: c,
|
|
7613
7687
|
phased: s,
|
|
7614
7688
|
startedAt: m,
|
|
7615
7689
|
durationMs: h,
|
|
7690
|
+
hasDetails: y,
|
|
7616
7691
|
itemsView: o(() => n.itemsView),
|
|
7617
7692
|
detailsLoading: o(() => n.detailsLoading),
|
|
7618
7693
|
detailsError: o(() => n.detailsError),
|
|
@@ -7622,23 +7697,23 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7622
7697
|
status: p,
|
|
7623
7698
|
turnId: a,
|
|
7624
7699
|
toggle() {
|
|
7625
|
-
|
|
7700
|
+
C.value = !0, S.value = !S.value;
|
|
7626
7701
|
}
|
|
7627
7702
|
}), W([
|
|
7628
|
-
|
|
7703
|
+
S,
|
|
7629
7704
|
() => n.itemsView,
|
|
7630
7705
|
() => n.detailsLoading,
|
|
7631
7706
|
() => n.detailsError
|
|
7632
7707
|
], () => {
|
|
7633
|
-
|
|
7708
|
+
S.value && n.itemsView === "summary" && !n.detailsLoading && !n.detailsError && n.turnId && r("loadTurnHistory", n.turnId);
|
|
7634
7709
|
}, { immediate: !0 });
|
|
7635
|
-
function
|
|
7636
|
-
let t =
|
|
7637
|
-
return t.length === 0 ? !1 : s.value ? t.some((e) =>
|
|
7710
|
+
function w(e) {
|
|
7711
|
+
let t = Ra(e).filter((e) => n.showToolBlocks || e.type !== "tool" && e.type !== "tool-group");
|
|
7712
|
+
return t.length === 0 ? !1 : s.value ? t.some((e) => Qa(e, n.answeredClientRequestIds)) : f.value && t.every((e) => e.type === "tool" || e.type === "tool-group");
|
|
7638
7713
|
}
|
|
7639
|
-
return (e, t) => (k(), l("div",
|
|
7714
|
+
return (e, t) => (k(), l("div", Sd, [I(e.$slots, "default", {}, void 0, !0)]));
|
|
7640
7715
|
}
|
|
7641
|
-
}), [["__scopeId", "data-v-
|
|
7716
|
+
}), [["__scopeId", "data-v-4964a752"]]), wd = ["aria-label", "title"], Td = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
7642
7717
|
__name: "CodexScrollToBottom",
|
|
7643
7718
|
props: { label: { default: "Scroll to bottom" } },
|
|
7644
7719
|
emits: ["click"],
|
|
@@ -7654,9 +7729,9 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7654
7729
|
"aria-hidden": "true",
|
|
7655
7730
|
size: 24,
|
|
7656
7731
|
"stroke-width": 1.75
|
|
7657
|
-
})], 8,
|
|
7732
|
+
})], 8, wd));
|
|
7658
7733
|
}
|
|
7659
|
-
}), [["__scopeId", "data-v-5a75ce89"]]),
|
|
7734
|
+
}), [["__scopeId", "data-v-5a75ce89"]]), Ed = ["aria-label"], Dd = { class: "codex-message-list__content" }, Od = { class: "codex-message-list__empty" }, kd = ["data-codex-message-index"], Ad = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
7660
7735
|
__name: "CodexMessageList",
|
|
7661
7736
|
props: {
|
|
7662
7737
|
actionsDisabled: { type: Boolean },
|
|
@@ -7743,8 +7818,8 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7743
7818
|
role: "assistant",
|
|
7744
7819
|
status: "streaming",
|
|
7745
7820
|
parts: []
|
|
7746
|
-
}, p = b(
|
|
7747
|
-
A(
|
|
7821
|
+
}, p = b(go, void 0) ?? ee(/* @__PURE__ */ new Map());
|
|
7822
|
+
A(go, p), W(() => i.messages, (e) => {
|
|
7748
7823
|
let t = {}, n = /* @__PURE__ */ new Set();
|
|
7749
7824
|
for (let n of e) {
|
|
7750
7825
|
if (!("metadata" in n)) continue;
|
|
@@ -7759,14 +7834,14 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
7759
7834
|
}
|
|
7760
7835
|
for (let e of p.keys()) n.has(e) || p.delete(e);
|
|
7761
7836
|
}, { immediate: !0 });
|
|
7762
|
-
let m = o(() => i.renderStrategy ?? (i.lazyMessages === !1 ? "eager" : "lazy")), h = o(() => i.initialMessageBatchSize ?? i.messageBatchSize ?? 50), g = o(() => i.messageBatchSize ?? 25), _ = N(Pe(i.messages, h.value)), v = /* @__PURE__ */ new Map(), y = je(i.messages, _.value), C = i.messages.length, w = je(i.messages, 0), T = je(i.messages, i.messages.length - 1), O = N(!1), j = !1, M = o(() =>
|
|
7837
|
+
let m = o(() => i.renderStrategy ?? (i.lazyMessages === !1 ? "eager" : "lazy")), h = o(() => i.initialMessageBatchSize ?? i.messageBatchSize ?? 50), g = o(() => i.messageBatchSize ?? 25), _ = N(Pe(i.messages, h.value)), v = /* @__PURE__ */ new Map(), y = je(i.messages, _.value), C = i.messages.length, w = je(i.messages, 0), T = je(i.messages, i.messages.length - 1), O = N(!1), j = !1, M = o(() => ka(i.messages)), P = o(() => m.value === "lazy" ? M.value.slice(_.value) : M.value), L = o(() => {
|
|
7763
7838
|
let e = -1;
|
|
7764
7839
|
for (let t = i.messages.length - 1; t >= 0; t--) if (i.messages[t]?.role === "user") {
|
|
7765
7840
|
e = t;
|
|
7766
7841
|
break;
|
|
7767
7842
|
}
|
|
7768
7843
|
let t = !1, n = P.value.flatMap((n, r) => {
|
|
7769
|
-
let a = m.value === "lazy" ? _.value + r : r, o = i.transformMessage?.(n, a) ?? n, s =
|
|
7844
|
+
let a = m.value === "lazy" ? _.value + r : r, o = i.transformMessage?.(n, a) ?? n, s = Vs(o, i.toolVisibility);
|
|
7770
7845
|
return !s && o.role === "assistant" && (i.activeTurnId ? $(o).turnId === i.activeTurnId : a > e) && (t = !0), s ? [{
|
|
7771
7846
|
index: a,
|
|
7772
7847
|
message: s,
|
|
@@ -8048,7 +8123,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8048
8123
|
onClickCapture: _e,
|
|
8049
8124
|
onPointerdown: ve,
|
|
8050
8125
|
onScroll: he
|
|
8051
|
-
}, [u("div",
|
|
8126
|
+
}, [u("div", Dd, [L.value.length === 0 ? I(n.$slots, "empty", {}, () => [u("p", Od, B(e.emptyLabel), 1)], !0, 0) : (k(!0), l(t, { key: 1 }, F(z.value, (i) => (k(), s(Cd, {
|
|
8052
8127
|
key: i.key,
|
|
8053
8128
|
entries: i.entries,
|
|
8054
8129
|
"answered-client-request-ids": e.answeredClientRequestIds,
|
|
@@ -8070,7 +8145,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8070
8145
|
}, [n.$slots.message ? I(n.$slots, "message", {
|
|
8071
8146
|
message: H($)(J(t.message, i.turnId)),
|
|
8072
8147
|
index: t.index
|
|
8073
|
-
}, void 0, !0, 0) : (k(), s(
|
|
8148
|
+
}, void 0, !0, 0) : (k(), s(xd, {
|
|
8074
8149
|
key: 1,
|
|
8075
8150
|
"activity-state": t.activityState,
|
|
8076
8151
|
"actions-disabled": e.actionsDisabled,
|
|
@@ -8170,7 +8245,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8170
8245
|
"show-tool-details",
|
|
8171
8246
|
"skills",
|
|
8172
8247
|
"thread-actions-disabled"
|
|
8173
|
-
]))], 8,
|
|
8248
|
+
]))], 8, kd))), 128))]),
|
|
8174
8249
|
_: 2
|
|
8175
8250
|
}, 1032, [
|
|
8176
8251
|
"entries",
|
|
@@ -8184,20 +8259,20 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8184
8259
|
"items-view",
|
|
8185
8260
|
"details-loading",
|
|
8186
8261
|
"details-error"
|
|
8187
|
-
]))), 128))])], 544), le.value ? (k(), s(
|
|
8262
|
+
]))), 128))])], 544), le.value ? (k(), s(Td, {
|
|
8188
8263
|
key: 0,
|
|
8189
8264
|
class: "codex-message-list__scroll-to-bottom",
|
|
8190
8265
|
label: e.scrollToBottomLabel,
|
|
8191
8266
|
onClick: Be
|
|
8192
|
-
}, null, 8, ["label"])) : c("", !0)], 8,
|
|
8267
|
+
}, null, 8, ["label"])) : c("", !0)], 8, Ed));
|
|
8193
8268
|
}
|
|
8194
|
-
}), [["__scopeId", "data-v-c9a41a60"]]),
|
|
8269
|
+
}), [["__scopeId", "data-v-c9a41a60"]]), jd = {
|
|
8195
8270
|
key: 0,
|
|
8196
8271
|
class: "codex-workbench-layout__body codex-workbench-layout__body--scroll"
|
|
8197
|
-
},
|
|
8272
|
+
}, Md = { class: "codex-workbench-layout__body-content" }, Nd = {
|
|
8198
8273
|
key: 1,
|
|
8199
8274
|
class: "codex-workbench-layout__body codex-workbench-layout__body--child"
|
|
8200
|
-
},
|
|
8275
|
+
}, Pd = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
8201
8276
|
__name: "CodexWorkbenchLayout",
|
|
8202
8277
|
props: { scrollMode: { default: "body" } },
|
|
8203
8278
|
setup(e) {
|
|
@@ -8223,7 +8298,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8223
8298
|
class: C(["codex-chat-theme codex-workbench-layout", `codex-workbench-layout--${e.scrollMode}`]),
|
|
8224
8299
|
style: T(a.value)
|
|
8225
8300
|
}, [
|
|
8226
|
-
e.scrollMode === "body" ? (k(), l("div",
|
|
8301
|
+
e.scrollMode === "body" ? (k(), l("div", jd, [u("div", Md, [I(r.$slots, "default", {}, void 0, !0)])])) : (k(), l("div", Nd, [I(r.$slots, "default", {}, void 0, !0)])),
|
|
8227
8302
|
r.$slots.header ? (k(), l("div", {
|
|
8228
8303
|
key: 2,
|
|
8229
8304
|
ref_key: "headerEl",
|
|
@@ -8238,36 +8313,36 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8238
8313
|
}, [I(r.$slots, "footer", {}, void 0, !0)], 512)) : c("", !0)
|
|
8239
8314
|
], 6));
|
|
8240
8315
|
}
|
|
8241
|
-
}), [["__scopeId", "data-v-661ca7b5"]]),
|
|
8316
|
+
}), [["__scopeId", "data-v-661ca7b5"]]), Fd = [
|
|
8242
8317
|
"aria-busy",
|
|
8243
8318
|
"aria-label",
|
|
8244
8319
|
"data-codex-generating"
|
|
8245
|
-
],
|
|
8320
|
+
], Id = {
|
|
8246
8321
|
key: 1,
|
|
8247
8322
|
class: "codex-conversation-pane__hero"
|
|
8248
|
-
},
|
|
8323
|
+
}, Ld = { class: "codex-conversation-pane__hero-copy" }, Rd = { key: 0 }, zd = {
|
|
8249
8324
|
key: 0,
|
|
8250
8325
|
class: "codex-conversation-pane__error",
|
|
8251
8326
|
role: "alert"
|
|
8252
|
-
},
|
|
8327
|
+
}, Bd = {
|
|
8253
8328
|
key: 1,
|
|
8254
8329
|
class: "codex-conversation-pane__approvals"
|
|
8255
|
-
},
|
|
8330
|
+
}, Vd = {
|
|
8256
8331
|
key: 0,
|
|
8257
8332
|
class: "codex-conversation-pane__pending-question"
|
|
8258
|
-
},
|
|
8333
|
+
}, Hd = ["aria-label"], Ud = {
|
|
8259
8334
|
key: 0,
|
|
8260
8335
|
class: "codex-conversation-pane__attachments",
|
|
8261
8336
|
"aria-label": "Prompt attachments"
|
|
8262
|
-
},
|
|
8337
|
+
}, Wd = ["src", "alt"], Gd = {
|
|
8263
8338
|
key: 1,
|
|
8264
8339
|
class: "codex-conversation-pane__attachment-file",
|
|
8265
8340
|
"aria-hidden": "true"
|
|
8266
|
-
},
|
|
8341
|
+
}, Kd = ["title"], qd = { class: "codex-conversation-pane__attachment-actions" }, Jd = [
|
|
8267
8342
|
"aria-label",
|
|
8268
8343
|
"disabled",
|
|
8269
8344
|
"onClick"
|
|
8270
|
-
],
|
|
8345
|
+
], Yd = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
8271
8346
|
__name: "CodexConversationPane",
|
|
8272
8347
|
props: {
|
|
8273
8348
|
ariaLabel: { default: "Conversation" },
|
|
@@ -8385,20 +8460,20 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8385
8460
|
},
|
|
8386
8461
|
emits: /* @__PURE__ */ "attach.attachmentsChange.cancel.clientResponse.copyMessage.clearGoal.continueInterruptedTurn.deleteTurn.deleteQueuedPrompt.updateQueuedPrompt.editGoal.editTurn.forkTurn.loadOlderHistory.loadTurnHistory.error.interrupt.menuSelect.messageTextSelectionChange.mentionSelect.openLink.openVisualization.resolveApproval.quoteMessage.retryTurn.selectApprovalPreset.sendFollowUp.submit.steer.steerQueuedPrompt.update:modelId.update:composerState.update:modelValue.update:planMode.update:reasoningEffort.update:serviceTier".split("."),
|
|
8387
8462
|
setup(e, { expose: n, emit: r }) {
|
|
8388
|
-
let i = e, a = r, f =
|
|
8389
|
-
A(
|
|
8390
|
-
let h = N(null), g = N(/* @__PURE__ */ new Set()), v = N(null), y = N(null), b = N(null), x = N(null), C = o(() =>
|
|
8463
|
+
let i = e, a = r, f = Li(), p = ee(/* @__PURE__ */ new Map());
|
|
8464
|
+
A(go, p);
|
|
8465
|
+
let h = N(null), g = N(/* @__PURE__ */ new Set()), v = N(null), y = N(null), b = N(null), x = N(null), C = o(() => ha(i.controller)), T = o(() => {
|
|
8391
8466
|
let e = C.value;
|
|
8392
|
-
return e ?
|
|
8467
|
+
return e ? ha(e.state) : void 0;
|
|
8393
8468
|
}), E = o(() => {
|
|
8394
8469
|
let e = C.value;
|
|
8395
|
-
return e ?
|
|
8470
|
+
return e ? ha(e.actions) : void 0;
|
|
8396
8471
|
}), O = o(() => i.surface?.state);
|
|
8397
8472
|
function j(e, t) {
|
|
8398
8473
|
let n = T.value;
|
|
8399
8474
|
return n ? e(n) : t();
|
|
8400
8475
|
}
|
|
8401
|
-
let M = o(() => j((e) => e.composer?.state, () => i.composerState)), P = o(() => j((e) => e.composer?.attachments ?? [], () => i.attachments)), L =
|
|
8476
|
+
let M = o(() => j((e) => e.composer?.state, () => i.composerState)), P = o(() => j((e) => e.composer?.attachments ?? [], () => i.attachments)), L = Ji(M.value ?? (T.value ? {
|
|
8402
8477
|
text: "",
|
|
8403
8478
|
selectionStart: 0,
|
|
8404
8479
|
selectionEnd: 0
|
|
@@ -8412,7 +8487,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8412
8487
|
}), le = o(() => j((e) => e.identity.activeTurnId, () => i.activeTurnId === void 0 ? O.value?.activeTurnId : i.activeTurnId)), ue = o(() => j((e) => e.identity.turns, () => i.turns ?? O.value?.turns ?? [])), de = o(() => !ke.value && le.value == null && (ue.value ?? []).at(-1)?.status === "interrupted"), fe = o(() => ce.value.flatMap((e) => {
|
|
8413
8488
|
let t = $(e);
|
|
8414
8489
|
if (t.role !== "user") return [];
|
|
8415
|
-
let n =
|
|
8490
|
+
let n = Ga(t.content);
|
|
8416
8491
|
return n && n !== "(no user instructions)" ? [n] : [];
|
|
8417
8492
|
})), pe = o(() => j((e) => e.composer?.promptHistory, () => i.promptHistory)), me = o(() => xt(pe.value ?? ie.value, fe.value)), he = o(() => j((e) => e.thread?.answeredClientRequestIds, () => i.answeredClientRequestIds ?? i.surface?.answeredClientRequestIds)), ge = o(() => /* @__PURE__ */ new Set([...he.value ?? [], ...p.keys()])), ve = o(() => j((e) => e.thread?.clientRequests ?? [], () => i.clientRequests ?? O.value?.clientRequests ?? [])), ye = o(() => {
|
|
8418
8493
|
let e = /* @__PURE__ */ new Set(), t = new Map((ue.value ?? []).map((e, t) => [e.id, t])), n = se.value.map($);
|
|
@@ -8447,7 +8522,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8447
8522
|
toolCalls: r.toolCalls?.filter((e) => !a(e))
|
|
8448
8523
|
};
|
|
8449
8524
|
}
|
|
8450
|
-
let De = o(() => j((e) => e.thread?.approvals ?? [], () => i.approvals ?? O.value?.approvals ?? [])), Oe = o(() => De.value[0]), ke = o(() => j((e) => e.identity.busy ?? !1, () => i.busy ?? O.value?.busy ?? !1)), Ae = o(() => ke.value || U.value !== null), { armed: Me, clear: Ne } =
|
|
8525
|
+
let De = o(() => j((e) => e.thread?.approvals ?? [], () => i.approvals ?? O.value?.approvals ?? [])), Oe = o(() => De.value[0]), ke = o(() => j((e) => e.identity.busy ?? !1, () => i.busy ?? O.value?.busy ?? !1)), Ae = o(() => ke.value || U.value !== null), { armed: Me, clear: Ne } = ho({
|
|
8451
8526
|
root: x,
|
|
8452
8527
|
busy: () => ke.value,
|
|
8453
8528
|
enabled: () => i.escapeInterrupt,
|
|
@@ -8471,7 +8546,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8471
8546
|
});
|
|
8472
8547
|
}), W(M, (e) => {
|
|
8473
8548
|
if (!e) return;
|
|
8474
|
-
let t =
|
|
8549
|
+
let t = Ji(e);
|
|
8475
8550
|
R.value = t, z.value = t.text;
|
|
8476
8551
|
}, { deep: !0 }), W(P, (e) => {
|
|
8477
8552
|
q.value = [...e];
|
|
@@ -8485,7 +8560,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8485
8560
|
adoptedConversationKey: e ?? null,
|
|
8486
8561
|
hasAdoptedConversationKey: !0
|
|
8487
8562
|
} : (e ?? null) !== n.originConversationKey && (e ?? null) !== n.adoptedConversationKey && (U.value = null)), re += 1, te.value = null, Ne(), V.value = null, K.value = null;
|
|
8488
|
-
let r =
|
|
8563
|
+
let r = Ji(M.value ?? (C.value ? {
|
|
8489
8564
|
text: "",
|
|
8490
8565
|
selectionStart: 0,
|
|
8491
8566
|
selectionEnd: 0
|
|
@@ -8624,7 +8699,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8624
8699
|
}
|
|
8625
8700
|
function Dt(e, t) {
|
|
8626
8701
|
let n = $(e);
|
|
8627
|
-
return n.role === "user" &&
|
|
8702
|
+
return n.role === "user" && Ga(n.content) === t.prompt;
|
|
8628
8703
|
}
|
|
8629
8704
|
function Ot(e) {
|
|
8630
8705
|
e && U.value?.message.id === e && (U.value = null);
|
|
@@ -8650,7 +8725,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8650
8725
|
function jt(e) {
|
|
8651
8726
|
let t = ce.value[e];
|
|
8652
8727
|
if (!t) return;
|
|
8653
|
-
let n = $(t), r =
|
|
8728
|
+
let n = $(t), r = Ga(n.content);
|
|
8654
8729
|
n.role !== "user" || !r || (Xt(r), !Z("quoteMessage", e) && (C.value || a("quoteMessage", e)));
|
|
8655
8730
|
}
|
|
8656
8731
|
function It() {
|
|
@@ -8698,7 +8773,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8698
8773
|
}
|
|
8699
8774
|
async function X() {
|
|
8700
8775
|
if (!Z("attach") && (C.value || a("attach"), rt.value)) try {
|
|
8701
|
-
Kt(await
|
|
8776
|
+
Kt(await Bi(i.pickAttachments, f));
|
|
8702
8777
|
} catch (e) {
|
|
8703
8778
|
Cn(e);
|
|
8704
8779
|
}
|
|
@@ -8723,7 +8798,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8723
8798
|
}
|
|
8724
8799
|
async function Gt(e) {
|
|
8725
8800
|
try {
|
|
8726
|
-
Kt(await
|
|
8801
|
+
Kt(await Vi(e, i.ingestAttachments, f));
|
|
8727
8802
|
} catch (e) {
|
|
8728
8803
|
Cn(e);
|
|
8729
8804
|
}
|
|
@@ -8761,7 +8836,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8761
8836
|
});
|
|
8762
8837
|
}
|
|
8763
8838
|
function Zt(e) {
|
|
8764
|
-
let t =
|
|
8839
|
+
let t = Ji(e);
|
|
8765
8840
|
R.value = t, z.value = t.text, !Z("updateComposerState", t) && (C.value || (a("update:modelValue", t.text), a("update:composerState", t)));
|
|
8766
8841
|
}
|
|
8767
8842
|
function Qt() {
|
|
@@ -8935,10 +9010,10 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8935
9010
|
onDragover: Vt,
|
|
8936
9011
|
onDrop: Ht,
|
|
8937
9012
|
onPasteCapture: Ut
|
|
8938
|
-
}, [vt.value ? (k(), s(
|
|
9013
|
+
}, [vt.value ? (k(), s(Bs, {
|
|
8939
9014
|
key: 0,
|
|
8940
9015
|
class: "codex-conversation-pane__history-loader"
|
|
8941
|
-
})) : (k(), s(
|
|
9016
|
+
})) : (k(), s(Pd, {
|
|
8942
9017
|
key: 1,
|
|
8943
9018
|
class: "codex-conversation-pane__layout",
|
|
8944
9019
|
"scroll-mode": "child"
|
|
@@ -8947,17 +9022,17 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8947
9022
|
ref_key: "footerElement",
|
|
8948
9023
|
ref: y,
|
|
8949
9024
|
class: "codex-conversation-pane__footer"
|
|
8950
|
-
}, [Ie.value ? (k(), l("p",
|
|
9025
|
+
}, [Ie.value ? (k(), l("p", zd, B(Ie.value), 1)) : c("", !0), Oe.value ? (k(), l("div", Bd, [I(n.$slots, "approval", { approval: Oe.value }, () => [(k(), s(ma, {
|
|
8951
9026
|
key: Oe.value.id,
|
|
8952
9027
|
approval: Oe.value,
|
|
8953
9028
|
disabled: Fe.value,
|
|
8954
9029
|
onResolve: r[1] ||= (e, t) => hn(Oe.value.id, e, t)
|
|
8955
|
-
}, null, 8, ["approval", "disabled"]))], !0)])) : we.value ? (k(), s(
|
|
9030
|
+
}, null, 8, ["approval", "disabled"]))], !0)])) : we.value ? (k(), s(us, {
|
|
8956
9031
|
key: we.value.id,
|
|
8957
9032
|
class: "codex-conversation-pane__confirmation-composer",
|
|
8958
9033
|
request: we.value,
|
|
8959
9034
|
onClientResponse: $t
|
|
8960
|
-
}, null, 8, ["request"])) : Se.value ? (k(), s(
|
|
9035
|
+
}, null, 8, ["request"])) : Se.value ? (k(), s(ss, {
|
|
8961
9036
|
key: Se.value.id,
|
|
8962
9037
|
class: "codex-conversation-pane__question-composer",
|
|
8963
9038
|
"answered-client-request-ids": ge.value,
|
|
@@ -8965,7 +9040,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8965
9040
|
onClientResponse: $t
|
|
8966
9041
|
}, null, 8, ["answered-client-request-ids", "request"])) : (k(), l(t, { key: 4 }, [
|
|
8967
9042
|
I(n.$slots, "before-composer", {}, void 0, !0),
|
|
8968
|
-
m(
|
|
9043
|
+
m(Is, {
|
|
8969
9044
|
class: "codex-conversation-pane__composer-shelf",
|
|
8970
9045
|
disabled: Fe.value,
|
|
8971
9046
|
goal: Le.value,
|
|
@@ -8996,7 +9071,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
8996
9071
|
"queued-prompt-steer-disabled",
|
|
8997
9072
|
"turn-git-diff"
|
|
8998
9073
|
]),
|
|
8999
|
-
(k(), s(
|
|
9074
|
+
(k(), s($i, {
|
|
9000
9075
|
key: Y.value ?? "no-conversation",
|
|
9001
9076
|
ref_key: "composer",
|
|
9002
9077
|
ref: v,
|
|
@@ -9053,7 +9128,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
9053
9128
|
"onUpdate:reasoningEffort": vn,
|
|
9054
9129
|
"onUpdate:serviceTier": bn
|
|
9055
9130
|
}, d({
|
|
9056
|
-
"before-meta": G(() => [xe.value.length > 0 ? (k(), l("span",
|
|
9131
|
+
"before-meta": G(() => [xe.value.length > 0 ? (k(), l("span", Vd, [u("button", {
|
|
9057
9132
|
class: "codex-conversation-pane__pending-question-cancel",
|
|
9058
9133
|
type: "button",
|
|
9059
9134
|
"aria-label": "Cancel pending question",
|
|
@@ -9069,8 +9144,8 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
9069
9144
|
type: "button",
|
|
9070
9145
|
"aria-label": xe.value.length === 1 ? "Pending question" : `${xe.value.length} pending questions`,
|
|
9071
9146
|
onClick: r[3] ||= (e) => h.value = xe.value[0].id
|
|
9072
|
-
}, B(xe.value.length === 1 ? "Pending question" : `${xe.value.length} pending questions`), 9,
|
|
9073
|
-
before: G(() => [q.value.length > 0 ? (k(), l("div",
|
|
9147
|
+
}, B(xe.value.length === 1 ? "Pending question" : `${xe.value.length} pending questions`), 9, Hd)])) : c("", !0)]),
|
|
9148
|
+
before: G(() => [q.value.length > 0 ? (k(), l("div", Ud, [(k(!0), l(t, null, F(q.value, (e, t) => (k(), l("div", {
|
|
9074
9149
|
key: e.id,
|
|
9075
9150
|
class: "codex-conversation-pane__attachment"
|
|
9076
9151
|
}, [
|
|
@@ -9079,12 +9154,12 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
9079
9154
|
class: "codex-conversation-pane__attachment-preview",
|
|
9080
9155
|
src: e.previewUrl,
|
|
9081
9156
|
alt: e.name
|
|
9082
|
-
}, null, 8,
|
|
9157
|
+
}, null, 8, Wd)) : (k(), l("span", Gd, "📎")),
|
|
9083
9158
|
u("span", {
|
|
9084
9159
|
class: "codex-conversation-pane__attachment-name",
|
|
9085
9160
|
title: e.name
|
|
9086
|
-
}, B(e.name), 9,
|
|
9087
|
-
u("span",
|
|
9161
|
+
}, B(e.name), 9, Kd),
|
|
9162
|
+
u("span", qd, [I(n.$slots, "composer-attachment-actions", {
|
|
9088
9163
|
attachments: q.value,
|
|
9089
9164
|
index: t,
|
|
9090
9165
|
disabled: Fe.value
|
|
@@ -9094,7 +9169,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
9094
9169
|
"aria-label": `Remove ${e.name}`,
|
|
9095
9170
|
disabled: Fe.value,
|
|
9096
9171
|
onClick: (t) => qt(e.id)
|
|
9097
|
-
}, [m(H(et), { "aria-hidden": "true" })], 8,
|
|
9172
|
+
}, [m(H(et), { "aria-hidden": "true" })], 8, Jd)])
|
|
9098
9173
|
]))), 128))])) : c("", !0), I(n.$slots, "composer-context", { disabled: Fe.value }, void 0, !0)]),
|
|
9099
9174
|
_: 2
|
|
9100
9175
|
}, [
|
|
@@ -9131,7 +9206,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
9131
9206
|
]), 1032, /* @__PURE__ */ "autofocus.attach-enabled.capabilities.can-continue-interrupted-turn.commands.composer-state.context-usage.disabled.draft.empty-send-prompt.follow-up-behavior.files.has-attachments.has-external-content.interrupt-armed.plugins.prompt-history.prompt-history-loading.queued-prompt-id.is-sending.leading-menu-items.menu-items.model-menu-items.mention-groups.model-catalog-status.models.placeholder.approval-preset.plan-mode.presentation.selected-model-id.selected-reasoning-effort.selected-service-tier.skill-catalog-status.skills.transcribe-audio".split("."))),
|
|
9132
9207
|
I(n.$slots, "after-composer", {}, void 0, !0)
|
|
9133
9208
|
], 64))], 512)]),
|
|
9134
|
-
default: G(() => [yt.value ? (k(), s(
|
|
9209
|
+
default: G(() => [yt.value ? (k(), s(Ad, {
|
|
9135
9210
|
key: 0,
|
|
9136
9211
|
ref_key: "messageList",
|
|
9137
9212
|
ref: b,
|
|
@@ -9232,23 +9307,23 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
9232
9307
|
fn: G((e) => [I(n.$slots, "message-tool", w(_(e)), void 0, !0)]),
|
|
9233
9308
|
key: "9"
|
|
9234
9309
|
} : void 0
|
|
9235
|
-
]), 1032, /* @__PURE__ */ "actions-disabled.active-turn-id.answered-client-request-ids.aria-label.busy.can-delete-turn.can-edit-turn.can-fork-turn.can-retry-turn.deleting-turn-id.empty-label.follow-ups-disabled.has-older-messages.hidden-client-request-ids.render-strategy.loading-older-messages.initial-message-batch-size.message-batch-size.message-text-selection.messages.mention-groups.plugins.presentation.reset-key.scroll-to-bottom-label.show-tool-details.skills.tool-visibility.transform-message.turns".split("."))) : (k(), l("div",
|
|
9310
|
+
]), 1032, /* @__PURE__ */ "actions-disabled.active-turn-id.answered-client-request-ids.aria-label.busy.can-delete-turn.can-edit-turn.can-fork-turn.can-retry-turn.deleting-turn-id.empty-label.follow-ups-disabled.has-older-messages.hidden-client-request-ids.render-strategy.loading-older-messages.initial-message-batch-size.message-batch-size.message-text-selection.messages.mention-groups.plugins.presentation.reset-key.scroll-to-bottom-label.show-tool-details.skills.tool-visibility.transform-message.turns".split("."))) : (k(), l("div", Id, [I(n.$slots, "empty", {
|
|
9236
9311
|
title: e.emptyTitle,
|
|
9237
9312
|
description: e.emptyDescription
|
|
9238
|
-
}, () => [u("div",
|
|
9313
|
+
}, () => [u("div", Ld, [u("h1", null, B(e.emptyTitle), 1), e.emptyDescription ? (k(), l("p", Rd, B(e.emptyDescription), 1)) : c("", !0)])], !0)]))]),
|
|
9239
9314
|
_: 3
|
|
9240
|
-
}))], 40,
|
|
9315
|
+
}))], 40, Fd));
|
|
9241
9316
|
}
|
|
9242
|
-
}), [["__scopeId", "data-v-be3ee0f0"]]),
|
|
9317
|
+
}), [["__scopeId", "data-v-be3ee0f0"]]), Xd = {
|
|
9243
9318
|
class: "codex-conversation-sidebar",
|
|
9244
9319
|
"aria-label": "Conversations"
|
|
9245
|
-
},
|
|
9320
|
+
}, Zd = { class: "codex-conversation-sidebar__header" }, Qd = { class: "codex-conversation-sidebar__brand" }, $d = ["disabled"], ef = {
|
|
9246
9321
|
key: 0,
|
|
9247
9322
|
class: "codex-conversation-sidebar__empty"
|
|
9248
|
-
},
|
|
9323
|
+
}, tf = {
|
|
9249
9324
|
key: 1,
|
|
9250
9325
|
class: "codex-conversation-sidebar__list"
|
|
9251
|
-
},
|
|
9326
|
+
}, nf = ["aria-current", "onClick"], rf = ["aria-label", "title"], af = { class: "codex-conversation-sidebar__title" }, of = { class: "codex-conversation-sidebar__time" }, sf = ["aria-label", "onClick"], cf = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
9252
9327
|
__name: "CodexConversationSidebar",
|
|
9253
9328
|
props: {
|
|
9254
9329
|
activeConversationId: { default: null },
|
|
@@ -9280,12 +9355,12 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
9280
9355
|
let n = Math.floor(t / 60);
|
|
9281
9356
|
return n < 24 ? `${n}h` : `${Math.floor(n / 24)}d`;
|
|
9282
9357
|
}
|
|
9283
|
-
return (n, o) => (k(), l("aside",
|
|
9358
|
+
return (n, o) => (k(), l("aside", Xd, [u("div", Zd, [u("span", Qd, B(e.brand), 1), u("button", {
|
|
9284
9359
|
class: "codex-conversation-sidebar__new",
|
|
9285
9360
|
type: "button",
|
|
9286
9361
|
disabled: e.createDisabled,
|
|
9287
9362
|
onClick: o[0] ||= (e) => r("create")
|
|
9288
|
-
}, [...o[1] ||= [u("span", { "aria-hidden": "true" }, "+", -1), p(" New thread ", -1)]], 8,
|
|
9363
|
+
}, [...o[1] ||= [u("span", { "aria-hidden": "true" }, "+", -1), p(" New thread ", -1)]], 8, $d)]), e.conversations.length === 0 ? (k(), l("p", ef, B(e.loading ? "Loading threads…" : "No conversations yet"), 1)) : (k(), l("nav", tf, [(k(!0), l(t, null, F(e.conversations, (t) => (k(), l("div", {
|
|
9289
9364
|
key: t.id,
|
|
9290
9365
|
class: C(["codex-conversation-sidebar__item", { "codex-conversation-sidebar__item--active": t.id === e.activeConversationId }])
|
|
9291
9366
|
}, [u("button", {
|
|
@@ -9298,10 +9373,10 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
9298
9373
|
class: C(["codex-conversation-sidebar__status", `codex-conversation-sidebar__status--${t.status}`]),
|
|
9299
9374
|
"aria-label": `Status: ${t.status}`,
|
|
9300
9375
|
title: t.status
|
|
9301
|
-
}, null, 10,
|
|
9302
|
-
u("span",
|
|
9303
|
-
u("span",
|
|
9304
|
-
], 8,
|
|
9376
|
+
}, null, 10, rf),
|
|
9377
|
+
u("span", af, B(t.title), 1),
|
|
9378
|
+
u("span", of, B(a(t.updatedAt)), 1)
|
|
9379
|
+
], 8, nf), u("button", {
|
|
9305
9380
|
class: "codex-conversation-sidebar__delete",
|
|
9306
9381
|
type: "button",
|
|
9307
9382
|
"aria-label": `Delete ${t.title}`,
|
|
@@ -9311,15 +9386,15 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
9311
9386
|
"aria-hidden": "true",
|
|
9312
9387
|
fill: "none",
|
|
9313
9388
|
viewBox: "0 0 24 24"
|
|
9314
|
-
}, [u("path", { d: "M4 7h16M10 11v6m4-6v6M9 7l1-2h4l1 2m2 0-1 12H8L7 7" })], -1)]], 8,
|
|
9389
|
+
}, [u("path", { d: "M4 7h16M10 11v6m4-6v6M9 7l1-2h4l1 2m2 0-1 12H8L7 7" })], -1)]], 8, sf)], 2))), 128))]))]));
|
|
9315
9390
|
}
|
|
9316
|
-
}), [["__scopeId", "data-v-97c47314"]]),
|
|
9391
|
+
}), [["__scopeId", "data-v-97c47314"]]), lf = { class: "chat-composer-file-menu__section" }, uf = ["onMousedown"], df = { class: "chat-composer-file-menu__name" }, ff = { class: "chat-composer-file-menu__path" }, pf = {
|
|
9317
9392
|
key: 0,
|
|
9318
9393
|
class: "chat-composer-file-menu__hint"
|
|
9319
|
-
},
|
|
9394
|
+
}, mf = {
|
|
9320
9395
|
key: 1,
|
|
9321
9396
|
class: "chat-composer-file-menu__empty"
|
|
9322
|
-
},
|
|
9397
|
+
}, hf = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
9323
9398
|
__name: "ChatComposerFileMentionMenu",
|
|
9324
9399
|
props: {
|
|
9325
9400
|
activeIndex: {},
|
|
@@ -9340,7 +9415,7 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
9340
9415
|
role: "listbox",
|
|
9341
9416
|
"aria-label": "Files"
|
|
9342
9417
|
}, [
|
|
9343
|
-
u("div",
|
|
9418
|
+
u("div", lf, B(H(r)("chat.files.title")), 1),
|
|
9344
9419
|
(k(!0), l(t, null, F(e.visibleFiles, (t, r) => (k(), l("button", {
|
|
9345
9420
|
key: t.path,
|
|
9346
9421
|
class: C(["chat-composer-file-menu__item", { "chat-composer-file-menu__item--active": r === e.activeIndex }]),
|
|
@@ -9352,16 +9427,16 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
9352
9427
|
class: "chat-composer-file-menu__icon",
|
|
9353
9428
|
"aria-hidden": "true"
|
|
9354
9429
|
}),
|
|
9355
|
-
u("span",
|
|
9356
|
-
u("span",
|
|
9357
|
-
], 42,
|
|
9358
|
-
e.showHint ? (k(), l("div",
|
|
9430
|
+
u("span", df, B(t.name), 1),
|
|
9431
|
+
u("span", ff, B(t.path), 1)
|
|
9432
|
+
], 42, uf))), 128)),
|
|
9433
|
+
e.showHint ? (k(), l("div", pf, B(H(r)("chat.files.hint")), 1)) : e.visibleFiles.length === 0 ? (k(), l("div", mf, B(H(r)("chat.files.empty")), 1)) : c("", !0)
|
|
9359
9434
|
], 512));
|
|
9360
9435
|
}
|
|
9361
|
-
}), [["__scopeId", "data-v-122fc71c"]]),
|
|
9436
|
+
}), [["__scopeId", "data-v-122fc71c"]]), gf = ["onMousedown"], _f = ["src"], vf = { class: "chat-composer-plugin-menu__main" }, yf = { class: "chat-composer-plugin-menu__name" }, bf = { class: "chat-composer-plugin-menu__description" }, xf = {
|
|
9362
9437
|
key: 0,
|
|
9363
9438
|
class: "chat-composer-plugin-menu__empty"
|
|
9364
|
-
},
|
|
9439
|
+
}, Sf = /*#__PURE__*/ X(/* @__PURE__ */ h({
|
|
9365
9440
|
__name: "ChatComposerPluginMenu",
|
|
9366
9441
|
props: {
|
|
9367
9442
|
activeIndex: {},
|
|
@@ -9395,24 +9470,24 @@ var ed = ["aria-busy", "aria-label"], td = ["title"], nd = ["title"], rd = /*#__
|
|
|
9395
9470
|
alt: "",
|
|
9396
9471
|
"aria-hidden": "true",
|
|
9397
9472
|
referrerpolicy: "no-referrer"
|
|
9398
|
-
}, null, 8,
|
|
9473
|
+
}, null, 8, _f)) : (k(), s(H(Ie), {
|
|
9399
9474
|
key: 1,
|
|
9400
9475
|
class: "chat-composer-plugin-menu__icon",
|
|
9401
9476
|
"aria-hidden": "true"
|
|
9402
|
-
})), u("span",
|
|
9403
|
-
e.visiblePlugins.length === 0 ? (k(), l("div",
|
|
9477
|
+
})), u("span", vf, [u("span", yf, B(H(gr)(t)), 1), u("span", bf, B(H(_r)(t)), 1)])], 42, gf))), 128)),
|
|
9478
|
+
e.visiblePlugins.length === 0 ? (k(), l("div", xf, "No matching plugins")) : c("", !0)
|
|
9404
9479
|
], 512));
|
|
9405
9480
|
}
|
|
9406
|
-
}), [["__scopeId", "data-v-336657b0"]]),
|
|
9407
|
-
function
|
|
9408
|
-
return
|
|
9409
|
-
id: `queued-prompt-${
|
|
9481
|
+
}), [["__scopeId", "data-v-336657b0"]]), Cf = 0;
|
|
9482
|
+
function wf(e) {
|
|
9483
|
+
return Cf += 1, {
|
|
9484
|
+
id: `queued-prompt-${Cf}`,
|
|
9410
9485
|
text: e
|
|
9411
9486
|
};
|
|
9412
9487
|
}
|
|
9413
9488
|
//#endregion
|
|
9414
9489
|
//#region src/use-codex-surface.ts
|
|
9415
|
-
var
|
|
9490
|
+
var Tf = {
|
|
9416
9491
|
status: "idle",
|
|
9417
9492
|
authentication: {
|
|
9418
9493
|
status: "notLoaded",
|
|
@@ -9457,8 +9532,8 @@ var xf = {
|
|
|
9457
9532
|
historyLoading: !1,
|
|
9458
9533
|
error: null
|
|
9459
9534
|
};
|
|
9460
|
-
function
|
|
9461
|
-
let t = j(structuredClone(
|
|
9535
|
+
function Ef(e) {
|
|
9536
|
+
let t = j(structuredClone(Tf)), n = j(/* @__PURE__ */ new Set()), r = M(n), i = z(null), a = /* @__PURE__ */ new Set(), o = 0, s = (e) => {
|
|
9462
9537
|
Object.assign(t, e), n.clear();
|
|
9463
9538
|
for (let t of e.answeredClientRequestIds) n.add(t);
|
|
9464
9539
|
}, c = At(e, (e) => {
|
|
@@ -9520,7 +9595,7 @@ function Sf(e) {
|
|
|
9520
9595
|
}
|
|
9521
9596
|
//#endregion
|
|
9522
9597
|
//#region src/use-codex-live-chat.ts
|
|
9523
|
-
function
|
|
9598
|
+
function Df(e) {
|
|
9524
9599
|
let t = N("idle"), n = N(null), r = N(!1), i = N([]), a, o = !1;
|
|
9525
9600
|
function s(t) {
|
|
9526
9601
|
if (!(!("conversationId" in t) || t.conversationId !== e.conversationId)) {
|
|
@@ -9581,7 +9656,7 @@ function Cf(e) {
|
|
|
9581
9656
|
let a = new Audio();
|
|
9582
9657
|
if (a.autoplay = !0, u.audio = a, i.ontrack = (e) => {
|
|
9583
9658
|
a.srcObject = e.streams[0] ?? new MediaStream([e.track]), a.play().catch((e) => {
|
|
9584
|
-
u.cancelled || (n.value =
|
|
9659
|
+
u.cancelled || (n.value = Of(e), d().catch(() => void 0));
|
|
9585
9660
|
});
|
|
9586
9661
|
}, i.onconnectionstatechange = () => {
|
|
9587
9662
|
u.cancelled || (i.connectionState === "connected" && (clearTimeout(u.timer), t.value = "connected"), (i.connectionState === "failed" || i.connectionState === "closed") && (n.value = "Live chat connection ended", d().catch(() => void 0)));
|
|
@@ -9601,7 +9676,7 @@ function Cf(e) {
|
|
|
9601
9676
|
n.value = "Timed out connecting live chat", d().catch(() => void 0);
|
|
9602
9677
|
}, 3e4));
|
|
9603
9678
|
} catch (e) {
|
|
9604
|
-
if (!u.cancelled) throw n.value =
|
|
9679
|
+
if (!u.cancelled) throw n.value = Of(e), t.value = "error", c(u), await l(u).catch(() => void 0), a === u && (a = void 0), e;
|
|
9605
9680
|
} finally {
|
|
9606
9681
|
u.cancelled && c(u);
|
|
9607
9682
|
}
|
|
@@ -9613,7 +9688,7 @@ function Cf(e) {
|
|
|
9613
9688
|
try {
|
|
9614
9689
|
e.requested && await e.done?.catch(() => void 0), await l(e);
|
|
9615
9690
|
} catch (e) {
|
|
9616
|
-
throw n.value =
|
|
9691
|
+
throw n.value = Of(e), e;
|
|
9617
9692
|
} finally {
|
|
9618
9693
|
a === e && (a = void 0), t.value = n.value ? "error" : "idle";
|
|
9619
9694
|
}
|
|
@@ -9636,16 +9711,16 @@ function Cf(e) {
|
|
|
9636
9711
|
setMuted: f
|
|
9637
9712
|
};
|
|
9638
9713
|
}
|
|
9639
|
-
function
|
|
9714
|
+
function Of(e) {
|
|
9640
9715
|
return e instanceof Error ? e.message : String(e);
|
|
9641
9716
|
}
|
|
9642
9717
|
//#endregion
|
|
9643
9718
|
//#region src/codex-theme.ts
|
|
9644
|
-
function
|
|
9719
|
+
function kf(e, t = {}) {
|
|
9645
9720
|
let n = e.getAttribute("data-codex-theme"), r = /* @__PURE__ */ new Map(), i = t.mode ?? "system";
|
|
9646
9721
|
e.setAttribute("data-codex-theme", i);
|
|
9647
9722
|
for (let [n, i] of Object.entries(t.tokens ?? {})) {
|
|
9648
|
-
let t =
|
|
9723
|
+
let t = Af(n);
|
|
9649
9724
|
r.has(t) || r.set(t, e.style.getPropertyValue(t)), i == null || !i.trim() ? e.style.removeProperty(t) : e.style.setProperty(t, i);
|
|
9650
9725
|
}
|
|
9651
9726
|
return () => {
|
|
@@ -9653,7 +9728,7 @@ function Tf(e, t = {}) {
|
|
|
9653
9728
|
for (let [t, n] of r) n ? e.style.setProperty(t, n) : e.style.removeProperty(t);
|
|
9654
9729
|
};
|
|
9655
9730
|
}
|
|
9656
|
-
function
|
|
9731
|
+
function Af(e) {
|
|
9657
9732
|
let t = e.trim();
|
|
9658
9733
|
if (t.startsWith("--codex-")) return t;
|
|
9659
9734
|
let n = t.replace(/^--/, "").replace(/([a-z\d])([A-Z])/g, "$1-$2").replace(/[^a-zA-Z\d-]+/g, "-").replace(/^-+|-+$/g, "").toLowerCase();
|
|
@@ -9661,6 +9736,6 @@ function Ef(e) {
|
|
|
9661
9736
|
return `--codex-${n}`;
|
|
9662
9737
|
}
|
|
9663
9738
|
//#endregion
|
|
9664
|
-
export {
|
|
9739
|
+
export { So as CodexAnimatedDiffStat, ma as CodexApprovalPrompt, sc as CodexAttachmentBlock, ld as CodexCompactionMessage, $i as CodexComposer, ln as CodexComposerActionMenu, Gt as CodexComposerActiveModes, Ar as CodexComposerAtMentionMenu, ys as CodexComposerDrawer, ws as CodexComposerDrawerRow, hf as CodexComposerFileMentionMenu, sn as CodexComposerMenu, an as CodexComposerMenuList, Sf as CodexComposerPluginMenu, Vt as CodexComposerSendButton, Is as CodexComposerShelf, Gr as CodexComposerSkillMenu, si as CodexComposerSlashMenu, dn as CodexComposerVoiceButton, _n as CodexComposerVoiceField, nr as CodexContextUsageIndicator, Bs as CodexConversationHistoryLoader, Yd as CodexConversationPane, cf as CodexConversationSidebar, pc as CodexFoldTransition, uc as CodexFollowUps, hs as CodexGoal, Ys as CodexIconButton, ec as CodexImageLightbox, kc as CodexMediaBlock, di as CodexMentionChip, Wc as CodexMermaidBlock, xd as CodexMessage, sd as CodexMessageActions, $u as CodexMessageBlock, pd as CodexMessageEditor, Ad as CodexMessageList, Cd as CodexMessageTurn, ur as CodexModelReasoningSelector, ss as CodexQuestionRequest, ks as CodexQueuedPrompt, As as CodexQueuedPrompts, hi as CodexRichTextEditor, Td as CodexScrollToBottom, pu as CodexToolCall, Fo as CodexToolCallTitle, ls as CodexToolConfirmation, bu as CodexToolGroup, Co as CodexToolIcon, os as CodexToolUserInputRequest, Ns as CodexTurnGitInfo, ar as CodexUltrafastIcon, Ru as CodexUserText, Bu as CodexVisualizationBlock, Xu as CodexWorkGroup, Pd as CodexWorkbenchLayout, kf as applyCodexTheme, qt as approvalPresetOptions, Nt as codexCapabilities, Pt as codexCommands, yn as codexConversationLinkFromHref, Jr as commandDescription, ga as createCodexConversationPaneController, wf as createQueuedChatPrompt, Kt as defaultApprovalPreset, Qn as defaultCodexChatTranslate, jt as defaultCodexConversationPresentation, qr as filterComposerCommands, fi as filterComposerMentionGroups, hr as filterComposerPlugins, Mr as filterComposerSkills, pi as findComposerMention, Ri as getCodexGlobalHostCapabilities, zi as getCodexNativeRendererApi, ku as humanizeMentionName, Vi as ingestCodexAttachments, Jt as isApprovalPreset, rl as languageForFilePath, xu as parseAuthoredUserText, vn as parseCodexEditorFileReference, Cu as parseCodexUserText, Bi as pickCodexAttachments, _r as pluginDescription, gr as pluginDisplayName, vr as pluginInsertText, yr as pluginMatchesMention, Lr as promptSkillInputsFromText, Xn as provideCodexChatTranslate, Ii as provideCodexHostCapabilities, ql as provideCodexToolCallDetails, Wl as provideCodexToolPresentation, Tn as registerCodexToolTitlePresenter, nl as renderCodeBlock, ll as renderMarkdown, ha as resolveCodexConversationPaneValue, Mt as resolveCodexConversationPresentation, Pr as skillDescription, Nr as skillDisplayName, Fr as skillInsertText, Ir as skillMatchesMention, xa as surfaceMessageToChatMessage, $ as toCodexChatMessage, ba as toCodexChatMessages, Zn as useCodexChatTranslate, Ki as useCodexComposerVoice, Li as useCodexHostCapabilities, Df as useCodexLiveChat, Ef as useCodexSurface, Jl as useCodexToolCallDetails, Gl as useCodexToolPresentation };
|
|
9665
9740
|
|
|
9666
9741
|
//# sourceMappingURL=index.js.map
|