@tangle-network/agent-app 0.44.29 → 0.44.30
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/assistant/index.d.ts +8 -6
- package/dist/assistant/index.js +6 -3
- package/dist/assistant/index.js.map +1 -1
- package/dist/{attachment-validation-Dvc_Livy.d.ts → attachment-validation-CNkH91Gs.d.ts} +1 -1
- package/dist/chat-react/index.d.ts +192 -0
- package/dist/chat-react/index.js +179 -0
- package/dist/chat-react/index.js.map +1 -0
- package/dist/chat-routes/index.d.ts +7 -6
- package/dist/chat-routes/index.js +12 -8
- package/dist/chat-routes/index.js.map +1 -1
- package/dist/chat-store/index.d.ts +6 -5
- package/dist/chat-store/index.js +2 -1
- package/dist/chat-store/index.js.map +1 -1
- package/dist/chunk-4OO7P3ZF.js +292 -0
- package/dist/chunk-4OO7P3ZF.js.map +1 -0
- package/dist/chunk-4PUMUTLU.js +158 -0
- package/dist/chunk-4PUMUTLU.js.map +1 -0
- package/dist/{chunk-PRKSYTMQ.js → chunk-GCH3BUAZ.js} +31 -317
- package/dist/chunk-GCH3BUAZ.js.map +1 -0
- package/dist/{chunk-BI6NKSO4.js → chunk-IYLJS6VW.js} +3 -84
- package/dist/chunk-IYLJS6VW.js.map +1 -0
- package/dist/chunk-QY4BRKRJ.js +84 -0
- package/dist/chunk-QY4BRKRJ.js.map +1 -0
- package/dist/{chunk-C3SRFZGL.js → chunk-QYAQGCHF.js} +2 -154
- package/dist/chunk-QYAQGCHF.js.map +1 -0
- package/dist/{contract-CEewO6DI.d.ts → contract-CQNvv5th.d.ts} +1 -1
- package/dist/interactions/index.d.ts +2 -2
- package/dist/{parts-fyPPdDdK.d.ts → parts-7fbe2rj8.d.ts} +4 -274
- package/dist/{queue-vRI0Qx3X.d.ts → queue-VTBA5ONX.d.ts} +1 -1
- package/dist/stream/index.d.ts +3 -3
- package/dist/{stream-normalizer-DnuqkZvw.d.ts → stream-normalizer-CnPnMaTp.d.ts} +1 -1
- package/dist/teams/index.js +5 -5
- package/dist/teams/invitations-api.js +4 -4
- package/dist/teams-react/index.js +3 -3
- package/dist/{types-DB82fktc.d.ts → types-CCeYywdS.d.ts} +1 -1
- package/dist/use-file-mentions-E6a7_cbH.d.ts +98 -0
- package/dist/web-react/index.d.ts +13 -104
- package/dist/web-react/index.js +17 -12
- package/dist/wire-DSp4LzEE.d.ts +272 -0
- package/dist/work-product/index.d.ts +3 -3
- package/dist/work-product-react/index.d.ts +1 -1
- package/package.json +6 -1
- package/dist/chunk-BI6NKSO4.js.map +0 -1
- package/dist/chunk-C3SRFZGL.js.map +0 -1
- package/dist/chunk-PRKSYTMQ.js.map +0 -1
|
@@ -6,21 +6,11 @@ import {
|
|
|
6
6
|
workProductPartsFromMessageParts
|
|
7
7
|
} from "./chunk-YTMKRL3L.js";
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
MAX_ATTACHMENT_TOTAL_BYTES,
|
|
12
|
-
MAX_BINARY_ATTACHMENT_BYTES,
|
|
13
|
-
MAX_TEXT_ATTACHMENT_BYTES,
|
|
14
|
-
attachmentSizeErrorMessage,
|
|
15
|
-
attachmentTotalSizeErrorMessage,
|
|
16
|
-
checkAttachmentType,
|
|
17
|
-
sanitizeAttachmentFileName,
|
|
18
|
-
sniffBinary
|
|
19
|
-
} from "./chunk-BI6NKSO4.js";
|
|
9
|
+
attachmentPartsFromMessageParts
|
|
10
|
+
} from "./chunk-4PUMUTLU.js";
|
|
20
11
|
import {
|
|
21
|
-
attachmentPartsFromMessageParts,
|
|
22
12
|
formatBytes
|
|
23
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-QYAQGCHF.js";
|
|
24
14
|
import {
|
|
25
15
|
cancelStatusFor,
|
|
26
16
|
fieldAcceptsFreeText,
|
|
@@ -41,7 +31,7 @@ import {
|
|
|
41
31
|
} from "./chunk-CQZSAR77.js";
|
|
42
32
|
|
|
43
33
|
// src/web-react/index.tsx
|
|
44
|
-
import { useEffect as
|
|
34
|
+
import { useEffect as useEffect9, useMemo as useMemo7, useRef as useRef8, useState as useState13, memo } from "react";
|
|
45
35
|
|
|
46
36
|
// src/web-react/smooth-text.ts
|
|
47
37
|
import { useEffect, useRef, useState } from "react";
|
|
@@ -2416,283 +2406,8 @@ function segmentMentionContent(content, parts) {
|
|
|
2416
2406
|
return { segments, matched };
|
|
2417
2407
|
}
|
|
2418
2408
|
|
|
2419
|
-
// src/web-react/use-composer-attachments.ts
|
|
2420
|
-
import { useCallback as useCallback6, useEffect as useEffect8, useMemo as useMemo6, useRef as useRef8, useState as useState11 } from "react";
|
|
2421
|
-
function newId() {
|
|
2422
|
-
const cryptoObject = globalThis.crypto;
|
|
2423
|
-
if (typeof cryptoObject?.randomUUID === "function") return cryptoObject.randomUUID();
|
|
2424
|
-
return `att-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
2425
|
-
}
|
|
2426
|
-
function dedupeName(name, taken) {
|
|
2427
|
-
if (!taken.has(name)) return name;
|
|
2428
|
-
const dot = name.lastIndexOf(".");
|
|
2429
|
-
const base = dot > 0 ? name.slice(0, dot) : name;
|
|
2430
|
-
const ext = dot > 0 ? name.slice(dot) : "";
|
|
2431
|
-
let n = 2;
|
|
2432
|
-
let candidate = `${base}-${n}${ext}`;
|
|
2433
|
-
while (taken.has(candidate)) {
|
|
2434
|
-
n += 1;
|
|
2435
|
-
candidate = `${base}-${n}${ext}`;
|
|
2436
|
-
}
|
|
2437
|
-
return candidate;
|
|
2438
|
-
}
|
|
2439
|
-
function kindForMime(mime) {
|
|
2440
|
-
return mime.startsWith("image/") ? "image" : "file";
|
|
2441
|
-
}
|
|
2442
|
-
function isAcceptedFileType(file, accept) {
|
|
2443
|
-
const patterns = accept.split(",").map((p) => p.trim()).filter((p) => p.length > 0);
|
|
2444
|
-
if (patterns.length === 0) return true;
|
|
2445
|
-
const name = file.name.toLowerCase();
|
|
2446
|
-
const type = (file.type || "").toLowerCase();
|
|
2447
|
-
return patterns.some((pattern) => {
|
|
2448
|
-
const lower = pattern.toLowerCase();
|
|
2449
|
-
if (lower.startsWith(".")) return name.endsWith(lower);
|
|
2450
|
-
if (lower.endsWith("/*")) return type.startsWith(lower.slice(0, -1));
|
|
2451
|
-
return type === lower;
|
|
2452
|
-
});
|
|
2453
|
-
}
|
|
2454
|
-
async function parseUploadError(res) {
|
|
2455
|
-
const detail = await res.json().catch(() => null);
|
|
2456
|
-
if (detail && typeof detail === "object" && "error" in detail) {
|
|
2457
|
-
const error = detail.error;
|
|
2458
|
-
if (typeof error === "string" && error) return error;
|
|
2459
|
-
if (error && typeof error === "object" && "message" in error) {
|
|
2460
|
-
const message = error.message;
|
|
2461
|
-
if (typeof message === "string" && message) return message;
|
|
2462
|
-
}
|
|
2463
|
-
}
|
|
2464
|
-
return `Upload failed (${res.status})`;
|
|
2465
|
-
}
|
|
2466
|
-
var NO_UPLOAD_TARGET_MESSAGE = "No upload destination configured (pass uploadUrl or buildUploadRequest)";
|
|
2467
|
-
function useComposerAttachments(options) {
|
|
2468
|
-
const optionsRef = useRef8(options);
|
|
2469
|
-
optionsRef.current = options;
|
|
2470
|
-
const [staged, setStagedState] = useState11([]);
|
|
2471
|
-
const stagedRef = useRef8([]);
|
|
2472
|
-
const controllersRef = useRef8(/* @__PURE__ */ new Map());
|
|
2473
|
-
const setStaged = useCallback6(
|
|
2474
|
-
(updater) => {
|
|
2475
|
-
const next = typeof updater === "function" ? updater(stagedRef.current) : updater;
|
|
2476
|
-
stagedRef.current = next;
|
|
2477
|
-
setStagedState(next);
|
|
2478
|
-
},
|
|
2479
|
-
[]
|
|
2480
|
-
);
|
|
2481
|
-
const upload = useCallback6(
|
|
2482
|
-
async (id, file, name) => {
|
|
2483
|
-
const opts = optionsRef.current;
|
|
2484
|
-
setStaged(
|
|
2485
|
-
(prev) => prev.map((s) => s.id === id ? { ...s, status: "uploading", errorMessage: void 0 } : s)
|
|
2486
|
-
);
|
|
2487
|
-
const controller = new AbortController();
|
|
2488
|
-
controllersRef.current.set(id, controller);
|
|
2489
|
-
const form = new FormData();
|
|
2490
|
-
form.append("file", file, name);
|
|
2491
|
-
const request = opts.buildUploadRequest ? opts.buildUploadRequest({ file, name, form }) : opts.uploadUrl ? { url: opts.uploadUrl } : null;
|
|
2492
|
-
if (!request) {
|
|
2493
|
-
setStaged(
|
|
2494
|
-
(prev) => prev.map(
|
|
2495
|
-
(s) => s.id === id ? { ...s, status: "error", errorMessage: NO_UPLOAD_TARGET_MESSAGE } : s
|
|
2496
|
-
)
|
|
2497
|
-
);
|
|
2498
|
-
opts.onError?.(NO_UPLOAD_TARGET_MESSAGE);
|
|
2499
|
-
controllersRef.current.delete(id);
|
|
2500
|
-
return;
|
|
2501
|
-
}
|
|
2502
|
-
try {
|
|
2503
|
-
const res = await fetch(request.url, {
|
|
2504
|
-
method: "POST",
|
|
2505
|
-
credentials: "same-origin",
|
|
2506
|
-
...request.init,
|
|
2507
|
-
body: form,
|
|
2508
|
-
signal: controller.signal
|
|
2509
|
-
});
|
|
2510
|
-
if (!res.ok) {
|
|
2511
|
-
const message = await parseUploadError(res);
|
|
2512
|
-
setStaged(
|
|
2513
|
-
(prev) => prev.map((s) => s.id === id ? { ...s, status: "error", errorMessage: message } : s)
|
|
2514
|
-
);
|
|
2515
|
-
opts.onError?.(message);
|
|
2516
|
-
return;
|
|
2517
|
-
}
|
|
2518
|
-
const data = await res.json();
|
|
2519
|
-
const uploaded = data.files?.[0];
|
|
2520
|
-
if (!uploaded) {
|
|
2521
|
-
const message = "Upload returned no file";
|
|
2522
|
-
setStaged(
|
|
2523
|
-
(prev) => prev.map((s) => s.id === id ? { ...s, status: "error", errorMessage: message } : s)
|
|
2524
|
-
);
|
|
2525
|
-
opts.onError?.(message);
|
|
2526
|
-
return;
|
|
2527
|
-
}
|
|
2528
|
-
setStaged(
|
|
2529
|
-
(prev) => prev.map((s) => s.id === id ? { ...s, status: "ready", reference: uploaded } : s)
|
|
2530
|
-
);
|
|
2531
|
-
} catch (err) {
|
|
2532
|
-
if (err.name === "AbortError") return;
|
|
2533
|
-
const message = err instanceof Error && err.message ? err.message : "Upload failed \u2014 check your connection";
|
|
2534
|
-
setStaged(
|
|
2535
|
-
(prev) => prev.map((s) => s.id === id ? { ...s, status: "error", errorMessage: message } : s)
|
|
2536
|
-
);
|
|
2537
|
-
opts.onError?.(message);
|
|
2538
|
-
} finally {
|
|
2539
|
-
controllersRef.current.delete(id);
|
|
2540
|
-
}
|
|
2541
|
-
},
|
|
2542
|
-
[setStaged]
|
|
2543
|
-
);
|
|
2544
|
-
const addFiles = useCallback6(
|
|
2545
|
-
async (files) => {
|
|
2546
|
-
const opts = optionsRef.current;
|
|
2547
|
-
const enabled2 = opts.enabled ?? true;
|
|
2548
|
-
if (!enabled2) {
|
|
2549
|
-
opts.onReject?.("Attachments are disabled");
|
|
2550
|
-
return;
|
|
2551
|
-
}
|
|
2552
|
-
const accept = opts.accept ?? ATTACHMENT_ACCEPT;
|
|
2553
|
-
const maxCount = opts.limits?.maxCount ?? ATTACHMENT_MAX_COUNT;
|
|
2554
|
-
const maxBinaryBytes = opts.limits?.maxBinaryBytes ?? MAX_BINARY_ATTACHMENT_BYTES;
|
|
2555
|
-
const maxTextBytes = opts.limits?.maxTextBytes ?? MAX_TEXT_ATTACHMENT_BYTES;
|
|
2556
|
-
const maxTotalBytes = opts.limits?.maxTotalBytes ?? MAX_ATTACHMENT_TOTAL_BYTES;
|
|
2557
|
-
const allowedKinds = opts.allowedKinds ?? ["image", "file"];
|
|
2558
|
-
const list = Array.isArray(files) ? files : Array.from(files);
|
|
2559
|
-
const currentCount = stagedRef.current.length;
|
|
2560
|
-
const countAccepted = [];
|
|
2561
|
-
for (const file of list) {
|
|
2562
|
-
if (!isAcceptedFileType(file, accept)) {
|
|
2563
|
-
opts.onReject?.(`"${file.name}" is not an accepted file type (${accept}).`, file);
|
|
2564
|
-
continue;
|
|
2565
|
-
}
|
|
2566
|
-
if (currentCount + countAccepted.length >= maxCount) {
|
|
2567
|
-
opts.onReject?.(`"${file.name}" was not added \u2014 the ${maxCount}-file limit is already reached.`, file);
|
|
2568
|
-
continue;
|
|
2569
|
-
}
|
|
2570
|
-
countAccepted.push(file);
|
|
2571
|
-
}
|
|
2572
|
-
const sizeAccepted = [];
|
|
2573
|
-
for (const file of countAccepted) {
|
|
2574
|
-
const bytes = new Uint8Array(await file.arrayBuffer());
|
|
2575
|
-
const sniff = sniffBinary(bytes);
|
|
2576
|
-
const typeCheck = checkAttachmentType(file.name, sniff);
|
|
2577
|
-
if (!typeCheck.succeeded) {
|
|
2578
|
-
opts.onReject?.(typeCheck.message, file);
|
|
2579
|
-
continue;
|
|
2580
|
-
}
|
|
2581
|
-
const limit = sniff.binary ? maxBinaryBytes : maxTextBytes;
|
|
2582
|
-
if (file.size > limit) {
|
|
2583
|
-
opts.onReject?.(attachmentSizeErrorMessage(file.name, file.size, limit), file);
|
|
2584
|
-
continue;
|
|
2585
|
-
}
|
|
2586
|
-
const mediaType = sniff.mime ?? file.type ?? "";
|
|
2587
|
-
const kind = kindForMime(mediaType);
|
|
2588
|
-
if (!allowedKinds.includes(kind)) {
|
|
2589
|
-
opts.onReject?.(`"${file.name}" is a ${kind} attachment, which isn't accepted here`, file);
|
|
2590
|
-
continue;
|
|
2591
|
-
}
|
|
2592
|
-
sizeAccepted.push(file);
|
|
2593
|
-
}
|
|
2594
|
-
const accepted = [];
|
|
2595
|
-
let totalBytes = stagedRef.current.reduce((total, s) => total + s.size, 0);
|
|
2596
|
-
for (const file of sizeAccepted) {
|
|
2597
|
-
const nextTotalBytes = totalBytes + file.size;
|
|
2598
|
-
if (nextTotalBytes > maxTotalBytes) {
|
|
2599
|
-
opts.onReject?.(attachmentTotalSizeErrorMessage(nextTotalBytes, maxTotalBytes), file);
|
|
2600
|
-
continue;
|
|
2601
|
-
}
|
|
2602
|
-
accepted.push(file);
|
|
2603
|
-
totalBytes = nextTotalBytes;
|
|
2604
|
-
}
|
|
2605
|
-
if (accepted.length === 0) return;
|
|
2606
|
-
const taken = new Set(stagedRef.current.map((s) => s.name));
|
|
2607
|
-
const entries = accepted.map((file) => {
|
|
2608
|
-
const name = dedupeName(sanitizeAttachmentFileName(file.name), taken);
|
|
2609
|
-
taken.add(name);
|
|
2610
|
-
return {
|
|
2611
|
-
id: newId(),
|
|
2612
|
-
file,
|
|
2613
|
-
name,
|
|
2614
|
-
size: file.size,
|
|
2615
|
-
status: "pending",
|
|
2616
|
-
previewUrl: file.type.startsWith("image/") ? URL.createObjectURL(file) : void 0
|
|
2617
|
-
};
|
|
2618
|
-
});
|
|
2619
|
-
setStaged((prev) => [...prev, ...entries]);
|
|
2620
|
-
for (const entry of entries) void upload(entry.id, entry.file, entry.name);
|
|
2621
|
-
},
|
|
2622
|
-
[setStaged, upload]
|
|
2623
|
-
);
|
|
2624
|
-
const retry = useCallback6(
|
|
2625
|
-
(id) => {
|
|
2626
|
-
const entry = stagedRef.current.find((s) => s.id === id);
|
|
2627
|
-
if (!entry) return;
|
|
2628
|
-
void upload(entry.id, entry.file, entry.name);
|
|
2629
|
-
},
|
|
2630
|
-
[upload]
|
|
2631
|
-
);
|
|
2632
|
-
const removeAttachment = useCallback6(
|
|
2633
|
-
(id) => {
|
|
2634
|
-
controllersRef.current.get(id)?.abort();
|
|
2635
|
-
controllersRef.current.delete(id);
|
|
2636
|
-
const entry = stagedRef.current.find((s) => s.id === id);
|
|
2637
|
-
if (entry?.previewUrl) URL.revokeObjectURL(entry.previewUrl);
|
|
2638
|
-
setStaged((prev) => prev.filter((s) => s.id !== id));
|
|
2639
|
-
},
|
|
2640
|
-
[setStaged]
|
|
2641
|
-
);
|
|
2642
|
-
const clear = useCallback6(() => {
|
|
2643
|
-
for (const controller of controllersRef.current.values()) controller.abort();
|
|
2644
|
-
controllersRef.current.clear();
|
|
2645
|
-
for (const entry of stagedRef.current) {
|
|
2646
|
-
if (entry.previewUrl) URL.revokeObjectURL(entry.previewUrl);
|
|
2647
|
-
}
|
|
2648
|
-
setStaged([]);
|
|
2649
|
-
}, [setStaged]);
|
|
2650
|
-
useEffect8(
|
|
2651
|
-
() => () => {
|
|
2652
|
-
for (const controller of controllersRef.current.values()) controller.abort();
|
|
2653
|
-
controllersRef.current.clear();
|
|
2654
|
-
for (const entry of stagedRef.current) {
|
|
2655
|
-
if (entry.previewUrl) URL.revokeObjectURL(entry.previewUrl);
|
|
2656
|
-
}
|
|
2657
|
-
},
|
|
2658
|
-
[]
|
|
2659
|
-
);
|
|
2660
|
-
const composerFiles = useMemo6(
|
|
2661
|
-
() => staged.map((s) => ({
|
|
2662
|
-
id: s.id,
|
|
2663
|
-
name: s.name,
|
|
2664
|
-
size: s.size,
|
|
2665
|
-
kind: "file",
|
|
2666
|
-
status: s.status
|
|
2667
|
-
})),
|
|
2668
|
-
[staged]
|
|
2669
|
-
);
|
|
2670
|
-
const references = useMemo6(
|
|
2671
|
-
() => staged.filter((s) => s.status === "ready" && !!s.reference).map((s) => s.reference),
|
|
2672
|
-
[staged]
|
|
2673
|
-
);
|
|
2674
|
-
const hasPending = useMemo6(
|
|
2675
|
-
() => staged.some((s) => s.status === "pending" || s.status === "uploading"),
|
|
2676
|
-
[staged]
|
|
2677
|
-
);
|
|
2678
|
-
const hasError = useMemo6(() => staged.some((s) => s.status === "error"), [staged]);
|
|
2679
|
-
const enabled = options.enabled ?? true;
|
|
2680
|
-
const blockReason = !enabled ? "Attachments are disabled" : hasPending ? "Attachments are still uploading" : hasError ? "Remove failed attachments to send" : null;
|
|
2681
|
-
return {
|
|
2682
|
-
composerFiles,
|
|
2683
|
-
references,
|
|
2684
|
-
addFiles,
|
|
2685
|
-
retry,
|
|
2686
|
-
removeAttachment,
|
|
2687
|
-
clear,
|
|
2688
|
-
hasPending,
|
|
2689
|
-
hasError,
|
|
2690
|
-
blockReason
|
|
2691
|
-
};
|
|
2692
|
-
}
|
|
2693
|
-
|
|
2694
2409
|
// src/web-react/mission-activity.tsx
|
|
2695
|
-
import { useCallback as
|
|
2410
|
+
import { useCallback as useCallback6, useEffect as useEffect8, useState as useState11 } from "react";
|
|
2696
2411
|
import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2697
2412
|
var LIVE_STATUSES = /* @__PURE__ */ new Set(["pending", "running"]);
|
|
2698
2413
|
var OK_STATUSES = /* @__PURE__ */ new Set(["completed", "done", "succeeded"]);
|
|
@@ -2752,8 +2467,8 @@ function CopyGlyph({ className }) {
|
|
|
2752
2467
|
] });
|
|
2753
2468
|
}
|
|
2754
2469
|
function TraceIdCopy({ traceId }) {
|
|
2755
|
-
const [copied, setCopied] =
|
|
2756
|
-
const copy =
|
|
2470
|
+
const [copied, setCopied] = useState11(false);
|
|
2471
|
+
const copy = useCallback6(() => {
|
|
2757
2472
|
void navigator.clipboard?.writeText(traceId).then(
|
|
2758
2473
|
() => {
|
|
2759
2474
|
setCopied(true);
|
|
@@ -2820,7 +2535,7 @@ function FlowWaterfall({ trace }) {
|
|
|
2820
2535
|
] });
|
|
2821
2536
|
}
|
|
2822
2537
|
function MissionActivityLane({ activity, startedAt, nowMs }) {
|
|
2823
|
-
const [expanded, setExpanded] =
|
|
2538
|
+
const [expanded, setExpanded] = useState11(false);
|
|
2824
2539
|
if (activity.length === 0) return null;
|
|
2825
2540
|
return /* @__PURE__ */ jsxs8("div", { className: "mt-1 border-l border-border/50 pl-3", children: [
|
|
2826
2541
|
activity.map((run) => {
|
|
@@ -2871,7 +2586,7 @@ function ActivityRow({
|
|
|
2871
2586
|
record,
|
|
2872
2587
|
renderMissionRef
|
|
2873
2588
|
}) {
|
|
2874
|
-
const [open, setOpen] =
|
|
2589
|
+
const [open, setOpen] = useState11(false);
|
|
2875
2590
|
const tone = activityTone(record.status);
|
|
2876
2591
|
const cost = formatActivityCost(record.costUsd);
|
|
2877
2592
|
const duration = formatActivityDuration(record.durationMs);
|
|
@@ -2917,11 +2632,11 @@ function ActivityRow({
|
|
|
2917
2632
|
] });
|
|
2918
2633
|
}
|
|
2919
2634
|
function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent activity", emptyLabel = "No agent runs yet." }) {
|
|
2920
|
-
const [rows, setRows] =
|
|
2921
|
-
const [cursor, setCursor] =
|
|
2922
|
-
const [loading, setLoading] =
|
|
2923
|
-
const [error, setError] =
|
|
2924
|
-
const load =
|
|
2635
|
+
const [rows, setRows] = useState11([]);
|
|
2636
|
+
const [cursor, setCursor] = useState11(void 0);
|
|
2637
|
+
const [loading, setLoading] = useState11(false);
|
|
2638
|
+
const [error, setError] = useState11(null);
|
|
2639
|
+
const load = useCallback6(
|
|
2925
2640
|
async (from) => {
|
|
2926
2641
|
setLoading(true);
|
|
2927
2642
|
setError(null);
|
|
@@ -2937,7 +2652,7 @@ function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent ac
|
|
|
2937
2652
|
},
|
|
2938
2653
|
[fetchActivity]
|
|
2939
2654
|
);
|
|
2940
|
-
|
|
2655
|
+
useEffect8(() => {
|
|
2941
2656
|
void load();
|
|
2942
2657
|
}, [load]);
|
|
2943
2658
|
return /* @__PURE__ */ jsxs8("div", { className: "space-y-2", children: [
|
|
@@ -3044,7 +2759,7 @@ function SeatPaywall({
|
|
|
3044
2759
|
}
|
|
3045
2760
|
|
|
3046
2761
|
// src/web-react/agent-session-controls.tsx
|
|
3047
|
-
import { useMemo as
|
|
2762
|
+
import { useMemo as useMemo6, useState as useState12 } from "react";
|
|
3048
2763
|
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3049
2764
|
var HARNESS_LABELS = {
|
|
3050
2765
|
opencode: "OpenCode (any model)",
|
|
@@ -3079,7 +2794,7 @@ function HarnessPicker({
|
|
|
3079
2794
|
onChange,
|
|
3080
2795
|
available
|
|
3081
2796
|
}) {
|
|
3082
|
-
const [open, setOpen] =
|
|
2797
|
+
const [open, setOpen] = useState12(false);
|
|
3083
2798
|
const { containerRef, triggerProps } = usePopover(open, setOpen);
|
|
3084
2799
|
const options = available ?? Object.keys(HARNESS_LABELS);
|
|
3085
2800
|
return /* @__PURE__ */ jsxs10("div", { ref: containerRef, className: "relative inline-flex", children: [
|
|
@@ -3116,7 +2831,7 @@ function HarnessPicker({
|
|
|
3116
2831
|
}
|
|
3117
2832
|
function useCoherentHandlers(props) {
|
|
3118
2833
|
const { model, models, harness, onModelChange, onHarnessChange } = props;
|
|
3119
|
-
const canonicalIds =
|
|
2834
|
+
const canonicalIds = useMemo6(() => models.map((m) => m.id), [models]);
|
|
3120
2835
|
const onModel = (next) => {
|
|
3121
2836
|
onModelChange(next);
|
|
3122
2837
|
const nextHarness = snapHarnessToModel(harness, next);
|
|
@@ -3144,7 +2859,7 @@ function AgentSessionControls(props) {
|
|
|
3144
2859
|
className
|
|
3145
2860
|
} = props;
|
|
3146
2861
|
const { onModel, onHarness } = useCoherentHandlers(props);
|
|
3147
|
-
const [open, setOpen] =
|
|
2862
|
+
const [open, setOpen] = useState12(false);
|
|
3148
2863
|
const { containerRef: popoverRef, triggerProps } = usePopover(open, setOpen);
|
|
3149
2864
|
const selectedModel = models.find((m) => m.id === model);
|
|
3150
2865
|
const showEffort = selectedModel?.supportsReasoning ?? true;
|
|
@@ -3413,7 +3128,7 @@ function ProposalCard({
|
|
|
3413
3128
|
approval,
|
|
3414
3129
|
renderers
|
|
3415
3130
|
}) {
|
|
3416
|
-
const [expanded, setExpanded] =
|
|
3131
|
+
const [expanded, setExpanded] = useState13(false);
|
|
3417
3132
|
const { summary, meta } = proposalPreview(call);
|
|
3418
3133
|
const custom = renderers?.[call.name]?.(call, message);
|
|
3419
3134
|
const { pending: deciding, run: decide } = usePending();
|
|
@@ -3485,7 +3200,7 @@ function ToolCallCard({
|
|
|
3485
3200
|
onOpenRun,
|
|
3486
3201
|
renderers
|
|
3487
3202
|
}) {
|
|
3488
|
-
const [expanded, setExpanded] =
|
|
3203
|
+
const [expanded, setExpanded] = useState13(false);
|
|
3489
3204
|
const pending = call.status === "done" ? pendingApprovalOf(call) : null;
|
|
3490
3205
|
const kind = blockKindOf(call);
|
|
3491
3206
|
const failed = call.status === "error" || toolOutcomeOf(call)?.ok === false;
|
|
@@ -3582,7 +3297,7 @@ function SegmentText({
|
|
|
3582
3297
|
renderBody
|
|
3583
3298
|
}) {
|
|
3584
3299
|
const text = useSmoothText(content, streaming);
|
|
3585
|
-
const body =
|
|
3300
|
+
const body = useMemo7(() => renderBody(text), [renderBody, text]);
|
|
3586
3301
|
if (!content.trim() && !showCaret) return null;
|
|
3587
3302
|
return /* @__PURE__ */ jsxs11("div", { className: "text-base leading-[1.75]", children: [
|
|
3588
3303
|
body,
|
|
@@ -3679,19 +3394,19 @@ function AssistantMessageImpl({
|
|
|
3679
3394
|
}) {
|
|
3680
3395
|
const content = useSmoothText(msg.content, streaming);
|
|
3681
3396
|
const reasoning = useSmoothText(msg.reasoning ?? "", streaming);
|
|
3682
|
-
const body =
|
|
3397
|
+
const body = useMemo7(() => renderBody(content), [renderBody, content]);
|
|
3683
3398
|
const segments = msg.segments;
|
|
3684
3399
|
const hasAnswerText = content !== "" || (segments?.some((s) => s.kind === "text" && s.content.trim() !== "") ?? false);
|
|
3685
|
-
const reasoningScrollRef =
|
|
3686
|
-
const thinkStartRef =
|
|
3687
|
-
const thinkMsRef =
|
|
3400
|
+
const reasoningScrollRef = useRef8(null);
|
|
3401
|
+
const thinkStartRef = useRef8(null);
|
|
3402
|
+
const thinkMsRef = useRef8(null);
|
|
3688
3403
|
if (streaming && reasoning && !hasAnswerText && thinkStartRef.current === null) {
|
|
3689
3404
|
thinkStartRef.current = performance.now();
|
|
3690
3405
|
}
|
|
3691
3406
|
if (hasAnswerText && thinkStartRef.current !== null && thinkMsRef.current === null) {
|
|
3692
3407
|
thinkMsRef.current = performance.now() - thinkStartRef.current;
|
|
3693
3408
|
}
|
|
3694
|
-
|
|
3409
|
+
useEffect9(() => {
|
|
3695
3410
|
const el = reasoningScrollRef.current;
|
|
3696
3411
|
if (el && streaming && !hasAnswerText) el.scrollTop = el.scrollHeight;
|
|
3697
3412
|
}, [reasoning, streaming, hasAnswerText]);
|
|
@@ -3771,8 +3486,8 @@ function AssistantMessageImpl({
|
|
|
3771
3486
|
}
|
|
3772
3487
|
var AssistantMessage = memo(AssistantMessageImpl);
|
|
3773
3488
|
function useThinkingSeconds(active) {
|
|
3774
|
-
const [seconds, setSeconds] =
|
|
3775
|
-
|
|
3489
|
+
const [seconds, setSeconds] = useState13(0);
|
|
3490
|
+
useEffect9(() => {
|
|
3776
3491
|
if (!active) return;
|
|
3777
3492
|
setSeconds(0);
|
|
3778
3493
|
const id = setInterval(() => setSeconds((s) => s + 1), 1e3);
|
|
@@ -3829,7 +3544,7 @@ function ChatMessages({
|
|
|
3829
3544
|
resolveAttachmentUrl,
|
|
3830
3545
|
workProductCards
|
|
3831
3546
|
}) {
|
|
3832
|
-
const renderBody =
|
|
3547
|
+
const renderBody = useMemo7(
|
|
3833
3548
|
() => renderMarkdown ?? ((content) => /* @__PURE__ */ jsx13("p", { className: "whitespace-pre-wrap", children: content })),
|
|
3834
3549
|
[renderMarkdown]
|
|
3835
3550
|
);
|
|
@@ -3937,7 +3652,6 @@ export {
|
|
|
3937
3652
|
DEFAULT_MENTION_EMPTY_TEXT,
|
|
3938
3653
|
useFileMentions,
|
|
3939
3654
|
segmentMentionContent,
|
|
3940
|
-
useComposerAttachments,
|
|
3941
3655
|
activityTone,
|
|
3942
3656
|
formatActivityCost,
|
|
3943
3657
|
formatActivityDuration,
|
|
@@ -3956,4 +3670,4 @@ export {
|
|
|
3956
3670
|
useThinkingSeconds,
|
|
3957
3671
|
ChatMessages
|
|
3958
3672
|
};
|
|
3959
|
-
//# sourceMappingURL=chunk-
|
|
3673
|
+
//# sourceMappingURL=chunk-GCH3BUAZ.js.map
|