@openrai/nano-core 2.0.0 → 2.3.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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <div align="center">
2
2
  <h1>@openrai/nano-core</h1>
3
- <p><b>The unopinionated, statically-typed, isomorphic protocol engine for the Nano (XNO) ecosystem.</b></p>
3
+ <p><b>Typed Nano primitives plus practical client utilities for RPC, WebSocket, and work generation.</b></p>
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@openrai/nano-core.svg?style=flat-square)](https://www.npmjs.com/package/@openrai/nano-core)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT)
@@ -9,20 +9,7 @@
9
9
 
10
10
  ---
11
11
 
12
- Historically, Nano developers have faced a fragmented integration landscape: ranging from "heavy, enterprise:y" backends to lightweight "frontend-only" implementation, suffering either from rigid vendor lock-in or fragile PoW architecture.
13
-
14
- **`@openrai/nano-core`** aims to be the canonical TypeScript Nano package: typed primitives, sane defaults, transport failover, endpoint normalization, auth handling, and a stable first-party API surface even when the internals wrap other best-of-breed libraries.
15
-
16
- ---
17
-
18
- ## 🚀 Key Features
19
-
20
- * **Bypassing the "Frontier Dilemma":** Nano is a state-based block-lattice where each block depends strictly on the exact final state of the previous frontier. This strong design choise is one of the main reasons why Nano can be feeless and energy efficient, but it often becomes a stumbling block for integrations. `@openrai/nano-core` provides internal concurrent Mutex queuing to perfectly sequentialize blocks even under heavy asynchronous loads, eliminating "Fork" or "Gap" errors.
21
- * **Isomorphic Proof-of-Work (JIT Profiling):** Wraps `nano-pow-with-fallback` in a Just-In-Time (JIT) environment profiler via `WorkProvider.auto()`. What it means is that whether running on an Apple Silicon Node.js server (jumping straight to local WebGPU) or on an aging mobile browser (delegating safely to remote servers by default), which generation method to use can be decided dynamically, without UI blocking or interfering with the current user flow.
22
- * **No Primitive-Obsession:** Heavily-typed, precision-safe wrappers for `NanoAmount` and `NanoAddress` entirely eliminate the "Stringly-Typed Money" programming anti-pattern.
23
- * **Resilient RPC / WS / Work Fallbacks:** Endpoint pools validate eagerly, deduplicate, apply endpoint-local exponential backoff, and only fail once all viable options are exhausted.
24
- * **Secret-Safe Endpoint Normalization:** API keys from query params or URL userinfo are converted into structured auth metadata and redacted from canonical URLs and audit output.
25
- * **Cross-Language FFI Preparation**: The TypeScript architecture strictly follows Domain-Driven Design (DDD) to promote close API compatibility across different eventual programming language ports of the library.
12
+ `@openrai/nano-core` provides typed Nano primitives and a small transport layer for applications that need reliable RPC, WebSocket, and work generation behavior without rebuilding endpoint parsing, auth handling, failover, or audit visibility. It is designed for direct use in services, scripts, and browser-capable clients, with explicit defaults and observable transport state.
26
13
 
27
14
  ## 📦 Installation
28
15
 
@@ -58,6 +45,31 @@ const client = NanoClient.initialize({
58
45
  console.log(client.getAuditReport());
59
46
  ```
60
47
 
48
+ ### 1.1 Observe Endpoint Selection
49
+
50
+ Long-running services can observe which upstream endpoint became active without
51
+ mutating transport configuration at runtime:
52
+
53
+ ```typescript
54
+ import { NanoClient } from '@openrai/nano-core';
55
+
56
+ const client = NanoClient.initialize();
57
+
58
+ const unsubscribe = client.onEndpointChange((event) => {
59
+ console.log(event.kind, event.status, event.activeUrl, event.previousUrl);
60
+ });
61
+
62
+ console.log(client.getActiveEndpoints());
63
+ // { rpc?: string, ws?: string, work?: string }
64
+
65
+ // Later:
66
+ unsubscribe();
67
+ ```
68
+
69
+ This is an observe-only API. It does not reconfigure pools or alter failover
70
+ policy; it simply exposes which endpoint was selected after a successful RPC,
71
+ WS, or work operation.
72
+
61
73
  What this buys you immediately:
62
74
 
63
75
  - comma-separated env vars also work: `NANO_RPC_URL`, `NANO_WS_URL`, `NANO_WORK_URL`
@@ -131,12 +143,14 @@ const client = NanoClient.initialize({
131
143
  ```
132
144
 
133
145
  ### 4. Isomorphic Work Calibration
134
- It's critical not to freeze the browser threads. On boot, evaluate the environment. `nano-core` remembers the hardware constraints across sessions.
146
+ `nano-core` can probe remote and local work capabilities asynchronously, then build an execution plan without doing any heavyweight work in constructors. When `profiler.mode` is `auto`, call `probe()` or `calibrate()` explicitly during startup and reuse the resulting plan for later work generation.
135
147
 
136
148
  ```typescript
137
- // Auto-detects whether local WebGPU/WASM is faster than network latency to remotes
149
+ const plan = await client.workProvider.probe();
150
+ console.log(plan.steps);
151
+
138
152
  const profile = await client.workProvider.calibrate();
139
- console.log(`Determined active PoW strategy: ${profile.activeStrategy} at ${profile.measuredMhs} MH/s.`);
153
+ console.log(profile.activeStrategy);
140
154
  ```
141
155
 
142
156
  ### 5. Precision-Safe Execution
@@ -181,29 +195,26 @@ For collaboration, please refer to the `github.com/OpenRai/nano-core` issues boa
181
195
 
182
196
  ---
183
197
 
184
- ## Addendum II: Browser Hostility & The Isomorphic Sandbox
198
+ See `docs/architecture/transport-auth.md` for the transport/auth design. More advanced local-vs-remote work profiling is planned but not implemented in the current release.
185
199
 
186
- ### 1. The Browser Execution Reality
200
+ ## Release Flow
187
201
 
188
- While Node.js provides unthrottled access to host silicon (delivering ~104 MH/s on Apple M1 architectures), browsers operate under strict security and power-management sandboxes. Empirical testing across modern Chromium (Brave) and WebKit (Safari) engines reveals that relying on static hardware fallbacks in a web environment is a critical architectural risk.
202
+ `@openrai/nano-core` is a single-package repo, so versioning is manual and publishing is automated.
189
203
 
190
- Browser engines dynamically throttle compute APIs based on task duration and thread count, leading to three distinct phenomena that the SDK must navigate:
204
+ Typical release steps:
191
205
 
192
- #### A. The WebGPU "Throttle Cliff" (Sprint vs. Marathon)
193
- WebGPU is highly unpredictable in the browser.
194
- * **The Burst:** On low-difficulty thresholds (e.g., `Open/Receive`), browsers allow WebGPU to run at maximum voltage, completing the task in milliseconds (bursting up to ~2,000 MH/s in Safari).
195
- * **The Throttle:** [Inference] On high-difficulty thresholds (e.g., `Send/Change`), the task takes longer. Once the compute shader runs past a specific time budget (often 1-2 seconds), browser watchdogs classify it as a runaway script or a crypto-miner. The engine violently throttles the GPU context to protect the UI thread, causing HashRates to collapse by up to 98% (e.g., dropping from 336 MH/s to 7.5 MH/s in Chromium).
206
+ 1. Bump the package version:
196
207
 
197
- #### B. The WASM "Death Spiral" (Thread Starvation)
198
- Counter-intuitively, spawning multiple Web Workers for WASM computation degrades performance in aggressive sandboxes like Safari.
199
- * [Inference] When the SDK requests 8 parallel WASM threads for a sustained `Send/Change` calculation, the browser's resource scheduler intervenes to prevent thermal throttling and battery drain. It starves the workers of CPU cycles, resulting in multi-threaded executions taking significantly *longer* than single-threaded executions (e.g., spanning upwards of 4.5 minutes for a single block).
208
+ ```bash
209
+ pnpm version patch
210
+ ```
200
211
 
201
- #### C. WebGL: The Predictable Baseline
202
- Across all tested engines, WebGL is the most consistently paced API. Because it taps into the legacy rendering pipeline, browsers are less likely to violently throttle it mid-task. It maintains a slow but predictable ~15 MH/s regardless of the threshold difficulty.
212
+ or, without git side effects:
203
213
 
204
- ### 2. Conclusion: The Necessity of JIT Profiling
214
+ ```bash
215
+ pnpm version patch --no-git-tag-version
216
+ ```
205
217
 
206
- These findings conclusively validate the `WorkProvider.auto()` architecture. The SDK cannot assume local hardware is safe just because `navigator.gpu` exists.
218
+ 2. Push the version commit and tag to `main`.
207
219
 
208
- The JIT Environment Profiler must execute a sub-50ms micro-probe on load. If the probe detects a sandboxed environment where a `Send` block will trigger the "Throttle Cliff" (taking >5 seconds), the SDK must intelligently route the work to a remote BPoW server, ensuring the application remains responsive and the user's battery is preserved.
209
- See `docs/architecture/transport-auth.md` for the full transport/auth design.
220
+ GitHub Actions then builds, tests, and publishes from `.github/workflows/release.yml` using npm Trusted Publisher.
package/dist/client.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { HttpEndpointPool } from './transport/http.js';
2
2
  import { WsEndpointPool } from './transport/ws.js';
3
3
  import { WorkProvider } from './work/WorkProvider.js';
4
+ import type { EndpointActivityEvent, EndpointAuditRecord } from './transport/types.js';
4
5
  export interface TransportFallback {
5
6
  urls: string[];
6
7
  }
@@ -16,18 +17,33 @@ export interface NanoClientOptions {
16
17
  workProvider?: WorkProvider;
17
18
  warn?: (message: string) => void;
18
19
  }
20
+ export interface NanoClientActiveEndpoints {
21
+ rpc?: string;
22
+ ws?: string;
23
+ work?: string;
24
+ }
25
+ export interface NanoClientAuditReport {
26
+ network: 'mainnet' | 'testnet' | 'beta';
27
+ rpc: EndpointAuditRecord[];
28
+ ws: EndpointAuditRecord[];
29
+ workProvider: ReturnType<WorkProvider['getAuditReport']>;
30
+ }
19
31
  export declare class NanoClient {
20
32
  workProvider: WorkProvider;
21
33
  rpcPool: HttpEndpointPool;
22
34
  wsPool: WsEndpointPool;
23
35
  private options;
36
+ private readonly endpointListeners;
37
+ private readonly activeEndpoints;
24
38
  private constructor();
25
39
  static initialize(options?: NanoClientOptions): NanoClient;
40
+ onEndpointChange(listener: (event: EndpointActivityEvent) => void): () => void;
41
+ getActiveEndpoints(): NanoClientActiveEndpoints;
26
42
  /**
27
43
  * Generates a minimal JSON-serializable report of the active configuration.
28
44
  * Useful for deploy-time auditing and startup logs to detect misconfigurations.
29
45
  */
30
- getAuditReport(): Record<string, any>;
46
+ getAuditReport(): NanoClientAuditReport;
31
47
  hydrateWallet(seed: string, options?: {
32
48
  index?: number;
33
49
  }): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAwB,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAsB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,YAAY,EAA4B,MAAM,wBAAwB,CAAC;AAEhF,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,eAAO,MAAM,iBAAiB;eACjB,MAAM,EAAE,KAAG,iBAAiB;CACxC,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,SAA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,GAAG;;CAK3C"}
package/dist/client.js CHANGED
@@ -9,9 +9,19 @@ export class NanoClient {
9
9
  rpcPool;
10
10
  wsPool;
11
11
  options;
12
+ endpointListeners;
13
+ activeEndpoints;
12
14
  constructor(options) {
13
15
  this.options = options;
16
+ this.endpointListeners = new Set();
17
+ this.activeEndpoints = {};
14
18
  const warn = options.warn ?? ((message) => console.warn(`[nano-core] ${message}`));
19
+ const forwardEndpointChange = (event) => {
20
+ this.activeEndpoints[event.kind] = event.activeUrl;
21
+ for (const listener of this.endpointListeners) {
22
+ listener(event);
23
+ }
24
+ };
15
25
  const defaultRpc = [
16
26
  'https://rpc.nano.to',
17
27
  'https://node.somenano.com/proxy',
@@ -28,6 +38,7 @@ export class NanoClient {
28
38
  kind: 'rpc',
29
39
  defaults: defaultRpc,
30
40
  warn,
41
+ onActiveEndpointChange: forwardEndpointChange,
31
42
  };
32
43
  if (rpcUrls && rpcUrls.length > 0)
33
44
  rpcOptions.urls = rpcUrls;
@@ -37,6 +48,7 @@ export class NanoClient {
37
48
  const wsOptions = {
38
49
  defaults: defaultWs,
39
50
  warn,
51
+ onActiveEndpointChange: forwardEndpointChange,
40
52
  };
41
53
  if (options.ws && options.ws.length > 0)
42
54
  wsOptions.urls = options.ws;
@@ -46,6 +58,7 @@ export class NanoClient {
46
58
  const workOptions = {
47
59
  defaults: defaultWork,
48
60
  warn,
61
+ onActiveEndpointChange: forwardEndpointChange,
49
62
  };
50
63
  if (options.work && options.work.length > 0)
51
64
  workOptions.urls = options.work;
@@ -56,6 +69,17 @@ export class NanoClient {
56
69
  static initialize(options = {}) {
57
70
  return new NanoClient(options);
58
71
  }
72
+ onEndpointChange(listener) {
73
+ this.endpointListeners.add(listener);
74
+ return () => this.endpointListeners.delete(listener);
75
+ }
76
+ getActiveEndpoints() {
77
+ return {
78
+ ...(this.activeEndpoints.rpc ? { rpc: this.activeEndpoints.rpc } : {}),
79
+ ...(this.activeEndpoints.ws ? { ws: this.activeEndpoints.ws } : {}),
80
+ ...(this.activeEndpoints.work ? { work: this.activeEndpoints.work } : {}),
81
+ };
82
+ }
59
83
  /**
60
84
  * Generates a minimal JSON-serializable report of the active configuration.
61
85
  * Useful for deploy-time auditing and startup logs to detect misconfigurations.
@@ -65,7 +89,7 @@ export class NanoClient {
65
89
  network: this.options.network ?? 'mainnet',
66
90
  rpc: this.rpcPool.getAuditReport(),
67
91
  ws: this.wsPool.getAuditReport(),
68
- workProvider: this.workProvider.getAuditReport()
92
+ workProvider: this.workProvider.getAuditReport(),
69
93
  };
70
94
  }
71
95
  async hydrateWallet(seed, options = {}) {
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAwB,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAsB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,YAAY,EAA4B,MAAM,wBAAwB,CAAC;AAMhF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,EAAE,EAAE,CAAC,IAAc,EAAqB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;CACtD,CAAC;AAYF,MAAM,OAAO,UAAU;IACd,YAAY,CAAe;IAC3B,OAAO,CAAmB;IAC1B,MAAM,CAAiB;IACtB,OAAO,CAAoB;IAEnC,YAAoB,OAA0B;QAC5C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,OAAO,EAAE,CAAC,CAAC,CAAC;QAC3F,MAAM,UAAU,GAAG;YACjB,qBAAqB;YACrB,iCAAiC;YACjC,4BAA4B;YAC5B,6BAA6B;SAC9B,CAAC;QACF,MAAM,SAAS,GAAG,CAAC,mBAAmB,CAAC,CAAC;QACxC,MAAM,WAAW,GAAG,CAAC,qBAAqB,CA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ACL,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACtE,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACnE,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1E,CAAC;IACJ,CAAC;IAED;;;OAGG;IACI,cAAc;QACnB,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS;YAC1C,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE;YAClC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE;YAChC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE;SACjD,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,IAAY,EAAE,UAA8B,EAAE;QACvE,wCAAwC;QACxC,OAAO;YACL,IAAI,EAAE,KAAK,EAAE,OAAY,EAAE,MAAW,EAAE,EAAE;gBACxC,OAAO,YAAY,CAAC;YACtB,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { NanoAddress } from './primitives/NanoAddress.js';
2
2
  export { NanoAmount } from './primitives/NanoAmount.js';
3
3
  export { WorkProvider, RemoteWorkServer, LocalCompute, type WorkProviderOptions } from './work/WorkProvider.js';
4
- export { NanoClient, TransportFallback, type NanoClientOptions } from './client.js';
4
+ export { NanoClient, TransportFallback, type NanoClientOptions, type NanoClientActiveEndpoints, type NanoClientAuditReport } from './client.js';
5
5
  export { EndpointPool, HttpEndpointPool, NanoTransportConfigError, WsEndpointPool, normalizeEndpoints, } from './transport/index.js';
6
6
  export type { AuthSource, EndpointActivityEvent, EndpointAuditRecord, EndpointAuth, EndpointKind, EndpointPoolOptions, EndpointState, NormalizedEndpoint, TransportPolicy, } from './transport/index.js';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACpF,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,EACd,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,UAAU,EACV,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,eAAe,GAChB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,KAAK,yBAAyB,EAAE,KAAK,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAChJ,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,EACd,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,UAAU,EACV,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,eAAe,GAChB,MAAM,sBAAsB,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAA4B,MAAM,wBAAwB,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAA0B,MAAM,aAAa,CAAC;AACpF,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,EACd,kBAAkB,GACnB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAA4B,MAAM,wBAAwB,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAsF,MAAM,aAAa,CAAC;AAChJ,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,EACd,kBAAkB,GACnB,MAAM,sBAAsB,CAAC"}
@@ -1,15 +1,38 @@
1
- /**
2
- * Local compute engines available.
3
- */
1
+ import type { EndpointActivityEvent, EndpointAuditRecord } from '../transport/types.js';
2
+ import { PowBackendName } from 'nano-pow-with-fallback';
4
3
  export declare enum LocalCompute {
5
4
  WEBGPU = "webgpu",
6
5
  WEBGL = "webgl",
7
- WASM_THREADS = "wasm",
8
- CPU = "cpu"
6
+ WASM = "wasm"
7
+ }
8
+ type PowBackendNameValue = typeof PowBackendName[keyof typeof PowBackendName];
9
+ type WorkPlanStepKind = 'remote' | 'webgpu' | 'webgl' | 'wasm';
10
+ export interface WorkCalibrationProfile {
11
+ measuredMhs: number;
12
+ activeStrategy: 'remote-first' | 'planned';
13
+ }
14
+ export interface WorkGenerationTrace {
15
+ mode: 'remote' | 'local';
16
+ backend?: PowBackendNameValue;
17
+ }
18
+ export interface WorkProbeResult {
19
+ kind: WorkPlanStepKind;
20
+ available: boolean;
21
+ durationMs?: number;
22
+ reason?: string;
23
+ }
24
+ export interface WorkPlanStep {
25
+ kind: WorkPlanStepKind;
26
+ }
27
+ export interface WorkExecutionPlan {
28
+ source: 'default' | 'probe';
29
+ steps: WorkPlanStep[];
30
+ disabledLocalBackends: PowBackendNameValue[];
31
+ probeResults: WorkProbeResult[];
9
32
  }
10
33
  export declare class RemoteWorkServer {
11
- private _url;
12
- private _timeoutMs;
34
+ private readonly _url;
35
+ private readonly _timeoutMs;
13
36
  constructor(url: string, timeoutMs: number);
14
37
  get url(): string;
15
38
  get timeoutMs(): number;
@@ -23,6 +46,8 @@ export interface WorkProviderOptions {
23
46
  env?: string;
24
47
  defaults?: string[];
25
48
  warn?: (message: string) => void;
49
+ onActiveEndpointChange?: (event: EndpointActivityEvent) => void;
50
+ timeoutMs?: number;
26
51
  remotes?: RemoteWorkServer[];
27
52
  localChain?: LocalCompute[];
28
53
  profiler?: {
@@ -32,25 +57,41 @@ export interface WorkProviderOptions {
32
57
  };
33
58
  }
34
59
  export declare class WorkProvider {
35
- private options;
36
- private remotePool;
60
+ private readonly options;
61
+ private readonly remotePool;
62
+ private readonly warn;
63
+ private readonly localTimeoutMs;
64
+ private lastGenerationTrace;
65
+ private lastProbeResults;
66
+ private executionPlan;
67
+ private probePromise;
37
68
  private constructor();
38
69
  static auto(options: WorkProviderOptions): WorkProvider;
39
- /**
40
- * Generates a minimal JSON-serializable report of the work provider's active configuration.
41
- */
42
- getAuditReport(): Record<string, any>;
43
- /**
44
- * Calibrates the work provider based on the environment.
45
- * Runs a dummy hash to determine optimal strategy.
46
- */
47
- calibrate(): Promise<{
48
- measuredMhs: number;
49
- activeStrategy: string;
50
- }>;
51
- /**
52
- * Generate Proof-of-Work for a given hash.
53
- */
70
+ getRemoteAuditReport(): EndpointAuditRecord[];
71
+ getAuditReport(): {
72
+ remotePool: EndpointAuditRecord[];
73
+ remotes: Array<{
74
+ url: string;
75
+ timeoutMs: number;
76
+ }>;
77
+ localChain: LocalCompute[];
78
+ profiler: WorkProviderOptions['profiler'] | 'default';
79
+ localBackend: PowBackendNameValue | null;
80
+ lastGenerationTrace: WorkGenerationTrace | null;
81
+ executionPlan: WorkExecutionPlan;
82
+ };
83
+ calibrate(): Promise<WorkCalibrationProfile>;
84
+ probe(): Promise<WorkExecutionPlan>;
85
+ private buildDefaultPlan;
86
+ private createLocalPowService;
87
+ private probeRemote;
88
+ private probeLocalBackend;
89
+ private buildPlanFromProbeResults;
90
+ private runProbe;
91
+ private generateRemote;
92
+ private generateLocalWithBackend;
93
+ private executePlan;
54
94
  generate(hash: string, difficulty: string): Promise<string>;
55
95
  }
96
+ export {};
56
97
  //# sourceMappingURL=WorkProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WorkProvider.d.ts","sourceRoot":"","sources":["../../src/work/WorkProvider.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,YAAY;IACtB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,YAAY,SAAS;IACrB,GAAG,QAAQ;CACZ;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,UAAU,CAAS;gBAEf,GAAG,EAAE,MAAM,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AE,KAAK,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACnD,UAAU,EAAE,YAAY,EAAE,CAAC;QAC3B,QAAQ,EAAE,mBAAmB,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC;QACtD,YAAY,EAAE,mBAAmB,GAAG,IAAI,CAAC;QACzC,mBAAmB,EAAE,mBAAmB,GAAG,IAAI,CAAC;QAChD,aAAa,EAAE,iBAAiB,CAAC;KAClC;IAaY,SAAS,IAAI,OAAO,CAAC,sBAAsB,CAAC;IAc5C,KAAK,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAehD,OAAO,CAAC,gBAAgB;IAkBxB,OAAO,CAAC,qBAAqB;YAKf,WAAW;YAsBX,iBAAiB;IA0B/B,OAAO,CAAC,yBAAyB;YAmCnB,QAAQ;YAaR,cAAc;YAmBd,wBAAwB;YAYxB,WAAW;IAkBZ,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAKzE"}
@@ -1,13 +1,10 @@
1
1
  import { HttpEndpointPool } from '../transport/http.js';
2
- /**
3
- * Local compute engines available.
4
- */
2
+ import { PowBackendName, PowService } from 'nano-pow-with-fallback';
5
3
  export var LocalCompute;
6
4
  (function (LocalCompute) {
7
5
  LocalCompute["WEBGPU"] = "webgpu";
8
6
  LocalCompute["WEBGL"] = "webgl";
9
- LocalCompute["WASM_THREADS"] = "wasm";
10
- LocalCompute["CPU"] = "cpu";
7
+ LocalCompute["WASM"] = "wasm";
11
8
  })(LocalCompute || (LocalCompute = {}));
12
9
  export class RemoteWorkServer {
13
10
  _url;
@@ -22,71 +19,285 @@ export class RemoteWorkServer {
22
19
  return new RemoteWorkServer(url, options.timeoutMs ?? 5000);
23
20
  }
24
21
  }
22
+ const DEFAULT_LOCAL_CHAIN = [LocalCompute.WEBGPU, LocalCompute.WEBGL, LocalCompute.WASM];
23
+ const DEFAULT_LOCAL_TIMEOUT_MS = 10_000;
24
+ const PROBE_HASH = 'ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789';
25
+ const PROBE_DIFFICULTY = 'fffffe0000000000';
26
+ function localComputeToBackendName(compute) {
27
+ switch (compute) {
28
+ case LocalCompute.WEBGPU:
29
+ return PowBackendName.WEBGPU;
30
+ case LocalCompute.WEBGL:
31
+ return PowBackendName.WEBGL;
32
+ case LocalCompute.WASM:
33
+ return PowBackendName.WASM;
34
+ }
35
+ }
36
+ function localComputeToPlanStep(compute) {
37
+ switch (compute) {
38
+ case LocalCompute.WEBGPU:
39
+ return 'webgpu';
40
+ case LocalCompute.WEBGL:
41
+ return 'webgl';
42
+ case LocalCompute.WASM:
43
+ return 'wasm';
44
+ }
45
+ }
46
+ function planStepToBackendName(kind) {
47
+ switch (kind) {
48
+ case 'webgpu':
49
+ return PowBackendName.WEBGPU;
50
+ case 'webgl':
51
+ return PowBackendName.WEBGL;
52
+ case 'wasm':
53
+ return PowBackendName.WASM;
54
+ case 'remote':
55
+ throw new Error('remote plan step does not map to a local backend');
56
+ }
57
+ }
58
+ function isLocalStepKind(kind) {
59
+ return kind !== 'remote';
60
+ }
61
+ function withTimeout(promise, timeoutMs, onTimeout) {
62
+ return new Promise((resolve, reject) => {
63
+ const timer = setTimeout(() => {
64
+ onTimeout?.();
65
+ reject(new Error(`Timed out after ${timeoutMs}ms`));
66
+ }, timeoutMs);
67
+ promise.then((value) => {
68
+ clearTimeout(timer);
69
+ resolve(value);
70
+ }, (error) => {
71
+ clearTimeout(timer);
72
+ reject(error);
73
+ });
74
+ });
75
+ }
25
76
  export class WorkProvider {
26
77
  options;
27
78
  remotePool;
79
+ warn;
80
+ localTimeoutMs;
81
+ lastGenerationTrace = null;
82
+ lastProbeResults = [];
83
+ executionPlan;
84
+ probePromise = null;
28
85
  constructor(options) {
29
86
  this.options = options;
87
+ this.warn = options.warn ?? ((message) => console.warn(`[nano-core] ${message}`));
88
+ this.localTimeoutMs = DEFAULT_LOCAL_TIMEOUT_MS;
30
89
  const hasRemotePool = (options.urls && options.urls.length > 0) || options.env || (options.defaults && options.defaults.length > 0);
31
90
  if (!hasRemotePool) {
32
91
  this.remotePool = null;
33
- return;
34
92
  }
35
- const remotePoolOptions = {
36
- kind: 'work',
37
- defaults: options.defaults ?? [],
38
- transportPolicy: 'bearer-and-json-body-key',
39
- };
40
- if (options.urls && options.urls.length > 0)
41
- remotePoolOptions.urls = options.urls;
42
- if (options.env)
43
- remotePoolOptions.env = options.env;
44
- if (options.warn)
45
- remotePoolOptions.warn = options.warn;
46
- this.remotePool = new HttpEndpointPool(remotePoolOptions);
93
+ else {
94
+ const remotePoolOptions = {
95
+ kind: 'work',
96
+ defaults: options.defaults ?? [],
97
+ transportPolicy: 'bearer-and-json-body-key',
98
+ ...(options.timeoutMs ? { timeoutMs: options.timeoutMs } : {}),
99
+ };
100
+ if (options.urls && options.urls.length > 0)
101
+ remotePoolOptions.urls = options.urls;
102
+ if (options.env)
103
+ remotePoolOptions.env = options.env;
104
+ if (options.warn)
105
+ remotePoolOptions.warn = options.warn;
106
+ if (options.onActiveEndpointChange)
107
+ remotePoolOptions.onActiveEndpointChange = options.onActiveEndpointChange;
108
+ this.remotePool = new HttpEndpointPool(remotePoolOptions);
109
+ }
110
+ this.executionPlan = this.buildDefaultPlan();
47
111
  }
48
112
  static auto(options) {
49
113
  return new WorkProvider(options);
50
114
  }
51
- /**
52
- * Generates a minimal JSON-serializable report of the work provider's active configuration.
53
- */
115
+ getRemoteAuditReport() {
116
+ return this.remotePool?.getAuditReport() ?? [];
117
+ }
54
118
  getAuditReport() {
119
+ const localStep = this.lastGenerationTrace?.mode === 'local' ? this.lastGenerationTrace.backend ?? null : null;
55
120
  return {
56
- remotePool: this.remotePool?.getAuditReport() ?? [],
57
- remotes: this.options.remotes?.map(r => ({ url: r.url, timeoutMs: r.timeoutMs })) || [],
58
- localChain: this.options.localChain || [],
59
- profiler: this.options.profiler || 'default'
121
+ remotePool: this.getRemoteAuditReport(),
122
+ remotes: this.options.remotes?.map((remote) => ({ url: remote.url, timeoutMs: remote.timeoutMs })) ?? [],
123
+ localChain: this.options.localChain ?? DEFAULT_LOCAL_CHAIN,
124
+ profiler: this.options.profiler ?? 'default',
125
+ localBackend: localStep,
126
+ lastGenerationTrace: this.lastGenerationTrace,
127
+ executionPlan: this.executionPlan,
60
128
  };
61
129
  }
62
- /**
63
- * Calibrates the work provider based on the environment.
64
- * Runs a dummy hash to determine optimal strategy.
65
- */
66
130
  async calibrate() {
67
- // In a real implementation this would benchmark nano-pow-with-fallback.
68
- // For scaffolding, we return a simulated profile.
69
- // Simulate picking WASM/WebGL based on fallback strategy
131
+ const plan = await this.probe();
132
+ const localProbeDurations = plan.probeResults
133
+ .filter((result) => result.available && result.kind !== 'remote' && typeof result.durationMs === 'number')
134
+ .map((result) => result.durationMs);
135
+ const bestLocalDuration = localProbeDurations.length > 0 ? Math.min(...localProbeDurations) : 0;
136
+ const measuredMhs = bestLocalDuration > 0 ? Number((1_000 / bestLocalDuration).toFixed(2)) : 0;
70
137
  return {
71
- measuredMhs: 104.2, // simulated Node M1 webgpu speed
72
- activeStrategy: 'local-primary'
138
+ measuredMhs,
139
+ activeStrategy: plan.source === 'probe' ? 'planned' : 'remote-first',
73
140
  };
74
141
  }
75
- /**
76
- * Generate Proof-of-Work for a given hash.
77
- */
78
- async generate(hash, difficulty) {
142
+ async probe() {
143
+ if (this.probePromise) {
144
+ return this.probePromise;
145
+ }
146
+ this.probePromise = this.runProbe();
147
+ try {
148
+ const plan = await this.probePromise;
149
+ this.executionPlan = plan;
150
+ return plan;
151
+ }
152
+ finally {
153
+ this.probePromise = null;
154
+ }
155
+ }
156
+ buildDefaultPlan() {
157
+ const localChain = this.options.localChain ?? DEFAULT_LOCAL_CHAIN;
158
+ const steps = [];
79
159
  if (this.remotePool) {
80
- const response = await this.remotePool.postJson({
81
- action: 'work_generate',
82
- hash,
83
- difficulty,
84
- });
85
- if (response.work)
86
- return response.work;
87
- }
88
- // In real implementation, this would route to local fallback engines.
89
- return '0000000000000000';
160
+ steps.push({ kind: 'remote' });
161
+ }
162
+ for (const compute of localChain) {
163
+ steps.push({ kind: localComputeToPlanStep(compute) });
164
+ }
165
+ return {
166
+ source: 'default',
167
+ steps,
168
+ disabledLocalBackends: [],
169
+ probeResults: [],
170
+ };
171
+ }
172
+ createLocalPowService(backend) {
173
+ const disabledBackends = Object.values(PowBackendName).filter((candidate) => candidate !== backend);
174
+ return new PowService({ disabledBackends });
175
+ }
176
+ async probeRemote() {
177
+ if (!this.remotePool) {
178
+ return { kind: 'remote', available: false, reason: 'remote pool not configured' };
179
+ }
180
+ const startedAt = performance.now();
181
+ try {
182
+ await this.remotePool.postJson({ action: 'version' });
183
+ return {
184
+ kind: 'remote',
185
+ available: true,
186
+ durationMs: performance.now() - startedAt,
187
+ };
188
+ }
189
+ catch (error) {
190
+ return {
191
+ kind: 'remote',
192
+ available: false,
193
+ reason: error instanceof Error ? error.message : String(error),
194
+ };
195
+ }
196
+ }
197
+ async probeLocalBackend(compute) {
198
+ const backend = localComputeToBackendName(compute);
199
+ const startedAt = performance.now();
200
+ const powService = this.createLocalPowService(backend);
201
+ try {
202
+ await powService.ready;
203
+ await withTimeout(powService.getProofOfWork({ hash: PROBE_HASH, threshold: PROBE_DIFFICULTY }), this.localTimeoutMs, () => powService.cancel());
204
+ return {
205
+ kind: localComputeToPlanStep(compute),
206
+ available: true,
207
+ durationMs: performance.now() - startedAt,
208
+ };
209
+ }
210
+ catch (error) {
211
+ return {
212
+ kind: localComputeToPlanStep(compute),
213
+ available: false,
214
+ reason: error instanceof Error ? error.message : String(error),
215
+ };
216
+ }
217
+ }
218
+ buildPlanFromProbeResults(results) {
219
+ const remote = results.find((result) => result.kind === 'remote');
220
+ const locals = results.filter((result) => isLocalStepKind(result.kind));
221
+ const availableLocals = locals
222
+ .filter((result) => result.available)
223
+ .sort((a, b) => (a.durationMs ?? Number.POSITIVE_INFINITY) - (b.durationMs ?? Number.POSITIVE_INFINITY));
224
+ const disabledLocalBackends = locals
225
+ .filter((result) => !result.available)
226
+ .map((result) => planStepToBackendName(result.kind));
227
+ const steps = [];
228
+ if (availableLocals.length > 0) {
229
+ steps.push({ kind: availableLocals[0].kind });
230
+ if (remote?.available) {
231
+ steps.push({ kind: 'remote' });
232
+ }
233
+ for (const local of availableLocals.slice(1)) {
234
+ steps.push({ kind: local.kind });
235
+ }
236
+ }
237
+ else if (remote?.available) {
238
+ steps.push({ kind: 'remote' });
239
+ }
240
+ if (steps.length === 0) {
241
+ return this.buildDefaultPlan();
242
+ }
243
+ return {
244
+ source: 'probe',
245
+ steps,
246
+ disabledLocalBackends,
247
+ probeResults: results,
248
+ };
249
+ }
250
+ async runProbe() {
251
+ const localChain = this.options.localChain ?? DEFAULT_LOCAL_CHAIN;
252
+ const results = [];
253
+ results.push(await this.probeRemote());
254
+ for (const compute of localChain) {
255
+ results.push(await this.probeLocalBackend(compute));
256
+ }
257
+ this.lastProbeResults = results;
258
+ return this.buildPlanFromProbeResults(results);
259
+ }
260
+ async generateRemote(hash, difficulty) {
261
+ if (!this.remotePool) {
262
+ throw new Error('Remote work pool is not configured');
263
+ }
264
+ const response = await this.remotePool.postJson({
265
+ action: 'work_generate',
266
+ hash,
267
+ difficulty,
268
+ });
269
+ if (!response.work || response.work === '0000000000000000') {
270
+ throw new Error('Remote work provider returned invalid/zero nonce');
271
+ }
272
+ this.lastGenerationTrace = { mode: 'remote' };
273
+ return response.work;
274
+ }
275
+ async generateLocalWithBackend(hash, difficulty, backend) {
276
+ const powService = this.createLocalPowService(backend);
277
+ await powService.ready;
278
+ const result = await withTimeout(powService.getProofOfWork({ hash, threshold: difficulty }), this.localTimeoutMs, () => powService.cancel());
279
+ this.lastGenerationTrace = { mode: 'local', backend: result.backend };
280
+ return result.proofOfWork;
281
+ }
282
+ async executePlan(hash, difficulty, plan) {
283
+ let lastError;
284
+ for (const step of plan.steps) {
285
+ try {
286
+ if (step.kind === 'remote') {
287
+ return await this.generateRemote(hash, difficulty);
288
+ }
289
+ return await this.generateLocalWithBackend(hash, difficulty, planStepToBackendName(step.kind));
290
+ }
291
+ catch (error) {
292
+ lastError = error;
293
+ }
294
+ }
295
+ throw lastError instanceof Error ? lastError : new Error('No work generation strategy succeeded');
296
+ }
297
+ async generate(hash, difficulty) {
298
+ const shouldProbe = this.options.profiler?.mode === 'auto';
299
+ const plan = shouldProbe ? await this.probe() : this.executionPlan;
300
+ return await this.executePlan(hash, difficulty, plan);
90
301
  }
91
302
  }
92
303
  //# sourceMappingURL=WorkProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WorkProvider.js","sourceRoot":"","sources":["../../src/work/WorkProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAwB,MAAM,sBAAsB,CAAC;AAG9E;;GAEG;AACH,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,+BAAe,CAAA;IACf,qCAAqB,CAAA;IACrB,2BAAW,CAAA;AACb,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAED,MAAM,OAAO,gBAAgB;IACnB,IAAI,CAAS;IACb,UAAU,CAAS;IAE3B,YAAY,GAAW,EAAE,SAAiB;QACxC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IAED,IAAW,GAAG,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,IAAW,SAAS,KAAa,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAE1D,MAAM,CAAC,EAAE,CAAC,GAAW,EAAE,UAA6D,EAAE;QACpF,OAAO,IAAI,gBAAgB,CAAC,GAAG,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC;IAC9D,CAAC;CACF;AAgBD,MAAM,OAAO,YAAY;IACf,OAAO,CAA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QAC3D,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC;QACnE,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC;CACF"}
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@openrai/nano-core",
3
- "version": "2.0.0",
3
+ "version": "2.3.1",
4
4
  "description": "Protocol engine for Nano integration ecosystem",
5
+ "repository": "https://github.com/OpenRai/nano-core",
5
6
  "type": "module",
6
7
  "main": "./dist/index.js",
7
8
  "types": "./dist/index.d.ts",
@@ -25,7 +26,8 @@
25
26
  },
26
27
  "scripts": {
27
28
  "build": "tsc",
28
- "test": "vitest run"
29
+ "test": "vitest run",
30
+ "release": "pnpm publish --access public --no-git-checks"
29
31
  },
30
32
  "keywords": [
31
33
  "nano",