lightnode-sdk 0.7.18 → 0.7.19

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 (3) hide show
  1. package/README.md +18 -0
  2. package/dist/cli.js +36 -8
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -464,17 +464,35 @@ PRIVATE_KEY=0x... npx lightnode worker deregister --yes # clear stuck + settl
464
464
 
465
465
  ### Scaffolders (write files into your project)
466
466
 
467
+ Server-paid (you host a backend; your funded wallet pays per call):
468
+
467
469
  ```bash
468
470
  npx lightnode add inference # encrypted inference route or script
469
471
  npx lightnode add chat # chat UI with conversation history
472
+ npx lightnode add judge # pass/fail evaluator route (criteria + evidence)
470
473
  npx lightnode add agent # scheduled inference (Vercel Cron / setInterval)
471
474
  npx lightnode add analytics-dashboard # read-only network + worker analytics page
472
475
  npx lightnode add nft-mint-with-inference # AI-generated NFT metadata with on-chain provenance
473
476
  ```
474
477
 
478
+ User-paid (no backend; each visitor signs + pays from their own wallet):
479
+
480
+ ```bash
481
+ npx lightnode add inference-web3 # one-shot inference UI, wallet-signed
482
+ npx lightnode add chat-web3 # chat UI, wallet-signed (mainnet + testnet aware)
483
+ npx lightnode add judge-web3 # evaluator UI, wallet-signed
484
+ npx lightnode add wagmi-setup # wallet wiring: lib/wagmi + providers + connect button
485
+ ```
486
+
487
+ The `*-web3` scaffolders and `wagmi-setup` write Next.js pages, so run them
488
+ inside a Next.js app (`npx create-next-app@latest .` first if you have none).
489
+
475
490
  All `add` commands accept `--template auto|nextjs-api|hono|node`,
476
491
  `--net testnet|mainnet`, and `--force`.
477
492
 
493
+ > If `add <name>` reports an unknown target, your `npx` cache is serving an
494
+ > older CLI. Force the current release: `npx lightnode-sdk@latest add <name>`.
495
+
478
496
  ## Networks
479
497
 
480
498
  | | Testnet | Mainnet |
package/dist/cli.js CHANGED
@@ -62,13 +62,20 @@ Ecosystem (read-only):
62
62
  dao addresses print LCAI Governor + Timelock + Treasury addresses
63
63
  dao config print voting delay / period / threshold (live read)
64
64
 
65
- Scaffold templates into the current project:
66
- add inference end-to-end encrypted inference route/script
67
- add chat chat-style UI with conversation history
68
- add agent scheduled/loop inference (cron-style)
69
- add analytics-dashboard read-only network + worker analytics page
70
- add nft-mint-with-inference AI-generated NFT metadata (provenance on-chain)
71
- (all add commands: [--template auto|nextjs-api|hono|node] [--force])
65
+ Scaffold templates into the current project (run inside a Next.js app):
66
+ Server-paid (you host a backend; your funded wallet pays per call):
67
+ add inference end-to-end encrypted inference route/script
68
+ add chat chat-style UI with conversation history
69
+ add judge pass/fail evaluator route (criteria + evidence)
70
+ add agent scheduled/loop inference (cron-style)
71
+ add analytics-dashboard read-only network + worker analytics page
72
+ add nft-mint-with-inference AI-generated NFT metadata (provenance on-chain)
73
+ User-paid (no backend; each visitor signs + pays from their own wallet):
74
+ add inference-web3 one-shot inference UI, wallet-signed
75
+ add chat-web3 chat UI, wallet-signed (mainnet + testnet aware)
76
+ add judge-web3 evaluator UI, wallet-signed
77
+ add wagmi-setup wallet wiring: lib/wagmi + providers + connect button
78
+ (all add commands: [--template auto|nextjs-api|hono|node] [--net testnet|mainnet] [--force])
72
79
 
73
80
  To scaffold a new project instead, run: npm create lightnode-app my-app`;
74
81
  function pickKey() {
@@ -464,7 +471,18 @@ async function main() {
464
471
  const network = (net === "mainnet" ? "mainnet" : "testnet");
465
472
  const known = ["inference", "inference-web3", "chat", "chat-web3", "judge", "judge-web3", "wagmi-setup", "agent", "analytics-dashboard", "nft-mint-with-inference"];
466
473
  if (!known.includes(sub ?? "")) {
467
- die(`usage: lightnode add <${known.join("|")}> [--template auto|nextjs-api|hono|node] [--net testnet|mainnet] [--force]`);
474
+ const lines = [
475
+ `usage: lightnode add <${known.join("|")}> [--template auto|nextjs-api|hono|node] [--net testnet|mainnet] [--force]`,
476
+ ];
477
+ // If the requested name is valid in a newer release but missing here,
478
+ // the user is almost certainly running a stale npx-cached CLI. Point
479
+ // them at @latest rather than letting them think the command is gone.
480
+ if (sub) {
481
+ lines.push("");
482
+ lines.push(`unknown add target "${sub}". If you expected this to work, you may be on an`);
483
+ lines.push(`older cached CLI. Force the current version: npx lightnode-sdk@latest add ${sub}`);
484
+ }
485
+ die(lines.join("\n"));
468
486
  }
469
487
  const result = sub === "analytics-dashboard" ? addAnalyticsDashboard({ template, network, force })
470
488
  : sub === "nft-mint-with-inference" ? addNftMint({ template, network, force })
@@ -488,6 +506,16 @@ async function main() {
488
506
  console.log("\nNothing to do - all target files already exist. Pass --force to overwrite.");
489
507
  }
490
508
  else {
509
+ // The *-web3 pages and wagmi-setup are Next.js React files. If no
510
+ // Next.js app was detected (e.g. an empty folder), nothing can render
511
+ // what we just wrote - surface that before the numbered steps so the
512
+ // user scaffolds an app first instead of chasing a non-running page.
513
+ const isNextOnly = sub === "chat-web3" || sub === "inference-web3" || sub === "judge-web3" || sub === "wagmi-setup";
514
+ if (isNextOnly && result.template !== "nextjs-api") {
515
+ console.log(`\nNo Next.js app detected in this folder. ${sub} is a Next.js page, so`);
516
+ console.log(`create one here first, then re-run this command:`);
517
+ console.log(` npx create-next-app@latest .`);
518
+ }
491
519
  console.log(`\nNext steps (these files were added to your CURRENT folder, not a new project):`);
492
520
  console.log(` 1. ${result.install}`);
493
521
  if (sub === "wagmi-setup") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lightnode-sdk",
3
- "version": "0.7.18",
3
+ "version": "0.7.19",
4
4
  "description": "Read-only TypeScript client for LightChain AI: workers, jobs, models, on-chain registration, and per-model network analytics. Independent, community-built (not an official LightChain package).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",