@effect-agent/storage-cloudflare 0.1.0-beta.9 → 0.1.0-beta.91
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/DoMemoryStore.d.mts +29 -0
- package/dist/DoMemoryStore.mjs +55 -0
- package/dist/DoMemoryStore.mjs.map +1 -0
- package/dist/DoMessageDeliveryStore.d.mts +17 -0
- package/dist/DoMessageDeliveryStore.mjs +32 -0
- package/dist/DoMessageDeliveryStore.mjs.map +1 -0
- package/dist/DoScheduleStore.d.mts +36 -0
- package/dist/DoScheduleStore.mjs +388 -0
- package/dist/DoScheduleStore.mjs.map +1 -0
- package/dist/DoStorageConfig.d.mts +45 -0
- package/dist/DoStorageConfig.mjs +52 -0
- package/dist/DoStorageConfig.mjs.map +1 -0
- package/dist/DoStorageError-Cmhvl4TQ.d.mts +98 -0
- package/dist/DoStorageError.d.mts +2 -0
- package/dist/DoStorageError.mjs +164 -0
- package/dist/DoStorageError.mjs.map +1 -0
- package/dist/DoStorageFailpoint.d.mts +17 -0
- package/dist/DoStorageFailpoint.mjs +14 -0
- package/dist/DoStorageFailpoint.mjs.map +1 -0
- package/dist/DoStorageFailpointTesting.d.mts +34 -0
- package/dist/DoStorageFailpointTesting.mjs +35 -0
- package/dist/DoStorageFailpointTesting.mjs.map +1 -0
- package/dist/DoStorageVersion-x5OOurvZ.d.mts +12 -0
- package/dist/DoStorageVersion.d.mts +2 -0
- package/dist/DoStorageVersion.mjs +8 -0
- package/dist/DoStorageVersion.mjs.map +1 -0
- package/dist/DoSubmissionLedger.d.mts +23 -0
- package/dist/DoSubmissionLedger.mjs +1849 -0
- package/dist/DoSubmissionLedger.mjs.map +1 -0
- package/dist/DoSubscriptionStore.d.mts +25 -0
- package/dist/DoSubscriptionStore.mjs +183 -0
- package/dist/DoSubscriptionStore.mjs.map +1 -0
- package/dist/DoThreadStore.d.mts +59 -0
- package/dist/DoThreadStore.mjs +465 -0
- package/dist/DoThreadStore.mjs.map +1 -0
- package/dist/MemoryProtocol.d.mts +38160 -0
- package/dist/MemoryProtocol.mjs +219 -0
- package/dist/MemoryProtocol.mjs.map +1 -0
- package/dist/PortProtocol.d.mts +3804 -0
- package/dist/PortProtocol.mjs +176 -0
- package/dist/PortProtocol.mjs.map +1 -0
- package/dist/PortRouting.d.mts +83 -0
- package/dist/PortRouting.mjs +410 -0
- package/dist/PortRouting.mjs.map +1 -0
- package/dist/do-journal-dJ01KSKf.mjs +991 -0
- package/dist/do-journal-dJ01KSKf.mjs.map +1 -0
- package/dist/index.d.mts +14 -1525
- package/dist/index.mjs +14 -3695
- package/dist/migrations-Ba_kOrSx.mjs +287 -0
- package/dist/migrations-Ba_kOrSx.mjs.map +1 -0
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/package.json +1 -45
- package/src/DoMemoryStore.ts +56 -0
- package/src/DoMessageDeliveryStore.ts +53 -0
- package/src/DoScheduleStore.ts +622 -0
- package/src/{errors.ts → DoStorageError.ts} +10 -3
- package/src/DoStorageFailpoint.ts +20 -0
- package/src/{do-storage-failpoint.ts → DoStorageFailpointTesting.ts} +5 -18
- package/src/DoStorageVersion.ts +2 -0
- package/src/{do-ledger.ts → DoSubmissionLedger.ts} +924 -225
- package/src/DoSubscriptionStore.ts +329 -0
- package/src/DoThreadStore.ts +1012 -0
- package/src/MemoryProtocol.ts +351 -0
- package/src/{port-protocol.ts → PortProtocol.ts} +45 -38
- package/src/{routing.ts → PortRouting.ts} +292 -264
- package/src/index.ts +13 -32
- package/src/{do-journal.ts → internal/do-journal.ts} +718 -234
- package/src/internal/message-delivery-schema.ts +24 -0
- package/src/{migrations.ts → internal/migrations.ts} +51 -35
- package/src/internal/recovery-checkpoint-schema.ts +17 -0
- package/dist/index.mjs.map +0 -1
- package/src/do-conversation-store.ts +0 -850
- /package/src/{do-storage-config.ts → DoStorageConfig.ts} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,1525 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
readonly rowKey: Schema.String;
|
|
16
|
-
readonly table: Schema.String;
|
|
17
|
-
}>, import("effect/Cause").YieldableError>;
|
|
18
|
-
/** Stored bytes failed the current Schema and cannot be used as recovery truth. */
|
|
19
|
-
declare class DoStorageCorruptionError extends DoStorageCorruptionError_base {}
|
|
20
|
-
declare const DoStorageError_base: Schema.Class<DoStorageError, Schema.TaggedStruct<"DoStorageError", {
|
|
21
|
-
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
22
|
-
readonly message: Schema.String;
|
|
23
|
-
readonly operation: Schema.String;
|
|
24
|
-
}>, import("effect/Cause").YieldableError>;
|
|
25
|
-
/** Durable Object SQLite infrastructure failed while opening or operating the store. */
|
|
26
|
-
declare class DoStorageError extends DoStorageError_base {}
|
|
27
|
-
declare const DoLedgerError_base: Schema.Class<DoLedgerError, Schema.TaggedStruct<"DoLedgerError", {
|
|
28
|
-
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
29
|
-
readonly message: Schema.String;
|
|
30
|
-
readonly operation: Schema.String;
|
|
31
|
-
}>, import("effect/Cause").YieldableError>;
|
|
32
|
-
/**
|
|
33
|
-
* Durable Object SQLite infrastructure failed while operating the Submission Ledger. Surfaces
|
|
34
|
-
* at the SubmissionLedger port as the typed `LedgerError` with this error preserved as its
|
|
35
|
-
* cause, so the adapter-level tag is never erased.
|
|
36
|
-
*/
|
|
37
|
-
declare class DoLedgerError extends DoLedgerError_base {}
|
|
38
|
-
declare const DoValueBoundExceeded_base: Schema.Class<DoValueBoundExceeded, Schema.TaggedStruct<"DoValueBoundExceeded", {
|
|
39
|
-
readonly actualBytes: Schema.Int;
|
|
40
|
-
readonly maxBytes: Schema.Int;
|
|
41
|
-
readonly operation: Schema.String;
|
|
42
|
-
}>, import("effect/Cause").YieldableError>;
|
|
43
|
-
/**
|
|
44
|
-
* A value to be stored exceeds the configured Durable Object per-value bound
|
|
45
|
-
* (`DoStorageConfigValue.maxStoredValueBytes`, kept under the platform's 2 MB SQLite value
|
|
46
|
-
* limit). The refusal happens typed BEFORE any durable mutation; no partial state is written.
|
|
47
|
-
* Payloads of this size are the designed overflow case for a future R2-backed AttachmentStore
|
|
48
|
-
* (deployment spec §3.1, deferred until a real attachment requirement exists).
|
|
49
|
-
*/
|
|
50
|
-
declare class DoValueBoundExceeded extends DoValueBoundExceeded_base {
|
|
51
|
-
get message(): string;
|
|
52
|
-
}
|
|
53
|
-
declare const DoAppendConflict_base: Schema.Class<DoAppendConflict, Schema.TaggedStruct<"DoAppendConflict", {
|
|
54
|
-
readonly message: Schema.String;
|
|
55
|
-
readonly reason: Schema.Literals<readonly ["batch-digest", "record-identity", "tail"]>;
|
|
56
|
-
readonly actualTailSequence: Schema.optionalKey<Schema.brand<Schema.Natural, "@effect-agent/session/CanonicalSequence">>;
|
|
57
|
-
readonly actualTailDigest: Schema.optionalKey<Schema.String>;
|
|
58
|
-
}>, import("effect/Cause").YieldableError>;
|
|
59
|
-
/**
|
|
60
|
-
* A canonical batch retry conflicts with existing append state. Tail conflicts carry the
|
|
61
|
-
* actual committed tail as a diagnostic resume hint.
|
|
62
|
-
*/
|
|
63
|
-
declare class DoAppendConflict extends DoAppendConflict_base {}
|
|
64
|
-
declare const DoFenceRejected_base: Schema.Class<DoFenceRejected, Schema.TaggedStruct<"DoFenceRejected", {
|
|
65
|
-
readonly actualEpoch: Schema.brand<Schema.Natural, "@effect-agent/session/ProducerEpoch">;
|
|
66
|
-
readonly message: Schema.String;
|
|
67
|
-
readonly producerEpoch: Schema.brand<Schema.Natural, "@effect-agent/session/ProducerEpoch">;
|
|
68
|
-
}>, import("effect/Cause").YieldableError>;
|
|
69
|
-
/**
|
|
70
|
-
* A producer epoch does not match the Conversation's current writer registration. Appends
|
|
71
|
-
* require the exact registered epoch, so both older and newer unregistered epochs are fenced;
|
|
72
|
-
* a newer epoch takes over by materializing first.
|
|
73
|
-
*/
|
|
74
|
-
declare class DoFenceRejected extends DoFenceRejected_base {}
|
|
75
|
-
declare const DoCheckpointConflict_base: Schema.Class<DoCheckpointConflict, Schema.TaggedStruct<"DoCheckpointConflict", {
|
|
76
|
-
readonly message: Schema.String;
|
|
77
|
-
}>, import("effect/Cause").YieldableError>;
|
|
78
|
-
/** A checkpoint conflicts with a previously stored checkpoint at the same offset. */
|
|
79
|
-
declare class DoCheckpointConflict extends DoCheckpointConflict_base {}
|
|
80
|
-
/**
|
|
81
|
-
* Deterministic fault-injection locations at Durable Object storage operation boundaries.
|
|
82
|
-
*
|
|
83
|
-
* The string list is copied VERBATIM from `SqliteStorageFailpointLocation`
|
|
84
|
-
* (`packages/storage-sqlite/src/errors.ts`) so every crash-matrix row keeps the same name on
|
|
85
|
-
* both platforms — the DN process-kill evidence and the DC eviction evidence address identical
|
|
86
|
-
* locations. There is intentionally no Cloudflare-only location.
|
|
87
|
-
*/
|
|
88
|
-
declare const DoStorageFailpointLocation: Schema.Literals<readonly ["materialize:before", "materialize:after", "append:before", "append:after-batch-insert", "append:after-record-insert", "append:after-tail-update", "append:after", "export:after-conversation-read", "save-checkpoint:before", "save-checkpoint:after", "ledger:admit:before", "ledger:admit:after", "ledger:mark-ready:before", "ledger:mark-ready:after", "ledger:claim:before", "ledger:claim:after", "ledger:mark-input-applied:before", "ledger:mark-input-applied:after", "ledger:renew:before", "ledger:renew:after", "ledger:reserve-settlement:before", "ledger:reserve-settlement:after", "ledger:finalize-settlement:before", "ledger:finalize-settlement:after", "ledger:request-abort:before", "ledger:request-abort:after", "ledger:release:before", "ledger:release:after", "ledger:claim-joining:before", "ledger:claim-joining:after", "ledger:mark-joined:before", "ledger:mark-joined:after", "ledger:revert-joining:before", "ledger:revert-joining:after", "ledger:suspend:before", "ledger:suspend:after", "ledger:approval-decision:before", "ledger:approval-decision:after", "ledger:mark-unknown:before", "ledger:mark-unknown:after", "ledger:unknown-resolution:before", "ledger:unknown-resolution:after", "ledger:child-reservation:before", "ledger:child-reservation:after", "ledger:child-attach:before", "ledger:child-attach:after", "ledger:child-release-pending:before", "ledger:child-release-pending:after", "ledger:child-release:before", "ledger:child-release:after", "ledger:child-settled:before", "ledger:child-settled:after"]>;
|
|
89
|
-
type DoStorageFailpointLocation = typeof DoStorageFailpointLocation.Type;
|
|
90
|
-
declare const DoStorageFailpointError_base: Schema.Class<DoStorageFailpointError, Schema.TaggedStruct<"DoStorageFailpointError", {
|
|
91
|
-
readonly location: Schema.Literals<readonly ["materialize:before", "materialize:after", "append:before", "append:after-batch-insert", "append:after-record-insert", "append:after-tail-update", "append:after", "export:after-conversation-read", "save-checkpoint:before", "save-checkpoint:after", "ledger:admit:before", "ledger:admit:after", "ledger:mark-ready:before", "ledger:mark-ready:after", "ledger:claim:before", "ledger:claim:after", "ledger:mark-input-applied:before", "ledger:mark-input-applied:after", "ledger:renew:before", "ledger:renew:after", "ledger:reserve-settlement:before", "ledger:reserve-settlement:after", "ledger:finalize-settlement:before", "ledger:finalize-settlement:after", "ledger:request-abort:before", "ledger:request-abort:after", "ledger:release:before", "ledger:release:after", "ledger:claim-joining:before", "ledger:claim-joining:after", "ledger:mark-joined:before", "ledger:mark-joined:after", "ledger:revert-joining:before", "ledger:revert-joining:after", "ledger:suspend:before", "ledger:suspend:after", "ledger:approval-decision:before", "ledger:approval-decision:after", "ledger:mark-unknown:before", "ledger:mark-unknown:after", "ledger:unknown-resolution:before", "ledger:unknown-resolution:after", "ledger:child-reservation:before", "ledger:child-reservation:after", "ledger:child-attach:before", "ledger:child-attach:after", "ledger:child-release-pending:before", "ledger:child-release-pending:after", "ledger:child-release:before", "ledger:child-release:after", "ledger:child-settled:before", "ledger:child-settled:after"]>;
|
|
92
|
-
}>, import("effect/Cause").YieldableError>;
|
|
93
|
-
/** Deterministic test-only fault or pause injected at a Durable Object storage boundary. */
|
|
94
|
-
declare class DoStorageFailpointError extends DoStorageFailpointError_base {
|
|
95
|
-
get message(): string;
|
|
96
|
-
}
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region src/migrations.d.ts
|
|
99
|
-
/**
|
|
100
|
-
* The exact-or-fresh storage version recorded in `effect_agent_meta`. Cloudflare is a fresh
|
|
101
|
-
* platform, so there is exactly ONE migration carrying the complete current schema — no
|
|
102
|
-
* v1→v4 history to replay (deployment spec §9: no rolling data-version promise during
|
|
103
|
-
* private development).
|
|
104
|
-
*/
|
|
105
|
-
declare const CurrentDoStorageVersion = 1;
|
|
106
|
-
/**
|
|
107
|
-
* The Conversation Durable Object schema. Table names and columns mirror the Node/SQLite v4
|
|
108
|
-
* schema byte-for-byte (`packages/storage-sqlite/src/migrations.ts`, migrations 1–4 collapsed
|
|
109
|
-
* into their final shape) so the shared conformance suites and crash-matrix rows address
|
|
110
|
-
* identical durable state. Two DC-specific additions:
|
|
111
|
-
*
|
|
112
|
-
* 1. `effect_agent_meta` replaces `PRAGMA user_version` as the exact-or-fresh version gate —
|
|
113
|
-
* a meta table is portable regardless of which PRAGMAs Durable Object SQL storage allows.
|
|
114
|
-
* 2. `effect_agent_child_settlements` is the durable cross-store notification marker the
|
|
115
|
-
* SubmissionLedger port contract mandates for cross-store adapters (`suspend`'s covering
|
|
116
|
-
* check and `recordChildSettled`'s wake both consult it): parent and child Conversations
|
|
117
|
-
* live in different Durable Objects, so a child settlement reported before the parent's
|
|
118
|
-
* suspend commits must be observable from the PARENT's own storage.
|
|
119
|
-
*/
|
|
120
|
-
declare const doMigrations: SqliteMigrator.Loader<never>;
|
|
121
|
-
//#endregion
|
|
122
|
-
//#region src/do-storage-config.d.ts
|
|
123
|
-
/**
|
|
124
|
-
* Default per-value byte bound, kept under the Durable Object platform's 2 MB SQLite value
|
|
125
|
-
* limit with a safety margin. This is the DC analogue of Node's 16 MB `BoundedStoredText`
|
|
126
|
-
* bound: both fail typed before mutating, only the threshold differs (a documented DN/DC
|
|
127
|
-
* behavioral difference; Travel Planner payloads sit orders of magnitude below both).
|
|
128
|
-
*/
|
|
129
|
-
declare const DEFAULT_MAX_STORED_VALUE_BYTES = 1900000;
|
|
130
|
-
declare const DoStorageConfigValue_base: Schema.Class<DoStorageConfigValue, Schema.Struct<{
|
|
131
|
-
readonly observationPollInterval: Schema.Int;
|
|
132
|
-
/**
|
|
133
|
-
* Submission ownership lease duration in milliseconds (D5). Inside one Durable Object the
|
|
134
|
-
* object itself is the serialized owner, so the lease's primary DC role is fencing work
|
|
135
|
-
* across DO incarnations (an evicted incarnation's claim becomes reclaimable); correctness
|
|
136
|
-
* never depends on it because every canonical append is fenced by producer epoch.
|
|
137
|
-
*/
|
|
138
|
-
readonly ownershipLeaseDuration: Schema.Int;
|
|
139
|
-
/**
|
|
140
|
-
* Maximum bytes for any single stored text value (canonical batch/record JSON, admission
|
|
141
|
-
* input payload, checkpoint JSON). Enforced typed BEFORE any write; must stay under the
|
|
142
|
-
* platform's 2 MB per-value limit.
|
|
143
|
-
*/
|
|
144
|
-
readonly maxStoredValueBytes: Schema.Int;
|
|
145
|
-
/**
|
|
146
|
-
* Re-verify every stored payload and digest chain while opening the store. Per-operation
|
|
147
|
-
* Schema decoding and the digest chain already fail clearly on corrupt rows, so the full
|
|
148
|
-
* scan is an explicit opt-in integrity audit rather than a startup requirement.
|
|
149
|
-
*/
|
|
150
|
-
readonly verifyOnOpen: Schema.Boolean;
|
|
151
|
-
}>, {}>;
|
|
152
|
-
/**
|
|
153
|
-
* Validated construction configuration consumed by the Durable Object storage Layers. The
|
|
154
|
-
* storage identity itself belongs to the SqlClient Layer (built from `ctx.storage`);
|
|
155
|
-
* duplicating it here could silently diverge from the handle actually in use.
|
|
156
|
-
*/
|
|
157
|
-
declare class DoStorageConfigValue extends DoStorageConfigValue_base {}
|
|
158
|
-
declare const DoStorageConfig_base: Context.ServiceClass<DoStorageConfig, "@effect-agent/storage-cloudflare/DoStorageConfig", DoStorageConfigValue>;
|
|
159
|
-
/** Explicit Durable Object storage configuration authority. */
|
|
160
|
-
declare class DoStorageConfig extends DoStorageConfig_base {}
|
|
161
|
-
//#endregion
|
|
162
|
-
//#region src/do-storage-failpoint.d.ts
|
|
163
|
-
type DoStorageFailpointHandler = (location: DoStorageFailpointLocation) => Effect.Effect<void, DoStorageFailpointError>;
|
|
164
|
-
declare const DoStorageFailpointTestControl_base: Context.ServiceClass<DoStorageFailpointTestControl, "@effect-agent/storage-cloudflare/DoStorageFailpointTestControl", {
|
|
165
|
-
readonly clear: Effect.Effect<void>;
|
|
166
|
-
readonly setHandler: (handler: DoStorageFailpointHandler) => Effect.Effect<void>;
|
|
167
|
-
}>;
|
|
168
|
-
/** Test-only control for replacing the active Durable Object failpoint handler. */
|
|
169
|
-
declare class DoStorageFailpointTestControl extends DoStorageFailpointTestControl_base {}
|
|
170
|
-
declare const DoStorageFailpoint_base: Context.ServiceClass<DoStorageFailpoint, "@effect-agent/storage-cloudflare/DoStorageFailpoint", {
|
|
171
|
-
readonly hit: DoStorageFailpointHandler;
|
|
172
|
-
}>;
|
|
173
|
-
/** Explicit fault-injection authority used at Durable Object storage operation boundaries. */
|
|
174
|
-
declare class DoStorageFailpoint extends DoStorageFailpoint_base {
|
|
175
|
-
/** Production default: no fault injection. */
|
|
176
|
-
static readonly layer: Layer.Layer<DoStorageFailpoint, never, never>;
|
|
177
|
-
/** Reusable test Layer with a control service backed by the same handler Ref. */
|
|
178
|
-
static readonly layerTest: Layer.Layer<DoStorageFailpoint | DoStorageFailpointTestControl, never, never>;
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* The DC-specific eviction failpoint mode: instead of failing typed, an armed hit evicts the
|
|
182
|
-
* Durable Object through an injected `evict` thunk — in production-shaped harnesses that thunk
|
|
183
|
-
* is `() => ctx.abort()`, the platform's real failure mode. `ctx.abort()` never returns (it
|
|
184
|
-
* throws while destroying the in-memory instance and every in-flight implicit or explicit
|
|
185
|
-
* storage transaction rolls back), so an armed hit ends the current Attempt exactly like an
|
|
186
|
-
* unannounced platform eviction; DO storage — the only correctness-critical state — survives
|
|
187
|
-
* for the next incarnation, which the persisted alarm wakes without any incoming request.
|
|
188
|
-
*
|
|
189
|
-
* The handles stay injected: this package never imports `cloudflare:workers`, so the harness
|
|
190
|
-
* that owns a `DurableObjectState` supplies the thunk.
|
|
191
|
-
*/
|
|
192
|
-
declare const evictionFailpointHandler: (options: {
|
|
193
|
-
readonly isArmed: (location: DoStorageFailpointLocation) => Effect.Effect<boolean>;
|
|
194
|
-
/** Kills the incarnation — e.g. `() => ctx.abort()`. Typed `void` because the platform
|
|
195
|
-
* declares `abort` as returning, but it throws while destroying the instance. */
|
|
196
|
-
readonly evict: (location: DoStorageFailpointLocation) => void;
|
|
197
|
-
}) => DoStorageFailpointHandler;
|
|
198
|
-
//#endregion
|
|
199
|
-
//#region src/do-conversation-store.d.ts
|
|
200
|
-
/**
|
|
201
|
-
* Convenience-layer construction options. `storage` is the Durable Object's own
|
|
202
|
-
* `ctx.storage` handle, injected as a value (DEPLOY-010: platform bindings enter only
|
|
203
|
-
* through Layers; this package never imports `cloudflare:workers`).
|
|
204
|
-
*/
|
|
205
|
-
interface DoStorageOptions {
|
|
206
|
-
readonly storage: DurableObjectStorage;
|
|
207
|
-
readonly observationPollInterval?: number | undefined;
|
|
208
|
-
/**
|
|
209
|
-
* Submission ownership lease duration in milliseconds (D5). Defaults to
|
|
210
|
-
* `DEFAULT_OWNERSHIP_LEASE_DURATION` from `@effect-agent/session`.
|
|
211
|
-
*/
|
|
212
|
-
readonly ownershipLeaseDuration?: number | undefined;
|
|
213
|
-
/**
|
|
214
|
-
* Maximum bytes for any single stored value; must stay under the platform's 2 MB
|
|
215
|
-
* per-value limit. Defaults to `DEFAULT_MAX_STORED_VALUE_BYTES`.
|
|
216
|
-
*/
|
|
217
|
-
readonly maxStoredValueBytes?: number | undefined;
|
|
218
|
-
/**
|
|
219
|
-
* Re-verify every stored payload and digest chain while opening the store. Defaults to
|
|
220
|
-
* off: per-operation Schema decoding and the digest chain already fail clearly on corrupt
|
|
221
|
-
* rows without scanning the whole database on every open.
|
|
222
|
-
*/
|
|
223
|
-
readonly verifyOnOpen?: boolean | undefined;
|
|
224
|
-
readonly failpoint?: DoStorageFailpointHandler | undefined;
|
|
225
|
-
}
|
|
226
|
-
type DoStorageInitializationError = DoStorageCompatibilityError | DoStorageCorruptionError | DoStorageError;
|
|
227
|
-
/**
|
|
228
|
-
* Durable Object Conversation Store implementation with configuration, failpoint, SQL, and
|
|
229
|
-
* Crypto authority kept visible in its input channel.
|
|
230
|
-
*/
|
|
231
|
-
declare const conversationStoreLayer: Layer.Layer<ConversationStore, DoStorageInitializationError, DoStorageConfig | DoStorageFailpoint | SqlClientService.SqlClient | Crypto.Crypto>;
|
|
232
|
-
/**
|
|
233
|
-
* Validated Durable Object storage configuration Layer with the documented defaults applied.
|
|
234
|
-
* Shared by the ConversationStore and SubmissionLedger convenience layers so their defaults
|
|
235
|
-
* cannot drift.
|
|
236
|
-
*/
|
|
237
|
-
declare const storageConfigLayer: (options: DoStorageOptions) => Layer.Layer<DoStorageConfig, DoStorageError>;
|
|
238
|
-
/** The failpoint Layer selected by convenience options: explicit handler or the no-op default. */
|
|
239
|
-
declare const storageFailpointLayer: (options: DoStorageOptions) => Layer.Layer<DoStorageFailpoint>;
|
|
240
|
-
/**
|
|
241
|
-
* A composition-root convenience Layer for canonical Conversations inside one Durable Object,
|
|
242
|
-
* built over `ctx.storage`. Durable accepted work is served by the separate SubmissionLedger
|
|
243
|
-
* port; point both at the SAME `ctx.storage` so claims fence the same producer epochs
|
|
244
|
-
* (ADR-0011 D7's "same file" rule, transposed to one object's private database).
|
|
245
|
-
*/
|
|
246
|
-
declare const layer: (options: DoStorageOptions) => Layer.Layer<ConversationStore, DoStorageInitializationError>;
|
|
247
|
-
/** Create an adapter-owned resumable observation offset for a known canonical sequence. */
|
|
248
|
-
declare const observationOffsetAt: (conversationId: string & import("effect/Brand").Brand<"@effect-agent/core/ConversationId">, sequence: number) => Effect.Effect<string & import("effect/Brand").Brand<"@effect-agent/session/ObservationOffset">, ConversationStoreError, never>;
|
|
249
|
-
//#endregion
|
|
250
|
-
//#region src/do-ledger.d.ts
|
|
251
|
-
/**
|
|
252
|
-
* Durable Object SubmissionLedger implementation sharing the journal's private SQLite
|
|
253
|
-
* database, storage-backed transaction discipline, and producer-epoch fencing substrate.
|
|
254
|
-
* Configuration, failpoint, SQL, and Crypto authority stay visible in the input channel.
|
|
255
|
-
*/
|
|
256
|
-
declare const submissionLedgerLayer: Layer.Layer<SubmissionLedger, DoStorageInitializationError, DoStorageConfig | DoStorageFailpoint | SqlClientService.SqlClient | Crypto.Crypto>;
|
|
257
|
-
/**
|
|
258
|
-
* A composition-root convenience Layer for the durable Submission Ledger. Point it at the
|
|
259
|
-
* same `ctx.storage` as the ConversationStore so claims fence the same producer epochs.
|
|
260
|
-
*/
|
|
261
|
-
declare const ledgerLayer: (options: DoStorageOptions) => Layer.Layer<SubmissionLedger, DoStorageInitializationError>;
|
|
262
|
-
//#endregion
|
|
263
|
-
//#region src/port-protocol.d.ts
|
|
264
|
-
/**
|
|
265
|
-
* The cross-Durable-Object port protocol (plan §1.3, D-P6-3): Schema request/response/error
|
|
266
|
-
* envelopes for the CLOSED route-capable subset of the session ports. One Conversation's
|
|
267
|
-
* Durable Object executes another Conversation's request against its OWN local facets; the
|
|
268
|
-
* envelopes here are the only values that cross the Object boundary, and they are
|
|
269
|
-
* transport-agnostic — native Durable Object JS RPC is the shipped carrier, fetch-with-JSON
|
|
270
|
-
* the documented fallback, and both move the same Schema-encoded JSON.
|
|
271
|
-
*
|
|
272
|
-
* The closed subset is exactly the set of operations the durable coordinator performs against
|
|
273
|
-
* a FOREIGN Conversation (parent/child establishment, status checks, abort propagation,
|
|
274
|
-
* child-settlement notification, and the child-conversation store operations used by
|
|
275
|
-
* establishment, `verifySettledChild`, and result projection):
|
|
276
|
-
*
|
|
277
|
-
* - ledger: `admit`, `markReady`, `lookup`, `resolveAdmission`, `requestAbort`,
|
|
278
|
-
* `recordChildSettled`;
|
|
279
|
-
* - store: `materialize`, `append`, `read` (one page), `inspectTail`, `export`.
|
|
280
|
-
*
|
|
281
|
-
* Every other port operation is lane-local by construction and is NOT given an envelope:
|
|
282
|
-
* honesty over accidental distribution — the routing layer fails such calls fast and typed
|
|
283
|
-
* instead of quietly widening the distributed surface.
|
|
284
|
-
*
|
|
285
|
-
* Failures cross the boundary as the `PortFailure` union and re-decode on the caller side to
|
|
286
|
-
* the SAME tagged error types the local facet would have produced, so routed calls keep
|
|
287
|
-
* error-tag fidelity. `cause` chains inside `LedgerError`/`ConversationStoreError` travel as
|
|
288
|
-
* Schema defects and do not claim instance fidelity across Objects (plan §2.8).
|
|
289
|
-
*/
|
|
290
|
-
/** Ceiling for protocol diagnostic strings; matches `AdmissionIndeterminate.reason`. */
|
|
291
|
-
declare const MAX_PORT_DIAGNOSTIC_LENGTH = 4096;
|
|
292
|
-
/** Truncate a diagnostic string to the protocol's bounded diagnostic length. */
|
|
293
|
-
declare const boundPortDiagnostic: (value: string) => string;
|
|
294
|
-
declare const PortProtocolError_base: Schema.Class<PortProtocolError, Schema.TaggedStruct<"PortProtocolError", {
|
|
295
|
-
readonly message: Schema.String;
|
|
296
|
-
}>, import("effect/Cause").YieldableError>;
|
|
297
|
-
/**
|
|
298
|
-
* The envelope itself could not be honored: the receiving Object could not decode the
|
|
299
|
-
* request, or a response could not be encoded/decoded. It never carries port semantics —
|
|
300
|
-
* callers fold it into the operation's base error (`LedgerError`/`ConversationStoreError`),
|
|
301
|
-
* except `resolveAdmission`, which folds it into `AdmissionIndeterminate` because a
|
|
302
|
-
* non-answer is never proof of absence (SUB-031).
|
|
303
|
-
*/
|
|
304
|
-
declare class PortProtocolError extends PortProtocolError_base {}
|
|
305
|
-
declare const LedgerAdmitCall_base: Schema.Class<LedgerAdmitCall, Schema.TaggedStruct<"LedgerAdmit", {
|
|
306
|
-
readonly request: typeof AdmissionRequest;
|
|
307
|
-
}>, {}>;
|
|
308
|
-
/** Routed `SubmissionLedger.admit` — child establishment admits INTO the owning Object. */
|
|
309
|
-
declare class LedgerAdmitCall extends LedgerAdmitCall_base {}
|
|
310
|
-
declare const LedgerMarkReadyCall_base: Schema.Class<LedgerMarkReadyCall, Schema.TaggedStruct<"LedgerMarkReady", {
|
|
311
|
-
readonly request: typeof MarkReadyRequest;
|
|
312
|
-
}>, {}>;
|
|
313
|
-
/** Routed `SubmissionLedger.markReady` for a Submission owned by another Object. */
|
|
314
|
-
declare class LedgerMarkReadyCall extends LedgerMarkReadyCall_base {}
|
|
315
|
-
declare const LedgerLookupCall_base: Schema.Class<LedgerLookupCall, Schema.TaggedStruct<"LedgerLookup", {
|
|
316
|
-
readonly request: Schema.Union<readonly [typeof import("@effect-agent/session").SubmissionLookupById, typeof SubmissionLookupByKey]>;
|
|
317
|
-
}>, {}>;
|
|
318
|
-
/** Routed `SubmissionLedger.lookup` (by identity or scoped idempotency key). */
|
|
319
|
-
declare class LedgerLookupCall extends LedgerLookupCall_base {}
|
|
320
|
-
declare const LedgerResolveAdmissionCall_base: Schema.Class<LedgerResolveAdmissionCall, Schema.TaggedStruct<"LedgerResolveAdmission", {
|
|
321
|
-
readonly request: typeof SubmissionLookupByKey;
|
|
322
|
-
}>, {}>;
|
|
323
|
-
/** Routed `SubmissionLedger.resolveAdmission` — the SUB-031 tri-state authority call. */
|
|
324
|
-
declare class LedgerResolveAdmissionCall extends LedgerResolveAdmissionCall_base {}
|
|
325
|
-
declare const LedgerRequestAbortCall_base: Schema.Class<LedgerRequestAbortCall, Schema.TaggedStruct<"LedgerRequestAbort", {
|
|
326
|
-
readonly request: typeof AbortCommand;
|
|
327
|
-
}>, {}>;
|
|
328
|
-
/** Routed `SubmissionLedger.requestAbort` — abort propagation across Objects. */
|
|
329
|
-
declare class LedgerRequestAbortCall extends LedgerRequestAbortCall_base {}
|
|
330
|
-
declare const LedgerRecordChildSettledCall_base: Schema.Class<LedgerRecordChildSettledCall, Schema.TaggedStruct<"LedgerRecordChildSettled", {
|
|
331
|
-
readonly request: typeof ChildSettledNotification;
|
|
332
|
-
}>, {}>;
|
|
333
|
-
/** Routed `SubmissionLedger.recordChildSettled` — the child→parent durable notification. */
|
|
334
|
-
declare class LedgerRecordChildSettledCall extends LedgerRecordChildSettledCall_base {}
|
|
335
|
-
declare const StoreMaterializeCall_base: Schema.Class<StoreMaterializeCall, Schema.TaggedStruct<"StoreMaterialize", {
|
|
336
|
-
readonly request: typeof ConversationMaterialization;
|
|
337
|
-
}>, {}>;
|
|
338
|
-
/** Routed `ConversationStore.materialize` against the owning Object. */
|
|
339
|
-
declare class StoreMaterializeCall extends StoreMaterializeCall_base {}
|
|
340
|
-
declare const StoreAppendCall_base: Schema.Class<StoreAppendCall, Schema.TaggedStruct<"StoreAppend", {
|
|
341
|
-
readonly request: typeof FencedAppendRequest;
|
|
342
|
-
}>, {}>;
|
|
343
|
-
/** Routed `ConversationStore.append` against the owning Object. */
|
|
344
|
-
declare class StoreAppendCall extends StoreAppendCall_base {}
|
|
345
|
-
declare const StoreReadPageCall_base: Schema.Class<StoreReadPageCall, Schema.TaggedStruct<"StoreReadPage", {
|
|
346
|
-
readonly request: typeof ConversationRead;
|
|
347
|
-
}>, {}>;
|
|
348
|
-
/** Routed one-page `ConversationStore.read`; the page bound is the request's own `limit`. */
|
|
349
|
-
declare class StoreReadPageCall extends StoreReadPageCall_base {}
|
|
350
|
-
declare const StoreInspectTailCall_base: Schema.Class<StoreInspectTailCall, Schema.TaggedStruct<"StoreInspectTail", {
|
|
351
|
-
readonly request: typeof ConversationTailRequest;
|
|
352
|
-
}>, {}>;
|
|
353
|
-
/** Routed `ConversationStore.inspectTail` against the owning Object. */
|
|
354
|
-
declare class StoreInspectTailCall extends StoreInspectTailCall_base {}
|
|
355
|
-
declare const StoreExportCall_base: Schema.Class<StoreExportCall, Schema.TaggedStruct<"StoreExport", {
|
|
356
|
-
readonly request: typeof ConversationExportRequest;
|
|
357
|
-
}>, {}>;
|
|
358
|
-
/** Routed `ConversationStore.export` against the owning Object. */
|
|
359
|
-
declare class StoreExportCall extends StoreExportCall_base {}
|
|
360
|
-
/** Every request that may cross a Durable Object boundary — the CLOSED route-capable subset. */
|
|
361
|
-
declare const PortRequest: Schema.Union<readonly [typeof LedgerAdmitCall, typeof LedgerMarkReadyCall, typeof LedgerLookupCall, typeof LedgerResolveAdmissionCall, typeof LedgerRequestAbortCall, typeof LedgerRecordChildSettledCall, typeof StoreMaterializeCall, typeof StoreAppendCall, typeof StoreReadPageCall, typeof StoreInspectTailCall, typeof StoreExportCall]>;
|
|
362
|
-
type PortRequest = typeof PortRequest.Type;
|
|
363
|
-
/** The wire form of one port request (what a transport actually carries). */
|
|
364
|
-
type PortRequestEnvelope = typeof PortRequest.Encoded;
|
|
365
|
-
declare const LedgerAdmitResult_base: Schema.Class<LedgerAdmitResult, Schema.TaggedStruct<"LedgerAdmitResult", {
|
|
366
|
-
readonly result: typeof AdmissionResult;
|
|
367
|
-
}>, {}>;
|
|
368
|
-
declare class LedgerAdmitResult extends LedgerAdmitResult_base {}
|
|
369
|
-
declare const LedgerMarkReadyResult_base: Schema.Class<LedgerMarkReadyResult, Schema.TaggedStruct<"LedgerMarkReadyResult", {}>, {}>;
|
|
370
|
-
declare class LedgerMarkReadyResult extends LedgerMarkReadyResult_base {}
|
|
371
|
-
declare const LedgerLookupResult_base: Schema.Class<LedgerLookupResult, Schema.TaggedStruct<"LedgerLookupResult", {
|
|
372
|
-
readonly submission: Schema.optionalKey<typeof SubmissionSnapshot>;
|
|
373
|
-
}>, {}>;
|
|
374
|
-
/** `submission` is absent exactly when the lookup answered `Option.none`. */
|
|
375
|
-
declare class LedgerLookupResult extends LedgerLookupResult_base {}
|
|
376
|
-
declare const LedgerResolveAdmissionResult_base: Schema.Class<LedgerResolveAdmissionResult, Schema.TaggedStruct<"LedgerResolveAdmissionResult", {
|
|
377
|
-
readonly resolution: Schema.Union<readonly [typeof import("@effect-agent/session").AdmissionNotAdmitted, typeof import("@effect-agent/session").AdmissionAdmitted, typeof import("@effect-agent/session").AdmissionIndeterminate]>;
|
|
378
|
-
}>, {}>;
|
|
379
|
-
declare class LedgerResolveAdmissionResult extends LedgerResolveAdmissionResult_base {}
|
|
380
|
-
declare const LedgerRequestAbortResult_base: Schema.Class<LedgerRequestAbortResult, Schema.TaggedStruct<"LedgerRequestAbortResult", {
|
|
381
|
-
readonly intent: typeof AbortIntent;
|
|
382
|
-
}>, {}>;
|
|
383
|
-
declare class LedgerRequestAbortResult extends LedgerRequestAbortResult_base {}
|
|
384
|
-
declare const LedgerRecordChildSettledResult_base: Schema.Class<LedgerRecordChildSettledResult, Schema.TaggedStruct<"LedgerRecordChildSettledResult", {
|
|
385
|
-
readonly outcome: Schema.Literals<readonly ["woken", "still-waiting", "not-waiting"]>;
|
|
386
|
-
}>, {}>;
|
|
387
|
-
declare class LedgerRecordChildSettledResult extends LedgerRecordChildSettledResult_base {}
|
|
388
|
-
declare const StoreMaterializeResult_base: Schema.Class<StoreMaterializeResult, Schema.TaggedStruct<"StoreMaterializeResult", {}>, {}>;
|
|
389
|
-
declare class StoreMaterializeResult extends StoreMaterializeResult_base {}
|
|
390
|
-
declare const StoreAppendResult_base: Schema.Class<StoreAppendResult, Schema.TaggedStruct<"StoreAppendResult", {
|
|
391
|
-
readonly result: typeof AppendResult;
|
|
392
|
-
}>, {}>;
|
|
393
|
-
declare class StoreAppendResult extends StoreAppendResult_base {}
|
|
394
|
-
declare const StoreReadPageResult_base: Schema.Class<StoreReadPageResult, Schema.TaggedStruct<"StoreReadPageResult", {
|
|
395
|
-
readonly records: Schema.$Array<typeof CanonicalRecordEnvelope>;
|
|
396
|
-
}>, {}>;
|
|
397
|
-
/** One page of canonical records, bounded by the request's `limit` (≤ 1,024). */
|
|
398
|
-
declare class StoreReadPageResult extends StoreReadPageResult_base {}
|
|
399
|
-
declare const StoreInspectTailResult_base: Schema.Class<StoreInspectTailResult, Schema.TaggedStruct<"StoreInspectTailResult", {
|
|
400
|
-
readonly tail: typeof ConversationTail;
|
|
401
|
-
}>, {}>;
|
|
402
|
-
declare class StoreInspectTailResult extends StoreInspectTailResult_base {}
|
|
403
|
-
declare const StoreExportResult_base: Schema.Class<StoreExportResult, Schema.TaggedStruct<"StoreExportResult", {
|
|
404
|
-
readonly export: typeof ConversationExport;
|
|
405
|
-
}>, {}>;
|
|
406
|
-
declare class StoreExportResult extends StoreExportResult_base {}
|
|
407
|
-
/** Every successful routed result. Callers narrow by the tag their request implies. */
|
|
408
|
-
declare const PortResult: Schema.Union<readonly [typeof LedgerAdmitResult, typeof LedgerMarkReadyResult, typeof LedgerLookupResult, typeof LedgerResolveAdmissionResult, typeof LedgerRequestAbortResult, typeof LedgerRecordChildSettledResult, typeof StoreMaterializeResult, typeof StoreAppendResult, typeof StoreReadPageResult, typeof StoreInspectTailResult, typeof StoreExportResult]>;
|
|
409
|
-
type PortResult = typeof PortResult.Type;
|
|
410
|
-
/**
|
|
411
|
-
* Every typed failure a route-capable operation can produce on its owning Object, plus the
|
|
412
|
-
* protocol's own `PortProtocolError`. Members re-decode to the SAME tagged classes the
|
|
413
|
-
* session ports declare, so a routed caller observes identical error tags and fields.
|
|
414
|
-
*/
|
|
415
|
-
declare const PortFailure: Schema.Union<readonly [typeof AdmissionConflict, typeof SettlementConflict, typeof JoinedToHost, typeof LedgerError, typeof ConversationStoreError, typeof ConversationNotMaterialized, typeof AppendConflict, typeof FenceRejected, typeof PortProtocolError]>;
|
|
416
|
-
type PortFailure = typeof PortFailure.Type;
|
|
417
|
-
declare const PortSucceeded_base: Schema.Class<PortSucceeded, Schema.TaggedStruct<"PortSucceeded", {
|
|
418
|
-
readonly result: Schema.Union<readonly [typeof LedgerAdmitResult, typeof LedgerMarkReadyResult, typeof LedgerLookupResult, typeof LedgerResolveAdmissionResult, typeof LedgerRequestAbortResult, typeof LedgerRecordChildSettledResult, typeof StoreMaterializeResult, typeof StoreAppendResult, typeof StoreReadPageResult, typeof StoreInspectTailResult, typeof StoreExportResult]>;
|
|
419
|
-
}>, {}>;
|
|
420
|
-
/** The routed operation succeeded on its owning Object. */
|
|
421
|
-
declare class PortSucceeded extends PortSucceeded_base {}
|
|
422
|
-
declare const PortFailed_base: Schema.Class<PortFailed, Schema.TaggedStruct<"PortFailed", {
|
|
423
|
-
readonly failure: Schema.Union<readonly [typeof AdmissionConflict, typeof SettlementConflict, typeof JoinedToHost, typeof LedgerError, typeof ConversationStoreError, typeof ConversationNotMaterialized, typeof AppendConflict, typeof FenceRejected, typeof PortProtocolError]>;
|
|
424
|
-
}>, {}>;
|
|
425
|
-
/** The routed operation failed TYPED on its owning Object; the failure re-decodes verbatim. */
|
|
426
|
-
declare class PortFailed extends PortFailed_base {}
|
|
427
|
-
/** The uniform answer of one `portCall`: op-specific success or a re-decodable typed failure. */
|
|
428
|
-
declare const PortResponse: Schema.Union<readonly [typeof PortSucceeded, typeof PortFailed]>;
|
|
429
|
-
type PortResponse = typeof PortResponse.Type;
|
|
430
|
-
/** The wire form of one port response (what a transport actually carries). */
|
|
431
|
-
type PortResponseEnvelope = typeof PortResponse.Encoded;
|
|
432
|
-
declare const encodePortRequest: (input: LedgerAdmitCall | LedgerLookupCall | LedgerMarkReadyCall | LedgerRecordChildSettledCall | LedgerRequestAbortCall | LedgerResolveAdmissionCall | StoreAppendCall | StoreExportCall | StoreInspectTailCall | StoreMaterializeCall | StoreReadPageCall, options?: import("effect/SchemaAST").ParseOptions) => import("effect/Effect").Effect<{
|
|
433
|
-
readonly _tag: "LedgerAdmit";
|
|
434
|
-
readonly request: {
|
|
435
|
-
readonly conversationId: string;
|
|
436
|
-
readonly principal: string;
|
|
437
|
-
readonly idempotencyKey: string;
|
|
438
|
-
readonly agentId: string;
|
|
439
|
-
readonly agentDigests: {
|
|
440
|
-
readonly agent: string;
|
|
441
|
-
readonly model: string;
|
|
442
|
-
readonly tools: string;
|
|
443
|
-
};
|
|
444
|
-
readonly deploymentId: string;
|
|
445
|
-
readonly inputPayload: Schema.Json;
|
|
446
|
-
readonly inputDigest: string;
|
|
447
|
-
readonly parentLinkage?: {
|
|
448
|
-
readonly parentSubmissionId: string;
|
|
449
|
-
readonly parentToolCallId: string;
|
|
450
|
-
} | undefined;
|
|
451
|
-
};
|
|
452
|
-
} | {
|
|
453
|
-
readonly _tag: "LedgerMarkReady";
|
|
454
|
-
readonly request: {
|
|
455
|
-
readonly submissionId: string;
|
|
456
|
-
};
|
|
457
|
-
} | {
|
|
458
|
-
readonly _tag: "LedgerLookup";
|
|
459
|
-
readonly request: {
|
|
460
|
-
readonly _tag: "SubmissionLookupById";
|
|
461
|
-
readonly submissionId: string;
|
|
462
|
-
} | {
|
|
463
|
-
readonly _tag: "SubmissionLookupByKey";
|
|
464
|
-
readonly conversationId: string;
|
|
465
|
-
readonly principal: string;
|
|
466
|
-
readonly idempotencyKey: string;
|
|
467
|
-
};
|
|
468
|
-
} | {
|
|
469
|
-
readonly _tag: "LedgerResolveAdmission";
|
|
470
|
-
readonly request: {
|
|
471
|
-
readonly _tag: "SubmissionLookupByKey";
|
|
472
|
-
readonly conversationId: string;
|
|
473
|
-
readonly principal: string;
|
|
474
|
-
readonly idempotencyKey: string;
|
|
475
|
-
};
|
|
476
|
-
} | {
|
|
477
|
-
readonly _tag: "LedgerRequestAbort";
|
|
478
|
-
readonly request: {
|
|
479
|
-
readonly submissionId: string;
|
|
480
|
-
readonly author: string;
|
|
481
|
-
readonly reason: string;
|
|
482
|
-
};
|
|
483
|
-
} | {
|
|
484
|
-
readonly _tag: "LedgerRecordChildSettled";
|
|
485
|
-
readonly request: {
|
|
486
|
-
readonly parentSubmissionId: string;
|
|
487
|
-
readonly childSubmissionId: string;
|
|
488
|
-
};
|
|
489
|
-
} | {
|
|
490
|
-
readonly _tag: "StoreMaterialize";
|
|
491
|
-
readonly request: {
|
|
492
|
-
readonly conversationId: string;
|
|
493
|
-
readonly producerEpoch: number;
|
|
494
|
-
};
|
|
495
|
-
} | {
|
|
496
|
-
readonly _tag: "StoreAppend";
|
|
497
|
-
readonly request: {
|
|
498
|
-
readonly conversationId: string;
|
|
499
|
-
readonly batch: {
|
|
500
|
-
readonly batchId: string;
|
|
501
|
-
readonly producerId: string;
|
|
502
|
-
readonly records: readonly [{
|
|
503
|
-
readonly recordId: string;
|
|
504
|
-
readonly family: "conversation";
|
|
505
|
-
readonly schemaVersion: 1;
|
|
506
|
-
readonly createdAt: string;
|
|
507
|
-
readonly deploymentId: string;
|
|
508
|
-
readonly payload: {
|
|
509
|
-
readonly _tag: "AbortRequested";
|
|
510
|
-
readonly submissionId: string;
|
|
511
|
-
readonly author: string;
|
|
512
|
-
readonly reason: string;
|
|
513
|
-
} | {
|
|
514
|
-
readonly _tag: "ConversationCreated";
|
|
515
|
-
readonly agentId: string;
|
|
516
|
-
readonly definitions: {
|
|
517
|
-
readonly agent: string;
|
|
518
|
-
readonly model: string;
|
|
519
|
-
readonly tools: string;
|
|
520
|
-
};
|
|
521
|
-
} | {
|
|
522
|
-
readonly _tag: "UserInputRecorded";
|
|
523
|
-
readonly submissionId: string;
|
|
524
|
-
readonly kind: "follow-up" | "steering" | "user";
|
|
525
|
-
readonly runId?: string | undefined;
|
|
526
|
-
readonly input: Schema.Json;
|
|
527
|
-
} | {
|
|
528
|
-
readonly _tag: "ModelCompleted";
|
|
529
|
-
readonly runId: string;
|
|
530
|
-
readonly output: Schema.Json;
|
|
531
|
-
} | {
|
|
532
|
-
readonly _tag: "ModelResponseRecorded";
|
|
533
|
-
readonly runId: string;
|
|
534
|
-
readonly turnId: string;
|
|
535
|
-
readonly turn: number;
|
|
536
|
-
readonly messages: Schema.Json;
|
|
537
|
-
readonly messagesDigest: string;
|
|
538
|
-
readonly inputTokens?: number | undefined;
|
|
539
|
-
readonly outputTokens?: number | undefined;
|
|
540
|
-
readonly costMicrousd?: number | undefined;
|
|
541
|
-
} | {
|
|
542
|
-
readonly _tag: "ToolCallPrepared";
|
|
543
|
-
readonly runId: string;
|
|
544
|
-
readonly turnId: string;
|
|
545
|
-
readonly turn: number;
|
|
546
|
-
readonly toolCallId: string;
|
|
547
|
-
readonly toolName: string;
|
|
548
|
-
readonly parameters: Schema.Json;
|
|
549
|
-
readonly parametersDigest: string;
|
|
550
|
-
} | {
|
|
551
|
-
readonly _tag: "ToolCallSettled";
|
|
552
|
-
readonly runId: string;
|
|
553
|
-
readonly toolCallId: string;
|
|
554
|
-
readonly toolName: string;
|
|
555
|
-
readonly result: Schema.Json;
|
|
556
|
-
readonly isFailure: boolean;
|
|
557
|
-
} | {
|
|
558
|
-
readonly _tag: "ToolCallUnknown";
|
|
559
|
-
readonly runId: string;
|
|
560
|
-
readonly turn: number;
|
|
561
|
-
readonly toolCallId: string;
|
|
562
|
-
readonly toolName: string;
|
|
563
|
-
readonly reason: string;
|
|
564
|
-
} | {
|
|
565
|
-
readonly _tag: "ToolCallResolved";
|
|
566
|
-
readonly runId: string;
|
|
567
|
-
readonly toolCallId: string;
|
|
568
|
-
readonly resolution: "completed-with-result" | "failed-with-error" | "never-started" | "safe-retry";
|
|
569
|
-
readonly author: string;
|
|
570
|
-
readonly reason: string;
|
|
571
|
-
} | {
|
|
572
|
-
readonly _tag: "ToolStepSettled";
|
|
573
|
-
readonly runId: string;
|
|
574
|
-
readonly toolCallId: string;
|
|
575
|
-
readonly stepName: string;
|
|
576
|
-
readonly output: Schema.Json;
|
|
577
|
-
readonly outputDigest: string;
|
|
578
|
-
} | {
|
|
579
|
-
readonly _tag: "ToolApprovalRequested";
|
|
580
|
-
readonly runId: string;
|
|
581
|
-
readonly turnId: string;
|
|
582
|
-
readonly turn: number;
|
|
583
|
-
readonly toolCallId: string;
|
|
584
|
-
readonly toolName: string;
|
|
585
|
-
readonly parametersDigest: string;
|
|
586
|
-
} | {
|
|
587
|
-
readonly _tag: "ToolApprovalDecided";
|
|
588
|
-
readonly runId: string;
|
|
589
|
-
readonly turn: number;
|
|
590
|
-
readonly toolCallId: string;
|
|
591
|
-
readonly decision: "approved" | "denied";
|
|
592
|
-
readonly resolver: string;
|
|
593
|
-
readonly reason: string;
|
|
594
|
-
} | {
|
|
595
|
-
readonly _tag: "ModelResponseInterrupted";
|
|
596
|
-
readonly runId: string;
|
|
597
|
-
readonly supersededEpoch: number;
|
|
598
|
-
readonly attemptId: string;
|
|
599
|
-
readonly reason: string;
|
|
600
|
-
} | {
|
|
601
|
-
readonly _tag: "CompactionCreated";
|
|
602
|
-
readonly runId: string;
|
|
603
|
-
readonly turn: number;
|
|
604
|
-
readonly kind: "clear-tool-results" | "summarize";
|
|
605
|
-
readonly coversThrough: number;
|
|
606
|
-
readonly summary?: string | undefined;
|
|
607
|
-
} | {
|
|
608
|
-
readonly _tag: "RunFailed";
|
|
609
|
-
readonly runId: string;
|
|
610
|
-
readonly failure: Schema.Json;
|
|
611
|
-
} | {
|
|
612
|
-
readonly _tag: "RunCompleted";
|
|
613
|
-
readonly runId: string;
|
|
614
|
-
readonly output: Schema.Json;
|
|
615
|
-
} | {
|
|
616
|
-
readonly _tag: "SubmissionSettled";
|
|
617
|
-
readonly submissionId: string;
|
|
618
|
-
readonly settlementId: string;
|
|
619
|
-
readonly receiptId: string;
|
|
620
|
-
readonly outcome: "aborted" | "completed" | "failed";
|
|
621
|
-
readonly runId?: string | undefined;
|
|
622
|
-
readonly result?: Schema.Json | undefined;
|
|
623
|
-
readonly finishReason?: "budget-exhausted" | undefined;
|
|
624
|
-
} | {
|
|
625
|
-
readonly _tag: "SubagentRequested";
|
|
626
|
-
readonly runId: string;
|
|
627
|
-
readonly turnId: string;
|
|
628
|
-
readonly turn: number;
|
|
629
|
-
readonly toolCallId: string;
|
|
630
|
-
readonly delegationId: string;
|
|
631
|
-
readonly targetAgentId: string;
|
|
632
|
-
readonly targetDigests: {
|
|
633
|
-
readonly agent: string;
|
|
634
|
-
readonly model: string;
|
|
635
|
-
readonly tools: string;
|
|
636
|
-
};
|
|
637
|
-
readonly childInput: Schema.Json;
|
|
638
|
-
readonly childInputDigest: string;
|
|
639
|
-
readonly grantDigest: string;
|
|
640
|
-
readonly reservationId: string;
|
|
641
|
-
readonly reservationDigest: string;
|
|
642
|
-
readonly childConversationId: string;
|
|
643
|
-
readonly childPrincipal: string;
|
|
644
|
-
readonly childIdempotencyKey: string;
|
|
645
|
-
} | {
|
|
646
|
-
readonly _tag: "SubagentStarted";
|
|
647
|
-
readonly runId: string;
|
|
648
|
-
readonly toolCallId: string;
|
|
649
|
-
readonly childConversationId: string;
|
|
650
|
-
readonly childSubmissionId: string;
|
|
651
|
-
readonly childReceiptId: string;
|
|
652
|
-
readonly childRunId: string;
|
|
653
|
-
} | {
|
|
654
|
-
readonly _tag: "SubagentJoined";
|
|
655
|
-
readonly runId: string;
|
|
656
|
-
readonly toolCallId: string;
|
|
657
|
-
readonly childSubmissionId: string;
|
|
658
|
-
readonly childSettlementId: string;
|
|
659
|
-
readonly childOutcome: "aborted" | "completed" | "failed";
|
|
660
|
-
readonly childResultDigest: string;
|
|
661
|
-
readonly projectedResultDigest: string;
|
|
662
|
-
readonly usageSummary: Schema.Json;
|
|
663
|
-
readonly reservationId: string;
|
|
664
|
-
readonly finalAccounting: Schema.Json;
|
|
665
|
-
} | {
|
|
666
|
-
readonly _tag: "SubagentLineageRecorded";
|
|
667
|
-
readonly parentLink: {
|
|
668
|
-
readonly delegationId: string;
|
|
669
|
-
readonly parentAgentId: string;
|
|
670
|
-
readonly parentConversationId: string;
|
|
671
|
-
readonly parentRunId: string;
|
|
672
|
-
readonly parentToolCallId: string;
|
|
673
|
-
readonly depth: number;
|
|
674
|
-
};
|
|
675
|
-
readonly parentSubmissionId: string;
|
|
676
|
-
readonly childDefinitionDigests: {
|
|
677
|
-
readonly agent: string;
|
|
678
|
-
readonly model: string;
|
|
679
|
-
readonly tools: string;
|
|
680
|
-
};
|
|
681
|
-
readonly childInputDigest: string;
|
|
682
|
-
readonly grantDigest: string;
|
|
683
|
-
} | {
|
|
684
|
-
readonly _tag: "RepairAnnotated";
|
|
685
|
-
readonly reason: string;
|
|
686
|
-
readonly details: Schema.Json;
|
|
687
|
-
};
|
|
688
|
-
}, ...{
|
|
689
|
-
readonly recordId: string;
|
|
690
|
-
readonly family: "conversation";
|
|
691
|
-
readonly schemaVersion: 1;
|
|
692
|
-
readonly createdAt: string;
|
|
693
|
-
readonly deploymentId: string;
|
|
694
|
-
readonly payload: {
|
|
695
|
-
readonly _tag: "AbortRequested";
|
|
696
|
-
readonly submissionId: string;
|
|
697
|
-
readonly author: string;
|
|
698
|
-
readonly reason: string;
|
|
699
|
-
} | {
|
|
700
|
-
readonly _tag: "ConversationCreated";
|
|
701
|
-
readonly agentId: string;
|
|
702
|
-
readonly definitions: {
|
|
703
|
-
readonly agent: string;
|
|
704
|
-
readonly model: string;
|
|
705
|
-
readonly tools: string;
|
|
706
|
-
};
|
|
707
|
-
} | {
|
|
708
|
-
readonly _tag: "UserInputRecorded";
|
|
709
|
-
readonly submissionId: string;
|
|
710
|
-
readonly kind: "follow-up" | "steering" | "user";
|
|
711
|
-
readonly runId?: string | undefined;
|
|
712
|
-
readonly input: Schema.Json;
|
|
713
|
-
} | {
|
|
714
|
-
readonly _tag: "ModelCompleted";
|
|
715
|
-
readonly runId: string;
|
|
716
|
-
readonly output: Schema.Json;
|
|
717
|
-
} | {
|
|
718
|
-
readonly _tag: "ModelResponseRecorded";
|
|
719
|
-
readonly runId: string;
|
|
720
|
-
readonly turnId: string;
|
|
721
|
-
readonly turn: number;
|
|
722
|
-
readonly messages: Schema.Json;
|
|
723
|
-
readonly messagesDigest: string;
|
|
724
|
-
readonly inputTokens?: number | undefined;
|
|
725
|
-
readonly outputTokens?: number | undefined;
|
|
726
|
-
readonly costMicrousd?: number | undefined;
|
|
727
|
-
} | {
|
|
728
|
-
readonly _tag: "ToolCallPrepared";
|
|
729
|
-
readonly runId: string;
|
|
730
|
-
readonly turnId: string;
|
|
731
|
-
readonly turn: number;
|
|
732
|
-
readonly toolCallId: string;
|
|
733
|
-
readonly toolName: string;
|
|
734
|
-
readonly parameters: Schema.Json;
|
|
735
|
-
readonly parametersDigest: string;
|
|
736
|
-
} | {
|
|
737
|
-
readonly _tag: "ToolCallSettled";
|
|
738
|
-
readonly runId: string;
|
|
739
|
-
readonly toolCallId: string;
|
|
740
|
-
readonly toolName: string;
|
|
741
|
-
readonly result: Schema.Json;
|
|
742
|
-
readonly isFailure: boolean;
|
|
743
|
-
} | {
|
|
744
|
-
readonly _tag: "ToolCallUnknown";
|
|
745
|
-
readonly runId: string;
|
|
746
|
-
readonly turn: number;
|
|
747
|
-
readonly toolCallId: string;
|
|
748
|
-
readonly toolName: string;
|
|
749
|
-
readonly reason: string;
|
|
750
|
-
} | {
|
|
751
|
-
readonly _tag: "ToolCallResolved";
|
|
752
|
-
readonly runId: string;
|
|
753
|
-
readonly toolCallId: string;
|
|
754
|
-
readonly resolution: "completed-with-result" | "failed-with-error" | "never-started" | "safe-retry";
|
|
755
|
-
readonly author: string;
|
|
756
|
-
readonly reason: string;
|
|
757
|
-
} | {
|
|
758
|
-
readonly _tag: "ToolStepSettled";
|
|
759
|
-
readonly runId: string;
|
|
760
|
-
readonly toolCallId: string;
|
|
761
|
-
readonly stepName: string;
|
|
762
|
-
readonly output: Schema.Json;
|
|
763
|
-
readonly outputDigest: string;
|
|
764
|
-
} | {
|
|
765
|
-
readonly _tag: "ToolApprovalRequested";
|
|
766
|
-
readonly runId: string;
|
|
767
|
-
readonly turnId: string;
|
|
768
|
-
readonly turn: number;
|
|
769
|
-
readonly toolCallId: string;
|
|
770
|
-
readonly toolName: string;
|
|
771
|
-
readonly parametersDigest: string;
|
|
772
|
-
} | {
|
|
773
|
-
readonly _tag: "ToolApprovalDecided";
|
|
774
|
-
readonly runId: string;
|
|
775
|
-
readonly turn: number;
|
|
776
|
-
readonly toolCallId: string;
|
|
777
|
-
readonly decision: "approved" | "denied";
|
|
778
|
-
readonly resolver: string;
|
|
779
|
-
readonly reason: string;
|
|
780
|
-
} | {
|
|
781
|
-
readonly _tag: "ModelResponseInterrupted";
|
|
782
|
-
readonly runId: string;
|
|
783
|
-
readonly supersededEpoch: number;
|
|
784
|
-
readonly attemptId: string;
|
|
785
|
-
readonly reason: string;
|
|
786
|
-
} | {
|
|
787
|
-
readonly _tag: "CompactionCreated";
|
|
788
|
-
readonly runId: string;
|
|
789
|
-
readonly turn: number;
|
|
790
|
-
readonly kind: "clear-tool-results" | "summarize";
|
|
791
|
-
readonly coversThrough: number;
|
|
792
|
-
readonly summary?: string | undefined;
|
|
793
|
-
} | {
|
|
794
|
-
readonly _tag: "RunFailed";
|
|
795
|
-
readonly runId: string;
|
|
796
|
-
readonly failure: Schema.Json;
|
|
797
|
-
} | {
|
|
798
|
-
readonly _tag: "RunCompleted";
|
|
799
|
-
readonly runId: string;
|
|
800
|
-
readonly output: Schema.Json;
|
|
801
|
-
} | {
|
|
802
|
-
readonly _tag: "SubmissionSettled";
|
|
803
|
-
readonly submissionId: string;
|
|
804
|
-
readonly settlementId: string;
|
|
805
|
-
readonly receiptId: string;
|
|
806
|
-
readonly outcome: "aborted" | "completed" | "failed";
|
|
807
|
-
readonly runId?: string | undefined;
|
|
808
|
-
readonly result?: Schema.Json | undefined;
|
|
809
|
-
readonly finishReason?: "budget-exhausted" | undefined;
|
|
810
|
-
} | {
|
|
811
|
-
readonly _tag: "SubagentRequested";
|
|
812
|
-
readonly runId: string;
|
|
813
|
-
readonly turnId: string;
|
|
814
|
-
readonly turn: number;
|
|
815
|
-
readonly toolCallId: string;
|
|
816
|
-
readonly delegationId: string;
|
|
817
|
-
readonly targetAgentId: string;
|
|
818
|
-
readonly targetDigests: {
|
|
819
|
-
readonly agent: string;
|
|
820
|
-
readonly model: string;
|
|
821
|
-
readonly tools: string;
|
|
822
|
-
};
|
|
823
|
-
readonly childInput: Schema.Json;
|
|
824
|
-
readonly childInputDigest: string;
|
|
825
|
-
readonly grantDigest: string;
|
|
826
|
-
readonly reservationId: string;
|
|
827
|
-
readonly reservationDigest: string;
|
|
828
|
-
readonly childConversationId: string;
|
|
829
|
-
readonly childPrincipal: string;
|
|
830
|
-
readonly childIdempotencyKey: string;
|
|
831
|
-
} | {
|
|
832
|
-
readonly _tag: "SubagentStarted";
|
|
833
|
-
readonly runId: string;
|
|
834
|
-
readonly toolCallId: string;
|
|
835
|
-
readonly childConversationId: string;
|
|
836
|
-
readonly childSubmissionId: string;
|
|
837
|
-
readonly childReceiptId: string;
|
|
838
|
-
readonly childRunId: string;
|
|
839
|
-
} | {
|
|
840
|
-
readonly _tag: "SubagentJoined";
|
|
841
|
-
readonly runId: string;
|
|
842
|
-
readonly toolCallId: string;
|
|
843
|
-
readonly childSubmissionId: string;
|
|
844
|
-
readonly childSettlementId: string;
|
|
845
|
-
readonly childOutcome: "aborted" | "completed" | "failed";
|
|
846
|
-
readonly childResultDigest: string;
|
|
847
|
-
readonly projectedResultDigest: string;
|
|
848
|
-
readonly usageSummary: Schema.Json;
|
|
849
|
-
readonly reservationId: string;
|
|
850
|
-
readonly finalAccounting: Schema.Json;
|
|
851
|
-
} | {
|
|
852
|
-
readonly _tag: "SubagentLineageRecorded";
|
|
853
|
-
readonly parentLink: {
|
|
854
|
-
readonly delegationId: string;
|
|
855
|
-
readonly parentAgentId: string;
|
|
856
|
-
readonly parentConversationId: string;
|
|
857
|
-
readonly parentRunId: string;
|
|
858
|
-
readonly parentToolCallId: string;
|
|
859
|
-
readonly depth: number;
|
|
860
|
-
};
|
|
861
|
-
readonly parentSubmissionId: string;
|
|
862
|
-
readonly childDefinitionDigests: {
|
|
863
|
-
readonly agent: string;
|
|
864
|
-
readonly model: string;
|
|
865
|
-
readonly tools: string;
|
|
866
|
-
};
|
|
867
|
-
readonly childInputDigest: string;
|
|
868
|
-
readonly grantDigest: string;
|
|
869
|
-
} | {
|
|
870
|
-
readonly _tag: "RepairAnnotated";
|
|
871
|
-
readonly reason: string;
|
|
872
|
-
readonly details: Schema.Json;
|
|
873
|
-
};
|
|
874
|
-
}[]];
|
|
875
|
-
};
|
|
876
|
-
readonly expectedTailSequence: number;
|
|
877
|
-
readonly expectedTailDigest: string;
|
|
878
|
-
readonly producerEpoch: number;
|
|
879
|
-
};
|
|
880
|
-
} | {
|
|
881
|
-
readonly _tag: "StoreReadPage";
|
|
882
|
-
readonly request: {
|
|
883
|
-
readonly conversationId: string;
|
|
884
|
-
readonly afterSequence?: number | undefined;
|
|
885
|
-
readonly limit: number;
|
|
886
|
-
};
|
|
887
|
-
} | {
|
|
888
|
-
readonly _tag: "StoreInspectTail";
|
|
889
|
-
readonly request: {
|
|
890
|
-
readonly conversationId: string;
|
|
891
|
-
};
|
|
892
|
-
} | {
|
|
893
|
-
readonly _tag: "StoreExport";
|
|
894
|
-
readonly request: {
|
|
895
|
-
readonly conversationId: string;
|
|
896
|
-
};
|
|
897
|
-
}, Schema.SchemaError, never>;
|
|
898
|
-
declare const decodePortRequest: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => import("effect/Effect").Effect<LedgerAdmitCall | LedgerLookupCall | LedgerMarkReadyCall | LedgerRecordChildSettledCall | LedgerRequestAbortCall | LedgerResolveAdmissionCall | StoreAppendCall | StoreExportCall | StoreInspectTailCall | StoreMaterializeCall | StoreReadPageCall, Schema.SchemaError, never>;
|
|
899
|
-
declare const encodePortResponse: (input: PortFailed | PortSucceeded, options?: import("effect/SchemaAST").ParseOptions) => import("effect/Effect").Effect<{
|
|
900
|
-
readonly _tag: "PortSucceeded";
|
|
901
|
-
readonly result: {
|
|
902
|
-
readonly _tag: "LedgerAdmitResult";
|
|
903
|
-
readonly result: {
|
|
904
|
-
readonly submissionId: string;
|
|
905
|
-
readonly receiptId: string;
|
|
906
|
-
readonly queueSequence: number;
|
|
907
|
-
readonly state: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "running" | "settled" | "suspended" | "terminalizing" | "unknown";
|
|
908
|
-
readonly replayed: boolean;
|
|
909
|
-
};
|
|
910
|
-
} | {
|
|
911
|
-
readonly _tag: "LedgerMarkReadyResult";
|
|
912
|
-
} | {
|
|
913
|
-
readonly _tag: "LedgerLookupResult";
|
|
914
|
-
readonly submission?: {
|
|
915
|
-
readonly submissionId: string;
|
|
916
|
-
readonly conversationId: string;
|
|
917
|
-
readonly queueSequence: number;
|
|
918
|
-
readonly principal: string;
|
|
919
|
-
readonly idempotencyKey: string;
|
|
920
|
-
readonly agentId: string;
|
|
921
|
-
readonly agentDigests: {
|
|
922
|
-
readonly agent: string;
|
|
923
|
-
readonly model: string;
|
|
924
|
-
readonly tools: string;
|
|
925
|
-
};
|
|
926
|
-
readonly deploymentId: string;
|
|
927
|
-
readonly inputPayload: Schema.Json;
|
|
928
|
-
readonly inputDigest: string;
|
|
929
|
-
readonly receiptId: string;
|
|
930
|
-
readonly state: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "running" | "settled" | "suspended" | "terminalizing" | "unknown";
|
|
931
|
-
readonly settledOutcome?: "aborted" | "completed" | "failed" | undefined;
|
|
932
|
-
readonly createdAt: string;
|
|
933
|
-
readonly readyAt?: string | undefined;
|
|
934
|
-
readonly parentLinkage?: {
|
|
935
|
-
readonly parentSubmissionId: string;
|
|
936
|
-
readonly parentToolCallId: string;
|
|
937
|
-
} | undefined;
|
|
938
|
-
} | undefined;
|
|
939
|
-
} | {
|
|
940
|
-
readonly _tag: "LedgerResolveAdmissionResult";
|
|
941
|
-
readonly resolution: {
|
|
942
|
-
readonly _tag: "NotAdmitted";
|
|
943
|
-
} | {
|
|
944
|
-
readonly _tag: "Admitted";
|
|
945
|
-
readonly submission: {
|
|
946
|
-
readonly submissionId: string;
|
|
947
|
-
readonly conversationId: string;
|
|
948
|
-
readonly queueSequence: number;
|
|
949
|
-
readonly principal: string;
|
|
950
|
-
readonly idempotencyKey: string;
|
|
951
|
-
readonly agentId: string;
|
|
952
|
-
readonly agentDigests: {
|
|
953
|
-
readonly agent: string;
|
|
954
|
-
readonly model: string;
|
|
955
|
-
readonly tools: string;
|
|
956
|
-
};
|
|
957
|
-
readonly deploymentId: string;
|
|
958
|
-
readonly inputPayload: Schema.Json;
|
|
959
|
-
readonly inputDigest: string;
|
|
960
|
-
readonly receiptId: string;
|
|
961
|
-
readonly state: "admitted" | "input-applied" | "joined" | "joining" | "ready" | "running" | "settled" | "suspended" | "terminalizing" | "unknown";
|
|
962
|
-
readonly settledOutcome?: "aborted" | "completed" | "failed" | undefined;
|
|
963
|
-
readonly createdAt: string;
|
|
964
|
-
readonly readyAt?: string | undefined;
|
|
965
|
-
readonly parentLinkage?: {
|
|
966
|
-
readonly parentSubmissionId: string;
|
|
967
|
-
readonly parentToolCallId: string;
|
|
968
|
-
} | undefined;
|
|
969
|
-
};
|
|
970
|
-
} | {
|
|
971
|
-
readonly _tag: "Indeterminate";
|
|
972
|
-
readonly reason: string;
|
|
973
|
-
};
|
|
974
|
-
} | {
|
|
975
|
-
readonly _tag: "LedgerRequestAbortResult";
|
|
976
|
-
readonly intent: {
|
|
977
|
-
readonly submissionId: string;
|
|
978
|
-
readonly author: string;
|
|
979
|
-
readonly reason: string;
|
|
980
|
-
readonly requestedAt: string;
|
|
981
|
-
readonly canonicalRecordId?: string | undefined;
|
|
982
|
-
};
|
|
983
|
-
} | {
|
|
984
|
-
readonly _tag: "LedgerRecordChildSettledResult";
|
|
985
|
-
readonly outcome: "not-waiting" | "still-waiting" | "woken";
|
|
986
|
-
} | {
|
|
987
|
-
readonly _tag: "StoreMaterializeResult";
|
|
988
|
-
} | {
|
|
989
|
-
readonly _tag: "StoreAppendResult";
|
|
990
|
-
readonly result: {
|
|
991
|
-
readonly firstSequence: number;
|
|
992
|
-
readonly lastSequence: number;
|
|
993
|
-
readonly tailDigest: string;
|
|
994
|
-
readonly replayed: boolean;
|
|
995
|
-
};
|
|
996
|
-
} | {
|
|
997
|
-
readonly _tag: "StoreReadPageResult";
|
|
998
|
-
readonly records: readonly {
|
|
999
|
-
readonly conversationId: string;
|
|
1000
|
-
readonly batchId: string;
|
|
1001
|
-
readonly sequence: number;
|
|
1002
|
-
readonly offset: string;
|
|
1003
|
-
readonly record: {
|
|
1004
|
-
readonly recordId: string;
|
|
1005
|
-
readonly family: "conversation";
|
|
1006
|
-
readonly schemaVersion: 1;
|
|
1007
|
-
readonly createdAt: string;
|
|
1008
|
-
readonly deploymentId: string;
|
|
1009
|
-
readonly payload: {
|
|
1010
|
-
readonly _tag: "AbortRequested";
|
|
1011
|
-
readonly submissionId: string;
|
|
1012
|
-
readonly author: string;
|
|
1013
|
-
readonly reason: string;
|
|
1014
|
-
} | {
|
|
1015
|
-
readonly _tag: "ConversationCreated";
|
|
1016
|
-
readonly agentId: string;
|
|
1017
|
-
readonly definitions: {
|
|
1018
|
-
readonly agent: string;
|
|
1019
|
-
readonly model: string;
|
|
1020
|
-
readonly tools: string;
|
|
1021
|
-
};
|
|
1022
|
-
} | {
|
|
1023
|
-
readonly _tag: "UserInputRecorded";
|
|
1024
|
-
readonly submissionId: string;
|
|
1025
|
-
readonly kind: "follow-up" | "steering" | "user";
|
|
1026
|
-
readonly runId?: string | undefined;
|
|
1027
|
-
readonly input: Schema.Json;
|
|
1028
|
-
} | {
|
|
1029
|
-
readonly _tag: "ModelCompleted";
|
|
1030
|
-
readonly runId: string;
|
|
1031
|
-
readonly output: Schema.Json;
|
|
1032
|
-
} | {
|
|
1033
|
-
readonly _tag: "ModelResponseRecorded";
|
|
1034
|
-
readonly runId: string;
|
|
1035
|
-
readonly turnId: string;
|
|
1036
|
-
readonly turn: number;
|
|
1037
|
-
readonly messages: Schema.Json;
|
|
1038
|
-
readonly messagesDigest: string;
|
|
1039
|
-
readonly inputTokens?: number | undefined;
|
|
1040
|
-
readonly outputTokens?: number | undefined;
|
|
1041
|
-
readonly costMicrousd?: number | undefined;
|
|
1042
|
-
} | {
|
|
1043
|
-
readonly _tag: "ToolCallPrepared";
|
|
1044
|
-
readonly runId: string;
|
|
1045
|
-
readonly turnId: string;
|
|
1046
|
-
readonly turn: number;
|
|
1047
|
-
readonly toolCallId: string;
|
|
1048
|
-
readonly toolName: string;
|
|
1049
|
-
readonly parameters: Schema.Json;
|
|
1050
|
-
readonly parametersDigest: string;
|
|
1051
|
-
} | {
|
|
1052
|
-
readonly _tag: "ToolCallSettled";
|
|
1053
|
-
readonly runId: string;
|
|
1054
|
-
readonly toolCallId: string;
|
|
1055
|
-
readonly toolName: string;
|
|
1056
|
-
readonly result: Schema.Json;
|
|
1057
|
-
readonly isFailure: boolean;
|
|
1058
|
-
} | {
|
|
1059
|
-
readonly _tag: "ToolCallUnknown";
|
|
1060
|
-
readonly runId: string;
|
|
1061
|
-
readonly turn: number;
|
|
1062
|
-
readonly toolCallId: string;
|
|
1063
|
-
readonly toolName: string;
|
|
1064
|
-
readonly reason: string;
|
|
1065
|
-
} | {
|
|
1066
|
-
readonly _tag: "ToolCallResolved";
|
|
1067
|
-
readonly runId: string;
|
|
1068
|
-
readonly toolCallId: string;
|
|
1069
|
-
readonly resolution: "completed-with-result" | "failed-with-error" | "never-started" | "safe-retry";
|
|
1070
|
-
readonly author: string;
|
|
1071
|
-
readonly reason: string;
|
|
1072
|
-
} | {
|
|
1073
|
-
readonly _tag: "ToolStepSettled";
|
|
1074
|
-
readonly runId: string;
|
|
1075
|
-
readonly toolCallId: string;
|
|
1076
|
-
readonly stepName: string;
|
|
1077
|
-
readonly output: Schema.Json;
|
|
1078
|
-
readonly outputDigest: string;
|
|
1079
|
-
} | {
|
|
1080
|
-
readonly _tag: "ToolApprovalRequested";
|
|
1081
|
-
readonly runId: string;
|
|
1082
|
-
readonly turnId: string;
|
|
1083
|
-
readonly turn: number;
|
|
1084
|
-
readonly toolCallId: string;
|
|
1085
|
-
readonly toolName: string;
|
|
1086
|
-
readonly parametersDigest: string;
|
|
1087
|
-
} | {
|
|
1088
|
-
readonly _tag: "ToolApprovalDecided";
|
|
1089
|
-
readonly runId: string;
|
|
1090
|
-
readonly turn: number;
|
|
1091
|
-
readonly toolCallId: string;
|
|
1092
|
-
readonly decision: "approved" | "denied";
|
|
1093
|
-
readonly resolver: string;
|
|
1094
|
-
readonly reason: string;
|
|
1095
|
-
} | {
|
|
1096
|
-
readonly _tag: "ModelResponseInterrupted";
|
|
1097
|
-
readonly runId: string;
|
|
1098
|
-
readonly supersededEpoch: number;
|
|
1099
|
-
readonly attemptId: string;
|
|
1100
|
-
readonly reason: string;
|
|
1101
|
-
} | {
|
|
1102
|
-
readonly _tag: "CompactionCreated";
|
|
1103
|
-
readonly runId: string;
|
|
1104
|
-
readonly turn: number;
|
|
1105
|
-
readonly kind: "clear-tool-results" | "summarize";
|
|
1106
|
-
readonly coversThrough: number;
|
|
1107
|
-
readonly summary?: string | undefined;
|
|
1108
|
-
} | {
|
|
1109
|
-
readonly _tag: "RunFailed";
|
|
1110
|
-
readonly runId: string;
|
|
1111
|
-
readonly failure: Schema.Json;
|
|
1112
|
-
} | {
|
|
1113
|
-
readonly _tag: "RunCompleted";
|
|
1114
|
-
readonly runId: string;
|
|
1115
|
-
readonly output: Schema.Json;
|
|
1116
|
-
} | {
|
|
1117
|
-
readonly _tag: "SubmissionSettled";
|
|
1118
|
-
readonly submissionId: string;
|
|
1119
|
-
readonly settlementId: string;
|
|
1120
|
-
readonly receiptId: string;
|
|
1121
|
-
readonly outcome: "aborted" | "completed" | "failed";
|
|
1122
|
-
readonly runId?: string | undefined;
|
|
1123
|
-
readonly result?: Schema.Json | undefined;
|
|
1124
|
-
readonly finishReason?: "budget-exhausted" | undefined;
|
|
1125
|
-
} | {
|
|
1126
|
-
readonly _tag: "SubagentRequested";
|
|
1127
|
-
readonly runId: string;
|
|
1128
|
-
readonly turnId: string;
|
|
1129
|
-
readonly turn: number;
|
|
1130
|
-
readonly toolCallId: string;
|
|
1131
|
-
readonly delegationId: string;
|
|
1132
|
-
readonly targetAgentId: string;
|
|
1133
|
-
readonly targetDigests: {
|
|
1134
|
-
readonly agent: string;
|
|
1135
|
-
readonly model: string;
|
|
1136
|
-
readonly tools: string;
|
|
1137
|
-
};
|
|
1138
|
-
readonly childInput: Schema.Json;
|
|
1139
|
-
readonly childInputDigest: string;
|
|
1140
|
-
readonly grantDigest: string;
|
|
1141
|
-
readonly reservationId: string;
|
|
1142
|
-
readonly reservationDigest: string;
|
|
1143
|
-
readonly childConversationId: string;
|
|
1144
|
-
readonly childPrincipal: string;
|
|
1145
|
-
readonly childIdempotencyKey: string;
|
|
1146
|
-
} | {
|
|
1147
|
-
readonly _tag: "SubagentStarted";
|
|
1148
|
-
readonly runId: string;
|
|
1149
|
-
readonly toolCallId: string;
|
|
1150
|
-
readonly childConversationId: string;
|
|
1151
|
-
readonly childSubmissionId: string;
|
|
1152
|
-
readonly childReceiptId: string;
|
|
1153
|
-
readonly childRunId: string;
|
|
1154
|
-
} | {
|
|
1155
|
-
readonly _tag: "SubagentJoined";
|
|
1156
|
-
readonly runId: string;
|
|
1157
|
-
readonly toolCallId: string;
|
|
1158
|
-
readonly childSubmissionId: string;
|
|
1159
|
-
readonly childSettlementId: string;
|
|
1160
|
-
readonly childOutcome: "aborted" | "completed" | "failed";
|
|
1161
|
-
readonly childResultDigest: string;
|
|
1162
|
-
readonly projectedResultDigest: string;
|
|
1163
|
-
readonly usageSummary: Schema.Json;
|
|
1164
|
-
readonly reservationId: string;
|
|
1165
|
-
readonly finalAccounting: Schema.Json;
|
|
1166
|
-
} | {
|
|
1167
|
-
readonly _tag: "SubagentLineageRecorded";
|
|
1168
|
-
readonly parentLink: {
|
|
1169
|
-
readonly delegationId: string;
|
|
1170
|
-
readonly parentAgentId: string;
|
|
1171
|
-
readonly parentConversationId: string;
|
|
1172
|
-
readonly parentRunId: string;
|
|
1173
|
-
readonly parentToolCallId: string;
|
|
1174
|
-
readonly depth: number;
|
|
1175
|
-
};
|
|
1176
|
-
readonly parentSubmissionId: string;
|
|
1177
|
-
readonly childDefinitionDigests: {
|
|
1178
|
-
readonly agent: string;
|
|
1179
|
-
readonly model: string;
|
|
1180
|
-
readonly tools: string;
|
|
1181
|
-
};
|
|
1182
|
-
readonly childInputDigest: string;
|
|
1183
|
-
readonly grantDigest: string;
|
|
1184
|
-
} | {
|
|
1185
|
-
readonly _tag: "RepairAnnotated";
|
|
1186
|
-
readonly reason: string;
|
|
1187
|
-
readonly details: Schema.Json;
|
|
1188
|
-
};
|
|
1189
|
-
};
|
|
1190
|
-
}[];
|
|
1191
|
-
} | {
|
|
1192
|
-
readonly _tag: "StoreInspectTailResult";
|
|
1193
|
-
readonly tail: {
|
|
1194
|
-
readonly conversationId: string;
|
|
1195
|
-
readonly tailSequence: number;
|
|
1196
|
-
readonly tailDigest: string;
|
|
1197
|
-
readonly producerEpoch: number;
|
|
1198
|
-
};
|
|
1199
|
-
} | {
|
|
1200
|
-
readonly _tag: "StoreExportResult";
|
|
1201
|
-
readonly export: {
|
|
1202
|
-
readonly format: "effect-agent/conversation@1";
|
|
1203
|
-
readonly conversationId: string;
|
|
1204
|
-
readonly tailSequence: number;
|
|
1205
|
-
readonly tailDigest: string;
|
|
1206
|
-
readonly records: readonly {
|
|
1207
|
-
readonly conversationId: string;
|
|
1208
|
-
readonly batchId: string;
|
|
1209
|
-
readonly sequence: number;
|
|
1210
|
-
readonly offset: string;
|
|
1211
|
-
readonly record: {
|
|
1212
|
-
readonly recordId: string;
|
|
1213
|
-
readonly family: "conversation";
|
|
1214
|
-
readonly schemaVersion: 1;
|
|
1215
|
-
readonly createdAt: string;
|
|
1216
|
-
readonly deploymentId: string;
|
|
1217
|
-
readonly payload: {
|
|
1218
|
-
readonly _tag: "AbortRequested";
|
|
1219
|
-
readonly submissionId: string;
|
|
1220
|
-
readonly author: string;
|
|
1221
|
-
readonly reason: string;
|
|
1222
|
-
} | {
|
|
1223
|
-
readonly _tag: "ConversationCreated";
|
|
1224
|
-
readonly agentId: string;
|
|
1225
|
-
readonly definitions: {
|
|
1226
|
-
readonly agent: string;
|
|
1227
|
-
readonly model: string;
|
|
1228
|
-
readonly tools: string;
|
|
1229
|
-
};
|
|
1230
|
-
} | {
|
|
1231
|
-
readonly _tag: "UserInputRecorded";
|
|
1232
|
-
readonly submissionId: string;
|
|
1233
|
-
readonly kind: "follow-up" | "steering" | "user";
|
|
1234
|
-
readonly runId?: string | undefined;
|
|
1235
|
-
readonly input: Schema.Json;
|
|
1236
|
-
} | {
|
|
1237
|
-
readonly _tag: "ModelCompleted";
|
|
1238
|
-
readonly runId: string;
|
|
1239
|
-
readonly output: Schema.Json;
|
|
1240
|
-
} | {
|
|
1241
|
-
readonly _tag: "ModelResponseRecorded";
|
|
1242
|
-
readonly runId: string;
|
|
1243
|
-
readonly turnId: string;
|
|
1244
|
-
readonly turn: number;
|
|
1245
|
-
readonly messages: Schema.Json;
|
|
1246
|
-
readonly messagesDigest: string;
|
|
1247
|
-
readonly inputTokens?: number | undefined;
|
|
1248
|
-
readonly outputTokens?: number | undefined;
|
|
1249
|
-
readonly costMicrousd?: number | undefined;
|
|
1250
|
-
} | {
|
|
1251
|
-
readonly _tag: "ToolCallPrepared";
|
|
1252
|
-
readonly runId: string;
|
|
1253
|
-
readonly turnId: string;
|
|
1254
|
-
readonly turn: number;
|
|
1255
|
-
readonly toolCallId: string;
|
|
1256
|
-
readonly toolName: string;
|
|
1257
|
-
readonly parameters: Schema.Json;
|
|
1258
|
-
readonly parametersDigest: string;
|
|
1259
|
-
} | {
|
|
1260
|
-
readonly _tag: "ToolCallSettled";
|
|
1261
|
-
readonly runId: string;
|
|
1262
|
-
readonly toolCallId: string;
|
|
1263
|
-
readonly toolName: string;
|
|
1264
|
-
readonly result: Schema.Json;
|
|
1265
|
-
readonly isFailure: boolean;
|
|
1266
|
-
} | {
|
|
1267
|
-
readonly _tag: "ToolCallUnknown";
|
|
1268
|
-
readonly runId: string;
|
|
1269
|
-
readonly turn: number;
|
|
1270
|
-
readonly toolCallId: string;
|
|
1271
|
-
readonly toolName: string;
|
|
1272
|
-
readonly reason: string;
|
|
1273
|
-
} | {
|
|
1274
|
-
readonly _tag: "ToolCallResolved";
|
|
1275
|
-
readonly runId: string;
|
|
1276
|
-
readonly toolCallId: string;
|
|
1277
|
-
readonly resolution: "completed-with-result" | "failed-with-error" | "never-started" | "safe-retry";
|
|
1278
|
-
readonly author: string;
|
|
1279
|
-
readonly reason: string;
|
|
1280
|
-
} | {
|
|
1281
|
-
readonly _tag: "ToolStepSettled";
|
|
1282
|
-
readonly runId: string;
|
|
1283
|
-
readonly toolCallId: string;
|
|
1284
|
-
readonly stepName: string;
|
|
1285
|
-
readonly output: Schema.Json;
|
|
1286
|
-
readonly outputDigest: string;
|
|
1287
|
-
} | {
|
|
1288
|
-
readonly _tag: "ToolApprovalRequested";
|
|
1289
|
-
readonly runId: string;
|
|
1290
|
-
readonly turnId: string;
|
|
1291
|
-
readonly turn: number;
|
|
1292
|
-
readonly toolCallId: string;
|
|
1293
|
-
readonly toolName: string;
|
|
1294
|
-
readonly parametersDigest: string;
|
|
1295
|
-
} | {
|
|
1296
|
-
readonly _tag: "ToolApprovalDecided";
|
|
1297
|
-
readonly runId: string;
|
|
1298
|
-
readonly turn: number;
|
|
1299
|
-
readonly toolCallId: string;
|
|
1300
|
-
readonly decision: "approved" | "denied";
|
|
1301
|
-
readonly resolver: string;
|
|
1302
|
-
readonly reason: string;
|
|
1303
|
-
} | {
|
|
1304
|
-
readonly _tag: "ModelResponseInterrupted";
|
|
1305
|
-
readonly runId: string;
|
|
1306
|
-
readonly supersededEpoch: number;
|
|
1307
|
-
readonly attemptId: string;
|
|
1308
|
-
readonly reason: string;
|
|
1309
|
-
} | {
|
|
1310
|
-
readonly _tag: "CompactionCreated";
|
|
1311
|
-
readonly runId: string;
|
|
1312
|
-
readonly turn: number;
|
|
1313
|
-
readonly kind: "clear-tool-results" | "summarize";
|
|
1314
|
-
readonly coversThrough: number;
|
|
1315
|
-
readonly summary?: string | undefined;
|
|
1316
|
-
} | {
|
|
1317
|
-
readonly _tag: "RunFailed";
|
|
1318
|
-
readonly runId: string;
|
|
1319
|
-
readonly failure: Schema.Json;
|
|
1320
|
-
} | {
|
|
1321
|
-
readonly _tag: "RunCompleted";
|
|
1322
|
-
readonly runId: string;
|
|
1323
|
-
readonly output: Schema.Json;
|
|
1324
|
-
} | {
|
|
1325
|
-
readonly _tag: "SubmissionSettled";
|
|
1326
|
-
readonly submissionId: string;
|
|
1327
|
-
readonly settlementId: string;
|
|
1328
|
-
readonly receiptId: string;
|
|
1329
|
-
readonly outcome: "aborted" | "completed" | "failed";
|
|
1330
|
-
readonly runId?: string | undefined;
|
|
1331
|
-
readonly result?: Schema.Json | undefined;
|
|
1332
|
-
readonly finishReason?: "budget-exhausted" | undefined;
|
|
1333
|
-
} | {
|
|
1334
|
-
readonly _tag: "SubagentRequested";
|
|
1335
|
-
readonly runId: string;
|
|
1336
|
-
readonly turnId: string;
|
|
1337
|
-
readonly turn: number;
|
|
1338
|
-
readonly toolCallId: string;
|
|
1339
|
-
readonly delegationId: string;
|
|
1340
|
-
readonly targetAgentId: string;
|
|
1341
|
-
readonly targetDigests: {
|
|
1342
|
-
readonly agent: string;
|
|
1343
|
-
readonly model: string;
|
|
1344
|
-
readonly tools: string;
|
|
1345
|
-
};
|
|
1346
|
-
readonly childInput: Schema.Json;
|
|
1347
|
-
readonly childInputDigest: string;
|
|
1348
|
-
readonly grantDigest: string;
|
|
1349
|
-
readonly reservationId: string;
|
|
1350
|
-
readonly reservationDigest: string;
|
|
1351
|
-
readonly childConversationId: string;
|
|
1352
|
-
readonly childPrincipal: string;
|
|
1353
|
-
readonly childIdempotencyKey: string;
|
|
1354
|
-
} | {
|
|
1355
|
-
readonly _tag: "SubagentStarted";
|
|
1356
|
-
readonly runId: string;
|
|
1357
|
-
readonly toolCallId: string;
|
|
1358
|
-
readonly childConversationId: string;
|
|
1359
|
-
readonly childSubmissionId: string;
|
|
1360
|
-
readonly childReceiptId: string;
|
|
1361
|
-
readonly childRunId: string;
|
|
1362
|
-
} | {
|
|
1363
|
-
readonly _tag: "SubagentJoined";
|
|
1364
|
-
readonly runId: string;
|
|
1365
|
-
readonly toolCallId: string;
|
|
1366
|
-
readonly childSubmissionId: string;
|
|
1367
|
-
readonly childSettlementId: string;
|
|
1368
|
-
readonly childOutcome: "aborted" | "completed" | "failed";
|
|
1369
|
-
readonly childResultDigest: string;
|
|
1370
|
-
readonly projectedResultDigest: string;
|
|
1371
|
-
readonly usageSummary: Schema.Json;
|
|
1372
|
-
readonly reservationId: string;
|
|
1373
|
-
readonly finalAccounting: Schema.Json;
|
|
1374
|
-
} | {
|
|
1375
|
-
readonly _tag: "SubagentLineageRecorded";
|
|
1376
|
-
readonly parentLink: {
|
|
1377
|
-
readonly delegationId: string;
|
|
1378
|
-
readonly parentAgentId: string;
|
|
1379
|
-
readonly parentConversationId: string;
|
|
1380
|
-
readonly parentRunId: string;
|
|
1381
|
-
readonly parentToolCallId: string;
|
|
1382
|
-
readonly depth: number;
|
|
1383
|
-
};
|
|
1384
|
-
readonly parentSubmissionId: string;
|
|
1385
|
-
readonly childDefinitionDigests: {
|
|
1386
|
-
readonly agent: string;
|
|
1387
|
-
readonly model: string;
|
|
1388
|
-
readonly tools: string;
|
|
1389
|
-
};
|
|
1390
|
-
readonly childInputDigest: string;
|
|
1391
|
-
readonly grantDigest: string;
|
|
1392
|
-
} | {
|
|
1393
|
-
readonly _tag: "RepairAnnotated";
|
|
1394
|
-
readonly reason: string;
|
|
1395
|
-
readonly details: Schema.Json;
|
|
1396
|
-
};
|
|
1397
|
-
};
|
|
1398
|
-
}[];
|
|
1399
|
-
};
|
|
1400
|
-
};
|
|
1401
|
-
} | {
|
|
1402
|
-
readonly _tag: "PortFailed";
|
|
1403
|
-
readonly failure: {
|
|
1404
|
-
readonly _tag: "PortProtocolError";
|
|
1405
|
-
readonly message: string;
|
|
1406
|
-
} | {
|
|
1407
|
-
readonly _tag: "AdmissionConflict";
|
|
1408
|
-
readonly conversationId: string;
|
|
1409
|
-
readonly principal: string;
|
|
1410
|
-
readonly idempotencyKey: string;
|
|
1411
|
-
readonly existingInputDigest: string;
|
|
1412
|
-
readonly attemptedInputDigest: string;
|
|
1413
|
-
} | {
|
|
1414
|
-
readonly _tag: "SettlementConflict";
|
|
1415
|
-
readonly submissionId: string;
|
|
1416
|
-
readonly existingOutcome: "aborted" | "completed" | "failed";
|
|
1417
|
-
} | {
|
|
1418
|
-
readonly _tag: "JoinedToHost";
|
|
1419
|
-
readonly submissionId: string;
|
|
1420
|
-
readonly hostSubmissionId: string;
|
|
1421
|
-
} | {
|
|
1422
|
-
readonly _tag: "LedgerError";
|
|
1423
|
-
readonly operation: string;
|
|
1424
|
-
readonly message: string;
|
|
1425
|
-
readonly cause?: Schema.Json | undefined;
|
|
1426
|
-
} | {
|
|
1427
|
-
readonly _tag: "ConversationStoreError";
|
|
1428
|
-
readonly operation: string;
|
|
1429
|
-
readonly message: string;
|
|
1430
|
-
readonly cause?: Schema.Json | undefined;
|
|
1431
|
-
} | {
|
|
1432
|
-
readonly _tag: "ConversationNotMaterialized";
|
|
1433
|
-
readonly conversationId: string;
|
|
1434
|
-
} | {
|
|
1435
|
-
readonly _tag: "AppendConflict";
|
|
1436
|
-
readonly conversationId: string;
|
|
1437
|
-
readonly batchId: string;
|
|
1438
|
-
readonly reason: "batch-digest" | "record-identity" | "tail";
|
|
1439
|
-
readonly actualTailSequence?: number | undefined;
|
|
1440
|
-
readonly actualTailDigest?: string | undefined;
|
|
1441
|
-
} | {
|
|
1442
|
-
readonly _tag: "FenceRejected";
|
|
1443
|
-
readonly conversationId: string;
|
|
1444
|
-
readonly actualEpoch: number;
|
|
1445
|
-
readonly attemptedEpoch: number;
|
|
1446
|
-
};
|
|
1447
|
-
}, Schema.SchemaError, never>;
|
|
1448
|
-
declare const decodePortResponse: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => import("effect/Effect").Effect<PortFailed | PortSucceeded, Schema.SchemaError, never>;
|
|
1449
|
-
//#endregion
|
|
1450
|
-
//#region src/routing.d.ts
|
|
1451
|
-
type ConversationId = ConversationMaterialization["conversationId"];
|
|
1452
|
-
declare const PortTransportError_base: Schema.Class<PortTransportError, Schema.TaggedStruct<"PortTransportError", {
|
|
1453
|
-
readonly target: Schema.String;
|
|
1454
|
-
readonly message: Schema.String;
|
|
1455
|
-
readonly retryable: Schema.optionalKey<Schema.Boolean>;
|
|
1456
|
-
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
1457
|
-
}>, import("effect/Cause").YieldableError>;
|
|
1458
|
-
/**
|
|
1459
|
-
* A transport could not deliver a port request to (or an answer from) the owning
|
|
1460
|
-
* Conversation's Durable Object. `retryable` carries the platform's own stub signal when one
|
|
1461
|
-
* exists. This error never crosses the wire — it is the CALLER-side evidence that the
|
|
1462
|
-
* authority was unreachable, which is exactly the case `AdmissionIndeterminate` was
|
|
1463
|
-
* specified for (SUB-031).
|
|
1464
|
-
*/
|
|
1465
|
-
declare class PortTransportError extends PortTransportError_base {}
|
|
1466
|
-
/**
|
|
1467
|
-
* Build a `PortTransportError` from an arbitrary thrown transport cause, preserving the
|
|
1468
|
-
* platform stub's own `retryable` signal when present.
|
|
1469
|
-
*/
|
|
1470
|
-
declare const portTransportFailure: (target: string, cause: unknown) => PortTransportError;
|
|
1471
|
-
declare const ConversationPortTransport_base: Context.ServiceClass<ConversationPortTransport, "@effect-agent/storage-cloudflare/ConversationPortTransport", {
|
|
1472
|
-
readonly call: (conversationId: ConversationId, request: PortRequestEnvelope) => Effect.Effect<unknown, PortTransportError>;
|
|
1473
|
-
}>;
|
|
1474
|
-
/**
|
|
1475
|
-
* Delivery of Schema-encoded port envelopes to the Durable Object that owns a FOREIGN
|
|
1476
|
-
* Conversation (plan §1.3, D-P6-3). The shipped implementation (platform-cloudflare, WP3)
|
|
1477
|
-
* calls the owner's `portCall` over native Durable Object JS RPC via
|
|
1478
|
-
* `namespace.idFromName(conversationId)`; the protocol is transport-agnostic and any carrier
|
|
1479
|
-
* that moves the encoded envelopes verbatim satisfies this service. Implementations MUST
|
|
1480
|
-
* surface every delivery problem as `PortTransportError` and must never fabricate an answer.
|
|
1481
|
-
*/
|
|
1482
|
-
declare class ConversationPortTransport extends ConversationPortTransport_base {}
|
|
1483
|
-
/** Construction options shared by both routed port Layers. */
|
|
1484
|
-
interface RoutedPortOptions {
|
|
1485
|
-
/**
|
|
1486
|
-
* The Conversation this Durable Object owns (the Object identity rule is
|
|
1487
|
-
* `namespace.idFromName(conversationId)`). Requests addressed here execute on the local
|
|
1488
|
-
* facet; requests addressed anywhere else route through the transport or fail fast typed.
|
|
1489
|
-
*/
|
|
1490
|
-
readonly localConversationId: ConversationId;
|
|
1491
|
-
}
|
|
1492
|
-
/**
|
|
1493
|
-
* Routing decorator over the LOCAL `SubmissionLedger` facet (plan §1.3): a request addressing
|
|
1494
|
-
* this Object's Conversation executes locally; a route-capable request addressing another
|
|
1495
|
-
* Conversation is Schema-encoded onto the `ConversationPortTransport` and executed by the
|
|
1496
|
-
* owning Object's local facet; any other foreign request fails fast typed. Provide the WP1
|
|
1497
|
-
* local facet (`submissionLedgerLayer`/`ledgerLayer`) and a transport to close it.
|
|
1498
|
-
*/
|
|
1499
|
-
declare const routedSubmissionLedgerLayer: (options: RoutedPortOptions) => Layer.Layer<SubmissionLedger, never, SubmissionLedger | ConversationPortTransport>;
|
|
1500
|
-
/**
|
|
1501
|
-
* Routing decorator over the LOCAL `ConversationStore` facet (plan §1.3): this-conversation
|
|
1502
|
-
* requests execute locally; foreign materialize/append/read/inspectTail/export travel the
|
|
1503
|
-
* transport; foreign observation and checkpoints fail fast typed.
|
|
1504
|
-
*/
|
|
1505
|
-
declare const routedConversationStoreLayer: (options: RoutedPortOptions) => Layer.Layer<ConversationStore, never, ConversationStore | ConversationPortTransport>;
|
|
1506
|
-
/**
|
|
1507
|
-
* Execute one decoded port request against THIS Object's LOCAL facets — the owner-side half
|
|
1508
|
-
* of the routed ports (plan §1.3). Callers must provide the WP1 local facets, never the
|
|
1509
|
-
* routed decorators: the routing layer already established that this Object owns the
|
|
1510
|
-
* addressed Conversation, and re-routing here could bounce a request between Objects.
|
|
1511
|
-
* Failures never escape — every typed port failure becomes a `PortFailed` envelope that
|
|
1512
|
-
* re-decodes on the caller side.
|
|
1513
|
-
*/
|
|
1514
|
-
declare const executePortRequest: (request: LedgerAdmitCall | LedgerLookupCall | LedgerMarkReadyCall | LedgerRecordChildSettledCall | LedgerRequestAbortCall | LedgerResolveAdmissionCall | StoreAppendCall | StoreExportCall | StoreInspectTailCall | StoreMaterializeCall | StoreReadPageCall) => Effect.Effect<PortFailed | PortSucceeded, never, ConversationStore | SubmissionLedger>;
|
|
1515
|
-
/**
|
|
1516
|
-
* The complete owner-side endpoint body for `portCall` (D-P6-3): decode the wire request,
|
|
1517
|
-
* execute it against this Object's LOCAL facets, and answer with the encoded response
|
|
1518
|
-
* envelope. Total by construction — a request that cannot be decoded, or a response that
|
|
1519
|
-
* cannot be encoded, answers `PortFailed(PortProtocolError)` instead of throwing, so the
|
|
1520
|
-
* transport never has to interpret exceptions as protocol answers.
|
|
1521
|
-
*/
|
|
1522
|
-
declare const handleEncodedPortRequest: (encoded: unknown) => Effect.Effect<unknown, never, ConversationStore | SubmissionLedger>;
|
|
1523
|
-
//#endregion
|
|
1524
|
-
export { ConversationPortTransport, CurrentDoStorageVersion, DEFAULT_MAX_STORED_VALUE_BYTES, DoAppendConflict, DoCheckpointConflict, DoFenceRejected, DoLedgerError, DoStorageCompatibilityError, DoStorageConfig, DoStorageConfigValue, DoStorageCorruptionError, DoStorageError, DoStorageFailpoint, DoStorageFailpointError, DoStorageFailpointHandler, DoStorageFailpointLocation, DoStorageFailpointTestControl, DoStorageInitializationError, DoStorageOptions, DoValueBoundExceeded, LedgerAdmitCall, LedgerAdmitResult, LedgerLookupCall, LedgerLookupResult, LedgerMarkReadyCall, LedgerMarkReadyResult, LedgerRecordChildSettledCall, LedgerRecordChildSettledResult, LedgerRequestAbortCall, LedgerRequestAbortResult, LedgerResolveAdmissionCall, LedgerResolveAdmissionResult, MAX_PORT_DIAGNOSTIC_LENGTH, PortFailed, PortFailure, PortProtocolError, PortRequest, PortRequestEnvelope, PortResponse, PortResponseEnvelope, PortResult, PortSucceeded, PortTransportError, RoutedPortOptions, StoreAppendCall, StoreAppendResult, StoreExportCall, StoreExportResult, StoreInspectTailCall, StoreInspectTailResult, StoreMaterializeCall, StoreMaterializeResult, StoreReadPageCall, StoreReadPageResult, boundPortDiagnostic, conversationStoreLayer, decodePortRequest, decodePortResponse, doMigrations, encodePortRequest, encodePortResponse, evictionFailpointHandler, executePortRequest, handleEncodedPortRequest, layer, ledgerLayer, observationOffsetAt, portTransportFailure, routedConversationStoreLayer, routedSubmissionLedgerLayer, storageConfigLayer, storageFailpointLayer, submissionLedgerLayer };
|
|
1525
|
-
//# sourceMappingURL=index.d.mts.map
|
|
1
|
+
import { t as DoMemoryStore_d_exports } from "./DoMemoryStore.mjs";
|
|
2
|
+
import { c as DoStorageError_d_exports } from "./DoStorageError-Cmhvl4TQ.mjs";
|
|
3
|
+
import { t as DoStorageConfig_d_exports } from "./DoStorageConfig.mjs";
|
|
4
|
+
import { t as DoStorageFailpoint_d_exports } from "./DoStorageFailpoint.mjs";
|
|
5
|
+
import { t as DoMessageDeliveryStore_d_exports } from "./DoMessageDeliveryStore.mjs";
|
|
6
|
+
import { t as DoScheduleStore_d_exports } from "./DoScheduleStore.mjs";
|
|
7
|
+
import { t as DoStorageVersion_d_exports } from "./DoStorageVersion-x5OOurvZ.mjs";
|
|
8
|
+
import { t as DoThreadStore_d_exports } from "./DoThreadStore.mjs";
|
|
9
|
+
import { t as DoSubmissionLedger_d_exports } from "./DoSubmissionLedger.mjs";
|
|
10
|
+
import { t as DoSubscriptionStore_d_exports } from "./DoSubscriptionStore.mjs";
|
|
11
|
+
import { t as MemoryProtocol_d_exports } from "./MemoryProtocol.mjs";
|
|
12
|
+
import { t as PortProtocol_d_exports } from "./PortProtocol.mjs";
|
|
13
|
+
import { t as PortRouting_d_exports } from "./PortRouting.mjs";
|
|
14
|
+
export { DoMemoryStore_d_exports as DoMemoryStore, DoMessageDeliveryStore_d_exports as DoMessageDeliveryStore, DoScheduleStore_d_exports as DoScheduleStore, DoStorageConfig_d_exports as DoStorageConfig, DoStorageError_d_exports as DoStorageError, DoStorageFailpoint_d_exports as DoStorageFailpoint, DoStorageVersion_d_exports as DoStorageVersion, DoSubmissionLedger_d_exports as DoSubmissionLedger, DoSubscriptionStore_d_exports as DoSubscriptionStore, DoThreadStore_d_exports as DoThreadStore, MemoryProtocol_d_exports as MemoryProtocol, PortProtocol_d_exports as PortProtocol, PortRouting_d_exports as PortRouting };
|