@carbonenginejs/runtime-resource 0.9.0 → 0.9.1

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 (74) hide show
  1. package/NOTICE +5 -3
  2. package/README.md +1 -1
  3. package/dist/CjsResourceSource.js +9 -0
  4. package/dist/CjsResourceSource.js.map +1 -1
  5. package/dist/format/CjsFormat.js +5 -0
  6. package/dist/format/CjsFormat.js.map +1 -1
  7. package/dist/formats/black/core/CjsBlackBinaryReader.js +4 -0
  8. package/dist/formats/black/core/CjsBlackBinaryReader.js.map +1 -1
  9. package/dist/formats/black/core/CjsBlackPropertyReaders.js +5 -0
  10. package/dist/formats/black/core/CjsBlackPropertyReaders.js.map +1 -1
  11. package/dist/formats/black/core/CjsBlackSchemaRegistry.js +4 -0
  12. package/dist/formats/black/core/CjsBlackSchemaRegistry.js.map +1 -1
  13. package/dist/formats/black/core/black-schema-v1-2026-07-23.json.js +4 -0
  14. package/dist/formats/black/core/black-schema-v1-2026-07-23.json.js.map +1 -0
  15. package/dist/formats/black/core/blackDefinitions.js +1 -1
  16. package/dist/formats/black/core/blackDefinitions.js.map +1 -1
  17. package/dist/formats/black/core/blackSchema.js +1 -1
  18. package/dist/formats/bnk/core/musicNodes.js +4 -0
  19. package/dist/formats/bnk/core/musicNodes.js.map +1 -1
  20. package/dist/formats/cmf/core/binary.js +5 -0
  21. package/dist/formats/cmf/core/binary.js.map +1 -1
  22. package/dist/formats/dds/CjsDdsFormat.js +7 -0
  23. package/dist/formats/dds/CjsDdsFormat.js.map +1 -1
  24. package/dist/formats/dds/core/bc7.js +7 -2
  25. package/dist/formats/dds/core/bc7.js.map +1 -1
  26. package/dist/formats/fbx/core/helpers.js +10 -0
  27. package/dist/formats/fbx/core/helpers.js.map +1 -1
  28. package/dist/formats/flac/CjsFlacFormat.js +6 -0
  29. package/dist/formats/flac/CjsFlacFormat.js.map +1 -1
  30. package/dist/formats/gif/CjsGifFormat.js +5 -0
  31. package/dist/formats/gif/CjsGifFormat.js.map +1 -1
  32. package/dist/formats/jpeg/CjsJpegFormat.js +6 -0
  33. package/dist/formats/jpeg/CjsJpegFormat.js.map +1 -1
  34. package/dist/formats/jpeg/core/jpeg.js +10 -0
  35. package/dist/formats/jpeg/core/jpeg.js.map +1 -1
  36. package/dist/formats/mp3/CjsMp3Format.js +5 -0
  37. package/dist/formats/mp3/CjsMp3Format.js.map +1 -1
  38. package/dist/formats/mp4/CjsMp4Format.js +6 -0
  39. package/dist/formats/mp4/CjsMp4Format.js.map +1 -1
  40. package/dist/formats/ogg/CjsOggFormat.js +6 -0
  41. package/dist/formats/ogg/CjsOggFormat.js.map +1 -1
  42. package/dist/formats/ogg/core/vorbis.js +5 -0
  43. package/dist/formats/ogg/core/vorbis.js.map +1 -1
  44. package/dist/formats/png/CjsPngFormat.js +6 -0
  45. package/dist/formats/png/CjsPngFormat.js.map +1 -1
  46. package/dist/formats/red/core/blackDefinitions.js +1 -1
  47. package/dist/formats/stl/core/stl.js +5 -0
  48. package/dist/formats/stl/core/stl.js.map +1 -1
  49. package/dist/formats/tga/CjsTgaFormat.js +5 -0
  50. package/dist/formats/tga/CjsTgaFormat.js.map +1 -1
  51. package/dist/formats/wav/CjsWavFormat.js +6 -0
  52. package/dist/formats/wav/CjsWavFormat.js.map +1 -1
  53. package/dist/formats/webm/CjsWebmFormat.js +6 -0
  54. package/dist/formats/webm/CjsWebmFormat.js.map +1 -1
  55. package/dist/formats/webp/CjsWebpFormat.js +5 -0
  56. package/dist/formats/webp/CjsWebpFormat.js.map +1 -1
  57. package/dist/formats/wem/CjsWemFormat.js +3 -2
  58. package/dist/formats/wem/CjsWemFormat.js.map +1 -1
  59. package/dist/formats/yaml/CjsYamlFormat.js +6 -0
  60. package/dist/formats/yaml/CjsYamlFormat.js.map +1 -1
  61. package/dist/formats/yaml/core/CjsYamlReader.js +6 -0
  62. package/dist/formats/yaml/core/CjsYamlReader.js.map +1 -1
  63. package/docs/README.md +4 -0
  64. package/docs/formats/README.md +7 -6
  65. package/docs/formats/gr2.md +161 -0
  66. package/docs/reference/classes/README.md +33 -0
  67. package/docs/reference/classes/core.md +106 -0
  68. package/docs/reference/classes/dropped.md +46 -0
  69. package/docs/reference/classes/formats.md +522 -0
  70. package/docs/reference/classes/resources.md +346 -0
  71. package/docs/reference/classes/texture.md +26 -0
  72. package/package.json +1 -1
  73. package/dist/formats/black/core/black-schema-v1-2026-07-11.json.js +0 -4
  74. package/dist/formats/black/core/black-schema-v1-2026-07-11.json.js.map +0 -1
@@ -2,6 +2,12 @@ import { CjsYamlReader } from './core/CjsYamlReader.js';
2
2
  import { DEFAULT_VALUES, normalizeValues, toJsonGraph, OUTPUT_RAW, OUTPUT_DOCUMENT, OUTPUT_PAYLOAD, OUTPUT_JSON, TAG_PRESERVE, TAG_REJECT, TAG_HANDLE } from './core/helpers.js';
3
3
 
4
4
  const FORMAT_NAME = "CjsYamlFormat";
