@wireweave/core 4.0.0-beta.13 → 4.0.0-beta.14

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.
@@ -1,5 +1,147 @@
1
+ import { J as JsonObject, V as V4SourceSpan, P as ParsedDocument, c as CanonicalModule } from './v4-types-2ORUg6To.js';
1
2
  import { W as WireframeDocument } from './types-CGRi1k2N.js';
2
3
 
4
+ interface Diagnostic {
5
+ severity: 'error';
6
+ code: string;
7
+ phase: 'schema' | 'import' | 'link' | 'compile';
8
+ sourceId: string;
9
+ start: number;
10
+ end: number;
11
+ path: string;
12
+ messageKey: string;
13
+ details: JsonObject;
14
+ related: {
15
+ sourceId: string;
16
+ start: number;
17
+ end: number;
18
+ }[];
19
+ }
20
+ type AppResult<T> = {
21
+ ok: true;
22
+ value: T;
23
+ diagnostics: readonly [];
24
+ } | {
25
+ ok: false;
26
+ value: null;
27
+ html: null;
28
+ diagnostics: readonly Diagnostic[];
29
+ };
30
+ interface ScreenReference {
31
+ namespace: string;
32
+ id: string;
33
+ variant?: string;
34
+ }
35
+ interface CreateAppBundleOptions {
36
+ id: string;
37
+ entry: ScreenReference;
38
+ profile: JsonObject;
39
+ states: JsonObject[];
40
+ registry: ParsedDocument['registry'];
41
+ fixtures: JsonObject[];
42
+ /** Exact original module bytes. Source maps address these bytes as moduleId.wf. */
43
+ moduleSources: Readonly<Record<string, string>>;
44
+ }
45
+ declare const bundleBrand: unique symbol;
46
+ declare const linkedBrand: unique symbol;
47
+ interface AppBundle {
48
+ readonly [bundleBrand]: true;
49
+ readonly schemaVersion: '1.0.0';
50
+ readonly languageVersion: '4.0.0';
51
+ readonly id: string;
52
+ readonly entry: Readonly<ScreenReference>;
53
+ readonly profile: Readonly<JsonObject>;
54
+ readonly states: readonly JsonObject[];
55
+ readonly registry: Readonly<ParsedDocument['registry']>;
56
+ readonly fixtures: readonly JsonObject[];
57
+ readonly modules: readonly CanonicalModule[];
58
+ }
59
+ type InstanceStep = {
60
+ kind: 'use';
61
+ id: string;
62
+ } | {
63
+ kind: 'repeat';
64
+ id: string;
65
+ index: number;
66
+ };
67
+ interface LinkedIdentity {
68
+ namespace: string;
69
+ definitionKind: 'page' | 'layout' | 'component';
70
+ definitionId: string;
71
+ instanceRoot: {
72
+ kind: 'screen';
73
+ namespace: string;
74
+ id: string;
75
+ } | {
76
+ kind: 'shell';
77
+ namespace: string;
78
+ id: string;
79
+ profileDigest: string;
80
+ };
81
+ instancePath: InstanceStep[];
82
+ localId: string;
83
+ }
84
+ interface SourceMapEntry {
85
+ renderedId: string;
86
+ identity: LinkedIdentity;
87
+ moduleId: string;
88
+ source: Readonly<V4SourceSpan>;
89
+ invocationSources: readonly Readonly<V4SourceSpan>[];
90
+ requirementRefs: readonly string[];
91
+ obligationRefs: readonly string[];
92
+ operationIds: readonly string[];
93
+ }
94
+ interface LinkedApp {
95
+ readonly [linkedBrand]: true;
96
+ readonly kind: 'LinkedApp';
97
+ readonly languageVersion: '4.0.0';
98
+ readonly id: string;
99
+ readonly digest: string;
100
+ readonly sourceMap: readonly SourceMapEntry[];
101
+ }
102
+ interface AppArtifact {
103
+ readonly kind: 'AppArtifact';
104
+ readonly schemaVersion: '1.0.0';
105
+ readonly languageVersion: '4.0.0';
106
+ readonly html: string;
107
+ readonly mediaType: 'text/html';
108
+ readonly byteLength: number;
109
+ readonly digest: string;
110
+ readonly modelDigest: string;
111
+ readonly profileDigest: string;
112
+ readonly runtimeDigest: string;
113
+ readonly registryDigest: string;
114
+ readonly entry: Readonly<ScreenReference>;
115
+ readonly screenIndex: readonly {
116
+ route: ScreenReference;
117
+ renderedId: string;
118
+ }[];
119
+ readonly operationIndex: readonly {
120
+ renderedId: string;
121
+ handlerId: string;
122
+ operationId: string;
123
+ executionClass: string;
124
+ operation: JsonObject;
125
+ }[];
126
+ readonly diagnostics: readonly [];
127
+ readonly sourceMap: readonly SourceMapEntry[];
128
+ readonly manifest: {
129
+ readonly appId: string;
130
+ readonly modelDigest: string;
131
+ readonly profileDigest: string;
132
+ readonly registryDigest: string;
133
+ readonly htmlDigest: string;
134
+ readonly runtimeDigest: string;
135
+ readonly executionScope: 'standard-1';
136
+ readonly unsupportedOperations: readonly {
137
+ renderedId: string;
138
+ handlerId: string;
139
+ operationId: string;
140
+ }[];
141
+ };
142
+ }
143
+ declare function createAppBundle(documents: readonly ParsedDocument[], options: CreateAppBundleOptions): AppResult<AppBundle>;
144
+
3
145
  /**
4
146
  * Renderer type definitions for wireweave
5
147
  *
@@ -237,4 +379,4 @@ interface SiteOptions extends Pick<RenderOptions, 'theme' | 'classPrefix' | 'bac
237
379
  */
