@valbuild/server 0.153.5 → 0.153.6

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 (26) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/browser/dist/valbuild-server-browser.cjs.dev.js +2 -2
  3. package/browser/dist/valbuild-server-browser.cjs.prod.js +2 -2
  4. package/browser/dist/valbuild-server-browser.esm.js +2 -2
  5. package/dist/{ValRouter-2ff58de9.cjs.dev.js → ValRouter-480ecf99.cjs.dev.js} +42 -4
  6. package/dist/{ValRouter-60ee2fa5.cjs.prod.js → ValRouter-b12133a1.cjs.prod.js} +42 -4
  7. package/dist/{ValRouter-072c3dee.esm.js → ValRouter-f4f5348d.esm.js} +42 -4
  8. package/dist/{ValRouterCore-4e3757ac.cjs.dev.js → ValRouterCore-3d7d2581.cjs.prod.js} +264 -14
  9. package/dist/{ValRouterCore-257f140c.esm.js → ValRouterCore-c418ffb7.esm.js} +259 -15
  10. package/dist/{ValRouterCore-d658dc75.cjs.prod.js → ValRouterCore-cbf1de67.cjs.dev.js} +264 -14
  11. package/dist/{inTabFetch-7f2c9455.cjs.prod.js → inTabFetch-5ef58dda.cjs.prod.js} +1 -1
  12. package/dist/{inTabFetch-09f7ae69.cjs.dev.js → inTabFetch-99450193.cjs.dev.js} +1 -1
  13. package/dist/{inTabFetch-0157c4a1.esm.js → inTabFetch-cb415a9d.esm.js} +1 -1
  14. package/dist/{publishKit-26231426.cjs.prod.js → publishKit-482747e2.cjs.prod.js} +2 -2
  15. package/dist/{publishKit-89923030.esm.js → publishKit-c2bcff27.esm.js} +3 -3
  16. package/dist/{publishKit-5227c288.cjs.dev.js → publishKit-f98d8cd1.cjs.dev.js} +2 -2
  17. package/dist/valbuild-server.cjs.dev.js +2 -2
  18. package/dist/valbuild-server.cjs.prod.js +2 -2
  19. package/dist/valbuild-server.esm.js +4 -4
  20. package/internal/browser/dist/valbuild-server-internal-browser.cjs.dev.js +2 -2
  21. package/internal/browser/dist/valbuild-server-internal-browser.cjs.prod.js +2 -2
  22. package/internal/browser/dist/valbuild-server-internal-browser.esm.js +2 -2
  23. package/internal/dist/valbuild-server-internal.cjs.dev.js +2 -2
  24. package/internal/dist/valbuild-server-internal.cjs.prod.js +2 -2
  25. package/internal/dist/valbuild-server-internal.esm.js +2 -2
  26. package/package.json +5 -5
@@ -755,6 +755,66 @@ function parseRangeHeader(header, size) {
755
755
  };
756
756
  }
757
757
 
