effect-durable-agent 0.1.0-alpha.22 → 0.1.0-alpha.23
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/domain/command-queues.d.ts +1 -1
- package/dist/domain/message-transcript.d.ts +1 -1
- package/dist/domain/reduced-state.d.ts +1 -1
- package/dist/domain/run-scheduling.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/records-DWKEjuqb.js +675 -0
- package/dist/records-DWKEjuqb.js.map +1 -0
- package/dist/{reduced-state-PJdig48e.d.ts → reduced-state-B5WxKSM5.d.ts} +4206 -4206
- package/dist/{reducer-registry-BAbhZs6d.d.ts → reducer-registry-CPObI3cs.d.ts} +2 -2
- package/dist/{run-scheduling-wakeup-QLK87OqG.d.ts → run-scheduling-wakeup-B19JTeyq.d.ts} +2 -2
- package/dist/services/compaction.d.ts +1 -1
- package/dist/services/model-call.d.ts +1 -1
- package/dist/services/prompt-projector.d.ts +1 -1
- package/dist/services/reducer-registry.d.ts +1 -1
- package/dist/services/reducer-registry.js +1 -1
- package/dist/services/run-scheduler.d.ts +1 -1
- package/dist/services/run-scheduling-wakeup.d.ts +1 -1
- package/dist/services/runtime-layer.d.ts +6 -6
- package/dist/services/runtime-layer.js +3 -3
- package/dist/services/runtime.d.ts +1 -1
- package/dist/services/runtime.js +1 -1
- package/dist/services/session-query.d.ts +1 -1
- package/dist/services/session-query.js +2 -2
- package/dist/services/session-state.d.ts +1 -1
- package/dist/services/session-state.js +1 -1
- package/dist/services/session-store.d.ts +1 -1
- package/dist/services/session-store.js +1 -1
- package/dist/services/sink-checkpoint-store.d.ts +1 -1
- package/dist/services/sink-registry.d.ts +1 -1
- package/dist/services/sink-registry.js +1 -1
- package/dist/services/tool-registry.d.ts +1 -1
- package/dist/{session-state-StlO5B2N.js → session-state-C6SyphC0.js} +3 -3
- package/dist/{session-state-StlO5B2N.js.map → session-state-C6SyphC0.js.map} +1 -1
- package/dist/{session-store-ByDjS03N.d.ts → session-store-CWYZ29CV.d.ts} +163 -45
- package/dist/{session-store-DcJjs4Fd.js → session-store-DuEhcqIC.js} +3 -2
- package/dist/{session-store-DcJjs4Fd.js.map → session-store-DuEhcqIC.js.map} +1 -1
- package/dist/{sink-checkpoint-store-BHb8YRTw.d.ts → sink-checkpoint-store-B8Ky5nfW.d.ts} +2 -2
- package/dist/{sink-registry-DEneTH8u.js → sink-registry-DtrssBxF.js} +2 -2
- package/dist/{sink-registry-DEneTH8u.js.map → sink-registry-DtrssBxF.js.map} +1 -1
- package/dist/subscription-DelB8L87.d.ts +958 -0
- package/dist/subscription-g5W0Ggqx.js +498 -0
- package/dist/subscription-g5W0Ggqx.js.map +1 -0
- package/dist/testkit/layers.d.ts +9 -6
- package/dist/testkit/layers.js +4 -4
- package/dist/testkit/layers.js.map +1 -1
- package/dist/{tool-registry-CxZ0iuYb.d.ts → tool-registry-B_WE2ZwK.d.ts} +2 -2
- package/dist/transcript.d.ts +44 -4
- package/dist/transcript.js +98 -170
- package/dist/transcript.js.map +1 -1
- package/dist/websocket.d.ts +2209 -2
- package/dist/websocket.js +704 -18
- package/dist/websocket.js.map +1 -1
- package/dist/{window-read-B8aF_hDq.js → window-read-BDayZf7O.js} +74 -683
- package/dist/window-read-BDayZf7O.js.map +1 -0
- package/package.json +1 -1
- package/dist/window-read-B8aF_hDq.js.map +0 -1
package/dist/websocket.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ import { c as StopTurnCommand, l as SubmitMessageCommand, o as PromotePendingMes
|
|
|
2
2
|
import { h as SequenceNumber } from "./core-BcimKMIv.js";
|
|
3
3
|
import { f as PositionedEvent, i as EventEnvelope } from "./envelope-Che6KatU.js";
|
|
4
4
|
import "./events-BWuvzVml.js";
|
|
5
|
-
import "./
|
|
5
|
+
import { Ct as TranscriptRecordView, Ft as TranscriptVersion, S as TranscriptReadiness, T as TranscriptWindow, b as TranscriptActiveContent, mt as TranscriptLogIncarnation } from "./session-store-CWYZ29CV.js";
|
|
6
|
+
import "./reduced-state-B5WxKSM5.js";
|
|
7
|
+
import { r as TranscriptSubscriptionBase, s as TranscriptUpdate, t as TranscriptCoverage } from "./subscription-DelB8L87.js";
|
|
6
8
|
import * as Effect from "effect/Effect";
|
|
7
9
|
import * as Schema from "effect/Schema";
|
|
8
10
|
//#region src/websocket/protocol.d.ts
|
|
@@ -75,16 +77,25 @@ declare const EDAWebSocketWireErrorFrame: Schema.Struct<{
|
|
|
75
77
|
readonly message: Schema.String;
|
|
76
78
|
}>;
|
|
77
79
|
type EDAWebSocketWireErrorFrame = typeof EDAWebSocketWireErrorFrame.Type;
|
|
80
|
+
/**
|
|
81
|
+
* Client acknowledgement. `frameId` is the transport receipt: it cumulatively frees flow-control
|
|
82
|
+
* capacity. On a transcript socket `appliedUpdateSeq` is the client's applied cut, the last
|
|
83
|
+
* transcript update it applied completely, and `durableThroughSeq` is that update's
|
|
84
|
+
* `throughSeq`; both advance only on complete updates, never on a partial chunked transfer.
|
|
85
|
+
* Raw event sockets ignore `appliedUpdateSeq`.
|
|
86
|
+
*/
|
|
78
87
|
declare const EDAWebSocketWireAckFrame: Schema.Struct<{
|
|
79
88
|
readonly _tag: Schema.Literal<"ack">;
|
|
80
89
|
readonly frameId: Schema.Int;
|
|
81
90
|
readonly durableThroughSeq: Schema.Int;
|
|
91
|
+
readonly appliedUpdateSeq: Schema.optionalKey<Schema.Int>;
|
|
82
92
|
}>;
|
|
83
93
|
type EDAWebSocketWireAckFrame = typeof EDAWebSocketWireAckFrame.Type;
|
|
84
94
|
declare const EDAWebSocketWireClientFrame: Schema.Union<readonly [Schema.Struct<{
|
|
85
95
|
readonly _tag: Schema.Literal<"ack">;
|
|
86
96
|
readonly frameId: Schema.Int;
|
|
87
97
|
readonly durableThroughSeq: Schema.Int;
|
|
98
|
+
readonly appliedUpdateSeq: Schema.optionalKey<Schema.Int>;
|
|
88
99
|
}>, Schema.Struct<{
|
|
89
100
|
readonly _tag: Schema.Literal<"ping">;
|
|
90
101
|
}>]>;
|
|
@@ -2861,6 +2872,7 @@ type EDAWebSocketServerFrame = typeof EDAWebSocketServerFrame.Type;
|
|
|
2861
2872
|
/** Client acknowledgement after applying a server frame. */
|
|
2862
2873
|
declare const EDAWebSocketAckFrame: Schema.Struct<{
|
|
2863
2874
|
readonly _tag: Schema.Literal<"ack">;
|
|
2875
|
+
readonly appliedUpdateSeq: Schema.optionalKey<Schema.Int>;
|
|
2864
2876
|
readonly frameId: Schema.brand<Schema.Int, "FrameId">;
|
|
2865
2877
|
readonly durableThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
2866
2878
|
}>;
|
|
@@ -2868,6 +2880,7 @@ type EDAWebSocketAckFrame = typeof EDAWebSocketAckFrame.Type;
|
|
|
2868
2880
|
/** Client-to-server application frame union. */
|
|
2869
2881
|
declare const EDAWebSocketClientFrame: Schema.Union<readonly [Schema.Struct<{
|
|
2870
2882
|
readonly _tag: Schema.Literal<"ack">;
|
|
2883
|
+
readonly appliedUpdateSeq: Schema.optionalKey<Schema.Int>;
|
|
2871
2884
|
readonly frameId: Schema.brand<Schema.Int, "FrameId">;
|
|
2872
2885
|
readonly durableThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
2873
2886
|
}>, Schema.Struct<{
|
|
@@ -2975,5 +2988,2199 @@ declare const onClientAck: (state: EDAWebSocketDeliveryState, ack: EDAWebSocketA
|
|
|
2975
2988
|
*/
|
|
2976
2989
|
declare const onHostSuppressedFrame: (state: EDAWebSocketDeliveryState, frame: Pick<EDAWebSocketEventsFrame, "durableThroughSeq" | "frameId">, nowMs: number) => EDAWebSocketDeliveryResult;
|
|
2977
2990
|
//#endregion
|
|
2978
|
-
|
|
2991
|
+
//#region src/websocket/transcript.d.ts
|
|
2992
|
+
/**
|
|
2993
|
+
* Transcript protocol major. A change of meaning that an older client would misread bumps it;
|
|
2994
|
+
* a client that sees another major performs one bounded reload.
|
|
2995
|
+
*/
|
|
2996
|
+
declare const EDA_TRANSCRIPT_PROTOCOL_MAJOR = 1;
|
|
2997
|
+
/** Additive wire revision within a major; older clients drop fields they do not know. */
|
|
2998
|
+
declare const EDA_TRANSCRIPT_WIRE_VERSION = 1;
|
|
2999
|
+
/**
|
|
3000
|
+
* The small, stable envelope a client decodes before any version-specific schema, from the
|
|
3001
|
+
* socket hello and from the host's SSR data. Its shape never changes; everything else may.
|
|
3002
|
+
*/
|
|
3003
|
+
declare const EDATranscriptNegotiation: Schema.Struct<{
|
|
3004
|
+
readonly protocolMajor: Schema.Int;
|
|
3005
|
+
readonly wireVersion: Schema.Int;
|
|
3006
|
+
/** Optional features this server speaks; clients ignore names they do not know. */
|
|
3007
|
+
readonly capabilities: Schema.$Array<Schema.String>;
|
|
3008
|
+
}>;
|
|
3009
|
+
type EDATranscriptNegotiation = typeof EDATranscriptNegotiation.Type;
|
|
3010
|
+
/** What this EDA release speaks. Hosts embed it in SSR data next to the transcript window. */
|
|
3011
|
+
declare const edaTranscriptNegotiation: EDATranscriptNegotiation;
|
|
3012
|
+
/** How a client should treat a server's negotiation envelope. */
|
|
3013
|
+
type EDATranscriptNegotiationResult = {
|
|
3014
|
+
readonly _tag: "Compatible";
|
|
3015
|
+
readonly remote: EDATranscriptNegotiation;
|
|
3016
|
+
} |
|
|
3017
|
+
/** The server speaks another major: reload once, preserving the viewport and draft. */
|
|
3018
|
+
{
|
|
3019
|
+
readonly _tag: "MajorMismatch";
|
|
3020
|
+
readonly remote: EDATranscriptNegotiation;
|
|
3021
|
+
} |
|
|
3022
|
+
/** No envelope could be decoded: an incompatible or non-transcript peer; also reload. */
|
|
3023
|
+
{
|
|
3024
|
+
readonly _tag: "Undecodable";
|
|
3025
|
+
};
|
|
3026
|
+
/**
|
|
3027
|
+
* Decode only the negotiation envelope from an untrusted hello frame or SSR payload and compare
|
|
3028
|
+
* it with this client's major. Run before decoding anything version-specific.
|
|
3029
|
+
*/
|
|
3030
|
+
declare const negotiateEDATranscript: (carrier: unknown, localMajor?: number) => EDATranscriptNegotiationResult;
|
|
3031
|
+
/** WebSocket close code: the server lost volatile transfer state; reconnect and resubscribe. */
|
|
3032
|
+
declare const EDA_WS_CLOSE_TRANSCRIPT_RESUBSCRIBE = 4009;
|
|
3033
|
+
/** First frame on a transcript socket: the event-socket hello plus the negotiation envelope. */
|
|
3034
|
+
declare const EDATranscriptHelloFrame: Schema.Struct<{
|
|
3035
|
+
readonly _tag: Schema.Literal<"hello">;
|
|
3036
|
+
readonly protocolVersion: Schema.Literal<1>;
|
|
3037
|
+
readonly subscriberId: Schema.NonEmptyString;
|
|
3038
|
+
readonly resumeSeq: Schema.Int;
|
|
3039
|
+
readonly flowControl: Schema.Struct<{
|
|
3040
|
+
readonly ackTimeoutMs: Schema.Int;
|
|
3041
|
+
readonly heartbeatIntervalMs: Schema.Int;
|
|
3042
|
+
readonly maxFrameBytes: Schema.Int;
|
|
3043
|
+
readonly maxFrameEvents: Schema.Int;
|
|
3044
|
+
readonly maxInFlightFrames: Schema.Int;
|
|
3045
|
+
readonly pingIntervalMs: Schema.optionalKey<Schema.Int>;
|
|
3046
|
+
readonly subscriberBufferCapacityEvents: Schema.Int;
|
|
3047
|
+
}>;
|
|
3048
|
+
readonly negotiation: Schema.Struct<{
|
|
3049
|
+
readonly protocolMajor: Schema.Int;
|
|
3050
|
+
readonly wireVersion: Schema.Int;
|
|
3051
|
+
/** Optional features this server speaks; clients ignore names they do not know. */
|
|
3052
|
+
readonly capabilities: Schema.$Array<Schema.String>;
|
|
3053
|
+
}>;
|
|
3054
|
+
}>;
|
|
3055
|
+
type EDATranscriptHelloFrame = typeof EDATranscriptHelloFrame.Type;
|
|
3056
|
+
/** A transcript update that fits one frame. */
|
|
3057
|
+
declare const EDATranscriptUpdateFrame: Schema.Struct<{
|
|
3058
|
+
readonly _tag: Schema.Literal<"transcript">;
|
|
3059
|
+
readonly frameId: Schema.Int;
|
|
3060
|
+
readonly update: Schema.Struct<{
|
|
3061
|
+
readonly updateSeq: Schema.Int;
|
|
3062
|
+
readonly mode: Schema.Literals<readonly ["replace", "patch"]>;
|
|
3063
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
3064
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
3065
|
+
readonly throughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3066
|
+
readonly coverage: Schema.optionalKey<Schema.Struct<{
|
|
3067
|
+
readonly from: Schema.Struct<{
|
|
3068
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
3069
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
3070
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3071
|
+
readonly ordinal: Schema.Int;
|
|
3072
|
+
readonly recordId: Schema.NonEmptyString;
|
|
3073
|
+
}>;
|
|
3074
|
+
readonly to: Schema.Struct<{
|
|
3075
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
3076
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
3077
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3078
|
+
readonly ordinal: Schema.Int;
|
|
3079
|
+
readonly recordId: Schema.NonEmptyString;
|
|
3080
|
+
}>;
|
|
3081
|
+
}>>;
|
|
3082
|
+
readonly hasOlder: Schema.Boolean;
|
|
3083
|
+
readonly hasNewer: Schema.Boolean;
|
|
3084
|
+
readonly readiness: Schema.Union<readonly [Schema.TaggedUnion<{
|
|
3085
|
+
readonly Building: Schema.TaggedStruct<"Building", {}>;
|
|
3086
|
+
readonly Degraded: Schema.TaggedStruct<"Degraded", {
|
|
3087
|
+
readonly failedAtSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3088
|
+
readonly error: Schema.String;
|
|
3089
|
+
}>;
|
|
3090
|
+
readonly Ready: Schema.TaggedStruct<"Ready", {}>;
|
|
3091
|
+
readonly Unknown: Schema.TaggedStruct<"Unknown", {
|
|
3092
|
+
readonly readinessType: Schema.String;
|
|
3093
|
+
}>;
|
|
3094
|
+
readonly Unreadable: Schema.TaggedStruct<"Unreadable", {
|
|
3095
|
+
readonly error: Schema.String;
|
|
3096
|
+
}>;
|
|
3097
|
+
readonly UpdatingHistory: Schema.TaggedStruct<"UpdatingHistory", {}>;
|
|
3098
|
+
}>, Schema.decodeTo<Schema.toType<Schema.TaggedStruct<"Unknown", {
|
|
3099
|
+
readonly readinessType: Schema.String;
|
|
3100
|
+
}>>, Schema.Struct<{
|
|
3101
|
+
readonly _tag: Schema.String;
|
|
3102
|
+
}>, never, never>]>;
|
|
3103
|
+
readonly records: Schema.$Array<Schema.Union<readonly [Schema.decodeTo<Schema.Union<readonly [Schema.Struct<{
|
|
3104
|
+
readonly commandId: Schema.brand<Schema.String, "CommandId">;
|
|
3105
|
+
readonly messageIds: Schema.$Array<Schema.brand<Schema.String, "MessageId">>;
|
|
3106
|
+
readonly idempotencyKey: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "CommandIdempotencyKey">>;
|
|
3107
|
+
readonly disposition: Schema.optionalKey<Schema.Literals<readonly ["queue", "steer", "interrupt"]>>;
|
|
3108
|
+
readonly content: Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
|
|
3109
|
+
readonly type: Schema.Literal<"text">;
|
|
3110
|
+
readonly text: Schema.String;
|
|
3111
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
3112
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
3113
|
+
}>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
3114
|
+
readonly type: Schema.Literal<"text">;
|
|
3115
|
+
readonly text: Schema.String;
|
|
3116
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
3117
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
3118
|
+
}>, Schema.decodeTo<Schema.Struct<{
|
|
3119
|
+
readonly type: Schema.Literal<"file">;
|
|
3120
|
+
readonly mediaType: Schema.String;
|
|
3121
|
+
readonly fileName: Schema.optional<Schema.String>;
|
|
3122
|
+
readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
|
|
3123
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
3124
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
3125
|
+
}>, Schema.Struct<{
|
|
3126
|
+
readonly type: Schema.Literal<"file">;
|
|
3127
|
+
readonly mediaType: Schema.String;
|
|
3128
|
+
readonly fileName: Schema.optional<Schema.String>;
|
|
3129
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
3130
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
3131
|
+
readonly data: Schema.String;
|
|
3132
|
+
}>, never, never>]>>]>;
|
|
3133
|
+
readonly state: Schema.TaggedUnion<{
|
|
3134
|
+
readonly Cancelled: Schema.TaggedStruct<"Cancelled", {
|
|
3135
|
+
readonly reason: Schema.String;
|
|
3136
|
+
readonly byCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
|
|
3137
|
+
}>;
|
|
3138
|
+
readonly Consumed: Schema.TaggedStruct<"Consumed", {
|
|
3139
|
+
readonly turnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
|
|
3140
|
+
readonly runId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
|
|
3141
|
+
}>;
|
|
3142
|
+
readonly Paused: Schema.TaggedStruct<"Paused", {
|
|
3143
|
+
readonly byCommandId: Schema.brand<Schema.String, "CommandId">;
|
|
3144
|
+
}>;
|
|
3145
|
+
readonly Pending: Schema.TaggedStruct<"Pending", {}>;
|
|
3146
|
+
readonly Promoted: Schema.TaggedStruct<"Promoted", {}>;
|
|
3147
|
+
readonly Steering: Schema.TaggedStruct<"Steering", {}>;
|
|
3148
|
+
}>;
|
|
3149
|
+
readonly steering: Schema.optionalKey<Schema.Struct<{
|
|
3150
|
+
readonly runId: Schema.brand<Schema.String, "RunId">;
|
|
3151
|
+
}>>;
|
|
3152
|
+
readonly classification: Schema.optionalKey<Schema.String>;
|
|
3153
|
+
readonly decorations: Schema.$Record<Schema.String, Schema.TaggedUnion<{
|
|
3154
|
+
readonly List: Schema.TaggedStruct<"List", {
|
|
3155
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
3156
|
+
readonly key: Schema.Union<readonly [Schema.String, Schema.Int]>;
|
|
3157
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3158
|
+
readonly id: Schema.optionalKey<Schema.NonEmptyString>;
|
|
3159
|
+
}>>;
|
|
3160
|
+
}>;
|
|
3161
|
+
readonly Value: Schema.TaggedStruct<"Value", {
|
|
3162
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3163
|
+
}>;
|
|
3164
|
+
}>>;
|
|
3165
|
+
readonly submittedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3166
|
+
readonly submittedAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
|
|
3167
|
+
readonly consumedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
3168
|
+
readonly kind: Schema.tag<"user">;
|
|
3169
|
+
readonly id: Schema.TemplateLiteral<readonly ["user:", Schema.brand<Schema.String, "CommandId">]>;
|
|
3170
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3171
|
+
readonly position: Schema.optionalKey<Schema.Struct<{
|
|
3172
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3173
|
+
readonly ordinal: Schema.Int;
|
|
3174
|
+
}>>;
|
|
3175
|
+
}>, Schema.Struct<{
|
|
3176
|
+
readonly startedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
3177
|
+
readonly terminalAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
3178
|
+
readonly durationMs: Schema.optionalKey<Schema.Int>;
|
|
3179
|
+
readonly source: Schema.Literals<readonly ["inference", "import"]>;
|
|
3180
|
+
readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
|
|
3181
|
+
readonly runId: Schema.brand<Schema.String, "RunId">;
|
|
3182
|
+
readonly turnId: Schema.brand<Schema.String, "TurnId">;
|
|
3183
|
+
readonly runGroupId: Schema.optionalKey<Schema.TemplateLiteral<readonly ["run:", Schema.brand<Schema.String, "RunId">]>>;
|
|
3184
|
+
readonly messageId: Schema.optionalKey<Schema.brand<Schema.String, "MessageId">>;
|
|
3185
|
+
readonly lifecycle: Schema.TaggedUnion<{
|
|
3186
|
+
readonly Completed: Schema.TaggedStruct<"Completed", {
|
|
3187
|
+
readonly finishReason: Schema.optionalKey<Schema.String>;
|
|
3188
|
+
readonly usage: Schema.optionalKey<Schema.Struct<{
|
|
3189
|
+
readonly inputTokens: Schema.optionalKey<Schema.Int>;
|
|
3190
|
+
readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
|
|
3191
|
+
readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
|
|
3192
|
+
readonly outputTokens: Schema.optionalKey<Schema.Int>;
|
|
3193
|
+
readonly textTokens: Schema.optionalKey<Schema.Int>;
|
|
3194
|
+
readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
|
|
3195
|
+
}>>;
|
|
3196
|
+
}>;
|
|
3197
|
+
readonly Failed: Schema.TaggedStruct<"Failed", {
|
|
3198
|
+
readonly error: Schema.Struct<{
|
|
3199
|
+
readonly message: Schema.String;
|
|
3200
|
+
readonly code: Schema.optionalKey<Schema.String>;
|
|
3201
|
+
readonly details: Schema.optionalKey<Schema.Unknown>;
|
|
3202
|
+
}>;
|
|
3203
|
+
}>;
|
|
3204
|
+
readonly Streaming: Schema.TaggedStruct<"Streaming", {}>;
|
|
3205
|
+
}>;
|
|
3206
|
+
readonly parts: Schema.$Array<Schema.Union<readonly [Schema.TaggedUnion<{
|
|
3207
|
+
readonly Reasoning: Schema.TaggedStruct<"Reasoning", {
|
|
3208
|
+
readonly text: Schema.String;
|
|
3209
|
+
}>;
|
|
3210
|
+
readonly Text: Schema.TaggedStruct<"Text", {
|
|
3211
|
+
readonly text: Schema.String;
|
|
3212
|
+
}>;
|
|
3213
|
+
readonly ToolCall: Schema.TaggedStruct<"ToolCall", {
|
|
3214
|
+
readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
|
|
3215
|
+
readonly toolName: Schema.NonEmptyString;
|
|
3216
|
+
readonly providerExecuted: Schema.Boolean;
|
|
3217
|
+
readonly toolId: Schema.optionalKey<Schema.TemplateLiteral<readonly ["tool:", Schema.brand<Schema.String, "ToolCallId">]>>;
|
|
3218
|
+
}>;
|
|
3219
|
+
readonly ToolResult: Schema.TaggedStruct<"ToolResult", {
|
|
3220
|
+
readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
|
|
3221
|
+
readonly toolName: Schema.NonEmptyString;
|
|
3222
|
+
readonly isFailure: Schema.Boolean;
|
|
3223
|
+
readonly result: Schema.TaggedUnion<{
|
|
3224
|
+
readonly Inline: Schema.TaggedStruct<"Inline", {
|
|
3225
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3226
|
+
readonly source: Schema.Struct<{
|
|
3227
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3228
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
3229
|
+
}>;
|
|
3230
|
+
}>;
|
|
3231
|
+
readonly Ref: Schema.TaggedStruct<"Ref", {
|
|
3232
|
+
readonly source: Schema.Struct<{
|
|
3233
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3234
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
3235
|
+
}>;
|
|
3236
|
+
readonly byteLength: Schema.Int;
|
|
3237
|
+
}>;
|
|
3238
|
+
}>;
|
|
3239
|
+
}>;
|
|
3240
|
+
readonly Unknown: Schema.TaggedStruct<"Unknown", {
|
|
3241
|
+
readonly partType: Schema.String;
|
|
3242
|
+
}>;
|
|
3243
|
+
}>, Schema.decodeTo<Schema.toType<Schema.TaggedStruct<"Unknown", {
|
|
3244
|
+
readonly partType: Schema.String;
|
|
3245
|
+
}>>, Schema.Struct<{
|
|
3246
|
+
readonly _tag: Schema.String;
|
|
3247
|
+
}>, never, never>]>>;
|
|
3248
|
+
readonly partial: Schema.optionalKey<Schema.Struct<{
|
|
3249
|
+
readonly reason: Schema.String;
|
|
3250
|
+
}>>;
|
|
3251
|
+
readonly kind: Schema.tag<"assistant">;
|
|
3252
|
+
readonly id: Schema.Union<readonly [Schema.TemplateLiteral<readonly ["assistant:", Schema.brand<Schema.String, "InferenceId">]>, Schema.TemplateLiteral<readonly ["import:", Schema.brand<Schema.String, "EventId">]>]>;
|
|
3253
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3254
|
+
readonly position: Schema.Struct<{
|
|
3255
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3256
|
+
readonly ordinal: Schema.Int;
|
|
3257
|
+
}>;
|
|
3258
|
+
}>, Schema.Struct<{
|
|
3259
|
+
readonly compactionId: Schema.brand<Schema.String, "CompactionId">;
|
|
3260
|
+
readonly summaryId: Schema.brand<Schema.String, "SummaryId">;
|
|
3261
|
+
readonly contextVersion: Schema.brand<Schema.Int, "ContextVersion">;
|
|
3262
|
+
readonly retainedFromContextSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3263
|
+
readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
|
|
3264
|
+
readonly completedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
3265
|
+
readonly kind: Schema.tag<"compaction">;
|
|
3266
|
+
readonly id: Schema.TemplateLiteral<readonly ["compaction:", Schema.brand<Schema.String, "CompactionId">]>;
|
|
3267
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3268
|
+
readonly position: Schema.Struct<{
|
|
3269
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3270
|
+
readonly ordinal: Schema.Int;
|
|
3271
|
+
}>;
|
|
3272
|
+
}>, Schema.Struct<{
|
|
3273
|
+
readonly startedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
3274
|
+
readonly terminalAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
3275
|
+
readonly durationMs: Schema.optionalKey<Schema.Int>;
|
|
3276
|
+
readonly toolCallId: Schema.brand<Schema.String, "ToolCallId">;
|
|
3277
|
+
readonly assistantId: Schema.TemplateLiteral<readonly ["assistant:", Schema.brand<Schema.String, "InferenceId">]>;
|
|
3278
|
+
readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
|
|
3279
|
+
readonly toolName: Schema.NonEmptyString;
|
|
3280
|
+
readonly providerExecuted: Schema.Boolean;
|
|
3281
|
+
readonly params: Schema.optionalKey<Schema.TaggedUnion<{
|
|
3282
|
+
readonly Inline: Schema.TaggedStruct<"Inline", {
|
|
3283
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3284
|
+
readonly source: Schema.Struct<{
|
|
3285
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3286
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
3287
|
+
}>;
|
|
3288
|
+
}>;
|
|
3289
|
+
readonly Ref: Schema.TaggedStruct<"Ref", {
|
|
3290
|
+
readonly source: Schema.Struct<{
|
|
3291
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3292
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
3293
|
+
}>;
|
|
3294
|
+
readonly byteLength: Schema.Int;
|
|
3295
|
+
}>;
|
|
3296
|
+
}>>;
|
|
3297
|
+
readonly lifecycle: Schema.TaggedUnion<{
|
|
3298
|
+
readonly Completed: Schema.TaggedStruct<"Completed", {
|
|
3299
|
+
readonly result: Schema.TaggedUnion<{
|
|
3300
|
+
readonly Inline: Schema.TaggedStruct<"Inline", {
|
|
3301
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3302
|
+
readonly source: Schema.Struct<{
|
|
3303
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3304
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
3305
|
+
}>;
|
|
3306
|
+
}>;
|
|
3307
|
+
readonly Ref: Schema.TaggedStruct<"Ref", {
|
|
3308
|
+
readonly source: Schema.Struct<{
|
|
3309
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3310
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
3311
|
+
}>;
|
|
3312
|
+
readonly byteLength: Schema.Int;
|
|
3313
|
+
}>;
|
|
3314
|
+
}>;
|
|
3315
|
+
}>;
|
|
3316
|
+
readonly Created: Schema.TaggedStruct<"Created", {}>;
|
|
3317
|
+
readonly Failed: Schema.TaggedStruct<"Failed", {
|
|
3318
|
+
readonly error: Schema.Struct<{
|
|
3319
|
+
readonly message: Schema.String;
|
|
3320
|
+
readonly code: Schema.optionalKey<Schema.String>;
|
|
3321
|
+
readonly details: Schema.optionalKey<Schema.Unknown>;
|
|
3322
|
+
}>;
|
|
3323
|
+
}>;
|
|
3324
|
+
readonly Rejected: Schema.TaggedStruct<"Rejected", {
|
|
3325
|
+
readonly reason: Schema.Literals<readonly ["unknown-tool", "invalid-params"]>;
|
|
3326
|
+
readonly message: Schema.String;
|
|
3327
|
+
readonly modelFeedback: Schema.String;
|
|
3328
|
+
}>;
|
|
3329
|
+
readonly Running: Schema.TaggedStruct<"Running", {}>;
|
|
3330
|
+
}>;
|
|
3331
|
+
readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
|
|
3332
|
+
readonly kind: Schema.tag<"tool">;
|
|
3333
|
+
readonly id: Schema.TemplateLiteral<readonly ["tool:", Schema.brand<Schema.String, "ToolCallId">]>;
|
|
3334
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3335
|
+
}>, Schema.Struct<{
|
|
3336
|
+
readonly rootRunId: Schema.brand<Schema.String, "RunId">;
|
|
3337
|
+
readonly runs: Schema.NonEmptyArray<Schema.Struct<{
|
|
3338
|
+
readonly startedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
3339
|
+
readonly terminalAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
3340
|
+
readonly durationMs: Schema.optionalKey<Schema.Int>;
|
|
3341
|
+
readonly runId: Schema.brand<Schema.String, "RunId">;
|
|
3342
|
+
readonly commandIds: Schema.$Array<Schema.brand<Schema.String, "CommandId">>;
|
|
3343
|
+
readonly modelSelection: Schema.Struct<{
|
|
3344
|
+
readonly provider: Schema.NonEmptyString;
|
|
3345
|
+
readonly modelId: Schema.NonEmptyString;
|
|
3346
|
+
readonly settings: Schema.optionalKey<Schema.Unknown>;
|
|
3347
|
+
}>;
|
|
3348
|
+
readonly outcome: Schema.TaggedUnion<{
|
|
3349
|
+
readonly Completed: Schema.TaggedStruct<"Completed", {}>;
|
|
3350
|
+
readonly Failed: Schema.TaggedStruct<"Failed", {
|
|
3351
|
+
readonly error: Schema.Struct<{
|
|
3352
|
+
readonly message: Schema.String;
|
|
3353
|
+
readonly code: Schema.optionalKey<Schema.String>;
|
|
3354
|
+
readonly details: Schema.optionalKey<Schema.Unknown>;
|
|
3355
|
+
}>;
|
|
3356
|
+
}>;
|
|
3357
|
+
readonly Interrupted: Schema.TaggedStruct<"Interrupted", {
|
|
3358
|
+
readonly reason: Schema.String;
|
|
3359
|
+
}>;
|
|
3360
|
+
readonly Running: Schema.TaggedStruct<"Running", {}>;
|
|
3361
|
+
}>;
|
|
3362
|
+
readonly continuationOf: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
|
|
3363
|
+
}>>;
|
|
3364
|
+
readonly kind: Schema.tag<"runGroup">;
|
|
3365
|
+
readonly id: Schema.TemplateLiteral<readonly ["run:", Schema.brand<Schema.String, "RunId">]>;
|
|
3366
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3367
|
+
}>, Schema.Struct<{
|
|
3368
|
+
readonly activeRunId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
|
|
3369
|
+
readonly activeCompactionId: Schema.optionalKey<Schema.brand<Schema.String, "CompactionId">>;
|
|
3370
|
+
readonly modelSelection: Schema.optionalKey<Schema.Struct<{
|
|
3371
|
+
readonly provider: Schema.NonEmptyString;
|
|
3372
|
+
readonly modelId: Schema.NonEmptyString;
|
|
3373
|
+
readonly settings: Schema.optionalKey<Schema.Unknown>;
|
|
3374
|
+
}>>;
|
|
3375
|
+
readonly lastRunModelSelection: Schema.optionalKey<Schema.Struct<{
|
|
3376
|
+
readonly provider: Schema.NonEmptyString;
|
|
3377
|
+
readonly modelId: Schema.NonEmptyString;
|
|
3378
|
+
readonly settings: Schema.optionalKey<Schema.Unknown>;
|
|
3379
|
+
}>>;
|
|
3380
|
+
readonly tokenUsage: Schema.Struct<{
|
|
3381
|
+
readonly byModel: Schema.$Array<Schema.Struct<{
|
|
3382
|
+
readonly provider: Schema.NonEmptyString;
|
|
3383
|
+
readonly modelId: Schema.NonEmptyString;
|
|
3384
|
+
readonly usage: Schema.Struct<{
|
|
3385
|
+
readonly inputTokens: Schema.Int;
|
|
3386
|
+
readonly cachedInputTokens: Schema.Int;
|
|
3387
|
+
readonly cacheWriteInputTokens: Schema.Int;
|
|
3388
|
+
readonly outputTokens: Schema.Int;
|
|
3389
|
+
readonly textTokens: Schema.Int;
|
|
3390
|
+
readonly reasoningTokens: Schema.Int;
|
|
3391
|
+
}>;
|
|
3392
|
+
}>>;
|
|
3393
|
+
}>;
|
|
3394
|
+
readonly decorations: Schema.$Record<Schema.String, Schema.TaggedUnion<{
|
|
3395
|
+
readonly List: Schema.TaggedStruct<"List", {
|
|
3396
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
3397
|
+
readonly key: Schema.Union<readonly [Schema.String, Schema.Int]>;
|
|
3398
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3399
|
+
readonly id: Schema.optionalKey<Schema.NonEmptyString>;
|
|
3400
|
+
}>>;
|
|
3401
|
+
}>;
|
|
3402
|
+
readonly Value: Schema.TaggedStruct<"Value", {
|
|
3403
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3404
|
+
}>;
|
|
3405
|
+
}>>;
|
|
3406
|
+
readonly kind: Schema.tag<"sessionContext">;
|
|
3407
|
+
readonly id: Schema.Literal<"session">;
|
|
3408
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3409
|
+
}>, Schema.Struct<{
|
|
3410
|
+
readonly operations: Schema.$Array<Schema.Struct<{
|
|
3411
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3412
|
+
readonly mapping: Schema.String;
|
|
3413
|
+
readonly operation: Schema.Int;
|
|
3414
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3415
|
+
readonly entryKey: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
3416
|
+
readonly entryId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
3417
|
+
}>>;
|
|
3418
|
+
readonly kind: Schema.tag<"decorationBuffer">;
|
|
3419
|
+
readonly id: Schema.TemplateLiteral<readonly ["decorations:", Schema.Literals<readonly ["command", "idempotencyKey"]>, ":", Schema.NonEmptyString]>;
|
|
3420
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3421
|
+
}>]>, Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.Struct<{
|
|
3422
|
+
readonly format: Schema.Int;
|
|
3423
|
+
readonly kind: Schema.NonEmptyString;
|
|
3424
|
+
readonly id: Schema.NonEmptyString;
|
|
3425
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3426
|
+
readonly position: Schema.optionalKey<Schema.Struct<{
|
|
3427
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3428
|
+
readonly ordinal: Schema.Int;
|
|
3429
|
+
}>>;
|
|
3430
|
+
readonly body: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
3431
|
+
}>, never, never>, never, never>, Schema.decodeTo<Schema.Struct<{
|
|
3432
|
+
readonly kind: Schema.tag<"unknown">;
|
|
3433
|
+
readonly originalKind: Schema.NonEmptyString;
|
|
3434
|
+
readonly format: Schema.Int;
|
|
3435
|
+
readonly body: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
3436
|
+
readonly id: Schema.NonEmptyString;
|
|
3437
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3438
|
+
readonly position: Schema.optionalKey<Schema.Struct<{
|
|
3439
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3440
|
+
readonly ordinal: Schema.Int;
|
|
3441
|
+
}>>;
|
|
3442
|
+
}>, Schema.Struct<{
|
|
3443
|
+
readonly format: Schema.Int;
|
|
3444
|
+
readonly kind: Schema.NonEmptyString;
|
|
3445
|
+
readonly id: Schema.NonEmptyString;
|
|
3446
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3447
|
+
readonly position: Schema.optionalKey<Schema.Struct<{
|
|
3448
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3449
|
+
readonly ordinal: Schema.Int;
|
|
3450
|
+
}>>;
|
|
3451
|
+
readonly body: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
3452
|
+
}>, never, never>]>>;
|
|
3453
|
+
readonly dependencies: Schema.$Array<Schema.Union<readonly [Schema.decodeTo<Schema.Union<readonly [Schema.Struct<{
|
|
3454
|
+
readonly commandId: Schema.brand<Schema.String, "CommandId">;
|
|
3455
|
+
readonly messageIds: Schema.$Array<Schema.brand<Schema.String, "MessageId">>;
|
|
3456
|
+
readonly idempotencyKey: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "CommandIdempotencyKey">>;
|
|
3457
|
+
readonly disposition: Schema.optionalKey<Schema.Literals<readonly ["queue", "steer", "interrupt"]>>;
|
|
3458
|
+
readonly content: Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
|
|
3459
|
+
readonly type: Schema.Literal<"text">;
|
|
3460
|
+
readonly text: Schema.String;
|
|
3461
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
3462
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
3463
|
+
}>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
3464
|
+
readonly type: Schema.Literal<"text">;
|
|
3465
|
+
readonly text: Schema.String;
|
|
3466
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
3467
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
3468
|
+
}>, Schema.decodeTo<Schema.Struct<{
|
|
3469
|
+
readonly type: Schema.Literal<"file">;
|
|
3470
|
+
readonly mediaType: Schema.String;
|
|
3471
|
+
readonly fileName: Schema.optional<Schema.String>;
|
|
3472
|
+
readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
|
|
3473
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
3474
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
3475
|
+
}>, Schema.Struct<{
|
|
3476
|
+
readonly type: Schema.Literal<"file">;
|
|
3477
|
+
readonly mediaType: Schema.String;
|
|
3478
|
+
readonly fileName: Schema.optional<Schema.String>;
|
|
3479
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
3480
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
3481
|
+
readonly data: Schema.String;
|
|
3482
|
+
}>, never, never>]>>]>;
|
|
3483
|
+
readonly state: Schema.TaggedUnion<{
|
|
3484
|
+
readonly Cancelled: Schema.TaggedStruct<"Cancelled", {
|
|
3485
|
+
readonly reason: Schema.String;
|
|
3486
|
+
readonly byCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
|
|
3487
|
+
}>;
|
|
3488
|
+
readonly Consumed: Schema.TaggedStruct<"Consumed", {
|
|
3489
|
+
readonly turnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
|
|
3490
|
+
readonly runId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
|
|
3491
|
+
}>;
|
|
3492
|
+
readonly Paused: Schema.TaggedStruct<"Paused", {
|
|
3493
|
+
readonly byCommandId: Schema.brand<Schema.String, "CommandId">;
|
|
3494
|
+
}>;
|
|
3495
|
+
readonly Pending: Schema.TaggedStruct<"Pending", {}>;
|
|
3496
|
+
readonly Promoted: Schema.TaggedStruct<"Promoted", {}>;
|
|
3497
|
+
readonly Steering: Schema.TaggedStruct<"Steering", {}>;
|
|
3498
|
+
}>;
|
|
3499
|
+
readonly steering: Schema.optionalKey<Schema.Struct<{
|
|
3500
|
+
readonly runId: Schema.brand<Schema.String, "RunId">;
|
|
3501
|
+
}>>;
|
|
3502
|
+
readonly classification: Schema.optionalKey<Schema.String>;
|
|
3503
|
+
readonly decorations: Schema.$Record<Schema.String, Schema.TaggedUnion<{
|
|
3504
|
+
readonly List: Schema.TaggedStruct<"List", {
|
|
3505
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
3506
|
+
readonly key: Schema.Union<readonly [Schema.String, Schema.Int]>;
|
|
3507
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3508
|
+
readonly id: Schema.optionalKey<Schema.NonEmptyString>;
|
|
3509
|
+
}>>;
|
|
3510
|
+
}>;
|
|
3511
|
+
readonly Value: Schema.TaggedStruct<"Value", {
|
|
3512
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3513
|
+
}>;
|
|
3514
|
+
}>>;
|
|
3515
|
+
readonly submittedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3516
|
+
readonly submittedAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
|
|
3517
|
+
readonly consumedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
3518
|
+
readonly kind: Schema.tag<"user">;
|
|
3519
|
+
readonly id: Schema.TemplateLiteral<readonly ["user:", Schema.brand<Schema.String, "CommandId">]>;
|
|
3520
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3521
|
+
readonly position: Schema.optionalKey<Schema.Struct<{
|
|
3522
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3523
|
+
readonly ordinal: Schema.Int;
|
|
3524
|
+
}>>;
|
|
3525
|
+
}>, Schema.Struct<{
|
|
3526
|
+
readonly startedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
3527
|
+
readonly terminalAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
3528
|
+
readonly durationMs: Schema.optionalKey<Schema.Int>;
|
|
3529
|
+
readonly source: Schema.Literals<readonly ["inference", "import"]>;
|
|
3530
|
+
readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
|
|
3531
|
+
readonly runId: Schema.brand<Schema.String, "RunId">;
|
|
3532
|
+
readonly turnId: Schema.brand<Schema.String, "TurnId">;
|
|
3533
|
+
readonly runGroupId: Schema.optionalKey<Schema.TemplateLiteral<readonly ["run:", Schema.brand<Schema.String, "RunId">]>>;
|
|
3534
|
+
readonly messageId: Schema.optionalKey<Schema.brand<Schema.String, "MessageId">>;
|
|
3535
|
+
readonly lifecycle: Schema.TaggedUnion<{
|
|
3536
|
+
readonly Completed: Schema.TaggedStruct<"Completed", {
|
|
3537
|
+
readonly finishReason: Schema.optionalKey<Schema.String>;
|
|
3538
|
+
readonly usage: Schema.optionalKey<Schema.Struct<{
|
|
3539
|
+
readonly inputTokens: Schema.optionalKey<Schema.Int>;
|
|
3540
|
+
readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
|
|
3541
|
+
readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
|
|
3542
|
+
readonly outputTokens: Schema.optionalKey<Schema.Int>;
|
|
3543
|
+
readonly textTokens: Schema.optionalKey<Schema.Int>;
|
|
3544
|
+
readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
|
|
3545
|
+
}>>;
|
|
3546
|
+
}>;
|
|
3547
|
+
readonly Failed: Schema.TaggedStruct<"Failed", {
|
|
3548
|
+
readonly error: Schema.Struct<{
|
|
3549
|
+
readonly message: Schema.String;
|
|
3550
|
+
readonly code: Schema.optionalKey<Schema.String>;
|
|
3551
|
+
readonly details: Schema.optionalKey<Schema.Unknown>;
|
|
3552
|
+
}>;
|
|
3553
|
+
}>;
|
|
3554
|
+
readonly Streaming: Schema.TaggedStruct<"Streaming", {}>;
|
|
3555
|
+
}>;
|
|
3556
|
+
readonly parts: Schema.$Array<Schema.Union<readonly [Schema.TaggedUnion<{
|
|
3557
|
+
readonly Reasoning: Schema.TaggedStruct<"Reasoning", {
|
|
3558
|
+
readonly text: Schema.String;
|
|
3559
|
+
}>;
|
|
3560
|
+
readonly Text: Schema.TaggedStruct<"Text", {
|
|
3561
|
+
readonly text: Schema.String;
|
|
3562
|
+
}>;
|
|
3563
|
+
readonly ToolCall: Schema.TaggedStruct<"ToolCall", {
|
|
3564
|
+
readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
|
|
3565
|
+
readonly toolName: Schema.NonEmptyString;
|
|
3566
|
+
readonly providerExecuted: Schema.Boolean;
|
|
3567
|
+
readonly toolId: Schema.optionalKey<Schema.TemplateLiteral<readonly ["tool:", Schema.brand<Schema.String, "ToolCallId">]>>;
|
|
3568
|
+
}>;
|
|
3569
|
+
readonly ToolResult: Schema.TaggedStruct<"ToolResult", {
|
|
3570
|
+
readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
|
|
3571
|
+
readonly toolName: Schema.NonEmptyString;
|
|
3572
|
+
readonly isFailure: Schema.Boolean;
|
|
3573
|
+
readonly result: Schema.TaggedUnion<{
|
|
3574
|
+
readonly Inline: Schema.TaggedStruct<"Inline", {
|
|
3575
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3576
|
+
readonly source: Schema.Struct<{
|
|
3577
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3578
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
3579
|
+
}>;
|
|
3580
|
+
}>;
|
|
3581
|
+
readonly Ref: Schema.TaggedStruct<"Ref", {
|
|
3582
|
+
readonly source: Schema.Struct<{
|
|
3583
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3584
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
3585
|
+
}>;
|
|
3586
|
+
readonly byteLength: Schema.Int;
|
|
3587
|
+
}>;
|
|
3588
|
+
}>;
|
|
3589
|
+
}>;
|
|
3590
|
+
readonly Unknown: Schema.TaggedStruct<"Unknown", {
|
|
3591
|
+
readonly partType: Schema.String;
|
|
3592
|
+
}>;
|
|
3593
|
+
}>, Schema.decodeTo<Schema.toType<Schema.TaggedStruct<"Unknown", {
|
|
3594
|
+
readonly partType: Schema.String;
|
|
3595
|
+
}>>, Schema.Struct<{
|
|
3596
|
+
readonly _tag: Schema.String;
|
|
3597
|
+
}>, never, never>]>>;
|
|
3598
|
+
readonly partial: Schema.optionalKey<Schema.Struct<{
|
|
3599
|
+
readonly reason: Schema.String;
|
|
3600
|
+
}>>;
|
|
3601
|
+
readonly kind: Schema.tag<"assistant">;
|
|
3602
|
+
readonly id: Schema.Union<readonly [Schema.TemplateLiteral<readonly ["assistant:", Schema.brand<Schema.String, "InferenceId">]>, Schema.TemplateLiteral<readonly ["import:", Schema.brand<Schema.String, "EventId">]>]>;
|
|
3603
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3604
|
+
readonly position: Schema.Struct<{
|
|
3605
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3606
|
+
readonly ordinal: Schema.Int;
|
|
3607
|
+
}>;
|
|
3608
|
+
}>, Schema.Struct<{
|
|
3609
|
+
readonly compactionId: Schema.brand<Schema.String, "CompactionId">;
|
|
3610
|
+
readonly summaryId: Schema.brand<Schema.String, "SummaryId">;
|
|
3611
|
+
readonly contextVersion: Schema.brand<Schema.Int, "ContextVersion">;
|
|
3612
|
+
readonly retainedFromContextSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3613
|
+
readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
|
|
3614
|
+
readonly completedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
3615
|
+
readonly kind: Schema.tag<"compaction">;
|
|
3616
|
+
readonly id: Schema.TemplateLiteral<readonly ["compaction:", Schema.brand<Schema.String, "CompactionId">]>;
|
|
3617
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3618
|
+
readonly position: Schema.Struct<{
|
|
3619
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3620
|
+
readonly ordinal: Schema.Int;
|
|
3621
|
+
}>;
|
|
3622
|
+
}>, Schema.Struct<{
|
|
3623
|
+
readonly startedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
3624
|
+
readonly terminalAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
3625
|
+
readonly durationMs: Schema.optionalKey<Schema.Int>;
|
|
3626
|
+
readonly toolCallId: Schema.brand<Schema.String, "ToolCallId">;
|
|
3627
|
+
readonly assistantId: Schema.TemplateLiteral<readonly ["assistant:", Schema.brand<Schema.String, "InferenceId">]>;
|
|
3628
|
+
readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
|
|
3629
|
+
readonly toolName: Schema.NonEmptyString;
|
|
3630
|
+
readonly providerExecuted: Schema.Boolean;
|
|
3631
|
+
readonly params: Schema.optionalKey<Schema.TaggedUnion<{
|
|
3632
|
+
readonly Inline: Schema.TaggedStruct<"Inline", {
|
|
3633
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3634
|
+
readonly source: Schema.Struct<{
|
|
3635
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3636
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
3637
|
+
}>;
|
|
3638
|
+
}>;
|
|
3639
|
+
readonly Ref: Schema.TaggedStruct<"Ref", {
|
|
3640
|
+
readonly source: Schema.Struct<{
|
|
3641
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3642
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
3643
|
+
}>;
|
|
3644
|
+
readonly byteLength: Schema.Int;
|
|
3645
|
+
}>;
|
|
3646
|
+
}>>;
|
|
3647
|
+
readonly lifecycle: Schema.TaggedUnion<{
|
|
3648
|
+
readonly Completed: Schema.TaggedStruct<"Completed", {
|
|
3649
|
+
readonly result: Schema.TaggedUnion<{
|
|
3650
|
+
readonly Inline: Schema.TaggedStruct<"Inline", {
|
|
3651
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3652
|
+
readonly source: Schema.Struct<{
|
|
3653
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3654
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
3655
|
+
}>;
|
|
3656
|
+
}>;
|
|
3657
|
+
readonly Ref: Schema.TaggedStruct<"Ref", {
|
|
3658
|
+
readonly source: Schema.Struct<{
|
|
3659
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3660
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
3661
|
+
}>;
|
|
3662
|
+
readonly byteLength: Schema.Int;
|
|
3663
|
+
}>;
|
|
3664
|
+
}>;
|
|
3665
|
+
}>;
|
|
3666
|
+
readonly Created: Schema.TaggedStruct<"Created", {}>;
|
|
3667
|
+
readonly Failed: Schema.TaggedStruct<"Failed", {
|
|
3668
|
+
readonly error: Schema.Struct<{
|
|
3669
|
+
readonly message: Schema.String;
|
|
3670
|
+
readonly code: Schema.optionalKey<Schema.String>;
|
|
3671
|
+
readonly details: Schema.optionalKey<Schema.Unknown>;
|
|
3672
|
+
}>;
|
|
3673
|
+
}>;
|
|
3674
|
+
readonly Rejected: Schema.TaggedStruct<"Rejected", {
|
|
3675
|
+
readonly reason: Schema.Literals<readonly ["unknown-tool", "invalid-params"]>;
|
|
3676
|
+
readonly message: Schema.String;
|
|
3677
|
+
readonly modelFeedback: Schema.String;
|
|
3678
|
+
}>;
|
|
3679
|
+
readonly Running: Schema.TaggedStruct<"Running", {}>;
|
|
3680
|
+
}>;
|
|
3681
|
+
readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
|
|
3682
|
+
readonly kind: Schema.tag<"tool">;
|
|
3683
|
+
readonly id: Schema.TemplateLiteral<readonly ["tool:", Schema.brand<Schema.String, "ToolCallId">]>;
|
|
3684
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3685
|
+
}>, Schema.Struct<{
|
|
3686
|
+
readonly rootRunId: Schema.brand<Schema.String, "RunId">;
|
|
3687
|
+
readonly runs: Schema.NonEmptyArray<Schema.Struct<{
|
|
3688
|
+
readonly startedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
3689
|
+
readonly terminalAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
3690
|
+
readonly durationMs: Schema.optionalKey<Schema.Int>;
|
|
3691
|
+
readonly runId: Schema.brand<Schema.String, "RunId">;
|
|
3692
|
+
readonly commandIds: Schema.$Array<Schema.brand<Schema.String, "CommandId">>;
|
|
3693
|
+
readonly modelSelection: Schema.Struct<{
|
|
3694
|
+
readonly provider: Schema.NonEmptyString;
|
|
3695
|
+
readonly modelId: Schema.NonEmptyString;
|
|
3696
|
+
readonly settings: Schema.optionalKey<Schema.Unknown>;
|
|
3697
|
+
}>;
|
|
3698
|
+
readonly outcome: Schema.TaggedUnion<{
|
|
3699
|
+
readonly Completed: Schema.TaggedStruct<"Completed", {}>;
|
|
3700
|
+
readonly Failed: Schema.TaggedStruct<"Failed", {
|
|
3701
|
+
readonly error: Schema.Struct<{
|
|
3702
|
+
readonly message: Schema.String;
|
|
3703
|
+
readonly code: Schema.optionalKey<Schema.String>;
|
|
3704
|
+
readonly details: Schema.optionalKey<Schema.Unknown>;
|
|
3705
|
+
}>;
|
|
3706
|
+
}>;
|
|
3707
|
+
readonly Interrupted: Schema.TaggedStruct<"Interrupted", {
|
|
3708
|
+
readonly reason: Schema.String;
|
|
3709
|
+
}>;
|
|
3710
|
+
readonly Running: Schema.TaggedStruct<"Running", {}>;
|
|
3711
|
+
}>;
|
|
3712
|
+
readonly continuationOf: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
|
|
3713
|
+
}>>;
|
|
3714
|
+
readonly kind: Schema.tag<"runGroup">;
|
|
3715
|
+
readonly id: Schema.TemplateLiteral<readonly ["run:", Schema.brand<Schema.String, "RunId">]>;
|
|
3716
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3717
|
+
}>, Schema.Struct<{
|
|
3718
|
+
readonly activeRunId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
|
|
3719
|
+
readonly activeCompactionId: Schema.optionalKey<Schema.brand<Schema.String, "CompactionId">>;
|
|
3720
|
+
readonly modelSelection: Schema.optionalKey<Schema.Struct<{
|
|
3721
|
+
readonly provider: Schema.NonEmptyString;
|
|
3722
|
+
readonly modelId: Schema.NonEmptyString;
|
|
3723
|
+
readonly settings: Schema.optionalKey<Schema.Unknown>;
|
|
3724
|
+
}>>;
|
|
3725
|
+
readonly lastRunModelSelection: Schema.optionalKey<Schema.Struct<{
|
|
3726
|
+
readonly provider: Schema.NonEmptyString;
|
|
3727
|
+
readonly modelId: Schema.NonEmptyString;
|
|
3728
|
+
readonly settings: Schema.optionalKey<Schema.Unknown>;
|
|
3729
|
+
}>>;
|
|
3730
|
+
readonly tokenUsage: Schema.Struct<{
|
|
3731
|
+
readonly byModel: Schema.$Array<Schema.Struct<{
|
|
3732
|
+
readonly provider: Schema.NonEmptyString;
|
|
3733
|
+
readonly modelId: Schema.NonEmptyString;
|
|
3734
|
+
readonly usage: Schema.Struct<{
|
|
3735
|
+
readonly inputTokens: Schema.Int;
|
|
3736
|
+
readonly cachedInputTokens: Schema.Int;
|
|
3737
|
+
readonly cacheWriteInputTokens: Schema.Int;
|
|
3738
|
+
readonly outputTokens: Schema.Int;
|
|
3739
|
+
readonly textTokens: Schema.Int;
|
|
3740
|
+
readonly reasoningTokens: Schema.Int;
|
|
3741
|
+
}>;
|
|
3742
|
+
}>>;
|
|
3743
|
+
}>;
|
|
3744
|
+
readonly decorations: Schema.$Record<Schema.String, Schema.TaggedUnion<{
|
|
3745
|
+
readonly List: Schema.TaggedStruct<"List", {
|
|
3746
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
3747
|
+
readonly key: Schema.Union<readonly [Schema.String, Schema.Int]>;
|
|
3748
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3749
|
+
readonly id: Schema.optionalKey<Schema.NonEmptyString>;
|
|
3750
|
+
}>>;
|
|
3751
|
+
}>;
|
|
3752
|
+
readonly Value: Schema.TaggedStruct<"Value", {
|
|
3753
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3754
|
+
}>;
|
|
3755
|
+
}>>;
|
|
3756
|
+
readonly kind: Schema.tag<"sessionContext">;
|
|
3757
|
+
readonly id: Schema.Literal<"session">;
|
|
3758
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3759
|
+
}>, Schema.Struct<{
|
|
3760
|
+
readonly operations: Schema.$Array<Schema.Struct<{
|
|
3761
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3762
|
+
readonly mapping: Schema.String;
|
|
3763
|
+
readonly operation: Schema.Int;
|
|
3764
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3765
|
+
readonly entryKey: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
3766
|
+
readonly entryId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
3767
|
+
}>>;
|
|
3768
|
+
readonly kind: Schema.tag<"decorationBuffer">;
|
|
3769
|
+
readonly id: Schema.TemplateLiteral<readonly ["decorations:", Schema.Literals<readonly ["command", "idempotencyKey"]>, ":", Schema.NonEmptyString]>;
|
|
3770
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3771
|
+
}>]>, Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.Struct<{
|
|
3772
|
+
readonly format: Schema.Int;
|
|
3773
|
+
readonly kind: Schema.NonEmptyString;
|
|
3774
|
+
readonly id: Schema.NonEmptyString;
|
|
3775
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3776
|
+
readonly position: Schema.optionalKey<Schema.Struct<{
|
|
3777
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3778
|
+
readonly ordinal: Schema.Int;
|
|
3779
|
+
}>>;
|
|
3780
|
+
readonly body: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
3781
|
+
}>, never, never>, never, never>, Schema.decodeTo<Schema.Struct<{
|
|
3782
|
+
readonly kind: Schema.tag<"unknown">;
|
|
3783
|
+
readonly originalKind: Schema.NonEmptyString;
|
|
3784
|
+
readonly format: Schema.Int;
|
|
3785
|
+
readonly body: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
3786
|
+
readonly id: Schema.NonEmptyString;
|
|
3787
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3788
|
+
readonly position: Schema.optionalKey<Schema.Struct<{
|
|
3789
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3790
|
+
readonly ordinal: Schema.Int;
|
|
3791
|
+
}>>;
|
|
3792
|
+
}>, Schema.Struct<{
|
|
3793
|
+
readonly format: Schema.Int;
|
|
3794
|
+
readonly kind: Schema.NonEmptyString;
|
|
3795
|
+
readonly id: Schema.NonEmptyString;
|
|
3796
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3797
|
+
readonly position: Schema.optionalKey<Schema.Struct<{
|
|
3798
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3799
|
+
readonly ordinal: Schema.Int;
|
|
3800
|
+
}>>;
|
|
3801
|
+
readonly body: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
3802
|
+
}>, never, never>]>>;
|
|
3803
|
+
readonly dependencyIds: Schema.$Array<Schema.NonEmptyString>;
|
|
3804
|
+
readonly activeContent: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
3805
|
+
readonly assistantId: Schema.TemplateLiteral<readonly ["assistant:", Schema.brand<Schema.String, "InferenceId">]>;
|
|
3806
|
+
readonly parts: Schema.$Array<Schema.Struct<{
|
|
3807
|
+
readonly id: Schema.NonEmptyString;
|
|
3808
|
+
readonly part: Schema.Union<readonly [Schema.TaggedUnion<{
|
|
3809
|
+
readonly Reasoning: Schema.TaggedStruct<"Reasoning", {
|
|
3810
|
+
readonly text: Schema.String;
|
|
3811
|
+
}>;
|
|
3812
|
+
readonly Text: Schema.TaggedStruct<"Text", {
|
|
3813
|
+
readonly text: Schema.String;
|
|
3814
|
+
}>;
|
|
3815
|
+
readonly ToolCall: Schema.TaggedStruct<"ToolCall", {
|
|
3816
|
+
readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
|
|
3817
|
+
readonly toolName: Schema.NonEmptyString;
|
|
3818
|
+
readonly providerExecuted: Schema.Boolean;
|
|
3819
|
+
readonly toolId: Schema.optionalKey<Schema.TemplateLiteral<readonly ["tool:", Schema.brand<Schema.String, "ToolCallId">]>>;
|
|
3820
|
+
}>;
|
|
3821
|
+
readonly ToolResult: Schema.TaggedStruct<"ToolResult", {
|
|
3822
|
+
readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
|
|
3823
|
+
readonly toolName: Schema.NonEmptyString;
|
|
3824
|
+
readonly isFailure: Schema.Boolean;
|
|
3825
|
+
readonly result: Schema.TaggedUnion<{
|
|
3826
|
+
readonly Inline: Schema.TaggedStruct<"Inline", {
|
|
3827
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3828
|
+
readonly source: Schema.Struct<{
|
|
3829
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3830
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
3831
|
+
}>;
|
|
3832
|
+
}>;
|
|
3833
|
+
readonly Ref: Schema.TaggedStruct<"Ref", {
|
|
3834
|
+
readonly source: Schema.Struct<{
|
|
3835
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3836
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
3837
|
+
}>;
|
|
3838
|
+
readonly byteLength: Schema.Int;
|
|
3839
|
+
}>;
|
|
3840
|
+
}>;
|
|
3841
|
+
}>;
|
|
3842
|
+
readonly Unknown: Schema.TaggedStruct<"Unknown", {
|
|
3843
|
+
readonly partType: Schema.String;
|
|
3844
|
+
}>;
|
|
3845
|
+
}>, Schema.decodeTo<Schema.toType<Schema.TaggedStruct<"Unknown", {
|
|
3846
|
+
readonly partType: Schema.String;
|
|
3847
|
+
}>>, Schema.Struct<{
|
|
3848
|
+
readonly _tag: Schema.String;
|
|
3849
|
+
}>, never, never>]>;
|
|
3850
|
+
readonly paramsText: Schema.optionalKey<Schema.String>;
|
|
3851
|
+
}>>;
|
|
3852
|
+
}>>>;
|
|
3853
|
+
readonly requestId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
3854
|
+
}>;
|
|
3855
|
+
}>;
|
|
3856
|
+
type EDATranscriptUpdateFrame = typeof EDATranscriptUpdateFrame.Type;
|
|
3857
|
+
/**
|
|
3858
|
+
* One slice of an update too large for a frame. `data` slices concatenated in `index` order are
|
|
3859
|
+
* the JSON of one `TranscriptUpdate`; the client applies it only after slice `count - 1` (the
|
|
3860
|
+
* completion marker) and discards a transfer that is interrupted.
|
|
3861
|
+
*/
|
|
3862
|
+
declare const EDATranscriptChunkFrame: Schema.Struct<{
|
|
3863
|
+
readonly _tag: Schema.Literal<"transcript-chunk">;
|
|
3864
|
+
readonly frameId: Schema.Int;
|
|
3865
|
+
readonly updateSeq: Schema.Int;
|
|
3866
|
+
readonly index: Schema.Int;
|
|
3867
|
+
readonly count: Schema.Int;
|
|
3868
|
+
readonly data: Schema.String;
|
|
3869
|
+
}>;
|
|
3870
|
+
type EDATranscriptChunkFrame = typeof EDATranscriptChunkFrame.Type;
|
|
3871
|
+
/** Every server frame a transcript socket may carry. */
|
|
3872
|
+
declare const EDATranscriptServerFrame: Schema.Union<readonly [Schema.Struct<{
|
|
3873
|
+
readonly _tag: Schema.Literal<"hello">;
|
|
3874
|
+
readonly protocolVersion: Schema.Literal<1>;
|
|
3875
|
+
readonly subscriberId: Schema.NonEmptyString;
|
|
3876
|
+
readonly resumeSeq: Schema.Int;
|
|
3877
|
+
readonly flowControl: Schema.Struct<{
|
|
3878
|
+
readonly ackTimeoutMs: Schema.Int;
|
|
3879
|
+
readonly heartbeatIntervalMs: Schema.Int;
|
|
3880
|
+
readonly maxFrameBytes: Schema.Int;
|
|
3881
|
+
readonly maxFrameEvents: Schema.Int;
|
|
3882
|
+
readonly maxInFlightFrames: Schema.Int;
|
|
3883
|
+
readonly pingIntervalMs: Schema.optionalKey<Schema.Int>;
|
|
3884
|
+
readonly subscriberBufferCapacityEvents: Schema.Int;
|
|
3885
|
+
}>;
|
|
3886
|
+
readonly negotiation: Schema.Struct<{
|
|
3887
|
+
readonly protocolMajor: Schema.Int;
|
|
3888
|
+
readonly wireVersion: Schema.Int;
|
|
3889
|
+
/** Optional features this server speaks; clients ignore names they do not know. */
|
|
3890
|
+
readonly capabilities: Schema.$Array<Schema.String>;
|
|
3891
|
+
}>;
|
|
3892
|
+
}>, Schema.Struct<{
|
|
3893
|
+
readonly _tag: Schema.Literal<"transcript">;
|
|
3894
|
+
readonly frameId: Schema.Int;
|
|
3895
|
+
readonly update: Schema.Struct<{
|
|
3896
|
+
readonly updateSeq: Schema.Int;
|
|
3897
|
+
readonly mode: Schema.Literals<readonly ["replace", "patch"]>;
|
|
3898
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
3899
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
3900
|
+
readonly throughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3901
|
+
readonly coverage: Schema.optionalKey<Schema.Struct<{
|
|
3902
|
+
readonly from: Schema.Struct<{
|
|
3903
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
3904
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
3905
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3906
|
+
readonly ordinal: Schema.Int;
|
|
3907
|
+
readonly recordId: Schema.NonEmptyString;
|
|
3908
|
+
}>;
|
|
3909
|
+
readonly to: Schema.Struct<{
|
|
3910
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
3911
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
3912
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3913
|
+
readonly ordinal: Schema.Int;
|
|
3914
|
+
readonly recordId: Schema.NonEmptyString;
|
|
3915
|
+
}>;
|
|
3916
|
+
}>>;
|
|
3917
|
+
readonly hasOlder: Schema.Boolean;
|
|
3918
|
+
readonly hasNewer: Schema.Boolean;
|
|
3919
|
+
readonly readiness: Schema.Union<readonly [Schema.TaggedUnion<{
|
|
3920
|
+
readonly Building: Schema.TaggedStruct<"Building", {}>;
|
|
3921
|
+
readonly Degraded: Schema.TaggedStruct<"Degraded", {
|
|
3922
|
+
readonly failedAtSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
3923
|
+
readonly error: Schema.String;
|
|
3924
|
+
}>;
|
|
3925
|
+
readonly Ready: Schema.TaggedStruct<"Ready", {}>;
|
|
3926
|
+
readonly Unknown: Schema.TaggedStruct<"Unknown", {
|
|
3927
|
+
readonly readinessType: Schema.String;
|
|
3928
|
+
}>;
|
|
3929
|
+
readonly Unreadable: Schema.TaggedStruct<"Unreadable", {
|
|
3930
|
+
readonly error: Schema.String;
|
|
3931
|
+
}>;
|
|
3932
|
+
readonly UpdatingHistory: Schema.TaggedStruct<"UpdatingHistory", {}>;
|
|
3933
|
+
}>, Schema.decodeTo<Schema.toType<Schema.TaggedStruct<"Unknown", {
|
|
3934
|
+
readonly readinessType: Schema.String;
|
|
3935
|
+
}>>, Schema.Struct<{
|
|
3936
|
+
readonly _tag: Schema.String;
|
|
3937
|
+
}>, never, never>]>;
|
|
3938
|
+
readonly records: Schema.$Array<Schema.Union<readonly [Schema.decodeTo<Schema.Union<readonly [Schema.Struct<{
|
|
3939
|
+
readonly commandId: Schema.brand<Schema.String, "CommandId">;
|
|
3940
|
+
readonly messageIds: Schema.$Array<Schema.brand<Schema.String, "MessageId">>;
|
|
3941
|
+
readonly idempotencyKey: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "CommandIdempotencyKey">>;
|
|
3942
|
+
readonly disposition: Schema.optionalKey<Schema.Literals<readonly ["queue", "steer", "interrupt"]>>;
|
|
3943
|
+
readonly content: Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
|
|
3944
|
+
readonly type: Schema.Literal<"text">;
|
|
3945
|
+
readonly text: Schema.String;
|
|
3946
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
3947
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
3948
|
+
}>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
3949
|
+
readonly type: Schema.Literal<"text">;
|
|
3950
|
+
readonly text: Schema.String;
|
|
3951
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
3952
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
3953
|
+
}>, Schema.decodeTo<Schema.Struct<{
|
|
3954
|
+
readonly type: Schema.Literal<"file">;
|
|
3955
|
+
readonly mediaType: Schema.String;
|
|
3956
|
+
readonly fileName: Schema.optional<Schema.String>;
|
|
3957
|
+
readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
|
|
3958
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
3959
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
3960
|
+
}>, Schema.Struct<{
|
|
3961
|
+
readonly type: Schema.Literal<"file">;
|
|
3962
|
+
readonly mediaType: Schema.String;
|
|
3963
|
+
readonly fileName: Schema.optional<Schema.String>;
|
|
3964
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
3965
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
3966
|
+
readonly data: Schema.String;
|
|
3967
|
+
}>, never, never>]>>]>;
|
|
3968
|
+
readonly state: Schema.TaggedUnion<{
|
|
3969
|
+
readonly Cancelled: Schema.TaggedStruct<"Cancelled", {
|
|
3970
|
+
readonly reason: Schema.String;
|
|
3971
|
+
readonly byCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
|
|
3972
|
+
}>;
|
|
3973
|
+
readonly Consumed: Schema.TaggedStruct<"Consumed", {
|
|
3974
|
+
readonly turnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
|
|
3975
|
+
readonly runId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
|
|
3976
|
+
}>;
|
|
3977
|
+
readonly Paused: Schema.TaggedStruct<"Paused", {
|
|
3978
|
+
readonly byCommandId: Schema.brand<Schema.String, "CommandId">;
|
|
3979
|
+
}>;
|
|
3980
|
+
readonly Pending: Schema.TaggedStruct<"Pending", {}>;
|
|
3981
|
+
readonly Promoted: Schema.TaggedStruct<"Promoted", {}>;
|
|
3982
|
+
readonly Steering: Schema.TaggedStruct<"Steering", {}>;
|
|
3983
|
+
}>;
|
|
3984
|
+
readonly steering: Schema.optionalKey<Schema.Struct<{
|
|
3985
|
+
readonly runId: Schema.brand<Schema.String, "RunId">;
|
|
3986
|
+
}>>;
|
|
3987
|
+
readonly classification: Schema.optionalKey<Schema.String>;
|
|
3988
|
+
readonly decorations: Schema.$Record<Schema.String, Schema.TaggedUnion<{
|
|
3989
|
+
readonly List: Schema.TaggedStruct<"List", {
|
|
3990
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
3991
|
+
readonly key: Schema.Union<readonly [Schema.String, Schema.Int]>;
|
|
3992
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3993
|
+
readonly id: Schema.optionalKey<Schema.NonEmptyString>;
|
|
3994
|
+
}>>;
|
|
3995
|
+
}>;
|
|
3996
|
+
readonly Value: Schema.TaggedStruct<"Value", {
|
|
3997
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3998
|
+
}>;
|
|
3999
|
+
}>>;
|
|
4000
|
+
readonly submittedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4001
|
+
readonly submittedAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
|
|
4002
|
+
readonly consumedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
4003
|
+
readonly kind: Schema.tag<"user">;
|
|
4004
|
+
readonly id: Schema.TemplateLiteral<readonly ["user:", Schema.brand<Schema.String, "CommandId">]>;
|
|
4005
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4006
|
+
readonly position: Schema.optionalKey<Schema.Struct<{
|
|
4007
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4008
|
+
readonly ordinal: Schema.Int;
|
|
4009
|
+
}>>;
|
|
4010
|
+
}>, Schema.Struct<{
|
|
4011
|
+
readonly startedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
4012
|
+
readonly terminalAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
4013
|
+
readonly durationMs: Schema.optionalKey<Schema.Int>;
|
|
4014
|
+
readonly source: Schema.Literals<readonly ["inference", "import"]>;
|
|
4015
|
+
readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
|
|
4016
|
+
readonly runId: Schema.brand<Schema.String, "RunId">;
|
|
4017
|
+
readonly turnId: Schema.brand<Schema.String, "TurnId">;
|
|
4018
|
+
readonly runGroupId: Schema.optionalKey<Schema.TemplateLiteral<readonly ["run:", Schema.brand<Schema.String, "RunId">]>>;
|
|
4019
|
+
readonly messageId: Schema.optionalKey<Schema.brand<Schema.String, "MessageId">>;
|
|
4020
|
+
readonly lifecycle: Schema.TaggedUnion<{
|
|
4021
|
+
readonly Completed: Schema.TaggedStruct<"Completed", {
|
|
4022
|
+
readonly finishReason: Schema.optionalKey<Schema.String>;
|
|
4023
|
+
readonly usage: Schema.optionalKey<Schema.Struct<{
|
|
4024
|
+
readonly inputTokens: Schema.optionalKey<Schema.Int>;
|
|
4025
|
+
readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
|
|
4026
|
+
readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
|
|
4027
|
+
readonly outputTokens: Schema.optionalKey<Schema.Int>;
|
|
4028
|
+
readonly textTokens: Schema.optionalKey<Schema.Int>;
|
|
4029
|
+
readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
|
|
4030
|
+
}>>;
|
|
4031
|
+
}>;
|
|
4032
|
+
readonly Failed: Schema.TaggedStruct<"Failed", {
|
|
4033
|
+
readonly error: Schema.Struct<{
|
|
4034
|
+
readonly message: Schema.String;
|
|
4035
|
+
readonly code: Schema.optionalKey<Schema.String>;
|
|
4036
|
+
readonly details: Schema.optionalKey<Schema.Unknown>;
|
|
4037
|
+
}>;
|
|
4038
|
+
}>;
|
|
4039
|
+
readonly Streaming: Schema.TaggedStruct<"Streaming", {}>;
|
|
4040
|
+
}>;
|
|
4041
|
+
readonly parts: Schema.$Array<Schema.Union<readonly [Schema.TaggedUnion<{
|
|
4042
|
+
readonly Reasoning: Schema.TaggedStruct<"Reasoning", {
|
|
4043
|
+
readonly text: Schema.String;
|
|
4044
|
+
}>;
|
|
4045
|
+
readonly Text: Schema.TaggedStruct<"Text", {
|
|
4046
|
+
readonly text: Schema.String;
|
|
4047
|
+
}>;
|
|
4048
|
+
readonly ToolCall: Schema.TaggedStruct<"ToolCall", {
|
|
4049
|
+
readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
|
|
4050
|
+
readonly toolName: Schema.NonEmptyString;
|
|
4051
|
+
readonly providerExecuted: Schema.Boolean;
|
|
4052
|
+
readonly toolId: Schema.optionalKey<Schema.TemplateLiteral<readonly ["tool:", Schema.brand<Schema.String, "ToolCallId">]>>;
|
|
4053
|
+
}>;
|
|
4054
|
+
readonly ToolResult: Schema.TaggedStruct<"ToolResult", {
|
|
4055
|
+
readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
|
|
4056
|
+
readonly toolName: Schema.NonEmptyString;
|
|
4057
|
+
readonly isFailure: Schema.Boolean;
|
|
4058
|
+
readonly result: Schema.TaggedUnion<{
|
|
4059
|
+
readonly Inline: Schema.TaggedStruct<"Inline", {
|
|
4060
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
4061
|
+
readonly source: Schema.Struct<{
|
|
4062
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4063
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
4064
|
+
}>;
|
|
4065
|
+
}>;
|
|
4066
|
+
readonly Ref: Schema.TaggedStruct<"Ref", {
|
|
4067
|
+
readonly source: Schema.Struct<{
|
|
4068
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4069
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
4070
|
+
}>;
|
|
4071
|
+
readonly byteLength: Schema.Int;
|
|
4072
|
+
}>;
|
|
4073
|
+
}>;
|
|
4074
|
+
}>;
|
|
4075
|
+
readonly Unknown: Schema.TaggedStruct<"Unknown", {
|
|
4076
|
+
readonly partType: Schema.String;
|
|
4077
|
+
}>;
|
|
4078
|
+
}>, Schema.decodeTo<Schema.toType<Schema.TaggedStruct<"Unknown", {
|
|
4079
|
+
readonly partType: Schema.String;
|
|
4080
|
+
}>>, Schema.Struct<{
|
|
4081
|
+
readonly _tag: Schema.String;
|
|
4082
|
+
}>, never, never>]>>;
|
|
4083
|
+
readonly partial: Schema.optionalKey<Schema.Struct<{
|
|
4084
|
+
readonly reason: Schema.String;
|
|
4085
|
+
}>>;
|
|
4086
|
+
readonly kind: Schema.tag<"assistant">;
|
|
4087
|
+
readonly id: Schema.Union<readonly [Schema.TemplateLiteral<readonly ["assistant:", Schema.brand<Schema.String, "InferenceId">]>, Schema.TemplateLiteral<readonly ["import:", Schema.brand<Schema.String, "EventId">]>]>;
|
|
4088
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4089
|
+
readonly position: Schema.Struct<{
|
|
4090
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4091
|
+
readonly ordinal: Schema.Int;
|
|
4092
|
+
}>;
|
|
4093
|
+
}>, Schema.Struct<{
|
|
4094
|
+
readonly compactionId: Schema.brand<Schema.String, "CompactionId">;
|
|
4095
|
+
readonly summaryId: Schema.brand<Schema.String, "SummaryId">;
|
|
4096
|
+
readonly contextVersion: Schema.brand<Schema.Int, "ContextVersion">;
|
|
4097
|
+
readonly retainedFromContextSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4098
|
+
readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
|
|
4099
|
+
readonly completedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
4100
|
+
readonly kind: Schema.tag<"compaction">;
|
|
4101
|
+
readonly id: Schema.TemplateLiteral<readonly ["compaction:", Schema.brand<Schema.String, "CompactionId">]>;
|
|
4102
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4103
|
+
readonly position: Schema.Struct<{
|
|
4104
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4105
|
+
readonly ordinal: Schema.Int;
|
|
4106
|
+
}>;
|
|
4107
|
+
}>, Schema.Struct<{
|
|
4108
|
+
readonly startedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
4109
|
+
readonly terminalAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
4110
|
+
readonly durationMs: Schema.optionalKey<Schema.Int>;
|
|
4111
|
+
readonly toolCallId: Schema.brand<Schema.String, "ToolCallId">;
|
|
4112
|
+
readonly assistantId: Schema.TemplateLiteral<readonly ["assistant:", Schema.brand<Schema.String, "InferenceId">]>;
|
|
4113
|
+
readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
|
|
4114
|
+
readonly toolName: Schema.NonEmptyString;
|
|
4115
|
+
readonly providerExecuted: Schema.Boolean;
|
|
4116
|
+
readonly params: Schema.optionalKey<Schema.TaggedUnion<{
|
|
4117
|
+
readonly Inline: Schema.TaggedStruct<"Inline", {
|
|
4118
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
4119
|
+
readonly source: Schema.Struct<{
|
|
4120
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4121
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
4122
|
+
}>;
|
|
4123
|
+
}>;
|
|
4124
|
+
readonly Ref: Schema.TaggedStruct<"Ref", {
|
|
4125
|
+
readonly source: Schema.Struct<{
|
|
4126
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4127
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
4128
|
+
}>;
|
|
4129
|
+
readonly byteLength: Schema.Int;
|
|
4130
|
+
}>;
|
|
4131
|
+
}>>;
|
|
4132
|
+
readonly lifecycle: Schema.TaggedUnion<{
|
|
4133
|
+
readonly Completed: Schema.TaggedStruct<"Completed", {
|
|
4134
|
+
readonly result: Schema.TaggedUnion<{
|
|
4135
|
+
readonly Inline: Schema.TaggedStruct<"Inline", {
|
|
4136
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
4137
|
+
readonly source: Schema.Struct<{
|
|
4138
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4139
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
4140
|
+
}>;
|
|
4141
|
+
}>;
|
|
4142
|
+
readonly Ref: Schema.TaggedStruct<"Ref", {
|
|
4143
|
+
readonly source: Schema.Struct<{
|
|
4144
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4145
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
4146
|
+
}>;
|
|
4147
|
+
readonly byteLength: Schema.Int;
|
|
4148
|
+
}>;
|
|
4149
|
+
}>;
|
|
4150
|
+
}>;
|
|
4151
|
+
readonly Created: Schema.TaggedStruct<"Created", {}>;
|
|
4152
|
+
readonly Failed: Schema.TaggedStruct<"Failed", {
|
|
4153
|
+
readonly error: Schema.Struct<{
|
|
4154
|
+
readonly message: Schema.String;
|
|
4155
|
+
readonly code: Schema.optionalKey<Schema.String>;
|
|
4156
|
+
readonly details: Schema.optionalKey<Schema.Unknown>;
|
|
4157
|
+
}>;
|
|
4158
|
+
}>;
|
|
4159
|
+
readonly Rejected: Schema.TaggedStruct<"Rejected", {
|
|
4160
|
+
readonly reason: Schema.Literals<readonly ["unknown-tool", "invalid-params"]>;
|
|
4161
|
+
readonly message: Schema.String;
|
|
4162
|
+
readonly modelFeedback: Schema.String;
|
|
4163
|
+
}>;
|
|
4164
|
+
readonly Running: Schema.TaggedStruct<"Running", {}>;
|
|
4165
|
+
}>;
|
|
4166
|
+
readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
|
|
4167
|
+
readonly kind: Schema.tag<"tool">;
|
|
4168
|
+
readonly id: Schema.TemplateLiteral<readonly ["tool:", Schema.brand<Schema.String, "ToolCallId">]>;
|
|
4169
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4170
|
+
}>, Schema.Struct<{
|
|
4171
|
+
readonly rootRunId: Schema.brand<Schema.String, "RunId">;
|
|
4172
|
+
readonly runs: Schema.NonEmptyArray<Schema.Struct<{
|
|
4173
|
+
readonly startedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
4174
|
+
readonly terminalAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
4175
|
+
readonly durationMs: Schema.optionalKey<Schema.Int>;
|
|
4176
|
+
readonly runId: Schema.brand<Schema.String, "RunId">;
|
|
4177
|
+
readonly commandIds: Schema.$Array<Schema.brand<Schema.String, "CommandId">>;
|
|
4178
|
+
readonly modelSelection: Schema.Struct<{
|
|
4179
|
+
readonly provider: Schema.NonEmptyString;
|
|
4180
|
+
readonly modelId: Schema.NonEmptyString;
|
|
4181
|
+
readonly settings: Schema.optionalKey<Schema.Unknown>;
|
|
4182
|
+
}>;
|
|
4183
|
+
readonly outcome: Schema.TaggedUnion<{
|
|
4184
|
+
readonly Completed: Schema.TaggedStruct<"Completed", {}>;
|
|
4185
|
+
readonly Failed: Schema.TaggedStruct<"Failed", {
|
|
4186
|
+
readonly error: Schema.Struct<{
|
|
4187
|
+
readonly message: Schema.String;
|
|
4188
|
+
readonly code: Schema.optionalKey<Schema.String>;
|
|
4189
|
+
readonly details: Schema.optionalKey<Schema.Unknown>;
|
|
4190
|
+
}>;
|
|
4191
|
+
}>;
|
|
4192
|
+
readonly Interrupted: Schema.TaggedStruct<"Interrupted", {
|
|
4193
|
+
readonly reason: Schema.String;
|
|
4194
|
+
}>;
|
|
4195
|
+
readonly Running: Schema.TaggedStruct<"Running", {}>;
|
|
4196
|
+
}>;
|
|
4197
|
+
readonly continuationOf: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
|
|
4198
|
+
}>>;
|
|
4199
|
+
readonly kind: Schema.tag<"runGroup">;
|
|
4200
|
+
readonly id: Schema.TemplateLiteral<readonly ["run:", Schema.brand<Schema.String, "RunId">]>;
|
|
4201
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4202
|
+
}>, Schema.Struct<{
|
|
4203
|
+
readonly activeRunId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
|
|
4204
|
+
readonly activeCompactionId: Schema.optionalKey<Schema.brand<Schema.String, "CompactionId">>;
|
|
4205
|
+
readonly modelSelection: Schema.optionalKey<Schema.Struct<{
|
|
4206
|
+
readonly provider: Schema.NonEmptyString;
|
|
4207
|
+
readonly modelId: Schema.NonEmptyString;
|
|
4208
|
+
readonly settings: Schema.optionalKey<Schema.Unknown>;
|
|
4209
|
+
}>>;
|
|
4210
|
+
readonly lastRunModelSelection: Schema.optionalKey<Schema.Struct<{
|
|
4211
|
+
readonly provider: Schema.NonEmptyString;
|
|
4212
|
+
readonly modelId: Schema.NonEmptyString;
|
|
4213
|
+
readonly settings: Schema.optionalKey<Schema.Unknown>;
|
|
4214
|
+
}>>;
|
|
4215
|
+
readonly tokenUsage: Schema.Struct<{
|
|
4216
|
+
readonly byModel: Schema.$Array<Schema.Struct<{
|
|
4217
|
+
readonly provider: Schema.NonEmptyString;
|
|
4218
|
+
readonly modelId: Schema.NonEmptyString;
|
|
4219
|
+
readonly usage: Schema.Struct<{
|
|
4220
|
+
readonly inputTokens: Schema.Int;
|
|
4221
|
+
readonly cachedInputTokens: Schema.Int;
|
|
4222
|
+
readonly cacheWriteInputTokens: Schema.Int;
|
|
4223
|
+
readonly outputTokens: Schema.Int;
|
|
4224
|
+
readonly textTokens: Schema.Int;
|
|
4225
|
+
readonly reasoningTokens: Schema.Int;
|
|
4226
|
+
}>;
|
|
4227
|
+
}>>;
|
|
4228
|
+
}>;
|
|
4229
|
+
readonly decorations: Schema.$Record<Schema.String, Schema.TaggedUnion<{
|
|
4230
|
+
readonly List: Schema.TaggedStruct<"List", {
|
|
4231
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
4232
|
+
readonly key: Schema.Union<readonly [Schema.String, Schema.Int]>;
|
|
4233
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
4234
|
+
readonly id: Schema.optionalKey<Schema.NonEmptyString>;
|
|
4235
|
+
}>>;
|
|
4236
|
+
}>;
|
|
4237
|
+
readonly Value: Schema.TaggedStruct<"Value", {
|
|
4238
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
4239
|
+
}>;
|
|
4240
|
+
}>>;
|
|
4241
|
+
readonly kind: Schema.tag<"sessionContext">;
|
|
4242
|
+
readonly id: Schema.Literal<"session">;
|
|
4243
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4244
|
+
}>, Schema.Struct<{
|
|
4245
|
+
readonly operations: Schema.$Array<Schema.Struct<{
|
|
4246
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4247
|
+
readonly mapping: Schema.String;
|
|
4248
|
+
readonly operation: Schema.Int;
|
|
4249
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
4250
|
+
readonly entryKey: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
4251
|
+
readonly entryId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
4252
|
+
}>>;
|
|
4253
|
+
readonly kind: Schema.tag<"decorationBuffer">;
|
|
4254
|
+
readonly id: Schema.TemplateLiteral<readonly ["decorations:", Schema.Literals<readonly ["command", "idempotencyKey"]>, ":", Schema.NonEmptyString]>;
|
|
4255
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4256
|
+
}>]>, Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.Struct<{
|
|
4257
|
+
readonly format: Schema.Int;
|
|
4258
|
+
readonly kind: Schema.NonEmptyString;
|
|
4259
|
+
readonly id: Schema.NonEmptyString;
|
|
4260
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4261
|
+
readonly position: Schema.optionalKey<Schema.Struct<{
|
|
4262
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4263
|
+
readonly ordinal: Schema.Int;
|
|
4264
|
+
}>>;
|
|
4265
|
+
readonly body: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
4266
|
+
}>, never, never>, never, never>, Schema.decodeTo<Schema.Struct<{
|
|
4267
|
+
readonly kind: Schema.tag<"unknown">;
|
|
4268
|
+
readonly originalKind: Schema.NonEmptyString;
|
|
4269
|
+
readonly format: Schema.Int;
|
|
4270
|
+
readonly body: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
4271
|
+
readonly id: Schema.NonEmptyString;
|
|
4272
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4273
|
+
readonly position: Schema.optionalKey<Schema.Struct<{
|
|
4274
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4275
|
+
readonly ordinal: Schema.Int;
|
|
4276
|
+
}>>;
|
|
4277
|
+
}>, Schema.Struct<{
|
|
4278
|
+
readonly format: Schema.Int;
|
|
4279
|
+
readonly kind: Schema.NonEmptyString;
|
|
4280
|
+
readonly id: Schema.NonEmptyString;
|
|
4281
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4282
|
+
readonly position: Schema.optionalKey<Schema.Struct<{
|
|
4283
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4284
|
+
readonly ordinal: Schema.Int;
|
|
4285
|
+
}>>;
|
|
4286
|
+
readonly body: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
4287
|
+
}>, never, never>]>>;
|
|
4288
|
+
readonly dependencies: Schema.$Array<Schema.Union<readonly [Schema.decodeTo<Schema.Union<readonly [Schema.Struct<{
|
|
4289
|
+
readonly commandId: Schema.brand<Schema.String, "CommandId">;
|
|
4290
|
+
readonly messageIds: Schema.$Array<Schema.brand<Schema.String, "MessageId">>;
|
|
4291
|
+
readonly idempotencyKey: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "CommandIdempotencyKey">>;
|
|
4292
|
+
readonly disposition: Schema.optionalKey<Schema.Literals<readonly ["queue", "steer", "interrupt"]>>;
|
|
4293
|
+
readonly content: Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
|
|
4294
|
+
readonly type: Schema.Literal<"text">;
|
|
4295
|
+
readonly text: Schema.String;
|
|
4296
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
4297
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
4298
|
+
}>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
4299
|
+
readonly type: Schema.Literal<"text">;
|
|
4300
|
+
readonly text: Schema.String;
|
|
4301
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
4302
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
4303
|
+
}>, Schema.decodeTo<Schema.Struct<{
|
|
4304
|
+
readonly type: Schema.Literal<"file">;
|
|
4305
|
+
readonly mediaType: Schema.String;
|
|
4306
|
+
readonly fileName: Schema.optional<Schema.String>;
|
|
4307
|
+
readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
|
|
4308
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
4309
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
4310
|
+
}>, Schema.Struct<{
|
|
4311
|
+
readonly type: Schema.Literal<"file">;
|
|
4312
|
+
readonly mediaType: Schema.String;
|
|
4313
|
+
readonly fileName: Schema.optional<Schema.String>;
|
|
4314
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
4315
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
4316
|
+
readonly data: Schema.String;
|
|
4317
|
+
}>, never, never>]>>]>;
|
|
4318
|
+
readonly state: Schema.TaggedUnion<{
|
|
4319
|
+
readonly Cancelled: Schema.TaggedStruct<"Cancelled", {
|
|
4320
|
+
readonly reason: Schema.String;
|
|
4321
|
+
readonly byCommandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
|
|
4322
|
+
}>;
|
|
4323
|
+
readonly Consumed: Schema.TaggedStruct<"Consumed", {
|
|
4324
|
+
readonly turnId: Schema.optionalKey<Schema.brand<Schema.String, "TurnId">>;
|
|
4325
|
+
readonly runId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
|
|
4326
|
+
}>;
|
|
4327
|
+
readonly Paused: Schema.TaggedStruct<"Paused", {
|
|
4328
|
+
readonly byCommandId: Schema.brand<Schema.String, "CommandId">;
|
|
4329
|
+
}>;
|
|
4330
|
+
readonly Pending: Schema.TaggedStruct<"Pending", {}>;
|
|
4331
|
+
readonly Promoted: Schema.TaggedStruct<"Promoted", {}>;
|
|
4332
|
+
readonly Steering: Schema.TaggedStruct<"Steering", {}>;
|
|
4333
|
+
}>;
|
|
4334
|
+
readonly steering: Schema.optionalKey<Schema.Struct<{
|
|
4335
|
+
readonly runId: Schema.brand<Schema.String, "RunId">;
|
|
4336
|
+
}>>;
|
|
4337
|
+
readonly classification: Schema.optionalKey<Schema.String>;
|
|
4338
|
+
readonly decorations: Schema.$Record<Schema.String, Schema.TaggedUnion<{
|
|
4339
|
+
readonly List: Schema.TaggedStruct<"List", {
|
|
4340
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
4341
|
+
readonly key: Schema.Union<readonly [Schema.String, Schema.Int]>;
|
|
4342
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
4343
|
+
readonly id: Schema.optionalKey<Schema.NonEmptyString>;
|
|
4344
|
+
}>>;
|
|
4345
|
+
}>;
|
|
4346
|
+
readonly Value: Schema.TaggedStruct<"Value", {
|
|
4347
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
4348
|
+
}>;
|
|
4349
|
+
}>>;
|
|
4350
|
+
readonly submittedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4351
|
+
readonly submittedAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
|
|
4352
|
+
readonly consumedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
4353
|
+
readonly kind: Schema.tag<"user">;
|
|
4354
|
+
readonly id: Schema.TemplateLiteral<readonly ["user:", Schema.brand<Schema.String, "CommandId">]>;
|
|
4355
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4356
|
+
readonly position: Schema.optionalKey<Schema.Struct<{
|
|
4357
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4358
|
+
readonly ordinal: Schema.Int;
|
|
4359
|
+
}>>;
|
|
4360
|
+
}>, Schema.Struct<{
|
|
4361
|
+
readonly startedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
4362
|
+
readonly terminalAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
4363
|
+
readonly durationMs: Schema.optionalKey<Schema.Int>;
|
|
4364
|
+
readonly source: Schema.Literals<readonly ["inference", "import"]>;
|
|
4365
|
+
readonly inferenceId: Schema.brand<Schema.String, "InferenceId">;
|
|
4366
|
+
readonly runId: Schema.brand<Schema.String, "RunId">;
|
|
4367
|
+
readonly turnId: Schema.brand<Schema.String, "TurnId">;
|
|
4368
|
+
readonly runGroupId: Schema.optionalKey<Schema.TemplateLiteral<readonly ["run:", Schema.brand<Schema.String, "RunId">]>>;
|
|
4369
|
+
readonly messageId: Schema.optionalKey<Schema.brand<Schema.String, "MessageId">>;
|
|
4370
|
+
readonly lifecycle: Schema.TaggedUnion<{
|
|
4371
|
+
readonly Completed: Schema.TaggedStruct<"Completed", {
|
|
4372
|
+
readonly finishReason: Schema.optionalKey<Schema.String>;
|
|
4373
|
+
readonly usage: Schema.optionalKey<Schema.Struct<{
|
|
4374
|
+
readonly inputTokens: Schema.optionalKey<Schema.Int>;
|
|
4375
|
+
readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
|
|
4376
|
+
readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
|
|
4377
|
+
readonly outputTokens: Schema.optionalKey<Schema.Int>;
|
|
4378
|
+
readonly textTokens: Schema.optionalKey<Schema.Int>;
|
|
4379
|
+
readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
|
|
4380
|
+
}>>;
|
|
4381
|
+
}>;
|
|
4382
|
+
readonly Failed: Schema.TaggedStruct<"Failed", {
|
|
4383
|
+
readonly error: Schema.Struct<{
|
|
4384
|
+
readonly message: Schema.String;
|
|
4385
|
+
readonly code: Schema.optionalKey<Schema.String>;
|
|
4386
|
+
readonly details: Schema.optionalKey<Schema.Unknown>;
|
|
4387
|
+
}>;
|
|
4388
|
+
}>;
|
|
4389
|
+
readonly Streaming: Schema.TaggedStruct<"Streaming", {}>;
|
|
4390
|
+
}>;
|
|
4391
|
+
readonly parts: Schema.$Array<Schema.Union<readonly [Schema.TaggedUnion<{
|
|
4392
|
+
readonly Reasoning: Schema.TaggedStruct<"Reasoning", {
|
|
4393
|
+
readonly text: Schema.String;
|
|
4394
|
+
}>;
|
|
4395
|
+
readonly Text: Schema.TaggedStruct<"Text", {
|
|
4396
|
+
readonly text: Schema.String;
|
|
4397
|
+
}>;
|
|
4398
|
+
readonly ToolCall: Schema.TaggedStruct<"ToolCall", {
|
|
4399
|
+
readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
|
|
4400
|
+
readonly toolName: Schema.NonEmptyString;
|
|
4401
|
+
readonly providerExecuted: Schema.Boolean;
|
|
4402
|
+
readonly toolId: Schema.optionalKey<Schema.TemplateLiteral<readonly ["tool:", Schema.brand<Schema.String, "ToolCallId">]>>;
|
|
4403
|
+
}>;
|
|
4404
|
+
readonly ToolResult: Schema.TaggedStruct<"ToolResult", {
|
|
4405
|
+
readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
|
|
4406
|
+
readonly toolName: Schema.NonEmptyString;
|
|
4407
|
+
readonly isFailure: Schema.Boolean;
|
|
4408
|
+
readonly result: Schema.TaggedUnion<{
|
|
4409
|
+
readonly Inline: Schema.TaggedStruct<"Inline", {
|
|
4410
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
4411
|
+
readonly source: Schema.Struct<{
|
|
4412
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4413
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
4414
|
+
}>;
|
|
4415
|
+
}>;
|
|
4416
|
+
readonly Ref: Schema.TaggedStruct<"Ref", {
|
|
4417
|
+
readonly source: Schema.Struct<{
|
|
4418
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4419
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
4420
|
+
}>;
|
|
4421
|
+
readonly byteLength: Schema.Int;
|
|
4422
|
+
}>;
|
|
4423
|
+
}>;
|
|
4424
|
+
}>;
|
|
4425
|
+
readonly Unknown: Schema.TaggedStruct<"Unknown", {
|
|
4426
|
+
readonly partType: Schema.String;
|
|
4427
|
+
}>;
|
|
4428
|
+
}>, Schema.decodeTo<Schema.toType<Schema.TaggedStruct<"Unknown", {
|
|
4429
|
+
readonly partType: Schema.String;
|
|
4430
|
+
}>>, Schema.Struct<{
|
|
4431
|
+
readonly _tag: Schema.String;
|
|
4432
|
+
}>, never, never>]>>;
|
|
4433
|
+
readonly partial: Schema.optionalKey<Schema.Struct<{
|
|
4434
|
+
readonly reason: Schema.String;
|
|
4435
|
+
}>>;
|
|
4436
|
+
readonly kind: Schema.tag<"assistant">;
|
|
4437
|
+
readonly id: Schema.Union<readonly [Schema.TemplateLiteral<readonly ["assistant:", Schema.brand<Schema.String, "InferenceId">]>, Schema.TemplateLiteral<readonly ["import:", Schema.brand<Schema.String, "EventId">]>]>;
|
|
4438
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4439
|
+
readonly position: Schema.Struct<{
|
|
4440
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4441
|
+
readonly ordinal: Schema.Int;
|
|
4442
|
+
}>;
|
|
4443
|
+
}>, Schema.Struct<{
|
|
4444
|
+
readonly compactionId: Schema.brand<Schema.String, "CompactionId">;
|
|
4445
|
+
readonly summaryId: Schema.brand<Schema.String, "SummaryId">;
|
|
4446
|
+
readonly contextVersion: Schema.brand<Schema.Int, "ContextVersion">;
|
|
4447
|
+
readonly retainedFromContextSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4448
|
+
readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
|
|
4449
|
+
readonly completedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
4450
|
+
readonly kind: Schema.tag<"compaction">;
|
|
4451
|
+
readonly id: Schema.TemplateLiteral<readonly ["compaction:", Schema.brand<Schema.String, "CompactionId">]>;
|
|
4452
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4453
|
+
readonly position: Schema.Struct<{
|
|
4454
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4455
|
+
readonly ordinal: Schema.Int;
|
|
4456
|
+
}>;
|
|
4457
|
+
}>, Schema.Struct<{
|
|
4458
|
+
readonly startedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
4459
|
+
readonly terminalAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
4460
|
+
readonly durationMs: Schema.optionalKey<Schema.Int>;
|
|
4461
|
+
readonly toolCallId: Schema.brand<Schema.String, "ToolCallId">;
|
|
4462
|
+
readonly assistantId: Schema.TemplateLiteral<readonly ["assistant:", Schema.brand<Schema.String, "InferenceId">]>;
|
|
4463
|
+
readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
|
|
4464
|
+
readonly toolName: Schema.NonEmptyString;
|
|
4465
|
+
readonly providerExecuted: Schema.Boolean;
|
|
4466
|
+
readonly params: Schema.optionalKey<Schema.TaggedUnion<{
|
|
4467
|
+
readonly Inline: Schema.TaggedStruct<"Inline", {
|
|
4468
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
4469
|
+
readonly source: Schema.Struct<{
|
|
4470
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4471
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
4472
|
+
}>;
|
|
4473
|
+
}>;
|
|
4474
|
+
readonly Ref: Schema.TaggedStruct<"Ref", {
|
|
4475
|
+
readonly source: Schema.Struct<{
|
|
4476
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4477
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
4478
|
+
}>;
|
|
4479
|
+
readonly byteLength: Schema.Int;
|
|
4480
|
+
}>;
|
|
4481
|
+
}>>;
|
|
4482
|
+
readonly lifecycle: Schema.TaggedUnion<{
|
|
4483
|
+
readonly Completed: Schema.TaggedStruct<"Completed", {
|
|
4484
|
+
readonly result: Schema.TaggedUnion<{
|
|
4485
|
+
readonly Inline: Schema.TaggedStruct<"Inline", {
|
|
4486
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
4487
|
+
readonly source: Schema.Struct<{
|
|
4488
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4489
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
4490
|
+
}>;
|
|
4491
|
+
}>;
|
|
4492
|
+
readonly Ref: Schema.TaggedStruct<"Ref", {
|
|
4493
|
+
readonly source: Schema.Struct<{
|
|
4494
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4495
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
4496
|
+
}>;
|
|
4497
|
+
readonly byteLength: Schema.Int;
|
|
4498
|
+
}>;
|
|
4499
|
+
}>;
|
|
4500
|
+
}>;
|
|
4501
|
+
readonly Created: Schema.TaggedStruct<"Created", {}>;
|
|
4502
|
+
readonly Failed: Schema.TaggedStruct<"Failed", {
|
|
4503
|
+
readonly error: Schema.Struct<{
|
|
4504
|
+
readonly message: Schema.String;
|
|
4505
|
+
readonly code: Schema.optionalKey<Schema.String>;
|
|
4506
|
+
readonly details: Schema.optionalKey<Schema.Unknown>;
|
|
4507
|
+
}>;
|
|
4508
|
+
}>;
|
|
4509
|
+
readonly Rejected: Schema.TaggedStruct<"Rejected", {
|
|
4510
|
+
readonly reason: Schema.Literals<readonly ["unknown-tool", "invalid-params"]>;
|
|
4511
|
+
readonly message: Schema.String;
|
|
4512
|
+
readonly modelFeedback: Schema.String;
|
|
4513
|
+
}>;
|
|
4514
|
+
readonly Running: Schema.TaggedStruct<"Running", {}>;
|
|
4515
|
+
}>;
|
|
4516
|
+
readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
|
|
4517
|
+
readonly kind: Schema.tag<"tool">;
|
|
4518
|
+
readonly id: Schema.TemplateLiteral<readonly ["tool:", Schema.brand<Schema.String, "ToolCallId">]>;
|
|
4519
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4520
|
+
}>, Schema.Struct<{
|
|
4521
|
+
readonly rootRunId: Schema.brand<Schema.String, "RunId">;
|
|
4522
|
+
readonly runs: Schema.NonEmptyArray<Schema.Struct<{
|
|
4523
|
+
readonly startedAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
4524
|
+
readonly terminalAtMs: Schema.optionalKey<Schema.brand<Schema.Int, "UnixEpochMillis">>;
|
|
4525
|
+
readonly durationMs: Schema.optionalKey<Schema.Int>;
|
|
4526
|
+
readonly runId: Schema.brand<Schema.String, "RunId">;
|
|
4527
|
+
readonly commandIds: Schema.$Array<Schema.brand<Schema.String, "CommandId">>;
|
|
4528
|
+
readonly modelSelection: Schema.Struct<{
|
|
4529
|
+
readonly provider: Schema.NonEmptyString;
|
|
4530
|
+
readonly modelId: Schema.NonEmptyString;
|
|
4531
|
+
readonly settings: Schema.optionalKey<Schema.Unknown>;
|
|
4532
|
+
}>;
|
|
4533
|
+
readonly outcome: Schema.TaggedUnion<{
|
|
4534
|
+
readonly Completed: Schema.TaggedStruct<"Completed", {}>;
|
|
4535
|
+
readonly Failed: Schema.TaggedStruct<"Failed", {
|
|
4536
|
+
readonly error: Schema.Struct<{
|
|
4537
|
+
readonly message: Schema.String;
|
|
4538
|
+
readonly code: Schema.optionalKey<Schema.String>;
|
|
4539
|
+
readonly details: Schema.optionalKey<Schema.Unknown>;
|
|
4540
|
+
}>;
|
|
4541
|
+
}>;
|
|
4542
|
+
readonly Interrupted: Schema.TaggedStruct<"Interrupted", {
|
|
4543
|
+
readonly reason: Schema.String;
|
|
4544
|
+
}>;
|
|
4545
|
+
readonly Running: Schema.TaggedStruct<"Running", {}>;
|
|
4546
|
+
}>;
|
|
4547
|
+
readonly continuationOf: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
|
|
4548
|
+
}>>;
|
|
4549
|
+
readonly kind: Schema.tag<"runGroup">;
|
|
4550
|
+
readonly id: Schema.TemplateLiteral<readonly ["run:", Schema.brand<Schema.String, "RunId">]>;
|
|
4551
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4552
|
+
}>, Schema.Struct<{
|
|
4553
|
+
readonly activeRunId: Schema.optionalKey<Schema.brand<Schema.String, "RunId">>;
|
|
4554
|
+
readonly activeCompactionId: Schema.optionalKey<Schema.brand<Schema.String, "CompactionId">>;
|
|
4555
|
+
readonly modelSelection: Schema.optionalKey<Schema.Struct<{
|
|
4556
|
+
readonly provider: Schema.NonEmptyString;
|
|
4557
|
+
readonly modelId: Schema.NonEmptyString;
|
|
4558
|
+
readonly settings: Schema.optionalKey<Schema.Unknown>;
|
|
4559
|
+
}>>;
|
|
4560
|
+
readonly lastRunModelSelection: Schema.optionalKey<Schema.Struct<{
|
|
4561
|
+
readonly provider: Schema.NonEmptyString;
|
|
4562
|
+
readonly modelId: Schema.NonEmptyString;
|
|
4563
|
+
readonly settings: Schema.optionalKey<Schema.Unknown>;
|
|
4564
|
+
}>>;
|
|
4565
|
+
readonly tokenUsage: Schema.Struct<{
|
|
4566
|
+
readonly byModel: Schema.$Array<Schema.Struct<{
|
|
4567
|
+
readonly provider: Schema.NonEmptyString;
|
|
4568
|
+
readonly modelId: Schema.NonEmptyString;
|
|
4569
|
+
readonly usage: Schema.Struct<{
|
|
4570
|
+
readonly inputTokens: Schema.Int;
|
|
4571
|
+
readonly cachedInputTokens: Schema.Int;
|
|
4572
|
+
readonly cacheWriteInputTokens: Schema.Int;
|
|
4573
|
+
readonly outputTokens: Schema.Int;
|
|
4574
|
+
readonly textTokens: Schema.Int;
|
|
4575
|
+
readonly reasoningTokens: Schema.Int;
|
|
4576
|
+
}>;
|
|
4577
|
+
}>>;
|
|
4578
|
+
}>;
|
|
4579
|
+
readonly decorations: Schema.$Record<Schema.String, Schema.TaggedUnion<{
|
|
4580
|
+
readonly List: Schema.TaggedStruct<"List", {
|
|
4581
|
+
readonly entries: Schema.$Array<Schema.Struct<{
|
|
4582
|
+
readonly key: Schema.Union<readonly [Schema.String, Schema.Int]>;
|
|
4583
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
4584
|
+
readonly id: Schema.optionalKey<Schema.NonEmptyString>;
|
|
4585
|
+
}>>;
|
|
4586
|
+
}>;
|
|
4587
|
+
readonly Value: Schema.TaggedStruct<"Value", {
|
|
4588
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
4589
|
+
}>;
|
|
4590
|
+
}>>;
|
|
4591
|
+
readonly kind: Schema.tag<"sessionContext">;
|
|
4592
|
+
readonly id: Schema.Literal<"session">;
|
|
4593
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4594
|
+
}>, Schema.Struct<{
|
|
4595
|
+
readonly operations: Schema.$Array<Schema.Struct<{
|
|
4596
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4597
|
+
readonly mapping: Schema.String;
|
|
4598
|
+
readonly operation: Schema.Int;
|
|
4599
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
4600
|
+
readonly entryKey: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
4601
|
+
readonly entryId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
4602
|
+
}>>;
|
|
4603
|
+
readonly kind: Schema.tag<"decorationBuffer">;
|
|
4604
|
+
readonly id: Schema.TemplateLiteral<readonly ["decorations:", Schema.Literals<readonly ["command", "idempotencyKey"]>, ":", Schema.NonEmptyString]>;
|
|
4605
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4606
|
+
}>]>, Schema.decodeTo<Schema.$Record<Schema.String, Schema.Unknown>, Schema.Struct<{
|
|
4607
|
+
readonly format: Schema.Int;
|
|
4608
|
+
readonly kind: Schema.NonEmptyString;
|
|
4609
|
+
readonly id: Schema.NonEmptyString;
|
|
4610
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4611
|
+
readonly position: Schema.optionalKey<Schema.Struct<{
|
|
4612
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4613
|
+
readonly ordinal: Schema.Int;
|
|
4614
|
+
}>>;
|
|
4615
|
+
readonly body: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
4616
|
+
}>, never, never>, never, never>, Schema.decodeTo<Schema.Struct<{
|
|
4617
|
+
readonly kind: Schema.tag<"unknown">;
|
|
4618
|
+
readonly originalKind: Schema.NonEmptyString;
|
|
4619
|
+
readonly format: Schema.Int;
|
|
4620
|
+
readonly body: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
4621
|
+
readonly id: Schema.NonEmptyString;
|
|
4622
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4623
|
+
readonly position: Schema.optionalKey<Schema.Struct<{
|
|
4624
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4625
|
+
readonly ordinal: Schema.Int;
|
|
4626
|
+
}>>;
|
|
4627
|
+
}>, Schema.Struct<{
|
|
4628
|
+
readonly format: Schema.Int;
|
|
4629
|
+
readonly kind: Schema.NonEmptyString;
|
|
4630
|
+
readonly id: Schema.NonEmptyString;
|
|
4631
|
+
readonly updatedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4632
|
+
readonly position: Schema.optionalKey<Schema.Struct<{
|
|
4633
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4634
|
+
readonly ordinal: Schema.Int;
|
|
4635
|
+
}>>;
|
|
4636
|
+
readonly body: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
4637
|
+
}>, never, never>]>>;
|
|
4638
|
+
readonly dependencyIds: Schema.$Array<Schema.NonEmptyString>;
|
|
4639
|
+
readonly activeContent: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
4640
|
+
readonly assistantId: Schema.TemplateLiteral<readonly ["assistant:", Schema.brand<Schema.String, "InferenceId">]>;
|
|
4641
|
+
readonly parts: Schema.$Array<Schema.Struct<{
|
|
4642
|
+
readonly id: Schema.NonEmptyString;
|
|
4643
|
+
readonly part: Schema.Union<readonly [Schema.TaggedUnion<{
|
|
4644
|
+
readonly Reasoning: Schema.TaggedStruct<"Reasoning", {
|
|
4645
|
+
readonly text: Schema.String;
|
|
4646
|
+
}>;
|
|
4647
|
+
readonly Text: Schema.TaggedStruct<"Text", {
|
|
4648
|
+
readonly text: Schema.String;
|
|
4649
|
+
}>;
|
|
4650
|
+
readonly ToolCall: Schema.TaggedStruct<"ToolCall", {
|
|
4651
|
+
readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
|
|
4652
|
+
readonly toolName: Schema.NonEmptyString;
|
|
4653
|
+
readonly providerExecuted: Schema.Boolean;
|
|
4654
|
+
readonly toolId: Schema.optionalKey<Schema.TemplateLiteral<readonly ["tool:", Schema.brand<Schema.String, "ToolCallId">]>>;
|
|
4655
|
+
}>;
|
|
4656
|
+
readonly ToolResult: Schema.TaggedStruct<"ToolResult", {
|
|
4657
|
+
readonly providerPartId: Schema.brand<Schema.NonEmptyString, "ProviderPartId">;
|
|
4658
|
+
readonly toolName: Schema.NonEmptyString;
|
|
4659
|
+
readonly isFailure: Schema.Boolean;
|
|
4660
|
+
readonly result: Schema.TaggedUnion<{
|
|
4661
|
+
readonly Inline: Schema.TaggedStruct<"Inline", {
|
|
4662
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
4663
|
+
readonly source: Schema.Struct<{
|
|
4664
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4665
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
4666
|
+
}>;
|
|
4667
|
+
}>;
|
|
4668
|
+
readonly Ref: Schema.TaggedStruct<"Ref", {
|
|
4669
|
+
readonly source: Schema.Struct<{
|
|
4670
|
+
readonly seq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4671
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Int]>>;
|
|
4672
|
+
}>;
|
|
4673
|
+
readonly byteLength: Schema.Int;
|
|
4674
|
+
}>;
|
|
4675
|
+
}>;
|
|
4676
|
+
}>;
|
|
4677
|
+
readonly Unknown: Schema.TaggedStruct<"Unknown", {
|
|
4678
|
+
readonly partType: Schema.String;
|
|
4679
|
+
}>;
|
|
4680
|
+
}>, Schema.decodeTo<Schema.toType<Schema.TaggedStruct<"Unknown", {
|
|
4681
|
+
readonly partType: Schema.String;
|
|
4682
|
+
}>>, Schema.Struct<{
|
|
4683
|
+
readonly _tag: Schema.String;
|
|
4684
|
+
}>, never, never>]>;
|
|
4685
|
+
readonly paramsText: Schema.optionalKey<Schema.String>;
|
|
4686
|
+
}>>;
|
|
4687
|
+
}>>>;
|
|
4688
|
+
readonly requestId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
4689
|
+
}>;
|
|
4690
|
+
}>, Schema.Struct<{
|
|
4691
|
+
readonly _tag: Schema.Literal<"transcript-chunk">;
|
|
4692
|
+
readonly frameId: Schema.Int;
|
|
4693
|
+
readonly updateSeq: Schema.Int;
|
|
4694
|
+
readonly index: Schema.Int;
|
|
4695
|
+
readonly count: Schema.Int;
|
|
4696
|
+
readonly data: Schema.String;
|
|
4697
|
+
}>, Schema.Struct<{
|
|
4698
|
+
readonly _tag: Schema.Literal<"pong">;
|
|
4699
|
+
}>, Schema.Struct<{
|
|
4700
|
+
readonly _tag: Schema.Literal<"lagged">;
|
|
4701
|
+
readonly resumeSeq: Schema.Int;
|
|
4702
|
+
readonly reason: Schema.Literals<readonly ["buffer-overflow", "ack-timeout"]>;
|
|
4703
|
+
}>, Schema.Struct<{
|
|
4704
|
+
readonly _tag: Schema.Literal<"error">;
|
|
4705
|
+
readonly message: Schema.String;
|
|
4706
|
+
}>]>;
|
|
4707
|
+
type EDATranscriptServerFrame = typeof EDATranscriptServerFrame.Type;
|
|
4708
|
+
/**
|
|
4709
|
+
* Start or restart the subscription. After SSR, `range` is what the page rendered, `tail` its
|
|
4710
|
+
* `!hasNewer`, and `since` its `throughSeq`; a reconnecting client sends what it last applied.
|
|
4711
|
+
* Without `range` the server replies with the latest `count` records.
|
|
4712
|
+
*/
|
|
4713
|
+
declare const EDATranscriptSubscribeFrame: Schema.Struct<{
|
|
4714
|
+
readonly _tag: Schema.Literal<"subscribe">;
|
|
4715
|
+
readonly requestId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
4716
|
+
readonly range: Schema.optionalKey<Schema.Struct<{
|
|
4717
|
+
readonly from: Schema.Struct<{
|
|
4718
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
4719
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
4720
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4721
|
+
readonly ordinal: Schema.Int;
|
|
4722
|
+
readonly recordId: Schema.NonEmptyString;
|
|
4723
|
+
}>;
|
|
4724
|
+
readonly to: Schema.Struct<{
|
|
4725
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
4726
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
4727
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4728
|
+
readonly ordinal: Schema.Int;
|
|
4729
|
+
readonly recordId: Schema.NonEmptyString;
|
|
4730
|
+
}>;
|
|
4731
|
+
}>>;
|
|
4732
|
+
readonly tail: Schema.optionalKey<Schema.Boolean>;
|
|
4733
|
+
readonly since: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
|
|
4734
|
+
readonly count: Schema.optionalKey<Schema.Int>;
|
|
4735
|
+
}>;
|
|
4736
|
+
type EDATranscriptSubscribeFrame = typeof EDATranscriptSubscribeFrame.Type;
|
|
4737
|
+
/** Extend the coverage from its edge: `cursor` is the coverage's `from` (before) or `to` (after). */
|
|
4738
|
+
declare const EDATranscriptPageFrame: Schema.Struct<{
|
|
4739
|
+
readonly _tag: Schema.Literal<"page">;
|
|
4740
|
+
readonly requestId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
4741
|
+
readonly direction: Schema.Literals<readonly ["before", "after"]>;
|
|
4742
|
+
readonly cursor: Schema.Struct<{
|
|
4743
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
4744
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
4745
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4746
|
+
readonly ordinal: Schema.Int;
|
|
4747
|
+
readonly recordId: Schema.NonEmptyString;
|
|
4748
|
+
}>;
|
|
4749
|
+
readonly count: Schema.Int;
|
|
4750
|
+
}>;
|
|
4751
|
+
type EDATranscriptPageFrame = typeof EDATranscriptPageFrame.Type;
|
|
4752
|
+
/** Narrow the coverage to a span inside it, so the server stops sending changes outside it. */
|
|
4753
|
+
declare const EDATranscriptRetainFrame: Schema.Struct<{
|
|
4754
|
+
readonly _tag: Schema.Literal<"retain">;
|
|
4755
|
+
readonly requestId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
4756
|
+
readonly from: Schema.Struct<{
|
|
4757
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
4758
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
4759
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4760
|
+
readonly ordinal: Schema.Int;
|
|
4761
|
+
readonly recordId: Schema.NonEmptyString;
|
|
4762
|
+
}>;
|
|
4763
|
+
readonly to: Schema.Struct<{
|
|
4764
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
4765
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
4766
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4767
|
+
readonly ordinal: Schema.Int;
|
|
4768
|
+
readonly recordId: Schema.NonEmptyString;
|
|
4769
|
+
}>;
|
|
4770
|
+
}>;
|
|
4771
|
+
type EDATranscriptRetainFrame = typeof EDATranscriptRetainFrame.Type;
|
|
4772
|
+
/** A client request; each is answered by exactly one update, in arrival order. */
|
|
4773
|
+
declare const EDATranscriptRequestFrame: Schema.Union<readonly [Schema.Struct<{
|
|
4774
|
+
readonly _tag: Schema.Literal<"subscribe">;
|
|
4775
|
+
readonly requestId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
4776
|
+
readonly range: Schema.optionalKey<Schema.Struct<{
|
|
4777
|
+
readonly from: Schema.Struct<{
|
|
4778
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
4779
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
4780
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4781
|
+
readonly ordinal: Schema.Int;
|
|
4782
|
+
readonly recordId: Schema.NonEmptyString;
|
|
4783
|
+
}>;
|
|
4784
|
+
readonly to: Schema.Struct<{
|
|
4785
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
4786
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
4787
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4788
|
+
readonly ordinal: Schema.Int;
|
|
4789
|
+
readonly recordId: Schema.NonEmptyString;
|
|
4790
|
+
}>;
|
|
4791
|
+
}>>;
|
|
4792
|
+
readonly tail: Schema.optionalKey<Schema.Boolean>;
|
|
4793
|
+
readonly since: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
|
|
4794
|
+
readonly count: Schema.optionalKey<Schema.Int>;
|
|
4795
|
+
}>, Schema.Struct<{
|
|
4796
|
+
readonly _tag: Schema.Literal<"page">;
|
|
4797
|
+
readonly requestId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
4798
|
+
readonly direction: Schema.Literals<readonly ["before", "after"]>;
|
|
4799
|
+
readonly cursor: Schema.Struct<{
|
|
4800
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
4801
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
4802
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4803
|
+
readonly ordinal: Schema.Int;
|
|
4804
|
+
readonly recordId: Schema.NonEmptyString;
|
|
4805
|
+
}>;
|
|
4806
|
+
readonly count: Schema.Int;
|
|
4807
|
+
}>, Schema.Struct<{
|
|
4808
|
+
readonly _tag: Schema.Literal<"retain">;
|
|
4809
|
+
readonly requestId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
4810
|
+
readonly from: Schema.Struct<{
|
|
4811
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
4812
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
4813
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4814
|
+
readonly ordinal: Schema.Int;
|
|
4815
|
+
readonly recordId: Schema.NonEmptyString;
|
|
4816
|
+
}>;
|
|
4817
|
+
readonly to: Schema.Struct<{
|
|
4818
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
4819
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
4820
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4821
|
+
readonly ordinal: Schema.Int;
|
|
4822
|
+
readonly recordId: Schema.NonEmptyString;
|
|
4823
|
+
}>;
|
|
4824
|
+
}>]>;
|
|
4825
|
+
type EDATranscriptRequestFrame = typeof EDATranscriptRequestFrame.Type;
|
|
4826
|
+
/** Every client frame a transcript socket accepts. */
|
|
4827
|
+
declare const EDATranscriptClientFrame: Schema.Union<readonly [Schema.Struct<{
|
|
4828
|
+
readonly _tag: Schema.Literal<"ack">;
|
|
4829
|
+
readonly frameId: Schema.Int;
|
|
4830
|
+
readonly durableThroughSeq: Schema.Int;
|
|
4831
|
+
readonly appliedUpdateSeq: Schema.optionalKey<Schema.Int>;
|
|
4832
|
+
}>, Schema.Struct<{
|
|
4833
|
+
readonly _tag: Schema.Literal<"ping">;
|
|
4834
|
+
}>, Schema.Struct<{
|
|
4835
|
+
readonly _tag: Schema.Literal<"subscribe">;
|
|
4836
|
+
readonly requestId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
4837
|
+
readonly range: Schema.optionalKey<Schema.Struct<{
|
|
4838
|
+
readonly from: Schema.Struct<{
|
|
4839
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
4840
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
4841
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4842
|
+
readonly ordinal: Schema.Int;
|
|
4843
|
+
readonly recordId: Schema.NonEmptyString;
|
|
4844
|
+
}>;
|
|
4845
|
+
readonly to: Schema.Struct<{
|
|
4846
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
4847
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
4848
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4849
|
+
readonly ordinal: Schema.Int;
|
|
4850
|
+
readonly recordId: Schema.NonEmptyString;
|
|
4851
|
+
}>;
|
|
4852
|
+
}>>;
|
|
4853
|
+
readonly tail: Schema.optionalKey<Schema.Boolean>;
|
|
4854
|
+
readonly since: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
|
|
4855
|
+
readonly count: Schema.optionalKey<Schema.Int>;
|
|
4856
|
+
}>, Schema.Struct<{
|
|
4857
|
+
readonly _tag: Schema.Literal<"page">;
|
|
4858
|
+
readonly requestId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
4859
|
+
readonly direction: Schema.Literals<readonly ["before", "after"]>;
|
|
4860
|
+
readonly cursor: Schema.Struct<{
|
|
4861
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
4862
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
4863
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4864
|
+
readonly ordinal: Schema.Int;
|
|
4865
|
+
readonly recordId: Schema.NonEmptyString;
|
|
4866
|
+
}>;
|
|
4867
|
+
readonly count: Schema.Int;
|
|
4868
|
+
}>, Schema.Struct<{
|
|
4869
|
+
readonly _tag: Schema.Literal<"retain">;
|
|
4870
|
+
readonly requestId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
4871
|
+
readonly from: Schema.Struct<{
|
|
4872
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
4873
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
4874
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4875
|
+
readonly ordinal: Schema.Int;
|
|
4876
|
+
readonly recordId: Schema.NonEmptyString;
|
|
4877
|
+
}>;
|
|
4878
|
+
readonly to: Schema.Struct<{
|
|
4879
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
4880
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
4881
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
4882
|
+
readonly ordinal: Schema.Int;
|
|
4883
|
+
readonly recordId: Schema.NonEmptyString;
|
|
4884
|
+
}>;
|
|
4885
|
+
}>]>;
|
|
4886
|
+
type EDATranscriptClientFrame = typeof EDATranscriptClientFrame.Type;
|
|
4887
|
+
/** Serialize one update once; frames embed this text, chunks slice it. */
|
|
4888
|
+
declare const encodeEDATranscriptUpdate: (update: TranscriptUpdate) => string;
|
|
4889
|
+
/** Serialize a non-update server frame. */
|
|
4890
|
+
declare const encodeEDATranscriptServerFrame: (frame: EDATranscriptServerFrame) => string;
|
|
4891
|
+
/** The single-frame form of an encoded update. */
|
|
4892
|
+
declare const edaTranscriptUpdateFrameText: (frameId: number, encodedUpdate: string) => string;
|
|
4893
|
+
/** One chunk frame of an encoded update. */
|
|
4894
|
+
declare const edaTranscriptChunkFrameText: (input: {
|
|
4895
|
+
readonly frameId: number;
|
|
4896
|
+
readonly updateSeq: number;
|
|
4897
|
+
readonly index: number;
|
|
4898
|
+
readonly count: number;
|
|
4899
|
+
readonly data: string;
|
|
4900
|
+
}) => string;
|
|
4901
|
+
/** UTF-8 byte length of a string. */
|
|
4902
|
+
declare const utf8ByteLength: (text: string) => number;
|
|
4903
|
+
/**
|
|
4904
|
+
* Split an encoded update into chunk data that each fit a frame of `maxFrameBytes`, never
|
|
4905
|
+
* splitting a surrogate pair.
|
|
4906
|
+
*/
|
|
4907
|
+
declare const splitEDATranscriptUpdate: (encodedUpdate: string, maxFrameBytes: number) => ReadonlyArray<string>;
|
|
4908
|
+
//#endregion
|
|
4909
|
+
//#region src/websocket/transcript-client.d.ts
|
|
4910
|
+
/**
|
|
4911
|
+
* The window a client holds: always exactly one complete cut. Top-level records are in
|
|
4912
|
+
* transcript order; dependencies are keyed by id and ordered as the server listed them.
|
|
4913
|
+
*/
|
|
4914
|
+
interface EDATranscriptClientWindow {
|
|
4915
|
+
readonly incarnation: TranscriptLogIncarnation;
|
|
4916
|
+
readonly version: TranscriptVersion;
|
|
4917
|
+
readonly throughSeq: SequenceNumber;
|
|
4918
|
+
readonly coverage: TranscriptCoverage | undefined;
|
|
4919
|
+
readonly hasOlder: boolean;
|
|
4920
|
+
readonly hasNewer: boolean;
|
|
4921
|
+
readonly readiness: TranscriptReadiness;
|
|
4922
|
+
readonly records: ReadonlyArray<TranscriptRecordView>;
|
|
4923
|
+
readonly dependencies: ReadonlyArray<TranscriptRecordView>;
|
|
4924
|
+
readonly activeContent: ReadonlyArray<TranscriptActiveContent>;
|
|
4925
|
+
}
|
|
4926
|
+
/**
|
|
4927
|
+
* Reference client state for one transcript socket, independent of any UI framework.
|
|
4928
|
+
*
|
|
4929
|
+
* Hosts feed every server message to `applyEDATranscriptServerMessage`, send the ACK it returns,
|
|
4930
|
+
* and render `window`. Chunked updates are assembled here and applied only when complete, so the
|
|
4931
|
+
* rendered window never shows a partial update.
|
|
4932
|
+
*/
|
|
4933
|
+
interface EDATranscriptClientState {
|
|
4934
|
+
readonly window: EDATranscriptClientWindow | undefined;
|
|
4935
|
+
/** Highest frame id received on the current socket. */
|
|
4936
|
+
readonly lastFrameId: number;
|
|
4937
|
+
/** The last update applied on the current socket. */
|
|
4938
|
+
readonly appliedUpdateSeq: number;
|
|
4939
|
+
readonly assembling: {
|
|
4940
|
+
readonly updateSeq: number;
|
|
4941
|
+
readonly count: number;
|
|
4942
|
+
readonly data: ReadonlyArray<string>;
|
|
4943
|
+
} | undefined;
|
|
4944
|
+
}
|
|
4945
|
+
/** A client that has rendered nothing yet. */
|
|
4946
|
+
declare const emptyEDATranscriptClientState: EDATranscriptClientState;
|
|
4947
|
+
/** Seed a client from the window its page was server-rendered with. */
|
|
4948
|
+
declare const edaTranscriptClientFromWindow: (window: TranscriptWindow) => EDATranscriptClientState;
|
|
4949
|
+
/**
|
|
4950
|
+
* Prepare for a new socket: per-socket counters restart and any partial transfer is discarded.
|
|
4951
|
+
* The applied window is kept; the next `subscribe` asks for changes since it.
|
|
4952
|
+
*/
|
|
4953
|
+
declare const edaTranscriptClientReconnected: (state: EDATranscriptClientState) => EDATranscriptClientState;
|
|
4954
|
+
/** What one server message did. */
|
|
4955
|
+
type EDATranscriptClientOutcome = {
|
|
4956
|
+
readonly _tag: "Hello";
|
|
4957
|
+
readonly negotiation: EDATranscriptNegotiationResult;
|
|
4958
|
+
} | {
|
|
4959
|
+
readonly _tag: "Applied";
|
|
4960
|
+
readonly updateSeq: number;
|
|
4961
|
+
readonly requestId?: string;
|
|
4962
|
+
} | {
|
|
4963
|
+
readonly _tag: "Partial";
|
|
4964
|
+
} | {
|
|
4965
|
+
readonly _tag: "Ignored";
|
|
4966
|
+
} |
|
|
4967
|
+
/** The stream is unusable (a gap, a bad frame, a protocol close): reconnect and resubscribe. */
|
|
4968
|
+
{
|
|
4969
|
+
readonly _tag: "Resubscribe";
|
|
4970
|
+
readonly reason: string;
|
|
4971
|
+
};
|
|
4972
|
+
interface EDATranscriptClientStep {
|
|
4973
|
+
readonly state: EDATranscriptClientState;
|
|
4974
|
+
readonly outcome: EDATranscriptClientOutcome;
|
|
4975
|
+
/** Send this ACK when present: a transport receipt plus the applied cut. */
|
|
4976
|
+
readonly ack?: EDAWebSocketWireAckFrame;
|
|
4977
|
+
}
|
|
4978
|
+
/** Apply one server text message. Frames must arrive in frame-id order without gaps. */
|
|
4979
|
+
declare const applyEDATranscriptServerMessage: (state: EDATranscriptClientState, message: string) => EDATranscriptClientStep;
|
|
4980
|
+
/**
|
|
4981
|
+
* The request a client sends first on every socket: changes since the window it holds over the
|
|
4982
|
+
* span it holds, or the latest `count` records when it holds none.
|
|
4983
|
+
*/
|
|
4984
|
+
declare const edaTranscriptSubscribeRequest: (state: EDATranscriptClientState, options?: {
|
|
4985
|
+
readonly count?: number;
|
|
4986
|
+
readonly requestId?: string;
|
|
4987
|
+
}) => EDATranscriptSubscribeFrame;
|
|
4988
|
+
/** Page from the held coverage's edge, or `undefined` when there is nothing to page from. */
|
|
4989
|
+
declare const edaTranscriptPageRequest: (state: EDATranscriptClientState, direction: "before" | "after", count: number, requestId?: string) => EDATranscriptPageFrame | undefined;
|
|
4990
|
+
/**
|
|
4991
|
+
* Keep only the top-level records from `fromIndex` to `toIndex` (inclusive) of the held window;
|
|
4992
|
+
* the server confirms with an update whose coverage is the narrowed span.
|
|
4993
|
+
*/
|
|
4994
|
+
declare const edaTranscriptRetainRequest: (state: EDATranscriptClientState, fromIndex: number, toIndex: number, requestId?: string) => EDATranscriptRetainFrame | undefined;
|
|
4995
|
+
//#endregion
|
|
4996
|
+
//#region src/websocket/transcript-delivery.d.ts
|
|
4997
|
+
/** A chunked update whose frames are not all sent yet; its chunk data is volatile. */
|
|
4998
|
+
declare const EDATranscriptTransfer: Schema.Struct<{
|
|
4999
|
+
readonly updateSeq: Schema.Int;
|
|
5000
|
+
readonly throughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
5001
|
+
readonly count: Schema.Int;
|
|
5002
|
+
readonly nextIndex: Schema.Int;
|
|
5003
|
+
}>;
|
|
5004
|
+
type EDATranscriptTransfer = typeof EDATranscriptTransfer.Type;
|
|
5005
|
+
/**
|
|
5006
|
+
* Everything a transcript socket needs to resume after hibernation, persisted in its attachment
|
|
5007
|
+
* before every send and after every applied ACK.
|
|
5008
|
+
*
|
|
5009
|
+
* Transport receipts (`inFlight`, `lastAckedFrameId`) bound frames in flight exactly as on an
|
|
5010
|
+
* event socket. The applied cut (`appliedUpdateSeq`, `appliedThroughSeq`) is the last update the
|
|
5011
|
+
* client applied completely. `subscription` is the base the next update is planned against, and
|
|
5012
|
+
* `requests` are client requests not yet answered. A persisted `transfer` means chunk data was
|
|
5013
|
+
* staged in memory; a socket restored with one cannot finish it and is closed.
|
|
5014
|
+
*/
|
|
5015
|
+
declare const EDATranscriptDeliveryCheckpoint: Schema.Struct<{
|
|
5016
|
+
readonly lastAckedFrameId: Schema.Int;
|
|
5017
|
+
readonly nextFrameId: Schema.Int;
|
|
5018
|
+
readonly inFlight: Schema.$Array<Schema.Struct<{
|
|
5019
|
+
readonly frameId: Schema.Int;
|
|
5020
|
+
readonly sentAtMs: Schema.Number;
|
|
5021
|
+
}>>;
|
|
5022
|
+
readonly nextUpdateSeq: Schema.Int;
|
|
5023
|
+
readonly completedUpdateSeq: Schema.Int;
|
|
5024
|
+
readonly completedThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
5025
|
+
readonly appliedUpdateSeq: Schema.Int;
|
|
5026
|
+
readonly appliedThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
5027
|
+
readonly transfer: Schema.optionalKey<Schema.Struct<{
|
|
5028
|
+
readonly updateSeq: Schema.Int;
|
|
5029
|
+
readonly throughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
5030
|
+
readonly count: Schema.Int;
|
|
5031
|
+
readonly nextIndex: Schema.Int;
|
|
5032
|
+
}>>;
|
|
5033
|
+
readonly subscription: Schema.optionalKey<Schema.Struct<{
|
|
5034
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
5035
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
5036
|
+
readonly throughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
5037
|
+
readonly coverage: Schema.optionalKey<Schema.Struct<{
|
|
5038
|
+
readonly from: Schema.Struct<{
|
|
5039
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
5040
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
5041
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
5042
|
+
readonly ordinal: Schema.Int;
|
|
5043
|
+
readonly recordId: Schema.NonEmptyString;
|
|
5044
|
+
}>;
|
|
5045
|
+
readonly to: Schema.Struct<{
|
|
5046
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
5047
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
5048
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
5049
|
+
readonly ordinal: Schema.Int;
|
|
5050
|
+
readonly recordId: Schema.NonEmptyString;
|
|
5051
|
+
}>;
|
|
5052
|
+
}>>;
|
|
5053
|
+
readonly tail: Schema.Boolean;
|
|
5054
|
+
}>>;
|
|
5055
|
+
readonly requests: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
5056
|
+
readonly _tag: Schema.Literal<"subscribe">;
|
|
5057
|
+
readonly requestId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
5058
|
+
readonly range: Schema.optionalKey<Schema.Struct<{
|
|
5059
|
+
readonly from: Schema.Struct<{
|
|
5060
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
5061
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
5062
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
5063
|
+
readonly ordinal: Schema.Int;
|
|
5064
|
+
readonly recordId: Schema.NonEmptyString;
|
|
5065
|
+
}>;
|
|
5066
|
+
readonly to: Schema.Struct<{
|
|
5067
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
5068
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
5069
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
5070
|
+
readonly ordinal: Schema.Int;
|
|
5071
|
+
readonly recordId: Schema.NonEmptyString;
|
|
5072
|
+
}>;
|
|
5073
|
+
}>>;
|
|
5074
|
+
readonly tail: Schema.optionalKey<Schema.Boolean>;
|
|
5075
|
+
readonly since: Schema.optionalKey<Schema.brand<Schema.Int, "SequenceNumber">>;
|
|
5076
|
+
readonly count: Schema.optionalKey<Schema.Int>;
|
|
5077
|
+
}>, Schema.Struct<{
|
|
5078
|
+
readonly _tag: Schema.Literal<"page">;
|
|
5079
|
+
readonly requestId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
5080
|
+
readonly direction: Schema.Literals<readonly ["before", "after"]>;
|
|
5081
|
+
readonly cursor: Schema.Struct<{
|
|
5082
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
5083
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
5084
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
5085
|
+
readonly ordinal: Schema.Int;
|
|
5086
|
+
readonly recordId: Schema.NonEmptyString;
|
|
5087
|
+
}>;
|
|
5088
|
+
readonly count: Schema.Int;
|
|
5089
|
+
}>, Schema.Struct<{
|
|
5090
|
+
readonly _tag: Schema.Literal<"retain">;
|
|
5091
|
+
readonly requestId: Schema.optionalKey<Schema.NonEmptyString>;
|
|
5092
|
+
readonly from: Schema.Struct<{
|
|
5093
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
5094
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
5095
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
5096
|
+
readonly ordinal: Schema.Int;
|
|
5097
|
+
readonly recordId: Schema.NonEmptyString;
|
|
5098
|
+
}>;
|
|
5099
|
+
readonly to: Schema.Struct<{
|
|
5100
|
+
readonly incarnation: Schema.brand<Schema.NonEmptyString, "TranscriptLogIncarnation">;
|
|
5101
|
+
readonly version: Schema.brand<Schema.String, "TranscriptVersion">;
|
|
5102
|
+
readonly anchorSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
5103
|
+
readonly ordinal: Schema.Int;
|
|
5104
|
+
readonly recordId: Schema.NonEmptyString;
|
|
5105
|
+
}>;
|
|
5106
|
+
}>]>>;
|
|
5107
|
+
}>;
|
|
5108
|
+
type EDATranscriptDeliveryCheckpoint = typeof EDATranscriptDeliveryCheckpoint.Type;
|
|
5109
|
+
/** Bounds on one transcript socket beyond the shared flow-control policy. */
|
|
5110
|
+
interface EDATranscriptDeliveryLimits {
|
|
5111
|
+
/** Largest encoded update staged for one transfer; a larger one closes the socket. */
|
|
5112
|
+
readonly maxStagedBytes: number;
|
|
5113
|
+
/** Unanswered client requests held at once; more is a protocol violation. */
|
|
5114
|
+
readonly maxPendingRequests: number;
|
|
5115
|
+
}
|
|
5116
|
+
declare const defaultEDATranscriptDeliveryLimits: EDATranscriptDeliveryLimits;
|
|
5117
|
+
/** In-memory state of one transcript socket. */
|
|
5118
|
+
interface EDATranscriptDeliveryState extends EDATranscriptDeliveryCheckpoint {
|
|
5119
|
+
readonly policy: EDAWebSocketFlowControl;
|
|
5120
|
+
/** Chunk data of `transfer` not yet sent, in order. Never persisted. */
|
|
5121
|
+
readonly staged: ReadonlyArray<string>;
|
|
5122
|
+
}
|
|
5123
|
+
/** Delivery state for a newly accepted transcript socket. */
|
|
5124
|
+
declare const makeTranscriptDeliveryState: (policy: EDAWebSocketFlowControl) => EDATranscriptDeliveryState;
|
|
5125
|
+
/**
|
|
5126
|
+
* Restore a hibernated transcript socket. A socket that was mid-transfer lost its staged chunks
|
|
5127
|
+
* with the isolate and cannot resume: the caller closes it and the client resubscribes.
|
|
5128
|
+
*/
|
|
5129
|
+
declare const restoreTranscriptDeliveryState: (policy: EDAWebSocketFlowControl, checkpoint: EDATranscriptDeliveryCheckpoint) => {
|
|
5130
|
+
readonly _tag: "Restored";
|
|
5131
|
+
readonly state: EDATranscriptDeliveryState;
|
|
5132
|
+
} | {
|
|
5133
|
+
readonly _tag: "TransferLost";
|
|
5134
|
+
};
|
|
5135
|
+
/** The attachment-safe part of the state. */
|
|
5136
|
+
declare const checkpointTranscriptDelivery: (state: EDATranscriptDeliveryState) => EDATranscriptDeliveryCheckpoint;
|
|
5137
|
+
/** Frames that may be sent before the client's next receipt. */
|
|
5138
|
+
declare const transcriptDeliveryCapacity: (state: EDATranscriptDeliveryState) => number;
|
|
5139
|
+
/** Lazily enforced ACK deadline: no resident timer, checked on each transition. */
|
|
5140
|
+
declare const transcriptAckTimedOut: (state: EDATranscriptDeliveryState, nowMs: number) => boolean;
|
|
5141
|
+
/** Result of a transition that may emit frames. */
|
|
5142
|
+
interface EDATranscriptSendResult {
|
|
5143
|
+
readonly state: EDATranscriptDeliveryState;
|
|
5144
|
+
/** Encoded frames to send in order, after persisting `state`. */
|
|
5145
|
+
readonly frames: ReadonlyArray<string>;
|
|
5146
|
+
}
|
|
5147
|
+
/**
|
|
5148
|
+
* Start sending one planned update, captured from its own snapshot.
|
|
5149
|
+
*
|
|
5150
|
+
* `subscription` becomes the base for the next update immediately: nothing else is sent until
|
|
5151
|
+
* this update's last frame is, so the client can only apply later updates on top of it. An
|
|
5152
|
+
* update within the frame limit is one frame; a larger one is chunked and as many chunks as
|
|
5153
|
+
* flow control allows are sent now, the rest staged.
|
|
5154
|
+
*/
|
|
5155
|
+
declare const startTranscriptUpdate: (state: EDATranscriptDeliveryState, input: {
|
|
5156
|
+
readonly update: TranscriptUpdate;
|
|
5157
|
+
readonly encodedUpdate: string;
|
|
5158
|
+
readonly subscription: TranscriptSubscriptionBase;
|
|
5159
|
+
}, limits: EDATranscriptDeliveryLimits, nowMs: number) => ({
|
|
5160
|
+
readonly _tag: "Sending";
|
|
5161
|
+
} & EDATranscriptSendResult) | {
|
|
5162
|
+
readonly _tag: "TooLarge";
|
|
5163
|
+
readonly bytes: number;
|
|
5164
|
+
};
|
|
5165
|
+
/** Send staged chunks of the transfer in progress while flow control allows. */
|
|
5166
|
+
declare const pumpTranscriptTransfer: (state: EDATranscriptDeliveryState, nowMs: number) => EDATranscriptSendResult;
|
|
5167
|
+
/** Outcome of one client ACK on a transcript socket. */
|
|
5168
|
+
type EDATranscriptAckResult = {
|
|
5169
|
+
readonly _tag: "Applied";
|
|
5170
|
+
readonly state: EDATranscriptDeliveryState;
|
|
5171
|
+
} | {
|
|
5172
|
+
readonly _tag: "Ignored";
|
|
5173
|
+
} | {
|
|
5174
|
+
readonly _tag: "ProtocolError";
|
|
5175
|
+
readonly message: string;
|
|
5176
|
+
};
|
|
5177
|
+
/**
|
|
5178
|
+
* Apply one ACK. The receipt frees flow-control capacity cumulatively; the applied cut may only
|
|
5179
|
+
* name an update whose frames were all sent, and never moves backwards.
|
|
5180
|
+
*/
|
|
5181
|
+
declare const onTranscriptAck: (state: EDATranscriptDeliveryState, ack: EDAWebSocketWireAckFrame) => EDATranscriptAckResult;
|
|
5182
|
+
/** Queue one client request, or report that the client exceeded its request bound. */
|
|
5183
|
+
declare const enqueueTranscriptRequest: (state: EDATranscriptDeliveryState, request: EDATranscriptRequestFrame, limits: EDATranscriptDeliveryLimits) => EDATranscriptDeliveryState | undefined;
|
|
5184
|
+
//#endregion
|
|
5185
|
+
export { EDAFrameworkWebSocketEvent, EDATranscriptAckResult, EDATranscriptChunkFrame, EDATranscriptClientFrame, EDATranscriptClientOutcome, EDATranscriptClientState, EDATranscriptClientStep, EDATranscriptClientWindow, EDATranscriptDeliveryCheckpoint, EDATranscriptDeliveryLimits, EDATranscriptDeliveryState, EDATranscriptHelloFrame, EDATranscriptNegotiation, EDATranscriptNegotiationResult, EDATranscriptPageFrame, EDATranscriptRequestFrame, EDATranscriptRetainFrame, EDATranscriptSendResult, EDATranscriptServerFrame, EDATranscriptSubscribeFrame, EDATranscriptTransfer, EDATranscriptUpdateFrame, EDAWebSocketAckFrame, EDAWebSocketClientFrame, EDAWebSocketDeliveryAction, EDAWebSocketDeliveryCheckpoint, EDAWebSocketDeliveryResult, EDAWebSocketDeliveryState, EDAWebSocketErrorFrame, EDAWebSocketEventConsumerPolicy, EDAWebSocketEventsFrame, EDAWebSocketFlowControl, EDAWebSocketHeartbeatFrame, EDAWebSocketHelloFrame, EDAWebSocketInFlightFrame, EDAWebSocketLaggedFrame, EDAWebSocketPingFrame, EDAWebSocketPongFrame, EDAWebSocketServerFrame, EDAWebSocketServerFrameEncoder, EDAWebSocketServerFrameInput, EDAWebSocketSuppressedRange, EDAWebSocketWireAckFrame, EDAWebSocketWireClientFrame, EDAWebSocketWireErrorFrame, EDAWebSocketWireFlowControl, EDAWebSocketWireHeartbeatFrame, EDAWebSocketWireHelloFrame, EDAWebSocketWireLaggedFrame, EDAWebSocketWirePingFrame, EDAWebSocketWirePongFrame, EDAWebSocketWireProtocol, EDA_TRANSCRIPT_PROTOCOL_MAJOR, EDA_TRANSCRIPT_WIRE_VERSION, EDA_WEB_SOCKET_PING_MESSAGE, EDA_WEB_SOCKET_PONG_MESSAGE, EDA_WEB_SOCKET_PROTOCOL_VERSION, EDA_WEB_SOCKET_WIRE_PROTOCOL_VERSION, EDA_WS_CLOSE_GOING_AWAY, EDA_WS_CLOSE_LAGGED, EDA_WS_CLOSE_PROTOCOL_ERROR, EDA_WS_CLOSE_SEND_FAILED, EDA_WS_CLOSE_TRANSCRIPT_RESUBSCRIBE, EDA_WS_CLOSE_UNSUPPORTED_DATA, FrameId, MakeDeliveryStateInput, SubscriberId, SubscriberLagReason, applyEDATranscriptServerMessage, checkpointTranscriptDelivery, checkpointWebSocketDeliveryState, decodeEDAWebSocketClientMessage, defaultEDATranscriptDeliveryLimits, defaultEDAWebSocketFlowControl, deliveryHelloFrame, edaFrameworkWebSocketWireProtocol, edaTranscriptChunkFrameText, edaTranscriptClientFromWindow, edaTranscriptClientReconnected, edaTranscriptNegotiation, edaTranscriptPageRequest, edaTranscriptRetainRequest, edaTranscriptSubscribeRequest, edaTranscriptUpdateFrameText, emptyEDATranscriptClientState, encodeEDATranscriptServerFrame, encodeEDATranscriptUpdate, encodeEDAWebSocketServerFrame, enqueueTranscriptRequest, laggedCloseReason, makeEDAWebSocketWireProtocol, makeTranscriptDeliveryState, makeWebSocketDeliveryState, negotiateEDATranscript, onClientAck, onDurableEvents, onEphemeralEvent, onHostSuppressedFrame, onTranscriptAck, pumpTranscriptTransfer, restoreTranscriptDeliveryState, restoreWebSocketDeliveryState, splitEDATranscriptUpdate, startTranscriptUpdate, transcriptAckTimedOut, transcriptDeliveryCapacity, utf8ByteLength };
|
|
2979
5186
|
//# sourceMappingURL=websocket.d.ts.map
|