@tangle-network/agent-app 0.60.178 → 0.60.180

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.
Files changed (60) hide show
  1. package/dist/agent-profiles/d1.js +3 -3
  2. package/dist/agent-profiles/index.js +3 -3
  3. package/dist/assistant/index.js +7 -5
  4. package/dist/assistant/index.js.map +1 -1
  5. package/dist/channels/index.js +1 -1
  6. package/dist/chat-routes/index.js +4 -4
  7. package/dist/{chunk-GIJY3YCH.js → chunk-3RHAF2P5.js} +11 -13
  8. package/dist/chunk-3RHAF2P5.js.map +1 -0
  9. package/dist/{chunk-IAFPBYQQ.js → chunk-6ZUVYAKB.js} +506 -315
  10. package/dist/chunk-6ZUVYAKB.js.map +1 -0
  11. package/dist/{chunk-ER3KSBA4.js → chunk-75ZIWV4U.js} +4 -4
  12. package/dist/{chunk-7PSYT35Z.js → chunk-7BYY7QKC.js} +5 -5
  13. package/dist/{chunk-7PSYT35Z.js.map → chunk-7BYY7QKC.js.map} +1 -1
  14. package/dist/chunk-A2GG4D4A.js +43 -0
  15. package/dist/chunk-A2GG4D4A.js.map +1 -0
  16. package/dist/{chunk-6CKNC32J.js → chunk-AJZ3EJB5.js} +2 -2
  17. package/dist/chunk-ATQQCG4I.js +194 -0
  18. package/dist/chunk-ATQQCG4I.js.map +1 -0
  19. package/dist/{chunk-4WEUWCA4.js → chunk-EQRVOMMS.js} +2 -2
  20. package/dist/{chunk-ARBBJWZA.js → chunk-KOTNMTHV.js} +3 -3
  21. package/dist/{chunk-LSUELMHY.js → chunk-LN5RBVGP.js} +6 -33
  22. package/dist/{chunk-LSUELMHY.js.map → chunk-LN5RBVGP.js.map} +1 -1
  23. package/dist/{chunk-CPNJRLPN.js → chunk-WSEXFTN4.js} +46 -7
  24. package/dist/chunk-WSEXFTN4.js.map +1 -0
  25. package/dist/{chunk-NO2YNV5C.js → chunk-YXLN4PXK.js} +2 -2
  26. package/dist/hub-approvals/index.js +1 -1
  27. package/dist/hub-approvals/types.d.ts +16 -1
  28. package/dist/hub-approvals-react/feedback.d.ts +25 -5
  29. package/dist/hub-approvals-react/index.d.ts +1 -0
  30. package/dist/hub-approvals-react/index.js +413 -257
  31. package/dist/hub-approvals-react/index.js.map +1 -1
  32. package/dist/hub-approvals-react/media.d.ts +12 -0
  33. package/dist/integrations-react/index.js +1 -1
  34. package/dist/preset-cloudflare/index.js +2 -2
  35. package/dist/public-consultation/index.d.ts +1 -1
  36. package/dist/sandbox/index.js +4 -4
  37. package/dist/stories/app-shell/interaction-evidence.d.ts +31 -0
  38. package/dist/studio-react/index.js +2 -2
  39. package/dist/theme/tokens.css +158 -0
  40. package/dist/tools/index.js +4 -4
  41. package/dist/web-react/action-dialog.d.ts +2 -2
  42. package/dist/web-react/agent-profile-editor.js +1 -1
  43. package/dist/web-react/agent-profile-form-kit.d.ts +1 -1
  44. package/dist/web-react/async/index.js +1 -1
  45. package/dist/web-react/index.d.ts +2 -0
  46. package/dist/web-react/index.js +12 -5
  47. package/dist/web-react/review-inbox.d.ts +33 -0
  48. package/dist/work-product/index.js +2 -2
  49. package/dist/workspace-react/index.js +1 -1
  50. package/package.json +2 -2
  51. package/dist/chunk-CPNJRLPN.js.map +0 -1
  52. package/dist/chunk-GIJY3YCH.js.map +0 -1
  53. package/dist/chunk-IAFPBYQQ.js.map +0 -1
  54. package/dist/chunk-QJYJOMMO.js +0 -78
  55. package/dist/chunk-QJYJOMMO.js.map +0 -1
  56. /package/dist/{chunk-ER3KSBA4.js.map → chunk-75ZIWV4U.js.map} +0 -0
  57. /package/dist/{chunk-6CKNC32J.js.map → chunk-AJZ3EJB5.js.map} +0 -0
  58. /package/dist/{chunk-4WEUWCA4.js.map → chunk-EQRVOMMS.js.map} +0 -0
  59. /package/dist/{chunk-ARBBJWZA.js.map → chunk-KOTNMTHV.js.map} +0 -0
  60. /package/dist/{chunk-NO2YNV5C.js.map → chunk-YXLN4PXK.js.map} +0 -0
@@ -31,7 +31,10 @@ import {
31
31
  } from "./chunk-TJ4DYKF2.js";
32
32
  import {
33
33
  AsyncView
34
- } from "./chunk-LSUELMHY.js";
34
+ } from "./chunk-LN5RBVGP.js";
35
+ import {
36
+ ReviewFeedbackForm
37
+ } from "./chunk-ATQQCG4I.js";
35
38
  import {
36
39
  attachmentPartsFromMessageParts
37
40
  } from "./chunk-YR6TZ777.js";
@@ -58,8 +61,9 @@ import {
58
61
  } from "./chunk-6VQCFJWP.js";
59
62
 
60
63
  // src/web-react/index.tsx
61
- import { useEffect as useEffect15, useMemo as useMemo8, useRef as useRef14, useState as useState21, memo } from "react";
64
+ import { useEffect as useEffect16, useMemo as useMemo8, useRef as useRef15, useState as useState22, memo } from "react";
62
65
  import { isViewerMessage, MessageAuthor, TRANSCRIPT_TEXT } from "@tangle-network/ui/chat";
66
+ import { TerminalDisplay, TerminalLine } from "@tangle-network/ui/primitives";
63
67
  import { InlineToolItem } from "@tangle-network/ui/run";
64
68
 
65
69
  // src/web-react/smooth-text.ts
@@ -3501,6 +3505,7 @@ import {
3501
3505
  useRef as useRef10,
3502
3506
  useState as useState16
3503
3507
  } from "react";
3508
+ import { Button as Button3, EmptyState, Skeleton, Table, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell } from "@tangle-network/ui/primitives";
3504
3509
 
3505
3510
  // src/web-react/record-grid-model.ts
3506
3511
  function recordGridOk(value) {
@@ -4181,7 +4186,7 @@ function RecordGrid({
4181
4186
  "Loading ",
4182
4187
  caption
4183
4188
  ] }),
4184
- Array.from({ length: Math.max(1, loadingRowCount) }, (_, index) => /* @__PURE__ */ jsx14("div", { className: "h-8 animate-pulse rounded-md bg-secondary", "aria-hidden": true }, index))
4189
+ Array.from({ length: Math.max(1, loadingRowCount) }, (_, index) => /* @__PURE__ */ jsx14(Skeleton, { className: "h-8", "aria-hidden": true }, index))
4185
4190
  ]
4186
4191
  }
4187
4192
  )
@@ -4225,30 +4230,18 @@ function RecordGrid({
4225
4230
  if (visibleRows.length === 0 && !reviewing) {
4226
4231
  return /* @__PURE__ */ jsxs12("div", { className: `space-y-3 ${className ?? ""}`, children: [
4227
4232
  toolbar,
4228
- addForm ?? /* @__PURE__ */ jsxs12("div", { className: "rounded-xl border border-dashed border-border px-6 py-10 text-center", children: [
4229
- /* @__PURE__ */ jsx14("p", { className: "text-sm font-medium text-foreground", children: empty.title }),
4230
- empty.description && /* @__PURE__ */ jsx14("p", { className: "mx-auto mt-1 max-w-md text-sm text-muted-foreground", children: empty.description }),
4231
- /* @__PURE__ */ jsxs12("div", { className: "mt-4 flex flex-wrap items-center justify-center gap-2", children: [
4232
- empty.action && (isValidElement(empty.action) ? empty.action : /* @__PURE__ */ jsx14(
4233
- "button",
4234
- {
4235
- type: "button",
4236
- onClick: empty.action.onClick,
4237
- className: "rounded-md border border-border px-3 py-1.5 text-sm font-medium text-foreground transition hover:bg-accent",
4238
- children: empty.action.label
4239
- }
4240
- )),
4241
- onCreate && /* @__PURE__ */ jsx14(
4242
- "button",
4243
- {
4244
- type: "button",
4245
- onClick: openAdd,
4246
- className: "rounded-md border border-border px-3 py-1.5 text-sm font-medium text-foreground transition hover:bg-accent",
4247
- children: addLabel
4248
- }
4249
- )
4250
- ] })
4251
- ] })
4233
+ addForm ?? /* @__PURE__ */ jsx14(
4234
+ EmptyState,
4235
+ {
4236
+ title: empty.title,
4237
+ description: empty.description,
4238
+ className: "rounded-xl border border-dashed border-border",
4239
+ action: /* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap items-center justify-center gap-2", children: [
4240
+ empty.action && (isValidElement(empty.action) ? empty.action : /* @__PURE__ */ jsx14(Button3, { type: "button", variant: "outline", size: "sm", onClick: empty.action.onClick, children: empty.action.label })),
4241
+ onCreate && /* @__PURE__ */ jsx14(Button3, { type: "button", variant: "outline", size: "sm", onClick: openAdd, children: addLabel })
4242
+ ] })
4243
+ }
4244
+ )
4252
4245
  ] });
4253
4246
  }
4254
4247
  const hasFooter = columns.some((column) => column.footerValue !== void 0);