758
+ /**
759
+ * Which paths a request may name, where the path ends up joined onto a
760
+ * directory on disk or handed to the content service as a file to read.
761
+ *
762
+ * A media file's path arrives from the client three ways: in the URL of
763
+ * `/files`, in the body of `/upload/patches`, and as the `filePath` of a
764
+ * patch's `file` op. None of them was checked. `/files` answered any path
765
+ * under the project root (`.env`, the source), and an upload's `filePath` was
766
+ * joined onto the staging directory as it was, so `../../../../src/x` wrote
767
+ * outside it. In fs mode there is no session to stop either.
768
+ *
769
+ * So the rule is on the PATH, and it is the one media already follows: a local
770
+ * file lives under `/public` (`MediaDir` in core), and a remote one is named by
771
+ * its ref, which is a URL and never starts with a slash.
772
+ */
773
+
774
+ /** No segment that climbs or stays put, and nothing a path API reads as a separator. */
775
+ function hasOnlyPlainSegments(filePath) {
776
+ if (filePath.includes("\\") || filePath.includes("\0")) {
777
+ return false;
778
+ }
779
+ return filePath.split("/").every(segment => segment !== ".." && segment !== ".");
780
+ }
781
+
782
+ /**
783
+ * A local media path: `/public/...`, with nothing in it that leaves `/public`.
784
+ *
785
+ * What `/files` serves when it is asked for a published file, and where a
786
+ * publish may write an uploaded one.
787
+ */
788
+ function isPublicFilePath(filePath) {
789
+ return filePath.startsWith("/public/") && hasOnlyPlainSegments(filePath);
790
+ }
791
+
792
+ /**
793
+ * What a `file` op or an upload may name: a local media path, or a remote ref.
794
+ *
795
+ * A remote ref is stored in the patch directory under its own text, so it is
796
+ * held to the same segments rule. It cannot start with a slash, which is what
797
+ * keeps `/etc/x` and `/src/x` from passing as one.
798
+ */
799
+ function isMediaFilePath(filePath) {
800
+ if (filePath.startsWith("/")) {
801
+ return isPublicFilePath(filePath);
802
+ }
803
+ return filePath.length > 0 && hasOnlyPlainSegments(filePath);
804
+ }
805
+
806
+ /**
807
+ * A patch id as a directory name: one segment, and not a climbing one.
808
+ *
809
+ * Patch ids are UUIDs here and whatever the content service mints there, so
810
+ * this does not say what an id IS, only what it cannot be while it is used as
811
+ * the name of a directory under `.val/patches`.
812
+ */
813
+ function isSafePatchId(patchId) {
814
+ return patchId.length > 0 && patchId !== "." && patchId !== ".." && !/[/\\\0]/.test(patchId);
815
+ }
816
+ const MEDIA_FILE_PATH_ACCEPTS = "A file's path must be under /public (/public/val/photo.jpg) or be a remote file's ref, with no '..' in it.";
817
+
758
818
  /**
759
819
  * The little of HLS (RFC 8216) the server has to read: the variants of a
760
820
  * master playlist, the segment durations of a media playlist, and every URI a
@@ -5203,6 +5263,27 @@ class ValOps {
5203
5263
 
5204
5264
  // #region createPatch
5205
5265
  async createPatch(path, patch, patchId, parentRef, sessionId, authorId) {
5266
+ // The id names a directory and each `file` op names a file in it, and
5267
+ // later a file a publish writes. Checked here, the one door every patch
5268
+ // comes through (the Studio, MCP), rather than at each of them.
5269
+ if (!isSafePatchId(patchId)) {
5270
+ return result.err({
5271
+ errorType: "other",
5272
+ error: {
5273
+ message: "This change's id is not a valid patch id."
5274
+ }
5275
+ });
5276
+ }
5277
+ for (const op of patch) {
5278
+ if (op.op === "file" && !isMediaFilePath(op.filePath)) {
5279
+ return result.err({
5280
+ errorType: "other",
5281
+ error: {
5282
+ message: `This change names a file at '${op.filePath}', which is not somewhere Val stores files. ${MEDIA_FILE_PATH_ACCEPTS}`
5283
+ }
5284
+ });
5285
+ }
5286
+ }
5206
5287
  const saveRes = await this.saveSourceFilePatch(path, patch, patchId, parentRef, authorId, sessionId);
5207
5288
  if (result.isErr(saveRes)) {
5208
5289
  if (saveRes.error.errorType === "plan-refused") {
@@ -6295,7 +6376,7 @@ var packageJson = {
6295
6376
  ],
6296
6377
  exports: true
6297
6378
  },
6298
- version: "0.153.5",
6379
+ version: "0.153.6",
6299
6380
  scripts: {
6300
6381
  typecheck: "tsc --noEmit",
6301
6382
  test: "jest",
@@ -6311,11 +6392,11 @@ var packageJson = {
6311
6392
  "@valbuild/shared": "workspace:*",
6312
6393
  "@valbuild/ui": "workspace:*",
6313
6394
  chokidar: "^5.0.0",
6314
- "image-size": "^2.0.2",
6395
+ "image-size": "^2.0.3",
6315
6396
  minimatch: "^10.2.6",
6316
6397
  sucrase: "^3.35.1",
6317
6398
  typescript: "^6.0.3",
6318
- zod: "^4.4.3",
6399
+ zod: "^4.6.6",
6319
6400
  "zod-validation-error": "^5.0.0"
6320
6401
  },
6321
6402
  engines: {
@@ -7239,7 +7320,8 @@ const ValServer = (valModules, options, callbacks, platform) => {
7239
7320
  const token = crypto.randomUUID();
7240
7321
  const redirectUrl = new URL(redirectTo);
7241
7322
  const appAuthorizeUrl = getAuthorizeUrl(`${redirectUrl.origin}${options.route}`, token);
7242
- await callbacks.onEnable(true);
7323
+ // Draft mode is NOT turned on here: nobody has signed in yet, and this
7324
+ // is reachable by anyone. `/callback` turns it on, once they have.
7243
7325
  return {
7244
7326
  cookies: {
7245
7327
  [VAL_ENABLE_COOKIE_NAME]: ENABLE_COOKIE_VALUE,
@@ -8416,6 +8498,9 @@ const ValServer = (valModules, options, callbacks, platform) => {
8416
8498
  ...data,
8417
8499
  exp // this is the client side exp
8418
8500
  }, valSecret);
8501
+ // Signed in: now draft mode, which `/authorize` used to turn on for
8502
+ // whoever asked.
8503
+ await callbacks.onEnable(true);
8419
8504
  return {
8420
8505
  status: 302,
8421
8506
  cookies: {
@@ -8947,7 +9032,7 @@ const ValServer = (valModules, options, callbacks, platform) => {
8947
9032
  }
8948
9033
  const pathParts = req.path.split("/");
8949
9034
  const patchId = pathParts[1];
8950
- const isValidPatchId = patchId.length === 36;
9035
+ const isValidPatchId = patchId.length === 36 && isSafePatchId(patchId);
8951
9036
  const isValidEndpoint = pathParts[0] === "" && isValidPatchId && pathParts[2] === "files";
8952
9037
  if (!isValidEndpoint) {
8953
9038
  return {
@@ -11102,6 +11187,19 @@ const ValServer = (valModules, options, callbacks, platform) => {
11102
11187
  // nothing fetches it backend-to-backend. Neither half of the argument
11103
11188
  // above transfers. See architecture/media.md, "Why /files has no auth,
11104
11189
  // and /history/files does".
11190
+ // Media and nothing else. This route has no auth (above), so what it
11191
+ // serves is decided by the path: a file under /public, which the site
11192
+ // serves anyway, or a draft of one. Without this it answered any path
11193
+ // in the project -- `.env`, the source -- and in http mode asked the
11194
+ // content service for it with the project's api key.
11195
+ if (!isPublicFilePath(filePath)) {
11196
+ return {
11197
+ status: 404,
11198
+ json: {
11199
+ message: "File not found"
11200
+ }
11201
+ };
11202
+ }
11105
11203
  const remote = query.remote === "true";
11106
11204
  const patchId = query.patch_id;
11107
11205
  if (!patchId && isHttpOps(serverOps) && remote) {
@@ -12662,8 +12760,9 @@ class ValOpsMemory extends ValOps {
12662
12760
 
12663
12761
  /**
12664
12762
  * What `redirect_to` may be on Val's routes (`/enable`, `/disable`,
12665
- * `/authorize`, `/draft/enable`, ...): an absolute URL, or a path on the site
12666
- * that was asked, which is made absolute against the request's own origin.
12763
+ * `/authorize`, `/draft/enable`, ...): a path on the site that was asked,
12764
+ * which is made absolute against the request's own origin, or an absolute
12765
+ * URL on that same site.
12667
12766
  *
12668
12767
  * A path used to go through as it was, and two things downstream need an
12669
12768
  * absolute URL: `/authorize` reads the origin off it to build the callback,
@@ -12676,8 +12775,13 @@ class ValOpsMemory extends ValOps {
12676
12775
  * it always was (`/logout` reads it as absent).
12677
12776
  */
