@driftsys/markspec 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/README.md +32 -8
  2. package/esm/_dnt.polyfills.d.ts +101 -0
  3. package/esm/_dnt.polyfills.d.ts.map +1 -0
  4. package/esm/_dnt.polyfills.js +127 -0
  5. package/esm/compiler/inverses.d.ts +22 -0
  6. package/esm/compiler/inverses.d.ts.map +1 -0
  7. package/esm/compiler/inverses.js +147 -0
  8. package/esm/compiler/link_target.d.ts +19 -0
  9. package/esm/compiler/link_target.d.ts.map +1 -0
  10. package/esm/compiler/link_target.js +66 -0
  11. package/esm/compiler/mod.d.ts +43 -0
  12. package/esm/compiler/mod.d.ts.map +1 -0
  13. package/esm/compiler/mod.js +163 -0
  14. package/esm/compiler/schema.d.ts +38 -0
  15. package/esm/compiler/schema.d.ts.map +1 -0
  16. package/esm/compiler/schema.js +44 -0
  17. package/esm/config/markspec.d.ts +51 -0
  18. package/esm/config/markspec.d.ts.map +1 -0
  19. package/esm/config/markspec.js +216 -0
  20. package/esm/config/mod.d.ts +48 -0
  21. package/esm/config/mod.d.ts.map +1 -0
  22. package/esm/config/mod.js +243 -0
  23. package/esm/formatter/mod.d.ts +65 -0
  24. package/esm/formatter/mod.d.ts.map +1 -0
  25. package/esm/formatter/mod.js +306 -0
  26. package/esm/mod.d.ts +19 -0
  27. package/esm/mod.d.ts.map +1 -1
  28. package/esm/mod.js +18 -0
  29. package/esm/model/attributes.d.ts +47 -0
  30. package/esm/model/attributes.d.ts.map +1 -0
  31. package/esm/model/attributes.js +97 -0
  32. package/esm/model/mod.d.ts +381 -0
  33. package/esm/model/mod.d.ts.map +1 -0
  34. package/esm/model/mod.js +73 -0
  35. package/esm/model/profile.d.ts +189 -0
  36. package/esm/model/profile.d.ts.map +1 -0
  37. package/esm/model/profile.js +31 -0
  38. package/esm/parser/attributes.d.ts +48 -0
  39. package/esm/parser/attributes.d.ts.map +1 -0
  40. package/esm/parser/attributes.js +131 -0
  41. package/esm/parser/captions.d.ts +25 -0
  42. package/esm/parser/captions.d.ts.map +1 -0
  43. package/esm/parser/captions.js +148 -0
  44. package/esm/parser/directives.d.ts +29 -0
  45. package/esm/parser/directives.d.ts.map +1 -0
  46. package/esm/parser/directives.js +88 -0
  47. package/esm/parser/frontmatter.d.ts +53 -0
  48. package/esm/parser/frontmatter.d.ts.map +1 -0
  49. package/esm/parser/frontmatter.js +185 -0
  50. package/esm/parser/grammars.d.ts +22 -0
  51. package/esm/parser/grammars.d.ts.map +1 -0
  52. package/esm/parser/grammars.js +70 -0
  53. package/esm/parser/markdown.d.ts +32 -0
  54. package/esm/parser/markdown.d.ts.map +1 -0
  55. package/esm/parser/markdown.js +225 -0
  56. package/esm/parser/mod.d.ts +73 -0
  57. package/esm/parser/mod.d.ts.map +1 -0
  58. package/esm/parser/mod.js +89 -0
  59. package/esm/parser/references.d.ts +24 -0
  60. package/esm/parser/references.d.ts.map +1 -0
  61. package/esm/parser/references.js +71 -0
  62. package/esm/parser/remark.d.ts +9 -0
  63. package/esm/parser/remark.d.ts.map +1 -0
  64. package/esm/parser/remark.js +11 -0
  65. package/esm/parser/source.d.ts +33 -0
  66. package/esm/parser/source.d.ts.map +1 -0
  67. package/esm/parser/source.js +192 -0
  68. package/esm/profile/cache.d.ts +29 -0
  69. package/esm/profile/cache.d.ts.map +1 -0
  70. package/esm/profile/cache.js +45 -0
  71. package/esm/profile/chain.d.ts +42 -0
  72. package/esm/profile/chain.d.ts.map +1 -0
  73. package/esm/profile/chain.js +193 -0
  74. package/esm/profile/git-cache.d.ts +73 -0
  75. package/esm/profile/git-cache.d.ts.map +1 -0
  76. package/esm/profile/git-cache.js +96 -0
  77. package/esm/profile/load.d.ts +28 -0
  78. package/esm/profile/load.d.ts.map +1 -0
  79. package/esm/profile/load.js +50 -0
  80. package/esm/profile/manifest.d.ts +21 -0
  81. package/esm/profile/manifest.d.ts.map +1 -0
  82. package/esm/profile/manifest.js +830 -0
  83. package/esm/profile/merge.d.ts +26 -0
  84. package/esm/profile/merge.d.ts.map +1 -0
  85. package/esm/profile/merge.js +518 -0
  86. package/esm/profile/mod.d.ts +23 -0
  87. package/esm/profile/mod.d.ts.map +1 -0
  88. package/esm/profile/mod.js +14 -0
  89. package/esm/profile/npm.d.ts +51 -0
  90. package/esm/profile/npm.d.ts.map +1 -0
  91. package/esm/profile/npm.js +186 -0
  92. package/esm/profile/resolver.d.ts +60 -0
  93. package/esm/profile/resolver.d.ts.map +1 -0
  94. package/esm/profile/resolver.js +132 -0
  95. package/esm/reporter/mod.d.ts +31 -0
  96. package/esm/reporter/mod.d.ts.map +1 -0
  97. package/esm/reporter/mod.js +173 -0
  98. package/esm/validator/attributes.d.ts +43 -0
  99. package/esm/validator/attributes.d.ts.map +1 -0
  100. package/esm/validator/attributes.js +169 -0
  101. package/esm/validator/mod.d.ts +44 -0
  102. package/esm/validator/mod.d.ts.map +1 -0
  103. package/esm/validator/mod.js +214 -0
  104. package/esm/validator/normalize.d.ts +21 -0
  105. package/esm/validator/normalize.d.ts.map +1 -0
  106. package/esm/validator/normalize.js +58 -0
  107. package/esm/validator/pattern.d.ts +23 -0
  108. package/esm/validator/pattern.d.ts.map +1 -0
  109. package/esm/validator/pattern.js +44 -0
  110. package/esm/validator/pipeline.d.ts +30 -0
  111. package/esm/validator/pipeline.d.ts.map +1 -0
  112. package/esm/validator/pipeline.js +115 -0
  113. package/esm/validator/traceability.d.ts +48 -0
  114. package/esm/validator/traceability.d.ts.map +1 -0
  115. package/esm/validator/traceability.js +141 -0
  116. package/esm/validator/types.d.ts +48 -0
  117. package/esm/validator/types.d.ts.map +1 -0
  118. package/esm/validator/types.js +140 -0
  119. package/esm/validator/value_types.d.ts +20 -0
  120. package/esm/validator/value_types.d.ts.map +1 -0
  121. package/esm/validator/value_types.js +126 -0
  122. package/package.json +8 -1
  123. package/script/_dnt.polyfills.d.ts +101 -0
  124. package/script/_dnt.polyfills.d.ts.map +1 -0
  125. package/script/_dnt.polyfills.js +130 -0
  126. package/script/compiler/inverses.d.ts +22 -0
  127. package/script/compiler/inverses.d.ts.map +1 -0
  128. package/script/compiler/inverses.js +150 -0
  129. package/script/compiler/link_target.d.ts +19 -0
  130. package/script/compiler/link_target.d.ts.map +1 -0
  131. package/script/compiler/link_target.js +69 -0
  132. package/script/compiler/mod.d.ts +43 -0
  133. package/script/compiler/mod.d.ts.map +1 -0
  134. package/script/compiler/mod.js +169 -0
  135. package/script/compiler/schema.d.ts +38 -0
  136. package/script/compiler/schema.d.ts.map +1 -0
  137. package/script/compiler/schema.js +47 -0
  138. package/script/config/markspec.d.ts +51 -0
  139. package/script/config/markspec.d.ts.map +1 -0
  140. package/script/config/markspec.js +222 -0
  141. package/script/config/mod.d.ts +48 -0
  142. package/script/config/mod.d.ts.map +1 -0
  143. package/script/config/mod.js +250 -0
  144. package/script/formatter/mod.d.ts +65 -0
  145. package/script/formatter/mod.d.ts.map +1 -0
  146. package/script/formatter/mod.js +313 -0
  147. package/script/mod.d.ts +19 -0
  148. package/script/mod.d.ts.map +1 -1
  149. package/script/mod.js +65 -2
  150. package/script/model/attributes.d.ts +47 -0
  151. package/script/model/attributes.d.ts.map +1 -0
  152. package/script/model/attributes.js +101 -0
  153. package/script/model/mod.d.ts +381 -0
  154. package/script/model/mod.d.ts.map +1 -0
  155. package/script/model/mod.js +83 -0
  156. package/script/model/profile.d.ts +189 -0
  157. package/script/model/profile.d.ts.map +1 -0
  158. package/script/model/profile.js +34 -0
  159. package/script/parser/attributes.d.ts +48 -0
  160. package/script/parser/attributes.d.ts.map +1 -0
  161. package/script/parser/attributes.js +137 -0
  162. package/script/parser/captions.d.ts +25 -0
  163. package/script/parser/captions.d.ts.map +1 -0
  164. package/script/parser/captions.js +151 -0
  165. package/script/parser/directives.d.ts +29 -0
  166. package/script/parser/directives.d.ts.map +1 -0
  167. package/script/parser/directives.js +91 -0
  168. package/script/parser/frontmatter.d.ts +53 -0
  169. package/script/parser/frontmatter.d.ts.map +1 -0
  170. package/script/parser/frontmatter.js +188 -0
  171. package/script/parser/grammars.d.ts +22 -0
  172. package/script/parser/grammars.d.ts.map +1 -0
  173. package/script/parser/grammars.js +77 -0
  174. package/script/parser/markdown.d.ts +32 -0
  175. package/script/parser/markdown.d.ts.map +1 -0
  176. package/script/parser/markdown.js +228 -0
  177. package/script/parser/mod.d.ts +73 -0
  178. package/script/parser/mod.d.ts.map +1 -0
  179. package/script/parser/mod.js +101 -0
  180. package/script/parser/references.d.ts +24 -0
  181. package/script/parser/references.d.ts.map +1 -0
  182. package/script/parser/references.js +74 -0
  183. package/script/parser/remark.d.ts +9 -0
  184. package/script/parser/remark.d.ts.map +1 -0
  185. package/script/parser/remark.js +17 -0
  186. package/script/parser/source.d.ts +33 -0
  187. package/script/parser/source.d.ts.map +1 -0
  188. package/script/parser/source.js +198 -0
  189. package/script/profile/cache.d.ts +29 -0
  190. package/script/profile/cache.d.ts.map +1 -0
  191. package/script/profile/cache.js +48 -0
  192. package/script/profile/chain.d.ts +42 -0
  193. package/script/profile/chain.d.ts.map +1 -0
  194. package/script/profile/chain.js +229 -0
  195. package/script/profile/git-cache.d.ts +73 -0
  196. package/script/profile/git-cache.d.ts.map +1 -0
  197. package/script/profile/git-cache.js +104 -0
  198. package/script/profile/load.d.ts +28 -0
  199. package/script/profile/load.d.ts.map +1 -0
  200. package/script/profile/load.js +53 -0
  201. package/script/profile/manifest.d.ts +21 -0
  202. package/script/profile/manifest.d.ts.map +1 -0
  203. package/script/profile/manifest.js +833 -0
  204. package/script/profile/merge.d.ts +26 -0
  205. package/script/profile/merge.d.ts.map +1 -0
  206. package/script/profile/merge.js +521 -0
  207. package/script/profile/mod.d.ts +23 -0
  208. package/script/profile/mod.d.ts.map +1 -0
  209. package/script/profile/mod.js +31 -0
  210. package/script/profile/npm.d.ts +51 -0
  211. package/script/profile/npm.d.ts.map +1 -0
  212. package/script/profile/npm.js +191 -0
  213. package/script/profile/resolver.d.ts +60 -0
  214. package/script/profile/resolver.d.ts.map +1 -0
  215. package/script/profile/resolver.js +136 -0
  216. package/script/reporter/mod.d.ts +31 -0
  217. package/script/reporter/mod.d.ts.map +1 -0
  218. package/script/reporter/mod.js +176 -0
  219. package/script/validator/attributes.d.ts +43 -0
  220. package/script/validator/attributes.d.ts.map +1 -0
  221. package/script/validator/attributes.js +173 -0
  222. package/script/validator/mod.d.ts +44 -0
  223. package/script/validator/mod.d.ts.map +1 -0
  224. package/script/validator/mod.js +231 -0
  225. package/script/validator/normalize.d.ts +21 -0
  226. package/script/validator/normalize.d.ts.map +1 -0
  227. package/script/validator/normalize.js +61 -0
  228. package/script/validator/pattern.d.ts +23 -0
  229. package/script/validator/pattern.d.ts.map +1 -0
  230. package/script/validator/pattern.js +47 -0
  231. package/script/validator/pipeline.d.ts +30 -0
  232. package/script/validator/pipeline.d.ts.map +1 -0
  233. package/script/validator/pipeline.js +118 -0
  234. package/script/validator/traceability.d.ts +48 -0
  235. package/script/validator/traceability.d.ts.map +1 -0
  236. package/script/validator/traceability.js +146 -0
  237. package/script/validator/types.d.ts +48 -0
  238. package/script/validator/types.d.ts.map +1 -0
  239. package/script/validator/types.js +144 -0
  240. package/script/validator/value_types.d.ts +20 -0
  241. package/script/validator/value_types.d.ts.map +1 -0
  242. package/script/validator/value_types.js +129 -0
