@opengeni/react 0.42.1 → 0.44.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/{chunk-SJKT4TKW.js → chunk-23EJ676W.js} +3 -1
- package/dist/chunk-23EJ676W.js.map +1 -0
- package/dist/{chunk-UWYTCQWW.js → chunk-KC27K42G.js} +92 -21
- package/dist/{chunk-UWYTCQWW.js.map → chunk-KC27K42G.js.map} +1 -1
- package/dist/{chunk-KR2SK5GJ.js → chunk-KG5F2OKE.js} +260 -93
- package/dist/chunk-KG5F2OKE.js.map +1 -0
- package/dist/{chunk-4IJCL7YO.js → chunk-LWR4MXSS.js} +4 -1
- package/dist/chunk-LWR4MXSS.js.map +1 -0
- package/dist/{chunk-JALF5FI3.js → chunk-SRFUT2ZU.js} +2 -2
- package/dist/{chunk-WZT5G5OR.js → chunk-U6K24XQD.js} +5 -4
- package/dist/{chunk-WZT5G5OR.js.map → chunk-U6K24XQD.js.map} +1 -1
- package/dist/components/chat-composer.d.ts +5 -1
- package/dist/components/composer-transcription-control.d.ts +3 -1
- package/dist/components/composer.d.ts +6 -4
- package/dist/components/session-chrome.d.ts +1 -1
- package/dist/composer.js +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +69 -20
- package/dist/index.js.map +1 -1
- package/dist/model-policy.d.ts +2 -0
- package/dist/model-policy.js +1 -1
- package/dist/realtime/realtime-control.d.ts +29 -1
- package/dist/realtime.d.ts +1 -1
- package/dist/realtime.js +269 -151
- package/dist/realtime.js.map +1 -1
- package/dist/session-ui.js +2 -2
- package/dist/session.js +2 -2
- package/dist/timeline/index.d.ts +1 -1
- package/dist/timeline/parsers.d.ts +13 -8
- package/package.json +2 -2
- package/src/components/chat-composer.tsx +58 -19
- package/src/components/composer-transcription-control.tsx +194 -165
- package/src/components/composer.tsx +78 -14
- package/src/components/model-policy-picker.tsx +7 -2
- package/src/components/session-chrome.tsx +89 -78
- package/src/index.ts +2 -0
- package/src/model-policy.ts +4 -0
- package/src/realtime/realtime-control.tsx +307 -137
- package/src/realtime.ts +1 -0
- package/src/timeline/index.ts +2 -0
- package/src/timeline/parsers.ts +201 -19
- package/src/timeline/projection.ts +11 -0
- package/src/timeline/tool-renderers.tsx +7 -5
- package/src/timeline/turn-summary.tsx +7 -2
- package/styles/tokens.css +8 -5
- package/dist/chunk-4IJCL7YO.js.map +0 -1
- package/dist/chunk-KR2SK5GJ.js.map +0 -1
- package/dist/chunk-SJKT4TKW.js.map +0 -1
- /package/dist/{chunk-JALF5FI3.js.map → chunk-SRFUT2ZU.js.map} +0 -0
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
groupTimeline,
|
|
8
8
|
mcpToolLeaf,
|
|
9
9
|
toolDisplayName
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LWR4MXSS.js";
|
|
11
11
|
import {
|
|
12
12
|
Tooltip,
|
|
13
13
|
TooltipContent,
|
|
@@ -301,7 +301,7 @@ function SessionChrome({
|
|
|
301
301
|
const chipRefs = useRef({});
|
|
302
302
|
const railRef = useRef(null);
|
|
303
303
|
const panelBodyRef = useRef(null);
|
|
304
|
-
const [pill, setPill] = useState({ left: 0, width: 0, opacity: 0 });
|
|
304
|
+
const [pill, setPill] = useState({ left: 0, top: 0, width: 0, height: 0, opacity: 0 });
|
|
305
305
|
const [panelHeight, setPanelHeight] = useState(0);
|
|
306
306
|
const signalIds = signals.map((signal) => signal.id).join(",");
|
|
307
307
|
useEffect(() => {
|
|
@@ -329,7 +329,9 @@ function SessionChrome({
|
|
|
329
329
|
const chipBox = chip.getBoundingClientRect();
|
|
330
330
|
setPill({
|
|
331
331
|
left: chipBox.left - railBox.left,
|
|
332
|
+
top: chipBox.top - railBox.top,
|
|
332
333
|
width: chipBox.width,
|
|
334
|
+
height: chipBox.height,
|
|
333
335
|
opacity: 1
|
|
334
336
|
});
|
|
335
337
|
};
|
|
@@ -337,6 +339,9 @@ function SessionChrome({
|
|
|
337
339
|
if (!rail) return;
|
|
338
340
|
const observer = new ResizeObserver(measure);
|
|
339
341
|
observer.observe(rail);
|
|
342
|
+
for (const chip of Object.values(chipRefs.current)) {
|
|
343
|
+
if (chip) observer.observe(chip);
|
|
344
|
+
}
|
|
340
345
|
window.addEventListener("resize", measure);
|
|
341
346
|
return () => {
|
|
342
347
|
observer.disconnect();
|
|
@@ -429,87 +434,95 @@ function SessionChrome({
|
|
|
429
434
|
transitionTimingFunction: "var(--og-session-chrome-ease)"
|
|
430
435
|
},
|
|
431
436
|
children: [
|
|
432
|
-
/* @__PURE__ */
|
|
437
|
+
/* @__PURE__ */ jsx2(
|
|
433
438
|
"div",
|
|
434
439
|
{
|
|
435
|
-
|
|
436
|
-
className: "relative flex flex-wrap items-stretch",
|
|
440
|
+
className: "relative",
|
|
437
441
|
style: {
|
|
438
|
-
|
|
439
|
-
|
|
442
|
+
paddingTop: "var(--og-session-chrome-rail-pad)",
|
|
443
|
+
paddingBottom: "var(--og-session-chrome-rail-pad)",
|
|
444
|
+
paddingLeft: "var(--og-session-chrome-rail-pad)",
|
|
445
|
+
paddingRight: "var(--og-session-chrome-rail-pad)"
|
|
440
446
|
},
|
|
441
|
-
children:
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
top: "var(--og-session-chrome-rail-pad)",
|
|
449
|
-
bottom: "var(--og-session-chrome-rail-pad)",
|
|
450
|
-
background: "var(--og-session-chrome-highlight)"
|
|
451
|
-
},
|
|
452
|
-
initial: false,
|
|
453
|
-
animate: {
|
|
454
|
-
x: pill.left,
|
|
455
|
-
width: pill.width,
|
|
456
|
-
opacity: pill.opacity
|
|
457
|
-
},
|
|
458
|
-
transition: { duration: shellDuration, ease }
|
|
459
|
-
}
|
|
460
|
-
),
|
|
461
|
-
signals.map((signal) => {
|
|
462
|
-
const selected = active === signal.id;
|
|
463
|
-
return /* @__PURE__ */ jsxs2(
|
|
464
|
-
"button",
|
|
465
|
-
{
|
|
466
|
-
type: "button",
|
|
467
|
-
ref: (node) => {
|
|
468
|
-
chipRefs.current[signal.id] = node;
|
|
469
|
-
},
|
|
470
|
-
"aria-expanded": selected,
|
|
471
|
-
"aria-controls": panelId,
|
|
472
|
-
"data-testid": `session-chrome-${signal.id}`,
|
|
473
|
-
"data-og-session-chrome-signal": signal.id,
|
|
474
|
-
onClick: () => setActive(selected ? null : signal.id),
|
|
475
|
-
className: cn(
|
|
476
|
-
"group relative z-[1] inline-flex min-h-[var(--og-session-chrome-chip-min-height)] max-w-full items-center gap-1 rounded-og-md text-left text-og-xs outline-none",
|
|
477
|
-
"transition-colors duration-150 motion-reduce:transition-none",
|
|
478
|
-
"hover:text-og-fg focus-visible:ring-2 focus-visible:ring-og-accent/40",
|
|
479
|
-
"pointer-coarse:min-h-11",
|
|
480
|
-
selected ? "text-og-fg" : "text-og-fg-muted"
|
|
481
|
-
),
|
|
482
|
-
style: {
|
|
483
|
-
paddingInline: "var(--og-session-chrome-chip-pad-x)"
|
|
484
|
-
},
|
|
485
|
-
children: [
|
|
486
|
-
/* @__PURE__ */ jsx2("span", { className: cn("shrink-0", toneClass(signal.tone, selected)), children: signal.icon }),
|
|
487
|
-
/* @__PURE__ */ jsx2("span", { className: "shrink-0 font-medium text-og-fg", children: signal.label }),
|
|
488
|
-
signal.detail ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
489
|
-
/* @__PURE__ */ jsx2("span", { "aria-hidden": true, className: "shrink-0 text-og-fg-subtle/60", children: "\xB7" }),
|
|
490
|
-
/* @__PURE__ */ jsx2("span", { className: "min-w-0 max-w-[8.5rem] truncate text-og-fg sm:max-w-[12rem]", children: signal.detail })
|
|
491
|
-
] }) : null
|
|
492
|
-
]
|
|
493
|
-
},
|
|
494
|
-
signal.id
|
|
495
|
-
);
|
|
496
|
-
}),
|
|
497
|
-
/* @__PURE__ */ jsx2(AnimatePresence, { initial: false, children: open ? /* @__PURE__ */ jsx2(
|
|
498
|
-
motion.button,
|
|
499
|
-
{
|
|
500
|
-
type: "button",
|
|
501
|
-
"aria-label": "Close session chrome panel",
|
|
502
|
-
onClick: () => setActive(null),
|
|
503
|
-
initial: reduceMotion ? false : { opacity: 0 },
|
|
504
|
-
animate: { opacity: 1 },
|
|
505
|
-
exit: reduceMotion ? { opacity: 1 } : { opacity: 0 },
|
|
506
|
-
transition: { duration: crossfadeDuration, ease },
|
|
507
|
-
className: "relative z-[1] ml-auto inline-flex size-7 shrink-0 items-center justify-center rounded-og-md text-og-fg-subtle outline-none transition-colors hover:bg-og-surface-3/60 hover:text-og-fg focus-visible:ring-2 focus-visible:ring-og-accent/40 pointer-coarse:size-11",
|
|
508
|
-
children: /* @__PURE__ */ jsx2(XIcon, { className: "size-3" })
|
|
447
|
+
children: /* @__PURE__ */ jsxs2(
|
|
448
|
+
"div",
|
|
449
|
+
{
|
|
450
|
+
ref: railRef,
|
|
451
|
+
className: "relative flex flex-wrap items-center",
|
|
452
|
+
style: {
|
|
453
|
+
gap: "var(--og-session-chrome-chip-gap)"
|
|
509
454
|
},
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
455
|
+
children: [
|
|
456
|
+
/* @__PURE__ */ jsx2(
|
|
457
|
+
motion.div,
|
|
458
|
+
{
|
|
459
|
+
"aria-hidden": true,
|
|
460
|
+
className: "pointer-events-none absolute left-0 top-0 rounded-og-md",
|
|
461
|
+
style: {
|
|
462
|
+
background: "var(--og-session-chrome-highlight)",
|
|
463
|
+
boxShadow: "inset 0 0 0 1px var(--og-session-chrome-highlight-ring)"
|
|
464
|
+
},
|
|
465
|
+
initial: false,
|
|
466
|
+
animate: {
|
|
467
|
+
x: pill.left,
|
|
468
|
+
y: pill.top,
|
|
469
|
+
width: pill.width,
|
|
470
|
+
height: pill.height,
|
|
471
|
+
opacity: pill.opacity
|
|
472
|
+
},
|
|
473
|
+
transition: { duration: shellDuration, ease }
|
|
474
|
+
}
|
|
475
|
+
),
|
|
476
|
+
signals.map((signal) => {
|
|
477
|
+
const selected = active === signal.id;
|
|
478
|
+
return /* @__PURE__ */ jsxs2(
|
|
479
|
+
"button",
|
|
480
|
+
{
|
|
481
|
+
type: "button",
|
|
482
|
+
ref: (node) => {
|
|
483
|
+
chipRefs.current[signal.id] = node;
|
|
484
|
+
},
|
|
485
|
+
"aria-expanded": selected,
|
|
486
|
+
"aria-controls": panelId,
|
|
487
|
+
"aria-label": selected ? `Close ${signal.label}` : void 0,
|
|
488
|
+
"data-testid": `session-chrome-${signal.id}`,
|
|
489
|
+
"data-og-session-chrome-signal": signal.id,
|
|
490
|
+
onClick: () => setActive(selected ? null : signal.id),
|
|
491
|
+
className: cn(
|
|
492
|
+
"group relative z-[1] inline-flex min-h-[var(--og-session-chrome-chip-min-height)] max-w-full items-center gap-1 rounded-og-md py-1 text-left text-og-xs outline-none",
|
|
493
|
+
// Coarse pointers keep a 44px target (session-pins acceptance).
|
|
494
|
+
"pointer-coarse:min-h-11",
|
|
495
|
+
"transition-colors duration-150 motion-reduce:transition-none",
|
|
496
|
+
"hover:text-og-fg focus-visible:bg-og-surface-3/50",
|
|
497
|
+
selected ? "text-og-fg" : "text-og-fg-muted"
|
|
498
|
+
),
|
|
499
|
+
style: {
|
|
500
|
+
paddingInline: "var(--og-session-chrome-chip-pad-x)"
|
|
501
|
+
},
|
|
502
|
+
children: [
|
|
503
|
+
/* @__PURE__ */ jsx2("span", { className: cn("shrink-0", toneClass(signal.tone, selected)), children: signal.icon }),
|
|
504
|
+
/* @__PURE__ */ jsx2("span", { className: "shrink-0 font-medium text-og-fg", children: signal.label }),
|
|
505
|
+
signal.detail ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
506
|
+
/* @__PURE__ */ jsx2("span", { "aria-hidden": true, className: "shrink-0 text-og-fg-subtle/60", children: "\xB7" }),
|
|
507
|
+
/* @__PURE__ */ jsx2("span", { className: "min-w-0 max-w-[8.5rem] truncate text-og-fg sm:max-w-[12rem]", children: signal.detail })
|
|
508
|
+
] }) : null,
|
|
509
|
+
selected ? /* @__PURE__ */ jsx2(
|
|
510
|
+
"span",
|
|
511
|
+
{
|
|
512
|
+
"data-testid": "session-chrome-close",
|
|
513
|
+
className: "ml-0.5 inline-flex size-4 shrink-0 items-center justify-center rounded-og-sm text-og-fg-subtle transition-colors group-hover:text-og-fg pointer-coarse:size-5",
|
|
514
|
+
"aria-hidden": true,
|
|
515
|
+
children: /* @__PURE__ */ jsx2(XIcon, { className: "size-3" })
|
|
516
|
+
}
|
|
517
|
+
) : null
|
|
518
|
+
]
|
|
519
|
+
},
|
|
520
|
+
signal.id
|
|
521
|
+
);
|
|
522
|
+
})
|
|
523
|
+
]
|
|
524
|
+
}
|
|
525
|
+
)
|
|
513
526
|
}
|
|
514
527
|
),
|
|
515
528
|
/* @__PURE__ */ jsx2(
|
|
@@ -1636,20 +1649,170 @@ function v4aToGitFileDiff(op) {
|
|
|
1636
1649
|
truncated: false
|
|
1637
1650
|
};
|
|
1638
1651
|
}
|
|
1652
|
+
var BEGIN_PATCH = "*** Begin Patch";
|
|
1653
|
+
var END_PATCH = "*** End Patch";
|
|
1654
|
+
var ADD_FILE = "*** Add File: ";
|
|
1655
|
+
var DELETE_FILE = "*** Delete File: ";
|
|
1656
|
+
var UPDATE_FILE = "*** Update File: ";
|
|
1657
|
+
var MOVE_TO = "*** Move to: ";
|
|
1658
|
+
var APPLY_PATCH_OP_TYPES = /* @__PURE__ */ new Set(["create_file", "update_file", "delete_file"]);
|
|
1659
|
+
function isRecord(value) {
|
|
1660
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
1661
|
+
}
|
|
1662
|
+
function freeformApplyPatchOps(rawPatch) {
|
|
1663
|
+
return parseFreeformApplyPatch(rawPatch.trimStart());
|
|
1664
|
+
}
|
|
1665
|
+
function asApplyPatchOperation(value) {
|
|
1666
|
+
if (!isRecord(value)) return null;
|
|
1667
|
+
if (typeof value.type !== "string" || !APPLY_PATCH_OP_TYPES.has(value.type)) {
|
|
1668
|
+
return null;
|
|
1669
|
+
}
|
|
1670
|
+
if (typeof value.path !== "string" || !value.path) {
|
|
1671
|
+
return null;
|
|
1672
|
+
}
|
|
1673
|
+
const op = {
|
|
1674
|
+
type: value.type,
|
|
1675
|
+
path: value.path
|
|
1676
|
+
};
|
|
1677
|
+
if (typeof value.diff === "string") op.diff = value.diff;
|
|
1678
|
+
if (typeof value.moveTo === "string" && value.moveTo.length > 0) op.moveTo = value.moveTo;
|
|
1679
|
+
return op;
|
|
1680
|
+
}
|
|
1681
|
+
function parseStructuredOperations(payloads) {
|
|
1682
|
+
if (payloads.length === 0) return [];
|
|
1683
|
+
const operations = [];
|
|
1684
|
+
for (const payload of payloads) {
|
|
1685
|
+
const op = asApplyPatchOperation(payload);
|
|
1686
|
+
if (!op) return [];
|
|
1687
|
+
operations.push(op);
|
|
1688
|
+
}
|
|
1689
|
+
return operations;
|
|
1690
|
+
}
|
|
1691
|
+
function parseFreeformApplyPatch(rawPatch) {
|
|
1692
|
+
const lines = rawPatch.split(/\r?\n/);
|
|
1693
|
+
if (lines.at(-1) === "") lines.pop();
|
|
1694
|
+
if (lines[0] !== BEGIN_PATCH) return [];
|
|
1695
|
+
if (lines.length < 2 || lines.at(-1) !== END_PATCH) return [];
|
|
1696
|
+
const operations = [];
|
|
1697
|
+
let index = 1;
|
|
1698
|
+
while (index < lines.length - 1) {
|
|
1699
|
+
const line = lines[index];
|
|
1700
|
+
let parsed = null;
|
|
1701
|
+
if (line.startsWith(ADD_FILE)) parsed = parseAddFilePatch(lines, index);
|
|
1702
|
+
else if (line.startsWith(DELETE_FILE)) parsed = parseDeleteFilePatch(lines, index);
|
|
1703
|
+
else if (line.startsWith(UPDATE_FILE)) parsed = parseUpdateFilePatch(lines, index);
|
|
1704
|
+
else return [];
|
|
1705
|
+
if (!parsed || "error" in parsed) return [];
|
|
1706
|
+
operations.push(parsed.operation);
|
|
1707
|
+
index = parsed.nextIndex;
|
|
1708
|
+
}
|
|
1709
|
+
return operations.length > 0 ? operations : [];
|
|
1710
|
+
}
|
|
1711
|
+
function parsePatchHeader(line, prefix) {
|
|
1712
|
+
const path = line.slice(prefix.length).trim();
|
|
1713
|
+
return path || null;
|
|
1714
|
+
}
|
|
1715
|
+
function isFileOperationHeader(line) {
|
|
1716
|
+
return line.startsWith(ADD_FILE) || line.startsWith(DELETE_FILE) || line.startsWith(UPDATE_FILE);
|
|
1717
|
+
}
|
|
1718
|
+
function joinDiff(lines) {
|
|
1719
|
+
return `${lines.join("\n")}
|
|
1720
|
+
`;
|
|
1721
|
+
}
|
|
1722
|
+
function parseAddFilePatch(lines, index) {
|
|
1723
|
+
const path = parsePatchHeader(lines[index], ADD_FILE);
|
|
1724
|
+
if (!path) return { error: true };
|
|
1725
|
+
index += 1;
|
|
1726
|
+
const diffLines = [];
|
|
1727
|
+
while (index < lines.length - 1 && !isFileOperationHeader(lines[index])) {
|
|
1728
|
+
const line = lines[index];
|
|
1729
|
+
if (!line.startsWith("+")) return { error: true };
|
|
1730
|
+
diffLines.push(line);
|
|
1731
|
+
index += 1;
|
|
1732
|
+
}
|
|
1733
|
+
if (diffLines.length === 0) return { error: true };
|
|
1734
|
+
return {
|
|
1735
|
+
operation: { type: "create_file", path, diff: joinDiff(diffLines) },
|
|
1736
|
+
nextIndex: index
|
|
1737
|
+
};
|
|
1738
|
+
}
|
|
1739
|
+
function parseDeleteFilePatch(lines, index) {
|
|
1740
|
+
const path = parsePatchHeader(lines[index], DELETE_FILE);
|
|
1741
|
+
if (!path) return { error: true };
|
|
1742
|
+
index += 1;
|
|
1743
|
+
if (index < lines.length - 1 && !isFileOperationHeader(lines[index])) {
|
|
1744
|
+
return { error: true };
|
|
1745
|
+
}
|
|
1746
|
+
return { operation: { type: "delete_file", path }, nextIndex: index };
|
|
1747
|
+
}
|
|
1748
|
+
function parseUpdateFilePatch(lines, index) {
|
|
1749
|
+
const path = parsePatchHeader(lines[index], UPDATE_FILE);
|
|
1750
|
+
if (!path) return { error: true };
|
|
1751
|
+
index += 1;
|
|
1752
|
+
let moveTo;
|
|
1753
|
+
if (index < lines.length - 1 && lines[index].startsWith(MOVE_TO)) {
|
|
1754
|
+
const parsedMoveTo = parsePatchHeader(lines[index], MOVE_TO);
|
|
1755
|
+
if (!parsedMoveTo) return { error: true };
|
|
1756
|
+
moveTo = parsedMoveTo;
|
|
1757
|
+
index += 1;
|
|
1758
|
+
}
|
|
1759
|
+
const diffLines = [];
|
|
1760
|
+
while (index < lines.length - 1 && !isFileOperationHeader(lines[index])) {
|
|
1761
|
+
diffLines.push(lines[index]);
|
|
1762
|
+
index += 1;
|
|
1763
|
+
}
|
|
1764
|
+
if (diffLines.length === 0 && !moveTo) return { error: true };
|
|
1765
|
+
return {
|
|
1766
|
+
operation: {
|
|
1767
|
+
type: "update_file",
|
|
1768
|
+
path,
|
|
1769
|
+
diff: diffLines.length > 0 ? joinDiff(diffLines) : "",
|
|
1770
|
+
...moveTo ? { moveTo } : {}
|
|
1771
|
+
},
|
|
1772
|
+
nextIndex: index
|
|
1773
|
+
};
|
|
1774
|
+
}
|
|
1639
1775
|
function applyPatchOps(raw) {
|
|
1640
|
-
|
|
1641
|
-
if (
|
|
1642
|
-
|
|
1776
|
+
if (raw == null) return [];
|
|
1777
|
+
if (typeof raw === "string") {
|
|
1778
|
+
const trimmed = raw.trimStart();
|
|
1779
|
+
if (trimmed.startsWith(BEGIN_PATCH)) return freeformApplyPatchOps(trimmed);
|
|
1780
|
+
const parsed = tryParseJson(trimmed);
|
|
1781
|
+
return parsed === void 0 ? [] : applyPatchOps(parsed);
|
|
1782
|
+
}
|
|
1783
|
+
if (Array.isArray(raw)) return parseStructuredOperations(raw);
|
|
1784
|
+
if (!isRecord(raw)) return [];
|
|
1785
|
+
if (typeof raw.patch === "string") return freeformApplyPatchOps(raw.patch);
|
|
1786
|
+
if (Array.isArray(raw.command)) {
|
|
1787
|
+
const [commandName, patch] = raw.command;
|
|
1788
|
+
if (commandName === "apply_patch" && typeof patch === "string") {
|
|
1789
|
+
return freeformApplyPatchOps(patch);
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
if (Array.isArray(raw.operations) && raw.operations.length > 0) {
|
|
1793
|
+
return parseStructuredOperations(raw.operations);
|
|
1643
1794
|
}
|
|
1644
|
-
|
|
1795
|
+
if (raw.operation !== void 0) {
|
|
1796
|
+
const op = asApplyPatchOperation(raw.operation);
|
|
1797
|
+
return op ? [op] : [];
|
|
1798
|
+
}
|
|
1799
|
+
const flat = asApplyPatchOperation(raw);
|
|
1800
|
+
return flat ? [flat] : [];
|
|
1645
1801
|
}
|
|
1646
1802
|
function applyPatchOpsFromToolItem(item) {
|
|
1647
1803
|
const fromRaw = applyPatchOps(item.raw);
|
|
1648
|
-
if (fromRaw.length > 0)
|
|
1649
|
-
|
|
1804
|
+
if (fromRaw.length > 0) return fromRaw;
|
|
1805
|
+
if (isRecord(item.raw)) {
|
|
1806
|
+
const nested = item.raw.arguments ?? item.raw.input;
|
|
1807
|
+
if (nested !== void 0 && nested !== item.arguments) {
|
|
1808
|
+
const fromNested = applyPatchOps(nested);
|
|
1809
|
+
if (fromNested.length > 0) return fromNested;
|
|
1810
|
+
}
|
|
1650
1811
|
}
|
|
1651
|
-
|
|
1652
|
-
|
|
1812
|
+
if (item.arguments !== void 0 && item.arguments !== null) {
|
|
1813
|
+
return applyPatchOps(item.arguments);
|
|
1814
|
+
}
|
|
1815
|
+
return [];
|
|
1653
1816
|
}
|
|
1654
1817
|
function isApplyPatch(item) {
|
|
1655
1818
|
const type = item.raw && typeof item.raw === "object" ? item.raw.type : void 0;
|
|
@@ -2670,12 +2833,13 @@ function ApplyPatchRenderer({ item }) {
|
|
|
2670
2833
|
title: fileCount > 1 ? `Applying ${fileCount} files` : titleVerb,
|
|
2671
2834
|
running: true,
|
|
2672
2835
|
preview: /* @__PURE__ */ jsx10(RunningPreview, { children: fileCount > 1 ? `${fileCount} files` : firstOp ? firstOp.path : "applying\u2026" }),
|
|
2673
|
-
children: ops.map((op) => {
|
|
2836
|
+
children: ops.map((op, index) => {
|
|
2674
2837
|
const file2 = safeParseOp(op);
|
|
2675
|
-
|
|
2838
|
+
const key = `${op.type}:${op.path}:${index}`;
|
|
2839
|
+
return file2 ? /* @__PURE__ */ jsx10(ToolDiff, { files: [file2] }, key) : /* @__PURE__ */ jsxs7("div", { children: [
|
|
2676
2840
|
/* @__PURE__ */ jsx10("p", { className: "mb-1 font-og-mono text-og-xs text-og-fg-muted", children: op.path }),
|
|
2677
2841
|
/* @__PURE__ */ jsx10(RawPatch, { diff: op.diff ?? "" })
|
|
2678
|
-
] },
|
|
2842
|
+
] }, key);
|
|
2679
2843
|
})
|
|
2680
2844
|
}
|
|
2681
2845
|
);
|
|
@@ -2719,10 +2883,11 @@ function ApplyPatchRenderer({ item }) {
|
|
|
2719
2883
|
] }),
|
|
2720
2884
|
children: ops.map((op, index) => {
|
|
2721
2885
|
const file2 = parsed[index];
|
|
2722
|
-
|
|
2886
|
+
const key = `${op.type}:${op.path}:${index}`;
|
|
2887
|
+
return file2 ? /* @__PURE__ */ jsx10(ToolDiff, { files: [file2] }, key) : /* @__PURE__ */ jsxs7("div", { children: [
|
|
2723
2888
|
/* @__PURE__ */ jsx10("p", { className: "mb-1 font-og-mono text-og-xs text-og-fg-muted", children: op.path }),
|
|
2724
2889
|
/* @__PURE__ */ jsx10(RawPatch, { diff: op.diff ?? "" })
|
|
2725
|
-
] },
|
|
2890
|
+
] }, key);
|
|
2726
2891
|
})
|
|
2727
2892
|
}
|
|
2728
2893
|
);
|
|
@@ -5020,7 +5185,7 @@ var BUILT_IN_TURN_SUMMARY_FACETS = Object.freeze([
|
|
|
5020
5185
|
let files = 0;
|
|
5021
5186
|
for (const item of toolCalls) {
|
|
5022
5187
|
if (isApplyPatch(item)) {
|
|
5023
|
-
files +=
|
|
5188
|
+
files += applyPatchOpsFromToolItem(item).length;
|
|
5024
5189
|
}
|
|
5025
5190
|
}
|
|
5026
5191
|
return files ? { content: `${files} ${files === 1 ? "file" : "files"} edited` } : null;
|
|
@@ -7427,7 +7592,9 @@ export {
|
|
|
7427
7592
|
looksBinary,
|
|
7428
7593
|
controlCaret,
|
|
7429
7594
|
v4aToGitFileDiff,
|
|
7595
|
+
parseFreeformApplyPatch,
|
|
7430
7596
|
applyPatchOps,
|
|
7597
|
+
applyPatchOpsFromToolItem,
|
|
7431
7598
|
isApplyPatch,
|
|
7432
7599
|
redactSecrets,
|
|
7433
7600
|
parseToolArgs,
|
|
@@ -7464,4 +7631,4 @@ export {
|
|
|
7464
7631
|
MessageTimeline,
|
|
7465
7632
|
TimelineRow
|
|
7466
7633
|
};
|
|
7467
|
-
//# sourceMappingURL=chunk-
|
|
7634
|
+
//# sourceMappingURL=chunk-KG5F2OKE.js.map
|