12678
12777
 
12679
- const REDIRECT_TO_ACCEPTS = "redirect_to must be an absolute URL (https://example.com/page) or a path on this site starting with / (/page).";
12680
- function resolveRedirectTo(value, requestOrigin) {
12778
+ const REDIRECT_TO_ACCEPTS = "redirect_to must be a path on this site starting with / (/page), or an absolute URL on this site (https://this-site.example/page).";
12779
+
12780
+ /**
12781
+ * `siteHosts` are the other names the request knows this site by (`Host`,
12782
+ * `X-Forwarded-Host`), for a server behind a proxy whose own URL is internal.
12783
+ */
12784
+ function resolveRedirectTo(value, requestOrigin, siteHosts = []) {
12681
12785
  if (value.startsWith("/") && !value.startsWith("//")) {
12682
12786
  // A path stays on this origin. `/\host/x` also starts with one slash,
12683
12787
  // and a URL parser reads the backslash as a second one: another host,
@@ -12691,13 +12795,22 @@ function resolveRedirectTo(value, requestOrigin) {
12691
12795
  message: REDIRECT_TO_ACCEPTS
12692
12796
  };
12693
12797
  }
12694
- if (parsed(value) !== null) {
12798
+ // An absolute URL, on this site only. Any URL used to pass, which made
12799
+ // `/logout` and `/enable` redirect wherever a link said, and `/authorize`
12800
+ // send the sign-in's code to that host: it reads the callback's origin off
12801
+ // this. http(s) only: `javascript:` parses as a URL too.
12802
+ const url = parsed(value);
12803
+ if (url === null || url.protocol !== "https:" && url.protocol !== "http:") {
12695
12804
  return {
12696
- ok: true,
12697
- href: value
12805
+ ok: false,
12806
+ message: REDIRECT_TO_ACCEPTS
12698
12807
  };
12699
12808
  }
12700
- return {
12809
+ const hosts = [new URL(requestOrigin).host, ...siteHosts].filter(host => typeof host === "string" && host !== "").map(host => host.toLowerCase());
12810
+ return hosts.includes(url.host.toLowerCase()) ? {
12811
+ ok: true,
12812
+ href: value
12813
+ } : {
12701
12814
  ok: false,
12702
12815
  message: REDIRECT_TO_ACCEPTS
12703
12816
  };
@@ -12715,6 +12828,130 @@ function parsed(value, base) {
12715
12828
  }
12716
12829
  }
12717
12830
 
12831
+ /**
12832
+ * Which requests Val's API answers in fs mode, where there is no session.
12833
+ *
12834
+ * fs mode reads and writes a working tree and asks nobody who they are: it is
12835
+ * a developer's own machine. That holds only while the request really comes
12836
+ * from that developer's Studio, and three kinds do not:
12837
+ *
12838
+ * - **A deployed site.** fs is the mode an app falls into when it has no
12839
+ * `VAL_API_KEY` and `VAL_SECRET`, so a site deployed without them served
12840
+ * this API, unauthenticated, to the internet.
12841
+ * - **Another site's page**, in the developer's browser. A `text/plain` POST
12842
+ * needs no preflight, and the router reads its body as JSON, so any page
12843
+ * open in another tab could write to the working tree.
12844
+ * - **A name that resolves to 127.0.0.1** (DNS rebinding), which makes such a
12845
+ * page same-origin with the dev server as far as the browser can tell.
12846
+ *
12847
+ * The MCP endpoint has refused all three since it was written
12848
+ * (`refuseUnsafeRequest` in `@valbuild/mcp`); this is the same rule for the
12849
+ * API the Studio uses. Nothing here needs Node: `ValRouterCore` runs in a
12850
+ * browser tab too, where no server is registered and nothing is refused.
12851
+ */
12852
+
12853
+ const guards = new WeakMap();
12854
+
12855
+ /** Say how `server`'s requests are to be checked. Without it, none are. */
12856
+ function setRequestGuard(server, guard) {
12857
+ guards.set(server, guard);
12858
+ }
12859
+
12860
+ /** `VAL_ALLOWED_HOSTS`: comma separated host names, without a port. */
12861
+ function parseAllowedHosts(value) {
12862
+ return (value ?? "").split(",").map(host => host.trim().toLowerCase()).filter(host => host !== "");
12863
+ }
12864
+
12865
+ /** The refusal, or `null` when the request may go on to its route. */
12866
+ function refuseUnsafeRequest(server, req, apiPath) {
12867
+ var _req$method;
12868
+ const guard = guards.get(server);
12869
+ if (guard === undefined || guard.mode !== "fs") {
12870
+ return null;
12871
+ }
12872
+ // Beacons are not refused: in fs mode one is checked and dropped, nothing
12873
+ // is written or forwarded, and a deployed site with analytics on would fill
12874
+ // every visitor's console with errors.
12875
+ if (apiPath === "/analytics") {
12876
+ return null;
12877
+ }
12878
+ if (guard.production) {
12879
+ return refusal("Val is not set up for a deployed site here: without VAL_API_KEY and VAL_SECRET it runs in local filesystem mode, which has no sign-in and is only served by a development server. Set both (and VAL_PROJECT) on this deployment to use Val on it.");
12880
+ }
12881
+ const host = hostOf(req);
12882
+ const forwardedHost = firstOf(req.headers.get("x-forwarded-host"));
12883
+ const origin = req.headers.get("origin");
12884
+ if (origin !== null) {
12885
+ // `null` is the opaque origin (a sandboxed frame, a `file:` page). It
12886
+ // cannot be compared with anything, so it is refused.
12887
+ const originHost = origin === "null" ? null : hostOfUrl(origin);
12888
+ if (originHost === null || originHost !== host && originHost !== forwardedHost) {
12889
+ return refusal(`Val refused a request from another site (${origin}). In local filesystem mode the API only answers the Studio on its own address.`);
12890
+ }
12891
+ }
12892
+ // A request with no `Origin` can still come from another site: an `<img>`,
12893
+ // a script. Following a link here is not refused: sign-in comes back as
12894
+ // one. A link is a GET; a form posted from another site navigates too.
12895
+ const followedLink = ((_req$method = req.method) === null || _req$method === void 0 ? void 0 : _req$method.toUpperCase()) === "GET" && req.headers.get("sec-fetch-mode") === "navigate";
12896
+ if (req.headers.get("sec-fetch-site") === "cross-site" && !followedLink) {
12897
+ return refusal("Val refused a request from another site. In local filesystem mode the API only answers the Studio on its own address.");
12898
+ }
12899
+ const hostname = host === null ? null : hostnameOf(host);
12900
+ if (hostname === null || !isLocalName(hostname, guard.allowedHosts)) {
12901
+ return refusal(`Val refused a request addressed to ${host ?? "an unknown host"}. In local filesystem mode the API answers on localhost and on IP addresses, because any other name can be made to point at this machine by the site that owns it. If this is the address you develop on, add its host name to the VAL_ALLOWED_HOSTS environment variable (comma separated) and restart the dev server.`);
12902
+ }
12903
+ return null;
12904
+ }
12905
+ function refusal(message) {
12906
+ return {
12907
+ status: 403,
12908
+ json: {
12909
+ message
12910
+ }
12911
+ };
12912
+ }
12913
+ function firstOf(header) {
12914
+ var _header$split$;
12915
+ const first = header === null || header === void 0 || (_header$split$ = header.split(",")[0]) === null || _header$split$ === void 0 ? void 0 : _header$split$.trim().toLowerCase();
12916
+ return first ? first : null;
12917
+ }
12918
+ function hostOf(req) {
12919
+ const header = firstOf(req.headers.get("host"));
12920
+ if (header !== null) {
12921
+ return header;
12922
+ }
12923
+ // No Host header: the URL the framework built the request from.
12924
+ return hostOfUrl(req.url);
12925
+ }
12926
+ function hostOfUrl(url) {
12927
+ try {
12928
+ return new URL(url).host.toLowerCase();
12929
+ } catch {
12930
+ return null;
12931
+ }
12932
+ }
12933
+
12934
+ /** A host without its port. An IPv6 literal keeps its brackets. */
12935
+ function hostnameOf(host) {
12936
+ if (host.startsWith("[")) {
12937
+ const end = host.indexOf("]");
12938
+ return end === -1 ? host : host.slice(0, end + 1);
12939
+ }
12940
+ const colon = host.indexOf(":");
12941
+ return colon === -1 ? host : host.slice(0, colon);
12942
+ }
12943
+
12944
+ /**
12945
+ * localhost, an IP address, or a name the developer listed.
12946
+ *
12947
+ * An IP address is allowed because it cannot be rebound: a page that reaches
12948
+ * this server by address is on another origin, and the `Origin` check above
12949
+ * has already refused it. A phone on the same network uses one.
12950
+ */
12951
+ function isLocalName(hostname, allowedHosts) {
12952
+ return hostname === "localhost" || hostname.endsWith(".localhost") || /^\d{1,3}(\.\d{1,3}){3}$/.test(hostname) || hostname.startsWith("[") && hostname.endsWith("]") || allowedHosts.includes(hostname);
12953
+ }
12954
+
12718
12955
  /**
12719
12956
  * Val's API as a web-standard handler: a `Request` in, a converted result out.
12720
12957
  *
@@ -12798,6 +13035,10 @@ function createValRequestHandler(route, valServerPromise, convert, serveStatic)
12798
13035
  Api;
12799
13036
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12800
13037
  const anyValServer = valServer;
13038
+ const refused = refuseUnsafeRequest(valServer, req, reqApiRoutePath);
13039
+ if (refused !== null) {
13040
+ return refused;
13041
+ }
12801
13042
  const method = (_req$method = req.method) === null || _req$method === void 0 ? void 0 : _req$method.toUpperCase();
12802
13043
  let route = null;
12803
13044
  let path = undefined;
@@ -12923,7 +13164,10 @@ function createValRequestHandler(route, valServerPromise, convert, serveStatic)
12923
13164
  }
12924
13165
  // `redirect_to` is a URL or a path on this site: see `resolveRedirectTo`.
12925
13166
  if ("redirect_to" in query && typeof query.redirect_to === "string" && query.redirect_to !== "") {
12926
- const resolved = resolveRedirectTo(query.redirect_to, url.origin);
13167
+ var _req$headers$get;
13168
+ // Behind a proxy `url` can be an internal address: the site's own
13169
+ // name is then in `Host` or `X-Forwarded-Host`.
13170
+ const resolved = resolveRedirectTo(query.redirect_to, url.origin, [req.headers.get("host"), (_req$headers$get = req.headers.get("x-forwarded-host")) === null || _req$headers$get === void 0 || (_req$headers$get = _req$headers$get.split(",")[0]) === null || _req$headers$get === void 0 ? void 0 : _req$headers$get.trim()]);
12927
13171
  if (!resolved.ok) {
12928
13172
  return {
12929
13173
  status: 400,
@@ -13116,4 +13360,4 @@ function getCookies(req, cookiesDef) {
13116
13360
  return z.object(cookiesDef).safeParse(input);
13117
13361
  }
13118
13362
 
13119
- export { largestHlsVariant as A, fallbackRefOf as B, mapHlsUris as C, DEFAULT_ANALYTICS_INGEST_URL as D, movedRemoteHost as E, needsHostCheck as F, rewriteRefHost as G, fallbackRemoteHost as H, InMemoryPatchStore as I, checkRemoteFiles as J, ValServer as K, createValRequestHandler as L, bytesToBase64 as M, ValHead as N, headWork as O, HEAD_BUDGET_BYTES as P, HEAD_VERSIONS_PER_MODULE as Q, bytesToUtf8 as R, posixPath as S, VAL_CLIENT_HEADERS as V, formatPatchSourceError as a, askOncePerHost as b, getSettings as c, getFileExt as d, ValOpsMemory as e, findNestedJsonValuesRecords as f, getNewJsonEntryPaths as g, byUpdatedAt as h, isSketchpadId as i, applySketchpadChange as j, ValOps as k, bufferFromDataUrl as l, matchesFilter as m, newSketchpad as n, getFieldsForType as o, guessMimeTypeFromPath as p, createMetadataFromBuffer as q, resolveExistingJsonPath as r, summaryOf as s, sessionAuth as t, uploadRemoteFile as u, validateJsonValuesEntries as v, isHttpOps as w, isHlsMasterPlaylist as x, sumHlsSegmentDurations as y, parseHlsMasterVariants as z };
13363
+ export { isHlsMasterPlaylist as A, sumHlsSegmentDurations as B, parseHlsMasterVariants as C, DEFAULT_ANALYTICS_INGEST_URL as D, largestHlsVariant as E, fallbackRefOf as F, mapHlsUris as G, movedRemoteHost as H, InMemoryPatchStore as I, needsHostCheck as J, rewriteRefHost as K, fallbackRemoteHost as L, MEDIA_FILE_PATH_ACCEPTS as M, checkRemoteFiles as N, ValServer as O, setRequestGuard as P, parseAllowedHosts as Q, createValRequestHandler as R, bytesToBase64 as S, ValHead as T, headWork as U, VAL_CLIENT_HEADERS as V, HEAD_BUDGET_BYTES as W, HEAD_VERSIONS_PER_MODULE as X, bytesToUtf8 as Y, posixPath as Z, formatPatchSourceError as a, askOncePerHost as b, getSettings as c, getFileExt as d, ValOpsMemory as e, findNestedJsonValuesRecords as f, getNewJsonEntryPaths as g, byUpdatedAt as h, isSketchpadId as i, applySketchpadChange as j, ValOps as k, isSafePatchId as l, matchesFilter as m, newSketchpad as n, isMediaFilePath as o, bufferFromDataUrl as p, getFieldsForType as q, resolveExistingJsonPath as r, summaryOf as s, isPublicFilePath as t, uploadRemoteFile as u, validateJsonValuesEntries as v, guessMimeTypeFromPath as w, createMetadataFromBuffer as x, sessionAuth as y, isHttpOps as z };