@vmz/vmz 0.0.3 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +6 -4
  2. package/dist/build-assemble.d.ts +52 -0
  3. package/dist/build-assemble.js +191 -0
  4. package/dist/cdn-policy.d.ts +196 -0
  5. package/dist/cdn-policy.js +443 -0
  6. package/dist/cli.js +152 -11
  7. package/dist/content-addressed-assets.d.ts +69 -0
  8. package/dist/content-addressed-assets.js +206 -0
  9. package/dist/delivery-profile.d.ts +74 -0
  10. package/dist/delivery-profile.js +279 -0
  11. package/dist/dev-session.js +49 -13
  12. package/dist/document-build.js +9 -4
  13. package/dist/document-designs.js +30 -2
  14. package/dist/document-enrich.js +8 -0
  15. package/dist/embedded-packaging.d.ts +22 -0
  16. package/dist/embedded-packaging.js +113 -0
  17. package/dist/index.d.ts +19 -3
  18. package/dist/index.js +35 -15
  19. package/dist/invocation.d.ts +8 -31
  20. package/dist/invocation.js +12 -33
  21. package/dist/locale-check.d.ts +16 -0
  22. package/dist/locale-check.js +131 -3
  23. package/dist/locale-cmd.js +2 -2
  24. package/dist/locale-route-emit.d.ts +34 -0
  25. package/dist/locale-route-emit.js +134 -0
  26. package/dist/locale-router.d.ts +20 -0
  27. package/dist/locale-router.js +68 -0
  28. package/dist/log.d.ts +2 -2
  29. package/dist/log.js +11 -3
  30. package/dist/pack.d.ts +40 -0
  31. package/dist/pack.js +108 -0
  32. package/dist/plugin-host.d.ts +10 -1
  33. package/dist/plugin-host.js +19 -2
  34. package/dist/port.d.ts +10 -0
  35. package/dist/port.js +46 -0
  36. package/dist/production-observability.d.ts +286 -0
  37. package/dist/production-observability.js +469 -0
  38. package/dist/production-test-pack.d.ts +144 -0
  39. package/dist/production-test-pack.js +447 -0
  40. package/dist/release-cmd.d.ts +8 -0
  41. package/dist/release-cmd.js +126 -0
  42. package/dist/release-pack.d.ts +96 -0
  43. package/dist/release-pack.js +346 -0
  44. package/dist/server-artifact.d.ts +140 -0
  45. package/dist/server-artifact.js +205 -0
  46. package/dist/server-language-backend.d.ts +89 -0
  47. package/dist/server-language-backend.js +121 -0
  48. package/dist/site-delivery.d.ts +134 -0
  49. package/dist/site-delivery.js +345 -0
  50. package/dist/static-emit.d.ts +145 -0
  51. package/dist/static-emit.js +577 -0
  52. package/package.json +13 -13
