@riebeckite/runtime 0.0.0-stage → 0.0.37
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.
- package/LICENSE +201 -0
- package/README.md +97 -2
- package/README_ja.md +100 -0
- package/dist/client.d.ts +8 -0
- package/dist/client.js +1343 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +617 -0
- package/dist/src/client/errors.d.ts +2 -0
- package/dist/src/client/fallback.d.ts +7 -0
- package/dist/src/client/host.d.ts +10 -0
- package/dist/src/client/iframe.d.ts +16 -0
- package/dist/src/client/main.d.ts +19 -0
- package/dist/src/client/wasm_worker.d.ts +12 -0
- package/dist/src/client/worker.d.ts +31 -0
- package/dist/src/core/abort.d.ts +1 -0
- package/dist/src/core/errors.d.ts +44 -0
- package/dist/src/core/instance.d.ts +32 -0
- package/dist/src/core/outcome.d.ts +7 -0
- package/dist/src/core/payload.d.ts +6 -0
- package/dist/src/core/protocol.d.ts +26 -0
- package/dist/src/core/registry.d.ts +17 -0
- package/dist/src/core/types.d.ts +77 -0
- package/dist/worker.d.ts +37 -0
- package/dist/worker.js +438 -0
- package/package.json +66 -3
package/dist/worker.js
ADDED
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
// src/core/errors.ts
|
|
2
|
+
var RuntimeError = class extends Error {
|
|
3
|
+
constructor(message, options) {
|
|
4
|
+
super(message, options);
|
|
5
|
+
this.name = "RuntimeError";
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
var RuntimeStateError = class extends RuntimeError {
|
|
9
|
+
constructor(message) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.name = "RuntimeStateError";
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
var RuntimeFailureError = class extends RuntimeStateError {
|
|
15
|
+
constructor(message, options) {
|
|
16
|
+
super(message);
|
|
17
|
+
this.name = "RuntimeFailureError";
|
|
18
|
+
if (options?.cause !== void 0) this.cause = options.cause;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var RuntimeAbortError = class extends RuntimeError {
|
|
22
|
+
constructor(message = "Interactive runtime operation was aborted.") {
|
|
23
|
+
super(message);
|
|
24
|
+
this.name = "RuntimeAbortError";
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var RuntimePayloadError = class extends RuntimeError {
|
|
28
|
+
constructor(message) {
|
|
29
|
+
super(message);
|
|
30
|
+
this.name = "RuntimePayloadError";
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var RuntimeConcurrencyError = class extends RuntimeError {
|
|
34
|
+
constructor(message) {
|
|
35
|
+
super(message);
|
|
36
|
+
this.name = "RuntimeConcurrencyError";
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var RuntimeWasmError = class extends RuntimeError {
|
|
40
|
+
trap;
|
|
41
|
+
constructor(message, options) {
|
|
42
|
+
super(message, options);
|
|
43
|
+
this.name = "RuntimeWasmError";
|
|
44
|
+
this.trap = options?.trap ?? false;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var RuntimeUnsupportedError = class extends RuntimeError {
|
|
48
|
+
constructor(message) {
|
|
49
|
+
super(message);
|
|
50
|
+
this.name = "RuntimeUnsupportedError";
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// src/core/outcome.ts
|
|
55
|
+
var RuntimeTransfer = class {
|
|
56
|
+
constructor(value, transfer = []) {
|
|
57
|
+
this.value = value;
|
|
58
|
+
this.transfer = transfer;
|
|
59
|
+
}
|
|
60
|
+
value;
|
|
61
|
+
transfer;
|
|
62
|
+
};
|
|
63
|
+
function isRuntimeTransfer(value) {
|
|
64
|
+
return value instanceof RuntimeTransfer;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// src/core/payload.ts
|
|
68
|
+
var MAX_DEPTH = 16;
|
|
69
|
+
var MAX_ENTRIES = 1e5;
|
|
70
|
+
var encoder = new TextEncoder();
|
|
71
|
+
function estimatePayloadSize(value) {
|
|
72
|
+
return estimate(value, 0, { entries: 0 }, /* @__PURE__ */ new WeakSet());
|
|
73
|
+
}
|
|
74
|
+
function assertPayloadSize(value, limit, label) {
|
|
75
|
+
if (limit <= 0) return;
|
|
76
|
+
const size = estimatePayloadSize(value);
|
|
77
|
+
if (size > limit) {
|
|
78
|
+
throw new RuntimePayloadError(
|
|
79
|
+
`${label} is ${size} bytes, exceeding the ${limit} byte runtime limit.`
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function estimate(value, depth, counter, ancestors) {
|
|
84
|
+
counter.entries += 1;
|
|
85
|
+
if (counter.entries > MAX_ENTRIES) {
|
|
86
|
+
throw new RuntimePayloadError(
|
|
87
|
+
"Runtime payload contains too many entries to measure."
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
if (value === void 0 || value === null) return 0;
|
|
91
|
+
if (typeof value === "string") return encoder.encode(value).byteLength;
|
|
92
|
+
if (typeof value === "number") return 8;
|
|
93
|
+
if (typeof value === "boolean") return 1;
|
|
94
|
+
if (typeof value === "bigint") return 16;
|
|
95
|
+
if (typeof value === "function" || typeof value === "symbol") {
|
|
96
|
+
throw new RuntimePayloadError(
|
|
97
|
+
"Runtime payload is not structured-cloneable."
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
if (value instanceof ArrayBuffer) return value.byteLength;
|
|
101
|
+
if (ArrayBuffer.isView(value)) return value.byteLength;
|
|
102
|
+
if (value instanceof Date) return 8;
|
|
103
|
+
if (depth >= MAX_DEPTH) {
|
|
104
|
+
throw new RuntimePayloadError("Runtime payload is nested too deeply.");
|
|
105
|
+
}
|
|
106
|
+
const objectValue = value;
|
|
107
|
+
if (ancestors.has(objectValue)) {
|
|
108
|
+
throw new RuntimePayloadError("Runtime payload must not contain cycles.");
|
|
109
|
+
}
|
|
110
|
+
ancestors.add(objectValue);
|
|
111
|
+
let total = 0;
|
|
112
|
+
if (value instanceof Map) {
|
|
113
|
+
for (const [key, item] of value) {
|
|
114
|
+
total += estimate(key, depth + 1, counter, ancestors);
|
|
115
|
+
total += estimate(item, depth + 1, counter, ancestors);
|
|
116
|
+
}
|
|
117
|
+
} else if (value instanceof Set) {
|
|
118
|
+
for (const item of value) {
|
|
119
|
+
total += estimate(item, depth + 1, counter, ancestors);
|
|
120
|
+
}
|
|
121
|
+
} else if (Array.isArray(value)) {
|
|
122
|
+
for (const item of value) {
|
|
123
|
+
total += estimate(item, depth + 1, counter, ancestors);
|
|
124
|
+
}
|
|
125
|
+
} else {
|
|
126
|
+
for (const key of Object.keys(value)) {
|
|
127
|
+
total += encoder.encode(key).byteLength;
|
|
128
|
+
total += estimate(
|
|
129
|
+
value[key],
|
|
130
|
+
depth + 1,
|
|
131
|
+
counter,
|
|
132
|
+
ancestors
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
ancestors.delete(objectValue);
|
|
137
|
+
return total;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// src/core/protocol.ts
|
|
141
|
+
var RUNTIME_PROTOCOL = "riebeckite:runtime";
|
|
142
|
+
var RUNTIME_PROTOCOL_VERSION = 1;
|
|
143
|
+
var RUNTIME_MESSAGE_KINDS = [
|
|
144
|
+
"init",
|
|
145
|
+
"invoke",
|
|
146
|
+
"cancel",
|
|
147
|
+
"ready",
|
|
148
|
+
"result",
|
|
149
|
+
"error",
|
|
150
|
+
"fatal",
|
|
151
|
+
"dispose"
|
|
152
|
+
];
|
|
153
|
+
function isRuntimeMessage(value) {
|
|
154
|
+
if (!value || typeof value !== "object") return false;
|
|
155
|
+
const message = value;
|
|
156
|
+
if (message.protocol !== RUNTIME_PROTOCOL) return false;
|
|
157
|
+
if (message.version !== RUNTIME_PROTOCOL_VERSION) return false;
|
|
158
|
+
if (typeof message.instanceId !== "string") return false;
|
|
159
|
+
return RUNTIME_MESSAGE_KINDS.includes(message.kind);
|
|
160
|
+
}
|
|
161
|
+
function serializeRuntimeError(error) {
|
|
162
|
+
if (error instanceof Error) {
|
|
163
|
+
const details = error;
|
|
164
|
+
return {
|
|
165
|
+
name: error.name,
|
|
166
|
+
message: error.message,
|
|
167
|
+
kind: typeof details.kind === "string" ? details.kind : void 0,
|
|
168
|
+
trap: details.trap === true,
|
|
169
|
+
stack: error.stack
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
name: "Error",
|
|
174
|
+
message: typeof error === "string" ? error : "Unknown runtime error."
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// worker.ts
|
|
179
|
+
function serveWorkerRuntime(scope, handler) {
|
|
180
|
+
let instanceId;
|
|
181
|
+
let initialized = false;
|
|
182
|
+
let failed = false;
|
|
183
|
+
let disposed = false;
|
|
184
|
+
let limits = {};
|
|
185
|
+
const active = /* @__PURE__ */ new Map();
|
|
186
|
+
const post = (message, transfer) => {
|
|
187
|
+
scope.postMessage(message, transfer);
|
|
188
|
+
};
|
|
189
|
+
const fatal = (error) => {
|
|
190
|
+
failed = true;
|
|
191
|
+
post({
|
|
192
|
+
protocol: RUNTIME_PROTOCOL,
|
|
193
|
+
version: RUNTIME_PROTOCOL_VERSION,
|
|
194
|
+
instanceId: instanceId ?? "",
|
|
195
|
+
kind: "fatal",
|
|
196
|
+
error: serializeRuntimeError(error)
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
const onMessage = (event) => {
|
|
200
|
+
const message = event.data;
|
|
201
|
+
if (!isRuntimeMessage(message)) return;
|
|
202
|
+
if (disposed || failed) return;
|
|
203
|
+
if (message.kind === "init") {
|
|
204
|
+
if (initialized) return;
|
|
205
|
+
if (!message.instanceId) return;
|
|
206
|
+
instanceId = message.instanceId;
|
|
207
|
+
limits = message.limits ?? {};
|
|
208
|
+
void initialize(message).catch(fatal);
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (!initialized || message.instanceId !== instanceId) return;
|
|
212
|
+
switch (message.kind) {
|
|
213
|
+
case "invoke":
|
|
214
|
+
void invokeMessage(message);
|
|
215
|
+
break;
|
|
216
|
+
case "cancel": {
|
|
217
|
+
if (message.requestId === void 0) return;
|
|
218
|
+
active.get(message.requestId)?.abort(
|
|
219
|
+
new RuntimeAbortError("Worker runtime request was cancelled.")
|
|
220
|
+
);
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
case "dispose":
|
|
224
|
+
void dispose();
|
|
225
|
+
break;
|
|
226
|
+
default:
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
const initialize = async (message) => {
|
|
231
|
+
try {
|
|
232
|
+
await handler.initialize?.(message.payload, {
|
|
233
|
+
instanceId: message.instanceId,
|
|
234
|
+
signal: new AbortController().signal
|
|
235
|
+
});
|
|
236
|
+
initialized = true;
|
|
237
|
+
post({
|
|
238
|
+
protocol: RUNTIME_PROTOCOL,
|
|
239
|
+
version: RUNTIME_PROTOCOL_VERSION,
|
|
240
|
+
instanceId: message.instanceId,
|
|
241
|
+
kind: "ready"
|
|
242
|
+
});
|
|
243
|
+
} catch (error) {
|
|
244
|
+
fatal(error);
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
const invokeMessage = async (message) => {
|
|
248
|
+
const requestId = message.requestId;
|
|
249
|
+
if (requestId === void 0 || active.has(requestId)) return;
|
|
250
|
+
const maxConcurrent = limits.maxConcurrent ?? 16;
|
|
251
|
+
if (active.size >= maxConcurrent) {
|
|
252
|
+
post({
|
|
253
|
+
protocol: RUNTIME_PROTOCOL,
|
|
254
|
+
version: RUNTIME_PROTOCOL_VERSION,
|
|
255
|
+
instanceId: instanceId ?? "",
|
|
256
|
+
kind: "error",
|
|
257
|
+
requestId,
|
|
258
|
+
error: serializeRuntimeError(
|
|
259
|
+
new RuntimeConcurrencyError(
|
|
260
|
+
`Worker runtime rejected a request: ${active.size} requests are already in flight.`
|
|
261
|
+
)
|
|
262
|
+
)
|
|
263
|
+
});
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
const controller = new AbortController();
|
|
267
|
+
active.set(requestId, controller);
|
|
268
|
+
try {
|
|
269
|
+
const result = await handler.invoke(message.payload, {
|
|
270
|
+
instanceId: instanceId ?? "",
|
|
271
|
+
requestId,
|
|
272
|
+
signal: controller.signal,
|
|
273
|
+
capability: message.capability
|
|
274
|
+
});
|
|
275
|
+
if (controller.signal.aborted) return;
|
|
276
|
+
const value = isRuntimeTransfer(result) ? result.value : result;
|
|
277
|
+
assertPayloadSize(
|
|
278
|
+
value,
|
|
279
|
+
limits.maxOutputBytes ?? 16 * 1024 * 1024,
|
|
280
|
+
"Worker runtime output"
|
|
281
|
+
);
|
|
282
|
+
const transfer = isRuntimeTransfer(result) ? result.transfer : [];
|
|
283
|
+
post(
|
|
284
|
+
{
|
|
285
|
+
protocol: RUNTIME_PROTOCOL,
|
|
286
|
+
version: RUNTIME_PROTOCOL_VERSION,
|
|
287
|
+
instanceId: instanceId ?? "",
|
|
288
|
+
kind: "result",
|
|
289
|
+
requestId,
|
|
290
|
+
payload: value,
|
|
291
|
+
transfer: transfer.length > 0 ? transfer : void 0
|
|
292
|
+
},
|
|
293
|
+
transfer.length > 0 ? [...transfer] : void 0
|
|
294
|
+
);
|
|
295
|
+
} catch (error) {
|
|
296
|
+
if (controller.signal.aborted) return;
|
|
297
|
+
if (error instanceof RuntimeFailureError) {
|
|
298
|
+
fatal(error);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
post({
|
|
302
|
+
protocol: RUNTIME_PROTOCOL,
|
|
303
|
+
version: RUNTIME_PROTOCOL_VERSION,
|
|
304
|
+
instanceId: instanceId ?? "",
|
|
305
|
+
kind: "error",
|
|
306
|
+
requestId,
|
|
307
|
+
error: serializeRuntimeError(error)
|
|
308
|
+
});
|
|
309
|
+
} finally {
|
|
310
|
+
active.delete(requestId);
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
const abortAll = () => {
|
|
314
|
+
for (const controller of active.values()) {
|
|
315
|
+
controller.abort(new RuntimeAbortError("Worker runtime was disposed."));
|
|
316
|
+
}
|
|
317
|
+
active.clear();
|
|
318
|
+
};
|
|
319
|
+
const dispose = async () => {
|
|
320
|
+
if (disposed) return;
|
|
321
|
+
disposed = true;
|
|
322
|
+
abortAll();
|
|
323
|
+
try {
|
|
324
|
+
await handler.dispose?.();
|
|
325
|
+
} catch {
|
|
326
|
+
return;
|
|
327
|
+
} finally {
|
|
328
|
+
scope.removeEventListener("message", onMessage);
|
|
329
|
+
scope.close?.();
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
scope.addEventListener("message", onMessage);
|
|
333
|
+
return () => {
|
|
334
|
+
void dispose();
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
function serveWasmWorkerRuntime(scope, options = {}) {
|
|
338
|
+
let exportFunction;
|
|
339
|
+
let instance;
|
|
340
|
+
return serveWorkerRuntime(scope, {
|
|
341
|
+
async initialize(init) {
|
|
342
|
+
const config = parseWasmInit(init);
|
|
343
|
+
if (typeof WebAssembly === "undefined") {
|
|
344
|
+
throw new RuntimeUnsupportedError(
|
|
345
|
+
"This browser does not support WebAssembly."
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
const base = globalThis.location?.href ?? "http://localhost/";
|
|
349
|
+
const url = new URL(config.wasmUrl, base);
|
|
350
|
+
if (!options.allowCrossOrigin && url.origin !== new URL(base).origin) {
|
|
351
|
+
throw new RuntimeWasmError(
|
|
352
|
+
`WASM asset "${config.wasmUrl}" must be served from the same origin.`
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
const loaded = await loadWasm(url, options);
|
|
356
|
+
instance = loaded.instance;
|
|
357
|
+
const candidate = instance.exports[config.exportName];
|
|
358
|
+
if (typeof candidate !== "function") {
|
|
359
|
+
throw new RuntimeWasmError(
|
|
360
|
+
`WASM module does not export the "${config.exportName}" function.`
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
exportFunction = candidate;
|
|
364
|
+
},
|
|
365
|
+
invoke(input) {
|
|
366
|
+
if (!exportFunction) {
|
|
367
|
+
throw new RuntimeWasmError("WASM module is not initialized.");
|
|
368
|
+
}
|
|
369
|
+
const args = Array.isArray(input) ? input : [input];
|
|
370
|
+
try {
|
|
371
|
+
return Reflect.apply(exportFunction, void 0, args);
|
|
372
|
+
} catch (error) {
|
|
373
|
+
if (isWasmTrap(error)) {
|
|
374
|
+
throw new RuntimeWasmError("WASM module trapped during execution.", {
|
|
375
|
+
trap: true,
|
|
376
|
+
cause: error
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
throw error;
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
dispose() {
|
|
383
|
+
exportFunction = void 0;
|
|
384
|
+
instance = void 0;
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
async function loadWasm(url, options) {
|
|
389
|
+
const fetcher = options.fetch ?? globalThis.fetch;
|
|
390
|
+
if (!fetcher) {
|
|
391
|
+
throw new RuntimeUnsupportedError(
|
|
392
|
+
"Fetch is unavailable; the WASM asset cannot be loaded."
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
const imports = options.imports ?? {};
|
|
396
|
+
const response = await fetcher(url);
|
|
397
|
+
if (!response.ok) {
|
|
398
|
+
throw new RuntimeWasmError(
|
|
399
|
+
`WASM asset "${url.pathname}" responded with ${response.status}.`
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
if (options.streaming !== false && typeof WebAssembly.instantiateStreaming === "function") {
|
|
403
|
+
try {
|
|
404
|
+
return await WebAssembly.instantiateStreaming(response.clone(), imports);
|
|
405
|
+
} catch {
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
const bytes = await response.arrayBuffer();
|
|
409
|
+
try {
|
|
410
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
411
|
+
} catch (error) {
|
|
412
|
+
throw new RuntimeWasmError(
|
|
413
|
+
"WASM module could not be compiled; check the content type and CSP.",
|
|
414
|
+
{ cause: error }
|
|
415
|
+
);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
function parseWasmInit(init) {
|
|
419
|
+
if (!init || typeof init !== "object") {
|
|
420
|
+
throw new RuntimeWasmError("WASM runtime init payload is missing.");
|
|
421
|
+
}
|
|
422
|
+
const config = init;
|
|
423
|
+
if (typeof config.wasmUrl !== "string" || !config.wasmUrl) {
|
|
424
|
+
throw new RuntimeWasmError("WASM runtime init requires a wasmUrl.");
|
|
425
|
+
}
|
|
426
|
+
if (typeof config.exportName !== "string" || !config.exportName) {
|
|
427
|
+
throw new RuntimeWasmError("WASM runtime init requires an exportName.");
|
|
428
|
+
}
|
|
429
|
+
return { wasmUrl: config.wasmUrl, exportName: config.exportName };
|
|
430
|
+
}
|
|
431
|
+
function isWasmTrap(error) {
|
|
432
|
+
if (error instanceof Error && error.name === "RuntimeError") return true;
|
|
433
|
+
return typeof WebAssembly !== "undefined" && typeof WebAssembly.RuntimeError === "function" && error instanceof WebAssembly.RuntimeError;
|
|
434
|
+
}
|
|
435
|
+
export {
|
|
436
|
+
serveWasmWorkerRuntime,
|
|
437
|
+
serveWorkerRuntime
|
|
438
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,69 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/runtime",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.0.37",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"source": "./index.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./client": {
|
|
16
|
+
"types": "./dist/client.d.ts",
|
|
17
|
+
"import": "./dist/client.js",
|
|
18
|
+
"source": "./client.ts",
|
|
19
|
+
"default": "./dist/client.js"
|
|
20
|
+
},
|
|
21
|
+
"./worker": {
|
|
22
|
+
"types": "./dist/worker.d.ts",
|
|
23
|
+
"import": "./dist/worker.js",
|
|
24
|
+
"source": "./worker.ts",
|
|
25
|
+
"default": "./dist/worker.js"
|
|
26
|
+
},
|
|
27
|
+
"./package.json": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"LICENSE",
|
|
31
|
+
"README.md",
|
|
32
|
+
"README_ja.md",
|
|
33
|
+
"dist"
|
|
34
|
+
],
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@riebeckite/core": "0.0.37"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"tsx": "^4.22.4"
|
|
43
|
+
},
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "https://github.com/Rerurate514/riebeckite.git",
|
|
47
|
+
"directory": "packages/runtime"
|
|
48
|
+
},
|
|
49
|
+
"homepage": "https://github.com/Rerurate514/riebeckite#readme",
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/Rerurate514/riebeckite/issues"
|
|
52
|
+
},
|
|
53
|
+
"description": "Typed interactive runtime contracts for Riebeckite main-thread, worker, WASM worker, and sandboxed iframe execution.",
|
|
54
|
+
"keywords": [
|
|
55
|
+
"riebeckite",
|
|
56
|
+
"runtime",
|
|
57
|
+
"web-worker",
|
|
58
|
+
"wasm",
|
|
59
|
+
"sandbox"
|
|
60
|
+
],
|
|
61
|
+
"engines": {
|
|
62
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
63
|
+
},
|
|
64
|
+
"sideEffects": false,
|
|
65
|
+
"scripts": {
|
|
66
|
+
"build": "node ../../scripts/build_package.mjs",
|
|
67
|
+
"test": "node --import tsx --test \"test/*.test.ts\""
|
|
68
|
+
}
|
|
6
69
|
}
|