@valbuild/shared 0.152.0 → 0.153.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.
@@ -7,12 +7,11 @@ var VAL_AI_SESSION_STORAGE_KEY = "val-ai-session";
7
7
 
8
8
  /**
9
9
  * A quick preview: a proposal's page, running the proposal's CLIENT code
10
- * built in the design tab, without a build being uploaded or served
11
- * (valbuild/home `docs/design-tab.md`).
10
+ * built in the Studio, without a build being uploaded or served.
12
11
  *
13
12
  * A full build of a proposal bundles the app for the server and the browser,
14
13
  * uploads it, and has the platform render every page before it is served --
15
- * minutes. Most of what the design tab changes is components and styles,
14
+ * minutes. Most of what the assistant changes is components and styles,
16
15
  * which the browser half alone shows. So the tab bundles the app in its
17
16
  * builder worker, and a service worker on the proposal's address hands the
18
17
  * page that bundle instead of the served one:
@@ -30,7 +29,7 @@ var VAL_AI_SESSION_STORAGE_KEY = "val-ai-session";
30
29
  * 4. It takes it over by RENDERING it, not by hydrating it. Hydration keeps
31
30
  * the markup the server sent wherever only an attribute differs -- React
32
31
  * mends text, never a `className` -- so a change to classes and props,
33
- * which is most of what the design tab changes, hydrated into the old
32
+ * which is most of what the assistant changes, hydrated into the old
34
33
  * page and showed nothing. The worker adds a script to the end of that
35
34
  * document's `<body>` ({@link QUICK_PREVIEW_RENDER_SCRIPT}) that takes the
36
35
  * server's markup out before the app's scripts run, so hydration finds
@@ -185,114 +184,6 @@ function withQuickPreviewParam(url, id) {
185
184
  return parsed.toString();
186
185
  }
187
186
 
188
- /**
189
- * The one origin allowed to send this page a quick preview: the site's, where
190
- * the design tab is, as this page's own Val server says it (the proposals
191
- * list's `siteUrl`). `null` when it does not say.
192
- *
193
- * A quick preview is code that runs on this address, so the bridge takes one
194
- * only from its parent, and only when that parent is the site: a page that
195
- * framed this one could otherwise post a script into the worker and open
196
- * the frame on it.
197
- */
198
- function quickPreviewSiteOrigin(_x4) {
199
- return _quickPreviewSiteOrigin.apply(this, arguments);
200
- }
201
-
202
- /** The site's origin, as this page's server named it: asked once per page. */
203
- function _quickPreviewSiteOrigin() {
204
- _quickPreviewSiteOrigin = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(api) {
205
- var fetchImpl,
206
- res,
207
- body,
208
- siteUrl,
209
- _args2 = arguments;
210
- return _regenerator().w(function (_context2) {
211
- while (1) switch (_context2.p = _context2.n) {
212
- case 0:
213
- fetchImpl = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : fetch;
214
- _context2.n = 1;
215
- return fetchImpl("".concat(api.replace(/\/+$/, ""), "/proposals-api"), {
216
- credentials: "same-origin",
217
- headers: {
218
- Accept: "application/json"
219
- }
220
- });
221
- case 1:
222
- res = _context2.v;
223
- if (res.ok) {
224
- _context2.n = 2;
225
- break;
226
- }
227
- return _context2.a(2, null);
228
- case 2:
229
- _context2.n = 3;
230
- return res.json();
231
- case 3:
232
- body = _context2.v;
233
- if (!(_typeof(body) !== "object" || body === null || !("siteUrl" in body))) {
234
- _context2.n = 4;
235
- break;
236
- }
237
- return _context2.a(2, null);
238
- case 4:
239
- siteUrl = body.siteUrl;
240
- if (!(typeof siteUrl !== "string")) {
241
- _context2.n = 5;
242
- break;
243
- }
244
- return _context2.a(2, null);
245
- case 5:
246
- _context2.p = 5;
247
- return _context2.a(2, new URL(siteUrl).origin);
248
- case 6:
249
- _context2.p = 6;
250
- _context2.v;
251
- return _context2.a(2, null);
252
- }
253
- }, _callee2, null, [[5, 6]]);
254
- }));
255
- return _quickPreviewSiteOrigin.apply(this, arguments);
256
- }
257
- var siteOriginOnce = null;
258
-
259
- /**
260
- * Whether `origin` may ask this page for what only the design tab should
261
- * have -- what is on it (`readPage`), or code to run (`quickPreview`): this
262
- * page's own origin (the Studio's canvas), or the site's, where the design
263
- * tab is ({@link quickPreviewSiteOrigin}). Asked of the server once, and
264
- * again only while it has not said.
265
- */
266
- function isDesignTabOrigin(_x5, _x6) {
267
- return _isDesignTabOrigin.apply(this, arguments);
268
- }
269
- function _isDesignTabOrigin() {
270
- _isDesignTabOrigin = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(origin, options) {
271
- var site;
272
- return _regenerator().w(function (_context3) {
273
- while (1) switch (_context3.n) {
274
- case 0:
275
- if (!(origin === options.own)) {
276
- _context3.n = 1;
277
- break;
278
- }
279
- return _context3.a(2, true);
280
- case 1:
281
- siteOriginOnce !== null && siteOriginOnce !== void 0 ? siteOriginOnce : siteOriginOnce = quickPreviewSiteOrigin(options.api, options.fetchImpl)["catch"](function () {
282
- return null;
283
- });
284
- _context3.n = 2;
285
- return siteOriginOnce;
286
- case 2:
287
- site = _context3.v;
288
- if (site === null) siteOriginOnce = null;
289
- return _context3.a(2, site !== null && site === origin);
290
- }
291
- }, _callee3);
292
- }));
293
- return _isDesignTabOrigin.apply(this, arguments);
294
- }
295
-
296
187
  /** Marks a page load as the studio's canvas frame. */
