@flytedan/flytebot-design-system 0.89.0 → 0.90.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1120,6 +1120,7 @@ __export(index_exports, {
1120
1120
  extensionOf: () => extensionOf,
1121
1121
  extractClipboardFiles: () => extractClipboardFiles,
1122
1122
  filterFiles: () => filterFiles,
1123
+ folderFiles: () => folderFiles,
1123
1124
  formatAbsolute: () => formatAbsolute,
1124
1125
  formatBytes: () => formatBytes,
1125
1126
  formatClock: () => formatClock,
@@ -1142,6 +1143,7 @@ __export(index_exports, {
1142
1143
  isUsStateCode: () => isUsStateCode,
1143
1144
  isWithinLayerTree: () => isWithinLayerTree,
1144
1145
  jobBucket: () => jobBucket,
1146
+ jsonPathPosition: () => jsonPathPosition,
1145
1147
  languageLabel: () => languageLabel,
1146
1148
  loadPrefs: () => loadPrefs,
1147
1149
  markdownToText: () => markdownToText,
@@ -3440,11 +3442,13 @@ function AppShell({
3440
3442
  );
3441
3443
  }
3442
3444
 
3445
+ // src/components/navigation/flytedeskLogo.ts
3446
+ var FLYTEDESK_LOGO_SRC = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOTUiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA5NSAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzg2NzNfNTU0KSI+CjxwYXRoIGQ9Ik01Ljg4OTk1IDEzLjU2NjNDNi4zNDU5NSAxMy41NjYzIDYuNjExOTUgMTMuNjMyNiA2Ljc1NDQ1IDEzLjY3MDRWMTEuMzYxOUM2LjUyNjQ1IDExLjI1NzkgNS45NjU5NSAxMS4xNTM4IDUuMzg2NDYgMTEuMTUzOEMzLjEzNDk4IDExLjE1MzggMS42OTA5OSAxMi42MzkyIDEuNjkwOTkgMTQu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nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF84NjczXzU1NCI+CjxyZWN0IHdpZHRoPSI5NSIgaGVpZ2h0PSIzNiIgZmlsbD0id2hpdGUiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K";
3447
+
3443
3448
  // src/components/navigation/FlytedeskBrand.tsx
3444
3449
  var import_jsx_runtime29 = require("react/jsx-runtime");
3445
- var LOGO_SRC = "https://cdn.prod.website-files.com/69a96def413819b7db64de8c/69ac8ec2ed84b986a5fb76dc_Logo%20(dark)%202.svg";
3446
3450
  function FlytedeskMark({ size = "md", className = "", ...rest }) {
3447
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: ["fd-brand-mark", size !== "md" ? "fd-brand-mark-" + size : "", className].filter(Boolean).join(" "), ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("img", { src: LOGO_SRC, alt: "flytedesk" }) });
3451
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: ["fd-brand-mark", size !== "md" ? "fd-brand-mark-" + size : "", className].filter(Boolean).join(" "), ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("img", { src: FLYTEDESK_LOGO_SRC, alt: "flytedesk" }) });
3448
3452
  }
3449
3453
  function FlytedeskBrand({ appName, size = "md", className = "", ...rest }) {
3450
3454
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: ["fd-brand", size !== "md" ? "fd-brand-" + size : "", className].filter(Boolean).join(" "), ...rest, children: [
@@ -3515,28 +3519,28 @@ function Tabs({ tabs = [], value, onChange, className = "", ...rest }) {
3515
3519
  "data-more-end": more.end ? "true" : void 0,
3516
3520
  ...rest,
3517
3521
  children: tabs.map((t) => {
3518
- const item = typeof t === "string" ? { value: t, label: t } : t;
3522
+ const item2 = typeof t === "string" ? { value: t, label: t } : t;
3519
3523
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3520
3524
  "button",
3521
3525
  {
3522
3526
  type: "button",
3523
3527
  role: "tab",
3524
3528
  className: "fd-tab",
3525
- "aria-selected": item.value === value,
3526
- onClick: onChange ? () => onChange(item.value) : void 0,
3529
+ "aria-selected": item2.value === value,
3530
+ onClick: onChange ? () => onChange(item2.value) : void 0,
3527
3531
  children: [
3528
- item.label,
3529
- item.count !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3532
+ item2.label,
3533
+ item2.count !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3530
3534
  "span",
3531
3535
  {
3532
- className: "fd-badge " + (item.tone === "attention" ? "fd-badge-warning" : "fd-badge-neutral"),
3536
+ className: "fd-badge " + (item2.tone === "attention" ? "fd-badge-warning" : "fd-badge-neutral"),
3533
3537
  style: { height: 20, padding: "0 7px" },
3534
- children: item.count
3538
+ children: item2.count
3535
3539
  }
3536
3540
  ) : null
3537
3541
  ]
3538
3542
  },
3539
- item.value
3543
+ item2.value
3540
3544
  );
3541
3545
  })
3542
3546
  }
