@project-ava-supernova/core 0.2.71 → 0.2.73

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 (171) hide show
  1. package/dist/agent/agent.d.ts.map +1 -1
  2. package/dist/agent/agent.js +138 -38
  3. package/dist/agent/agent.js.map +1 -1
  4. package/dist/agent/mode-tags.d.ts +72 -0
  5. package/dist/agent/mode-tags.d.ts.map +1 -0
  6. package/dist/agent/mode-tags.js +84 -0
  7. package/dist/agent/mode-tags.js.map +1 -0
  8. package/dist/agent/system-prompt.d.ts +16 -2
  9. package/dist/agent/system-prompt.d.ts.map +1 -1
  10. package/dist/agent/system-prompt.js +178 -24
  11. package/dist/agent/system-prompt.js.map +1 -1
  12. package/dist/brainstorm/brainstorm-store.d.ts +42 -0
  13. package/dist/brainstorm/brainstorm-store.d.ts.map +1 -0
  14. package/dist/brainstorm/brainstorm-store.js +164 -0
  15. package/dist/brainstorm/brainstorm-store.js.map +1 -0
  16. package/dist/brainstorm/types.d.ts +64 -0
  17. package/dist/brainstorm/types.d.ts.map +1 -0
  18. package/dist/brainstorm/types.js +20 -0
  19. package/dist/brainstorm/types.js.map +1 -0
  20. package/dist/config/project.d.ts.map +1 -1
  21. package/dist/config/project.js +3 -1
  22. package/dist/config/project.js.map +1 -1
  23. package/dist/config/schema.d.ts +13 -0
  24. package/dist/config/schema.d.ts.map +1 -1
  25. package/dist/config/schema.js.map +1 -1
  26. package/dist/dataset/capture.d.ts.map +1 -1
  27. package/dist/dataset/capture.js +6 -14
  28. package/dist/dataset/capture.js.map +1 -1
  29. package/dist/history/conversation-title.d.ts +5 -4
  30. package/dist/history/conversation-title.d.ts.map +1 -1
  31. package/dist/history/conversation-title.js +6 -19
  32. package/dist/history/conversation-title.js.map +1 -1
  33. package/dist/i18n/locales/ar.d.ts.map +1 -1
  34. package/dist/i18n/locales/ar.js +41 -13
  35. package/dist/i18n/locales/ar.js.map +1 -1
  36. package/dist/i18n/locales/de.d.ts.map +1 -1
  37. package/dist/i18n/locales/de.js +41 -13
  38. package/dist/i18n/locales/de.js.map +1 -1
  39. package/dist/i18n/locales/en.d.ts +38 -10
  40. package/dist/i18n/locales/en.d.ts.map +1 -1
  41. package/dist/i18n/locales/en.js +41 -13
  42. package/dist/i18n/locales/en.js.map +1 -1
  43. package/dist/i18n/locales/es.d.ts.map +1 -1
  44. package/dist/i18n/locales/es.js +41 -13
  45. package/dist/i18n/locales/es.js.map +1 -1
  46. package/dist/i18n/locales/fr.d.ts.map +1 -1
  47. package/dist/i18n/locales/fr.js +41 -13
  48. package/dist/i18n/locales/fr.js.map +1 -1
  49. package/dist/i18n/locales/hi.d.ts.map +1 -1
  50. package/dist/i18n/locales/hi.js +41 -13
  51. package/dist/i18n/locales/hi.js.map +1 -1
  52. package/dist/i18n/locales/id.d.ts.map +1 -1
  53. package/dist/i18n/locales/id.js +41 -13
  54. package/dist/i18n/locales/id.js.map +1 -1
  55. package/dist/i18n/locales/it.d.ts.map +1 -1
  56. package/dist/i18n/locales/it.js +41 -13
  57. package/dist/i18n/locales/it.js.map +1 -1
  58. package/dist/i18n/locales/ja.d.ts.map +1 -1
  59. package/dist/i18n/locales/ja.js +41 -13
  60. package/dist/i18n/locales/ja.js.map +1 -1
  61. package/dist/i18n/locales/ko.d.ts.map +1 -1
  62. package/dist/i18n/locales/ko.js +41 -13
  63. package/dist/i18n/locales/ko.js.map +1 -1
  64. package/dist/i18n/locales/nl.d.ts.map +1 -1
  65. package/dist/i18n/locales/nl.js +41 -13
  66. package/dist/i18n/locales/nl.js.map +1 -1
  67. package/dist/i18n/locales/pl.d.ts.map +1 -1
  68. package/dist/i18n/locales/pl.js +41 -13
  69. package/dist/i18n/locales/pl.js.map +1 -1
  70. package/dist/i18n/locales/pt.d.ts.map +1 -1
  71. package/dist/i18n/locales/pt.js +41 -13
  72. package/dist/i18n/locales/pt.js.map +1 -1
  73. package/dist/i18n/locales/ru.d.ts.map +1 -1
  74. package/dist/i18n/locales/ru.js +41 -13
  75. package/dist/i18n/locales/ru.js.map +1 -1
  76. package/dist/i18n/locales/th.d.ts.map +1 -1
  77. package/dist/i18n/locales/th.js +41 -13
  78. package/dist/i18n/locales/th.js.map +1 -1
  79. package/dist/i18n/locales/tr.d.ts.map +1 -1
  80. package/dist/i18n/locales/tr.js +41 -13
  81. package/dist/i18n/locales/tr.js.map +1 -1
  82. package/dist/i18n/locales/uk.d.ts.map +1 -1
  83. package/dist/i18n/locales/uk.js +41 -13
  84. package/dist/i18n/locales/uk.js.map +1 -1
  85. package/dist/i18n/locales/vi.d.ts.map +1 -1
  86. package/dist/i18n/locales/vi.js +41 -13
  87. package/dist/i18n/locales/vi.js.map +1 -1
  88. package/dist/i18n/locales/zh-CN.d.ts.map +1 -1
  89. package/dist/i18n/locales/zh-CN.js +41 -13
  90. package/dist/i18n/locales/zh-CN.js.map +1 -1
  91. package/dist/i18n/locales/zh-TW.d.ts.map +1 -1
  92. package/dist/i18n/locales/zh-TW.js +41 -13
  93. package/dist/i18n/locales/zh-TW.js.map +1 -1
  94. package/dist/index.d.ts +5 -1
  95. package/dist/index.d.ts.map +1 -1
  96. package/dist/index.js +7 -1
  97. package/dist/index.js.map +1 -1
  98. package/dist/journal/journal-manager.d.ts +22 -1
  99. package/dist/journal/journal-manager.d.ts.map +1 -1
  100. package/dist/journal/journal-manager.js +47 -2
  101. package/dist/journal/journal-manager.js.map +1 -1
  102. package/dist/personas/conductor.d.ts +11 -0
  103. package/dist/personas/conductor.d.ts.map +1 -1
  104. package/dist/personas/conductor.js +56 -12
  105. package/dist/personas/conductor.js.map +1 -1
  106. package/dist/personas/definitions.d.ts +15 -4
  107. package/dist/personas/definitions.d.ts.map +1 -1
  108. package/dist/personas/definitions.js +184 -19
  109. package/dist/personas/definitions.js.map +1 -1
  110. package/dist/personas/types.d.ts +1 -1
  111. package/dist/personas/types.d.ts.map +1 -1
  112. package/dist/projects/project-data.d.ts +73 -0
  113. package/dist/projects/project-data.d.ts.map +1 -0
  114. package/dist/projects/project-data.js +126 -0
  115. package/dist/projects/project-data.js.map +1 -0
  116. package/dist/projects/projects-home.d.ts +33 -0
  117. package/dist/projects/projects-home.d.ts.map +1 -0
  118. package/dist/projects/projects-home.js +43 -0
  119. package/dist/projects/projects-home.js.map +1 -0
  120. package/dist/projects/storage-categories.d.ts +45 -0
  121. package/dist/projects/storage-categories.d.ts.map +1 -0
  122. package/dist/projects/storage-categories.js +86 -0
  123. package/dist/projects/storage-categories.js.map +1 -0
  124. package/dist/social/index.d.ts +19 -4
  125. package/dist/social/index.d.ts.map +1 -1
  126. package/dist/tools/authoring/export-document.d.ts +45 -0
  127. package/dist/tools/authoring/export-document.d.ts.map +1 -0
  128. package/dist/tools/authoring/export-document.js +132 -0
  129. package/dist/tools/authoring/export-document.js.map +1 -0
  130. package/dist/tools/authoring/export-formats.d.ts +37 -0
  131. package/dist/tools/authoring/export-formats.d.ts.map +1 -0
  132. package/dist/tools/authoring/export-formats.js +50 -0
  133. package/dist/tools/authoring/export-formats.js.map +1 -0
  134. package/dist/tools/authoring/index.d.ts +6 -1
  135. package/dist/tools/authoring/index.d.ts.map +1 -1
  136. package/dist/tools/authoring/index.js +9 -0
  137. package/dist/tools/authoring/index.js.map +1 -1
  138. package/dist/tools/authoring/render-odf.d.ts +22 -0
  139. package/dist/tools/authoring/render-odf.d.ts.map +1 -0
  140. package/dist/tools/authoring/render-odf.js +604 -0
  141. package/dist/tools/authoring/render-odf.js.map +1 -0
  142. package/dist/tools/authoring/zip.d.ts +33 -0
  143. package/dist/tools/authoring/zip.d.ts.map +1 -0
  144. package/dist/tools/authoring/zip.js +125 -0
  145. package/dist/tools/authoring/zip.js.map +1 -0
  146. package/dist/tools/brainstorm-session.d.ts +29 -0
  147. package/dist/tools/brainstorm-session.d.ts.map +1 -0
  148. package/dist/tools/brainstorm-session.js +184 -0
  149. package/dist/tools/brainstorm-session.js.map +1 -0
  150. package/dist/tools/document-author.d.ts +1 -1
  151. package/dist/tools/document-author.d.ts.map +1 -1
  152. package/dist/tools/document-author.js +22 -5
  153. package/dist/tools/document-author.js.map +1 -1
  154. package/dist/tools/security.d.ts +25 -0
  155. package/dist/tools/security.d.ts.map +1 -1
  156. package/dist/tools/security.js +35 -0
  157. package/dist/tools/security.js.map +1 -1
  158. package/dist/tools/suggest-beats.d.ts.map +1 -1
  159. package/dist/tools/suggest-beats.js +3 -2
  160. package/dist/tools/suggest-beats.js.map +1 -1
  161. package/dist/tools/tool-registry.d.ts.map +1 -1
  162. package/dist/tools/tool-registry.js +4 -0
  163. package/dist/tools/tool-registry.js.map +1 -1
  164. package/dist/tools/verification-trust.d.ts +2 -2
  165. package/dist/tools/verification-trust.d.ts.map +1 -1
  166. package/dist/tools/verification-trust.js +11 -13
  167. package/dist/tools/verification-trust.js.map +1 -1
  168. package/dist/tools/write-video-post.d.ts.map +1 -1
  169. package/dist/tools/write-video-post.js +89 -13
  170. package/dist/tools/write-video-post.js.map +1 -1
  171. package/package.json +26 -1
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Export a stored document to a chosen format.
3
+ *
4
+ * The Library is where documents are kept, exported and opened, and both the
5
+ * extension and the IDE mount that same tab. This module is the shared body
6
+ * behind both mounts: one place that decides what can be exported, what the
7
+ * output is called, and what a failure says. Two hosts calling one function is
8
+ * the only version of "one feature, two mounts" that does not quietly drift.
9
+ *
10
+ * Only sources we can faithfully re-render are exportable. A `.docx` is not
11
+ * offered as an `.odt` here, because that is a conversion with fidelity loss
12
+ * dressed up as an export — the honest answer for an already-built file is
13
+ * Open or Reveal, not a second lossy copy of it.
14
+ */
15
+ import { readFile, writeFile } from 'node:fs/promises';
16
+ import { basename, dirname, extname, join } from 'node:path';
17
+ import { textInline } from './doc-model.js';
18
+ import { parseMarkdown } from './md-parse.js';
19
+ import { renderDocument } from './index.js';
20
+ // The format question is answered in a dependency-free leaf, because the
21
+ // webviews need the same answer and cannot import this file.
22
+ import { canExport } from './export-formats.js';
23
+ /** Where the export lands: beside its source, which is how `document_author
24
+ * build` already behaves, so an exported file stays in the Library. */
25
+ export function deriveExportPath(sourcePath, format) {
26
+ const dir = dirname(sourcePath);
27
+ const stem = basename(sourcePath, extname(sourcePath));
28
+ // join, not string concatenation: on Windows the source arrives with
29
+ // backslashes and a hand-built '/' would hand back a mixed-separator path
30
+ // that every later comparison gets subtly wrong.
31
+ return join(dir, `${stem}.${format}`);
32
+ }
33
+ export async function exportDocument(req) {
34
+ const ext = extname(req.sourcePath).toLowerCase();
35
+ if (!canExport(req.sourcePath)) {
36
+ return { ok: false, error: `${ext || 'This file'} cannot be exported — it is already a built document. Open or reveal it instead.` };
37
+ }
38
+ let source;
39
+ try {
40
+ source = await readFile(req.sourcePath, 'utf8');
41
+ }
42
+ catch (e) {
43
+ return { ok: false, error: `Could not read ${basename(req.sourcePath)}: ${e.message}` };
44
+ }
45
+ const model = ext === '.csv' ? csvToModel(source, basename(req.sourcePath, ext)) : parseMarkdown(source);
46
+ const opts = {
47
+ loadDocx: req.loadDocx,
48
+ loadPdf: req.loadPdf,
49
+ baseDir: dirname(req.sourcePath),
50
+ };
51
+ let rendered;
52
+ try {
53
+ rendered = await renderDocument(model, req.format, opts);
54
+ }
55
+ catch (e) {
56
+ return { ok: false, error: e.message };
57
+ }
58
+ const outPath = req.outPath ?? deriveExportPath(req.sourcePath, req.format);
59
+ const data = typeof rendered === 'string' ? Buffer.from(rendered, 'utf8') : rendered;
60
+ try {
61
+ await writeFile(outPath, data);
62
+ }
63
+ catch (e) {
64
+ return { ok: false, error: `Could not write ${basename(outPath)}: ${e.message}` };
65
+ }
66
+ return { ok: true, path: outPath, bytes: data.length };
67
+ }
68
+ // ── CSV ──────────────────────────────────────────────────────────────────────
69
+ /**
70
+ * RFC 4180 enough: quoted fields, doubled quotes, and — the case a
71
+ * split-on-newline parser gets wrong — newlines inside quoted fields.
72
+ */
73
+ export function parseCsv(raw) {
74
+ const rows = [];
75
+ let row = [];
76
+ let field = '';
77
+ let quoted = false;
78
+ let started = false;
79
+ const endField = () => { row.push(field); field = ''; started = false; };
80
+ const endRow = () => { endField(); rows.push(row); row = []; };
81
+ for (let i = 0; i < raw.length; i++) {
82
+ const ch = raw[i];
83
+ if (quoted) {
84
+ if (ch === '"' && raw[i + 1] === '"') {
85
+ field += '"';
86
+ i++;
87
+ }
88
+ else if (ch === '"')
89
+ quoted = false;
90
+ else
91
+ field += ch;
92
+ continue;
93
+ }
94
+ if (ch === '"' && !started) {
95
+ quoted = true;
96
+ started = true;
97
+ continue;
98
+ }
99
+ if (ch === ',') {
100
+ endField();
101
+ continue;
102
+ }
103
+ if (ch === '\r')
104
+ continue;
105
+ if (ch === '\n') {
106
+ endRow();
107
+ continue;
108
+ }
109
+ field += ch;
110
+ started = true;
111
+ }
112
+ // A trailing newline ends the last row; anything else means one is still open.
113
+ if (field !== '' || row.length > 0)
114
+ endRow();
115
+ const headers = rows.shift() ?? [];
116
+ return { headers, rows };
117
+ }
118
+ /** A CSV is a single table; wrapping it in a DocModel lets it reach every
119
+ * renderer, so the same file can leave as .ods, .docx or .pdf. */
120
+ function csvToModel(raw, title) {
121
+ const { headers, rows } = parseCsv(raw);
122
+ const cells = (values) => values.map((v) => textInline(v));
123
+ return {
124
+ meta: { title },
125
+ blocks: [{
126
+ type: 'table',
127
+ headers: cells(headers),
128
+ rows: rows.map(cells),
129
+ }],
130
+ };
131
+ }
132
+ //# sourceMappingURL=export-document.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-document.js","sourceRoot":"","sources":["../../../src/tools/authoring/export-document.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;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EAAE,KAAK,IAAI,EAAE,CAAC;YAAC,MAAM,EAAE,CAAC;YAAC,SAAS;QAAC,CAAC;QACxC,KAAK,IAAI,EAAE,CAAC;QACZ,OAAO,GAAG,IAAI,CAAC;IACjB,CAAC;IACD,+EAA+E;IAC/E,IAAI,KAAK,KAAK,EAAE,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,EAAE,CAAC;IAE7C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC;IACnC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED;mEACmE;AACnE,SAAS,UAAU,CAAC,GAAW,EAAE,KAAa;IAC5C,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,CAAC,MAAgB,EAAc,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACjF,OAAO;QACL,IAAI,EAAE,EAAE,KAAK,EAAE;QACf,MAAM,EAAE,CAAC;gBACP,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;gBACvB,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;aACtB,CAAC;KACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Which formats a document can be exported to — and nothing else.
3
+ *
4
+ * Dependency-free on purpose, the same reason routing-modes.ts is: the answer
5
+ * to "can this be exported, and as what?" is needed by the renderer (Node), the
6
+ * extension host (Node) and two webview bundles (no Node at all). A file that
7
+ * imports nothing can be reached from all four, so the list lives in one place
8
+ * instead of being copied into the surfaces that could not cheaply import it.
9
+ *
10
+ * Reachability shapes what people write. Keep this leaf a leaf.
11
+ */
12
+ export type RenderTarget = 'docx' | 'pdf' | 'md' | 'odt' | 'ods';
13
+ /** What a user can export TO. Markdown is the source format, not a
14
+ * destination — exporting a .md as .md is a no-op nobody asked for. */
15
+ export type ExportFormat = Exclude<RenderTarget, 'md'>;
16
+ /** Targets needing no optional peer, so they always work. */
17
+ export declare const ALWAYS_AVAILABLE_TARGETS: readonly RenderTarget[];
18
+ /**
19
+ * Sources that can be re-rendered into another format.
20
+ *
21
+ * Deliberately excludes built documents (.docx, .xlsx, .pdf): turning one of
22
+ * those into another is a lossy conversion wearing an export's clothes. For
23
+ * those the honest actions are Open and Reveal.
24
+ */
25
+ export declare const EXPORTABLE_SOURCE_EXTENSIONS: readonly string[];
26
+ /** What prose exports as. `.docx` first: it opens everywhere, including in
27
+ * LibreOffice and the ODF suites. */
28
+ export declare const DOCUMENT_TARGETS: readonly ExportFormat[];
29
+ /** What tabular data exports as. */
30
+ export declare const SPREADSHEET_TARGETS: readonly ExportFormat[];
31
+ /** Human labels for the buttons, so the surfaces agree on wording too. */
32
+ export declare const TARGET_LABELS: Readonly<Record<RenderTarget, string>>;
33
+ export declare function canExport(path: string): boolean;
34
+ /** The formats offered for this particular source; empty when it is not a
35
+ * source we can render. */
36
+ export declare function targetsFor(path: string): readonly ExportFormat[];
37
+ //# sourceMappingURL=export-formats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-formats.d.ts","sourceRoot":"","sources":["../../../src/tools/authoring/export-formats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,CAAC;AAEjE;wEACwE;AACxE,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AAEvD,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,EAAE,SAAS,YAAY,EAAyB,CAAC;AAEtF;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,EAAE,SAAS,MAAM,EAAyC,CAAC;AAEpG;sCACsC;AACtC,eAAO,MAAM,gBAAgB,EAAE,SAAS,YAAY,EAA2B,CAAC;AAEhF,oCAAoC;AACpC,eAAO,MAAM,mBAAmB,EAAE,SAAS,YAAY,EAA2B,CAAC;AAEnF,0EAA0E;AAC1E,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAMhE,CAAC;AAQF,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED;4BAC4B;AAC5B,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,YAAY,EAAE,CAGhE"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Which formats a document can be exported to — and nothing else.
3
+ *
4
+ * Dependency-free on purpose, the same reason routing-modes.ts is: the answer
5
+ * to "can this be exported, and as what?" is needed by the renderer (Node), the
6
+ * extension host (Node) and two webview bundles (no Node at all). A file that
7
+ * imports nothing can be reached from all four, so the list lives in one place
8
+ * instead of being copied into the surfaces that could not cheaply import it.
9
+ *
10
+ * Reachability shapes what people write. Keep this leaf a leaf.
11
+ */
12
+ /** Targets needing no optional peer, so they always work. */
13
+ export const ALWAYS_AVAILABLE_TARGETS = ['md', 'odt', 'ods'];
14
+ /**
15
+ * Sources that can be re-rendered into another format.
16
+ *
17
+ * Deliberately excludes built documents (.docx, .xlsx, .pdf): turning one of
18
+ * those into another is a lossy conversion wearing an export's clothes. For
19
+ * those the honest actions are Open and Reveal.
20
+ */
21
+ export const EXPORTABLE_SOURCE_EXTENSIONS = ['.md', '.markdown', '.txt', '.csv'];
22
+ /** What prose exports as. `.docx` first: it opens everywhere, including in
23
+ * LibreOffice and the ODF suites. */
24
+ export const DOCUMENT_TARGETS = ['docx', 'odt', 'pdf'];
25
+ /** What tabular data exports as. */
26
+ export const SPREADSHEET_TARGETS = ['ods', 'docx', 'pdf'];
27
+ /** Human labels for the buttons, so the surfaces agree on wording too. */
28
+ export const TARGET_LABELS = {
29
+ docx: 'Word (.docx)',
30
+ odt: 'OpenDocument (.odt)',
31
+ ods: 'OpenDocument (.ods)',
32
+ pdf: 'PDF',
33
+ md: 'Markdown',
34
+ };
35
+ function extensionOf(path) {
36
+ const dot = path.lastIndexOf('.');
37
+ const slash = Math.max(path.lastIndexOf('/'), path.lastIndexOf('\\'));
38
+ return dot > slash ? path.slice(dot).toLowerCase() : '';
39
+ }
40
+ export function canExport(path) {
41
+ return EXPORTABLE_SOURCE_EXTENSIONS.includes(extensionOf(path));
42
+ }
43
+ /** The formats offered for this particular source; empty when it is not a
44
+ * source we can render. */
45
+ export function targetsFor(path) {
46
+ if (!canExport(path))
47
+ return [];
48
+ return extensionOf(path) === '.csv' ? SPREADSHEET_TARGETS : DOCUMENT_TARGETS;
49
+ }
50
+ //# sourceMappingURL=export-formats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-formats.js","sourceRoot":"","sources":["../../../src/tools/authoring/export-formats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH,6DAA6D;AAC7D,MAAM,CAAC,MAAM,wBAAwB,GAA4B,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAEtF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAsB,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEpG;sCACsC;AACtC,MAAM,CAAC,MAAM,gBAAgB,GAA4B,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAEhF,oCAAoC;AACpC,MAAM,CAAC,MAAM,mBAAmB,GAA4B,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAEnF,0EAA0E;AAC1E,MAAM,CAAC,MAAM,aAAa,GAA2C;IACnE,IAAI,EAAE,cAAc;IACpB,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,KAAK;IACV,EAAE,EAAE,UAAU;CACf,CAAC;AAEF,SAAS,WAAW,CAAC,IAAY;IAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;IACtE,OAAO,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,4BAA4B,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AAClE,CAAC;AAED;4BAC4B;AAC5B,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IAChC,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC/E,CAAC"}
@@ -8,7 +8,9 @@
8
8
  * `build` step needs the peer for that format.