5
+
6
+ /**
7
+ * YAML format profile that parses YAML text into payload, JSON-graph, raw,
8
+ * or document output with configurable tag policies, alias limits, and
9
+ * identity/reference markers.
10
+ */
5
11
  class CjsYamlFormat {
6
12
  #values = DEFAULT_VALUES;
7
13
  constructor(options = {}) {
@@ -1 +1 @@
1
- {"version":3,"file":"CjsYamlFormat.js","sources":["../../../../src/formats/yaml/CjsYamlFormat.js"],"sourcesContent":["import { CjsYamlReader } from \"./core/CjsYamlReader.js\";\nimport {\n DEFAULT_VALUES,\n OUTPUT_DOCUMENT,\n OUTPUT_JSON,\n OUTPUT_PAYLOAD,\n OUTPUT_RAW,\n TAG_HANDLE,\n TAG_PRESERVE,\n TAG_REJECT,\n normalizeValues,\n toJsonGraph\n} from \"./core/helpers.js\";\n\nconst FORMAT_NAME = \"CjsYamlFormat\";\n\nexport class CjsYamlFormat\n{\n #values = DEFAULT_VALUES;\n\n constructor(options = {})\n {\n this.SetValues(options);\n }\n\n SetValues(options = {})\n {\n this.#values = normalizeValues(this.#values, options, FORMAT_NAME);\n return this;\n }\n\n GetValues(options = {})\n {\n return normalizeValues(this.#values, options, FORMAT_NAME);\n }\n\n Read(input, options = {})\n {\n return CjsYamlFormat.read(input, this.GetValues(options));\n }\n\n ReadPayload(input, options = {})\n {\n return CjsYamlFormat.readPayload(input, this.GetValues(options));\n }\n\n ReadRaw(input, options = {})\n {\n return CjsYamlFormat.readRaw(input, this.GetValues(options));\n }\n\n ReadDocument(input, options = {})\n {\n return CjsYamlFormat.readDocument(input, this.GetValues(options));\n }\n\n Inspect(input, options = {})\n {\n return CjsYamlFormat.inspect(input, this.GetValues(options));\n }\n\n ToJSON(value, options = {})\n {\n return toJsonGraph(value, this.GetValues(options));\n }\n\n static read(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n if (values.emit === OUTPUT_RAW) return new CjsYamlReader(input, values).ReadRaw();\n if (values.emit === OUTPUT_DOCUMENT) return new CjsYamlReader(input, values).ReadDocument();\n return new CjsYamlReader(input, values).ReadPayload();\n }\n\n static readPayload(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n return new CjsYamlReader(input, values).ReadPayload();\n }\n\n static readRaw(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n return new CjsYamlReader(input, values).ReadRaw();\n }\n\n static readDocument(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n return new CjsYamlReader(input, values).ReadDocument();\n }\n\n static inspect(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n return new CjsYamlReader(input, values).Inspect();\n }\n\n static toJSON(value, options = {})\n {\n return toJsonGraph(value, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Emit targets for this format (canonical frozen enum).\n */\n static Output = Object.freeze({\n JSON: OUTPUT_JSON,\n PAYLOAD: OUTPUT_PAYLOAD,\n RAW: OUTPUT_RAW,\n DOCUMENT: OUTPUT_DOCUMENT\n });\n static TAG_PRESERVE = TAG_PRESERVE;\n static TAG_REJECT = TAG_REJECT;\n static TAG_HANDLE = TAG_HANDLE;\n static id = \"yaml\";\n static extensions = Object.freeze([ \".yaml\", \".yml\" ]);\n static type = Object.freeze([ \"data\" ]);\n static mediaTypes = Object.freeze([ \"data\" ]);\n static inputTypes = Object.freeze([ \"yaml\" ]);\n static outputTypes = Object.freeze([ OUTPUT_JSON, OUTPUT_PAYLOAD ]);\n static debugOutputTypes = Object.freeze([ OUTPUT_RAW, OUTPUT_DOCUMENT ]);\n}\n\nexport default CjsYamlFormat;\n"],"names":["FORMAT_NAME","CjsYamlFormat","DEFAULT_VALUES","constructor","options","SetValues","normalizeValues","GetValues","Read","input","read","ReadPayload","readPayload","ReadRaw","readRaw","ReadDocument","readDocument","Inspect","inspect","ToJSON","value","toJsonGraph","values","emit","OUTPUT_RAW","CjsYamlReader","OUTPUT_DOCUMENT","toJSON","Output","Object","freeze","JSON","OUTPUT_JSON","PAYLOAD","OUTPUT_PAYLOAD","RAW","DOCUMENT","TAG_PRESERVE","TAG_REJECT","TAG_HANDLE","id","extensions","type","mediaTypes","inputTypes","outputTypes","debugOutputTypes"],"mappings":";;;AAcA,MAAMA,WAAW,GAAG,eAAe;AAE5B,MAAMC,aAAa,CAC1B;EACI,OAAO,GAAGC,cAAc;AAExBC,EAAAA,WAAWA,CAACC,OAAO,GAAG,EAAE,EACxB;AACI,IAAA,IAAI,CAACC,SAAS,CAACD,OAAO,CAAC;AAC3B,EAAA;AAEAC,EAAAA,SAASA,CAACD,OAAO,GAAG,EAAE,EACtB;AACI,IAAA,IAAI,CAAC,OAAO,GAAGE,eAAe,CAAC,IAAI,CAAC,OAAO,EAAEF,OAAO,EAAEJ,WAAW,CAAC;AAClE,IAAA,OAAO,IAAI;AACf,EAAA;AAEAO,EAAAA,SAASA,CAACH,OAAO,GAAG,EAAE,EACtB;IACI,OAAOE,eAAe,CAAC,IAAI,CAAC,OAAO,EAAEF,OAAO,EAAE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O,EAAE;AACrD,EAAA;EAEA,OAAOU,MAAMA,CAACP,KAAK,EAAEhB,OAAO,GAAG,EAAE,EACjC;AACI,IAAA,OAAOiB,WAAW,CAACD,KAAK,EAAEd,eAAe,CAACJ,cAAc,EAAEE,OAAO,EAAEJ,WAAW,CAAC,CAAC;AACpF,EAAA;;AAEA;AACJ;AACA;AACI,EAAA,OAAO4B,MAAM,GAAGC,MAAM,CAACC,MAAM,CAAC;AAC1BC,IAAAA,IAAI,EAAEC,WAAW;AACjBC,IAAAA,OAAO,EAAEC,cAAc;AACvBC,IAAAA,GAAG,EAAEX,UAAU;AACfY,IAAAA,QAAQ,EAAEV;AACd,GAAC,CAAC;EACF,OAAOW,YAAY,GAAGA,YAAY;EAClC,OAAOC,UAAU,GAAGA,UAAU;EAC9B,OAAOC,UAAU,GAAGA,UAAU;EAC9B,OAAOC,EAAE,GAAG,MAAM;EAClB,OAAOC,UAAU,GAAGZ,MAAM,CAACC,MAAM,CAAC,CAAE,OAAO,EAAE,MAAM,CAAE,CAAC;EACtD,OAAOY,IAAI,GAAGb,MAAM,CAACC,MAAM,CAAC,CAAE,MAAM,CAAE,CAAC;EACvC,OAAOa,UAAU,GAAGd,MAAM,CAACC,MAAM,CAAC,CAAE,MAAM,CAAE,CAAC;EAC7C,OAAOc,UAAU,GAAGf,MAAM,CAACC,MAAM,CAAC,CAAE,MAAM,CAAE,CAAC;EAC7C,OAAOe,WAAW,GAAGhB,MAAM,CAACC,MAAM,CAAC,CAAEE,WAAW,EAAEE,cAAc,CAAE,CAAC;EACnE,OAAOY,gBAAgB,GAAGjB,MAAM,CAACC,MAAM,CAAC,CAAEN,UAAU,EAAEE,eAAe,CAAE,CAAC;AAC5E;;;;"}
1
+ {"version":3,"file":"CjsYamlFormat.js","sources":["../../../../src/formats/yaml/CjsYamlFormat.js"],"sourcesContent":["import { CjsYamlReader } from \"./core/CjsYamlReader.js\";\nimport {\n DEFAULT_VALUES,\n OUTPUT_DOCUMENT,\n OUTPUT_JSON,\n OUTPUT_PAYLOAD,\n OUTPUT_RAW,\n TAG_HANDLE,\n TAG_PRESERVE,\n TAG_REJECT,\n normalizeValues,\n toJsonGraph\n} from \"./core/helpers.js\";\n\nconst FORMAT_NAME = \"CjsYamlFormat\";\n\n/**\n * YAML format profile that parses YAML text into payload, JSON-graph, raw,\n * or document output with configurable tag policies, alias limits, and\n * identity/reference markers.\n */\nexport class CjsYamlFormat\n{\n #values = DEFAULT_VALUES;\n\n constructor(options = {})\n {\n this.SetValues(options);\n }\n\n SetValues(options = {})\n {\n this.#values = normalizeValues(this.#values, options, FORMAT_NAME);\n return this;\n }\n\n GetValues(options = {})\n {\n return normalizeValues(this.#values, options, FORMAT_NAME);\n }\n\n Read(input, options = {})\n {\n return CjsYamlFormat.read(input, this.GetValues(options));\n }\n\n ReadPayload(input, options = {})\n {\n return CjsYamlFormat.readPayload(input, this.GetValues(options));\n }\n\n ReadRaw(input, options = {})\n {\n return CjsYamlFormat.readRaw(input, this.GetValues(options));\n }\n\n ReadDocument(input, options = {})\n {\n return CjsYamlFormat.readDocument(input, this.GetValues(options));\n }\n\n Inspect(input, options = {})\n {\n return CjsYamlFormat.inspect(input, this.GetValues(options));\n }\n\n ToJSON(value, options = {})\n {\n return toJsonGraph(value, this.GetValues(options));\n }\n\n static read(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n if (values.emit === OUTPUT_RAW) return new CjsYamlReader(input, values).ReadRaw();\n if (values.emit === OUTPUT_DOCUMENT) return new CjsYamlReader(input, values).ReadDocument();\n return new CjsYamlReader(input, values).ReadPayload();\n }\n\n static readPayload(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n return new CjsYamlReader(input, values).ReadPayload();\n }\n\n static readRaw(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n return new CjsYamlReader(input, values).ReadRaw();\n }\n\n static readDocument(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n return new CjsYamlReader(input, values).ReadDocument();\n }\n\n static inspect(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n return new CjsYamlReader(input, values).Inspect();\n }\n\n static toJSON(value, options = {})\n {\n return toJsonGraph(value, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Emit targets for this format (canonical frozen enum).\n */\n static Output = Object.freeze({\n JSON: OUTPUT_JSON,\n PAYLOAD: OUTPUT_PAYLOAD,\n RAW: OUTPUT_RAW,\n DOCUMENT: OUTPUT_DOCUMENT\n });\n static TAG_PRESERVE = TAG_PRESERVE;\n static TAG_REJECT = TAG_REJECT;\n static TAG_HANDLE = TAG_HANDLE;\n static id = \"yaml\";\n static extensions = Object.freeze([ \".yaml\", \".yml\" ]);\n static type = Object.freeze([ \"data\" ]);\n static mediaTypes = Object.freeze([ \"data\" ]);\n static inputTypes = Object.freeze([ \"yaml\" ]);\n static outputTypes = Object.freeze([ OUTPUT_JSON, OUTPUT_PAYLOAD ]);\n static debugOutputTypes = Object.freeze([ OUTPUT_RAW, OUTPUT_DOCUMENT ]);\n}\n\nexport default CjsYamlFormat;\n"],"names":["FORMAT_NAME","CjsYamlFormat","DEFAULT_VALUES","constructor","options","SetValues","normalizeValues","GetValues","Read","input","read","ReadPayload","readPayload","ReadRaw","readRaw","ReadDocument","readDocument","Inspect","inspect","ToJSON","value","toJsonGraph","values","emit","OUTPUT_RAW","CjsYamlReader","OUTPUT_DOCUMENT","toJSON","Output","Object","freeze","JSON","OUTPUT_JSON","PAYLOAD","OUTPUT_PAYLOAD","RAW","DOCUMENT","TAG_PRESERVE","TAG_REJECT","TAG_HANDLE","id","extensions","type","mediaTypes","inputTypes","outputTypes","debugOutputTypes"],"mappings":";;;AAcA,MAAMA,WAAW,GAAG,eAAe;;AAEnC;AACA;AACA;AACA;AACA;AACO,MAAMC,aAAa,CAC1B;EACI,OAAO,GAAGC,cAAc;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AACC,MAAM,CAAC,CAAE,MAAM,CAAE,CAAC;EAC7C,OAAOe,WAAW,GAAGhB,MAAM,CAACC,MAAM,CAAC,CAAEE,WAAW,EAAEE,cAAc,CAAE,CAAC;EACnE,OAAOY,gBAAgB,GAAGjB,MAAM,CAACC,MAAM,CAAC,CAAEN,UAAU,EAAEE,eAAe,CAAE,CAAC;AAC5E;;;;"}
@@ -24,6 +24,12 @@ function defineMappingValue(target, key, value) {
24
24
  writable: true
25
25
  });
26
26
  }