@@ -3795,7 +3799,7 @@ function ToastProvider({ children }) {
3795
3799
  const timers = React28.useRef(/* @__PURE__ */ new Map());
3796
3800
  const nextId = React28.useRef(1);
3797
3801
  const dismiss = React28.useCallback((id) => {
3798
- setItems((current2) => current2.filter((item) => item.id !== id));
3802
+ setItems((current2) => current2.filter((item2) => item2.id !== id));
3799
3803
  const timer = timers.current.get(id);
3800
3804
  if (timer !== void 0) {
3801
3805
  clearTimeout(timer);
@@ -3821,7 +3825,7 @@ function ToastProvider({ children }) {
3821
3825
  const api = React28.useMemo(() => ({ show }), [show]);
3822
3826
  return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(ToastContext.Provider, { value: api, children: [
3823
3827
  children,
3824
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CornerStackPortal, { slot: "toasts", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "fd-toast-region", "aria-live": "polite", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Toast, { title: item.title, tone: item.tone, onDismiss: () => dismiss(item.id) }, item.id)) }) })
3828
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CornerStackPortal, { slot: "toasts", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "fd-toast-region", "aria-live": "polite", children: items.map((item2) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Toast, { title: item2.title, tone: item2.tone, onDismiss: () => dismiss(item2.id) }, item2.id)) }) })
3825
3829
  ] });
3826
3830
  }
3827
3831
  function useToast() {
@@ -4048,6 +4052,14 @@ var FileKit = {
4048
4052
  toAttachment,
4049
4053
  revokeAttachment
4050
4054
  };
4055
+ function folderFiles(files) {
4056
+ return files.map((file) => {
4057
+ const relative = file.webkitRelativePath;
4058
+ const slash = relative ? relative.indexOf("/") : -1;
4059
+ if (slash < 0) throw new Error(`folderFiles: ${file.name} has no folder path; it did not come from a folder pick.`);
4060
+ return { file, path: relative.slice(slash + 1) };
4061
+ });
4062
+ }
4051
4063
 
4052
4064
  // src/components/data/SegmentedMeter.tsx
4053
4065
  var import_jsx_runtime42 = require("react/jsx-runtime");
@@ -4796,6 +4808,7 @@ function RowActionCell({ action }) {
4796
4808
  var cellOf = (c, row) => c.render ? c.render(row) : row[c.key];
4797
4809
  var cellClassOf = (c) => [c.numeric ? "is-num" : "", c.noWrap ? "fd-table-nowrap" : ""].filter(Boolean).join(" ") || void 0;
4798
4810
  var cardCellOf = (c, row) => c.phoneRender ? c.phoneRender(row) : cellOf(c, row);
4811
+ var hasContent = (node) => node !== null && node !== void 0 && typeof node !== "boolean" && node !== "";
4799
4812
  function rowInteraction(row, onRowClick) {
4800
4813
  if (!onRowClick) return {};
4801
4814
  return {
@@ -4927,6 +4940,7 @@ function StackedRows({ columns, rows, rowKey, loading, stale, skeletonRows, sort
4927
4940
  ] }) }, i)) : rows.map((r) => {
4928
4941
  const selected = isSelected(r);
4929
4942
  const action = rowAction ? rowAction(r) : null;
4943
+ const metaItems = secondary.map((c) => ({ column: c, cell: cardCellOf(c, r) })).filter((item2) => hasContent(item2.cell));
4930
4944
  const semantics = onRowClick ? { role: "button", "aria-pressed": selected } : { "aria-current": selected ? "true" : void 0 };
4931
4945
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "fd-dt-item", children: [
4932
4946
  /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
@@ -4939,10 +4953,10 @@ function StackedRows({ columns, rows, rowKey, loading, stale, skeletonRows, sort
4939
4953
  ...rowInteraction(r, onRowClick),
4940
4954
  children: [
4941
4955
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "fd-dt-card-title", children: primary.map((c) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: c.numeric ? "is-num" : void 0, children: cardCellOf(c, r) }, c.key)) }),
4942
- secondary.length ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "fd-dt-card-meta", children: secondary.map((c) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { className: cellClassOf(c), children: [
4956
+ metaItems.length ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "fd-dt-card-meta", children: metaItems.map(({ column: c, cell }) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { className: cellClassOf(c), children: [
4943
4957
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "fd-dt-card-label", children: c.label }),
4944
4958
  " ",
4945
- cardCellOf(c, r)
4959
+ cell
4946
4960
  ] }, c.key)) }) : null
4947
4961
  ]
4948
4962
  }
