@iicp/client 0.7.37 → 0.7.39

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
@@ -73,6 +73,24 @@ const result = await client.submit({
73
73
 
74
74
  ---
75
75
 
76
+ ## Use as a local API proxy (OpenAI / Ollama / Anthropic compat)
77
+
78
+ Run a local gateway that speaks the OpenAI, Ollama, and Anthropic HTTP APIs and routes
79
+ every request across the IICP mesh — point any tool you already use at it, no code changes.
80
+
81
+ ```bash
82
+ npm i -g @iicp/client
83
+ iicp-node proxy # → http://127.0.0.1:9483
84
+
85
+ export OPENAI_BASE_URL=http://127.0.0.1:9483/v1 # OpenAI SDK / LangChain / Cursor / liteLLM
86
+ export OLLAMA_HOST=http://127.0.0.1:9483 # Open WebUI / Continue.dev / aider / Jan
87
+ ```
88
+
89
+ Loopback-only consumer (never registers with the directory), built on Node's `http` (no
90
+ extra runtime dependency). Override the port with `--port` / `IICP_PROXY_PORT`; co-host
91
+ next to a node with `iicp-node serve --with-proxy`. Every response carries
92
+ `Server: iicp-proxy`. Full guide: <https://iicp.network/docs/proxy>
93
+
76
94
  ## Configuration
77
95
 
78
96
  ```typescript
@@ -308,6 +326,30 @@ IICP_RELAY_WORKER_ENDPOINT=host:9485 # specific relay instead of auto-elect
308
326
 
309
327
  ---
310
328
 
329
+ ## Operator identity
330
+
331
+ Your **operator identity** is an ed25519 keypair — its public key *is* your `operator_id` (the
332
+ directory stores it as `operator_pubkey`). One identity spans every node you run: it binds them to
333
+ you (nodes show **`Operated by <your name>` ✓**), earns a
334
+ [founder ordinal](https://iicp.network/founders), and rolls each node's credits into one operator
335
+ wallet. Your `display_name` is the public, mutable handle; your contact stays local.
336
+
337
+ ```bash
338
+ iicp-node init # create your key-backed identity (~/.iicp/operator.json)
339
+ iicp-node serve --node mynode # signs an operator→node delegation; binds the node to you
340
+ iicp-node operator rename "NewName" # change your public display_name (signed)
341
+ iicp-node operator encrypt # password-encrypt the secret at rest ($IICP_OPERATOR_PASSPHRASE)
342
+ iicp-node operator decrypt # remove at-rest encryption
343
+ ```
344
+
345
+ **The key is the identity** — whoever holds `~/.iicp/operator.json` controls it (its nodes, ordinal,
346
+ and wallet); there is no central recovery. Back it up (encrypted), never commit or share it; lose it
347
+ and the identity, with its founder ordinal, is gone.
348
+
349
+ Full guide: **[iicp.network/docs/operator-identity](https://iicp.network/docs/operator-identity)**
350
+
351
+ ---
352
+
311
353
  ## SDK conformance
312
354
 
313
355
  | Rule | Description | Status |
@@ -328,7 +370,7 @@ Conformance tier: `iicp:sdk:v1` (spec S.14) · [Request a badge](https://iicp.ne
328
370
  ```bash
329
371
  npm install # install deps
330
372
  npm run typecheck # tsc strict
331
- npm test # 224 unit tests
373
+ npm test # run the unit suite
332
374
  npm run build # emit to dist/
333
375
  ```
334
376
 
package/dist/cli.d.ts CHANGED
@@ -21,7 +21,19 @@ export interface ServeOpts {
21
21
  relayWorkerEndpoint: string;
22
22
  node: string;
23
23
  logDir?: string;
24
+ withProxy?: boolean;
24
25
  }
25
26
  export declare function applySavedNode(opts: ServeOpts, saved: NodeIdentity): ServeOpts;
27
+ /**
28
+ * #456 --verify: cryptographically confirm this node's CREDIT_AWARD income against the
29
+ * directory's signed event log (defends against a lying directory). Resolves the directory's
30
+ * Ed25519 key from /.well-known/did.json and re-derives + verifies each award signature.
31
+ * Free-tier CREDIT_ALLOCATION is unsigned by design, so it is not counted here (no cry-wolf).
32
+ */
33
+ export declare function verifyCreditAwards(directoryUrl: string, nodeId: string): Promise<{
34
+ sum: number;
35
+ verified: number;
36
+ failed: number;
37
+ }>;
26
38
  export declare function main(argv?: string[]): Promise<number>;
27
39
  //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAiCA,OAAO,EASL,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AAEvB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