@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,380 @@
|
|
|
1
|
+
import type { Model, PromptInput, ReasoningMode, Thinking, TurnUsage } from "../types.mjs";
|
|
2
|
+
import type { AgentId } from "../runtime/subagents.mjs";
|
|
3
|
+
|
|
4
|
+
export type HistorySource = Readonly<{ turn_id: string; cursor: string }>;
|
|
5
|
+
export type HistoryCitation = Readonly<{
|
|
6
|
+
thread_id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
sources: readonly HistorySource[];
|
|
9
|
+
}>;
|
|
10
|
+
export type SessionSearchHit = Readonly<{
|
|
11
|
+
session_id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
turn_id: string;
|
|
14
|
+
cursor: string;
|
|
15
|
+
score: number;
|
|
16
|
+
snippet: string;
|
|
17
|
+
}>;
|
|
18
|
+
export type FindSessionsRequest = Readonly<{
|
|
19
|
+
query: string;
|
|
20
|
+
limit?: number | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
export type FindSessionsResponse = Readonly<{
|
|
23
|
+
query: string;
|
|
24
|
+
results: readonly SessionSearchHit[];
|
|
25
|
+
citations: readonly HistoryCitation[];
|
|
26
|
+
}>;
|
|
27
|
+
export type ReadSessionRequest = Readonly<{
|
|
28
|
+
session_id: string;
|
|
29
|
+
turn_ids?: readonly string[] | undefined;
|
|
30
|
+
}>;
|
|
31
|
+
export type SessionTurn = Readonly<{
|
|
32
|
+
session_id: string;
|
|
33
|
+
title: string;
|
|
34
|
+
turn_id: string;
|
|
35
|
+
cursor: string;
|
|
36
|
+
user: string;
|
|
37
|
+
assistant: string;
|
|
38
|
+
}>;
|
|
39
|
+
export type ReadSessionResponse = Readonly<{
|
|
40
|
+
turns: readonly SessionTurn[];
|
|
41
|
+
citations: readonly HistoryCitation[];
|
|
42
|
+
}>;
|
|
43
|
+
export type MemoryKey = Readonly<{ id: number; version: number }>;
|
|
44
|
+
export type MemoryRecord = Readonly<{
|
|
45
|
+
key: MemoryKey;
|
|
46
|
+
content: string;
|
|
47
|
+
created_at_ms: number;
|
|
48
|
+
updated_at_ms: number;
|
|
49
|
+
last_scanned_at_ms: number | null;
|
|
50
|
+
scan_count: number;
|
|
51
|
+
last_used_at_ms: number | null;
|
|
52
|
+
use_count: number;
|
|
53
|
+
probation_until_ms: number | null;
|
|
54
|
+
}>;
|
|
55
|
+
export type MemoryCandidate = Readonly<{
|
|
56
|
+
key: MemoryKey;
|
|
57
|
+
preview: string;
|
|
58
|
+
score: number;
|
|
59
|
+
}>;
|
|
60
|
+
export type MemoryScanOperation = Readonly<{
|
|
61
|
+
operation: "scan";
|
|
62
|
+
query: string;
|
|
63
|
+
limit?: number | undefined;
|
|
64
|
+
}>;
|
|
65
|
+
export type MemoryReadOperation = Readonly<{ operation: "read"; keys: readonly MemoryKey[] }>;
|
|
66
|
+
export type MemoryPutOperation = Readonly<{
|
|
67
|
+
operation: "put";
|
|
68
|
+
content: string;
|
|
69
|
+
replace?: MemoryKey | undefined;
|
|
70
|
+
}>;
|
|
71
|
+
export type MemoryDeleteOperation = Readonly<{ operation: "delete"; key: MemoryKey }>;
|
|
72
|
+
export type MemoryOperation =
|
|
73
|
+
| MemoryScanOperation
|
|
74
|
+
| MemoryReadOperation
|
|
75
|
+
| MemoryPutOperation
|
|
76
|
+
| MemoryDeleteOperation;
|
|
77
|
+
export type MemoryScanResult = Readonly<{
|
|
78
|
+
operation: "scan";
|
|
79
|
+
abstained: boolean;
|
|
80
|
+
candidates: readonly MemoryCandidate[];
|
|
81
|
+
}>;
|
|
82
|
+
export type MemoryReadResult = Readonly<{
|
|
83
|
+
operation: "read";
|
|
84
|
+
memories: readonly MemoryRecord[];
|
|
85
|
+
}>;
|
|
86
|
+
export type MemoryPutResult = Readonly<{
|
|
87
|
+
operation: "put";
|
|
88
|
+
memory: MemoryRecord;
|
|
89
|
+
replaced: boolean;
|
|
90
|
+
}>;
|
|
91
|
+
export type MemoryDeleteResult = Readonly<{ operation: "delete"; key: MemoryKey }>;
|
|
92
|
+
export type MemoryResult =
|
|
93
|
+
| MemoryScanResult
|
|
94
|
+
| MemoryReadResult
|
|
95
|
+
| MemoryPutResult
|
|
96
|
+
| MemoryDeleteResult;
|
|
97
|
+
|
|
98
|
+
export type Organization = Readonly<{
|
|
99
|
+
id: string;
|
|
100
|
+
name: string | null;
|
|
101
|
+
rootTeam: Readonly<{ id: string; name: string | null }>;
|
|
102
|
+
authorizationEpoch: number;
|
|
103
|
+
createdAt: number;
|
|
104
|
+
updatedAt: number;
|
|
105
|
+
}>;
|
|
106
|
+
export type OrganizationUpdate = Readonly<{ name: string | null }>;
|
|
107
|
+
|
|
108
|
+
export type Options = Readonly<{
|
|
109
|
+
/** Managed service origin. Defaults to the current browser origin. */
|
|
110
|
+
baseUrl?: string | URL | undefined;
|
|
111
|
+
/** Server credential. Browsers omit this and authenticate with the account cookie. */
|
|
112
|
+
apiKey?: string | undefined;
|
|
113
|
+
/** Platform-compatible fetch implementation, primarily for non-browser hosts and tests. */
|
|
114
|
+
fetch?: typeof globalThis.fetch | undefined;
|
|
115
|
+
/** WebSocket factory for Node/RN. Authorization is supplied only to this private handshake callback. */
|
|
116
|
+
toolsTransport?: ((target: URL, options: Readonly<{
|
|
117
|
+
headers?: Readonly<Record<string, string>>;
|
|
118
|
+
credentials?: "include";
|
|
119
|
+
}>) => import("../tools/Tools.mjs").AttachmentSocket | Promise<import("../tools/Tools.mjs").AttachmentSocket>) | Readonly<{
|
|
120
|
+
connect(target: URL, options: Readonly<{
|
|
121
|
+
headers?: Readonly<Record<string, string>>;
|
|
122
|
+
credentials?: "include";
|
|
123
|
+
}>): import("../tools/Tools.mjs").AttachmentSocket | Promise<import("../tools/Tools.mjs").AttachmentSocket>;
|
|
124
|
+
}> | undefined;
|
|
125
|
+
}>;
|
|
126
|
+
|
|
127
|
+
export type CreateSettings = Readonly<{
|
|
128
|
+
model: Model;
|
|
129
|
+
thinking: Thinking;
|
|
130
|
+
reasoningMode: ReasoningMode;
|
|
131
|
+
fastMode: boolean;
|
|
132
|
+
}>;
|
|
133
|
+
|
|
134
|
+
export type SettingsPatch = Readonly<Partial<CreateSettings>>;
|
|
135
|
+
|
|
136
|
+
export type CreateOptions = Options & Readonly<{
|
|
137
|
+
/** Complete immutable starting policy. GPT-6 Astra requires at least low reasoning. */
|
|
138
|
+
settings?: CreateSettings | undefined;
|
|
139
|
+
}>;
|
|
140
|
+
|
|
141
|
+
export type Capabilities = Readonly<{
|
|
142
|
+
durable_turns: true;
|
|
143
|
+
resumable_events: true;
|
|
144
|
+
live_steer: true;
|
|
145
|
+
live_cancel: true;
|
|
146
|
+
workspace: "cloudflare-computer";
|
|
147
|
+
/** Tools can target explicit sandbox and connected-user environments. */
|
|
148
|
+
execution_environments: true;
|
|
149
|
+
/** Canonical commands select an execution hand from the root of their logical cwd. */
|
|
150
|
+
execution_namespace: "cwd-root-v1";
|
|
151
|
+
/** Native processes cannot yet access peer mounts through filesystem syscalls. */
|
|
152
|
+
native_cross_mounts: false;
|
|
153
|
+
}>;
|
|
154
|
+
|
|
155
|
+
export type State = Readonly<{
|
|
156
|
+
agent_id: string;
|
|
157
|
+
session_id: string;
|
|
158
|
+
has_snapshot: boolean;
|
|
159
|
+
completed_turns: number;
|
|
160
|
+
accepted_turns: number;
|
|
161
|
+
last_active: number;
|
|
162
|
+
active_turns: readonly string[];
|
|
163
|
+
active_turn_details: readonly Readonly<{ id: string; input: PromptInput }>[];
|
|
164
|
+
agent_loaded: boolean;
|
|
165
|
+
connected_clients: number;
|
|
166
|
+
capabilities: Capabilities;
|
|
167
|
+
latest_event_cursor: string;
|
|
168
|
+
stream_error: string | null;
|
|
169
|
+
settings: Readonly<{
|
|
170
|
+
model: Model;
|
|
171
|
+
thinking: Thinking;
|
|
172
|
+
reasoning_mode: ReasoningMode;
|
|
173
|
+
fast_mode: boolean;
|
|
174
|
+
}>;
|
|
175
|
+
}>;
|
|
176
|
+
|
|
177
|
+
export type Summary = Readonly<{
|
|
178
|
+
title: string;
|
|
179
|
+
createdAt: number;
|
|
180
|
+
updatedAt: number;
|
|
181
|
+
turnCount: number;
|
|
182
|
+
}>;
|
|
183
|
+
|
|
184
|
+
export type TurnState =
|
|
185
|
+
| "accepted"
|
|
186
|
+
| "cancelling"
|
|
187
|
+
| "completed"
|
|
188
|
+
| "cancelled"
|
|
189
|
+
| "failed";
|
|
190
|
+
|
|
191
|
+
export type TurnView = Readonly<{
|
|
192
|
+
turn_id: string;
|
|
193
|
+
state: TurnState;
|
|
194
|
+
input: PromptInput;
|
|
195
|
+
accepted_cursor: string;
|
|
196
|
+
terminal_cursor: string | null;
|
|
197
|
+
created_at: number;
|
|
198
|
+
accepted_at: number;
|
|
199
|
+
updated_at: number;
|
|
200
|
+
attempt_count: number;
|
|
201
|
+
retry_at: number | null;
|
|
202
|
+
error?: string | undefined;
|
|
203
|
+
terminal?: TerminalEventData | undefined;
|
|
204
|
+
}>;
|
|
205
|
+
|
|
206
|
+
export type EventData = Readonly<{
|
|
207
|
+
cursor: string;
|
|
208
|
+
created_at: number;
|
|
209
|
+
turn_id: string | null;
|
|
210
|
+
}> & (
|
|
211
|
+
| { type: "agent_created"; agent_id: string; capabilities: Capabilities }
|
|
212
|
+
| { type: "turn_accepted"; id: string; input: PromptInput; replayed: boolean }
|
|
213
|
+
| { type: "turn_cancelling"; id: string; error?: string; retry_at?: number }
|
|
214
|
+
| CompletedEventData
|
|
215
|
+
| { type: "turn_cancelled"; id: string }
|
|
216
|
+
| { type: "turn_retryable"; id: string; error: string }
|
|
217
|
+
| { type: "turn_failed"; id: string; error: string }
|
|
218
|
+
| { type: "event"; event: unknown; agent_id?: AgentId | undefined }
|
|
219
|
+
| { type: "stream_failed"; error: string }
|
|
220
|
+
);
|
|
221
|
+
|
|
222
|
+
export type CompletedEventData = Readonly<{
|
|
223
|
+
type: "turn_completed";
|
|
224
|
+
id: string;
|
|
225
|
+
final_message: string;
|
|
226
|
+
usage: TurnUsage | null;
|
|
227
|
+
citations: readonly HistoryCitation[];
|
|
228
|
+
usage_error?: string | undefined;
|
|
229
|
+
}>;
|
|
230
|
+
|
|
231
|
+
export type TerminalEventData =
|
|
232
|
+
| CompletedEventData
|
|
233
|
+
| Readonly<{ type: "turn_cancelled"; id: string }>
|
|
234
|
+
| Readonly<{ type: "turn_failed"; id: string; error: string }>;
|
|
235
|
+
|
|
236
|
+
export type Event = Readonly<{
|
|
237
|
+
cursor: string;
|
|
238
|
+
createdAt: number | undefined;
|
|
239
|
+
turnId: string | null;
|
|
240
|
+
type: EventData["type"] | string;
|
|
241
|
+
data: EventData;
|
|
242
|
+
}>;
|
|
243
|
+
|
|
244
|
+
export type WatchEventsOptions = Readonly<{
|
|
245
|
+
/** Resume after a durable decimal cursor, or tail atomically from `"latest"`. Defaults to `"0"`. */
|
|
246
|
+
cursor?: string | "latest" | undefined;
|
|
247
|
+
signal?: AbortSignal | undefined;
|
|
248
|
+
}>;
|
|
249
|
+
|
|
250
|
+
export type EventHistoryOptions = Readonly<{
|
|
251
|
+
/** Fetch events strictly before this durable cursor. Omit for the newest page. */
|
|
252
|
+
before?: string | undefined;
|
|
253
|
+
/** Page size from 1 through 256. Defaults to 128. */
|
|
254
|
+
limit?: number | undefined;
|
|
255
|
+
signal?: AbortSignal | undefined;
|
|
256
|
+
}>;
|
|
257
|
+
|
|
258
|
+
export type EventHistoryPage = Readonly<{
|
|
259
|
+
data: readonly Event[];
|
|
260
|
+
hasMore: boolean;
|
|
261
|
+
/** Cursor captured with the page; attach the live watcher strictly after it. */
|
|
262
|
+
latestCursor: string;
|
|
263
|
+
}>;
|
|
264
|
+
|
|
265
|
+
export type PromptOptions = Readonly<{
|
|
266
|
+
input: PromptInput;
|
|
267
|
+
/** Stable request key. A random key is generated when omitted. */
|
|
268
|
+
idempotencyKey?: string | undefined;
|
|
269
|
+
/** Optional stable turn identifier. */
|
|
270
|
+
id?: string | undefined;
|
|
271
|
+
signal?: AbortSignal | undefined;
|
|
272
|
+
}>;
|
|
273
|
+
|
|
274
|
+
export type TurnResult = Readonly<{
|
|
275
|
+
turnId: string;
|
|
276
|
+
finalMessage: string;
|
|
277
|
+
usage: TurnUsage | null;
|
|
278
|
+
citations: readonly HistoryCitation[];
|
|
279
|
+
usageError?: string | undefined;
|
|
280
|
+
cursor?: string | undefined;
|
|
281
|
+
}>;
|
|
282
|
+
|
|
283
|
+
export type TurnResultOptions = Readonly<{
|
|
284
|
+
/** Cancels only this result observer; it never cancels the durable server turn. */
|
|
285
|
+
signal?: AbortSignal | undefined;
|
|
286
|
+
}>;
|
|
287
|
+
|
|
288
|
+
export type Turn = Readonly<{
|
|
289
|
+
idempotencyKey: string;
|
|
290
|
+
accepted(): Promise<string>;
|
|
291
|
+
state(): Promise<TurnView>;
|
|
292
|
+
steer(options: Readonly<{ input: PromptInput }>): Promise<Readonly<{ turn_id: string; state: "steering" }>>;
|
|
293
|
+
/** With a caller-supplied prompt ID, cancellation does not wait for the prompt response. */
|
|
294
|
+
cancel(): Promise<TurnView | Readonly<{ turn_id: string; state: "cancelling" }>>;
|
|
295
|
+
result(options?: TurnResultOptions): Promise<TurnResult>;
|
|
296
|
+
}>;
|
|
297
|
+
|
|
298
|
+
export type CronTriggerConfig = Readonly<{
|
|
299
|
+
/** A fresh session per occurrence (default on create), or continue this conversation. Omit on update to retain the mode. */
|
|
300
|
+
session_mode?: "new" | "continue" | undefined;
|
|
301
|
+
/** Five-field cron expression, with minute precision. */
|
|
302
|
+
cron: string;
|
|
303
|
+
/** IANA time zone. Defaults to UTC. */
|
|
304
|
+
timezone?: string | undefined;
|
|
305
|
+
/** Text prompt submitted for each occurrence, at most 64 KiB. */
|
|
306
|
+
input: string;
|
|
307
|
+
/** Defaults to true; false pauses future occurrences. */
|
|
308
|
+
enabled?: boolean | undefined;
|
|
309
|
+
}>;
|
|
310
|
+
|
|
311
|
+
export type CronTrigger = Readonly<{
|
|
312
|
+
id: string;
|
|
313
|
+
session_mode: "new" | "continue";
|
|
314
|
+
/** Session containing last_turn_id; null before a run or on legacy servers. */
|
|
315
|
+
last_agent_id: string | null;
|
|
316
|
+
cron: string;
|
|
317
|
+
timezone: string;
|
|
318
|
+
input: string;
|
|
319
|
+
enabled: boolean;
|
|
320
|
+
/** Unix milliseconds; null while paused. */
|
|
321
|
+
next_run_at: number | null;
|
|
322
|
+
/** Scheduled time of the last accepted occurrence, in Unix milliseconds. */
|
|
323
|
+
last_run_at: number | null;
|
|
324
|
+
last_turn_id: string | null;
|
|
325
|
+
last_skipped_at: number | null;
|
|
326
|
+
created_at: number;
|
|
327
|
+
updated_at: number;
|
|
328
|
+
}>;
|
|
329
|
+
|
|
330
|
+
export type Agent = Readonly<{
|
|
331
|
+
type: "managed";
|
|
332
|
+
id: string;
|
|
333
|
+
/** Account-owned list metadata, present on handles returned by `list()`. */
|
|
334
|
+
summary?: Summary | undefined;
|
|
335
|
+
turn: Readonly<{ prompt(options: PromptOptions): Turn }>;
|
|
336
|
+
settings: Readonly<{
|
|
337
|
+
read(): Promise<CreateSettings>;
|
|
338
|
+
update(patch: SettingsPatch): Promise<CreateSettings>;
|
|
339
|
+
}>;
|
|
340
|
+
triggers: Readonly<{
|
|
341
|
+
list(): Promise<readonly CronTrigger[]>;
|
|
342
|
+
get(id: string): Promise<CronTrigger>;
|
|
343
|
+
/** Create or replace an account-owned schedule using a stable id. */
|
|
344
|
+
put(id: string, config: CronTriggerConfig): Promise<CronTrigger>;
|
|
345
|
+
delete(id: string): Promise<void>;
|
|
346
|
+
}>;
|
|
347
|
+
/** Reverse-tool endpoint with cookie/bearer transport retained in a private closure. */
|
|
348
|
+
toolsTarget(): import("../tools/Tools.mjs").AttachmentTarget;
|
|
349
|
+
events: Readonly<{
|
|
350
|
+
page(options?: EventHistoryOptions): Promise<EventHistoryPage>;
|
|
351
|
+
/**
|
|
352
|
+
* Each iterator has a private 4,096-event/32-MiB buffer. A lagging iterator
|
|
353
|
+
* fails with an actionable resume cursor instead of dropping durable events.
|
|
354
|
+
*/
|
|
355
|
+
watch(options?: WatchEventsOptions): AsyncIterableIterator<Event>;
|
|
356
|
+
}>;
|
|
357
|
+
state(): Promise<State>;
|
|
358
|
+
delete(): Promise<void>;
|
|
359
|
+
}>;
|
|
360
|
+
|
|
361
|
+
export function create(options?: CreateOptions): Promise<Agent>;
|
|
362
|
+
export function list(options?: Options): Promise<readonly Agent[]>;
|
|
363
|
+
export function get(id: string, options?: Options): Promise<Agent>;
|
|
364
|
+
/** Open a handle immediately; each subsequent operation verifies ownership server-side. */
|
|
365
|
+
export function open(id: string, options?: Options): Agent;
|
|
366
|
+
export function remove(id: string, options?: Options): Promise<void>;
|
|
367
|
+
export { remove as delete };
|
|
368
|
+
export function findSessions(request: FindSessionsRequest, options?: Options): Promise<FindSessionsResponse>;
|
|
369
|
+
export function readSession(request: ReadSessionRequest, options?: Options): Promise<ReadSessionResponse>;
|
|
370
|
+
/** List the authenticated account's hosted durable memory. */
|
|
371
|
+
export function listMemories(options?: Options): Promise<readonly MemoryRecord[]>;
|
|
372
|
+
/** Compare-and-swap delete one hosted durable memory; deleting an absent id is idempotent. */
|
|
373
|
+
export function deleteMemory(key: MemoryKey, options?: Options): Promise<void>;
|
|
374
|
+
export function memory(operation: MemoryScanOperation, options?: Options): Promise<MemoryScanResult>;
|
|
375
|
+
export function memory(operation: MemoryReadOperation, options?: Options): Promise<MemoryReadResult>;
|
|
376
|
+
export function memory(operation: MemoryPutOperation, options?: Options): Promise<MemoryPutResult>;
|
|
377
|
+
export function memory(operation: MemoryDeleteOperation, options?: Options): Promise<MemoryDeleteResult>;
|
|
378
|
+
export function memory(operation: MemoryOperation, options?: Options): Promise<MemoryResult>;
|
|
379
|
+
export function getOrganization(options?: Options): Promise<Organization>;
|
|
380
|
+
export function updateOrganization(request: OrganizationUpdate, options?: Options): Promise<Organization>;
|