27
+
28
+ /**
29
+ * Construction-bound reader that parses one YAML source with the `yaml`
30
+ * library and produces the format's payload, raw, or document graphs while
31
+ * enforcing tag policy and alias limits.
32
+ */
27
33
  class CjsYamlReader extends CjsReader {
28
34
  constructor(input, options = {}) {
29
35
  super(options);
@@ -1 +1 @@
1
- {"version":3,"file":"CjsYamlReader.js","sources":["../../../../../src/formats/yaml/core/CjsYamlReader.js"],"sourcesContent":["import {\n LineCounter,\n isAlias,\n isMap,\n isScalar,\n isSeq,\n parseDocument,\n visit\n} from \"yaml\";\n\nimport { CjsReader } from \"../../../format/CjsReader.js\";\nimport { TAG_HANDLE, TAG_PRESERVE, TAG_REJECT, toJsonGraph } from \"./helpers.js\";\n\nconst TAG_PREFIX = \"tag:yaml.org,2002:\";\nconst PYTHON_TUPLE = `${TAG_PREFIX}python/tuple`;\nconst PYTHON_UNICODE = `${TAG_PREFIX}python/unicode`;\nconst PYTHON_PROJECTED_DECAL = `${TAG_PREFIX}python/object:paperDoll.ProjectedDecal`;\nconst PYTHON_PART_METADATA = `${TAG_PREFIX}python/object:paperDoll.AvatarPartMetaData`;\n\nconst STANDARD_TAGS = new Set([\n \"binary\", \"bool\", \"float\", \"int\", \"map\", \"merge\", \"null\", \"omap\",\n \"pairs\", \"seq\", \"set\", \"str\", \"timestamp\"\n].map(name => `${TAG_PREFIX}${name}`));\n\nfunction canonicalTag(tag)\n{\n if (typeof tag !== \"string\") return tag;\n if (tag.startsWith(\"!!\")) return `${TAG_PREFIX}${tag.slice(2)}`;\n return tag;\n}\n\nfunction displayMessage(error)\n{\n return String(error && error.message ? error.message : error).trim();\n}\n\nfunction defineMappingValue(target, key, value)\n{\n Object.defineProperty(target, key, {\n value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n}\n\nexport class CjsYamlReader extends CjsReader\n{\n constructor(input, options = {})\n {\n super(options);\n\n if (typeof input !== \"string\")\n {\n throw new TypeError(\"CjsYamlFormat input must be a YAML string\");\n }\n\n this.source = input;\n this.lineCounter = new LineCounter();\n this.document = parseDocument(input, {\n keepSourceTokens: true,\n lineCounter: this.lineCounter,\n prettyErrors: true,\n strict: true,\n uniqueKeys: this.options.uniqueKeys\n });\n this.inventory = this.BuildInventory();\n }\n\n Read()\n {\n return this.ReadPayload();\n }\n\n ReadPayload()\n {\n return toJsonGraph(this.ReadRaw(), this.options);\n }\n\n ReadRaw()\n {\n this.AssertSyntax();\n this.AssertAliasLimit();\n return this.Convert(this.document.contents, new Map());\n }\n\n ReadDocument()\n {\n let value = null;\n const errors = this.inventory.errors.slice();\n\n if (!errors.length)\n {\n try\n {\n this.AssertAliasLimit();\n value = this.Convert(this.document.contents, new Map());\n }\n catch (error)\n {\n errors.push(this.DescribeError(error));\n }\n }\n\n return {\n format: { id: \"yaml\" },\n source: { name: this.options.sourceName, length: this.source.length },\n root: { kind: this.RootKind() },\n value,\n tags: this.inventory.tags,\n anchors: this.inventory.anchors,\n aliases: this.inventory.aliases,\n warnings: this.inventory.warnings,\n errors\n };\n }\n\n Inspect()\n {\n return {\n format: { id: \"yaml\" },\n source: { name: this.options.sourceName, length: this.source.length },\n root: { kind: this.RootKind() },\n tags: this.inventory.tags,\n anchors: this.inventory.anchors,\n aliases: this.inventory.aliases,\n warnings: this.inventory.warnings,\n errors: this.inventory.errors\n };\n }\n\n RootKind()\n {\n const node = this.document.contents;\n if (node === null) return \"null\";\n if (isMap(node)) return \"mapping\";\n if (isSeq(node)) return \"sequence\";\n if (isScalar(node)) return \"scalar\";\n if (isAlias(node)) return \"alias\";\n return \"unknown\";\n }\n\n AssertSyntax()\n {\n if (!this.document.errors.length) return;\n const first = this.document.errors[0];\n const source = this.options.sourceName ? ` in ${this.options.sourceName}` : \"\";\n throw new SyntaxError(`CjsYamlFormat${source}: ${displayMessage(first)}`);\n }\n\n AssertAliasLimit()\n {\n if (this.inventory.aliases.length <= this.options.maxAliasCount) return;\n const source = this.options.sourceName ? ` in ${this.options.sourceName}` : \"\";\n throw new RangeError(`CjsYamlFormat${source}: alias count ${this.inventory.aliases.length} exceeds maxAliasCount ${this.options.maxAliasCount}`);\n }\n\n Convert(node, memo)\n {\n if (node === null || node === undefined) return null;\n\n if (isAlias(node))\n {\n const source = node.resolve(this.document);\n if (!source) throw this.NodeError(node, `unresolved alias \"${node.source}\"`);\n return this.Convert(source, memo);\n }\n\n if (memo.has(node)) return memo.get(node);\n\n const tag = this.CustomTag(node);\n if (tag)\n {\n this.AssertTagAllowed(tag, node);\n const handler = this.FindTagHandler(tag);\n\n if (handler)\n {\n const value = this.ConvertBase(node, memo, true);\n const handled = handler(value, this.TagContext(tag, node));\n memo.set(node, handled);\n return handled;\n }\n\n if (tag === PYTHON_TUPLE)\n {\n if (!isSeq(node)) throw this.NodeError(node, `${tag} must decorate a sequence`);\n return this.ConvertBase(node, memo, true);\n }\n\n if (tag === PYTHON_UNICODE)\n {\n if (!isScalar(node) || typeof node.value !== \"string\")\n {\n throw this.NodeError(node, `${tag} must decorate a string scalar`);\n }\n return node.value;\n }\n\n if (this.options.tagPolicy === TAG_REJECT)\n {\n throw this.NodeError(node, `custom tag \"${tag}\" is rejected by tagPolicy`);\n }\n\n if (this.options.tagPolicy === TAG_HANDLE)\n {\n throw this.NodeError(node, `custom tag \"${tag}\" has no explicit handler`);\n }\n\n if (this.options.tagPolicy === TAG_PRESERVE || tag === PYTHON_PROJECTED_DECAL || tag === PYTHON_PART_METADATA)\n {\n const wrapper = { [this.options.tagField]: tag };\n memo.set(node, wrapper);\n wrapper[this.options.valueField] = this.ConvertBase(node, memo, false);\n return wrapper;\n }\n }\n\n return this.ConvertBase(node, memo, true);\n }\n\n ConvertBase(node, memo, memoize)\n {\n if (isScalar(node)) return node.value;\n\n if (isSeq(node))\n {\n const out = [];\n if (memoize) memo.set(node, out);\n for (const item of node.items) out.push(this.Convert(item, memo));\n return out;\n }\n\n if (isMap(node))\n {\n const out = {};\n if (memoize) memo.set(node, out);\n for (const pair of node.items)\n {\n const key = this.MapKey(pair.key);\n if (this.options.uniqueKeys && Object.prototype.hasOwnProperty.call(out, key))\n {\n throw this.NodeError(pair.key, `duplicate mapping key \"${key}\"`);\n }\n // Defining the property prevents keys such as \"__proto__\" from\n // mutating the result object's prototype.\n defineMappingValue(out, key, this.Convert(pair.value, memo));\n }\n return out;\n }\n\n throw this.NodeError(node, \"unsupported YAML node\");\n }\n\n MapKey(node)\n {\n if (!isScalar(node)) throw this.NodeError(node, \"mapping keys must be scalar values\");\n return String(node.value);\n }\n\n CustomTag(node)\n {\n const tag = canonicalTag(node.tag);\n return tag && !STANDARD_TAGS.has(tag) ? tag : null;\n }\n\n AssertTagAllowed(tag, node)\n {\n if (!this.options.allowedTags) return;\n const allowed = new Set(this.options.allowedTags.map(canonicalTag));\n if (!allowed.has(tag)) throw this.NodeError(node, `custom tag \"${tag}\" is not in allowedTags`);\n }\n\n FindTagHandler(tag)\n {\n const handlers = this.options.tagHandlers;\n const short = tag.startsWith(TAG_PREFIX) ? `!!${tag.slice(TAG_PREFIX.length)}` : tag;\n if (handlers instanceof Map) return handlers.get(tag) || handlers.get(short) || null;\n return handlers[tag] || handlers[short] || null;\n }\n\n TagContext(tag, node)\n {\n return {\n tag,\n sourceName: this.options.sourceName,\n location: this.TagLocation(node)\n };\n }\n\n NodeError(node, message)\n {\n const at = node && node.tag ? this.TagLocation(node) : this.Location(node);\n const source = this.options.sourceName ? `${this.options.sourceName}:` : \"\";\n const where = at ? `${source}${at.line}:${at.column}` : (this.options.sourceName || \"YAML input\");\n const error = new Error(`CjsYamlFormat ${where}: ${message}`);\n error.code = \"YAML_TAG_POLICY\";\n error.location = at;\n return error;\n }\n\n Location(node)\n {\n if (!node || !Array.isArray(node.range)) return null;\n const pos = this.lineCounter.linePos(node.range[0]);\n return { offset: node.range[0], line: pos.line, column: pos.col };\n }\n\n TagLocation(node)\n {\n const fallback = this.Location(node);\n if (!fallback || !node.tag) return fallback;\n\n const lineStart = this.source.lastIndexOf(\"\\n\", node.range[0] - 1) + 1;\n const prefix = this.source.slice(lineStart, node.range[0]);\n const tags = [ ...prefix.matchAll(/!<[^>]+>|!!?[^\\s[\\]{},]+/g) ];\n const match = tags[tags.length - 1];\n if (!match) return fallback;\n\n const offset = lineStart + match.index;\n const pos = this.lineCounter.linePos(offset);\n return { offset, line: pos.line, column: pos.col };\n }\n\n DescribeError(error)\n {\n const linePos = error && error.linePos && error.linePos[0];\n return {\n code: error && error.code ? error.code : \"YAML_ERROR\",\n message: displayMessage(error),\n location: error && error.location ? error.location : (linePos ? {\n line: linePos.line,\n column: linePos.col\n } : null)\n };\n }\n\n BuildInventory()\n {\n const tags = [];\n const anchors = [];\n const aliases = [];\n\n visit(this.document, (_key, node) =>\n {\n if (!node || typeof node !== \"object\") return;\n const tag = this.CustomTag(node);\n const location = tag ? this.TagLocation(node) : this.Location(node);\n if (tag) tags.push({ tag, kind: this.NodeKind(node), location });\n if (node.anchor) anchors.push({ name: node.anchor, kind: this.NodeKind(node), location });\n if (isAlias(node)) aliases.push({ name: node.source, location });\n });\n\n return {\n tags,\n anchors,\n aliases,\n warnings: this.document.warnings.map(error => this.DescribeError(error)),\n errors: this.document.errors.map(error => this.DescribeError(error))\n };\n }\n\n NodeKind(node)\n {\n if (isMap(node)) return \"mapping\";\n if (isSeq(node)) return \"sequence\";\n if (isScalar(node)) return \"scalar\";\n if (isAlias(node)) return \"alias\";\n return \"unknown\";\n }\n}\n\nexport default CjsYamlReader;\n"],"names":["TAG_PREFIX","PYTHON_TUPLE","PYTHON_UNICODE","PYTHON_PROJECTED_DECAL","PYTHON_PART_METADATA","STANDARD_TAGS","Set","map","name","canonicalTag","tag","startsWith","slice","displayMessage","error","String","message","trim","defineMappingValue","target","key","value","Object","defineProperty","enumerable","configurable","writable","CjsYamlReader","CjsReader","constructor","input","options","TypeError","source","lineCounter","LineCounter","document","parseDocument","keepSourceTokens","prettyErrors","strict","uniqueKeys","inventory","BuildInventory","Read","ReadPayload","toJsonGraph","ReadRaw","AssertSyntax","AssertAliasLimit","Convert","contents","Map","ReadDocument","errors","length","push","DescribeError","format","id","sourceName","root","kind","RootKind","tags","anchors","aliases","warnings","Inspect","node","isMap","isSeq","isScalar","isAlias","first","SyntaxError","maxAliasCount","RangeError","memo","undefined","resolve","NodeError","has","get","CustomTag","AssertTagAllowed","handler","FindTagHandler","ConvertBase","handled","TagContext","set","tagPolicy","TAG_REJECT","TAG_HANDLE","TAG_PRESERVE","wrapper","tagField","valueField","memoize","out","item","items","pair","MapKey","prototype","hasOwnProperty","call","allowedTags","allowed","handlers","tagHandlers","short","location","TagLocation","at","Location","where","line","column","Error","code","Array","isArray","range","pos","linePos","offset","col","fallback","lineStart","lastIndexOf","prefix","matchAll","match","index","visit","_key","NodeKind","anchor"],"mappings":";;;;AAaA,MAAMA,UAAU,GAAG,oBAAoB;AACvC,MAAMC,YAAY,GAAG,CAAA,EAAGD,UAAU,CAAA,YAAA,CAAc;AAChD,MAAME,cAAc,GAAG,CAAA,EAAGF,UAAU,CAAA,cAAA,CAAgB;AACpD,MAAMG,sBAAsB,GAAG,CAAA,EAAGH,UAAU,CAAA,sCAAA,CAAwC;AACpF,MAAMI,oBAAoB,GAAG,CAAA,EAAGJ,UAAU,CAAA,0CAAA,CAA4C;AAEtF,MAAMK,aAAa,GAAG,IAAIC,GAAG,CAAC,CAC1B,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAChE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EA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AQ,CAACH,IAAI,CAAC,EAAE,OAAO,QAAQ;AACnC,IAAA,IAAII,OAAO,CAACJ,IAAI,CAAC,EAAE,OAAO,OAAO;AACjC,IAAA,OAAO,SAAS;AACpB,EAAA;AACJ;;;;"}
1
+ {"version":3,"file":"CjsYamlReader.js","sources":["../../../../../src/formats/yaml/core/CjsYamlReader.js"],"sourcesContent":["import {\n LineCounter,\n isAlias,\n isMap,\n isScalar,\n isSeq,\n parseDocument,\n visit\n} from \"yaml\";\n\nimport { CjsReader } from \"../../../format/CjsReader.js\";\nimport { TAG_HANDLE, TAG_PRESERVE, TAG_REJECT, toJsonGraph } from \"./helpers.js\";\n\nconst TAG_PREFIX = \"tag:yaml.org,2002:\";\nconst PYTHON_TUPLE = `${TAG_PREFIX}python/tuple`;\nconst PYTHON_UNICODE = `${TAG_PREFIX}python/unicode`;\nconst PYTHON_PROJECTED_DECAL = `${TAG_PREFIX}python/object:paperDoll.ProjectedDecal`;\nconst PYTHON_PART_METADATA = `${TAG_PREFIX}python/object:paperDoll.AvatarPartMetaData`;\n\nconst STANDARD_TAGS = new Set([\n \"binary\", \"bool\", \"float\", \"int\", \"map\", \"merge\", \"null\", \"omap\",\n \"pairs\", \"seq\", \"set\", \"str\", \"timestamp\"\n].map(name => `${TAG_PREFIX}${name}`));\n\nfunction canonicalTag(tag)\n{\n if (typeof tag !== \"string\") return tag;\n if (tag.startsWith(\"!!\")) return `${TAG_PREFIX}${tag.slice(2)}`;\n return tag;\n}\n\nfunction displayMessage(error)\n{\n return String(error && error.message ? error.message : error).trim();\n}\n\nfunction defineMappingValue(target, key, value)\n{\n Object.defineProperty(target, key, {\n value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n}\n\n/**\n * Construction-bound reader that parses one YAML source with the `yaml`\n * library and produces the format's payload, raw, or document graphs while\n * enforcing tag policy and alias limits.\n */\nexport class CjsYamlReader extends CjsReader\n{\n constructor(input, options = {})\n {\n super(options);\n\n if (typeof input !== \"string\")\n {\n throw new TypeError(\"CjsYamlFormat input must be a YAML string\");\n }\n\n this.source = input;\n this.lineCounter = new LineCounter();\n this.document = parseDocument(input, {\n keepSourceTokens: true,\n lineCounter: this.lineCounter,\n prettyErrors: true,\n strict: true,\n uniqueKeys: this.options.uniqueKeys\n });\n this.inventory = this.BuildInventory();\n }\n\n Read()\n {\n return this.ReadPayload();\n }\n\n ReadPayload()\n {\n return toJsonGraph(this.ReadRaw(), this.options);\n }\n\n ReadRaw()\n {\n this.AssertSyntax();\n this.AssertAliasLimit();\n return this.Convert(this.document.contents, new Map());\n }\n\n ReadDocument()\n {\n let value = null;\n const errors = this.inventory.errors.slice();\n\n if (!errors.length)\n {\n try\n {\n this.AssertAliasLimit();\n value = this.Convert(this.document.contents, new Map());\n }\n catch (error)\n {\n errors.push(this.DescribeError(error));\n }\n }\n\n return {\n format: { id: \"yaml\" },\n source: { name: this.options.sourceName, length: this.source.length },\n root: { kind: this.RootKind() },\n value,\n tags: this.inventory.tags,\n anchors: this.inventory.anchors,\n aliases: this.inventory.aliases,\n warnings: this.inventory.warnings,\n errors\n };\n }\n\n Inspect()\n {\n return {\n format: { id: \"yaml\" },\n source: { name: this.options.sourceName, length: this.source.length },\n root: { kind: this.RootKind() },\n tags: this.inventory.tags,\n anchors: this.inventory.anchors,\n aliases: this.inventory.aliases,\n warnings: this.inventory.warnings,\n errors: this.inventory.errors\n };\n }\n\n RootKind()\n {\n const node = this.document.contents;\n if (node === null) return \"null\";\n if (isMap(node)) return \"mapping\";\n if (isSeq(node)) return \"sequence\";\n if (isScalar(node)) return \"scalar\";\n if (isAlias(node)) return \"alias\";\n return \"unknown\";\n }\n\n AssertSyntax()\n {\n if (!this.document.errors.length) return;\n const first = this.document.errors[0];\n const source = this.options.sourceName ? ` in ${this.options.sourceName}` : \"\";\n throw new SyntaxError(`CjsYamlFormat${source}: ${displayMessage(first)}`);\n }\n\n AssertAliasLimit()\n {\n if (this.inventory.aliases.length <= this.options.maxAliasCount) return;\n const source = this.options.sourceName ? ` in ${this.options.sourceName}` : \"\";\n throw new RangeError(`CjsYamlFormat${source}: alias count ${this.inventory.aliases.length} exceeds maxAliasCount ${this.options.maxAliasCount}`);\n }\n\n Convert(node, memo)\n {\n if (node === null || node === undefined) return null;\n\n if (isAlias(node))\n {\n const source = node.resolve(this.document);\n if (!source) throw this.NodeError(node, `unresolved alias \"${node.source}\"`);\n return this.Convert(source, memo);\n }\n\n if (memo.has(node)) return memo.get(node);\n\n const tag = this.CustomTag(node);\n if (tag)\n {\n this.AssertTagAllowed(tag, node);\n const handler = this.FindTagHandler(tag);\n\n if (handler)\n {\n const value = this.ConvertBase(node, memo, true);\n const handled = handler(value, this.TagContext(tag, node));\n memo.set(node, handled);\n return handled;\n }\n\n if (tag === PYTHON_TUPLE)\n {\n if (!isSeq(node)) throw this.NodeError(node, `${tag} must decorate a sequence`);\n return this.ConvertBase(node, memo, true);\n }\n\n if (tag === PYTHON_UNICODE)\n {\n if (!isScalar(node) || typeof node.value !== \"string\")\n {\n throw this.NodeError(node, `${tag} must decorate a string scalar`);\n }\n return node.value;\n }\n\n if (this.options.tagPolicy === TAG_REJECT)\n {\n throw this.NodeError(node, `custom tag \"${tag}\" is rejected by tagPolicy`);\n }\n\n if (this.options.tagPolicy === TAG_HANDLE)\n {\n throw this.NodeError(node, `custom tag \"${tag}\" has no explicit handler`);\n }\n\n if (this.options.tagPolicy === TAG_PRESERVE || tag === PYTHON_PROJECTED_DECAL || tag === PYTHON_PART_METADATA)\n {\n const wrapper = { [this.options.tagField]: tag };\n memo.set(node, wrapper);\n wrapper[this.options.valueField] = this.ConvertBase(node, memo, false);\n return wrapper;\n }\n }\n\n return this.ConvertBase(node, memo, true);\n }\n\n ConvertBase(node, memo, memoize)\n {\n if (isScalar(node)) return node.value;\n\n if (isSeq(node))\n {\n const out = [];\n if (memoize) memo.set(node, out);\n for (const item of node.items) out.push(this.Convert(item, memo));\n return out;\n }\n\n if (isMap(node))\n {\n const out = {};\n if (memoize) memo.set(node, out);\n for (const pair of node.items)\n {\n const key = this.MapKey(pair.key);\n if (this.options.uniqueKeys && Object.prototype.hasOwnProperty.call(out, key))\n {\n throw this.NodeError(pair.key, `duplicate mapping key \"${key}\"`);\n }\n // Defining the property prevents keys such as \"__proto__\" from\n // mutating the result object's prototype.\n defineMappingValue(out, key, this.Convert(pair.value, memo));\n }\n return out;\n }\n\n throw this.NodeError(node, \"unsupported YAML node\");\n }\n\n MapKey(node)\n {\n if (!isScalar(node)) throw this.NodeError(node, \"mapping keys must be scalar values\");\n return String(node.value);\n }\n\n CustomTag(node)\n {\n const tag = canonicalTag(node.tag);\n return tag && !STANDARD_TAGS.has(tag) ? tag : null;\n }\n\n AssertTagAllowed(tag, node)\n {\n if (!this.options.allowedTags) return;\n const allowed = new Set(this.options.allowedTags.map(canonicalTag));\n if (!allowed.has(tag)) throw this.NodeError(node, `custom tag \"${tag}\" is not in allowedTags`);\n }\n\n FindTagHandler(tag)\n {\n const handlers = this.options.tagHandlers;\n const short = tag.startsWith(TAG_PREFIX) ? `!!${tag.slice(TAG_PREFIX.length)}` : tag;\n if (handlers instanceof Map) return handlers.get(tag) || handlers.get(short) || null;\n return handlers[tag] || handlers[short] || null;\n }\n\n TagContext(tag, node)\n {\n return {\n tag,\n sourceName: this.options.sourceName,\n location: this.TagLocation(node)\n };\n }\n\n NodeError(node, message)\n {\n const at = node && node.tag ? this.TagLocation(node) : this.Location(node);\n const source = this.options.sourceName ? `${this.options.sourceName}:` : \"\";\n const where = at ? `${source}${at.line}:${at.column}` : (this.options.sourceName || \"YAML input\");\n const error = new Error(`CjsYamlFormat ${where}: ${message}`);\n error.code = \"YAML_TAG_POLICY\";\n error.location = at;\n return error;\n }\n\n Location(node)\n {\n if (!node || !Array.isArray(node.range)) return null;\n const pos = this.lineCounter.linePos(node.range[0]);\n return { offset: node.range[0], line: pos.line, column: pos.col };\n }\n\n TagLocation(node)\n {\n const fallback = this.Location(node);\n if (!fallback || !node.tag) return fallback;\n\n const lineStart = this.source.lastIndexOf(\"\\n\", node.range[0] - 1) + 1;\n const prefix = this.source.slice(lineStart, node.range[0]);\n const tags = [ ...prefix.matchAll(/!<[^>]+>|!!?[^\\s[\\]{},]+/g) ];\n const match = tags[tags.length - 1];\n if (!match) return fallback;\n\n const offset = lineStart + match.index;\n const pos = this.lineCounter.linePos(offset);\n return { offset, line: pos.line, column: pos.col };\n }\n\n DescribeError(error)\n {\n const linePos = error && error.linePos && error.linePos[0];\n return {\n code: error && error.code ? error.code : \"YAML_ERROR\",\n message: displayMessage(error),\n location: error && error.location ? error.location : (linePos ? {\n line: linePos.line,\n column: linePos.col\n } : null)\n };\n }\n\n BuildInventory()\n {\n const tags = [];\n const anchors = [];\n const aliases = [];\n\n visit(this.document, (_key, node) =>\n {\n if (!node || typeof node !== \"object\") return;\n const tag = this.CustomTag(node);\n const location = tag ? this.TagLocation(node) : this.Location(node);\n if (tag) tags.push({ tag, kind: this.NodeKind(node), location });\n if (node.anchor) anchors.push({ name: node.anchor, kind: this.NodeKind(node), location });\n if (isAlias(node)) aliases.push({ name: node.source, location });\n });\n\n return {\n tags,\n anchors,\n aliases,\n warnings: this.document.warnings.map(error => this.DescribeError(error)),\n errors: this.document.errors.map(error => this.DescribeError(error))\n };\n }\n\n NodeKind(node)\n {\n if (isMap(node)) return \"mapping\";\n if (isSeq(node)) return \"sequence\";\n if (isScalar(node)) return \"scalar\";\n if (isAlias(node)) return \"alias\";\n return \"unknown\";\n }\n}\n\nexport default CjsYamlReader;\n"],"names":["TAG_PREFIX","PYTHON_TUPLE","PYTHON_UNICODE","PYTHON_PROJECTED_DECAL","PYTHON_PART_METADATA","STANDARD_TAGS","Set","map","name","canonicalTag","tag","startsWith","slice","displayMessage","error","String","message","trim","defineMappingValue","target","key","value","Object","defineProperty","enumerable","configurable","writable","CjsYamlReader","CjsReader","constructor","input","options","TypeError","source","lineCounter","LineCounter","document","parseDocument","keepSourceTokens","prettyErrors","strict","uniqueKeys","inventory","BuildInventory","Read","ReadPayload","toJsonGraph","ReadRaw","AssertSyntax","AssertAliasLimit","Convert","contents","Map","ReadDocument","errors","length","push","DescribeError","format","id","sourceName","root","kind","RootKind","tags","anchors","aliases","warnings","Inspect","node","isMap","isSeq","isScalar","isAlias","first","SyntaxError","maxAliasCount","RangeError","memo","undefined","resolve","NodeError","has","get","CustomTag","AssertTagAllowed","handler","FindTagHandler","ConvertBase","handled","TagContext","set","tagPolicy","TAG_REJECT","TAG_HANDLE","TAG_PRESERVE","wrapper","tagField","valueField","memoize","out","item","items","pair","MapKey","prototype","hasOwnProperty","call","allowedTags","allowed","handlers","tagHandlers","short","location","TagLocation","at","Location","where","line","column","Error","code","Array","isArray","range","pos","linePos","offset","col","fallback","lineStart","lastIndexOf","prefix","matchAll","match","index","visit","_key","NodeKind","anchor"],"mappings":";;;;AAaA,MAAMA,UAAU,GAAG,oBAAoB;AACvC,MAAMC,YAAY,GAAG,CAAA,EAAGD,UAAU,CAAA,YAAA,CAAc;AAChD,MAAME,cAAc,GAAG,CAAA,EAAGF,UAAU,CAAA,cAAA,CAAgB;AACpD,MAAMG,sBAAsB,GAAG,CAAA,EAAGH,UAAU,CAAA,sCAAA,CAAwC;AACpF,MAAMI,oBAAoB,GAAG,CAAA,EAAGJ,UAAU,CAAA,0CAAA,CAA4C;AAEtF,MAAMK,aAAa,GAAG,IAAIC,GAAG,CAAC,CAC1B,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAChE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,CAC5C,CAACC,GAAG,CAACC,IAAI,IAAI,CAAA,EAAGR,UAAU,GAAGQ,IAAI,CAAA,CAAE,CAAC,CAAC;AAEtC,SAASC,YAAYA,CAACC,GAAG,EACzB;AACI,EAAA,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAE,OAAOA,GAAG;AACvC,EAAA,IAAIA,GAAG,CAACC,UAAU,CAAC,IAA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CPU steps and `Tr2TextureLodManager` membership.
61
61
  - [reference/events.md](reference/events.md): the `CjsEventEmitter` contract
62
62
  and event memory rules.
63
+ - [reference/classes/README.md](reference/classes/README.md): the searchable
64
+ one-sentence class-purpose catalog.
63
65
  - [formats/README.md](formats/README.md): format import map and per-format
64
66
  output notes.
67
+ - [formats/gr2.md](formats/gr2.md): Granny GR2/GSF reading, output modes,
68
+ conversions, graph shape, and class hydration.
65
69
  - [formats/wwise.md](formats/wwise.md): Wwise soundbank and media readers.
66
70
  - [formats/stl.md](formats/stl.md): STL geometry export.
67
71
  - [formats/provenance.md](formats/provenance.md): format ownership, fork
@@ -57,9 +57,10 @@ retention without introducing a parallel DTO class hierarchy.
57
57
  | Wwise media (`.wem`) | `CjsWemFormat` | `@carbonenginejs/runtime-resource/formats/wem` |
58
58
  | YAML (`.yaml`/`.yml`) | `CjsYamlFormat` | `@carbonenginejs/runtime-resource/formats/yaml` |
59
59
 
60
- Detailed pages: [Wwise soundbanks and media](wwise.md),
61
- [STL export](stl.md). Ownership history, retained snapshots, and donor
62
- licensing are recorded in [provenance.md](provenance.md).
60
+ Detailed pages: [Granny GR2 and GSF](gr2.md),
61
+ [Wwise soundbanks and media](wwise.md), and [STL export](stl.md). Ownership
62
+ history, retained snapshots, and donor licensing are recorded in
63
+ [provenance.md](provenance.md).
63
64
 
64
65
  ## Granny GR2/GSF
65
66
 
@@ -69,9 +70,9 @@ Oodle1, and the clean-room BitKnit2 decoder), reflected type-tree walking,
69
70
  GR2 JSON emission, optional curve decompression, CCP packed tangent-frame
70
71
  unpacking, and caller-class hydration (`emit: "gr2"`/`"cmf"` with a
71
72
  `classes` map). It was migrated from `@carbonenginejs/format-gr2` after that
72
- package's 2026-07-24 MIT relicense; the frozen donor repository documents
73
- the reader API and JSON graph in detail, and this copy preserves its
74
- behavior and test surface.
73
+ package's 2026-07-24 MIT relicense, preserving its behavior and test
74
+ surface; [gr2.md](gr2.md) documents the reader API, output modes, graph
75
+ shape, and hydration contract.
75
76
 
76
77
  ## Red output markers
77
78
 
@@ -0,0 +1,161 @@
1
+ # Granny GR2 and GSF
2
+
3
+ Status: Evolving
4
+ Scope: `@carbonenginejs/runtime-resource/formats/gr2`
5
+ Audience: Users and integrators
6
+ Summary: Defines the pure-JavaScript GR2/GSF reader, its output modes, conversion options, graph shape, and class-hydration boundary.
7
+
8
+ ## Purpose
9
+
10
+ `CjsGr2Format` reads Granny 3D `.gr2` geometry, skeleton, animation, and
11
+ morph-target data, plus Granny State `.gsf` profiles. It runs in Node and the
12
+ browser without `granny2.dll`, native addons, a GPU, or private assets.
13
+
14
+ The reader owns Granny container parsing, reflected type-tree walking, section
15
+ decompression, JSON projection, optional curve and vertex-channel conversion,
16
+ GSF projection, and caller-class hydration. Resource caching and publication
17
+ remain with `CjsResMan`; GPU realization remains with engine packages.
18
+
19
+ Supported section compression is None, Oodle1, and the in-project clean-room
20
+ BitKnit2 decoder. Licensing and migration history are recorded in
21
+ [format provenance](provenance.md).
22
+
23
+ ## Import and basic use
24
+
25
+ Import the runtime-resource wrapper from its explicit format subpath:
26
+
27
+ ```js
28
+ import { CjsGr2Format } from "@carbonenginejs/runtime-resource/formats/gr2";
29
+
30
+ const graph = CjsGr2Format.read(bytes);
31
+ const summary = CjsGr2Format.inspect(bytes);
32
+ const asynchronousGraph = await CjsGr2Format.readAsync(bytes);
33
+ ```
34
+
35
+ The wrapper exposes the normal runtime-resource format metadata and
36
+ `isSupported(bytes)` magic probe. It also exports the migrated
37
+ `CjsFormatGr2` reader engine for compatibility, but new consumers should use
38
+ `CjsGr2Format`.
39
+
40
+ Register it with `CjsResMan` when GR2/GSF should participate in ordinary
41
+ resource loading:
42
+
43
+ ```js
44
+ import { CjsResMan } from "@carbonenginejs/runtime-resource";
45
+ import { CjsGr2Format } from "@carbonenginejs/runtime-resource/formats/gr2";
46
+
47
+ const resMan = new CjsResMan().Register({
48
+ source,
49
+ formats: [ CjsGr2Format ]
50
+ });
51
+
52
+ const resource = resMan.GetResource("res:/model/ship.gr2");
53
+ const graph = await resource.Ready();
54
+ ```
55
+
56
+ Concrete formats are not imported or registered by the package root.
57
+
58
+ ## Output modes
59
+
60
+ `emit` selects the representation:
61
+
62
+ | Value | Result |
63
+ |---|---|
64
+ | `"json"` | Default stable GR2 graph with plain objects |
65
+ | `"gr2Json"` | Explicit alias for the JSON graph |
66
+ | `"gr2"` | GR2 graph hydrated with caller-supplied classes |
67
+ | `"cmf"` | CMF-shaped graph hydrated with caller-supplied classes |
68
+ | `"raw"` | Low-level reflected `granny_file_info` result |
69
+
70
+ `"gr2"` and `"cmf"` require a non-empty `classes` map. Classes may also be
71
+ supplied with `"json"`/`"gr2Json"` to hydrate selected JSON nodes while
72
+ leaving omitted nodes as plain objects.
73
+
74
+ ## Conversion options
75
+
76
+ | Option | Default | Effect |
77
+ |---|---:|---|
78
+ | `decompressCurves` | `false` | Adds decoded `knots`, `controls`, and `dimension` to supported compressed animation curves while retaining the raw curve fields |
79
+ | `unpackTangents` | `false` | Converts packed CCP tangent frames into separate normal, tangent, and binormal channels |
80
+ | `rebuildMissingNormals` | `false` | Generates absent normals from positions and triangle indices |
81
+ | `rebuildMissingTangents` | `false` | Generates absent tangents from positions, normals, UVs, and triangle indices |
82
+ | `rebuildMissingBiNormals` | `false` | Generates absent binormals from normals and tangents |
83
+ | `classes` | `{}` | Maps supported graph node keys to constructors |
84
+
85
+ Tangent unpacking and missing-channel rebuild options may be functions when a
86
+ caller needs per-mesh policy. Rebuild options fill absent data; they do not
87
+ repair authored channels that are present but incorrect.
88
+
89
+ A reusable reader profile can hold these defaults:
90
+
91
+ ```js
92
+ const reader = new CjsGr2Format({
93
+ decompressCurves: true,
94
+ unpackTangents: true
95
+ });
96
+
97
+ const first = reader.Read(firstBytes);
98
+ const second = reader.Read(secondBytes);
99
+ ```
100
+
101
+ ## JSON graph and hydration
102
+
103
+ The default graph has this general shape:
104
+
105
+ ```text
106
+ Root
107
+ |-- grannyFileFormatRevision, grannyFileSource
108
+ |-- meshes
109
+ | |-- boneBindings, morphTargets
110
+ | |-- vertex: flat numeric channels
111
+ | `-- indices: triangle index groups
112
+ |-- models
113
+ | `-- skeleton -> bones
114
+ `-- animations
115
+ `-- trackGroups -> transformTracks -> curves
116
+ ```
117
+
118
+ Vertex channels include positions, normals, tangents, binormals, UVs, blend
119
+ indices, and blend weights when available. `IndexGroup.faces` is a flat array
120
+ of triangle indices. Sparse morph targets carry `vertexIndices`; native and
121
+ annotation-set morph targets share the same projected shape.
122
+
123
+ For each registered class key, hydration constructs the class without
124
+ arguments and calls:
125
+
126
+ ```js
127
+ new Class().SetValues(nodeFields);
128
+ ```
129
+
130
+ Constructors must therefore support zero-argument construction and
131
+ `SetValues(values)`. Supported GR2 and CMF keys are exposed through
132
+ `CjsGr2Format.CLASS_KEYS`; use `SetClass`, `SetClasses`, `GetClass`, and
133
+ `HasClass` on reusable reader instances.
134
+
135
+ `ToJSON(value)` and static `toJSON(value)` convert hydrated output into a
136
+ JSON-compatible value. They do not write a binary `.gr2` file or return JSON
137
+ text.
138
+
139
+ ## Granny State
140
+
141
+ GSF uses the ordinary Granny container with a GState root schema. The reader
142
+ provides dedicated classification, projection, and inspection:
143
+
144
+ ```js
145
+ if (CjsGr2Format.isGsf(bytes)) {
146
+ const state = CjsGr2Format.readGsf(bytes);
147
+ const dependencies = CjsGr2Format.inspectGsf(bytes);
148
+ }
149
+ ```
150
+
151
+ The stable GSF projection contains container revision data, model and
152
+ retarget hints, the state machine, animation slots and sets, referenced
153
+ relative `.gr2` files, token count, editor data, and extended data.
154
+ `readGsfAsync` provides the equivalent promise-facing entry point.
155
+
156
+ ## Related documentation
157
+
158
+ - [Format subpaths](README.md)
159
+ - [Architecture and boundaries](../architecture.md)
160
+ - [Resource lifecycle](../concepts/resource-lifecycle.md)
161
+ - [Format ownership and provenance](provenance.md)
@@ -0,0 +1,33 @@
1
+ # Class catalog
2
+
3
+ Status: Evolving
4
+ Scope: `@carbonenginejs/runtime-resource` classes
5
+ Audience: Users, maintainers, and automated readers
6
+ Summary: Indexes the one-sentence purpose descriptors for every maintained class in the package.
7
+
8
+ ## Purpose
9
+
10
+ Every maintained class carries exactly one catalog entry with a stable HTML
11
+ marker, so a class can be located with an exact low-cost search:
12
+
13
+ ```sh
14
+ rg 'class:CjsResMan' docs/reference/classes
15
+ ```
16
+
17
+ Entries record a one-sentence responsibility plus Export, Source, Visibility,
18
+ and Kind metadata. The catalog is an index, not a replacement for the API
19
+ reference or source documentation, and it is validated by the shared
20
+ documentation check against the actual source tree.
21
+
22
+ ## Catalog pages
23
+
24
+ - [core.md](core.md): the resource manager, MotherLode cache, resource and
25
+ source classes, and the format/probe bases.
26
+ - [resources.md](resources.md): the Carbon-shaped semantic resource and data
27
+ classes under `src/resources`.
28
+ - [texture.md](texture.md): texture-array aggregation classes under
29
+ `src/texture`.
30
+ - [formats.md](formats.md): format entry classes and their internal reader
31
+ machinery under `src/formats`.
32
+ - [dropped.md](dropped.md): retained native shapes under `src/dropped` that
33
+ are documented but never exported or bundled.
@@ -0,0 +1,106 @@
1
+ # Core class catalog
2
+
3
+ Status: Evolving
4
+ Scope: `@carbonenginejs/runtime-resource` classes under `src/` and `src/format/`
5
+ Audience: Users, maintainers, and automated readers
6
+ Summary: Provides one-sentence purpose descriptors for the resource manager, registry, resource, source, and format/probe base classes.
7
+
8
+ <!-- class:CjsMotherLode -->
9
+ ## `CjsMotherLode`
10
+
11
+ Strong, deterministic resource registry that owns canonical path/variant identities and evicts entries only through explicit ownership removal, inactivity sweeps, or recorded-byte cache trimming, replacing Carbon's weak-live/strong-cache ownership transition.
12
+
13
+ - Export: `@carbonenginejs/runtime-resource`
14
+ - Source: `src/CjsMotherLode.js`
15
+ - Visibility: Public
16
+ - Kind: Adapted Carbon concept
17
+
18
+ <!-- class:CjsResMan -->
19
+ ## `CjsResMan`
20
+
21
+ GPU-free resource manager that resolves paths through registered sources and formats, publishes canonical resources into a `CjsMotherLode` registry under exact-owner generation guards, and drives the main/background work queues, read-operation caching, reload staging, and automatic purge policy.
22
+
23
+ - Export: `@carbonenginejs/runtime-resource`
24
+ - Source: `src/CjsResMan.js`
25
+ - Visibility: Public
26
+ - Kind: Adapted Carbon concept
27
+
28
+ <!-- class:CjsResManWorkQueue -->
29
+ ## `CjsResManWorkQueue`
30
+
31
+ Small FIFO executor used inside `CjsResMan` that tracks item ids, pause state, concurrency, cancellation, and sync/async completion while queue policy stays in the manager.
32
+
33
+ - Export: None
34
+ - Source: `src/CjsResManQueue.js`
35
+ - Visibility: Internal
36
+ - Kind: Internal implementation class
37
+
38
+ <!-- class:CjsResource -->
39
+ ## `CjsResource`
40
+
41
+ Base runtime resource handle that carries normalized path/extension/requirement identity, load state, and an attached CPU payload, with manager lifecycle callbacks supplied by `CjsResMan` after canonical insertion.
42
+
43
+ - Export: `@carbonenginejs/runtime-resource`
44
+ - Source: `src/CjsResource.js`
45
+ - Visibility: Public
46
+ - Kind: Adapted Carbon concept
47
+
48
+ <!-- class:CjsMemoryResourceSource -->
49
+ ## `CjsMemoryResourceSource`
50
+
51
+ In-memory resource source that maps normalized resource paths to preset values and serves them to reads without any I/O.
52
+
53
+ - Export: `@carbonenginejs/runtime-resource`
54
+ - Source: `src/CjsResourceSource.js`
55
+ - Visibility: Public
56
+ - Kind: Original CarbonEngineJS class
57
+
58
+ <!-- class:CjsFetchResourceSource -->
59
+ ## `CjsFetchResourceSource`
60
+
61
+ Resource source that resolves a normalized path against an optional base URL and reads response bytes through an injected fetch implementation.
62
+
63
+ - Export: `@carbonenginejs/runtime-resource`
64
+ - Source: `src/CjsResourceSource.js`
65
+ - Visibility: Public
66
+ - Kind: Original CarbonEngineJS class
67
+
68
+ <!-- class:CjsBlueReader -->
69
+ ## `CjsBlueReader`
70
+
71
+ Shared output and hydration backend for Blue persistence readers that owns common payload/runtime targets, reference emission, hydration adapter phases, reports, finalization, and schema-descriptor helpers, while transports keep framing and member decoding.
72
+
73
+ - Export: None
74
+ - Source: `src/format/CjsBlueReader.js`
75
+ - Visibility: Internal
76
+ - Kind: Internal implementation class
77
+
78
+ <!-- class:CjsFormat -->
79
+ ## `CjsFormat`
80
+
81
+ Base class for format readers that defines the static `read`/`readAsync`/`isSupported`/`resolveType` contract and instance option handling that concrete format packages implement.
82
+
83
+ - Export: `@carbonenginejs/runtime-resource`
84
+ - Source: `src/format/CjsFormat.js`
85
+ - Visibility: Public
86
+ - Kind: Original CarbonEngineJS class
87
+
88
+ <!-- class:CjsReader -->
89
+ ## `CjsReader`
90
+
91
+ Internal base for construction-bound readers that are created for one source and dropped after use, relying on garbage collection instead of explicit dispose/clear cleanup.
92
+
93
+ - Export: None
94
+ - Source: `src/format/CjsReader.js`
95
+ - Visibility: Internal
96
+ - Kind: Internal implementation class
97
+
98
+ <!-- class:CjsResourceProbe -->
99
+ ## `CjsResourceProbe`
100
+
101
+ Standard probe-report model that formats return from inspection, recording support status, content-verification state, confidence, preferred route, capability variants, warnings, and errors without choosing an engine or media backend.
102
+
103
+ - Export: `@carbonenginejs/runtime-resource`
104
+ - Source: `src/format/CjsResourceProbe.js`
105
+ - Visibility: Public
106
+ - Kind: Original CarbonEngineJS class
@@ -0,0 +1,46 @@
1
+ # Dropped class catalog
2
+
3
+ Status: Evolving
4
+ Scope: `@carbonenginejs/runtime-resource` classes under `src/dropped`
5
+ Audience: Users, maintainers, and automated readers
6
+ Summary: Provides one-sentence purpose descriptors for retained-only Carbon reference shapes that are never exported or bundled.
7
+
8
+ <!-- class:CmfVertexReader -->
9
+ ## `CmfVertexReader`
10
+
11
+ Retained-only reference shape mirroring Carbon's CMF vertex-element pointer-lookup helper, superseded by the JavaScript CMF format's channel decoding.
12
+
13
+ - Export: None
14
+ - Source: `src/dropped/CmfVertexReader.js`
15
+ - Visibility: Internal
16
+ - Kind: Faithful Carbon port
17
+
18
+ <!-- class:Tr2AsyncSave -->
19
+ ## `Tr2AsyncSave`
20
+
21
+ Retained-only reference shape mirroring Carbon's abstract prepare/save callback base, superseded by promise-based format `Write`/`WriteAsync` operations and resource-level save-status compatibility methods.
22
+
23
+ - Export: None
24
+ - Source: `src/dropped/Tr2AsyncSave.js`
25
+ - Visibility: Internal
26
+ - Kind: Faithful Carbon port
27
+
28
+ <!-- class:Tr2CmfContents -->
29
+ ## `Tr2CmfContents`
30
+
31
+ Retained-only reference shape mirroring Carbon's native CMF section lifetime and decompression holder, superseded by `CjsCmfFormat`'s bounded section access and typed-array data.
32
+
33
+ - Export: None
34
+ - Source: `src/dropped/Tr2CmfContents.js`
35
+ - Visibility: Internal
36
+ - Kind: Faithful Carbon port
37
+
38
+ <!-- class:Tr2LoadPrepareFence -->
39
+ ## `Tr2LoadPrepareFence`
40
+
41
+ Retained-only reference shape mirroring Carbon's two-queue load/prepare fence helper, superseded by the snapshot-fence contract owned by `CjsResMan.Wait()`.
42
+
43
+ - Export: None
44
+ - Source: `src/dropped/Tr2LoadPrepareFence.js`
45
+ - Visibility: Internal
46
+ - Kind: Faithful Carbon port