@tangle-network/agent-app 0.60.174 → 0.60.176
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/{DesignCanvasEditor-UHX7YFKE.js → DesignCanvasEditor-EZ7LNKNQ.js} +3 -3
- package/dist/agent-profiles/d1.js +3 -3
- package/dist/agent-profiles/index.js +3 -3
- package/dist/assistant/index.js +9 -9
- package/dist/chat-react/index.js +4 -4
- package/dist/chat-routes/index.js +4 -4
- package/dist/{chunk-MOFLIBQW.js → chunk-4WEUWCA4.js} +3 -3
- package/dist/{chunk-N537SNWU.js → chunk-6CKNC32J.js} +2 -2
- package/dist/{chunk-GV7UGCKR.js → chunk-6VXBUIM5.js} +3 -3
- package/dist/{chunk-UK4PVX2T.js → chunk-7PSYT35Z.js} +5 -5
- package/dist/{chunk-UK4PVX2T.js.map → chunk-7PSYT35Z.js.map} +1 -1
- package/dist/{chunk-PP5KIVHL.js → chunk-BBHVV37T.js} +4 -4
- package/dist/{chunk-74WXGIEK.js → chunk-ER3KSBA4.js} +4 -4
- package/dist/{chunk-GYQTJA6N.js → chunk-GIJY3YCH.js} +3 -3
- package/dist/{chunk-DQSGUZZZ.js → chunk-IAFPBYQQ.js} +248 -157
- package/dist/chunk-IAFPBYQQ.js.map +1 -0
- package/dist/{chunk-CV5L2FUK.js → chunk-IIE3K2Y5.js} +2 -2
- package/dist/{chunk-MLVCFWEH.js → chunk-LZBEAWHY.js} +2 -2
- package/dist/{chunk-MJ4PW262.js → chunk-NO2YNV5C.js} +2 -2
- package/dist/{chunk-ILZQAXJH.js → chunk-QJYJOMMO.js} +2 -2
- package/dist/{chunk-AA4FKEQW.js → chunk-TJ4DYKF2.js} +2 -1
- package/dist/chunk-TJ4DYKF2.js.map +1 -0
- package/dist/{chunk-CW6F6GDP.js → chunk-UDLA3NGY.js} +3 -3
- package/dist/{chunk-BUF2OCZM.js → chunk-UTF7H6BK.js} +1 -1
- package/dist/{chunk-BUF2OCZM.js.map → chunk-UTF7H6BK.js.map} +1 -1
- package/dist/{chunk-F2BXNZAH.js → chunk-YESFGM56.js} +3 -3
- package/dist/{chunk-R5K5ML3Q.js → chunk-YGBEGBJY.js} +2 -2
- package/dist/design-canvas-react/index.js +3 -3
- package/dist/design-canvas-react/lazy.js +1 -1
- package/dist/{mention-editor-JO2Y6C6S.js → mention-editor-ZJAOUDEE.js} +2 -2
- package/dist/preset-cloudflare/index.js +2 -2
- package/dist/sandbox/index.js +4 -4
- package/dist/studio-react/index.js +3 -3
- package/dist/theme/brand.generated.d.ts +1 -1
- package/dist/theme/index.js +1 -1
- package/dist/theme/tokens.css +25 -2
- package/dist/tools/index.js +4 -4
- package/dist/web-react/agent-profile-editor.js +4 -4
- package/dist/web-react/chat-scroll.d.ts +11 -0
- package/dist/web-react/controls.d.ts +10 -1
- package/dist/web-react/index.d.ts +1 -0
- package/dist/web-react/index.js +11 -9
- package/dist/work-product/index.js +2 -2
- package/dist/workspace-react/index.js +4 -4
- package/package.json +4 -4
- package/dist/chunk-AA4FKEQW.js.map +0 -1
- package/dist/chunk-DQSGUZZZ.js.map +0 -1
- /package/dist/{DesignCanvasEditor-UHX7YFKE.js.map → DesignCanvasEditor-EZ7LNKNQ.js.map} +0 -0
- /package/dist/{chunk-MOFLIBQW.js.map → chunk-4WEUWCA4.js.map} +0 -0
- /package/dist/{chunk-N537SNWU.js.map → chunk-6CKNC32J.js.map} +0 -0
- /package/dist/{chunk-GV7UGCKR.js.map → chunk-6VXBUIM5.js.map} +0 -0
- /package/dist/{chunk-PP5KIVHL.js.map → chunk-BBHVV37T.js.map} +0 -0
- /package/dist/{chunk-74WXGIEK.js.map → chunk-ER3KSBA4.js.map} +0 -0
- /package/dist/{chunk-GYQTJA6N.js.map → chunk-GIJY3YCH.js.map} +0 -0
- /package/dist/{chunk-CV5L2FUK.js.map → chunk-IIE3K2Y5.js.map} +0 -0
- /package/dist/{chunk-MLVCFWEH.js.map → chunk-LZBEAWHY.js.map} +0 -0
- /package/dist/{chunk-MJ4PW262.js.map → chunk-NO2YNV5C.js.map} +0 -0
- /package/dist/{chunk-ILZQAXJH.js.map → chunk-QJYJOMMO.js.map} +0 -0
- /package/dist/{chunk-CW6F6GDP.js.map → chunk-UDLA3NGY.js.map} +0 -0
- /package/dist/{chunk-F2BXNZAH.js.map → chunk-YESFGM56.js.map} +0 -0
- /package/dist/{chunk-R5K5ML3Q.js.map → chunk-YGBEGBJY.js.map} +0 -0
- /package/dist/{mention-editor-JO2Y6C6S.js.map → mention-editor-ZJAOUDEE.js.map} +0 -0
|
@@ -25,9 +25,10 @@ import {
|
|
|
25
25
|
POPOVER_OPTION_FOCUS,
|
|
26
26
|
POPOVER_SURFACE_ATTR,
|
|
27
27
|
PopoverSurface,
|
|
28
|
+
useBrowserLayoutEffect,
|
|
28
29
|
usePending,
|
|
29
30
|
usePopover
|
|
30
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-TJ4DYKF2.js";
|
|
31
32
|
import {
|
|
32
33
|
AsyncView
|
|
33
34
|
} from "./chunk-LSUELMHY.js";
|
|
@@ -57,7 +58,7 @@ import {
|
|
|
57
58
|
} from "./chunk-6VQCFJWP.js";
|
|
58
59
|
|
|
59
60
|
// src/web-react/index.tsx
|
|
60
|
-
import { useEffect as useEffect15, useMemo as useMemo8, useRef as
|
|
61
|
+
import { useEffect as useEffect15, useMemo as useMemo8, useRef as useRef14, useState as useState21, memo } from "react";
|
|
61
62
|
import { isViewerMessage, MessageAuthor, TRANSCRIPT_TEXT } from "@tangle-network/ui/chat";
|
|
62
63
|
import { InlineToolItem } from "@tangle-network/ui/run";
|
|
63
64
|
|
|
@@ -1326,9 +1327,97 @@ function TurnProgress({ phase, pendingMessage = "Sending\u2026", startedAt, show
|
|
|
1326
1327
|
}
|
|
1327
1328
|
|
|
1328
1329
|
// src/web-react/reasoning-row.tsx
|
|
1329
|
-
import { useEffect as useEffect6, useMemo as useMemo3, useRef as
|
|
1330
|
+
import { useEffect as useEffect6, useMemo as useMemo3, useRef as useRef6, useState as useState9 } from "react";
|
|
1330
1331
|
import { RunRowShell } from "@tangle-network/ui/run";
|
|
1331
1332
|
import { Markdown } from "@tangle-network/ui/markdown";
|
|
1333
|
+
import { Button } from "@tangle-network/ui/primitives";
|
|
1334
|
+
|
|
1335
|
+
// src/web-react/chat-scroll.ts
|
|
1336
|
+
import { useCallback as useCallback2, useRef as useRef5, useState as useState8 } from "react";
|
|
1337
|
+
function useChatScroll() {
|
|
1338
|
+
const [viewport, viewportRef] = useState8(null);
|
|
1339
|
+
const [content, contentRef] = useState8(null);
|
|
1340
|
+
const [following, setFollowing] = useState8(true);
|
|
1341
|
+
const followingRef = useRef5(true);
|
|
1342
|
+
const previousTop = useRef5(0);
|
|
1343
|
+
const follow = useCallback2((value) => {
|
|
1344
|
+
followingRef.current = value;
|
|
1345
|
+
setFollowing(value);
|
|
1346
|
+
}, []);
|
|
1347
|
+
const scrollToBottom = useCallback2(() => {
|
|
1348
|
+
if (viewport) {
|
|
1349
|
+
viewport.scrollTop = viewport.scrollHeight;
|
|
1350
|
+
previousTop.current = viewport.scrollTop;
|
|
1351
|
+
}
|
|
1352
|
+
}, [viewport]);
|
|
1353
|
+
const jumpToLatest = useCallback2(() => {
|
|
1354
|
+
follow(true);
|
|
1355
|
+
scrollToBottom();
|
|
1356
|
+
viewport?.focus({ preventScroll: true });
|
|
1357
|
+
}, [viewport, follow, scrollToBottom]);
|
|
1358
|
+
useBrowserLayoutEffect(() => {
|
|
1359
|
+
if (!viewport || !content) return;
|
|
1360
|
+
if (!followingRef.current) viewport.scrollTop = previousTop.current;
|
|
1361
|
+
previousTop.current = viewport.scrollTop;
|
|
1362
|
+
let previousHeight = viewport.scrollHeight;
|
|
1363
|
+
let previousClient = viewport.clientHeight;
|
|
1364
|
+
const scroll = () => {
|
|
1365
|
+
const top = viewport.scrollTop;
|
|
1366
|
+
const nearBottom = viewport.scrollHeight - top - viewport.clientHeight <= 24;
|
|
1367
|
+
const clampedToBottom = nearBottom && followingRef.current && (viewport.scrollHeight < previousHeight || viewport.clientHeight > previousClient);
|
|
1368
|
+
if (top < previousTop.current && !clampedToBottom) follow(false);
|
|
1369
|
+
else if (top > previousTop.current && nearBottom) follow(true);
|
|
1370
|
+
previousTop.current = top;
|
|
1371
|
+
previousHeight = viewport.scrollHeight;
|
|
1372
|
+
previousClient = viewport.clientHeight;
|
|
1373
|
+
};
|
|
1374
|
+
const wheel = (event) => {
|
|
1375
|
+
if (event.deltaY < 0) follow(false);
|
|
1376
|
+
};
|
|
1377
|
+
let touchY = 0;
|
|
1378
|
+
const touchStart = (event) => {
|
|
1379
|
+
touchY = event.touches[0]?.clientY ?? 0;
|
|
1380
|
+
};
|
|
1381
|
+
const touchMove = (event) => {
|
|
1382
|
+
const nextY = event.touches[0]?.clientY ?? touchY;
|
|
1383
|
+
if (nextY > touchY) follow(false);
|
|
1384
|
+
touchY = nextY;
|
|
1385
|
+
};
|
|
1386
|
+
const key = (event) => {
|
|
1387
|
+
if (event.key === "End" && event.target === viewport) {
|
|
1388
|
+
event.preventDefault();
|
|
1389
|
+
follow(true);
|
|
1390
|
+
scrollToBottom();
|
|
1391
|
+
}
|
|
1392
|
+
if (["ArrowUp", "PageUp", "Home"].includes(event.key) || event.key === " " && event.shiftKey) follow(false);
|
|
1393
|
+
};
|
|
1394
|
+
const resize = () => {
|
|
1395
|
+
if (followingRef.current) scrollToBottom();
|
|
1396
|
+
previousHeight = viewport.scrollHeight;
|
|
1397
|
+
previousClient = viewport.clientHeight;
|
|
1398
|
+
};
|
|
1399
|
+
viewport.addEventListener("scroll", scroll);
|
|
1400
|
+
viewport.addEventListener("wheel", wheel, { passive: true });
|
|
1401
|
+
viewport.addEventListener("touchstart", touchStart, { passive: true });
|
|
1402
|
+
viewport.addEventListener("touchmove", touchMove, { passive: true });
|
|
1403
|
+
viewport.addEventListener("keydown", key);
|
|
1404
|
+
const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(resize);
|
|
1405
|
+
observer?.observe(content);
|
|
1406
|
+
observer?.observe(viewport);
|
|
1407
|
+
resize();
|
|
1408
|
+
return () => {
|
|
1409
|
+
observer?.disconnect();
|
|
1410
|
+
viewport.removeEventListener("scroll", scroll);
|
|
1411
|
+
viewport.removeEventListener("wheel", wheel);
|
|
1412
|
+
viewport.removeEventListener("touchstart", touchStart);
|
|
1413
|
+
viewport.removeEventListener("touchmove", touchMove);
|
|
1414
|
+
viewport.removeEventListener("keydown", key);
|
|
1415
|
+
};
|
|
1416
|
+
}, [viewport, content, follow, scrollToBottom]);
|
|
1417
|
+
return { viewportRef, contentRef, following, jumpToLatest };
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
// src/web-react/reasoning-row.tsx
|
|
1332
1421
|
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1333
1422
|
function reasoningPreview(text) {
|
|
1334
1423
|
const flat = text.replace(/[*_`#>]+/g, "").replace(/\s+/g, " ").trim();
|
|
@@ -1340,14 +1429,14 @@ function thoughtForLabel(durationMs) {
|
|
|
1340
1429
|
return `Thought for ${seconds} second${seconds === 1 ? "" : "s"}`;
|
|
1341
1430
|
}
|
|
1342
1431
|
function useSecondTick(active) {
|
|
1343
|
-
const [, setTick] =
|
|
1432
|
+
const [, setTick] = useState9(0);
|
|
1344
1433
|
useEffect6(() => {
|
|
1345
1434
|
if (!active) return;
|
|
1346
1435
|
const id = setInterval(() => setTick((n) => n + 1), 1e3);
|
|
1347
1436
|
return () => clearInterval(id);
|
|
1348
1437
|
}, [active]);
|
|
1349
1438
|
}
|
|
1350
|
-
var defaultRenderText = (text) => /* @__PURE__ */ jsx8(Markdown, { children: text });
|
|
1439
|
+
var defaultRenderText = (text) => /* @__PURE__ */ jsx8(Markdown, { className: "text-base leading-relaxed", children: text });
|
|
1351
1440
|
function ReasoningRow({
|
|
1352
1441
|
text,
|
|
1353
1442
|
startedAt,
|
|
@@ -1358,11 +1447,10 @@ function ReasoningRow({
|
|
|
1358
1447
|
className
|
|
1359
1448
|
}) {
|
|
1360
1449
|
const thinking = thinkingProp ?? (startedAt !== void 0 && endedAt === void 0);
|
|
1361
|
-
const
|
|
1362
|
-
const body = useMemo3(() => renderText(shown), [renderText, shown]);
|
|
1450
|
+
const body = useMemo3(() => renderText(text), [renderText, text]);
|
|
1363
1451
|
const visible = text.trim() !== "";
|
|
1364
|
-
const seenStart =
|
|
1365
|
-
const seenEnd =
|
|
1452
|
+
const seenStart = useRef6(null);
|
|
1453
|
+
const seenEnd = useRef6(null);
|
|
1366
1454
|
if (thinking && visible) {
|
|
1367
1455
|
if (seenStart.current === null) seenStart.current = Date.now();
|
|
1368
1456
|
seenEnd.current = null;
|
|
@@ -1372,25 +1460,21 @@ function ReasoningRow({
|
|
|
1372
1460
|
const start = startedAt ?? seenStart.current ?? void 0;
|
|
1373
1461
|
const end = endedAt ?? seenEnd.current ?? void 0;
|
|
1374
1462
|
useSecondTick(thinking);
|
|
1375
|
-
const [toggled, setToggled] =
|
|
1376
|
-
const
|
|
1377
|
-
const
|
|
1378
|
-
useEffect6(() => {
|
|
1379
|
-
const el = scrollRef.current;
|
|
1380
|
-
if (el && thinking) el.scrollTop = el.scrollHeight;
|
|
1381
|
-
}, [shown, thinking]);
|
|
1463
|
+
const [toggled, setToggled] = useState9(null);
|
|
1464
|
+
const { viewportRef, contentRef, following, jumpToLatest } = useChatScroll();
|
|
1465
|
+
const open = toggled ?? (thinking || defaultOpen || !following);
|
|
1382
1466
|
if (!visible) return null;
|
|
1383
1467
|
const elapsedSeconds = thinking && start !== void 0 ? Math.max(0, Math.floor((Date.now() - start) / 1e3)) : 0;
|
|
1384
1468
|
const durationMs = !thinking && start !== void 0 && end !== void 0 && end >= start ? end - start : void 0;
|
|
1385
1469
|
const title = thinking ? (
|
|
1386
|
-
// The
|
|
1387
|
-
//
|
|
1388
|
-
/* @__PURE__ */ jsxs6("span", { className: "agent-shimmer",
|
|
1470
|
+
// The shared reduced-motion recipe stops the sweep; the label and timer
|
|
1471
|
+
// still report the observed thinking state without an animation exemption.
|
|
1472
|
+
/* @__PURE__ */ jsxs6("span", { className: "agent-shimmer", children: [
|
|
1389
1473
|
"Thinking",
|
|
1390
1474
|
elapsedSeconds >= 1 ? ` \xB7 ${elapsedSeconds}s` : "\u2026"
|
|
1391
1475
|
] })
|
|
1392
1476
|
) : durationMs !== void 0 ? thoughtForLabel(durationMs) : "Thought process";
|
|
1393
|
-
return /* @__PURE__ */
|
|
1477
|
+
return /* @__PURE__ */ jsxs6(
|
|
1394
1478
|
RunRowShell,
|
|
1395
1479
|
{
|
|
1396
1480
|
className,
|
|
@@ -1400,16 +1484,22 @@ function ReasoningRow({
|
|
|
1400
1484
|
status: thinking ? "running" : "idle",
|
|
1401
1485
|
open,
|
|
1402
1486
|
onOpenChange: setToggled,
|
|
1403
|
-
children:
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1487
|
+
children: [
|
|
1488
|
+
/* @__PURE__ */ jsx8(
|
|
1489
|
+
"div",
|
|
1490
|
+
{
|
|
1491
|
+
ref: viewportRef,
|
|
1492
|
+
tabIndex: 0,
|
|
1493
|
+
role: "region",
|
|
1494
|
+
"aria-label": "Reasoning",
|
|
1495
|
+
"data-reasoning": thinking ? "thinking" : "settled",
|
|
1496
|
+
"aria-busy": thinking || void 0,
|
|
1497
|
+
className: "max-h-[min(28rem,60dvh)] overflow-y-auto overscroll-contain px-4 py-4 text-base leading-relaxed text-foreground",
|
|
1498
|
+
children: /* @__PURE__ */ jsx8("div", { ref: contentRef, className: "min-w-0 break-words", children: body })
|
|
1499
|
+
}
|
|
1500
|
+
),
|
|
1501
|
+
!following && /* @__PURE__ */ jsx8("div", { className: "flex justify-end px-4 pb-3", children: /* @__PURE__ */ jsx8(Button, { type: "button", variant: "outline", "aria-label": "Jump to latest reasoning", onClick: jumpToLatest, children: "Jump to latest" }) })
|
|
1502
|
+
]
|
|
1413
1503
|
}
|
|
1414
1504
|
);
|
|
1415
1505
|
}
|
|
@@ -1682,7 +1772,7 @@ async function streamChatTurn(opts) {
|
|
|
1682
1772
|
}
|
|
1683
1773
|
|
|
1684
1774
|
// src/web-react/workspace-prewarm.ts
|
|
1685
|
-
import { useCallback as
|
|
1775
|
+
import { useCallback as useCallback3, useEffect as useEffect7 } from "react";
|
|
1686
1776
|
var DEFAULT_MIN_INTERVAL_MS = 6e4;
|
|
1687
1777
|
var lastSent = /* @__PURE__ */ new Map();
|
|
1688
1778
|
var inFlight = /* @__PURE__ */ new Set();
|
|
@@ -1718,7 +1808,7 @@ function useWorkspacePrewarm(options) {
|
|
|
1718
1808
|
document.addEventListener("visibilitychange", fire);
|
|
1719
1809
|
return () => document.removeEventListener("visibilitychange", fire);
|
|
1720
1810
|
}, [active, url, minIntervalMs]);
|
|
1721
|
-
const reassert =
|
|
1811
|
+
const reassert = useCallback3(() => {
|
|
1722
1812
|
if (active && url) requestWorkspacePrewarm(url, { minIntervalMs, reason: "composer-focus" });
|
|
1723
1813
|
}, [active, url, minIntervalMs]);
|
|
1724
1814
|
return { reassert };
|
|
@@ -1744,8 +1834,8 @@ function getChatFundingRecovery(failure) {
|
|
|
1744
1834
|
}
|
|
1745
1835
|
|
|
1746
1836
|
// src/web-react/agent-profile-viewer.tsx
|
|
1747
|
-
import { useState as
|
|
1748
|
-
import { Button, CodeBlock, Tabs, TabsContent, TabsList, TabsTrigger } from "@tangle-network/sandbox-ui/primitives";
|
|
1837
|
+
import { useState as useState10 } from "react";
|
|
1838
|
+
import { Button as Button2, CodeBlock, Tabs, TabsContent, TabsList, TabsTrigger } from "@tangle-network/sandbox-ui/primitives";
|
|
1749
1839
|
import { CopyButton } from "@tangle-network/sandbox-ui/markdown";
|
|
1750
1840
|
|
|
1751
1841
|
// src/web-react/agent-profile-layout.tsx
|
|
@@ -1980,7 +2070,7 @@ function JsonValue({ value, name }) {
|
|
|
1980
2070
|
] });
|
|
1981
2071
|
}
|
|
1982
2072
|
function AgentProfileViewer({ profile, className = "", showFullProfile = false, ...overview }) {
|
|
1983
|
-
const [view, setView] =
|
|
2073
|
+
const [view, setView] = useState10("overview");
|
|
1984
2074
|
const json = showFullProfile ? JSON.stringify(profile, null, 2) : "";
|
|
1985
2075
|
return /* @__PURE__ */ jsx10("section", { className: `min-w-0 text-sm text-foreground ${className}`.trim(), "aria-label": "Agent profile", children: showFullProfile ? /* @__PURE__ */ jsxs8(Tabs, { value: view, onValueChange: setView, children: [
|
|
1986
2076
|
/* @__PURE__ */ jsxs8("div", { className: "mb-4 flex min-w-0 flex-wrap items-center justify-between gap-3 rounded-xl border border-border bg-card p-2", children: [
|
|
@@ -1991,7 +2081,7 @@ function AgentProfileViewer({ profile, className = "", showFullProfile = false,
|
|
|
1991
2081
|
] }),
|
|
1992
2082
|
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
|
|
1993
2083
|
/* @__PURE__ */ jsx10(CopyButton, { text: json }),
|
|
1994
|
-
/* @__PURE__ */ jsx10(
|
|
2084
|
+
/* @__PURE__ */ jsx10(Button2, { asChild: true, variant: "outline", size: "sm", children: /* @__PURE__ */ jsx10("a", { href: `data:application/json;charset=utf-8,${encodeURIComponent(json)}`, download: "agent-profile.json", children: "Download" }) })
|
|
1995
2085
|
] })
|
|
1996
2086
|
] }),
|
|
1997
2087
|
/* @__PURE__ */ jsx10(TabsContent, { value: "overview", className: "mt-0", children: /* @__PURE__ */ jsx10(ProfileOverview, { profile, ...overview }) }),
|
|
@@ -2007,7 +2097,7 @@ function AgentProfileViewer({ profile, className = "", showFullProfile = false,
|
|
|
2007
2097
|
}
|
|
2008
2098
|
|
|
2009
2099
|
// src/web-react/durable-plan-flow.ts
|
|
2010
|
-
import { useCallback as
|
|
2100
|
+
import { useCallback as useCallback4, useEffect as useEffect8, useRef as useRef7, useState as useState11 } from "react";
|
|
2011
2101
|
var DurablePlanClientError = class extends Error {
|
|
2012
2102
|
constructor(message, status, code, currentPlan) {
|
|
2013
2103
|
super(message);
|
|
@@ -2094,14 +2184,14 @@ function createDurablePlanDecisionClient(options) {
|
|
|
2094
2184
|
};
|
|
2095
2185
|
}
|
|
2096
2186
|
function useDurablePlanFlow(options) {
|
|
2097
|
-
const [plan, setPlan] =
|
|
2098
|
-
const [deciding, setDeciding] =
|
|
2099
|
-
const [restoring, setRestoring] =
|
|
2100
|
-
const [error, setError] =
|
|
2101
|
-
const attachments =
|
|
2102
|
-
const decisionInFlight =
|
|
2187
|
+
const [plan, setPlan] = useState11(options.plan);
|
|
2188
|
+
const [deciding, setDeciding] = useState11(null);
|
|
2189
|
+
const [restoring, setRestoring] = useState11(false);
|
|
2190
|
+
const [error, setError] = useState11(null);
|
|
2191
|
+
const attachments = useRef7(/* @__PURE__ */ new Map());
|
|
2192
|
+
const decisionInFlight = useRef7(false);
|
|
2103
2193
|
useEffect8(() => setPlan(options.plan), [options.plan]);
|
|
2104
|
-
const apply =
|
|
2194
|
+
const apply = useCallback4(async (result) => {
|
|
2105
2195
|
setPlan(result.plan);
|
|
2106
2196
|
options.onUpdated?.(result.plan);
|
|
2107
2197
|
const receipt = result.followUp;
|
|
@@ -2114,7 +2204,7 @@ function useDurablePlanFlow(options) {
|
|
|
2114
2204
|
}
|
|
2115
2205
|
await pending;
|
|
2116
2206
|
}, [options.attachFollowUp, options.onUpdated]);
|
|
2117
|
-
const decide =
|
|
2207
|
+
const decide = useCallback4(async (decision, feedback) => {
|
|
2118
2208
|
if (decisionInFlight.current) return null;
|
|
2119
2209
|
decisionInFlight.current = true;
|
|
2120
2210
|
setDeciding(decision);
|
|
@@ -2140,7 +2230,7 @@ function useDurablePlanFlow(options) {
|
|
|
2140
2230
|
setDeciding(null);
|
|
2141
2231
|
}
|
|
2142
2232
|
}, [apply, options.client, options.onUpdated, plan.planId, plan.revision]);
|
|
2143
|
-
const restore =
|
|
2233
|
+
const restore = useCallback4(async () => {
|
|
2144
2234
|
setRestoring(true);
|
|
2145
2235
|
setError(null);
|
|
2146
2236
|
try {
|
|
@@ -2269,7 +2359,7 @@ function createDurableInteractionAnswerSubmitter(options) {
|
|
|
2269
2359
|
}
|
|
2270
2360
|
|
|
2271
2361
|
// src/web-react/use-chat-interactions.ts
|
|
2272
|
-
import { useCallback as
|
|
2362
|
+
import { useCallback as useCallback5, useMemo as useMemo4, useState as useState12 } from "react";
|
|
2273
2363
|
function hasPendingContentDuplicate(list, interaction) {
|
|
2274
2364
|
if (interaction.status !== "pending") return false;
|
|
2275
2365
|
const signature = questionInteractionContentSignature(interaction);
|
|
@@ -2348,34 +2438,34 @@ function hydrateChatInteractions(list, persisted) {
|
|
|
2348
2438
|
return persisted.reduce(upsertChatInteraction, list);
|
|
2349
2439
|
}
|
|
2350
2440
|
function useChatInteractions(options = {}) {
|
|
2351
|
-
const [interactions, setInteractions] =
|
|
2352
|
-
const upsert =
|
|
2441
|
+
const [interactions, setInteractions] = useState12([]);
|
|
2442
|
+
const upsert = useCallback5((interaction) => {
|
|
2353
2443
|
setInteractions((prev) => upsertChatInteraction(prev, interaction));
|
|
2354
2444
|
}, []);
|
|
2355
|
-
const applyCancel =
|
|
2445
|
+
const applyCancel = useCallback5((cancel) => {
|
|
2356
2446
|
setInteractions((prev) => cancelChatInteraction(prev, cancel));
|
|
2357
2447
|
}, []);
|
|
2358
|
-
const markResolved =
|
|
2448
|
+
const markResolved = useCallback5((id, status, answers) => {
|
|
2359
2449
|
setInteractions((prev) => resolveChatInteraction(prev, id, status, answers));
|
|
2360
2450
|
}, []);
|
|
2361
|
-
const restore =
|
|
2451
|
+
const restore = useCallback5((outstanding, restoreOptions) => {
|
|
2362
2452
|
setInteractions((prev) => restoreChatInteractions(prev, outstanding, {
|
|
2363
2453
|
mode: restoreOptions?.mode ?? options.mode
|
|
2364
2454
|
}));
|
|
2365
2455
|
}, [options.mode]);
|
|
2366
|
-
const hydrate =
|
|
2456
|
+
const hydrate = useCallback5((persisted) => {
|
|
2367
2457
|
setInteractions((prev) => hydrateChatInteractions(prev, persisted));
|
|
2368
2458
|
}, []);
|
|
2369
|
-
const terminalizePending =
|
|
2459
|
+
const terminalizePending = useCallback5((status) => {
|
|
2370
2460
|
setInteractions((prev) => terminalizePendingChatInteractions(prev, status));
|
|
2371
2461
|
}, []);
|
|
2372
|
-
const reset =
|
|
2462
|
+
const reset = useCallback5(() => setInteractions([]), []);
|
|
2373
2463
|
const pending = useMemo4(() => interactions.filter((item) => item.status === "pending"), [interactions]);
|
|
2374
2464
|
return { interactions, pending, upsert, applyCancel, markResolved, restore, hydrate, terminalizePending, reset };
|
|
2375
2465
|
}
|
|
2376
2466
|
|
|
2377
2467
|
// src/web-react/use-file-mentions.ts
|
|
2378
|
-
import { useCallback as
|
|
2468
|
+
import { useCallback as useCallback6, useMemo as useMemo5, useRef as useRef8, useState as useState13 } from "react";
|
|
2379
2469
|
var FILE_MENTION_KIND = "file";
|
|
2380
2470
|
function toMentionItem(file) {
|
|
2381
2471
|
return { id: file.path, label: file.name, detail: file.path, kind: FILE_MENTION_KIND };
|
|
@@ -2433,12 +2523,12 @@ function useFileMentions(options) {
|
|
|
2433
2523
|
emptyText = DEFAULT_MENTION_EMPTY_TEXT
|
|
2434
2524
|
} = options;
|
|
2435
2525
|
const fetchImpl = options.fetchImpl ?? fetch;
|
|
2436
|
-
const [state, setState] =
|
|
2437
|
-
const stateRef =
|
|
2526
|
+
const [state, setState] = useState13({ kind: "idle" });
|
|
2527
|
+
const stateRef = useRef8(state);
|
|
2438
2528
|
stateRef.current = state;
|
|
2439
|
-
const inFlightRef =
|
|
2440
|
-
const [mentions, setMentions] =
|
|
2441
|
-
const load =
|
|
2529
|
+
const inFlightRef = useRef8(null);
|
|
2530
|
+
const [mentions, setMentions] = useState13([]);
|
|
2531
|
+
const load = useCallback6(() => {
|
|
2442
2532
|
if (inFlightRef.current) return inFlightRef.current;
|
|
2443
2533
|
if (stateRef.current.kind === "idle") {
|
|
2444
2534
|
stateRef.current = { kind: "loading" };
|
|
@@ -2470,10 +2560,10 @@ function useFileMentions(options) {
|
|
|
2470
2560
|
inFlightRef.current = attempt;
|
|
2471
2561
|
return attempt;
|
|
2472
2562
|
}, [fetchImpl, indexUrl]);
|
|
2473
|
-
const refresh =
|
|
2563
|
+
const refresh = useCallback6(async () => {
|
|
2474
2564
|
await load();
|
|
2475
2565
|
}, [load]);
|
|
2476
|
-
const fetchItems =
|
|
2566
|
+
const fetchItems = useCallback6(
|
|
2477
2567
|
async (query) => {
|
|
2478
2568
|
let current = stateRef.current;
|
|
2479
2569
|
if (current.kind === "idle" || current.kind === "loading") {
|
|
@@ -2488,10 +2578,10 @@ function useFileMentions(options) {
|
|
|
2488
2578
|
},
|
|
2489
2579
|
[load, limit, refreshAfterMs]
|
|
2490
2580
|
);
|
|
2491
|
-
const onMentionsChange =
|
|
2581
|
+
const onMentionsChange = useCallback6((items) => {
|
|
2492
2582
|
setMentions(items.filter((item) => item.kind === void 0 || item.kind === FILE_MENTION_KIND).map(toFileMention));
|
|
2493
2583
|
}, []);
|
|
2494
|
-
const clearMentions =
|
|
2584
|
+
const clearMentions = useCallback6(() => setMentions([]), []);
|
|
2495
2585
|
const mention = useMemo5(
|
|
2496
2586
|
() => ({
|
|
2497
2587
|
fetchItems,
|
|
@@ -2544,7 +2634,7 @@ function segmentMentionContent(content, parts) {
|
|
|
2544
2634
|
}
|
|
2545
2635
|
|
|
2546
2636
|
// src/web-react/mission-activity.tsx
|
|
2547
|
-
import { useCallback as
|
|
2637
|
+
import { useCallback as useCallback7, useEffect as useEffect9, useState as useState14 } from "react";
|
|
2548
2638
|
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2549
2639
|
var LIVE_STATUSES = /* @__PURE__ */ new Set(["pending", "running"]);
|
|
2550
2640
|
var OK_STATUSES = /* @__PURE__ */ new Set(["completed", "done", "succeeded"]);
|
|
@@ -2604,8 +2694,8 @@ function CopyGlyph({ className }) {
|
|
|
2604
2694
|
] });
|
|
2605
2695
|
}
|
|
2606
2696
|
function TraceIdCopy({ traceId }) {
|
|
2607
|
-
const [copied, setCopied] =
|
|
2608
|
-
const copy =
|
|
2697
|
+
const [copied, setCopied] = useState14(false);
|
|
2698
|
+
const copy = useCallback7(() => {
|
|
2609
2699
|
void navigator.clipboard?.writeText(traceId).then(
|
|
2610
2700
|
() => {
|
|
2611
2701
|
setCopied(true);
|
|
@@ -2697,7 +2787,7 @@ function LaneRow({ run, staggerIndex }) {
|
|
|
2697
2787
|
] });
|
|
2698
2788
|
}
|
|
2699
2789
|
function MissionActivityLane({ activity, startedAt, nowMs }) {
|
|
2700
|
-
const [expanded, setExpanded] =
|
|
2790
|
+
const [expanded, setExpanded] = useState14(false);
|
|
2701
2791
|
if (activity.length === 0) return null;
|
|
2702
2792
|
return /* @__PURE__ */ jsxs9("div", { className: "mt-1 border-l border-border pl-3", children: [
|
|
2703
2793
|
activity.map((run, index) => /* @__PURE__ */ jsx11(LaneRow, { run, staggerIndex: index }, run.taskId)),
|
|
@@ -2730,7 +2820,7 @@ function ActivityRow({
|
|
|
2730
2820
|
staggerIndex
|
|
2731
2821
|
}) {
|
|
2732
2822
|
const arrival = useArrivalStyle(staggerIndex);
|
|
2733
|
-
const [open, setOpen] =
|
|
2823
|
+
const [open, setOpen] = useState14(false);
|
|
2734
2824
|
const tone = activityTone(record.status);
|
|
2735
2825
|
const cost = formatActivityCost(record.costUsd);
|
|
2736
2826
|
const duration = formatActivityDuration(record.durationMs);
|
|
@@ -2770,11 +2860,11 @@ function ActivityRow({
|
|
|
2770
2860
|
] });
|
|
2771
2861
|
}
|
|
2772
2862
|
function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent activity", emptyLabel = "No agent runs yet." }) {
|
|
2773
|
-
const [rows, setRows] =
|
|
2774
|
-
const [cursor, setCursor] =
|
|
2775
|
-
const [status, setStatus] =
|
|
2776
|
-
const [error, setError] =
|
|
2777
|
-
const load =
|
|
2863
|
+
const [rows, setRows] = useState14([]);
|
|
2864
|
+
const [cursor, setCursor] = useState14(void 0);
|
|
2865
|
+
const [status, setStatus] = useState14("loading");
|
|
2866
|
+
const [error, setError] = useState14(null);
|
|
2867
|
+
const load = useCallback7(
|
|
2778
2868
|
async (from) => {
|
|
2779
2869
|
setStatus("loading");
|
|
2780
2870
|
setError(null);
|
|
@@ -2827,7 +2917,7 @@ function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent ac
|
|
|
2827
2917
|
}
|
|
2828
2918
|
|
|
2829
2919
|
// src/web-react/provenance.tsx
|
|
2830
|
-
import { useCallback as
|
|
2920
|
+
import { useCallback as useCallback8, useEffect as useEffect10, useId, useRef as useRef9, useState as useState15 } from "react";
|
|
2831
2921
|
|
|
2832
2922
|
// src/web-react/provenance-model.ts
|
|
2833
2923
|
var PROVENANCE_BASES = ["extracted", "entered", "computed", "asserted"];
|
|
@@ -3121,9 +3211,9 @@ function ProvenanceValue({
|
|
|
3121
3211
|
missingValueLabel = DEFAULT_MISSING_VALUE_LABEL,
|
|
3122
3212
|
className
|
|
3123
3213
|
}) {
|
|
3124
|
-
const [open, setOpen] =
|
|
3125
|
-
const triggerRef =
|
|
3126
|
-
const rootRef =
|
|
3214
|
+
const [open, setOpen] = useState15(defaultOpen);
|
|
3215
|
+
const triggerRef = useRef9(null);
|
|
3216
|
+
const rootRef = useRef9(null);
|
|
3127
3217
|
const panelId = useId();
|
|
3128
3218
|
const standing = rollUpProvenanceStanding(record, confidencePolicy);
|
|
3129
3219
|
const basisMeta = provenanceBasisMeta(record.basis);
|
|
@@ -3133,7 +3223,7 @@ function ProvenanceValue({
|
|
|
3133
3223
|
const sources = record.sources ?? [];
|
|
3134
3224
|
const inputs = record.inputs ?? [];
|
|
3135
3225
|
const hasValue = record.display.trim() !== "";
|
|
3136
|
-
const onKeyDown =
|
|
3226
|
+
const onKeyDown = useCallback8(
|
|
3137
3227
|
(event) => {
|
|
3138
3228
|
if (event.key !== "Escape" || !open) return;
|
|
3139
3229
|
event.stopPropagation();
|
|
@@ -3142,7 +3232,7 @@ function ProvenanceValue({
|
|
|
3142
3232
|
},
|
|
3143
3233
|
[open]
|
|
3144
3234
|
);
|
|
3145
|
-
const onToggle =
|
|
3235
|
+
const onToggle = useCallback8(() => {
|
|
3146
3236
|
if (!open) closeTrailsOutside(rootRef.current);
|
|
3147
3237
|
setOpen(!open);
|
|
3148
3238
|
}, [open]);
|
|
@@ -3404,12 +3494,12 @@ function SeatPaywall({
|
|
|
3404
3494
|
import {
|
|
3405
3495
|
Fragment as Fragment4,
|
|
3406
3496
|
isValidElement,
|
|
3407
|
-
useCallback as
|
|
3497
|
+
useCallback as useCallback9,
|
|
3408
3498
|
useEffect as useEffect11,
|
|
3409
3499
|
useId as useId2,
|
|
3410
3500
|
useMemo as useMemo6,
|
|
3411
|
-
useRef as
|
|
3412
|
-
useState as
|
|
3501
|
+
useRef as useRef10,
|
|
3502
|
+
useState as useState16
|
|
3413
3503
|
} from "react";
|
|
3414
3504
|
|
|
3415
3505
|
// src/web-react/record-grid-model.ts
|
|
@@ -3825,24 +3915,24 @@ function RecordGrid({
|
|
|
3825
3915
|
className
|
|
3826
3916
|
}) {
|
|
3827
3917
|
const fieldPrefix = useId2();
|
|
3828
|
-
const [overlay, setOverlay] =
|
|
3829
|
-
const [editing, setEditingState] =
|
|
3830
|
-
const [cellErrors, setCellErrors] =
|
|
3831
|
-
const [rowErrors, setRowErrors] =
|
|
3832
|
-
const [pendingRows, setPendingRows] =
|
|
3833
|
-
const [focus, setFocus] =
|
|
3834
|
-
const [openSource, setOpenSource] =
|
|
3835
|
-
const [confirmDelete, setConfirmDelete] =
|
|
3836
|
-
const [adding, setAdding] =
|
|
3837
|
-
const [draft, setDraft] =
|
|
3838
|
-
const [draftErrors, setDraftErrors] =
|
|
3839
|
-
const [draftError, setDraftError] =
|
|
3840
|
-
const [creating, setCreating] =
|
|
3841
|
-
const cellRefs =
|
|
3842
|
-
const settling =
|
|
3843
|
-
const draftCounter =
|
|
3844
|
-
const editingRef =
|
|
3845
|
-
const setEditing =
|
|
3918
|
+
const [overlay, setOverlay] = useState16(EMPTY_RECORD_GRID_OVERLAY);
|
|
3919
|
+
const [editing, setEditingState] = useState16(null);
|
|
3920
|
+
const [cellErrors, setCellErrors] = useState16({});
|
|
3921
|
+
const [rowErrors, setRowErrors] = useState16({});
|
|
3922
|
+
const [pendingRows, setPendingRows] = useState16({});
|
|
3923
|
+
const [focus, setFocus] = useState16(null);
|
|
3924
|
+
const [openSource, setOpenSource] = useState16(null);
|
|
3925
|
+
const [confirmDelete, setConfirmDelete] = useState16(null);
|
|
3926
|
+
const [adding, setAdding] = useState16(false);
|
|
3927
|
+
const [draft, setDraft] = useState16({ ...newRowDefaults ?? {} });
|
|
3928
|
+
const [draftErrors, setDraftErrors] = useState16({});
|
|
3929
|
+
const [draftError, setDraftError] = useState16(null);
|
|
3930
|
+
const [creating, setCreating] = useState16(false);
|
|
3931
|
+
const cellRefs = useRef10(/* @__PURE__ */ new Map());
|
|
3932
|
+
const settling = useRef10(false);
|
|
3933
|
+
const draftCounter = useRef10(0);
|
|
3934
|
+
const editingRef = useRef10(null);
|
|
3935
|
+
const setEditing = useCallback9((next) => {
|
|
3846
3936
|
editingRef.current = next;
|
|
3847
3937
|
setEditingState(next);
|
|
3848
3938
|
}, []);
|
|
@@ -3874,7 +3964,7 @@ function RecordGrid({
|
|
|
3874
3964
|
if (!columns.some((column) => column.id === focus.columnId)) return null;
|
|
3875
3965
|
return focus;
|
|
3876
3966
|
}, [columns, focus, visibleRows]);
|
|
3877
|
-
const setCellError =
|
|
3967
|
+
const setCellError = useCallback9((key, message) => {
|
|
3878
3968
|
setCellErrors((current) => {
|
|
3879
3969
|
if (message === null) {
|
|
3880
3970
|
if (!(key in current)) return current;
|
|
@@ -3886,7 +3976,7 @@ function RecordGrid({
|
|
|
3886
3976
|
return { ...current, [key]: message };
|
|
3887
3977
|
});
|
|
3888
3978
|
}, []);
|
|
3889
|
-
const setRowError =
|
|
3979
|
+
const setRowError = useCallback9((rowId, message) => {
|
|
3890
3980
|
setRowErrors((current) => {
|
|
3891
3981
|
if (message === null) {
|
|
3892
3982
|
if (!(rowId in current)) return current;
|
|
@@ -3897,7 +3987,7 @@ function RecordGrid({
|
|
|
3897
3987
|
return { ...current, [rowId]: message };
|
|
3898
3988
|
});
|
|
3899
3989
|
}, []);
|
|
3900
|
-
const setRowPending =
|
|
3990
|
+
const setRowPending = useCallback9((rowId, pending) => {
|
|
3901
3991
|
setPendingRows((current) => {
|
|
3902
3992
|
if (pending) return rowId in current ? current : { ...current, [rowId]: true };
|
|
3903
3993
|
if (!(rowId in current)) return current;
|
|
@@ -3906,11 +3996,11 @@ function RecordGrid({
|
|
|
3906
3996
|
return next;
|
|
3907
3997
|
});
|
|
3908
3998
|
}, []);
|
|
3909
|
-
const focusCell =
|
|
3999
|
+
const focusCell = useCallback9((rowId, columnId) => {
|
|
3910
4000
|
setFocus({ rowId, columnId });
|
|
3911
4001
|
cellRefs.current.get(cellKey(rowId, columnId))?.focus();
|
|
3912
4002
|
}, []);
|
|
3913
|
-
const beginEdit =
|
|
4003
|
+
const beginEdit = useCallback9(
|
|
3914
4004
|
(row, column) => {
|
|
3915
4005
|
setCellError(cellKey(row.id, column.id), null);
|
|
3916
4006
|
setEditing({
|
|
@@ -3921,7 +4011,7 @@ function RecordGrid({
|
|
|
3921
4011
|
},
|
|
3922
4012
|
[setCellError, setEditing]
|
|
3923
4013
|
);
|
|
3924
|
-
const applyCellWrite =
|
|
4014
|
+
const applyCellWrite = useCallback9(
|
|
3925
4015
|
async (row, column, value) => {
|
|
3926
4016
|
if (!onUpdate) return;
|
|
3927
4017
|
const values = { ...row.values, [column.id]: value };
|
|
@@ -3949,7 +4039,7 @@ function RecordGrid({
|
|
|
3949
4039
|
},
|
|
3950
4040
|
[locale, onUpdate, setRowError, setRowPending]
|
|
3951
4041
|
);
|
|
3952
|
-
const commitEdit =
|
|
4042
|
+
const commitEdit = useCallback9(
|
|
3953
4043
|
async (row, column, text) => {
|
|
3954
4044
|
const open = editingRef.current;
|
|
3955
4045
|
if (open === null || open.rowId !== row.id || open.columnId !== column.id) return;
|
|
@@ -3973,7 +4063,7 @@ function RecordGrid({
|
|
|
3973
4063
|
},
|
|
3974
4064
|
[applyCellWrite, setCellError, setEditing]
|
|
3975
4065
|
);
|
|
3976
|
-
const cancelEdit =
|
|
4066
|
+
const cancelEdit = useCallback9(
|
|
3977
4067
|
(row, column) => {
|
|
3978
4068
|
setCellError(cellKey(row.id, column.id), null);
|
|
3979
4069
|
setEditing(null);
|
|
@@ -3981,7 +4071,7 @@ function RecordGrid({
|
|
|
3981
4071
|
},
|
|
3982
4072
|
[focusCell, setCellError, setEditing]
|
|
3983
4073
|
);
|
|
3984
|
-
const performDelete =
|
|
4074
|
+
const performDelete = useCallback9(
|
|
3985
4075
|
async (row) => {
|
|
3986
4076
|
if (!onDelete) return;
|
|
3987
4077
|
setConfirmDelete(null);
|
|
@@ -3999,16 +4089,16 @@ function RecordGrid({
|
|
|
3999
4089
|
},
|
|
4000
4090
|
[columns, onDelete, setRowError]
|
|
4001
4091
|
);
|
|
4002
|
-
const resetDraft =
|
|
4092
|
+
const resetDraft = useCallback9(() => {
|
|
4003
4093
|
setDraft({ ...newRowDefaults ?? {} });
|
|
4004
4094
|
setDraftErrors({});
|
|
4005
4095
|
setDraftError(null);
|
|
4006
4096
|
}, [newRowDefaults]);
|
|
4007
|
-
const openAdd =
|
|
4097
|
+
const openAdd = useCallback9(() => {
|
|
4008
4098
|
resetDraft();
|
|
4009
4099
|
setAdding(true);
|
|
4010
4100
|
}, [resetDraft]);
|
|
4011
|
-
const submitDraft =
|
|
4101
|
+
const submitDraft = useCallback9(async () => {
|
|
4012
4102
|
if (!onCreate) return;
|
|
4013
4103
|
const validated = validateRecordGridRow(columns, draft);
|
|
4014
4104
|
if (!validated.succeeded) {
|
|
@@ -4038,7 +4128,7 @@ function RecordGrid({
|
|
|
4038
4128
|
setOverlay((current) => withoutRecordGridCreated(current, draftId));
|
|
4039
4129
|
setDraftError(outcome.error);
|
|
4040
4130
|
}, [columns, draft, fieldPrefix, onCreate, resetDraft]);
|
|
4041
|
-
const handleGridKeyDown =
|
|
4131
|
+
const handleGridKeyDown = useCallback9(
|
|
4042
4132
|
(event) => {
|
|
4043
4133
|
if (editing !== null) return;
|
|
4044
4134
|
const target = event.target;
|
|
@@ -4588,7 +4678,7 @@ function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCo
|
|
|
4588
4678
|
}
|
|
4589
4679
|
function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle }) {
|
|
4590
4680
|
const basis = source.basis ?? "asserted";
|
|
4591
|
-
const setOpen =
|
|
4681
|
+
const setOpen = useCallback9(
|
|
4592
4682
|
(next) => {
|
|
4593
4683
|
if (!next) onToggle();
|
|
4594
4684
|
},
|
|
@@ -4835,12 +4925,12 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
|
|
|
4835
4925
|
|
|
4836
4926
|
// src/web-react/command-palette.tsx
|
|
4837
4927
|
import {
|
|
4838
|
-
useCallback as
|
|
4928
|
+
useCallback as useCallback10,
|
|
4839
4929
|
useEffect as useEffect12,
|
|
4840
4930
|
useId as useId3,
|
|
4841
4931
|
useMemo as useMemo7,
|
|
4842
|
-
useRef as
|
|
4843
|
-
useState as
|
|
4932
|
+
useRef as useRef11,
|
|
4933
|
+
useState as useState17
|
|
4844
4934
|
} from "react";
|
|
4845
4935
|
import { Dialog, DialogContent, DialogTitle } from "@tangle-network/ui/primitives";
|
|
4846
4936
|
import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
@@ -4864,18 +4954,18 @@ function CommandPalette({
|
|
|
4864
4954
|
emptyMessage,
|
|
4865
4955
|
label = "Command palette"
|
|
4866
4956
|
}) {
|
|
4867
|
-
const [internalOpen, setInternalOpen] =
|
|
4957
|
+
const [internalOpen, setInternalOpen] = useState17(false);
|
|
4868
4958
|
const open = controlledOpen ?? internalOpen;
|
|
4869
|
-
const setOpen =
|
|
4959
|
+
const setOpen = useCallback10(
|
|
4870
4960
|
(next) => {
|
|
4871
4961
|
if (controlledOpen === void 0) setInternalOpen(next);
|
|
4872
4962
|
onOpenChange?.(next);
|
|
4873
4963
|
},
|
|
4874
4964
|
[controlledOpen, onOpenChange]
|
|
4875
4965
|
);
|
|
4876
|
-
const [query, setQuery] =
|
|
4877
|
-
const [active, setActive] =
|
|
4878
|
-
const inputRef =
|
|
4966
|
+
const [query, setQuery] = useState17(initialQuery ?? "");
|
|
4967
|
+
const [active, setActive] = useState17(0);
|
|
4968
|
+
const inputRef = useRef11(null);
|
|
4879
4969
|
const surfaceId = useId3();
|
|
4880
4970
|
const listId = `${surfaceId}-list`;
|
|
4881
4971
|
const flat = useMemo7(() => filterCommandPaletteItems(items, query), [items, query]);
|
|
@@ -4893,7 +4983,7 @@ function CommandPalette({
|
|
|
4893
4983
|
document.addEventListener("keydown", onKeyDown);
|
|
4894
4984
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
4895
4985
|
}, [hotkey, open, setOpen]);
|
|
4896
|
-
const restoreFocusRef =
|
|
4986
|
+
const restoreFocusRef = useRef11(null);
|
|
4897
4987
|
useEffect12(() => {
|
|
4898
4988
|
if (open) return;
|
|
4899
4989
|
setQuery(initialQuery ?? "");
|
|
@@ -4904,7 +4994,7 @@ function CommandPalette({
|
|
|
4904
4994
|
if (!open || !activeId) return;
|
|
4905
4995
|
document.getElementById(activeId)?.scrollIntoView?.({ block: "nearest" });
|
|
4906
4996
|
}, [open, activeId]);
|
|
4907
|
-
const choose =
|
|
4997
|
+
const choose = useCallback10(
|
|
4908
4998
|
(item) => {
|
|
4909
4999
|
onSelect(item);
|
|
4910
5000
|
setOpen(false);
|
|
@@ -5178,10 +5268,10 @@ function Sparkline({
|
|
|
5178
5268
|
// src/web-react/insight-card.tsx
|
|
5179
5269
|
import {
|
|
5180
5270
|
isValidElement as isValidElement2,
|
|
5181
|
-
useCallback as
|
|
5271
|
+
useCallback as useCallback11,
|
|
5182
5272
|
useEffect as useEffect13,
|
|
5183
|
-
useRef as
|
|
5184
|
-
useState as
|
|
5273
|
+
useRef as useRef12,
|
|
5274
|
+
useState as useState18
|
|
5185
5275
|
} from "react";
|
|
5186
5276
|
import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
5187
5277
|
function insightDelta(value, previous) {
|
|
@@ -5346,15 +5436,15 @@ function InsightDeck({
|
|
|
5346
5436
|
className,
|
|
5347
5437
|
onPageChange
|
|
5348
5438
|
}) {
|
|
5349
|
-
const [page, setPage] =
|
|
5350
|
-
const [held, setHeld] =
|
|
5439
|
+
const [page, setPage] = useState18(0);
|
|
5440
|
+
const [held, setHeld] = useState18(null);
|
|
5351
5441
|
const answered = state.status === "error" || state.status === "empty";
|
|
5352
5442
|
const carried = state.status === "ready" ? state.value : answered ? null : held;
|
|
5353
5443
|
if (carried !== held) setHeld(carried);
|
|
5354
5444
|
const shown = carried !== null && state.status !== "ready" ? { status: "ready", value: carried, retry: state.retry } : state;
|
|
5355
5445
|
const refreshing = shown !== state;
|
|
5356
|
-
const reported =
|
|
5357
|
-
const settlePage =
|
|
5446
|
+
const reported = useRef12(0);
|
|
5447
|
+
const settlePage = useCallback11(
|
|
5358
5448
|
(next) => {
|
|
5359
5449
|
if (reported.current === next) return;
|
|
5360
5450
|
reported.current = next;
|
|
@@ -5437,9 +5527,9 @@ function InsightPages({
|
|
|
5437
5527
|
const pageCount = insightPageCount(insights.length, size);
|
|
5438
5528
|
const current = Math.min(Math.max(page, 0), pageCount - 1);
|
|
5439
5529
|
const visible = insightPageSlice(insights, current, size);
|
|
5440
|
-
const sectionRef =
|
|
5441
|
-
const listRef =
|
|
5442
|
-
const recoverFocus =
|
|
5530
|
+
const sectionRef = useRef12(null);
|
|
5531
|
+
const listRef = useRef12(null);
|
|
5532
|
+
const recoverFocus = useRef12(false);
|
|
5443
5533
|
useEffect13(() => {
|
|
5444
5534
|
onPageSettled(current);
|
|
5445
5535
|
}, [current, onPageSettled]);
|
|
@@ -5448,7 +5538,7 @@ function InsightPages({
|
|
|
5448
5538
|
recoverFocus.current = false;
|
|
5449
5539
|
sectionRef.current?.focus();
|
|
5450
5540
|
}, [current]);
|
|
5451
|
-
const goTo =
|
|
5541
|
+
const goTo = useCallback11(
|
|
5452
5542
|
(next) => {
|
|
5453
5543
|
const clamped = Math.min(Math.max(next, 0), pageCount - 1);
|
|
5454
5544
|
if (clamped === current) return false;
|
|
@@ -5591,7 +5681,7 @@ function PagerButton({
|
|
|
5591
5681
|
}
|
|
5592
5682
|
|
|
5593
5683
|
// src/web-react/api-access-panel.tsx
|
|
5594
|
-
import { useEffect as useEffect14, useRef as
|
|
5684
|
+
import { useEffect as useEffect14, useRef as useRef13, useState as useState19 } from "react";
|
|
5595
5685
|
import { PageHeader } from "@tangle-network/ui/primitives";
|
|
5596
5686
|
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
5597
5687
|
var defaultExpiryChoices = [1, 7, 30];
|
|
@@ -5647,23 +5737,23 @@ function ApiAccessPanel({
|
|
|
5647
5737
|
onRevoke,
|
|
5648
5738
|
onChanged
|
|
5649
5739
|
}) {
|
|
5650
|
-
const [name, setName] =
|
|
5651
|
-
const [reach, setReach] =
|
|
5740
|
+
const [name, setName] = useState19("");
|
|
5741
|
+
const [reach, setReach] = useState19("");
|
|
5652
5742
|
const selectedWorkspace = workspaces?.some((workspace) => workspace.id === reach) ? reach : "";
|
|
5653
5743
|
const workspaceName = (id) => workspaces?.find((workspace) => workspace.id === id)?.name ?? `A removed ${workspaceNoun.singular}`;
|
|
5654
5744
|
const allowedDays = [...new Set(expiryDays)].filter((days2) => days2 > 0 && Number.isFinite(new Date(Date.now() + days2 * 864e5).getTime()));
|
|
5655
5745
|
const fallbackDays = allowedDays.includes(defaultExpiryDays) ? defaultExpiryDays : allowedDays[0];
|
|
5656
|
-
const [days, setDays] =
|
|
5746
|
+
const [days, setDays] = useState19(fallbackDays);
|
|
5657
5747
|
const selectedDays = days !== void 0 && allowedDays.includes(days) ? days : fallbackDays;
|
|
5658
|
-
const [scopes, setScopes] =
|
|
5659
|
-
const [creating, setCreating] =
|
|
5660
|
-
const [revoking, setRevoking] =
|
|
5661
|
-
const [created, setCreated] =
|
|
5662
|
-
const [notice, setNotice] =
|
|
5663
|
-
const [error, setError] =
|
|
5664
|
-
const keyHeading =
|
|
5665
|
-
const nameInput =
|
|
5666
|
-
const keyWasShown =
|
|
5748
|
+
const [scopes, setScopes] = useState19(() => expandScopes(defaultScopes, access));
|
|
5749
|
+
const [creating, setCreating] = useState19(false);
|
|
5750
|
+
const [revoking, setRevoking] = useState19(null);
|
|
5751
|
+
const [created, setCreated] = useState19(null);
|
|
5752
|
+
const [notice, setNotice] = useState19(null);
|
|
5753
|
+
const [error, setError] = useState19(null);
|
|
5754
|
+
const keyHeading = useRef13(null);
|
|
5755
|
+
const nameInput = useRef13(null);
|
|
5756
|
+
const keyWasShown = useRef13(false);
|
|
5667
5757
|
const selectedScopes = pruneScopes(scopes, access);
|
|
5668
5758
|
useEffect14(() => {
|
|
5669
5759
|
setScopes((current) => {
|
|
@@ -5826,10 +5916,10 @@ function ApiAccessPanel({
|
|
|
5826
5916
|
}
|
|
5827
5917
|
|
|
5828
5918
|
// src/web-react/agent-setup-block.tsx
|
|
5829
|
-
import { useState as
|
|
5919
|
+
import { useState as useState20 } from "react";
|
|
5830
5920
|
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5831
5921
|
function AgentSetupBlock({ productName, setupUrl, markdown, description, className }) {
|
|
5832
|
-
const [notice, setNotice] =
|
|
5922
|
+
const [notice, setNotice] = useState20(null);
|
|
5833
5923
|
const prompt = markdown ?? `Set up ${productName} for me. Fetch ${setupUrl} and follow every step in it.`;
|
|
5834
5924
|
async function copy() {
|
|
5835
5925
|
try {
|
|
@@ -6188,7 +6278,7 @@ function ProposalCard({
|
|
|
6188
6278
|
approval,
|
|
6189
6279
|
renderers
|
|
6190
6280
|
}) {
|
|
6191
|
-
const [expanded, setExpanded] =
|
|
6281
|
+
const [expanded, setExpanded] = useState21(false);
|
|
6192
6282
|
const { summary, meta, typeSlug } = proposalPreview(call);
|
|
6193
6283
|
const custom = renderers?.[call.name]?.(call, message);
|
|
6194
6284
|
const { pending: deciding, run: decide } = usePending();
|
|
@@ -6459,8 +6549,8 @@ function copyTextOf(msg) {
|
|
|
6459
6549
|
return msg.content;
|
|
6460
6550
|
}
|
|
6461
6551
|
function CopyMessageButton({ text }) {
|
|
6462
|
-
const [copied, setCopied] =
|
|
6463
|
-
const timerRef =
|
|
6552
|
+
const [copied, setCopied] = useState21(false);
|
|
6553
|
+
const timerRef = useRef14(null);
|
|
6464
6554
|
useEffect15(
|
|
6465
6555
|
() => () => {
|
|
6466
6556
|
if (timerRef.current !== null) clearTimeout(timerRef.current);
|
|
@@ -6607,7 +6697,7 @@ function AssistantMessageImpl({
|
|
|
6607
6697
|
}
|
|
6608
6698
|
var AssistantMessage = memo(AssistantMessageImpl);
|
|
6609
6699
|
function useThinkingSeconds(active) {
|
|
6610
|
-
const [seconds, setSeconds] =
|
|
6700
|
+
const [seconds, setSeconds] = useState21(0);
|
|
6611
6701
|
useEffect15(() => {
|
|
6612
6702
|
if (!active) return;
|
|
6613
6703
|
setSeconds(0);
|
|
@@ -6812,6 +6902,7 @@ export {
|
|
|
6812
6902
|
triggerAttachmentDownload,
|
|
6813
6903
|
MessageAttachments,
|
|
6814
6904
|
TurnProgress,
|
|
6905
|
+
useChatScroll,
|
|
6815
6906
|
ReasoningRow,
|
|
6816
6907
|
trackChatReasoning,
|
|
6817
6908
|
chatReasoningFromParts,
|
|
@@ -6925,4 +7016,4 @@ export {
|
|
|
6925
7016
|
useThinkingSeconds,
|
|
6926
7017
|
ChatMessages
|
|
6927
7018
|
};
|
|
6928
|
-
//# sourceMappingURL=chunk-
|
|
7019
|
+
//# sourceMappingURL=chunk-IAFPBYQQ.js.map
|