297
188
  var VAL_CANVAS_PARAM = "val_canvas";
298
189
 
@@ -339,7 +230,7 @@ function isValCanvasPageMessage(data) {
339
230
  if (_typeof(data) !== "object" || data === null) return false;
340
231
  var message = data;
341
232
  if (message.val !== VAL_CANVAS_MESSAGE) return false;
342
- return message.type === "ready" && isModulePathList(data.holds) && isHeldVersions(data.holdsVersions) || message.type === "elements" || message.type === "clicked" || message.type === "pinch" || message.type === "zoom" || message.type === "refreshing" || message.type === "elementPickingStopped" || message.type === "elementPicked" && isPickedElement(data.element) || message.type === "location" && isPageLocation(data) || message.type === "pageRead" && typeof data.requestId === "string" || message.type === "pageScreenshot" && typeof data.requestId === "string" || message.type === "quickPreviewStored" && typeof data.id === "string";
233
+ return message.type === "ready" && isModulePathList(data.holds) && isHeldVersions(data.holdsVersions) || message.type === "elements" || message.type === "clicked" || message.type === "pinch" || message.type === "zoom" || message.type === "refreshing" || message.type === "elementPickingStopped" || message.type === "pickingStopped" || message.type === "elementPicked" && isPickedElement(data.element) || message.type === "location" && isPageLocation(data) || message.type === "pageRead" && typeof data.requestId === "string" || message.type === "pageScreenshot" && typeof data.requestId === "string" || message.type === "quickPreviewStored" && typeof data.id === "string";
343
234
  }
344
235
 
345
236
  /** `holdsVersions` on `ready`: absent, or a version per module path. */
@@ -402,7 +293,7 @@ function isValCanvasStudioMessage(data) {
402
293
  }
403
294
  if (message.type === "pickElements") {
404
295
  var pick = data;
405
- return typeof pick.enabled === "boolean" && typeof pick.active === "boolean" && typeof pick.keepPicked === "boolean" && PICK_MODIFIERS.includes(pick.modifier);
296
+ return typeof pick.enabled === "boolean" && typeof pick.active === "boolean" && typeof pick.keepPicked === "boolean" && PICK_MODIFIERS.includes(pick.modifier) && (pick.fieldsOnly === undefined || typeof pick.fieldsOnly === "boolean") && (pick.color === undefined || isCanvasSelectionColor(pick.color));
406
297
  }
