@flaxia/node 0.3.7 → 0.5.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 (113) hide show
  1. package/README.md +43 -19
  2. package/dist/__tests__/consent-policy.test.d.ts +2 -0
  3. package/dist/__tests__/consent-policy.test.d.ts.map +1 -0
  4. package/dist/assets/VectorStoreEngine.js +140 -85
  5. package/dist/assets/ai-inference.js +336 -40
  6. package/dist/assets/container.js +368 -260
  7. package/dist/assets/egress-guard.js +174 -0
  8. package/dist/assets/image-process.js +184 -19
  9. package/dist/assets/nudenet.js +2 -2
  10. package/dist/assets/webgpuProbe.js +357 -0
  11. package/dist/client/SignalingClient.d.ts +6 -0
  12. package/dist/client/SignalingClient.d.ts.map +1 -1
  13. package/dist/client/__tests__/mobile-lifecycle.test.d.ts +2 -0
  14. package/dist/client/__tests__/mobile-lifecycle.test.d.ts.map +1 -0
  15. package/dist/client/mobile-lifecycle.d.ts +20 -0
  16. package/dist/client/mobile-lifecycle.d.ts.map +1 -0
  17. package/dist/consent/ConsentUI.d.ts +44 -5
  18. package/dist/consent/ConsentUI.d.ts.map +1 -1
  19. package/dist/consent/notice.d.ts +29 -0
  20. package/dist/consent/notice.d.ts.map +1 -0
  21. package/dist/consent/storage.d.ts +91 -7
  22. package/dist/consent/storage.d.ts.map +1 -1
  23. package/dist/executor/WorkerPool.d.ts +42 -2
  24. package/dist/executor/WorkerPool.d.ts.map +1 -1
  25. package/dist/executor/__tests__/WorkerPool.swarm.test.d.ts +13 -0
  26. package/dist/executor/__tests__/WorkerPool.swarm.test.d.ts.map +1 -0
  27. package/dist/executor/__tests__/container-executor.test.d.ts +2 -0
  28. package/dist/executor/__tests__/container-executor.test.d.ts.map +1 -0
  29. package/dist/executor/__tests__/egress-guard.test.d.ts +2 -0
  30. package/dist/executor/__tests__/egress-guard.test.d.ts.map +1 -0
  31. package/dist/executor/__tests__/resourceReporter.test.d.ts +2 -0
  32. package/dist/executor/__tests__/resourceReporter.test.d.ts.map +1 -0
  33. package/dist/executor/__tests__/webgpuProbe.test.d.ts +2 -0
  34. package/dist/executor/__tests__/webgpuProbe.test.d.ts.map +1 -0
  35. package/dist/executor/container-executor.d.ts +49 -1
  36. package/dist/executor/container-executor.d.ts.map +1 -1
  37. package/dist/executor/egress-guard.d.ts +105 -0
  38. package/dist/executor/egress-guard.d.ts.map +1 -0
  39. package/dist/executor/memoryProbe.d.ts +30 -0
  40. package/dist/executor/memoryProbe.d.ts.map +1 -1
  41. package/dist/executor/resourceReporter.d.ts +15 -0
  42. package/dist/executor/resourceReporter.d.ts.map +1 -0
  43. package/dist/executor/throttle.d.ts +62 -4
  44. package/dist/executor/throttle.d.ts.map +1 -1
  45. package/dist/executor/webgpuProbe.d.ts +20 -0
  46. package/dist/executor/webgpuProbe.d.ts.map +1 -0
  47. package/dist/index.d.ts +2 -0
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +1423 -235
  50. package/dist/swarm/__tests__/adapter.test.d.ts +2 -0
  51. package/dist/swarm/__tests__/adapter.test.d.ts.map +1 -0
  52. package/dist/swarm/__tests__/controller.test.d.ts +2 -0
  53. package/dist/swarm/__tests__/controller.test.d.ts.map +1 -0
  54. package/dist/swarm/__tests__/defects.test.d.ts +16 -0
  55. package/dist/swarm/__tests__/defects.test.d.ts.map +1 -0
  56. package/dist/swarm/__tests__/hardening.test.d.ts +2 -0
  57. package/dist/swarm/__tests__/hardening.test.d.ts.map +1 -0
  58. package/dist/swarm/__tests__/peer-quality.test.d.ts +2 -0
  59. package/dist/swarm/__tests__/peer-quality.test.d.ts.map +1 -0
  60. package/dist/swarm/__tests__/peer-transport.test.d.ts +2 -0
  61. package/dist/swarm/__tests__/peer-transport.test.d.ts.map +1 -0
  62. package/dist/swarm/__tests__/runtime.test.d.ts +2 -0
  63. package/dist/swarm/__tests__/runtime.test.d.ts.map +1 -0
  64. package/dist/swarm/__tests__/session.test.d.ts +2 -0
  65. package/dist/swarm/__tests__/session.test.d.ts.map +1 -0
  66. package/dist/swarm/adapter.d.ts +115 -0
  67. package/dist/swarm/adapter.d.ts.map +1 -0
  68. package/dist/swarm/controller.d.ts +91 -0
  69. package/dist/swarm/controller.d.ts.map +1 -0
  70. package/dist/swarm/messages.d.ts +41 -0
  71. package/dist/swarm/messages.d.ts.map +1 -0
  72. package/dist/swarm/peer-quality.d.ts +14 -0
  73. package/dist/swarm/peer-quality.d.ts.map +1 -0
  74. package/dist/swarm/peer-transport.d.ts +81 -0
  75. package/dist/swarm/peer-transport.d.ts.map +1 -0
  76. package/dist/swarm/runtime.d.ts +20 -0
  77. package/dist/swarm/runtime.d.ts.map +1 -0
  78. package/dist/swarm/session.d.ts +73 -0
  79. package/dist/swarm/session.d.ts.map +1 -0
  80. package/dist/swarm-engine.js +7496 -0
  81. package/dist/vector-store/HNSWIndex.d.ts +30 -0
  82. package/dist/vector-store/HNSWIndex.d.ts.map +1 -1
  83. package/dist/vector-store/VectorStoreEngine.d.ts +43 -0
  84. package/dist/vector-store/VectorStoreEngine.d.ts.map +1 -1
  85. package/dist/vector-store/__tests__/HNSWIndex.test.d.ts +2 -0
  86. package/dist/vector-store/__tests__/HNSWIndex.test.d.ts.map +1 -0
  87. package/dist/vector-store/__tests__/VectorStoreEngine.test.d.ts +2 -0
  88. package/dist/vector-store/__tests__/VectorStoreEngine.test.d.ts.map +1 -0
  89. package/dist/worker/__tests__/main.worker.abort.test.d.ts +2 -0
  90. package/dist/worker/__tests__/main.worker.abort.test.d.ts.map +1 -0
  91. package/dist/worker/__tests__/main.worker.control.test.d.ts +2 -0
  92. package/dist/worker/__tests__/main.worker.control.test.d.ts.map +1 -0
  93. package/dist/worker.js +766 -67
  94. package/dist/workloads/__tests__/model-pipeline-cache.test.d.ts +2 -0
  95. package/dist/workloads/__tests__/model-pipeline-cache.test.d.ts.map +1 -0
  96. package/dist/workloads/__tests__/nudenet.test.d.ts +2 -0
  97. package/dist/workloads/__tests__/nudenet.test.d.ts.map +1 -0
  98. package/dist/workloads/ai-inference.d.ts +8 -1
  99. package/dist/workloads/ai-inference.d.ts.map +1 -1
  100. package/dist/workloads/ai-model-registry.d.ts +72 -0
  101. package/dist/workloads/ai-model-registry.d.ts.map +1 -0
  102. package/dist/workloads/container.d.ts +1 -1
  103. package/dist/workloads/container.d.ts.map +1 -1
  104. package/dist/workloads/image-process.d.ts +27 -0
  105. package/dist/workloads/image-process.d.ts.map +1 -1
  106. package/dist/workloads/model-pipeline-cache.d.ts +48 -0
  107. package/dist/workloads/model-pipeline-cache.d.ts.map +1 -0
  108. package/dist/workloads/nudenet.d.ts +8 -0
  109. package/dist/workloads/nudenet.d.ts.map +1 -1
  110. package/package.json +3 -2
  111. package/dist/assets/memoryProbe.js +0 -28
  112. package/dist/client/WebRTCPeer.d.ts +0 -8
  113. package/dist/client/WebRTCPeer.d.ts.map +0 -1