238
380
  declare function renderSite(document: WireframeDocument, options?: SiteOptions): string;
239
381
 
240
- export { type AnnotationStyle as A, type CanvasOptions as C, type PageRenderResult as P, type RenderContext as R, type SvgRenderOptions as S, type ThemeConfig as T, type RenderOptions as a, type RenderResult as b, type CanvasRenderResult as c, type SvgRenderResult as d, type SiteOptions as e, type ThemeColors as f, darkTheme as g, defaultTheme as h, getTheme as i, renderSite as r };
382
+ export { type AppResult as A, type CanvasOptions as C, type Diagnostic as D, type InstanceStep as I, type LinkedIdentity as L, type PageRenderResult as P, type RenderContext as R, type SourceMapEntry as S, type ThemeConfig as T, type ScreenReference as a, type LinkedApp as b, type RenderOptions as c, type RenderResult as d, type AnnotationStyle as e, type CanvasRenderResult as f, type SvgRenderOptions as g, type SvgRenderResult as h, type SiteOptions as i, type ThemeColors as j, darkTheme as k, defaultTheme as l, getTheme as m, type AppArtifact as n, type AppBundle as o, type CreateAppBundleOptions as p, createAppBundle as q, renderSite as r };
@@ -1,5 +1,147 @@
1
+ import { J as JsonObject, V as V4SourceSpan, P as ParsedDocument, c as CanonicalModule } from './v4-types-2ORUg6To.cjs';
1
2
  import { W as WireframeDocument } from './types-CGRi1k2N.cjs';
2
3
 