9
9
  */
10
10
  import type { DocModel } from './doc-model.js';
11
- export type RenderTarget = 'docx' | 'pdf' | 'md';
11
+ import type { RenderTarget } from './export-formats.js';
12
+ export type { RenderTarget, ExportFormat } from './export-formats.js';
13
+ export { ALWAYS_AVAILABLE_TARGETS, EXPORTABLE_SOURCE_EXTENSIONS, DOCUMENT_TARGETS, SPREADSHEET_TARGETS, TARGET_LABELS, canExport, targetsFor, } from './export-formats.js';
12
14
  export interface RenderOptions {
13
15
  /** Loads the `docx` peer (required for target 'docx'). */
14
16
  loadDocx?: () => Promise<unknown>;
@@ -29,6 +31,9 @@ export { parseMarkdown } from './md-parse.js';
29
31
  export { renderMarkdown } from './render-md.js';
30
32
  export { renderDocx } from './render-docx.js';
31
33
  export { renderPdf } from './render-pdf.js';
34
+ export { renderOdt, renderOds, ODT_MIMETYPE, ODS_MIMETYPE } from './render-odf.js';
35
+ export { exportDocument, deriveExportPath, parseCsv } from './export-document.js';
36
+ export type { ExportRequest, ExportResult } from './export-document.js';
32
37
  export { legacyToDocModel } from './doc-model.js';
33
38
  export type { DocModel, DocMeta, Block, Inline, ListItem, Align, CalloutVariant, BrandTokens, } from './doc-model.js';
34
39
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/authoring/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM/C,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,CAAC;AAEjD,MAAM,WAAW,aAAa;IAC5B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAClC,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACjC,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,GAAE,aAAkB,GAAG,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CAa9H;AAED,yEAAyE;AACzE,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,GAAE,aAAkB,GAAG,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CAEnI;AAED,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EA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AC,CAEnI;AAED,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAClF,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,YAAY,EACV,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,GAC/E,MAAM,gBAAgB,CAAC"}
@@ -11,6 +11,8 @@ import { parseMarkdown } from './md-parse.js';
11
11
  import { renderMarkdown } from './render-md.js';
12
12
  import { renderDocx } from './render-docx.js';
13
13
  import { renderPdf } from './render-pdf.js';
14
+ import { renderOdt, renderOds } from './render-odf.js';
15
+ export { ALWAYS_AVAILABLE_TARGETS, EXPORTABLE_SOURCE_EXTENSIONS, DOCUMENT_TARGETS, SPREADSHEET_TARGETS, TARGET_LABELS, canExport, targetsFor, } from './export-formats.js';
14
16
  /**
15
17
  * Render a parsed model to one of the supported targets. Returns a Buffer for
16
18
  * docx/pdf and a string for md. Throws a clear, actionable error when the peer
@@ -30,6 +32,11 @@ export async function renderDocument(model, target, opts = {}) {
30
32
  throw new Error('pdf rendering requires the pdfkit package. Install it with: npm install pdfkit');
31
33
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
34
  return renderPdf(model, { loadPdf: opts.loadPdf, baseDir: opts.baseDir });
35
+ // OpenDocument needs no peer — XML in a zip, both from Node's stdlib.
36
+ case 'odt':
37
+ return renderOdt(model, { baseDir: opts.baseDir });
38
+ case 'ods':
39
+ return renderOds(model, { baseDir: opts.baseDir });
33
40
  }
34
41
  }
35
42
  /** Parse extended Markdown straight to a rendered target in one call. */
@@ -40,5 +47,7 @@ export { parseMarkdown } from './md-parse.js';
40
47
  export { renderMarkdown } from './render-md.js';
41
48
  export { renderDocx } from './render-docx.js';
42
49
  export { renderPdf } from './render-pdf.js';
50
+ export { renderOdt, renderOds, ODT_MIMETYPE, ODS_MIMETYPE } from './render-odf.js';
51
+ export { exportDocument, deriveExportPath, parseCsv } from './export-document.js';
43
52
  export { legacyToDocModel } from './doc-model.js';
44
53
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/authoring/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAa5C;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,KAAe,EAAE,MAAoB,EAAE,OAAsB,EAAE;IAClG,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,IAAI;YACP,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;QAC/B,KAAK,MAAM;YACT,IAAI,CAAC,IAAI,CAAC,QAAQ;gBAAE,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC;YACnH,8DAA8D;YAC9D,OAAO,UAAU,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAA8B,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QACrG,KAAK,KAAK;YACR,IAAI,CAAC,IA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AAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * DocModel → OpenDocument (.odt text, .ods spreadsheet).
3
+ *
4
+ * Walks the same rich model the docx and pdf renderers walk, honouring the
5
+ * same brand tokens, so the three formats are one document in three coats
6
+ * rather than three separate documents. Unlike those two this needs no peer
7
+ * dependency: an ODF file is XML in a zip, and both halves are in Node's
8
+ * standard library (see ./zip.ts). The open format is the one that always
9
+ * works, which is the point of offering it.
10
+ */
11
+ import type { DocModel } from './doc-model.js';
12
+ export interface RenderOdfOptions {
13
+ /** Base directory for resolving relative image paths. */
14
+ baseDir?: string;
15
+ /** Fixed modification time — pass one for byte-reproducible output. */
16
+ modified?: Date;
17
+ }
18
+ export declare const ODT_MIMETYPE = "application/vnd.oasis.opendocument.text";
19
+ export declare function renderOdt(model: DocModel, opts?: RenderOdfOptions): Promise<Buffer>;
20
+ export declare const ODS_MIMETYPE = "application/vnd.oasis.opendocument.spreadsheet";
21
+ export declare function renderOds(model: DocModel, opts?: RenderOdfOptions): Promise<Buffer>;
22
+ //# sourceMappingURL=render-odf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-odf.d.ts","sourceRoot":"","sources":["../../../src/tools/authoring/render-odf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAiB,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AAU/E,MAAM,WAAW,gBAAgB;IAC/B,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB;AA0gBD,eAAO,MAAM,YAAY,4CAA4C,CAAC;AAEtE,wBAAsB,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,GAAE,gBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CAwB7F;AAID,eAAO,MAAM,YAAY,mDAAmD,CAAC;AAqC7E,wBAAsB,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,GAAE,gBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CA6D7F"}