407
298
  if (message.type === "scrollTo") {
408
299
  var scroll = data;
@@ -465,9 +356,9 @@ function withValCanvasParam(url) {
465
356
  /**
466
357
  * Pointing at anything on a page, as Lovable's picker does: hover outlines
467
358
  * the element under the pointer, a click picks it, and the assistant is told
468
- * which (valbuild/home `docs/design-tab.md`).
359
+ * which.
469
360
  *
470
- * ANY element, not only what Val marks. The design tab changes code, and the
361
+ * ANY element, not only what Val marks. The assistant changes code, and the
471
362
  * thing a person wants changed is as often a wrapper, a gap or a button as a
472
363
  * field -- so a field's path is extra information when there is one
473
364
  * (`valPath`), never the condition for picking.
@@ -478,9 +369,8 @@ function withValCanvasParam(url) {
478
369
  *
479
370
  * Plain DOM, nothing of React's or the Studio's, and in `shared` because
480
371
  * both halves need it: the canvas bridge (`@valbuild/next`,
481
- * `@valbuild/tanstack`) runs it inside the proposal's page, which is another
482
- * origin than the design tab and the only place the page's elements can be
483
- * reached; the Studio's stories run it on a page of their own. Only the
372
+ * `@valbuild/tanstack`) runs it inside the page, the only place the page's
373
+ * elements can be reached; the Studio's stories run it on a page of their own. Only the
484
374
  * `PickedElement` crosses the frame (`valCanvasProtocol.ts`).
485
375
  */
486
376
 
@@ -561,8 +451,15 @@ function attachElementPicker(root, options) {
561
451
  var picking = function picking(event) {
562
452
  return options.active() || held(event, options.modifier);
563
453
  };
454
+ var pickable = function pickable(element) {
455
+ var _options$fieldsOnly;
456
+ if (element === null || !root.contains(element)) return null;
457
+ if (((_options$fieldsOnly = options.fieldsOnly) === null || _options$fieldsOnly === void 0 ? void 0 : _options$fieldsOnly.call(options)) !== true) return element;
458
+ var field = element.closest("[data-val-path]");
459
+ return field !== null && root.contains(field) ? field : null;
460
+ };
564
461
  var target = function target(event) {
565
- return event.target instanceof Element && root.contains(event.target) ? event.target : null;
462
+ return pickable(event.target instanceof Element ? event.target : null);
566
463
  };
567
464
  var onMove = function onMove(event) {
568
465
  last = {
@@ -623,8 +520,7 @@ function attachElementPicker(root, options) {
623
520
  return;
624
521
  }
625
522
  if (last === null) return;
626
- var under = root.ownerDocument.elementFromPoint(last.x, last.y);
627
- options.onHover(under !== null && root.contains(under) ? under : null);
523
+ options.onHover(pickable(root.ownerDocument.elementFromPoint(last.x, last.y)));
628
524
  };
629
525
  var onLeave = function onLeave() {
630
526
  last = null;
@@ -726,7 +622,9 @@ function createPickerOverlay(doc, initialColor) {
726
622
  left: "".concat(rect.left - 2, "px"),
727
623
  width: "".concat(rect.width + 4, "px"),
728
624
  height: "".concat(rect.height + 4, "px"),
729
- border: "2px ".concat(kind === "hover" ? "solid" : "dashed", " ").concat(color)
625
+ // Dashed, both: it is what the assistant is pointed at, and the
626
+ // canvas's own field outlines -- Content's Select -- are solid.
627
+ border: "2px dashed ".concat(color)
730
628
  });
731
629
  if (kind === "hover") {
732
630
  label.textContent = elementLabel(element);
@@ -797,6 +695,7 @@ function startElementPicking(root, options) {
797
695
  var detach = attachElementPicker(root, {
798
696
  modifier: options.modifier,
799
697
  active: options.active,
698
+ fieldsOnly: options.fieldsOnly,
800
699
  onHover: function onHover(element) {
801
700
  return overlay.show("hover", element);
802
701
  },
@@ -1179,9 +1078,8 @@ function selectorOf(element, root) {
1179
1078
  * `screenshot_page`, so it can see a change it made rather than only read it
1180
1079
  * (`read_page` gives the words and the boxes).
1181
1080
  *
1182
- * Taken HERE because nothing else can: the design tab is another origin than
1183
- * the proposal's page in its frame, and a browser lets no page photograph a
1184
- * frame of another origin. So the bridge renders its own document --
1081
+ * Taken HERE, in the page: a browser lets no page photograph a frame, so
1082
+ * the bridge renders its own document --
1185
1083
  * `modern-screenshot` draws the DOM, with its computed styles, fonts and
1186
1084
  * same-origin images, into a canvas -- and hands back a JPEG.
1187
1085
  *
@@ -1546,4 +1444,4 @@ function getPatternFromModuleFilePath(moduleFilePath, srcFolder) {
1546
1444
  .replace("/page.val.ts", "").replace("/page.val.js", "");
1547
1445
  }
1548
1446
 
1549
- export { storeQuickPreview as A, withQuickPreviewParam as B, quickPreviewSiteOrigin as C, DEFAULT_CANVAS_SELECTION as D, isDesignTabOrigin as E, parseRoutePattern as F, formatRoutePattern as G, getNextAppRouterSourceFolder as H, getTanStackRouterSourceFolder as I, getPageRouterSourceFolder as J, isTanStackRoutesFolder as K, getPageRouterSitemapTree as L, getPatternFromModuleFilePath as M, QUICK_PREVIEW_PARAM as Q, VAL_CONFIG_SESSION_STORAGE_KEY as V, VAL_THEME_SESSION_STORAGE_KEY as a, VAL_AI_SESSION_STORAGE_KEY as b, VAL_CANVAS_PARAM as c, VAL_CANVAS_MESSAGE as d, DEFAULT_CANVAS_SELECTION_SOFT as e, isValCanvasStudioMessage as f, isValCanvasFrame as g, describeElement as h, isValCanvasPageMessage as i, attachElementPicker as j, createPickerOverlay as k, elementLabel as l, modifierLabel as m, watchPageLocation as n, readPageSnapshot as o, pageLocationOf as p, findBySelector as q, restoreScroll as r, startElementPicking as s, screenshotPage as t, QUICK_PREVIEW_SERVICE_WORKER_PATH as u, QUICK_PREVIEW_RENDER_SCRIPT as v, withValCanvasParam as w, QUICK_PREVIEW_STORE_MESSAGE as x, isQuickPreviewFiles as y, QUICK_PREVIEW_SERVICE_WORKER_SOURCE as z };
1447
+ export { QUICK_PREVIEW_SERVICE_WORKER_SOURCE as A, storeQuickPreview as B, withQuickPreviewParam as C, DEFAULT_CANVAS_SELECTION as D, parseRoutePattern as E, formatRoutePattern as F, getNextAppRouterSourceFolder as G, getTanStackRouterSourceFolder as H, getPageRouterSourceFolder as I, isTanStackRoutesFolder as J, getPageRouterSitemapTree as K, getPatternFromModuleFilePath as L, QUICK_PREVIEW_PARAM as Q, VAL_CONFIG_SESSION_STORAGE_KEY as V, VAL_THEME_SESSION_STORAGE_KEY as a, VAL_AI_SESSION_STORAGE_KEY as b, VAL_CANVAS_PARAM as c, VAL_CANVAS_MESSAGE as d, DEFAULT_CANVAS_SELECTION_SOFT as e, isCanvasSelectionColor as f, isValCanvasStudioMessage as g, isValCanvasFrame as h, isValCanvasPageMessage as i, describeElement as j, attachElementPicker as k, createPickerOverlay as l, modifierLabel as m, elementLabel as n, watchPageLocation as o, pageLocationOf as p, readPageSnapshot as q, restoreScroll as r, startElementPicking as s, findBySelector as t, screenshotPage as u, QUICK_PREVIEW_SERVICE_WORKER_PATH as v, withValCanvasParam as w, QUICK_PREVIEW_RENDER_SCRIPT as x, QUICK_PREVIEW_STORE_MESSAGE as y, isQuickPreviewFiles as z };
@@ -10,7 +10,7 @@ var wrapNativeSuper = require('../../dist/wrapNativeSuper-933f991e.cjs.dev.js');
10
10
  var zodValidationError = require('zod-validation-error');
11
11
  var fp = require('@valbuild/core/fp');
12
12
  var patch = require('@valbuild/core/patch');
13
- var getSitemapTree = require('../../dist/getSitemapTree-59c5ed5d.cjs.dev.js');
13
+ var getSitemapTree = require('../../dist/getSitemapTree-32643b50.cjs.dev.js');
14
14
  var FlexSearch = require('flexsearch');
15
15
  var utils = require('../../dist/utils-d3d8b4b5.cjs.dev.js');
16
16
 
@@ -1879,6 +1879,70 @@ var SketchErrorZ = zod.z.object({
1879
1879
  });
1880
1880
  /** The most text a sketchpad holds, in UTF-8 bytes: a page, not a site. */
1881
1881
  var SKETCHPAD_MAX_TEXT_LENGTH = 256 * 1024;
1882
+
1883
+ /**
1884
+ * A manifest as the server answers it: what each module IS on the server
1885
+ * (`GET /manifest`, and the same answer on `/stat` when the Studio asks for it
1886
+ * there -- one function on the server answers both, `manifestAnswer`).
1887
+ */
1888
+ var ManifestJson = zod.z.object({
1889
+ project: ProjectVersionSchema,
1890
+ modules: zod.z.record(ModuleFilePath, ModuleVersionSchema),
1891
+ /** This answer's ETag, as the header has it. */
1892
+ tag: zod.z.string().optional(),
1893
+ /**
1894
+ * Present on a delta only: the `seq` of the manifest it is
1895
+ * relative to, whose modules that are not named here did not
1896
+ * move. Absent: every module is named.
1897
+ */
1898
+ since: zod.z.number().optional(),
1899
+ /**
1900
+ * The build that answered is a previous build still answering
1901
+ * (http mode: the content service counted a newer one live).
1902
+ * Its versions are right for its own bases, which the site does
1903
+ * not serve any more: a Studio does not move to them, and asks
1904
+ * again. Optional: absent from a live build and a server of the
1905
+ * release before.
1906
+ */
1907
+ superseded: zod.z["boolean"]().optional(),
1908
+ /**
1909
+ * The answering build's `val.modules` registry, as an entry a
1910
+ * Studio can import (`valModulesEntryPath`), and the Val it
1911
+ * runs: where a Studio opened on another build takes this
1912
+ * build's code in without reloading the page. Only a build the
1913
+ * platform made and names (`publishBuild`) has one. Optional
1914
+ * both ways: absent from any other server (local development,
1915
+ * where HMR brings the code; a self-hosted deploy) and from a
1916
+ * server of the release before, and ignored by a Studio of the
1917
+ * release before.
1918
+ */
1919
+ registry: zod.z.object({
1920
+ entry: zod.z.string(),
1921
+ core: zod.z.string()
1922
+ }).optional()
1923
+ });
1924
+ /**
1925
+ * The manifest a `/stat` answer carries, when the request said which one the
1926
+ * Studio holds (`manifest` on the request): what `GET /manifest` would have
1927
+ * answered for it, so another editor's keystroke costs no manifest request.
1928
+ *
1929
+ * - A manifest, whole or a delta. A delta names the ETag it is relative to
1930
+ * (`sinceTag`): a Studio uses it only while it holds exactly that one.
1931
+ * - `unchanged`: the manifest the request named, at `seq`, is still the
1932
+ * one for this answer's `seq`. Decided by `seq` alone, and not read: a
1933
+ * Studio reads a manifest only for a stat whose `seq` moved. It keeps the
1934
+ * next request naming the same manifest.
1935
+ *
1936
+ * Optional: absent from a server of the release before, and from an answer
1937
+ * to a request that did not ask, and then the Studio reads `GET /manifest`.
1938
+ */
1939
+ var StatManifest = zod.z.union([ManifestJson.extend({
1940
+ sinceTag: zod.z.string().optional()
1941
+ }), zod.z.object({
1942
+ unchanged: zod.z.literal(true),
1943
+ tag: zod.z.string(),
1944
+ seq: zod.z.number()
1945
+ })]);
1882
1946
  var Api = {
1883
1947
  "/draft/enable": {
1884
1948
  GET: {
@@ -2265,42 +2329,7 @@ var Api = {
2265
2329
  json: GenericError
2266
2330
  }), zod.z.object({
2267
2331
  status: zod.z.literal(200),
2268
- json: zod.z.object({
2269
- project: ProjectVersionSchema,
2270
- modules: zod.z.record(ModuleFilePath, ModuleVersionSchema),
2271
- /** This answer's ETag, as the header has it. */
2272
- tag: zod.z.string().optional(),
2273
- /**
2274
- * Present on a delta only: the `seq` of the manifest it is
2275
- * relative to, whose modules that are not named here did not
2276
- * move. Absent: every module is named.
2277
- */
2278
- since: zod.z.number().optional(),
2279
- /**
2280
- * The build that answered is a previous build still answering
2281
- * (http mode: the content service counted a newer one live).
2282
- * Its versions are right for its own bases, which the site does
2283
- * not serve any more: a Studio does not move to them, and asks
2284
- * again. Optional: absent from a live build and a server of the
2285
- * release before.
2286
- */
2287
- superseded: zod.z["boolean"]().optional(),
2288
- /**
2289
- * The answering build's `val.modules` registry, as an entry a
2290
- * Studio can import (`valModulesEntryPath`), and the Val it
2291
- * runs: where a Studio opened on another build takes this
2292
- * build's code in without reloading the page. Only a build the
2293
- * platform made and names (`publishBuild`) has one. Optional
2294
- * both ways: absent from any other server (local development,
2295
- * where HMR brings the code; a self-hosted deploy) and from a
2296
- * server of the release before, and ignored by a Studio of the
2297
- * release before.
2298
- */
2299
- registry: zod.z.object({
2300
- entry: zod.z.string(),
2301
- core: zod.z.string()
2302
- }).optional()
2303
- })
2332
+ json: ManifestJson
2304
2333
  }),
2305
2334
  /*
2306
2335
  * Nothing moved since the ETag the client sent. No body on the wire;
@@ -2317,23 +2346,24 @@ var Api = {
2317
2346
  req: {
2318
2347
  body: zod.z.object({
2319
2348
  /**
2320
- * @deprecated Echoed by the Studio, and compared by the fs and
2321
- * memory long poll to see that another build answers. This
2322
- * release's Studio reads each module's version from
2323
- * `GET /manifest`; goes once the long poll compares the echoed
2324
- * version instead (see "Release-delayed deletions" in
2349
+ * @deprecated Echoed by a Studio of the release that shipped the
2350
+ * one content model, whose fs and memory long poll compared it to
2351
+ * see another build; a Studio of the release after echoes
2352
+ * {@link version} instead, and this only when it was sent. The
2353
+ * request field goes once no Studio sends it (see
2354
+ * "Release-delayed deletions" in
2325
2355
  * `docs/plans/one-content-model.md`).
2326
2356
  */
2327
- sourcesSha: zod.z.string(),
2357
+ sourcesSha: zod.z.string().optional(),
2358
+ /** @deprecated As `sourcesSha`. */
2359
+ schemaSha: zod.z.string().optional(),
2328
2360
  /**
2329
- * @deprecated Echoed by the Studio, and compared by the fs and
2330
- * memory long poll to see that another build answers. This
2331
- * release's Studio reads each module's version from
2332
- * `GET /manifest`; goes once the long poll compares the echoed
2333
- * version instead (see "Release-delayed deletions" in
2334
- * `docs/plans/one-content-model.md`).
2361
+ * The `version` the last answer carried: what the fs and memory
2362
+ * long poll compare to see another build (the build the chain is
2363
+ * relative to, `ValOps.chainBuild`). Optional: a Studio of the
2364
+ * release before echoes the shas.
2335
2365
  */
2336
- schemaSha: zod.z.string(),
2366
+ version: ProjectVersionSchema.optional(),
2337
2367
  baseSha: zod.z.string(),
2338
2368
  patches: zod.z.array(zod.z.string()).optional(),
2339
2369
  /**
@@ -2342,7 +2372,17 @@ var Api = {
2342
2372
  * jsonValues module's source is markers and the content sits behind a
2343
2373
  * thunk that `JSON.stringify` drops.
2344
2374
  */
2345
- jsonEntriesSha: zod.z.string().optional()
2375
+ jsonEntriesSha: zod.z.string().optional(),
2376
+ /**
2377
+ * The manifest the Studio holds, by its ETag and `seq`, so the
2378
+ * answer can carry what moved since (`manifest` on the answer):
2379
+ * `null` when it holds none and can take one. Absent from a
2380
+ * Studio of the release before, which reads `GET /manifest`.
2381
+ */
2382
+ manifest: zod.z.object({
2383
+ tag: zod.z.string(),
2384
+ seq: zod.z.number()
2385
+ }).nullable().optional()
2346
2386
  }).nullable(),
2347
2387
  cookies: {
2348
2388
  val_session: zod.z.string().optional()
@@ -2363,21 +2403,16 @@ var Api = {
2363
2403
  type: zod.z.union([zod.z.literal("request-again"), zod.z.literal("no-change"), zod.z.literal("did-change")]),
2364
2404
  baseSha: zod.z.string(),
2365
2405
  /**
2366
- * @deprecated Read by a Studio of the release before
2367
- * (`BaseAlignment`, `SchemaFreshnessWatch`); this release's
2368
- * only echoes it, and reads each module's version from
2369
- * `GET /manifest`. Goes in two steps (see "Release-delayed
2370
- * deletions" in `docs/plans/one-content-model.md`).
2371
- */
2372
- schemaSha: zod.z.string(),
2373
- /**
2374
- * @deprecated Read by a Studio of the release before
2375
- * (`BaseAlignment`, `SchemaFreshnessWatch`); this release's
2376
- * only echoes it, and reads each module's version from
2377
- * `GET /manifest`. Goes in two steps (see "Release-delayed
2378
- * deletions" in `docs/plans/one-content-model.md`).
2406
+ * @deprecated Still sent, for a Studio of the release that
2407
+ * shipped the one content model, which echoes it; a Studio of
2408
+ * the release after reads it as optional and echoes `version`.
2409
+ * The server stops sending it in the release after that (see
2410
+ * "Release-delayed deletions" in
2411
+ * `docs/plans/one-content-model.md`).
2379
2412
  */
2380
- sourcesSha: zod.z.string(),
2413
+ schemaSha: zod.z.string().optional(),
2414
+ /** @deprecated As `schemaSha`. */
2415
+ sourcesSha: zod.z.string().optional(),
2381
2416
  patches: zod.z.array(PatchId),
2382
2417
  /**
2383
2418
  * Of `patches`, the ones that have already SHIPPED.
@@ -2481,28 +2516,25 @@ var Api = {
2481
2516
  * answers, the higher `seq` is the newer. Optional: a server
2482
2517
  * that predates versions sends none.
2483
2518
  */
2484
- version: ProjectVersionSchema.optional()
2519
+ version: ProjectVersionSchema.optional(),
2520
+ /** See {@link StatManifest}. */
2521
+ manifest: StatManifest.optional()
2485
2522
  }), zod.z.object({
2486
2523
  type: zod.z.literal("use-websocket"),
2487
2524
  url: zod.z.string(),
2488
2525
  nonce: zod.z.string(),
2489
2526
  baseSha: zod.z.string(),
2490
2527
  /**
2491
- * @deprecated Read by a Studio of the release before
2492
- * (`BaseAlignment`, `SchemaFreshnessWatch`); this release's
2493
- * only echoes it, and reads each module's version from
2494
- * `GET /manifest`. Goes in two steps (see "Release-delayed
2495
- * deletions" in `docs/plans/one-content-model.md`).
2496
- */
2497
- schemaSha: zod.z.string(),
2498
- /**
2499
- * @deprecated Read by a Studio of the release before
2500
- * (`BaseAlignment`, `SchemaFreshnessWatch`); this release's
2501
- * only echoes it, and reads each module's version from
2502
- * `GET /manifest`. Goes in two steps (see "Release-delayed
2503
- * deletions" in `docs/plans/one-content-model.md`).
2528
+ * @deprecated Still sent, for a Studio of the release that
2529
+ * shipped the one content model, which echoes it; a Studio of
2530
+ * the release after reads it as optional and echoes `version`.
2531
+ * The server stops sending it in the release after that (see
2532
+ * "Release-delayed deletions" in
2533
+ * `docs/plans/one-content-model.md`).
2504
2534
  */
2505
- sourcesSha: zod.z.string(),
2535
+ schemaSha: zod.z.string().optional(),
2536
+ /** @deprecated As `schemaSha`. */
2537
+ sourcesSha: zod.z.string().optional(),
2506
2538
  /**
2507
2539
  * The commit this deployment was built from.
2508
2540
  *
@@ -2630,7 +2662,9 @@ var Api = {
2630
2662
  * answers, the higher `seq` is the newer. Optional: a server
2631
2663
  * that predates versions sends none.
2632
2664
  */
2633
- version: ProjectVersionSchema.optional()
2665
+ version: ProjectVersionSchema.optional(),
2666
+ /** See {@link StatManifest}. */
2667
+ manifest: StatManifest.optional()
2634
2668
  })])
2635
2669
  })])
2636
2670
  }
@@ -3195,81 +3229,6 @@ var Api = {
3195
3229
  })])