@@ -7832,8 +7846,8 @@ function VirtualList({
7832
7846
  const prev = lastKeysRef.current;
7833
7847
  if (!prev) return /* @__PURE__ */ new Set();
7834
7848
  const fresh = /* @__PURE__ */ new Set();
7835
- for (const item of items) {
7836
- const k = keyOf(item);
7849
+ for (const item2 of items) {
7850
+ const k = keyOf(item2);
7837
7851
  if (!prev.has(k)) fresh.add(k);
7838
7852
  }
7839
7853
  return fresh;
@@ -7847,16 +7861,16 @@ function VirtualList({
7847
7861
  }
7848
7862
  const rows = [];
7849
7863
  for (let i = win.startIndex; i <= win.endIndex; i++) {
7850
- const item = items[i - firstItemIndex];
7851
- if (item === void 0) continue;
7852
- const key = keyOf(item);
7864
+ const item2 = items[i - firstItemIndex];
7865
+ if (item2 === void 0) continue;
7866
+ const key = keyOf(item2);
7853
7867
  rows.push(
7854
7868
  /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
7855
7869
  "div",
7856
7870
  {
7857
7871
  className: "fd-vlist-row",
7858
7872
  style: { height: itemHeight, boxSizing: "border-box", transform: "translateY(" + i * itemHeight + "px)" },
7859
- children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: newKeys.has(key) ? "fd-vlist-row-content fd-vlist-row-enter" : "fd-vlist-row-content", children: renderItem(item, i) })
7873
+ children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: newKeys.has(key) ? "fd-vlist-row-content fd-vlist-row-enter" : "fd-vlist-row-content", children: renderItem(item2, i) })
7860
7874
  },
7861
7875
  key
7862
7876
  )
@@ -8112,15 +8126,15 @@ function TransferList({
8112
8126
  (side, key) => (side === "left" ? left.items : right.items).find((it) => keyOf(it) === key),
8113
8127
  [left.items, right.items, keyOf]
8114
8128
  );
8115
- const beginDrag = (e, item, from) => {
8129
+ const beginDrag = (e, item2, from) => {
8116
8130
  if (e.button !== 0) return;
8117
8131
  if (e.target.closest && e.target.closest("button")) return;
8118
8132
  e.preventDefault();
8119
8133
  const rect = e.currentTarget.getBoundingClientRect();
8120
8134
  armedRef.current = {
8121
- item,
8135
+ item: item2,
8122
8136
  from,
8123
- key: keyOf(item),
8137
+ key: keyOf(item2),
8124
8138
  pointerId: e.pointerId,
8125
8139
  startX: e.clientX,
8126
8140
  startY: e.clientY,
@@ -8170,8 +8184,8 @@ function TransferList({
8170
8184
  if (!wasDragging) return;
8171
8185
  const hit = hitTestSide(e.clientX, e.clientY);
8172
8186
  if (hit && hit !== armed.from) {
8173
- const item = findItem(armed.from, armed.key);
8174
- if (item !== void 0) onMove(item, armed.from, hit);
8187
+ const item2 = findItem(armed.from, armed.key);
8188
+ if (item2 !== void 0) onMove(item2, armed.from, hit);
8175
8189
  }
8176
8190
  };
8177
8191
  window.addEventListener("pointermove", onMovePointer);
@@ -8225,19 +8239,19 @@ function TransferList({
8225
8239
  totalCount: cfg.totalCount,
8226
8240
  onNeedMore: cfg.onNeedMore,
8227
8241
  emptyState: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(EmptyState, { icon: "tray", title: "Nothing here" }),
8228
- renderItem: (item) => {
8229
- const isBeingDragged = drag != null && drag.from === side && drag.key === keyOf(item);
8242
+ renderItem: (item2) => {
8243
+ const isBeingDragged = drag != null && drag.from === side && drag.key === keyOf(item2);
8230
8244
  if (isBeingDragged) {
8231
8245
  return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "fd-erow-placeholder", "aria-hidden": "true" });
8232
8246
  }
8233
- const content = renderRow(item);
8247
+ const content = renderRow(item2);
8234
8248
  const destination = (side === "left" ? right : left).label || "the other list";
8235
8249
  return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
8236
8250
  EntityRow,
8237
8251
  {
8238
8252
  ...content,
8239
8253
  draggable: true,
8240
- onPointerDown: (e) => beginDrag(e, item, side),
8254
+ onPointerDown: (e) => beginDrag(e, item2, side),
8241
8255
  action: {
8242
8256
  icon: side === "left" ? "plus" : "minus",
8243
8257
  // Names the row AND where it goes. A list repeats this button on every
@@ -8245,7 +8259,7 @@ function TransferList({
8245
8259
  // over to a screen reader, with nothing to tell one button from the next.
8246
8260
  label: "Move " + content.title + " to " + destination,
8247
8261
  tone: side === "left" ? "add" : "remove",
8248
- onClick: () => onMove(item, side, opposite)
8262
+ onClick: () => onMove(item2, side, opposite)
8249
8263
  }
8250
8264
  }
8251
8265
  );
@@ -9291,6 +9305,8 @@ function Dropzone({
9291
9305
  }
9292
9306
  function FilePickButton({
9293
9307
  onFiles,
9308
+ onFolder,
9309
+ directory = false,
9294
9310
  onReject,
9295
9311
  accept,
9296
9312
  maxFileSize,
@@ -9323,10 +9339,14 @@ function FilePickButton({
9323
9339
  accept,
9324
9340
  multiple,
9325
9341
  className: "fd-sr",
9342
+ ...directory ? { webkitdirectory: "" } : {},
9326
9343
  onChange: (e) => {
9327
9344
  const { accepted, rejected } = filterFiles(e.target.files, { accept, maxFileSize });
9328
9345
  if (rejected.length && onReject) onReject(rejected);
9329
- if (accepted.length && onFiles) onFiles(accepted);
9346
+ if (accepted.length) {
9347
+ if (directory) onFolder?.(folderFiles(accepted));
9348
+ else onFiles?.(accepted);
9349
+ }
9330
9350
  e.target.value = "";
9331
9351
  }
9332
9352
  }
@@ -10271,6 +10291,75 @@ function CodeEditor({
10271
10291
  ] });
10272
10292
  }
10273
10293
 
10294
+ // src/components/forms/jsonPath.ts
10295
+ var import_state3 = require("@codemirror/state");
10296
+ var import_lang_json3 = require("@codemirror/lang-json");
10297
+ var VALUE_NODES = /* @__PURE__ */ new Set(["Object", "Array", "String", "Number", "True", "False", "Null"]);
10298
+ function valueChild(node) {
10299
+ for (let child = node.firstChild; child; child = child.nextSibling) {
10300
+ if (VALUE_NODES.has(child.name)) return child;
10301
+ }
10302
+ return null;
10303
+ }
10304
+ function member(text, object2, key) {
10305
+ let found = null;
10306
+ for (let prop = object2.firstChild; prop; prop = prop.nextSibling) {
10307
+ if (prop.name !== "Property") continue;
10308
+ const name = prop.getChild("PropertyName");
10309
+ const value = valueChild(prop);
10310
+ if (name && value && JSON.parse(text.slice(name.from, name.to)) === key) found = { name, value };
10311
+ }
10312
+ return found;
10313
+ }
10314
+ function item(array, index) {
10315
+ let at = 0;
10316
+ for (let child = array.firstChild; child; child = child.nextSibling) {
10317
+ if (VALUE_NODES.has(child.name) && at++ === index) return child;
10318
+ }
10319
+ return null;
10320
+ }
10321
+ function jsonPathPosition(text, path, anchor = "value") {
10322
+ try {
10323
+ JSON.parse(text);
10324
+ } catch (e) {
10325
+ if (e instanceof SyntaxError) return null;
10326
+ throw e;
10327
+ }
10328
+ const doc = import_state3.EditorState.create({ doc: text }).doc;
10329
+ const normalized = doc.toString();
10330
+ const root = valueChild((0, import_lang_json3.json)().language.parser.parse(normalized).topNode);
10331
+ if (!root) return null;
10332
+ let target = root;
10333
+ let key = null;
10334
+ let exact = true;
10335
+ for (const step of path) {
10336
+ let next = null;
10337
+ if (target.name === "Object" && typeof step === "string") next = member(normalized, target, step);
10338
+ else if (target.name === "Array" && typeof step === "number") {
10339
+ const value = item(target, step);
10340
+ next = value && { name: null, value };
10341
+ }
10342
+ if (!next) {
10343
+ exact = false;
10344
+ break;
10345
+ }
10346
+ target = next.value;
10347
+ key = next.name;
10348
+ }
10349
+ const span = anchor === "key" && exact && key ? key : target;
10350
+ const from = span.from;
10351
+ const to = span.name === "Object" || span.name === "Array" ? span.from + 1 : span.to;
10352
+ const start = doc.lineAt(from);
10353
+ const end = doc.lineAt(to);
10354
+ return {
10355
+ line: start.number,
10356
+ column: from - start.from + 1,
10357
+ endLine: end.number,
10358
+ endColumn: to - end.from + 1,
10359
+ exact
10360
+ };
10361
+ }
10362
+
10274
10363
  // src/components/forms/RadioGroup.tsx
10275
10364
  var React62 = __toESM(require("react"), 1);
10276
10365
  var import_jsx_runtime88 = require("react/jsx-runtime");
@@ -10326,18 +10415,18 @@ function useSessionContext() {
10326
10415
  var import_jsx_runtime90 = require("react/jsx-runtime");
10327
10416
  var DEFAULT_LINKS = [];
10328
10417
  var DEFAULT_GROUPS = [];
10329
- function Item({ item, onPick }) {
10418
+ function Item({ item: item2, onPick }) {
10330
10419
  return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
10331
10420
  "button",
10332
10421
  {
10333
10422
  type: "button",
10334
10423
  role: "menuitem",
10335
10424
  className: "fd-acct-item",
10336
- onClick: () => onPick(item),
10425
+ onClick: () => onPick(item2),
10337
10426
  children: [
10338
- item.icon ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("i", { className: "ph ph-" + item.icon, "aria-hidden": "true" }) : null,
10339
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { style: { flex: 1 }, children: item.label }),
10340
- item.badge ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Badge, { tone: "neutral", children: item.badge }) : null
10427
+ item2.icon ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("i", { className: "ph ph-" + item2.icon, "aria-hidden": "true" }) : null,
10428
+ /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { style: { flex: 1 }, children: item2.label }),
10429
+ item2.badge ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Badge, { tone: "neutral", children: item2.badge }) : null
10341
10430
  ]
10342
10431
  }
10343
10432
  );
@@ -10364,11 +10453,11 @@ function AccountMenu({
10364
10453
  setOpen(false);
10365
10454
  setSignOutError(null);
10366
10455
  };
10367
- const pick = (item) => {
10456
+ const pick = (item2) => {
10368
10457
  closeMenu();
10369
- if (item.onSelect) return item.onSelect();
10370
- if (onNavigate) return onNavigate(item.href, item);
10371
- if (item.href) window.location.href = item.href;
10458
+ if (item2.onSelect) return item2.onSelect();
10459
+ if (onNavigate) return onNavigate(item2.href, item2);
10460
+ if (item2.href) window.location.href = item2.href;
10372
10461
  };
10373
10462
  const signOut = async () => {
10374
10463
  const handler = onSignOut ?? ctxSignOut;
@@ -13026,41 +13115,41 @@ var fmtDate = (iso2) => {
13026
13115
  const d = /* @__PURE__ */ new Date(String(iso2) + "T00:00:00");
13027
13116
  return isNaN(d) ? iso2 : d.toLocaleDateString(void 0, { month: "short", day: "numeric", year: "numeric" });
13028
13117
  };
13029
- function RoadmapCard({ item, byKey, onOpenFlag }) {
13030
- const s = STATUS[item.status] || STATUS.planned;
13031
- const deps = (item.dependsOn || []).map((k) => byKey[k]).filter(Boolean);
13118
+ function RoadmapCard({ item: item2, byKey, onOpenFlag }) {
13119
+ const s = STATUS[item2.status] || STATUS.planned;
13120
+ const deps = (item2.dependsOn || []).map((k) => byKey[k]).filter(Boolean);
13032
13121
  const blocking = deps.filter((d) => !d.implemented);
13033
13122
  return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Card, { elevation: "flat", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "fd-stack", style: { gap: 10 }, children: [
13034
13123
  /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "fd-row", style: { gap: 8, flexWrap: "wrap" }, children: [
13035
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "fd-body", style: { fontWeight: 700, flex: 1, minWidth: 140 }, children: item.label }),
13036
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Badge, { tone: "neutral", icon: PROJECT_ICON[item.project] || "squares-four", children: item.project }),
13124
+ /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "fd-body", style: { fontWeight: 700, flex: 1, minWidth: 140 }, children: item2.label }),
13125
+ /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Badge, { tone: "neutral", icon: PROJECT_ICON[item2.project] || "squares-four", children: item2.project }),
13037
13126
  /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Badge, { tone: s.tone, icon: s.icon, children: s.label })
13038
13127
  ] }),
13039
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("p", { className: "fd-body-sm fd-secondary", style: { margin: 0, textWrap: "pretty" }, children: item.description }),
13040
- item.backend ? /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "fd-row", style: { gap: 10, alignItems: "flex-start" }, children: [
13128
+ /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("p", { className: "fd-body-sm fd-secondary", style: { margin: 0, textWrap: "pretty" }, children: item2.description }),
13129
+ item2.backend ? /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "fd-row", style: { gap: 10, alignItems: "flex-start" }, children: [
13041
13130
  /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "fd-overline fd-muted", style: { width: 62, flex: "none", paddingTop: 2 }, children: "Backend" }),
13042
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "fd-body-sm", style: { flex: 1, textWrap: "pretty" }, children: item.backend })
13131
+ /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "fd-body-sm", style: { flex: 1, textWrap: "pretty" }, children: item2.backend })
13043
13132
  ] }) : null,
