@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,92 @@
|
|
|
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
|
+
ExecutionEnvironment,
|
|
37
|
+
HistoryContentItem,
|
|
38
|
+
HistoryItem,
|
|
39
|
+
HistorySeed,
|
|
40
|
+
PromptInput,
|
|
41
|
+
PromptItem,
|
|
42
|
+
LifecycleTurn,
|
|
43
|
+
LifecycleTurnResult,
|
|
44
|
+
ReasoningMode,
|
|
45
|
+
SessionSnapshot,
|
|
46
|
+
Thinking,
|
|
47
|
+
CustomToolFormat,
|
|
48
|
+
Tool,
|
|
49
|
+
NamedTool,
|
|
50
|
+
ToolDefinition,
|
|
51
|
+
ToolJson,
|
|
52
|
+
ToolContext,
|
|
53
|
+
SubagentToolContext,
|
|
54
|
+
ToolConfiguration,
|
|
55
|
+
ToolMap,
|
|
56
|
+
Turn,
|
|
57
|
+
TurnResult,
|
|
58
|
+
TurnUsage,
|
|
59
|
+
McpPayment,
|
|
60
|
+
McpServer,
|
|
61
|
+
McpServers,
|
|
62
|
+
MemoryChatGptSubscriptionStore,
|
|
63
|
+
MppSession,
|
|
64
|
+
SubscriptionCommitRequest,
|
|
65
|
+
SubscriptionCommitResult,
|
|
66
|
+
SubscriptionRevision,
|
|
67
|
+
SubscriptionStoredValue,
|
|
68
|
+
} from "../types.mjs";
|
|
69
|
+
export * as Agent from "./Agent.mjs";
|
|
70
|
+
export * as ChatGptSubscription from "./ChatGptSubscription.mjs";
|
|
71
|
+
export * as Subagents from "../runtime/subagents.mjs";
|
|
72
|
+
export * as Transport from "./Transport.mjs";
|
|
73
|
+
export * as Voice from "./Voice.mjs";
|
|
74
|
+
export * as Workspace from "./workspace.mjs";
|
|
75
|
+
export * as Tools from "../tools/index.mjs";
|
|
76
|
+
export {
|
|
77
|
+
createConfig,
|
|
78
|
+
type AgentParameters,
|
|
79
|
+
type AgentSnapshot,
|
|
80
|
+
type AgentStatus,
|
|
81
|
+
type Config,
|
|
82
|
+
type CreateConfigParameters,
|
|
83
|
+
} from "./config.mjs";
|
|
84
|
+
export {
|
|
85
|
+
defaultHostManagedWebSocketUrl,
|
|
86
|
+
openHostManagedWebSocket,
|
|
87
|
+
type HostManagedWebSocketOptions,
|
|
88
|
+
} from "./hostManagedWebSocket.mjs";
|
|
89
|
+
export type {
|
|
90
|
+
BrowserWebSocketConnection,
|
|
91
|
+
BrowserWebSocketRequest,
|
|
92
|
+
} from "./host.mjs";
|
|
@@ -0,0 +1,23 @@
|
|
|
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 Voice from "./Voice.mjs";
|
|
17
|
+
export * as Workspace from "./workspace.mjs";
|
|
18
|
+
export * as Tools from "../tools/index.mjs";
|
|
19
|
+
export { createConfig } from "./config.mjs";
|
|
20
|
+
export {
|
|
21
|
+
defaultHostManagedWebSocketUrl,
|
|
22
|
+
openHostManagedWebSocket,
|
|
23
|
+
} from "./hostManagedWebSocket.mjs";
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { durabilityRevision } from "../runtime/durability-store.mjs";
|
|
2
|
+
|
|
3
|
+
const DATABASE_NAME = "nanocodex-browser-durability-v2";
|
|
4
|
+
const DATABASE_VERSION = 1;
|
|
5
|
+
const OWNERS = "owners";
|
|
6
|
+
const STATES = "states";
|
|
7
|
+
const MAX_REVISION = "18446744073709551615";
|
|
8
|
+
|
|
9
|
+
/** Creates the Worker-local IndexedDB durability capability. */
|
|
10
|
+
export function createIndexedDbDurabilityStore(options = {}) {
|
|
11
|
+
const indexedDb = options.indexedDB ?? globalThis.indexedDB;
|
|
12
|
+
if (!indexedDb || typeof indexedDb.open !== "function") {
|
|
13
|
+
throw new TypeError("browser durability requires IndexedDB");
|
|
14
|
+
}
|
|
15
|
+
const databaseName = options.databaseName ?? DATABASE_NAME;
|
|
16
|
+
requireId(databaseName, "browser durability database name");
|
|
17
|
+
let database;
|
|
18
|
+
const open = () => {
|
|
19
|
+
if (database) return database;
|
|
20
|
+
const opening = openDatabase(indexedDb, databaseName, () => {
|
|
21
|
+
if (database === opening) database = undefined;
|
|
22
|
+
}).catch((error) => {
|
|
23
|
+
if (database === opening) database = undefined;
|
|
24
|
+
throw error;
|
|
25
|
+
});
|
|
26
|
+
database = opening;
|
|
27
|
+
return opening;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return Object.freeze({
|
|
31
|
+
async load(stateId) {
|
|
32
|
+
requireId(stateId, "durability state ID");
|
|
33
|
+
const db = await open();
|
|
34
|
+
const transaction = db.transaction([STATES], "readonly");
|
|
35
|
+
const state = await requestResult(transaction.objectStore(STATES).get(stateId));
|
|
36
|
+
await transactionCompletion(transaction);
|
|
37
|
+
return storedState(state, stateId);
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
async acquire(stateId, request) {
|
|
41
|
+
requireId(stateId, "durability state ID");
|
|
42
|
+
const ownerId = requireId(request?.ownerId, "durability owner ID");
|
|
43
|
+
const db = await open();
|
|
44
|
+
const transaction = db.transaction([OWNERS, STATES], "readwrite");
|
|
45
|
+
const completed = transactionCompletion(transaction);
|
|
46
|
+
try {
|
|
47
|
+
const owners = transaction.objectStore(OWNERS);
|
|
48
|
+
const previous = await requestResult(owners.get(stateId));
|
|
49
|
+
const previousFence = previous === undefined ? "0" : storedOwner(previous, stateId).fence;
|
|
50
|
+
if (previousFence === MAX_REVISION) throw new RangeError("IndexedDB durability fence overflow");
|
|
51
|
+
const fence = durabilityRevision(BigInt(previousFence) + 1n);
|
|
52
|
+
await requestResult(owners.put({ stateId, ownerId, fence }));
|
|
53
|
+
const state = storedState(await requestResult(transaction.objectStore(STATES).get(stateId)), stateId);
|
|
54
|
+
await completed;
|
|
55
|
+
return Object.freeze({ ownerId, fence, ...state });
|
|
56
|
+
} catch (error) {
|
|
57
|
+
try { transaction.abort(); } catch {}
|
|
58
|
+
await completed.catch(() => {});
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
async replace(stateId, request) {
|
|
64
|
+
requireId(stateId, "durability state ID");
|
|
65
|
+
const ownerId = requireId(request?.ownerId, "durability owner ID");
|
|
66
|
+
const fence = durabilityRevision(request?.fence);
|
|
67
|
+
const db = await open();
|
|
68
|
+
const transaction = db.transaction([OWNERS, STATES], "readwrite");
|
|
69
|
+
const completed = transactionCompletion(transaction);
|
|
70
|
+
try {
|
|
71
|
+
const ownerValue = await requestResult(transaction.objectStore(OWNERS).get(stateId));
|
|
72
|
+
const owner = ownerValue === undefined ? undefined : storedOwner(ownerValue, stateId);
|
|
73
|
+
if (owner?.ownerId !== ownerId || durabilityRevision(owner?.fence ?? "0") !== fence) {
|
|
74
|
+
await completed;
|
|
75
|
+
return { status: "fenced" };
|
|
76
|
+
}
|
|
77
|
+
const expectedRevision = durabilityRevision(request?.expectedRevision);
|
|
78
|
+
const states = transaction.objectStore(STATES);
|
|
79
|
+
const state = storedState(await requestResult(states.get(stateId)), stateId);
|
|
80
|
+
if (state.revision !== expectedRevision) {
|
|
81
|
+
await completed;
|
|
82
|
+
return { status: "conflict", actualRevision: state.revision };
|
|
83
|
+
}
|
|
84
|
+
if (expectedRevision === MAX_REVISION) {
|
|
85
|
+
await completed;
|
|
86
|
+
return { status: "not_committed", message: "IndexedDB durability revision overflow" };
|
|
87
|
+
}
|
|
88
|
+
const payload = requirePayload(request?.payload);
|
|
89
|
+
const revision = durabilityRevision(BigInt(expectedRevision) + 1n);
|
|
90
|
+
await requestResult(states.put({ stateId, revision, payload }));
|
|
91
|
+
await completed;
|
|
92
|
+
return { status: "replaced", revision };
|
|
93
|
+
} catch (error) {
|
|
94
|
+
try { transaction.abort(); } catch {}
|
|
95
|
+
await completed.catch(() => {});
|
|
96
|
+
throw error;
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function openDatabase(indexedDb, databaseName, invalidate) {
|
|
103
|
+
return new Promise((resolve, reject) => {
|
|
104
|
+
let settled = false;
|
|
105
|
+
const request = indexedDb.open(databaseName, DATABASE_VERSION);
|
|
106
|
+
request.onupgradeneeded = () => {
|
|
107
|
+
const database = request.result;
|
|
108
|
+
database.createObjectStore(OWNERS, { keyPath: "stateId" });
|
|
109
|
+
database.createObjectStore(STATES, { keyPath: "stateId" });
|
|
110
|
+
};
|
|
111
|
+
request.onerror = () => settle(reject, request.error ?? new Error("opening browser durability failed"));
|
|
112
|
+
request.onblocked = () => settle(reject, new Error("opening browser durability was blocked"));
|
|
113
|
+
request.onsuccess = () => {
|
|
114
|
+
const opened = request.result;
|
|
115
|
+
if (settled) return opened.close();
|
|
116
|
+
const stores = Array.from(opened.objectStoreNames).sort();
|
|
117
|
+
if (stores.length !== 2 || stores[0] !== OWNERS || stores[1] !== STATES
|
|
118
|
+
|| !validStoreSchema(opened, OWNERS) || !validStoreSchema(opened, STATES)) {
|
|
119
|
+
opened.close();
|
|
120
|
+
return settle(reject, new Error("incompatible IndexedDB durability schema; delete the database"));
|
|
121
|
+
}
|
|
122
|
+
settled = true;
|
|
123
|
+
opened.onversionchange = () => { invalidate(); opened.close(); };
|
|
124
|
+
opened.onclose = () => invalidate();
|
|
125
|
+
resolve(opened);
|
|
126
|
+
};
|
|
127
|
+
function settle(callback, value) {
|
|
128
|
+
if (settled) return;
|
|
129
|
+
settled = true;
|
|
130
|
+
callback(value);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function validStoreSchema(database, name) {
|
|
136
|
+
try {
|
|
137
|
+
const store = database.transaction([name], "readonly").objectStore(name);
|
|
138
|
+
return store.keyPath === "stateId" && store.autoIncrement === false;
|
|
139
|
+
} catch {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function storedState(value, stateId) {
|
|
145
|
+
if (value === undefined) return Object.freeze({ revision: "0", payload: null });
|
|
146
|
+
exactRecord(value, ["stateId", "revision", "payload"], "IndexedDB durability state");
|
|
147
|
+
if (value.stateId !== stateId) throw new TypeError("IndexedDB durability state ID mismatch");
|
|
148
|
+
return Object.freeze({
|
|
149
|
+
revision: durabilityRevision(value.revision),
|
|
150
|
+
payload: requirePayload(value.payload),
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function storedOwner(value, stateId) {
|
|
155
|
+
exactRecord(value, ["stateId", "ownerId", "fence"], "IndexedDB durability owner");
|
|
156
|
+
if (value.stateId !== stateId) throw new TypeError("IndexedDB durability owner ID mismatch");
|
|
157
|
+
return Object.freeze({
|
|
158
|
+
ownerId: requireId(value.ownerId, "durability owner ID"),
|
|
159
|
+
fence: durabilityRevision(value.fence),
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function exactRecord(value, expected, label) {
|
|
164
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
165
|
+
throw new TypeError(`${label} must be an object`);
|
|
166
|
+
}
|
|
167
|
+
const actual = Object.keys(value).sort();
|
|
168
|
+
const required = [...expected].sort();
|
|
169
|
+
if (actual.length !== required.length || actual.some((key, index) => key !== required[index])) {
|
|
170
|
+
throw new TypeError(`${label} has an invalid shape`);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function requestResult(request) {
|
|
175
|
+
return new Promise((resolve, reject) => {
|
|
176
|
+
request.onsuccess = () => resolve(request.result);
|
|
177
|
+
request.onerror = () => reject(request.error ?? new Error("IndexedDB durability request failed"));
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function transactionCompletion(transaction) {
|
|
182
|
+
return new Promise((resolve, reject) => {
|
|
183
|
+
transaction.oncomplete = () => resolve();
|
|
184
|
+
transaction.onerror = () => reject(transaction.error ?? new Error("IndexedDB durability transaction failed"));
|
|
185
|
+
transaction.onabort = () => reject(transaction.error ?? new Error("IndexedDB durability transaction was aborted"));
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function requireId(value, label) {
|
|
190
|
+
if (typeof value !== "string" || !value.trim()) throw new TypeError(`${label} must be a non-empty string`);
|
|
191
|
+
return value;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function requirePayload(value) {
|
|
195
|
+
if (typeof value !== "string") throw new TypeError("durability payload must be a string");
|
|
196
|
+
return value;
|
|
197
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Workspace, WorkspaceBackend, WorkspaceEntry } from "../runtime/workspace.mjs";
|
|
2
|
+
|
|
3
|
+
export { tools } from "../runtime/workspace.mjs";
|
|
4
|
+
|
|
5
|
+
type OpfsStorage = {
|
|
6
|
+
getDirectory(): Promise<FileSystemDirectoryHandle>;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export function open(options?: {
|
|
10
|
+
name?: string | undefined;
|
|
11
|
+
root?: string | undefined;
|
|
12
|
+
/** Primarily useful for non-DOM hosts and deterministic tests. */
|
|
13
|
+
storage?: OpfsStorage | undefined;
|
|
14
|
+
}): Promise<Workspace>;
|
|
15
|
+
|
|
16
|
+
export type { Workspace, WorkspaceBackend, WorkspaceEntry };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { createWorkspace, normalizeRelativePath, tools } from "../runtime/workspace.mjs";
|
|
2
|
+
|
|
3
|
+
const WORKSPACE_DIRECTORY = "nanocodex-workspaces";
|
|
4
|
+
|
|
5
|
+
export { tools };
|
|
6
|
+
|
|
7
|
+
export async function open(options = {}) {
|
|
8
|
+
const name = workspaceName(options.name ?? "default");
|
|
9
|
+
const storage = options.storage ?? globalThis.navigator?.storage;
|
|
10
|
+
if (!storage || typeof storage.getDirectory !== "function") {
|
|
11
|
+
throw new Error("Origin Private File System storage is unavailable in this browser");
|
|
12
|
+
}
|
|
13
|
+
const origin = await storage.getDirectory();
|
|
14
|
+
const workspaces = await origin.getDirectoryHandle(WORKSPACE_DIRECTORY, { create: true });
|
|
15
|
+
const directory = await workspaces.getDirectoryHandle(encodeURIComponent(name), { create: true });
|
|
16
|
+
return createWorkspace({
|
|
17
|
+
root: options.root ?? "/workspace",
|
|
18
|
+
backend: opfsBackend(directory),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function opfsBackend(root) {
|
|
23
|
+
return {
|
|
24
|
+
async list(path, { recursive, maxEntries }) {
|
|
25
|
+
const directory = await directoryHandle(root, path, false);
|
|
26
|
+
const entries = [];
|
|
27
|
+
await listDirectory(directory, path, recursive, maxEntries, entries);
|
|
28
|
+
return entries.sort((left, right) => left.path.localeCompare(right.path));
|
|
29
|
+
},
|
|
30
|
+
async readFile(path) {
|
|
31
|
+
const { directory, name } = await parentHandle(root, path, false);
|
|
32
|
+
const handle = await directory.getFileHandle(name);
|
|
33
|
+
return new Uint8Array(await (await handle.getFile()).arrayBuffer());
|
|
34
|
+
},
|
|
35
|
+
async writeFile(path, contents) {
|
|
36
|
+
const { directory, name } = await parentHandle(root, path, true);
|
|
37
|
+
const handle = await directory.getFileHandle(name, { create: true });
|
|
38
|
+
const writable = await handle.createWritable();
|
|
39
|
+
try {
|
|
40
|
+
await writable.write(contents);
|
|
41
|
+
await writable.close();
|
|
42
|
+
} catch (error) {
|
|
43
|
+
await writable.abort?.().catch(() => {});
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
async remove(path, { recursive }) {
|
|
48
|
+
const { directory, name } = await parentHandle(root, path, false);
|
|
49
|
+
await directory.removeEntry(name, { recursive });
|
|
50
|
+
},
|
|
51
|
+
async mkdir(path) {
|
|
52
|
+
await directoryHandle(root, path, true);
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function listDirectory(directory, prefix, recursive, maxEntries, output) {
|
|
58
|
+
for await (const [name, handle] of directory.entries()) {
|
|
59
|
+
if (output.length >= maxEntries) {
|
|
60
|
+
throw new RangeError(`workspace listing exceeds ${maxEntries} entries`);
|
|
61
|
+
}
|
|
62
|
+
const path = prefix ? `${prefix}/${name}` : name;
|
|
63
|
+
if (handle.kind === "directory") {
|
|
64
|
+
output.push({ kind: "directory", path });
|
|
65
|
+
if (recursive) await listDirectory(handle, path, true, maxEntries, output);
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (handle.kind !== "file") throw new Error(`unsupported workspace entry kind: ${handle.kind}`);
|
|
69
|
+
const file = await handle.getFile();
|
|
70
|
+
output.push({
|
|
71
|
+
kind: "file",
|
|
72
|
+
modifiedAt: file.lastModified,
|
|
73
|
+
path,
|
|
74
|
+
size: file.size,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async function directoryHandle(root, path, create) {
|
|
80
|
+
let directory = root;
|
|
81
|
+
const relative = normalizeRelativePath(path);
|
|
82
|
+
if (!relative) return directory;
|
|
83
|
+
for (const segment of relative.split("/")) {
|
|
84
|
+
directory = await directory.getDirectoryHandle(segment, { create });
|
|
85
|
+
}
|
|
86
|
+
return directory;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
async function parentHandle(root, path, create) {
|
|
90
|
+
const relative = normalizeRelativePath(path);
|
|
91
|
+
const segments = relative.split("/");
|
|
92
|
+
const name = segments.pop();
|
|
93
|
+
if (!name) throw new Error("workspace file path cannot be empty");
|
|
94
|
+
return {
|
|
95
|
+
directory: await directoryHandle(root, segments.join("/"), create),
|
|
96
|
+
name,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function workspaceName(value) {
|
|
101
|
+
if (typeof value !== "string" || !value.trim()) {
|
|
102
|
+
throw new TypeError("workspace name must be a non-empty string");
|
|
103
|
+
}
|
|
104
|
+
if (value.length > 128) throw new RangeError("workspace name cannot exceed 128 characters");
|
|
105
|
+
if (value.includes("\0")) throw new TypeError("workspace name cannot contain NUL");
|
|
106
|
+
return value;
|
|
107
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { ConnectActions } from "./Decorator.mjs";
|
|
2
|
+
import type { Instance as DialogInstance, Dialog } from "./Dialog.mjs";
|
|
3
|
+
import type { Instance as PrincipalInstance, Principal } from "./Principal.mjs";
|
|
4
|
+
import type { Request, Transport } from "./Transport.mjs";
|
|
5
|
+
import type { Auth, AuthorizeAccessKey } from "./actions/connection.mjs";
|
|
6
|
+
import type { HostConnection } from "./types.mjs";
|
|
7
|
+
|
|
8
|
+
export type Provider = Readonly<{
|
|
9
|
+
request(request: Readonly<{
|
|
10
|
+
method: string;
|
|
11
|
+
params?: readonly unknown[] | undefined;
|
|
12
|
+
context?: Readonly<Record<string, unknown>> | undefined;
|
|
13
|
+
}>): Promise<unknown>;
|
|
14
|
+
/** Internal lifecycle reset used after account logout. */
|
|
15
|
+
reset?(): Promise<void>;
|
|
16
|
+
store?: Readonly<{
|
|
17
|
+
getState?(): Readonly<{
|
|
18
|
+
accounts?: readonly Readonly<{ address: string }>[] | undefined;
|
|
19
|
+
activeAccount?: number | undefined;
|
|
20
|
+
accessKeys?: readonly Readonly<{
|
|
21
|
+
access: string;
|
|
22
|
+
address: string;
|
|
23
|
+
chainId: number;
|
|
24
|
+
expiry: number;
|
|
25
|
+
}>[] | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
}> | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
|
|
30
|
+
export type Base<principal extends PrincipalInstance | undefined = PrincipalInstance | undefined> = Readonly<{
|
|
31
|
+
appId: string;
|
|
32
|
+
appOrigin: string | undefined;
|
|
33
|
+
accessKey: Readonly<{ authorize?: AuthorizeAccessKey | undefined }> | undefined;
|
|
34
|
+
auth: Auth | undefined;
|
|
35
|
+
dialog: DialogInstance;
|
|
36
|
+
key: string;
|
|
37
|
+
name: string;
|
|
38
|
+
principal: principal;
|
|
39
|
+
provider: Provider;
|
|
40
|
+
type: "connect";
|
|
41
|
+
uid: string;
|
|
42
|
+
transport: Readonly<{ key: string; name: string; type: string; baseUrl: string }>;
|
|
43
|
+
fetch(input: RequestInfo | URL, init?: RequestInit | undefined): Promise<Response>;
|
|
44
|
+
request(request: Request): Promise<unknown>;
|
|
45
|
+
}>;
|
|
46
|
+
|
|
47
|
+
export type Client<
|
|
48
|
+
extension extends object = ConnectActions,
|
|
49
|
+
principal extends PrincipalInstance | undefined = undefined,
|
|
50
|
+
> = Base<principal> & extension & {
|
|
51
|
+
extend<next extends object>(decorator: (client: Client<extension, principal>) => next): Client<extension & next, principal>;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
type BaseParameters = Readonly<{
|
|
55
|
+
appId: string;
|
|
56
|
+
/** Exact browser origin bound into approvals and grants. Defaults to location.origin. */
|
|
57
|
+
appOrigin?: string | undefined;
|
|
58
|
+
/** Accounts-compatible default SIWE round-trip configuration. */
|
|
59
|
+
auth?: Auth | undefined;
|
|
60
|
+
/** Accounts-compatible default access-key authorization policy. */
|
|
61
|
+
accessKey?: Readonly<{ authorize?: AuthorizeAccessKey | undefined }> | undefined;
|
|
62
|
+
dialog?: Dialog | undefined;
|
|
63
|
+
key?: string | undefined;
|
|
64
|
+
name?: string | undefined;
|
|
65
|
+
/** Advanced override for the remote wallet provider that owns the access key. */
|
|
66
|
+
provider?: Provider | undefined;
|
|
67
|
+
/** App-scoped grant session persistence. Defaults to browser localStorage. */
|
|
68
|
+
session?: Pick<Storage, "getItem" | "setItem" | "removeItem"> | false | undefined;
|
|
69
|
+
transport?: Transport | undefined;
|
|
70
|
+
}>;
|
|
71
|
+
|
|
72
|
+
export type Parameters<principal extends Principal | undefined = undefined> = BaseParameters & (
|
|
73
|
+
principal extends Principal
|
|
74
|
+
? Readonly<{
|
|
75
|
+
/** Existing host login used only for hosted, principal-scoped authorization. */
|
|
76
|
+
principal: principal;
|
|
77
|
+
}>
|
|
78
|
+
: Readonly<{ principal?: undefined }>
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
export function create(parameters: Parameters<Principal<"host">>): Client<ConnectActions<HostConnection>, PrincipalInstance>;
|
|
82
|
+
export function create(parameters: Parameters): Client;
|
|
83
|
+
export function create(parameters: Parameters<Principal>): Client<ConnectActions<HostConnection>, PrincipalInstance>;
|