@effect-agent/platform-cloudflare 0.1.0-beta.9 → 0.1.0-beta.90
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/dist/Alarm.d.mts +188 -0
- package/dist/Alarm.mjs +451 -0
- package/dist/Alarm.mjs.map +1 -0
- package/dist/BrowserRestCapture.d.mts +35 -0
- package/dist/BrowserRestCapture.mjs +238 -0
- package/dist/BrowserRestCapture.mjs.map +1 -0
- package/dist/BrowserRestCrawl.d.mts +17 -0
- package/dist/BrowserRestCrawl.mjs +244 -0
- package/dist/BrowserRestCrawl.mjs.map +1 -0
- package/dist/CloudflareAiGateway.d.mts +64 -0
- package/dist/CloudflareAiGateway.mjs +70 -0
- package/dist/CloudflareAiGateway.mjs.map +1 -0
- package/dist/CloudflareBindings.d.mts +115 -0
- package/dist/CloudflareBindings.mjs +113 -0
- package/dist/CloudflareBindings.mjs.map +1 -0
- package/dist/CloudflareBrowser-DV6kya1H.mjs +495 -0
- package/dist/CloudflareBrowser-DV6kya1H.mjs.map +1 -0
- package/dist/CloudflareBrowser-Doe1M7R5.d.mts +80 -0
- package/dist/CloudflareBrowser.d.mts +2 -0
- package/dist/CloudflareBrowser.mjs +2 -0
- package/dist/CloudflareCodeMode.d.mts +44 -0
- package/dist/CloudflareCodeMode.mjs +616 -0
- package/dist/CloudflareCodeMode.mjs.map +1 -0
- package/dist/CloudflareConfig-f3CqTel1.d.mts +101 -0
- package/dist/CloudflareConfig.d.mts +2 -0
- package/dist/CloudflareConfig.mjs +122 -0
- package/dist/CloudflareConfig.mjs.map +1 -0
- package/dist/CloudflareMemory.d.mts +142 -0
- package/dist/CloudflareMemory.mjs +202 -0
- package/dist/CloudflareMemory.mjs.map +1 -0
- package/dist/CloudflareScheduling.d.mts +52 -0
- package/dist/CloudflareScheduling.mjs +396 -0
- package/dist/CloudflareScheduling.mjs.map +1 -0
- package/dist/CloudflareSubscriptions.d.mts +87 -0
- package/dist/CloudflareSubscriptions.mjs +530 -0
- package/dist/CloudflareSubscriptions.mjs.map +1 -0
- package/dist/CloudflareThreadClient.d.mts +1496 -0
- package/dist/CloudflareThreadClient.mjs +382 -0
- package/dist/CloudflareThreadClient.mjs.map +1 -0
- package/dist/InteractiveBrowser-DUE_m12-.d.mts +161 -0
- package/dist/InteractiveBrowser-DupDtfw2.mjs +1169 -0
- package/dist/InteractiveBrowser-DupDtfw2.mjs.map +1 -0
- package/dist/InteractiveBrowser.d.mts +2 -0
- package/dist/InteractiveBrowser.mjs +2 -0
- package/dist/ProtectedBrowser.d.mts +123 -0
- package/dist/ProtectedBrowser.mjs +1135 -0
- package/dist/ProtectedBrowser.mjs.map +1 -0
- package/dist/ThreadObject-CIbmXZCY.d.mts +812 -0
- package/dist/ThreadObject-DvRG0dDz.mjs +835 -0
- package/dist/ThreadObject-DvRG0dDz.mjs.map +1 -0
- package/dist/ThreadObject.d.mts +2 -0
- package/dist/ThreadObject.mjs +3 -0
- package/dist/WakeScheduler.d.mts +23 -0
- package/dist/WakeScheduler.mjs +57 -0
- package/dist/WakeScheduler.mjs.map +1 -0
- package/dist/boundary-BguazVkh.mjs +42 -0
- package/dist/boundary-BguazVkh.mjs.map +1 -0
- package/dist/index.d.mts +13 -1548
- package/dist/index.mjs +13 -1636
- package/dist/prepared-admission-DU0_T-ev.mjs +73 -0
- package/dist/prepared-admission-DU0_T-ev.mjs.map +1 -0
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/package.json +1 -53
- package/src/Alarm.ts +973 -0
- package/src/BrowserRestCapture.ts +477 -0
- package/src/BrowserRestCrawl.ts +540 -0
- package/src/CloudflareAiGateway.ts +170 -0
- package/src/CloudflareBindings.ts +199 -0
- package/src/CloudflareBrowser.ts +15 -0
- package/src/{code-mode-executor.ts → CloudflareCodeMode.ts} +372 -204
- package/src/{config.ts → CloudflareConfig.ts} +9 -8
- package/src/CloudflareMemory.ts +420 -0
- package/src/CloudflareScheduling.ts +747 -0
- package/src/CloudflareSubscriptions.ts +1041 -0
- package/src/CloudflareThreadClient.ts +809 -0
- package/src/InteractiveBrowser.ts +2354 -0
- package/src/ProtectedBrowser.ts +9 -0
- package/src/ThreadObject.ts +1179 -0
- package/src/{wake-scheduler.ts → WakeScheduler.ts} +32 -26
- package/src/index.ts +12 -23
- package/src/internal/boundary.ts +55 -0
- package/src/internal/browser-quick-action.ts +857 -0
- package/src/internal/browser-session-lifecycle.ts +160 -0
- package/src/internal/layers.ts +751 -0
- package/src/internal/message-delivery.ts +152 -0
- package/src/internal/prepared-admission.ts +116 -0
- package/src/internal/progress-wait.ts +121 -0
- package/src/internal/transport.ts +44 -0
- package/src/protected-browser/binding.ts +313 -0
- package/src/protected-browser/host.ts +344 -0
- package/src/protected-browser/inspect-frame.ts +125 -0
- package/src/protected-browser/native.ts +445 -0
- package/src/protected-browser/policy.ts +821 -0
- package/dist/index.mjs.map +0 -1
- package/src/alarm.ts +0 -334
- package/src/bindings.ts +0 -145
- package/src/client.ts +0 -646
- package/src/conversation-object.ts +0 -768
- package/src/layers.ts +0 -376
- package/src/transport.ts +0 -38
|
@@ -0,0 +1,1496 @@
|
|
|
1
|
+
import { ThreadObjectNamespace, ThreadObjectRpc } from "./CloudflareBindings.mjs";
|
|
2
|
+
import { t as AdmissionLimitExceeded } from "./CloudflareConfig-f3CqTel1.mjs";
|
|
3
|
+
import { DurableAlarmError } from "./Alarm.mjs";
|
|
4
|
+
import { Context, Crypto, Effect, Layer, Schema } from "effect";
|
|
5
|
+
import { DurableSubmitAgent, DurableSubmitOptions, Receipt } from "effect-agent/durable-agent-runtime";
|
|
6
|
+
import { ThreadId } from "effect-agent/identifiers";
|
|
7
|
+
import { AbortCommand, AbortIntent, AdmissionConflict, AdmissionPolicyError, ApprovalConflict, ApprovalDecisionCommand, ApprovalDecisionIntent, JoinedToHost, LedgerError, Settlement, SettlementConflict, UnknownResolutionCommand, UnknownResolutionConflict, UnknownResolutionIntent } from "effect-agent/submission-ledger";
|
|
8
|
+
import { CanonicalRecordEnvelope, CanonicalSequence, DefinitionDigests } from "effect-agent/records";
|
|
9
|
+
import { AgentInputError } from "effect-agent/agent-error";
|
|
10
|
+
import { DigestError } from "effect-agent/digest";
|
|
11
|
+
import { DurableRuntimeFailpointError } from "effect-agent/durable-failpoint";
|
|
12
|
+
import { OperationDenied } from "effect-agent/operation-authorizer";
|
|
13
|
+
import { SubmissionStatus } from "effect-agent/submission-status";
|
|
14
|
+
import { AppendConflict, FenceRejected, ThreadNotMaterialized, ThreadStoreError } from "effect-agent/thread-store";
|
|
15
|
+
declare namespace CloudflareThreadClient_d_exports {
|
|
16
|
+
export { AbortRecorded, ApprovalRecorded, AwaitProgressRequest, CancelProgressRequest, ClientAbortFailure, ClientApprovalFailure, ClientAwaitFailure, ClientObserveFailure, ClientProgressFailure, ClientSubmitFailure, ClientUnknownFailure, CloudflareThreadClient, HostFailed, HostFailure, HostProtocolError, HostResponse, ObservePageRequest, ObservedPage, ProgressCancelled, ProgressObserved, SettlementReached, SubmissionStatusResponse, SubmitRequest, SubmitSucceeded, ThreadClientError, UnknownResolutionRecorded, boundHostDiagnostic, decodeAbortCommand, decodeApprovalDecisionCommand, decodeAwaitProgressRequest, decodeCancelProgressRequest, decodeHostResponse, decodeObservePageRequest, decodeReceipt, decodeSubmitRequest, decodeUnknownResolutionCommand, encodeAbortCommand, encodeApprovalDecisionCommand, encodeAwaitProgressRequest, encodeCancelProgressRequest, encodeHostResponse, encodeObservePageRequest, encodeReceipt, encodeSubmitRequest, encodeUnknownResolutionCommand };
|
|
17
|
+
}
|
|
18
|
+
/** Truncate a diagnostic string to the host protocol's bounded length. */
|
|
19
|
+
declare const boundHostDiagnostic: (value: string) => string;
|
|
20
|
+
declare const HostProtocolError_base: Schema.Class<HostProtocolError, Schema.TaggedStruct<"HostProtocolError", {
|
|
21
|
+
readonly message: Schema.String;
|
|
22
|
+
}>, import("effect/Cause").YieldableError>;
|
|
23
|
+
/**
|
|
24
|
+
* The envelope itself could not be honored: the Object could not decode the request, or a
|
|
25
|
+
* response could not be encoded/decoded. Never carries operation semantics.
|
|
26
|
+
*/
|
|
27
|
+
declare class HostProtocolError extends HostProtocolError_base {}
|
|
28
|
+
declare const ThreadClientError_base: Schema.Class<ThreadClientError, Schema.TaggedStruct<"ThreadClientError", {
|
|
29
|
+
readonly threadId: Schema.String;
|
|
30
|
+
readonly message: Schema.String;
|
|
31
|
+
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
32
|
+
/** Cloudflare's own classification for a failure safe to retry with a fresh stub. */
|
|
33
|
+
readonly retryable: Schema.optionalKey<Schema.Boolean>;
|
|
34
|
+
/** Cloudflare overloads are surfaced immediately instead of adding retry pressure. */
|
|
35
|
+
readonly overloaded: Schema.optionalKey<Schema.Boolean>;
|
|
36
|
+
}>, import("effect/Cause").YieldableError>;
|
|
37
|
+
/** The Worker-side stub call itself failed (RPC rejection, overload, eviction mid-call). */
|
|
38
|
+
declare class ThreadClientError extends ThreadClientError_base {}
|
|
39
|
+
declare const SubmitRequest_base: Schema.Class<SubmitRequest, Schema.Struct<{
|
|
40
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
41
|
+
readonly principal: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">;
|
|
42
|
+
readonly idempotencyKey: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
43
|
+
readonly admissionGroup: Schema.optionalKey<Schema.NonEmptyString>;
|
|
44
|
+
readonly admissionFence: Schema.optionalKey<Schema.Struct<{
|
|
45
|
+
readonly policyId: Schema.NonEmptyString;
|
|
46
|
+
readonly key: Schema.NonEmptyString;
|
|
47
|
+
readonly revision: Schema.NonEmptyString;
|
|
48
|
+
}>>;
|
|
49
|
+
readonly workerAdmission: Schema.optionalKey<Schema.Struct<{
|
|
50
|
+
readonly origin: Schema.Struct<{
|
|
51
|
+
readonly worker: Schema.Struct<{
|
|
52
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
53
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
54
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
55
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
56
|
+
}>;
|
|
57
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
58
|
+
readonly _tag: Schema.Literal<"tool">;
|
|
59
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
60
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
61
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
62
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
63
|
+
}>, Schema.Struct<{
|
|
64
|
+
readonly _tag: Schema.Literal<"programmatic">;
|
|
65
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
66
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
67
|
+
}>]>;
|
|
68
|
+
readonly budgetScope: Schema.optionalKey<Schema.Literals<readonly ["source-subtree", "worker-run"]>>;
|
|
69
|
+
readonly targetDigests: typeof DefinitionDigests;
|
|
70
|
+
readonly policy: Schema.toCodecJson<typeof import("effect-agent/agent-policy").AgentPolicy>;
|
|
71
|
+
readonly budget: Schema.Struct<{
|
|
72
|
+
readonly caps: typeof import("effect-agent/subagent-contract").SubagentDelegationCaps;
|
|
73
|
+
readonly allocation: typeof import("effect-agent/subagent-contract").SubagentReservationAmounts;
|
|
74
|
+
readonly descendantInvocations: Schema.optionalKey<Schema.Natural>;
|
|
75
|
+
}>;
|
|
76
|
+
readonly grant: typeof import("effect-agent/subagent-contract").SubagentGrant;
|
|
77
|
+
readonly depth: Schema.Int;
|
|
78
|
+
readonly toolCallAllowance: Schema.optionalKey<Schema.Int>;
|
|
79
|
+
readonly firstMessageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
80
|
+
readonly createdAtMillis: Schema.Natural;
|
|
81
|
+
readonly expiresAtMillis: Schema.Natural;
|
|
82
|
+
readonly reporting: Schema.optionalKey<Schema.Struct<{
|
|
83
|
+
readonly mode: Schema.optionalKey<Schema.Literal<"standard">>;
|
|
84
|
+
readonly sourceDigests: typeof DefinitionDigests;
|
|
85
|
+
readonly destinationDelegationId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">>;
|
|
86
|
+
}>>;
|
|
87
|
+
}>;
|
|
88
|
+
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
89
|
+
readonly parameters: Schema.declare<Schema.Json, Schema.Json>;
|
|
90
|
+
readonly createdAtMillis: Schema.Natural;
|
|
91
|
+
readonly sourceSubmissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
92
|
+
readonly deliveryPrincipal: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">>;
|
|
93
|
+
readonly reportKind: Schema.optionalKey<Schema.Literal<"update">>;
|
|
94
|
+
}>>;
|
|
95
|
+
readonly messageAdmission: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
96
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
97
|
+
readonly message: Schema.Struct<{
|
|
98
|
+
readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
99
|
+
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
100
|
+
}>;
|
|
101
|
+
readonly peerName: Schema.NonEmptyString;
|
|
102
|
+
readonly sender: Schema.Struct<{
|
|
103
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
104
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
105
|
+
}>;
|
|
106
|
+
readonly returnAddress: Schema.Struct<{
|
|
107
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
108
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
109
|
+
}>;
|
|
110
|
+
readonly inReplyTo: Schema.optionalKey<Schema.Struct<{
|
|
111
|
+
readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
112
|
+
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
113
|
+
}>>;
|
|
114
|
+
}>, Schema.Union<readonly [Schema.Struct<{
|
|
115
|
+
readonly _tag: Schema.Literal<"WorkerCompletion">;
|
|
116
|
+
readonly budgetExhausted: Schema.Boolean;
|
|
117
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
118
|
+
readonly report: Schema.Union<readonly [Schema.Struct<{
|
|
119
|
+
readonly _tag: Schema.Literal<"Settled">;
|
|
120
|
+
readonly worker: Schema.Struct<{
|
|
121
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
122
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
123
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
124
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
125
|
+
}>;
|
|
126
|
+
readonly receipt: typeof Receipt;
|
|
127
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
128
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
129
|
+
readonly outcome: Schema.Literal<"completed">;
|
|
130
|
+
readonly result: Schema.Union<readonly [Schema.Codec<Schema.Json, Schema.Json, never, never>]>;
|
|
131
|
+
}>, Schema.Struct<{
|
|
132
|
+
readonly _tag: Schema.Literal<"Settled">;
|
|
133
|
+
readonly worker: Schema.Struct<{
|
|
134
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
135
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
136
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
137
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
138
|
+
}>;
|
|
139
|
+
readonly receipt: typeof Receipt;
|
|
140
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
141
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
142
|
+
readonly outcome: Schema.Literals<readonly ["failed", "aborted"]>;
|
|
143
|
+
readonly failure: typeof import("effect-agent/subagent-contract").SubagentExecutionFailure;
|
|
144
|
+
}>]>;
|
|
145
|
+
}>, Schema.Struct<{
|
|
146
|
+
readonly _tag: Schema.Literal<"WorkerUpdate">;
|
|
147
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
148
|
+
readonly worker: Schema.Struct<{
|
|
149
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
150
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
151
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
152
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
153
|
+
}>;
|
|
154
|
+
readonly update: typeof import("effect-agent/agent-updates").Update;
|
|
155
|
+
}>]>]>>;
|
|
156
|
+
readonly definitions: typeof DefinitionDigests;
|
|
157
|
+
readonly inputPayload: Schema.declare<Schema.Json, Schema.Json>;
|
|
158
|
+
}>, {}>;
|
|
159
|
+
/**
|
|
160
|
+
* One durable submission, input ALREADY encoded by the caller through the Agent Binding's
|
|
161
|
+
* input schema (the Worker bundles the same Agent definitions as the Object, so schema
|
|
162
|
+
* validation happens client-side; the resolved Binding re-validates at claim time). The
|
|
163
|
+
* Thread identity is deliberately absent — the addressed Object IS the lane.
|
|
164
|
+
*/
|
|
165
|
+
declare class SubmitRequest extends SubmitRequest_base {}
|
|
166
|
+
declare const ObservePageRequest_base: Schema.Class<ObservePageRequest, Schema.Struct<{
|
|
167
|
+
readonly afterSequence: Schema.optionalKey<Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">>;
|
|
168
|
+
readonly limit: Schema.Int;
|
|
169
|
+
}>, {}>;
|
|
170
|
+
/** One bounded page of canonical records after an optional sequence. */
|
|
171
|
+
declare class ObservePageRequest extends ObservePageRequest_base {}
|
|
172
|
+
declare const AwaitProgressRequest_base: Schema.Class<AwaitProgressRequest, Schema.Struct<{
|
|
173
|
+
readonly afterSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
174
|
+
readonly waiterId: Schema.String;
|
|
175
|
+
}>, {}>;
|
|
176
|
+
/** One event-driven wait for canonical progress strictly after this sequence. */
|
|
177
|
+
declare class AwaitProgressRequest extends AwaitProgressRequest_base {}
|
|
178
|
+
declare const CancelProgressRequest_base: Schema.Class<CancelProgressRequest, Schema.Struct<{
|
|
179
|
+
readonly waiterId: Schema.String;
|
|
180
|
+
}>, {}>;
|
|
181
|
+
/** Best-effort cancellation of one in-flight progress RPC. */
|
|
182
|
+
declare class CancelProgressRequest extends CancelProgressRequest_base {}
|
|
183
|
+
/**
|
|
184
|
+
* Every typed failure a host entry point can produce, plus the protocol's own errors. Same
|
|
185
|
+
* closed-union discipline as the WP2 `PortFailure`: members re-decode to the SAME tagged
|
|
186
|
+
* classes on the Worker side; `cause` chains travel as Schema defects without instance
|
|
187
|
+
* fidelity (plan §2.8).
|
|
188
|
+
*/
|
|
189
|
+
declare const HostFailure: Schema.Union<readonly [typeof AgentInputError, typeof DigestError, typeof AdmissionConflict, typeof AdmissionPolicyError, typeof SettlementConflict, typeof ApprovalConflict, typeof UnknownResolutionConflict, typeof JoinedToHost, typeof LedgerError, typeof ThreadStoreError, typeof ThreadNotMaterialized, typeof AppendConflict, typeof FenceRejected, typeof DurableRuntimeFailpointError, typeof AdmissionLimitExceeded, typeof DurableAlarmError, typeof OperationDenied, typeof HostProtocolError]>;
|
|
190
|
+
type HostFailure = typeof HostFailure.Type;
|
|
191
|
+
declare const SubmitSucceeded_base: Schema.Class<SubmitSucceeded, Schema.TaggedStruct<"SubmitSucceeded", {
|
|
192
|
+
readonly receipt: typeof Receipt;
|
|
193
|
+
}>, {}>;
|
|
194
|
+
declare class SubmitSucceeded extends SubmitSucceeded_base {}
|
|
195
|
+
declare const SubmissionStatusResponse_base: Schema.Class<SubmissionStatusResponse, Schema.TaggedStruct<"SubmissionStatusResponse", {
|
|
196
|
+
readonly status: Schema.Union<readonly [typeof import("effect-agent/submission-status").PendingSubmission, typeof import("effect-agent/submission-status").SettledSubmission]>;
|
|
197
|
+
}>, {}>;
|
|
198
|
+
declare class SubmissionStatusResponse extends SubmissionStatusResponse_base {}
|
|
199
|
+
declare const SettlementReached_base: Schema.Class<SettlementReached, Schema.TaggedStruct<"SettlementReached", {
|
|
200
|
+
readonly settlement: typeof Settlement;
|
|
201
|
+
}>, {}>;
|
|
202
|
+
declare class SettlementReached extends SettlementReached_base {}
|
|
203
|
+
declare const ObservedPage_base: Schema.Class<ObservedPage, Schema.TaggedStruct<"ObservedPage", {
|
|
204
|
+
readonly records: Schema.$Array<typeof CanonicalRecordEnvelope>;
|
|
205
|
+
}>, {}>;
|
|
206
|
+
declare class ObservedPage extends ObservedPage_base {}
|
|
207
|
+
declare const ProgressObserved_base: Schema.Class<ProgressObserved, Schema.TaggedStruct<"ProgressObserved", {}>, {}>;
|
|
208
|
+
/** A record was already committed or an incarnation-local hint says the caller should re-read. */
|
|
209
|
+
declare class ProgressObserved extends ProgressObserved_base {}
|
|
210
|
+
declare const ProgressCancelled_base: Schema.Class<ProgressCancelled, Schema.TaggedStruct<"ProgressCancelled", {}>, {}>;
|
|
211
|
+
declare class ProgressCancelled extends ProgressCancelled_base {}
|
|
212
|
+
declare const AbortRecorded_base: Schema.Class<AbortRecorded, Schema.TaggedStruct<"AbortRecorded", {
|
|
213
|
+
readonly intent: typeof AbortIntent;
|
|
214
|
+
}>, {}>;
|
|
215
|
+
declare class AbortRecorded extends AbortRecorded_base {}
|
|
216
|
+
declare const ApprovalRecorded_base: Schema.Class<ApprovalRecorded, Schema.TaggedStruct<"ApprovalRecorded", {
|
|
217
|
+
readonly intent: typeof ApprovalDecisionIntent;
|
|
218
|
+
}>, {}>;
|
|
219
|
+
declare class ApprovalRecorded extends ApprovalRecorded_base {}
|
|
220
|
+
declare const UnknownResolutionRecorded_base: Schema.Class<UnknownResolutionRecorded, Schema.TaggedStruct<"UnknownResolutionRecorded", {
|
|
221
|
+
readonly intent: typeof UnknownResolutionIntent;
|
|
222
|
+
}>, {}>;
|
|
223
|
+
declare class UnknownResolutionRecorded extends UnknownResolutionRecorded_base {}
|
|
224
|
+
declare const HostFailed_base: Schema.Class<HostFailed, Schema.TaggedStruct<"HostFailed", {
|
|
225
|
+
readonly failure: Schema.Union<readonly [typeof AgentInputError, typeof DigestError, typeof AdmissionConflict, typeof AdmissionPolicyError, typeof SettlementConflict, typeof ApprovalConflict, typeof UnknownResolutionConflict, typeof JoinedToHost, typeof LedgerError, typeof ThreadStoreError, typeof ThreadNotMaterialized, typeof AppendConflict, typeof FenceRejected, typeof DurableRuntimeFailpointError, typeof AdmissionLimitExceeded, typeof DurableAlarmError, typeof OperationDenied, typeof HostProtocolError]>;
|
|
226
|
+
}>, {}>;
|
|
227
|
+
/** The entry point failed TYPED on the Object; the failure re-decodes verbatim. */
|
|
228
|
+
declare class HostFailed extends HostFailed_base {}
|
|
229
|
+
/** The uniform answer of one host entry point. Callers narrow by the tag their call implies. */
|
|
230
|
+
declare const HostResponse: Schema.Union<readonly [typeof SubmitSucceeded, typeof SettlementReached, typeof SubmissionStatusResponse, typeof ObservedPage, typeof ProgressObserved, typeof ProgressCancelled, typeof AbortRecorded, typeof ApprovalRecorded, typeof UnknownResolutionRecorded, typeof HostFailed]>;
|
|
231
|
+
type HostResponse = typeof HostResponse.Type;
|
|
232
|
+
declare const decodeSubmitRequest: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<SubmitRequest, Schema.SchemaError, never>;
|
|
233
|
+
declare const encodeSubmitRequest: (input: SubmitRequest, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
|
|
234
|
+
readonly agentId: string;
|
|
235
|
+
readonly principal: string;
|
|
236
|
+
readonly idempotencyKey: string;
|
|
237
|
+
readonly admissionGroup?: string | undefined;
|
|
238
|
+
readonly admissionFence?: {
|
|
239
|
+
readonly policyId: string;
|
|
240
|
+
readonly key: string;
|
|
241
|
+
readonly revision: string;
|
|
242
|
+
} | undefined;
|
|
243
|
+
readonly workerAdmission?: {
|
|
244
|
+
readonly origin: {
|
|
245
|
+
readonly worker: {
|
|
246
|
+
readonly schemaVersion: 1;
|
|
247
|
+
readonly delegationId: string;
|
|
248
|
+
readonly targetAgentId: string;
|
|
249
|
+
readonly threadId: string;
|
|
250
|
+
};
|
|
251
|
+
readonly source: {
|
|
252
|
+
readonly _tag: "tool";
|
|
253
|
+
readonly agentId: string;
|
|
254
|
+
readonly threadId: string;
|
|
255
|
+
readonly runId: string;
|
|
256
|
+
readonly toolCallId: string;
|
|
257
|
+
} | {
|
|
258
|
+
readonly _tag: "programmatic";
|
|
259
|
+
readonly agentId: string;
|
|
260
|
+
readonly threadId: string;
|
|
261
|
+
};
|
|
262
|
+
readonly budgetScope?: "source-subtree" | "worker-run" | undefined;
|
|
263
|
+
readonly targetDigests: {
|
|
264
|
+
readonly agent: string;
|
|
265
|
+
readonly model: string;
|
|
266
|
+
readonly tools: string;
|
|
267
|
+
};
|
|
268
|
+
readonly policy: Schema.Json;
|
|
269
|
+
readonly budget: {
|
|
270
|
+
readonly caps: {
|
|
271
|
+
readonly maxTotalChildInvocations?: number | undefined;
|
|
272
|
+
readonly maxConcurrentChildren?: number | undefined;
|
|
273
|
+
readonly maxTurns?: number | undefined;
|
|
274
|
+
readonly maxToolCalls?: number | undefined;
|
|
275
|
+
readonly maxDurationMillis?: number | undefined;
|
|
276
|
+
readonly maxInputTokens?: number | undefined;
|
|
277
|
+
readonly maxOutputTokens?: number | undefined;
|
|
278
|
+
readonly maxCostMicrousd?: number | undefined;
|
|
279
|
+
readonly maxResultBytes?: number | undefined;
|
|
280
|
+
};
|
|
281
|
+
readonly allocation: {
|
|
282
|
+
readonly turns: number;
|
|
283
|
+
readonly toolCalls: number;
|
|
284
|
+
readonly durationMillis: number;
|
|
285
|
+
readonly inputTokens: number;
|
|
286
|
+
readonly outputTokens: number;
|
|
287
|
+
readonly costMicrousd: number;
|
|
288
|
+
readonly resultBytes: number;
|
|
289
|
+
};
|
|
290
|
+
readonly descendantInvocations?: number | undefined;
|
|
291
|
+
};
|
|
292
|
+
readonly grant: {
|
|
293
|
+
readonly allowedToolNames: readonly string[];
|
|
294
|
+
readonly maxDepth: number;
|
|
295
|
+
readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
|
|
296
|
+
};
|
|
297
|
+
readonly depth: number;
|
|
298
|
+
readonly toolCallAllowance?: number | undefined;
|
|
299
|
+
readonly firstMessageId: string;
|
|
300
|
+
readonly createdAtMillis: number;
|
|
301
|
+
readonly expiresAtMillis: number;
|
|
302
|
+
readonly reporting?: {
|
|
303
|
+
readonly mode?: "standard" | undefined;
|
|
304
|
+
readonly sourceDigests: {
|
|
305
|
+
readonly agent: string;
|
|
306
|
+
readonly model: string;
|
|
307
|
+
readonly tools: string;
|
|
308
|
+
};
|
|
309
|
+
readonly destinationDelegationId?: string | undefined;
|
|
310
|
+
} | undefined;
|
|
311
|
+
};
|
|
312
|
+
readonly messageId: string;
|
|
313
|
+
readonly parameters: Schema.Json;
|
|
314
|
+
readonly createdAtMillis: number;
|
|
315
|
+
readonly sourceSubmissionId?: string | undefined;
|
|
316
|
+
readonly deliveryPrincipal?: string | undefined;
|
|
317
|
+
readonly reportKind?: "update" | undefined;
|
|
318
|
+
} | undefined;
|
|
319
|
+
readonly messageAdmission?: {
|
|
320
|
+
readonly schemaVersion: 1;
|
|
321
|
+
readonly message: {
|
|
322
|
+
readonly ownerThreadId: string;
|
|
323
|
+
readonly messageId: string;
|
|
324
|
+
};
|
|
325
|
+
readonly peerName: string;
|
|
326
|
+
readonly sender: {
|
|
327
|
+
readonly threadId: string;
|
|
328
|
+
readonly agentId: string;
|
|
329
|
+
};
|
|
330
|
+
readonly returnAddress: {
|
|
331
|
+
readonly threadId: string;
|
|
332
|
+
readonly agentId: string;
|
|
333
|
+
};
|
|
334
|
+
readonly inReplyTo?: {
|
|
335
|
+
readonly ownerThreadId: string;
|
|
336
|
+
readonly messageId: string;
|
|
337
|
+
} | undefined;
|
|
338
|
+
} | {
|
|
339
|
+
readonly _tag: "WorkerCompletion";
|
|
340
|
+
readonly budgetExhausted: boolean;
|
|
341
|
+
readonly schemaVersion: 1;
|
|
342
|
+
readonly report: {
|
|
343
|
+
readonly _tag: "Settled";
|
|
344
|
+
readonly worker: {
|
|
345
|
+
readonly schemaVersion: 1;
|
|
346
|
+
readonly delegationId: string;
|
|
347
|
+
readonly targetAgentId: string;
|
|
348
|
+
readonly threadId: string;
|
|
349
|
+
};
|
|
350
|
+
readonly receipt: {
|
|
351
|
+
readonly receiptId: string;
|
|
352
|
+
readonly submissionId: string;
|
|
353
|
+
readonly threadId: string;
|
|
354
|
+
readonly queueSequence: number;
|
|
355
|
+
};
|
|
356
|
+
readonly runId: string;
|
|
357
|
+
readonly settlementId: string;
|
|
358
|
+
readonly outcome: "completed";
|
|
359
|
+
readonly result: Schema.Json;
|
|
360
|
+
} | {
|
|
361
|
+
readonly _tag: "Settled";
|
|
362
|
+
readonly worker: {
|
|
363
|
+
readonly schemaVersion: 1;
|
|
364
|
+
readonly delegationId: string;
|
|
365
|
+
readonly targetAgentId: string;
|
|
366
|
+
readonly threadId: string;
|
|
367
|
+
};
|
|
368
|
+
readonly receipt: {
|
|
369
|
+
readonly receiptId: string;
|
|
370
|
+
readonly submissionId: string;
|
|
371
|
+
readonly threadId: string;
|
|
372
|
+
readonly queueSequence: number;
|
|
373
|
+
};
|
|
374
|
+
readonly runId: string;
|
|
375
|
+
readonly settlementId: string;
|
|
376
|
+
readonly outcome: "aborted" | "failed";
|
|
377
|
+
readonly failure: {
|
|
378
|
+
readonly _tag: "SubagentExecutionFailure";
|
|
379
|
+
readonly delegationId: string;
|
|
380
|
+
readonly targetAgentId: string;
|
|
381
|
+
readonly classification: "child-aborted" | "child-compatibility" | "child-failed" | "declaration-unavailable" | "establishment-denied";
|
|
382
|
+
readonly childThreadId?: string | undefined;
|
|
383
|
+
readonly childSubmissionId?: string | undefined;
|
|
384
|
+
readonly childRunId?: string | undefined;
|
|
385
|
+
readonly errorTag: string;
|
|
386
|
+
readonly message: string;
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
} | {
|
|
390
|
+
readonly _tag: "WorkerUpdate";
|
|
391
|
+
readonly schemaVersion: 1;
|
|
392
|
+
readonly worker: {
|
|
393
|
+
readonly schemaVersion: 1;
|
|
394
|
+
readonly delegationId: string;
|
|
395
|
+
readonly targetAgentId: string;
|
|
396
|
+
readonly threadId: string;
|
|
397
|
+
};
|
|
398
|
+
readonly update: {
|
|
399
|
+
readonly schemaVersion: 1;
|
|
400
|
+
readonly agentId: string;
|
|
401
|
+
readonly threadId: string;
|
|
402
|
+
readonly runId: string;
|
|
403
|
+
readonly updateId: string;
|
|
404
|
+
readonly sequence: number;
|
|
405
|
+
readonly value: Schema.Json;
|
|
406
|
+
};
|
|
407
|
+
} | undefined;
|
|
408
|
+
readonly definitions: {
|
|
409
|
+
readonly agent: string;
|
|
410
|
+
readonly model: string;
|
|
411
|
+
readonly tools: string;
|
|
412
|
+
};
|
|
413
|
+
readonly inputPayload: Schema.Json;
|
|
414
|
+
}, Schema.SchemaError, never>;
|
|
415
|
+
declare const decodeReceipt: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<Receipt, Schema.SchemaError, never>;
|
|
416
|
+
declare const encodeReceipt: (input: Receipt, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
|
|
417
|
+
readonly receiptId: string;
|
|
418
|
+
readonly submissionId: string;
|
|
419
|
+
readonly threadId: string;
|
|
420
|
+
readonly queueSequence: number;
|
|
421
|
+
}, Schema.SchemaError, never>;
|
|
422
|
+
declare const decodeObservePageRequest: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<ObservePageRequest, Schema.SchemaError, never>;
|
|
423
|
+
declare const encodeObservePageRequest: (input: ObservePageRequest, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
|
|
424
|
+
readonly afterSequence?: number | undefined;
|
|
425
|
+
readonly limit: number;
|
|
426
|
+
}, Schema.SchemaError, never>;
|
|
427
|
+
declare const decodeAwaitProgressRequest: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AwaitProgressRequest, Schema.SchemaError, never>;
|
|
428
|
+
declare const encodeAwaitProgressRequest: (input: AwaitProgressRequest, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
|
|
429
|
+
readonly afterSequence: number;
|
|
430
|
+
readonly waiterId: string;
|
|
431
|
+
}, Schema.SchemaError, never>;
|
|
432
|
+
declare const decodeCancelProgressRequest: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<CancelProgressRequest, Schema.SchemaError, never>;
|
|
433
|
+
declare const encodeCancelProgressRequest: (input: CancelProgressRequest, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
|
|
434
|
+
readonly waiterId: string;
|
|
435
|
+
}, Schema.SchemaError, never>;
|
|
436
|
+
declare const decodeAbortCommand: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AbortCommand, Schema.SchemaError, never>;
|
|
437
|
+
declare const encodeAbortCommand: (input: AbortCommand, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
|
|
438
|
+
readonly submissionId: string;
|
|
439
|
+
readonly author: string;
|
|
440
|
+
readonly reason: string;
|
|
441
|
+
}, Schema.SchemaError, never>;
|
|
442
|
+
declare const decodeApprovalDecisionCommand: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<ApprovalDecisionCommand, Schema.SchemaError, never>;
|
|
443
|
+
declare const encodeApprovalDecisionCommand: (input: ApprovalDecisionCommand, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
|
|
444
|
+
readonly submissionId: string;
|
|
445
|
+
readonly toolCallId: string;
|
|
446
|
+
readonly decision: "approved" | "denied";
|
|
447
|
+
readonly resolver: string;
|
|
448
|
+
readonly reason: string;
|
|
449
|
+
}, Schema.SchemaError, never>;
|
|
450
|
+
declare const decodeUnknownResolutionCommand: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<UnknownResolutionCommand, Schema.SchemaError, never>;
|
|
451
|
+
declare const encodeUnknownResolutionCommand: (input: UnknownResolutionCommand, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
|
|
452
|
+
readonly submissionId: string;
|
|
453
|
+
readonly toolCallId: string;
|
|
454
|
+
readonly author: string;
|
|
455
|
+
readonly reason: string;
|
|
456
|
+
readonly resolution: {
|
|
457
|
+
readonly _tag: "CompletedWithResult";
|
|
458
|
+
readonly result: Schema.Json;
|
|
459
|
+
readonly isFailure: boolean;
|
|
460
|
+
} | {
|
|
461
|
+
readonly _tag: "NeverHappened";
|
|
462
|
+
} | {
|
|
463
|
+
readonly _tag: "SafeToRetry";
|
|
464
|
+
} | {
|
|
465
|
+
readonly _tag: "AbortSubmission";
|
|
466
|
+
};
|
|
467
|
+
}, Schema.SchemaError, never>;
|
|
468
|
+
declare const encodeHostResponse: (input: AbortRecorded | ApprovalRecorded | HostFailed | ObservedPage | ProgressCancelled | ProgressObserved | SettlementReached | SubmissionStatusResponse | SubmitSucceeded | UnknownResolutionRecorded, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<{
|
|
469
|
+
readonly _tag: "SubmitSucceeded";
|
|
470
|
+
readonly receipt: {
|
|
471
|
+
readonly receiptId: string;
|
|
472
|
+
readonly submissionId: string;
|
|
473
|
+
readonly threadId: string;
|
|
474
|
+
readonly queueSequence: number;
|
|
475
|
+
};
|
|
476
|
+
} | {
|
|
477
|
+
readonly _tag: "SubmissionStatusResponse";
|
|
478
|
+
readonly status: {
|
|
479
|
+
readonly _tag: "pending";
|
|
480
|
+
} | {
|
|
481
|
+
readonly _tag: "settled";
|
|
482
|
+
readonly settlement: {
|
|
483
|
+
readonly submissionId: string;
|
|
484
|
+
readonly settlementId: string;
|
|
485
|
+
readonly receiptId: string;
|
|
486
|
+
readonly outcome: "aborted" | "completed" | "failed";
|
|
487
|
+
readonly runDisposition?: Schema.Json | undefined;
|
|
488
|
+
readonly usageSummary?: {
|
|
489
|
+
readonly modelCalls: number;
|
|
490
|
+
readonly inputTokens: {
|
|
491
|
+
readonly total: number;
|
|
492
|
+
readonly uncached: number;
|
|
493
|
+
readonly cacheRead: number;
|
|
494
|
+
readonly cacheWrite: number;
|
|
495
|
+
};
|
|
496
|
+
readonly outputTokens: {
|
|
497
|
+
readonly total: number;
|
|
498
|
+
readonly text: number;
|
|
499
|
+
readonly reasoning: number;
|
|
500
|
+
};
|
|
501
|
+
readonly costMicrousd: number;
|
|
502
|
+
readonly byModel: readonly {
|
|
503
|
+
readonly provider: string;
|
|
504
|
+
readonly model: string;
|
|
505
|
+
readonly responseModel?: string | undefined;
|
|
506
|
+
readonly serviceTier?: string | undefined;
|
|
507
|
+
readonly pricingVersion?: string | undefined;
|
|
508
|
+
readonly modelCalls: number;
|
|
509
|
+
readonly inputTokens: {
|
|
510
|
+
readonly total: number;
|
|
511
|
+
readonly uncached: number;
|
|
512
|
+
readonly cacheRead: number;
|
|
513
|
+
readonly cacheWrite: number;
|
|
514
|
+
};
|
|
515
|
+
readonly outputTokens: {
|
|
516
|
+
readonly total: number;
|
|
517
|
+
readonly text: number;
|
|
518
|
+
readonly reasoning: number;
|
|
519
|
+
};
|
|
520
|
+
readonly costMicrousd: number;
|
|
521
|
+
}[];
|
|
522
|
+
readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
|
|
523
|
+
readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
|
|
524
|
+
readonly unobservedModelCalls?: number | undefined;
|
|
525
|
+
} | undefined;
|
|
526
|
+
readonly failure?: {
|
|
527
|
+
readonly errorTag: string;
|
|
528
|
+
readonly message: string;
|
|
529
|
+
} | undefined;
|
|
530
|
+
readonly settledAt: string;
|
|
531
|
+
};
|
|
532
|
+
};
|
|
533
|
+
} | {
|
|
534
|
+
readonly _tag: "SettlementReached";
|
|
535
|
+
readonly settlement: {
|
|
536
|
+
readonly submissionId: string;
|
|
537
|
+
readonly settlementId: string;
|
|
538
|
+
readonly receiptId: string;
|
|
539
|
+
readonly outcome: "aborted" | "completed" | "failed";
|
|
540
|
+
readonly runDisposition?: Schema.Json | undefined;
|
|
541
|
+
readonly usageSummary?: {
|
|
542
|
+
readonly modelCalls: number;
|
|
543
|
+
readonly inputTokens: {
|
|
544
|
+
readonly total: number;
|
|
545
|
+
readonly uncached: number;
|
|
546
|
+
readonly cacheRead: number;
|
|
547
|
+
readonly cacheWrite: number;
|
|
548
|
+
};
|
|
549
|
+
readonly outputTokens: {
|
|
550
|
+
readonly total: number;
|
|
551
|
+
readonly text: number;
|
|
552
|
+
readonly reasoning: number;
|
|
553
|
+
};
|
|
554
|
+
readonly costMicrousd: number;
|
|
555
|
+
readonly byModel: readonly {
|
|
556
|
+
readonly provider: string;
|
|
557
|
+
readonly model: string;
|
|
558
|
+
readonly responseModel?: string | undefined;
|
|
559
|
+
readonly serviceTier?: string | undefined;
|
|
560
|
+
readonly pricingVersion?: string | undefined;
|
|
561
|
+
readonly modelCalls: number;
|
|
562
|
+
readonly inputTokens: {
|
|
563
|
+
readonly total: number;
|
|
564
|
+
readonly uncached: number;
|
|
565
|
+
readonly cacheRead: number;
|
|
566
|
+
readonly cacheWrite: number;
|
|
567
|
+
};
|
|
568
|
+
readonly outputTokens: {
|
|
569
|
+
readonly total: number;
|
|
570
|
+
readonly text: number;
|
|
571
|
+
readonly reasoning: number;
|
|
572
|
+
};
|
|
573
|
+
readonly costMicrousd: number;
|
|
574
|
+
}[];
|
|
575
|
+
readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
|
|
576
|
+
readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
|
|
577
|
+
readonly unobservedModelCalls?: number | undefined;
|
|
578
|
+
} | undefined;
|
|
579
|
+
readonly failure?: {
|
|
580
|
+
readonly errorTag: string;
|
|
581
|
+
readonly message: string;
|
|
582
|
+
} | undefined;
|
|
583
|
+
readonly settledAt: string;
|
|
584
|
+
};
|
|
585
|
+
} | {
|
|
586
|
+
readonly _tag: "ObservedPage";
|
|
587
|
+
readonly records: readonly {
|
|
588
|
+
readonly threadId: string;
|
|
589
|
+
readonly batchId: string;
|
|
590
|
+
readonly sequence: number;
|
|
591
|
+
readonly offset: string;
|
|
592
|
+
readonly record: {
|
|
593
|
+
readonly recordId: string;
|
|
594
|
+
readonly family: "thread";
|
|
595
|
+
readonly schemaVersion: 1;
|
|
596
|
+
readonly createdAt: string;
|
|
597
|
+
readonly deploymentId: string;
|
|
598
|
+
readonly payload: {
|
|
599
|
+
readonly _tag: "ThreadCreated";
|
|
600
|
+
readonly agentId: string;
|
|
601
|
+
readonly definitions: {
|
|
602
|
+
readonly agent: string;
|
|
603
|
+
readonly model: string;
|
|
604
|
+
readonly tools: string;
|
|
605
|
+
};
|
|
606
|
+
} | {
|
|
607
|
+
readonly _tag: "UserInputRecorded";
|
|
608
|
+
readonly submissionId?: string | undefined;
|
|
609
|
+
readonly kind: "follow-up" | "steering" | "user";
|
|
610
|
+
readonly runId?: string | undefined;
|
|
611
|
+
readonly input: Schema.Json;
|
|
612
|
+
readonly messageAdmission?: {
|
|
613
|
+
readonly schemaVersion: 1;
|
|
614
|
+
readonly message: {
|
|
615
|
+
readonly ownerThreadId: string;
|
|
616
|
+
readonly messageId: string;
|
|
617
|
+
};
|
|
618
|
+
readonly peerName: string;
|
|
619
|
+
readonly sender: {
|
|
620
|
+
readonly threadId: string;
|
|
621
|
+
readonly agentId: string;
|
|
622
|
+
};
|
|
623
|
+
readonly returnAddress: {
|
|
624
|
+
readonly threadId: string;
|
|
625
|
+
readonly agentId: string;
|
|
626
|
+
};
|
|
627
|
+
readonly inReplyTo?: {
|
|
628
|
+
readonly ownerThreadId: string;
|
|
629
|
+
readonly messageId: string;
|
|
630
|
+
} | undefined;
|
|
631
|
+
} | {
|
|
632
|
+
readonly _tag: "WorkerCompletion";
|
|
633
|
+
readonly budgetExhausted: boolean;
|
|
634
|
+
readonly schemaVersion: 1;
|
|
635
|
+
readonly report: {
|
|
636
|
+
readonly _tag: "Settled";
|
|
637
|
+
readonly worker: {
|
|
638
|
+
readonly schemaVersion: 1;
|
|
639
|
+
readonly delegationId: string;
|
|
640
|
+
readonly targetAgentId: string;
|
|
641
|
+
readonly threadId: string;
|
|
642
|
+
};
|
|
643
|
+
readonly receipt: {
|
|
644
|
+
readonly receiptId: string;
|
|
645
|
+
readonly submissionId: string;
|
|
646
|
+
readonly threadId: string;
|
|
647
|
+
readonly queueSequence: number;
|
|
648
|
+
};
|
|
649
|
+
readonly runId: string;
|
|
650
|
+
readonly settlementId: string;
|
|
651
|
+
readonly outcome: "completed";
|
|
652
|
+
readonly result: Schema.Json;
|
|
653
|
+
} | {
|
|
654
|
+
readonly _tag: "Settled";
|
|
655
|
+
readonly worker: {
|
|
656
|
+
readonly schemaVersion: 1;
|
|
657
|
+
readonly delegationId: string;
|
|
658
|
+
readonly targetAgentId: string;
|
|
659
|
+
readonly threadId: string;
|
|
660
|
+
};
|
|
661
|
+
readonly receipt: {
|
|
662
|
+
readonly receiptId: string;
|
|
663
|
+
readonly submissionId: string;
|
|
664
|
+
readonly threadId: string;
|
|
665
|
+
readonly queueSequence: number;
|
|
666
|
+
};
|
|
667
|
+
readonly runId: string;
|
|
668
|
+
readonly settlementId: string;
|
|
669
|
+
readonly outcome: "aborted" | "failed";
|
|
670
|
+
readonly failure: {
|
|
671
|
+
readonly _tag: "SubagentExecutionFailure";
|
|
672
|
+
readonly delegationId: string;
|
|
673
|
+
readonly targetAgentId: string;
|
|
674
|
+
readonly classification: "child-aborted" | "child-compatibility" | "child-failed" | "declaration-unavailable" | "establishment-denied";
|
|
675
|
+
readonly childThreadId?: string | undefined;
|
|
676
|
+
readonly childSubmissionId?: string | undefined;
|
|
677
|
+
readonly childRunId?: string | undefined;
|
|
678
|
+
readonly errorTag: string;
|
|
679
|
+
readonly message: string;
|
|
680
|
+
};
|
|
681
|
+
};
|
|
682
|
+
} | {
|
|
683
|
+
readonly _tag: "WorkerUpdate";
|
|
684
|
+
readonly schemaVersion: 1;
|
|
685
|
+
readonly worker: {
|
|
686
|
+
readonly schemaVersion: 1;
|
|
687
|
+
readonly delegationId: string;
|
|
688
|
+
readonly targetAgentId: string;
|
|
689
|
+
readonly threadId: string;
|
|
690
|
+
};
|
|
691
|
+
readonly update: {
|
|
692
|
+
readonly schemaVersion: 1;
|
|
693
|
+
readonly agentId: string;
|
|
694
|
+
readonly threadId: string;
|
|
695
|
+
readonly runId: string;
|
|
696
|
+
readonly updateId: string;
|
|
697
|
+
readonly sequence: number;
|
|
698
|
+
readonly value: Schema.Json;
|
|
699
|
+
};
|
|
700
|
+
} | undefined;
|
|
701
|
+
} | {
|
|
702
|
+
readonly _tag: "RunStarted";
|
|
703
|
+
readonly runId: string;
|
|
704
|
+
readonly policyAccountingVersion: 1;
|
|
705
|
+
readonly maxDurationMillis: number;
|
|
706
|
+
} | {
|
|
707
|
+
readonly _tag: "RunPolicyUsageReserved";
|
|
708
|
+
readonly runId: string;
|
|
709
|
+
readonly programmaticToolCalls: number;
|
|
710
|
+
readonly finalizationUsed: boolean;
|
|
711
|
+
} | {
|
|
712
|
+
readonly _tag: "ModelCompleted";
|
|
713
|
+
readonly runId: string;
|
|
714
|
+
readonly output: Schema.Json;
|
|
715
|
+
readonly messages?: Schema.Json | undefined;
|
|
716
|
+
} | {
|
|
717
|
+
readonly _tag: "ModelResponseRecorded";
|
|
718
|
+
readonly toolExposure?: {
|
|
719
|
+
readonly exposedToolNames: readonly string[];
|
|
720
|
+
readonly selection?: {
|
|
721
|
+
readonly toolNames: readonly string[];
|
|
722
|
+
} | undefined;
|
|
723
|
+
} | undefined;
|
|
724
|
+
readonly runId: string;
|
|
725
|
+
readonly turnId: string;
|
|
726
|
+
readonly turn: number;
|
|
727
|
+
readonly messages: Schema.Json;
|
|
728
|
+
readonly messagesDigest: string;
|
|
729
|
+
readonly runScopedPrefixLength?: number | undefined;
|
|
730
|
+
readonly modelUsage?: readonly {
|
|
731
|
+
readonly provider: string;
|
|
732
|
+
readonly model: string;
|
|
733
|
+
readonly serviceTier?: string | undefined;
|
|
734
|
+
readonly pricingVersion?: string | undefined;
|
|
735
|
+
readonly response?: {
|
|
736
|
+
readonly id?: string | undefined;
|
|
737
|
+
readonly model?: string | undefined;
|
|
738
|
+
} | undefined;
|
|
739
|
+
readonly purpose?: "summary" | "turn" | undefined;
|
|
740
|
+
readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
|
|
741
|
+
readonly pricingStatus?: "estimated" | "unknown" | undefined;
|
|
742
|
+
readonly inputTokens: {
|
|
743
|
+
readonly total: number;
|
|
744
|
+
readonly uncached: number;
|
|
745
|
+
readonly cacheRead: number;
|
|
746
|
+
readonly cacheWrite: number;
|
|
747
|
+
};
|
|
748
|
+
readonly outputTokens: {
|
|
749
|
+
readonly total: number;
|
|
750
|
+
readonly text: number;
|
|
751
|
+
readonly reasoning: number;
|
|
752
|
+
};
|
|
753
|
+
readonly costMicrousd: number;
|
|
754
|
+
}[] | undefined;
|
|
755
|
+
readonly unobservedModelCalls?: number | undefined;
|
|
756
|
+
readonly inputTokens?: number | undefined;
|
|
757
|
+
readonly outputTokens?: number | undefined;
|
|
758
|
+
readonly costMicrousd?: number | undefined;
|
|
759
|
+
} | {
|
|
760
|
+
readonly _tag: "ToolCallPrepared";
|
|
761
|
+
readonly runId: string;
|
|
762
|
+
readonly turnId: string;
|
|
763
|
+
readonly turn: number;
|
|
764
|
+
readonly toolCallId: string;
|
|
765
|
+
readonly toolName: string;
|
|
766
|
+
readonly parameters: Schema.Json;
|
|
767
|
+
readonly parametersDigest: string;
|
|
768
|
+
readonly executionKind?: "delegation" | "orchestration" | "ordinary" | undefined;
|
|
769
|
+
} | {
|
|
770
|
+
readonly _tag: "ToolCallSettled";
|
|
771
|
+
readonly toolSelection?: {
|
|
772
|
+
readonly toolNames: readonly string[];
|
|
773
|
+
} | undefined;
|
|
774
|
+
readonly runId: string;
|
|
775
|
+
readonly toolCallId: string;
|
|
776
|
+
readonly toolName: string;
|
|
777
|
+
readonly result: Schema.Json;
|
|
778
|
+
readonly isFailure: boolean;
|
|
779
|
+
readonly budgetRejected?: true | undefined;
|
|
780
|
+
} | {
|
|
781
|
+
readonly _tag: "ToolCallUnknown";
|
|
782
|
+
readonly runId: string;
|
|
783
|
+
readonly turn: number;
|
|
784
|
+
readonly toolCallId: string;
|
|
785
|
+
readonly toolName: string;
|
|
786
|
+
readonly reason: string;
|
|
787
|
+
} | {
|
|
788
|
+
readonly _tag: "ToolCallResolved";
|
|
789
|
+
readonly runId: string;
|
|
790
|
+
readonly toolCallId: string;
|
|
791
|
+
readonly resolution: "completed-with-result" | "failed-with-error" | "never-started" | "safe-retry";
|
|
792
|
+
readonly author: string;
|
|
793
|
+
readonly reason: string;
|
|
794
|
+
} | {
|
|
795
|
+
readonly _tag: "ToolStepSettled";
|
|
796
|
+
readonly runId: string;
|
|
797
|
+
readonly toolCallId: string;
|
|
798
|
+
readonly stepName: string;
|
|
799
|
+
readonly output: Schema.Json;
|
|
800
|
+
readonly outputDigest: string;
|
|
801
|
+
} | {
|
|
802
|
+
readonly _tag: "ToolApprovalRequested";
|
|
803
|
+
readonly runId: string;
|
|
804
|
+
readonly turnId: string;
|
|
805
|
+
readonly turn: number;
|
|
806
|
+
readonly toolCallId: string;
|
|
807
|
+
readonly toolName: string;
|
|
808
|
+
readonly parametersDigest: string;
|
|
809
|
+
} | {
|
|
810
|
+
readonly _tag: "ToolApprovalDecided";
|
|
811
|
+
readonly runId: string;
|
|
812
|
+
readonly turn: number;
|
|
813
|
+
readonly toolCallId: string;
|
|
814
|
+
readonly decision: "approved" | "denied";
|
|
815
|
+
readonly resolver: string;
|
|
816
|
+
readonly reason: string;
|
|
817
|
+
} | {
|
|
818
|
+
readonly _tag: "ModelResponseInterrupted";
|
|
819
|
+
readonly runId: string;
|
|
820
|
+
readonly supersededEpoch: number;
|
|
821
|
+
readonly attemptId: string;
|
|
822
|
+
readonly reason: string;
|
|
823
|
+
} | {
|
|
824
|
+
readonly _tag: "CompactionCreated";
|
|
825
|
+
readonly runId: string;
|
|
826
|
+
readonly turn: number;
|
|
827
|
+
readonly kind: "clear-tool-results" | "rollover" | "summarize";
|
|
828
|
+
readonly coversThrough: number;
|
|
829
|
+
readonly summary?: string | undefined;
|
|
830
|
+
readonly handoff?: string | undefined;
|
|
831
|
+
} | {
|
|
832
|
+
readonly _tag: "RunFailed";
|
|
833
|
+
readonly runId: string;
|
|
834
|
+
readonly failure: Schema.Json;
|
|
835
|
+
} | {
|
|
836
|
+
readonly _tag: "RunCompleted";
|
|
837
|
+
readonly runId: string;
|
|
838
|
+
readonly output: Schema.Json;
|
|
839
|
+
readonly runDisposition?: Schema.Json | undefined;
|
|
840
|
+
readonly finishReason?: "budget-exhausted" | undefined;
|
|
841
|
+
readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
|
|
842
|
+
} | {
|
|
843
|
+
readonly _tag: "AbortRequested";
|
|
844
|
+
readonly submissionId: string;
|
|
845
|
+
readonly author: string;
|
|
846
|
+
readonly reason: string;
|
|
847
|
+
} | {
|
|
848
|
+
readonly _tag: "SubmissionSettled";
|
|
849
|
+
readonly submissionId: string;
|
|
850
|
+
readonly settlementId: string;
|
|
851
|
+
readonly receiptId: string;
|
|
852
|
+
readonly outcome: "aborted" | "completed" | "failed";
|
|
853
|
+
readonly runId?: string | undefined;
|
|
854
|
+
readonly result?: Schema.Json | undefined;
|
|
855
|
+
readonly runDisposition?: Schema.Json | undefined;
|
|
856
|
+
readonly finishReason?: "budget-exhausted" | undefined;
|
|
857
|
+
readonly exhausted?: "tokens" | "tool-calls" | "turns" | undefined;
|
|
858
|
+
readonly policyLimit?: "cost" | "duration" | "repeated-failures" | "tokens" | "tool-calls" | "turns" | "usage" | undefined;
|
|
859
|
+
readonly usageSummary?: {
|
|
860
|
+
readonly modelCalls: number;
|
|
861
|
+
readonly inputTokens: {
|
|
862
|
+
readonly total: number;
|
|
863
|
+
readonly uncached: number;
|
|
864
|
+
readonly cacheRead: number;
|
|
865
|
+
readonly cacheWrite: number;
|
|
866
|
+
};
|
|
867
|
+
readonly outputTokens: {
|
|
868
|
+
readonly total: number;
|
|
869
|
+
readonly text: number;
|
|
870
|
+
readonly reasoning: number;
|
|
871
|
+
};
|
|
872
|
+
readonly costMicrousd: number;
|
|
873
|
+
readonly byModel: readonly {
|
|
874
|
+
readonly provider: string;
|
|
875
|
+
readonly model: string;
|
|
876
|
+
readonly responseModel?: string | undefined;
|
|
877
|
+
readonly serviceTier?: string | undefined;
|
|
878
|
+
readonly pricingVersion?: string | undefined;
|
|
879
|
+
readonly modelCalls: number;
|
|
880
|
+
readonly inputTokens: {
|
|
881
|
+
readonly total: number;
|
|
882
|
+
readonly uncached: number;
|
|
883
|
+
readonly cacheRead: number;
|
|
884
|
+
readonly cacheWrite: number;
|
|
885
|
+
};
|
|
886
|
+
readonly outputTokens: {
|
|
887
|
+
readonly total: number;
|
|
888
|
+
readonly text: number;
|
|
889
|
+
readonly reasoning: number;
|
|
890
|
+
};
|
|
891
|
+
readonly costMicrousd: number;
|
|
892
|
+
}[];
|
|
893
|
+
readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
|
|
894
|
+
readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
|
|
895
|
+
readonly unobservedModelCalls?: number | undefined;
|
|
896
|
+
} | undefined;
|
|
897
|
+
readonly uncommittedModelUsage?: readonly {
|
|
898
|
+
readonly provider: string;
|
|
899
|
+
readonly model: string;
|
|
900
|
+
readonly serviceTier?: string | undefined;
|
|
901
|
+
readonly pricingVersion?: string | undefined;
|
|
902
|
+
readonly response?: {
|
|
903
|
+
readonly id?: string | undefined;
|
|
904
|
+
readonly model?: string | undefined;
|
|
905
|
+
} | undefined;
|
|
906
|
+
readonly purpose?: "summary" | "turn" | undefined;
|
|
907
|
+
readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
|
|
908
|
+
readonly pricingStatus?: "estimated" | "unknown" | undefined;
|
|
909
|
+
readonly inputTokens: {
|
|
910
|
+
readonly total: number;
|
|
911
|
+
readonly uncached: number;
|
|
912
|
+
readonly cacheRead: number;
|
|
913
|
+
readonly cacheWrite: number;
|
|
914
|
+
};
|
|
915
|
+
readonly outputTokens: {
|
|
916
|
+
readonly total: number;
|
|
917
|
+
readonly text: number;
|
|
918
|
+
readonly reasoning: number;
|
|
919
|
+
};
|
|
920
|
+
readonly costMicrousd: number;
|
|
921
|
+
}[] | undefined;
|
|
922
|
+
} | {
|
|
923
|
+
readonly _tag: "SubagentRequested";
|
|
924
|
+
readonly runId: string;
|
|
925
|
+
readonly turnId: string;
|
|
926
|
+
readonly turn: number;
|
|
927
|
+
readonly toolCallId: string;
|
|
928
|
+
readonly delegationId: string;
|
|
929
|
+
readonly targetAgentId: string;
|
|
930
|
+
readonly targetDigests: {
|
|
931
|
+
readonly agent: string;
|
|
932
|
+
readonly model: string;
|
|
933
|
+
readonly tools: string;
|
|
934
|
+
};
|
|
935
|
+
readonly childInput: Schema.Json;
|
|
936
|
+
readonly childInputDigest: string;
|
|
937
|
+
readonly grantDigest: string;
|
|
938
|
+
readonly reservationId: string;
|
|
939
|
+
readonly reservationDigest: string;
|
|
940
|
+
readonly childThreadId: string;
|
|
941
|
+
readonly childPrincipal: string;
|
|
942
|
+
readonly childIdempotencyKey: string;
|
|
943
|
+
readonly toolCallAllowance?: number | undefined;
|
|
944
|
+
readonly policy?: Schema.Json | undefined;
|
|
945
|
+
readonly budget?: {
|
|
946
|
+
readonly caps: {
|
|
947
|
+
readonly maxTotalChildInvocations?: number | undefined;
|
|
948
|
+
readonly maxConcurrentChildren?: number | undefined;
|
|
949
|
+
readonly maxTurns?: number | undefined;
|
|
950
|
+
readonly maxToolCalls?: number | undefined;
|
|
951
|
+
readonly maxDurationMillis?: number | undefined;
|
|
952
|
+
readonly maxInputTokens?: number | undefined;
|
|
953
|
+
readonly maxOutputTokens?: number | undefined;
|
|
954
|
+
readonly maxCostMicrousd?: number | undefined;
|
|
955
|
+
readonly maxResultBytes?: number | undefined;
|
|
956
|
+
};
|
|
957
|
+
readonly allocation: {
|
|
958
|
+
readonly turns: number;
|
|
959
|
+
readonly toolCalls: number;
|
|
960
|
+
readonly durationMillis: number;
|
|
961
|
+
readonly inputTokens: number;
|
|
962
|
+
readonly outputTokens: number;
|
|
963
|
+
readonly costMicrousd: number;
|
|
964
|
+
readonly resultBytes: number;
|
|
965
|
+
};
|
|
966
|
+
readonly descendantInvocations?: number | undefined;
|
|
967
|
+
} | undefined;
|
|
968
|
+
readonly grant?: {
|
|
969
|
+
readonly allowedToolNames: readonly string[];
|
|
970
|
+
readonly maxDepth: number;
|
|
971
|
+
readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
|
|
972
|
+
} | undefined;
|
|
973
|
+
readonly depth?: number | undefined;
|
|
974
|
+
} | {
|
|
975
|
+
readonly _tag: "SubagentStarted";
|
|
976
|
+
readonly runId: string;
|
|
977
|
+
readonly toolCallId: string;
|
|
978
|
+
readonly childThreadId: string;
|
|
979
|
+
readonly childSubmissionId: string;
|
|
980
|
+
readonly childReceiptId: string;
|
|
981
|
+
readonly childRunId: string;
|
|
982
|
+
} | {
|
|
983
|
+
readonly _tag: "SubagentJoined";
|
|
984
|
+
readonly runId: string;
|
|
985
|
+
readonly toolCallId: string;
|
|
986
|
+
readonly childSubmissionId: string;
|
|
987
|
+
readonly childSettlementId: string;
|
|
988
|
+
readonly childOutcome: "aborted" | "completed" | "failed";
|
|
989
|
+
readonly childResultDigest: string;
|
|
990
|
+
readonly projectedResultDigest: string;
|
|
991
|
+
readonly usageSummary: Schema.Json;
|
|
992
|
+
readonly usage?: {
|
|
993
|
+
readonly modelCalls: number;
|
|
994
|
+
readonly inputTokens: number;
|
|
995
|
+
readonly outputTokens: number;
|
|
996
|
+
readonly costMicrousd: number;
|
|
997
|
+
readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
|
|
998
|
+
readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
|
|
999
|
+
readonly unobservedModelCalls?: number | undefined;
|
|
1000
|
+
} | undefined;
|
|
1001
|
+
readonly delegatedUsage?: {
|
|
1002
|
+
readonly modelCalls: number;
|
|
1003
|
+
readonly inputTokens: number;
|
|
1004
|
+
readonly outputTokens: number;
|
|
1005
|
+
readonly costMicrousd: number;
|
|
1006
|
+
readonly usageStatus?: "complete" | "partial" | "unknown" | undefined;
|
|
1007
|
+
readonly pricingStatus?: "complete" | "partial" | "unknown" | undefined;
|
|
1008
|
+
readonly unobservedModelCalls?: number | undefined;
|
|
1009
|
+
} | undefined;
|
|
1010
|
+
readonly reservationId: string;
|
|
1011
|
+
readonly finalAccounting: Schema.Json;
|
|
1012
|
+
} | {
|
|
1013
|
+
readonly _tag: "SubagentLineageRecorded";
|
|
1014
|
+
readonly parentLink: {
|
|
1015
|
+
readonly delegationId: string;
|
|
1016
|
+
readonly parentAgentId: string;
|
|
1017
|
+
readonly parentThreadId: string;
|
|
1018
|
+
readonly parentRunId: string;
|
|
1019
|
+
readonly parentToolCallId: string;
|
|
1020
|
+
readonly depth: number;
|
|
1021
|
+
};
|
|
1022
|
+
readonly parentSubmissionId: string;
|
|
1023
|
+
readonly childDefinitionDigests: {
|
|
1024
|
+
readonly agent: string;
|
|
1025
|
+
readonly model: string;
|
|
1026
|
+
readonly tools: string;
|
|
1027
|
+
};
|
|
1028
|
+
readonly childInputDigest: string;
|
|
1029
|
+
readonly grantDigest: string;
|
|
1030
|
+
readonly toolCallAllowance?: number | undefined;
|
|
1031
|
+
readonly policy?: Schema.Json | undefined;
|
|
1032
|
+
readonly budget?: {
|
|
1033
|
+
readonly caps: {
|
|
1034
|
+
readonly maxTotalChildInvocations?: number | undefined;
|
|
1035
|
+
readonly maxConcurrentChildren?: number | undefined;
|
|
1036
|
+
readonly maxTurns?: number | undefined;
|
|
1037
|
+
readonly maxToolCalls?: number | undefined;
|
|
1038
|
+
readonly maxDurationMillis?: number | undefined;
|
|
1039
|
+
readonly maxInputTokens?: number | undefined;
|
|
1040
|
+
readonly maxOutputTokens?: number | undefined;
|
|
1041
|
+
readonly maxCostMicrousd?: number | undefined;
|
|
1042
|
+
readonly maxResultBytes?: number | undefined;
|
|
1043
|
+
};
|
|
1044
|
+
readonly allocation: {
|
|
1045
|
+
readonly turns: number;
|
|
1046
|
+
readonly toolCalls: number;
|
|
1047
|
+
readonly durationMillis: number;
|
|
1048
|
+
readonly inputTokens: number;
|
|
1049
|
+
readonly outputTokens: number;
|
|
1050
|
+
readonly costMicrousd: number;
|
|
1051
|
+
readonly resultBytes: number;
|
|
1052
|
+
};
|
|
1053
|
+
readonly descendantInvocations?: number | undefined;
|
|
1054
|
+
} | undefined;
|
|
1055
|
+
readonly grant?: {
|
|
1056
|
+
readonly allowedToolNames: readonly string[];
|
|
1057
|
+
readonly maxDepth: number;
|
|
1058
|
+
readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
|
|
1059
|
+
} | undefined;
|
|
1060
|
+
} | {
|
|
1061
|
+
readonly _tag: "WorkerInputRequested";
|
|
1062
|
+
readonly admission: {
|
|
1063
|
+
readonly origin: {
|
|
1064
|
+
readonly worker: {
|
|
1065
|
+
readonly schemaVersion: 1;
|
|
1066
|
+
readonly delegationId: string;
|
|
1067
|
+
readonly targetAgentId: string;
|
|
1068
|
+
readonly threadId: string;
|
|
1069
|
+
};
|
|
1070
|
+
readonly source: {
|
|
1071
|
+
readonly _tag: "tool";
|
|
1072
|
+
readonly agentId: string;
|
|
1073
|
+
readonly threadId: string;
|
|
1074
|
+
readonly runId: string;
|
|
1075
|
+
readonly toolCallId: string;
|
|
1076
|
+
} | {
|
|
1077
|
+
readonly _tag: "programmatic";
|
|
1078
|
+
readonly agentId: string;
|
|
1079
|
+
readonly threadId: string;
|
|
1080
|
+
};
|
|
1081
|
+
readonly budgetScope?: "source-subtree" | "worker-run" | undefined;
|
|
1082
|
+
readonly targetDigests: {
|
|
1083
|
+
readonly agent: string;
|
|
1084
|
+
readonly model: string;
|
|
1085
|
+
readonly tools: string;
|
|
1086
|
+
};
|
|
1087
|
+
readonly policy: Schema.Json;
|
|
1088
|
+
readonly budget: {
|
|
1089
|
+
readonly caps: {
|
|
1090
|
+
readonly maxTotalChildInvocations?: number | undefined;
|
|
1091
|
+
readonly maxConcurrentChildren?: number | undefined;
|
|
1092
|
+
readonly maxTurns?: number | undefined;
|
|
1093
|
+
readonly maxToolCalls?: number | undefined;
|
|
1094
|
+
readonly maxDurationMillis?: number | undefined;
|
|
1095
|
+
readonly maxInputTokens?: number | undefined;
|
|
1096
|
+
readonly maxOutputTokens?: number | undefined;
|
|
1097
|
+
readonly maxCostMicrousd?: number | undefined;
|
|
1098
|
+
readonly maxResultBytes?: number | undefined;
|
|
1099
|
+
};
|
|
1100
|
+
readonly allocation: {
|
|
1101
|
+
readonly turns: number;
|
|
1102
|
+
readonly toolCalls: number;
|
|
1103
|
+
readonly durationMillis: number;
|
|
1104
|
+
readonly inputTokens: number;
|
|
1105
|
+
readonly outputTokens: number;
|
|
1106
|
+
readonly costMicrousd: number;
|
|
1107
|
+
readonly resultBytes: number;
|
|
1108
|
+
};
|
|
1109
|
+
readonly descendantInvocations?: number | undefined;
|
|
1110
|
+
};
|
|
1111
|
+
readonly grant: {
|
|
1112
|
+
readonly allowedToolNames: readonly string[];
|
|
1113
|
+
readonly maxDepth: number;
|
|
1114
|
+
readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
|
|
1115
|
+
};
|
|
1116
|
+
readonly depth: number;
|
|
1117
|
+
readonly toolCallAllowance?: number | undefined;
|
|
1118
|
+
readonly firstMessageId: string;
|
|
1119
|
+
readonly createdAtMillis: number;
|
|
1120
|
+
readonly expiresAtMillis: number;
|
|
1121
|
+
readonly reporting?: {
|
|
1122
|
+
readonly mode?: "standard" | undefined;
|
|
1123
|
+
readonly sourceDigests: {
|
|
1124
|
+
readonly agent: string;
|
|
1125
|
+
readonly model: string;
|
|
1126
|
+
readonly tools: string;
|
|
1127
|
+
};
|
|
1128
|
+
readonly destinationDelegationId?: string | undefined;
|
|
1129
|
+
} | undefined;
|
|
1130
|
+
};
|
|
1131
|
+
readonly messageId: string;
|
|
1132
|
+
readonly parameters: Schema.Json;
|
|
1133
|
+
readonly createdAtMillis: number;
|
|
1134
|
+
readonly sourceSubmissionId?: string | undefined;
|
|
1135
|
+
readonly deliveryPrincipal?: string | undefined;
|
|
1136
|
+
readonly reportKind?: "update" | undefined;
|
|
1137
|
+
};
|
|
1138
|
+
readonly inputDigest: string;
|
|
1139
|
+
} | {
|
|
1140
|
+
readonly _tag: "WorkerOriginRecorded";
|
|
1141
|
+
readonly origin: {
|
|
1142
|
+
readonly worker: {
|
|
1143
|
+
readonly schemaVersion: 1;
|
|
1144
|
+
readonly delegationId: string;
|
|
1145
|
+
readonly targetAgentId: string;
|
|
1146
|
+
readonly threadId: string;
|
|
1147
|
+
};
|
|
1148
|
+
readonly source: {
|
|
1149
|
+
readonly _tag: "tool";
|
|
1150
|
+
readonly agentId: string;
|
|
1151
|
+
readonly threadId: string;
|
|
1152
|
+
readonly runId: string;
|
|
1153
|
+
readonly toolCallId: string;
|
|
1154
|
+
} | {
|
|
1155
|
+
readonly _tag: "programmatic";
|
|
1156
|
+
readonly agentId: string;
|
|
1157
|
+
readonly threadId: string;
|
|
1158
|
+
};
|
|
1159
|
+
readonly budgetScope?: "source-subtree" | "worker-run" | undefined;
|
|
1160
|
+
readonly targetDigests: {
|
|
1161
|
+
readonly agent: string;
|
|
1162
|
+
readonly model: string;
|
|
1163
|
+
readonly tools: string;
|
|
1164
|
+
};
|
|
1165
|
+
readonly policy: Schema.Json;
|
|
1166
|
+
readonly budget: {
|
|
1167
|
+
readonly caps: {
|
|
1168
|
+
readonly maxTotalChildInvocations?: number | undefined;
|
|
1169
|
+
readonly maxConcurrentChildren?: number | undefined;
|
|
1170
|
+
readonly maxTurns?: number | undefined;
|
|
1171
|
+
readonly maxToolCalls?: number | undefined;
|
|
1172
|
+
readonly maxDurationMillis?: number | undefined;
|
|
1173
|
+
readonly maxInputTokens?: number | undefined;
|
|
1174
|
+
readonly maxOutputTokens?: number | undefined;
|
|
1175
|
+
readonly maxCostMicrousd?: number | undefined;
|
|
1176
|
+
readonly maxResultBytes?: number | undefined;
|
|
1177
|
+
};
|
|
1178
|
+
readonly allocation: {
|
|
1179
|
+
readonly turns: number;
|
|
1180
|
+
readonly toolCalls: number;
|
|
1181
|
+
readonly durationMillis: number;
|
|
1182
|
+
readonly inputTokens: number;
|
|
1183
|
+
readonly outputTokens: number;
|
|
1184
|
+
readonly costMicrousd: number;
|
|
1185
|
+
readonly resultBytes: number;
|
|
1186
|
+
};
|
|
1187
|
+
readonly descendantInvocations?: number | undefined;
|
|
1188
|
+
};
|
|
1189
|
+
readonly grant: {
|
|
1190
|
+
readonly allowedToolNames: readonly string[];
|
|
1191
|
+
readonly maxDepth: number;
|
|
1192
|
+
readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
|
|
1193
|
+
};
|
|
1194
|
+
readonly depth: number;
|
|
1195
|
+
readonly toolCallAllowance?: number | undefined;
|
|
1196
|
+
readonly firstMessageId: string;
|
|
1197
|
+
readonly createdAtMillis: number;
|
|
1198
|
+
readonly expiresAtMillis: number;
|
|
1199
|
+
readonly reporting?: {
|
|
1200
|
+
readonly mode?: "standard" | undefined;
|
|
1201
|
+
readonly sourceDigests: {
|
|
1202
|
+
readonly agent: string;
|
|
1203
|
+
readonly model: string;
|
|
1204
|
+
readonly tools: string;
|
|
1205
|
+
};
|
|
1206
|
+
readonly destinationDelegationId?: string | undefined;
|
|
1207
|
+
} | undefined;
|
|
1208
|
+
};
|
|
1209
|
+
} | {
|
|
1210
|
+
readonly _tag: "WorkerInputCompleted";
|
|
1211
|
+
readonly messageId: string;
|
|
1212
|
+
readonly workerThreadId: string;
|
|
1213
|
+
readonly submissionId: string;
|
|
1214
|
+
readonly receiptId: string;
|
|
1215
|
+
readonly settlementId: string;
|
|
1216
|
+
readonly completedAtMillis: number;
|
|
1217
|
+
} | {
|
|
1218
|
+
readonly _tag: "WorkerReportPrepared";
|
|
1219
|
+
readonly runId: string;
|
|
1220
|
+
readonly messageId: string;
|
|
1221
|
+
readonly envelope: Schema.Json;
|
|
1222
|
+
readonly createdAtMillis: number;
|
|
1223
|
+
readonly deadlineAtMillis: number;
|
|
1224
|
+
readonly predecessor?: string | undefined;
|
|
1225
|
+
} | {
|
|
1226
|
+
readonly _tag: "AgentUpdateEmitted";
|
|
1227
|
+
readonly update: {
|
|
1228
|
+
readonly schemaVersion: 1;
|
|
1229
|
+
readonly agentId: string;
|
|
1230
|
+
readonly threadId: string;
|
|
1231
|
+
readonly runId: string;
|
|
1232
|
+
readonly updateId: string;
|
|
1233
|
+
readonly sequence: number;
|
|
1234
|
+
readonly value: Schema.Json;
|
|
1235
|
+
};
|
|
1236
|
+
readonly definitions: {
|
|
1237
|
+
readonly agent: string;
|
|
1238
|
+
readonly model: string;
|
|
1239
|
+
readonly tools: string;
|
|
1240
|
+
};
|
|
1241
|
+
readonly delivery?: {
|
|
1242
|
+
readonly messageId: string;
|
|
1243
|
+
readonly envelope: Schema.Json;
|
|
1244
|
+
readonly createdAtMillis: number;
|
|
1245
|
+
readonly deadlineAtMillis: number;
|
|
1246
|
+
readonly predecessor?: string | undefined;
|
|
1247
|
+
} | undefined;
|
|
1248
|
+
} | {
|
|
1249
|
+
readonly _tag: "WorkerReportRefused";
|
|
1250
|
+
readonly runId: string;
|
|
1251
|
+
readonly messageId: string;
|
|
1252
|
+
readonly reason: "capacity" | "declaration-unavailable" | "defect" | "denied" | "destination" | "expired" | "input" | "preparation" | "projection" | "timeout";
|
|
1253
|
+
} | {
|
|
1254
|
+
readonly _tag: "PeerMessagePrepared";
|
|
1255
|
+
readonly messageId: string;
|
|
1256
|
+
readonly sourcePrincipal: string;
|
|
1257
|
+
readonly operation: "reply" | "send";
|
|
1258
|
+
readonly deadlineAtMillis: number;
|
|
1259
|
+
readonly encodedEnvelope: Schema.Json;
|
|
1260
|
+
} | {
|
|
1261
|
+
readonly _tag: "SubtreeBudgetReserved";
|
|
1262
|
+
readonly reservationId: string;
|
|
1263
|
+
readonly sourceSubmissionId?: string | undefined;
|
|
1264
|
+
readonly childThreadId: string;
|
|
1265
|
+
readonly lifetime: "attached" | "background";
|
|
1266
|
+
readonly depth: number;
|
|
1267
|
+
readonly policy: Schema.Json;
|
|
1268
|
+
readonly grant: {
|
|
1269
|
+
readonly allowedToolNames: readonly string[];
|
|
1270
|
+
readonly maxDepth: number;
|
|
1271
|
+
readonly childLifetimes?: readonly ("attached" | "background")[] | undefined;
|
|
1272
|
+
};
|
|
1273
|
+
readonly budget: {
|
|
1274
|
+
readonly caps: {
|
|
1275
|
+
readonly maxTotalChildInvocations?: number | undefined;
|
|
1276
|
+
readonly maxConcurrentChildren?: number | undefined;
|
|
1277
|
+
readonly maxTurns?: number | undefined;
|
|
1278
|
+
readonly maxToolCalls?: number | undefined;
|
|
1279
|
+
readonly maxDurationMillis?: number | undefined;
|
|
1280
|
+
readonly maxInputTokens?: number | undefined;
|
|
1281
|
+
readonly maxOutputTokens?: number | undefined;
|
|
1282
|
+
readonly maxCostMicrousd?: number | undefined;
|
|
1283
|
+
readonly maxResultBytes?: number | undefined;
|
|
1284
|
+
};
|
|
1285
|
+
readonly allocation: {
|
|
1286
|
+
readonly turns: number;
|
|
1287
|
+
readonly toolCalls: number;
|
|
1288
|
+
readonly durationMillis: number;
|
|
1289
|
+
readonly inputTokens: number;
|
|
1290
|
+
readonly outputTokens: number;
|
|
1291
|
+
readonly costMicrousd: number;
|
|
1292
|
+
readonly resultBytes: number;
|
|
1293
|
+
};
|
|
1294
|
+
readonly descendantInvocations?: number | undefined;
|
|
1295
|
+
};
|
|
1296
|
+
} | {
|
|
1297
|
+
readonly _tag: "RepairAnnotated";
|
|
1298
|
+
readonly reason: string;
|
|
1299
|
+
readonly details: Schema.Json;
|
|
1300
|
+
};
|
|
1301
|
+
};
|
|
1302
|
+
}[];
|
|
1303
|
+
} | {
|
|
1304
|
+
readonly _tag: "ProgressObserved";
|
|
1305
|
+
} | {
|
|
1306
|
+
readonly _tag: "ProgressCancelled";
|
|
1307
|
+
} | {
|
|
1308
|
+
readonly _tag: "AbortRecorded";
|
|
1309
|
+
readonly intent: {
|
|
1310
|
+
readonly submissionId: string;
|
|
1311
|
+
readonly author: string;
|
|
1312
|
+
readonly reason: string;
|
|
1313
|
+
readonly requestedAt: string;
|
|
1314
|
+
readonly canonicalRecordId?: string | undefined;
|
|
1315
|
+
};
|
|
1316
|
+
} | {
|
|
1317
|
+
readonly _tag: "ApprovalRecorded";
|
|
1318
|
+
readonly intent: {
|
|
1319
|
+
readonly submissionId: string;
|
|
1320
|
+
readonly toolCallId: string;
|
|
1321
|
+
readonly decision: "approved" | "denied";
|
|
1322
|
+
readonly resolver: string;
|
|
1323
|
+
readonly reason: string;
|
|
1324
|
+
readonly decidedAt: string;
|
|
1325
|
+
readonly canonicalRecordId?: string | undefined;
|
|
1326
|
+
};
|
|
1327
|
+
} | {
|
|
1328
|
+
readonly _tag: "UnknownResolutionRecorded";
|
|
1329
|
+
readonly intent: {
|
|
1330
|
+
readonly submissionId: string;
|
|
1331
|
+
readonly toolCallId: string;
|
|
1332
|
+
readonly author: string;
|
|
1333
|
+
readonly reason: string;
|
|
1334
|
+
readonly resolution: {
|
|
1335
|
+
readonly _tag: "CompletedWithResult";
|
|
1336
|
+
readonly result: Schema.Json;
|
|
1337
|
+
readonly isFailure: boolean;
|
|
1338
|
+
} | {
|
|
1339
|
+
readonly _tag: "NeverHappened";
|
|
1340
|
+
} | {
|
|
1341
|
+
readonly _tag: "SafeToRetry";
|
|
1342
|
+
} | {
|
|
1343
|
+
readonly _tag: "AbortSubmission";
|
|
1344
|
+
};
|
|
1345
|
+
readonly resolvedAt: string;
|
|
1346
|
+
readonly canonicalRecordId?: string | undefined;
|
|
1347
|
+
};
|
|
1348
|
+
} | {
|
|
1349
|
+
readonly _tag: "HostFailed";
|
|
1350
|
+
readonly failure: {
|
|
1351
|
+
readonly _tag: "LedgerError";
|
|
1352
|
+
readonly operation: string;
|
|
1353
|
+
readonly message: string;
|
|
1354
|
+
readonly cause?: Schema.Json | undefined;
|
|
1355
|
+
} | {
|
|
1356
|
+
readonly _tag: "AppendConflict";
|
|
1357
|
+
readonly threadId: string;
|
|
1358
|
+
readonly batchId: string;
|
|
1359
|
+
readonly reason: "batch-digest" | "record-identity" | "tail";
|
|
1360
|
+
readonly actualTailSequence?: number | undefined;
|
|
1361
|
+
readonly actualTailDigest?: string | undefined;
|
|
1362
|
+
} | {
|
|
1363
|
+
readonly _tag: "FenceRejected";
|
|
1364
|
+
readonly threadId: string;
|
|
1365
|
+
readonly actualEpoch: number;
|
|
1366
|
+
readonly attemptedEpoch: number;
|
|
1367
|
+
} | {
|
|
1368
|
+
readonly _tag: "ThreadNotMaterialized";
|
|
1369
|
+
readonly threadId: string;
|
|
1370
|
+
} | {
|
|
1371
|
+
readonly _tag: "ThreadStoreError";
|
|
1372
|
+
readonly operation: string;
|
|
1373
|
+
readonly message: string;
|
|
1374
|
+
readonly cause?: Schema.Json | undefined;
|
|
1375
|
+
} | {
|
|
1376
|
+
readonly _tag: "OperationDenied";
|
|
1377
|
+
readonly operation: "abort" | "awaitSettlement" | "explain" | "observe" | "resolveApproval" | "resolveUnknown" | "retry" | "scanObligations" | "verify" | "wake";
|
|
1378
|
+
readonly reason: string;
|
|
1379
|
+
readonly threadId?: string | undefined;
|
|
1380
|
+
readonly submissionId?: string | undefined;
|
|
1381
|
+
} | {
|
|
1382
|
+
readonly _tag: "AdmissionConflict";
|
|
1383
|
+
readonly threadId: string;
|
|
1384
|
+
readonly principal: string;
|
|
1385
|
+
readonly idempotencyKey: string;
|
|
1386
|
+
readonly existingInputDigest: string;
|
|
1387
|
+
readonly attemptedInputDigest: string;
|
|
1388
|
+
} | {
|
|
1389
|
+
readonly _tag: "AdmissionPolicyError";
|
|
1390
|
+
readonly reason: "occupied" | "refused" | "unavailable";
|
|
1391
|
+
readonly code: string;
|
|
1392
|
+
} | {
|
|
1393
|
+
readonly _tag: "AgentInputError";
|
|
1394
|
+
readonly message: string;
|
|
1395
|
+
} | {
|
|
1396
|
+
readonly _tag: "DigestError";
|
|
1397
|
+
readonly message: string;
|
|
1398
|
+
readonly cause?: Schema.Json | undefined;
|
|
1399
|
+
} | {
|
|
1400
|
+
readonly _tag: "DurableRuntimeFailpointError";
|
|
1401
|
+
readonly location: "abort:after-intent" | "approval:after-request-append" | "approval:after-suspend" | "checkpoint:after-save" | "checkpoint:before-save" | "claim:after-claim" | "compaction:after-canonical-append" | "compaction:before-canonical-append" | "input:after-canonical-append" | "join:after-canonical-append" | "join:after-claim" | "policy:after-reservation-append" | "policy:before-reservation-append" | "resolve:after-intent" | "run:after-start-append" | "run:before-start-append" | "step:after-step-append" | "subagent:after-admit" | "subagent:after-child-abort-intent" | "subagent:after-child-ready" | "subagent:after-join-append" | "subagent:after-release" | "subagent:after-release-pending" | "subagent:after-request-append" | "subagent:after-reserve" | "subagent:after-sibling-settle" | "subagent:after-start-append" | "subagent:after-suspend" | "subagent:before-join-append" | "submit:after-admit" | "submit:after-materialize" | "terminalize:after-canonical-append" | "terminalize:after-reserve" | "tools:after-prepared-append" | "tools:before-prepared-append" | "turn:after-canonical-append" | "turn:after-response-append" | "turn:after-results-append" | "update:after-canonical-append" | "update:after-delivery-insert" | "update:before-canonical-append" | "update:before-delivery-insert" | "worker:after-completion-append" | "worker:after-origin-append" | "worker:after-report-append" | "worker:after-report-delivery" | "worker:after-source-append" | "worker:after-subtree-append" | "worker:before-completion-append" | "worker:before-origin-append" | "worker:before-report-append" | "worker:before-report-delivery" | "worker:before-source-append" | "worker:before-subtree-append";
|
|
1402
|
+
} | {
|
|
1403
|
+
readonly _tag: "SettlementConflict";
|
|
1404
|
+
readonly submissionId: string;
|
|
1405
|
+
readonly existingOutcome: "aborted" | "completed" | "failed";
|
|
1406
|
+
} | {
|
|
1407
|
+
readonly _tag: "JoinedToHost";
|
|
1408
|
+
readonly submissionId: string;
|
|
1409
|
+
readonly hostSubmissionId: string;
|
|
1410
|
+
} | {
|
|
1411
|
+
readonly _tag: "DurableAlarmError";
|
|
1412
|
+
readonly operation: string;
|
|
1413
|
+
readonly message: string;
|
|
1414
|
+
readonly cause?: Schema.Json | undefined;
|
|
1415
|
+
} | {
|
|
1416
|
+
readonly _tag: "HostProtocolError";
|
|
1417
|
+
readonly message: string;
|
|
1418
|
+
} | {
|
|
1419
|
+
readonly _tag: "ApprovalConflict";
|
|
1420
|
+
readonly submissionId: string;
|
|
1421
|
+
readonly toolCallId: string;
|
|
1422
|
+
readonly existingDecision: "approved" | "denied";
|
|
1423
|
+
} | {
|
|
1424
|
+
readonly _tag: "UnknownResolutionConflict";
|
|
1425
|
+
readonly submissionId: string;
|
|
1426
|
+
readonly toolCallId: string;
|
|
1427
|
+
} | {
|
|
1428
|
+
readonly _tag: "AdmissionLimitExceeded";
|
|
1429
|
+
readonly limit: "database-bytes" | "input-bytes" | "queue-depth";
|
|
1430
|
+
readonly actual: number;
|
|
1431
|
+
readonly maximum: number;
|
|
1432
|
+
};
|
|
1433
|
+
}, Schema.SchemaError, never>;
|
|
1434
|
+
declare const decodeHostResponse: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<AbortRecorded | ApprovalRecorded | HostFailed | ObservedPage | ProgressCancelled | ProgressObserved | SettlementReached | SubmissionStatusResponse | SubmitSucceeded | UnknownResolutionRecorded, Schema.SchemaError, never>;
|
|
1435
|
+
/** Failure surface of `CloudflareThreadClient.submit`. */
|
|
1436
|
+
declare const ClientSubmitHostFailure: Schema.Union<readonly [typeof AgentInputError, typeof DigestError, typeof AdmissionConflict, typeof AdmissionPolicyError, typeof LedgerError, typeof ThreadStoreError, typeof ThreadNotMaterialized, typeof AppendConflict, typeof FenceRejected, typeof DurableRuntimeFailpointError, typeof AdmissionLimitExceeded, typeof DurableAlarmError, typeof HostProtocolError]>;
|
|
1437
|
+
declare const ClientAwaitHostFailure: Schema.Union<readonly [typeof LedgerError, typeof SettlementConflict, typeof OperationDenied, typeof HostProtocolError]>;
|
|
1438
|
+
declare const ClientObserveHostFailure: Schema.Union<readonly [typeof ThreadStoreError, typeof ThreadNotMaterialized, typeof OperationDenied, typeof HostProtocolError]>;
|
|
1439
|
+
declare const ClientAbortHostFailure: Schema.Union<readonly [typeof OperationDenied, typeof LedgerError, typeof SettlementConflict, typeof JoinedToHost, typeof DurableRuntimeFailpointError, typeof DurableAlarmError, typeof HostProtocolError]>;
|
|
1440
|
+
declare const ClientApprovalHostFailure: Schema.Union<readonly [typeof LedgerError, typeof SettlementConflict, typeof ApprovalConflict, typeof OperationDenied, typeof DurableAlarmError, typeof HostProtocolError]>;
|
|
1441
|
+
declare const ClientUnknownHostFailure: Schema.Union<readonly [typeof LedgerError, typeof SettlementConflict, typeof UnknownResolutionConflict, typeof JoinedToHost, typeof DurableRuntimeFailpointError, typeof OperationDenied, typeof DurableAlarmError, typeof HostProtocolError]>;
|
|
1442
|
+
type ClientSubmitFailure = typeof ClientSubmitHostFailure.Type | ThreadClientError;
|
|
1443
|
+
type ClientAwaitFailure = typeof ClientAwaitHostFailure.Type | ThreadClientError;
|
|
1444
|
+
type ClientObserveFailure = typeof ClientObserveHostFailure.Type | ThreadClientError;
|
|
1445
|
+
type ClientProgressFailure = ClientObserveFailure;
|
|
1446
|
+
type ClientAbortFailure = typeof ClientAbortHostFailure.Type | ThreadClientError;
|
|
1447
|
+
type ClientApprovalFailure = typeof ClientApprovalHostFailure.Type | ThreadClientError;
|
|
1448
|
+
type ClientUnknownFailure = typeof ClientUnknownHostFailure.Type | ThreadClientError;
|
|
1449
|
+
declare const CloudflareThreadClient_base: Context.ServiceClass<CloudflareThreadClient, "@effect-agent/platform-cloudflare/CloudflareThreadClient", {
|
|
1450
|
+
/** Encode the input client-side, then durably submit to the owning Object. */
|
|
1451
|
+
readonly submit: <InputSchema extends Schema.Top>(agent: DurableSubmitAgent<InputSchema>, input: InputSchema["Type"], options: DurableSubmitOptions) => Effect.Effect<Receipt, ClientSubmitFailure, InputSchema["EncodingServices"]>;
|
|
1452
|
+
/** Wake-hinted, poll-guaranteed settlement wait executed inside the owning Object. */
|
|
1453
|
+
readonly submissionStatus: (receipt: Receipt) => Effect.Effect<SubmissionStatus, ClientAwaitFailure>;
|
|
1454
|
+
readonly awaitSettlement: (receipt: Receipt) => Effect.Effect<Settlement, ClientAwaitFailure>;
|
|
1455
|
+
/**
|
|
1456
|
+
* Wait without polling until progress after `afterSequence` is already durable or hinted.
|
|
1457
|
+
* The result is deliberately void: canonical records remain authoritative and must be read.
|
|
1458
|
+
* Interruption waits at most one second for best-effort remote cancellation.
|
|
1459
|
+
*/
|
|
1460
|
+
readonly awaitProgress: (threadId: ThreadId, afterSequence: CanonicalSequence) => Effect.Effect<void, ClientProgressFailure>;
|
|
1461
|
+
/** One bounded page of canonical records. */
|
|
1462
|
+
readonly readPage: (threadId: ThreadId, options?: {
|
|
1463
|
+
readonly afterSequence?: CanonicalSequence | undefined;
|
|
1464
|
+
readonly limit?: number | undefined;
|
|
1465
|
+
}) => Effect.Effect<ReadonlyArray<CanonicalRecordEnvelope>, ClientObserveFailure>;
|
|
1466
|
+
/**
|
|
1467
|
+
* Every canonical record up to the CURRENT committed tail, via repeated pages. A
|
|
1468
|
+
* snapshot read, not a live observation — callers wanting liveness re-read after
|
|
1469
|
+
* `awaitSettlement`.
|
|
1470
|
+
*/
|
|
1471
|
+
readonly readAll: (threadId: ThreadId) => Effect.Effect<ReadonlyArray<CanonicalRecordEnvelope>, ClientObserveFailure>;
|
|
1472
|
+
/**
|
|
1473
|
+
* Submission-addressed operations take the owning Thread explicitly (from the
|
|
1474
|
+
* Receipt): minted Submission identities stay OPAQUE outside the storage adapter that
|
|
1475
|
+
* minted them (D-P6-5), so the client never parses one to find the lane.
|
|
1476
|
+
*/
|
|
1477
|
+
readonly abort: (threadId: ThreadId, command: AbortCommand) => Effect.Effect<AbortIntent, ClientAbortFailure>;
|
|
1478
|
+
readonly resolveApproval: (threadId: ThreadId, command: ApprovalDecisionCommand) => Effect.Effect<ApprovalDecisionIntent, ClientApprovalFailure>;
|
|
1479
|
+
readonly resolveUnknown: (threadId: ThreadId, command: UnknownResolutionCommand) => Effect.Effect<UnknownResolutionIntent, ClientUnknownFailure>;
|
|
1480
|
+
}>;
|
|
1481
|
+
/** Worker-side client over the Thread Object namespace (DEPLOY-010). */
|
|
1482
|
+
declare class CloudflareThreadClient extends CloudflareThreadClient_base {
|
|
1483
|
+
/**
|
|
1484
|
+
* Assemble the client from a resolved namespace and the platform Crypto implementation.
|
|
1485
|
+
* rpcTracing is the binding name and remains opt-in. Caller authentication, principals,
|
|
1486
|
+
* idempotency keys, and definition digests are still explicit submission inputs.
|
|
1487
|
+
*/
|
|
1488
|
+
static layerFromBinding(options: {
|
|
1489
|
+
readonly namespace: DurableObjectNamespace<ThreadObjectRpc>;
|
|
1490
|
+
readonly rpcTracing?: string;
|
|
1491
|
+
}): Layer.Layer<CloudflareThreadClient>;
|
|
1492
|
+
static readonly layer: Layer.Layer<CloudflareThreadClient, never, ThreadObjectNamespace | Crypto.Crypto>;
|
|
1493
|
+
}
|
|
1494
|
+
//#endregion
|
|
1495
|
+
export { AbortRecorded, ApprovalRecorded, AwaitProgressRequest, CancelProgressRequest, ClientAbortFailure, ClientApprovalFailure, ClientAwaitFailure, ClientObserveFailure, ClientProgressFailure, ClientSubmitFailure, ClientUnknownFailure, CloudflareThreadClient, HostFailed, HostFailure, HostProtocolError, HostResponse, ObservePageRequest, ObservedPage, ProgressCancelled, ProgressObserved, SettlementReached, SubmissionStatusResponse, SubmitRequest, SubmitSucceeded, ThreadClientError, UnknownResolutionRecorded, boundHostDiagnostic, decodeAbortCommand, decodeApprovalDecisionCommand, decodeAwaitProgressRequest, decodeCancelProgressRequest, decodeHostResponse, decodeObservePageRequest, decodeReceipt, decodeSubmitRequest, decodeUnknownResolutionCommand, encodeAbortCommand, encodeApprovalDecisionCommand, encodeAwaitProgressRequest, encodeCancelProgressRequest, encodeHostResponse, encodeObservePageRequest, encodeReceipt, encodeSubmitRequest, encodeUnknownResolutionCommand, CloudflareThreadClient_d_exports as t };
|
|
1496
|
+
//# sourceMappingURL=CloudflareThreadClient.d.mts.map
|