13044
13133
  /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "fd-row", style: { gap: 12, flexWrap: "wrap" }, children: [
13045
- item.effort ? /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("span", { className: "fd-body-sm fd-muted", children: [
13134
+ item2.effort ? /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("span", { className: "fd-body-sm fd-muted", children: [
13046
13135
  /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("i", { className: "ph ph-hourglass-medium" }),
13047
13136
  " ",
13048
- item.effort
13137
+ item2.effort
13049
13138
  ] }) : null,
13050
13139
  /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("span", { className: "fd-body-sm fd-muted", children: [
13051
13140
  /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("i", { className: "ph ph-user" }),
13052
13141
  " ",
13053
- item.owner
13142
+ item2.owner
13054
13143
  ] }),
13055
- item.screen ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Badge, { tone: "neutral", icon: "browser", children: "screen" }) : null,
13144
+ item2.screen ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Badge, { tone: "neutral", icon: "browser", children: "screen" }) : null,
13056
13145
  /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { style: { flex: 1 } }),
13057
13146
  /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
13058
13147
  "button",
13059
13148
  {
13060
13149
  type: "button",
13061
- onClick: () => onOpenFlag && onOpenFlag(item.key),
13150
+ onClick: () => onOpenFlag && onOpenFlag(item2.key),
13062
13151
  style: { all: "unset", cursor: "pointer", display: "inline-flex", alignItems: "center", gap: 5 },
13063
- children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("code", { className: "fd-mono", style: { fontSize: 11, color: "var(--brand)" }, children: item.key })
13152
+ children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("code", { className: "fd-mono", style: { fontSize: 11, color: "var(--brand)" }, children: item2.key })
13064
13153
  }
13065
13154
  )