@@ -0,0 +1,357 @@
1
+ //#region ../sdk/dist/index.js
2
+ var e = "flaxia-node-v1", t = "bearer.";
3
+ function n(n) {
4
+ return [e, `${t}${n}`];
5
+ }
6
+ function r(e, t, n = {}) {
7
+ let r = e.replace(/\/+$/, "").replace(/^http/, "ws"), i = new URL(`${r}${t.startsWith("/") ? t : `/${t}`}`);
8
+ for (let [e, t] of Object.entries(n)) t !== void 0 && i.searchParams.set(e, String(t));
9
+ return i.toString();
10
+ }
11
+ var i = 6e4;
12
+ function a(e, t) {
13
+ if (t.length === 0) return [];
14
+ if (!Number.isInteger(e) || e < 1) throw Error(`layers must be a positive integer, got ${e}`);
15
+ let n = Math.min(t.length, e), r = t.slice(0, n).map((e) => Number.isFinite(e) && e > 0 ? e : 0), i = r.reduce((e, t) => e + t, 0) || 1, a = r.map((t) => Math.max(1, Math.floor(e * t / i))), o = a.reduce((e, t) => e + t, 0);
16
+ for (; o > e;) {
17
+ let e = 0;
18
+ for (let t = 1; t < n; t++) a[t] > a[e] && (e = t);
19
+ if (a[e] <= 1) break;
20
+ a[e]--, o--;
21
+ }
22
+ let s = r.map((t, n) => ({
23
+ i: n,
24
+ f: e * t / i - Math.floor(e * t / i)
25
+ })).sort((e, t) => t.f - e.f), c = 0;
26
+ for (; o < e;) a[s[c % n].i]++, o++, c++;
27
+ return a;
28
+ }
29
+ function o(e) {
30
+ let t = a(e.layers, e.nodes.map((e) => e.capacity)), n = [], r = 0;
31
+ for (let i = 0; i < t.length; i++) {
32
+ let a = r + t[i], o = i === 0 ? "host" : "worker", s = {
33
+ start: r,
34
+ end: a,
35
+ hasEmbed: i === 0,
36
+ hasHead: i === 0
37
+ };
38
+ n.push({
39
+ nodeId: e.nodes[i].nodeId,
40
+ role: o,
41
+ slice: s
42
+ }), r = a;
43
+ }
44
+ return {
45
+ sessionId: e.sessionId,
46
+ taskId: e.taskId,
47
+ model: e.model,
48
+ layers: e.layers,
49
+ chain: n
50
+ };
51
+ }
52
+ var s = 21335, c = 0, l = 1, u = 8 * 1024 * 1024;
53
+ function d(e, t, n) {
54
+ let r = new TextEncoder().encode(e);
55
+ if (!r.length || r.length > 256) throw Error("swarm session id length is invalid");
56
+ let i = n ?? new Uint8Array();
57
+ if (i.byteLength !== 0 && i.byteLength !== 16) throw Error("swarm envelope MAC length is invalid");
58
+ let a = 4 + r.length + 1 + i.byteLength;
59
+ if (a + t.byteLength > 8388608) throw Error(`swarm envelope exceeds ${u} bytes`);
60
+ let o = new ArrayBuffer(a + t.byteLength), s = new DataView(o);
61
+ return s.setUint32(0, r.length, !0), new Uint8Array(o, 4, r.length).set(r), s.setUint8(4 + r.length, i.byteLength), i.byteLength && new Uint8Array(o, 4 + r.length + 1, i.byteLength).set(i), new Uint8Array(o, a).set(new Uint8Array(t)), o;
62
+ }
63
+ function f(e) {
64
+ if (e.byteLength < 5 || e.byteLength > 8388608) return null;
65
+ let t = new DataView(e), n = t.getUint32(0, !0);
66
+ if (!n || n > 256) return null;
67
+ let r = 4 + n;
68
+ if (e.byteLength < r + 1) return null;
69
+ let i = t.getUint8(r);
70
+ if (i !== 0 && i !== 16) return null;
71
+ let a = r + 1 + i;
72
+ return e.byteLength < a + 16 ? null : {
73
+ sessionId: new TextDecoder().decode(new Uint8Array(e, 4, n)),
74
+ mac: i ? new Uint8Array(e, r + 1, i) : null,
75
+ frame: e.slice(a)
76
+ };
77
+ }
78
+ async function p(e, t, n) {
79
+ let r = await crypto.subtle.importKey("raw", new TextEncoder().encode(e), {
80
+ name: "HMAC",
81
+ hash: "SHA-256"
82
+ }, !1, ["sign"]), i = await crypto.subtle.sign("HMAC", r, d(t, n));
83
+ return new Uint8Array(i).slice(0, 16);
84
+ }
85
+ async function m(e, t, n) {
86
+ return d(t, n, await p(e, t, n));
87
+ }
88
+ async function ee(e, t, n, r) {
89
+ if (r.byteLength !== 16) return !1;
90
+ let i = await p(e, t, n), a = 0;
91
+ for (let e = 0; e < i.byteLength; e++) a |= i[e] ^ r[e];
92
+ return a === 0;
93
+ }
94
+ function h(e, t) {
95
+ let n = new ArrayBuffer(16 + t.byteLength), r = new DataView(n);
96
+ return r.setUint16(0, s, !0), r.setUint8(2, c), r.setUint8(3, 0), r.setUint32(4, e.requestId >>> 0, !0), r.setUint32(8, e.pos >>> 0, !0), r.setUint16(12, e.tokens, !0), r.setUint16(14, 0, !0), new Uint8Array(n, 16).set(t), n;
97
+ }
98
+ function g(e = 0) {
99
+ let t = /* @__PURE__ */ new ArrayBuffer(16), n = new DataView(t);
100
+ return n.setUint16(0, s, !0), n.setUint8(2, l), n.setUint8(3, 0), n.setUint32(4, e >>> 0, !0), t;
101
+ }
102
+ function te(e) {
103
+ if (e.byteLength !== 16) return !1;
104
+ let t = new DataView(e);
105
+ return t.getUint16(0, !0) === 21335 && t.getUint8(2) === l && t.getUint8(3) === 0 && t.getUint32(8, !0) === 0 && t.getUint16(12, !0) === 0 && t.getUint16(14, !0) === 0;
106
+ }
107
+ function ne(e) {
108
+ if (e.byteLength < 16) return null;
109
+ let t = new DataView(e);
110
+ return t.getUint16(0, !0) !== 21335 || t.getUint8(2) !== c ? null : {
111
+ header: {
112
+ requestId: t.getUint32(4, !0),
113
+ pos: t.getUint32(8, !0),
114
+ tokens: t.getUint16(12, !0)
115
+ },
116
+ payload: new Uint8Array(e, 16)
117
+ };
118
+ }
119
+ function _(e) {
120
+ if (!y(e)) return !1;
121
+ if (e.kind === "description") {
122
+ let t = e.description;
123
+ return y(t) && (t.type === "offer" || t.type === "answer") && typeof t.sdp == "string" && t.sdp.length > 0 && t.sdp.length <= 24576;
124
+ }
125
+ if (e.kind === "candidate") {
126
+ let t = e.candidate;
127
+ return t === null ? !0 : y(t) && typeof t.candidate == "string" && t.candidate.length > 0 && t.candidate.length <= 4096 && (t.sdpMid === void 0 || t.sdpMid === null || typeof t.sdpMid == "string" && t.sdpMid.length <= 128) && (t.sdpMLineIndex === void 0 || t.sdpMLineIndex === null || typeof t.sdpMLineIndex == "number" && Number.isInteger(t.sdpMLineIndex) && t.sdpMLineIndex >= 0 && t.sdpMLineIndex <= 255) && (t.usernameFragment === void 0 || t.usernameFragment === null || typeof t.usernameFragment == "string" && t.usernameFragment.length <= 256);
128
+ }
129
+ return !1;
130
+ }
131
+ function v(e) {
132
+ if (!y(e) || e.type !== "swarm-peer-signal" || !_(e.signal)) return !1;
133
+ try {
134
+ if (new TextEncoder().encode(JSON.stringify(e.signal)).byteLength > 32768) return !1;
135
+ } catch {
136
+ return !1;
137
+ }
138
+ return typeof e.taskId == "string" && e.taskId.length > 0 && e.taskId.length <= 128 && typeof e.sessionId == "string" && e.sessionId.length > 0 && e.sessionId.length <= 128 && typeof e.attemptId == "string" && e.attemptId.length > 0 && e.attemptId.length <= 128 && typeof e.toNodeId == "string" && e.toNodeId.length > 0 && e.toNodeId.length <= 128 && (e.fromNodeId === void 0 || typeof e.fromNodeId == "string" && e.fromNodeId.length > 0 && e.fromNodeId.length <= 128);
139
+ }
140
+ function y(e) {
141
+ return typeof e == "object" && !!e;
142
+ }
143
+ function b(e) {
144
+ return typeof e == "number" && Number.isInteger(e) && e >= 0;
145
+ }
146
+ function x(e, t = {}) {
147
+ let n = t.maxLayers ?? 1024, r = t.maxSliceLayers ?? 256;
148
+ return !(!S(e) || !b(e.start) || !b(e.end) || e.end <= e.start || e.end - e.start > r || e.end > n);
149
+ }
150
+ function S(e) {
151
+ return y(e) ? typeof e.start == "number" && typeof e.end == "number" && typeof e.hasEmbed == "boolean" && typeof e.hasHead == "boolean" : !1;
152
+ }
153
+ function C(e) {
154
+ return y(e) ? typeof e.nodeId == "string" && e.nodeId.length > 0 && typeof e.capacity == "number" : !1;
155
+ }
156
+ function w(e) {
157
+ return e === void 0 || typeof e == "string" && e.length > 0 && e.length <= 128;
158
+ }
159
+ function re(e) {
160
+ return !y(e) || e.type !== "swarm-init" || typeof e.sessionId != "string" || !e.sessionId || typeof e.taskId != "string" || !e.taskId || typeof e.model != "string" || typeof e.timeoutMs != "number" || !Array.isArray(e.members) || e.members.length === 0 || e.members.length > 16 || typeof e.prompt != "string" && !Array.isArray(e.prompt) ? !1 : e.members.every(C);
161
+ }
162
+ function ie(e) {
163
+ return !(!y(e) || e.type !== "swarm-slice" || typeof e.sessionId != "string" || !e.sessionId || typeof e.taskId != "string" || !e.taskId || typeof e.model != "string" || !e.model || typeof e.timeoutMs != "number" || !b(e.index) || !b(e.chainLength) || e.chainLength < 1 || e.chainLength > 16 || e.index >= e.chainLength || e.role !== (e.index === 0 ? "host" : "worker") || !x(e.slice) || e.slice.hasEmbed !== (e.index === 0) || e.slice.hasHead !== (e.index === 0) || !w(e.inboundKey) || !w(e.outboundKey) || e.attemptId !== void 0 && (typeof e.attemptId != "string" || !e.attemptId || e.attemptId.length > 128) || e.previousNodeId !== void 0 && (typeof e.previousNodeId != "string" || !e.previousNodeId || e.previousNodeId.length > 128) || e.nextNodeId !== void 0 && (typeof e.nextNodeId != "string" || !e.nextNodeId || e.nextNodeId.length > 128));
164
+ }
165
+ function ae(e) {
166
+ return !y(e) || e.type !== "swarm-start" ? !1 : typeof e.sessionId == "string" && !!e.sessionId && typeof e.taskId == "string" && !!e.taskId;
167
+ }
168
+ function oe(e) {
169
+ return !y(e) || e.type !== "swarm-transport" ? !1 : typeof e.sessionId == "string" && !!e.sessionId && typeof e.taskId == "string" && !!e.taskId && (e.mode === "peer" || e.mode === "relay");
170
+ }
171
+ function T(e) {
172
+ return !y(e) || e.type !== "swarm-flow" ? !1 : typeof e.sessionId == "string" && !!e.sessionId && typeof e.taskId == "string" && !!e.taskId && typeof e.paused == "boolean" && (e.attemptId === void 0 || typeof e.attemptId == "string" && !!e.attemptId && e.attemptId.length <= 128);
173
+ }
174
+ function E(e) {
175
+ return !y(e) || e.type !== "swarm-error" ? !1 : typeof e.sessionId == "string" && !!e.sessionId && typeof e.taskId == "string" && !!e.taskId && typeof e.error == "string";
176
+ }
177
+ new Set([
178
+ "qwen3.5-2b",
179
+ "qwen3.8-27b",
180
+ "qwen3.6-35b-moe"
181
+ ]);
182
+ var D = new Set([
183
+ "ai-inference",
184
+ "image-process",
185
+ "container",
186
+ "vector-embed",
187
+ "vector-query",
188
+ "nudenet",
189
+ "swarm-inference"
190
+ ]), O = 9e4, k = 600 * 1e3, A = 1440 * 60 * 1e3, j = 6e4;
191
+ function M(e) {
192
+ return typeof e == "object" && !!e && !Array.isArray(e);
193
+ }
194
+ function N(e) {
195
+ if (!M(e) || typeof e.modelId != "string" || !e.modelId || e.modelId.length > 128 || typeof e.revision != "string" || !e.revision || e.revision.length > 128 || typeof e.dtype != "string" || !e.dtype || e.dtype.length > 32 || e.backend !== "wasm" && e.backend !== "cpu" && e.backend !== "webgpu" || e.state !== "loading" && e.state !== "ready" && e.state !== "evicting" && e.state !== "failed" || !Number.isInteger(e.referenceCount) || e.referenceCount < 0 || e.referenceCount > 64) return !1;
196
+ if (e.layerRange === void 0) return !0;
197
+ let t = e.layerRange;
198
+ return Array.isArray(t) && t.length === 2 && Number.isInteger(t[0]) && Number.isInteger(t[1]) && t[0] >= 0 && t[1] > t[0] && t[1] <= 1024;
199
+ }
200
+ function P(e, t = Date.now()) {
201
+ if (!M(e) || e.version !== 1 || !Number.isSafeInteger(e.sampledAt) || !Number.isSafeInteger(e.expiresAt) || !Array.isArray(e.entries) || e.entries.length > 8 || !e.entries.every(N)) return !1;
202
+ let n = e.sampledAt, r = e.expiresAt;
203
+ return n <= t + 5e3 && n >= t - 6e4 && r > t && r > n && r - n <= 6e4;
204
+ }
205
+ //#endregion
206
+ //#region src/executor/memoryProbe.ts
207
+ var F = 2 * 1024 ** 3, I = 65536, L = 16 * 1024 * 1024, R = 4096, z = null, B = 0;
208
+ function V(e, t) {
209
+ let n = Math.ceil(t / I);
210
+ try {
211
+ e.grow(n);
212
+ } catch {
213
+ return !1;
214
+ }
215
+ let r = new Uint8Array(e.buffer);
216
+ for (let e = 0; e < n; e++) r[e * I] = 0;
217
+ return !0;
218
+ }
219
+ function H(e = F, t = L) {
220
+ if (z) return z.bytes;
221
+ B++;
222
+ let n = Date.now(), r;
223
+ try {
224
+ r = new WebAssembly.Memory({ initial: 0 });
225
+ } catch {
226
+ return z = {
227
+ bytes: 0,
228
+ sampledAt: n,
229
+ measured: !1
230
+ }, 0;
231
+ }
232
+ let i = Math.max(0, Math.floor(e)), a = Math.max(I, Math.floor(t)), o = 0, s = 0;
233
+ for (; o < i && s < R;) {
234
+ let e = Math.min(a, i - o);
235
+ if (!V(r, e)) break;
236
+ o += e, s++;
237
+ }
238
+ return r = void 0, z = {
239
+ bytes: o,
240
+ sampledAt: n,
241
+ measured: !0
242
+ }, o;
243
+ }
244
+ function U() {
245
+ return z ? z.bytes : H();
246
+ }
247
+ function W() {
248
+ return z || H(), {
249
+ bytes: z?.measured ? z.bytes : null,
250
+ sampledAt: z?.sampledAt ?? null
251
+ };
252
+ }
253
+ function G() {
254
+ return U() >= F;
255
+ }
256
+ //#endregion
257
+ //#region src/executor/webgpuProbe.ts
258
+ var K = 3, q = 750, J = 1500, Y = 600 * 1e3;
259
+ async function X(e, t) {
260
+ let n, r = new Promise((e) => {
261
+ n = setTimeout(() => e({
262
+ value: null,
263
+ timedOut: !0
264
+ }), t);
265
+ });
266
+ try {
267
+ return await Promise.race([e.then((e) => ({
268
+ value: e,
269
+ timedOut: !1
270
+ })), r]);
271
+ } finally {
272
+ n !== void 0 && clearTimeout(n);
273
+ }
274
+ }
275
+ function Z(e, t = Date.now()) {
276
+ return {
277
+ capabilities: { webgpu: !1 },
278
+ status: e,
279
+ sampledAt: t,
280
+ expiresAt: t + Y,
281
+ architecture: null,
282
+ maxStorageBufferBindingSize: null,
283
+ computeCompletionMs: null,
284
+ sampleCount: 0
285
+ };
286
+ }
287
+ function Q() {
288
+ return typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now();
289
+ }
290
+ async function se(e) {
291
+ let t, n = new Promise((e) => {
292
+ t = setTimeout(() => e("timeout"), q);
293
+ }), r = e.queue.onSubmittedWorkDone().then(() => "complete"), i = e.lost.then(() => "lost", () => "lost");
294
+ try {
295
+ return await Promise.race([
296
+ r,
297
+ i,
298
+ n
299
+ ]);
300
+ } finally {
301
+ t !== void 0 && clearTimeout(t);
302
+ }
303
+ }
304
+ async function $() {
305
+ let e = Date.now(), t = navigator.gpu;
306
+ if (!t || typeof t.requestAdapter != "function") return Z("unsupported", e);
307
+ let n = null;
308
+ try {
309
+ let r = await X(t.requestAdapter({ powerPreference: "high-performance" }), J);
310
+ if (r.timedOut) return Z("unavailable", Date.now());
311
+ let i = r.value;
312
+ if (!i) return Z("unsupported", e);
313
+ let a = i.limits?.maxStorageBufferBindingSize, o = [i.info?.vendor, i.info?.architecture].filter((e) => typeof e == "string" && e.trim().length > 0).join(" ").trim().slice(0, 64), s = typeof a == "number" && Number.isFinite(a) && a > 0 ? Math.min(Math.floor(a), 16 * 1024 ** 3) : null, c = i.requestDevice(), l = await X(c, J);
314
+ if (l.timedOut) return c.then((e) => e.destroy()).catch(() => {}), Z("unavailable", Date.now());
315
+ n = l.value;
316
+ let u = n, d = u.createComputePipeline({
317
+ layout: "auto",
318
+ compute: {
319
+ module: u.createShaderModule({ code: "@compute @workgroup_size(1) fn main() {}" }),
320
+ entryPoint: "main"
321
+ }
322
+ }), f = [];
323
+ for (let e = 0; e < K; e++) {
324
+ let e = u.createCommandEncoder(), t = e.beginComputePass();
325
+ t.setPipeline(d), t.dispatchWorkgroups(1), t.end();
326
+ let n = e.finish(), r = Q();
327
+ u.queue.submit([n]);
328
+ let i = await se(u);
329
+ if (i === "lost") return Z("device-lost", Date.now());
330
+ if (i === "timeout") return Z("unavailable", Date.now());
331
+ f.push(Math.max(0, Q() - r));
332
+ }
333
+ f.sort((e, t) => e - t);
334
+ let p = f[Math.floor(f.length / 2)], m = { webgpu: !0 };
335
+ return o && (m.gpuArchitecture = o), s !== null && (m.maxStorageBufferBindingSize = s), {
336
+ capabilities: m,
337
+ status: "available",
338
+ sampledAt: Date.now(),
339
+ expiresAt: Date.now() + Y,
340
+ architecture: o || null,
341
+ maxStorageBufferBindingSize: s,
342
+ computeCompletionMs: p,
343
+ sampleCount: f.length
344
+ };
345
+ } catch {
346
+ return Z("unavailable", Date.now());
347
+ } finally {
348
+ try {
349
+ n?.destroy();
350
+ } catch {}
351
+ }
352
+ }
353
+ async function ce() {
354
+ return (await $()).capabilities;
355
+ }
356
+ //#endregion
357
+ export { f as A, i as C, O as D, m as E, g as M, te as N, E as O, r as S, ee as T, A as _, G as a, n as b, T as c, d, re as f, u as g, ae as h, W as i, j, oe as k, D as l, x as m, $ as n, H as o, k as p, F as r, v as s, ce as t, ie as u, h as v, P as w, o as x, ne as y };
@@ -5,6 +5,12 @@ export interface TaskMessage {
5
5
  workload: WorkloadType;
6
6
  payload: unknown;
7
7
  timeoutMs?: number;
8
+ /**
9
+ * Coordinator-generated id for this delivery. Must be echoed on `result`,
10
+ * `progress` and `error`: the coordinator only accepts messages that arrive
11
+ * on the socket that received the delivery and carry its attempt id.
12
+ */
13
+ attemptId?: string;
8
14
  }
