@mcp-b/react-components 0.68.0 → 0.69.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.
Files changed (64) hide show
  1. package/dist/{AgentComputer-BP9ixGGE.js → AgentComputer-CFJxjMFE.js} +32 -3
  2. package/dist/ComputerFileThumbnail-CXHy127c.js +393 -0
  3. package/dist/{ThinkSchedule-D4Ulsa0-.d.ts → ThinkSchedule-9nzxIoX1.d.ts} +1 -1
  4. package/dist/{Workspace-B9nuTfIi.d.ts → Workspace-mZddFyvP.d.ts} +7 -3
  5. package/dist/{WorkspaceAutomation-C0fghGLi.d.ts → WorkspaceAutomation-hwl6C1aX.d.ts} +2 -2
  6. package/dist/{WorkspaceBrowser-Dz48H-7X.d.ts → WorkspaceBrowser-CNVAKXXZ.d.ts} +4 -11
  7. package/dist/{WorkspaceBrowser-oBJv-Dac.js → WorkspaceBrowser-ojoZy0uO.js} +202 -210
  8. package/dist/{WorkspaceConcept-D46cYerS.d.ts → WorkspaceConcept-DqzfZWws.d.ts} +1 -1
  9. package/dist/{WorkspaceFileCommands-1s9Ol8CG.d.ts → WorkspaceFileCommands-CN2oVUzx.d.ts} +5 -2
  10. package/dist/{WorkspaceFileTransfer-BRD22nW-.d.ts → WorkspaceFileTransfer-D--dVla2.d.ts} +1 -1
  11. package/dist/components/agents-sdk/AgentComputer.d.ts +1 -1
  12. package/dist/components/agents-sdk/AgentComputer.js +1 -1
  13. package/dist/components/agents-sdk/ComputerAppIds.d.ts +15 -0
  14. package/dist/components/agents-sdk/ComputerAppIds.js +14 -0
  15. package/dist/components/agents-sdk/ComputerAutomations.d.ts +23 -14
  16. package/dist/components/agents-sdk/ComputerAutomations.js +437 -354
  17. package/dist/components/agents-sdk/ComputerCalendar.js +16 -15
  18. package/dist/components/agents-sdk/ComputerCustomWallpaper.js +186 -171
  19. package/dist/components/agents-sdk/ComputerFileThumbnail.d.ts +5 -3
  20. package/dist/components/agents-sdk/ComputerFileThumbnail.js +1 -132
  21. package/dist/components/agents-sdk/ComputerFiles.d.ts +4 -6
  22. package/dist/components/agents-sdk/ComputerFiles.js +337 -316
  23. package/dist/components/agents-sdk/ComputerHome.js +1 -1
  24. package/dist/components/agents-sdk/ComputerLayout.d.ts +9 -0
  25. package/dist/components/agents-sdk/ComputerLayout.js +66 -0
  26. package/dist/components/agents-sdk/ComputerNotifications.js +60 -83
  27. package/dist/components/agents-sdk/ComputerScreen.d.ts +12 -6
  28. package/dist/components/agents-sdk/ComputerScreen.js +49 -36
  29. package/dist/components/agents-sdk/ComputerSettings.d.ts +10 -4
  30. package/dist/components/agents-sdk/ComputerSettings.js +92 -72
  31. package/dist/components/agents-sdk/ComputerSpotlight.js +1 -1
  32. package/dist/components/agents-sdk/EmployeeSchedules.d.ts +2 -2
  33. package/dist/components/agents-sdk/ManagerOffice.d.ts +1 -1
  34. package/dist/components/agents-sdk/ThinkSchedule.d.ts +1 -1
  35. package/dist/components/agents-sdk/ThinkScheduleActions.d.ts +1 -1
  36. package/dist/components/agents-sdk/ThinkScheduleBrowser.d.ts +1 -1
  37. package/dist/components/agents-sdk/ThinkScheduleDetail.d.ts +2 -2
  38. package/dist/components/agents-sdk/ThinkScheduleForm.d.ts +1 -1
  39. package/dist/components/agents-sdk/Workspace.d.ts +1 -1
  40. package/dist/components/agents-sdk/Workspace.js +197 -190
  41. package/dist/components/agents-sdk/WorkspaceAutomation.d.ts +1 -1
  42. package/dist/components/agents-sdk/WorkspaceAutomationTable.d.ts +1 -1
  43. package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
  44. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
  45. package/dist/components/agents-sdk/WorkspaceConcept.d.ts +1 -1
  46. package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +1 -1
  47. package/dist/components/agents-sdk/WorkspaceDesktop.d.ts +6 -6
  48. package/dist/components/agents-sdk/WorkspaceDesktop.js +126 -101
  49. package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +2 -10
  50. package/dist/components/agents-sdk/WorkspaceExplorer.js +67 -71
  51. package/dist/components/agents-sdk/WorkspaceFileCommands.d.ts +1 -1
  52. package/dist/components/agents-sdk/WorkspaceFileCommands.js +11 -6
  53. package/dist/components/agents-sdk/WorkspaceFileTransfer.d.ts +1 -1
  54. package/dist/components/agents-sdk/WorkspaceLive.d.ts +1 -1
  55. package/dist/components/agents-sdk/WorkspaceLive.js +7 -5
  56. package/dist/components/agents-sdk/WorkspaceLocalFolder.d.ts +1 -1
  57. package/dist/components/agents-sdk/WorkspacePerson.d.ts +2 -2
  58. package/dist/components/agents-sdk/WorkspaceProject.d.ts +2 -2
  59. package/dist/components/extension/FirstRunSetup.d.ts +2 -2
  60. package/dist/minute-clock-CXpRGCMF.js +35 -0
  61. package/dist/{parts-RXV6GGdB.js → parts-CPVz9l31.js} +1 -1
  62. package/dist/{workspace-concept-panel-BDTBISNO.d.ts → workspace-concept-panel-D1czupvi.d.ts} +1 -1
  63. package/dist/{workspace-quick-look-9V-UFpjj.js → workspace-quick-look-DODjsfhH.js} +79 -251
  64. package/package.json +2 -2