13066
13155
  ] }),
@@ -13068,7 +13157,7 @@ function RoadmapCard({ item, byKey, onOpenFlag }) {
13068
13157
  /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "fd-overline fd-muted", style: { paddingTop: 3 }, children: "After" }),
13069
13158
  deps.map((d) => /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Tag, { icon: d.implemented ? "check" : "clock", children: d.label }, d.key))
13070
13159
  ] }) : null,
13071
- blocking.length && !item.implemented ? /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("span", { className: "fd-body-sm", style: { color: "var(--warn-text)" }, children: [
13160
+ blocking.length && !item2.implemented ? /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("span", { className: "fd-body-sm", style: { color: "var(--warn-text)" }, children: [
13072
13161
  "Blocked until ",
13073
13162
  blocking.map((d) => d.label).join(" and "),
13074
13163
  " ",
@@ -13162,19 +13251,19 @@ function RoadmapTimeline({ onOpenFlag, title = "Roadmap", lede }) {
13162
13251
  ),
13163
13252
  /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "fd-rm", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "fd-rm-scroll", ref: scrollRef, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "fd-rm-track", children: [
13164
13253
  /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "fd-rm-spine", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "fd-rm-spine-done", style: { height: items.length ? 100 * shippedShown / items.length + "%" : "0%" } }) }),
13165
- items.map((item, n) => {
13166
- const showPhase = item.phase !== lastPhase;
13167
- lastPhase = item.phase;
13168
- const inPhase = items.filter((i) => i.phase === item.phase).length;
13254
+ items.map((item2, n) => {
13255
+ const showPhase = item2.phase !== lastPhase;
13256
+ lastPhase = item2.phase;
13257
+ const inPhase = items.filter((i) => i.phase === item2.phase).length;
13169
13258
  const isBoundary = n === firstPending;
13170
13259
  return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(React74.Fragment, { children: [
13171
13260
  showPhase ? /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "fd-rm-era", children: [
13172
13261
  /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("span", { className: "fd-row", style: { gap: 8, flexWrap: "wrap", alignItems: "baseline" }, children: [
13173
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { style: { fontWeight: 700 }, children: item.phase === 0 ? "Shipped" : "Phase " + item.phase + " \u2014 " + item.phaseName }),
13174
- item.phase === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("span", { className: "fd-mono", style: { opacity: 0.7, fontWeight: 400 }, children: [
13175
- fmtDate(item.phaseStart),
13262
+ /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { style: { fontWeight: 700 }, children: item2.phase === 0 ? "Shipped" : "Phase " + item2.phase + " \u2014 " + item2.phaseName }),
13263
+ item2.phase === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("span", { className: "fd-mono", style: { opacity: 0.7, fontWeight: 400 }, children: [
13264
+ fmtDate(item2.phaseStart),
13176
13265
  " \u2013 ",
13177
- fmtDate(item.date)
13266
+ fmtDate(item2.date)
13178
13267
  ] }),
13179
13268
  /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("span", { style: { opacity: 0.7, fontWeight: 400 }, children: [
13180
13269
  "\xB7 ",
@@ -13183,22 +13272,22 @@ function RoadmapTimeline({ onOpenFlag, title = "Roadmap", lede }) {
13183
13272
  inPhase === 1 ? "" : "s"
13184
13273
  ] })
13185
13274
  ] }),
13186
- item.phaseWhy ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("p", { className: "fd-rm-era-why", children: item.phaseWhy }) : null
13275
+ item2.phaseWhy ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("p", { className: "fd-rm-era-why", children: item2.phaseWhy }) : null
13187
13276
  ] }) : null,
13188
13277
  isBoundary ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "fd-rm-now", ref: nowRef, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("span", { className: "fd-rm-now-pill", children: [
13189
13278
  /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("i", { className: "ph ph-map-pin" }),
13190
13279
  " You are here \u2014 everything above is wired"
13191
13280
  ] }) }) : null,
13192
13281
  /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "fd-rm-row", children: [
13193
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "fd-rm-dot " + (item.implemented ? "is-shipped" : item.status === "next" ? "is-next" : "") }),
13282
+ /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { className: "fd-rm-dot " + (item2.implemented ? "is-shipped" : item2.status === "next" ? "is-next" : "") }),
13194
13283
  /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "fd-rm-date", children: [
13195
- fmtDate(item.date),
13284
+ fmtDate(item2.date),
13196
13285
  /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("br", {}),
13197
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { style: { opacity: 0.75 }, children: item.implemented ? "shipped" : "phase " + item.phase })
13286
+ /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { style: { opacity: 0.75 }, children: item2.implemented ? "shipped" : "phase " + item2.phase })
13198
13287
  ] }),
13199
- /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(RoadmapCard, { item, byKey, onOpenFlag })
13288
+ /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(RoadmapCard, { item: item2, byKey, onOpenFlag })
13200
13289
  ] })
