@iicp/web-node 0.2.2 → 0.2.3

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/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Browser-native **IICP node** for the [IICP](https://iicp.network) mesh — **consume** AI
4
4
  from the network *and* **serve** a model from a browser tab. ESM, built on the platform's
5
- native `fetch` / `SubtleCrypto` / WebGPU (and runs in Node ≥18). End-to-end payload
6
- encryption is **mandatory** and on by default.
5
+ native `fetch` / `SubtleCrypto` / WebGPU (and runs in Node ≥18). The browser
6
+ client refuses keyless providers rather than silently sending plaintext.
7
7
 
8
8
  ```
9
9
  npm install @iicp/web-node
@@ -47,6 +47,9 @@ Browser providers advertise a generated `cx_public_key`, decrypt incoming `iicp_
47
47
  payloads locally, report task success/failure/latency in heartbeats, and use a relay path
48
48
  because browser tabs cannot accept raw inbound TCP.
49
49
 
50
+ Browser provider mode is experimental. Tab lifetime, relay availability,
51
+ browser policy and device resources make it unsuitable for unattended service.
52
+
50
53
  Startup is intentionally ticketed: the provider registers, requests a short-lived relay
51
54
  bind ticket scoped to its worker and selected relay, and presents that ticket when it binds.
52
55
  Authentication or validation failures stop serving and clean up the temporary directory
@@ -64,6 +67,13 @@ Serving requires WebLLM — add it alongside this package:
64
67
  npm install @mlc-ai/web-llm # peer dependency, only needed to serve
65
68
  ```
66
69
 
70
+ ## Version metadata
71
+
72
+ Browser package identity and directory compatibility are separate values. Provider
73
+ registration reports `implementation_name=@iicp/web-node`, the package
74
+ `implementation_version`, and `sdk_compatibility_version`; the legacy
75
+ `sdk_version` field remains the compatibility alias for older directories.
76
+
67
77
  ## Encryption
68
78
 
69
79
  IICP-CX (S.16) Tier-1: ephemeral **X25519** key agreement → **HKDF-SHA256** →
@@ -82,3 +92,9 @@ restriction and everything works.
82
92
  ## License
83
93
 
84
94
  Apache-2.0. Part of the open [IICP protocol](https://github.com/RobLe3/IICP).
95
+
96
+ ## Documentation
97
+
98
+ - [Connect an AI agent](https://github.com/RobLe3/IICP/blob/main/docs/agent-bootstrap.md)
99
+ - [Browser-node guide](https://iicp.network/browser-node)
100
+ - [Official implementation registry](https://github.com/RobLe3/IICP/blob/main/IMPLEMENTATIONS.md)
@@ -31,7 +31,7 @@ export interface BrowserProviderDiagnostic {
31
31
  relay_bound: boolean;
32
32
  tasks_served: number;
33
33
  }
34
- export declare const BROWSER_NODE_SDK_VERSION = "0.7.86-browser";
34
+ export { BROWSER_NODE_SDK_VERSION } from "./version.js";
35
35
  /**
36
36
  * Coarse region autodetect from the browser's timezone (no network, no
37
37
  * geolocation permission). Matches the mesh's region convention
@@ -18,8 +18,9 @@
18
18
  // consumers route to a browser worker with zero client changes.
19
19
  import { maskTunnelUrl } from "./iicpConsumer.js";
20
20
  import { createCxKeyPair, decryptPayload } from "./cxConfidentiality.js";
21
+ import { BROWSER_NODE_SDK_COMPATIBILITY_VERSION, BROWSER_NODE_SDK_VERSION, BROWSER_NODE_VERSION, } from "./version.js";
21
22
  const CHAT_INTENT = "urn:iicp:intent:llm:chat:v1";
22
- export const BROWSER_NODE_SDK_VERSION = "0.7.86-browser";
23
+ export { BROWSER_NODE_SDK_VERSION } from "./version.js";
23
24
  /**
24
25
  * Coarse region autodetect from the browser's timezone (no network, no
25
26
  * geolocation permission). Matches the mesh's region convention
@@ -276,7 +277,14 @@ export class BrowserNodeProvider {
276
277
  relay_transport: "http-poll",
277
278
  },
278
279
  sdk_language: "browser",
280
+ // Old directories retain sdk_version as the compatibility fallback.
279
281
  sdk_version: BROWSER_NODE_SDK_VERSION,
282
+ // Newer projections can expose the implementation and compatibility
283
+ // axes independently. Unknown registration fields are safely ignored
284
+ // by older directory releases.
285
+ implementation_name: "@iicp/web-node",
286
+ implementation_version: BROWSER_NODE_VERSION,
287
+ sdk_compatibility_version: BROWSER_NODE_SDK_COMPATIBILITY_VERSION,
280
288
  // The current directory contract accepts native backend identifiers
281
289
  // plus "custom". Browser/WebLLM providers are non-native providers,
282
290
  // so advertise them as custom until the protocol taxonomy grows a
@@ -0,0 +1,8 @@
1
+ {
2
+ "schema": "iicp.browser_build_provenance.v1",
3
+ "package": "@iicp/web-node",
4
+ "implementation_version": "0.2.3",
5
+ "sdk_compatibility_version": "0.7.101",
6
+ "source_commit": "1d1e5612e237894735e05526d36dfebeec3ee53e",
7
+ "lockfile_sha256": "1dea1f6057741f225d03d4b96cd9f963bc70623cc126e2d65f80984fb8f8c85c"
8
+ }
package/dist/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export * from "./iicpConsumer.js";
2
2
  export * from "./cxConfidentiality.js";
3
3
  export * from "./browserNodeProvider.js";
4
4
  export * from "./webllmRuntime.js";
5
+ export * from "./version.js";
package/dist/index.js CHANGED
@@ -9,3 +9,4 @@ export * from "./iicpConsumer.js";
9
9
  export * from "./cxConfidentiality.js";
10
10
  export * from "./browserNodeProvider.js";
11
11
  export * from "./webllmRuntime.js";
12
+ export * from "./version.js";
@@ -0,0 +1,4 @@
1
+ export declare const BROWSER_NODE_VERSION = "0.2.3";
2
+ export declare const BROWSER_NODE_SDK_COMPATIBILITY_VERSION = "0.7.101";
3
+ /** Backward-compatible registration value for directories that know only sdk_version. */
4
+ export declare const BROWSER_NODE_SDK_VERSION = "0.7.101";
@@ -0,0 +1,7 @@
1
+ // Browser implementation and IICP SDK-compatibility versions are separate axes.
2
+ // Keep package.json synchronized with BROWSER_NODE_VERSION; the quality gate
3
+ // rejects drift. SDK compatibility describes the registration contract only.
4
+ export const BROWSER_NODE_VERSION = "0.2.3";
5
+ export const BROWSER_NODE_SDK_COMPATIBILITY_VERSION = "0.7.101";
6
+ /** Backward-compatible registration value for directories that know only sdk_version. */
7
+ export const BROWSER_NODE_SDK_VERSION = BROWSER_NODE_SDK_COMPATIBILITY_VERSION;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iicp/web-node",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Browser-native IICP node (consume + serve): discovery-mesh client with mandatory E2E encryption (IICP-CX) + WebLLM provider. Zero-config, ESM.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -19,9 +19,10 @@
19
19
  ],
20
20
  "sideEffects": false,
21
21
  "scripts": {
22
- "build": "tsc -p tsconfig.json",
22
+ "build": "tsc -p tsconfig.json && node scripts/check-package-provenance.mjs",
23
23
  "typecheck": "tsc -p tsconfig.json --noEmit",
24
- "test": "tsx --test tests/*.test.ts"
24
+ "test": "tsx --test tests/*.test.ts",
25
+ "package:audit": "npm pack --dry-run --json > /tmp/iicp-web-node-pack.json && node -e \"const p=require('/tmp/iicp-web-node-pack.json')[0]; if (!p.files.some(f=>f.path==='dist/build-manifest.json')) process.exit(1); if (p.files.some(f=>/(^|\\/)(\\.env|credentials?|node_modules)(\\/|$)/i.test(f.path))) process.exit(1)\""
25
26
  },
26
27
  "keywords": [
27
28
  "iicp",