@vmz/vmz 0.1.17 → 0.1.19

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 (131) hide show
  1. package/dist/application-cmd.d.ts +6 -16
  2. package/dist/application-cmd.js +34 -180
  3. package/dist/author-input.d.ts +40 -19
  4. package/dist/author-input.js +2 -16
  5. package/dist/build-assemble.d.ts +63 -41
  6. package/dist/build-assemble.js +42 -43
  7. package/dist/bundler-adapter.d.ts +46 -48
  8. package/dist/bundler-adapter.js +4 -43
  9. package/dist/cdn-policy.d.ts +77 -93
  10. package/dist/cdn-policy.js +10 -16
  11. package/dist/cli-localize.d.ts +34 -0
  12. package/dist/cli-localize.js +58 -0
  13. package/dist/cli.d.ts +8 -19
  14. package/dist/cli.js +69 -252
  15. package/dist/content-addressed-assets.d.ts +24 -10
  16. package/dist/content-addressed-assets.js +2 -7
  17. package/dist/delivery-profile.d.ts +54 -27
  18. package/dist/delivery-profile.js +15 -13
  19. package/dist/dev-session.d.ts +29 -23
  20. package/dist/dev-session.js +0 -21
  21. package/dist/dev-watch-roots.d.ts +34 -25
  22. package/dist/dev-watch-roots.js +0 -31
  23. package/dist/document-build.d.ts +22 -97
  24. package/dist/document-build.js +4 -19
  25. package/dist/document-check.d.ts +30 -53
  26. package/dist/document-check.js +14 -29
  27. package/dist/document-cmd.d.ts +3 -6
  28. package/dist/document-cmd.js +19 -79
  29. package/dist/document-designs.d.ts +5 -8
  30. package/dist/document-designs.js +2 -15
  31. package/dist/document-enrich.d.ts +52 -24
  32. package/dist/document-enrich.js +4 -32
  33. package/dist/document-evidence.d.ts +46 -43
  34. package/dist/document-evidence.js +6 -47
  35. package/dist/document-integrate.d.ts +13 -29
  36. package/dist/document-integrate.js +2 -13
  37. package/dist/document-interactive.d.ts +45 -67
  38. package/dist/document-interactive.js +9 -50
  39. package/dist/document-layout-render.d.ts +7 -16
  40. package/dist/document-layout-render.js +0 -17
  41. package/dist/document-locale.d.ts +12 -25
  42. package/dist/document-locale.js +3 -14
  43. package/dist/document-markdown.d.ts +9 -5
  44. package/dist/document-markdown.js +0 -4
  45. package/dist/document-routing-config.d.ts +7 -14
  46. package/dist/document-routing-config.js +0 -9
  47. package/dist/document-scan.d.ts +14 -18
  48. package/dist/document-scan.js +2 -23
  49. package/dist/document-schema.d.ts +154 -41
  50. package/dist/document-schema.js +0 -35
  51. package/dist/embedded-packaging.d.ts +20 -8
  52. package/dist/embedded-packaging.js +0 -1
  53. package/dist/explain-cmd.d.ts +4 -3
  54. package/dist/explain-cmd.js +16 -65
  55. package/dist/index.d.ts +70 -143
  56. package/dist/index.js +16 -136
  57. package/dist/invocation.d.ts +29 -50
  58. package/dist/invocation.js +11 -57
  59. package/dist/locale-check.d.ts +69 -70
  60. package/dist/locale-check.js +5 -66
  61. package/dist/locale-cmd.d.ts +2 -5
  62. package/dist/locale-cmd.js +62 -142
  63. package/dist/locale-delivery.d.ts +294 -191
  64. package/dist/locale-delivery.js +8 -94
  65. package/dist/locale-route-emit.d.ts +23 -9
  66. package/dist/locale-route-emit.js +0 -7
  67. package/dist/locale-router.d.ts +189 -162
  68. package/dist/locale-router.js +13 -122
  69. package/dist/locale-runtime.d.ts +292 -262
  70. package/dist/locale-runtime.js +8 -102
  71. package/dist/locale-schema.js +0 -1
  72. package/dist/locale-tooling.d.ts +100 -63
  73. package/dist/locale-tooling.js +7 -45
  74. package/dist/log.d.ts +22 -15
  75. package/dist/log.js +24 -21
  76. package/dist/native-addon.d.ts +10 -9
  77. package/dist/native-addon.js +1 -10
  78. package/dist/pack-client-packages.d.ts +5 -1
  79. package/dist/pack-client-packages.js +0 -6
  80. package/dist/pack.d.ts +17 -15
  81. package/dist/pack.js +0 -12
  82. package/dist/packages.d.ts +10 -23
  83. package/dist/packages.js +1 -37
  84. package/dist/plan-cmd.d.ts +6 -0
  85. package/dist/plan-cmd.js +35 -0
  86. package/dist/plugin-host.js +0 -1
  87. package/dist/port.d.ts +2 -10
  88. package/dist/port.js +2 -11
  89. package/dist/pretty-json.d.ts +9 -19
  90. package/dist/pretty-json.js +3 -17
  91. package/dist/production-observability.d.ts +37 -181
  92. package/dist/production-observability.js +1 -9
  93. package/dist/production-test-pack.d.ts +17 -3
  94. package/dist/production-test-pack.js +0 -2
  95. package/dist/public-static-assets.d.ts +6 -1
  96. package/dist/public-static-assets.js +0 -5
  97. package/dist/refactor-cmd.d.ts +3 -6
  98. package/dist/refactor-cmd.js +16 -69
  99. package/dist/release-cmd.d.ts +7 -6
  100. package/dist/release-cmd.js +17 -59
  101. package/dist/release-pack.d.ts +7 -3
  102. package/dist/release-pack.js +0 -6
  103. package/dist/resolve.d.ts +15 -19
  104. package/dist/resolve.js +1 -15
  105. package/dist/server-artifact.d.ts +30 -75
  106. package/dist/server-artifact.js +0 -10
  107. package/dist/server-language-backend.d.ts +22 -79
  108. package/dist/server-language-backend.js +0 -26
  109. package/dist/site-delivery.d.ts +46 -59
  110. package/dist/site-delivery.js +3 -8
  111. package/dist/site-favicon.d.ts +6 -1
  112. package/dist/site-favicon.js +0 -5
  113. package/dist/static-emit.d.ts +73 -103
  114. package/dist/static-emit.js +1 -26
  115. package/dist/test-cmd.d.ts +3 -5
  116. package/dist/test-cmd.js +46 -30
  117. package/dist/test-compile.js +0 -1
  118. package/dist/test-discover.js +0 -1
  119. package/dist/test-logic.js +0 -1
  120. package/dist/test-protocol.js +0 -1
  121. package/dist/toolchain-dx.d.ts +11 -0
  122. package/dist/toolchain-dx.js +10 -0
  123. package/dist/watch-diff.d.ts +4 -13
  124. package/dist/watch-diff.js +0 -17
  125. package/dist/wechat-packaging.d.ts +8 -7
  126. package/dist/wechat-packaging.js +0 -6
  127. package/locales/en-US/cli.json +105 -0
  128. package/locales/locales.json +4 -0
  129. package/package.json +15 -12
  130. package/dist/resolve-native-cli.d.ts +0 -14
  131. package/dist/resolve-native-cli.js +0 -84
