nanocodex 0.6.6 → 0.6.7
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 +297 -6
- package/THIRD-PARTY-LICENSES +23 -0
- package/browser/Agent.d.mts +5 -4
- package/browser/Agent.mjs +4 -0
- package/browser/Claude.d.mts +4 -0
- package/browser/Claude.mjs +11 -0
- package/browser/InlineAgent.mjs +19 -1
- package/browser/host.d.mts +54 -1
- package/browser/host.mjs +65 -16
- package/browser/hostManagedWebSocket.mjs +11 -2
- package/browser/index.d.mts +3 -10
- package/browser/index.mjs +2 -5
- package/browser/socket-observations.mjs +203 -0
- package/cloud/Decorator.d.mts +2 -2
- package/cloud/Decorator.mjs +1 -0
- package/cloud/Dialog.d.mts +13 -0
- package/cloud/Dialog.mjs +52 -6
- package/cloud/Transport.d.mts +0 -11
- package/cloud/Transport.mjs +1 -386
- package/cloud/actions/account.d.mts +12 -0
- package/cloud/actions/account.mjs +11 -0
- package/cloud/actions/agent.mjs +3 -0
- package/cloud/actions/connection.d.mts +3 -1
- package/cloud/actions/connection.mjs +19 -4
- package/cloud/index.d.mts +1 -1
- package/cloud/index.mjs +1 -1
- package/cloud/internal.mjs +19 -4
- package/cloud/mercator.mjs +1 -1
- package/cloud/mock.d.mts +17 -0
- package/cloud/mock.mjs +392 -0
- package/cloud/types.d.mts +3 -1
- package/cloudflare/Agent.d.mts +2 -0
- package/cloudflare/Agent.mjs +88 -2
- package/cloudflare/agent-settings.d.mts +1 -1
- package/cloudflare/agent-settings.mjs +9 -0
- package/cloudflare/egress.mjs +9 -6
- package/cloudflare/gateway-responses.d.mts +1 -0
- package/cloudflare/gateway-responses.mjs +2 -2
- package/cloudflare/managed-auth.d.mts +4 -4
- package/cloudflare/managed-auth.mjs +14 -2
- package/cloudflare/managed-live.d.mts +6 -0
- package/cloudflare/managed-live.mjs +56 -1
- package/cloudflare/workers-ai-responses.d.mts +2 -1
- package/cloudflare/workers-ai-responses.mjs +80 -6
- package/host/Agent.d.mts +6 -2
- package/host/Claude.d.mts +3 -0
- package/host/Claude.mjs +2 -0
- package/host/index.d.mts +6 -10
- package/host/index.mjs +2 -5
- package/index.d.mts +11 -10
- package/index.mjs +0 -5
- package/internal.mjs +28 -3
- package/managed/Agent.d.mts +6 -2
- package/managed/Agent.mjs +39 -5
- package/managed/ManagedError.d.mts +3 -0
- package/node/Agent.d.mts +6 -2
- package/node/Agent.mjs +14 -1
- package/node/Claude.d.mts +4 -0
- package/node/Claude.mjs +24 -0
- package/node/host.mjs +18 -9
- package/node/index.d.mts +6 -10
- package/node/index.mjs +2 -5
- package/package.json +41 -9
- package/pkg-node/nanocodex.d.ts +109 -0
- package/pkg-node/nanocodex.js +818 -51
- package/pkg-node/nanocodex_bg.wasm.d.ts +47 -3
- package/pkg-web/.nanocodex-bindgen-stamp +3 -3
- package/pkg-web/nanocodex-build.json +1 -1
- package/pkg-web/nanocodex.d.ts +156 -3
- package/pkg-web/nanocodex.js +813 -51
- package/pkg-web/nanocodex_bg.js +813 -51
- package/pkg-web/nanocodex_bg.wasm +0 -0
- package/pkg-web/nanocodex_bg.wasm.d.ts +47 -3
- package/pkg-web/nanocodex_worker.js +1 -1
- package/runtime/claude-host.mjs +308 -0
- package/runtime/claude-subscription.mjs +79 -0
- package/runtime/claude.d.mts +112 -0
- package/runtime/claude.mjs +221 -0
- package/runtime/code-effect-identity.mjs +123 -0
- package/runtime/harnesses.mjs +51 -0
- package/runtime/mcp-payment.mjs +8 -0
- package/runtime/mcp-runtime.d.mts +10 -0
- package/runtime/mcp-runtime.mjs +242 -57
- package/runtime/mercator.mjs +2 -0
- package/runtime/quickjs-evaluator.mjs +23 -11
- package/runtime/response-controls.mjs +1 -6
- package/runtime/responses-http.mjs +4 -2
- package/runtime/retry-after.d.mts +10 -0
- package/runtime/retry-after.mjs +86 -0
- package/runtime/steer-receipt.mjs +8 -1
- package/runtime/subagent-routing.d.mts +4 -2
- package/runtime/subagent-routing.mjs +7 -2
- package/runtime/subagents.d.mts +8 -3
- package/services/account.d.mts +76 -0
- package/services/account.mjs +151 -0
- package/services/hosted.mjs +72 -0
- package/services/index.d.mts +95 -0
- package/services/index.mjs +192 -0
- package/services/scope.mjs +36 -0
- package/{runtime/tempo-provider.d.mts → tempo/index.d.mts} +20 -1
- package/{runtime/tempo-provider.mjs → tempo/index.mjs} +39 -3
- package/tools/browser/browserShell.mjs +18 -8
- package/tools/browser/python.worker.mjs +17 -1
- package/tools/browser/threadGit.mjs +12 -2
- package/tools/environment.d.mts +8 -0
- package/tools/environment.mjs +10 -0
- package/tools/index.d.mts +6 -3
- package/types.d.mts +104 -4
- package/worker/Claude.d.mts +4 -0
- package/worker/Claude.mjs +11 -0
- package/worker/ClaudeSubscription.d.mts +24 -0
- package/worker/ClaudeSubscription.mjs +9 -0
- package/worker/index.d.mts +9 -0
- package/worker/index.mjs +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nanocodex",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"description": "Viem-style Node and browser bindings for the Nanocodex WASM agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -75,6 +75,10 @@
|
|
|
75
75
|
"types": "./managed/index.d.mts",
|
|
76
76
|
"import": "./managed/index.mjs"
|
|
77
77
|
},
|
|
78
|
+
"./tempo": {
|
|
79
|
+
"types": "./tempo/index.d.mts",
|
|
80
|
+
"import": "./tempo/index.mjs"
|
|
81
|
+
},
|
|
78
82
|
"./connect": {
|
|
79
83
|
"types": "./cloud/index.d.mts",
|
|
80
84
|
"import": "./cloud/index.mjs"
|
|
@@ -87,6 +91,10 @@
|
|
|
87
91
|
"types": "./cloud/server/index.d.mts",
|
|
88
92
|
"import": "./cloud/server/index.mjs"
|
|
89
93
|
},
|
|
94
|
+
"./connect/mock": {
|
|
95
|
+
"types": "./cloud/mock.d.mts",
|
|
96
|
+
"import": "./cloud/mock.mjs"
|
|
97
|
+
},
|
|
90
98
|
"./durability": {
|
|
91
99
|
"types": "./runtime/durability-store.d.mts",
|
|
92
100
|
"import": "./runtime/durability-store.mjs"
|
|
@@ -166,6 +174,10 @@
|
|
|
166
174
|
"./cloudflare/tracing": {
|
|
167
175
|
"types": "./cloudflare/tracing.d.mts",
|
|
168
176
|
"import": "./cloudflare/tracing.mjs"
|
|
177
|
+
},
|
|
178
|
+
"./services": {
|
|
179
|
+
"types": "./services/index.d.mts",
|
|
180
|
+
"import": "./services/index.mjs"
|
|
169
181
|
}
|
|
170
182
|
},
|
|
171
183
|
"files": [
|
|
@@ -181,12 +193,15 @@
|
|
|
181
193
|
"pkg-web",
|
|
182
194
|
"runtime",
|
|
183
195
|
"tools",
|
|
196
|
+
"tempo",
|
|
184
197
|
"internal.mjs",
|
|
185
198
|
"index.d.mts",
|
|
186
199
|
"index.mjs",
|
|
187
200
|
"wasm.d.mts",
|
|
188
201
|
"types.d.mts",
|
|
189
|
-
"README.md"
|
|
202
|
+
"README.md",
|
|
203
|
+
"THIRD-PARTY-LICENSES",
|
|
204
|
+
"services"
|
|
190
205
|
],
|
|
191
206
|
"publishConfig": {
|
|
192
207
|
"access": "public",
|
|
@@ -202,24 +217,40 @@
|
|
|
202
217
|
"diff": "^9.0.0",
|
|
203
218
|
"isomorphic-git": "^1.41.5",
|
|
204
219
|
"minisearch": "7.2.0",
|
|
205
|
-
"
|
|
206
|
-
"nanocodex-tools": "0.6.6",
|
|
207
|
-
"ox": "1.6.2",
|
|
220
|
+
"nanocodex-tools": "0.6.7",
|
|
208
221
|
"pako": "2.1.0",
|
|
209
|
-
"pyodide": "314.0.5",
|
|
210
222
|
"sprintf-js": "1.1.3",
|
|
211
|
-
"viem": "2.55.13",
|
|
212
223
|
"wata": "0.4.0",
|
|
213
224
|
"ws": "^8.18.3"
|
|
214
225
|
},
|
|
226
|
+
"peerDependencies": {
|
|
227
|
+
"mppx": ">=0.8.17 <0.10",
|
|
228
|
+
"ox": ">=0.14.20 <2",
|
|
229
|
+
"viem": "^2.55.8"
|
|
230
|
+
},
|
|
231
|
+
"peerDependenciesMeta": {
|
|
232
|
+
"mppx": {
|
|
233
|
+
"optional": true
|
|
234
|
+
},
|
|
235
|
+
"ox": {
|
|
236
|
+
"optional": true
|
|
237
|
+
},
|
|
238
|
+
"viem": {
|
|
239
|
+
"optional": true
|
|
240
|
+
}
|
|
241
|
+
},
|
|
215
242
|
"devDependencies": {
|
|
216
243
|
"@jitl/quickjs-wasmfile-release-asyncify": "0.32.0",
|
|
217
244
|
"binaryen": "132.0.0",
|
|
218
245
|
"esbuild": "0.28.1",
|
|
219
246
|
"hyparquet-writer": "0.16.6",
|
|
247
|
+
"mppx": "0.9.1",
|
|
248
|
+
"ox": "1.6.2",
|
|
220
249
|
"pkg-pr-new": "0.0.79",
|
|
221
250
|
"quickjs-emscripten-core": "0.32.0",
|
|
222
|
-
"typescript": "5.9.3"
|
|
251
|
+
"typescript": "5.9.3",
|
|
252
|
+
"viem": "2.55.13",
|
|
253
|
+
"miniflare": "4.20260730.0"
|
|
223
254
|
},
|
|
224
255
|
"engines": {
|
|
225
256
|
"node": ">=22.13.0"
|
|
@@ -236,6 +267,7 @@
|
|
|
236
267
|
"test": "node --test test/*.test.mjs && npm run test:performance && npm run test:typecheck && npm run check:package",
|
|
237
268
|
"test:performance": "node --expose-gc --test test/performance.bench.mjs",
|
|
238
269
|
"bench:dataset": "node scripts/dataset.bench.mjs",
|
|
239
|
-
"test:typecheck": "tsc -p test/tsconfig.json"
|
|
270
|
+
"test:typecheck": "tsc -p test/tsconfig.json",
|
|
271
|
+
"test:services:workerd": "node --test test/services-workerd.test.mjs"
|
|
240
272
|
}
|
|
241
273
|
}
|
package/pkg-node/nanocodex.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* The `ReadableStreamType` enum.
|
|
5
|
+
*
|
|
6
|
+
* *This API requires the following crate features to be activated: `ReadableStreamType`*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export type ReadableStreamType = "bytes";
|
|
3
10
|
|
|
4
11
|
/**
|
|
5
12
|
* Rust-owned Codex browser voice protocol and Agent bridge.
|
|
@@ -182,6 +189,56 @@ export class ChatGptSubscription {
|
|
|
182
189
|
status(): Promise<string>;
|
|
183
190
|
}
|
|
184
191
|
|
|
192
|
+
/**
|
|
193
|
+
* Host-only lifecycle handle. Authorization URL/status are the only browser-safe results.
|
|
194
|
+
*/
|
|
195
|
+
export class ClaudeSubscription {
|
|
196
|
+
private constructor();
|
|
197
|
+
free(): void;
|
|
198
|
+
[Symbol.dispose](): void;
|
|
199
|
+
completeLogin(private_code: string): Promise<string>;
|
|
200
|
+
/**
|
|
201
|
+
* Private capability: never expose through account API, tool result, or trace.
|
|
202
|
+
*/
|
|
203
|
+
credential(): Promise<string>;
|
|
204
|
+
logout(): Promise<void>;
|
|
205
|
+
static open(encoded: string): Promise<ClaudeSubscription>;
|
|
206
|
+
/**
|
|
207
|
+
* Invalidate only the rejected credential; next credential() performs bounded refresh.
|
|
208
|
+
*/
|
|
209
|
+
recover(encoded: string): Promise<boolean>;
|
|
210
|
+
startLogin(): Promise<string>;
|
|
211
|
+
status(): Promise<string>;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export class IntoUnderlyingByteSource {
|
|
215
|
+
private constructor();
|
|
216
|
+
free(): void;
|
|
217
|
+
[Symbol.dispose](): void;
|
|
218
|
+
cancel(): void;
|
|
219
|
+
pull(controller: ReadableByteStreamController): Promise<any>;
|
|
220
|
+
start(controller: ReadableByteStreamController): void;
|
|
221
|
+
readonly autoAllocateChunkSize: number;
|
|
222
|
+
readonly type: ReadableStreamType;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export class IntoUnderlyingSink {
|
|
226
|
+
private constructor();
|
|
227
|
+
free(): void;
|
|
228
|
+
[Symbol.dispose](): void;
|
|
229
|
+
abort(reason: any): Promise<any>;
|
|
230
|
+
close(): Promise<any>;
|
|
231
|
+
write(chunk: any): Promise<any>;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export class IntoUnderlyingSource {
|
|
235
|
+
private constructor();
|
|
236
|
+
free(): void;
|
|
237
|
+
[Symbol.dispose](): void;
|
|
238
|
+
cancel(): void;
|
|
239
|
+
pull(controller: ReadableStreamDefaultController): Promise<any>;
|
|
240
|
+
}
|
|
241
|
+
|
|
185
242
|
/**
|
|
186
243
|
* Standalone Rust-owned browser voice protocol for a remote managed Agent.
|
|
187
244
|
*
|
|
@@ -349,6 +406,54 @@ export class ManagedBrowserVoice {
|
|
|
349
406
|
stop(): string;
|
|
350
407
|
}
|
|
351
408
|
|
|
409
|
+
/**
|
|
410
|
+
* Opt-in Claude-native WASM lifecycle. Authentication remains host-owned.
|
|
411
|
+
*/
|
|
412
|
+
export class Nanoclaude {
|
|
413
|
+
private constructor();
|
|
414
|
+
free(): void;
|
|
415
|
+
[Symbol.dispose](): void;
|
|
416
|
+
/**
|
|
417
|
+
* Cancels nonterminal prompts issued by this handle (not an in-flight compact).
|
|
418
|
+
*/
|
|
419
|
+
cancel(): Promise<void>;
|
|
420
|
+
checkpoint(): string;
|
|
421
|
+
closeSubagent(task: string): Promise<string>;
|
|
422
|
+
compact(): Promise<void>;
|
|
423
|
+
/**
|
|
424
|
+
* Creates only explicitly supplied Claude capabilities.
|
|
425
|
+
*/
|
|
426
|
+
static create(config_json: string): Promise<Nanoclaude>;
|
|
427
|
+
interruptSubagent(task: string): Promise<string>;
|
|
428
|
+
listSubagents(task: string): Promise<string>;
|
|
429
|
+
/**
|
|
430
|
+
* Accepts text using the shared Turn/TurnResult and durable request-ID path.
|
|
431
|
+
*/
|
|
432
|
+
prompt(input: string, request_id?: string | null, cancel_on_admission?: boolean | null): Turn;
|
|
433
|
+
/**
|
|
434
|
+
* Accepts ordered multimodal JSON content: text, image URLs or data URLs,
|
|
435
|
+
* and inline `file` documents (PDF or plain text). Local paths are rejected.
|
|
436
|
+
*/
|
|
437
|
+
promptContent(content_json: string, request_id?: string | null, cancel_on_admission?: boolean | null): Turn;
|
|
438
|
+
/**
|
|
439
|
+
* Atomically steers the active Claude turn or starts a new one, for live
|
|
440
|
+
* frontends such as realtime voice. Returns `undefined` when steered.
|
|
441
|
+
*/
|
|
442
|
+
routePrompt(instruction: string): Promise<Turn | undefined>;
|
|
443
|
+
sendSubagentMessage(task: string): Promise<string>;
|
|
444
|
+
setEventForwarding(enabled: boolean): void;
|
|
445
|
+
shutdown(): Promise<void>;
|
|
446
|
+
/**
|
|
447
|
+
* Claude checkpoints are stored natively by durability, not OpenAI snapshots.
|
|
448
|
+
*/
|
|
449
|
+
snapshot(): string;
|
|
450
|
+
spawnSubagent(task: string): Promise<string>;
|
|
451
|
+
spawnSubagents(tasks_json: string): Promise<string>;
|
|
452
|
+
waitSubagents(task: string): Promise<string>;
|
|
453
|
+
readonly agentId: string;
|
|
454
|
+
readonly sessionId: string;
|
|
455
|
+
}
|
|
456
|
+
|
|
352
457
|
/**
|
|
353
458
|
* JavaScript binding over the shared Rust agent lifecycle.
|
|
354
459
|
*/
|
|
@@ -598,6 +703,10 @@ export class Turn {
|
|
|
598
703
|
* Rejects if the turn is already terminal or its driver stopped.
|
|
599
704
|
*/
|
|
600
705
|
cancel(): Promise<void>;
|
|
706
|
+
/**
|
|
707
|
+
* Host-only lifecycle identity, including turns without a durable request ID.
|
|
708
|
+
*/
|
|
709
|
+
hostTurnId(): Promise<string>;
|
|
601
710
|
/**
|
|
602
711
|
* Waits for the final assistant message.
|
|
603
712
|
*
|