@dotit/core 1.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.
- package/LICENSE +21 -0
- package/README.md +229 -0
- package/dist/aliases.d.ts +1 -0
- package/dist/aliases.js +8 -0
- package/dist/ask.d.ts +7 -0
- package/dist/ask.js +55 -0
- package/dist/browser.d.ts +12 -0
- package/dist/browser.js +32 -0
- package/dist/diff.d.ts +17 -0
- package/dist/diff.js +179 -0
- package/dist/document-css.d.ts +1 -0
- package/dist/document-css.js +290 -0
- package/dist/executor.d.ts +40 -0
- package/dist/executor.js +501 -0
- package/dist/history.d.ts +10 -0
- package/dist/history.js +297 -0
- package/dist/html-to-it.d.ts +1 -0
- package/dist/html-to-it.js +288 -0
- package/dist/index-builder.d.ts +62 -0
- package/dist/index-builder.js +228 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.js +94 -0
- package/dist/language-registry.d.ts +39 -0
- package/dist/language-registry.js +530 -0
- package/dist/markdown.d.ts +1 -0
- package/dist/markdown.js +123 -0
- package/dist/merge.d.ts +6 -0
- package/dist/merge.js +255 -0
- package/dist/parser.d.ts +29 -0
- package/dist/parser.js +1562 -0
- package/dist/query.d.ts +32 -0
- package/dist/query.js +293 -0
- package/dist/renderer.d.ts +16 -0
- package/dist/renderer.js +1286 -0
- package/dist/schema.d.ts +47 -0
- package/dist/schema.js +574 -0
- package/dist/source.d.ts +3 -0
- package/dist/source.js +223 -0
- package/dist/theme.d.ts +49 -0
- package/dist/theme.js +113 -0
- package/dist/themes/corporate.json +86 -0
- package/dist/themes/dark.json +64 -0
- package/dist/themes/editorial.json +54 -0
- package/dist/themes/legal.json +57 -0
- package/dist/themes/minimal.json +50 -0
- package/dist/themes/print.json +54 -0
- package/dist/themes/technical.json +59 -0
- package/dist/themes/warm.json +53 -0
- package/dist/trust.d.ts +66 -0
- package/dist/trust.js +200 -0
- package/dist/types.d.ts +234 -0
- package/dist/types.js +19 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +13 -0
- package/dist/validate.d.ts +13 -0
- package/dist/validate.js +711 -0
- package/dist/workflow.d.ts +18 -0
- package/dist/workflow.js +160 -0
- package/package.json +51 -0
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EXTENSION_LEGACY_ALIASES = exports.EXTENSION_NS_MAP = exports.EXTENSION_KEYWORDS = exports.CALLOUT_ALIAS_MAP = exports.CORE_KEYWORDS = exports.KEYWORD_TIERS = exports.PUBLIC_KEYWORDS = exports.COMPAT_KEYWORDS = exports.BOUNDARY_KEYWORDS = exports.COMPAT_ONLY_ALIASES = exports.DEPRECATED_ALIASES = exports.ALIAS_MAP = exports.EXTENSION_COUNT = exports.KEYWORD_COUNT = exports.CANONICAL_KEYWORDS = exports.EXTENSION_REGISTRY = exports.LANGUAGE_REGISTRY = void 0;
|
|
4
|
+
exports.tierOf = tierOf;
|
|
5
|
+
exports.LANGUAGE_REGISTRY = [
|
|
6
|
+
{
|
|
7
|
+
canonical: "title",
|
|
8
|
+
category: "identity",
|
|
9
|
+
since: "1.0",
|
|
10
|
+
status: "stable",
|
|
11
|
+
description: "Unique document title — renders as H1",
|
|
12
|
+
aliases: [{ alias: "عنوان", status: "alias" }, { alias: "h1", status: "compat-only" }],
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
canonical: "summary",
|
|
16
|
+
category: "identity",
|
|
17
|
+
since: "1.0",
|
|
18
|
+
status: "stable",
|
|
19
|
+
description: "Short document description",
|
|
20
|
+
aliases: [{ alias: "ملخص", status: "alias" }, { alias: "abstract", status: "alias" }],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
canonical: "meta",
|
|
24
|
+
category: "identity",
|
|
25
|
+
since: "2.8.1",
|
|
26
|
+
status: "stable",
|
|
27
|
+
description: "Document metadata (author, tags, theme, type)",
|
|
28
|
+
aliases: [{ alias: "بيانات", status: "alias" },],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
canonical: "context",
|
|
32
|
+
category: "identity",
|
|
33
|
+
since: "2.0",
|
|
34
|
+
status: "stable",
|
|
35
|
+
description: "Agent execution context and scoped variables",
|
|
36
|
+
aliases: [],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
canonical: "section",
|
|
40
|
+
category: "structure",
|
|
41
|
+
since: "1.0",
|
|
42
|
+
status: "stable",
|
|
43
|
+
description: "Major heading / context boundary — renders as H2",
|
|
44
|
+
aliases: [{ alias: "قسم", status: "alias" },
|
|
45
|
+
{ alias: "heading", status: "alias" },
|
|
46
|
+
{ alias: "chapter", status: "alias" },
|
|
47
|
+
{ alias: "h2", status: "compat-only" },
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
canonical: "sub",
|
|
52
|
+
category: "structure",
|
|
53
|
+
since: "1.0",
|
|
54
|
+
status: "stable",
|
|
55
|
+
description: "Sub-section — renders as H3",
|
|
56
|
+
aliases: [{ alias: "فرعي", status: "alias" },
|
|
57
|
+
{ alias: "subheading", status: "alias" },
|
|
58
|
+
{ alias: "h3", status: "compat-only" },
|
|
59
|
+
{ alias: "subsection", status: "compat-only" },
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
canonical: "toc",
|
|
64
|
+
category: "structure",
|
|
65
|
+
since: "2.5",
|
|
66
|
+
status: "stable",
|
|
67
|
+
description: "Auto-generated table of contents",
|
|
68
|
+
aliases: [],
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
canonical: "text",
|
|
72
|
+
category: "content",
|
|
73
|
+
since: "1.0",
|
|
74
|
+
status: "stable",
|
|
75
|
+
description: "Body paragraph (note: is alias)",
|
|
76
|
+
aliases: [{ alias: "نص", status: "alias" },
|
|
77
|
+
{ alias: "note", status: "alias" },
|
|
78
|
+
{ alias: "body", status: "alias" },
|
|
79
|
+
{ alias: "content", status: "alias" },
|
|
80
|
+
{ alias: "paragraph", status: "alias" },
|
|
81
|
+
{ alias: "p", status: "compat-only" },
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
canonical: "info",
|
|
86
|
+
category: "content",
|
|
87
|
+
since: "1.0",
|
|
88
|
+
status: "stable",
|
|
89
|
+
description: "Callout block (warning/danger/tip/success are aliases with type injection)",
|
|
90
|
+
aliases: [{ alias: "تنبيه", status: "alias" },
|
|
91
|
+
{ alias: "warning", status: "alias" },
|
|
92
|
+
{ alias: "danger", status: "alias" },
|
|
93
|
+
{ alias: "tip", status: "alias" },
|
|
94
|
+
{ alias: "success", status: "alias" },
|
|
95
|
+
{ alias: "alert", status: "alias" },
|
|
96
|
+
{ alias: "caution", status: "alias" },
|
|
97
|
+
{ alias: "critical", status: "alias" },
|
|
98
|
+
{ alias: "destructive", status: "alias" },
|
|
99
|
+
{ alias: "hint", status: "alias" },
|
|
100
|
+
{ alias: "advice", status: "alias" },
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
canonical: "quote",
|
|
105
|
+
category: "content",
|
|
106
|
+
since: "1.0",
|
|
107
|
+
status: "stable",
|
|
108
|
+
description: "Attributed block quotation",
|
|
109
|
+
aliases: [{ alias: "اقتباس", status: "alias" },
|
|
110
|
+
{ alias: "blockquote", status: "alias" },
|
|
111
|
+
{ alias: "excerpt", status: "alias" },
|
|
112
|
+
{ alias: "pullquote", status: "alias" },
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
canonical: "cite",
|
|
117
|
+
category: "content",
|
|
118
|
+
since: "1.0",
|
|
119
|
+
status: "stable",
|
|
120
|
+
description: "Bibliographic citation (author, date, url) — NOT same as quote",
|
|
121
|
+
aliases: [{ alias: "استشهاد", status: "alias" },
|
|
122
|
+
{ alias: "citation", status: "alias" },
|
|
123
|
+
{ alias: "source", status: "alias" },
|
|
124
|
+
{ alias: "reference", status: "alias" },
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
canonical: "code",
|
|
129
|
+
category: "content",
|
|
130
|
+
since: "1.0",
|
|
131
|
+
status: "stable",
|
|
132
|
+
description: "Code block with optional language for syntax highlighting",
|
|
133
|
+
aliases: [{ alias: "شيفرة", status: "alias" }, { alias: "snippet", status: "alias" }],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
canonical: "image",
|
|
137
|
+
category: "content",
|
|
138
|
+
since: "1.0",
|
|
139
|
+
status: "stable",
|
|
140
|
+
description: "Image with optional caption",
|
|
141
|
+
aliases: [{ alias: "صورة", status: "alias" },
|
|
142
|
+
{ alias: "img", status: "alias" },
|
|
143
|
+
{ alias: "photo", status: "alias" },
|
|
144
|
+
{ alias: "picture", status: "alias" },
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
canonical: "link",
|
|
149
|
+
category: "content",
|
|
150
|
+
since: "1.0",
|
|
151
|
+
status: "stable",
|
|
152
|
+
description: "Hyperlink to an external resource",
|
|
153
|
+
aliases: [{ alias: "رابط", status: "alias" },
|
|
154
|
+
{ alias: "url", status: "alias" },
|
|
155
|
+
{ alias: "href", status: "alias" },
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
canonical: "task",
|
|
160
|
+
category: "agent",
|
|
161
|
+
since: "1.0",
|
|
162
|
+
status: "stable",
|
|
163
|
+
description: "Actionable item with owner and due date",
|
|
164
|
+
aliases: [{ alias: "مهمة", status: "alias" },
|
|
165
|
+
{ alias: "check", status: "alias" },
|
|
166
|
+
{ alias: "todo", status: "alias" },
|
|
167
|
+
{ alias: "action", status: "alias" },
|
|
168
|
+
{ alias: "item", status: "alias" },
|
|
169
|
+
],
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
canonical: "done",
|
|
173
|
+
category: "agent",
|
|
174
|
+
since: "2.0",
|
|
175
|
+
status: "stable",
|
|
176
|
+
description: "Completed item — the resolved state of a task: block",
|
|
177
|
+
aliases: [{ alias: "منجز", status: "alias" },
|
|
178
|
+
{ alias: "completed", status: "compat-only" },
|
|
179
|
+
{ alias: "finished", status: "compat-only" },
|
|
180
|
+
],
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
canonical: "ask",
|
|
184
|
+
category: "agent",
|
|
185
|
+
since: "1.0",
|
|
186
|
+
status: "stable",
|
|
187
|
+
description: "Open question requiring a response",
|
|
188
|
+
aliases: [{ alias: "question", status: "compat-only" }],
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
canonical: "columns",
|
|
192
|
+
category: "data",
|
|
193
|
+
since: "1.0",
|
|
194
|
+
status: "stable",
|
|
195
|
+
description: "Table column definitions (declares headers for following row: blocks)",
|
|
196
|
+
aliases: [{ alias: "أعمدة", status: "alias" }, { alias: "headers", status: "compat-only" }],
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
canonical: "row",
|
|
200
|
+
category: "data",
|
|
201
|
+
since: "1.0",
|
|
202
|
+
status: "stable",
|
|
203
|
+
description: "Table data row — pipe-separated cell values",
|
|
204
|
+
aliases: [{ alias: "صف", status: "alias" },],
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
canonical: "metric",
|
|
208
|
+
category: "data",
|
|
209
|
+
since: "2.11",
|
|
210
|
+
status: "stable",
|
|
211
|
+
description: "Named measurement with value",
|
|
212
|
+
aliases: [{ alias: "مؤشر", status: "alias" },
|
|
213
|
+
{ alias: "kpi", status: "alias" },
|
|
214
|
+
{ alias: "measure", status: "alias" },
|
|
215
|
+
{ alias: "indicator", status: "alias" },
|
|
216
|
+
{ alias: "stat", status: "compat-only" },
|
|
217
|
+
],
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
canonical: "step",
|
|
221
|
+
category: "agent",
|
|
222
|
+
since: "2.0",
|
|
223
|
+
status: "stable",
|
|
224
|
+
description: "Execute a tool or action",
|
|
225
|
+
aliases: [{ alias: "run", status: "alias" }],
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
canonical: "decision",
|
|
229
|
+
category: "agent",
|
|
230
|
+
since: "2.0",
|
|
231
|
+
status: "stable",
|
|
232
|
+
description: "Conditional branch",
|
|
233
|
+
aliases: [{ alias: "if", status: "alias" }],
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
canonical: "gate",
|
|
237
|
+
category: "agent",
|
|
238
|
+
since: "2.2",
|
|
239
|
+
status: "stable",
|
|
240
|
+
description: "Human approval checkpoint",
|
|
241
|
+
aliases: [],
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
canonical: "trigger",
|
|
245
|
+
category: "agent",
|
|
246
|
+
since: "2.0",
|
|
247
|
+
status: "stable",
|
|
248
|
+
description: "Workflow entry point",
|
|
249
|
+
aliases: [{ alias: "on", status: "alias" }],
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
canonical: "result",
|
|
253
|
+
category: "agent",
|
|
254
|
+
since: "2.1",
|
|
255
|
+
status: "stable",
|
|
256
|
+
description: "Terminal workflow output",
|
|
257
|
+
aliases: [],
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
canonical: "policy",
|
|
261
|
+
category: "agent",
|
|
262
|
+
since: "2.7",
|
|
263
|
+
status: "stable",
|
|
264
|
+
description: "Standing behavioural rule",
|
|
265
|
+
aliases: [
|
|
266
|
+
{ alias: "rule", status: "alias" },
|
|
267
|
+
{ alias: "constraint", status: "alias" },
|
|
268
|
+
{ alias: "guard", status: "alias" },
|
|
269
|
+
{ alias: "requirement", status: "alias" },
|
|
270
|
+
],
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
canonical: "audit",
|
|
274
|
+
category: "agent",
|
|
275
|
+
since: "2.0",
|
|
276
|
+
status: "stable",
|
|
277
|
+
description: "Immutable execution record",
|
|
278
|
+
aliases: [{ alias: "log", status: "alias" }],
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
canonical: "track",
|
|
282
|
+
category: "trust",
|
|
283
|
+
since: "2.8",
|
|
284
|
+
status: "stable",
|
|
285
|
+
description: "Start tracking document",
|
|
286
|
+
aliases: [{ alias: "تتبع", status: "alias" },],
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
canonical: "approve",
|
|
290
|
+
category: "trust",
|
|
291
|
+
since: "2.8",
|
|
292
|
+
status: "stable",
|
|
293
|
+
description: "Approval record",
|
|
294
|
+
aliases: [{ alias: "اعتماد", status: "alias" },],
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
canonical: "sign",
|
|
298
|
+
category: "trust",
|
|
299
|
+
since: "2.8",
|
|
300
|
+
status: "stable",
|
|
301
|
+
description: "Signature / attestation record",
|
|
302
|
+
aliases: [{ alias: "توقيع", status: "alias" }, { alias: "sig", status: "alias" }],
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
canonical: "freeze",
|
|
306
|
+
category: "trust",
|
|
307
|
+
since: "2.8",
|
|
308
|
+
status: "stable",
|
|
309
|
+
description: "Lock document against changes",
|
|
310
|
+
aliases: [{ alias: "تجميد", status: "alias" }, { alias: "lock", status: "alias" }],
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
canonical: "amendment",
|
|
314
|
+
category: "trust",
|
|
315
|
+
since: "2.11",
|
|
316
|
+
status: "stable",
|
|
317
|
+
description: "Formal change to frozen document",
|
|
318
|
+
aliases: [{ alias: "تعديل", status: "alias" },
|
|
319
|
+
{ alias: "amend", status: "alias" },
|
|
320
|
+
{ alias: "change", status: "alias" },
|
|
321
|
+
],
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
canonical: "page",
|
|
325
|
+
category: "layout",
|
|
326
|
+
since: "2.5",
|
|
327
|
+
status: "stable",
|
|
328
|
+
description: "Page layout declaration (document-level)",
|
|
329
|
+
aliases: [{ alias: "صفحة", status: "alias" },],
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
canonical: "header",
|
|
333
|
+
category: "layout",
|
|
334
|
+
since: "2.9",
|
|
335
|
+
status: "stable",
|
|
336
|
+
description: "Page header for print output",
|
|
337
|
+
aliases: [{ alias: "ترويسة", status: "alias" },],
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
canonical: "footer",
|
|
341
|
+
category: "layout",
|
|
342
|
+
since: "2.9",
|
|
343
|
+
status: "stable",
|
|
344
|
+
description: "Page footer for print output",
|
|
345
|
+
aliases: [{ alias: "تذييل", status: "alias" },],
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
canonical: "watermark",
|
|
349
|
+
category: "layout",
|
|
350
|
+
since: "2.9",
|
|
351
|
+
status: "stable",
|
|
352
|
+
description: "Watermark overlay (print)",
|
|
353
|
+
aliases: [{ alias: "علامة", status: "alias" },],
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
canonical: "style",
|
|
357
|
+
category: "layout",
|
|
358
|
+
since: "4.3",
|
|
359
|
+
status: "stable",
|
|
360
|
+
description: "Scoped document style rule: maps a block type to style properties (house styling without per-line props)",
|
|
361
|
+
aliases: [{ alias: "نمط", status: "alias" },],
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
canonical: "break",
|
|
365
|
+
category: "layout",
|
|
366
|
+
since: "1.0",
|
|
367
|
+
status: "stable",
|
|
368
|
+
description: "Print page break — invisible in web, forces new page in print",
|
|
369
|
+
aliases: [{ alias: "فاصل", status: "alias" },],
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
canonical: "history",
|
|
373
|
+
category: "trust",
|
|
374
|
+
since: "2.12",
|
|
375
|
+
status: "boundary",
|
|
376
|
+
description: "History boundary — separates document body from revision log",
|
|
377
|
+
aliases: [],
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
canonical: "divider",
|
|
381
|
+
category: "layout",
|
|
382
|
+
since: "2.12",
|
|
383
|
+
status: "compat-only",
|
|
384
|
+
description: "Internal: visible horizontal rule — users write --- directly",
|
|
385
|
+
aliases: [
|
|
386
|
+
{ alias: "hr", status: "alias" },
|
|
387
|
+
{ alias: "separator", status: "alias" },
|
|
388
|
+
],
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
canonical: "revision",
|
|
392
|
+
category: "trust",
|
|
393
|
+
since: "2.8",
|
|
394
|
+
status: "compat-only",
|
|
395
|
+
description: "Internal: auto-generated revision record in history section",
|
|
396
|
+
aliases: [],
|
|
397
|
+
},
|
|
398
|
+
];
|
|
399
|
+
exports.EXTENSION_REGISTRY = [
|
|
400
|
+
{ keyword: "byline", namespace: "writer", xForm: "x-writer: byline", since: "2.5", description: "Author byline with date and publication" },
|
|
401
|
+
{ keyword: "epigraph", namespace: "writer", xForm: "x-writer: epigraph", since: "2.5", description: "Introductory quotation at the start of a document" },
|
|
402
|
+
{ keyword: "figure", namespace: "writer", xForm: "x-writer: figure", since: "2.11", description: "Numbered captioned figure — NOT an alias for image:" },
|
|
403
|
+
{ keyword: "caption", namespace: "writer", xForm: "x-writer: caption", since: "2.5", description: "Figure or table caption" },
|
|
404
|
+
{ keyword: "footnote", namespace: "writer", xForm: "x-writer: footnote", since: "2.5", description: "Numbered footnote" },
|
|
405
|
+
{ keyword: "dedication", namespace: "writer", xForm: "x-writer: dedication", since: "2.5", description: "Document dedication page" },
|
|
406
|
+
{ keyword: "def", namespace: "doc", xForm: "x-doc: def", since: "2.11", description: "Term definition — inline or glossary entry" },
|
|
407
|
+
{ keyword: "contact", namespace: "doc", xForm: "x-doc: contact", since: "2.11", description: "Person or organization contact information" },
|
|
408
|
+
{ keyword: "deadline", namespace: "doc", xForm: "x-doc: deadline", since: "2.11", description: "Date-bound milestone or due date" },
|
|
409
|
+
{ keyword: "ref", namespace: "doc", xForm: "x-doc: ref", since: "2.11", description: "Cross-document reference with typed relationship" },
|
|
410
|
+
{ keyword: "signline", namespace: "doc", xForm: "x-doc: signline", since: "2.11", description: "Physical signature line for print" },
|
|
411
|
+
{ keyword: "loop", namespace: "agent", xForm: "x-agent: loop", since: "2.0", description: "Iterate over a collection" },
|
|
412
|
+
{ keyword: "parallel", namespace: "agent", xForm: "x-agent: parallel", since: "2.1", description: "Run multiple steps concurrently" },
|
|
413
|
+
{ keyword: "retry", namespace: "agent", xForm: "x-agent: retry", since: "2.1", description: "Retry a failed step with backoff" },
|
|
414
|
+
{ keyword: "wait", namespace: "agent", xForm: "x-agent: wait", since: "2.1", description: "Pause execution until an event or timeout" },
|
|
415
|
+
{ keyword: "handoff", namespace: "agent", xForm: "x-agent: handoff", since: "2.1", description: "Transfer control to another agent" },
|
|
416
|
+
{ keyword: "call", namespace: "agent", xForm: "x-agent: call", since: "2.2", description: "Invoke a sub-workflow by file reference" },
|
|
417
|
+
{ keyword: "checkpoint", namespace: "agent", xForm: "x-agent: checkpoint", since: "2.0", description: "Named workflow checkpoint for resume and rollback" },
|
|
418
|
+
{ keyword: "error", namespace: "agent", xForm: "x-agent: error", since: "2.0", description: "Error record with severity and retry metadata" },
|
|
419
|
+
{ keyword: "import", namespace: "agent", xForm: "x-agent: import", since: "2.0", description: "Import a workflow from a file" },
|
|
420
|
+
{ keyword: "export", namespace: "agent", xForm: "x-agent: export", since: "2.0", description: "Export data or workflow output" },
|
|
421
|
+
{ keyword: "progress", namespace: "agent", xForm: "x-agent: progress", since: "2.0", description: "Progress indicator for long-running operations" },
|
|
422
|
+
{ keyword: "agent", namespace: "agent", xForm: "x-agent: agent", since: "2.0", description: "Document-level agent name/identifier config" },
|
|
423
|
+
{ keyword: "model", namespace: "agent", xForm: "x-agent: model", since: "2.0", description: "Default AI model for this document" },
|
|
424
|
+
{ keyword: "tool", namespace: "agent", xForm: "x-agent: tool", since: "2.0", description: "External tool or API declaration" },
|
|
425
|
+
{ keyword: "prompt", namespace: "agent", xForm: "x-agent: prompt", since: "2.0", description: "LLM prompt template" },
|
|
426
|
+
{ keyword: "memory", namespace: "agent", xForm: "x-agent: memory", since: "2.0", description: "Agent memory or persistent state declaration" },
|
|
427
|
+
{ keyword: "signal", namespace: "agent", xForm: "x-agent: signal", since: "2.2", description: "Emit a named workflow signal or event" },
|
|
428
|
+
{ keyword: "embed", namespace: "agent", xForm: "x-agent: embed", since: "1.0", description: "Embed a referenced external resource" },
|
|
429
|
+
{ keyword: "history", namespace: "trust", xForm: "x-trust: history", since: "2.12", description: "History boundary marker" },
|
|
430
|
+
{ keyword: "revision", namespace: "trust", xForm: "x-trust: revision", since: "2.8", description: "Auto-generated revision record" },
|
|
431
|
+
{ keyword: "font", namespace: "layout", xForm: "x-layout: font", since: "2.5", description: "Typography settings (use page: properties instead)" },
|
|
432
|
+
{ keyword: "assert", namespace: "exp", xForm: "x-exp: assert", since: "2.13", description: "Testable assertion — evaluable by agents and CI" },
|
|
433
|
+
{ keyword: "secret", namespace: "exp", xForm: "x-exp: secret", since: "2.13", description: "Secret or credential reference — never rendered" },
|
|
434
|
+
{ keyword: "input", namespace: "exp", xForm: "x-exp: input", since: "1.3", description: "Declared input parameter for templates and workflows" },
|
|
435
|
+
{ keyword: "output", namespace: "exp", xForm: "x-exp: output", since: "1.3", description: "Declared output parameter for templates and workflows" },
|
|
436
|
+
];
|
|
437
|
+
exports.CANONICAL_KEYWORDS = exports.LANGUAGE_REGISTRY.filter((k) => k.status === "stable").map((k) => k.canonical);
|
|
438
|
+
exports.KEYWORD_COUNT = exports.CANONICAL_KEYWORDS.length;
|
|
439
|
+
exports.EXTENSION_COUNT = exports.EXTENSION_REGISTRY.length;
|
|
440
|
+
const ALL_REGISTRY_KEYWORDS = exports.LANGUAGE_REGISTRY.map((k) => k.canonical);
|
|
441
|
+
exports.ALIAS_MAP = Object.fromEntries(exports.LANGUAGE_REGISTRY.flatMap((k) => k.aliases.map((a) => [a.alias, k.canonical])));
|
|
442
|
+
exports.DEPRECATED_ALIASES = new Set(exports.LANGUAGE_REGISTRY.flatMap((k) => k.aliases.filter((a) => a.status === "deprecated").map((a) => a.alias)));
|
|
443
|
+
exports.COMPAT_ONLY_ALIASES = new Set(exports.LANGUAGE_REGISTRY.flatMap((k) => k.aliases.filter((a) => a.status === "compat-only").map((a) => a.alias)));
|
|
444
|
+
exports.BOUNDARY_KEYWORDS = new Set(exports.LANGUAGE_REGISTRY.filter((k) => k.status === "boundary").map((k) => k.canonical));
|
|
445
|
+
exports.COMPAT_KEYWORDS = exports.LANGUAGE_REGISTRY.filter((k) => k.status === "compat-only").map((k) => k.canonical);
|
|
446
|
+
exports.PUBLIC_KEYWORDS = exports.LANGUAGE_REGISTRY.filter((k) => k.status === "stable");
|
|
447
|
+
const CATEGORY_TIER = {
|
|
448
|
+
identity: "core",
|
|
449
|
+
structure: "core",
|
|
450
|
+
content: "core",
|
|
451
|
+
agent: "agent",
|
|
452
|
+
data: "data",
|
|
453
|
+
trust: "contract",
|
|
454
|
+
layout: "print",
|
|
455
|
+
};
|
|
456
|
+
const TIER_OVERRIDES = {
|
|
457
|
+
task: "core",
|
|
458
|
+
done: "core",
|
|
459
|
+
divider: "core",
|
|
460
|
+
context: "agent",
|
|
461
|
+
toc: "print",
|
|
462
|
+
cite: "contract",
|
|
463
|
+
};
|
|
464
|
+
function tierOf(def) {
|
|
465
|
+
return TIER_OVERRIDES[def.canonical] ?? CATEGORY_TIER[def.category];
|
|
466
|
+
}
|
|
467
|
+
exports.KEYWORD_TIERS = (() => {
|
|
468
|
+
const tiers = {
|
|
469
|
+
core: [],
|
|
470
|
+
agent: [],
|
|
471
|
+
contract: [],
|
|
472
|
+
data: [],
|
|
473
|
+
print: [],
|
|
474
|
+
};
|
|
475
|
+
for (const def of exports.LANGUAGE_REGISTRY) {
|
|
476
|
+
if (def.status !== "stable")
|
|
477
|
+
continue;
|
|
478
|
+
tiers[tierOf(def)].push(def.canonical);
|
|
479
|
+
}
|
|
480
|
+
return tiers;
|
|
481
|
+
})();
|
|
482
|
+
exports.CORE_KEYWORDS = exports.KEYWORD_TIERS.core;
|
|
483
|
+
exports.CALLOUT_ALIAS_MAP = {
|
|
484
|
+
warning: "warning",
|
|
485
|
+
alert: "warning",
|
|
486
|
+
caution: "warning",
|
|
487
|
+
danger: "danger",
|
|
488
|
+
critical: "danger",
|
|
489
|
+
destructive: "danger",
|
|
490
|
+
tip: "tip",
|
|
491
|
+
hint: "tip",
|
|
492
|
+
advice: "tip",
|
|
493
|
+
success: "success",
|
|
494
|
+
};
|
|
495
|
+
exports.EXTENSION_KEYWORDS = new Set(exports.EXTENSION_REGISTRY.map((e) => e.keyword));
|
|
496
|
+
exports.EXTENSION_NS_MAP = Object.fromEntries(exports.EXTENSION_REGISTRY.map((e) => [e.keyword, e.namespace]));
|
|
497
|
+
exports.EXTENSION_LEGACY_ALIASES = {
|
|
498
|
+
fig: "figure",
|
|
499
|
+
diagram: "figure",
|
|
500
|
+
chart: "figure",
|
|
501
|
+
illustration: "figure",
|
|
502
|
+
visual: "figure",
|
|
503
|
+
"مهلة": "deadline",
|
|
504
|
+
"جهة": "contact",
|
|
505
|
+
"تواصل": "contact",
|
|
506
|
+
"تعريف": "def",
|
|
507
|
+
"مرجع": "ref",
|
|
508
|
+
define: "def",
|
|
509
|
+
term: "def",
|
|
510
|
+
glossary: "def",
|
|
511
|
+
person: "contact",
|
|
512
|
+
party: "contact",
|
|
513
|
+
entity: "contact",
|
|
514
|
+
references: "ref",
|
|
515
|
+
see: "ref",
|
|
516
|
+
related: "ref",
|
|
517
|
+
xref: "ref",
|
|
518
|
+
due: "deadline",
|
|
519
|
+
milestone: "deadline",
|
|
520
|
+
by: "deadline",
|
|
521
|
+
"due-date": "deadline",
|
|
522
|
+
"signature-line": "signline",
|
|
523
|
+
"sign-here": "signline",
|
|
524
|
+
emit: "signal",
|
|
525
|
+
status: "signal",
|
|
526
|
+
expect: "assert",
|
|
527
|
+
verify: "assert",
|
|
528
|
+
credential: "secret",
|
|
529
|
+
token: "secret",
|
|
530
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function convertMarkdownToIntentText(markdown: string): string;
|
package/dist/markdown.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertMarkdownToIntentText = convertMarkdownToIntentText;
|
|
4
|
+
function convertMarkdownToIntentText(markdown) {
|
|
5
|
+
if (typeof markdown !== "string" || markdown.length === 0)
|
|
6
|
+
return "";
|
|
7
|
+
const lines = markdown.split(/\r?\n/);
|
|
8
|
+
const out = [];
|
|
9
|
+
let inCodeBlock = false;
|
|
10
|
+
let codeLines = [];
|
|
11
|
+
const flushCodeBlock = () => {
|
|
12
|
+
out.push("code:");
|
|
13
|
+
out.push(...codeLines);
|
|
14
|
+
out.push("end:");
|
|
15
|
+
codeLines = [];
|
|
16
|
+
};
|
|
17
|
+
const convertInline = (text) => {
|
|
18
|
+
let result = text;
|
|
19
|
+
result = result.replace(/`([^`]+)`/g, "```$1```");
|
|
20
|
+
const BOLD_START = "\x00BS\x00";
|
|
21
|
+
const BOLD_END = "\x00BE\x00";
|
|
22
|
+
let boldIndex = 0;
|
|
23
|
+
result = result.replace(/\*\*/g, () => boldIndex++ % 2 === 0 ? BOLD_START : BOLD_END);
|
|
24
|
+
result = result.replace(/(^|\s)\*([^*\s][^*]*?)\*(?=(\s|$))/g, "$1_$2_");
|
|
25
|
+
result = result.replace(new RegExp(BOLD_START, "g"), "*");
|
|
26
|
+
result = result.replace(new RegExp(BOLD_END, "g"), "*");
|
|
27
|
+
result = result.replace(/~~([^~]+)~~/g, "~$1~");
|
|
28
|
+
return result;
|
|
29
|
+
};
|
|
30
|
+
for (let i = 0; i < lines.length; i++) {
|
|
31
|
+
const raw = lines[i];
|
|
32
|
+
const trimmed = raw.trim();
|
|
33
|
+
if (trimmed.startsWith("```")) {
|
|
34
|
+
if (!inCodeBlock) {
|
|
35
|
+
inCodeBlock = true;
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
inCodeBlock = false;
|
|
40
|
+
flushCodeBlock();
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (inCodeBlock) {
|
|
45
|
+
codeLines.push(raw);
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (!trimmed) {
|
|
49
|
+
out.push("");
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
if (/^(-{3,}|\*{3,}|_{3,})$/.test(trimmed)) {
|
|
53
|
+
out.push("---");
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
const h = trimmed.match(/^(#{1,6})\s+(.+)$/);
|
|
57
|
+
if (h) {
|
|
58
|
+
const level = h[1].length;
|
|
59
|
+
const text = convertInline(h[2].trim());
|
|
60
|
+
if (level === 1)
|
|
61
|
+
out.push(`title: ${text}`);
|
|
62
|
+
else if (level === 2)
|
|
63
|
+
out.push(`section: ${text}`);
|
|
64
|
+
else
|
|
65
|
+
out.push(`sub: ${text}`);
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const img = trimmed.match(/^!\[([^\]]*)\]\(([^)]+)\)$/);
|
|
69
|
+
if (img) {
|
|
70
|
+
const alt = convertInline(img[1].trim());
|
|
71
|
+
const url = img[2].trim();
|
|
72
|
+
out.push(`image: ${alt} | src: ${url}`);
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
const link = trimmed.match(/^\[([^\]]+)\]\(([^)]+)\)$/);
|
|
76
|
+
if (link) {
|
|
77
|
+
const text = convertInline(link[1].trim());
|
|
78
|
+
const url = link[2].trim();
|
|
79
|
+
out.push(`link: ${text} | to: ${url}`);
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
const ul = trimmed.match(/^[-*+]\s+(.+)$/);
|
|
83
|
+
if (ul) {
|
|
84
|
+
out.push(`- ${convertInline(ul[1].trim())}`);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
const ol = trimmed.match(/^(\d+)\.\s+(.+)$/);
|
|
88
|
+
if (ol) {
|
|
89
|
+
out.push(`${ol[1]}. ${convertInline(ol[2].trim())}`);
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
const bq = trimmed.match(/^>\s*(.*)$/);
|
|
93
|
+
if (bq) {
|
|
94
|
+
out.push(`quote: ${convertInline(bq[1].trim())}`);
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
if (/^\|.+\|$/.test(trimmed)) {
|
|
98
|
+
if (/^\|[\s\-:|]+\|$/.test(trimmed)) {
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
const cells = trimmed
|
|
102
|
+
.slice(1, -1)
|
|
103
|
+
.split("|")
|
|
104
|
+
.map((c) => convertInline(c.trim()));
|
|
105
|
+
const isHeader = i + 1 < lines.length && /^\|[\s\-:|]+\|$/.test(lines[i + 1].trim());
|
|
106
|
+
if (isHeader) {
|
|
107
|
+
out.push(`headers: ${cells.join(" | ")}`);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
out.push(`row: ${cells.join(" | ")}`);
|
|
111
|
+
}
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
out.push(`note: ${convertInline(trimmed)}`);
|
|
115
|
+
}
|
|
116
|
+
if (inCodeBlock) {
|
|
117
|
+
flushCodeBlock();
|
|
118
|
+
}
|
|
119
|
+
while (out.length > 0 && out[out.length - 1] === "") {
|
|
120
|
+
out.pop();
|
|
121
|
+
}
|
|
122
|
+
return out.join("\n");
|
|
123
|
+
}
|
package/dist/merge.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IntentDocument } from "./types";
|
|
2
|
+
export interface MergeOptions {
|
|
3
|
+
missing?: "keep" | "blank";
|
|
4
|
+
}
|
|
5
|
+
export declare function mergeData(template: IntentDocument, data: Record<string, unknown>, options?: MergeOptions): IntentDocument;
|
|
6
|
+
export declare function parseAndMerge(source: string, data: Record<string, unknown>, options?: MergeOptions): IntentDocument;
|