@flytedan/flytebot-design-system 0.89.0 → 0.90.0

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.js CHANGED
@@ -2256,11 +2256,13 @@ function AppShell({
2256
2256
  );
2257
2257
  }
2258
2258
 
2259
+ // src/components/navigation/flytedeskLogo.ts
2260
+ var FLYTEDESK_LOGO_SRC = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOTUiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA5NSAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzg2NzNfNTU0KSI+CjxwYXRoIGQ9Ik01Ljg4OTk1IDEzLjU2NjNDNi4zNDU5NSAxMy41NjYzIDYuNjExOTUgMTMuNjMyNiA2Ljc1NDQ1IDEzLjY3MDRWMTEuMzYxOUM2LjUyNjQ1IDExLjI1NzkgNS45NjU5NSAxMS4xNTM4IDUuMzg2NDYgMTEuMTUzOEMzLjEzNDk4IDExLjE1MzggMS42OTA5OSAxMi42MzkyIDEuNjkwOTkgMTQuOTE5MlYxNi4wNzM1SDBWMTguNDE5N0gxLjY5MDk5VjI2LjE5NjZINC40NTU0N1YxOC40MTk3SDYuNzQ0OTVWMTYuMDczNUg0LjQ1NTQ3VjE0Ljk2NjVDNC40NTU0NyAxMy44MzEyIDUuMjYyOTYgMTMuNTY2MyA1Ljg4MDQ2IDEzLjU2NjNINS44ODk5NVoiIGZpbGw9IiMwNTJFNEEiLz4KPHBhdGggZD0iTTEwLjgxMDkgMjYuMTk2M1YxMS4zMDQ5SDguMDY1NDNWMjYuMjA1OEgxMC44MTA5VjI2LjE5NjNaIiBmaWxsPSIjMDUyRTRBIi8+CjxwYXRoIGQ9Ik0yNi45MTI1IDEzLjA0MzlIMjQuNDMzVjE0LjQ2MzFDMjQuNDMzIDE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zQxTDE2Ljg1MyAyMi45NDc5TDE5LjE0MjUgMTYuMDUxVjE2LjA0MTVaIiBmaWxsPSIjMDUyRTRBIi8+CjxwYXRoIGQ9Ik04NS4wNzI4IDEyLjUxNTVMOTUuMDAwMiAxLjE0MzU1Qzk1LjAwMDIgMS4xNDM1NSA5MS4xMDUyIDE2LjI5OTggOTAuMzkyNyAxNy4xMTM1Qzg5LjY5OTIgMTcuOTA4MiA4Ni4yMDMyIDE3LjY2MjIgODUuNjYxOCAxNy4xODkyQzg1LjEyMDMgMTYuNzE2MSA4NS4wODIzIDEyLjUwNiA4NS4wODIzIDEyLjUwNkw4NS4wNzI4IDEyLjUxNTVaIiBmaWxsPSIjODBCRkU5Ii8+CjxwYXRoIGQ9Ik04My43MDQ5IDExLjI3NDVMOTQuNzYyOCAxQzk0Ljc2MjggMSA3OS42OTU5IDUuNDA4NzYgNzguODk3OSA2LjE0NjdDNzguMTI4NCA2Ljg2NTczIDc4LjQ5ODkgMTAuMzM3OSA3OC45ODM0IDEwLjg1ODJDNzkuNDc3NCAxMS4zNzg2IDgzLjY5NTQgMTEuMjc0NSA4My42OTU0IDExLjI3NDVIODMuNzA0OVoiIGZpbGw9IiMyMjcyQkEiLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF84NjczXzU1NCI+CjxyZWN0IHdpZHRoPSI5NSIgaGVpZ2h0PSIzNiIgZmlsbD0id2hpdGUiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K";
2261
+
2259
2262
  // src/components/navigation/FlytedeskBrand.tsx
2260
2263
  import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
2261
- var LOGO_SRC = "https://cdn.prod.website-files.com/69a96def413819b7db64de8c/69ac8ec2ed84b986a5fb76dc_Logo%20(dark)%202.svg";
2262
2264
  function FlytedeskMark({ size = "md", className = "", ...rest }) {
2263
- return /* @__PURE__ */ jsx29("span", { className: ["fd-brand-mark", size !== "md" ? "fd-brand-mark-" + size : "", className].filter(Boolean).join(" "), ...rest, children: /* @__PURE__ */ jsx29("img", { src: LOGO_SRC, alt: "flytedesk" }) });
2265
+ return /* @__PURE__ */ jsx29("span", { className: ["fd-brand-mark", size !== "md" ? "fd-brand-mark-" + size : "", className].filter(Boolean).join(" "), ...rest, children: /* @__PURE__ */ jsx29("img", { src: FLYTEDESK_LOGO_SRC, alt: "flytedesk" }) });
2264
2266
  }
