@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
package/dist/resolve.d.ts CHANGED
@@ -1,24 +1,20 @@
1
1
  /**
2
2
  * Shared project path resolution for the Node CLI host .
3
3
  */
4
- /**
5
- * @param {string} startDir
6
- * @returns {string | null}
7
- */
8
- export declare function findPackageJson(startDir: any): string;
9
- /**
10
- * Resolve project root + out dir from CLI args / cwd.
11
- * Prefers an explicit path; otherwise walks up for package.json with `src/`.
12
- *
13
- * @param {{ cwd?: string, path?: string, outDir?: string }} opts
14
- */
15
- export declare function resolveWorkspaceDirs(opts?: {}): {
4
+ export interface ResolveWorkspaceDirsOpts {
5
+ cwd?: string;
6
+ path?: string;
7
+ outDir?: string;
8
+ }
9
+ export interface PackageMeta {
10
+ name?: string;
11
+ private?: boolean;
12
+ }
13
+ export declare function findPackageJson(startDir: string): string | null;
14
+ /** Resolve project root + out dir from CLI args / cwd. Prefers an explicit path; otherwise walks up for package.json with `src/`. */
15
+ export declare function resolveWorkspaceDirs(opts?: ResolveWorkspaceDirsOpts): {
16
16
  project: string;
17
- outDir: any;
18
- cwd: any;
17
+ outDir: string;
18
+ cwd: string;
19
19
  };
20
- /**
21
- * @param {string} projectRoot
22
- * @returns {{ name?: string, private?: boolean } | null}
23
- */
24
- export declare function readPackageMeta(projectRoot: any): any;
20
+ export declare function readPackageMeta(projectRoot: string): PackageMeta | null;
package/dist/resolve.js CHANGED
@@ -1,13 +1,8 @@
1
- // @ts-nocheck
2
1
  /**
3
2
  * Shared project path resolution for the Node CLI host .
4
3
  */
5
4
  import { existsSync, readFileSync } from 'node:fs';
6
5
  import path from 'node:path';
7
- /**
8
- * @param {string} startDir
9
- * @returns {string | null}
10
- */
11
6
  export function findPackageJson(startDir) {
12
7
  let dir = path.resolve(startDir);
13
8
  for (;;) {
@@ -20,12 +15,7 @@ export function findPackageJson(startDir) {
20
15
  dir = parent;
21
16
  }
22
17
  }
23
- /**
24
- * Resolve project root + out dir from CLI args / cwd.
25
- * Prefers an explicit path; otherwise walks up for package.json with `src/`.
26
- *
27
- * @param {{ cwd?: string, path?: string, outDir?: string }} opts
28
- */
18
+ /** Resolve project root + out dir from CLI args / cwd. Prefers an explicit path; otherwise walks up for package.json with `src/`. */
29
19
  export function resolveWorkspaceDirs(opts = {}) {
30
20
  const cwd = opts.cwd ?? process.cwd();
31
21
  const input = path.resolve(cwd, opts.path ?? '.');
@@ -38,10 +28,6 @@ export function resolveWorkspaceDirs(opts = {}) {
38
28
  const outDir = opts.outDir ? (path.isAbsolute(opts.outDir) ? opts.outDir : path.join(project, opts.outDir)) : path.join(project, 'dist');
39
29
  return { project, outDir, cwd };
40
30
  }
41
- /**
42
- * @param {string} projectRoot
43
- * @returns {{ name?: string, private?: boolean } | null}
44
- */
45
31
  export function readPackageMeta(projectRoot) {
46
32
  const pkgPath = path.join(projectRoot, 'package.json');
47
33
  if (!existsSync(pkgPath))
@@ -14,83 +14,37 @@ export declare const SERVER_RUNTIME_ADAPTER_SCHEMA = "vmz.server.runtime_adapter
14
14
  * packDigest?: string | null,
15
15
  * }} [opts]
16
16
  */
17
- export declare function emitServerArtifact(outDir: any, opts?: {}): {
18
- artifact: {
17
+ interface ServerArtifactOpts {
18
+ profileId?: string | null;
19
+ assembly?: string | null;
20
+ serverRuntime?: string | null;
21
+ packDigest?: string | null;
22
+ }
23
+ interface ServerArtifactBody {
24
+ schema: string;
25
+ profileId: string | null;
26
+ assembly: string | null;
27
+ selectedRuntime: string;
28
+ entry: {
29
+ kind: string;
30
+ standards: string[];
31
+ rpcPath: string;
32
+ };
33
+ httpContract: {
19
34
  schema: string;
20
- profileId: any;
21
- assembly: any;
22
- selectedRuntime: string;
23
- entry: {
24
- kind: string;
25
- standards: string[];
26
- rpcPath: string;
27
- };
28
- httpContract: {
29
- schema: string;
30
- digest: string;
31
- };
32
- publicRoutes: {
33
- verb: string;
34
- path: string;
35
- moduleId: string;
36
- method: string;
37
- className: string;
38
- visibility: string;
39
- kind: string;
40
- }[];
41
- internalCapabilities: any[];
42
- middlewareUnits: any[];
43
- routeDecisionTree: ({
44
- id: string;
45
- match: {
46
- method: string;
47
- path: string;
48
- };
49
- action: string;
50
- target: {
51
- moduleId: string;
52
- method: string;
53
- };
54
- visibility: string;
55
- } | {
56
- id: string;
57
- match: {
58
- method: string;
59
- path: string;
60
- };
61
- action: string;
62
- visibility: string;
63
- })[];
64
- deploymentSchema: any;
65
- packDigest: any;
66
- adapters: {
67
- node: {
68
- kind: string;
69
- status: string;
70
- entry: string;
71
- };
72
- worker: {
73
- kind: string;
74
- status: string;
75
- entry: string;
76
- };
77
- deno: {
78
- kind: string;
79
- status: string;
80
- entry: string;
81
- };
82
- bun: {
83
- kind: string;
84
- status: string;
85
- entry: string;
86
- };
87
- 'rust-host': {
88
- kind: string;
89
- status: string;
90
- entry: string;
91
- };
92
- };
35
+ digest: string;
93
36
  };
37
+ publicRoutes: Array<Record<string, unknown>>;
38
+ internalCapabilities: Array<Record<string, unknown>>;
39
+ middlewareUnits: unknown[];
40
+ routeDecisionTree: unknown[];
41
+ deploymentSchema: unknown;
42
+ packDigest: string | null;
43
+ adapters: Record<string, unknown>;
44
+ artifactDigest?: string;
45
+ }
46
+ export declare function emitServerArtifact(outDir: string, opts?: ServerArtifactOpts): {
47
+ artifact: ServerArtifactBody;
94
48
  path: string;
95
49
  httpContractDigest: string;
96
50
  };
@@ -138,3 +92,4 @@ export declare function projectServerRuntimeAdapter(artifact: any, adapterId: an
138
92
  publicRouteCount: any;
139
93
  internalCapabilityCount: any;
140
94
  };
95
+ export {};
@@ -2,7 +2,6 @@
2
2
  * P4 ServerArtifact — compiled route decision tree + public ServerRoute contracts
3
3
  * + internal capability units + selected runtime adapter. Web Standards Fetch entry.
4
4
  */
5
- // @ts-nocheck
6
5
  import crypto from 'node:crypto';
7
6
  import { existsSync, mkdirSync, readFileSync } from 'node:fs';
8
7
  import path from 'node:path';
@@ -12,15 +11,6 @@ export const SERVER_ARTIFACT_SCHEMA = 'vmz.server.artifact.v0';
12
11
  export const HTTP_CONTRACT_SCHEMA = 'vmz.http.contract.v0';
13
12
  export const SERVER_RUNTIME_ADAPTER_SCHEMA = 'vmz.server.runtime_adapter.v0';
14
13
  const DEFAULT_RPC_PATH = '/__vmz/rpc';
15
- /**
16
- * @param {string} outDir
17
- * @param {{
18
- * profileId?: string | null,
19
- * assembly?: string | null,
20
- * serverRuntime?: string | null,
21
- * packDigest?: string | null,
22
- * }} [opts]
23
- */
24
14
  export function emitServerArtifact(outDir, opts = {}) {
25
15
  const deployment = readJson(path.join(outDir, 'vmz-deployment.json')) || { schema: null, units: [] };
26
16
  const routes = readJson(path.join(outDir, 'vmz-routes.json'));
@@ -2,88 +2,31 @@
2
2
  * Server Language DSL backends (lang on `<script server>`).
3
3
  * Author surface is a VMZ DSL flavor — not full target-language source.
4
4
  */
5
- /** @typedef {'ts' | 'rust' | 'python' | 'java'} ServerLangId */
6
- export declare const SERVER_LANG_IDS: readonly string[];
7
- /** @type {Record<string, ServerLangId>} */
8
- export declare const SERVER_LANG_ALIASES: Readonly<{
9
- ts: "ts";
10
- typescript: "ts";
11
- rust: "rust";
12
- python: "python";
13
- java: "java";
14
- }>;
15
- /**
16
- * @typedef {{
17
- * langId: ServerLangId,
18
- * aliases: string[],
19
- * compatibleRuntimes: string[],
20
- * implemented: boolean,
21
- * artifactRoot: string,
22
- * }} ServerLanguageBackendMeta
23
- */
24
- /** @type {Record<ServerLangId, ServerLanguageBackendMeta>} */
25
- export declare const SERVER_LANGUAGE_BACKENDS: Readonly<{
26
- ts: {
27
- langId: string;
28
- aliases: string[];
29
- compatibleRuntimes: string[];
30
- implemented: boolean;
31
- artifactRoot: string;
32
- };
33
- rust: {
34
- langId: string;
35
- aliases: string[];
36
- compatibleRuntimes: string[];
37
- implemented: boolean;
38
- artifactRoot: string;
39
- };
40
- python: {
41
- langId: string;
42
- aliases: string[];
43
- compatibleRuntimes: string[];
44
- implemented: boolean;
45
- artifactRoot: string;
46
- };
47
- java: {
48
- langId: string;
49
- aliases: string[];
50
- compatibleRuntimes: string[];
51
- implemented: boolean;
52
- artifactRoot: string;
53
- };
54
- }>;
55
- /**
56
- * Resolve author `lang` attr (or null/undefined for default TS).
57
- * @param {string | null | undefined} raw
58
- * @returns {{
59
- * ok: true, langId: ServerLangId, backend: ServerLanguageBackendMeta
60
- * } | {
61
- * ok: false, code: string, message: string
62
- * }}
63
- */
64
- export declare function resolveServerLanguage(raw: any): {
65
- ok: boolean;
5
+ export type ServerLangId = 'ts' | 'rust' | 'python' | 'java';
6
+ export declare const SERVER_LANG_IDS: readonly ["ts", "rust", "python", "java"];
7
+ export declare const SERVER_LANG_ALIASES: Record<string, ServerLangId>;
8
+ export interface ServerLanguageBackendMeta {
9
+ langId: ServerLangId;
10
+ aliases: string[];
11
+ compatibleRuntimes: string[];
12
+ implemented: boolean;
13
+ artifactRoot: string;
14
+ }
15
+ export declare const SERVER_LANGUAGE_BACKENDS: Record<ServerLangId, ServerLanguageBackendMeta>;
16
+ export type ResolveServerLanguageResult = {
17
+ ok: true;
18
+ langId: ServerLangId;
19
+ backend: ServerLanguageBackendMeta;
20
+ } | {
21
+ ok: false;
66
22
  code: string;
67
23
  message: string;
68
- langId?: undefined;
69
- backend?: undefined;
70
- } | {
71
- ok: boolean;
72
- langId: any;
73
- backend: any;
74
- code?: undefined;
75
- message?: undefined;
76
24
  };
77
- /**
78
- * @param {ServerLangId} langId
79
- * @param {string | null | undefined} serverRuntime
80
- */
81
- export declare function assertLangRuntimePair(langId: any, serverRuntime: any): {
82
- ok: boolean;
25
+ export declare function resolveServerLanguage(raw: string | null | undefined): ResolveServerLanguageResult;
26
+ export declare function assertLangRuntimePair(langId: ServerLangId, serverRuntime: string | null | undefined): {
27
+ ok: true;
28
+ } | {
29
+ ok: false;
83
30
  code: string;
84
31
  message: string;
85
- } | {
86
- ok: boolean;
87
- code?: undefined;
88
- message?: undefined;
89
32
  };
@@ -2,10 +2,7 @@
2
2
  * Server Language DSL backends (lang on `<script server>`).
3
3
  * Author surface is a VMZ DSL flavor — not full target-language source.
4
4
  */
5
- // @ts-nocheck
6
- /** @typedef {'ts' | 'rust' | 'python' | 'java'} ServerLangId */
7
5
  export const SERVER_LANG_IDS = Object.freeze(['ts', 'rust', 'python', 'java']);
8
- /** @type {Record<string, ServerLangId>} */
9
6
  export const SERVER_LANG_ALIASES = Object.freeze({
10
7
  ts: 'ts',
11
8
  typescript: 'ts',
@@ -13,16 +10,6 @@ export const SERVER_LANG_ALIASES = Object.freeze({
13
10
  python: 'python',
14
11
  java: 'java',
15
12
  });
16
- /**
17
- * @typedef {{
18
- * langId: ServerLangId,
19
- * aliases: string[],
20
- * compatibleRuntimes: string[],
21
- * implemented: boolean,
22
- * artifactRoot: string,
23
- * }} ServerLanguageBackendMeta
24
- */
25
- /** @type {Record<ServerLangId, ServerLanguageBackendMeta>} */
26
13
  export const SERVER_LANGUAGE_BACKENDS = Object.freeze({
27
14
  ts: {
28
15
  langId: 'ts',
@@ -53,15 +40,6 @@ export const SERVER_LANGUAGE_BACKENDS = Object.freeze({
53
40
  artifactRoot: 'target/vmz/server-java',
54
41
  },
55
42
  });
56
- /**
57
- * Resolve author `lang` attr (or null/undefined for default TS).
58
- * @param {string | null | undefined} raw
59
- * @returns {{
60
- * ok: true, langId: ServerLangId, backend: ServerLanguageBackendMeta
61
- * } | {
62
- * ok: false, code: string, message: string
63
- * }}
64
- */
65
43
  export function resolveServerLanguage(raw) {
66
44
  const trimmed = raw == null ? '' : String(raw).trim();
67
45
  if (!trimmed) {
@@ -85,10 +63,6 @@ export function resolveServerLanguage(raw) {
85
63
  }
86
64
  return { ok: true, langId, backend };
87
65
  }
88
- /**
89
- * @param {ServerLangId} langId
90
- * @param {string | null | undefined} serverRuntime
91
- */
92
66
  export function assertLangRuntimePair(langId, serverRuntime) {
93
67
  const backend = SERVER_LANGUAGE_BACKENDS[langId];
94
68
  if (!backend) {
@@ -12,35 +12,19 @@ export declare const SITE_DELIVERY_RESOLUTION_SCHEMA = "vmz.site.delivery_resolu
12
12
  export declare function defineSite(delivery: any): any;
13
13
  /**
14
14
  * Normalize authoring delivery → frozen SiteDeliveryContract.
15
- * @param {unknown} raw
16
- * @param {{ siteId?: string, projectRoot?: string }} [opts]
17
- * @returns {{ ok: true, contract: Record<string, any> } | { ok: false, diagnostics: Array<{ code: string, message: string }> }}
18
15
  */
19
- export declare function normalizeSiteDelivery(raw: any, opts?: {}): {
20
- ok: boolean;
21
- diagnostics: any[];
22
- contract?: undefined;
16
+ export declare function normalizeSiteDelivery(raw: unknown, opts?: {
17
+ siteId?: string;
18
+ projectRoot?: string;
19
+ }): {
20
+ ok: true;
21
+ contract: Record<string, any>;
23
22
  } | {
24
- ok: boolean;
25
- contract: {
26
- schema: string;
27
- schemaVersion: string;
28
- siteId: any;
29
- artifact: string;
30
- expectedCompatibility: any;
31
- sources: any[];
32
- resolutionPolicy: {
33
- mode: string;
34
- fallback: any;
35
- fileLevelMix: boolean;
36
- };
37
- failurePolicy: any;
38
- updatePolicy: any;
39
- rollbackPolicy: any;
40
- securityPolicy: any;
41
- activation: string;
42
- };
43
- diagnostics?: undefined;
23
+ ok: false;
24
+ diagnostics: Array<{
25
+ code: string;
26
+ message: string;
27
+ }>;
44
28
  };
45
29
  /**
46
30
  * Probe one physical source for release-level readiness (not per-URL).
@@ -54,31 +38,44 @@ export declare function normalizeSiteDelivery(raw: any, opts?: {}): {
54
38
  * error?: string | null,
55
39
  * }} [probe]
56
40
  */
57
- export declare function normalizeSourceProbe(probe?: {}): {
41
+ export declare function normalizeSourceProbe(probe?: {
42
+ available?: boolean;
43
+ artifactDigest?: string | null;
44
+ integrityOk?: boolean;
45
+ signatureOk?: boolean;
46
+ objectClosureOk?: boolean;
47
+ mixedDigestObjects?: boolean;
48
+ error?: string | null;
49
+ }): {
58
50
  available: boolean;
59
- artifactDigest: any;
51
+ artifactDigest: string;
60
52
  integrityOk: boolean;
61
53
  signatureOk: boolean;
62
54
  objectClosureOk: boolean;
63
55
  mixedDigestObjects: boolean;
64
- error: any;
56
+ error: string;
65
57
  };
66
58
  /**
67
59
  * Resolve one complete release per SiteDeliveryContract (no file-level mix).
68
60
  * @param {Record<string, any>} contract
69
61
  * @param {Record<string, ReturnType<typeof normalizeSourceProbe>>} probes by sourceId
70
62
  */
71
- export declare function resolveSiteRelease(contract: any, probes?: {}): {
63
+ export declare function resolveSiteRelease(contract: Record<string, any>, probes?: Record<string, ReturnType<typeof normalizeSourceProbe>>): {
72
64
  schema: string;
73
65
  status: string;
74
- selectedSourceId: any;
75
- selectedKind: any;
76
- selectedDigest: any;
77
- fallbackReason: string;
78
- attempted: any[];
66
+ selectedSourceId: string;
67
+ selectedKind: unknown;
68
+ selectedDigest: string | null;
69
+ fallbackReason: string | null;
70
+ attempted: {
71
+ sourceId: string;
72
+ result: string;
73
+ reason: string | null;
74
+ }[];
79
75
  fileLevelMix: boolean;
80
76
  activation: string;
81
- contractDigest: any;
77
+ contractDigest: unknown;
78
+ resolutionDigest?: string;
82
79
  } | {
83
80
  schema: string;
84
81
  status: string;
@@ -86,7 +83,11 @@ export declare function resolveSiteRelease(contract: any, probes?: {}): {
86
83
  selectedKind: any;
87
84
  selectedDigest: any;
88
85
  fallbackReason: string;
89
- attempted: any[];
86
+ attempted: {
87
+ sourceId: string;
88
+ result: string;
89
+ reason: string | null;
90
+ }[];
90
91
  fileLevelMix: boolean;
91
92
  activation: string;
92
93
  contractDigest: any;
@@ -98,12 +99,12 @@ export declare function resolveSiteRelease(contract: any, probes?: {}): {
98
99
  */
99
100
  export declare function probeReleaseDirectory(releaseDir: any): {
100
101
  available: boolean;
101
- artifactDigest: any;
102
+ artifactDigest: string;
102
103
  integrityOk: boolean;
103
104
  signatureOk: boolean;
104
105
  objectClosureOk: boolean;
105
106
  mixedDigestObjects: boolean;
106
- error: any;
107
+ error: string;
107
108
  };
108
109
  /**
109
110
  * Emit normalized contract (+ optional resolution) under dist/_vmz.
@@ -111,24 +112,10 @@ export declare function probeReleaseDirectory(releaseDir: any): {
111
112
  * @param {unknown} deliveryRaw
112
113
  * @param {{ siteId?: string, probes?: Record<string, any> }} [opts]
113
114
  */
114
- export declare function emitSiteDelivery(outDir: any, deliveryRaw: any, opts?: {}): {
115
- contract: {
116
- schema: string;
117
- schemaVersion: string;
118
- siteId: any;
119
- artifact: string;
120
- expectedCompatibility: any;
121
- sources: any[];
122
- resolutionPolicy: {
123
- mode: string;
124
- fallback: any;
125
- fileLevelMix: boolean;
126
- };
127
- failurePolicy: any;
128
- updatePolicy: any;
129
- rollbackPolicy: any;
130
- securityPolicy: any;
131
- activation: string;
132
- };
115
+ export declare function emitSiteDelivery(outDir: string, deliveryRaw: unknown, opts?: {
116
+ siteId?: string;
117
+ probes?: Record<string, ReturnType<typeof normalizeSourceProbe>>;
118
+ }): {
119
+ contract: Record<string, any>;
133
120
  resolution: any;
134
121
  };
@@ -2,7 +2,6 @@
2
2
  * A3-site: SiteDeliveryContract — embedded | filesystem | remote selection + release fallback.
3
3
  * Authoring via defineConfig({ delivery }) / defineSite(...); pure data only.
4
4
  */
5
- // @ts-nocheck
6
5
  import crypto from 'node:crypto';
7
6
  import fs from 'node:fs';
8
7
  import path from 'node:path';
@@ -19,12 +18,8 @@ export function defineSite(delivery) {
19
18
  }
20
19
  /**
21
20
  * Normalize authoring delivery → frozen SiteDeliveryContract.
22
- * @param {unknown} raw
23
- * @param {{ siteId?: string, projectRoot?: string }} [opts]
24
- * @returns {{ ok: true, contract: Record<string, any> } | { ok: false, diagnostics: Array<{ code: string, message: string }> }}
25
21
  */
26
22
  export function normalizeSiteDelivery(raw, opts = {}) {
27
- /** @type {Array<{ code: string, message: string }>} */
28
23
  const diagnostics = [];
29
24
  if (raw == null || typeof raw !== 'object' || Array.isArray(raw)) {
30
25
  return {
@@ -32,7 +27,7 @@ export function normalizeSiteDelivery(raw, opts = {}) {
32
27
  diagnostics: [{ code: 'site.delivery.invalid', message: 'delivery must be a plain object' }],
33
28
  };
34
29
  }
35
- const d = /** @type {Record<string, any>} */ (raw);
30
+ const d = raw;
36
31
  if (typeof d.artifact !== 'string' || !d.artifact.trim()) {
37
32
  diagnostics.push({ code: 'site.delivery.artifact', message: 'delivery.artifact is required' });
38
33
  }
@@ -110,7 +105,7 @@ export function normalizeSiteDelivery(raw, opts = {}) {
110
105
  message: `resolution.mode must be 'release' (got ${mode})`,
111
106
  });
112
107
  }
113
- let fallback = Array.isArray(resolution.fallback) ? resolution.fallback.map(String) : sources.map((s) => s.sourceId);
108
+ const fallback = Array.isArray(resolution.fallback) ? resolution.fallback.map(String) : sources.map((s) => s.sourceId);
114
109
  for (const id of fallback) {
115
110
  if (!seen.has(id)) {
116
111
  diagnostics.push({
@@ -314,7 +309,7 @@ export function probeReleaseDirectory(releaseDir) {
314
309
  */
315
310
  export function emitSiteDelivery(outDir, deliveryRaw, opts = {}) {
316
311
  const norm = normalizeSiteDelivery(deliveryRaw, { siteId: opts.siteId });
317
- if (!norm.ok) {
312
+ if (norm.ok === false) {
318
313
  throw new Error(`emitSiteDelivery: ${norm.diagnostics.map((d) => d.message).join('; ')}`);
319
314
  }
320
315
  const vmzDir = path.join(outDir, '_vmz');
@@ -7,7 +7,11 @@ export declare const SITE_FAVICON_SCHEMA = "vmz.site_favicon.v0";
7
7
  * @param {string} distDir
8
8
  * @param {{ projectRoot?: string, skipNative?: boolean }} [opts]
9
9
  */
10
- export declare function emitSiteFavicon(distDir: any, opts?: {}): {
10
+ interface SiteFaviconOpts {
11
+ projectRoot?: string;
12
+ skipNative?: boolean;
13
+ }
14
+ export declare function emitSiteFavicon(distDir: string, opts?: SiteFaviconOpts): {
11
15
  schema: string;
12
16
  status: string;
13
17
  source: string;
@@ -29,3 +33,4 @@ export declare function readSiteFaviconHeadHtml(distDir: any): any;
29
33
  * @param {Array<{ png: Buffer, size: number }>} images
30
34
  */
31
35
  export declare function packPngsIntoIco(images: any): Buffer<ArrayBuffer>;
36
+ export {};
@@ -2,17 +2,12 @@
2
2
  * Site favicon: author SVG → PNG + ICO + `_vmz/site-favicon.json` head links.
3
3
  * Convention: `assets/favicon.svg` (or `favicon.svg`) under project / already in dist.
4
4
  */
5
- // @ts-nocheck
6
5
  import fs from 'node:fs';
7
6
  import path from 'node:path';
8
7
  import { requireNativeAddon } from './native-addon.js';
9
8
  import { writePrettyJsonFile } from './pretty-json.js';
10
9
  export const SITE_FAVICON_SCHEMA = 'vmz.site_favicon.v0';
11
10
  const ICO_SIZES = [16, 32, 48];
12
- /**
13
- * @param {string} distDir
14
- * @param {{ projectRoot?: string, skipNative?: boolean }} [opts]
15
- */
16
11
  export function emitSiteFavicon(distDir, opts = {}) {
17
12
  const absDist = path.resolve(distDir);
18
13
  const projectRoot = opts.projectRoot ? path.resolve(opts.projectRoot) : null;