@lamplitisles/dsh-nanocodex 0.1.0-beta.0
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/LICENSE +65 -0
- package/NOTICE +2 -0
- package/README.md +182 -0
- package/THIRD_PARTY_NOTICES.md +29 -0
- package/cordis.patch.yml +52 -0
- package/dist/index.d.ts +435 -0
- package/dist/index.js +3405 -0
- package/dist/standard-preset.d.ts +7 -0
- package/dist/standard-preset.js +25 -0
- package/engine-release.json +14 -0
- package/package.json +119 -0
- package/presets/standard/agent.cordis.yml +6 -0
- package/presets/standard/preset.yml +2 -0
- package/vendor/nanocodex/README.md +1344 -0
- package/vendor/nanocodex/actions/events.d.mts +10 -0
- package/vendor/nanocodex/actions/events.mjs +163 -0
- package/vendor/nanocodex/actions/index.d.mts +13 -0
- package/vendor/nanocodex/actions/index.mjs +35 -0
- package/vendor/nanocodex/actions/session.d.mts +66 -0
- package/vendor/nanocodex/actions/session.mjs +59 -0
- package/vendor/nanocodex/actions/turn.d.mts +59 -0
- package/vendor/nanocodex/actions/turn.mjs +37 -0
- package/vendor/nanocodex/actions/voice.d.mts +22 -0
- package/vendor/nanocodex/actions/voice.mjs +50 -0
- package/vendor/nanocodex/browser/Agent.d.mts +55 -0
- package/vendor/nanocodex/browser/Agent.mjs +11 -0
- package/vendor/nanocodex/browser/ChatGptSubscription.d.mts +7 -0
- package/vendor/nanocodex/browser/ChatGptSubscription.mjs +19 -0
- package/vendor/nanocodex/browser/InlineAgent.mjs +266 -0
- package/vendor/nanocodex/browser/Transport.d.mts +74 -0
- package/vendor/nanocodex/browser/Transport.mjs +61 -0
- package/vendor/nanocodex/browser/Voice.d.mts +71 -0
- package/vendor/nanocodex/browser/Voice.mjs +291 -0
- package/vendor/nanocodex/browser/VoiceSession.mjs +688 -0
- package/vendor/nanocodex/browser/WorkerAgent.d.mts +65 -0
- package/vendor/nanocodex/browser/WorkerAgent.mjs +1472 -0
- package/vendor/nanocodex/browser/agent.worker.mjs +3 -0
- package/vendor/nanocodex/browser/config.d.mts +36 -0
- package/vendor/nanocodex/browser/config.mjs +439 -0
- package/vendor/nanocodex/browser/engine.mjs +13 -0
- package/vendor/nanocodex/browser/harness.mjs +55 -0
- package/vendor/nanocodex/browser/host.d.mts +83 -0
- package/vendor/nanocodex/browser/host.mjs +555 -0
- package/vendor/nanocodex/browser/hostManagedWebSocket.d.mts +14 -0
- package/vendor/nanocodex/browser/hostManagedWebSocket.mjs +110 -0
- package/vendor/nanocodex/browser/index.d.mts +92 -0
- package/vendor/nanocodex/browser/index.mjs +23 -0
- package/vendor/nanocodex/browser/indexeddb-durability-store.mjs +197 -0
- package/vendor/nanocodex/browser/workspace.d.mts +16 -0
- package/vendor/nanocodex/browser/workspace.mjs +107 -0
- package/vendor/nanocodex/cloud/Client.d.mts +83 -0
- package/vendor/nanocodex/cloud/Client.mjs +231 -0
- package/vendor/nanocodex/cloud/Decorator.d.mts +31 -0
- package/vendor/nanocodex/cloud/Decorator.mjs +37 -0
- package/vendor/nanocodex/cloud/Dialog.d.mts +113 -0
- package/vendor/nanocodex/cloud/Dialog.mjs +366 -0
- package/vendor/nanocodex/cloud/Errors.d.mts +22 -0
- package/vendor/nanocodex/cloud/Errors.mjs +39 -0
- package/vendor/nanocodex/cloud/Principal.d.mts +26 -0
- package/vendor/nanocodex/cloud/Principal.mjs +88 -0
- package/vendor/nanocodex/cloud/RemoteProvider.mjs +88 -0
- package/vendor/nanocodex/cloud/Transport.d.mts +47 -0
- package/vendor/nanocodex/cloud/Transport.mjs +454 -0
- package/vendor/nanocodex/cloud/actions/account.d.mts +9 -0
- package/vendor/nanocodex/cloud/actions/account.mjs +19 -0
- package/vendor/nanocodex/cloud/actions/agent.d.mts +18 -0
- package/vendor/nanocodex/cloud/actions/agent.mjs +428 -0
- package/vendor/nanocodex/cloud/actions/connection.d.mts +133 -0
- package/vendor/nanocodex/cloud/actions/connection.mjs +580 -0
- package/vendor/nanocodex/cloud/actions/grant.d.mts +10 -0
- package/vendor/nanocodex/cloud/actions/grant.mjs +12 -0
- package/vendor/nanocodex/cloud/actions/index.d.mts +7 -0
- package/vendor/nanocodex/cloud/actions/index.mjs +7 -0
- package/vendor/nanocodex/cloud/actions/machineUsd.d.mts +23 -0
- package/vendor/nanocodex/cloud/actions/machineUsd.mjs +37 -0
- package/vendor/nanocodex/cloud/actions/model.d.mts +12 -0
- package/vendor/nanocodex/cloud/actions/model.mjs +50 -0
- package/vendor/nanocodex/cloud/actions/mpp.d.mts +28 -0
- package/vendor/nanocodex/cloud/actions/mpp.mjs +39 -0
- package/vendor/nanocodex/cloud/index.d.mts +30 -0
- package/vendor/nanocodex/cloud/index.mjs +9 -0
- package/vendor/nanocodex/cloud/internal.mjs +533 -0
- package/vendor/nanocodex/cloud/mercator.mjs +108 -0
- package/vendor/nanocodex/cloud/server/HostPrincipal.d.mts +34 -0
- package/vendor/nanocodex/cloud/server/HostPrincipal.mjs +202 -0
- package/vendor/nanocodex/cloud/server/index.d.mts +1 -0
- package/vendor/nanocodex/cloud/server/index.mjs +1 -0
- package/vendor/nanocodex/cloud/types.d.mts +211 -0
- package/vendor/nanocodex/cloudflare/Agent.d.mts +133 -0
- package/vendor/nanocodex/cloudflare/Agent.mjs +811 -0
- package/vendor/nanocodex/cloudflare/egress-subject.mjs +19 -0
- package/vendor/nanocodex/cloudflare/egress.d.mts +41 -0
- package/vendor/nanocodex/cloudflare/egress.mjs +119 -0
- package/vendor/nanocodex/cloudflare/event-socket.mjs +316 -0
- package/vendor/nanocodex/cloudflare/index.d.mts +7 -0
- package/vendor/nanocodex/cloudflare/index.mjs +6 -0
- package/vendor/nanocodex/host/Agent.d.mts +55 -0
- package/vendor/nanocodex/host/Agent.mjs +1 -0
- package/vendor/nanocodex/host/index.d.mts +82 -0
- package/vendor/nanocodex/host/index.mjs +10 -0
- package/vendor/nanocodex/index.d.mts +81 -0
- package/vendor/nanocodex/index.mjs +12 -0
- package/vendor/nanocodex/internal.mjs +1275 -0
- package/vendor/nanocodex/managed/Agent.d.mts +380 -0
- package/vendor/nanocodex/managed/Agent.mjs +1694 -0
- package/vendor/nanocodex/managed/ManagedError.d.mts +9 -0
- package/vendor/nanocodex/managed/ManagedError.mjs +8 -0
- package/vendor/nanocodex/managed/README.md +241 -0
- package/vendor/nanocodex/managed/Voice.mjs +202 -0
- package/vendor/nanocodex/managed/index.d.mts +20 -0
- package/vendor/nanocodex/managed/index.mjs +2 -0
- package/vendor/nanocodex/managed/internal.mjs +119 -0
- package/vendor/nanocodex/node/Agent.d.mts +50 -0
- package/vendor/nanocodex/node/Agent.mjs +203 -0
- package/vendor/nanocodex/node/ChatGptSubscription.d.mts +9 -0
- package/vendor/nanocodex/node/ChatGptSubscription.mjs +17 -0
- package/vendor/nanocodex/node/Transport.d.mts +44 -0
- package/vendor/nanocodex/node/Transport.mjs +46 -0
- package/vendor/nanocodex/node/host.mjs +731 -0
- package/vendor/nanocodex/node/index.d.mts +73 -0
- package/vendor/nanocodex/node/index.mjs +17 -0
- package/vendor/nanocodex/node/workspace.d.mts +10 -0
- package/vendor/nanocodex/node/workspace.mjs +198 -0
- package/vendor/nanocodex/package.json +200 -0
- package/vendor/nanocodex/pkg-node/nanocodex.d.ts +675 -0
- package/vendor/nanocodex/pkg-node/nanocodex.js +2628 -0
- package/vendor/nanocodex/pkg-node/nanocodex_bg.wasm.d.ts +105 -0
- package/vendor/nanocodex/pkg-node/package.json +1 -0
- package/vendor/nanocodex/pkg-web/.nanocodex-bindgen-stamp +6 -0
- package/vendor/nanocodex/pkg-web/nanocodex-build.json +1 -0
- package/vendor/nanocodex/pkg-web/nanocodex.d.ts +805 -0
- package/vendor/nanocodex/pkg-web/nanocodex.js +2714 -0
- package/vendor/nanocodex/pkg-web/nanocodex_bg.js +2615 -0
- package/vendor/nanocodex/pkg-web/nanocodex_bg.wasm +0 -0
- package/vendor/nanocodex/pkg-web/nanocodex_bg.wasm.d.ts +105 -0
- package/vendor/nanocodex/pkg-web/nanocodex_worker.js +9 -0
- package/vendor/nanocodex/pkg-web/package.json +1 -0
- package/vendor/nanocodex/runtime/chatgpt-subscription.mjs +212 -0
- package/vendor/nanocodex/runtime/cloudflare-durability-store.d.mts +26 -0
- package/vendor/nanocodex/runtime/cloudflare-durability-store.mjs +168 -0
- package/vendor/nanocodex/runtime/code-evaluator.worker.mjs +137 -0
- package/vendor/nanocodex/runtime/code-runtime.mjs +1 -0
- package/vendor/nanocodex/runtime/durability-store.d.mts +85 -0
- package/vendor/nanocodex/runtime/durability-store.mjs +631 -0
- package/vendor/nanocodex/runtime/durability.mjs +153 -0
- package/vendor/nanocodex/runtime/managed-transport.mjs +460 -0
- package/vendor/nanocodex/runtime/mcp-runtime.mjs +534 -0
- package/vendor/nanocodex/runtime/postgres-durability-store.d.mts +64 -0
- package/vendor/nanocodex/runtime/postgres-durability-store.mjs +532 -0
- package/vendor/nanocodex/runtime/quickjs-evaluator.d.mts +17 -0
- package/vendor/nanocodex/runtime/quickjs-evaluator.mjs +236 -0
- package/vendor/nanocodex/runtime/responses-transport.mjs +22 -0
- package/vendor/nanocodex/runtime/subagents.d.mts +107 -0
- package/vendor/nanocodex/runtime/subagents.mjs +54 -0
- package/vendor/nanocodex/runtime/subscription-store.d.mts +8 -0
- package/vendor/nanocodex/runtime/subscription-store.mjs +42 -0
- package/vendor/nanocodex/runtime/tempo-provider.d.mts +125 -0
- package/vendor/nanocodex/runtime/tempo-provider.mjs +264 -0
- package/vendor/nanocodex/runtime/tool-configuration.mjs +1 -0
- package/vendor/nanocodex/runtime/tool-router.mjs +1 -0
- package/vendor/nanocodex/runtime/utf8.mjs +1 -0
- package/vendor/nanocodex/runtime/worker-evaluator.mjs +162 -0
- package/vendor/nanocodex/runtime/workspace.d.mts +1 -0
- package/vendor/nanocodex/runtime/workspace.mjs +1 -0
- package/vendor/nanocodex/tools/Tools.d.mts +56 -0
- package/vendor/nanocodex/tools/Tools.mjs +136 -0
- package/vendor/nanocodex/tools/artifact.d.mts +1 -0
- package/vendor/nanocodex/tools/artifact.mjs +1 -0
- package/vendor/nanocodex/tools/attachment.mjs +1 -0
- package/vendor/nanocodex/tools/bash.d.mts +1 -0
- package/vendor/nanocodex/tools/bash.mjs +1 -0
- package/vendor/nanocodex/tools/browser/accountInfo.mjs +795 -0
- package/vendor/nanocodex/tools/browser/browserBuffer.mjs +18 -0
- package/vendor/nanocodex/tools/browser/browserCompiler.mjs +155 -0
- package/vendor/nanocodex/tools/browser/browserEgress.mjs +161 -0
- package/vendor/nanocodex/tools/browser/browserPython.mjs +133 -0
- package/vendor/nanocodex/tools/browser/browserShell.mjs +1075 -0
- package/vendor/nanocodex/tools/browser/browserSprintf.mjs +4 -0
- package/vendor/nanocodex/tools/browser/browserSsh.mjs +201 -0
- package/vendor/nanocodex/tools/browser/browserZlib.mjs +136 -0
- package/vendor/nanocodex/tools/browser/compiler.worker.mjs +160 -0
- package/vendor/nanocodex/tools/browser/devTunnelsSshBrowser.mjs +13 -0
- package/vendor/nanocodex/tools/browser/index.d.mts +209 -0
- package/vendor/nanocodex/tools/browser/index.mjs +174 -0
- package/vendor/nanocodex/tools/browser/opfsGit.mjs +248 -0
- package/vendor/nanocodex/tools/browser/python.worker.mjs +114 -0
- package/vendor/nanocodex/tools/browser/threadGit.mjs +197 -0
- package/vendor/nanocodex/tools/browser/unsupportedNodeRsa.mjs +5 -0
- package/vendor/nanocodex/tools/browser/workspace.mjs +83 -0
- package/vendor/nanocodex/tools/dataset.d.mts +1 -0
- package/vendor/nanocodex/tools/dataset.mjs +1 -0
- package/vendor/nanocodex/tools/datasetContract.mjs +1 -0
- package/vendor/nanocodex/tools/datasetEngine.mjs +1 -0
- package/vendor/nanocodex/tools/hostedCatalog.d.mts +1 -0
- package/vendor/nanocodex/tools/hostedCatalog.mjs +1 -0
- package/vendor/nanocodex/tools/index.d.mts +49 -0
- package/vendor/nanocodex/tools/index.mjs +19 -0
- package/vendor/nanocodex/tools/namedTool.mjs +1 -0
- package/vendor/nanocodex/tools/repository-workspace.d.mts +1 -0
- package/vendor/nanocodex/tools/repository-workspace.mjs +1 -0
- package/vendor/nanocodex/tools/ssh.d.mts +1 -0
- package/vendor/nanocodex/tools/ssh.mjs +1 -0
- package/vendor/nanocodex/tools/standard.mjs +1 -0
- package/vendor/nanocodex/tools/standardDescriptions.mjs +1 -0
- package/vendor/nanocodex/types.d.mts +663 -0
- package/vendor/nanocodex/wasm.d.mts +4 -0
- package/vendor/nanocodex/worker/ChatGptSubscription.d.mts +9 -0
- package/vendor/nanocodex/worker/ChatGptSubscription.mjs +29 -0
- package/vendor/nanocodex/worker/index.d.mts +18 -0
- package/vendor/nanocodex/worker/index.mjs +5 -0
- package/vendor/nanocodex-tools/README.md +65 -0
- package/vendor/nanocodex-tools/dist/hosted/app-tool-catalog.d.ts +7 -0
- package/vendor/nanocodex-tools/dist/hosted/app-tool-catalog.js +14 -0
- package/vendor/nanocodex-tools/dist/hosted/broker-core.d.ts +172 -0
- package/vendor/nanocodex-tools/dist/hosted/broker-core.js +1278 -0
- package/vendor/nanocodex-tools/dist/hosted/index.d.ts +3 -0
- package/vendor/nanocodex-tools/dist/hosted/index.js +3 -0
- package/vendor/nanocodex-tools/dist/hosted/protocol.d.ts +120 -0
- package/vendor/nanocodex-tools/dist/hosted/protocol.js +415 -0
- package/vendor/nanocodex-tools/dist/index.d.ts +19 -0
- package/vendor/nanocodex-tools/dist/index.js +14 -0
- package/vendor/nanocodex-tools/dist/memory.d.ts +204 -0
- package/vendor/nanocodex-tools/dist/memory.js +411 -0
- package/vendor/nanocodex-tools/dist/namespace.d.ts +87 -0
- package/vendor/nanocodex-tools/dist/namespace.js +338 -0
- package/vendor/nanocodex-tools/dist/repository-archive.d.ts +4 -0
- package/vendor/nanocodex-tools/dist/repository-archive.js +104 -0
- package/vendor/nanocodex-tools/dist/runtime.d.ts +30 -0
- package/vendor/nanocodex-tools/dist/runtime.js +37 -0
- package/vendor/nanocodex-tools/dist/session.d.ts +167 -0
- package/vendor/nanocodex-tools/dist/session.js +286 -0
- package/vendor/nanocodex-tools/dist/shell.d.ts +51 -0
- package/vendor/nanocodex-tools/dist/shell.js +553 -0
- package/vendor/nanocodex-tools/dist/ssh.d.ts +29 -0
- package/vendor/nanocodex-tools/dist/ssh.js +66 -0
- package/vendor/nanocodex-tools/dist/workspace.d.ts +45 -0
- package/vendor/nanocodex-tools/dist/workspace.js +237 -0
- package/vendor/nanocodex-tools/package.json +122 -0
- package/vendor/nanocodex-tools/runtime/code-runtime.mjs +817 -0
- package/vendor/nanocodex-tools/runtime/tool-configuration.mjs +50 -0
- package/vendor/nanocodex-tools/runtime/tool-router.mjs +730 -0
- package/vendor/nanocodex-tools/runtime/utf8.d.mts +2 -0
- package/vendor/nanocodex-tools/runtime/utf8.mjs +25 -0
- package/vendor/nanocodex-tools/tools/artifact.d.mts +69 -0
- package/vendor/nanocodex-tools/tools/artifact.mjs +270 -0
- package/vendor/nanocodex-tools/tools/attachment.mjs +603 -0
- package/vendor/nanocodex-tools/tools/bash.d.mts +90 -0
- package/vendor/nanocodex-tools/tools/bash.mjs +742 -0
- package/vendor/nanocodex-tools/tools/dataset.d.mts +9 -0
- package/vendor/nanocodex-tools/tools/dataset.mjs +47 -0
- package/vendor/nanocodex-tools/tools/datasetContract.mjs +54 -0
- package/vendor/nanocodex-tools/tools/datasetEngine.mjs +1167 -0
- package/vendor/nanocodex-tools/tools/execution-contract.d.mts +5 -0
- package/vendor/nanocodex-tools/tools/execution-contract.mjs +63 -0
- package/vendor/nanocodex-tools/tools/hostedCatalog.d.mts +20 -0
- package/vendor/nanocodex-tools/tools/hostedCatalog.mjs +67 -0
- package/vendor/nanocodex-tools/tools/hostedMachine.d.mts +10 -0
- package/vendor/nanocodex-tools/tools/hostedMachine.mjs +56 -0
- package/vendor/nanocodex-tools/tools/just-bash-browser.d.mts +1 -0
- package/vendor/nanocodex-tools/tools/just-bash-browser.mjs +1 -0
- package/vendor/nanocodex-tools/tools/namedTool.d.mts +3 -0
- package/vendor/nanocodex-tools/tools/namedTool.mjs +3 -0
- package/vendor/nanocodex-tools/tools/nodeProcess.d.mts +10 -0
- package/vendor/nanocodex-tools/tools/nodeProcess.mjs +314 -0
- package/vendor/nanocodex-tools/tools/processOutput.mjs +56 -0
- package/vendor/nanocodex-tools/tools/repository-workspace.d.mts +55 -0
- package/vendor/nanocodex-tools/tools/repository-workspace.mjs +397 -0
- package/vendor/nanocodex-tools/tools/ssh.d.mts +56 -0
- package/vendor/nanocodex-tools/tools/ssh.mjs +503 -0
- package/vendor/nanocodex-tools/tools/standard.mjs +458 -0
- package/vendor/nanocodex-tools/tools/standardDescriptions.mjs +3 -0
- package/vendor/nanocodex-tools/tools/types.d.mts +83 -0
- package/vendor/nanocodex-tools/tools/workspace.d.mts +25 -0
- package/vendor/nanocodex-tools/tools/workspace.mjs +282 -0
- package/vendor/nanocodex-tools/tools/x.d.mts +30 -0
- package/vendor/nanocodex-tools/tools/x.mjs +91 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export * as Actions from "../actions/index.mjs";
|
|
2
|
+
export {
|
|
3
|
+
createMemoryChatGptSubscriptionStore,
|
|
4
|
+
subscriptionRevision,
|
|
5
|
+
} from "../runtime/subscription-store.mjs";
|
|
6
|
+
export { createQuickJsEvaluator } from "../runtime/quickjs-evaluator.mjs";
|
|
7
|
+
export {
|
|
8
|
+
createTempoProvider,
|
|
9
|
+
createTempoProviderFromAccounts,
|
|
10
|
+
DEFAULT_MERCATOR_MCP_URL,
|
|
11
|
+
} from "../runtime/tempo-provider.mjs";
|
|
12
|
+
export type {
|
|
13
|
+
AccountsTempoProviderOptions,
|
|
14
|
+
AccountsWallet,
|
|
15
|
+
TempoProvider,
|
|
16
|
+
} from "../runtime/tempo-provider.mjs";
|
|
17
|
+
export type {
|
|
18
|
+
AgentEvent,
|
|
19
|
+
AgentLifecycle,
|
|
20
|
+
AgentSessionContext,
|
|
21
|
+
CompactionInstructionContext,
|
|
22
|
+
CompactionInstructionResolver,
|
|
23
|
+
CompactionItemIdentity,
|
|
24
|
+
CompactionOutcome,
|
|
25
|
+
CompactionReplacedEventPayload,
|
|
26
|
+
ChatGptCredential,
|
|
27
|
+
ChatGptCredentialSeed,
|
|
28
|
+
ChatGptLoginStatus,
|
|
29
|
+
ChatGptSubscriptionHandle,
|
|
30
|
+
ChatGptSubscriptionOptions,
|
|
31
|
+
ChatGptSubscriptionStore,
|
|
32
|
+
CostStatus,
|
|
33
|
+
CodeEvaluator,
|
|
34
|
+
CodeEvaluatorEnvironment,
|
|
35
|
+
EstimatedUsdCost,
|
|
36
|
+
HistoryContentItem,
|
|
37
|
+
HistoryItem,
|
|
38
|
+
HistorySeed,
|
|
39
|
+
PromptInput,
|
|
40
|
+
PromptItem,
|
|
41
|
+
LifecycleTurn,
|
|
42
|
+
LifecycleTurnResult,
|
|
43
|
+
ReasoningMode,
|
|
44
|
+
SessionSnapshot,
|
|
45
|
+
Thinking,
|
|
46
|
+
CustomToolFormat,
|
|
47
|
+
Tool,
|
|
48
|
+
NamedTool,
|
|
49
|
+
ToolDefinition,
|
|
50
|
+
ToolJson,
|
|
51
|
+
ToolContext,
|
|
52
|
+
SubagentToolContext,
|
|
53
|
+
ToolConfiguration,
|
|
54
|
+
ToolMap,
|
|
55
|
+
Turn,
|
|
56
|
+
TurnResult,
|
|
57
|
+
TurnUsage,
|
|
58
|
+
McpPayment,
|
|
59
|
+
McpServer,
|
|
60
|
+
McpServers,
|
|
61
|
+
MemoryChatGptSubscriptionStore,
|
|
62
|
+
MppSession,
|
|
63
|
+
SubscriptionCommitRequest,
|
|
64
|
+
SubscriptionCommitResult,
|
|
65
|
+
SubscriptionRevision,
|
|
66
|
+
SubscriptionStoredValue,
|
|
67
|
+
} from "../types.mjs";
|
|
68
|
+
export * as Agent from "./Agent.mjs";
|
|
69
|
+
export * as ChatGptSubscription from "./ChatGptSubscription.mjs";
|
|
70
|
+
export * as Subagents from "../runtime/subagents.mjs";
|
|
71
|
+
export * as Transport from "./Transport.mjs";
|
|
72
|
+
export * as Workspace from "./workspace.mjs";
|
|
73
|
+
export * as Tools from "../tools/index.mjs";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * as Actions from "../actions/index.mjs";
|
|
2
|
+
export {
|
|
3
|
+
createMemoryChatGptSubscriptionStore,
|
|
4
|
+
subscriptionRevision,
|
|
5
|
+
} from "../runtime/subscription-store.mjs";
|
|
6
|
+
export { createQuickJsEvaluator } from "../runtime/quickjs-evaluator.mjs";
|
|
7
|
+
export {
|
|
8
|
+
createTempoProvider,
|
|
9
|
+
createTempoProviderFromAccounts,
|
|
10
|
+
DEFAULT_MERCATOR_MCP_URL,
|
|
11
|
+
} from "../runtime/tempo-provider.mjs";
|
|
12
|
+
export * as Agent from "./Agent.mjs";
|
|
13
|
+
export * as ChatGptSubscription from "./ChatGptSubscription.mjs";
|
|
14
|
+
export * as Subagents from "../runtime/subagents.mjs";
|
|
15
|
+
export * as Transport from "./Transport.mjs";
|
|
16
|
+
export * as Workspace from "./workspace.mjs";
|
|
17
|
+
export * as Tools from "../tools/index.mjs";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Workspace, WorkspaceBackend, WorkspaceEntry } from "../runtime/workspace.mjs";
|
|
2
|
+
|
|
3
|
+
export { tools } from "../runtime/workspace.mjs";
|
|
4
|
+
|
|
5
|
+
export function open(options: {
|
|
6
|
+
path: string;
|
|
7
|
+
root?: string;
|
|
8
|
+
}): Promise<Workspace>;
|
|
9
|
+
|
|
10
|
+
export type { Workspace, WorkspaceBackend, WorkspaceEntry };
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import {
|
|
3
|
+
lstat,
|
|
4
|
+
mkdir,
|
|
5
|
+
open as openFile,
|
|
6
|
+
readdir,
|
|
7
|
+
readFile,
|
|
8
|
+
rename,
|
|
9
|
+
rm,
|
|
10
|
+
unlink,
|
|
11
|
+
} from "node:fs/promises";
|
|
12
|
+
import { isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
13
|
+
|
|
14
|
+
import { createWorkspace, normalizeRelativePath, tools } from "../runtime/workspace.mjs";
|
|
15
|
+
|
|
16
|
+
export { tools };
|
|
17
|
+
|
|
18
|
+
export async function open(options = {}) {
|
|
19
|
+
if (typeof options.path !== "string" || !options.path) {
|
|
20
|
+
throw new TypeError("Node workspace path must be a non-empty string");
|
|
21
|
+
}
|
|
22
|
+
const directory = resolve(options.path);
|
|
23
|
+
const logicalRoot = options.root ?? "/workspace";
|
|
24
|
+
try {
|
|
25
|
+
await mkdir(directory, { recursive: true });
|
|
26
|
+
} catch (error) {
|
|
27
|
+
throw privatePathError(error, directory, logicalRoot);
|
|
28
|
+
}
|
|
29
|
+
let metadata;
|
|
30
|
+
try {
|
|
31
|
+
metadata = await lstat(directory);
|
|
32
|
+
} catch (error) {
|
|
33
|
+
throw privatePathError(error, directory, logicalRoot);
|
|
34
|
+
}
|
|
35
|
+
if (!metadata.isDirectory() || metadata.isSymbolicLink()) {
|
|
36
|
+
throw new Error("Node workspace path must be a real directory");
|
|
37
|
+
}
|
|
38
|
+
return createWorkspace({
|
|
39
|
+
root: logicalRoot,
|
|
40
|
+
backend: nodeBackend(directory, logicalRoot),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function nodeBackend(root, logicalRoot) {
|
|
45
|
+
const backend = {
|
|
46
|
+
async list(path, { recursive, maxEntries }) {
|
|
47
|
+
const directory = await resolveDirectory(root, path, false);
|
|
48
|
+
const output = [];
|
|
49
|
+
await listDirectory(root, directory, path, recursive, maxEntries, output);
|
|
50
|
+
return output.sort((left, right) => left.path.localeCompare(right.path));
|
|
51
|
+
},
|
|
52
|
+
async readFile(path) {
|
|
53
|
+
return new Uint8Array(await readFile(await resolveFile(root, path)));
|
|
54
|
+
},
|
|
55
|
+
async writeFile(path, contents) {
|
|
56
|
+
const { directory, name } = await resolveParent(root, path, true);
|
|
57
|
+
const target = join(directory, name);
|
|
58
|
+
await rejectSymlink(target, { displayPath: path, optional: true });
|
|
59
|
+
const temporary = join(directory, `.nanocodex-${randomUUID()}.tmp`);
|
|
60
|
+
const handle = await openFile(temporary, "wx", 0o600);
|
|
61
|
+
try {
|
|
62
|
+
await handle.writeFile(contents);
|
|
63
|
+
await handle.close();
|
|
64
|
+
await rename(temporary, target);
|
|
65
|
+
} catch (error) {
|
|
66
|
+
await handle.close().catch(() => {});
|
|
67
|
+
await unlink(temporary).catch(() => {});
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
async remove(path, { recursive }) {
|
|
72
|
+
const { directory, name } = await resolveParent(root, path, false);
|
|
73
|
+
const target = join(directory, name);
|
|
74
|
+
await rejectSymlink(target, { displayPath: path });
|
|
75
|
+
await rm(target, { recursive, force: false });
|
|
76
|
+
},
|
|
77
|
+
async mkdir(path) {
|
|
78
|
+
await resolveDirectory(root, path, true);
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
return Object.fromEntries(Object.entries(backend).map(([name, operation]) => [
|
|
82
|
+
name,
|
|
83
|
+
async (...args) => {
|
|
84
|
+
try {
|
|
85
|
+
return await operation(...args);
|
|
86
|
+
} catch (error) {
|
|
87
|
+
throw privatePathError(error, root, logicalRoot);
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
]));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async function listDirectory(root, directory, prefix, recursive, maxEntries, output) {
|
|
94
|
+
const entries = await readdir(directory, { withFileTypes: true });
|
|
95
|
+
for (const entry of entries) {
|
|
96
|
+
if (output.length >= maxEntries) {
|
|
97
|
+
throw new RangeError(`workspace listing exceeds ${maxEntries} entries`);
|
|
98
|
+
}
|
|
99
|
+
if (entry.isSymbolicLink()) {
|
|
100
|
+
throw new Error(`workspace refuses symbolic link: ${displayRelative(prefix, entry.name)}`);
|
|
101
|
+
}
|
|
102
|
+
const path = displayRelative(prefix, entry.name);
|
|
103
|
+
const absolute = join(directory, entry.name);
|
|
104
|
+
if (entry.isDirectory()) {
|
|
105
|
+
output.push({ kind: "directory", path });
|
|
106
|
+
if (recursive) await listDirectory(root, absolute, path, true, maxEntries, output);
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (!entry.isFile()) throw new Error(`unsupported workspace entry: ${path}`);
|
|
110
|
+
const metadata = await lstat(absolute);
|
|
111
|
+
output.push({
|
|
112
|
+
kind: "file",
|
|
113
|
+
modifiedAt: metadata.mtimeMs,
|
|
114
|
+
path,
|
|
115
|
+
size: metadata.size,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
async function resolveFile(root, path) {
|
|
121
|
+
const { directory, name } = await resolveParent(root, path, false);
|
|
122
|
+
const target = join(directory, name);
|
|
123
|
+
const metadata = await rejectSymlink(target, { displayPath: path });
|
|
124
|
+
if (!metadata.isFile()) throw new Error(`workspace path is not a file: ${path}`);
|
|
125
|
+
return target;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async function resolveParent(root, path, create) {
|
|
129
|
+
const relative = normalizeRelativePath(path);
|
|
130
|
+
const segments = relative.split("/");
|
|
131
|
+
const name = segments.pop();
|
|
132
|
+
if (!name) throw new Error("workspace file path cannot be empty");
|
|
133
|
+
return {
|
|
134
|
+
directory: await resolveDirectory(root, segments.join("/"), create),
|
|
135
|
+
name,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
async function resolveDirectory(root, path, create) {
|
|
140
|
+
let directory = root;
|
|
141
|
+
const relative = normalizeRelativePath(path);
|
|
142
|
+
if (!relative) return directory;
|
|
143
|
+
for (const segment of relative.split("/")) {
|
|
144
|
+
directory = join(directory, segment);
|
|
145
|
+
let metadata;
|
|
146
|
+
try {
|
|
147
|
+
metadata = await lstat(directory);
|
|
148
|
+
} catch (error) {
|
|
149
|
+
if (error?.code !== "ENOENT" || !create) throw error;
|
|
150
|
+
await mkdir(directory);
|
|
151
|
+
metadata = await lstat(directory);
|
|
152
|
+
}
|
|
153
|
+
if (metadata.isSymbolicLink() || !metadata.isDirectory()) {
|
|
154
|
+
throw new Error(`workspace directory path is unsafe: ${path}`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
assertInside(root, directory);
|
|
158
|
+
return directory;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
async function rejectSymlink(path, { displayPath = path, optional = false } = {}) {
|
|
162
|
+
try {
|
|
163
|
+
const metadata = await lstat(path);
|
|
164
|
+
if (metadata.isSymbolicLink()) {
|
|
165
|
+
throw new Error(`workspace refuses symbolic link: ${displayPath}`);
|
|
166
|
+
}
|
|
167
|
+
return metadata;
|
|
168
|
+
} catch (error) {
|
|
169
|
+
if (optional && error?.code === "ENOENT") return undefined;
|
|
170
|
+
throw error;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function assertInside(root, path) {
|
|
175
|
+
const descendant = relative(root, path);
|
|
176
|
+
if (
|
|
177
|
+
!isAbsolute(root)
|
|
178
|
+
|| descendant === ".."
|
|
179
|
+
|| descendant.startsWith(`..${sep}`)
|
|
180
|
+
|| isAbsolute(descendant)
|
|
181
|
+
) {
|
|
182
|
+
throw new Error("workspace path escaped its root");
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function privatePathError(error, nativeRoot, logicalRoot) {
|
|
187
|
+
if (!(error instanceof Error) || !error.message.includes(nativeRoot)) return error;
|
|
188
|
+
const sanitized = new Error(error.message.split(nativeRoot).join(logicalRoot));
|
|
189
|
+
sanitized.name = error.name;
|
|
190
|
+
for (const property of ["code", "errno", "syscall"]) {
|
|
191
|
+
if (property in error) sanitized[property] = error[property];
|
|
192
|
+
}
|
|
193
|
+
return sanitized;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function displayRelative(prefix, name) {
|
|
197
|
+
return prefix ? `${prefix}/${name}` : name;
|
|
198
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nanocodex",
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Viem-style Node and browser bindings for the Nanocodex WASM agent",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"./tools/browser/browserBuffer.mjs"
|
|
8
|
+
],
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./index.d.mts",
|
|
12
|
+
"import": "./index.mjs"
|
|
13
|
+
},
|
|
14
|
+
"./node": {
|
|
15
|
+
"types": "./node/index.d.mts",
|
|
16
|
+
"import": "./node/index.mjs"
|
|
17
|
+
},
|
|
18
|
+
"./node/workspace": {
|
|
19
|
+
"types": "./node/workspace.d.mts",
|
|
20
|
+
"import": "./node/workspace.mjs"
|
|
21
|
+
},
|
|
22
|
+
"./node/transport": {
|
|
23
|
+
"types": "./node/Transport.d.mts",
|
|
24
|
+
"import": "./node/Transport.mjs"
|
|
25
|
+
},
|
|
26
|
+
"./browser": {
|
|
27
|
+
"types": "./browser/index.d.mts",
|
|
28
|
+
"import": "./browser/index.mjs"
|
|
29
|
+
},
|
|
30
|
+
"./browser/workspace": {
|
|
31
|
+
"types": "./browser/workspace.d.mts",
|
|
32
|
+
"import": "./browser/workspace.mjs"
|
|
33
|
+
},
|
|
34
|
+
"./browser/transport": {
|
|
35
|
+
"types": "./browser/Transport.d.mts",
|
|
36
|
+
"import": "./browser/Transport.mjs"
|
|
37
|
+
},
|
|
38
|
+
"./browser/voice": {
|
|
39
|
+
"types": "./browser/Voice.d.mts",
|
|
40
|
+
"import": "./browser/Voice.mjs"
|
|
41
|
+
},
|
|
42
|
+
"./workspace": {
|
|
43
|
+
"types": "./runtime/workspace.d.mts",
|
|
44
|
+
"import": "./runtime/workspace.mjs"
|
|
45
|
+
},
|
|
46
|
+
"./host": {
|
|
47
|
+
"types": "./host/index.d.mts",
|
|
48
|
+
"import": "./host/index.mjs"
|
|
49
|
+
},
|
|
50
|
+
"./cloudflare": {
|
|
51
|
+
"types": "./cloudflare/index.d.mts",
|
|
52
|
+
"import": "./cloudflare/index.mjs"
|
|
53
|
+
},
|
|
54
|
+
"./cloudflare/egress": {
|
|
55
|
+
"types": "./cloudflare/egress.d.mts",
|
|
56
|
+
"import": "./cloudflare/egress.mjs"
|
|
57
|
+
},
|
|
58
|
+
"./managed": {
|
|
59
|
+
"types": "./managed/index.d.mts",
|
|
60
|
+
"import": "./managed/index.mjs"
|
|
61
|
+
},
|
|
62
|
+
"./connect": {
|
|
63
|
+
"types": "./cloud/index.d.mts",
|
|
64
|
+
"import": "./cloud/index.mjs"
|
|
65
|
+
},
|
|
66
|
+
"./connect/actions": {
|
|
67
|
+
"types": "./cloud/actions/index.d.mts",
|
|
68
|
+
"import": "./cloud/actions/index.mjs"
|
|
69
|
+
},
|
|
70
|
+
"./connect/server": {
|
|
71
|
+
"types": "./cloud/server/index.d.mts",
|
|
72
|
+
"import": "./cloud/server/index.mjs"
|
|
73
|
+
},
|
|
74
|
+
"./durability": {
|
|
75
|
+
"types": "./runtime/durability-store.d.mts",
|
|
76
|
+
"import": "./runtime/durability-store.mjs"
|
|
77
|
+
},
|
|
78
|
+
"./durability/postgres": {
|
|
79
|
+
"types": "./runtime/postgres-durability-store.d.mts",
|
|
80
|
+
"import": "./runtime/postgres-durability-store.mjs"
|
|
81
|
+
},
|
|
82
|
+
"./durability/cloudflare": {
|
|
83
|
+
"types": "./runtime/cloudflare-durability-store.d.mts",
|
|
84
|
+
"import": "./runtime/cloudflare-durability-store.mjs"
|
|
85
|
+
},
|
|
86
|
+
"./subagents": {
|
|
87
|
+
"types": "./runtime/subagents.d.mts",
|
|
88
|
+
"import": "./runtime/subagents.mjs"
|
|
89
|
+
},
|
|
90
|
+
"./tools": {
|
|
91
|
+
"types": "./tools/index.d.mts",
|
|
92
|
+
"import": "./tools/index.mjs"
|
|
93
|
+
},
|
|
94
|
+
"./tools/hosted-catalog": {
|
|
95
|
+
"types": "./tools/hostedCatalog.d.mts",
|
|
96
|
+
"import": "./tools/hostedCatalog.mjs"
|
|
97
|
+
},
|
|
98
|
+
"./tools/dataset": {
|
|
99
|
+
"types": "./tools/dataset.d.mts",
|
|
100
|
+
"import": "./tools/dataset.mjs"
|
|
101
|
+
},
|
|
102
|
+
"./tools/artifact": {
|
|
103
|
+
"types": "./tools/artifact.d.mts",
|
|
104
|
+
"import": "./tools/artifact.mjs"
|
|
105
|
+
},
|
|
106
|
+
"./tools/bash": {
|
|
107
|
+
"types": "./tools/bash.d.mts",
|
|
108
|
+
"import": "./tools/bash.mjs"
|
|
109
|
+
},
|
|
110
|
+
"./tools/ssh": {
|
|
111
|
+
"types": "./tools/ssh.d.mts",
|
|
112
|
+
"import": "./tools/ssh.mjs"
|
|
113
|
+
},
|
|
114
|
+
"./tools/repository-workspace": {
|
|
115
|
+
"types": "./tools/repository-workspace.d.mts",
|
|
116
|
+
"import": "./tools/repository-workspace.mjs"
|
|
117
|
+
},
|
|
118
|
+
"./tools/browser": {
|
|
119
|
+
"types": "./tools/browser/index.d.mts",
|
|
120
|
+
"import": "./tools/browser/index.mjs"
|
|
121
|
+
},
|
|
122
|
+
"./worker": {
|
|
123
|
+
"types": "./worker/index.d.mts",
|
|
124
|
+
"import": "./worker/index.mjs"
|
|
125
|
+
},
|
|
126
|
+
"./wasm": {
|
|
127
|
+
"types": "./wasm.d.mts",
|
|
128
|
+
"import": "./pkg-web/nanocodex_bg.wasm"
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"files": [
|
|
132
|
+
"actions",
|
|
133
|
+
"browser",
|
|
134
|
+
"cloudflare",
|
|
135
|
+
"cloud",
|
|
136
|
+
"host",
|
|
137
|
+
"managed",
|
|
138
|
+
"node",
|
|
139
|
+
"worker",
|
|
140
|
+
"pkg-node",
|
|
141
|
+
"pkg-web",
|
|
142
|
+
"runtime",
|
|
143
|
+
"tools",
|
|
144
|
+
"internal.mjs",
|
|
145
|
+
"index.d.mts",
|
|
146
|
+
"index.mjs",
|
|
147
|
+
"wasm.d.mts",
|
|
148
|
+
"types.d.mts",
|
|
149
|
+
"README.md"
|
|
150
|
+
],
|
|
151
|
+
"publishConfig": {
|
|
152
|
+
"access": "public",
|
|
153
|
+
"provenance": true
|
|
154
|
+
},
|
|
155
|
+
"dependencies": {
|
|
156
|
+
"@cfworker/json-schema": "4.1.1",
|
|
157
|
+
"@eduoj/wasm-clang": "1.0.0",
|
|
158
|
+
"@microsoft/dev-tunnels-ssh": "3.12.40",
|
|
159
|
+
"@microsoft/dev-tunnels-ssh-keys": "3.12.40",
|
|
160
|
+
"@modelcontextprotocol/sdk": "1.30.0",
|
|
161
|
+
"buffer": "6.0.3",
|
|
162
|
+
"diff": "^9.0.0",
|
|
163
|
+
"isomorphic-git": "^1.41.5",
|
|
164
|
+
"minisearch": "7.2.0",
|
|
165
|
+
"mppx": "0.9.1",
|
|
166
|
+
"nanocodex-tools": "0.1.0",
|
|
167
|
+
"ox": "1.6.2",
|
|
168
|
+
"pako": "2.1.0",
|
|
169
|
+
"pyodide": "314.0.5",
|
|
170
|
+
"sprintf-js": "1.1.3",
|
|
171
|
+
"viem": "2.55.13",
|
|
172
|
+
"wata": "0.4.0",
|
|
173
|
+
"ws": "^8.18.3"
|
|
174
|
+
},
|
|
175
|
+
"devDependencies": {
|
|
176
|
+
"@jitl/quickjs-wasmfile-release-asyncify": "0.32.0",
|
|
177
|
+
"binaryen": "132.0.0",
|
|
178
|
+
"hyparquet-writer": "0.16.6",
|
|
179
|
+
"pkg-pr-new": "0.0.79",
|
|
180
|
+
"quickjs-emscripten-core": "0.32.0",
|
|
181
|
+
"typescript": "5.9.3"
|
|
182
|
+
},
|
|
183
|
+
"engines": {
|
|
184
|
+
"node": ">=22.13.0"
|
|
185
|
+
},
|
|
186
|
+
"license": "MIT OR Apache-2.0",
|
|
187
|
+
"repository": {
|
|
188
|
+
"type": "git",
|
|
189
|
+
"url": "git+https://github.com/gakonst/nanocodex.git",
|
|
190
|
+
"directory": "js/nanocodex"
|
|
191
|
+
},
|
|
192
|
+
"scripts": {
|
|
193
|
+
"build": "pnpm --filter nanocodex-vite run build:wasm:release",
|
|
194
|
+
"check:package": "node scripts/check-package.mjs",
|
|
195
|
+
"test": "node --test test/*.test.mjs && npm run test:performance && npm run test:typecheck && npm run check:package",
|
|
196
|
+
"test:performance": "node --expose-gc --test test/performance.bench.mjs",
|
|
197
|
+
"bench:dataset": "node scripts/dataset.bench.mjs",
|
|
198
|
+
"test:typecheck": "tsc -p test/tsconfig.json"
|
|
199
|
+
}
|
|
200
|
+
}
|