@dxos/deus 0.0.0-stage → 0.0.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 (201) hide show
  1. package/LICENSE +105 -0
  2. package/README.md +24 -2
  3. package/bin/deus.ts +42 -0
  4. package/dist/lib/chunk-blocks.mjs +151 -0
  5. package/dist/lib/chunk-blocks.mjs.map +1 -0
  6. package/dist/lib/chunk-check.mjs +452 -0
  7. package/dist/lib/chunk-check.mjs.map +1 -0
  8. package/dist/lib/chunk-completion.mjs +112 -0
  9. package/dist/lib/chunk-completion.mjs.map +1 -0
  10. package/dist/lib/chunk-extension.mjs +396 -0
  11. package/dist/lib/chunk-extension.mjs.map +1 -0
  12. package/dist/lib/chunk-parse.mjs +21 -0
  13. package/dist/lib/chunk-parse.mjs.map +1 -0
  14. package/dist/lib/cli.mjs +946 -0
  15. package/dist/lib/cli.mjs.map +1 -0
  16. package/dist/lib/extension.mjs +4 -0
  17. package/dist/lib/index.mjs +6 -0
  18. package/dist/lib/parse.mjs +4 -0
  19. package/dist/lib/review.mjs +260 -0
  20. package/dist/lib/review.mjs.map +1 -0
  21. package/dist/lib/spec-index.mjs +28 -0
  22. package/dist/lib/spec-index.mjs.map +1 -0
  23. package/dist/types/bin/deus.d.ts +3 -0
  24. package/dist/types/bin/deus.d.ts.map +1 -0
  25. package/dist/types/src/cli/__fixtures__/review/plugin-deps/dx.config.d.ts +8 -0
  26. package/dist/types/src/cli/__fixtures__/review/plugin-deps/dx.config.d.ts.map +1 -0
  27. package/dist/types/src/cli/__fixtures__/review/plugin-deps-diverged/dx.config.d.ts +8 -0
  28. package/dist/types/src/cli/__fixtures__/review/plugin-deps-diverged/dx.config.d.ts.map +1 -0
  29. package/dist/types/src/cli/__fixtures__/review/plugin-deps-empty/dx.config.d.ts +7 -0
  30. package/dist/types/src/cli/__fixtures__/review/plugin-deps-empty/dx.config.d.ts.map +1 -0
  31. package/dist/types/src/cli/__fixtures__/review/plugin-deps-mismatch/dx.config.d.ts +8 -0
  32. package/dist/types/src/cli/__fixtures__/review/plugin-deps-mismatch/dx.config.d.ts.map +1 -0
  33. package/dist/types/src/cli/__fixtures__/review/plugin-deps-noplugin/dx.config.d.ts +5 -0
  34. package/dist/types/src/cli/__fixtures__/review/plugin-deps-noplugin/dx.config.d.ts.map +1 -0
  35. package/dist/types/src/cli/changelog.d.ts +25 -0
  36. package/dist/types/src/cli/changelog.d.ts.map +1 -0
  37. package/dist/types/src/cli/cli.test.d.ts +2 -0
  38. package/dist/types/src/cli/cli.test.d.ts.map +1 -0
  39. package/dist/types/src/cli/errors.d.ts +183 -0
  40. package/dist/types/src/cli/errors.d.ts.map +1 -0
  41. package/dist/types/src/cli/features.d.ts +58 -0
  42. package/dist/types/src/cli/features.d.ts.map +1 -0
  43. package/dist/types/src/cli/git.d.ts +8 -0
  44. package/dist/types/src/cli/git.d.ts.map +1 -0
  45. package/dist/types/src/cli/index.d.ts +12 -0
  46. package/dist/types/src/cli/index.d.ts.map +1 -0
  47. package/dist/types/src/cli/lint.d.ts +17 -0
  48. package/dist/types/src/cli/lint.d.ts.map +1 -0
  49. package/dist/types/src/cli/qa-lint.d.ts +40 -0
  50. package/dist/types/src/cli/qa-lint.d.ts.map +1 -0
  51. package/dist/types/src/cli/qa.d.ts +86 -0
  52. package/dist/types/src/cli/qa.d.ts.map +1 -0
  53. package/dist/types/src/cli/review.d.ts +38 -0
  54. package/dist/types/src/cli/review.d.ts.map +1 -0
  55. package/dist/types/src/cli/spec-index.d.ts +17 -0
  56. package/dist/types/src/cli/spec-index.d.ts.map +1 -0
  57. package/dist/types/src/extension/blocks.d.ts +65 -0
  58. package/dist/types/src/extension/blocks.d.ts.map +1 -0
  59. package/dist/types/src/extension/check.d.ts +99 -0
  60. package/dist/types/src/extension/check.d.ts.map +1 -0
  61. package/dist/types/src/extension/check.test.d.ts +2 -0
  62. package/dist/types/src/extension/check.test.d.ts.map +1 -0
  63. package/dist/types/src/extension/code.d.ts +7 -0
  64. package/dist/types/src/extension/code.d.ts.map +1 -0
  65. package/dist/types/src/extension/complete.d.ts +6 -0
  66. package/dist/types/src/extension/complete.d.ts.map +1 -0
  67. package/dist/types/src/extension/completion.d.ts +10 -0
  68. package/dist/types/src/extension/completion.d.ts.map +1 -0
  69. package/dist/types/src/extension/constants.d.ts +6 -0
  70. package/dist/types/src/extension/constants.d.ts.map +1 -0
  71. package/dist/types/src/extension/fences.d.ts +10 -0
  72. package/dist/types/src/extension/fences.d.ts.map +1 -0
  73. package/dist/types/src/extension/gen/mdl.d.ts +3 -0
  74. package/dist/types/src/extension/gen/mdl.d.ts.map +1 -0
  75. package/dist/types/src/extension/gen/mdl.terms.d.ts +2 -0
  76. package/dist/types/src/extension/gen/mdl.terms.d.ts.map +1 -0
  77. package/dist/types/src/extension/index.d.ts +8 -0
  78. package/dist/types/src/extension/index.d.ts.map +1 -0
  79. package/dist/types/src/extension/language.d.ts +20 -0
  80. package/dist/types/src/extension/language.d.ts.map +1 -0
  81. package/dist/types/src/extension/lint.d.ts +8 -0
  82. package/dist/types/src/extension/lint.d.ts.map +1 -0
  83. package/dist/types/src/extension/parse.d.ts +6 -0
  84. package/dist/types/src/extension/parse.d.ts.map +1 -0
  85. package/dist/types/src/extension/parser.test.d.ts +2 -0
  86. package/dist/types/src/extension/parser.test.d.ts.map +1 -0
  87. package/dist/types/src/extension/refs.d.ts +32 -0
  88. package/dist/types/src/extension/refs.d.ts.map +1 -0
  89. package/dist/types/src/extension/refs.test.d.ts +2 -0
  90. package/dist/types/src/extension/refs.test.d.ts.map +1 -0
  91. package/dist/types/src/extension/syntax.d.ts +12 -0
  92. package/dist/types/src/extension/syntax.d.ts.map +1 -0
  93. package/dist/types/src/index.d.ts +3 -0
  94. package/dist/types/src/index.d.ts.map +1 -0
  95. package/dist/types/src/review/fields.d.ts +9 -0
  96. package/dist/types/src/review/fields.d.ts.map +1 -0
  97. package/dist/types/src/review/index.d.ts +5 -0
  98. package/dist/types/src/review/index.d.ts.map +1 -0
  99. package/dist/types/src/review/review.d.ts +70 -0
  100. package/dist/types/src/review/review.d.ts.map +1 -0
  101. package/dist/types/src/review/review.test.d.ts +2 -0
  102. package/dist/types/src/review/review.test.d.ts.map +1 -0
  103. package/dist/types/src/review/source-key.d.ts +35 -0
  104. package/dist/types/src/review/source-key.d.ts.map +1 -0
  105. package/dist/types/src/review/symbol.d.ts +17 -0
  106. package/dist/types/src/review/symbol.d.ts.map +1 -0
  107. package/dist/types/src/review/symbol.test.d.ts +2 -0
  108. package/dist/types/src/review/symbol.test.d.ts.map +1 -0
  109. package/dist/types/src/spec-index/index.d.ts +3 -0
  110. package/dist/types/src/spec-index/index.d.ts.map +1 -0
  111. package/dist/types/src/spec-index/parse.d.ts +11 -0
  112. package/dist/types/src/spec-index/parse.d.ts.map +1 -0
  113. package/dist/types/src/spec-index/spec-index.d.ts +21 -0
  114. package/dist/types/src/spec-index/spec-index.d.ts.map +1 -0
  115. package/dist/types/src/spec-index/spec-index.test.d.ts +2 -0
  116. package/dist/types/src/spec-index/spec-index.test.d.ts.map +1 -0
  117. package/dist/types/tsconfig.tsbuildinfo +1 -0
  118. package/docs/DESIGN.md +561 -0
  119. package/docs/IDIOMS.md +265 -0
  120. package/lang/PLUGIN-.template.mdl +115 -0
  121. package/lang/app.mdl +200 -0
  122. package/lang/changelog.mdl +184 -0
  123. package/lang/core.mdl +203 -0
  124. package/lang/examples/chess-1.mdl +149 -0
  125. package/lang/examples/chess-2.mdl +203 -0
  126. package/lang/examples/chess-3.mdl +231 -0
  127. package/lang/features.mdl +92 -0
  128. package/lang/plugin.mdl +59 -0
  129. package/lang/qa.mdl +383 -0
  130. package/lang/review.mdl +103 -0
  131. package/lang/sql.mdl +72 -0
  132. package/package.json +74 -3
  133. package/src/cli/__fixtures__/bad-decision.mdl +13 -0
  134. package/src/cli/__fixtures__/features/CYCLE.mdl +25 -0
  135. package/src/cli/__fixtures__/features/FEATURES.mdl +47 -0
  136. package/src/cli/__fixtures__/features/SPEC.mdl +22 -0
  137. package/src/cli/__fixtures__/features/SPEC.review.mdl +32 -0
  138. package/src/cli/__fixtures__/features/TASKS.md +5 -0
  139. package/src/cli/__fixtures__/lint-refs/SPEC.mdl +7 -0
  140. package/src/cli/__fixtures__/lint-refs/SPEC.review.mdl +7 -0
  141. package/src/cli/__fixtures__/qa-lint/packages/plugins/plugin-risky/PLUGIN.mdl +29 -0
  142. package/src/cli/__fixtures__/qa-list/plugin-sample/spec/PLUGIN.mdl +51 -0
  143. package/src/cli/__fixtures__/review/SPEC.mdl +23 -0
  144. package/src/cli/__fixtures__/review/SPEC.review.mdl +26 -0
  145. package/src/cli/__fixtures__/review/plugin-deps/PLUGIN.mdl +9 -0
  146. package/src/cli/__fixtures__/review/plugin-deps/PLUGIN.review.mdl +13 -0
  147. package/src/cli/__fixtures__/review/plugin-deps/dx.config.ts +10 -0
  148. package/src/cli/__fixtures__/review/plugin-deps-diverged/PLUGIN.mdl +9 -0
  149. package/src/cli/__fixtures__/review/plugin-deps-diverged/PLUGIN.review.mdl +14 -0
  150. package/src/cli/__fixtures__/review/plugin-deps-diverged/dx.config.ts +10 -0
  151. package/src/cli/__fixtures__/review/plugin-deps-empty/PLUGIN.mdl +9 -0
  152. package/src/cli/__fixtures__/review/plugin-deps-empty/PLUGIN.review.mdl +13 -0
  153. package/src/cli/__fixtures__/review/plugin-deps-empty/dx.config.ts +9 -0
  154. package/src/cli/__fixtures__/review/plugin-deps-mismatch/PLUGIN.mdl +9 -0
  155. package/src/cli/__fixtures__/review/plugin-deps-mismatch/PLUGIN.review.mdl +13 -0
  156. package/src/cli/__fixtures__/review/plugin-deps-mismatch/dx.config.ts +10 -0
  157. package/src/cli/__fixtures__/review/plugin-deps-noplugin/PLUGIN.mdl +9 -0
  158. package/src/cli/__fixtures__/review/plugin-deps-noplugin/PLUGIN.review.mdl +13 -0
  159. package/src/cli/__fixtures__/review/plugin-deps-noplugin/dx.config.ts +7 -0
  160. package/src/cli/changelog.ts +122 -0
  161. package/src/cli/cli.test.ts +359 -0
  162. package/src/cli/errors.ts +23 -0
  163. package/src/cli/features.ts +320 -0
  164. package/src/cli/git.ts +35 -0
  165. package/src/cli/index.ts +27 -0
  166. package/src/cli/lint.ts +75 -0
  167. package/src/cli/qa-lint.ts +206 -0
  168. package/src/cli/qa.ts +300 -0
  169. package/src/cli/review.ts +359 -0
  170. package/src/cli/spec-index.ts +54 -0
  171. package/src/extension/blocks.ts +169 -0
  172. package/src/extension/check.test.ts +629 -0
  173. package/src/extension/check.ts +552 -0
  174. package/src/extension/code.ts +99 -0
  175. package/src/extension/complete.ts +34 -0
  176. package/src/extension/completion.ts +64 -0
  177. package/src/extension/constants.ts +28 -0
  178. package/src/extension/fences.ts +270 -0
  179. package/src/extension/gen/mdl.terms.ts +16 -0
  180. package/src/extension/gen/mdl.ts +16 -0
  181. package/src/extension/index.ts +25 -0
  182. package/src/extension/language.ts +33 -0
  183. package/src/extension/lint.ts +19 -0
  184. package/src/extension/mdl.grammar +60 -0
  185. package/src/extension/parse.ts +31 -0
  186. package/src/extension/parser.test.ts +248 -0
  187. package/src/extension/refs.test.ts +95 -0
  188. package/src/extension/refs.ts +94 -0
  189. package/src/extension/syntax.ts +25 -0
  190. package/src/index.ts +6 -0
  191. package/src/review/fields.ts +31 -0
  192. package/src/review/index.ts +8 -0
  193. package/src/review/review.test.ts +111 -0
  194. package/src/review/review.ts +184 -0
  195. package/src/review/source-key.ts +63 -0
  196. package/src/review/symbol.test.ts +47 -0
  197. package/src/review/symbol.ts +96 -0
  198. package/src/spec-index/index.ts +6 -0
  199. package/src/spec-index/parse.ts +22 -0
  200. package/src/spec-index/spec-index.test.ts +56 -0
  201. package/src/spec-index/spec-index.ts +49 -0
