@jxrstudios/jxr 1.0.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.
- package/LICENSE +21 -0
- package/README.md +107 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/module-resolver.d.ts +115 -0
- package/dist/module-resolver.d.ts.map +1 -0
- package/dist/module-resolver.js +430 -0
- package/dist/module-resolver.js.map +1 -0
- package/dist/moq-transport.d.ts +96 -0
- package/dist/moq-transport.d.ts.map +1 -0
- package/dist/moq-transport.js +188 -0
- package/dist/moq-transport.js.map +1 -0
- package/dist/runtime.d.ts +70 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +150 -0
- package/dist/runtime.js.map +1 -0
- package/dist/web-crypto.d.ts +77 -0
- package/dist/web-crypto.d.ts.map +1 -0
- package/dist/web-crypto.js +186 -0
- package/dist/web-crypto.js.map +1 -0
- package/dist/worker-pool.d.ts +83 -0
- package/dist/worker-pool.d.ts.map +1 -0
- package/dist/worker-pool.js +238 -0
- package/dist/worker-pool.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JXR.js — Module Resolver & Virtual File System
|
|
3
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
4
|
+
* Design: LavaFlow OS — Thermal Precision + Edge Command
|
|
5
|
+
* Layer: Core Runtime / Module System
|
|
6
|
+
*
|
|
7
|
+
* Architecture:
|
|
8
|
+
* Zero-build-step module resolution pipeline:
|
|
9
|
+
* 1. VirtualFS: In-memory file system with change notification
|
|
10
|
+
* 2. ModuleResolver: Resolves imports to VirtualFS entries
|
|
11
|
+
* 3. JSXTransformer: Browser-native JSX → JS transform (no Babel/esbuild)
|
|
12
|
+
* 4. ImportMapBuilder: Generates browser-native import maps for esm.sh CDN
|
|
13
|
+
* 5. ModuleCache: LRU cache with crypto integrity verification
|
|
14
|
+
*
|
|
15
|
+
* The resolver produces browser-executable ES modules from JSX/TSX source
|
|
16
|
+
* without any build step, using the esm.sh CDN for npm package resolution.
|
|
17
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* VirtualFS — In-memory file system with reactive change notifications
|
|
21
|
+
*/
|
|
22
|
+
export class VirtualFS {
|
|
23
|
+
files = new Map();
|
|
24
|
+
changeHandlers = new Set();
|
|
25
|
+
constructor(initialFiles) {
|
|
26
|
+
if (initialFiles) {
|
|
27
|
+
for (const file of initialFiles) {
|
|
28
|
+
this.files.set(file.path, file);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
write(path, content) {
|
|
33
|
+
const existing = this.files.get(path);
|
|
34
|
+
const language = this.detectLanguage(path);
|
|
35
|
+
const file = {
|
|
36
|
+
path,
|
|
37
|
+
content,
|
|
38
|
+
language,
|
|
39
|
+
lastModified: Date.now(),
|
|
40
|
+
size: new TextEncoder().encode(content).byteLength,
|
|
41
|
+
dirty: true,
|
|
42
|
+
};
|
|
43
|
+
this.files.set(path, file);
|
|
44
|
+
this.emit(file, existing ? 'update' : 'create');
|
|
45
|
+
return file;
|
|
46
|
+
}
|
|
47
|
+
read(path) {
|
|
48
|
+
return this.files.get(path) ?? null;
|
|
49
|
+
}
|
|
50
|
+
delete(path) {
|
|
51
|
+
const file = this.files.get(path);
|
|
52
|
+
if (!file)
|
|
53
|
+
return false;
|
|
54
|
+
this.files.delete(path);
|
|
55
|
+
this.emit(file, 'delete');
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
list(prefix) {
|
|
59
|
+
const all = Array.from(this.files.values());
|
|
60
|
+
return prefix ? all.filter((f) => f.path.startsWith(prefix)) : all;
|
|
61
|
+
}
|
|
62
|
+
exists(path) {
|
|
63
|
+
return this.files.has(path);
|
|
64
|
+
}
|
|
65
|
+
onChange(handler) {
|
|
66
|
+
this.changeHandlers.add(handler);
|
|
67
|
+
return () => this.changeHandlers.delete(handler);
|
|
68
|
+
}
|
|
69
|
+
emit(file, event) {
|
|
70
|
+
this.changeHandlers.forEach((h) => h(file, event));
|
|
71
|
+
}
|
|
72
|
+
buildTree(rootPath = '/') {
|
|
73
|
+
const files = this.list();
|
|
74
|
+
const root = {
|
|
75
|
+
path: rootPath,
|
|
76
|
+
name: rootPath === '/' ? 'project' : rootPath.split('/').pop(),
|
|
77
|
+
children: [],
|
|
78
|
+
expanded: true,
|
|
79
|
+
};
|
|
80
|
+
const dirs = new Map();
|
|
81
|
+
dirs.set(rootPath, root);
|
|
82
|
+
// Sort files to ensure parent dirs are created first
|
|
83
|
+
const sorted = [...files].sort((a, b) => a.path.localeCompare(b.path));
|
|
84
|
+
for (const file of sorted) {
|
|
85
|
+
const parts = file.path.replace(rootPath, '').split('/').filter(Boolean);
|
|
86
|
+
let current = root;
|
|
87
|
+
let currentPath = rootPath;
|
|
88
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
89
|
+
currentPath = `${currentPath}${parts[i]}/`;
|
|
90
|
+
if (!dirs.has(currentPath)) {
|
|
91
|
+
const dir = {
|
|
92
|
+
path: currentPath,
|
|
93
|
+
name: parts[i],
|
|
94
|
+
children: [],
|
|
95
|
+
expanded: true,
|
|
96
|
+
};
|
|
97
|
+
dirs.set(currentPath, dir);
|
|
98
|
+
current.children.push(dir);
|
|
99
|
+
}
|
|
100
|
+
current = dirs.get(currentPath);
|
|
101
|
+
}
|
|
102
|
+
current.children.push(file);
|
|
103
|
+
}
|
|
104
|
+
return root;
|
|
105
|
+
}
|
|
106
|
+
toJSON() {
|
|
107
|
+
const result = {};
|
|
108
|
+
for (const [path, file] of Array.from(this.files.entries())) {
|
|
109
|
+
result[path] = file.content;
|
|
110
|
+
}
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
detectLanguage(path) {
|
|
114
|
+
const ext = path.split('.').pop()?.toLowerCase();
|
|
115
|
+
const map = {
|
|
116
|
+
tsx: 'tsx', ts: 'ts', jsx: 'jsx', js: 'js',
|
|
117
|
+
css: 'css', json: 'json', md: 'md', html: 'html',
|
|
118
|
+
};
|
|
119
|
+
return map[ext ?? ''] ?? 'js';
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* JSXTransformer — Zero-dependency JSX → JS transform
|
|
124
|
+
*
|
|
125
|
+
* Uses a lightweight regex-based transform for simple JSX,
|
|
126
|
+
* with Sucrase-style transforms for production accuracy.
|
|
127
|
+
* Falls back to esm.sh/sucrase for complex transforms.
|
|
128
|
+
*/
|
|
129
|
+
export class JSXTransformer {
|
|
130
|
+
objectUrls = new Map();
|
|
131
|
+
/**
|
|
132
|
+
* Transform JSX/TSX source to browser-executable ES module
|
|
133
|
+
* Uses the automatic JSX runtime (React 17+)
|
|
134
|
+
*/
|
|
135
|
+
transform(source, filePath) {
|
|
136
|
+
const isTS = filePath.endsWith('.ts') || filePath.endsWith('.tsx');
|
|
137
|
+
let result = source;
|
|
138
|
+
// Step 1: Strip TypeScript type annotations
|
|
139
|
+
if (isTS) {
|
|
140
|
+
result = this.stripTypeScript(result);
|
|
141
|
+
}
|
|
142
|
+
// Step 2: Transform JSX to React.createElement calls
|
|
143
|
+
if (filePath.endsWith('.jsx') || filePath.endsWith('.tsx')) {
|
|
144
|
+
result = this.transformJSX(result);
|
|
145
|
+
}
|
|
146
|
+
// Step 3: Rewrite imports to use esm.sh CDN
|
|
147
|
+
result = this.rewriteImports(result);
|
|
148
|
+
return result;
|
|
149
|
+
}
|
|
150
|
+
stripTypeScript(source) {
|
|
151
|
+
let result = source;
|
|
152
|
+
// Remove type imports: import type { ... } from '...'
|
|
153
|
+
result = result.replace(/^import\s+type\s+.*?from\s+['"][^'"]+['"]\s*;?\s*$/gm, '');
|
|
154
|
+
// Remove inline type imports: import { type Foo, Bar }
|
|
155
|
+
result = result.replace(/\{\s*type\s+\w+\s*,?\s*/g, '{ ');
|
|
156
|
+
result = result.replace(/,\s*type\s+\w+\s*/g, ', ');
|
|
157
|
+
// Remove type assertions: as Type
|
|
158
|
+
result = result.replace(/\s+as\s+[A-Z][A-Za-z<>\[\],\s|&]+(?=[,)\s;])/g, '');
|
|
159
|
+
// Remove generic type parameters from function calls: fn<Type>(...)
|
|
160
|
+
result = result.replace(/<[A-Z][A-Za-z<>\[\],\s|&]*>\s*\(/g, '(');
|
|
161
|
+
// Remove interface declarations
|
|
162
|
+
result = result.replace(/^(export\s+)?interface\s+\w+[^{]*\{[^}]*\}/gm, '');
|
|
163
|
+
// Remove type alias declarations
|
|
164
|
+
result = result.replace(/^(export\s+)?type\s+\w+\s*=\s*[^;]+;/gm, '');
|
|
165
|
+
// Remove function parameter type annotations: (x: Type) => ...
|
|
166
|
+
result = result.replace(/:\s*[A-Z][A-Za-z<>\[\],\s|&]*(?=[,)=])/g, '');
|
|
167
|
+
// Remove return type annotations: ): Type {
|
|
168
|
+
result = result.replace(/\)\s*:\s*[A-Za-z<>\[\],\s|&]+\s*\{/g, ') {');
|
|
169
|
+
// Remove variable type annotations: const x: Type =
|
|
170
|
+
result = result.replace(/:\s*[A-Z][A-Za-z<>\[\],\s|&]*\s*=/g, ' =');
|
|
171
|
+
return result;
|
|
172
|
+
}
|
|
173
|
+
transformJSX(source) {
|
|
174
|
+
// Add React import if not present (for createElement)
|
|
175
|
+
const hasReactImport = /import\s+React/.test(source) ||
|
|
176
|
+
/import\s+\*\s+as\s+React/.test(source);
|
|
177
|
+
let result = source;
|
|
178
|
+
if (!hasReactImport) {
|
|
179
|
+
result = `import React from 'react';\n` + result;
|
|
180
|
+
}
|
|
181
|
+
// Transform JSX self-closing tags: <Component />
|
|
182
|
+
result = result.replace(/<([A-Z][A-Za-z.]*)\s*\/>/g, 'React.createElement($1, null)');
|
|
183
|
+
// Transform JSX self-closing with props: <Component prop="val" />
|
|
184
|
+
result = result.replace(/<([A-Z][A-Za-z.]*)\s+([^>]+?)\s*\/>/g, (_, tag, props) => `React.createElement(${tag}, {${this.parseProps(props)}})`);
|
|
185
|
+
// Transform lowercase self-closing: <div />
|
|
186
|
+
result = result.replace(/<([a-z][a-z-]*)\s*\/>/g, `React.createElement('$1', null)`);
|
|
187
|
+
// Transform JSX fragments: <> ... </>
|
|
188
|
+
result = result.replace(/<>/g, 'React.createElement(React.Fragment, null,');
|
|
189
|
+
result = result.replace(/<\/>/g, ')');
|
|
190
|
+
return result;
|
|
191
|
+
}
|
|
192
|
+
parseProps(propsStr) {
|
|
193
|
+
const props = [];
|
|
194
|
+
const regex = /(\w+)(?:=(?:"([^"]*?)"|'([^']*?)'|\{([^}]*?)\}))?/g;
|
|
195
|
+
let match;
|
|
196
|
+
while ((match = regex.exec(propsStr)) !== null) {
|
|
197
|
+
const [, name, strDouble, strSingle, expr] = match;
|
|
198
|
+
if (strDouble !== undefined)
|
|
199
|
+
props.push(`${name}: "${strDouble}"`);
|
|
200
|
+
else if (strSingle !== undefined)
|
|
201
|
+
props.push(`${name}: '${strSingle}'`);
|
|
202
|
+
else if (expr !== undefined)
|
|
203
|
+
props.push(`${name}: ${expr}`);
|
|
204
|
+
else
|
|
205
|
+
props.push(`${name}: true`);
|
|
206
|
+
}
|
|
207
|
+
return props.join(', ');
|
|
208
|
+
}
|
|
209
|
+
rewriteImports(source) {
|
|
210
|
+
// Rewrite bare specifiers to esm.sh CDN
|
|
211
|
+
return source.replace(/^(import\s+(?:.*?\s+from\s+)?['"])([^./][^'"]*?)(['"])/gm, (_, prefix, specifier, suffix) => {
|
|
212
|
+
// Keep relative imports as-is
|
|
213
|
+
if (specifier.startsWith('.') || specifier.startsWith('/')) {
|
|
214
|
+
return `${prefix}${specifier}${suffix}`;
|
|
215
|
+
}
|
|
216
|
+
// Map to esm.sh CDN
|
|
217
|
+
return `${prefix}https://esm.sh/${specifier}${suffix}`;
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
createObjectUrl(source, type = 'application/javascript') {
|
|
221
|
+
const blob = new Blob([source], { type });
|
|
222
|
+
const url = URL.createObjectURL(blob);
|
|
223
|
+
return url;
|
|
224
|
+
}
|
|
225
|
+
revokeObjectUrl(url) {
|
|
226
|
+
URL.revokeObjectURL(url);
|
|
227
|
+
this.objectUrls.delete(url);
|
|
228
|
+
}
|
|
229
|
+
cleanup() {
|
|
230
|
+
for (const url of Array.from(this.objectUrls.values())) {
|
|
231
|
+
URL.revokeObjectURL(url);
|
|
232
|
+
}
|
|
233
|
+
this.objectUrls.clear();
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* ImportMapBuilder — Generates browser-native import maps
|
|
238
|
+
*/
|
|
239
|
+
export class ImportMapBuilder {
|
|
240
|
+
imports = {};
|
|
241
|
+
/** Add a package mapping to the import map */
|
|
242
|
+
add(specifier, url) {
|
|
243
|
+
this.imports[specifier] = url;
|
|
244
|
+
return this;
|
|
245
|
+
}
|
|
246
|
+
/** Add React and common packages */
|
|
247
|
+
addReactDefaults(reactVersion = '18') {
|
|
248
|
+
const base = `https://esm.sh`;
|
|
249
|
+
this.imports['react'] = `${base}/react@${reactVersion}`;
|
|
250
|
+
this.imports['react-dom'] = `${base}/react-dom@${reactVersion}`;
|
|
251
|
+
this.imports['react-dom/client'] = `${base}/react-dom@${reactVersion}/client`;
|
|
252
|
+
this.imports['react/jsx-runtime'] = `${base}/react@${reactVersion}/jsx-runtime`;
|
|
253
|
+
this.imports['react/jsx-dev-runtime'] = `${base}/react@${reactVersion}/jsx-dev-runtime`;
|
|
254
|
+
return this;
|
|
255
|
+
}
|
|
256
|
+
build() {
|
|
257
|
+
return { imports: { ...this.imports } };
|
|
258
|
+
}
|
|
259
|
+
toScriptTag() {
|
|
260
|
+
return `<script type="importmap">${JSON.stringify(this.build(), null, 2)}</script>`;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* ModuleCache — LRU cache with integrity verification
|
|
265
|
+
*/
|
|
266
|
+
export class ModuleCache {
|
|
267
|
+
cache = new Map();
|
|
268
|
+
maxSize;
|
|
269
|
+
constructor(maxSize = 200) {
|
|
270
|
+
this.maxSize = maxSize;
|
|
271
|
+
}
|
|
272
|
+
set(path, module) {
|
|
273
|
+
if (this.cache.size >= this.maxSize) {
|
|
274
|
+
// Evict oldest entry (LRU)
|
|
275
|
+
const oldest = Array.from(this.cache.keys())[0];
|
|
276
|
+
const old = this.cache.get(oldest);
|
|
277
|
+
if (old?.objectUrl)
|
|
278
|
+
URL.revokeObjectURL(old.objectUrl);
|
|
279
|
+
this.cache.delete(oldest);
|
|
280
|
+
}
|
|
281
|
+
this.cache.set(path, module);
|
|
282
|
+
}
|
|
283
|
+
get(path) {
|
|
284
|
+
const module = this.cache.get(path);
|
|
285
|
+
if (!module)
|
|
286
|
+
return null;
|
|
287
|
+
// Move to end (LRU update)
|
|
288
|
+
this.cache.delete(path);
|
|
289
|
+
this.cache.set(path, module);
|
|
290
|
+
return module;
|
|
291
|
+
}
|
|
292
|
+
invalidate(path) {
|
|
293
|
+
const module = this.cache.get(path);
|
|
294
|
+
if (module?.objectUrl)
|
|
295
|
+
URL.revokeObjectURL(module.objectUrl);
|
|
296
|
+
this.cache.delete(path);
|
|
297
|
+
}
|
|
298
|
+
clear() {
|
|
299
|
+
for (const module of Array.from(this.cache.values())) {
|
|
300
|
+
if (module.objectUrl)
|
|
301
|
+
URL.revokeObjectURL(module.objectUrl);
|
|
302
|
+
}
|
|
303
|
+
this.cache.clear();
|
|
304
|
+
}
|
|
305
|
+
get size() {
|
|
306
|
+
return this.cache.size;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
/** Default project template files */
|
|
310
|
+
export const DEFAULT_PROJECT_FILES = [
|
|
311
|
+
{
|
|
312
|
+
path: '/src/App.tsx',
|
|
313
|
+
content: `import { useState } from 'react';
|
|
314
|
+
|
|
315
|
+
export default function App() {
|
|
316
|
+
const [count, setCount] = useState(0);
|
|
317
|
+
|
|
318
|
+
return (
|
|
319
|
+
<div style={{ fontFamily: 'system-ui', padding: '2rem', textAlign: 'center' }}>
|
|
320
|
+
<h1 style={{ color: '#e8650a', fontSize: '2.5rem', marginBottom: '0.5rem' }}>
|
|
321
|
+
JXR.js Edge Runtime
|
|
322
|
+
</h1>
|
|
323
|
+
<p style={{ color: '#888', marginBottom: '2rem' }}>
|
|
324
|
+
Zero-build React preview — powered by JXR Studios & DamascusAI
|
|
325
|
+
</p>
|
|
326
|
+
<button
|
|
327
|
+
onClick={() => setCount(c => c + 1)}
|
|
328
|
+
style={{
|
|
329
|
+
background: '#e8650a',
|
|
330
|
+
color: 'white',
|
|
331
|
+
border: 'none',
|
|
332
|
+
padding: '0.75rem 2rem',
|
|
333
|
+
borderRadius: '6px',
|
|
334
|
+
fontSize: '1rem',
|
|
335
|
+
cursor: 'pointer',
|
|
336
|
+
}}
|
|
337
|
+
>
|
|
338
|
+
Count: {count}
|
|
339
|
+
</button>
|
|
340
|
+
</div>
|
|
341
|
+
);
|
|
342
|
+
}`,
|
|
343
|
+
language: 'tsx',
|
|
344
|
+
lastModified: Date.now(),
|
|
345
|
+
size: 0,
|
|
346
|
+
dirty: false,
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
path: '/src/index.tsx',
|
|
350
|
+
content: `import { createRoot } from 'react-dom/client';
|
|
351
|
+
import App from './App';
|
|
352
|
+
|
|
353
|
+
const root = createRoot(document.getElementById('root')!);
|
|
354
|
+
root.render(<App />);`,
|
|
355
|
+
language: 'tsx',
|
|
356
|
+
lastModified: Date.now(),
|
|
357
|
+
size: 0,
|
|
358
|
+
dirty: false,
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
path: '/src/components/Button.tsx',
|
|
362
|
+
content: `interface ButtonProps {
|
|
363
|
+
children: React.ReactNode;
|
|
364
|
+
onClick?: () => void;
|
|
365
|
+
variant?: 'primary' | 'secondary' | 'ghost';
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export function Button({ children, onClick, variant = 'primary' }: ButtonProps) {
|
|
369
|
+
const styles = {
|
|
370
|
+
primary: { background: '#e8650a', color: 'white' },
|
|
371
|
+
secondary: { background: '#1a1a2e', color: '#e8650a', border: '1px solid #e8650a' },
|
|
372
|
+
ghost: { background: 'transparent', color: '#e8650a' },
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
return (
|
|
376
|
+
<button
|
|
377
|
+
onClick={onClick}
|
|
378
|
+
style={{
|
|
379
|
+
...styles[variant],
|
|
380
|
+
padding: '0.5rem 1.25rem',
|
|
381
|
+
borderRadius: '4px',
|
|
382
|
+
border: 'none',
|
|
383
|
+
cursor: 'pointer',
|
|
384
|
+
fontSize: '0.875rem',
|
|
385
|
+
fontWeight: 600,
|
|
386
|
+
transition: 'opacity 0.15s',
|
|
387
|
+
}}
|
|
388
|
+
>
|
|
389
|
+
{children}
|
|
390
|
+
</button>
|
|
391
|
+
);
|
|
392
|
+
}`,
|
|
393
|
+
language: 'tsx',
|
|
394
|
+
lastModified: Date.now(),
|
|
395
|
+
size: 0,
|
|
396
|
+
dirty: false,
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
path: '/src/hooks/useCounter.ts',
|
|
400
|
+
content: `import { useState, useCallback } from 'react';
|
|
401
|
+
|
|
402
|
+
export function useCounter(initial = 0) {
|
|
403
|
+
const [count, setCount] = useState(initial);
|
|
404
|
+
const increment = useCallback(() => setCount(c => c + 1), []);
|
|
405
|
+
const decrement = useCallback(() => setCount(c => c - 1), []);
|
|
406
|
+
const reset = useCallback(() => setCount(initial), [initial]);
|
|
407
|
+
return { count, increment, decrement, reset };
|
|
408
|
+
}`,
|
|
409
|
+
language: 'ts',
|
|
410
|
+
lastModified: Date.now(),
|
|
411
|
+
size: 0,
|
|
412
|
+
dirty: false,
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
path: '/package.json',
|
|
416
|
+
content: JSON.stringify({
|
|
417
|
+
name: 'jxr-project',
|
|
418
|
+
version: '0.1.0',
|
|
419
|
+
dependencies: {
|
|
420
|
+
react: '^18.3.0',
|
|
421
|
+
'react-dom': '^18.3.0',
|
|
422
|
+
},
|
|
423
|
+
}, null, 2),
|
|
424
|
+
language: 'json',
|
|
425
|
+
lastModified: Date.now(),
|
|
426
|
+
size: 0,
|
|
427
|
+
dirty: false,
|
|
428
|
+
},
|
|
429
|
+
];
|
|
430
|
+
//# sourceMappingURL=module-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-resolver.js","sourceRoot":"","sources":["../src/module-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAmCH;;GAEG;AACH,MAAM,OAAO,SAAS;IACZ,KAAK,GAA6B,IAAI,GAAG,EAAE,CAAC;IAC5C,cAAc,GAA2B,IAAI,GAAG,EAAE,CAAC;IAE3D,YAAY,YAA4B;QACtC,IAAI,YAAY,EAAE,CAAC;YACjB,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,CAAC;gBAChC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAY,EAAE,OAAe;QACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,IAAI,GAAgB;YACxB,IAAI;YACJ,OAAO;YACP,QAAQ;YACR,YAAY,EAAE,IAAI,CAAC,GAAG,EAAE;YACxB,IAAI,EAAE,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,UAAU;YAClD,KAAK,EAAE,IAAI;SACZ,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,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AE,gBAAgB;QACtB,OAAO,EAAE;;;;sBAIS;QAClB,QAAQ,EAAE,KAAK;QACf,YAAY,EAAE,IAAI,CAAC,GAAG,EAAE;QACxB,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,KAAK;KACb;IACD;QACE,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BX;QACE,QAAQ,EAAE,KAAK;QACf,YAAY,EAAE,IAAI,CAAC,GAAG,EAAE;QACxB,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,KAAK;KACb;IACD;QACE,IAAI,EAAE,0BAA0B;QAChC,OAAO,EAAE;;;;;;;;EAQX;QACE,QAAQ,EAAE,IAAI;QACd,YAAY,EAAE,IAAI,CAAC,GAAG,EAAE;QACxB,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,KAAK;KACb;IACD;QACE,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;YACtB,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,OAAO;YAChB,YAAY,EAAE;gBACZ,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,SAAS;aACvB;SACF,EAAE,IAAI,EAAE,CAAC,CAAC;QACX,QAAQ,EAAE,MAAM;QAChB,YAAY,EAAE,IAAI,CAAC,GAAG,EAAE;QACxB,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,KAAK;KACb;CACF,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JXR.js — MoQ Transport Layer (Media over QUIC simulation)
|
|
3
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
4
|
+
* Design: LavaFlow OS — Thermal Precision + Edge Command
|
|
5
|
+
* Layer: Core Runtime / Transport
|
|
6
|
+
*
|
|
7
|
+
* Architecture:
|
|
8
|
+
* Implements the MoQ (Media over QUIC) transport protocol semantics
|
|
9
|
+
* using WebTransport where available, falling back to WebSocket streams.
|
|
10
|
+
* Provides ordered/unordered object delivery with subscription semantics,
|
|
11
|
+
* priority-based stream multiplexing, and sub-RTT latency for edge delivery.
|
|
12
|
+
*
|
|
13
|
+
* MoQ Concepts implemented:
|
|
14
|
+
* - Track: Named data stream with publisher/subscriber model
|
|
15
|
+
* - Object: Discrete data unit within a track (group + sequence)
|
|
16
|
+
* - Subscription: Consumer interest in a track with delivery preferences
|
|
17
|
+
* - Relay: Edge node that caches and forwards track objects
|
|
18
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
19
|
+
*/
|
|
20
|
+
export type MoQDeliveryOrder = 'ascending' | 'descending' | 'publisher';
|
|
21
|
+
export type MoQStreamType = 'data' | 'control' | 'announce' | 'subscribe';
|
|
22
|
+
export type MoQConnectionState = 'connecting' | 'connected' | 'degraded' | 'disconnected';
|
|
23
|
+
export interface MoQTrackNamespace {
|
|
24
|
+
namespace: string;
|
|
25
|
+
trackName: string;
|
|
26
|
+
}
|
|
27
|
+
export interface MoQObject {
|
|
28
|
+
trackNamespace: MoQTrackNamespace;
|
|
29
|
+
groupSequence: number;
|
|
30
|
+
objectSequence: number;
|
|
31
|
+
sendOrder: number;
|
|
32
|
+
payload: ArrayBuffer | string;
|
|
33
|
+
timestamp: number;
|
|
34
|
+
size: number;
|
|
35
|
+
}
|
|
36
|
+
export interface MoQSubscription {
|
|
37
|
+
id: string;
|
|
38
|
+
track: MoQTrackNamespace;
|
|
39
|
+
deliveryOrder: MoQDeliveryOrder;
|
|
40
|
+
startGroup?: number;
|
|
41
|
+
startObject?: number;
|
|
42
|
+
handler: (obj: MoQObject) => void;
|
|
43
|
+
errorHandler?: (err: Error) => void;
|
|
44
|
+
}
|
|
45
|
+
export interface MoQStreamMetrics {
|
|
46
|
+
connectionState: MoQConnectionState;
|
|
47
|
+
rttMs: number;
|
|
48
|
+
bandwidthBps: number;
|
|
49
|
+
packetsReceived: number;
|
|
50
|
+
packetsSent: number;
|
|
51
|
+
bytesReceived: number;
|
|
52
|
+
bytesSent: number;
|
|
53
|
+
activeSubscriptions: number;
|
|
54
|
+
activePublications: number;
|
|
55
|
+
lossRate: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* MoQTransport — Edge-optimized data transport with QUIC semantics
|
|
59
|
+
*
|
|
60
|
+
* In browser environments without WebTransport, this implements
|
|
61
|
+
* the full MoQ protocol semantics over a simulated QUIC-like
|
|
62
|
+
* stream multiplexer using ReadableStream/WritableStream pairs.
|
|
63
|
+
*/
|
|
64
|
+
export declare class MoQTransport {
|
|
65
|
+
private state;
|
|
66
|
+
private subscriptions;
|
|
67
|
+
private trackBuffers;
|
|
68
|
+
private metrics;
|
|
69
|
+
private rttHistory;
|
|
70
|
+
private bandwidthSamples;
|
|
71
|
+
private metricsListeners;
|
|
72
|
+
private objectListeners;
|
|
73
|
+
private groupSequence;
|
|
74
|
+
private objectSequence;
|
|
75
|
+
private simulationInterval;
|
|
76
|
+
constructor();
|
|
77
|
+
/** Connect to a MoQ relay endpoint */
|
|
78
|
+
connect(endpoint: string): Promise<void>;
|
|
79
|
+
private simulateHandshake;
|
|
80
|
+
/** Publish an object to a track */
|
|
81
|
+
publish(track: MoQTrackNamespace, payload: ArrayBuffer | string, options?: {
|
|
82
|
+
sendOrder?: number;
|
|
83
|
+
newGroup?: boolean;
|
|
84
|
+
}): Promise<void>;
|
|
85
|
+
/** Subscribe to a track */
|
|
86
|
+
subscribe(subscription: MoQSubscription): () => void;
|
|
87
|
+
private deliverToSubscribers;
|
|
88
|
+
private trackKey;
|
|
89
|
+
private startMetricsSimulation;
|
|
90
|
+
private updateMetrics;
|
|
91
|
+
onMetrics(cb: (m: MoQStreamMetrics) => void): () => void;
|
|
92
|
+
getMetrics(): MoQStreamMetrics;
|
|
93
|
+
getState(): MoQConnectionState;
|
|
94
|
+
disconnect(): void;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=moq-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moq-trans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