@@ -0,0 +1,286 @@
1
+ /**
2
+ * A5: Production observability — trace facets, redaction, CSP/security,
3
+ * performance budgets, health/readiness, capability closure.
4
+ */
5
+ export declare const PRODUCTION_OBSERVABILITY_SCHEMA = "vmz.production.observability.v0";
6
+ export declare const PRODUCTION_TRACE_SCHEMA = "vmz.production.trace.v0";
7
+ /** Facets that production traces must be able to carry (08 A5). */
8
+ export declare const REQUIRED_TRACE_FACETS: readonly string[];
9
+ /**
10
+ * Default Browser Production Profile observability contract.
11
+ * @param {Record<string, unknown>} [overrides]
12
+ */
13
+ export declare function browserProductionObservability(overrides?: {}): {
14
+ schema: string;
15
+ id: any;
16
+ trace: {
17
+ schema: string;
18
+ requiredFacets: any;
19
+ retainOnFailure: any;
20
+ };
21
+ redaction: {
22
+ mode: string;
23
+ replaceWith: any;
24
+ allowPublicProvenance: boolean;
25
+ sensitiveKeyPattern: string;
26
+ };
27
+ security: {
28
+ csp: any;
29
+ requireIntegrityForRemote: boolean;
30
+ originIsolation: boolean;
31
+ requireNonceForInline: boolean;
32
+ cookieNamespace: any;
33
+ sessionNamespace: any;
34
+ };
35
+ capability: {
36
+ allowlistRequired: boolean;
37
+ inputOutputSchemaRequired: boolean;
38
+ timeoutMsDefault: number;
39
+ cancelSupported: boolean;
40
+ serverSecretClosure: boolean;
41
+ };
42
+ budgets: {
43
+ irrelevantBindingWork: number;
44
+ irrelevantRouteRegionRebuild: number;
45
+ wholeTreeRerender: number;
46
+ maxArtifactBytes: number;
47
+ maxHtmlBytes: number;
48
+ maxClientJsBytes: number;
49
+ maxPatchCountPerTransition: number;
50
+ };
51
+ health: {
52
+ livePath: any;
53
+ readyPath: any;
54
+ gracefulShutdown: {
55
+ stopAccepting: boolean;
56
+ drainInFlight: boolean;
57
+ timeoutMs: number;
58
+ };
59
+ };
60
+ sampling: {
61
+ diagnosticSampleRate: number;
62
+ rollbackOnErrorRate: number;
63
+ latencyBudgetMs: {
64
+ p95: number;
65
+ p99: number;
66
+ };
67
+ };
68
+ };
69
+ /**
70
+ * @param {unknown} raw
71
+ */
72
+ export declare function normalizeObservability(raw: any): {
73
+ schema: string;
74
+ id: any;
75
+ trace: {
76
+ schema: string;
77
+ requiredFacets: any;
78
+ retainOnFailure: any;
79
+ };
80
+ redaction: {
81
+ mode: string;
82
+ replaceWith: any;
83
+ allowPublicProvenance: boolean;
84
+ sensitiveKeyPattern: string;
85
+ };
86
+ security: {
87
+ csp: any;
88
+ requireIntegrityForRemote: boolean;
89
+ originIsolation: boolean;
90
+ requireNonceForInline: boolean;
91
+ cookieNamespace: any;
92
+ sessionNamespace: any;
93
+ };
94
+ capability: {
95
+ allowlistRequired: boolean;
96
+ inputOutputSchemaRequired: boolean;
97
+ timeoutMsDefault: number;
98
+ cancelSupported: boolean;
99
+ serverSecretClosure: boolean;
100
+ };
101
+ budgets: {
102
+ irrelevantBindingWork: number;
103
+ irrelevantRouteRegionRebuild: number;
104
+ wholeTreeRerender: number;
105
+ maxArtifactBytes: number;
106
+ maxHtmlBytes: number;
107
+ maxClientJsBytes: number;
108
+ maxPatchCountPerTransition: number;
109
+ };
110
+ health: {
111
+ livePath: any;
112
+ readyPath: any;
113
+ gracefulShutdown: {
114
+ stopAccepting: boolean;
115
+ drainInFlight: boolean;
116
+ timeoutMs: number;
117
+ };
118
+ };
119
+ sampling: {
120
+ diagnosticSampleRate: number;
121
+ rollbackOnErrorRate: number;
122
+ latencyBudgetMs: {
123
+ p95: number;
124
+ p99: number;
125
+ };
126
+ };
127
+ };
128
+ /**
129
+ * Redact sensitive keys recursively. Never returns secrets for public provenance.
130
+ * @param {unknown} value
131
+ * @param {Record<string, any>} [policy]
132
+ * @param {{ privilege?: 'public' | 'operator' }} [opts]
133
+ */
134
+ export declare function redactSensitive(value: any, policy?: {}, opts?: {}): any;
135
+ /**
136
+ * Validate a production trace carries required facets (as event.facet or mapped kind).
137
+ * @param {unknown} raw
138
+ * @param {string[]} [requiredFacets]
139
+ */
140
+ export declare function validateProductionTrace(raw: any, requiredFacets?: readonly string[]): {
141
+ ok: boolean;
142
+ covered: unknown[];
143
+ errors: any[];
144
+ };
145
+ /**
146
+ * Build a minimal valid production trace covering all required facets (for CI assembly).
147
+ * @param {Record<string, unknown>} [meta]
148
+ */
149
+ export declare function buildCoveringProductionTrace(meta?: {}): {
150
+ schema: string;
151
+ status: string;
152
+ applicationId: any;
153
+ artifactDigest: any;
154
+ events: {
155
+ facet: string;
156
+ kind: string;
157
+ stableId: {
158
+ kind: string;
159
+ id: string;
160
+ };
161
+ generation: number;
162
+ redacted: boolean;
163
+ payload: any;
164
+ }[];
165
+ };
166
+ /**
167
+ * @param {Record<string, any>} measured
168
+ * @param {Record<string, any>} budgets
169
+ */
170
+ export declare function checkProductionBudgets(measured: any, budgets: any): {
171
+ ok: boolean;
172
+ violations: any[];
173
+ };
174
+ /**
175
+ * Validate capability production closure (allowlist + schema + timeout + secret).
176
+ * @param {Record<string, any>} cap
177
+ * @param {Record<string, any>} policy
178
+ */
179
+ export declare function checkCapabilityClosure(cap: any, policy: any): {
180
+ ok: boolean;
181
+ errors: any[];
182
+ };
183
+ /**
184
+ * Merge CSP / security headers into a CDN policy headers list (HTML matches).
185
+ * @param {Record<string, any>} cdnPolicy
186
+ * @param {Record<string, any>} security
187
+ */
188
+ export declare function applySecurityHeadersToCdnPolicy(cdnPolicy: any, security: any): any;
189
+ /**
190
+ * Measure dist sizes for budget gates.
191
+ * @param {string} distDir
192
+ */
193
+ export declare function measureDistBudgets(distDir: any): {
194
+ artifactBytes: number;
195
+ htmlBytes: number;
196
+ clientJsBytes: number;
197
+ irrelevantBindingWork: number;
198
+ irrelevantRouteRegionRebuild: number;
199
+ wholeTreeRerender: number;
200
+ patchCount: number;
201
+ };
202
+ /**
203
+ * Write observability contract (+ covering trace sample) under dist/_vmz.
204
+ * @param {string} distDir
205
+ * @param {Record<string, unknown>} [overrides]
206
+ * @param {{ applicationId?: string, artifactDigest?: string }} [meta]
207
+ */
208
+ export declare function emitProductionObservability(distDir: any, overrides?: {}, meta?: {}): {
209
+ contract: {
210
+ schema: string;
211
+ id: any;
212
+ trace: {
213
+ schema: string;
214
+ requiredFacets: any;
215
+ retainOnFailure: any;
216
+ };
217
+ redaction: {
218
+ mode: string;
219
+ replaceWith: any;
220
+ allowPublicProvenance: boolean;
221
+ sensitiveKeyPattern: string;
222
+ };
223
+ security: {
224
+ csp: any;
225
+ requireIntegrityForRemote: boolean;
226
+ originIsolation: boolean;
227
+ requireNonceForInline: boolean;
228
+ cookieNamespace: any;
229
+ sessionNamespace: any;
230
+ };
231
+ capability: {
232
+ allowlistRequired: boolean;
233
+ inputOutputSchemaRequired: boolean;
234
+ timeoutMsDefault: number;
235
+ cancelSupported: boolean;
236
+ serverSecretClosure: boolean;
237
+ };
238
+ budgets: {
239
+ irrelevantBindingWork: number;
240
+ irrelevantRouteRegionRebuild: number;
241
+ wholeTreeRerender: number;
242
+ maxArtifactBytes: number;
243
+ maxHtmlBytes: number;
244
+ maxClientJsBytes: number;
245
+ maxPatchCountPerTransition: number;
246
+ };
247
+ health: {
248
+ livePath: any;
249
+ readyPath: any;
250
+ gracefulShutdown: {
251
+ stopAccepting: boolean;
252
+ drainInFlight: boolean;
253
+ timeoutMs: number;
254
+ };
255
+ };
256
+ sampling: {
257
+ diagnosticSampleRate: number;
258
+ rollbackOnErrorRate: number;
259
+ latencyBudgetMs: {
260
+ p95: number;
261
+ p99: number;
262
+ };
263
+ };
264
+ };
265
+ trace: {
266
+ schema: string;
267
+ status: string;
268
+ applicationId: any;
269
+ artifactDigest: any;
270
+ events: {
271
+ facet: string;
272
+ kind: string;
273
+ stableId: {
274
+ kind: string;
275
+ id: string;
276
+ };
277
+ generation: number;
278
+ redacted: boolean;
279
+ payload: any;
280
+ }[];
281
+ };
282
+ contractPath: string;
283
+ tracePath: string;
284
+ };
285
+ export declare function observabilityDigest(contract: any): any;
286
+ export declare function sha256Text(text: any): string;