superbee 0.4.4-pre.13 → 0.4.4-pre.15

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.
@@ -63,8 +63,8 @@ var require_common = __commonJS({
63
63
  return target;
64
64
  }
65
65
  function repeat(string3, count) {
66
- var result = "", cycle;
67
- for (cycle = 0; cycle < count; cycle += 1) {
66
+ var result = "", cycle2;
67
+ for (cycle2 = 0; cycle2 < count; cycle2 += 1) {
68
68
  result += string3;
69
69
  }
70
70
  return result;
@@ -30835,6 +30835,14 @@ var InvalidInputError = class extends Error {
30835
30835
  this.name = "InvalidInputError";
30836
30836
  }
30837
30837
  };
30838
+ var FrontmatterRefusedError = class extends InvalidInputError {
30839
+ code;
30840
+ constructor(code2, detail) {
30841
+ super(`frontmatter cannot be stored: ${detail}`);
30842
+ this.name = "FrontmatterRefusedError";
30843
+ this.code = code2;
30844
+ }
30845
+ };
30838
30846
  var FilesystemIdentityAliasError = class extends InvalidInputError {
30839
30847
  rel;
30840
30848
  segment;
@@ -30859,12 +30867,21 @@ var ConcurrentReplacementError = class extends Error {
30859
30867
  }
30860
30868
  };
30861
30869
 
30862
- // ../core/src/portable-frontmatter.ts
30870
+ // ../core/src/bounded-yaml.ts
30863
30871
  var import_js_yaml = __toESM(require_js_yaml2(), 1);
30864
30872
 
30865
30873
  // ../core/src/frontmatter-contract.ts
30874
+ var FrontmatterLimitError = class extends Error {
30875
+ name = "FrontmatterLimitError";
30876
+ code;
30877
+ constructor(code2, message) {
30878
+ super(message);
30879
+ this.code = code2;
30880
+ }
30881
+ };
30866
30882
  var MalformedDocumentError = class extends Error {
30867
30883
  name = "MalformedDocumentError";
30884
+ code;
30868
30885
  context;
30869
30886
  detail;
30870
30887
  constructor(context, cause) {
@@ -30872,12 +30889,165 @@ var MalformedDocumentError = class extends Error {
30872
30889
  super(
30873
30890
  `malformed frontmatter${context ? ` in '${context}'` : ""}: ${detail} \u2014 fix the YAML or remove the file`
30874
30891
  );
30892
+ this.code = cause instanceof FrontmatterLimitError ? cause.code : "FRONTMATTER_MALFORMED";
30875
30893
  if (context !== void 0) this.context = context;
30876
30894
  this.detail = detail;
30877
30895
  if (cause !== void 0) this.cause = cause;
30878
30896
  }
30879
30897
  };
30880
30898
 
30899
+ // ../core/src/bounded-yaml.ts
30900
+ var FRONTMATTER_LIMITS = Object.freeze({
30901
+ sourceChars: 256 * 1024,
30902
+ depth: 32,
30903
+ aliases: 1e3,
30904
+ expandedNodes: 1e5,
30905
+ expandedChars: 1024 * 1024
30906
+ });
30907
+ var PARSE_NESTING_GUARD = FRONTMATTER_LIMITS.depth * 4;
30908
+ function tooDeep() {
30909
+ return new FrontmatterLimitError("FRONTMATTER_TOO_DEEP", `YAML nesting is deeper than ${FRONTMATTER_LIMITS.depth} levels`);
30910
+ }
30911
+ function tooLarge() {
30912
+ return new FrontmatterLimitError(
30913
+ "FRONTMATTER_ALIAS_LIMIT",
30914
+ `YAML aliases expand to more than ${FRONTMATTER_LIMITS.expandedNodes} nodes or ${FRONTMATTER_LIMITS.expandedChars} characters`
30915
+ );
30916
+ }
30917
+ function cycle() {
30918
+ return new FrontmatterLimitError("FRONTMATTER_CYCLE", "YAML aliases form a cycle");
30919
+ }
30920
+ function scalarExtent(value) {
30921
+ const chars = typeof value === "string" ? value.length : ArrayBuffer.isView(value) ? value.byteLength : 0;
30922
+ return { nodes: 1, chars, depth: 0 };
30923
+ }
30924
+ function isCollection(value) {
30925
+ if (Array.isArray(value)) return true;
30926
+ if (value === null || typeof value !== "object") return false;
30927
+ const prototype = Object.getPrototypeOf(value);
30928
+ return prototype === Object.prototype || prototype === null;
30929
+ }
30930
+ var ExtentMeter = class {
30931
+ known = /* @__PURE__ */ new Map();
30932
+ path = /* @__PURE__ */ new Set();
30933
+ unfinished;
30934
+ constructor(unfinished = /* @__PURE__ */ new Set()) {
30935
+ this.unfinished = unfinished;
30936
+ }
30937
+ measure(value) {
30938
+ if (!isCollection(value)) return scalarExtent(value);
30939
+ const known = this.known.get(value);
30940
+ if (known !== void 0) return known;
30941
+ if (this.path.has(value) || this.unfinished.has(value)) throw cycle();
30942
+ return this.walk(value);
30943
+ }
30944
+ walk(value) {
30945
+ if (this.path.size >= FRONTMATTER_LIMITS.depth) throw tooDeep();
30946
+ this.path.add(value);
30947
+ const keyed = !Array.isArray(value);
30948
+ const extent = { nodes: 1, chars: 0, depth: 1 };
30949
+ for (const [key, child] of Object.entries(value)) {
30950
+ const inner = this.measure(child);
30951
+ extent.nodes += inner.nodes;
30952
+ extent.chars += inner.chars + (keyed ? key.length : 0);
30953
+ extent.depth = Math.max(extent.depth, inner.depth + 1);
30954
+ if (extent.nodes > FRONTMATTER_LIMITS.expandedNodes || extent.chars > FRONTMATTER_LIMITS.expandedChars) throw tooLarge();
30955
+ if (extent.depth > FRONTMATTER_LIMITS.depth) throw tooDeep();
30956
+ }
30957
+ this.path.delete(value);
30958
+ this.known.set(value, extent);
30959
+ return extent;
30960
+ }
30961
+ };
30962
+ var AliasBudget = class {
30963
+ unfinished = /* @__PURE__ */ new Set();
30964
+ finished = /* @__PURE__ */ new Set();
30965
+ meter = new ExtentMeter(this.unfinished);
30966
+ aliases = 0;
30967
+ nodes = 0;
30968
+ chars = 0;
30969
+ /** Wrap the parser's anchor table; the parser reads it only to resolve an alias. */
30970
+ watch(state) {
30971
+ state.anchorMap = new Proxy(state.anchorMap, {
30972
+ get: (target, name, receiver) => {
30973
+ const value = Reflect.get(target, name, receiver);
30974
+ if (typeof name === "string") this.charge(name, value);
30975
+ return value;
30976
+ },
30977
+ set: (target, name, value, receiver) => {
30978
+ if (typeof name === "string") {
30979
+ this.finished.delete(name);
30980
+ if (isCollection(value)) this.unfinished.add(value);
30981
+ }
30982
+ return Reflect.set(target, name, value, receiver);
30983
+ }
30984
+ });
30985
+ }
30986
+ /** Called when an anchored node closes: its anchor now names a complete value. */
30987
+ close(anchor, value) {
30988
+ this.finished.add(anchor);
30989
+ if (isCollection(value)) this.unfinished.delete(value);
30990
+ }
30991
+ charge(name, value) {
30992
+ this.aliases += 1;
30993
+ if (this.aliases > FRONTMATTER_LIMITS.aliases) {
30994
+ throw new FrontmatterLimitError(
30995
+ "FRONTMATTER_ALIAS_LIMIT",
30996
+ `YAML aliases are used more than ${FRONTMATTER_LIMITS.aliases} times`
30997
+ );
30998
+ }
30999
+ if (!this.finished.has(name) && isCollection(value)) throw cycle();
31000
+ const extent = this.meter.measure(value);
31001
+ this.nodes += extent.nodes;
31002
+ this.chars += extent.chars;
31003
+ if (this.nodes > FRONTMATTER_LIMITS.expandedNodes || this.chars > FRONTMATTER_LIMITS.expandedChars) throw tooLarge();
31004
+ }
31005
+ };
31006
+ var MERGE_KEY_LIMIT_REASON = "merge keys exceeded maxTotalMergeKeys";
31007
+ function loadBoundedYaml(source, options = {}) {
31008
+ if (source.length > FRONTMATTER_LIMITS.sourceChars) {
31009
+ throw new FrontmatterLimitError(
31010
+ "FRONTMATTER_TOO_LARGE",
31011
+ `YAML source is longer than ${FRONTMATTER_LIMITS.sourceChars} characters`
31012
+ );
31013
+ }
31014
+ const schema = options.schema === "json" ? import_js_yaml.default.JSON_SCHEMA : options.schema;
31015
+ const budget = new AliasBudget();
31016
+ let watched;
31017
+ let nesting = 0;
31018
+ let value;
31019
+ try {
31020
+ value = import_js_yaml.default.safeLoad(source, {
31021
+ ...schema ? { schema } : {},
31022
+ listener(event, rawState) {
31023
+ const state = rawState;
31024
+ if (state.anchorMap !== watched) {
31025
+ budget.watch(state);
31026
+ watched = state.anchorMap;
31027
+ }
31028
+ if (event === "open") {
31029
+ nesting += 1;
31030
+ if (nesting > PARSE_NESTING_GUARD) throw tooDeep();
31031
+ } else {
31032
+ nesting -= 1;
31033
+ if (state.anchor !== null) budget.close(state.anchor, state.result);
31034
+ }
31035
+ }
31036
+ });
31037
+ } catch (error) {
31038
+ const reason = error.reason;
31039
+ if (typeof reason === "string" && reason.startsWith(MERGE_KEY_LIMIT_REASON)) {
31040
+ throw new FrontmatterLimitError("FRONTMATTER_ALIAS_LIMIT", reason);
31041
+ }
31042
+ throw error;
31043
+ }
31044
+ new ExtentMeter().measure(value);
31045
+ return value;
31046
+ }
31047
+
31048
+ // ../core/src/frontmatter.ts
31049
+ var import_js_yaml2 = __toESM(require_js_yaml2(), 1);
31050
+
30881
31051
  // ../core/src/frontmatter-splitter.ts
30882
31052
  function delimiterLineEnd(input, offset) {
30883
31053
  if (!input.startsWith("---", offset)) return null;
@@ -30907,12 +31077,106 @@ function splitLeadingFrontmatter(raw, context) {
30907
31077
  throw new MalformedDocumentError(context, new Error("unterminated YAML frontmatter delimiter"));
30908
31078
  }
30909
31079
 
31080
+ // ../core/src/frontmatter.ts
31081
+ var YAML_TIMESTAMP_TAG = "tag:yaml.org,2002:timestamp";
31082
+ function requireYamlTimestampType() {
31083
+ const type = import_js_yaml2.default.DEFAULT_SAFE_SCHEMA.implicit.find(
31084
+ (candidate) => candidate.tag === YAML_TIMESTAMP_TAG
31085
+ );
31086
+ if (!type) throw new Error("js-yaml safe schema is missing its timestamp type");
31087
+ return type;
31088
+ }
31089
+ var yamlTimestampType = requireYamlTimestampType();
31090
+ var stringTimestampType = new import_js_yaml2.default.Type(YAML_TIMESTAMP_TAG, {
31091
+ kind: "scalar",
31092
+ resolve: (value) => yamlTimestampType.resolve(value),
31093
+ construct: (value) => value
31094
+ });
31095
+ var losslessDateSchema = new import_js_yaml2.default.Schema({
31096
+ include: [import_js_yaml2.default.DEFAULT_SAFE_SCHEMA],
31097
+ implicit: [stringTimestampType]
31098
+ });
31099
+ var yamlEngine = {
31100
+ parse(input) {
31101
+ return loadBoundedYaml(input, { schema: losslessDateSchema }) ?? {};
31102
+ }
31103
+ };
31104
+ function normalizeFrontmatter(data, options) {
31105
+ const out = { ...data };
31106
+ if (options.preserveTimestamp || options.okfVersion === "0.2") return out;
31107
+ const value = out.timestamp;
31108
+ if (value instanceof Date) {
31109
+ out.timestamp = value.toISOString();
31110
+ } else if (typeof value === "number" && Number.isFinite(value)) {
31111
+ out.timestamp = new Date(value).toISOString();
31112
+ } else if (typeof value === "string" && yamlTimestampType.resolve(value)) {
31113
+ const parsed = yamlTimestampType.construct(value);
31114
+ if (parsed instanceof Date) out.timestamp = parsed.toISOString();
31115
+ }
31116
+ return out;
31117
+ }
31118
+ function parseMarkdown(raw, context, options = {}) {
31119
+ const split = splitLeadingFrontmatter(raw, context);
31120
+ if (!("yamlSource" in split)) return { frontmatter: {}, body: split.body };
31121
+ return { frontmatter: parseFrontmatter(split.yamlSource, context, options), body: split.body };
31122
+ }
31123
+ function parseFrontmatter(source, context, options = {}) {
31124
+ let parsed;
31125
+ try {
31126
+ parsed = yamlEngine.parse(source);
31127
+ } catch (err) {
31128
+ throw new MalformedDocumentError(context, err);
31129
+ }
31130
+ return normalizeFrontmatter(parsed, options);
31131
+ }
31132
+ function isStackExhaustion(error) {
31133
+ if (error instanceof RangeError) return /call stack/i.test(error.message);
31134
+ return error?.name === "InternalError" && /recursion/i.test(error.message);
31135
+ }
31136
+ function stringifyFrontmatter(data) {
31137
+ let dumped;
31138
+ try {
31139
+ dumped = import_js_yaml2.default.safeDump(data).trim();
31140
+ } catch (error) {
31141
+ if (isStackExhaustion(error)) throw new FrontmatterRefusedError("FRONTMATTER_TOO_DEEP", `YAML nesting is deeper than ${FRONTMATTER_LIMITS.depth} levels`);
31142
+ throw error;
31143
+ }
31144
+ try {
31145
+ yamlEngine.parse(`${dumped}
31146
+ `);
31147
+ } catch (error) {
31148
+ if (error instanceof FrontmatterLimitError) throw new FrontmatterRefusedError(error.code, error.message);
31149
+ const detail = (error instanceof Error ? error.message : String(error)).split("\n")[0] ?? "";
31150
+ throw new FrontmatterRefusedError("FRONTMATTER_MALFORMED", detail);
31151
+ }
31152
+ return dumped;
31153
+ }
31154
+ function normalizeDocumentBodyForStorage(body) {
31155
+ return body.endsWith("\n") ? body : `${body}
31156
+ `;
31157
+ }
31158
+ function stringifyWithData(data, body) {
31159
+ return stringifyWithSerializedFrontmatter(stringifyFrontmatter(data), body);
31160
+ }
31161
+ function stringifyWithSerializedFrontmatter(dumped, body) {
31162
+ const content3 = body ?? "";
31163
+ const newline = (value) => value.endsWith("\n") ? value : `${value}
31164
+ `;
31165
+ if (dumped === "{}") return normalizeDocumentBodyForStorage(content3);
31166
+ return `---
31167
+ ${newline(dumped)}---
31168
+ ${normalizeDocumentBodyForStorage(content3)}`;
31169
+ }
31170
+ function stringifyDoc(frontmatter2, body) {
31171
+ return stringifyWithData(frontmatter2, body);
31172
+ }
31173
+
30910
31174
  // ../core/src/portable-frontmatter.ts
30911
31175
  function parseLeadingFrontmatter(raw, context) {
30912
31176
  const split = splitLeadingFrontmatter(raw, context);
30913
31177
  if (!("yamlSource" in split)) return {};
30914
31178
  try {
30915
- const parsed = import_js_yaml.default.safeLoad(split.yamlSource);
31179
+ const parsed = loadBoundedYaml(split.yamlSource);
30916
31180
  if (parsed === void 0 || parsed === null) return {};
30917
31181
  if (typeof parsed !== "object" || Array.isArray(parsed)) {
30918
31182
  throw new TypeError("YAML frontmatter must be a mapping");
@@ -30923,6 +31187,18 @@ function parseLeadingFrontmatter(raw, context) {
30923
31187
  throw new MalformedDocumentError(context, error);
30924
31188
  }
30925
31189
  }
31190
+ function assertStorableFrontmatter(raw) {
31191
+ try {
31192
+ parseLeadingFrontmatter(raw);
31193
+ const split = splitLeadingFrontmatter(raw);
31194
+ if ("yamlSource" in split) parseFrontmatter(split.yamlSource);
31195
+ } catch (error) {
31196
+ if (error instanceof MalformedDocumentError && error.code !== "FRONTMATTER_MALFORMED") {
31197
+ throw new FrontmatterRefusedError(error.code, error.detail);
31198
+ }
31199
+ if (!(error instanceof MalformedDocumentError)) throw error;
31200
+ }
31201
+ }
30926
31202
 
30927
31203
  // ../core/src/paths.ts
30928
31204
  var RESERVED_FILENAMES = ["index.md", "log.md"];
@@ -31282,82 +31558,6 @@ function inventoryDigest(inventory) {
31282
31558
  return `sha256:${sha256HexOfUtf8(JSON.stringify(inventory.map((row) => [row.id, row.version])))}`;
31283
31559
  }
31284
31560
 
31285
- // ../core/src/frontmatter.ts
31286
- var import_js_yaml2 = __toESM(require_js_yaml2(), 1);
31287
- var YAML_TIMESTAMP_TAG = "tag:yaml.org,2002:timestamp";
31288
- function requireYamlTimestampType() {
31289
- const type = import_js_yaml2.default.DEFAULT_SAFE_SCHEMA.implicit.find(
31290
- (candidate) => candidate.tag === YAML_TIMESTAMP_TAG
31291
- );
31292
- if (!type) throw new Error("js-yaml safe schema is missing its timestamp type");
31293
- return type;
31294
- }
31295
- var yamlTimestampType = requireYamlTimestampType();
31296
- var stringTimestampType = new import_js_yaml2.default.Type(YAML_TIMESTAMP_TAG, {
31297
- kind: "scalar",
31298
- resolve: (value) => yamlTimestampType.resolve(value),
31299
- construct: (value) => value
31300
- });
31301
- var losslessDateSchema = new import_js_yaml2.default.Schema({
31302
- include: [import_js_yaml2.default.DEFAULT_SAFE_SCHEMA],
31303
- implicit: [stringTimestampType]
31304
- });
31305
- var yamlEngine = {
31306
- parse(input) {
31307
- return import_js_yaml2.default.safeLoad(input, { schema: losslessDateSchema }) ?? {};
31308
- }
31309
- };
31310
- function normalizeFrontmatter(data, options) {
31311
- const out = { ...data };
31312
- if (options.preserveTimestamp || options.okfVersion === "0.2") return out;
31313
- const value = out.timestamp;
31314
- if (value instanceof Date) {
31315
- out.timestamp = value.toISOString();
31316
- } else if (typeof value === "number" && Number.isFinite(value)) {
31317
- out.timestamp = new Date(value).toISOString();
31318
- } else if (typeof value === "string" && yamlTimestampType.resolve(value)) {
31319
- const parsed = yamlTimestampType.construct(value);
31320
- if (parsed instanceof Date) out.timestamp = parsed.toISOString();
31321
- }
31322
- return out;
31323
- }
31324
- function parseMarkdown(raw, context, options = {}) {
31325
- const split = splitLeadingFrontmatter(raw, context);
31326
- if (!("yamlSource" in split)) return { frontmatter: {}, body: split.body };
31327
- return { frontmatter: parseFrontmatter(split.yamlSource, context, options), body: split.body };
31328
- }
31329
- function parseFrontmatter(source, context, options = {}) {
31330
- let parsed;
31331
- try {
31332
- parsed = yamlEngine.parse(source);
31333
- } catch (err) {
31334
- throw new MalformedDocumentError(context, err);
31335
- }
31336
- return normalizeFrontmatter(parsed, options);
31337
- }
31338
- function stringifyFrontmatter(data) {
31339
- return import_js_yaml2.default.safeDump(data).trim();
31340
- }
31341
- function normalizeDocumentBodyForStorage(body) {
31342
- return body.endsWith("\n") ? body : `${body}
31343
- `;
31344
- }
31345
- function stringifyWithData(data, body) {
31346
- return stringifyWithSerializedFrontmatter(stringifyFrontmatter(data), body);
31347
- }
31348
- function stringifyWithSerializedFrontmatter(dumped, body) {
31349
- const content3 = body ?? "";
31350
- const newline = (value) => value.endsWith("\n") ? value : `${value}
31351
- `;
31352
- if (dumped === "{}") return normalizeDocumentBodyForStorage(content3);
31353
- return `---
31354
- ${newline(dumped)}---
31355
- ${normalizeDocumentBodyForStorage(content3)}`;
31356
- }
31357
- function stringifyDoc(frontmatter2, body) {
31358
- return stringifyWithData(frontmatter2, body);
31359
- }
31360
-
31361
31561
  // ../core/src/code-unit-order.ts
31362
31562
  function compareCodeUnits(a, b) {
31363
31563
  return a < b ? -1 : a > b ? 1 : 0;
@@ -31769,24 +31969,7 @@ function hasSourceIdentity(sources, identity) {
31769
31969
  return Array.isArray(sources) && sources.some((entry) => matchesSourceIdentity(entry, identity));
31770
31970
  }
31771
31971
 
31772
- // ../core/src/engine.ts
31773
- async function readBundleOkfVersion(backend) {
31774
- const index2 = await backend.readReserved("", "index.md");
31775
- if (!index2) return void 0;
31776
- const value = parseLeadingFrontmatter(index2.content, "index.md").okf_version;
31777
- return typeof value === "string" && value.trim() !== "" ? value : void 0;
31778
- }
31779
- function assertReadableConceptId(id) {
31780
- assertSafeConceptId(id);
31781
- const rel = pathFromConceptId(id);
31782
- if (isReservedFile(rel)) {
31783
- throw new InvalidInputError(`'${id}' is a reserved file (index.md / log.md), not a concept document.`);
31784
- }
31785
- }
31786
- async function readDocVersioned(backend, id) {
31787
- assertReadableConceptId(id);
31788
- return backend.read(id);
31789
- }
31972
+ // ../core/src/document-scan.ts
31790
31973
  function isEnoent(err) {
31791
31974
  return typeof err === "object" && err !== null && err.code === "ENOENT";
31792
31975
  }
@@ -31817,6 +32000,25 @@ async function readManyExisting(backend, ids, onMalformed, onAliased) {
31817
32000
  return out;
31818
32001
  }
31819
32002
  }
32003
+
32004
+ // ../core/src/engine.ts
32005
+ async function readBundleOkfVersion(backend) {
32006
+ const index2 = await backend.readReserved("", "index.md");
32007
+ if (!index2) return void 0;
32008
+ const value = parseLeadingFrontmatter(index2.content, "index.md").okf_version;
32009
+ return typeof value === "string" && value.trim() !== "" ? value : void 0;
32010
+ }
32011
+ function assertReadableConceptId(id) {
32012
+ assertSafeConceptId(id);
32013
+ const rel = pathFromConceptId(id);
32014
+ if (isReservedFile(rel)) {
32015
+ throw new InvalidInputError(`'${id}' is a reserved file (index.md / log.md), not a concept document.`);
32016
+ }
32017
+ }
32018
+ async function readDocVersioned(backend, id) {
32019
+ assertReadableConceptId(id);
32020
+ return backend.read(id);
32021
+ }
31820
32022
  async function scanMatching(backend, filter, onSkip) {
31821
32023
  const ids = await backend.list(filter.prefix);
31822
32024
  const results = [];
@@ -31935,6 +32137,13 @@ function resolveContentType(key, override) {
31935
32137
  return inferContentTypeFromDocKey(key) ?? DEFAULT_BLOB_CONTENT_TYPE;
31936
32138
  }
31937
32139
 
32140
+ // ../core/src/reserved-write.ts
32141
+ function assertStorableReservedWrite(dir, name, content3) {
32142
+ assertSafeReservedDir(dir);
32143
+ assertSafeReservedFilename(name);
32144
+ if (name.endsWith(".md")) assertStorableFrontmatter(content3);
32145
+ }
32146
+
31938
32147
  // ../core/src/filesystem-identity.ts
31939
32148
  import { promises as fs2 } from "node:fs";
31940
32149
  import path2 from "node:path";
@@ -33289,8 +33498,7 @@ var FilesystemBackend = class _FilesystemBackend {
33289
33498
  return { content: content3, version: versionOfBytes(content3) };
33290
33499
  }
33291
33500
  async writeReserved(dir, name, content3, options = {}) {
33292
- assertSafeReservedDir(dir);
33293
- assertSafeReservedFilename(name);
33501
+ assertStorableReservedWrite(dir, name, content3);
33294
33502
  const rel = reservedPath(dir, name);
33295
33503
  return this.#mutateExact(rel, async (target) => {
33296
33504
  if (options.expectedVersion !== void 0) {