13201
- ] }, item.key);
13290
+ ] }, item2.key);
13202
13291
  }),
13203
13292
  !items.length ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("p", { className: "fd-body-sm fd-muted", children: "Nothing matches that filter." }) : null
13204
13293
  ] }) }) }),
@@ -14495,13 +14584,15 @@ function useChatEngine(opts) {
14495
14584
  if (m.role === "assistant") ownAssistants.push(m);
14496
14585
  }
14497
14586
  }
14498
- const progress = ownAssistants.pop();
14587
+ const rowAt = turn?.stored ? ownAssistants.findIndex((m) => m.id === turn.holderId) : ownAssistants.length - 1;
14588
+ const progress = rowAt < 0 ? void 0 : ownAssistants.splice(rowAt, 1)[0];
14499
14589
  const cards = ownAssistants;
14500
14590
  const ids = new Set(server.map((m) => m.id));
14501
14591
  serverCount.current = server.length;
14502
14592
  serverIds.current = ids;
14503
14593
  const settled = server.filter((m) => !ownIds.has(m.id) && !retired.current.has(m.id));
14504
- const local = listRef.current.filter((m) => !ids.has(m.id));
14594
+ const turnOwn = (m) => !!turn?.stored && (m.id === turn.userId || m.id === turn.holderId);
14595
+ const local = listRef.current.filter((m) => turnOwn(m) || !ids.has(m.id));
14505
14596
  const at = local.findIndex((m) => m.id === turn?.holderId);