@@ -0,0 +1,250 @@
1
+ "use strict";
2
+ /**
3
+ * @module config
4
+ *
5
+ * Project discovery and configuration loading. Walks up from CWD to
6
+ * find `project.yaml`, parses the YAML, and validates the schema.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.CONFIG_FILE_NAME = void 0;
10
+ exports.discoverProjectRoot = discoverProjectRoot;
11
+ exports.parseProjectConfig = parseProjectConfig;
12
+ exports.deriveDomain = deriveDomain;
13
+ exports.loadConfig = loadConfig;
14
+ const yaml_1 = require("@std/yaml");
15
+ const path_1 = require("@std/path");
16
+ const mod_js_1 = require("../model/mod.js");
17
+ /** The config file name used as the project root marker. */
18
+ exports.CONFIG_FILE_NAME = "project.yaml";
19
+ // ---------------------------------------------------------------------------
20
+ // Discovery
21
+ // ---------------------------------------------------------------------------
22
+ /**
23
+ * Walk up from `startDir` to the filesystem root looking for `project.yaml`.
24
+ *
25
+ * @returns Absolute path to the directory containing `project.yaml`,
26
+ * or `undefined` if not found.
27
+ */
28
+ async function discoverProjectRoot(startDir, readFile) {
29
+ let current = (0, path_1.resolve)(startDir);
30
+ for (;;) {
31
+ const candidate = (0, path_1.join)(current, exports.CONFIG_FILE_NAME);
32
+ const content = await readFile(candidate);
33
+ if (content !== undefined)
34
+ return current;
35
+ const parent = (0, path_1.dirname)(current);
36
+ if (parent === current)
37
+ return undefined;
38
+ current = parent;
39
+ }
40
+ }
41
+ // ---------------------------------------------------------------------------
42
+ // Parsing and validation
43
+ // ---------------------------------------------------------------------------
44
+ /** Escape special regex characters for safe interpolation into RegExp. */
45
+ function escapeRegex(s) {
46
+ return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
47
+ }
48
+ /** Find the 1-based line number where `^fieldName:` appears in raw YAML. */
49
+ function findLineNumber(rawYaml, fieldName) {
50
+ const pattern = new RegExp(`^${escapeRegex(fieldName)}\\s*:`, "m");
51
+ const match = pattern.exec(rawYaml);
52
+ if (!match)
53
+ return undefined;
54
+ return rawYaml.slice(0, match.index).split("\n").length;
55
+ }
56
+ /**
57
+ * Parse a YAML string and validate it as a MarkSpec project configuration.
58
+ *
59
+ * @param yaml - Raw YAML content
60
+ * @param filePath - Path to the file (for error messages)
61
+ * @returns Validated `ProjectConfig`
62
+ * @throws {ConfigError} on invalid content
63
+ */
64
+ function parseProjectConfig(yaml, filePath) {
65
+ // Parse YAML
66
+ let raw;
67
+ try {
68
+ raw = (0, yaml_1.parse)(yaml);
69
+ }
70
+ catch (err) {
71
+ throw new mod_js_1.ConfigError(filePath, [
72
+ {
73
+ field: "(syntax)",
74
+ message: err instanceof Error ? err.message : String(err),
75
+ line: undefined,
76
+ },
77
+ ]);
78
+ }
79
+ // Must be a plain object
80
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
81
+ throw new mod_js_1.ConfigError(filePath, [
82
+ {
83
+ field: "(root)",
84
+ message: "expected a YAML mapping, got " +
85
+ (raw === null ? "null" : Array.isArray(raw) ? "array" : typeof raw),
86
+ line: undefined,
87
+ },
88
+ ]);
89
+ }
90
+ const obj = raw;
91
+ const errors = [];
92
+ // name: required string
93
+ if (obj.name === undefined || obj.name === null || obj.name === "") {
94
+ errors.push({
95
+ field: "name",
96
+ message: "required, must be a non-empty string",
97
+ line: obj.name === undefined ? undefined : findLineNumber(yaml, "name"),
98
+ });
99
+ }
100
+ else if (typeof obj.name !== "string") {
101
+ errors.push({
102
+ field: "name",
103
+ message: `expected string, got ${typeof obj.name}`,
104
+ line: findLineNumber(yaml, "name"),
105
+ });
106
+ }
107
+ // version: optional string
108
+ // version: optional string
109
+ let version = mod_js_1.DEFAULT_PROJECT_CONFIG.version;
110
+ if (obj.version !== undefined && obj.version !== null) {
111
+ if (typeof obj.version === "number") {
112
+ console.error(`warning: ${filePath}: version is a number (${obj.version}), ` +
113
+ `coerced to "${String(obj.version)}". ` +
114
+ `Quote it in YAML: version: "${obj.version}"`);
115
+ }
116
+ version = String(obj.version);
117
+ }
118
+ // labels: optional string[]
119
+ let labels = mod_js_1.DEFAULT_PROJECT_CONFIG.labels;
120
+ if (obj.labels !== undefined && obj.labels !== null) {
121
+ if (!Array.isArray(obj.labels)) {
122
+ errors.push({
123
+ field: "labels",
124
+ message: `expected array, got ${typeof obj.labels}`,
125
+ line: findLineNumber(yaml, "labels"),
126
+ });
127
+ }
128
+ else {
129
+ const bad = obj.labels.findIndex((v) => typeof v !== "string" || v === "");
130
+ if (bad !== -1) {
131
+ errors.push({
132
+ field: `labels[${bad}]`,
133
+ message: "each label must be a non-empty string",
134
+ line: findLineNumber(yaml, "labels"),
135
+ });
136
+ }
137
+ else {
138
+ labels = obj.labels;
139
+ }
140
+ }
141
+ }
142
+ // parents: optional string[] of URLs
143
+ let parents = mod_js_1.DEFAULT_PROJECT_CONFIG.parents;
144
+ if (obj.parents !== undefined && obj.parents !== null) {
145
+ if (!Array.isArray(obj.parents)) {
146
+ errors.push({
147
+ field: "parents",
148
+ message: `expected array, got ${typeof obj.parents}`,
149
+ line: findLineNumber(yaml, "parents"),
150
+ });
151
+ }
152
+ else {
153
+ const bad = obj.parents.findIndex((v) => typeof v !== "string" || !isValidUrl(v));
154
+ if (bad !== -1) {
155
+ errors.push({
156
+ field: `parents[${bad}]`,
157
+ message: "each parent must be a valid URL",
158
+ line: findLineNumber(yaml, "parents"),
159
+ });
160
+ }
161
+ else {
162
+ parents = obj.parents;
163
+ }
164
+ }
165
+ }
166
+ // parent-fallback: optional URL string
167
+ let parentFallback = mod_js_1.DEFAULT_PROJECT_CONFIG.parentFallback;
168
+ const fallbackKey = "parent-fallback";
169
+ if (obj[fallbackKey] !== undefined && obj[fallbackKey] !== null) {
170
+ const val = obj[fallbackKey];
171
+ if (typeof val !== "string" || !isValidUrl(val)) {
172
+ errors.push({
173
+ field: "parent-fallback",
174
+ message: "must be a valid URL",
175
+ line: findLineNumber(yaml, "parent-fallback"),
176
+ });
177
+ }
178
+ else {
179
+ parentFallback = val;
180
+ }
181
+ }
182
+ if (errors.length > 0) {
183
+ throw new mod_js_1.ConfigError(filePath, errors);
184
+ }
185
+ return {
186
+ name: obj.name,
187
+ version,
188
+ labels,
189
+ parents,
190
+ parentFallback,
191
+ };
192
+ }
193
+ // ---------------------------------------------------------------------------
194
+ // Domain derivation
195
+ // ---------------------------------------------------------------------------
196
+ /**
197
+ * Derive a 3-6 letter project domain abbreviation from the project name.
198
+ */
199
+ function deriveDomain(projectName) {
200
+ const lastSegment = projectName.split(".").pop() ?? projectName;
201
+ const words = lastSegment.split(/[-_]+/).filter((w) => w.length > 0);
202
+ if (words.length === 0) {
203
+ return "XXXXX";
204
+ }
205
+ const charsPerWord = Math.ceil(6 / words.length);
206
+ const abbrev = words
207
+ .map((word) => word.slice(0, charsPerWord).toUpperCase())
208
+ .join("");
209
+ if (abbrev.length >= 3 && abbrev.length <= 6) {
210
+ return abbrev;
211
+ }
212
+ else if (abbrev.length > 6) {
213
+ return abbrev.slice(0, 6);
214
+ }
215
+ else {
216
+ return (abbrev + "XXXXXX").slice(0, 6);
217
+ }
218
+ }
219
+ // ---------------------------------------------------------------------------
220
+ // Combined load
221
+ // ---------------------------------------------------------------------------
222
+ /**
223
+ * Discover `project.yaml` by walking up from `startDir`, load, and validate.
224
+ *
225
+ * @returns `LoadConfigResult` if found and valid, `undefined` if not found.
226
+ * @throws {ConfigError} if `project.yaml` exists but is invalid.
227
+ */
228
+ async function loadConfig(startDir, readFile) {
229
+ const root = await discoverProjectRoot(startDir, readFile);
230
+ if (root === undefined)
231
+ return undefined;
232
+ const configPath = (0, path_1.join)(root, exports.CONFIG_FILE_NAME);
233
+ const content = await readFile(configPath);
234
+ if (content === undefined)
235
+ return undefined;
236
+ const config = parseProjectConfig(content, configPath);
237
+ return { config, projectRoot: root, configPath };
238
+ }
239
+ // ---------------------------------------------------------------------------
240
+ // Helpers
241
+ // ---------------------------------------------------------------------------
242
+ function isValidUrl(value) {
243
+ try {
244
+ new URL(value);
245
+ return true;
246
+ }
247
+ catch {
248
+ return false;
249
+ }
250
+ }
@@ -0,0 +1,65 @@
1
+ /**
2
+ * @module formatter
3
+ *
4
+ * Markdown formatter and ULID assigner. Handles write-back operations:
5
+ * ULID stamping, indentation normalization, trailing backslash enforcement,
6
+ * and requirement block insertion.
7
+ */
8
+ import type { Attribute, Diagnostic } from "../model/mod.js";
9
+ /** Options for {@linkcode format}. */
10
+ export interface FormatOptions {
11
+ /** File path for diagnostic messages. */
12
+ readonly file?: string;
13
+ /** ULID generator override (for testing). */
14
+ readonly generateUlid?: () => string;
15
+ }
16
+ /** Result of a format operation. */
17
+ export interface FormatResult {
18
+ /** The formatted Markdown text. */
19
+ readonly output: string;
20
+ /** Diagnostics emitted during formatting (e.g., ULID assignments). */
21
+ readonly diagnostics: readonly Diagnostic[];
22
+ /** Whether any changes were made. */
23
+ readonly changed: boolean;
24
+ }
25
+ /**
26
+ * Format a Markdown string — normalize attribute blocks,
27
+ * fix indentation, enforce canonical ordering.
28
+ *
29
+ * @param markdown - Markdown source text
30
+ * @param options - Format options
31
+ * @returns Format result with output text and diagnostics
32
+ */
33
+ export declare function format(markdown: string, options?: FormatOptions): FormatResult;
34
+ /**
35
+ * Expand CSV values on repeatable-type attributes into one entry per value
36
+ * per ADR-002 §2.6. `id-list` / `tag-list` / `external-id` accept CSV input
37
+ * but must round-trip as multi-line output; `citation` is left alone
38
+ * because locators may contain commas.
39
+ */
40
+ export declare function expandCsvValues(attrs: Attribute[]): Attribute[];
41
+ /**
42
+ * Sort attributes to canonical order per the language spec.
43
+ *
44
+ * `Id:` first, then profile-declared/unknown keys in source order, then
45
+ * universal attributes (References / Labels / External-id / Supersedes /
46
+ * Superseded-by / Deprecated).
47
+ */
48
+ export declare function sortAttributes(attributes: Attribute[]): Attribute[];
49
+ /**
50
+ * Render attributes as indented `Key: Value\` lines.
51
+ * Trailing backslash on all lines except the last.
52
+ */
53
+ export declare function renderAttributeBlock(attributes: Attribute[], indent: number): string;
54
+ /**
55
+ * Find the 0-based line range [start, end) of the attribute block
56
+ * for an entry starting at the given line.
57
+ *
58
+ * Scans forward from the entry start to find the list item boundary,
59
+ * then walks backwards to find the contiguous trailing attribute block.
60
+ */
61
+ export declare function findAttributeBlockRange(lines: readonly string[], entryStartLine: number, indent: number): {
62
+ start: number;
63
+ end: number;
64
+ } | undefined;
65
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/formatter/mod.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EAGX,MAAM,iBAAiB,CAAC;AAyDzB,sCAAsC;AACtC,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,6CAA6C;IAC7C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC;CACtC;AAED,oCAAoC;AACpC,MAAM,WAAW,YAAY;IAC3B,mCAAmC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,qCAAqC;IACrC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CACpB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,aAAa,GACtB,YAAY,CA8Ed;AA8BD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAmB/D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,SAAS,EAAE,GACtB,SAAS,EAAE,CAmCb;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,SAAS,EAAE,EACvB,MAAM,EAAE,MAAM,GACb,MAAM,CAQR;AA2BD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,GACb;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CA2B5C"}
@@ -0,0 +1,313 @@
1
+ "use strict";
2
+ /**
3
+ * @module formatter
4
+ *
5
+ * Markdown formatter and ULID assigner. Handles write-back operations:
6
+ * ULID stamping, indentation normalization, trailing backslash enforcement,
7
+ * and requirement block insertion.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.format = format;
11
+ exports.expandCsvValues = expandCsvValues;
12
+ exports.sortAttributes = sortAttributes;
13
+ exports.renderAttributeBlock = renderAttributeBlock;
14
+ exports.findAttributeBlockRange = findAttributeBlockRange;
15
+ const ulid_1 = require("@std/ulid");
16
+ const yaml_1 = require("@std/yaml");
17
+ const mod_js_1 = require("../model/mod.js");
18
+ const attributes_js_1 = require("../parser/attributes.js");
19
+ const frontmatter_js_1 = require("../parser/frontmatter.js");
20
+ const markdown_js_1 = require("../parser/markdown.js");
21
+ /**
22
+ * Value types that accept CSV on input but must be emitted as multi-line
23
+ * per ADR-002 §2.6. `citation` is deliberately excluded because locators
24
+ * may contain commas.
25
+ */
26
+ const CSV_SPLITTABLE_TYPES = new Set([
27
+ "id-list",
28
+ "tag-list",
29
+ "external-id",
30
+ ]);
31
+ /**
32
+ * Canonical front-matter key order per ADR-007. Core keys first, then
33
+ * `metadata` (reserved free-form map), then `extra` (allowlisted ecosystem
34
+ * keys / profile keys) are emitted verbatim at the end.
35
+ */
36
+ const FRONT_MATTER_CORE_ORDER = [
37
+ "document-id",
38
+ "document-type",
39
+ "labels",
40
+ "deprecated",
41
+ "external-id",
42
+ "supersedes",
43
+ "references",
44
+ ];
45
+ /**
46
+ * Canonical attribute ordering per the language spec.
47
+ *
48
+ * Identity (`Id:`) comes first, then profile-declared attributes appear in
49
+ * the order the author wrote them (or in the order a profile-aware pass
50
+ * may rewrite them), then the universal set
51
+ * (References / Labels / External-id / Supersedes / Deprecated). Unknown
52
+ * keys are placed just before `Labels:`, preserving their relative order.
53
+ *
54
+ * A profile-aware formatter may extend this with profile-declared canonical
55
+ * positions; the core formatter only knows about `Id:` and the universal
56
+ * set.
57
+ */
58
+ const CANONICAL_ORDER = [
59
+ "Id",
60
+ // Profile-declared attributes land here in whatever order the source has
61
+ // them; the filler slot keeps them between Id and the universal set.
62
+ "References",
63
+ "Labels",
64
+ "External-id",
65
+ "Supersedes",
66
+ "Superseded-by",
67
+ "Deprecated",
68
+ ];
69
+ /**
70
+ * Format a Markdown string — normalize attribute blocks,
71
+ * fix indentation, enforce canonical ordering.
72
+ *
73
+ * @param markdown - Markdown source text
74
+ * @param options - Format options
75
+ * @returns Format result with output text and diagnostics
76
+ */
77
+ function format(markdown, options) {
78
+ const file = options?.file ?? "<unknown>";
79
+ // Extract any YAML front matter first so entries are parsed against the
80
+ // body only (front-matter `---` could be confused with horizontal rules).
81
+ const fm = (0, frontmatter_js_1.extractFrontMatter)(markdown, { file });
82
+ const body = fm.hadFrontMatter ? fm.markdown : markdown;
83
+ const entries = (0, markdown_js_1.parseMarkdown)(body, { file });
84
+ const diagnostics = [...fm.diagnostics];
85
+ if (entries.length === 0 && !fm.hadFrontMatter) {
86
+ return { output: markdown, diagnostics, changed: false };
87
+ }
88
+ const lines = body.split("\n");
89
+ let changed = false;
90
+ // Process bottom-to-top so line splicing doesn't shift earlier entries.
91
+ const sorted = [...entries].sort((a, b) => b.location.line - a.location.line);
92
+ const genUlid = options?.generateUlid ?? ulid_1.ulid;
93
+ for (const entry of sorted) {
94
+ const indent = (entry.location.column - 1) + 2;
95
+ let attrs = [...entry.rawAttributes];
96
+ // Assign a bare ULID `Id:` to identified entries that carry no
97
+ // identity yet. Referenced entries are left alone — their `Id:` is a
98
+ // URI that must be author-provided.
99
+ const hasIdentity = attrs.some((a) => a.key === mod_js_1.IDENTITY_KEY);
100
+ if (!hasIdentity && entry.shape === "identified") {
101
+ const newId = genUlid();
102
+ attrs = [{ key: mod_js_1.IDENTITY_KEY, value: newId }, ...attrs];
103
+ diagnostics.push({
104
+ code: "MSL-F001",
105
+ severity: "info",
106
+ message: `assigned Id: ${newId} to ${entry.displayId}`,
107
+ location: entry.location,
108
+ });
109
+ }
110
+ if (attrs.length === 0)
111
+ continue;
112
+ const normalized = sortAttributes(expandCsvValues(attrs));
113
+ const range = findAttributeBlockRange(lines, entry.location.line, indent);
114
+ if (range) {
115
+ // Replace existing attribute block.
116
+ const newBlock = renderAttributeBlock(normalized, indent);
117
+ const oldBlock = lines.slice(range.start, range.end).join("\n");
118
+ if (newBlock !== oldBlock) {
119
+ lines.splice(range.start, range.end - range.start, ...newBlock.split("\n"));
120
+ changed = true;
121
+ }
122
+ }
123
+ else {
124
+ // No attribute block — insert one after the entry body.
125
+ const insertLine = findEntryBodyEnd(lines, entry, indent);
126
+ const newBlock = renderAttributeBlock(normalized, indent);
127
+ lines.splice(insertLine, 0, "", ...newBlock.split("\n"));
128
+ changed = true;
129
+ }
130
+ }
131
+ const formattedBody = lines.join("\n");
132
+ if (fm.hadFrontMatter) {
133
+ const canonicalFm = renderFrontMatter(fm.attributes);
134
+ const output = canonicalFm + formattedBody;
135
+ if (output !== markdown)
136
+ changed = true;
137
+ return { output, diagnostics, changed };
138
+ }
139
+ return { output: formattedBody, diagnostics, changed };
140
+ }
141
+ /**
142
+ * Render {@linkcode DocumentAttributes} as a canonical YAML front matter
143
+ * block. Keys are emitted in canonical order (core → metadata → extra);
144
+ * an `extra` subtree is flattened to top-level keys per ADR-007
145
+ * allowlist conventions.
146
+ */
147
+ function renderFrontMatter(attrs) {
148
+ const ordered = {};
149
+ const a = attrs;
150
+ for (const key of FRONT_MATTER_CORE_ORDER) {
151
+ if (a[key] !== undefined)
152
+ ordered[key] = a[key];
153
+ }
154
+ if (a.metadata !== undefined)
155
+ ordered.metadata = a.metadata;
156
+ if (a.extra && typeof a.extra === "object") {
157
+ for (const [key, value] of Object.entries(a.extra)) {
158
+ ordered[key] = value;
159
+ }
160
+ }
161
+ if (Object.keys(ordered).length === 0) {
162
+ return "---\n---\n\n";
163
+ }
164
+ const yaml = (0, yaml_1.stringify)(ordered).trimEnd();
165
+ return `---\n${yaml}\n---\n\n`;
166
+ }
167
+ /**
168
+ * Expand CSV values on repeatable-type attributes into one entry per value
169
+ * per ADR-002 §2.6. `id-list` / `tag-list` / `external-id` accept CSV input
170
+ * but must round-trip as multi-line output; `citation` is left alone
171
+ * because locators may contain commas.
172
+ */
173
+ function expandCsvValues(attrs) {
174
+ const result = [];
175
+ for (const attr of attrs) {
176
+ const spec = (0, mod_js_1.attributeSpec)(attr.key);
177
+ if (spec && CSV_SPLITTABLE_TYPES.has(spec.type) && attr.value.includes(",")) {
178
+ const values = attr.value
179
+ .split(",")
180
+ .map((s) => s.trim())
181
+ .filter((s) => s.length > 0);
182
+ for (const value of values) {
183
+ result.push({ key: attr.key, value });
184
+ }
185
+ }
186
+ else {
187
+ result.push(attr);
188
+ }
189
+ }
190
+ return result;
191
+ }
192
+ /**
193
+ * Sort attributes to canonical order per the language spec.
194
+ *
195
+ * `Id:` first, then profile-declared/unknown keys in source order, then
196
+ * universal attributes (References / Labels / External-id / Supersedes /
197
+ * Superseded-by / Deprecated).
198
+ */
199
+ function sortAttributes(attributes) {
200
+ const known = new Array(CANONICAL_ORDER.length);
201
+ const unknown = [];
202
+ for (const attr of attributes) {
203
+ const idx = CANONICAL_ORDER.indexOf(attr.key);
204
+ if (idx >= 0) {
205
+ // Preserve duplicates — keep all occurrences of the same key.
206
+ if (!known[idx])
207
+ known[idx] = [];
208
+ known[idx].push(attr);
209
+ }
210
+ else {
211
+ unknown.push(attr);
212
+ }
213
+ }
214
+ const result = [];
215
+ const labelsIdx = CANONICAL_ORDER.indexOf("Labels");
216
+ const hasLabels = known[labelsIdx] != null;
217
+ for (let i = 0; i < known.length; i++) {
218
+ // Insert unknown attributes just before Labels (or at end if no Labels).
219
+ if (i === labelsIdx && hasLabels) {
220
+ result.push(...unknown);
221
+ }
222
+ if (known[i] != null) {
223
+ result.push(...known[i]);
224
+ }
225
+ }
226
+ // If Labels was not present, unknown attrs go at the end.
227
+ if (!hasLabels) {
228
+ result.push(...unknown);
229
+ }
230
+ return result;
231
+ }
232
+ /**
233
+ * Render attributes as indented `Key: Value\` lines.
234
+ * Trailing backslash on all lines except the last.
235
+ */
236
+ function renderAttributeBlock(attributes, indent) {
237
+ const prefix = " ".repeat(indent);
238
+ return attributes
239
+ .map((attr, i) => {
240
+ const sep = i < attributes.length - 1 ? "\\" : "";
241
+ return `${prefix}${attr.key}: ${attr.value}${sep}`;
242
+ })
243
+ .join("\n");
244
+ }
245
+ /**
246
+ * Find the 0-based line index where a list item's content ends.
247
+ * Scans forward from the entry start, stopping at: a sibling list item
248
+ * (`- ` at the entry's marker column), a line with less indent, or EOF.
249
+ */
250
+ function findItemEnd(lines, startIdx, indent) {
251
+ const indentStr = " ".repeat(indent);
252
+ // The marker column is indent - 2 (e.g., indent 2 → marker at column 0).
253
+ const markerPrefix = " ".repeat(Math.max(0, indent - 2)) + "- ";
254
+ for (let i = startIdx + 1; i < lines.length; i++) {
255
+ const line = lines[i];
256
+ if (line.trim() === "")
257
+ continue;
258
+ // Sibling list item at same level
259
+ if (line.startsWith(markerPrefix))
260
+ return i;
261
+ // Line with less indent than continuation
262
+ if (!line.startsWith(indentStr))
263
+ return i;
264
+ }
265
+ return lines.length;
266
+ }
267
+ /**
268
+ * Find the 0-based line range [start, end) of the attribute block
269
+ * for an entry starting at the given line.
270
+ *
271
+ * Scans forward from the entry start to find the list item boundary,
272
+ * then walks backwards to find the contiguous trailing attribute block.
273
+ */
274
+ function findAttributeBlockRange(lines, entryStartLine, indent) {
275
+ const startIdx = entryStartLine - 1;
276
+ const itemEnd = findItemEnd(lines, startIdx, indent);
277
+ // Walk backwards from itemEnd, skip trailing blank lines.
278
+ let scanEnd = itemEnd;
279
+ while (scanEnd > startIdx && lines[scanEnd - 1].trim() === "") {
280
+ scanEnd--;
281
+ }
282
+ if (scanEnd <= startIdx)
283
+ return undefined;
284
+ // Walk backwards collecting attribute lines.
285
+ let attrStart = scanEnd;
286
+ for (let i = scanEnd - 1; i > startIdx; i--) {
287
+ const trimmed = lines[i].trim();
288
+ if (trimmed === "")
289
+ break;
290
+ if (attributes_js_1.ATTR_LINE_RE.test(trimmed)) {
291
+ attrStart = i;
292
+ }
293
+ else {
294
+ break;
295
+ }
296
+ }
297
+ if (attrStart >= scanEnd)
298
+ return undefined;
299
+ return { start: attrStart, end: scanEnd };
300
+ }
301
+ /**
302
+ * Find the 0-based line index where a new attribute block should be inserted
303
+ * (after the last non-blank body line of the entry).
304
+ */
305
+ function findEntryBodyEnd(lines, entry, indent) {
306
+ const startIdx = entry.location.line - 1;
307
+ const itemEnd = findItemEnd(lines, startIdx, indent);
308
+ let insertAt = itemEnd;
309
+ while (insertAt > startIdx && lines[insertAt - 1].trim() === "") {
310
+ insertAt--;
311
+ }
312
+ return insertAt;
313
+ }
package/script/mod.d.ts CHANGED
@@ -7,5 +7,24 @@
7
7
  * This is the library boundary. Everything outside core/ imports