@@ -1,21 +1,11 @@
1
1
  /**
2
- * `vmz application` — Application Collection / Mount .
2
+ * `vmz application` — registered on `@vmz/commander`.
3
3
  */
4
- /**
5
- * @param {string[]} argv
6
- * @returns {Promise<number>}
7
- */
8
- export declare function cmdApplication(argv: any): Promise<number>;
9
- /**
10
- * @param {string} pathArg
11
- */
12
- export declare function runCheck(pathArg: any): {
4
+ import type { Command } from '@vmz/commander';
5
+ export declare function registerApplicationCommands(parent: Command): void;
6
+ export declare function runCheck(pathArg: string): {
13
7
  project: string;
14
- json: any;
8
+ json: string;
15
9
  data: any;
16
10
  };
17
- /**
18
- * @param {string} hostRoot
19
- * @returns {boolean}
20
- */
21
- export declare function hasApplicationsConfig(hostRoot: any): boolean;
11
+ export declare function hasApplicationsConfig(hostRoot: string): boolean;
@@ -1,6 +1,5 @@
1
- // @ts-nocheck
2
1
  /**
3
- * `vmz application` — Application Collection / Mount .
2
+ * `vmz application` — registered on `@vmz/commander`.
4
3
  */
5
4
  import { existsSync, readFileSync, writeFileSync } from 'node:fs';
6
5
  import path from 'node:path';
@@ -8,106 +7,18 @@ import { loadNative } from './index.js';
8
7
  import { log } from './log.js';
9
8
  import { resolveWorkspacePackages } from './packages.js';
10
9
  import { resolveWorkspaceDirs } from './resolve.js';
11
- /**
12
- * @param {string[]} argv
13
- * @returns {Promise<number>}
14
- */
15
- export async function cmdApplication(argv) {
16
- const [sub, ...rest] = argv;
17
- if (!sub || sub === 'help' || sub === '-h' || sub === '--help') {
18
- printHelp();
19
- return 0;
20
- }
21
- if (sub === 'check')
22
- return cmdCheck(rest);
23
- if (sub === 'list')
24
- return cmdList(rest);
25
- if (sub === 'schemas' || sub === 'protocol')
26
- return cmdSchemas();
27
- if (sub === 'relocatable')
28
- return cmdRelocatable(rest);
29
- if (sub === 'relocate')
30
- return cmdRelocate(rest);
31
- if (sub === 'artifacts')
32
- return cmdArtifacts(rest);
33
- if (sub === 'isolation')
34
- return cmdIsolation(rest);
35
- if (sub === 'composition' || sub === 'compose' || sub === 'host')
36
- return cmdComposition(rest);
37
- if (sub === 'dev' || sub === 'sessions' || sub === 'm5')
38
- return cmdDev(rest);
39
- log.error(`unknown application subcommand \`${sub}\``);
40
- printHelp();
41
- return 1;
42
- }
43
- function printHelp() {
44
- console.log(`vmz application — Application Collection / Mount
45
-
46
- Usage:
47
- vmz application check [host] Validate descriptors + applications.config.json5
48
- vmz application list [host] List resolved ApplicationIds / collections / mounts
49
- vmz application schemas Print frozen protocol catalog JSON
50
- vmz application relocatable [pkg] ApplicationBase / non_relocatable_url proof
51
- vmz application relocate <manifest.json> apply ApplicationBase to relocation manifest
52
- vmz application artifacts [host] ApplicationArtifact + MountTable boundary
53
- vmz application isolation [host] isolation namespaces + failure containment
54
- vmz application composition [host] catalog consumption + cross-app Link hrefs
55
- vmz application dev [host] sessions / affected / proxy / mounted tests / deploy
56
-
57
- Options:
58
- --json [file] Emit report JSON to stdout or file
59
- --base <path> ApplicationBase for relocatable / relocate (e.g. /examples/counter)
60
- --dirty <path> Dirty file path for affected planning (repeatable)
61
- `);
62
- }
63
- /**
64
- * @param {string[]} argv
65
- */
66
- function parseRest(argv) {
67
- /** @type {Record<string, string | boolean | string[]> & { _: string[] }} */
68
- const out = { _: [] };
69
- for (let i = 0; i < argv.length; i++) {
70
- const a = argv[i];
71
- if (a.startsWith('--')) {
72
- const key = a.slice(2);
73
- const next = argv[i + 1];
74
- if (key === 'json') {
75
- if (next && !next.startsWith('-')) {
76
- out.json = next;
77
- i += 1;
78
- }
79
- else {
80
- out.json = true;
81
- }
82
- continue;
83
- }
84
- if (key === 'dirty') {
85
- if (!Array.isArray(out.dirty))
86
- out.dirty = [];
87
- if (next && !next.startsWith('-')) {
88
- out.dirty.push(next);
89
- i += 1;
90
- }
91
- continue;
92
- }
93
- if (next && !next.startsWith('-')) {
94
- out[key] = next;
95
- i += 1;
96
- }
97
- else {
98
- out[key] = true;
99
- }
100
- continue;
101
- }
102
- out._.push(a);
103
- }
104
- return out;
10
+ export function registerApplicationCommands(parent) {
11
+ const withCommon = (cmd) => cmd.option('--json [file]', 'cli.opt.json').option('--base <path>', 'cli.opt.base').option('--dirty <path>...', 'cli.opt.dirty');
12
+ withCommon(parent.command('check', 'cli.cmd.application.check')).action((o) => cmdCheck(o));
13
+ withCommon(parent.command('list', 'cli.cmd.application.list')).action((o) => cmdList(o));
14
+ parent.command('schemas|protocol', 'cli.cmd.application.schemas').action(() => cmdSchemas());
15
+ withCommon(parent.command('relocatable', 'cli.cmd.application.relocatable')).action((o) => cmdRelocatable(o));
16
+ withCommon(parent.command('relocate', 'cli.cmd.application.relocate')).action((o) => cmdRelocate(o));
17
+ withCommon(parent.command('artifacts', 'cli.cmd.application.artifacts')).action((o) => cmdArtifacts(o));
18
+ withCommon(parent.command('isolation', 'cli.cmd.application.isolation')).action((o) => cmdIsolation(o));
19
+ withCommon(parent.command('composition|compose|host', 'cli.cmd.application.composition')).action((o) => cmdComposition(o));
20
+ withCommon(parent.command('dev|sessions|m5', 'cli.cmd.application.dev')).action((o) => cmdDev(o));
105
21
  }
106
- /**
107
- * @param {{ json?: string | boolean }} args
108
- * @param {string} json
109
- * @param {(data: any) => void} [printHuman]
110
- */
111
22
  function emitJson(args, json, printHuman) {
112
23
  if (typeof args.json === 'string') {
113
24
  writeFileSync(args.json, `${json}\n`, 'utf8');
@@ -127,27 +38,16 @@ function cmdSchemas() {
127
38
  console.log(native.queryApplicationProtocolCatalog);
128
39
  return 0;
129
40
  }
130
- /**
131
- * @param {string[]} argv
132
- */
133
- function cmdCheck(argv) {
134
- const args = parseRest(argv);
41
+ function cmdCheck(args) {
135
42
  const report = runCheck(args._[0] ?? '.');
136
43
  emitJson(args, report.json, (data) => {
137
44
  const errors = data.diagnostics.filter((d) => d.severity === 'error');
138
45
  log.info(`application check: descriptors=${data.descriptors.length} collections=${data.collections.length} mounts=${data.mounts.length} errors=${errors.length}`);
139
- for (const d of data.diagnostics) {
140
- const fn = d.severity === 'error' ? log.error : log.warn;
141
- fn(`${d.code}: ${d.path}: ${d.message}`);
142
- }
46
+ log.diagnostics(data.diagnostics ?? []);
143
47
  });
144
48
  return report.data.diagnostics.some((d) => d.severity === 'error') ? 1 : 0;
145
49
  }
146
- /**
147
- * @param {string[]} argv
148
- */
149
- function cmdList(argv) {
150
- const args = parseRest(argv);
50
+ function cmdList(args) {
151
51
  const report = runCheck(args._[0] ?? '.');
152
52
  emitJson(args, report.json, (data) => {
153
53
  for (const d of data.descriptors) {
@@ -163,11 +63,7 @@ function cmdList(argv) {
163
63
  });
164
64
  return report.data.diagnostics.some((d) => d.severity === 'error') ? 1 : 0;
165
65
  }
166
- /**
167
- * @param {string[]} argv
168
- */
169
- function cmdRelocatable(argv) {
170
- const args = parseRest(argv);
66
+ function cmdRelocatable(args) {
171
67
  const { project } = resolveWorkspaceDirs({ path: args._[0] ?? '.' });
172
68
  const native = loadNative();
173
69
  if (typeof native.checkApplicationRelocatableJson !== 'function') {
@@ -179,25 +75,18 @@ function cmdRelocatable(argv) {
179
75
  emitJson(args, json, () => {
180
76
  const errors = data.diagnostics.filter((d) => d.severity === 'error');
181
77
  log.info(`application relocatable: entries=${data.manifest?.entries?.length ?? 0} errors=${errors.length}`);
182
- for (const d of data.diagnostics) {
183
- const fn = d.severity === 'error' ? log.error : log.warn;
184
- fn(`${d.code}: ${d.path}: ${d.message}`);
185
- }
78
+ log.diagnostics(data.diagnostics ?? []);
186
79
  });
187
80
  return data.diagnostics.some((d) => d.severity === 'error') ? 1 : 0;
188
81
  }
189
- /**
190
- * @param {string[]} argv
191
- */
192
- function cmdRelocate(argv) {
193
- const args = parseRest(argv);
82
+ function cmdRelocate(args) {
194
83
  const manifestPath = args._[0];
195
84
  if (!manifestPath) {
196
- log.error('relocate requires a relocation manifest JSON path');
85
+ log.errorId('cli.err.application_relocate_manifest');
197
86
  return 1;
198
87
  }
199
88
  if (typeof args.base !== 'string' || !args.base) {
200
- log.error('relocate requires --base <ApplicationBase>');
89
+ log.errorId('cli.err.application_relocate_base');
201
90
  return 1;
202
91
  }
203
92
  const native = loadNative();
@@ -209,43 +98,25 @@ function cmdRelocate(argv) {
209
98
  emitJson(args, json);
210
99
  return 0;
211
100
  }
212
- /**
213
- * @param {string[]} argv
214
- */
215
- function cmdArtifacts(argv) {
216
- const args = parseRest(argv);
101
+ function cmdArtifacts(args) {
217
102
  const report = runHostPackageReport(args._[0] ?? '.', 'checkApplicationArtifactBoundaryJson');
218
103
  emitJson(args, report.json, (data) => {
219
104
  const errors = data.diagnostics.filter((d) => d.severity === 'error');
220
105
  log.info(`application artifacts: artifacts=${data.artifacts?.length ?? 0} mounts=${data.mountTable?.mounts?.length ?? 0} errors=${errors.length}`);
221
- for (const d of data.diagnostics) {
222
- const fn = d.severity === 'error' ? log.error : log.warn;
223
- fn(`${d.code}: ${d.path}: ${d.message}`);
224
- }
106
+ log.diagnostics(data.diagnostics ?? []);
225
107
  });
226
108
  return report.data.diagnostics.some((d) => d.severity === 'error') ? 1 : 0;
227
109
  }
228
- /**
229
- * @param {string[]} argv
230
- */
231
- function cmdIsolation(argv) {
232
- const args = parseRest(argv);
110
+ function cmdIsolation(args) {
233
111
  const report = runHostPackageReport(args._[0] ?? '.', 'checkApplicationIsolationJson');
234
112
  emitJson(args, report.json, (data) => {
235
113
  const errors = data.diagnostics.filter((d) => d.severity === 'error');
236
114
  log.info(`application isolation: namespaces=${data.namespaces?.length ?? 0} containment=${data.failureContainment?.length ?? 0} errors=${errors.length}`);
237
- for (const d of data.diagnostics) {
238
- const fn = d.severity === 'error' ? log.error : log.warn;
239
- fn(`${d.code}: ${d.path}: ${d.message}`);
240
- }
115
+ log.diagnostics(data.diagnostics ?? []);
241
116
  });
242
117
  return report.data.diagnostics.some((d) => d.severity === 'error') ? 1 : 0;
243
118
  }
244
- /**
245
- * @param {string[]} argv
246
- */
247
- function cmdComposition(argv) {
248
- const args = parseRest(argv);
119
+ function cmdComposition(args) {
249
120
  const report = runHostPackageReport(args._[0] ?? '.', 'checkApplicationHostCompositionJson');
250
121
  emitJson(args, report.json, (data) => {
251
122
  const errors = data.diagnostics.filter((d) => d.severity === 'error');
@@ -253,25 +124,23 @@ function cmdComposition(argv) {
253
124
  for (const link of data.crossApplicationLinks ?? []) {
254
125
  console.log(`link ${link.applicationId}\t${link.routeId}\t${link.href ?? '(unresolved)'}\tdocumentNavigation=${link.documentNavigation}`);
255
126
  }
256
- for (const d of data.diagnostics) {
257
- const fn = d.severity === 'error' ? log.error : log.warn;
258
- fn(`${d.code}: ${d.path}: ${d.message}`);
259
- }
127
+ log.diagnostics(data.diagnostics ?? []);
260
128
  });
261
129
  return report.data.diagnostics.some((d) => d.severity === 'error') ? 1 : 0;
262
130
  }
263
- /**
264
- * @param {string[]} argv
265
- */
266
- function cmdDev(argv) {
267
- const args = parseRest(argv);
131
+ function cmdDev(args) {
268
132
  const pathArg = args._[0] ?? '.';
269
133
  const { project } = resolveWorkspaceDirs({ path: pathArg });
270
134
  const packages = resolveWorkspacePackages(project);
271
135
  const roots = packages.map((p) => p.root);
272
136
  if (!roots.includes(project))
273
137
  roots.unshift(project);
274
- const dirty = Array.isArray(args.dirty) ? args.dirty.map((d) => path.resolve(project, String(d))) : [];
138
+ const dirtyRaw = args.dirty;
139
+ const dirty = Array.isArray(dirtyRaw)
140
+ ? dirtyRaw.map((d) => path.resolve(project, String(d)))
141
+ : typeof dirtyRaw === 'string'
142
+ ? [path.resolve(project, dirtyRaw)]
143
+ : [];
275
144
  const native = loadNative();
276
145
  if (typeof native.checkApplicationDevTestDeployJson !== 'function') {
277
146
  log.error('checkApplicationDevTestDeployJson missing — rebuild native (`pnpm napi:build`)');
@@ -295,17 +164,10 @@ function cmdDev(argv) {
295
164
  for (const c of report.proxy?.cases ?? []) {
296
165
  console.log(`proxy ${c.url}\t${c.applicationId ?? '-'}\t${c.status}\t${c.reason ?? ''}`);
297
166
  }
298
- for (const d of report.diagnostics || []) {
299
- const fn = d.severity === 'error' ? log.error : log.warn;
300
- fn(`${d.code}: ${d.path}: ${d.message}`);
301
- }
167
+ log.diagnostics(report.diagnostics || []);
302
168
  });
303
169
  return data.diagnostics.some((d) => d.severity === 'error') ? 1 : 0;
304
170
  }
305
- /**
306
- * @param {string} pathArg
307
- * @param {string} nativeFn
308
- */
309
171
  function runHostPackageReport(pathArg, nativeFn) {
310
172
  const { project } = resolveWorkspaceDirs({ path: pathArg });
311
173
  const packages = resolveWorkspacePackages(project);
@@ -320,14 +182,10 @@ function runHostPackageReport(pathArg, nativeFn) {
320
182
  const data = JSON.parse(json);
321
183
  return { project, json, data };
322
184
  }
323
- /**
324
- * @param {string} pathArg
325
- */
326
185
  export function runCheck(pathArg) {
327
186
  const { project } = resolveWorkspaceDirs({ path: pathArg });
328
187
  const packages = resolveWorkspacePackages(project);
329
188
  const roots = packages.map((p) => p.root);
330
- // Always include host root so a local package.json#vmz.application is visible.
331
189
  if (!roots.includes(project))
332
190
  roots.unshift(project);
333
191
  const native = loadNative();
@@ -338,10 +196,6 @@ export function runCheck(pathArg) {
338
196
  const data = JSON.parse(json);
339
197
  return { project, json, data };
340
198
  }
341
- /**
342
- * @param {string} hostRoot
343
- * @returns {boolean}
344
- */
345
199
  export function hasApplicationsConfig(hostRoot) {
346
200
  return existsSync(path.join(hostRoot, 'applications.config.json5'));
347
201
  }
@@ -1,19 +1,40 @@
1
- /**
2
- * Degrade author JSON5/JSON text to a plain object via Rust (not a semantic plan API).
3
- * @param {string} source
4
- * @returns {any}
5
- */
6
- export declare function parseAuthorInput(source: any): any;
7
- /**
8
- * @param {string} projectRoot
9
- */
10
- export declare function loadLocalePlan(projectRoot: any): any;
11
- /**
12
- * @param {string} projectRoot
13
- */
14
- export declare function loadDocumentRoutePlan(projectRoot: any): any;
15
- /**
16
- * Map Rust ReportedDiagnostic rows into host `{ code, severity, message, path }` rows.
17
- * @param {Array<{ code?: string, severity?: string, message?: string, path?: string }>} rows
18
- */
19
- export declare function mapPlanDiagnostics(rows: any): any;
1
+ export interface PlanDiagnostic {
2
+ code?: string;
3
+ severity?: string;
4
+ message?: string;
5
+ path?: string;
6
+ }
7
+ export interface MappedPlanDiagnostic {
8
+ code: string;
9
+ severity: string;
10
+ message: string;
11
+ path: string | undefined;
12
+ }
13
+ export interface LocalePlan {
14
+ diagnostics?: PlanDiagnostic[];
15
+ routing?: {
16
+ strategy?: string;
17
+ defaultPrefix?: string;
18
+ };
19
+ defaultLocale?: string;
20
+ }
21
+ export interface DocumentRouteCollection {
22
+ id: string;
23
+ sourceRoot?: string;
24
+ routeBase?: string;
25
+ }
26
+ /** Normalized documents route plan from Rust (author JSON5/JSON/declaration). */
27
+ export interface DocumentRoutePlan {
28
+ diagnostics?: PlanDiagnostic[];
29
+ sourcePath?: string | null;
30
+ defaultLocale?: string | null;
31
+ localeLabels?: Record<string, string>;
32
+ collections?: DocumentRouteCollection[];
33
+ silentFallbackRequested?: boolean;
34
+ }
35
+ /** Degrade author JSON5/JSON text to a plain object via Rust (not a semantic plan API). */
36
+ export declare function parseAuthorInput(source: string): unknown;
37
+ export declare function loadLocalePlan(projectRoot: string): LocalePlan;
38
+ export declare function loadDocumentRoutePlan(projectRoot: string): DocumentRoutePlan;
39
+ /** Map Rust ReportedDiagnostic rows into host `{ code, severity, message, path }` rows. */
40
+ export declare function mapPlanDiagnostics(rows: PlanDiagnostic[] | null | undefined): MappedPlanDiagnostic[];
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  /**
3
2
  * Author declaration input via Rust N-API (no JS JSON5 package).
4
3
  *
@@ -6,11 +5,7 @@
6
5
  * Catalogs / transitional tables: parseAuthorInput → Rust degrade → JSON.parse.
7
6
  */
8
7
  import { requireNativeAddon } from './native-addon.js';
9
- /**
10
- * Degrade author JSON5/JSON text to a plain object via Rust (not a semantic plan API).
11
- * @param {string} source
12
- * @returns {any}
13
- */
8
+ /** Degrade author JSON5/JSON text to a plain object via Rust (not a semantic plan API). */
14
9
  export function parseAuthorInput(source) {
15
10
  const native = requireNativeAddon();
16
11
  if (typeof native.authorJson5ToCanonicalJson !== 'function') {
@@ -18,9 +13,6 @@ export function parseAuthorInput(source) {
18
13
  }
19
14
  return JSON.parse(native.authorJson5ToCanonicalJson(String(source)));
20
15
  }
21
- /**
22
- * @param {string} projectRoot
23
- */
24
16
  export function loadLocalePlan(projectRoot) {
25
17
  const native = requireNativeAddon();
26
18
  if (typeof native.loadLocalePlan !== 'function') {
@@ -28,9 +20,6 @@ export function loadLocalePlan(projectRoot) {
28
20
  }
29
21
  return JSON.parse(native.loadLocalePlan(String(projectRoot)));
30
22
  }
31
- /**
32
- * @param {string} projectRoot
33
- */
34
23
  export function loadDocumentRoutePlan(projectRoot) {
35
24
  const native = requireNativeAddon();
36
25
  if (typeof native.loadDocumentRoutePlan !== 'function') {
@@ -38,10 +27,7 @@ export function loadDocumentRoutePlan(projectRoot) {
38
27
  }
39
28
  return JSON.parse(native.loadDocumentRoutePlan(String(projectRoot)));
40
29
  }
41
- /**
42
- * Map Rust ReportedDiagnostic rows into host `{ code, severity, message, path }` rows.
43
- * @param {Array<{ code?: string, severity?: string, message?: string, path?: string }>} rows
44
- */
30
+ /** Map Rust ReportedDiagnostic rows into host `{ code, severity, message, path }` rows. */
45
31
  export function mapPlanDiagnostics(rows) {
46
32
  return (rows || []).map((d) => ({
47
33
  code: d.code || 'vmz::unknown',
@@ -3,50 +3,72 @@
3
3
  */
4
4
  export declare const BUILD_PROOF_SCHEMA = "vmz.build.proof.v0";
5
5
  export declare const ASSEMBLE_MANIFEST_SCHEMA = "vmz.assemble.manifest.v0";
6
- /**
7
- * @param {string} outDir
8
- * @param {any} ctx
9
- */
10
- export declare function assembleDelivery(outDir: any, ctx: any): Promise<{
11
- manifest: {
6
+ interface AssembleStep {
7
+ kind: string;
8
+ digest?: string;
9
+ status?: string;
10
+ note?: string;
11
+ reason?: string;
12
+ htmlFiles?: number;
13
+ skipped?: number;
14
+ publicRoutes?: number;
15
+ internalCapabilities?: number;
16
+ httpContractDigest?: string;
17
+ objectCount?: number;
18
+ }
19
+ interface AssembleManifest {
20
+ schema: string;
21
+ profileId: unknown;
22
+ assembly: unknown;
23
+ serverRuntime: unknown;
24
+ steps: AssembleStep[];
25
+ staticDelivery?: {
26
+ digest: string;
27
+ htmlFiles: unknown;
28
+ skipped: unknown;
29
+ };
30
+ serverArtifact?: {
31
+ digest: string;
32
+ httpContractDigest: string;
12
33
  schema: string;
13
- profileId: any;
14
- assembly: any;
15
- serverRuntime: any;
16
- steps: any[];
34
+ selectedRuntime: string;
17
35
  };
18
- path: string;
19
- }>;
20
- /**
21
- * @param {string} outDir
22
- * @param {any} ctx
23
- */
24
- export declare function emitBuildProof(outDir: any, ctx: any): {
25
- proof: {
36
+ siteDelivery?: {
37
+ digest: string;
38
+ schema: string;
39
+ };
40
+ embeddedPackaging?: {
41
+ digest: string;
42
+ objectCount: number;
26
43
  schema: string;
27
- profileId: any;
28
- assembly: any;
29
- selectionDigest: any;
30
- packDigest: any;
31
- assembleDigest: any;
32
- release: boolean;
33
- semanticIds: string[];
34
- slots: {
35
- 'server-host': {
36
- status: string;
37
- };
38
- 'static-delivery': {
39
- status: string;
40
- };
41
- 'site-fallback': {
42
- status: string;
43
- };
44
- 'asset-graph': {
45
- status: string;
46
- };
47
- };
48
- productionReadyClaim: boolean;
49
- note: string;
50
44
  };
45
+ packDigest?: string | null;
46
+ assembleDigest?: string;
47
+ }
48
+ interface BuildProofSlot {
49
+ status: string;
50
+ detail?: string;
51
+ }
52
+ interface BuildProofBody {
53
+ schema: string;
54
+ profileId: unknown;
55
+ assembly: unknown;
56
+ selectionDigest: unknown;
57
+ packDigest: string | null;
58
+ assembleDigest: string | null;
59
+ release: boolean;
60
+ semanticIds: string[];
61
+ slots: Record<string, BuildProofSlot>;
62
+ productionReadyClaim: boolean;
63
+ note: string;
64
+ proofDigest?: string;
65
+ }
66
+ export declare function assembleDelivery(outDir: string, ctx: Record<string, unknown>): Promise<{
67
+ manifest: AssembleManifest;
68
+ path: string;
69
+ }>;
70
+ export declare function emitBuildProof(outDir: string, ctx: Record<string, unknown>): {
71
+ proof: BuildProofBody;
51
72
  path: string;
52
73
  };
74
+ export {};