@kubohiroya/turbowarp-http-server 0.1.0 → 0.2.1

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 (234) hide show
  1. package/README.ja.md +29 -13
  2. package/README.md +101 -42
  3. package/dist/cli.js +131 -17
  4. package/dist/cli.js.map +1 -1
  5. package/dist/compiler/adapters/cloudflare.d.ts +2 -0
  6. package/dist/compiler/adapters/cloudflare.js +477 -0
  7. package/dist/compiler/adapters/cloudflare.js.map +1 -0
  8. package/dist/compiler/adapters/firebase.d.ts +2 -0
  9. package/dist/compiler/adapters/firebase.js +489 -0
  10. package/dist/compiler/adapters/firebase.js.map +1 -0
  11. package/dist/compiler/adapters/index.d.ts +2 -0
  12. package/dist/compiler/adapters/index.js +3 -0
  13. package/dist/compiler/adapters/index.js.map +1 -0
  14. package/dist/compiler/binary/codec.d.ts +4 -0
  15. package/dist/compiler/binary/codec.js +45 -0
  16. package/dist/compiler/binary/codec.js.map +1 -0
  17. package/dist/compiler/binary/error.d.ts +3 -0
  18. package/dist/compiler/binary/error.js +21 -0
  19. package/dist/compiler/binary/error.js.map +1 -0
  20. package/dist/compiler/binary/index.d.ts +4 -0
  21. package/dist/compiler/binary/index.js +5 -0
  22. package/dist/compiler/binary/index.js.map +1 -0
  23. package/dist/compiler/binary/runtime.d.ts +18 -0
  24. package/dist/compiler/binary/runtime.js +123 -0
  25. package/dist/compiler/binary/runtime.js.map +1 -0
  26. package/dist/compiler/binary/types.d.ts +17 -0
  27. package/dist/compiler/binary/types.js +2 -0
  28. package/dist/compiler/binary/types.js.map +1 -0
  29. package/dist/compiler/feature-flags.d.ts +4 -0
  30. package/dist/compiler/feature-flags.js +4 -0
  31. package/dist/compiler/feature-flags.js.map +1 -0
  32. package/dist/compiler/index.d.ts +35 -0
  33. package/dist/compiler/index.js +84 -0
  34. package/dist/compiler/index.js.map +1 -0
  35. package/dist/compiler/ir-v2/canonical.d.ts +3 -0
  36. package/dist/compiler/ir-v2/canonical.js +50 -0
  37. package/dist/compiler/ir-v2/canonical.js.map +1 -0
  38. package/dist/compiler/ir-v2/index.d.ts +4 -0
  39. package/dist/compiler/ir-v2/index.js +5 -0
  40. package/dist/compiler/ir-v2/index.js.map +1 -0
  41. package/dist/compiler/ir-v2/parse.d.ts +10 -0
  42. package/dist/compiler/ir-v2/parse.js +753 -0
  43. package/dist/compiler/ir-v2/parse.js.map +1 -0
  44. package/dist/compiler/ir-v2/strict-json.d.ts +4 -0
  45. package/dist/compiler/ir-v2/strict-json.js +133 -0
  46. package/dist/compiler/ir-v2/strict-json.js.map +1 -0
  47. package/dist/compiler/ir-v2/types.d.ts +412 -0
  48. package/dist/compiler/ir-v2/types.js +84 -0
  49. package/dist/compiler/ir-v2/types.js.map +1 -0
  50. package/dist/compiler/kvs/lowering.d.ts +13 -0
  51. package/dist/compiler/kvs/lowering.js +77 -0
  52. package/dist/compiler/kvs/lowering.js.map +1 -0
  53. package/dist/compiler/manifest/error.d.ts +7 -0
  54. package/dist/compiler/manifest/error.js +9 -0
  55. package/dist/compiler/manifest/error.js.map +1 -0
  56. package/dist/compiler/manifest/index.d.ts +6 -0
  57. package/dist/compiler/manifest/index.js +7 -0
  58. package/dist/compiler/manifest/index.js.map +1 -0
  59. package/dist/compiler/manifest/operations.d.ts +12 -0
  60. package/dist/compiler/manifest/operations.js +60 -0
  61. package/dist/compiler/manifest/operations.js.map +1 -0
  62. package/dist/compiler/manifest/parse.d.ts +9 -0
  63. package/dist/compiler/manifest/parse.js +280 -0
  64. package/dist/compiler/manifest/parse.js.map +1 -0
  65. package/dist/compiler/manifest/registry.d.ts +3 -0
  66. package/dist/compiler/manifest/registry.js +48 -0
  67. package/dist/compiler/manifest/registry.js.map +1 -0
  68. package/dist/compiler/manifest/resolve.d.ts +14 -0
  69. package/dist/compiler/manifest/resolve.js +116 -0
  70. package/dist/compiler/manifest/resolve.js.map +1 -0
  71. package/dist/compiler/manifest/types.d.ts +95 -0
  72. package/dist/compiler/manifest/types.js +3 -0
  73. package/dist/compiler/manifest/types.js.map +1 -0
  74. package/dist/compiler/named-body/index.d.ts +1 -0
  75. package/dist/compiler/named-body/index.js +2 -0
  76. package/dist/compiler/named-body/index.js.map +1 -0
  77. package/dist/compiler/named-body/lowering.d.ts +18 -0
  78. package/dist/compiler/named-body/lowering.js +83 -0
  79. package/dist/compiler/named-body/lowering.js.map +1 -0
  80. package/dist/compiler/pipeline/compiler.d.ts +18 -0
  81. package/dist/compiler/pipeline/compiler.js +105 -0
  82. package/dist/compiler/pipeline/compiler.js.map +1 -0
  83. package/dist/compiler/pipeline/core-generator.d.ts +3 -0
  84. package/dist/compiler/pipeline/core-generator.js +483 -0
  85. package/dist/compiler/pipeline/core-generator.js.map +1 -0
  86. package/dist/compiler/pipeline/index.d.ts +5 -0
  87. package/dist/compiler/pipeline/index.js +6 -0
  88. package/dist/compiler/pipeline/index.js.map +1 -0
  89. package/dist/compiler/pipeline/registry.d.ts +7 -0
  90. package/dist/compiler/pipeline/registry.js +17 -0
  91. package/dist/compiler/pipeline/registry.js.map +1 -0
  92. package/dist/compiler/pipeline/requirements.d.ts +9 -0
  93. package/dist/compiler/pipeline/requirements.js +135 -0
  94. package/dist/compiler/pipeline/requirements.js.map +1 -0
  95. package/dist/compiler/pipeline/types.d.ts +65 -0
  96. package/dist/compiler/pipeline/types.js +2 -0
  97. package/dist/compiler/pipeline/types.js.map +1 -0
  98. package/dist/compiler/runtime/error.d.ts +6 -0
  99. package/dist/compiler/runtime/error.js +9 -0
  100. package/dist/compiler/runtime/error.js.map +1 -0
  101. package/dist/compiler/runtime/index.d.ts +1 -0
  102. package/dist/compiler/runtime/index.js +2 -0
  103. package/dist/compiler/runtime/index.js.map +1 -0
  104. package/dist/compiler/structured-data/index.d.ts +3 -0
  105. package/dist/compiler/structured-data/index.js +4 -0
  106. package/dist/compiler/structured-data/index.js.map +1 -0
  107. package/dist/compiler/structured-data/lowering.d.ts +30 -0
  108. package/dist/compiler/structured-data/lowering.js +202 -0
  109. package/dist/compiler/structured-data/lowering.js.map +1 -0
  110. package/dist/compiler/structured-data/path.d.ts +2 -0
  111. package/dist/compiler/structured-data/path.js +60 -0
  112. package/dist/compiler/structured-data/path.js.map +1 -0
  113. package/dist/compiler/structured-data/runtime.d.ts +20 -0
  114. package/dist/compiler/structured-data/runtime.js +210 -0
  115. package/dist/compiler/structured-data/runtime.js.map +1 -0
  116. package/dist/compiler/turbowarp-v2.d.ts +8 -0
  117. package/dist/compiler/turbowarp-v2.js +479 -0
  118. package/dist/compiler/turbowarp-v2.js.map +1 -0
  119. package/dist/compiler/validator/index.d.ts +4 -0
  120. package/dist/compiler/validator/index.js +5 -0
  121. package/dist/compiler/validator/index.js.map +1 -0
  122. package/dist/compiler/validator/ir-validator.d.ts +10 -0
  123. package/dist/compiler/validator/ir-validator.js +463 -0
  124. package/dist/compiler/validator/ir-validator.js.map +1 -0
  125. package/dist/compiler/validator/resource-lifetime.d.ts +18 -0
  126. package/dist/compiler/validator/resource-lifetime.js +106 -0
  127. package/dist/compiler/validator/resource-lifetime.js.map +1 -0
  128. package/dist/compiler/validator/turbowarp-subset.d.ts +3 -0
  129. package/dist/compiler/validator/turbowarp-subset.js +241 -0
  130. package/dist/compiler/validator/turbowarp-subset.js.map +1 -0
  131. package/dist/compiler/validator/types.d.ts +30 -0
  132. package/dist/compiler/validator/types.js +7 -0
  133. package/dist/compiler/validator/types.js.map +1 -0
  134. package/dist/config.d.ts +11 -0
  135. package/dist/config.js +12 -0
  136. package/dist/config.js.map +1 -0
  137. package/dist/digest-cli.js +0 -0
  138. package/dist/extension-manifest.json +102 -0
  139. package/dist/named-body.d.ts +57 -0
  140. package/dist/named-body.js +396 -0
  141. package/dist/named-body.js.map +1 -0
  142. package/dist/named-data-namespace.d.ts +3 -0
  143. package/dist/named-data-namespace.js +6 -0
  144. package/dist/named-data-namespace.js.map +1 -0
  145. package/dist/protocol.d.ts +13 -1
  146. package/dist/protocol.js +34 -0
  147. package/dist/protocol.js.map +1 -1
  148. package/dist/resource-named-body-provider.d.ts +8 -0
  149. package/dist/resource-named-body-provider.js +88 -0
  150. package/dist/resource-named-body-provider.js.map +1 -0
  151. package/dist/server.d.ts +10 -1
  152. package/dist/server.js +37 -7
  153. package/dist/server.js.map +1 -1
  154. package/dist/turbowarp-http-server.js +516 -1
  155. package/docs/binary-resource-semantics.ja.md +84 -0
  156. package/docs/cloudflare-worker-compiler.ja.md +90 -0
  157. package/docs/compiler-manifest-registry.ja.md +79 -0
  158. package/docs/compiler-platform-pipeline.ja.md +94 -0
  159. package/docs/deploy-ir-v2.ja.md +123 -0
  160. package/docs/fixed-input-editors.ja.md +23 -0
  161. package/docs/index.html +80 -0
  162. package/docs/ir-v2-conformance.ja.md +65 -0
  163. package/docs/named-response-body.ja.md +120 -0
  164. package/docs/platform-storage-adapters.ja.md +99 -0
  165. package/docs/server-executable-subset.ja.md +88 -0
  166. package/docs/structured-data-lowering.ja.md +63 -0
  167. package/examples/compiler/message-app.v2.ir.json +41 -0
  168. package/package.json +44 -20
  169. package/schemas/block-editor-fixed-inputs.schema.json +85 -0
  170. package/schemas/compiler-extension-manifest.schema.json +126 -0
  171. package/schemas/compiler-manifest-lock-v1.schema.json +48 -0
  172. package/schemas/deploy-ir-v2.schema.json +835 -0
  173. package/schemas/ir-v2-conformance-fixture.schema.json +44 -0
  174. package/src/block-definitions.json +76 -0
  175. package/src/cli.ts +136 -23
  176. package/src/compiler/adapters/cloudflare.ts +510 -0
  177. package/src/compiler/adapters/firebase.ts +538 -0
  178. package/src/compiler/adapters/index.ts +2 -0
  179. package/src/compiler/binary/codec.ts +61 -0
  180. package/src/compiler/binary/error.ts +25 -0
  181. package/src/compiler/binary/index.ts +4 -0
  182. package/src/compiler/binary/runtime.ts +133 -0
  183. package/src/compiler/binary/types.ts +26 -0
  184. package/src/compiler/feature-flags.ts +7 -0
  185. package/src/compiler/index.ts +114 -0
  186. package/src/compiler/ir-v2/canonical.ts +46 -0
  187. package/src/compiler/ir-v2/index.ts +9 -0
  188. package/src/compiler/ir-v2/parse.ts +921 -0
  189. package/src/compiler/ir-v2/strict-json.ts +129 -0
  190. package/src/compiler/ir-v2/types.ts +462 -0
  191. package/src/compiler/kvs/lowering.ts +88 -0
  192. package/src/compiler/manifest/error.ts +29 -0
  193. package/src/compiler/manifest/index.ts +17 -0
  194. package/src/compiler/manifest/operations.ts +175 -0
  195. package/src/compiler/manifest/parse.ts +390 -0
  196. package/src/compiler/manifest/registry.ts +74 -0
  197. package/src/compiler/manifest/resolve.ts +159 -0
  198. package/src/compiler/manifest/types.ts +112 -0
  199. package/src/compiler/named-body/index.ts +1 -0
  200. package/src/compiler/named-body/lowering.ts +186 -0
  201. package/src/compiler/pipeline/compiler.ts +138 -0
  202. package/src/compiler/pipeline/core-generator.ts +486 -0
  203. package/src/compiler/pipeline/index.ts +5 -0
  204. package/src/compiler/pipeline/registry.ts +18 -0
  205. package/src/compiler/pipeline/requirements.ts +139 -0
  206. package/src/compiler/pipeline/types.ts +59 -0
  207. package/src/compiler/runtime/error.ts +11 -0
  208. package/src/compiler/runtime/index.ts +1 -0
  209. package/src/compiler/structured-data/index.ts +3 -0
  210. package/src/compiler/structured-data/lowering.ts +314 -0
  211. package/src/compiler/structured-data/path.ts +53 -0
  212. package/src/compiler/structured-data/runtime.ts +221 -0
  213. package/src/compiler/turbowarp-v2.ts +610 -0
  214. package/src/compiler/validator/index.ts +4 -0
  215. package/src/compiler/validator/ir-validator.ts +812 -0
  216. package/src/compiler/validator/resource-lifetime.ts +153 -0
  217. package/src/compiler/validator/turbowarp-subset.ts +387 -0
  218. package/src/compiler/validator/types.ts +68 -0
  219. package/src/extension.ts +87 -1
  220. package/src/fixed-input-editors.ts +181 -0
  221. package/src/fixed-input-schema.ts +15 -0
  222. package/src/named-body.ts +495 -0
  223. package/src/named-data-namespace.ts +6 -0
  224. package/src/protocol.ts +50 -1
  225. package/src/resource-named-body-provider.ts +106 -0
  226. package/src/server.ts +88 -8
  227. package/docs/turbowarp-http-server.architecture.visual-check.1440x900.dark.png +0 -0
  228. package/docs/turbowarp-http-server.architecture.visual-check.1440x900.light.png +0 -0
  229. package/docs/turbowarp-http-server.architecture.visual-check.2048x1320.dark.png +0 -0
  230. package/docs/turbowarp-http-server.architecture.visual-check.2048x1320.light.png +0 -0
  231. package/docs/turbowarp-http-server.architecture.visual-check.html +0 -32
  232. package/docs/turbowarp-http-server.architecture.visual-check.json +0 -547
  233. package/schemas/extension-manifest.schema.json +0 -49
  234. package/src/extension-manifest.ts +0 -149