8
8
  * from core/mod.ts, never from internal paths.
9
9
  */
10
+ import "./_dnt.polyfills.js";
10
11
  export declare const VERSION = "0.0.1";
12
+ export { ConfigError, DEFAULT_PROJECT_CONFIG, REFHUB_URL, } from "./model/mod.js";
13
+ export type { Attribute, Caption, ConfigFieldError, Diagnostic, Directive, DisplayId, EffectiveProfile, Entry, EntryShape, EntrySource, InlineRef, Link, LinkKind, ProfileChain, ProjectConfig, Severity, SourceLocation, Ulid, } from "./model/mod.js";
14
+ export { discoverProjectRoot, loadConfig, parseProjectConfig, } from "./config/mod.js";
15
+ export type { LoadConfigResult, ReadFile } from "./config/mod.js";
16
+ export { MARKSPEC_YAML_FILENAME, parseMarkspecYaml, readMarkspecYaml, } from "./config/markspec.js";
17
+ export type { MarkspecYaml, ParseMarkspecYamlResult, } from "./config/markspec.js";
18
+ export { computeCacheKey, computeCacheLocation, defaultAppendFile, defaultRunGit, ensureCacheGitignored, loadChain, loadProfileForCommand, mergeChain, parseManifest, resolveGitSpecifier, resolveLocalSpecifier, } from "./profile/mod.js";
19
+ export type { AppendFile, CacheLocation, GitCacheKeyInput, LoadChainOptions, LoadChainResult, LoadProfileForCommandResult, MergeResult, ParseManifestResult, ResolvedProfileSource, ResolveGitOptions, RunGit, RunGitResult, } from "./profile/mod.js";
20
+ export { detectCaptions, detectDirectives, detectInlineRefs, isSupportedExtension, loadGrammar, parse, parseFile, parseSource, } from "./parser/mod.js";
21
+ export type { DetectCaptionsOptions, DetectDirectivesOptions, DetectInlineRefsOptions, ParseFileResult, ParseOptions, ParseSourceOptions, ParseSourceResult, } from "./parser/mod.js";
22
+ export { format } from "./formatter/mod.js";
23
+ export type { FormatOptions, FormatResult } from "./formatter/mod.js";
24
+ export { classifyEntriesStage, classifyEntry, compileDisplayIdPattern, effectiveScope, effectiveTraceRules, matchesAnyTarget, normalizeListValues, runPipeline, validate, validateAttributesForEntry, validateTraceabilityForEntry, validateValue, } from "./validator/mod.js";
25
+ export type { ClassifyResult, ClassifyStageResult, EffectiveAttrScope, PipelineResult, ValidateResult, ValueValidator, } from "./validator/mod.js";
26
+ export { compile, generateInverses, serializeCompileResult, } from "./compiler/mod.js";
27
+ export type { CompileOptions, CompileResult, GenerateInversesResult, SerializedCompileResult, } from "./compiler/mod.js";
28
+ export { report } from "./reporter/mod.js";
29
+ export type { ReportFormat, ReportKind, ReportOptions, } from "./reporter/mod.js";
11
30
  //# sourceMappingURL=mod.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,qBAAqB,CAAC;AAG7B,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,SAAS,EACT,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV,WAAW,EACX,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,cAAc,EACd,IAAI,GACL,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAElE,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,YAAY,EACZ,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,SAAS,EACT,qBAAqB,EACrB,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,2BAA2B,EAC3B,WAAW,EACX,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,EACN,YAAY,GACb,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,WAAW,EACX,KAAK,EACL,SAAS,EACT,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,uBAAuB,EACvB,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,QAAQ,EACR,0BAA0B,EAC1B,4BAA4B,EAC5B,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,cAAc,GACf,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,OAAO,EACP,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,cAAc,EACd,aAAa,EACb,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,YAAY,EACV,YAAY,EACZ,UAAU,EACV,aAAa,GACd,MAAM,mBAAmB,CAAC"}