@@ -738,6 +738,13 @@ var ScopedTransition = class {
738
738
  };
739
739
  //#endregion
740
740
  //#region src/components/_internal/agent-computer/store.ts
741
+ /** Whether two layouts say the same thing, field by field. */
742
+ function sameLayout(a, b) {
743
+ return a.activeAppId === b.activeAppId && a.expandedAppId === b.expandedAppId && a.surface === b.surface && a.windows.length === b.windows.length && a.windows.every((window, index) => {
744
+ const other = b.windows[index];
745
+ return window.id === other.id && window.placement === other.placement && window.minimized === other.minimized && (window.bounds === other.bounds || window.bounds !== null && other.bounds !== null && window.bounds.x === other.bounds.x && window.bounds.y === other.bounds.y && window.bounds.width === other.bounds.width && window.bounds.height === other.bounds.height);
746
+ });
747
+ }
741
748
  function sameList(a, b) {
742
749
  return a.length === b.length && a.every((item, index) => Object.is(item, b[index]));
743
750
  }
@@ -874,6 +881,11 @@ var ComputerStore = class {
874
881
  lastInput = -Infinity;
875
882
  focusAfterHide = null;
876
883
  focusAfterRemoval = null;
884
+ /**
885
+ * The layout the host restored, until the first report: a first paint that
886
+ * shows exactly it is not news to the host, which already keeps it.
887
+ */
888
+ restoredLayout;
877
889
  constructor(host, defaultLayout, anchorPrefix) {
878
890
  this.anchorPrefix = anchorPrefix;
879
891
  const { apps, selected } = host;
@@ -882,6 +894,7 @@ var ComputerStore = class {
882
894
  const expanded = defaultLayout?.windows.find((window) => window.id === defaultLayout.expandedAppId && !window.minimized);
883
895
  this.onActiveAppChange = host.onActiveAppChange;
884
896
  this.onLayoutChange = host.onLayoutChange;
897
+ this.restoredLayout = defaultLayout;
885
898
  this.state = {
886
899
  apps,
887
900
  selected,
@@ -1068,7 +1081,7 @@ var ComputerStore = class {
1068
1081
  if (!this.onLayoutChange) return;
1069
1082
  const { openIds, apps, closingIds, closedIds, layouts, minimized, expandedId } = this.state;
1070
1083
  const { activeId, homeShown } = this.view;
1071
- this.onLayoutChange({
1084
+ const layout = {
1072
1085
  windows: openIds.filter((id) => apps.some((app) => app.id === id) && !closingIds.includes(id) && !closedIds.includes(id)).map((id) => ({
1073
1086
  id,
1074
1087
  bounds: layouts.get(id)?.bounds ?? null,
@@ -1078,7 +1091,11 @@ var ComputerStore = class {
1078
1091
  activeAppId: activeId ?? null,
1079
1092
  expandedAppId: expandedId && openIds.includes(expandedId) && apps.some((app) => app.id === expandedId) && !closingIds.includes(expandedId) && !minimized.some((window) => window.id === expandedId) ? expandedId : null,
1080
1093
  surface: homeShown ? "home" : "desktop"
1081
- });
1094
+ };
1095
+ const restored = this.restoredLayout;
1096
+ this.restoredLayout = void 0;
1097
+ if (restored && sameLayout(restored, layout)) return;
1098
+ this.onLayoutChange(layout);
1082
1099
  }
1083
1100
  /**
1084
1101
  * The element an app's zoom starts from and comes back to: its Dock tile
@@ -1943,6 +1960,18 @@ const TEXT_FIELD = "input:not([type=\"checkbox\"], [type=\"radio\"], [type=\"but
1943
1960
  //#endregion
1944
1961
  //#region src/components/_internal/agent-computer/window-actions.ts
1945
1962
  /**
1963
+ * Whether two catalogs draw and behave alike: the same apps in the same
1964
+ * order, each with the same facts and the same parts. Only the icon, a
1965
+ * rendered node, is not compared, so a host that rebuilds its list each
1966
+ * render does not redraw the computer.
1967
+ */
1968
+ function sameApps(left, right) {
1969
+ return left.length === right.length && left.every((app, index) => {
1970
+ const other = right[index];
1971
+ return Object.keys(app).concat(Object.keys(other)).every((key) => key === "icon" || app[key] === other[key] || key === "defaultWindowSize" && app.defaultWindowSize?.width === other.defaultWindowSize?.width && app.defaultWindowSize?.height === other.defaultWindowSize?.height);
1972
+ });
1973
+ }
1974
+ /**
1946
1975
  * Asks a running app to confirm quitting. A rejection keeps the app running,
1947
1976
  * and its reason is returned for the shell to announce.
1948
1977
  */
@@ -2007,7 +2036,7 @@ var WindowActions = class extends PhoneMotion {
2007
2036
  this.onActiveAppChange = onActiveAppChange;
2008
2037
  this.onLayoutChange = onLayoutChange;
2009
2038
  const state = this.state;
2010
- if (apps === state.apps && selected === state.selected) return;
2039
+ if (selected === state.selected && (apps === state.apps || sameApps(apps, state.apps))) return;
2011
2040
  const previous = state.selected;
2012
2041
  const patch = {
2013
2042
  apps,
@@ -0,0 +1,393 @@
1
+ import { desktopArtwork } from "./utils/desktop-artwork.js";
2
+ import { AppIcon } from "./components/foundations/AppIcon.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import * as React from "react";
5
+ import { useState } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { useQuery } from "@tanstack/react-query";
8
+ //#region src/components/_internal/file-grid.tsx
9
+ const OPTION = "[data-workspace-path]";
10
+ const ARROW_KEYS = /* @__PURE__ */ new Set([
11
+ "ArrowDown",
12
+ "ArrowUp",
13
+ "ArrowLeft",
14
+ "ArrowRight"
15
+ ]);
16
+ /** Whether a key or a press is modified, so a view's plain-key handling leaves it alone. */
17
+ function hasModifier(event) {
18
+ return event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
19
+ }
20
+ /** Arrow keys walk the icons the way the Finder does: by geometry, not DOM order. */
21
+ function nextOption(options, index, key) {
22
+ const vertical = key === "ArrowDown" || key === "ArrowUp";
23
+ if (!vertical && key !== "ArrowLeft" && key !== "ArrowRight") return void 0;
24
+ const axis = vertical ? "top" : "left";
25
+ const cross = vertical ? "left" : "top";
26
+ const forward = key === "ArrowDown" || key === "ArrowRight";
27
+ const rects = options.map((option) => option.getBoundingClientRect());
28
+ const current = rects[index];
29
+ const candidates = rects.map((rect, i) => ({
30
+ rect,
31
+ i
32
+ })).filter(({ rect }) => forward ? rect[axis] > current[axis] : rect[axis] < current[axis]);
33
+ if (candidates.length === 0) return void 0;
34
+ const nearest = (forward ? Math.min : Math.max)(...candidates.map(({ rect }) => rect[axis]));
35
+ return candidates.filter(({ rect }) => rect[axis] === nearest).reduce((best, candidate) => Math.abs(candidate.rect[cross] - current[cross]) < Math.abs(best.rect[cross] - current[cross]) ? candidate : best).i;
36
+ }
37
+ /** The Finder's type-to-select pause: a longer gap starts a new name. */
38
+ const TYPE_AHEAD_MS = 1e3;
39
+ /**
40
+ * Typing selects the first object whose name starts with what was typed;
41
+ * repeating one letter steps through that letter's objects. Space joins the
42
+ * name only once typing has begun, so on its own it stays Quick Look.
43
+ */
44
+ function typeAhead(event, typed, collection) {
45
+ const list = event.currentTarget;
46
+ const target = event.target;
47
+ if (event.key.length !== 1 || event.altKey || event.ctrlKey || event.metaKey || event.nativeEvent.isComposing || target !== list && !target.matches(OPTION)) return;
48
+ const text = event.timeStamp - typed.time > TYPE_AHEAD_MS ? "" : typed.text;
49
+ if (event.key === " " && !text) return;
50
+ typed.text = text + event.key.toLocaleLowerCase();
51
+ typed.time = event.timeStamp;
52
+ event.preventDefault();
53
+ const options = [...list.querySelectorAll(OPTION)];
54
+ const names = collection?.names ?? options.map((option) => option.dataset.fileGridName ?? "");
55
+ const current = target === list ? -1 : optionIndex(options, target, collection);
56
+ const first = typed.text[0];
57
+ const cycling = typed.text.length > 1 && typed.text === first.repeat(typed.text.length);
58
+ const indexes = names.map((_, index) => index);
59
+ const order = cycling ? [...indexes.slice(current + 1), ...indexes.slice(0, current + 1)] : indexes;
60
+ const prefix = cycling ? first : typed.text;
61
+ const match = order.find((index) => names[index].toLocaleLowerCase().startsWith(prefix));
62
+ if (match !== void 0) focusOption(options, match, collection);
63
+ }
64
+ /** An option's place among all the objects, drawn or not. */
65
+ function optionIndex(options, option, collection) {
66
+ return collection ? Number(option.ariaPosInSet) - 1 : options.indexOf(option);
67
+ }
68
+ function focusOption(options, index, collection) {
69
+ if (collection) collection.focus(index);
70
+ else options[index]?.focus();
71
+ }
72
+ /**
73
+ * One listbox for every view of file objects — desktop icons, an icon grid, a
74
+ * list of rows. It is one tab stop; arrow keys then move focus by geometry, so
75
+ * the same handler walks a wrapped grid and a single column, and Home/End jump
76
+ * to the ends. In an `aria-multiselectable` grid, Shift with those keys moves
77
+ * focus as well, and the view extends its selection to it. Children are `<li role="none">` wrapping one element spread
78
+ * with `fileGridOption()`. A keydown the host handles first (Escape, Space)
79
+ * calls `preventDefault()` to keep it from moving focus. Typing a name
80
+ * focuses the first object it starts, as the Finder's type-to-select does.
81
+ */
82
+ function FileGrid(t0) {
83
+ const $ = c(16);
84
+ let collection;
85
+ let onKeyDown;
86
+ let onKeyDownCapture;
87
+ let props;
88
+ if ($[0] !== t0) {
89
+ ({onKeyDown, onKeyDownCapture, collection, ...props} = t0);
90
+ $[0] = t0;
91
+ $[1] = collection;
92
+ $[2] = onKeyDown;
93
+ $[3] = onKeyDownCapture;
94
+ $[4] = props;
95
+ } else {
96
+ collection = $[1];
97
+ onKeyDown = $[2];
98
+ onKeyDownCapture = $[3];
99
+ props = $[4];
100
+ }
101
+ let t1;
102
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
103
+ t1 = {
104
+ text: "",
105
+ time: -Infinity
106
+ };
107
+ $[5] = t1;
108
+ } else t1 = $[5];
109
+ const typed = React.useRef(t1);
110
+ let t2;
111
+ if ($[6] !== collection || $[7] !== onKeyDownCapture) {
112
+ t2 = (event) => {
113
+ onKeyDownCapture?.(event);
114
+ if (!event.defaultPrevented) typeAhead(event, typed.current, collection);
115
+ };
116
+ $[6] = collection;
117
+ $[7] = onKeyDownCapture;
118
+ $[8] = t2;
119
+ } else t2 = $[8];
120
+ let t3;
121
+ if ($[9] !== collection || $[10] !== onKeyDown) {
122
+ t3 = (event_0) => {
123
+ onKeyDown?.(event_0);
124
+ if (event_0.defaultPrevented || event_0.altKey || event_0.ctrlKey || event_0.metaKey || event_0.shiftKey && event_0.currentTarget.ariaMultiSelectable !== "true" || !event_0.currentTarget.contains(event_0.target)) return;
125
+ const options = [...event_0.currentTarget.querySelectorAll(OPTION)];
126
+ if (options.length === 0) return;
127
+ const onList = event_0.target === event_0.currentTarget;
128
+ const index = options.indexOf(event_0.target);
129
+ if (index < 0 && !onList) return;
130
+ const count = collection?.names.length ?? options.length;
131
+ const end = event_0.key === "Home" ? 0 : event_0.key === "End" ? count - 1 : onList && ARROW_KEYS.has(event_0.key) ? 0 : void 0;
132
+ if (end !== void 0) {
133
+ event_0.preventDefault();
134
+ focusOption(options, end, collection);
135
+ return;
136
+ }
137
+ const next = nextOption(options, index, event_0.key);
138
+ if (next === void 0) return;
139
+ event_0.preventDefault();
140
+ options[next]?.focus();
141
+ };
142
+ $[9] = collection;
143
+ $[10] = onKeyDown;
144
+ $[11] = t3;
145
+ } else t3 = $[11];
146
+ let t4;
147
+ if ($[12] !== props || $[13] !== t2 || $[14] !== t3) {
148
+ t4 = /* @__PURE__ */ jsx("ul", {
149
+ role: "listbox",
150
+ onKeyDownCapture: t2,
151
+ onKeyDown: t3,
152
+ ...props
153
+ });
154
+ $[12] = props;
155
+ $[13] = t2;
156
+ $[14] = t3;
157
+ $[15] = t4;
158
+ } else t4 = $[15];
159
+ return t4;
160
+ }
161
+ /**
162
+ * The option attributes for one file object: its path, the name typing
163
+ * matches, its selection, and whether it is the grid's single tab stop (the
164
+ * selected object, else the first).
165
+ */
166
+ function fileGridOption({ path, name, selected, tabStop, position }) {
167
+ return {
168
+ role: "option",
169
+ "aria-selected": selected,
170
+ "aria-posinset": position ? position.index + 1 : void 0,
171
+ "aria-setsize": position?.count,
172
+ tabIndex: tabStop ? 0 : -1,
173
+ "data-workspace-path": path,
174
+ "data-file-grid-name": name
175
+ };
176
+ }
177
+ /** An object's generic picture: the Finder's folder or page. */
178
+ function FileGridArtwork(t0) {
179
+ const $ = c(5);
180
+ const { entry, ref } = t0;
181
+ const t1 = entry.type === "directory" ? desktopArtwork.folder : desktopArtwork.document;
182
+ let t2;
183
+ if ($[0] !== t1) {
184
+ t2 = /* @__PURE__ */ jsx(AppIcon.Image, {
185
+ src: t1,
186
+ alt: ""
187
+ });
188
+ $[0] = t1;
189
+ $[1] = t2;
190
+ } else t2 = $[1];
191
+ let t3;
192
+ if ($[2] !== ref || $[3] !== t2) {
193
+ t3 = /* @__PURE__ */ jsx(AppIcon.Root, {
194
+ ref,
195
+ children: t2
196
+ });
197
+ $[2] = ref;
198
+ $[3] = t2;
199
+ $[4] = t3;
200
+ } else t3 = $[4];
201
+ return t3;
202
+ }
203
+ //#endregion
204
+ //#region src/components/agents-sdk/ComputerFileThumbnail.tsx
205
+ /** Files small enough to read for a decoration: an SVG as the image, a text file as its page. */
206
+ const MAX_SVG_BYTES = 1048576;
207
+ const MAX_TEXT_BYTES = 65536;
208
+ const PAGE_CHARACTERS = 2048;
209
+ function thumbnailKind(entry) {
210
+ if (entry.type !== "file") return null;
211
+ if (entry.mimeType === "image/svg+xml") return entry.size <= MAX_SVG_BYTES ? "svg" : null;
212
+ return (entry.mimeType.startsWith("text/") || entry.mimeType === "application/json" || entry.mimeType === "application/javascript") && entry.size <= MAX_TEXT_BYTES ? "text" : null;
213
+ }
214
+ /**
215
+ * Whether the element has come near the viewport yet. It latches: a
216
+ * thumbnail read once scrolled into view stays read.
217
+ */
218
+ function useSeen() {
219
+ const $ = c(5);
220
+ const [seen, setSeen] = useState(false);
221
+ let t0;
222
+ if ($[0] !== seen) {
223
+ t0 = (element) => {
224
+ if (!element || seen) return;
225
+ const observer = new IntersectionObserver((records) => {
226
+ if (!records.some(_temp)) return;
227
+ observer.disconnect();
228
+ setSeen(true);
229
+ }, { rootMargin: "25%" });
230
+ observer.observe(element);
231
+ return () => observer.disconnect();
232
+ };
233
+ $[0] = seen;
234
+ $[1] = t0;
235
+ } else t0 = $[1];
236
+ const observe = t0;
237
+ let t1;
238
+ if ($[2] !== observe || $[3] !== seen) {
239
+ t1 = [observe, seen];
240
+ $[2] = observe;
241
+ $[3] = seen;
242
+ $[4] = t1;
243
+ } else t1 = $[4];
244
+ return t1;
245
+ }
246
+ function _temp(record) {
247
+ return record.isIntersecting;
248
+ }
249
+ /**
250
+ * A desktop or Finder thumbnail drawn from the file itself, the way Finder
251
+ * draws one: an SVG shows as the image, a text file as a page of its text.
252
+ * Every other entry, and one whose read has not come back, draws its kind's
253
+ * generic folder or page. The file is read once it nears the viewport, under
254
+ * a key of its own version, so listing refreshes never read it again.
255
+ */
256
+ function ComputerFileThumbnail(t0) {
257
+ const $ = c(36);
258
+ const { entry, source, sourceKey } = t0;
259
+ let t1;
260
+ if ($[0] !== entry) {
261
+ t1 = thumbnailKind(entry);
262
+ $[0] = entry;
263
+ $[1] = t1;
264
+ } else t1 = $[1];
265
+ const kind = t1;
266
+ const [observe, seen] = useSeen();
267
+ let t2;
268
+ if ($[2] !== entry.path || $[3] !== entry.size || $[4] !== entry.updatedAt || $[5] !== sourceKey) {
269
+ t2 = [
270
+ "workspace-thumbnail",
271
+ sourceKey,
272
+ entry.path,
273
+ entry.updatedAt,
274
+ entry.size
275
+ ];
276
+ $[2] = entry.path;
277
+ $[3] = entry.size;
278
+ $[4] = entry.updatedAt;
279
+ $[5] = sourceKey;
280
+ $[6] = t2;
281
+ } else t2 = $[6];
282
+ let t3;
283
+ if ($[7] !== entry.path || $[8] !== source) {
284
+ t3 = () => source.readFile(entry.path);
285
+ $[7] = entry.path;
286
+ $[8] = source;
287
+ $[9] = t3;
288
+ } else t3 = $[9];
289
+ const t4 = kind !== null && seen;
290
+ let t5;
291
+ if ($[10] !== t2 || $[11] !== t3 || $[12] !== t4) {
292
+ t5 = {
293
+ queryKey: t2,
294
+ queryFn: t3,
295
+ enabled: t4,
296
+ staleTime: Infinity,
297
+ retry: false
298
+ };
299
+ $[10] = t2;
300
+ $[11] = t3;
301
+ $[12] = t4;
302
+ $[13] = t5;
303
+ } else t5 = $[13];
304
+ const content = useQuery(t5).data;
305
+ const svg = kind === "svg" && content ? `data:image/svg+xml,${encodeURIComponent(content)}` : null;
306
+ if (!kind || !content) {
307
+ const t6 = kind ? observe : void 0;
308
+ let t7;
309
+ if ($[14] !== entry || $[15] !== t6) {
310
+ t7 = /* @__PURE__ */ jsx(FileGridArtwork, {
311
+ entry,
312
+ ref: t6
313
+ });
314
+ $[14] = entry;
315
+ $[15] = t6;
316
+ $[16] = t7;
317
+ } else t7 = $[16];
318
+ return t7;
319
+ }
320
+ if (svg) {
321
+ let t6;
322
+ if ($[17] !== observe || $[18] !== svg) {
323
+ t6 = /* @__PURE__ */ jsx("img", {
324
+ ref: observe,
325
+ src: svg,
326
+ alt: "",
327
+ width: "64",
328
+ height: "64"
329
+ });
330
+ $[17] = observe;
331
+ $[18] = svg;
332
+ $[19] = t6;
333
+ } else t6 = $[19];
334
+ return t6;
335
+ }
336
+ let lines;
337
+ let t6;
338
+ let t7;
339
+ let t8;
340
+ if ($[20] !== content || $[21] !== observe) {
341
+ const [t9, ...t10] = content.slice(0, PAGE_CHARACTERS).split("\n");
342
+ lines = t10;
343
+ const title = t9 === void 0 ? "" : t9;
344
+ t7 = observe;
345
+ t8 = "computer-file-thumbnail";
346
+ let t11;
347
+ if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
348
+ t11 = /^# /;
349
+ $[26] = t11;
350
+ } else t11 = $[26];
351
+ t6 = title.replace(t11, "");
352
+ $[20] = content;
353
+ $[21] = observe;
354
+ $[22] = lines;
355
+ $[23] = t6;
356
+ $[24] = t7;
357
+ $[25] = t8;
358
+ } else {
359
+ lines = $[22];
360
+ t6 = $[23];
361
+ t7 = $[24];
362
+ t8 = $[25];
363
+ }
364
+ let t9;
365
+ if ($[27] !== t6) {
366
+ t9 = /* @__PURE__ */ jsx("strong", { children: t6 });
367
+ $[27] = t6;
368
+ $[28] = t9;
369
+ } else t9 = $[28];
370
+ const t10 = lines.join("\n");
371
+ let t11;
372
+ if ($[29] !== t10) {
373
+ t11 = /* @__PURE__ */ jsx("span", { children: t10 });
374
+ $[29] = t10;
375
+ $[30] = t11;
376
+ } else t11 = $[30];
377
+ let t12;
378
+ if ($[31] !== t11 || $[32] !== t7 || $[33] !== t8 || $[34] !== t9) {
379
+ t12 = /* @__PURE__ */ jsxs("span", {
380
+ ref: t7,
381
+ className: t8,
382
+ children: [t9, t11]
383
+ });
384
+ $[31] = t11;
385
+ $[32] = t7;
386
+ $[33] = t8;
387
+ $[34] = t9;
388
+ $[35] = t12;
389
+ } else t12 = $[35];
390
+ return t12;
391
+ }
392
+ //#endregion
393
+ export { hasModifier as a, fileGridOption as i, FileGrid as n, FileGridArtwork as r, ComputerFileThumbnail as t };
@@ -1,5 +1,5 @@
1
1
  import { t as ThinkExecutionRun } from "./ThinkExecutionRun-QzZVWX75.js";
2
- import { i as WorkspaceAutomationInvocation } from "./WorkspaceAutomation-C0fghGLi.js";
2
+ import { i as WorkspaceAutomationInvocation } from "./WorkspaceAutomation-hwl6C1aX.js";
3
3
  import { ParsedDeclaredSchedule, ThinkScheduledTask, ThinkScheduledTaskSchedule } from "@cloudflare/think";
4
4
  import { Schedule } from "agents";
5
5
  //#region src/components/agents-sdk/ThinkSchedule.d.ts
@@ -84,7 +84,11 @@ declare function workspaceDirectoryQueryKey(sourceKey: string, root: string, pat
84
84
  type WorkspaceDirectoryQueryKey = ReturnType<typeof workspaceDirectoryQueryKey>;
85
85
  declare function workspaceFileQueryKey(sourceKey: string, root: string, requestedPath: string): readonly ["workspace", string, string, "file", string];
86
86
  type WorkspaceFileQueryKey = ReturnType<typeof workspaceFileQueryKey>;
87
- declare function workspaceInfoQueryKey(sourceKey: string, root: string): readonly ["workspace", string, string, "info"];
87
+ /**
88
+ * The source's summary. It does not depend on the root and each read is a
89
+ * whole-workspace aggregate, so every root of one source shares it.
90
+ */
91
+ declare function workspaceInfoQueryKey(sourceKey: string): readonly ["workspace", string, "info"];
88
92
  declare function workspaceFileVersion(target: WorkspaceFileReadTarget): {
89
93
  readonly path: string;
90
94
  readonly name: string;
@@ -97,7 +101,7 @@ declare function workspaceFileVersion(target: WorkspaceFileReadTarget): {
97
101
  };
98
102
  type WorkspaceFileVersion = ReturnType<typeof workspaceFileVersion>;
99
103
  type WorkspaceDirectoryQueryOptions = WorkspaceQueryOptions<readonly FileInfo[], WorkspaceDirectoryQueryKey>;
100
- type WorkspaceInfoQueryKey = readonly [...WorkspaceQueryKey, "info"];
104
+ type WorkspaceInfoQueryKey = ReturnType<typeof workspaceInfoQueryKey>;
101
105
  type WorkspaceInfoQueryOptions = WorkspaceQueryOptions<WorkspaceInfo, WorkspaceInfoQueryKey>;
102
106
  type WorkspaceFileStatQueryKey = readonly [...WorkspaceFileQueryKey, "stat"];
103
107
  type WorkspaceFileStatQueryOptions = WorkspaceQueryOptions<WorkspaceFileReadTarget, WorkspaceFileStatQueryKey>;
@@ -112,7 +116,7 @@ type WorkspaceBinaryFileQueryOptions = WorkspaceQueryOptions<WorkspaceResolvedAs
112
116
  /** Shared directory options for workspace components and route loaders. */
113
117
  declare function workspaceDirectoryQueryOptions(source: WorkspaceSource, sourceKey: string, root: string, path: string): WorkspaceDirectoryQueryOptions;
114
118
  /** Shared workspace-summary options for workspace components and route loaders. */
115
- declare function workspaceInfoQueryOptions(source: WorkspaceSource, sourceKey: string, root: string): WorkspaceInfoQueryOptions;
119
+ declare function workspaceInfoQueryOptions(source: WorkspaceSource, sourceKey: string): WorkspaceInfoQueryOptions;
116
120
  /** Re-stat and validate a requested path before any resolver or file read. */
117
121
  declare function workspaceFileStatQueryOptions(source: WorkspaceSource, sourceKey: string, root: string, requestedPath: string): WorkspaceFileStatQueryOptions;
118
122
  /** Optional host asset resolution, scoped to the current stat result. */
@@ -1,5 +1,5 @@
1
- import { t as WorkspaceConceptQueryOptions } from "./WorkspaceConcept-D46cYerS.js";
2
- import { n as WorkspaceConceptPanelProps, t as WorkspaceConceptFileProps } from "./workspace-concept-panel-BDTBISNO.js";
1
+ import { t as WorkspaceConceptQueryOptions } from "./WorkspaceConcept-DqzfZWws.js";
2
+ import { n as WorkspaceConceptPanelProps, t as WorkspaceConceptFileProps } from "./workspace-concept-panel-D1czupvi.js";
3
3
  import { a as ExecutionTrace, r as ExecutionGraph } from "./ExecutionBoard-DBj1Aiva.js";
4
4
  import * as React from "react";
5
5
  import { JSONValue } from "ai";
@@ -1,6 +1,6 @@
1
- import { b as WorkspaceState } from "./Workspace-B9nuTfIi.js";
2
- import { r as WorkspaceDragAndDrop } from "./WorkspaceFileTransfer-BRD22nW-.js";
3
- import { i as WorkspaceFileCommands, n as WorkspaceFileCommand } from "./WorkspaceFileCommands-1s9Ol8CG.js";
1
+ import { b as WorkspaceState } from "./Workspace-mZddFyvP.js";
2
+ import { r as WorkspaceDragAndDrop } from "./WorkspaceFileTransfer-D--dVla2.js";
3
+ import { i as WorkspaceFileCommands, n as WorkspaceFileCommand } from "./WorkspaceFileCommands-CN2oVUzx.js";
4
4
  import * as React from "react";
5
5
  import { FileInfo } from "@cloudflare/shell";
6
6
  //#region src/components/agents-sdk/WorkspaceBrowser.d.ts
@@ -47,13 +47,6 @@ interface WorkspaceBrowserProps {
47
47
  onDirectoryOpen?: (path: string) => void;
48
48
  /** App-owned anchor or router Link for a file destination. */
49
49
  renderFileLink?: (path: string) => React.ReactElement;
50
- /**
51
- * An entry's leading mark, when the host can draw the content itself: Finder
52
- * and Files both show an image's own thumbnail there in place of the generic
53
- * page. Returning nothing for an entry leaves it the default icon. The mark
54
- * sits in the row's icon slot, so it takes the row's icon size.
55
- */
56
- renderThumbnail?: (entry: FileInfo) => React.ReactNode;
57
50
  /**
58
51
  * In the list and grid layouts, rows drag, and the folder and its folders
59
52
  * take drops, as a Finder window does. A folder held under a drag opens
@@ -84,6 +77,6 @@ interface WorkspaceBrowserActions {
84
77
  run(command: WorkspaceFileCommand): void;
85
78
  }
86
79
  /** Workspace tree and filter surface, usable independently from the file preview. */
87
- declare function WorkspaceBrowser({ workspace, header, title, leading, actions, showFilter, filterPlaceholder, filter, onFilterChange, emptyState, onDirectoryOpen, renderFileLink, renderThumbnail, layout, sort, dragAndDrop, commands, renderPreview, actionsRef }: WorkspaceBrowserProps): React.JSX.Element;
80
+ declare function WorkspaceBrowser({ workspace, header, title, leading, actions, showFilter, filterPlaceholder, filter, onFilterChange, emptyState, onDirectoryOpen, renderFileLink, layout, sort, dragAndDrop, commands, renderPreview, actionsRef }: WorkspaceBrowserProps): React.JSX.Element;
88
81
  //#endregion
89
82
  export { WorkspaceBrowserSort as i, WorkspaceBrowserActions as n, WorkspaceBrowserProps as r, WorkspaceBrowser as t };