2265
2267
  function FlytedeskBrand({ appName, size = "md", className = "", ...rest }) {
2266
2268
  return /* @__PURE__ */ jsxs21("span", { className: ["fd-brand", size !== "md" ? "fd-brand-" + size : "", className].filter(Boolean).join(" "), ...rest, children: [
@@ -2331,28 +2333,28 @@ function Tabs({ tabs = [], value, onChange, className = "", ...rest }) {
2331
2333
  "data-more-end": more.end ? "true" : void 0,
2332
2334
  ...rest,
2333
2335
  children: tabs.map((t) => {
2334
- const item = typeof t === "string" ? { value: t, label: t } : t;
2336
+ const item2 = typeof t === "string" ? { value: t, label: t } : t;
2335
2337
  return /* @__PURE__ */ jsxs22(
2336
2338
  "button",
2337
2339
  {
2338
2340
  type: "button",
2339
2341
  role: "tab",
2340
2342
  className: "fd-tab",
2341
- "aria-selected": item.value === value,
2342
- onClick: onChange ? () => onChange(item.value) : void 0,
2343
+ "aria-selected": item2.value === value,
2344
+ onClick: onChange ? () => onChange(item2.value) : void 0,
2343
2345
  children: [
2344
- item.label,
2345
- item.count !== void 0 ? /* @__PURE__ */ jsx30(
2346
+ item2.label,
2347
+ item2.count !== void 0 ? /* @__PURE__ */ jsx30(
2346
2348
  "span",
2347
2349
  {
2348
- className: "fd-badge " + (item.tone === "attention" ? "fd-badge-warning" : "fd-badge-neutral"),
2350
+ className: "fd-badge " + (item2.tone === "attention" ? "fd-badge-warning" : "fd-badge-neutral"),
2349
2351
  style: { height: 20, padding: "0 7px" },
2350
- children: item.count
2352
+ children: item2.count
2351
2353
  }
2352
2354
  ) : null
2353
2355
  ]
2354
2356
  },
2355
- item.value
2357
+ item2.value
2356
2358
  );
2357
2359
  })
2358
2360
  }
@@ -2611,7 +2613,7 @@ function ToastProvider({ children }) {
2611
2613
  const timers = React28.useRef(/* @__PURE__ */ new Map());
2612
2614
  const nextId = React28.useRef(1);
2613
2615
  const dismiss = React28.useCallback((id) => {
2614
- setItems((current2) => current2.filter((item) => item.id !== id));
2616
+ setItems((current2) => current2.filter((item2) => item2.id !== id));
2615
2617
  const timer = timers.current.get(id);
2616
2618
  if (timer !== void 0) {
2617
2619
  clearTimeout(timer);
@@ -2637,7 +2639,7 @@ function ToastProvider({ children }) {
2637
2639
  const api = React28.useMemo(() => ({ show }), [show]);
2638
2640
  return /* @__PURE__ */ jsxs31(ToastContext.Provider, { value: api, children: [
2639
2641
  children,
2640
- /* @__PURE__ */ jsx40(CornerStackPortal, { slot: "toasts", children: /* @__PURE__ */ jsx40("div", { className: "fd-toast-region", "aria-live": "polite", children: items.map((item) => /* @__PURE__ */ jsx40(Toast, { title: item.title, tone: item.tone, onDismiss: () => dismiss(item.id) }, item.id)) }) })
2642
+ /* @__PURE__ */ jsx40(CornerStackPortal, { slot: "toasts", children: /* @__PURE__ */ jsx40("div", { className: "fd-toast-region", "aria-live": "polite", children: items.map((item2) => /* @__PURE__ */ jsx40(Toast, { title: item2.title, tone: item2.tone, onDismiss: () => dismiss(item2.id) }, item2.id)) }) })
2641
2643
  ] });
2642
2644
  }
2643
2645
  function useToast() {
@@ -2864,6 +2866,14 @@ var FileKit = {
2864
2866
  toAttachment,
2865
2867
  revokeAttachment
2866
2868
  };
2869
+ function folderFiles(files) {
2870
+ return files.map((file) => {
2871
+ const relative = file.webkitRelativePath;
2872
+ const slash = relative ? relative.indexOf("/") : -1;
2873
+ if (slash < 0) throw new Error(`folderFiles: ${file.name} has no folder path; it did not come from a folder pick.`);
2874
+ return { file, path: relative.slice(slash + 1) };
2875
+ });
2876
+ }
2867
2877
 
2868
2878
  // src/components/data/SegmentedMeter.tsx
2869
2879
  import { jsx as jsx42, jsxs as jsxs32 } from "react/jsx-runtime";
@@ -6618,8 +6628,8 @@ function VirtualList({
6618
6628
  const prev = lastKeysRef.current;
6619
6629
  if (!prev) return /* @__PURE__ */ new Set();
6620
6630
  const fresh = /* @__PURE__ */ new Set();
6621
- for (const item of items) {
6622
- const k = keyOf(item);
6631
+ for (const item2 of items) {
6632
+ const k = keyOf(item2);
6623
6633
  if (!prev.has(k)) fresh.add(k);
6624
6634
  }
6625
6635
  return fresh;
@@ -6633,16 +6643,16 @@ function VirtualList({
6633
6643
  }
6634
6644
  const rows = [];
6635
6645
  for (let i = win.startIndex; i <= win.endIndex; i++) {
6636
- const item = items[i - firstItemIndex];
6637
- if (item === void 0) continue;
6638
- const key = keyOf(item);
6646
+ const item2 = items[i - firstItemIndex];
6647
+ if (item2 === void 0) continue;
6648
+ const key = keyOf(item2);
6639
6649
  rows.push(
6640
6650
  /* @__PURE__ */ jsx68(
6641
6651
  "div",
6642
6652
  {
6643
6653
  className: "fd-vlist-row",
6644
6654
  style: { height: itemHeight, boxSizing: "border-box", transform: "translateY(" + i * itemHeight + "px)" },
6645
- children: /* @__PURE__ */ jsx68("div", { className: newKeys.has(key) ? "fd-vlist-row-content fd-vlist-row-enter" : "fd-vlist-row-content", children: renderItem(item, i) })
6655
+ children: /* @__PURE__ */ jsx68("div", { className: newKeys.has(key) ? "fd-vlist-row-content fd-vlist-row-enter" : "fd-vlist-row-content", children: renderItem(item2, i) })
6646
6656
  },
6647
6657
  key
6648
6658
  )
@@ -6898,15 +6908,15 @@ function TransferList({
6898
6908
  (side, key) => (side === "left" ? left.items : right.items).find((it) => keyOf(it) === key),
6899
6909
  [left.items, right.items, keyOf]
6900
6910
  );
6901
- const beginDrag = (e, item, from) => {
6911
+ const beginDrag = (e, item2, from) => {
6902
6912
  if (e.button !== 0) return;
6903
6913
  if (e.target.closest && e.target.closest("button")) return;
6904
6914
  e.preventDefault();
6905
6915
  const rect = e.currentTarget.getBoundingClientRect();
6906
6916
  armedRef.current = {
6907
- item,
6917
+ item: item2,
6908
6918
  from,
6909
- key: keyOf(item),
6919
+ key: keyOf(item2),
6910
6920
  pointerId: e.pointerId,
6911
6921
  startX: e.clientX,
6912
6922
  startY: e.clientY,
@@ -6956,8 +6966,8 @@ function TransferList({
6956
6966
  if (!wasDragging) return;
6957
6967
  const hit = hitTestSide(e.clientX, e.clientY);
6958
6968
  if (hit && hit !== armed.from) {
6959
- const item = findItem(armed.from, armed.key);
6960
- if (item !== void 0) onMove(item, armed.from, hit);
6969
+ const item2 = findItem(armed.from, armed.key);
6970
+ if (item2 !== void 0) onMove(item2, armed.from, hit);
6961
6971
  }
6962
6972
  };
6963
6973
  window.addEventListener("pointermove", onMovePointer);
@@ -7011,19 +7021,19 @@ function TransferList({
7011
7021
  totalCount: cfg.totalCount,
7012
7022
  onNeedMore: cfg.onNeedMore,
7013
7023
  emptyState: /* @__PURE__ */ jsx72(EmptyState, { icon: "tray", title: "Nothing here" }),
7014
- renderItem: (item) => {
7015
- const isBeingDragged = drag != null && drag.from === side && drag.key === keyOf(item);
7024
+ renderItem: (item2) => {
7025
+ const isBeingDragged = drag != null && drag.from === side && drag.key === keyOf(item2);
7016
7026
  if (isBeingDragged) {
7017
7027
  return /* @__PURE__ */ jsx72("div", { className: "fd-erow-placeholder", "aria-hidden": "true" });
7018
7028
  }
7019
- const content = renderRow(item);
7029
+ const content = renderRow(item2);
7020
7030
  const destination = (side === "left" ? right : left).label || "the other list";
7021
7031
  return /* @__PURE__ */ jsx72(
7022
7032
  EntityRow,
7023
7033
  {
7024
7034
  ...content,
7025
7035
  draggable: true,
7026
- onPointerDown: (e) => beginDrag(e, item, side),
7036
+ onPointerDown: (e) => beginDrag(e, item2, side),
7027
7037
  action: {
7028
7038
  icon: side === "left" ? "plus" : "minus",
7029
7039
  // Names the row AND where it goes. A list repeats this button on every
@@ -7031,7 +7041,7 @@ function TransferList({
7031
7041
  // over to a screen reader, with nothing to tell one button from the next.
7032
7042
  label: "Move " + content.title + " to " + destination,
7033
7043
  tone: side === "left" ? "add" : "remove",
7034
- onClick: () => onMove(item, side, opposite)
7044
+ onClick: () => onMove(item2, side, opposite)
7035
7045
  }
7036
7046
  }
7037
7047
  );
@@ -8072,6 +8082,8 @@ function Dropzone({
8072
8082
  }
8073
8083
  function FilePickButton({
8074
8084
  onFiles,
8085
+ onFolder,
8086
+ directory = false,
8075
8087
  onReject,
8076
8088
  accept,
8077
8089
  maxFileSize,
@@ -8104,10 +8116,14 @@ function FilePickButton({
8104
8116
  accept,
8105
8117
  multiple,
8106
8118
  className: "fd-sr",
8119
+ ...directory ? { webkitdirectory: "" } : {},
8107
8120
  onChange: (e) => {
8108
8121
  const { accepted, rejected } = filterFiles(e.target.files, { accept, maxFileSize });
8109
8122
  if (rejected.length && onReject) onReject(rejected);
8110
- if (accepted.length && onFiles) onFiles(accepted);
8123
+ if (accepted.length) {
8124
+ if (directory) onFolder?.(folderFiles(accepted));
8125
+ else onFiles?.(accepted);
8126
+ }
8111
8127
  e.target.value = "";
8112
8128
  }
8113
8129
  }
@@ -9052,6 +9068,75 @@ function CodeEditor({
9052
9068
  ] });
9053
9069
  }
9054
9070
 
9071
+ // src/components/forms/jsonPath.ts
9072
+ import { EditorState as EditorState3 } from "@codemirror/state";
9073
+ import { json as json2 } from "@codemirror/lang-json";
9074
+ var VALUE_NODES = /* @__PURE__ */ new Set(["Object", "Array", "String", "Number", "True", "False", "Null"]);
9075
+ function valueChild(node) {
9076
+ for (let child = node.firstChild; child; child = child.nextSibling) {
9077
+ if (VALUE_NODES.has(child.name)) return child;
9078
+ }
9079
+ return null;
9080
+ }
9081
+ function member(text, object, key) {
9082
+ let found = null;
9083
+ for (let prop = object.firstChild; prop; prop = prop.nextSibling) {
9084
+ if (prop.name !== "Property") continue;
9085
+ const name = prop.getChild("PropertyName");
9086
+ const value = valueChild(prop);
9087
+ if (name && value && JSON.parse(text.slice(name.from, name.to)) === key) found = { name, value };
9088
+ }
9089
+ return found;
9090
+ }
9091
+ function item(array, index) {
9092
+ let at = 0;
9093
+ for (let child = array.firstChild; child; child = child.nextSibling) {
9094
+ if (VALUE_NODES.has(child.name) && at++ === index) return child;
9095
+ }
9096
+ return null;
9097
+ }
9098
+ function jsonPathPosition(text, path, anchor = "value") {
9099
+ try {
9100
+ JSON.parse(text);
9101
+ } catch (e) {
9102
+ if (e instanceof SyntaxError) return null;
9103
+ throw e;
9104
+ }
9105
+ const doc = EditorState3.create({ doc: text }).doc;
9106
+ const normalized = doc.toString();
9107
+ const root = valueChild(json2().language.parser.parse(normalized).topNode);
9108
+ if (!root) return null;
9109
+ let target = root;
9110
+ let key = null;
9111
+ let exact = true;
9112
+ for (const step of path) {
9113
+ let next = null;
9114
+ if (target.name === "Object" && typeof step === "string") next = member(normalized, target, step);
9115
+ else if (target.name === "Array" && typeof step === "number") {
9116
+ const value = item(target, step);
9117
+ next = value && { name: null, value };
9118
+ }
9119
+ if (!next) {
9120
+ exact = false;
9121
+ break;
9122
+ }
9123
+ target = next.value;
9124
+ key = next.name;
9125
+ }
9126
+ const span = anchor === "key" && exact && key ? key : target;
9127
+ const from = span.from;
9128
+ const to = span.name === "Object" || span.name === "Array" ? span.from + 1 : span.to;
9129
+ const start = doc.lineAt(from);
9130
+ const end = doc.lineAt(to);
9131
+ return {
9132
+ line: start.number,
9133
+ column: from - start.from + 1,
9134
+ endLine: end.number,
9135
+ endColumn: to - end.from + 1,
9136
+ exact
9137
+ };
9138
+ }
9139
+
9055
9140
  // src/components/forms/RadioGroup.tsx
9056
9141
  import * as React62 from "react";
9057
9142
  import { jsx as jsx87, jsxs as jsxs74 } from "react/jsx-runtime";
@@ -9107,18 +9192,18 @@ function useSessionContext() {
9107
9192
  import { Fragment as Fragment22, jsx as jsx89, jsxs as jsxs75 } from "react/jsx-runtime";
9108
9193
  var DEFAULT_LINKS = [];
9109
9194
  var DEFAULT_GROUPS = [];
9110
- function Item({ item, onPick }) {
9195
+ function Item({ item: item2, onPick }) {
9111
9196
  return /* @__PURE__ */ jsxs75(
9112
9197
  "button",
9113
9198
  {
9114
9199
  type: "button",
9115
9200
  role: "menuitem",
9116
9201
  className: "fd-acct-item",
9117
- onClick: () => onPick(item),
9202
+ onClick: () => onPick(item2),
9118
9203
  children: [
9119
- item.icon ? /* @__PURE__ */ jsx89("i", { className: "ph ph-" + item.icon, "aria-hidden": "true" }) : null,
9120
- /* @__PURE__ */ jsx89("span", { style: { flex: 1 }, children: item.label }),
9121
- item.badge ? /* @__PURE__ */ jsx89(Badge, { tone: "neutral", children: item.badge }) : null
9204
+ item2.icon ? /* @__PURE__ */ jsx89("i", { className: "ph ph-" + item2.icon, "aria-hidden": "true" }) : null,
9205
+ /* @__PURE__ */ jsx89("span", { style: { flex: 1 }, children: item2.label }),
9206
+ item2.badge ? /* @__PURE__ */ jsx89(Badge, { tone: "neutral", children: item2.badge }) : null
9122
9207
  ]
9123
9208
  }
9124
9209
  );
@@ -9145,11 +9230,11 @@ function AccountMenu({
9145
9230
  setOpen(false);
9146
9231
  setSignOutError(null);
9147
9232
  };
9148
- const pick = (item) => {
9233
+ const pick = (item2) => {
9149
9234
  closeMenu();
9150
- if (item.onSelect) return item.onSelect();
9151
- if (onNavigate) return onNavigate(item.href, item);
9152
- if (item.href) window.location.href = item.href;
9235
+ if (item2.onSelect) return item2.onSelect();
9236
+ if (onNavigate) return onNavigate(item2.href, item2);
9237
+ if (item2.href) window.location.href = item2.href;
9153
9238
  };
9154
9239
  const signOut = async () => {
9155
9240
  const handler = onSignOut ?? ctxSignOut;
@@ -11807,41 +11892,41 @@ var fmtDate = (iso2) => {
11807
11892
  const d = /* @__PURE__ */ new Date(String(iso2) + "T00:00:00");
11808
11893
  return isNaN(d) ? iso2 : d.toLocaleDateString(void 0, { month: "short", day: "numeric", year: "numeric" });
11809
11894
  };
11810
- function RoadmapCard({ item, byKey, onOpenFlag }) {
11811
- const s = STATUS[item.status] || STATUS.planned;
11812
- const deps = (item.dependsOn || []).map((k) => byKey[k]).filter(Boolean);
11895
+ function RoadmapCard({ item: item2, byKey, onOpenFlag }) {
11896
+ const s = STATUS[item2.status] || STATUS.planned;
11897
+ const deps = (item2.dependsOn || []).map((k) => byKey[k]).filter(Boolean);
11813
11898
  const blocking = deps.filter((d) => !d.implemented);
11814
11899
  return /* @__PURE__ */ jsx96(Card, { elevation: "flat", children: /* @__PURE__ */ jsxs81("div", { className: "fd-stack", style: { gap: 10 }, children: [
11815
11900
  /* @__PURE__ */ jsxs81("div", { className: "fd-row", style: { gap: 8, flexWrap: "wrap" }, children: [
11816
- /* @__PURE__ */ jsx96("span", { className: "fd-body", style: { fontWeight: 700, flex: 1, minWidth: 140 }, children: item.label }),
11817
- /* @__PURE__ */ jsx96(Badge, { tone: "neutral", icon: PROJECT_ICON[item.project] || "squares-four", children: item.project }),
11901
+ /* @__PURE__ */ jsx96("span", { className: "fd-body", style: { fontWeight: 700, flex: 1, minWidth: 140 }, children: item2.label }),
11902
+ /* @__PURE__ */ jsx96(Badge, { tone: "neutral", icon: PROJECT_ICON[item2.project] || "squares-four", children: item2.project }),
11818
11903
  /* @__PURE__ */ jsx96(Badge, { tone: s.tone, icon: s.icon, children: s.label })
11819
11904
  ] }),
11820
- /* @__PURE__ */ jsx96("p", { className: "fd-body-sm fd-secondary", style: { margin: 0, textWrap: "pretty" }, children: item.description }),
11821
- item.backend ? /* @__PURE__ */ jsxs81("div", { className: "fd-row", style: { gap: 10, alignItems: "flex-start" }, children: [
11905
+ /* @__PURE__ */ jsx96("p", { className: "fd-body-sm fd-secondary", style: { margin: 0, textWrap: "pretty" }, children: item2.description }),
11906
+ item2.backend ? /* @__PURE__ */ jsxs81("div", { className: "fd-row", style: { gap: 10, alignItems: "flex-start" }, children: [
11822
11907
  /* @__PURE__ */ jsx96("span", { className: "fd-overline fd-muted", style: { width: 62, flex: "none", paddingTop: 2 }, children: "Backend" }),
11823
- /* @__PURE__ */ jsx96("span", { className: "fd-body-sm", style: { flex: 1, textWrap: "pretty" }, children: item.backend })
11908
+ /* @__PURE__ */ jsx96("span", { className: "fd-body-sm", style: { flex: 1, textWrap: "pretty" }, children: item2.backend })
11824
11909
  ] }) : null,
11825
11910
  /* @__PURE__ */ jsxs81("div", { className: "fd-row", style: { gap: 12, flexWrap: "wrap" }, children: [
11826
- item.effort ? /* @__PURE__ */ jsxs81("span", { className: "fd-body-sm fd-muted", children: [
11911
+ item2.effort ? /* @__PURE__ */ jsxs81("span", { className: "fd-body-sm fd-muted", children: [
11827
11912
  /* @__PURE__ */ jsx96("i", { className: "ph ph-hourglass-medium" }),
11828
11913
  " ",
11829
- item.effort
11914
+ item2.effort
11830
11915
  ] }) : null,
11831
11916
  /* @__PURE__ */ jsxs81("span", { className: "fd-body-sm fd-muted", children: [
11832
11917
  /* @__PURE__ */ jsx96("i", { className: "ph ph-user" }),
11833
11918
  " ",
11834
- item.owner
11919
+ item2.owner
11835
11920
  ] }),
11836
- item.screen ? /* @__PURE__ */ jsx96(Badge, { tone: "neutral", icon: "browser", children: "screen" }) : null,
11921
+ item2.screen ? /* @__PURE__ */ jsx96(Badge, { tone: "neutral", icon: "browser", children: "screen" }) : null,
11837
11922
  /* @__PURE__ */ jsx96("span", { style: { flex: 1 } }),
11838
11923
  /* @__PURE__ */ jsx96(
11839
11924
  "button",
11840
11925
  {
11841
11926
  type: "button",
11842
- onClick: () => onOpenFlag && onOpenFlag(item.key),
11927
+ onClick: () => onOpenFlag && onOpenFlag(item2.key),
11843
11928
  style: { all: "unset", cursor: "pointer", display: "inline-flex", alignItems: "center", gap: 5 },
11844
- children: /* @__PURE__ */ jsx96("code", { className: "fd-mono", style: { fontSize: 11, color: "var(--brand)" }, children: item.key })
11929
+ children: /* @__PURE__ */ jsx96("code", { className: "fd-mono", style: { fontSize: 11, color: "var(--brand)" }, children: item2.key })
11845
11930
  }
11846
11931
  )
11847
11932
  ] }),
@@ -11849,7 +11934,7 @@ function RoadmapCard({ item, byKey, onOpenFlag }) {
11849
11934
  /* @__PURE__ */ jsx96("span", { className: "fd-overline fd-muted", style: { paddingTop: 3 }, children: "After" }),
11850
11935
  deps.map((d) => /* @__PURE__ */ jsx96(Tag, { icon: d.implemented ? "check" : "clock", children: d.label }, d.key))
11851
11936
  ] }) : null,
11852
- blocking.length && !item.implemented ? /* @__PURE__ */ jsxs81("span", { className: "fd-body-sm", style: { color: "var(--warn-text)" }, children: [
11937
+ blocking.length && !item2.implemented ? /* @__PURE__ */ jsxs81("span", { className: "fd-body-sm", style: { color: "var(--warn-text)" }, children: [
11853
11938
  "Blocked until ",
11854
11939
  blocking.map((d) => d.label).join(" and "),
11855
11940
  " ",
@@ -11943,19 +12028,19 @@ function RoadmapTimeline({ onOpenFlag, title = "Roadmap", lede }) {
11943
12028
  ),
11944
12029
  /* @__PURE__ */ jsx96("div", { className: "fd-rm", children: /* @__PURE__ */ jsx96("div", { className: "fd-rm-scroll", ref: scrollRef, children: /* @__PURE__ */ jsxs81("div", { className: "fd-rm-track", children: [
11945
12030
  /* @__PURE__ */ jsx96("span", { className: "fd-rm-spine", children: /* @__PURE__ */ jsx96("span", { className: "fd-rm-spine-done", style: { height: items.length ? 100 * shippedShown / items.length + "%" : "0%" } }) }),
11946
- items.map((item, n) => {
11947
- const showPhase = item.phase !== lastPhase;
11948
- lastPhase = item.phase;
11949
- const inPhase = items.filter((i) => i.phase === item.phase).length;
12031
+ items.map((item2, n) => {
12032
+ const showPhase = item2.phase !== lastPhase;
12033
+ lastPhase = item2.phase;
12034
+ const inPhase = items.filter((i) => i.phase === item2.phase).length;
11950
12035
  const isBoundary = n === firstPending;
11951
12036
  return /* @__PURE__ */ jsxs81(React74.Fragment, { children: [
11952
12037
  showPhase ? /* @__PURE__ */ jsxs81("div", { className: "fd-rm-era", children: [
11953
12038
  /* @__PURE__ */ jsxs81("span", { className: "fd-row", style: { gap: 8, flexWrap: "wrap", alignItems: "baseline" }, children: [
11954
- /* @__PURE__ */ jsx96("span", { style: { fontWeight: 700 }, children: item.phase === 0 ? "Shipped" : "Phase " + item.phase + " \u2014 " + item.phaseName }),
11955
- item.phase === 0 ? null : /* @__PURE__ */ jsxs81("span", { className: "fd-mono", style: { opacity: 0.7, fontWeight: 400 }, children: [
11956
- fmtDate(item.phaseStart),
12039
+ /* @__PURE__ */ jsx96("span", { style: { fontWeight: 700 }, children: item2.phase === 0 ? "Shipped" : "Phase " + item2.phase + " \u2014 " + item2.phaseName }),
12040
+ item2.phase === 0 ? null : /* @__PURE__ */ jsxs81("span", { className: "fd-mono", style: { opacity: 0.7, fontWeight: 400 }, children: [
12041
+ fmtDate(item2.phaseStart),
11957
12042
  " \u2013 ",
11958
- fmtDate(item.date)
12043
+ fmtDate(item2.date)
11959
12044
  ] }),
11960
12045
  /* @__PURE__ */ jsxs81("span", { style: { opacity: 0.7, fontWeight: 400 }, children: [
11961
12046
  "\xB7 ",
@@ -11964,22 +12049,22 @@ function RoadmapTimeline({ onOpenFlag, title = "Roadmap", lede }) {
11964
12049
  inPhase === 1 ? "" : "s"
11965
12050
  ] })
11966
12051
  ] }),
11967
- item.phaseWhy ? /* @__PURE__ */ jsx96("p", { className: "fd-rm-era-why", children: item.phaseWhy }) : null
12052
+ item2.phaseWhy ? /* @__PURE__ */ jsx96("p", { className: "fd-rm-era-why", children: item2.phaseWhy }) : null
11968
12053
  ] }) : null,
11969
12054
  isBoundary ? /* @__PURE__ */ jsx96("div", { className: "fd-rm-now", ref: nowRef, children: /* @__PURE__ */ jsxs81("span", { className: "fd-rm-now-pill", children: [
11970
12055
  /* @__PURE__ */ jsx96("i", { className: "ph ph-map-pin" }),
11971
12056
  " You are here \u2014 everything above is wired"
11972
12057
  ] }) }) : null,
11973
12058
  /* @__PURE__ */ jsxs81("div", { className: "fd-rm-row", children: [
11974
- /* @__PURE__ */ jsx96("span", { className: "fd-rm-dot " + (item.implemented ? "is-shipped" : item.status === "next" ? "is-next" : "") }),
12059
+ /* @__PURE__ */ jsx96("span", { className: "fd-rm-dot " + (item2.implemented ? "is-shipped" : item2.status === "next" ? "is-next" : "") }),
11975
12060
  /* @__PURE__ */ jsxs81("div", { className: "fd-rm-date", children: [
11976
- fmtDate(item.date),
12061
+ fmtDate(item2.date),
11977
12062
  /* @__PURE__ */ jsx96("br", {}),
11978
- /* @__PURE__ */ jsx96("span", { style: { opacity: 0.75 }, children: item.implemented ? "shipped" : "phase " + item.phase })
12063
+ /* @__PURE__ */ jsx96("span", { style: { opacity: 0.75 }, children: item2.implemented ? "shipped" : "phase " + item2.phase })
11979
12064
  ] }),
11980
- /* @__PURE__ */ jsx96(RoadmapCard, { item, byKey, onOpenFlag })
12065
+ /* @__PURE__ */ jsx96(RoadmapCard, { item: item2, byKey, onOpenFlag })
11981
12066
  ] })
11982
- ] }, item.key);
12067
+ ] }, item2.key);
11983
12068
  }),
11984
12069
  !items.length ? /* @__PURE__ */ jsx96("p", { className: "fd-body-sm fd-muted", children: "Nothing matches that filter." }) : null
11985
12070
  ] }) }) }),
@@ -13276,13 +13361,15 @@ function useChatEngine(opts) {
13276
13361
  if (m.role === "assistant") ownAssistants.push(m);
13277
13362
  }
13278
13363
  }
13279
- const progress = ownAssistants.pop();
13364
+ const rowAt = turn?.stored ? ownAssistants.findIndex((m) => m.id === turn.holderId) : ownAssistants.length - 1;
13365
+ const progress = rowAt < 0 ? void 0 : ownAssistants.splice(rowAt, 1)[0];
13280
13366
  const cards = ownAssistants;
13281
13367
  const ids = new Set(server.map((m) => m.id));
13282
13368
  serverCount.current = server.length;
13283
13369
  serverIds.current = ids;
13284
13370
  const settled = server.filter((m) => !ownIds.has(m.id) && !retired.current.has(m.id));
13285
- const local = listRef.current.filter((m) => !ids.has(m.id));
13371
+ const turnOwn = (m) => !!turn?.stored && (m.id === turn.userId || m.id === turn.holderId);
13372
+ const local = listRef.current.filter((m) => turnOwn(m) || !ids.has(m.id));
13286
13373
  const at = local.findIndex((m) => m.id === turn?.holderId);
13287
13374
  const tail = at < 0 ? [...cards, ...local] : [...local.slice(0, at), ...cards, ...local.slice(at)];
13288
13375
  const next = [...settled, ...tail];
@@ -13452,7 +13539,15 @@ function useChatEngine(opts) {
13452
13539
  { id: userId, role: "user", text: turn.text || null, attachments: turn.attachments, pending: true, timestamp: (/* @__PURE__ */ new Date()).toISOString() },
13453
13540
  { id: holderId, role: "assistant", text: "", streaming: !!apiAdapter.streamMessage, working: !apiAdapter.streamMessage, timestamp: (/* @__PURE__ */ new Date()).toISOString() }
13454
13541
  );
13455
- liveTurn.current = { known: new Set(serverIds.current), holderId };
13542
+ const live = { known: new Set(serverIds.current), userId, holderId, stored: false };
13543
+ liveTurn.current = live;
13544
+ const adopt = (stored) => {
13545
+ if (live.stored) return;
13546
+ live.stored = true;
13547
+ 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));
13548
+ live.userId = stored.user_message_id;
13549
+ live.holderId = stored.assistant_message_id;
13550
+ };
13456
13551
  const ac = typeof AbortController !== "undefined" ? new AbortController() : { abort() {
13457
13552
  }, signal: void 0 };
13458
13553
  abortRef.current = ac;
@@ -13461,53 +13556,54 @@ function useChatEngine(opts) {
13461
13556
  let res;
13462
13557
  if (apiAdapter.streamMessage) {
13463
13558
  res = await apiAdapter.streamMessage(id, turn.text, {
13464
- onToken: (chunk) => patch(holderId, (m) => ({ text: (m.text || "") + chunk, streaming: true })),
13559
+ onAccepted: adopt,
13560
+ onToken: (chunk) => patch(live.holderId, (m) => ({ text: (m.text || "") + chunk, streaming: true })),
13465
13561
  // chunks append
13466
- onStep: (step) => patch(holderId, (m) => {
13562
+ onStep: (step) => patch(live.holderId, (m) => {
13467
13563
  const steps = (m.steps || []).slice();
13468
13564
  const at = steps.findIndex((s) => s.id === step.id);
13469
13565
  if (at === -1) steps.push(step);
13470
13566
  else steps[at] = Object.assign({}, steps[at], step);
13471
13567
  return { steps };
13472
13568
  }),
13473
- onThinking: (chunk) => patch(holderId, (m) => ({ thinking: (m.thinking || "") + chunk }))
13569
+ onThinking: (chunk) => patch(live.holderId, (m) => ({ thinking: (m.thinking || "") + chunk }))
13474
13570
  }, ac.signal, turn.attachments && turn.attachments.length ? turn.attachments : void 0);
13475
13571
  } else if (turn.attachments && turn.attachments.length) {
13476
13572
  res = await apiAdapter.sendMessage(id, turn.text, ac.signal, turn.attachments);
13477
13573
  } else {
13478
13574
  res = await apiAdapter.sendMessage(id, turn.text, ac.signal);
13479
13575
  }
13480
- patch(userId, { pending: false });
13576
+ patch(live.userId, { pending: false });
13481
13577
  if (!res) throw new Error("send_failed");
13482
13578
  const r = res;
13483
13579
  if (r.dispatched) {
13484
- patch(holderId, { streaming: false, working: true, jobId: r.job_id, text: r.reply || "" });
13485
- await pollJob(r.job_id, holderId);
13580
+ patch(live.holderId, { streaming: false, working: true, jobId: r.job_id, text: r.reply || "" });
13581
+ await pollJob(r.job_id, live.holderId);
13486
13582
  } else {
13487
- patch(holderId, {
13583
+ patch(live.holderId, {
13488
13584
  streaming: false,
13489
13585
  working: false,
13490
- text: r.reply != null ? r.reply : listRef.current.find((m) => m.id === holderId)?.text || "",
13586
+ text: r.reply != null ? r.reply : listRef.current.find((m) => m.id === live.holderId)?.text || "",
13491
13587
  packet: r.packet,
13492
- steps: r.steps || listRef.current.find((m) => m.id === holderId)?.steps,
13588
+ steps: r.steps || listRef.current.find((m) => m.id === live.holderId)?.steps,
13493
13589
  citations: r.citations,
13494
13590
  usage: r.usage,
13495
13591
  model: r.model,
13496
13592
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
13497
13593
  });
13498
- commit(listRef.current.map((m) => m.id === userId ? { ...m, id: r.user_message_id } : m.id === holderId ? { ...m, id: r.assistant_message_id } : m));
13594
+ adopt(r);
13499
13595
  serverCount.current += 2;
13500
13596
  if (r.packet && onPacket) onPacket(r.packet);
13501
13597
  }
13502
13598
  } catch (err) {
13503
13599
  const aborted = err && (err.name === "AbortError" || err.message === "aborted") || stoppedRef.current;
13504
- patch(userId, { pending: false });
13600
+ patch(live.userId, { pending: false });
13505
13601
  if (aborted) {
13506
- patch(holderId, (m) => ({ streaming: false, working: false, stopped: true, retryable: true, text: m.text || null }));
13602
+ patch(live.holderId, (m) => ({ streaming: false, working: false, stopped: true, retryable: true, text: m.text || null }));
13507
13603
  } else if (!fail(err)) {
13508
- patch(holderId, { streaming: false, working: false, error: err?.message || "send_failed", retryable: true });
13604
+ patch(live.holderId, { streaming: false, working: false, error: err?.message || "send_failed", retryable: true });
13509
13605
  } else {
13510
- commit(listRef.current.filter((m) => m.id !== holderId));
13606
+ commit(listRef.current.filter((m) => m.id !== live.holderId));
13511
13607
  }
13512
13608
  } finally {
13513
13609
  const known = liveTurn.current.known;
@@ -14409,7 +14505,7 @@ function ModelControls({
14409
14505
  }
14410
14506
  flat.push(m);
14411
14507
  });
14412
- const item = (m) => ({
14508
+ const item2 = (m) => ({
14413
14509
  id: m.id,
14414
14510
  label: m.label,
14415
14511
  description: m.description,
@@ -14419,11 +14515,11 @@ function ModelControls({
14419
14515
  shortcut: m.shortcut ? /* @__PURE__ */ jsx111(KeyHint, { keys: m.shortcut, size: "sm" }) : void 0,
14420
14516
  onSelect: () => onModelChange && onModelChange(m.id)
14421
14517
  });
14422
- const items = [{ kind: "section", label: "Models" }].concat(flat.map(item));
14518
+ const items = [{ kind: "section", label: "Models" }].concat(flat.map(item2));
14423
14519
  Object.keys(grouped).forEach((g) => {
14424
- items.push({ id: "grp_" + g, label: g, icon: "stack", submenu: grouped[g].map(item) });
14520
+ items.push({ id: "grp_" + g, label: g, icon: "stack", submenu: grouped[g].map(item2) });
14425
14521
  });
14426
- if (moreModels && moreModels.length) items.push({ id: "more", label: "More models", submenu: moreModels.map(item) });
14522
+ if (moreModels && moreModels.length) items.push({ id: "more", label: "More models", submenu: moreModels.map(item2) });
14427
14523
  if (onFastModeChange) {
14428
14524
  items.push({ kind: "separator" });
14429
14525
  items.push({ kind: "section", label: "Fast mode" });
@@ -16250,6 +16346,7 @@ function createChatAdapter(transport, { onTurnStarted, deadlineMs = CHAT_CALL_DE
16250
16346
  onTurnStarted?.();
16251
16347
  };
16252
16348
  const accepting = {
16349
+ onAccepted: handlers.onAccepted && ((ids) => (markStarted(), handlers.onAccepted(ids))),
16253
16350
  onToken: (chunk) => (markStarted(), handlers.onToken(chunk)),
16254
16351
  onStep: handlers.onStep && ((step) => (markStarted(), handlers.onStep(step))),
16255
16352
  onThinking: handlers.onThinking && ((chunk) => (markStarted(), handlers.onThinking(chunk)))
@@ -16618,6 +16715,7 @@ export {
16618
16715
  extensionOf,
16619
16716
  extractClipboardFiles,
16620
16717
  filterFiles,
16718
+ folderFiles,
16621
16719
  formatAbsolute,
16622
16720
  formatBytes,
16623
16721
  formatClock,
@@ -16640,6 +16738,7 @@ export {
16640
16738
  isUsStateCode,
16641
16739
  isWithinLayerTree,
16642
16740
  jobBucket,
16741
+ jsonPathPosition,
16643
16742
  languageLabel,
16644
16743
  loadPrefs,
16645
16744
  markdownToText,