9
15
  export declare const initFlaxiaNode: (config: NodeConfig) => FlaxiaNodeController;
10
16
  //# sourceMappingURL=SignalingClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignalingClient.d.ts","sourceRoot":"","sources":["../../src/client/SignalingClient.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAgB,oBAAoB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhG,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA2VD,eAAO,MAAM,cAAc,GAAI,QAAQ,UAAU,KAAG,oBAwDnD,CAAC"}
1
+ {"version":3,"file":"SignalingClient.d.ts","sourceRoot":"","sources":["../../src/client/SignalingClient.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAgB,oBAAoB,EAAE,UAAU,EAAyB,YAAY,EAAE,MAAM,aAAa,CAAC;AAmBvH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA81BD,eAAO,MAAM,cAAc,GAAI,QAAQ,UAAU,KAAG,oBAwDnD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=mobile-lifecycle.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mobile-lifecycle.test.d.ts","sourceRoot":"","sources":["../../../src/client/__tests__/mobile-lifecycle.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ export interface MobileLifecycleSignals {
2
+ hidden: boolean;
3
+ pageHidden: boolean;
4
+ online: boolean;
5
+ batteryLevel?: number;
6
+ batteryCharging?: boolean;
7
+ effectiveType?: string;
8
+ saveData?: boolean;
9
+ }
10
+ export interface MobileLifecycleDecision {
11
+ suspend: boolean;
12
+ constrained: boolean;
13
+ maxCpuLoad?: number;
14
+ }
15
+ /**
16
+ * Convert optional browser lifecycle, network, and battery signals into a
17
+ * bounded execution policy. Missing Battery/Network Information APIs are safe.
18
+ */
19
+ export declare function evaluateMobileLifecycle(signals: MobileLifecycleSignals, configuredMaxCpuLoad?: number): MobileLifecycleDecision;
20
+ //# sourceMappingURL=mobile-lifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mobile-lifecycle.d.ts","sourceRoot":"","sources":["../../src/client/mobile-lifecycle.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAMD;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,sBAAsB,EAC/B,oBAAoB,CAAC,EAAE,MAAM,GAC5B,uBAAuB,CAgBzB"}
@@ -1,12 +1,51 @@
1
- interface ConsentConfig {
1
+ export type ConsentPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
2
+ export interface ConsentConfig {
2
3
  brandName: string;
3
- position: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
4
+ position: ConsentPosition;
4
5
  accentColor?: string;
6
+ /** Optional copy overrides; sanitized like every other config string. */
7
+ acceptLabel?: string;
8
+ rejectLabel?: string;
9
+ /** Optional link to the host's privacy policy (http/https only). */
10
+ privacyPolicyUrl?: string;
11
+ /**
12
+ * Host-facing minimum-visible duration. Hosts may only *raise* it: values
13
+ * below {@link MIN_VISIBLE_MS_FLOOR} are clamped so the notice cannot be
14
+ * clicked through by configuration. Tests use `ConsentUIOptions` instead.
15
+ */
16
+ minVisibleMs?: number;
5
17
  }
18
+ export interface ConsentUIOptions {
19
+ /**
20
+ * Minimum time (ms) the banner must stay visible before the accept button
21
+ * becomes actionable. Guards against click-through flicker; defaults to
22
+ * {@link DEFAULT_MIN_VISIBLE_MS}. Tests may inject a smaller value together
23
+ * with `now`/`schedule`, but production defaults never disable the gate.
24
+ */
25
+ minVisibleMs?: number;
26
+ /** Clock used by the minimum-visible gate. Defaults to `Date.now`. */
27
+ now?: () => number;
28
+ /** Scheduler used to re-enable the accept button. Defaults to `setTimeout`. */
29
+ schedule?: (callback: () => void, delayMs: number) => void;
30
+ }
31
+ /**
32
+ * Never interpolate host input into markup or CSS text. `accentColor` is
33
+ * parsed against a strict allowlist and re-emitted in a canonical form, so the
34
+ * string that reaches the stylesheet cannot contain `;`, `{`, `}` or quotes.
35
+ */
36
+ export declare function sanitizeAccentColor(input: unknown): string;
6
37
  export declare class ConsentUI {
7
- private shadow;
8
- constructor(container: HTMLElement, config: ConsentConfig, onConsent: () => void, onReject?: () => void);
38
+ private readonly root;
39
+ /** Sanitized copy of the host configuration, kept for the banner's lifetime. */
40
+ private readonly config;
41
+ private readonly options;
42
+ constructor(container: HTMLElement, config: ConsentConfig, onConsent: () => void, onReject?: () => void, options?: ConsentUIOptions);
43
+ /**
44
+ * @internal The closed shadow root, exposed for tests and diagnostics. The
45
+ * banner is never registered globally, so host scripts cannot reach this
46
+ * instance through the DOM.
47
+ */
48
+ shadowRootForTesting(): ShadowRoot;
9
49
  private render;
10
50
  }
11
- export {};
12
51
  //# sourceMappingURL=ConsentUI.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConsentUI.d.ts","sourceRoot":"","sources":["../../src/consent/ConsentUI.ts"],"names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,CAAC,IAAI,CAAa;IAClC,gFAAgF;IAChF,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyB;IAChD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;gBAGzC,SAAS,EAAE,WAAW,EACtB,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,MAAM,IAAI,EACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,EACrB,OAAO,CAAC,EAAE,gBAAgB;IAU5B;;;;OAIG;IACH,oBAAoB,IAAI,UAAU;IAIlC,OAAO,CAAC,MAAM;CAwGf"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Version of the consent disclosure text below.
3
+ *
4
+ * Consent records are bound to this value: a record only counts as granted
5
+ * while it carries the *current* version, so bumping the version invalidates
6
+ * every existing grant and forces the visitor to see (and accept) the new
7
+ * wording. Increment it whenever `CONSENT_DISCLOSURE` changes in any way that
8
+ * a visitor would care about.
9
+ *
10
+ * - v1: legacy copy ("サイトのパフォーマンス向上にご協力ください。"), which never
11
+ * disclosed what actually runs on the device.
12
+ * - v2: the informed-consent copy below (third-party workloads, orchestrator
13
+ * registration, persistent connection, resource usage).
14
+ */
15
+ export declare const CONSENT_NOTICE_VERSION = 2;
16
+ /**
17
+ * The disclosure shown in the built-in banner. Deliberately static: hosts may
18
+ * style the banner but must not be able to weaken the wording, otherwise the
19
+ * recorded notice version would no longer describe what the visitor saw.
20
+ */
21
+ export declare const CONSENT_DISCLOSURE: {
22
+ readonly summary: "同意すると、このブラウザは第三者から依頼された処理をバックグラウンドで実行します。";
23
+ readonly items: readonly ["実行する処理: 顧客(第三者)が依頼したワークロード。任意の WebAssembly コンテナの実行や、画像の NSFW(成人向け)判定などを含みます。", "接続と登録: オーケストレーターへ WebSocket で常時接続し、端末の性能や対応ワークロードを登録します。", "資源の使用: 待機中も接続を維持し、処理の実行中は CPU・GPU・通信・バッテリーを消費します。", "タスクの出所: 処理はこのサイトの運営者ではなく、第三者(顧客)から割り当てられます。"];
24
+ /** Shown while the accept button is inside its minimum-visible window. */
25
+ readonly acceptGateHint: "開示内容を確認できるよう、「同意して開始」はしばらくの間押せません。";
26
+ readonly acceptLabel: "同意して開始";
27
+ readonly rejectLabel: "拒否";
28
+ };
29
+ //# sourceMappingURL=notice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notice.d.ts","sourceRoot":"","sources":["../../src/consent/notice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;IAS7B,0EAA0E;;;;CAKlE,CAAC"}
@@ -1,20 +1,89 @@
1
1
  import type { ConsentState } from '@flaxia/sdk';
2
+ /**
3
+ * Maximum lifetime of a stored consent grant: 180 days.
4
+ *
5
+ * The lifetime is bounded on purpose — consent is not permanent, and the
6
+ * disclosure shown to the visitor describes what the node does *today*, so a
7
+ * grant must be renewed periodically. Records that claim a longer lifetime are
8
+ * rejected (see `isRecordFresh`).
9
+ */
10
+ export declare const CONSENT_MAX_TTL_MS: number;
2
11
  declare function safeGet(key: string): string | null;
3
12
  declare function safeSet(key: string, value: string): void;
4
13
  declare function safeRemove(key: string): void;
14
+ /**
15
+ * Persistent store for the non-extractable HMAC key. The key is a `CryptoKey`,
16
+ * so it cannot be exported as raw bytes; persisting it in IndexedDB (which
17
+ * structured-clones `CryptoKey` objects) keeps forgery out of reach of scripts
18
+ * that can only write strings into `localStorage`.
19
+ */
20
+ export interface ConsentKeyStore {
21
+ load(): Promise<CryptoKey | null>;
22
+ save(key: CryptoKey): Promise<void>;
23
+ clear(): Promise<void>;
24
+ }
5
25
  export declare const hasConsent: () => boolean;
6
- /** Persist consent. Clears any previous denial so the two never co-exist. */
7
- export declare const saveConsent: () => void;
8
26
  export declare const hasDenial: () => boolean;
27
+ /**
28
+ * Resolve the persisted consent state.
29
+ *
30
+ * Synchronous and fail-closed: until {@link initConsentIntegrity} has verified
31
+ * the stored record (or a grant is made in this document) the answer is not
32
+ * `'granted'`. A stored grant still wins over a stored denial, but the two are
33
+ * kept mutually exclusive by the save helpers.
34
+ */
35
+ export declare const getConsentState: () => ConsentState;
36
+ /**
37
+ * Load (or create) the non-extractable HMAC key and verify the stored consent
38
+ * record. Idempotent and never rejects. Hosts should await this before relying
39
+ * on {@link getConsentState}; callers that cannot wait still fail closed.
40
+ */
41
+ export declare const initConsentIntegrity: () => Promise<ConsentState>;
42
+ /**
43
+ * Persist consent (clears any previous denial). Synchronous, as required by the
44
+ * controller and by host consent callbacks.
45
+ *
46
+ * The grant is only accepted when it is authorized:
47
+ * - `ConsentUI` minted a one-shot gesture token from a click on the accept
48
+ * button (the visitor saw the banner and acted), or
49
+ * - the host explicitly opted in via {@link setHostManagedConsentAllowed}.
50
+ *
51
+ * Otherwise the call is refused with a warning and the state stays not-granted,
52
+ * so a host that calls `accept()` without rendering a banner cannot silently
53
+ * consent. When WebCrypto is unavailable the grant is limited to the current
54
+ * document (nothing unverifiable is written to storage).
55
+ */
56
+ export declare const saveConsent: () => void;
57
+ /**
58
+ * Async variant of {@link saveConsent} that resolves once the record is sealed
59
+ * and readable again. Same authorization requirements.
60
+ */
61
+ export declare const grantConsent: (options?: {
62
+ ttlMs?: number;
63
+ }) => Promise<ConsentState>;
64
+ /**
65
+ * Mint the one-shot authorization consumed by the next {@link saveConsent} /
66
+ * {@link grantConsent} call. Only the built-in `ConsentUI` accept button calls
67
+ * this, from a click handler that runs after the minimum-visible duration.
68
+ */
69
+ export declare const markUserGestureConsent: (noticeVersion?: number) => void;
70
+ /**
71
+ * Opt in to host-managed consent (default: disabled).
72
+ *
73
+ * Disabled by default so a host-supplied `onConsentRequired` callback cannot
74
+ * grant consent headlessly. Hosts that render their own disclosure UI must call
75
+ * this before granting, and remain responsible for showing the current
76
+ * disclosure text to the visitor.
77
+ */
78
+ export declare const setHostManagedConsentAllowed: (allowed: boolean) => void;
79
+ export declare const isHostManagedConsentAllowed: () => boolean;
9
80
  /** Persist denial. Clears any previous consent/expiry so the two never co-exist. */
10
81
  export declare const saveDenial: () => void;
11
- /** Forget the consent decision entirely (granted + expiry + denial). */
12
- export declare const clearConsent: () => void;
13
82
  /**
14
- * Resolve the persisted consent state. A stored grant wins over a stored
15
- * denial, but the two are kept mutually exclusive by the save helpers.
83
+ * Revoke consent: forget the decision entirely (granted + expiry + denial) and
84
+ * drop the HMAC key so copies of the old record can no longer verify.
16
85
  */
17
- export declare const getConsentState: () => ConsentState;
86
+ export declare const clearConsent: () => void;
18
87
  export declare const safeLocalStorageGet: typeof safeGet;
19
88
  export declare const safeLocalStorageSet: typeof safeSet;
20
89
  export declare const safeLocalStorageRemove: typeof safeRemove;
@@ -24,5 +93,20 @@ export declare const safeLocalStorageRemove: typeof safeRemove;
24
93
  * is undefined on mobile Chrome). Never throws.
25
94
  */
26
95
  export declare const safeRandomUUID: () => string;
96
+ /** @internal Drop every in-memory grant/key so the next read re-verifies. */
97
+ declare function resetIntegrityCache(): void;
98
+ /**
99
+ * @internal Test-only seams. Production code never calls these; they exist so
100
+ * unit tests can simulate a reload (key store), a foreign origin, or an
101
+ * integrity-cache reset without weakening any production default.
102
+ */
103
+ export declare const __consentTestHooks: {
104
+ setKeyStore(store: ConsentKeyStore | null): void;
105
+ setOrigin(origin: string | null): void;
106
+ resetIntegrityCache: typeof resetIntegrityCache;
107
+ reset(): void;
108
+ /** Seed a valid grant as if the visitor had accepted the banner. */
109
+ seedGrantedConsent(noticeVersion?: number): void;
110
+ };
27
111
  export {};
28
112
  //# sourceMappingURL=storage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/consent/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAahD,iBAAS,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAM3C;AAED,iBAAS,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,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