@@ -0,0 +1,54 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import * as Command from 'effect/cli/Command';
6
+ import * as Flag from 'effect/cli/Flag';
7
+ import * as Console from 'effect/Console';
8
+ import * as Effect from 'effect/Effect';
9
+ import * as FileSystem from 'effect/FileSystem';
10
+ import * as Option from 'effect/Option';
11
+ import * as Path from 'effect/Path';
12
+
13
+ import { indexSpecs, isIndexedSpec } from '../spec-index/index.ts';
14
+ import { git, lines } from './git.ts';
15
+
16
+ /** Indexes every tracked `.mdl` spec under `root`, leaving out what {@link isIndexedSpec} excludes. */
17
+ export const buildSpecIndex = Effect.fnUntraced(function* (root: string) {
18
+ const fs = yield* FileSystem.FileSystem;
19
+ const path = yield* Path.Path;
20
+ const tracked = lines(yield* git(root, '-c', 'core.quotePath=false', 'ls-files', '--', '*.mdl')).filter(
21
+ isIndexedSpec,
22
+ );
23
+ const files = yield* Effect.forEach(tracked, (file) =>
24
+ fs.readFileString(path.join(root, file)).pipe(
25
+ Effect.map((text) => ({ path: file, text })),
26
+ // A tracked file deleted in the working tree is no longer a spec.
27
+ Effect.option,
28
+ ),
29
+ );
30
+ return indexSpecs(files.flatMap((file) => (file._tag === 'Some' ? [file.value] : [])));
31
+ });
32
+
33
+ export type IndexOptions = {
34
+ /** File to write instead of printing. */
35
+ out: Option.Option<string>;
36
+ };
37
+
38
+ /** Indexes every spec of the checkout by id and prints the JSON, or writes it to `out`. */
39
+ export const printIndex = Effect.fnUntraced(function* ({ out }: IndexOptions) {
40
+ const fs = yield* FileSystem.FileSystem;
41
+ const root = yield* git(process.cwd(), 'rev-parse', '--show-toplevel');
42
+ const json = JSON.stringify(yield* buildSpecIndex(root), null, 2);
43
+ if (Option.isSome(out)) {
44
+ yield* fs.writeFileString(out.value, `${json}\n`);
45
+ } else {
46
+ yield* Console.log(json);
47
+ }
48
+ });
49
+
50
+ export const index = Command.make(
51
+ 'index',
52
+ { out: Flag.String('out').pipe(Flag.withDescription('Write the index to this file.'), Flag.optional) },
53
+ printIndex,
54
+ ).pipe(Command.withDescription('Index every .mdl spec of the checkout by its frontmatter id.'));
@@ -0,0 +1,169 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ /**
6
+ * Regex matching the opening fence of a Spec mdl block.
7
+ * All Spec blocks use ```mdl; the block type lives on the first body line.
8
+ */
9
+ export const FENCE_REGEX = /^```mdl\s*$/gm;
10
+
11
+ export type BlockHeader = { type: string; id: string; from: number; to: number; body: string };
12
+
13
+ /** One line of a spec text, classified by its fence context. */
14
+ export type FenceLine = {
15
+ line: string;
16
+ /** Offset of the line in the text. */
17
+ offset: number;
18
+ /** `prose` is outside any fence; `open`/`close` are fence lines; `body` is inside a fence. */
19
+ kind: 'prose' | 'open' | 'body' | 'close';
20
+ /** For `open` and `body`: whether the enclosing fence is a top-level `mdl` block. */
21
+ mdl: boolean;
22
+ };
23
+
24
+ /**
25
+ * Classifies each line of the text by CommonMark fence rules: a fence closes only on a line of the
26
+ * opener's character, at least as long, with no info string, so an example fence encloses nested ones.
27
+ */
28
+ export const scanFenceLines = (text: string, visit: (line: FenceLine) => void): void => {
29
+ let fence: { char: string; length: number; mdl: boolean } | undefined;
30
+ let offset = 0;
31
+ for (const line of text.split('\n')) {
32
+ const marker = line.match(/^ {0,3}(`{3,}|~{3,})(.*)$/);
33
+ const info = marker?.[2].trim() ?? '';
34
+ if (fence) {
35
+ if (marker && marker[1][0] === fence.char && marker[1].length >= fence.length && info === '') {
36
+ visit({ line, offset, kind: 'close', mdl: fence.mdl });
37
+ fence = undefined;
38
+ } else {
39
+ visit({ line, offset, kind: 'body', mdl: fence.mdl });
40
+ }
41
+ } else if (marker && !(marker[1][0] === '`' && info.includes('`'))) {
42
+ fence = { char: marker[1][0], length: marker[1].length, mdl: info === 'mdl' };
43
+ visit({ line, offset, kind: 'open', mdl: fence.mdl });
44
+ } else {
45
+ visit({ line, offset, kind: 'prose', mdl: false });
46
+ }
47
+ offset += line.length + 1;
48
+ }
49
+ };
50
+
51
+ /**
52
+ * Extracts block headers from the raw document text.
53
+ * Returns { type, id, from, to, body } for each top-level `mdl` fence,
54
+ * reading the block type from the first line of the block body.
55
+ * An unclosed block (mid-edit) runs to the end of the text.
56
+ */
57
+ export const parseBlockHeaders = (text: string): BlockHeader[] => {
58
+ const results: BlockHeader[] = [];
59
+ let current: { from: number; to: number; bodyStart: number; bodyEnd: number } | undefined;
60
+ const flush = () => {
61
+ if (!current) {
62
+ return;
63
+ }
64
+ const body = text.slice(current.bodyStart, current.bodyEnd);
65
+ const firstBodyLine = body.split('\n', 1)[0].trim();
66
+ // First body line: "<blockType> [name][: label]"
67
+ const lineMatch = firstBodyLine.match(/^(\w+)(?:\s+([^\s:][^\n:]*?))?(?::\s*[^\n]*)?\s*$/);
68
+ results.push({
69
+ type: lineMatch?.[1] ?? '',
70
+ id: lineMatch?.[2]?.trim() ?? '',
71
+ from: current.from,
72
+ to: current.to,
73
+ body,
74
+ });
75
+ current = undefined;
76
+ };
77
+
78
+ scanFenceLines(text, ({ line, offset, kind, mdl }) => {
79
+ // A top-level `mdl` opener inside an unclosed block ends it, since a block never nests (mid-edit).
80
+ const reopens = kind === 'body' && mdl && /^ {0,3}`{3,}mdl\s*$/.test(line);
81
+ if (reopens && current) {
82
+ current.bodyEnd = offset;
83
+ flush();
84
+ }
85
+ if ((kind === 'open' && mdl) || reopens) {
86
+ current = { from: offset, to: offset + line.length, bodyStart: offset + line.length + 1, bodyEnd: text.length };
87
+ } else if (kind === 'close' && mdl) {
88
+ if (current) {
89
+ current.bodyEnd = offset;
90
+ }
91
+ flush();
92
+ }
93
+ });
94
+ flush();
95
+ return results;
96
+ };
97
+
98
+ /** One fenced `mdl` block: its type, identifier and title from the header line, and the body below it. */
99
+ export type MdlBlock = {
100
+ type: string;
101
+ /** Empty for a block with no identifier. */
102
+ id: string;
103
+ /** The prose after the header's colon, if any. */
104
+ title?: string;
105
+ /** The block's lines after the header. */
106
+ body: string;
107
+ /** Offset of the opening fence in the text. */
108
+ from: number;
109
+ };
110
+
111
+ /** Every fenced `mdl` block of a spec, in document order. */
112
+ export const parseMdlBlocks = (text: string): MdlBlock[] =>
113
+ parseBlockHeaders(text).map(({ type, id, from, body }) => {
114
+ const newline = body.indexOf('\n');
115
+ const header = newline === -1 ? body : body.slice(0, newline);
116
+ const title = header.match(/^\s*\w+\s+[^\s:][^\n:]*?:\s*(.+?)\s*$/)?.[1];
117
+ return { type, id, ...(title && { title }), body: newline === -1 ? '' : body.slice(newline + 1), from };
118
+ });
119
+
120
+ /** A block header line: `<type> [<id>][: <title>]`. */
121
+ export const BLOCK_HEADER_LINE = /^(\w+)(\s+[^\s:][^\n:]*?)?(:\s*.*)?\s*$/;
122
+
123
+ /** The terms a document's `## Extensions` table declares: the backticked first cell of each row. */
124
+ export const extensionTerms = (text: string): string[] => {
125
+ const terms: string[] = [];
126
+ let inExtensions = false;
127
+ scanFenceLines(text, ({ line, kind }) => {
128
+ if (kind !== 'prose') {
129
+ return;
130
+ }
131
+ if (/^## /.test(line)) {
132
+ inExtensions = /^## Extensions\s*$/.test(line);
133
+ } else if (inExtensions) {
134
+ const term = line.match(/^\|\s*`([\w-]+)`/)?.[1];
135
+ if (term) {
136
+ terms.push(term);
137
+ }
138
+ }
139
+ });
140
+ return terms;
141
+ };
142
+
143
+ /** A block header that follows another block inside the same fence. */
144
+ export type InnerBlockHeader = { type: string; id: string; from: number; to: number };
145
+
146
+ /**
147
+ * Finds the block headers an `mdl` fence hides after its first block: lines past the fence's first body line, at
148
+ * column 0 (a block body is always indented), whose first word is one of `types`.
149
+ */
150
+ export const findInnerBlockHeaders = (text: string, types: ReadonlySet<string>): InnerBlockHeader[] => {
151
+ const headers: InnerBlockHeader[] = [];
152
+ let first = false;
153
+ scanFenceLines(text, ({ line, offset, kind, mdl }) => {
154
+ // A top-level `mdl` opener inside an unclosed block starts a new block, as in `parseBlockHeaders`.
155
+ if (kind === 'open' || (kind === 'body' && mdl && /^ {0,3}`{3,}mdl\s*$/.test(line))) {
156
+ first = true;
157
+ } else if (kind === 'body' && mdl) {
158
+ if (first) {
159
+ first = false;
160
+ return;
161
+ }
162
+ const match = line.match(BLOCK_HEADER_LINE);
163
+ if (match && types.has(match[1])) {
164
+ headers.push({ type: match[1], id: match[2]?.trim() ?? '', from: offset, to: offset + line.length });
165
+ }
166
+ }
167
+ });
168
+ return headers;
169
+ };