14506
14597
  const tail = at < 0 ? [...cards, ...local] : [...local.slice(0, at), ...cards, ...local.slice(at)];
14507
14598
  const next = [...settled, ...tail];
@@ -14671,7 +14762,15 @@ function useChatEngine(opts) {
14671
14762
  { id: userId, role: "user", text: turn.text || null, attachments: turn.attachments, pending: true, timestamp: (/* @__PURE__ */ new Date()).toISOString() },
14672
14763
  { id: holderId, role: "assistant", text: "", streaming: !!apiAdapter.streamMessage, working: !apiAdapter.streamMessage, timestamp: (/* @__PURE__ */ new Date()).toISOString() }
14673
14764
  );
14674
- liveTurn.current = { known: new Set(serverIds.current), holderId };
14765
+ const live = { known: new Set(serverIds.current), userId, holderId, stored: false };
14766
+ liveTurn.current = live;
14767
+ const adopt = (stored) => {
14768
+ if (live.stored) return;
14769
+ live.stored = true;
14770
+ commit(listRef.current.map((m) => m.id === live.userId ? { ...m, id: stored.user_message_id } : m.id === live.holderId ? { ...m, id: stored.assistant_message_id } : m));
14771
+ live.userId = stored.user_message_id;
14772
+ live.holderId = stored.assistant_message_id;
14773
+ };
14675
14774
  const ac = typeof AbortController !== "undefined" ? new AbortController() : { abort() {
14676
14775
  }, signal: void 0 };
14677
14776
  abortRef.current = ac;