@@ -0,0 +1,210 @@
1
+ import { IrRuntimeError } from '../runtime/error.js';
2
+ export const STRUCTURED_DATA_HTTP_STATUS = 422;
3
+ export const STRUCTURED_DATA_RUNTIME_ERROR_CODES = [
4
+ 'INVALID_JSON',
5
+ 'INVALID_PATH',
6
+ 'PATH_NOT_FOUND',
7
+ 'TYPE_MISMATCH',
8
+ 'INDEX_OUT_OF_RANGE',
9
+ 'ITERATION_LIMIT_EXCEEDED',
10
+ 'ITERATION_CONTEXT_REQUIRED'
11
+ ];
12
+ export function parseApplicationJson(text) {
13
+ try {
14
+ const value = JSON.parse(String(text));
15
+ assertJsonValue(value);
16
+ return value;
17
+ }
18
+ catch (error) {
19
+ if (error instanceof IrRuntimeError)
20
+ throw error;
21
+ runtimeError('INVALID_JSON', 'Input must be valid application JSON.');
22
+ }
23
+ }
24
+ export function isValidApplicationJson(text) {
25
+ try {
26
+ parseApplicationJson(text);
27
+ return true;
28
+ }
29
+ catch {
30
+ return false;
31
+ }
32
+ }
33
+ export function stringifyApplicationJson(value) {
34
+ if (Array.isArray(value))
35
+ return `[${value.map(stringifyApplicationJson).join(',')}]`;
36
+ if (isJsonObject(value)) {
37
+ return `{${Object.keys(value)
38
+ .sort(compareUnicodeCodePoints)
39
+ .map((key) => `${JSON.stringify(key)}:${stringifyApplicationJson(value[key])}`)
40
+ .join(',')}}`;
41
+ }
42
+ return JSON.stringify(value);
43
+ }
44
+ export function getJsonAtPath(root, path) {
45
+ let current = root;
46
+ for (const segment of path)
47
+ current = readSegment(current, segment);
48
+ return current;
49
+ }
50
+ export function hasJsonAtPath(root, path) {
51
+ try {
52
+ getJsonAtPath(root, path);
53
+ return true;
54
+ }
55
+ catch (error) {
56
+ if (error instanceof IrRuntimeError &&
57
+ (error.code === 'PATH_NOT_FOUND' || error.code === 'INDEX_OUT_OF_RANGE')) {
58
+ return false;
59
+ }
60
+ throw error;
61
+ }
62
+ }
63
+ export function setJsonAtPath(root, path, replacement) {
64
+ if (path.length === 0)
65
+ return cloneJson(replacement);
66
+ return updateParent(root, path, (parent, segment) => {
67
+ if (segment.kind === 'key') {
68
+ if (!isJsonObject(parent))
69
+ runtimeError('TYPE_MISMATCH', 'Object path segment requires an object.');
70
+ return { ...parent, [segment.value]: cloneJson(replacement) };
71
+ }
72
+ if (!Array.isArray(parent))
73
+ runtimeError('TYPE_MISMATCH', 'Index path segment requires an array.');
74
+ if (segment.value >= parent.length)
75
+ runtimeError('INDEX_OUT_OF_RANGE', 'Array index is out of range.');
76
+ const result = parent.slice();
77
+ result[segment.value] = cloneJson(replacement);
78
+ return result;
79
+ });
80
+ }
81
+ export function deleteJsonAtPath(root, path) {
82
+ if (path.length === 0)
83
+ runtimeError('INVALID_PATH', 'The root value cannot be deleted.');
84
+ return updateParent(root, path, (parent, segment) => {
85
+ if (segment.kind === 'key') {
86
+ if (!isJsonObject(parent))
87
+ runtimeError('TYPE_MISMATCH', 'Object path segment requires an object.');
88
+ if (!hasOwn(parent, segment.value))
89
+ runtimeError('PATH_NOT_FOUND', 'Path does not exist.');
90
+ const result = { ...parent };
91
+ delete result[segment.value];
92
+ return result;
93
+ }
94
+ if (!Array.isArray(parent))
95
+ runtimeError('TYPE_MISMATCH', 'Index path segment requires an array.');
96
+ if (segment.value >= parent.length)
97
+ runtimeError('INDEX_OUT_OF_RANGE', 'Array index is out of range.');
98
+ const result = parent.slice();
99
+ result.splice(segment.value, 1);
100
+ return result;
101
+ });
102
+ }
103
+ export function jsonKeysAtPath(root, path) {
104
+ const value = getJsonAtPath(root, path);
105
+ if (!isJsonObject(value))
106
+ runtimeError('TYPE_MISMATCH', 'Keys require an object.');
107
+ return Object.keys(value).sort(compareUnicodeCodePoints);
108
+ }
109
+ export function jsonLengthAtPath(root, path) {
110
+ const value = getJsonAtPath(root, path);
111
+ if (!Array.isArray(value))
112
+ runtimeError('TYPE_MISMATCH', 'Length requires an array.');
113
+ return value.length;
114
+ }
115
+ export function structuredIterationEntries(root, path, maximum) {
116
+ if (!Number.isInteger(maximum) || maximum < 1 || maximum > 1000) {
117
+ runtimeError('ITERATION_LIMIT_EXCEEDED', 'Maximum must be from 1 to 1000.');
118
+ }
119
+ const value = getJsonAtPath(root, path);
120
+ const entries = Array.isArray(value)
121
+ ? value.map((item, index) => ({ key: String(index), index, value: item }))
122
+ : isJsonObject(value)
123
+ ? Object.keys(value)
124
+ .sort(compareUnicodeCodePoints)
125
+ .map((key, index) => ({ key, index, value: value[key] }))
126
+ : runtimeError('TYPE_MISMATCH', 'Iteration requires an array or object.');
127
+ if (entries.length > maximum) {
128
+ runtimeError('ITERATION_LIMIT_EXCEEDED', 'Collection exceeds the declared iteration maximum.');
129
+ }
130
+ return entries;
131
+ }
132
+ export function compareUnicodeCodePoints(left, right) {
133
+ const leftPoints = Array.from(left, (character) => character.codePointAt(0));
134
+ const rightPoints = Array.from(right, (character) => character.codePointAt(0));
135
+ const length = Math.min(leftPoints.length, rightPoints.length);
136
+ for (let index = 0; index < length; index += 1) {
137
+ const difference = leftPoints[index] - rightPoints[index];
138
+ if (difference !== 0)
139
+ return difference;
140
+ }
141
+ return leftPoints.length - rightPoints.length;
142
+ }
143
+ function updateParent(root, path, update) {
144
+ const [segment, ...remaining] = path;
145
+ if (segment === undefined)
146
+ return root;
147
+ if (remaining.length === 0)
148
+ return update(root, segment);
149
+ const child = readSegment(root, segment);
150
+ const next = updateParent(child, remaining, update);
151
+ if (segment.kind === 'key') {
152
+ if (!isJsonObject(root))
153
+ runtimeError('TYPE_MISMATCH', 'Object path segment requires an object.');
154
+ return { ...root, [segment.value]: next };
155
+ }
156
+ if (!Array.isArray(root))
157
+ runtimeError('TYPE_MISMATCH', 'Index path segment requires an array.');
158
+ const result = root.slice();
159
+ result[segment.value] = next;
160
+ return result;
161
+ }
162
+ function readSegment(value, segment) {
163
+ if (segment.kind === 'key') {
164
+ if (!isJsonObject(value))
165
+ runtimeError('TYPE_MISMATCH', 'Object path segment requires an object.');
166
+ if (!hasOwn(value, segment.value))
167
+ runtimeError('PATH_NOT_FOUND', 'Path does not exist.');
168
+ return value[segment.value];
169
+ }
170
+ if (!Array.isArray(value))
171
+ runtimeError('TYPE_MISMATCH', 'Index path segment requires an array.');
172
+ if (segment.value >= value.length)
173
+ runtimeError('INDEX_OUT_OF_RANGE', 'Array index is out of range.');
174
+ return value[segment.value];
175
+ }
176
+ function cloneJson(value) {
177
+ if (Array.isArray(value))
178
+ return value.map(cloneJson);
179
+ if (isJsonObject(value)) {
180
+ return Object.fromEntries(Object.keys(value).map((key) => [key, cloneJson(value[key])]));
181
+ }
182
+ return value;
183
+ }
184
+ function assertJsonValue(value) {
185
+ if (value === null || typeof value === 'string' || typeof value === 'boolean')
186
+ return;
187
+ if (typeof value === 'number' && Number.isFinite(value))
188
+ return;
189
+ if (Array.isArray(value)) {
190
+ for (const item of value)
191
+ assertJsonValue(item);
192
+ return;
193
+ }
194
+ if (typeof value === 'object') {
195
+ for (const item of Object.values(value))
196
+ assertJsonValue(item);
197
+ return;
198
+ }
199
+ runtimeError('INVALID_JSON', 'JSON contains an unsupported value.');
200
+ }
201
+ function isJsonObject(value) {
202
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
203
+ }
204
+ function hasOwn(value, key) {
205
+ return Object.prototype.hasOwnProperty.call(value, key);
206
+ }
207
+ function runtimeError(code, message) {
208
+ throw new IrRuntimeError(code, message, STRUCTURED_DATA_HTTP_STATUS);
209
+ }
210
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+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CAAC,KAAK,CAAC;QAAE,OAAO;IAChE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,KAAK,MAAM,IAAI,IAAI,KAAK;YAAE,eAAe,CAAC,IAAI,CAAC,CAAC;QAChD,OAAO;IACT,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;YAAE,eAAe,CAAC,IAAI,CAAC,CAAC;QAC/D,OAAO;IACT,CAAC;IACD,YAAY,CAAC,cAAc,EAAE,qCAAqC,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,YAAY,CAAC,KAAgB;IACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,MAAM,CAAC,KAAa,EAAE,GAAgB;IAC7C,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,YAAY,CAAC,IAAoC,EAAE,OAAe;IACzE,MAAM,IAAI,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,2BAA2B,CAAC,CAAC;AACvE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type CompilerDiagnosticV2, type DeployIrV2 } from './ir-v2/types.js';
2
+ import type { CompilerOpcodeRegistry } from './manifest/types.js';
3
+ export interface CompileTurboWarpProjectV2Result {
4
+ ir: DeployIrV2;
5
+ diagnostics: CompilerDiagnosticV2[];
6
+ }
7
+ /** Compiles the locked server-executable TurboWarp subset directly into typed IR v2. */
8
+ export declare function compileTurboWarpProjectV2(value: unknown, registry?: CompilerOpcodeRegistry): CompileTurboWarpProjectV2Result;