4
+ interface Diagnostic {
5
+ severity: 'error';
6
+ code: string;
7
+ phase: 'schema' | 'import' | 'link' | 'compile';
8
+ sourceId: string;
9
+ start: number;
10
+ end: number;
11
+ path: string;
12
+ messageKey: string;
13
+ details: JsonObject;
14
+ related: {
15
+ sourceId: string;
16
+ start: number;
17
+ end: number;
18
+ }[];
19
+ }
20
+ type AppResult<T> = {
21
+ ok: true;
22
+ value: T;
23
+ diagnostics: readonly [];
24
+ } | {
25
+ ok: false;
26
+ value: null;
27
+ html: null;
28
+ diagnostics: readonly Diagnostic[];
29
+ };
30
+ interface ScreenReference {
31
+ namespace: string;
32
+ id: string;
33
+ variant?: string;
34
+ }
35
+ interface CreateAppBundleOptions {
36
+ id: string;
37
+ entry: ScreenReference;
38
+ profile: JsonObject;
39
+ states: JsonObject[];
40
+ registry: ParsedDocument['registry'];
41
+ fixtures: JsonObject[];
42
+ /** Exact original module bytes. Source maps address these bytes as moduleId.wf. */
43
+ moduleSources: Readonly<Record<string, string>>;
44
+ }
45
+ declare const bundleBrand: unique symbol;
46
+ declare const linkedBrand: unique symbol;
47
+ interface AppBundle {
48
+ readonly [bundleBrand]: true;
49
+ readonly schemaVersion: '1.0.0';
50
+ readonly languageVersion: '4.0.0';
51
+ readonly id: string;
52
+ readonly entry: Readonly<ScreenReference>;
53
+ readonly profile: Readonly<JsonObject>;
54
+ readonly states: readonly JsonObject[];
55
+ readonly registry: Readonly<ParsedDocument['registry']>;
56
+ readonly fixtures: readonly JsonObject[];
57
+ readonly modules: readonly CanonicalModule[];
58
+ }
59
+ type InstanceStep = {
60
+ kind: 'use';
61
+ id: string;
62
+ } | {
63
+ kind: 'repeat';
64
+ id: string;
65
+ index: number;
66
+ };
67
+ interface LinkedIdentity {
68
+ namespace: string;
69
+ definitionKind: 'page' | 'layout' | 'component';
70
+ definitionId: string;
71
+ instanceRoot: {
72
+ kind: 'screen';
73
+ namespace: string;
74
+ id: string;
75
+ } | {
76
+ kind: 'shell';
77
+ namespace: string;
78
+ id: string;
79
+ profileDigest: string;
80
+ };
81
+ instancePath: InstanceStep[];
82
+ localId: string;
83
+ }
84
+ interface SourceMapEntry {
85
+ renderedId: string;
86
+ identity: LinkedIdentity;
87
+ moduleId: string;
88
+ source: Readonly<V4SourceSpan>;
89
+ invocationSources: readonly Readonly<V4SourceSpan>[];
90
+ requirementRefs: readonly string[];
91
+ obligationRefs: readonly string[];
92
+ operationIds: readonly string[];
93
+ }
94
+ interface LinkedApp {
95
+ readonly [linkedBrand]: true;
96
+ readonly kind: 'LinkedApp';
97
+ readonly languageVersion: '4.0.0';
98
+ readonly id: string;
99
+ readonly digest: string;
100
+ readonly sourceMap: readonly SourceMapEntry[];
101
+ }
102
+ interface AppArtifact {
103
+ readonly kind: 'AppArtifact';
104
+ readonly schemaVersion: '1.0.0';
105
+ readonly languageVersion: '4.0.0';
106
+ readonly html: string;
107
+ readonly mediaType: 'text/html';
108
+ readonly byteLength: number;
109
+ readonly digest: string;
110
+ readonly modelDigest: string;
111
+ readonly profileDigest: string;
112
+ readonly runtimeDigest: string;
113
+ readonly registryDigest: string;
114
+ readonly entry: Readonly<ScreenReference>;
115
+ readonly screenIndex: readonly {
116
+ route: ScreenReference;
117
+ renderedId: string;
118
+ }[];
119
+ readonly operationIndex: readonly {
120
+ renderedId: string;
121
+ handlerId: string;
122
+ operationId: string;
123
+ executionClass: string;
124
+ operation: JsonObject;
125
+ }[];
126
+ readonly diagnostics: readonly [];
127
+ readonly sourceMap: readonly SourceMapEntry[];
128
+ readonly manifest: {
129
+ readonly appId: string;
130
+ readonly modelDigest: string;
131
+ readonly profileDigest: string;
132
+ readonly registryDigest: string;
133
+ readonly htmlDigest: string;
134
+ readonly runtimeDigest: string;
135
+ readonly executionScope: 'standard-1';
136
+ readonly unsupportedOperations: readonly {
137
+ renderedId: string;
138
+ handlerId: string;
139
+ operationId: string;
140
+ }[];
141
+ };
142
+ }
143
+ declare function createAppBundle(documents: readonly ParsedDocument[], options: CreateAppBundleOptions): AppResult<AppBundle>;
144
+
3
145
  /**
4
146
  * Renderer type definitions for wireweave
5
147
  *
@@ -237,4 +379,4 @@ interface SiteOptions extends Pick<RenderOptions, 'theme' | 'classPrefix' | 'bac
237
379
  */
238
380
  declare function renderSite(document: WireframeDocument, options?: SiteOptions): string;
239
381
 
240
- export { type AnnotationStyle as A, type CanvasOptions as C, type PageRenderResult as P, type RenderContext as R, type SvgRenderOptions as S, type ThemeConfig as T, type RenderOptions as a, type RenderResult as b, type CanvasRenderResult as c, type SvgRenderResult as d, type SiteOptions as e, type ThemeColors as f, darkTheme as g, defaultTheme as h, getTheme as i, renderSite as r };
382
+ export { type AppResult as A, type CanvasOptions as C, type Diagnostic as D, type InstanceStep as I, type LinkedIdentity as L, type PageRenderResult as P, type RenderContext as R, type SourceMapEntry as S, type ThemeConfig as T, type ScreenReference as a, type LinkedApp as b, type RenderOptions as c, type RenderResult as d, type AnnotationStyle as e, type CanvasRenderResult as f, type SvgRenderOptions as g, type SvgRenderResult as h, type SiteOptions as i, type ThemeColors as j, darkTheme as k, defaultTheme as l, getTheme as m, type AppArtifact as n, type AppBundle as o, type CreateAppBundleOptions as p, createAppBundle as q, renderSite as r };