3196
3230
  }
3197
3231
  },
3198
- /**
3199
- * @deprecated The whole tree. Nothing of this release asks it: the Studio
3200
- * reads modules by version (`GET /manifest`, `GET /modules/~`), the draft
3201
- * readers and MCP read the head in-process. Kept, with `exclude_patches`
3202
- * (`BaseAlignment`'s fetch) and the ignored `validate_sources` and
3203
- * `validate_binary_files`, for a Studio of the release before; goes in the
3204
- * release after the one that ships this (see "Release-delayed deletions"
3205
- * in `docs/plans/one-content-model.md`).
3206
- */
3207
- "/sources/~": {
3208
- PUT: {
3209
- req: {
3210
- path: zod.z.string().optional(),
3211
- query: {
3212
- validate_sources: onlyOneBooleanQueryParam.optional(),
3213
- validate_binary_files: onlyOneBooleanQueryParam.optional(),
3214
- exclude_patches: onlyOneBooleanQueryParam.optional(),
3215
- apply_patches: onlyOneBooleanQueryParam.optional()
3216
- },
3217
- cookies: {
3218
- val_session: zod.z.string().optional()
3219
- }
3220
- },
3221
- res: zod.z.union([unauthorizedResponse, zod.z.object({
3222
- status: zod.z.literal(401),
3223
- json: GenericError
3224
- }), zod.z.object({
3225
- status: zod.z.literal(500),
3226
- json: zod.z.object({
3227
- message: zod.z.string(),
3228
- details: zod.z.union([zod.z.array(ModulesError), GenericError])
3229
- })
3230
- }), zod.z.object({
3231
- status: zod.z.literal(409),
3232
- json: zod.z.object({
3233
- message: zod.z.string()
3234
- })
3235
- }), zod.z.object({
3236
- status: zod.z.literal(400),
3237
- json: zod.z.object({
3238
- message: zod.z.string(),
3239
- details: zod.z.array(ModulesError)
3240
- })
3241
- }), zod.z.object({
3242
- status: zod.z.literal(200),
3243
- json: zod.z.object({
3244
- schemaSha: zod.z.string(),
3245
- sourcesSha: zod.z.string(),
3246
- modules: zod.z.record(ModuleFilePath, zod.z.object({
3247
- preview: zod.z.any().optional(),
3248
- // TODO: improve this type
3249
- source: zod.z.any().optional(),
3250
- //.optional(), // TODO: Json zod type
3251
- baseSource: zod.z.any().optional(),
3252
- // pre-patch source for compare view; only set when the server applies patches (apply_patches=true) and the module has pending patches
3253
- patches: zod.z.object({
3254
- applied: zod.z.array(PatchId),
3255
- skipped: zod.z.array(PatchId).optional(),
3256
- errors: zod.z.record(PatchId, GenericError).optional()
3257
- }).optional(),
3258
- validationErrors: zod.z.record(zod.z.string(), zod.z.array(ValidationError)).optional(),
3259
- /**
3260
- * The version of `source` as answered: with the chain the
3261
- * server applied, or the empty chain when it applied none
3262
- * (`apply_patches=false`). Optional: an older server sends
3263
- * none.
3264
- */
3265
- version: ModuleVersionSchema.optional()
3266
- })),
3267
- /** The project version this tree was read at. See `/stat`. */
3268
- project: ProjectVersionSchema.optional()
3269
- })
3270
- })])
3271
- }
3272
- },
3273
3232
  /**
3274
3233
  * One module by version: phase 6 of `docs/plans/one-content-model.md`
3275
3234
  * ("The Studio loads everything from one place"). `GET /modules/~<path>`,
@@ -11885,7 +11844,7 @@ exports.getPageRouterSitemapTree = getSitemapTree.getPageRouterSitemapTree;
11885
11844
  exports.getPageRouterSourceFolder = getSitemapTree.getPageRouterSourceFolder;
11886
11845
  exports.getPatternFromModuleFilePath = getSitemapTree.getPatternFromModuleFilePath;
11887
11846
  exports.getTanStackRouterSourceFolder = getSitemapTree.getTanStackRouterSourceFolder;
11888
- exports.isDesignTabOrigin = getSitemapTree.isDesignTabOrigin;
11847
+ exports.isCanvasSelectionColor = getSitemapTree.isCanvasSelectionColor;
11889
11848
  exports.isQuickPreviewFiles = getSitemapTree.isQuickPreviewFiles;
11890
11849
  exports.isTanStackRoutesFolder = getSitemapTree.isTanStackRoutesFolder;
11891
11850
  exports.isValCanvasFrame = getSitemapTree.isValCanvasFrame;
@@ -11894,7 +11853,6 @@ exports.isValCanvasStudioMessage = getSitemapTree.isValCanvasStudioMessage;
11894
11853
  exports.modifierLabel = getSitemapTree.modifierLabel;
11895
11854
  exports.pageLocationOf = getSitemapTree.pageLocationOf;
11896
11855
  exports.parseRoutePattern = getSitemapTree.parseRoutePattern;
11897
- exports.quickPreviewSiteOrigin = getSitemapTree.quickPreviewSiteOrigin;
11898
11856
  exports.readPageSnapshot = getSitemapTree.readPageSnapshot;
11899
11857
  exports.restoreScroll = getSitemapTree.restoreScroll;
11900
11858
  exports.screenshotPage = getSitemapTree.screenshotPage;
@@ -11930,6 +11888,7 @@ exports.JSONValue = JSONValue;
11930
11888
  exports.JSON_ENTRIES_BATCH_MAX = JSON_ENTRIES_BATCH_MAX;
11931
11889
  exports.LOCAL_FILE_IN_REMOTE_PROJECT_HINT = LOCAL_FILE_IN_REMOTE_PROJECT_HINT;
11932
11890
  exports.LOCAL_FILE_IN_REMOTE_PROJECT_WARNING = LOCAL_FILE_IN_REMOTE_PROJECT_WARNING;
11891
+ exports.ManifestJson = ManifestJson;
11933
11892
  exports.ModuleComparison = ModuleComparison;
11934
11893
  exports.ModuleVersionSchema = ModuleVersionSchema;
11935
11894
  exports.NEVER_ENCODED = NEVER_ENCODED;
@@ -11987,6 +11946,7 @@ exports.SerializedVideoSchema = SerializedVideoSchema;
11987
11946
  exports.SharedValConfig = SharedValConfig;
11988
11947
  exports.Sketchpad = Sketchpad;
11989
11948
  exports.SketchpadSummary = SketchpadSummary;
11949
+ exports.StatManifest = StatManifest;
11990
11950
  exports.VAL_CLIENT_HEADER = VAL_CLIENT_HEADER;
11991
11951
  exports.VAL_ENABLE_COOKIE_NAME = VAL_ENABLE_COOKIE_NAME;
11992
11952
  exports.VAL_GREEN_RAMP = VAL_GREEN_RAMP;