@@ -14680,53 +14779,54 @@ function useChatEngine(opts) {
14680
14779
  let res;
14681
14780
  if (apiAdapter.streamMessage) {
14682
14781
  res = await apiAdapter.streamMessage(id, turn.text, {
14683
- onToken: (chunk) => patch(holderId, (m) => ({ text: (m.text || "") + chunk, streaming: true })),
14782
+ onAccepted: adopt,
14783
+ onToken: (chunk) => patch(live.holderId, (m) => ({ text: (m.text || "") + chunk, streaming: true })),
14684
14784
  // chunks append
14685
- onStep: (step) => patch(holderId, (m) => {
14785
+ onStep: (step) => patch(live.holderId, (m) => {
14686
14786
  const steps = (m.steps || []).slice();
14687
14787
  const at = steps.findIndex((s) => s.id === step.id);
14688
14788
  if (at === -1) steps.push(step);
14689
14789
  else steps[at] = Object.assign({}, steps[at], step);
14690
14790
  return { steps };
14691
14791
  }),
14692
- onThinking: (chunk) => patch(holderId, (m) => ({ thinking: (m.thinking || "") + chunk }))
14792
+ onThinking: (chunk) => patch(live.holderId, (m) => ({ thinking: (m.thinking || "") + chunk }))
14693
14793
  }, ac.signal, turn.attachments && turn.attachments.length ? turn.attachments : void 0);
14694
14794
  } else if (turn.attachments && turn.attachments.length) {
14695
14795
  res = await apiAdapter.sendMessage(id, turn.text, ac.signal, turn.attachments);
14696
14796
  } else {
14697
14797
  res = await apiAdapter.sendMessage(id, turn.text, ac.signal);
14698
14798
  }
14699
- patch(userId, { pending: false });
14799
+ patch(live.userId, { pending: false });
14700
14800
  if (!res) throw new Error("send_failed");
14701
14801
  const r = res;
14702
14802
  if (r.dispatched) {
14703
- patch(holderId, { streaming: false, working: true, jobId: r.job_id, text: r.reply || "" });
14704
- await pollJob(r.job_id, holderId);
14803
+ patch(live.holderId, { streaming: false, working: true, jobId: r.job_id, text: r.reply || "" });
14804
+ await pollJob(r.job_id, live.holderId);
14705
14805
  } else {
14706
- patch(holderId, {
14806
+ patch(live.holderId, {
14707
14807
  streaming: false,
14708
14808
  working: false,
14709
- text: r.reply != null ? r.reply : listRef.current.find((m) => m.id === holderId)?.text || "",
14809
+ text: r.reply != null ? r.reply : listRef.current.find((m) => m.id === live.holderId)?.text || "",
14710
14810
  packet: r.packet,
14711
- steps: r.steps || listRef.current.find((m) => m.id === holderId)?.steps,
14811
+ steps: r.steps || listRef.current.find((m) => m.id === live.holderId)?.steps,
14712
14812
  citations: r.citations,
14713
14813
  usage: r.usage,
14714
14814
  model: r.model,
14715
14815
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
14716
14816
  });
14717
- commit(listRef.current.map((m) => m.id === userId ? { ...m, id: r.user_message_id } : m.id === holderId ? { ...m, id: r.assistant_message_id } : m));
14817
+ adopt(r);
14718
14818
  serverCount.current += 2;
14719
14819
  if (r.packet && onPacket) onPacket(r.packet);
14720
14820
  }
14721
14821
  } catch (err) {
14722
14822
  const aborted = err && (err.name === "AbortError" || err.message === "aborted") || stoppedRef.current;
14723
- patch(userId, { pending: false });
14823
+ patch(live.userId, { pending: false });
14724
14824
  if (aborted) {
14725
- patch(holderId, (m) => ({ streaming: false, working: false, stopped: true, retryable: true, text: m.text || null }));
14825
+ patch(live.holderId, (m) => ({ streaming: false, working: false, stopped: true, retryable: true, text: m.text || null }));
14726
14826
  } else if (!fail(err)) {
14727
- patch(holderId, { streaming: false, working: false, error: err?.message || "send_failed", retryable: true });
14827
+ patch(live.holderId, { streaming: false, working: false, error: err?.message || "send_failed", retryable: true });
14728
14828
  } else {
14729
- commit(listRef.current.filter((m) => m.id !== holderId));
14829
+ commit(listRef.current.filter((m) => m.id !== live.holderId));
14730
14830
  }
14731
14831
  } finally {
14732
14832
  const known = liveTurn.current.known;
@@ -15628,7 +15728,7 @@ function ModelControls({
15628
15728
  }
15629
15729
  flat.push(m);
15630
15730
  });
15631
- const item = (m) => ({
15731
+ const item2 = (m) => ({
15632
15732
  id: m.id,
15633
15733
  label: m.label,
15634
15734
  description: m.description,
@@ -15638,11 +15738,11 @@ function ModelControls({
15638
15738
  shortcut: m.shortcut ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(KeyHint, { keys: m.shortcut, size: "sm" }) : void 0,
15639
15739
  onSelect: () => onModelChange && onModelChange(m.id)
15640
15740
  });
15641
- const items = [{ kind: "section", label: "Models" }].concat(flat.map(item));
15741
+ const items = [{ kind: "section", label: "Models" }].concat(flat.map(item2));
15642
15742
  Object.keys(grouped).forEach((g) => {
15643
- items.push({ id: "grp_" + g, label: g, icon: "stack", submenu: grouped[g].map(item) });
15743
+ items.push({ id: "grp_" + g, label: g, icon: "stack", submenu: grouped[g].map(item2) });
15644
15744
  });
15645
- if (moreModels && moreModels.length) items.push({ id: "more", label: "More models", submenu: moreModels.map(item) });
15745
+ if (moreModels && moreModels.length) items.push({ id: "more", label: "More models", submenu: moreModels.map(item2) });
15646
15746
  if (onFastModeChange) {
15647
15747
  items.push({ kind: "separator" });
15648
15748
  items.push({ kind: "section", label: "Fast mode" });
@@ -17469,6 +17569,7 @@ function createChatAdapter(transport, { onTurnStarted, deadlineMs = CHAT_CALL_DE
17469
17569
  onTurnStarted?.();
17470
17570
  };
17471
17571
  const accepting = {
17572
+ onAccepted: handlers.onAccepted && ((ids) => (markStarted(), handlers.onAccepted(ids))),
17472
17573
  onToken: (chunk) => (markStarted(), handlers.onToken(chunk)),
17473
17574
  onStep: handlers.onStep && ((step) => (markStarted(), handlers.onStep(step))),
17474
17575
  onThinking: handlers.onThinking && ((chunk) => (markStarted(), handlers.onThinking(chunk)))
@@ -17838,6 +17939,7 @@ function ExportTray({ exports: exports2, keptNote, onDownload, onDismiss }) {
17838
17939
  extensionOf,
17839
17940
  extractClipboardFiles,
17840
17941
  filterFiles,
17942
+ folderFiles,
17841
17943
  formatAbsolute,
17842
17944
  formatBytes,
17843
17945
  formatClock,
@@ -17860,6 +17962,7 @@ function ExportTray({ exports: exports2, keptNote, onDownload, onDismiss }) {
17860
17962
  isUsStateCode,
17861
17963
  isWithinLayerTree,
17862
17964
  jobBucket,
17965
+ jsonPathPosition,
17863
17966
  languageLabel,
17864
17967
  loadPrefs,
17865
17968
  markdownToText,