@@ -4302,27 +4295,28 @@ function RecordGrid({
4302
4295
  toolbar,
4303
4296
  reviewBar,
4304
4297
  /* @__PURE__ */ jsx14("div", { className: "overflow-x-auto rounded-xl border border-card-edge bg-card", children: /* @__PURE__ */ jsxs12(
4305
- "table",
4298
+ Table,
4306
4299
  {
4300
+ wrapper: false,
4307
4301
  role: "grid",
4308
4302
  "aria-label": caption,
4309
- className: "w-full border-collapse text-left text-sm",
4303
+ className: "border-collapse text-left",
4310
4304
  onKeyDown: handleGridKeyDown,
4311
4305
  children: [
4312
- /* @__PURE__ */ jsx14("thead", { children: /* @__PURE__ */ jsxs12("tr", { role: "row", className: "border-b border-border text-xs uppercase tracking-[0.05em] text-muted-foreground", children: [
4306
+ /* @__PURE__ */ jsx14(TableHeader, { children: /* @__PURE__ */ jsxs12(TableRow, { role: "row", className: "text-xs uppercase tracking-[0.05em] text-muted-foreground", children: [
4313
4307
  columns.map((column) => /* @__PURE__ */ jsx14(
4314
- "th",
4308
+ TableHead,
4315
4309
  {
4316
4310
  role: "columnheader",
4317
4311
  scope: "col",
4318
- className: `px-3 py-2 font-medium ${alignmentClass(column)}`,
4312
+ className: `h-auto px-3 py-2 ${alignmentClass(column)}`,
4319
4313
  children: column.header
4320
4314
  },
4321
4315
  column.id
4322
4316
  )),
4323
- showActionsColumn && /* @__PURE__ */ jsx14("th", { role: "columnheader", scope: "col", className: "w-px px-3 py-2 font-medium", children: /* @__PURE__ */ jsx14("span", { className: "sr-only", children: reviewing ? "Review" : "Row actions" }) })
4317
+ showActionsColumn && /* @__PURE__ */ jsx14(TableHead, { role: "columnheader", scope: "col", className: "h-auto w-px px-3 py-2", children: /* @__PURE__ */ jsx14("span", { className: "sr-only", children: reviewing ? "Review" : "Row actions" }) })
4324
4318
  ] }) }),
4325
- /* @__PURE__ */ jsxs12("tbody", { children: [
4319
+ /* @__PURE__ */ jsxs12(TableBody, { children: [
4326
4320
  visibleRows.map((row) => {
4327
4321
  const rowLabel = recordGridRowLabel(columns, row);
4328
4322
  const pending = row.id in pendingRows;
@@ -4331,12 +4325,12 @@ function RecordGrid({
4331
4325
  const removedRow = rowDiff?.kind === "removed";
4332
4326
  return /* @__PURE__ */ jsxs12(Fragment4, { children: [
4333
4327
  /* @__PURE__ */ jsxs12(
4334
- "tr",
4328
+ TableRow,
4335
4329
  {
4336
4330
  role: "row",
4337
4331
  "aria-busy": pending,
4338
4332
  "data-record-grid-diff": rowDiff?.kind,
4339
- className: `border-b border-border ${pending ? "opacity-60" : ""} ${removedRow ? "bg-destructive/[0.06]" : ""}`,
4333
+ className: `${pending ? "opacity-60" : ""} ${removedRow ? "bg-destructive/[0.06]" : ""}`,
4340
4334
  children: [
4341
4335
  columns.map((column) => {
4342
4336
  const key = cellKey(row.id, column.id);
@@ -4350,7 +4344,7 @@ function RecordGrid({
4350
4344
  const errorId = `${fieldPrefix}-cell-error-${row.id}-${column.id}`;
4351
4345
  const cellDiff = rowDiff?.kind === "changed" ? diffCellByKey.get(key) : void 0;
4352
4346
  if (isEditing && editable) {
4353
- return /* @__PURE__ */ jsxs12("td", { role: "gridcell", className: `px-3 py-1.5 ${alignmentClass(column)}`, children: [
4347
+ return /* @__PURE__ */ jsxs12(TableCell, { role: "gridcell", className: `px-3 py-1.5 ${alignmentClass(column)}`, children: [
4354
4348
  /* @__PURE__ */ jsx14(
4355
4349
  CellEditor,
4356
4350
  {
@@ -4368,7 +4362,7 @@ function RecordGrid({
4368
4362
  ] }, column.id);
4369
4363
  }
4370
4364
  if (column.kind === "boolean" && editable) {
4371
- return /* @__PURE__ */ jsx14("td", { role: "gridcell", className: `px-3 py-2 ${alignmentClass(column)}`, children: /* @__PURE__ */ jsx14(
4365
+ return /* @__PURE__ */ jsx14(TableCell, { role: "gridcell", className: `px-3 py-2 ${alignmentClass(column)}`, children: /* @__PURE__ */ jsx14(
4372
4366
  "input",
4373
4367
  {
4374
4368
  type: "checkbox",
@@ -4388,7 +4382,7 @@ function RecordGrid({
4388
4382
  }
4389
4383
  const display = applicable ? formatRecordGridValue(column, value, locale) : "";
4390
4384
  return /* @__PURE__ */ jsx14(
4391
- "td",
4385
+ TableCell,
4392
4386
  {
4393
4387
  role: "gridcell",
4394
4388
  "aria-readonly": editable ? void 0 : true,
@@ -4434,7 +4428,7 @@ function RecordGrid({
4434
4428
  column.id
4435
4429
  );
4436
4430
  }),
4437
- showActionsColumn && /* @__PURE__ */ jsx14("td", { role: "gridcell", className: "px-3 py-2 text-right", children: reviewing ? rowDiff && /* @__PURE__ */ jsx14(
4431
+ showActionsColumn && /* @__PURE__ */ jsx14(TableCell, { role: "gridcell", className: "px-3 py-2 text-right", children: reviewing ? rowDiff && /* @__PURE__ */ jsx14(
4438
4432
  ReviewActions,
4439
4433
  {
4440
4434
  rowId: row.id,
@@ -4493,23 +4487,23 @@ function RecordGrid({
4493
4487
  ]
4494
4488
  }
4495
4489
  ),
4496
- rowError !== void 0 && /* @__PURE__ */ jsx14("tr", { role: "row", className: "border-b border-border", children: /* @__PURE__ */ jsx14("td", { role: "gridcell", colSpan: columnSpan, className: "px-3 pb-2", children: /* @__PURE__ */ jsx14("p", { role: "alert", className: "rounded-md bg-destructive/10 px-2.5 py-1.5 text-xs text-destructive", children: rowError }) }) })
4490
+ rowError !== void 0 && /* @__PURE__ */ jsx14(TableRow, { role: "row", children: /* @__PURE__ */ jsx14(TableCell, { role: "gridcell", colSpan: columnSpan, className: "px-3 pb-2", children: /* @__PURE__ */ jsx14("p", { role: "alert", className: "rounded-md bg-destructive/10 px-2.5 py-1.5 text-xs text-destructive", children: rowError }) }) })
4497
4491
  ] }, row.id);
4498
4492
  }),
4499
4493
  reviewing && addedRows.map((row) => {
4500
4494
  const rowLabel = recordGridRowLabel(columns, row);
4501
4495
  return /* @__PURE__ */ jsxs12(
4502
- "tr",
4496
+ TableRow,
4503
4497
  {
4504
4498
  role: "row",
4505
4499
  "data-record-grid-diff": "added",
4506
- className: "border-b border-border bg-success/[0.06]",
4500
+ className: "bg-success/[0.06]",
4507
4501
  children: [
4508
4502
  columns.map((column, columnIndex) => {
4509
4503
  const applicable = isRecordGridCellApplicable(column, row.values);
4510
4504
  const value = row.values[column.id] ?? null;
4511
4505
  const display = applicable ? formatRecordGridValue(column, value, locale) : "";
4512
- return /* @__PURE__ */ jsx14("td", { role: "gridcell", className: `px-3 py-2 ${alignmentClass(column)}`, children: /* @__PURE__ */ jsxs12("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
4506
+ return /* @__PURE__ */ jsx14(TableCell, { role: "gridcell", className: `px-3 py-2 ${alignmentClass(column)}`, children: /* @__PURE__ */ jsxs12("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
4513
4507
  columnIndex === 0 && /* @__PURE__ */ jsx14("span", { className: "inline-flex shrink-0 rounded border border-success/60 px-1 py-px text-[11px] font-semibold uppercase tracking-[0.05em] text-success", children: "New" }),
4514
4508
  /* @__PURE__ */ jsx14(
4515
4509
  "span",
@@ -4520,7 +4514,7 @@ function RecordGrid({
4520
4514
  )
4521
4515
  ] }) }, column.id);
4522
4516
  }),
4523
- /* @__PURE__ */ jsx14("td", { role: "gridcell", className: "px-3 py-2 text-right", children: /* @__PURE__ */ jsx14(
4517
+ /* @__PURE__ */ jsx14(TableCell, { role: "gridcell", className: "px-3 py-2 text-right", children: /* @__PURE__ */ jsx14(
4524
4518
  ReviewActions,
4525
4519
  {
4526
4520
  rowId: row.id,
@@ -4536,9 +4530,9 @@ function RecordGrid({
4536
4530
  );
4537
4531
  })
4538
4532
  ] }),
4539
- hasFooter && /* @__PURE__ */ jsx14("tfoot", { children: /* @__PURE__ */ jsxs12("tr", { role: "row", className: "border-t-2 border-border", children: [
4533
+ hasFooter && /* @__PURE__ */ jsx14(TableFooter, { children: /* @__PURE__ */ jsxs12(TableRow, { role: "row", className: "border-t-2 border-border", children: [
4540
4534
  columns.map((column) => /* @__PURE__ */ jsx14(
4541
- "td",
4535
+ TableCell,
4542
4536
  {
4543
4537
  role: "gridcell",
4544
4538
  className: `px-3 py-2 text-sm font-semibold text-foreground ${alignmentClass(column)}`,
@@ -4546,7 +4540,7 @@ function RecordGrid({
4546
4540
  },
4547
4541
  column.id
4548
4542
  )),
4549
- showActionsColumn && /* @__PURE__ */ jsx14("td", { role: "gridcell" })
4543
+ showActionsColumn && /* @__PURE__ */ jsx14(TableCell, { role: "gridcell" })
4550
4544
  ] }) })
4551
4545
  ]
4552
4546
  }
@@ -5680,14 +5674,213 @@ function PagerButton({
5680
5674
  );
5681
5675
  }
5682
5676
 
5683
- // src/web-react/api-access-panel.tsx
5677
+ // src/web-react/review-inbox.tsx
5684
5678
  import { useEffect as useEffect14, useRef as useRef13, useState as useState19 } from "react";
5685
- import { PageHeader } from "@tangle-network/ui/primitives";
5686
- import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
5679
+ import { Button as Button4, PageHeader } from "@tangle-network/ui/primitives";
5680
+ import { Fragment as Fragment6, jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
5681
+ var revisionKey = (item) => JSON.stringify([item.id, item.revision]);
5682
+ function ordered(items) {
5683
+ return [...items].sort((left, right) => left.createdAt - right.createdAt || (left.id < right.id ? -1 : left.id > right.id ? 1 : 0));
5684
+ }
5685
+ function ReviewInbox({ items, initialSelectedId, renderItem, onVerdict, onFeedback, loading = false, error, onRefresh }) {
5686
+ const [round2, setRound] = useState19(() => ordered(items).map((item) => item.id));
5687
+ const [answered, setAnswered] = useState19(/* @__PURE__ */ new Set());
5688
+ const [resolvedElsewhere, setResolvedElsewhere] = useState19(/* @__PURE__ */ new Set());
5689
+ const [activeId, setActiveId] = useState19(() => items.some((item) => item.id === initialSelectedId) ? initialSelectedId : ordered(items)[0]?.id ?? null);
5690
+ const [busy, setBusy] = useState19(false);
5691
+ const [refreshing, setRefreshing] = useState19(false);
5692
+ const [restart, setRestart] = useState19(false);
5693
+ const [refreshError, setRefreshError] = useState19("");
5694
+ const cache = useRef13(/* @__PURE__ */ new Map());
5695
+ const drafts = useRef13(/* @__PURE__ */ new Map());
5696
+ const pending = useRef13(false);
5697
+ const section = useRef13(null);
5698
+ const form = useRef13(null);
5699
+ for (const item of items) cache.current.set(item.id, item);
5700
+ const currentItems = new Map(items.map((item) => [item.id, item]));
5701
+ const missing = loading || error || busy || refreshing ? resolvedElsewhere : new Set(round2.filter((id) => !currentItems.has(id)));
5702
+ const unanswered = round2.filter((id) => {
5703
+ const item = cache.current.get(id);
5704
+ return item && !answered.has(revisionKey(item)) && !missing.has(id);
5705
+ });
5706
+ const currentId = activeId && unanswered.includes(activeId) ? activeId : unanswered.find((id) => round2.indexOf(id) > round2.indexOf(activeId ?? "")) ?? unanswered[0];
5707
+ const active = currentId ? cache.current.get(currentId) : void 0;
5708
+ const currentKey = active ? revisionKey(active) : "";
5709
+ const available = !!active && currentItems.has(active.id);
5710
+ const canReview = !!active && available && active.canReview;
5711
+ const rank = currentId ? round2.indexOf(currentId) + 1 : round2.length;
5712
+ const reviewed = round2.length - unanswered.length;
5713
+ useEffect14(() => {
5714
+ if (loading || !restart && (round2.length > 0 || items.length === 0)) return;
5715
+ const next = ordered(items).map((item) => item.id);
5716
+ setRound(next);
5717
+ setActiveId(initialSelectedId && next.includes(initialSelectedId) ? initialSelectedId : next[0] ?? null);
5718
+ setAnswered(/* @__PURE__ */ new Set());
5719
+ setResolvedElsewhere(/* @__PURE__ */ new Set());
5720
+ setRestart(false);
5721
+ }, [items, loading, restart, round2.length, initialSelectedId]);
5722
+ useEffect14(() => {
5723
+ if (loading || error || busy || refreshing) return;
5724
+ const present = new Set(items.map((item) => item.id));
5725
+ setResolvedElsewhere((previous) => {
5726
+ const next = new Set(round2.filter((id) => !present.has(id)));
5727
+ return next.size === previous.size && [...next].every((id) => previous.has(id)) ? previous : next;
5728
+ });
5729
+ }, [items, loading, error, busy, refreshing, round2]);
5730
+ useEffect14(() => {
5731
+ setActiveId(currentId ?? null);
5732
+ section.current?.focus({ preventScroll: true });
5733
+ }, [currentKey]);
5734
+ function navigate(direction) {
5735
+ if (pending.current || unanswered.length < 2) return;
5736
+ const index = Math.max(0, unanswered.indexOf(currentId));
5737
+ setActiveId(unanswered[(index + direction + unanswered.length) % unanswered.length]);
5738
+ }
5739
+ async function verdict(item, value) {
5740
+ if (pending.current || !item.canReview || !currentItems.has(item.id)) return;
5741
+ pending.current = true;
5742
+ setBusy(true);
5743
+ try {
5744
+ await onVerdict(item, value);
5745
+ const nextAnswered = new Set(answered).add(revisionKey(item));
5746
+ setAnswered(nextAnswered);
5747
+ const remaining = round2.filter((id) => {
5748
+ const candidate = cache.current.get(id);
5749
+ return candidate && !nextAnswered.has(revisionKey(candidate));
5750
+ });
5751
+ const position = round2.indexOf(item.id);
5752
+ setActiveId(remaining.find((id) => round2.indexOf(id) > position) ?? remaining[0] ?? null);
5753
+ } finally {
5754
+ pending.current = false;
5755
+ setBusy(false);
5756
+ }
5757
+ }
5758
+ async function feedback(item, value) {
5759
+ if (!onFeedback || pending.current || !item.canReview || !currentItems.has(item.id)) return;
5760
+ pending.current = true;
5761
+ setBusy(true);
5762
+ try {
5763
+ await onFeedback(item, value);
5764
+ } finally {
5765
+ pending.current = false;
5766
+ setBusy(false);
5767
+ }
5768
+ }
5769
+ async function refresh() {
5770
+ if (!onRefresh || pending.current) return;
5771
+ pending.current = true;
5772
+ setRefreshing(true);
5773
+ setRefreshError("");
5774
+ try {
5775
+ await onRefresh();
5776
+ setRestart(true);
5777
+ } catch (cause) {
5778
+ setRefreshError(cause instanceof Error ? cause.message : "The inbox could not refresh. Your drafts are kept.");
5779
+ } finally {
5780
+ pending.current = false;
5781
+ setRefreshing(false);
5782
+ }
5783
+ }
5784
+ useEffect14(() => {
5785
+ function shortcut(event) {
5786
+ if (event.defaultPrevented || event.repeat || event.altKey || event.ctrlKey || event.metaKey || event.isComposing) return;
5787
+ const target = event.target instanceof Element ? event.target : null;
5788
+ const typing = target?.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"]), [role="textbox"]');
5789
+ if (event.key === "Escape" && typing instanceof HTMLElement) {
5790
+ typing.blur();
5791
+ event.preventDefault();
5792
+ return;
5793
+ }
5794
+ if (typing || target && target !== document.body && !section.current?.contains(target) || pending.current || refreshing) return;
5795
+ const key = event.key.toLowerCase();
5796
+ if (key === "j") {
5797
+ event.preventDefault();
5798
+ navigate(1);
5799
+ } else if (key === "k") {
5800
+ event.preventDefault();
5801
+ navigate(-1);
5802
+ } else if (active && canReview && key === "s") {
5803
+ event.preventDefault();
5804
+ form.current?.focusScore();
5805
+ } else if (active && canReview && (key === "a" || key === "r")) {
5806
+ event.preventDefault();
5807
+ void form.current?.submitVerdict(key === "a" ? "approve" : "request_changes");
5808
+ }
5809
+ }
5810
+ window.addEventListener("keydown", shortcut);
5811
+ return () => window.removeEventListener("keydown", shortcut);
5812
+ });
5813
+ return /* @__PURE__ */ jsxs16(
5814
+ "section",
5815
+ {
5816
+ ref: section,
5817
+ tabIndex: -1,
5818
+ "aria-label": "Review inbox",
5819
+ "aria-busy": busy || refreshing || loading,
5820
+ className: "mx-auto min-w-0 max-w-4xl space-y-5 outline-none",
5821
+ "data-review-inbox": true,
5822
+ children: [
5823
+ /* @__PURE__ */ jsx18(
5824
+ PageHeader,
5825
+ {
5826
+ title: "Review inbox",
5827
+ description: "Review the oldest work first. Every decision includes your score and feedback.",
5828
+ actions: onRefresh && /* @__PURE__ */ jsx18(Button4, { variant: "outline", disabled: busy || refreshing || loading, onClick: () => void refresh(), children: refreshing ? "Refreshing\u2026" : "Refresh" }),
5829
+ meta: /* @__PURE__ */ jsx18("p", { role: "status", "data-review-progress": true, children: active ? `${rank} of ${round2.length}` : `${reviewed} of ${round2.length} resolved` })
5830
+ }
5831
+ ),
5832
+ (error || refreshError) && /* @__PURE__ */ jsx18("p", { role: "alert", className: "text-sm text-[var(--surface-danger-text)]", children: error || refreshError }),
5833
+ round2.length > 0 && /* @__PURE__ */ jsx18("progress", { "aria-label": "Items resolved this round", value: reviewed, max: round2.length, className: "h-1.5 w-full accent-primary" }),
5834
+ (loading || error) && !active ? /* @__PURE__ */ jsx18("p", { role: "status", children: loading ? "Loading the review inbox\u2026" : "The review inbox could not load." }) : !active ? /* @__PURE__ */ jsxs16("div", { className: "py-12 text-center", children: [
5835
+ /* @__PURE__ */ jsx18("h2", { className: "text-xl font-semibold", children: "All caught up" }),
5836
+ /* @__PURE__ */ jsxs16("p", { className: "mt-2 text-sm text-muted-foreground", children: [
5837
+ reviewed,
5838
+ " of ",
5839
+ round2.length,
5840
+ " resolved this round."
5841
+ ] })
5842
+ ] }) : /* @__PURE__ */ jsxs16(Fragment6, { children: [
5843
+ /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
5844
+ /* @__PURE__ */ jsxs16("div", { className: "min-w-0", children: [
5845
+ /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground", children: active.kind }),
5846
+ /* @__PURE__ */ jsx18("h2", { className: "break-words text-lg font-semibold", "data-review-title": true, children: active.title })
5847
+ ] }),
5848
+ /* @__PURE__ */ jsxs16("div", { className: "flex gap-2", children: [
5849
+ /* @__PURE__ */ jsx18(Button4, { variant: "outline", "aria-keyshortcuts": "K", disabled: busy || unanswered.length < 2, onClick: () => navigate(-1), children: "Previous" }),
5850
+ /* @__PURE__ */ jsx18(Button4, { variant: "outline", "aria-keyshortcuts": "J", disabled: busy || unanswered.length < 2, onClick: () => navigate(1), children: "Next" })
5851
+ ] })
5852
+ ] }),
5853
+ available && !active.canReview && /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground", children: "You do not have permission to review this item." }),
5854
+ /* @__PURE__ */ jsx18("div", { className: "min-w-0", "data-review-content": true, children: renderItem(active) }),
5855
+ /* @__PURE__ */ jsx18(
5856
+ ReviewFeedbackForm,
5857
+ {
5858
+ ref: form,
5859
+ draftKey: currentKey,
5860
+ drafts: drafts.current,
5861
+ input: active.input,
5862
+ preview: active.preview,
5863
+ feedback: active.feedback,
5864
+ disabled: !canReview || busy || loading,
5865
+ approveLabel: active.approveLabel,
5866
+ allowedVerdicts: active.allowedVerdicts,
5867
+ onVerdict: (decision, value) => verdict(active, { verdict: decision, ...value }),
5868
+ onFeedback: onFeedback ? (value) => feedback(active, value) : void 0
5869
+ },
5870
+ currentKey
5871
+ ),
5872
+ /* @__PURE__ */ jsx18("p", { className: "text-xs leading-5 text-muted-foreground", children: "A approve \xB7 R request changes \xB7 S score \xB7 J/K next/previous \xB7 Esc leave a field. Shortcuts pause while typing." })
5873
+ ] })
5874
+ ]
5875
+ }
5876
+ );
5877
+ }
5878
+
5879
+ // src/web-react/api-access-panel.tsx
5880
+ import { useEffect as useEffect15, useRef as useRef14, useState as useState20 } from "react";
5881
+ import { Button as Button5, Input, PageHeader as PageHeader2 } from "@tangle-network/ui/primitives";
5882
+ import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
5687
5883
  var defaultExpiryChoices = [1, 7, 30];
5688
- var inputClass = "h-11 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground";
5689
- var buttonClass = "inline-flex items-center justify-center rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50";
5690
- var outlineClass = "inline-flex items-center justify-center rounded-lg border border-input bg-background px-3 py-2 text-sm font-medium text-foreground disabled:opacity-50";
5691
5884
  function pruneScopes(scopes, access) {
5692
5885
  const offered = new Map(access.map((option) => [option.scope, option]));
5693
5886
  const selected = new Set(scopes.filter((scope) => offered.has(scope)));
@@ -5737,31 +5930,31 @@ function ApiAccessPanel({
5737
5930
  onRevoke,
5738
5931
  onChanged
5739
5932
  }) {
5740
- const [name, setName] = useState19("");
5741
- const [reach, setReach] = useState19("");
5933
+ const [name, setName] = useState20("");
5934
+ const [reach, setReach] = useState20("");
5742
5935
  const selectedWorkspace = workspaces?.some((workspace) => workspace.id === reach) ? reach : "";
5743
5936
  const workspaceName = (id) => workspaces?.find((workspace) => workspace.id === id)?.name ?? `A removed ${workspaceNoun.singular}`;
5744
5937
  const allowedDays = [...new Set(expiryDays)].filter((days2) => days2 > 0 && Number.isFinite(new Date(Date.now() + days2 * 864e5).getTime()));
5745
5938
  const fallbackDays = allowedDays.includes(defaultExpiryDays) ? defaultExpiryDays : allowedDays[0];
5746
- const [days, setDays] = useState19(fallbackDays);
5939
+ const [days, setDays] = useState20(fallbackDays);
5747
5940
  const selectedDays = days !== void 0 && allowedDays.includes(days) ? days : fallbackDays;
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);
5941
+ const [scopes, setScopes] = useState20(() => expandScopes(defaultScopes, access));
5942
+ const [creating, setCreating] = useState20(false);
5943
+ const [revoking, setRevoking] = useState20(null);
5944
+ const [created, setCreated] = useState20(null);
5945
+ const [notice, setNotice] = useState20(null);
5946
+ const [error, setError] = useState20(null);
5947
+ const keyHeading = useRef14(null);
5948
+ const nameInput = useRef14(null);
5949
+ const keyWasShown = useRef14(false);
5757
5950
  const selectedScopes = pruneScopes(scopes, access);
5758
- useEffect14(() => {
5951
+ useEffect15(() => {
5759
5952
  setScopes((current) => {
5760
5953
  const next = pruneScopes(current, access);
5761
5954
  return next.length === current.length ? current : next;
5762
5955
  });
5763
5956
  }, [access]);
5764
- useEffect14(() => {
5957
+ useEffect15(() => {
5765
5958
  if (created) {
5766
5959
  keyHeading.current?.focus();
5767
5960
  keyWasShown.current = true;
@@ -5807,11 +6000,11 @@ function ApiAccessPanel({
5807
6000
  setRevoking(null);
5808
6001
  }
5809
6002
  }
5810
- return /* @__PURE__ */ jsx18("main", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxs16("div", { className: "mx-auto max-w-2xl space-y-8 px-4 py-8 sm:px-8", children: [
5811
- /* @__PURE__ */ jsxs16("div", { className: "space-y-2", children: [
5812
- accountHref && /* @__PURE__ */ jsx18("a", { href: accountHref, className: "text-sm text-muted-foreground hover:text-foreground", children: "Account" }),
5813
- /* @__PURE__ */ jsx18(
5814
- PageHeader,
6003
+ return /* @__PURE__ */ jsx19("main", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxs17("div", { className: "mx-auto max-w-2xl space-y-8 px-4 py-8 sm:px-8", children: [
6004
+ /* @__PURE__ */ jsxs17("div", { className: "space-y-2", children: [
6005
+ accountHref && /* @__PURE__ */ jsx19("a", { href: accountHref, className: "text-sm text-muted-foreground hover:text-foreground", children: "Account" }),
6006
+ /* @__PURE__ */ jsx19(
6007
+ PageHeader2,
5815
6008
  {
5816
6009
  className: "mb-0",
5817
6010
  title: "API access",
@@ -5819,14 +6012,14 @@ function ApiAccessPanel({
5819
6012
  }
5820
6013
  )
5821
6014
  ] }),
5822
- error && /* @__PURE__ */ jsx18("p", { role: "alert", className: "rounded-lg border border-destructive/40 p-3 text-sm text-destructive", children: error }),
5823
- notice && /* @__PURE__ */ jsx18("p", { role: "status", className: "text-sm text-muted-foreground", children: notice }),
5824
- created ? /* @__PURE__ */ jsxs16("section", { "aria-labelledby": "save-api-key", className: "space-y-4 rounded-xl border border-border bg-card p-5", children: [
5825
- /* @__PURE__ */ jsx18("h2", { ref: keyHeading, tabIndex: -1, id: "save-api-key", className: "font-medium outline-none", children: "Save your key" }),
5826
- /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground", children: "Copy it directly into your client\u2019s secret storage. It is shown only now. Keep it out of chat messages and prompts." }),
5827
- /* @__PURE__ */ jsxs16("div", { className: "flex gap-2", children: [
5828
- /* @__PURE__ */ jsx18("input", { "aria-label": "New API key", type: "password", value: created.key, readOnly: true, autoComplete: "off", className: `${inputClass} min-w-0 font-mono` }),
5829
- /* @__PURE__ */ jsx18("button", { className: buttonClass, onClick: async () => {
6015
+ error && /* @__PURE__ */ jsx19("p", { role: "alert", className: "rounded-lg border border-destructive/40 p-3 text-sm text-destructive", children: error }),
6016
+ notice && /* @__PURE__ */ jsx19("p", { role: "status", className: "text-sm text-muted-foreground", children: notice }),
6017
+ created ? /* @__PURE__ */ jsxs17("section", { "aria-labelledby": "save-api-key", className: "space-y-4 rounded-xl border border-border bg-card p-5", children: [
6018
+ /* @__PURE__ */ jsx19("h2", { ref: keyHeading, tabIndex: -1, id: "save-api-key", className: "font-medium outline-none", children: "Save your key" }),
6019
+ /* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground", children: "Copy it directly into your client\u2019s secret storage. It is shown only now. Keep it out of chat messages and prompts." }),
6020
+ /* @__PURE__ */ jsxs17("div", { className: "flex gap-2", children: [
6021
+ /* @__PURE__ */ jsx19(Input, { size: "lg", "aria-label": "New API key", type: "password", value: created.key, readOnly: true, autoComplete: "off", className: "min-w-0 font-mono" }),
6022
+ /* @__PURE__ */ jsx19(Button5, { onClick: async () => {
5830
6023
  try {
5831
6024
  await navigator.clipboard.writeText(created.key);
5832
6025
  setNotice("Key copied");
@@ -5835,46 +6028,46 @@ function ApiAccessPanel({
5835
6028
  }
5836
6029
  }, children: "Copy key" })
5837
6030
  ] }),
5838
- /* @__PURE__ */ jsx18("button", { className: outlineClass, onClick: () => {
6031
+ /* @__PURE__ */ jsx19(Button5, { variant: "outline", onClick: () => {
5839
6032
  setCreated(null);
5840
6033
  setNotice(null);
5841
6034
  }, children: "I\u2019ve saved it" })
5842
- ] }) : /* @__PURE__ */ jsxs16("form", { onSubmit: createKey, className: "space-y-5 rounded-xl border border-border bg-card p-5", children: [
5843
- /* @__PURE__ */ jsx18("h2", { className: "font-medium", children: "Create a key" }),
5844
- /* @__PURE__ */ jsxs16("div", { className: "grid gap-4 sm:grid-cols-[1fr_10rem]", children: [
5845
- /* @__PURE__ */ jsxs16("div", { className: "space-y-1.5", children: [
5846
- /* @__PURE__ */ jsx18("label", { className: "text-sm font-medium", htmlFor: "key-name", children: "Name" }),
5847
- /* @__PURE__ */ jsx18("input", { ref: nameInput, id: "key-name", className: inputClass, value: name, onChange: (event) => setName(event.target.value), placeholder: "Client on my server", maxLength: 100, required: true, autoComplete: "off" })
6035
+ ] }) : /* @__PURE__ */ jsxs17("form", { onSubmit: createKey, className: "space-y-5 rounded-xl border border-border bg-card p-5", children: [
6036
+ /* @__PURE__ */ jsx19("h2", { className: "font-medium", children: "Create a key" }),
6037
+ /* @__PURE__ */ jsxs17("div", { className: "grid gap-4 sm:grid-cols-[1fr_10rem]", children: [
6038
+ /* @__PURE__ */ jsxs17("div", { className: "space-y-1.5", children: [
6039
+ /* @__PURE__ */ jsx19("label", { className: "text-sm font-medium", htmlFor: "key-name", children: "Name" }),
6040
+ /* @__PURE__ */ jsx19(Input, { size: "lg", ref: nameInput, id: "key-name", value: name, onChange: (event) => setName(event.target.value), placeholder: "Client on my server", maxLength: 100, required: true, autoComplete: "off" })
5848
6041
  ] }),
5849
- /* @__PURE__ */ jsxs16("div", { className: "space-y-1.5", children: [
5850
- /* @__PURE__ */ jsx18("label", { className: "text-sm font-medium", htmlFor: "key-expiry", children: "Expires in" }),
5851
- /* @__PURE__ */ jsx18("select", { id: "key-expiry", value: selectedDays ?? "", onChange: (event) => setDays(Number(event.target.value)), className: "h-11 w-full rounded-lg border border-input bg-background px-3 text-sm", children: allowedDays.map((days2) => /* @__PURE__ */ jsxs16("option", { value: days2, children: [
6042
+ /* @__PURE__ */ jsxs17("div", { className: "space-y-1.5", children: [
6043
+ /* @__PURE__ */ jsx19("label", { className: "text-sm font-medium", htmlFor: "key-expiry", children: "Expires in" }),
6044
+ /* @__PURE__ */ jsx19("select", { id: "key-expiry", value: selectedDays ?? "", onChange: (event) => setDays(Number(event.target.value)), className: "h-11 w-full rounded-lg border border-input bg-background px-3 text-sm", children: allowedDays.map((days2) => /* @__PURE__ */ jsxs17("option", { value: days2, children: [
5852
6045
  days2,
5853
6046
  " ",
5854
6047
  days2 === 1 ? "day" : "days"
5855
6048
  ] }, days2)) })
5856
6049
  ] })
5857
6050
  ] }),
5858
- workspaces && workspaces.length > 0 && /* @__PURE__ */ jsxs16("div", { className: "space-y-1.5", children: [
5859
- /* @__PURE__ */ jsx18("label", { className: "text-sm font-medium", htmlFor: "key-reach", children: "Reaches" }),
5860
- /* @__PURE__ */ jsxs16("select", { id: "key-reach", value: selectedWorkspace, onChange: (event) => setReach(event.target.value), className: "h-11 w-full rounded-lg border border-input bg-background px-3 text-sm", children: [
5861
- /* @__PURE__ */ jsxs16("option", { value: "", children: [
6051
+ workspaces && workspaces.length > 0 && /* @__PURE__ */ jsxs17("div", { className: "space-y-1.5", children: [
6052
+ /* @__PURE__ */ jsx19("label", { className: "text-sm font-medium", htmlFor: "key-reach", children: "Reaches" }),
6053
+ /* @__PURE__ */ jsxs17("select", { id: "key-reach", value: selectedWorkspace, onChange: (event) => setReach(event.target.value), className: "h-11 w-full rounded-lg border border-input bg-background px-3 text-sm", children: [
6054
+ /* @__PURE__ */ jsxs17("option", { value: "", children: [
5862
6055
  "All ",
5863
6056
  workspaceNoun.plural,
5864
6057
  ", including new ones"
5865
6058
  ] }),
5866
- workspaces.map((workspace) => /* @__PURE__ */ jsxs16("option", { value: workspace.id, children: [
6059
+ workspaces.map((workspace) => /* @__PURE__ */ jsxs17("option", { value: workspace.id, children: [
5867
6060
  "Only ",
5868
6061
  workspace.name
5869
6062
  ] }, workspace.id))
5870
6063
  ] })
5871
6064
  ] }),
5872
- /* @__PURE__ */ jsxs16("fieldset", { className: "space-y-3", children: [
5873
- /* @__PURE__ */ jsx18("legend", { className: "mb-3 text-sm font-medium", children: "Permissions" }),
6065
+ /* @__PURE__ */ jsxs17("fieldset", { className: "space-y-3", children: [
6066
+ /* @__PURE__ */ jsx19("legend", { className: "mb-3 text-sm font-medium", children: "Permissions" }),
5874
6067
  access.map((option) => {
5875
6068
  const unavailable = !expandScopes([option.scope], access).includes(option.scope);
5876
- return /* @__PURE__ */ jsxs16("label", { className: "flex cursor-pointer items-start gap-3", children: [
5877
- /* @__PURE__ */ jsx18(
6069
+ return /* @__PURE__ */ jsxs17("label", { className: "flex cursor-pointer items-start gap-3", children: [
6070
+ /* @__PURE__ */ jsx19(
5878
6071
  "input",
5879
6072
  {
5880
6073
  type: "checkbox",
@@ -5884,42 +6077,42 @@ function ApiAccessPanel({
5884
6077
  onChange: (event) => setScopes((current) => event.target.checked ? expandScopes([...current, option.scope], access) : pruneScopes(current.filter((scope) => scope !== option.scope), access))
5885
6078
  }
5886
6079
  ),
5887
- /* @__PURE__ */ jsxs16("span", { className: "text-sm", children: [
5888
- /* @__PURE__ */ jsx18("span", { className: "block font-medium", children: option.label }),
5889
- /* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: option.description }),
5890
- unavailable && /* @__PURE__ */ jsx18("span", { className: "block text-muted-foreground", children: "Required permission unavailable." })
6080
+ /* @__PURE__ */ jsxs17("span", { className: "text-sm", children: [
6081
+ /* @__PURE__ */ jsx19("span", { className: "block font-medium", children: option.label }),
6082
+ /* @__PURE__ */ jsx19("span", { className: "text-muted-foreground", children: option.description }),
6083
+ unavailable && /* @__PURE__ */ jsx19("span", { className: "block text-muted-foreground", children: "Required permission unavailable." })
5891
6084
  ] })
5892
6085
  ] }, option.scope);
5893
6086
  })
5894
6087
  ] }),
5895
- limitsDescription && /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground", children: limitsDescription }),
5896
- /* @__PURE__ */ jsx18("button", { className: buttonClass, type: "submit", disabled: creating || !name.trim() || !selectedScopes.length || selectedDays === void 0, children: creating ? "Creating\u2026" : "Create key" })
6088
+ limitsDescription && /* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground", children: limitsDescription }),
6089
+ /* @__PURE__ */ jsx19(Button5, { type: "submit", disabled: creating || !name.trim() || !selectedScopes.length || selectedDays === void 0, children: creating ? "Creating\u2026" : "Create key" })
5897
6090
  ] }),
5898
- /* @__PURE__ */ jsxs16("section", { "aria-labelledby": "existing-keys", className: "space-y-3", children: [
5899
- /* @__PURE__ */ jsx18("h2", { id: "existing-keys", className: "font-medium", children: "Your keys" }),
5900
- keys.length === 0 ? /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground", children: "No keys yet." }) : /* @__PURE__ */ jsx18("ul", { className: "divide-y divide-border rounded-xl border border-border bg-card", children: keys.map((key) => /* @__PURE__ */ jsxs16("li", { className: "flex items-start justify-between gap-3 p-4", children: [
5901
- /* @__PURE__ */ jsxs16("div", { className: "min-w-0 space-y-1", children: [
5902
- /* @__PURE__ */ jsx18("p", { className: "break-words text-sm font-medium", children: key.name }),
5903
- /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground", children: key.expiresAt ? `${new Date(key.expiresAt).getTime() <= Date.now() ? "Expired" : "Expires"} ${new Date(key.expiresAt).toLocaleDateString()}` : "No expiry" }),
5904
- /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground", children: key.scopes.map((scope) => access.find((access2) => access2.scope === scope)?.label ?? scope).join(" \xB7 ") }),
5905
- workspaces && /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground", children: key.workspaceIds?.length ? `Only ${key.workspaceIds.map(workspaceName).join(", ")}` : `All ${workspaceNoun.plural}` })
6091
+ /* @__PURE__ */ jsxs17("section", { "aria-labelledby": "existing-keys", className: "space-y-3", children: [
6092
+ /* @__PURE__ */ jsx19("h2", { id: "existing-keys", className: "font-medium", children: "Your keys" }),
6093
+ keys.length === 0 ? /* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground", children: "No keys yet." }) : /* @__PURE__ */ jsx19("ul", { className: "divide-y divide-border rounded-xl border border-border bg-card", children: keys.map((key) => /* @__PURE__ */ jsxs17("li", { className: "flex items-start justify-between gap-3 p-4", children: [
6094
+ /* @__PURE__ */ jsxs17("div", { className: "min-w-0 space-y-1", children: [
6095
+ /* @__PURE__ */ jsx19("p", { className: "break-words text-sm font-medium", children: key.name }),
6096
+ /* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground", children: key.expiresAt ? `${new Date(key.expiresAt).getTime() <= Date.now() ? "Expired" : "Expires"} ${new Date(key.expiresAt).toLocaleDateString()}` : "No expiry" }),
6097
+ /* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground", children: key.scopes.map((scope) => access.find((access2) => access2.scope === scope)?.label ?? scope).join(" \xB7 ") }),
6098
+ workspaces && /* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground", children: key.workspaceIds?.length ? `Only ${key.workspaceIds.map(workspaceName).join(", ")}` : `All ${workspaceNoun.plural}` })
5906
6099
  ] }),
5907
- /* @__PURE__ */ jsx18("button", { className: outlineClass, disabled: revoking !== null, onClick: () => revokeKey(key.id), "aria-label": `Revoke ${key.name}`, children: revoking === key.id ? "Revoking\u2026" : "Revoke" })
6100
+ /* @__PURE__ */ jsx19(Button5, { variant: "outline", disabled: revoking !== null, onClick: () => revokeKey(key.id), "aria-label": `Revoke ${key.name}`, children: revoking === key.id ? "Revoking\u2026" : "Revoke" })
5908
6101
  ] }, key.id)) })
5909
6102
  ] }),
5910
- /* @__PURE__ */ jsxs16("p", { className: "text-sm text-muted-foreground", children: [
6103
+ /* @__PURE__ */ jsxs17("p", { className: "text-sm text-muted-foreground", children: [
5911
6104
  "Use ",
5912
- /* @__PURE__ */ jsx18("code", { className: "text-sm", children: baseUrl }),
6105
+ /* @__PURE__ */ jsx19("code", { className: "text-sm", children: baseUrl }),
5913
6106
  " as the API base and send the key as a Bearer credential."
5914
6107
  ] })
5915
6108
  ] }) });
5916
6109
  }
5917
6110
 
5918
6111
  // src/web-react/agent-setup-block.tsx
5919
- import { useState as useState20 } from "react";
5920
- import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
6112
+ import { useState as useState21 } from "react";
6113
+ import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
5921
6114
  function AgentSetupBlock({ productName, setupUrl, markdown, description, className }) {
5922
- const [notice, setNotice] = useState20(null);
6115
+ const [notice, setNotice] = useState21(null);
5923
6116
  const prompt = markdown ?? `Set up ${productName} for me. Fetch ${setupUrl} and follow every step in it.`;
5924
6117
  async function copy() {
5925
6118
  try {
@@ -5929,15 +6122,15 @@ function AgentSetupBlock({ productName, setupUrl, markdown, description, classNa
5929
6122
  setNotice(`Clipboard unavailable. Open ${setupUrl} and copy it from there.`);
5930
6123
  }
5931
6124
  }
5932
- return /* @__PURE__ */ jsxs17(
6125
+ return /* @__PURE__ */ jsxs18(
5933
6126
  "section",
5934
6127
  {
5935
6128
  "aria-labelledby": "agent-setup-heading",
5936
6129
  className: `space-y-3 rounded-xl border border-border bg-card p-5 ${className ?? ""}`.trim(),
5937
6130
  children: [
5938
- /* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
5939
- /* @__PURE__ */ jsx19("h2", { id: "agent-setup-heading", className: "font-medium text-foreground", children: "Hand this to your agent" }),
5940
- /* @__PURE__ */ jsx19(
6131
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
6132
+ /* @__PURE__ */ jsx20("h2", { id: "agent-setup-heading", className: "font-medium text-foreground", children: "Hand this to your agent" }),
6133
+ /* @__PURE__ */ jsx20(
5941
6134
  "button",
5942
6135
  {
5943
6136
  type: "button",
@@ -5947,13 +6140,13 @@ function AgentSetupBlock({ productName, setupUrl, markdown, description, classNa
5947
6140
  }
5948
6141
  )
5949
6142
  ] }),
5950
- /* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground", children: description ?? `Your coding agent sets up ${productName} end to end: it asks you to approve once, gets its own capped key, installs the client, and verifies a first call.` }),
5951
- /* @__PURE__ */ jsxs17("p", { className: "text-sm text-muted-foreground", children: [
6143
+ /* @__PURE__ */ jsx20("p", { className: "text-sm text-muted-foreground", children: description ?? `Your coding agent sets up ${productName} end to end: it asks you to approve once, gets its own capped key, installs the client, and verifies a first call.` }),
6144
+ /* @__PURE__ */ jsxs18("p", { className: "text-sm text-muted-foreground", children: [
5952
6145
  "Raw prompt:",
5953
6146
  " ",
5954
- /* @__PURE__ */ jsx19("a", { href: setupUrl, className: "font-mono text-foreground underline", children: setupUrl })
6147
+ /* @__PURE__ */ jsx20("a", { href: setupUrl, className: "font-mono text-foreground underline", children: setupUrl })
5955
6148
  ] }),
5956
- notice ? /* @__PURE__ */ jsx19("p", { role: "status", className: "text-sm text-foreground", children: notice }) : null
6149
+ notice ? /* @__PURE__ */ jsx20("p", { role: "status", className: "text-sm text-foreground", children: notice }) : null
5957
6150
  ]
5958
6151
  }
5959
6152
  );
@@ -5961,37 +6154,37 @@ function AgentSetupBlock({ productName, setupUrl, markdown, description, classNa
5961
6154
 
5962
6155
  // src/web-react/agent-profile-choices.tsx
5963
6156
  import { useId as useId4 } from "react";
5964
- import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
6157
+ import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
5965
6158
  function AgentProfileChoices({ value, profiles, onChange, disabled, locked, lockReason, onNewChat, label = "Agent profile" }) {
5966
6159
  const name = useId4();
5967
6160
  const selected = profiles.find((profile) => profile.id === value);
5968
6161
  if (locked) {
5969
- return /* @__PURE__ */ jsxs18("div", { className: "space-y-2 rounded-lg border border-border p-3 text-sm", children: [
5970
- /* @__PURE__ */ jsx20("p", { className: "font-medium text-foreground", children: selected?.name ?? value }),
5971
- /* @__PURE__ */ jsx20("p", { className: "text-muted-foreground", children: lockReason ?? "This conversation stays on its current profile." }),
5972
- onNewChat && !disabled && /* @__PURE__ */ jsx20("button", { type: "button", onClick: onNewChat, className: "text-sm font-medium text-primary underline underline-offset-4", children: "New chat to switch profile" })
6162
+ return /* @__PURE__ */ jsxs19("div", { className: "space-y-2 rounded-lg border border-border p-3 text-sm", children: [
6163
+ /* @__PURE__ */ jsx21("p", { className: "font-medium text-foreground", children: selected?.name ?? value }),
6164
+ /* @__PURE__ */ jsx21("p", { className: "text-muted-foreground", children: lockReason ?? "This conversation stays on its current profile." }),
6165
+ onNewChat && !disabled && /* @__PURE__ */ jsx21("button", { type: "button", onClick: onNewChat, className: "text-sm font-medium text-primary underline underline-offset-4", children: "New chat to switch profile" })
5973
6166
  ] });
5974
6167
  }
5975
- return /* @__PURE__ */ jsxs18("fieldset", { disabled, className: "min-w-0 space-y-1", children: [
5976
- /* @__PURE__ */ jsx20("legend", { className: "sr-only", children: label }),
5977
- /* @__PURE__ */ jsxs18("div", { className: "max-h-48 space-y-1 overflow-y-auto", children: [
5978
- profiles.map((profile) => /* @__PURE__ */ jsxs18("label", { className: "flex min-h-10 cursor-pointer items-start gap-2 rounded-lg border border-transparent p-2 text-sm hover:bg-muted has-[:checked]:border-border has-[:checked]:bg-muted has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-60", children: [
5979
- /* @__PURE__ */ jsx20("input", { type: "radio", name, value: profile.id, checked: profile.id === value, disabled, onChange: () => {
6168
+ return /* @__PURE__ */ jsxs19("fieldset", { disabled, className: "min-w-0 space-y-1", children: [
6169
+ /* @__PURE__ */ jsx21("legend", { className: "sr-only", children: label }),
6170
+ /* @__PURE__ */ jsxs19("div", { className: "max-h-48 space-y-1 overflow-y-auto", children: [
6171
+ profiles.map((profile) => /* @__PURE__ */ jsxs19("label", { className: "flex min-h-10 cursor-pointer items-start gap-2 rounded-lg border border-transparent p-2 text-sm hover:bg-muted has-[:checked]:border-border has-[:checked]:bg-muted has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-60", children: [
6172
+ /* @__PURE__ */ jsx21("input", { type: "radio", name, value: profile.id, checked: profile.id === value, disabled, onChange: () => {
5980
6173
  if (!disabled) onChange(profile.id);
5981
6174
  }, className: "mt-1 shrink-0 accent-primary" }),
5982
- /* @__PURE__ */ jsxs18("span", { className: "min-w-0", children: [
5983
- /* @__PURE__ */ jsx20("span", { className: "block font-medium text-foreground", children: profile.name }),
5984
- profile.description && /* @__PURE__ */ jsx20("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: profile.description })
6175
+ /* @__PURE__ */ jsxs19("span", { className: "min-w-0", children: [
6176
+ /* @__PURE__ */ jsx21("span", { className: "block font-medium text-foreground", children: profile.name }),
6177
+ profile.description && /* @__PURE__ */ jsx21("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: profile.description })
5985
6178
  ] })
5986
6179
  ] }, profile.id)),
5987
- profiles.length === 0 && /* @__PURE__ */ jsx20("p", { role: "status", className: "p-2 text-sm text-muted-foreground", children: "No profiles available." })
6180
+ profiles.length === 0 && /* @__PURE__ */ jsx21("p", { role: "status", className: "p-2 text-sm text-muted-foreground", children: "No profiles available." })
5988
6181
  ] })
5989
6182
  ] });
5990
6183
  }
5991
6184
 
5992
6185
  // src/web-react/composer-profile-pill.tsx
5993
6186
  import { AgentProfilePicker } from "@tangle-network/sandbox-ui/chat";
5994
- import { jsx as jsx21 } from "react/jsx-runtime";
6187
+ import { jsx as jsx22 } from "react/jsx-runtime";
5995
6188
  var TRIGGER = {
5996
6189
  composer: "max-w-[180px]",
5997
6190
  // A menu panel repoints surface-container to its own tone, which would leave
@@ -6016,7 +6209,7 @@ function ComposerProfilePill({
6016
6209
  placement = "composer",
6017
6210
  className
6018
6211
  }) {
6019
- return /* @__PURE__ */ jsx21(
6212
+ return /* @__PURE__ */ jsx22(
6020
6213
  AgentProfilePicker,
6021
6214
  {
6022
6215
  value: selection.value,
@@ -6040,7 +6233,7 @@ function ComposerProfilePill({
6040
6233
  }
6041
6234
 
6042
6235
  // src/web-react/index.tsx
6043
- import { Fragment as Fragment6, jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
6236
+ import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
6044
6237
  function formatModelCost(msg, models) {
6045
6238
  if (msg.promptTokens == null && msg.completionTokens == null) return null;
6046
6239
  const pricing = models.find((m) => m.id === msg.modelUsed)?.pricing;
@@ -6054,41 +6247,41 @@ function formatTokensPerSecond(msg) {
6054
6247
  return `${Math.round(msg.completionTokens / (msg.durationMs / 1e3))} tok/s`;
6055
6248
  }
6056
6249
  function RunDrillIn({ run, onClose }) {
6057
- return /* @__PURE__ */ jsxs19("div", { className: `fixed inset-y-0 right-0 z-50 flex w-[480px] max-w-full flex-col border-l border-card-edge bg-popover ${OVERLAY_SHADOW}`, children: [
6058
- /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 border-b border-border px-4 py-3", children: [
6059
- /* @__PURE__ */ jsx22(
6250
+ return /* @__PURE__ */ jsxs20("div", { className: `fixed inset-y-0 right-0 z-50 flex w-[480px] max-w-full flex-col border-l border-card-edge bg-popover ${OVERLAY_SHADOW}`, children: [
6251
+ /* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-2 border-b border-border px-4 py-3", children: [
6252
+ /* @__PURE__ */ jsx23(
6060
6253
  "span",
6061
6254
  {
6062
6255
  className: `h-2 w-2 shrink-0 rounded-full ${run.status === "running" ? "bg-warning" : run.status === "error" ? "bg-destructive" : "bg-success"}`
6063
6256
  }
6064
6257
  ),
6065
- /* @__PURE__ */ jsxs19("div", { className: "min-w-0 flex-1", children: [
6066
- /* @__PURE__ */ jsx22("p", { className: "truncate text-[15px] font-semibold", children: run.title }),
6067
- /* @__PURE__ */ jsx22("p", { className: "truncate font-mono text-xs text-muted-foreground", children: run.toolName })
6258
+ /* @__PURE__ */ jsxs20("div", { className: "min-w-0 flex-1", children: [
6259
+ /* @__PURE__ */ jsx23("p", { className: "truncate text-[15px] font-semibold", children: run.title }),
6260
+ /* @__PURE__ */ jsx23("p", { className: "truncate font-mono text-xs text-muted-foreground", children: run.toolName })
6068
6261
  ] }),
6069
- /* @__PURE__ */ jsx22(
6262
+ /* @__PURE__ */ jsx23(
6070
6263
  "button",
6071
6264
  {
6072
6265
  type: "button",
6073
6266
  onClick: onClose,
6074
6267
  "aria-label": "Close",
6075
6268
  className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-accent hover:text-foreground",
6076
- children: /* @__PURE__ */ jsx22("svg", { className: "h-4 w-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx22("path", { d: "M18 6 6 18M6 6l12 12" }) })
6269
+ children: /* @__PURE__ */ jsx23("svg", { className: "h-4 w-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx23("path", { d: "M18 6 6 18M6 6l12 12" }) })
6077
6270
  }
6078
6271
  )
6079
6272
  ] }),
6080
- /* @__PURE__ */ jsxs19("div", { className: "flex-1 space-y-3 overflow-y-auto p-4", children: [
6081
- run.steps.length === 0 && /* @__PURE__ */ jsx22("p", { className: "text-sm text-muted-foreground", children: "No steps recorded yet." }),
6082
- run.steps.map((step, i) => /* @__PURE__ */ jsxs19("div", { className: "rounded-lg border border-card-edge bg-card", children: [
6083
- /* @__PURE__ */ jsxs19("div", { className: "flex items-baseline gap-2 border-b border-border px-3 py-1.5", children: [
6084
- /* @__PURE__ */ jsx22("span", { className: `font-mono text-xs ${step.status === "error" ? "text-destructive" : "text-muted-foreground"}`, children: step.status === "error" ? "\u2717" : "$" }),
6085
- /* @__PURE__ */ jsx22("code", { className: "min-w-0 flex-1 truncate font-mono text-xs", children: step.label }),
6086
- /* @__PURE__ */ jsx22("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: new Date(step.at).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }) })
6273
+ /* @__PURE__ */ jsxs20("div", { className: "flex-1 space-y-3 overflow-y-auto p-4", children: [
6274
+ run.steps.length === 0 && /* @__PURE__ */ jsx23("p", { className: "text-sm text-muted-foreground", children: "No steps recorded yet." }),
6275
+ run.steps.map((step, i) => /* @__PURE__ */ jsxs20("div", { className: "rounded-lg border border-card-edge bg-card", children: [
6276
+ /* @__PURE__ */ jsxs20("div", { className: "flex items-baseline gap-2 border-b border-border px-3 py-1.5", children: [
6277
+ /* @__PURE__ */ jsx23("span", { className: `font-mono text-xs ${step.status === "error" ? "text-destructive" : "text-muted-foreground"}`, children: step.status === "error" ? "\u2717" : "$" }),
6278
+ /* @__PURE__ */ jsx23("code", { className: "min-w-0 flex-1 truncate font-mono text-xs", children: step.label }),
6279
+ /* @__PURE__ */ jsx23("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: new Date(step.at).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }) })
6087
6280
  ] }),
6088
- step.detail && /* @__PURE__ */ jsx22("pre", { className: "max-h-48 overflow-auto whitespace-pre-wrap px-3 py-2 font-mono text-xs leading-relaxed text-muted-foreground", children: step.detail })
6281
+ step.detail && /* @__PURE__ */ jsx23("pre", { className: "max-h-48 overflow-auto whitespace-pre-wrap px-3 py-2 font-mono text-xs leading-relaxed text-muted-foreground", children: step.detail })
6089
6282
  ] }, i))
6090
6283
  ] }),
6091
- /* @__PURE__ */ jsx22("p", { className: "border-t border-border px-4 py-2 text-xs text-muted-foreground", children: "Read-only transcript \u2014 reply in the main chat." })
6284
+ /* @__PURE__ */ jsx23("p", { className: "border-t border-border px-4 py-2 text-xs text-muted-foreground", children: "Read-only transcript \u2014 reply in the main chat." })
6092
6285
  ] });
6093
6286
  }
6094
6287
  function pendingApprovalOf(call) {
@@ -6104,23 +6297,23 @@ function ChatEmptyState({
6104
6297
  }) {
6105
6298
  const doorCount = Math.min(doors?.length ?? 0, 3);
6106
6299
  const doorsGridClass = doorCount === 1 ? "mx-auto max-w-sm sm:grid-cols-1" : doorCount === 2 ? "sm:grid-cols-2" : "sm:grid-cols-3";
6107
- return /* @__PURE__ */ jsxs19("div", { className: "mx-auto flex w-full max-w-2xl flex-col items-center px-6 py-12 text-center sm:py-20", children: [
6108
- /* @__PURE__ */ jsx22("span", { className: "mb-5 inline-flex h-14 w-14 items-center justify-center rounded-2xl bg-primary/10 ring-1 ring-primary/15", children: /* @__PURE__ */ jsx22(BrandMark, { size: 32, className: "shrink-0" }) }),
6109
- /* @__PURE__ */ jsx22("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: productName }),
6110
- /* @__PURE__ */ jsx22("h2", { className: "mt-1.5 text-balance text-2xl font-semibold leading-tight text-foreground", children: headline }),
6111
- subline && /* @__PURE__ */ jsx22("p", { className: "mt-3 max-w-md text-[15px] leading-relaxed text-muted-foreground", children: subline }),
6112
- doors && doors.length > 0 && /* @__PURE__ */ jsx22("div", { className: `mt-7 grid w-full gap-2.5 ${doorsGridClass}`, children: doors.slice(0, 3).map((door, i) => /* @__PURE__ */ jsxs19(
6300
+ return /* @__PURE__ */ jsxs20("div", { className: "mx-auto flex w-full max-w-2xl flex-col items-center px-6 py-12 text-center sm:py-20", children: [
6301
+ /* @__PURE__ */ jsx23("span", { className: "mb-5 inline-flex h-14 w-14 items-center justify-center rounded-2xl bg-primary/10 ring-1 ring-primary/15", children: /* @__PURE__ */ jsx23(BrandMark, { size: 32, className: "shrink-0" }) }),
6302
+ /* @__PURE__ */ jsx23("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: productName }),
6303
+ /* @__PURE__ */ jsx23("h2", { className: "mt-1.5 text-balance text-2xl font-semibold leading-tight text-foreground", children: headline }),
6304
+ subline && /* @__PURE__ */ jsx23("p", { className: "mt-3 max-w-md text-[15px] leading-relaxed text-muted-foreground", children: subline }),
6305
+ doors && doors.length > 0 && /* @__PURE__ */ jsx23("div", { className: `mt-7 grid w-full gap-2.5 ${doorsGridClass}`, children: doors.slice(0, 3).map((door, i) => /* @__PURE__ */ jsxs20(
6113
6306
  "button",
6114
6307
  {
6115
6308
  type: "button",
6116
6309
  onClick: door.onSelect,
6117
6310
  className: "group flex min-h-[44px] flex-col items-start rounded-xl border border-border bg-card px-4 py-3 text-left transition hover:border-primary/40 hover:bg-accent",
6118
6311
  children: [
6119
- /* @__PURE__ */ jsxs19("span", { className: "flex items-center gap-2 text-sm font-semibold text-foreground", children: [
6312
+ /* @__PURE__ */ jsxs20("span", { className: "flex items-center gap-2 text-sm font-semibold text-foreground", children: [
6120
6313
  door.icon,
6121
6314
  door.label
6122
6315
  ] }),
6123
- door.description && /* @__PURE__ */ jsx22("span", { className: "mt-0.5 text-[12px] leading-snug text-muted-foreground", children: door.description })
6316
+ door.description && /* @__PURE__ */ jsx23("span", { className: "mt-0.5 text-[12px] leading-snug text-muted-foreground", children: door.description })
6124
6317
  ]
6125
6318
  },
6126
6319
  i
@@ -6129,26 +6322,26 @@ function ChatEmptyState({
6129
6322
  }
6130
6323
  function ToolGlyph({ name, className }) {
6131
6324
  if (name.startsWith("sandbox_")) {
6132
- return /* @__PURE__ */ jsxs19("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6133
- /* @__PURE__ */ jsx22("polyline", { points: "4 17 10 11 4 5" }),
6134
- /* @__PURE__ */ jsx22("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
6325
+ return /* @__PURE__ */ jsxs20("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6326
+ /* @__PURE__ */ jsx23("polyline", { points: "4 17 10 11 4 5" }),
6327
+ /* @__PURE__ */ jsx23("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
6135
6328
  ] });
6136
6329
  }
6137
6330
  if (name === "submit_proposal") {
6138
- return /* @__PURE__ */ jsxs19("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6139
- /* @__PURE__ */ jsx22("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
6140
- /* @__PURE__ */ jsx22("path", { d: "M14 2v6h6M9 15l2 2 4-4" })
6331
+ return /* @__PURE__ */ jsxs20("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6332
+ /* @__PURE__ */ jsx23("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
6333
+ /* @__PURE__ */ jsx23("path", { d: "M14 2v6h6M9 15l2 2 4-4" })
6141
6334
  ] });
6142
6335
  }
6143
6336
  if (name === "schedule_followup") {
6144
- return /* @__PURE__ */ jsxs19("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: [
6145
- /* @__PURE__ */ jsx22("circle", { cx: "12", cy: "12", r: "9" }),
6146
- /* @__PURE__ */ jsx22("path", { d: "M12 7v5l3 3" })
6337
+ return /* @__PURE__ */ jsxs20("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: [
6338
+ /* @__PURE__ */ jsx23("circle", { cx: "12", cy: "12", r: "9" }),
6339
+ /* @__PURE__ */ jsx23("path", { d: "M12 7v5l3 3" })
6147
6340
  ] });
6148
6341
  }
6149
- return /* @__PURE__ */ jsxs19("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6150
- /* @__PURE__ */ jsx22("path", { d: "M12 3v3m0 12v3M3 12h3m12 0h3" }),
6151
- /* @__PURE__ */ jsx22("circle", { cx: "12", cy: "12", r: "4" })
6342
+ return /* @__PURE__ */ jsxs20("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6343
+ /* @__PURE__ */ jsx23("path", { d: "M12 3v3m0 12v3M3 12h3m12 0h3" }),
6344
+ /* @__PURE__ */ jsx23("circle", { cx: "12", cy: "12", r: "4" })
6152
6345
  ] });
6153
6346
  }
6154
6347
  function toolOutcomeOf(call) {
@@ -6234,40 +6427,37 @@ function truncate(v, max = 240) {
6234
6427
  function KvRows({ data }) {
6235
6428
  const entries = Object.entries(data).filter(([, v]) => v !== void 0 && v !== null && v !== "");
6236
6429
  if (!entries.length) return null;
6237
- return /* @__PURE__ */ jsx22("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1", children: entries.map(([k, v]) => /* @__PURE__ */ jsxs19("div", { className: "contents", children: [
6238
- /* @__PURE__ */ jsx22("dt", { className: "font-mono text-xs text-muted-foreground", children: k }),
6239
- /* @__PURE__ */ jsx22("dd", { className: "min-w-0 whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground", children: truncate(v) })
6430
+ return /* @__PURE__ */ jsx23("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1", children: entries.map(([k, v]) => /* @__PURE__ */ jsxs20("div", { className: "contents", children: [
6431
+ /* @__PURE__ */ jsx23("dt", { className: "font-mono text-xs text-muted-foreground", children: k }),
6432
+ /* @__PURE__ */ jsx23("dd", { className: "min-w-0 whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground", children: truncate(v) })
6240
6433
  ] }, k)) });
6241
6434
  }
6242
6435
  function ShellDetail({ call }) {
6243
6436
  const outcome = toolOutcomeOf(call);
6244
6437
  const r = outcome?.result ?? {};
6245
- return /* @__PURE__ */ jsxs19("div", { className: "overflow-hidden rounded-md bg-zinc-900 font-mono text-xs leading-relaxed", children: [
6246
- /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 px-3 pt-2 text-zinc-400", children: [
6247
- /* @__PURE__ */ jsx22("span", { className: "select-none text-zinc-500", children: "$" }),
6248
- /* @__PURE__ */ jsx22("span", { className: "min-w-0 flex-1 truncate text-zinc-200", children: String(call.args?.command ?? "") }),
6249
- r.exitCode != null && /* @__PURE__ */ jsxs19("span", { className: r.exitCode === 0 ? "text-success" : "text-destructive", children: [
6250
- "exit ",
6251
- r.exitCode
6252
- ] })
6438
+ return /* @__PURE__ */ jsxs20(TerminalDisplay, { showHeader: false, autoScroll: false, maxHeight: "14rem", className: "text-xs", children: [
6439
+ /* @__PURE__ */ jsx23(TerminalLine, { type: "command", children: String(call.args?.command ?? "") }),
6440
+ r.exitCode != null && /* @__PURE__ */ jsxs20(TerminalLine, { type: r.exitCode === 0 ? "success" : "error", children: [
6441
+ "exit ",
6442
+ r.exitCode
6253
6443
  ] }),
6254
- /* @__PURE__ */ jsx22("pre", { className: "max-h-56 overflow-auto whitespace-pre-wrap px-3 pb-2.5 pt-1.5 text-zinc-300", children: outcome?.ok === false ? outcome.message ?? "failed" : [r.stdout, r.stderr].filter(Boolean).join("\n") || "(no output)" })
6444
+ /* @__PURE__ */ jsx23(TerminalLine, { type: outcome?.ok === false ? "error" : "output", children: outcome?.ok === false ? outcome.message ?? "failed" : [r.stdout, r.stderr].filter(Boolean).join("\n") || "(no output)" })
6255
6445
  ] });
6256
6446
  }
6257
6447
  function DefaultToolDetail({ call }) {
6258
6448
  const result = call.result;
6259
6449
  const envelope = typeof result === "object" && result !== null ? result : null;
6260
- return /* @__PURE__ */ jsxs19("div", { className: "space-y-2", children: [
6261
- call.args && Object.keys(call.args).length > 0 && /* @__PURE__ */ jsxs19("div", { children: [
6262
- /* @__PURE__ */ jsx22("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Called with" }),
6263
- /* @__PURE__ */ jsx22(KvRows, { data: call.args })
6450
+ return /* @__PURE__ */ jsxs20("div", { className: "space-y-2", children: [
6451
+ call.args && Object.keys(call.args).length > 0 && /* @__PURE__ */ jsxs20("div", { children: [
6452
+ /* @__PURE__ */ jsx23("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Called with" }),
6453
+ /* @__PURE__ */ jsx23(KvRows, { data: call.args })
6264
6454
  ] }),
6265
- envelope ? /* @__PURE__ */ jsxs19("div", { children: [
6266
- /* @__PURE__ */ jsx22("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: envelope.ok === false ? "Failed" : "Result" }),
6267
- envelope.ok === false ? /* @__PURE__ */ jsx22("p", { className: "text-xs text-destructive", children: envelope.message ?? "Tool failed" }) : envelope.result && typeof envelope.result === "object" ? /* @__PURE__ */ jsx22(KvRows, { data: envelope.result }) : envelope.result != null ? /* @__PURE__ */ jsx22("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(envelope.result) }) : null
6268
- ] }) : result != null ? /* @__PURE__ */ jsxs19("div", { children: [
6269
- /* @__PURE__ */ jsx22("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Result" }),
6270
- /* @__PURE__ */ jsx22("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(result) })
6455
+ envelope ? /* @__PURE__ */ jsxs20("div", { children: [
6456
+ /* @__PURE__ */ jsx23("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: envelope.ok === false ? "Failed" : "Result" }),
6457
+ envelope.ok === false ? /* @__PURE__ */ jsx23("p", { className: "text-xs text-destructive", children: envelope.message ?? "Tool failed" }) : envelope.result && typeof envelope.result === "object" ? /* @__PURE__ */ jsx23(KvRows, { data: envelope.result }) : envelope.result != null ? /* @__PURE__ */ jsx23("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(envelope.result) }) : null
6458
+ ] }) : result != null ? /* @__PURE__ */ jsxs20("div", { children: [
6459
+ /* @__PURE__ */ jsx23("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Result" }),
6460
+ /* @__PURE__ */ jsx23("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(result) })
6271
6461
  ] }) : null
6272
6462
  ] });
6273
6463
  }
@@ -6278,24 +6468,24 @@ function ProposalCard({
6278
6468
  approval,
6279
6469
  renderers
6280
6470
  }) {
6281
- const [expanded, setExpanded] = useState21(false);
6471
+ const [expanded, setExpanded] = useState22(false);
6282
6472
  const { summary, meta, typeSlug } = proposalPreview(call);
6283
6473
  const custom = renderers?.[call.name]?.(call, message);
6284
6474
  const { pending: deciding, run: decide } = usePending();
6285
- return /* @__PURE__ */ jsxs19("div", { className: "w-full max-w-full rounded-xl border border-warning/50 bg-warning/[0.06] text-sm shadow-sm ring-1 ring-warning/10", children: [
6286
- /* @__PURE__ */ jsxs19("div", { className: "flex items-start gap-2.5 px-4 pt-3.5", children: [
6287
- /* @__PURE__ */ jsx22("span", { className: "mt-0.5 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-warning/15 text-warning", children: /* @__PURE__ */ jsx22(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
6288
- /* @__PURE__ */ jsxs19("div", { className: "min-w-0 flex-1", children: [
6289
- /* @__PURE__ */ jsx22("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-warning-strong", children: approval ? "Needs your approval" : "Awaiting approval" }),
6290
- /* @__PURE__ */ jsx22("p", { className: "mt-0.5 text-[15px] font-semibold leading-snug text-foreground", children: friendlyToolTitle(call) }),
6291
- summary && /* @__PURE__ */ jsx22("p", { className: "mt-1 text-xs leading-relaxed text-muted-foreground", children: summary }),
6292
- typeSlug && /* @__PURE__ */ jsx22("p", { className: "mt-1 font-mono text-xs text-muted-foreground", children: typeSlug }),
6293
- meta.length > 0 && /* @__PURE__ */ jsx22("div", { className: "mt-1.5 flex flex-wrap items-center gap-1.5", children: meta.map((m, i) => /* @__PURE__ */ jsx22("span", { className: "rounded-full bg-secondary px-2 py-0.5 text-xs font-medium text-muted-foreground", children: m }, i)) })
6475
+ return /* @__PURE__ */ jsxs20("div", { className: "w-full max-w-full rounded-xl border border-warning/50 bg-warning/[0.06] text-sm shadow-sm ring-1 ring-warning/10", children: [
6476
+ /* @__PURE__ */ jsxs20("div", { className: "flex items-start gap-2.5 px-4 pt-3.5", children: [
6477
+ /* @__PURE__ */ jsx23("span", { className: "mt-0.5 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-warning/15 text-warning", children: /* @__PURE__ */ jsx23(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
6478
+ /* @__PURE__ */ jsxs20("div", { className: "min-w-0 flex-1", children: [
6479
+ /* @__PURE__ */ jsx23("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-warning-strong", children: approval ? "Needs your approval" : "Awaiting approval" }),
6480
+ /* @__PURE__ */ jsx23("p", { className: "mt-0.5 text-[15px] font-semibold leading-snug text-foreground", children: friendlyToolTitle(call) }),
6481
+ summary && /* @__PURE__ */ jsx23("p", { className: "mt-1 text-xs leading-relaxed text-muted-foreground", children: summary }),
6482
+ typeSlug && /* @__PURE__ */ jsx23("p", { className: "mt-1 font-mono text-xs text-muted-foreground", children: typeSlug }),
6483
+ meta.length > 0 && /* @__PURE__ */ jsx23("div", { className: "mt-1.5 flex flex-wrap items-center gap-1.5", children: meta.map((m, i) => /* @__PURE__ */ jsx23("span", { className: "rounded-full bg-secondary px-2 py-0.5 text-xs font-medium text-muted-foreground", children: m }, i)) })
6294
6484
  ] })
6295
6485
  ] }),
6296
- /* @__PURE__ */ jsxs19("div", { className: "flex flex-wrap items-center gap-2 px-4 pb-3.5 pt-3", children: [
6297
- approval && /* @__PURE__ */ jsxs19(Fragment6, { children: [
6298
- /* @__PURE__ */ jsx22(
6486
+ /* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap items-center gap-2 px-4 pb-3.5 pt-3", children: [
6487
+ approval && /* @__PURE__ */ jsxs20(Fragment7, { children: [
6488
+ /* @__PURE__ */ jsx23(
6299
6489
  "button",
6300
6490
  {
6301
6491
  type: "button",
@@ -6305,7 +6495,7 @@ function ProposalCard({
6305
6495
  children: "Approve & run"
6306
6496
  }
6307
6497
  ),
6308
- /* @__PURE__ */ jsx22(
6498
+ /* @__PURE__ */ jsx23(
6309
6499
  "button",
6310
6500
  {
6311
6501
  type: "button",
@@ -6316,7 +6506,7 @@ function ProposalCard({
6316
6506
  }
6317
6507
  )
6318
6508
  ] }),
6319
- /* @__PURE__ */ jsxs19(
6509
+ /* @__PURE__ */ jsxs20(
6320
6510
  "button",
6321
6511
  {
6322
6512
  type: "button",
@@ -6325,12 +6515,12 @@ function ProposalCard({
6325
6515
  className: "ml-auto inline-flex items-center gap-1 rounded text-[12px] font-medium text-muted-foreground transition hover:text-foreground",
6326
6516
  children: [
6327
6517
  expanded ? "Hide details" : "View details",
6328
- /* @__PURE__ */ jsx22(ChevronDown, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` })
6518
+ /* @__PURE__ */ jsx23(ChevronDown, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` })
6329
6519
  ]
6330
6520
  }
6331
6521
  )
6332
6522
  ] }),
6333
- expanded && /* @__PURE__ */ jsx22("div", { className: "border-t border-warning/20 px-4 py-3 text-xs", children: custom ?? /* @__PURE__ */ jsx22(DefaultToolDetail, { call }) })
6523
+ expanded && /* @__PURE__ */ jsx23("div", { className: "border-t border-warning/20 px-4 py-3 text-xs", children: custom ?? /* @__PURE__ */ jsx23(DefaultToolDetail, { call }) })
6334
6524
  ] });
6335
6525
  }
6336
6526
  function formatFollowupWhen(when) {
@@ -6345,14 +6535,14 @@ function FollowupCard({ call }) {
6345
6535
  const when = typeof a.when === "string" ? a.when : typeof a.at === "string" ? a.at : typeof a.schedule === "string" ? a.schedule : null;
6346
6536
  const failed = toolCallFailed(call);
6347
6537
  const errorText = failed ? toolOutcomeOf(call)?.message ?? "Scheduling failed" : null;
6348
- return /* @__PURE__ */ jsx22("div", { className: "flex items-start gap-2", children: /* @__PURE__ */ jsxs19("div", { className: "min-w-0 flex-1 overflow-hidden rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--md3-surface-container)]", children: [
6349
- /* @__PURE__ */ jsxs19("div", { className: "flex w-full items-center gap-2.5 px-3 py-2", children: [
6350
- /* @__PURE__ */ jsx22("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-[var(--radius-sm)] border border-border bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx22(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
6351
- /* @__PURE__ */ jsx22("span", { className: "shrink-0 whitespace-nowrap text-xs font-medium text-foreground", children: friendlyToolTitle(call) }),
6352
- when && /* @__PURE__ */ jsx22("span", { title: when, className: "hidden min-w-0 flex-1 truncate font-mono text-xs tabular-nums text-muted-foreground sm:inline", children: formatFollowupWhen(when) }),
6353
- /* @__PURE__ */ jsx22("span", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: call.status === "running" ? /* @__PURE__ */ jsx22("svg", { className: "h-3 w-3 shrink-0 animate-spin text-[var(--accent-text)]", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: /* @__PURE__ */ jsx22("path", { d: "M21 12a9 9 0 1 1-6.219-8.56", strokeLinecap: "round" }) }) : /* @__PURE__ */ jsx22("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${failed ? "bg-[var(--surface-danger-text)]" : "bg-[var(--surface-success-text)]"}` }) })
6538
+ return /* @__PURE__ */ jsx23("div", { className: "flex items-start gap-2", children: /* @__PURE__ */ jsxs20("div", { className: "min-w-0 flex-1 overflow-hidden rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--md3-surface-container)]", children: [
6539
+ /* @__PURE__ */ jsxs20("div", { className: "flex w-full items-center gap-2.5 px-3 py-2", children: [
6540
+ /* @__PURE__ */ jsx23("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-[var(--radius-sm)] border border-border bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx23(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
6541
+ /* @__PURE__ */ jsx23("span", { className: "shrink-0 whitespace-nowrap text-xs font-medium text-foreground", children: friendlyToolTitle(call) }),
6542
+ when && /* @__PURE__ */ jsx23("span", { title: when, className: "hidden min-w-0 flex-1 truncate font-mono text-xs tabular-nums text-muted-foreground sm:inline", children: formatFollowupWhen(when) }),
6543
+ /* @__PURE__ */ jsx23("span", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: call.status === "running" ? /* @__PURE__ */ jsx23("svg", { className: "h-3 w-3 shrink-0 animate-spin text-[var(--accent-text)]", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: /* @__PURE__ */ jsx23("path", { d: "M21 12a9 9 0 1 1-6.219-8.56", strokeLinecap: "round" }) }) : /* @__PURE__ */ jsx23("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${failed ? "bg-[var(--surface-danger-text)]" : "bg-[var(--surface-success-text)]"}` }) })
6354
6544
  ] }),
6355
- errorText && /* @__PURE__ */ jsx22("div", { className: "border-t border-border px-3 py-2 text-xs text-[var(--surface-danger-text)]", children: errorText })
6545
+ errorText && /* @__PURE__ */ jsx23("div", { className: "border-t border-border px-3 py-2 text-xs text-[var(--surface-danger-text)]", children: errorText })
6356
6546
  ] }) });
6357
6547
  }
6358
6548
  function toolRowTitle(call) {
@@ -6375,10 +6565,10 @@ function ToolCallCard({
6375
6565
  const arrival = useArrivalStyle(staggerIndex ?? 0);
6376
6566
  const pending = call.status === "done" ? pendingApprovalOf(call) : null;
6377
6567
  const kind = blockKindOf(call);
6378
- const arrive = (row) => /* @__PURE__ */ jsx22("div", { className: "agent-arrive", style: arrival, children: row });
6568
+ const arrive = (row) => /* @__PURE__ */ jsx23("div", { className: "agent-arrive", style: arrival, children: row });
6379
6569
  if (pending) {
6380
6570
  return arrive(
6381
- /* @__PURE__ */ jsx22(
6571
+ /* @__PURE__ */ jsx23(
6382
6572
  ProposalCard,
6383
6573
  {
6384
6574
  call,
@@ -6391,18 +6581,18 @@ function ToolCallCard({
6391
6581
  );
6392
6582
  }
6393
6583
  if (kind === "followup") {
6394
- return arrive(/* @__PURE__ */ jsx22(FollowupCard, { call }));
6584
+ return arrive(/* @__PURE__ */ jsx23(FollowupCard, { call }));
6395
6585
  }
6396
6586
  const custom = renderers?.[call.name]?.(call, message);
6397
6587
  return arrive(
6398
- /* @__PURE__ */ jsx22(
6588
+ /* @__PURE__ */ jsx23(
6399
6589
  InlineToolItem,
6400
6590
  {
6401
6591
  part: chatToolCallPart(call),
6402
6592
  title: toolRowTitle(call),
6403
6593
  description: toolRowDescription(call),
6404
- renderToolDetail: () => custom ?? (call.name === "sandbox_run_command" ? /* @__PURE__ */ jsx22(ShellDetail, { call }) : /* @__PURE__ */ jsx22(DefaultToolDetail, { call })),
6405
- actions: onOpenRun && call.name.startsWith("sandbox_") ? /* @__PURE__ */ jsx22(
6594
+ renderToolDetail: () => custom ?? (call.name === "sandbox_run_command" ? /* @__PURE__ */ jsx23(ShellDetail, { call }) : /* @__PURE__ */ jsx23(DefaultToolDetail, { call })),
6595
+ actions: onOpenRun && call.name.startsWith("sandbox_") ? /* @__PURE__ */ jsx23(
6406
6596
  "button",
6407
6597
  {
6408
6598
  type: "button",
@@ -6410,9 +6600,9 @@ function ToolCallCard({
6410
6600
  "aria-label": "Open full transcript",
6411
6601
  title: "Open full transcript",
6412
6602
  className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-accent hover:text-foreground",
6413
- children: /* @__PURE__ */ jsxs19("svg", { className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6414
- /* @__PURE__ */ jsx22("path", { d: "M7 17 17 7" }),
6415
- /* @__PURE__ */ jsx22("path", { d: "M7 7h10v10" })
6603
+ children: /* @__PURE__ */ jsxs20("svg", { className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6604
+ /* @__PURE__ */ jsx23("path", { d: "M7 17 17 7" }),
6605
+ /* @__PURE__ */ jsx23("path", { d: "M7 7h10v10" })
6416
6606
  ] })
6417
6607
  }
6418
6608
  ) : void 0
@@ -6421,7 +6611,7 @@ function ToolCallCard({
6421
6611
  );
6422
6612
  }
6423
6613
  function StreamingCaret() {
6424
- return /* @__PURE__ */ jsx22(
6614
+ return /* @__PURE__ */ jsx23(
6425
6615
  "span",
6426
6616
  {
6427
6617
  className: "ml-0.5 inline-block h-[1.1em] w-[3px] translate-y-[2px] animate-[agent-caret_1s_step-end_infinite] rounded-sm bg-foreground/70",
@@ -6446,9 +6636,9 @@ function SegmentText({
6446
6636
  // the container on top of that makes the paragraph shimmer while it types.
6447
6637
  // The distinction is what separates "the answer materialised" from "the
6448
6638
  // log was appended to".
6449
- /* @__PURE__ */ jsxs19("div", { className: `${messageClassName}${streaming ? "" : " agent-stream-in"}`, children: [
6639
+ /* @__PURE__ */ jsxs20("div", { className: `${messageClassName}${streaming ? "" : " agent-stream-in"}`, children: [
6450
6640
  body,
6451
- showCaret && /* @__PURE__ */ jsx22(StreamingCaret, {})
6641
+ showCaret && /* @__PURE__ */ jsx23(StreamingCaret, {})
6452
6642
  ] })
6453
6643
  );
6454
6644
  }
@@ -6473,7 +6663,7 @@ function SegmentedBody({
6473
6663
  const leftoverToolCalls = (msg.toolCalls ?? []).filter(
6474
6664
  (tc) => !segmentToolIds.has(tc.id)
6475
6665
  );
6476
- const renderToolCard = (call, index) => /* @__PURE__ */ jsx22(
6666
+ const renderToolCard = (call, index) => /* @__PURE__ */ jsx23(
6477
6667
  ToolCallCard,
6478
6668
  {
6479
6669
  call,
@@ -6502,12 +6692,12 @@ function SegmentedBody({
6502
6692
  const children = [];
6503
6693
  for (const g of groups) {
6504
6694
  if (g.kind === "notice") {
6505
- children.push(/* @__PURE__ */ jsx22(SegmentNotice, { tone: g.tone, content: g.content }, `notice-${g.index}`));
6695
+ children.push(/* @__PURE__ */ jsx23(SegmentNotice, { tone: g.tone, content: g.content }, `notice-${g.index}`));
6506
6696
  continue;
6507
6697
  }
6508
6698
  if (g.kind === "text") {
6509
6699
  children.push(
6510
- /* @__PURE__ */ jsx22(
6700
+ /* @__PURE__ */ jsx23(
6511
6701
  SegmentText,
6512
6702
  {
6513
6703
  content: g.content,
@@ -6523,13 +6713,13 @@ function SegmentedBody({
6523
6713
  }
6524
6714
  if (!streaming && g.calls.length >= COLLAPSE_TOOL_RUN_AT && !g.calls.some(isImportantTool)) {
6525
6715
  children.push(
6526
- /* @__PURE__ */ jsxs19("details", { children: [
6527
- /* @__PURE__ */ jsxs19("summary", { className: "cursor-pointer select-none rounded-md py-0.5 text-xs font-medium text-muted-foreground [transition:color_var(--motion-control)] hover:text-foreground", children: [
6716
+ /* @__PURE__ */ jsxs20("details", { children: [
6717
+ /* @__PURE__ */ jsxs20("summary", { className: "cursor-pointer select-none rounded-md py-0.5 text-xs font-medium text-muted-foreground [transition:color_var(--motion-control)] hover:text-foreground", children: [
6528
6718
  "Worked through ",
6529
6719
  g.calls.length,
6530
6720
  " steps"
6531
6721
  ] }),
6532
- /* @__PURE__ */ jsx22("div", { className: "mt-1.5 flex flex-col gap-1.5", children: g.calls.map(renderToolCard) })
6722
+ /* @__PURE__ */ jsx23("div", { className: "mt-1.5 flex flex-col gap-1.5", children: g.calls.map(renderToolCard) })
6533
6723
  ] }, `tools-fold-${g.index}`)
6534
6724
  );
6535
6725
  continue;
@@ -6538,9 +6728,9 @@ function SegmentedBody({
6538
6728
  }
6539
6729
  leftoverToolCalls.forEach((call, index) => children.push(renderToolCard(call, index)));
6540
6730
  if (streaming && segments[lastIndex]?.kind === "tool") {
6541
- children.push(/* @__PURE__ */ jsx22(StreamingCaret, {}, "streaming-caret"));
6731
+ children.push(/* @__PURE__ */ jsx23(StreamingCaret, {}, "streaming-caret"));
6542
6732
  }
6543
- return /* @__PURE__ */ jsx22("div", { className: "flex flex-col gap-2", children });
6733
+ return /* @__PURE__ */ jsx23("div", { className: "flex flex-col gap-2", children });
6544
6734
  }
6545
6735
  var QUIET_META_LANE_CLASS = "mt-1 flex h-[18px] items-center gap-2 text-xs tabular-nums text-muted-foreground opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100 motion-reduce:transition-none [@media(hover:none)]:opacity-100";
6546
6736
  function copyTextOf(msg) {
@@ -6549,9 +6739,9 @@ function copyTextOf(msg) {
6549
6739
  return msg.content;
6550
6740
  }
6551
6741
  function CopyMessageButton({ text }) {
6552
- const [copied, setCopied] = useState21(false);
6553
- const timerRef = useRef14(null);
6554
- useEffect15(
6742
+ const [copied, setCopied] = useState22(false);
6743
+ const timerRef = useRef15(null);
6744
+ useEffect16(
6555
6745
  () => () => {
6556
6746
  if (timerRef.current !== null) clearTimeout(timerRef.current);
6557
6747
  },
@@ -6570,7 +6760,7 @@ function CopyMessageButton({ text }) {
6570
6760
  }
6571
6761
  );
6572
6762
  };
6573
- return /* @__PURE__ */ jsx22(
6763
+ return /* @__PURE__ */ jsx23(
6574
6764
  "button",
6575
6765
  {
6576
6766
  type: "button",
@@ -6578,9 +6768,9 @@ function CopyMessageButton({ text }) {
6578
6768
  "aria-label": "Copy message",
6579
6769
  title: "Copy message",
6580
6770
  className: "rounded p-0.5 text-muted-foreground transition hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
6581
- children: copied ? /* @__PURE__ */ jsx22("svg", { className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx22("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ jsxs19("svg", { className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6582
- /* @__PURE__ */ jsx22("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
6583
- /* @__PURE__ */ jsx22("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
6771
+ children: copied ? /* @__PURE__ */ jsx23("svg", { className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx23("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ jsxs20("svg", { className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6772
+ /* @__PURE__ */ jsx23("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
6773
+ /* @__PURE__ */ jsx23("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
6584
6774
  ] })
6585
6775
  }
6586
6776
  );
@@ -6606,21 +6796,21 @@ function AssistantMessageImpl({
6606
6796
  const segments = msg.segments;
6607
6797
  const hasAnswerText = content !== "" || (segments?.some((s) => (s.kind === "text" || s.kind === "notice") && s.content.trim() !== "") ?? false);
6608
6798
  const quiet = chrome === "quiet";
6609
- return /* @__PURE__ */ jsxs19("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
6610
- quiet && msg.author && /* @__PURE__ */ jsx22(MessageAuthor, { author: msg.author, className: "mb-1.5" }),
6611
- !quiet && /* @__PURE__ */ jsxs19(
6799
+ return /* @__PURE__ */ jsxs20("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
6800
+ quiet && msg.author && /* @__PURE__ */ jsx23(MessageAuthor, { author: msg.author, className: "mb-1.5" }),
6801
+ !quiet && /* @__PURE__ */ jsxs20(
6612
6802
  "div",
6613
6803
  {
6614
6804
  className: `mb-1 flex ${msg.author ? "items-center" : "items-baseline"} gap-2 text-xs tabular-nums text-muted-foreground`,
6615
6805
  children: [
6616
- msg.author ? /* @__PURE__ */ jsx22(MessageAuthor, { author: msg.author }) : /* @__PURE__ */ jsx22("span", { className: "font-semibold uppercase tracking-[0.05em]", children: agentLabel }),
6617
- msg.modelUsed && /* @__PURE__ */ jsx22("span", { className: "font-mono normal-case", children: msg.modelUsed }),
6618
- formatTokensPerSecond(msg) && /* @__PURE__ */ jsx22("span", { children: formatTokensPerSecond(msg) }),
6619
- formatModelCost(msg, models) && /* @__PURE__ */ jsx22("span", { children: formatModelCost(msg, models) })
6806
+ msg.author ? /* @__PURE__ */ jsx23(MessageAuthor, { author: msg.author }) : /* @__PURE__ */ jsx23("span", { className: "font-semibold uppercase tracking-[0.05em]", children: agentLabel }),
6807
+ msg.modelUsed && /* @__PURE__ */ jsx23("span", { className: "font-mono normal-case", children: msg.modelUsed }),
6808
+ formatTokensPerSecond(msg) && /* @__PURE__ */ jsx23("span", { children: formatTokensPerSecond(msg) }),
6809
+ formatModelCost(msg, models) && /* @__PURE__ */ jsx23("span", { children: formatModelCost(msg, models) })
6620
6810
  ]
6621
6811
  }
6622
6812
  ),
6623
- /* @__PURE__ */ jsx22(
6813
+ /* @__PURE__ */ jsx23(
6624
6814
  ReasoningRow,
6625
6815
  {
6626
6816
  className: "mb-2",
@@ -6630,7 +6820,7 @@ function AssistantMessageImpl({
6630
6820
  thinking: streaming && !hasAnswerText && msg.reasoningEndedAt === void 0
6631
6821
  }
6632
6822
  ),
6633
- segments && segments.length > 0 ? /* @__PURE__ */ jsx22(
6823
+ segments && segments.length > 0 ? /* @__PURE__ */ jsx23(
6634
6824
  SegmentedBody,
6635
6825
  {
6636
6826
  segments,
@@ -6642,12 +6832,12 @@ function AssistantMessageImpl({
6642
6832
  toolRenderers,
6643
6833
  messageClassName
6644
6834
  }
6645
- ) : /* @__PURE__ */ jsxs19(Fragment6, { children: [
6646
- /* @__PURE__ */ jsxs19("div", { className: messageClassName, children: [
6835
+ ) : /* @__PURE__ */ jsxs20(Fragment7, { children: [
6836
+ /* @__PURE__ */ jsxs20("div", { className: messageClassName, children: [
6647
6837
  body,
6648
- streaming && content && !msg.toolCalls?.length && /* @__PURE__ */ jsx22(StreamingCaret, {})
6838
+ streaming && content && !msg.toolCalls?.length && /* @__PURE__ */ jsx23(StreamingCaret, {})
6649
6839
  ] }),
6650
- msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */ jsx22("div", { className: "mt-2 flex flex-col gap-1.5", children: msg.toolCalls.map((tc, index) => /* @__PURE__ */ jsx22(
6840
+ msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */ jsx23("div", { className: "mt-2 flex flex-col gap-1.5", children: msg.toolCalls.map((tc, index) => /* @__PURE__ */ jsx23(
6651
6841
  ToolCallCard,
6652
6842
  {
6653
6843
  call: tc,
@@ -6660,7 +6850,7 @@ function AssistantMessageImpl({
6660
6850
  tc.id
6661
6851
  )) })
6662
6852
  ] }),
6663
- durableCards && msg.parts && /* @__PURE__ */ jsx22(
6853
+ durableCards && msg.parts && /* @__PURE__ */ jsx23(
6664
6854
  DurableChatCards,
6665
6855
  {
6666
6856
  ...durableCards,
@@ -6669,7 +6859,7 @@ function AssistantMessageImpl({
6669
6859
  className: "mt-3"
6670
6860
  }
6671
6861
  ),
6672
- workProductCards && workProductPartsFromMessageParts(msg.parts).map((part) => /* @__PURE__ */ jsx22(
6862
+ workProductCards && workProductPartsFromMessageParts(msg.parts).map((part) => /* @__PURE__ */ jsx23(
6673
6863
  WorkProductCard,
6674
6864
  {
6675
6865
  part,
@@ -6679,7 +6869,7 @@ function AssistantMessageImpl({
6679
6869
  `${part.ref.id}:${part.ref.version}`
6680
6870
  )),
6681
6871
  renderExtras?.(msg),
6682
- resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx22("div", { className: "mt-2", children: /* @__PURE__ */ jsx22(
6872
+ resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx23("div", { className: "mt-2", children: /* @__PURE__ */ jsx23(
6683
6873
  MessageAttachments,
6684
6874
  {
6685
6875
  parts: attachmentPartsFromMessageParts(msg.parts),
@@ -6687,18 +6877,18 @@ function AssistantMessageImpl({
6687
6877
  justify: "start"
6688
6878
  }
6689
6879
  ) }),
6690
- quiet && /* @__PURE__ */ jsxs19("div", { "data-testid": "message-meta-lane", className: QUIET_META_LANE_CLASS, children: [
6691
- /* @__PURE__ */ jsx22(CopyMessageButton, { text: copyTextOf(msg) }),
6692
- msg.modelUsed && /* @__PURE__ */ jsx22("span", { className: "font-mono", children: msg.modelUsed }),
6693
- formatTokensPerSecond(msg) && /* @__PURE__ */ jsx22("span", { children: formatTokensPerSecond(msg) }),
6694
- formatModelCost(msg, models) && /* @__PURE__ */ jsx22("span", { children: formatModelCost(msg, models) })
6880
+ quiet && /* @__PURE__ */ jsxs20("div", { "data-testid": "message-meta-lane", className: QUIET_META_LANE_CLASS, children: [
6881
+ /* @__PURE__ */ jsx23(CopyMessageButton, { text: copyTextOf(msg) }),
6882
+ msg.modelUsed && /* @__PURE__ */ jsx23("span", { className: "font-mono", children: msg.modelUsed }),
6883
+ formatTokensPerSecond(msg) && /* @__PURE__ */ jsx23("span", { children: formatTokensPerSecond(msg) }),
6884
+ formatModelCost(msg, models) && /* @__PURE__ */ jsx23("span", { children: formatModelCost(msg, models) })
6695
6885
  ] })
6696
6886
  ] });
6697
6887
  }
6698
6888
  var AssistantMessage = memo(AssistantMessageImpl);
6699
6889
  function useThinkingSeconds(active) {
6700
- const [seconds, setSeconds] = useState21(0);
6701
- useEffect15(() => {
6890
+ const [seconds, setSeconds] = useState22(0);
6891
+ useEffect16(() => {
6702
6892
  if (!active) return;
6703
6893
  setSeconds(0);
6704
6894
  const id = setInterval(() => setSeconds((s) => s + 1), 1e3);
@@ -6707,9 +6897,9 @@ function useThinkingSeconds(active) {
6707
6897
  return seconds;
6708
6898
  }
6709
6899
  function ThinkingRow({ agentLabel, chrome = "labeled", phase }) {
6710
- return /* @__PURE__ */ jsxs19("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: [
6711
- chrome !== "quiet" && /* @__PURE__ */ jsx22("p", { className: "mb-1 text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: agentLabel }),
6712
- /* @__PURE__ */ jsx22(TurnProgress, { phase, pendingMessage: "Thinking\u2026", className: "text-[15px]" })
6900
+ return /* @__PURE__ */ jsxs20("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: [
6901
+ chrome !== "quiet" && /* @__PURE__ */ jsx23("p", { className: "mb-1 text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: agentLabel }),
6902
+ /* @__PURE__ */ jsx23(TurnProgress, { phase, pendingMessage: "Thinking\u2026", className: "text-[15px]" })
6713
6903
  ] });
6714
6904
  }
6715
6905
  var NOTICE_TONE_CLASS = {
@@ -6717,29 +6907,29 @@ var NOTICE_TONE_CLASS = {
6717
6907
  warning: "border-warning/40 bg-warning/10 text-warning-strong"
6718
6908
  };
6719
6909
  function SegmentNotice({ tone, content }) {
6720
- return /* @__PURE__ */ jsxs19(
6910
+ return /* @__PURE__ */ jsxs20(
6721
6911
  "div",
6722
6912
  {
6723
6913
  "data-notice-tone": tone,
6724
6914
  className: `flex items-start gap-2.5 rounded-lg border px-3 py-2.5 text-sm ${NOTICE_TONE_CLASS[tone]}`,
6725
6915
  children: [
6726
- /* @__PURE__ */ jsxs19("svg", { className: "mt-0.5 h-4 w-4 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6727
- /* @__PURE__ */ jsx22("circle", { cx: "12", cy: "12", r: "9" }),
6728
- /* @__PURE__ */ jsx22("path", { d: "M12 8v4m0 4h.01" })
6916
+ /* @__PURE__ */ jsxs20("svg", { className: "mt-0.5 h-4 w-4 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6917
+ /* @__PURE__ */ jsx23("circle", { cx: "12", cy: "12", r: "9" }),
6918
+ /* @__PURE__ */ jsx23("path", { d: "M12 8v4m0 4h.01" })
6729
6919
  ] }),
6730
- /* @__PURE__ */ jsx22("span", { className: "min-w-0 flex-1 whitespace-pre-wrap break-words", children: content })
6920
+ /* @__PURE__ */ jsx23("span", { className: "min-w-0 flex-1 whitespace-pre-wrap break-words", children: content })
6731
6921
  ]
6732
6922
  }
6733
6923
  );
6734
6924
  }
6735
6925
  function StreamErrorRow({ message, onRetry }) {
6736
- return /* @__PURE__ */ jsx22("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: /* @__PURE__ */ jsxs19("div", { role: "alert", className: "flex items-start gap-2.5 rounded-lg border border-destructive/40 bg-destructive/5 px-3 py-2.5 text-sm text-destructive", children: [
6737
- /* @__PURE__ */ jsxs19("svg", { className: "mt-0.5 h-4 w-4 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6738
- /* @__PURE__ */ jsx22("circle", { cx: "12", cy: "12", r: "9" }),
6739
- /* @__PURE__ */ jsx22("path", { d: "M12 8v4m0 4h.01" })
6926
+ return /* @__PURE__ */ jsx23("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: /* @__PURE__ */ jsxs20("div", { role: "alert", className: "flex items-start gap-2.5 rounded-lg border border-destructive/40 bg-destructive/5 px-3 py-2.5 text-sm text-destructive", children: [
6927
+ /* @__PURE__ */ jsxs20("svg", { className: "mt-0.5 h-4 w-4 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6928
+ /* @__PURE__ */ jsx23("circle", { cx: "12", cy: "12", r: "9" }),
6929
+ /* @__PURE__ */ jsx23("path", { d: "M12 8v4m0 4h.01" })
6740
6930
  ] }),
6741
- /* @__PURE__ */ jsx22("span", { className: "min-w-0 flex-1 break-words", children: message }),
6742
- onRetry && /* @__PURE__ */ jsx22(
6931
+ /* @__PURE__ */ jsx23("span", { className: "min-w-0 flex-1 break-words", children: message }),
6932
+ onRetry && /* @__PURE__ */ jsx23(
6743
6933
  "button",
6744
6934
  {
6745
6935
  type: "button",
@@ -6758,19 +6948,19 @@ function OtherPersonMessage({
6758
6948
  resolveAttachmentUrl
6759
6949
  }) {
6760
6950
  const attachments = resolveAttachmentUrl ? attachmentPartsFromMessageParts(msg.parts) : [];
6761
- return /* @__PURE__ */ jsxs19("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
6762
- /* @__PURE__ */ jsxs19("div", { className: `w-fit ${quiet ? "max-w-[72%]" : "max-w-[85%]"}`, children: [
6763
- /* @__PURE__ */ jsx22(MessageAuthor, { author, className: "mb-1.5" }),
6764
- /* @__PURE__ */ jsx22(
6951
+ return /* @__PURE__ */ jsxs20("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
6952
+ /* @__PURE__ */ jsxs20("div", { className: `w-fit ${quiet ? "max-w-[72%]" : "max-w-[85%]"}`, children: [
6953
+ /* @__PURE__ */ jsx23(MessageAuthor, { author, className: "mb-1.5" }),
6954
+ /* @__PURE__ */ jsx23(
6765
6955
  "div",
6766
6956
  {
6767
6957
  className: `w-fit max-w-full rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-4 py-2.5 text-[hsl(var(--foreground))] ${quiet ? "" : "rounded-tl-md "}${messageClassName}`,
6768
- children: /* @__PURE__ */ jsx22("p", { className: "whitespace-pre-wrap", children: msg.content })
6958
+ children: /* @__PURE__ */ jsx23("p", { className: "whitespace-pre-wrap", children: msg.content })
6769
6959
  }
6770
6960
  ),
6771
- resolveAttachmentUrl && attachments.length > 0 && /* @__PURE__ */ jsx22("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx22(MessageAttachments, { parts: attachments, resolveFileUrl: resolveAttachmentUrl, justify: "start" }) })
6961
+ resolveAttachmentUrl && attachments.length > 0 && /* @__PURE__ */ jsx23("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx23(MessageAttachments, { parts: attachments, resolveFileUrl: resolveAttachmentUrl, justify: "start" }) })
6772
6962
  ] }),
6773
- quiet && /* @__PURE__ */ jsx22("div", { "data-testid": "message-meta-lane", className: `${QUIET_META_LANE_CLASS} justify-start`, children: /* @__PURE__ */ jsx22(CopyMessageButton, { text: msg.content }) })
6963
+ quiet && /* @__PURE__ */ jsx23("div", { "data-testid": "message-meta-lane", className: `${QUIET_META_LANE_CLASS} justify-start`, children: /* @__PURE__ */ jsx23(CopyMessageButton, { text: msg.content }) })
6774
6964
  ] });
6775
6965
  }
6776
6966
  function ChatMessages({
@@ -6800,22 +6990,22 @@ function ChatMessages({
6800
6990
  const messageClassName = messageSize === "large" ? `agent-app-message-copy ${TRANSCRIPT_TEXT} [--transcript-font-size:1.0625rem]` : `agent-app-message-copy ${TRANSCRIPT_TEXT}`;
6801
6991
  const assistantMessageClassName = `${messageClassName} bg-transparent text-[hsl(var(--foreground))]`;
6802
6992
  const renderBody = useMemo8(
6803
- () => renderMarkdown ?? ((content) => /* @__PURE__ */ jsx22("p", { className: "whitespace-pre-wrap", children: content })),
6993
+ () => renderMarkdown ?? ((content) => /* @__PURE__ */ jsx23("p", { className: "whitespace-pre-wrap", children: content })),
6804
6994
  [renderMarkdown]
6805
6995
  );
6806
6996
  const lastIsUser = messages[messages.length - 1]?.role === "user";
6807
6997
  const quiet = chrome === "quiet";
6808
6998
  if (messages.length === 0 && !loading && !error) {
6809
- const empty = renderEmpty ? renderEmpty() : /* @__PURE__ */ jsx22(ChatEmptyState, { ...emptyState });
6810
- return /* @__PURE__ */ jsxs19(Fragment6, { children: [
6999
+ const empty = renderEmpty ? renderEmpty() : /* @__PURE__ */ jsx23(ChatEmptyState, { ...emptyState });
7000
+ return /* @__PURE__ */ jsxs20(Fragment7, { children: [
6811
7001
  header,
6812
7002
  empty
6813
7003
  ] });
6814
7004
  }
6815
- return /* @__PURE__ */ jsxs19(Fragment6, { children: [
7005
+ return /* @__PURE__ */ jsxs20(Fragment7, { children: [
6816
7006
  header,
6817
7007
  messages.map(
6818
- (msg) => msg.role === "user" && msg.author && !isViewerMessage(msg.author, viewerId) ? /* @__PURE__ */ jsx22(
7008
+ (msg) => msg.role === "user" && msg.author && !isViewerMessage(msg.author, viewerId) ? /* @__PURE__ */ jsx23(
6819
7009
  OtherPersonMessage,
6820
7010
  {
6821
7011
  msg,
@@ -6825,17 +7015,17 @@ function ChatMessages({
6825
7015
  resolveAttachmentUrl
6826
7016
  },
6827
7017
  msg.id
6828
- ) : msg.role === "user" ? /* @__PURE__ */ jsxs19("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
6829
- /* @__PURE__ */ jsxs19("div", { className: `ml-auto w-fit ${quiet ? "max-w-[72%]" : "max-w-[85%]"}`, children: [
6830
- !quiet && /* @__PURE__ */ jsx22("p", { className: "mb-1 text-right text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: userLabel }),
6831
- /* @__PURE__ */ jsx22(
7018
+ ) : msg.role === "user" ? /* @__PURE__ */ jsxs20("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
7019
+ /* @__PURE__ */ jsxs20("div", { className: `ml-auto w-fit ${quiet ? "max-w-[72%]" : "max-w-[85%]"}`, children: [
7020
+ !quiet && /* @__PURE__ */ jsx23("p", { className: "mb-1 text-right text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: userLabel }),
7021
+ /* @__PURE__ */ jsx23(
6832
7022
  "div",
6833
7023
  {
6834
7024
  className: `rounded-2xl bg-[hsl(var(--foreground))] px-4 py-2.5 text-[hsl(var(--background))] ${quiet ? "" : "rounded-tr-md "}${messageClassName}`,
6835
- children: /* @__PURE__ */ jsx22("p", { className: "whitespace-pre-wrap", children: msg.content })
7025
+ children: /* @__PURE__ */ jsx23("p", { className: "whitespace-pre-wrap", children: msg.content })
6836
7026
  }
6837
7027
  ),
6838
- resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx22("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx22(
7028
+ resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx23("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx23(
6839
7029
  MessageAttachments,
6840
7030
  {
6841
7031
  parts: attachmentPartsFromMessageParts(msg.parts),
@@ -6844,8 +7034,8 @@ function ChatMessages({
6844
7034
  }
6845
7035
  ) })
6846
7036
  ] }),
6847
- quiet && /* @__PURE__ */ jsx22("div", { "data-testid": "message-meta-lane", className: `${QUIET_META_LANE_CLASS} justify-end`, children: /* @__PURE__ */ jsx22(CopyMessageButton, { text: msg.content }) })
6848
- ] }, msg.id) : /* @__PURE__ */ jsx22(
7037
+ quiet && /* @__PURE__ */ jsx23("div", { "data-testid": "message-meta-lane", className: `${QUIET_META_LANE_CLASS} justify-end`, children: /* @__PURE__ */ jsx23(CopyMessageButton, { text: msg.content }) })
7038
+ ] }, msg.id) : /* @__PURE__ */ jsx23(
6849
7039
  AssistantMessage,
6850
7040
  {
6851
7041
  msg,
@@ -6866,8 +7056,8 @@ function ChatMessages({
6866
7056
  msg.id
6867
7057
  )
6868
7058
  ),
6869
- loading && lastIsUser && /* @__PURE__ */ jsx22(ThinkingRow, { agentLabel, chrome, phase: turnPhase }),
6870
- error && !loading && /* @__PURE__ */ jsx22(StreamErrorRow, { message: error, onRetry })
7059
+ loading && lastIsUser && /* @__PURE__ */ jsx23(ThinkingRow, { agentLabel, chrome, phase: turnPhase }),
7060
+ error && !loading && /* @__PURE__ */ jsx23(StreamErrorRow, { message: error, onRetry })
6871
7061
  ] });
6872
7062
  }
6873
7063
 
@@ -7003,6 +7193,7 @@ export {
7003
7193
  insightPageCount,
7004
7194
  insightPageSlice,
7005
7195
  InsightDeck,
7196
+ ReviewInbox,
7006
7197
  ApiAccessPanel,
7007
7198
  AgentSetupBlock,
7008
7199
  AgentProfileChoices,
@@ -7016,4 +7207,4 @@ export {
7016
7207
  useThinkingSeconds,
7017
7208
  ChatMessages
7018
7209
  };
7019
- //# sourceMappingURL=chunk-IAFPBYQQ.js.map
7210
+ //# sourceMappingURL=chunk-6ZUVYAKB.js.map