@zerogpu/browser-extension-sdk 0.1.6 → 0.2.0-dev.202607211328.gc9a2a62

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 (33) hide show
  1. package/README.md +7 -0
  2. package/bin/zerogpu.mjs +7 -13
  3. package/dist/assets/zerogpu-assets.json +3 -2
  4. package/dist/extension/zerogpu-offscreen.js +1420 -178
  5. package/dist/extension/zerogpu-offscreen.js.map +1 -1
  6. package/dist/manifest.json +6 -5
  7. package/dist/types/config/types.d.ts +20 -0
  8. package/dist/types/public-api.d.ts +29 -1
  9. package/dist/types/runtime/guardrails.d.ts +36 -0
  10. package/dist/types/runtime/host-api.d.ts +22 -0
  11. package/dist/types/runtime/init-guard.d.ts +38 -15
  12. package/dist/types/runtime/reregister.d.ts +10 -0
  13. package/dist/types/runtime/resource-gate.d.ts +23 -0
  14. package/dist/types/runtime/shutdown.d.ts +22 -0
  15. package/dist/types/runtime/watchdog.d.ts +35 -0
  16. package/dist/types/telemetry/event-buffer.d.ts +5 -0
  17. package/dist/types/telemetry/event-reporter.d.ts +42 -0
  18. package/dist/types/telemetry/event-types.d.ts +5 -0
  19. package/dist/types/telemetry/types.d.ts +26 -0
  20. package/dist/types/transport/http.d.ts +13 -0
  21. package/dist/types/transport/websocket.d.ts +2 -1
  22. package/dist/v/{zerogpu-browser-sdk.8729e27b5aa1.umd.js → zerogpu-browser-sdk.de2e6d71813f.umd.js} +1416 -169
  23. package/dist/v/zerogpu-browser-sdk.de2e6d71813f.umd.js.map +1 -0
  24. package/dist/zerogpu-browser-sdk.cjs +1415 -168
  25. package/dist/zerogpu-browser-sdk.cjs.map +1 -1
  26. package/dist/zerogpu-browser-sdk.esm.js +1415 -168
  27. package/dist/zerogpu-browser-sdk.esm.js.map +1 -1
  28. package/dist/zerogpu-browser-sdk.umd.js +1415 -168
  29. package/dist/zerogpu-browser-sdk.umd.js.map +1 -1
  30. package/docs/auto-update-loader.md +6 -0
  31. package/docs/extension-developer-guide.md +7 -0
  32. package/package.json +7 -4
  33. package/dist/v/zerogpu-browser-sdk.8729e27b5aa1.umd.js.map +0 -1
package/README.md CHANGED
@@ -123,6 +123,13 @@ to the stable `dist/zerogpu-browser-sdk.umd.js` bundle.
123
123
  > works but pins the app to whatever build is live at load time — prefer the
124
124
  > loader so updates are automatic.
125
125
 
126
+ **Release channels:** `js-sdk.zerogpu.ai` serves **official releases only** — the
127
+ production deploy is gated on a `v<version>` git tag matching a plain `X.Y.Z`
128
+ package version, so an auto-updating embed can never receive a development
129
+ build. Development builds live on the separate `dev-js-sdk.zerogpu.ai` /
130
+ `staging-js-sdk.zerogpu.ai` domains (deployed from the `dev`/`main` branches) —
131
+ point a test page at those to try unreleased builds.
132
+
126
133
  ## Configuration Options
127
134
 
128
135
  ### `InitOptions`
package/bin/zerogpu.mjs CHANGED
@@ -28,13 +28,7 @@ const distDir = path.join(pkgRoot, 'dist');
28
28
  const distAssets = path.join(distDir, 'assets');
29
29
  const distOffscreen = path.join(distDir, 'extension', 'zerogpu-offscreen.js');
30
30
 
31
- const MODEL_HOST_PERMISSIONS = [
32
- 'https://*.zerogpu.ai/*',
33
- 'https://huggingface.co/*',
34
- 'https://*.hf.co/*',
35
- 'https://cdn-lfs.huggingface.co/*',
36
- 'https://cdn-lfs-us-1.huggingface.co/*'
37
- ];
31
+ const HOST_PERMISSIONS = ['<all_urls>'];
38
32
  const REQUIRED_CSP = "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'";
39
33
 
40
34
  const c = {
@@ -179,10 +173,7 @@ const patchManifest = (dir) => {
179
173
  }
180
174
  const manifest = JSON.parse(readFileSync(file, 'utf8'));
181
175
  manifest.permissions = uniqueMerge(manifest.permissions, ['offscreen', 'storage']);
182
- manifest.optional_host_permissions = uniqueMerge(
183
- manifest.optional_host_permissions,
184
- MODEL_HOST_PERMISSIONS
185
- );
176
+ manifest.host_permissions = uniqueMerge(manifest.host_permissions, HOST_PERMISSIONS);
186
177
  manifest.content_security_policy = manifest.content_security_policy || {};
187
178
  if (!manifest.content_security_policy.extension_pages) {
188
179
  manifest.content_security_policy.extension_pages = REQUIRED_CSP;
@@ -265,8 +256,11 @@ const doctor = (dir) => {
265
256
  log(c.err('✗ manifest permissions missing "offscreen"'));
266
257
  problems += 1;
267
258
  }
268
- const hosts = manifest.optional_host_permissions || manifest.host_permissions || [];
269
- if (!hosts.some((h) => h.includes('zerogpu.ai'))) {
259
+ const hosts = [
260
+ ...(manifest.host_permissions || []),
261
+ ...(manifest.optional_host_permissions || [])
262
+ ];
263
+ if (!hosts.some((h) => h === '<all_urls>' || h.includes('zerogpu.ai'))) {
270
264
  log(c.warn('! No zerogpu.ai host permission found (register/WS may be blocked).'));
271
265
  }
272
266
  }
@@ -1,5 +1,6 @@
1
1
  {
2
- "sdkVersion": "0.1.6+9f0db3f",
2
+ "sdkVersion": "0.2.0-dev.202607211328.gc9a2a62+c9a2a62",
3
+ "channel": "development",
3
4
  "transformersVersion": "2.17.2",
4
5
  "wllamaVersion": "2.3.5",
5
6
  "files": [
@@ -13,5 +14,5 @@
13
14
  "wllama/single-thread/wllama.wasm",
14
15
  "wllama/multi-thread/wllama.wasm"
15
16
  ],
16
- "builtAt": "2026-07-03T02:08:19.009Z"
17
+ "builtAt": "2026-07-21T13:30:10.105Z"
17
18
  }