@dxos/compute 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/dist/lib/AiMetering.mjs +1 -0
  2. package/dist/lib/Hook.mjs +1 -0
  3. package/dist/lib/Operation.mjs +3 -3
  4. package/dist/lib/Process.mjs +2 -2
  5. package/dist/lib/Trace.mjs +1 -1
  6. package/dist/lib/chunk-AgentIdentity.mjs +1 -1
  7. package/dist/lib/chunk-AgentService.mjs.map +1 -1
  8. package/dist/lib/chunk-AiMetering.mjs +77 -0
  9. package/dist/lib/chunk-AiMetering.mjs.map +1 -0
  10. package/dist/lib/chunk-Cancellation.mjs +1 -1
  11. package/dist/lib/chunk-Hook.mjs +78 -0
  12. package/dist/lib/chunk-Hook.mjs.map +1 -0
  13. package/dist/lib/chunk-Instructions.mjs +1 -1
  14. package/dist/lib/chunk-Operation.mjs +169 -5
  15. package/dist/lib/chunk-Operation.mjs.map +1 -1
  16. package/dist/lib/chunk-OperationHandlerSet.mjs +1 -1
  17. package/dist/lib/chunk-OperationRegistry.mjs +1 -1
  18. package/dist/lib/chunk-OperationRegistry.mjs.map +1 -1
  19. package/dist/lib/chunk-Process.mjs +18 -10
  20. package/dist/lib/chunk-Process.mjs.map +1 -1
  21. package/dist/lib/chunk-Project.mjs +52 -24
  22. package/dist/lib/chunk-Project.mjs.map +1 -1
  23. package/dist/lib/chunk-Reducer.mjs +827 -0
  24. package/dist/lib/chunk-Reducer.mjs.map +1 -0
  25. package/dist/lib/chunk-Routine.mjs +1 -1
  26. package/dist/lib/chunk-Runnable.mjs +1 -1
  27. package/dist/lib/chunk-ServiceResolver.mjs +1 -1
  28. package/dist/lib/chunk-Skill.mjs +10 -47
  29. package/dist/lib/chunk-Skill.mjs.map +1 -1
  30. package/dist/lib/chunk-Spec.mjs +49 -0
  31. package/dist/lib/chunk-Spec.mjs.map +1 -0
  32. package/dist/lib/chunk-SpecReview.mjs +98 -0
  33. package/dist/lib/chunk-SpecReview.mjs.map +1 -0
  34. package/dist/lib/chunk-SqlService.mjs.map +1 -1
  35. package/dist/lib/chunk-StorageService.mjs +1 -1
  36. package/dist/lib/chunk-Template.mjs +2 -2
  37. package/dist/lib/chunk-Trace.mjs +97 -13
  38. package/dist/lib/chunk-Trace.mjs.map +1 -1
  39. package/dist/lib/chunk-Trajectory.mjs +326 -0
  40. package/dist/lib/chunk-Trajectory.mjs.map +1 -0
  41. package/dist/lib/chunk-Transcript.mjs +84 -0
  42. package/dist/lib/chunk-Transcript.mjs.map +1 -0
  43. package/dist/lib/chunk-definitions.mjs +1 -1
  44. package/dist/lib/errors.mjs +3 -1
  45. package/dist/lib/errors.mjs.map +1 -1
  46. package/dist/lib/index.mjs +14 -8
  47. package/dist/lib/testing.mjs +2 -2
  48. package/dist/lib/trajectory/Reducer.mjs +1 -0
  49. package/dist/lib/trajectory/Trajectory.mjs +1 -0
  50. package/dist/lib/trajectory/Transcript.mjs +1 -0
  51. package/dist/lib/types/Project.mjs +1 -1
  52. package/dist/lib/types/Skill.mjs +1 -1
  53. package/dist/lib/types/Spec.mjs +1 -0
  54. package/dist/lib/types/SpecReview.mjs +1 -0
  55. package/dist/types/src/AgentService.d.ts +9 -0
  56. package/dist/types/src/AgentService.d.ts.map +1 -1
  57. package/dist/types/src/AiMetering.d.ts +23 -0
  58. package/dist/types/src/AiMetering.d.ts.map +1 -0
  59. package/dist/types/src/AiMetering.test.d.ts +2 -0
  60. package/dist/types/src/AiMetering.test.d.ts.map +1 -0
  61. package/dist/types/src/Hook.d.ts +84 -0
  62. package/dist/types/src/Hook.d.ts.map +1 -0
  63. package/dist/types/src/Hook.test.d.ts +2 -0
  64. package/dist/types/src/Hook.test.d.ts.map +1 -0
  65. package/dist/types/src/Operation.d.ts +276 -2
  66. package/dist/types/src/Operation.d.ts.map +1 -1
  67. package/dist/types/src/Process.d.ts +26 -4
  68. package/dist/types/src/Process.d.ts.map +1 -1
  69. package/dist/types/src/Script.test.d.ts +2 -0
  70. package/dist/types/src/Script.test.d.ts.map +1 -0
  71. package/dist/types/src/Trace.d.ts +103 -1
  72. package/dist/types/src/Trace.d.ts.map +1 -1
  73. package/dist/types/src/errors.d.ts +30 -0
  74. package/dist/types/src/errors.d.ts.map +1 -1
  75. package/dist/types/src/index.d.ts +3 -1
  76. package/dist/types/src/index.d.ts.map +1 -1
  77. package/dist/types/src/trajectory/Reducer.d.ts +191 -0
  78. package/dist/types/src/trajectory/Reducer.d.ts.map +1 -0
  79. package/dist/types/src/trajectory/Reducer.test.d.ts +2 -0
  80. package/dist/types/src/trajectory/Reducer.test.d.ts.map +1 -0
  81. package/dist/types/src/trajectory/Trajectory.d.ts +3211 -0
  82. package/dist/types/src/trajectory/Trajectory.d.ts.map +1 -0
  83. package/dist/types/src/trajectory/Trajectory.test.d.ts +2 -0
  84. package/dist/types/src/trajectory/Trajectory.test.d.ts.map +1 -0
  85. package/dist/types/src/trajectory/Transcript.d.ts +40 -0
  86. package/dist/types/src/trajectory/Transcript.d.ts.map +1 -0
  87. package/dist/types/src/trajectory/index.d.ts +4 -0
  88. package/dist/types/src/trajectory/index.d.ts.map +1 -0
  89. package/dist/types/src/trajectory/light-threads.test.d.ts +2 -0
  90. package/dist/types/src/trajectory/light-threads.test.d.ts.map +1 -0
  91. package/dist/types/src/trajectory/samples.test.d.ts +2 -0
  92. package/dist/types/src/trajectory/samples.test.d.ts.map +1 -0
  93. package/dist/types/src/types/Project.d.ts +11 -12
  94. package/dist/types/src/types/Project.d.ts.map +1 -1
  95. package/dist/types/src/types/Skill.d.ts +6 -51
  96. package/dist/types/src/types/Skill.d.ts.map +1 -1
  97. package/dist/types/src/types/Spec.d.ts +26 -0
  98. package/dist/types/src/types/Spec.d.ts.map +1 -0
  99. package/dist/types/src/types/SpecReview.d.ts +76 -0
  100. package/dist/types/src/types/SpecReview.d.ts.map +1 -0
  101. package/dist/types/src/types/index.d.ts +2 -0
  102. package/dist/types/src/types/index.d.ts.map +1 -1
  103. package/dist/types/tsconfig.tsbuildinfo +1 -1
  104. package/package.json +59 -26
  105. package/src/AgentService.ts +9 -0
  106. package/src/AiMetering.test.ts +89 -0
  107. package/src/AiMetering.ts +93 -0
  108. package/src/Hook.test.ts +75 -0
  109. package/src/Hook.ts +154 -0
  110. package/src/Operation.test.ts +23 -0
  111. package/src/Operation.ts +334 -0
  112. package/src/Process.ts +33 -6
  113. package/src/Script.test.ts +74 -0
  114. package/src/Trace.ts +97 -4
  115. package/src/errors.ts +3 -0
  116. package/src/index.ts +3 -1
  117. package/src/trajectory/Reducer.test.ts +575 -0
  118. package/src/trajectory/Reducer.ts +1026 -0
  119. package/src/trajectory/Trajectory.test.ts +114 -0
  120. package/src/trajectory/Trajectory.ts +440 -0
  121. package/src/trajectory/Transcript.ts +113 -0
  122. package/src/trajectory/index.ts +7 -0
  123. package/src/trajectory/light-threads.test.ts +310 -0
  124. package/src/trajectory/samples.test.ts +285 -0
  125. package/src/types/Project.test.ts +2 -1
  126. package/src/types/Project.ts +43 -27
  127. package/src/types/Skill.ts +6 -61
  128. package/src/types/Spec.ts +68 -0
  129. package/src/types/SpecReview.ts +98 -0
  130. package/src/types/index.ts +2 -0
  131. package/dist/lib/McpServer.mjs +0 -1
  132. package/dist/lib/chunk-McpServer.mjs +0 -124
  133. package/dist/lib/chunk-McpServer.mjs.map +0 -1
  134. package/dist/types/src/McpServer.d.ts +0 -113
  135. package/dist/types/src/McpServer.d.ts.map +0 -1
  136. package/src/McpServer.ts +0 -142
@@ -0,0 +1,3211 @@
1
+ import * as Schema from 'effect/Schema';
2
+ import { DXN, Feed, Obj, Ref, Type } from '@dxos/echo';
3
+ import { IdentityDid } from '@dxos/keys';
4
+ import * as Skill from '../types/Skill.ts';
5
+ /**
6
+ * Id of an earlier event in the same log; events reference each other by id because they are never mutated.
7
+ */
8
+ export declare const EventId: import("@dxos/keys").EntityIdClass;
9
+ export type EventId = Schema.Schema.Type<typeof EventId>;
10
+ /**
11
+ * A thread (or turn) is a branch of the conversation's feed: its opener is the branch's base, and every event written
12
+ * in it continues the branch. The main thread is the root branch, which has no id.
13
+ */
14
+ export declare const ThreadId: Schema.brand<Schema.String, "@dxos/echo/Feed/BranchId">;
15
+ export type ThreadId = Schema.Schema.Type<typeof ThreadId>;
16
+ /**
17
+ * `event` marks content from outside the conversation (alarm, webhook, email, background result), which the model
18
+ * sees as a synthetic user turn rather than as something a person typed.
19
+ */
20
+ export declare const Role: Schema.Literals<readonly ["user", "assistant", "tool", "event"]>;
21
+ export type Role = Schema.Schema.Type<typeof Role>;
22
+ export declare const Sender: Schema.Struct<{
23
+ readonly role: Schema.Literals<readonly ["user", "assistant", "tool", "event"]>;
24
+ /** Writer's identity, which tells participants apart in a multi-tenant chat. */
25
+ readonly identity: Schema.optional<Schema.Codec<IdentityDid, string, never, never> & {
26
+ byteLength: number;
27
+ encode: (value: Uint8Array) => IdentityDid;
28
+ decode: (value: IdentityDid) => Uint8Array;
29
+ isValid: (value: unknown) => value is IdentityDid;
30
+ make: (value: string) => IdentityDid;
31
+ random: () => IdentityDid;
32
+ }>;
33
+ /** Object the sender stands for when it is not a person (agent session, service, hook). */
34
+ readonly subject: Schema.optional<Ref.RefSchema<Obj.Unknown>>;
35
+ readonly name: Schema.optional<Schema.String>;
36
+ }>;
37
+ export type Sender = Schema.Schema.Type<typeof Sender>;
38
+ /**
39
+ * Content seen by the model, attributed by the event's `sender`. A user message stays out of the prompt until a
40
+ * {@link PromptConsume} names it, so a prompt typed mid-turn never lands inside a prefix already sent.
41
+ */
42
+ export declare const Message: Schema.TaggedStruct<"message", {
43
+ readonly blocks: Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"anchor", {
44
+ readonly pending: Schema.optional<Schema.Boolean>;
45
+ readonly objectId: import("@dxos/keys").EntityIdClass;
46
+ readonly version: Schema.Unknown;
47
+ }>, Schema.TaggedStruct<"change", {
48
+ readonly pending: Schema.optional<Schema.Boolean>;
49
+ readonly before: Schema.String;
50
+ readonly after: Schema.String;
51
+ }>, Schema.TaggedStruct<"file", {
52
+ readonly pending: Schema.optional<Schema.Boolean>;
53
+ readonly url: Schema.String;
54
+ readonly name: Schema.optional<Schema.String>;
55
+ readonly mediaType: Schema.optional<Schema.String>;
56
+ }>, Schema.TaggedStruct<"image", {
57
+ readonly pending: Schema.optional<Schema.Boolean>;
58
+ readonly id: Schema.optional<Schema.String>;
59
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
60
+ readonly type: Schema.Literal<"base64">;
61
+ readonly mediaType: Schema.String;
62
+ readonly data: Schema.String;
63
+ }>, Schema.Struct<{
64
+ readonly type: Schema.Literal<"http">;
65
+ readonly url: Schema.String;
66
+ }>]>>;
67
+ }>, Schema.TaggedStruct<"json", {
68
+ readonly pending: Schema.optional<Schema.Boolean>;
69
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
70
+ readonly data: Schema.String;
71
+ }>, Schema.TaggedStruct<"proposal", {
72
+ readonly pending: Schema.optional<Schema.Boolean>;
73
+ readonly text: Schema.String;
74
+ }>, Schema.TaggedStruct<"reasoning", {
75
+ readonly pending: Schema.optional<Schema.Boolean>;
76
+ readonly reasoningText: Schema.optional<Schema.String>;
77
+ readonly redactedText: Schema.optional<Schema.String>;
78
+ readonly signature: Schema.optional<Schema.String>;
79
+ }>, Schema.TaggedStruct<"reference", {
80
+ readonly pending: Schema.optional<Schema.Boolean>;
81
+ readonly reference: Ref.RefSchema<Obj.Unknown>;
82
+ }>, Schema.TaggedStruct<"request", {
83
+ readonly pending: Schema.optional<Schema.Boolean>;
84
+ readonly requestId: Schema.String;
85
+ readonly title: Schema.String;
86
+ readonly toolCallId: Schema.optional<Schema.String>;
87
+ readonly options: Schema.$Array<Schema.Struct<{
88
+ readonly id: Schema.String;
89
+ readonly label: Schema.String;
90
+ readonly kind: Schema.Literals<readonly ["allow_once", "allow_always", "reject_once", "reject_always"]>;
91
+ }>>;
92
+ readonly preview: Schema.optional<Schema.Struct<{
93
+ readonly label: Schema.String;
94
+ readonly text: Schema.String;
95
+ }>>;
96
+ readonly resolution: Schema.optional<Schema.Struct<{
97
+ readonly outcome: Schema.Literals<readonly ["selected", "cancelled"]>;
98
+ readonly optionId: Schema.optional<Schema.String>;
99
+ }>>;
100
+ }>, Schema.TaggedStruct<"select", {
101
+ readonly pending: Schema.optional<Schema.Boolean>;
102
+ readonly options: Schema.mutable<Schema.$Array<Schema.String>>;
103
+ }>, Schema.TaggedStruct<"status", {
104
+ readonly pending: Schema.optional<Schema.Boolean>;
105
+ readonly statusText: Schema.String;
106
+ }>, Schema.TaggedStruct<"suggestion", {
107
+ readonly pending: Schema.optional<Schema.Boolean>;
108
+ readonly text: Schema.String;
109
+ }>, Schema.TaggedStruct<"stats", {
110
+ readonly pending: Schema.optional<Schema.Boolean>;
111
+ readonly mimeType: Schema.optional<Schema.String>;
112
+ readonly message: Schema.optional<Schema.String>;
113
+ readonly model: Schema.optional<Schema.String>;
114
+ readonly usage: Schema.optional<Schema.Struct<{
115
+ readonly inputTokens: Schema.optional<Schema.Number>;
116
+ readonly outputTokens: Schema.optional<Schema.Number>;
117
+ readonly totalTokens: Schema.optional<Schema.Number>;
118
+ readonly cacheReadTokens: Schema.optional<Schema.Number>;
119
+ readonly cacheWriteTokens: Schema.optional<Schema.Number>;
120
+ }>>;
121
+ readonly toolCalls: Schema.optional<Schema.Number>;
122
+ readonly errors: Schema.optional<Schema.Number>;
123
+ readonly duration: Schema.optional<Schema.Number>;
124
+ readonly finishReason: Schema.optional<Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>>;
125
+ }>, Schema.TaggedStruct<"surface", {
126
+ readonly pending: Schema.optional<Schema.Boolean>;
127
+ readonly role: Schema.String;
128
+ readonly data: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
129
+ }>, Schema.TaggedStruct<"text", {
130
+ readonly pending: Schema.optional<Schema.Boolean>;
131
+ readonly mimeType: Schema.optional<Schema.String>;
132
+ readonly text: Schema.String;
133
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
134
+ }>, Schema.TaggedStruct<"summary", {
135
+ readonly pending: Schema.optional<Schema.Boolean>;
136
+ readonly content: Schema.String;
137
+ }>, Schema.TaggedStruct<"toolkit", {
138
+ readonly pending: Schema.optional<Schema.Boolean>;
139
+ }>, Schema.TaggedStruct<"toolCall", {
140
+ readonly pending: Schema.optional<Schema.Boolean>;
141
+ readonly toolCallId: Schema.String;
142
+ readonly name: Schema.String;
143
+ readonly input: Schema.String;
144
+ readonly providerExecuted: Schema.Boolean;
145
+ readonly operationKey: Schema.optional<Schema.String>;
146
+ readonly operationName: Schema.optional<Schema.String>;
147
+ readonly operationIcon: Schema.optional<Schema.String>;
148
+ readonly displayName: Schema.optional<Schema.String>;
149
+ readonly displayIcon: Schema.optional<Schema.String>;
150
+ }>, Schema.TaggedStruct<"toolResult", {
151
+ readonly pending: Schema.optional<Schema.Boolean>;
152
+ readonly toolCallId: Schema.String;
153
+ readonly name: Schema.String;
154
+ readonly result: Schema.optional<Schema.Union<readonly [Schema.String, Schema.suspend<Schema.TaggedStruct<"~@dxos/types/ContentBlock.ContentBlockResult", {
155
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"text", {
156
+ readonly pending: Schema.optional<Schema.Boolean>;
157
+ readonly mimeType: Schema.optional<Schema.String>;
158
+ readonly text: Schema.String;
159
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
160
+ }>, Schema.suspend<Schema.TaggedStruct<"image", {
161
+ readonly pending: Schema.optional<Schema.Boolean>;
162
+ readonly id: Schema.optional<Schema.String>;
163
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
164
+ readonly type: Schema.Literal<"base64">;
165
+ readonly mediaType: Schema.String;
166
+ readonly data: Schema.String;
167
+ }>, Schema.Struct<{
168
+ readonly type: Schema.Literal<"http">;
169
+ readonly url: Schema.String;
170
+ }>]>>;
171
+ }>>, Schema.suspend<Schema.TaggedStruct<"file", {
172
+ readonly pending: Schema.optional<Schema.Boolean>;
173
+ readonly url: Schema.String;
174
+ readonly name: Schema.optional<Schema.String>;
175
+ readonly mediaType: Schema.optional<Schema.String>;
176
+ }>>]>>;
177
+ }>>]>>;
178
+ readonly error: Schema.optional<Schema.String>;
179
+ readonly providerExecuted: Schema.Boolean;
180
+ readonly invocations: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
181
+ readonly operationKey: Schema.String;
182
+ readonly error: Schema.optional<Schema.String>;
183
+ }>>>>;
184
+ }>, Schema.TaggedStruct<"transcript", {
185
+ readonly pending: Schema.optional<Schema.Boolean>;
186
+ readonly started: Schema.String;
187
+ readonly text: Schema.String;
188
+ readonly corrected: Schema.optional<Schema.String>;
189
+ readonly references: Schema.optional<Schema.mutable<Schema.$Array<Ref.RefSchema<Obj.Unknown>>>>;
190
+ readonly candidates: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
191
+ readonly text: Schema.String;
192
+ readonly kind: Schema.Literals<readonly ["noun", "proper-noun"]>;
193
+ readonly start: Schema.Number;
194
+ readonly end: Schema.Number;
195
+ readonly suggested: Schema.optional<Schema.Struct<{
196
+ readonly typename: Schema.String;
197
+ }>>;
198
+ }>>>>;
199
+ readonly translation: Schema.optional<Schema.String>;
200
+ }>]>>;
201
+ /** Files or objects attached alongside the blocks, as on `Message.Message`. */
202
+ readonly attachments: Schema.optional<Schema.$Array<Schema.Struct<{
203
+ readonly name: Schema.optional<Schema.String>;
204
+ readonly ref: Ref.RefSchema<Obj.Unknown>;
205
+ readonly contentId: Schema.optional<Schema.String>;
206
+ }>>>;
207
+ /**
208
+ * `Message.Message`'s properties, carried so a message converts both ways; a channel backend's post receipt lives
209
+ * here (e.g. `discord.messageId`), which tells a mirror the message is already posted.
210
+ */
211
+ readonly properties: Schema.optional<Schema.$Record<Schema.String, Schema.Any>>;
212
+ }>;
213
+ export type Message = Schema.Schema.Type<typeof Message>;
214
+ export declare const Usage: Schema.Struct<{
215
+ readonly inputTokens: Schema.optional<Schema.Number>;
216
+ readonly outputTokens: Schema.optional<Schema.Number>;
217
+ readonly cacheReadTokens: Schema.optional<Schema.Number>;
218
+ readonly cacheWriteTokens: Schema.optional<Schema.Number>;
219
+ }>;
220
+ export type Usage = Schema.Schema.Type<typeof Usage>;
221
+ /**
222
+ * What a thread or turn could see when it started: the parent thread up to and including `event`.
223
+ */
224
+ export declare const ThreadOrigin: Schema.Struct<{
225
+ /** Feed of another conversation; absent for the current one. */
226
+ readonly feed: Schema.optional<Ref.RefSchema<Feed.Feed & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>>;
227
+ /** Parent thread; absent for the main thread. */
228
+ readonly thread: Schema.optional<Schema.brand<Schema.String, "@dxos/echo/Feed/BranchId">>;
229
+ /**
230
+ * Last event of the parent that was visible: the last event the writer had folded when it wrote the opener, so an
231
+ * event that syncs in afterwards stays out of what the thread saw.
232
+ */
233
+ readonly event: import("@dxos/keys").EntityIdClass;
234
+ }>;
235
+ export type ThreadOrigin = Schema.Schema.Type<typeof ThreadOrigin>;
236
+ /**
237
+ * Start of one model request: the base of the turn's own branch, so every event the turn produces continues that
238
+ * branch, and `turnEnd` (the branch's last event) merges the turn into its parent.
239
+ */
240
+ export declare const TurnBegin: Schema.TaggedStruct<"turnBegin", {
241
+ /** Model DXN, as `SessionConfig.model` stores it; absent when the writer does not choose the model. */
242
+ readonly model: Schema.optional<Schema.Codec<DXN.DXN, DXN.DXN, never, never>>;
243
+ /** What the turn saw; absent when it started on an empty log. */
244
+ readonly from: Schema.optional<Schema.Struct<{
245
+ /** Feed of another conversation; absent for the current one. */
246
+ readonly feed: Schema.optional<Ref.RefSchema<Feed.Feed & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>>;
247
+ /** Parent thread; absent for the main thread. */
248
+ readonly thread: Schema.optional<Schema.brand<Schema.String, "@dxos/echo/Feed/BranchId">>;
249
+ /**
250
+ * Last event of the parent that was visible: the last event the writer had folded when it wrote the opener, so an
251
+ * event that syncs in afterwards stays out of what the thread saw.
252
+ */
253
+ readonly event: import("@dxos/keys").EntityIdClass;
254
+ }>>;
255
+ }>;
256
+ export type TurnBegin = Schema.Schema.Type<typeof TurnBegin>;
257
+ /** Ends the turn whose branch it is written on. */
258
+ export declare const TurnEnd: Schema.TaggedStruct<"turnEnd", {
259
+ readonly finishReason: Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>;
260
+ readonly usage: Schema.optional<Schema.Struct<{
261
+ readonly inputTokens: Schema.optional<Schema.Number>;
262
+ readonly outputTokens: Schema.optional<Schema.Number>;
263
+ readonly cacheReadTokens: Schema.optional<Schema.Number>;
264
+ readonly cacheWriteTokens: Schema.optional<Schema.Number>;
265
+ }>>;
266
+ readonly error: Schema.optional<Schema.String>;
267
+ }>;
268
+ export type TurnEnd = Schema.Schema.Type<typeof TurnEnd>;
269
+ /**
270
+ * The agent took a user message into its next turn; the message enters the prompt at this event's position.
271
+ */
272
+ export declare const PromptConsume: Schema.TaggedStruct<"promptConsume", {
273
+ readonly message: import("@dxos/keys").EntityIdClass;
274
+ }>;
275
+ export type PromptConsume = Schema.Schema.Type<typeof PromptConsume>;
276
+ export declare const PromptCancel: Schema.TaggedStruct<"promptCancel", {
277
+ readonly message: import("@dxos/keys").EntityIdClass;
278
+ }>;
279
+ export type PromptCancel = Schema.Schema.Type<typeof PromptCancel>;
280
+ export declare const ContextBind: Schema.TaggedStruct<"contextBind", {
281
+ skills: Schema.$Array<Ref.RefSchema<Skill.Skill & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>>;
282
+ objects: Schema.$Array<Ref.RefSchema<Obj.Unknown>>;
283
+ /**
284
+ * Connections whose MCP server the conversation turns on (`contextBind`) or off (`contextUnbind`); one never
285
+ * named follows the space default.
286
+ */
287
+ connections: Schema.optional<Schema.$Array<Ref.RefSchema<Obj.Unknown>>>;
288
+ }>;
289
+ export type ContextBind = Schema.Schema.Type<typeof ContextBind>;
290
+ export declare const ContextUnbind: Schema.TaggedStruct<"contextUnbind", {
291
+ skills: Schema.$Array<Ref.RefSchema<Skill.Skill & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>>;
292
+ objects: Schema.$Array<Ref.RefSchema<Obj.Unknown>>;
293
+ /**
294
+ * Connections whose MCP server the conversation turns on (`contextBind`) or off (`contextUnbind`); one never
295
+ * named follows the space default.
296
+ */
297
+ connections: Schema.optional<Schema.$Array<Ref.RefSchema<Obj.Unknown>>>;
298
+ }>;
299
+ export type ContextUnbind = Schema.Schema.Type<typeof ContextUnbind>;
300
+ export declare const AlarmSet: Schema.TaggedStruct<"alarmSet", {
301
+ /** Epoch milliseconds. */
302
+ readonly wakeAt: Schema.Number;
303
+ readonly message: Schema.optional<Schema.String>;
304
+ }>;
305
+ export type AlarmSet = Schema.Schema.Type<typeof AlarmSet>;
306
+ export declare const AlarmCancel: Schema.TaggedStruct<"alarmCancel", {
307
+ readonly alarm: import("@dxos/keys").EntityIdClass;
308
+ }>;
309
+ export type AlarmCancel = Schema.Schema.Type<typeof AlarmCancel>;
310
+ export declare const AlarmFire: Schema.TaggedStruct<"alarmFire", {
311
+ readonly alarm: import("@dxos/keys").EntityIdClass;
312
+ }>;
313
+ export type AlarmFire = Schema.Schema.Type<typeof AlarmFire>;
314
+ /**
315
+ * A tool call that outlived its turn; its result arrives later as {@link ToolDeliver}.
316
+ */
317
+ export declare const ToolBackground: Schema.TaggedStruct<"toolBackground", {
318
+ readonly toolCallId: Schema.String;
319
+ /** Process running the call. */
320
+ readonly pid: Schema.optional<Schema.String>;
321
+ }>;
322
+ export type ToolBackground = Schema.Schema.Type<typeof ToolBackground>;
323
+ export declare const ToolDeliver: Schema.TaggedStruct<"toolDeliver", {
324
+ readonly toolCallId: Schema.String;
325
+ readonly result: Schema.TaggedStruct<"toolResult", {
326
+ readonly pending: Schema.optional<Schema.Boolean>;
327
+ readonly toolCallId: Schema.String;
328
+ readonly name: Schema.String;
329
+ readonly result: Schema.optional<Schema.Union<readonly [Schema.String, Schema.suspend<Schema.TaggedStruct<"~@dxos/types/ContentBlock.ContentBlockResult", {
330
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"text", {
331
+ readonly pending: Schema.optional<Schema.Boolean>;
332
+ readonly mimeType: Schema.optional<Schema.String>;
333
+ readonly text: Schema.String;
334
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
335
+ }>, Schema.suspend<Schema.TaggedStruct<"image", {
336
+ readonly pending: Schema.optional<Schema.Boolean>;
337
+ readonly id: Schema.optional<Schema.String>;
338
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
339
+ readonly type: Schema.Literal<"base64">;
340
+ readonly mediaType: Schema.String;
341
+ readonly data: Schema.String;
342
+ }>, Schema.Struct<{
343
+ readonly type: Schema.Literal<"http">;
344
+ readonly url: Schema.String;
345
+ }>]>>;
346
+ }>>, Schema.suspend<Schema.TaggedStruct<"file", {
347
+ readonly pending: Schema.optional<Schema.Boolean>;
348
+ readonly url: Schema.String;
349
+ readonly name: Schema.optional<Schema.String>;
350
+ readonly mediaType: Schema.optional<Schema.String>;
351
+ }>>]>>;
352
+ }>>]>>;
353
+ readonly error: Schema.optional<Schema.String>;
354
+ readonly providerExecuted: Schema.Boolean;
355
+ readonly invocations: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
356
+ readonly operationKey: Schema.String;
357
+ readonly error: Schema.optional<Schema.String>;
358
+ }>>>>;
359
+ }>;
360
+ }>;
361
+ export type ToolDeliver = Schema.Schema.Type<typeof ToolDeliver>;
362
+ export declare const HookKind: Schema.Literals<readonly ["inline", "background", "agentic"]>;
363
+ export type HookKind = Schema.Schema.Type<typeof HookKind>;
364
+ export declare const HookBegin: Schema.TaggedStruct<"hookBegin", {
365
+ readonly hook: Schema.String;
366
+ readonly kind: Schema.Literals<readonly ["inline", "background", "agentic"]>;
367
+ /** Thread an agentic hook runs in. */
368
+ readonly thread: Schema.optional<Schema.brand<Schema.String, "@dxos/echo/Feed/BranchId">>;
369
+ }>;
370
+ export type HookBegin = Schema.Schema.Type<typeof HookBegin>;
371
+ export declare const HookEnd: Schema.TaggedStruct<"hookEnd", {
372
+ readonly begin: import("@dxos/keys").EntityIdClass;
373
+ /** Output of an inline hook, which the model sees. */
374
+ readonly blocks: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"anchor", {
375
+ readonly pending: Schema.optional<Schema.Boolean>;
376
+ readonly objectId: import("@dxos/keys").EntityIdClass;
377
+ readonly version: Schema.Unknown;
378
+ }>, Schema.TaggedStruct<"change", {
379
+ readonly pending: Schema.optional<Schema.Boolean>;
380
+ readonly before: Schema.String;
381
+ readonly after: Schema.String;
382
+ }>, Schema.TaggedStruct<"file", {
383
+ readonly pending: Schema.optional<Schema.Boolean>;
384
+ readonly url: Schema.String;
385
+ readonly name: Schema.optional<Schema.String>;
386
+ readonly mediaType: Schema.optional<Schema.String>;
387
+ }>, Schema.TaggedStruct<"image", {
388
+ readonly pending: Schema.optional<Schema.Boolean>;
389
+ readonly id: Schema.optional<Schema.String>;
390
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
391
+ readonly type: Schema.Literal<"base64">;
392
+ readonly mediaType: Schema.String;
393
+ readonly data: Schema.String;
394
+ }>, Schema.Struct<{
395
+ readonly type: Schema.Literal<"http">;
396
+ readonly url: Schema.String;
397
+ }>]>>;
398
+ }>, Schema.TaggedStruct<"json", {
399
+ readonly pending: Schema.optional<Schema.Boolean>;
400
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
401
+ readonly data: Schema.String;
402
+ }>, Schema.TaggedStruct<"proposal", {
403
+ readonly pending: Schema.optional<Schema.Boolean>;
404
+ readonly text: Schema.String;
405
+ }>, Schema.TaggedStruct<"reasoning", {
406
+ readonly pending: Schema.optional<Schema.Boolean>;
407
+ readonly reasoningText: Schema.optional<Schema.String>;
408
+ readonly redactedText: Schema.optional<Schema.String>;
409
+ readonly signature: Schema.optional<Schema.String>;
410
+ }>, Schema.TaggedStruct<"reference", {
411
+ readonly pending: Schema.optional<Schema.Boolean>;
412
+ readonly reference: Ref.RefSchema<Obj.Unknown>;
413
+ }>, Schema.TaggedStruct<"request", {
414
+ readonly pending: Schema.optional<Schema.Boolean>;
415
+ readonly requestId: Schema.String;
416
+ readonly title: Schema.String;
417
+ readonly toolCallId: Schema.optional<Schema.String>;
418
+ readonly options: Schema.$Array<Schema.Struct<{
419
+ readonly id: Schema.String;
420
+ readonly label: Schema.String;
421
+ readonly kind: Schema.Literals<readonly ["allow_once", "allow_always", "reject_once", "reject_always"]>;
422
+ }>>;
423
+ readonly preview: Schema.optional<Schema.Struct<{
424
+ readonly label: Schema.String;
425
+ readonly text: Schema.String;
426
+ }>>;
427
+ readonly resolution: Schema.optional<Schema.Struct<{
428
+ readonly outcome: Schema.Literals<readonly ["selected", "cancelled"]>;
429
+ readonly optionId: Schema.optional<Schema.String>;
430
+ }>>;
431
+ }>, Schema.TaggedStruct<"select", {
432
+ readonly pending: Schema.optional<Schema.Boolean>;
433
+ readonly options: Schema.mutable<Schema.$Array<Schema.String>>;
434
+ }>, Schema.TaggedStruct<"status", {
435
+ readonly pending: Schema.optional<Schema.Boolean>;
436
+ readonly statusText: Schema.String;
437
+ }>, Schema.TaggedStruct<"suggestion", {
438
+ readonly pending: Schema.optional<Schema.Boolean>;
439
+ readonly text: Schema.String;
440
+ }>, Schema.TaggedStruct<"stats", {
441
+ readonly pending: Schema.optional<Schema.Boolean>;
442
+ readonly mimeType: Schema.optional<Schema.String>;
443
+ readonly message: Schema.optional<Schema.String>;
444
+ readonly model: Schema.optional<Schema.String>;
445
+ readonly usage: Schema.optional<Schema.Struct<{
446
+ readonly inputTokens: Schema.optional<Schema.Number>;
447
+ readonly outputTokens: Schema.optional<Schema.Number>;
448
+ readonly totalTokens: Schema.optional<Schema.Number>;
449
+ readonly cacheReadTokens: Schema.optional<Schema.Number>;
450
+ readonly cacheWriteTokens: Schema.optional<Schema.Number>;
451
+ }>>;
452
+ readonly toolCalls: Schema.optional<Schema.Number>;
453
+ readonly errors: Schema.optional<Schema.Number>;
454
+ readonly duration: Schema.optional<Schema.Number>;
455
+ readonly finishReason: Schema.optional<Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>>;
456
+ }>, Schema.TaggedStruct<"surface", {
457
+ readonly pending: Schema.optional<Schema.Boolean>;
458
+ readonly role: Schema.String;
459
+ readonly data: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
460
+ }>, Schema.TaggedStruct<"text", {
461
+ readonly pending: Schema.optional<Schema.Boolean>;
462
+ readonly mimeType: Schema.optional<Schema.String>;
463
+ readonly text: Schema.String;
464
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
465
+ }>, Schema.TaggedStruct<"summary", {
466
+ readonly pending: Schema.optional<Schema.Boolean>;
467
+ readonly content: Schema.String;
468
+ }>, Schema.TaggedStruct<"toolkit", {
469
+ readonly pending: Schema.optional<Schema.Boolean>;
470
+ }>, Schema.TaggedStruct<"toolCall", {
471
+ readonly pending: Schema.optional<Schema.Boolean>;
472
+ readonly toolCallId: Schema.String;
473
+ readonly name: Schema.String;
474
+ readonly input: Schema.String;
475
+ readonly providerExecuted: Schema.Boolean;
476
+ readonly operationKey: Schema.optional<Schema.String>;
477
+ readonly operationName: Schema.optional<Schema.String>;
478
+ readonly operationIcon: Schema.optional<Schema.String>;
479
+ readonly displayName: Schema.optional<Schema.String>;
480
+ readonly displayIcon: Schema.optional<Schema.String>;
481
+ }>, Schema.TaggedStruct<"toolResult", {
482
+ readonly pending: Schema.optional<Schema.Boolean>;
483
+ readonly toolCallId: Schema.String;
484
+ readonly name: Schema.String;
485
+ readonly result: Schema.optional<Schema.Union<readonly [Schema.String, Schema.suspend<Schema.TaggedStruct<"~@dxos/types/ContentBlock.ContentBlockResult", {
486
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"text", {
487
+ readonly pending: Schema.optional<Schema.Boolean>;
488
+ readonly mimeType: Schema.optional<Schema.String>;
489
+ readonly text: Schema.String;
490
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
491
+ }>, Schema.suspend<Schema.TaggedStruct<"image", {
492
+ readonly pending: Schema.optional<Schema.Boolean>;
493
+ readonly id: Schema.optional<Schema.String>;
494
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
495
+ readonly type: Schema.Literal<"base64">;
496
+ readonly mediaType: Schema.String;
497
+ readonly data: Schema.String;
498
+ }>, Schema.Struct<{
499
+ readonly type: Schema.Literal<"http">;
500
+ readonly url: Schema.String;
501
+ }>]>>;
502
+ }>>, Schema.suspend<Schema.TaggedStruct<"file", {
503
+ readonly pending: Schema.optional<Schema.Boolean>;
504
+ readonly url: Schema.String;
505
+ readonly name: Schema.optional<Schema.String>;
506
+ readonly mediaType: Schema.optional<Schema.String>;
507
+ }>>]>>;
508
+ }>>]>>;
509
+ readonly error: Schema.optional<Schema.String>;
510
+ readonly providerExecuted: Schema.Boolean;
511
+ readonly invocations: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
512
+ readonly operationKey: Schema.String;
513
+ readonly error: Schema.optional<Schema.String>;
514
+ }>>>>;
515
+ }>, Schema.TaggedStruct<"transcript", {
516
+ readonly pending: Schema.optional<Schema.Boolean>;
517
+ readonly started: Schema.String;
518
+ readonly text: Schema.String;
519
+ readonly corrected: Schema.optional<Schema.String>;
520
+ readonly references: Schema.optional<Schema.mutable<Schema.$Array<Ref.RefSchema<Obj.Unknown>>>>;
521
+ readonly candidates: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
522
+ readonly text: Schema.String;
523
+ readonly kind: Schema.Literals<readonly ["noun", "proper-noun"]>;
524
+ readonly start: Schema.Number;
525
+ readonly end: Schema.Number;
526
+ readonly suggested: Schema.optional<Schema.Struct<{
527
+ readonly typename: Schema.String;
528
+ }>>;
529
+ }>>>>;
530
+ readonly translation: Schema.optional<Schema.String>;
531
+ }>]>>>;
532
+ readonly error: Schema.optional<Schema.String>;
533
+ }>;
534
+ export type HookEnd = Schema.Schema.Type<typeof HookEnd>;
535
+ /**
536
+ * Replaces the inclusive range `from`..`to` with `summary` in the prompt; the events themselves stay in the log.
537
+ */
538
+ export declare const Compact: Schema.TaggedStruct<"compact", {
539
+ readonly from: import("@dxos/keys").EntityIdClass;
540
+ readonly to: import("@dxos/keys").EntityIdClass;
541
+ readonly summary: Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"anchor", {
542
+ readonly pending: Schema.optional<Schema.Boolean>;
543
+ readonly objectId: import("@dxos/keys").EntityIdClass;
544
+ readonly version: Schema.Unknown;
545
+ }>, Schema.TaggedStruct<"change", {
546
+ readonly pending: Schema.optional<Schema.Boolean>;
547
+ readonly before: Schema.String;
548
+ readonly after: Schema.String;
549
+ }>, Schema.TaggedStruct<"file", {
550
+ readonly pending: Schema.optional<Schema.Boolean>;
551
+ readonly url: Schema.String;
552
+ readonly name: Schema.optional<Schema.String>;
553
+ readonly mediaType: Schema.optional<Schema.String>;
554
+ }>, Schema.TaggedStruct<"image", {
555
+ readonly pending: Schema.optional<Schema.Boolean>;
556
+ readonly id: Schema.optional<Schema.String>;
557
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
558
+ readonly type: Schema.Literal<"base64">;
559
+ readonly mediaType: Schema.String;
560
+ readonly data: Schema.String;
561
+ }>, Schema.Struct<{
562
+ readonly type: Schema.Literal<"http">;
563
+ readonly url: Schema.String;
564
+ }>]>>;
565
+ }>, Schema.TaggedStruct<"json", {
566
+ readonly pending: Schema.optional<Schema.Boolean>;
567
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
568
+ readonly data: Schema.String;
569
+ }>, Schema.TaggedStruct<"proposal", {
570
+ readonly pending: Schema.optional<Schema.Boolean>;
571
+ readonly text: Schema.String;
572
+ }>, Schema.TaggedStruct<"reasoning", {
573
+ readonly pending: Schema.optional<Schema.Boolean>;
574
+ readonly reasoningText: Schema.optional<Schema.String>;
575
+ readonly redactedText: Schema.optional<Schema.String>;
576
+ readonly signature: Schema.optional<Schema.String>;
577
+ }>, Schema.TaggedStruct<"reference", {
578
+ readonly pending: Schema.optional<Schema.Boolean>;
579
+ readonly reference: Ref.RefSchema<Obj.Unknown>;
580
+ }>, Schema.TaggedStruct<"request", {
581
+ readonly pending: Schema.optional<Schema.Boolean>;
582
+ readonly requestId: Schema.String;
583
+ readonly title: Schema.String;
584
+ readonly toolCallId: Schema.optional<Schema.String>;
585
+ readonly options: Schema.$Array<Schema.Struct<{
586
+ readonly id: Schema.String;
587
+ readonly label: Schema.String;
588
+ readonly kind: Schema.Literals<readonly ["allow_once", "allow_always", "reject_once", "reject_always"]>;
589
+ }>>;
590
+ readonly preview: Schema.optional<Schema.Struct<{
591
+ readonly label: Schema.String;
592
+ readonly text: Schema.String;
593
+ }>>;
594
+ readonly resolution: Schema.optional<Schema.Struct<{
595
+ readonly outcome: Schema.Literals<readonly ["selected", "cancelled"]>;
596
+ readonly optionId: Schema.optional<Schema.String>;
597
+ }>>;
598
+ }>, Schema.TaggedStruct<"select", {
599
+ readonly pending: Schema.optional<Schema.Boolean>;
600
+ readonly options: Schema.mutable<Schema.$Array<Schema.String>>;
601
+ }>, Schema.TaggedStruct<"status", {
602
+ readonly pending: Schema.optional<Schema.Boolean>;
603
+ readonly statusText: Schema.String;
604
+ }>, Schema.TaggedStruct<"suggestion", {
605
+ readonly pending: Schema.optional<Schema.Boolean>;
606
+ readonly text: Schema.String;
607
+ }>, Schema.TaggedStruct<"stats", {
608
+ readonly pending: Schema.optional<Schema.Boolean>;
609
+ readonly mimeType: Schema.optional<Schema.String>;
610
+ readonly message: Schema.optional<Schema.String>;
611
+ readonly model: Schema.optional<Schema.String>;
612
+ readonly usage: Schema.optional<Schema.Struct<{
613
+ readonly inputTokens: Schema.optional<Schema.Number>;
614
+ readonly outputTokens: Schema.optional<Schema.Number>;
615
+ readonly totalTokens: Schema.optional<Schema.Number>;
616
+ readonly cacheReadTokens: Schema.optional<Schema.Number>;
617
+ readonly cacheWriteTokens: Schema.optional<Schema.Number>;
618
+ }>>;
619
+ readonly toolCalls: Schema.optional<Schema.Number>;
620
+ readonly errors: Schema.optional<Schema.Number>;
621
+ readonly duration: Schema.optional<Schema.Number>;
622
+ readonly finishReason: Schema.optional<Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>>;
623
+ }>, Schema.TaggedStruct<"surface", {
624
+ readonly pending: Schema.optional<Schema.Boolean>;
625
+ readonly role: Schema.String;
626
+ readonly data: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
627
+ }>, Schema.TaggedStruct<"text", {
628
+ readonly pending: Schema.optional<Schema.Boolean>;
629
+ readonly mimeType: Schema.optional<Schema.String>;
630
+ readonly text: Schema.String;
631
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
632
+ }>, Schema.TaggedStruct<"summary", {
633
+ readonly pending: Schema.optional<Schema.Boolean>;
634
+ readonly content: Schema.String;
635
+ }>, Schema.TaggedStruct<"toolkit", {
636
+ readonly pending: Schema.optional<Schema.Boolean>;
637
+ }>, Schema.TaggedStruct<"toolCall", {
638
+ readonly pending: Schema.optional<Schema.Boolean>;
639
+ readonly toolCallId: Schema.String;
640
+ readonly name: Schema.String;
641
+ readonly input: Schema.String;
642
+ readonly providerExecuted: Schema.Boolean;
643
+ readonly operationKey: Schema.optional<Schema.String>;
644
+ readonly operationName: Schema.optional<Schema.String>;
645
+ readonly operationIcon: Schema.optional<Schema.String>;
646
+ readonly displayName: Schema.optional<Schema.String>;
647
+ readonly displayIcon: Schema.optional<Schema.String>;
648
+ }>, Schema.TaggedStruct<"toolResult", {
649
+ readonly pending: Schema.optional<Schema.Boolean>;
650
+ readonly toolCallId: Schema.String;
651
+ readonly name: Schema.String;
652
+ readonly result: Schema.optional<Schema.Union<readonly [Schema.String, Schema.suspend<Schema.TaggedStruct<"~@dxos/types/ContentBlock.ContentBlockResult", {
653
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"text", {
654
+ readonly pending: Schema.optional<Schema.Boolean>;
655
+ readonly mimeType: Schema.optional<Schema.String>;
656
+ readonly text: Schema.String;
657
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
658
+ }>, Schema.suspend<Schema.TaggedStruct<"image", {
659
+ readonly pending: Schema.optional<Schema.Boolean>;
660
+ readonly id: Schema.optional<Schema.String>;
661
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
662
+ readonly type: Schema.Literal<"base64">;
663
+ readonly mediaType: Schema.String;
664
+ readonly data: Schema.String;
665
+ }>, Schema.Struct<{
666
+ readonly type: Schema.Literal<"http">;
667
+ readonly url: Schema.String;
668
+ }>]>>;
669
+ }>>, Schema.suspend<Schema.TaggedStruct<"file", {
670
+ readonly pending: Schema.optional<Schema.Boolean>;
671
+ readonly url: Schema.String;
672
+ readonly name: Schema.optional<Schema.String>;
673
+ readonly mediaType: Schema.optional<Schema.String>;
674
+ }>>]>>;
675
+ }>>]>>;
676
+ readonly error: Schema.optional<Schema.String>;
677
+ readonly providerExecuted: Schema.Boolean;
678
+ readonly invocations: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
679
+ readonly operationKey: Schema.String;
680
+ readonly error: Schema.optional<Schema.String>;
681
+ }>>>>;
682
+ }>, Schema.TaggedStruct<"transcript", {
683
+ readonly pending: Schema.optional<Schema.Boolean>;
684
+ readonly started: Schema.String;
685
+ readonly text: Schema.String;
686
+ readonly corrected: Schema.optional<Schema.String>;
687
+ readonly references: Schema.optional<Schema.mutable<Schema.$Array<Ref.RefSchema<Obj.Unknown>>>>;
688
+ readonly candidates: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
689
+ readonly text: Schema.String;
690
+ readonly kind: Schema.Literals<readonly ["noun", "proper-noun"]>;
691
+ readonly start: Schema.Number;
692
+ readonly end: Schema.Number;
693
+ readonly suggested: Schema.optional<Schema.Struct<{
694
+ readonly typename: Schema.String;
695
+ }>>;
696
+ }>>>>;
697
+ readonly translation: Schema.optional<Schema.String>;
698
+ }>]>>;
699
+ /** Threads whose merged entries the range holds; a thread still running is never in it. */
700
+ readonly closure: Schema.optional<Schema.$Array<Schema.brand<Schema.String, "@dxos/echo/Feed/BranchId">>>;
701
+ }>;
702
+ export type Compact = Schema.Schema.Type<typeof Compact>;
703
+ /**
704
+ * A person's answer to a `request` block an agent asked in an earlier message; the message itself never changes.
705
+ */
706
+ export declare const RequestResolve: Schema.TaggedStruct<"requestResolve", {
707
+ readonly message: import("@dxos/keys").EntityIdClass;
708
+ readonly requestId: Schema.String;
709
+ readonly resolution: Schema.Struct<{
710
+ readonly outcome: Schema.Literals<readonly ["selected", "cancelled"]>;
711
+ readonly optionId: Schema.optional<Schema.String>;
712
+ }>;
713
+ }>;
714
+ export type RequestResolve = Schema.Schema.Type<typeof RequestResolve>;
715
+ /**
716
+ * Discards the main thread from `from` on: its prompt entries and thread items go, the events stay in the log.
717
+ */
718
+ export declare const Rewind: Schema.TaggedStruct<"rewind", {
719
+ /** First event discarded. */
720
+ readonly from: import("@dxos/keys").EntityIdClass;
721
+ }>;
722
+ export type Rewind = Schema.Schema.Type<typeof Rewind>;
723
+ /**
724
+ * Continues another conversation: its prompt up to `from.event` precedes this feed's main thread.
725
+ */
726
+ export declare const Fork: Schema.TaggedStruct<"fork", {
727
+ readonly from: Schema.Struct<{
728
+ /** Feed of another conversation; absent for the current one. */
729
+ readonly feed: Schema.optional<Ref.RefSchema<Feed.Feed & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>>;
730
+ /** Parent thread; absent for the main thread. */
731
+ readonly thread: Schema.optional<Schema.brand<Schema.String, "@dxos/echo/Feed/BranchId">>;
732
+ /**
733
+ * Last event of the parent that was visible: the last event the writer had folded when it wrote the opener, so an
734
+ * event that syncs in afterwards stays out of what the thread saw.
735
+ */
736
+ readonly event: import("@dxos/keys").EntityIdClass;
737
+ }>;
738
+ }>;
739
+ export type Fork = Schema.Schema.Type<typeof Fork>;
740
+ /**
741
+ * `light` is a fork of main that also starts with a transcript of each thread still running beside it (its
742
+ * `siblings`), so a prompt sent while the agent works runs in parallel with that work.
743
+ */
744
+ export declare const ThreadMode: Schema.Literals<readonly ["fork", "fresh", "light"]>;
745
+ export type ThreadMode = Schema.Schema.Type<typeof ThreadMode>;
746
+ /**
747
+ * Opens a thread: the base of its own branch, whose id is the thread's; the event's `sender` owns the thread.
748
+ */
749
+ export declare const ThreadOpen: Schema.TaggedStruct<"threadOpen", {
750
+ readonly mode: Schema.Literals<readonly ["fork", "fresh", "light"]>;
751
+ /** Where a `fork` or `light` thread branches from; a `fresh` thread starts with no history. */
752
+ readonly from: Schema.optional<Schema.Struct<{
753
+ /** Feed of another conversation; absent for the current one. */
754
+ readonly feed: Schema.optional<Ref.RefSchema<Feed.Feed & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>>;
755
+ /** Parent thread; absent for the main thread. */
756
+ readonly thread: Schema.optional<Schema.brand<Schema.String, "@dxos/echo/Feed/BranchId">>;
757
+ /**
758
+ * Last event of the parent that was visible: the last event the writer had folded when it wrote the opener, so an
759
+ * event that syncs in afterwards stays out of what the thread saw.
760
+ */
761
+ readonly event: import("@dxos/keys").EntityIdClass;
762
+ }>>;
763
+ readonly purpose: Schema.optional<Schema.String>;
764
+ /** `light` only: threads (or turns on main) still running when it opened, whose work it starts with. */
765
+ readonly siblings: Schema.optional<Schema.$Array<Schema.brand<Schema.String, "@dxos/echo/Feed/BranchId">>>;
766
+ }>;
767
+ export type ThreadOpen = Schema.Schema.Type<typeof ThreadOpen>;
768
+ export declare const MergeMode: Schema.Literals<readonly ["raw", "summary"]>;
769
+ export type MergeMode = Schema.Schema.Type<typeof MergeMode>;
770
+ /** Joins the thread whose branch it is written on to its parent. */
771
+ export declare const ThreadMerge: Schema.TaggedStruct<"threadMerge", {
772
+ readonly mode: Schema.Literals<readonly ["raw", "summary"]>;
773
+ readonly summary: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"anchor", {
774
+ readonly pending: Schema.optional<Schema.Boolean>;
775
+ readonly objectId: import("@dxos/keys").EntityIdClass;
776
+ readonly version: Schema.Unknown;
777
+ }>, Schema.TaggedStruct<"change", {
778
+ readonly pending: Schema.optional<Schema.Boolean>;
779
+ readonly before: Schema.String;
780
+ readonly after: Schema.String;
781
+ }>, Schema.TaggedStruct<"file", {
782
+ readonly pending: Schema.optional<Schema.Boolean>;
783
+ readonly url: Schema.String;
784
+ readonly name: Schema.optional<Schema.String>;
785
+ readonly mediaType: Schema.optional<Schema.String>;
786
+ }>, Schema.TaggedStruct<"image", {
787
+ readonly pending: Schema.optional<Schema.Boolean>;
788
+ readonly id: Schema.optional<Schema.String>;
789
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
790
+ readonly type: Schema.Literal<"base64">;
791
+ readonly mediaType: Schema.String;
792
+ readonly data: Schema.String;
793
+ }>, Schema.Struct<{
794
+ readonly type: Schema.Literal<"http">;
795
+ readonly url: Schema.String;
796
+ }>]>>;
797
+ }>, Schema.TaggedStruct<"json", {
798
+ readonly pending: Schema.optional<Schema.Boolean>;
799
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
800
+ readonly data: Schema.String;
801
+ }>, Schema.TaggedStruct<"proposal", {
802
+ readonly pending: Schema.optional<Schema.Boolean>;
803
+ readonly text: Schema.String;
804
+ }>, Schema.TaggedStruct<"reasoning", {
805
+ readonly pending: Schema.optional<Schema.Boolean>;
806
+ readonly reasoningText: Schema.optional<Schema.String>;
807
+ readonly redactedText: Schema.optional<Schema.String>;
808
+ readonly signature: Schema.optional<Schema.String>;
809
+ }>, Schema.TaggedStruct<"reference", {
810
+ readonly pending: Schema.optional<Schema.Boolean>;
811
+ readonly reference: Ref.RefSchema<Obj.Unknown>;
812
+ }>, Schema.TaggedStruct<"request", {
813
+ readonly pending: Schema.optional<Schema.Boolean>;
814
+ readonly requestId: Schema.String;
815
+ readonly title: Schema.String;
816
+ readonly toolCallId: Schema.optional<Schema.String>;
817
+ readonly options: Schema.$Array<Schema.Struct<{
818
+ readonly id: Schema.String;
819
+ readonly label: Schema.String;
820
+ readonly kind: Schema.Literals<readonly ["allow_once", "allow_always", "reject_once", "reject_always"]>;
821
+ }>>;
822
+ readonly preview: Schema.optional<Schema.Struct<{
823
+ readonly label: Schema.String;
824
+ readonly text: Schema.String;
825
+ }>>;
826
+ readonly resolution: Schema.optional<Schema.Struct<{
827
+ readonly outcome: Schema.Literals<readonly ["selected", "cancelled"]>;
828
+ readonly optionId: Schema.optional<Schema.String>;
829
+ }>>;
830
+ }>, Schema.TaggedStruct<"select", {
831
+ readonly pending: Schema.optional<Schema.Boolean>;
832
+ readonly options: Schema.mutable<Schema.$Array<Schema.String>>;
833
+ }>, Schema.TaggedStruct<"status", {
834
+ readonly pending: Schema.optional<Schema.Boolean>;
835
+ readonly statusText: Schema.String;
836
+ }>, Schema.TaggedStruct<"suggestion", {
837
+ readonly pending: Schema.optional<Schema.Boolean>;
838
+ readonly text: Schema.String;
839
+ }>, Schema.TaggedStruct<"stats", {
840
+ readonly pending: Schema.optional<Schema.Boolean>;
841
+ readonly mimeType: Schema.optional<Schema.String>;
842
+ readonly message: Schema.optional<Schema.String>;
843
+ readonly model: Schema.optional<Schema.String>;
844
+ readonly usage: Schema.optional<Schema.Struct<{
845
+ readonly inputTokens: Schema.optional<Schema.Number>;
846
+ readonly outputTokens: Schema.optional<Schema.Number>;
847
+ readonly totalTokens: Schema.optional<Schema.Number>;
848
+ readonly cacheReadTokens: Schema.optional<Schema.Number>;
849
+ readonly cacheWriteTokens: Schema.optional<Schema.Number>;
850
+ }>>;
851
+ readonly toolCalls: Schema.optional<Schema.Number>;
852
+ readonly errors: Schema.optional<Schema.Number>;
853
+ readonly duration: Schema.optional<Schema.Number>;
854
+ readonly finishReason: Schema.optional<Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>>;
855
+ }>, Schema.TaggedStruct<"surface", {
856
+ readonly pending: Schema.optional<Schema.Boolean>;
857
+ readonly role: Schema.String;
858
+ readonly data: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
859
+ }>, Schema.TaggedStruct<"text", {
860
+ readonly pending: Schema.optional<Schema.Boolean>;
861
+ readonly mimeType: Schema.optional<Schema.String>;
862
+ readonly text: Schema.String;
863
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
864
+ }>, Schema.TaggedStruct<"summary", {
865
+ readonly pending: Schema.optional<Schema.Boolean>;
866
+ readonly content: Schema.String;
867
+ }>, Schema.TaggedStruct<"toolkit", {
868
+ readonly pending: Schema.optional<Schema.Boolean>;
869
+ }>, Schema.TaggedStruct<"toolCall", {
870
+ readonly pending: Schema.optional<Schema.Boolean>;
871
+ readonly toolCallId: Schema.String;
872
+ readonly name: Schema.String;
873
+ readonly input: Schema.String;
874
+ readonly providerExecuted: Schema.Boolean;
875
+ readonly operationKey: Schema.optional<Schema.String>;
876
+ readonly operationName: Schema.optional<Schema.String>;
877
+ readonly operationIcon: Schema.optional<Schema.String>;
878
+ readonly displayName: Schema.optional<Schema.String>;
879
+ readonly displayIcon: Schema.optional<Schema.String>;
880
+ }>, Schema.TaggedStruct<"toolResult", {
881
+ readonly pending: Schema.optional<Schema.Boolean>;
882
+ readonly toolCallId: Schema.String;
883
+ readonly name: Schema.String;
884
+ readonly result: Schema.optional<Schema.Union<readonly [Schema.String, Schema.suspend<Schema.TaggedStruct<"~@dxos/types/ContentBlock.ContentBlockResult", {
885
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"text", {
886
+ readonly pending: Schema.optional<Schema.Boolean>;
887
+ readonly mimeType: Schema.optional<Schema.String>;
888
+ readonly text: Schema.String;
889
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
890
+ }>, Schema.suspend<Schema.TaggedStruct<"image", {
891
+ readonly pending: Schema.optional<Schema.Boolean>;
892
+ readonly id: Schema.optional<Schema.String>;
893
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
894
+ readonly type: Schema.Literal<"base64">;
895
+ readonly mediaType: Schema.String;
896
+ readonly data: Schema.String;
897
+ }>, Schema.Struct<{
898
+ readonly type: Schema.Literal<"http">;
899
+ readonly url: Schema.String;
900
+ }>]>>;
901
+ }>>, Schema.suspend<Schema.TaggedStruct<"file", {
902
+ readonly pending: Schema.optional<Schema.Boolean>;
903
+ readonly url: Schema.String;
904
+ readonly name: Schema.optional<Schema.String>;
905
+ readonly mediaType: Schema.optional<Schema.String>;
906
+ }>>]>>;
907
+ }>>]>>;
908
+ readonly error: Schema.optional<Schema.String>;
909
+ readonly providerExecuted: Schema.Boolean;
910
+ readonly invocations: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
911
+ readonly operationKey: Schema.String;
912
+ readonly error: Schema.optional<Schema.String>;
913
+ }>>>>;
914
+ }>, Schema.TaggedStruct<"transcript", {
915
+ readonly pending: Schema.optional<Schema.Boolean>;
916
+ readonly started: Schema.String;
917
+ readonly text: Schema.String;
918
+ readonly corrected: Schema.optional<Schema.String>;
919
+ readonly references: Schema.optional<Schema.mutable<Schema.$Array<Ref.RefSchema<Obj.Unknown>>>>;
920
+ readonly candidates: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
921
+ readonly text: Schema.String;
922
+ readonly kind: Schema.Literals<readonly ["noun", "proper-noun"]>;
923
+ readonly start: Schema.Number;
924
+ readonly end: Schema.Number;
925
+ readonly suggested: Schema.optional<Schema.Struct<{
926
+ readonly typename: Schema.String;
927
+ }>>;
928
+ }>>>>;
929
+ readonly translation: Schema.optional<Schema.String>;
930
+ }>]>>>;
931
+ }>;
932
+ export type ThreadMerge = Schema.Schema.Type<typeof ThreadMerge>;
933
+ /**
934
+ * A turn waits for another thread to end before it continues; written in the waiting turn's thread.
935
+ */
936
+ export declare const ThreadWait: Schema.TaggedStruct<"threadWait", {
937
+ readonly on: Schema.brand<Schema.String, "@dxos/echo/Feed/BranchId">;
938
+ }>;
939
+ export type ThreadWait = Schema.Schema.Type<typeof ThreadWait>;
940
+ export declare const ThreadStatus: Schema.Literals<readonly ["completed", "failed", "cancelled"]>;
941
+ export type ThreadStatus = Schema.Schema.Type<typeof ThreadStatus>;
942
+ /** Ends the thread whose branch it is written on without merging it. */
943
+ export declare const ThreadClose: Schema.TaggedStruct<"threadClose", {
944
+ readonly status: Schema.Literals<readonly ["completed", "failed", "cancelled"]>;
945
+ }>;
946
+ export type ThreadClose = Schema.Schema.Type<typeof ThreadClose>;
947
+ export declare const ModelChange: Schema.TaggedStruct<"modelChange", {
948
+ readonly model: Schema.Codec<DXN.DXN, DXN.DXN, never, never>;
949
+ }>;
950
+ export type ModelChange = Schema.Schema.Type<typeof ModelChange>;
951
+ /**
952
+ * Extension-defined event; `blocks` reach the model only when `visible` is set.
953
+ */
954
+ export declare const Custom: Schema.TaggedStruct<"custom", {
955
+ /** Namespaced extension type (e.g. `org.example.checkpoint`). */
956
+ readonly type: Schema.String;
957
+ readonly visible: Schema.Boolean;
958
+ readonly data: Schema.optional<Schema.Unknown>;
959
+ readonly blocks: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"anchor", {
960
+ readonly pending: Schema.optional<Schema.Boolean>;
961
+ readonly objectId: import("@dxos/keys").EntityIdClass;
962
+ readonly version: Schema.Unknown;
963
+ }>, Schema.TaggedStruct<"change", {
964
+ readonly pending: Schema.optional<Schema.Boolean>;
965
+ readonly before: Schema.String;
966
+ readonly after: Schema.String;
967
+ }>, Schema.TaggedStruct<"file", {
968
+ readonly pending: Schema.optional<Schema.Boolean>;
969
+ readonly url: Schema.String;
970
+ readonly name: Schema.optional<Schema.String>;
971
+ readonly mediaType: Schema.optional<Schema.String>;
972
+ }>, Schema.TaggedStruct<"image", {
973
+ readonly pending: Schema.optional<Schema.Boolean>;
974
+ readonly id: Schema.optional<Schema.String>;
975
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
976
+ readonly type: Schema.Literal<"base64">;
977
+ readonly mediaType: Schema.String;
978
+ readonly data: Schema.String;
979
+ }>, Schema.Struct<{
980
+ readonly type: Schema.Literal<"http">;
981
+ readonly url: Schema.String;
982
+ }>]>>;
983
+ }>, Schema.TaggedStruct<"json", {
984
+ readonly pending: Schema.optional<Schema.Boolean>;
985
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
986
+ readonly data: Schema.String;
987
+ }>, Schema.TaggedStruct<"proposal", {
988
+ readonly pending: Schema.optional<Schema.Boolean>;
989
+ readonly text: Schema.String;
990
+ }>, Schema.TaggedStruct<"reasoning", {
991
+ readonly pending: Schema.optional<Schema.Boolean>;
992
+ readonly reasoningText: Schema.optional<Schema.String>;
993
+ readonly redactedText: Schema.optional<Schema.String>;
994
+ readonly signature: Schema.optional<Schema.String>;
995
+ }>, Schema.TaggedStruct<"reference", {
996
+ readonly pending: Schema.optional<Schema.Boolean>;
997
+ readonly reference: Ref.RefSchema<Obj.Unknown>;
998
+ }>, Schema.TaggedStruct<"request", {
999
+ readonly pending: Schema.optional<Schema.Boolean>;
1000
+ readonly requestId: Schema.String;
1001
+ readonly title: Schema.String;
1002
+ readonly toolCallId: Schema.optional<Schema.String>;
1003
+ readonly options: Schema.$Array<Schema.Struct<{
1004
+ readonly id: Schema.String;
1005
+ readonly label: Schema.String;
1006
+ readonly kind: Schema.Literals<readonly ["allow_once", "allow_always", "reject_once", "reject_always"]>;
1007
+ }>>;
1008
+ readonly preview: Schema.optional<Schema.Struct<{
1009
+ readonly label: Schema.String;
1010
+ readonly text: Schema.String;
1011
+ }>>;
1012
+ readonly resolution: Schema.optional<Schema.Struct<{
1013
+ readonly outcome: Schema.Literals<readonly ["selected", "cancelled"]>;
1014
+ readonly optionId: Schema.optional<Schema.String>;
1015
+ }>>;
1016
+ }>, Schema.TaggedStruct<"select", {
1017
+ readonly pending: Schema.optional<Schema.Boolean>;
1018
+ readonly options: Schema.mutable<Schema.$Array<Schema.String>>;
1019
+ }>, Schema.TaggedStruct<"status", {
1020
+ readonly pending: Schema.optional<Schema.Boolean>;
1021
+ readonly statusText: Schema.String;
1022
+ }>, Schema.TaggedStruct<"suggestion", {
1023
+ readonly pending: Schema.optional<Schema.Boolean>;
1024
+ readonly text: Schema.String;
1025
+ }>, Schema.TaggedStruct<"stats", {
1026
+ readonly pending: Schema.optional<Schema.Boolean>;
1027
+ readonly mimeType: Schema.optional<Schema.String>;
1028
+ readonly message: Schema.optional<Schema.String>;
1029
+ readonly model: Schema.optional<Schema.String>;
1030
+ readonly usage: Schema.optional<Schema.Struct<{
1031
+ readonly inputTokens: Schema.optional<Schema.Number>;
1032
+ readonly outputTokens: Schema.optional<Schema.Number>;
1033
+ readonly totalTokens: Schema.optional<Schema.Number>;
1034
+ readonly cacheReadTokens: Schema.optional<Schema.Number>;
1035
+ readonly cacheWriteTokens: Schema.optional<Schema.Number>;
1036
+ }>>;
1037
+ readonly toolCalls: Schema.optional<Schema.Number>;
1038
+ readonly errors: Schema.optional<Schema.Number>;
1039
+ readonly duration: Schema.optional<Schema.Number>;
1040
+ readonly finishReason: Schema.optional<Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>>;
1041
+ }>, Schema.TaggedStruct<"surface", {
1042
+ readonly pending: Schema.optional<Schema.Boolean>;
1043
+ readonly role: Schema.String;
1044
+ readonly data: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
1045
+ }>, Schema.TaggedStruct<"text", {
1046
+ readonly pending: Schema.optional<Schema.Boolean>;
1047
+ readonly mimeType: Schema.optional<Schema.String>;
1048
+ readonly text: Schema.String;
1049
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
1050
+ }>, Schema.TaggedStruct<"summary", {
1051
+ readonly pending: Schema.optional<Schema.Boolean>;
1052
+ readonly content: Schema.String;
1053
+ }>, Schema.TaggedStruct<"toolkit", {
1054
+ readonly pending: Schema.optional<Schema.Boolean>;
1055
+ }>, Schema.TaggedStruct<"toolCall", {
1056
+ readonly pending: Schema.optional<Schema.Boolean>;
1057
+ readonly toolCallId: Schema.String;
1058
+ readonly name: Schema.String;
1059
+ readonly input: Schema.String;
1060
+ readonly providerExecuted: Schema.Boolean;
1061
+ readonly operationKey: Schema.optional<Schema.String>;
1062
+ readonly operationName: Schema.optional<Schema.String>;
1063
+ readonly operationIcon: Schema.optional<Schema.String>;
1064
+ readonly displayName: Schema.optional<Schema.String>;
1065
+ readonly displayIcon: Schema.optional<Schema.String>;
1066
+ }>, Schema.TaggedStruct<"toolResult", {
1067
+ readonly pending: Schema.optional<Schema.Boolean>;
1068
+ readonly toolCallId: Schema.String;
1069
+ readonly name: Schema.String;
1070
+ readonly result: Schema.optional<Schema.Union<readonly [Schema.String, Schema.suspend<Schema.TaggedStruct<"~@dxos/types/ContentBlock.ContentBlockResult", {
1071
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"text", {
1072
+ readonly pending: Schema.optional<Schema.Boolean>;
1073
+ readonly mimeType: Schema.optional<Schema.String>;
1074
+ readonly text: Schema.String;
1075
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
1076
+ }>, Schema.suspend<Schema.TaggedStruct<"image", {
1077
+ readonly pending: Schema.optional<Schema.Boolean>;
1078
+ readonly id: Schema.optional<Schema.String>;
1079
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
1080
+ readonly type: Schema.Literal<"base64">;
1081
+ readonly mediaType: Schema.String;
1082
+ readonly data: Schema.String;
1083
+ }>, Schema.Struct<{
1084
+ readonly type: Schema.Literal<"http">;
1085
+ readonly url: Schema.String;
1086
+ }>]>>;
1087
+ }>>, Schema.suspend<Schema.TaggedStruct<"file", {
1088
+ readonly pending: Schema.optional<Schema.Boolean>;
1089
+ readonly url: Schema.String;
1090
+ readonly name: Schema.optional<Schema.String>;
1091
+ readonly mediaType: Schema.optional<Schema.String>;
1092
+ }>>]>>;
1093
+ }>>]>>;
1094
+ readonly error: Schema.optional<Schema.String>;
1095
+ readonly providerExecuted: Schema.Boolean;
1096
+ readonly invocations: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
1097
+ readonly operationKey: Schema.String;
1098
+ readonly error: Schema.optional<Schema.String>;
1099
+ }>>>>;
1100
+ }>, Schema.TaggedStruct<"transcript", {
1101
+ readonly pending: Schema.optional<Schema.Boolean>;
1102
+ readonly started: Schema.String;
1103
+ readonly text: Schema.String;
1104
+ readonly corrected: Schema.optional<Schema.String>;
1105
+ readonly references: Schema.optional<Schema.mutable<Schema.$Array<Ref.RefSchema<Obj.Unknown>>>>;
1106
+ readonly candidates: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
1107
+ readonly text: Schema.String;
1108
+ readonly kind: Schema.Literals<readonly ["noun", "proper-noun"]>;
1109
+ readonly start: Schema.Number;
1110
+ readonly end: Schema.Number;
1111
+ readonly suggested: Schema.optional<Schema.Struct<{
1112
+ readonly typename: Schema.String;
1113
+ }>>;
1114
+ }>>>>;
1115
+ readonly translation: Schema.optional<Schema.String>;
1116
+ }>]>>>;
1117
+ }>;
1118
+ export type Custom = Schema.Schema.Type<typeof Custom>;
1119
+ export declare const Payload: Schema.Union<readonly [Schema.TaggedStruct<"message", {
1120
+ readonly blocks: Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"anchor", {
1121
+ readonly pending: Schema.optional<Schema.Boolean>;
1122
+ readonly objectId: import("@dxos/keys").EntityIdClass;
1123
+ readonly version: Schema.Unknown;
1124
+ }>, Schema.TaggedStruct<"change", {
1125
+ readonly pending: Schema.optional<Schema.Boolean>;
1126
+ readonly before: Schema.String;
1127
+ readonly after: Schema.String;
1128
+ }>, Schema.TaggedStruct<"file", {
1129
+ readonly pending: Schema.optional<Schema.Boolean>;
1130
+ readonly url: Schema.String;
1131
+ readonly name: Schema.optional<Schema.String>;
1132
+ readonly mediaType: Schema.optional<Schema.String>;
1133
+ }>, Schema.TaggedStruct<"image", {
1134
+ readonly pending: Schema.optional<Schema.Boolean>;
1135
+ readonly id: Schema.optional<Schema.String>;
1136
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
1137
+ readonly type: Schema.Literal<"base64">;
1138
+ readonly mediaType: Schema.String;
1139
+ readonly data: Schema.String;
1140
+ }>, Schema.Struct<{
1141
+ readonly type: Schema.Literal<"http">;
1142
+ readonly url: Schema.String;
1143
+ }>]>>;
1144
+ }>, Schema.TaggedStruct<"json", {
1145
+ readonly pending: Schema.optional<Schema.Boolean>;
1146
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
1147
+ readonly data: Schema.String;
1148
+ }>, Schema.TaggedStruct<"proposal", {
1149
+ readonly pending: Schema.optional<Schema.Boolean>;
1150
+ readonly text: Schema.String;
1151
+ }>, Schema.TaggedStruct<"reasoning", {
1152
+ readonly pending: Schema.optional<Schema.Boolean>;
1153
+ readonly reasoningText: Schema.optional<Schema.String>;
1154
+ readonly redactedText: Schema.optional<Schema.String>;
1155
+ readonly signature: Schema.optional<Schema.String>;
1156
+ }>, Schema.TaggedStruct<"reference", {
1157
+ readonly pending: Schema.optional<Schema.Boolean>;
1158
+ readonly reference: Ref.RefSchema<Obj.Unknown>;
1159
+ }>, Schema.TaggedStruct<"request", {
1160
+ readonly pending: Schema.optional<Schema.Boolean>;
1161
+ readonly requestId: Schema.String;
1162
+ readonly title: Schema.String;
1163
+ readonly toolCallId: Schema.optional<Schema.String>;
1164
+ readonly options: Schema.$Array<Schema.Struct<{
1165
+ readonly id: Schema.String;
1166
+ readonly label: Schema.String;
1167
+ readonly kind: Schema.Literals<readonly ["allow_once", "allow_always", "reject_once", "reject_always"]>;
1168
+ }>>;
1169
+ readonly preview: Schema.optional<Schema.Struct<{
1170
+ readonly label: Schema.String;
1171
+ readonly text: Schema.String;
1172
+ }>>;
1173
+ readonly resolution: Schema.optional<Schema.Struct<{
1174
+ readonly outcome: Schema.Literals<readonly ["selected", "cancelled"]>;
1175
+ readonly optionId: Schema.optional<Schema.String>;
1176
+ }>>;
1177
+ }>, Schema.TaggedStruct<"select", {
1178
+ readonly pending: Schema.optional<Schema.Boolean>;
1179
+ readonly options: Schema.mutable<Schema.$Array<Schema.String>>;
1180
+ }>, Schema.TaggedStruct<"status", {
1181
+ readonly pending: Schema.optional<Schema.Boolean>;
1182
+ readonly statusText: Schema.String;
1183
+ }>, Schema.TaggedStruct<"suggestion", {
1184
+ readonly pending: Schema.optional<Schema.Boolean>;
1185
+ readonly text: Schema.String;
1186
+ }>, Schema.TaggedStruct<"stats", {
1187
+ readonly pending: Schema.optional<Schema.Boolean>;
1188
+ readonly mimeType: Schema.optional<Schema.String>;
1189
+ readonly message: Schema.optional<Schema.String>;
1190
+ readonly model: Schema.optional<Schema.String>;
1191
+ readonly usage: Schema.optional<Schema.Struct<{
1192
+ readonly inputTokens: Schema.optional<Schema.Number>;
1193
+ readonly outputTokens: Schema.optional<Schema.Number>;
1194
+ readonly totalTokens: Schema.optional<Schema.Number>;
1195
+ readonly cacheReadTokens: Schema.optional<Schema.Number>;
1196
+ readonly cacheWriteTokens: Schema.optional<Schema.Number>;
1197
+ }>>;
1198
+ readonly toolCalls: Schema.optional<Schema.Number>;
1199
+ readonly errors: Schema.optional<Schema.Number>;
1200
+ readonly duration: Schema.optional<Schema.Number>;
1201
+ readonly finishReason: Schema.optional<Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>>;
1202
+ }>, Schema.TaggedStruct<"surface", {
1203
+ readonly pending: Schema.optional<Schema.Boolean>;
1204
+ readonly role: Schema.String;
1205
+ readonly data: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
1206
+ }>, Schema.TaggedStruct<"text", {
1207
+ readonly pending: Schema.optional<Schema.Boolean>;
1208
+ readonly mimeType: Schema.optional<Schema.String>;
1209
+ readonly text: Schema.String;
1210
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
1211
+ }>, Schema.TaggedStruct<"summary", {
1212
+ readonly pending: Schema.optional<Schema.Boolean>;
1213
+ readonly content: Schema.String;
1214
+ }>, Schema.TaggedStruct<"toolkit", {
1215
+ readonly pending: Schema.optional<Schema.Boolean>;
1216
+ }>, Schema.TaggedStruct<"toolCall", {
1217
+ readonly pending: Schema.optional<Schema.Boolean>;
1218
+ readonly toolCallId: Schema.String;
1219
+ readonly name: Schema.String;
1220
+ readonly input: Schema.String;
1221
+ readonly providerExecuted: Schema.Boolean;
1222
+ readonly operationKey: Schema.optional<Schema.String>;
1223
+ readonly operationName: Schema.optional<Schema.String>;
1224
+ readonly operationIcon: Schema.optional<Schema.String>;
1225
+ readonly displayName: Schema.optional<Schema.String>;
1226
+ readonly displayIcon: Schema.optional<Schema.String>;
1227
+ }>, Schema.TaggedStruct<"toolResult", {
1228
+ readonly pending: Schema.optional<Schema.Boolean>;
1229
+ readonly toolCallId: Schema.String;
1230
+ readonly name: Schema.String;
1231
+ readonly result: Schema.optional<Schema.Union<readonly [Schema.String, Schema.suspend<Schema.TaggedStruct<"~@dxos/types/ContentBlock.ContentBlockResult", {
1232
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"text", {
1233
+ readonly pending: Schema.optional<Schema.Boolean>;
1234
+ readonly mimeType: Schema.optional<Schema.String>;
1235
+ readonly text: Schema.String;
1236
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
1237
+ }>, Schema.suspend<Schema.TaggedStruct<"image", {
1238
+ readonly pending: Schema.optional<Schema.Boolean>;
1239
+ readonly id: Schema.optional<Schema.String>;
1240
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
1241
+ readonly type: Schema.Literal<"base64">;
1242
+ readonly mediaType: Schema.String;
1243
+ readonly data: Schema.String;
1244
+ }>, Schema.Struct<{
1245
+ readonly type: Schema.Literal<"http">;
1246
+ readonly url: Schema.String;
1247
+ }>]>>;
1248
+ }>>, Schema.suspend<Schema.TaggedStruct<"file", {
1249
+ readonly pending: Schema.optional<Schema.Boolean>;
1250
+ readonly url: Schema.String;
1251
+ readonly name: Schema.optional<Schema.String>;
1252
+ readonly mediaType: Schema.optional<Schema.String>;
1253
+ }>>]>>;
1254
+ }>>]>>;
1255
+ readonly error: Schema.optional<Schema.String>;
1256
+ readonly providerExecuted: Schema.Boolean;
1257
+ readonly invocations: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
1258
+ readonly operationKey: Schema.String;
1259
+ readonly error: Schema.optional<Schema.String>;
1260
+ }>>>>;
1261
+ }>, Schema.TaggedStruct<"transcript", {
1262
+ readonly pending: Schema.optional<Schema.Boolean>;
1263
+ readonly started: Schema.String;
1264
+ readonly text: Schema.String;
1265
+ readonly corrected: Schema.optional<Schema.String>;
1266
+ readonly references: Schema.optional<Schema.mutable<Schema.$Array<Ref.RefSchema<Obj.Unknown>>>>;
1267
+ readonly candidates: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
1268
+ readonly text: Schema.String;
1269
+ readonly kind: Schema.Literals<readonly ["noun", "proper-noun"]>;
1270
+ readonly start: Schema.Number;
1271
+ readonly end: Schema.Number;
1272
+ readonly suggested: Schema.optional<Schema.Struct<{
1273
+ readonly typename: Schema.String;
1274
+ }>>;
1275
+ }>>>>;
1276
+ readonly translation: Schema.optional<Schema.String>;
1277
+ }>]>>;
1278
+ /** Files or objects attached alongside the blocks, as on `Message.Message`. */
1279
+ readonly attachments: Schema.optional<Schema.$Array<Schema.Struct<{
1280
+ readonly name: Schema.optional<Schema.String>;
1281
+ readonly ref: Ref.RefSchema<Obj.Unknown>;
1282
+ readonly contentId: Schema.optional<Schema.String>;
1283
+ }>>>;
1284
+ /**
1285
+ * `Message.Message`'s properties, carried so a message converts both ways; a channel backend's post receipt lives
1286
+ * here (e.g. `discord.messageId`), which tells a mirror the message is already posted.
1287
+ */
1288
+ readonly properties: Schema.optional<Schema.$Record<Schema.String, Schema.Any>>;
1289
+ }>, Schema.TaggedStruct<"turnBegin", {
1290
+ /** Model DXN, as `SessionConfig.model` stores it; absent when the writer does not choose the model. */
1291
+ readonly model: Schema.optional<Schema.Codec<DXN.DXN, DXN.DXN, never, never>>;
1292
+ /** What the turn saw; absent when it started on an empty log. */
1293
+ readonly from: Schema.optional<Schema.Struct<{
1294
+ /** Feed of another conversation; absent for the current one. */
1295
+ readonly feed: Schema.optional<Ref.RefSchema<Feed.Feed & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>>;
1296
+ /** Parent thread; absent for the main thread. */
1297
+ readonly thread: Schema.optional<Schema.brand<Schema.String, "@dxos/echo/Feed/BranchId">>;
1298
+ /**
1299
+ * Last event of the parent that was visible: the last event the writer had folded when it wrote the opener, so an
1300
+ * event that syncs in afterwards stays out of what the thread saw.
1301
+ */
1302
+ readonly event: import("@dxos/keys").EntityIdClass;
1303
+ }>>;
1304
+ }>, Schema.TaggedStruct<"turnEnd", {
1305
+ readonly finishReason: Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>;
1306
+ readonly usage: Schema.optional<Schema.Struct<{
1307
+ readonly inputTokens: Schema.optional<Schema.Number>;
1308
+ readonly outputTokens: Schema.optional<Schema.Number>;
1309
+ readonly cacheReadTokens: Schema.optional<Schema.Number>;
1310
+ readonly cacheWriteTokens: Schema.optional<Schema.Number>;
1311
+ }>>;
1312
+ readonly error: Schema.optional<Schema.String>;
1313
+ }>, Schema.TaggedStruct<"promptConsume", {
1314
+ readonly message: import("@dxos/keys").EntityIdClass;
1315
+ }>, Schema.TaggedStruct<"promptCancel", {
1316
+ readonly message: import("@dxos/keys").EntityIdClass;
1317
+ }>, Schema.TaggedStruct<"contextBind", {
1318
+ skills: Schema.$Array<Ref.RefSchema<Skill.Skill & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>>;
1319
+ objects: Schema.$Array<Ref.RefSchema<Obj.Unknown>>;
1320
+ /**
1321
+ * Connections whose MCP server the conversation turns on (`contextBind`) or off (`contextUnbind`); one never
1322
+ * named follows the space default.
1323
+ */
1324
+ connections: Schema.optional<Schema.$Array<Ref.RefSchema<Obj.Unknown>>>;
1325
+ }>, Schema.TaggedStruct<"contextUnbind", {
1326
+ skills: Schema.$Array<Ref.RefSchema<Skill.Skill & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>>;
1327
+ objects: Schema.$Array<Ref.RefSchema<Obj.Unknown>>;
1328
+ /**
1329
+ * Connections whose MCP server the conversation turns on (`contextBind`) or off (`contextUnbind`); one never
1330
+ * named follows the space default.
1331
+ */
1332
+ connections: Schema.optional<Schema.$Array<Ref.RefSchema<Obj.Unknown>>>;
1333
+ }>, Schema.TaggedStruct<"alarmSet", {
1334
+ /** Epoch milliseconds. */
1335
+ readonly wakeAt: Schema.Number;
1336
+ readonly message: Schema.optional<Schema.String>;
1337
+ }>, Schema.TaggedStruct<"alarmCancel", {
1338
+ readonly alarm: import("@dxos/keys").EntityIdClass;
1339
+ }>, Schema.TaggedStruct<"alarmFire", {
1340
+ readonly alarm: import("@dxos/keys").EntityIdClass;
1341
+ }>, Schema.TaggedStruct<"toolBackground", {
1342
+ readonly toolCallId: Schema.String;
1343
+ /** Process running the call. */
1344
+ readonly pid: Schema.optional<Schema.String>;
1345
+ }>, Schema.TaggedStruct<"toolDeliver", {
1346
+ readonly toolCallId: Schema.String;
1347
+ readonly result: Schema.TaggedStruct<"toolResult", {
1348
+ readonly pending: Schema.optional<Schema.Boolean>;
1349
+ readonly toolCallId: Schema.String;
1350
+ readonly name: Schema.String;
1351
+ readonly result: Schema.optional<Schema.Union<readonly [Schema.String, Schema.suspend<Schema.TaggedStruct<"~@dxos/types/ContentBlock.ContentBlockResult", {
1352
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"text", {
1353
+ readonly pending: Schema.optional<Schema.Boolean>;
1354
+ readonly mimeType: Schema.optional<Schema.String>;
1355
+ readonly text: Schema.String;
1356
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
1357
+ }>, Schema.suspend<Schema.TaggedStruct<"image", {
1358
+ readonly pending: Schema.optional<Schema.Boolean>;
1359
+ readonly id: Schema.optional<Schema.String>;
1360
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
1361
+ readonly type: Schema.Literal<"base64">;
1362
+ readonly mediaType: Schema.String;
1363
+ readonly data: Schema.String;
1364
+ }>, Schema.Struct<{
1365
+ readonly type: Schema.Literal<"http">;
1366
+ readonly url: Schema.String;
1367
+ }>]>>;
1368
+ }>>, Schema.suspend<Schema.TaggedStruct<"file", {
1369
+ readonly pending: Schema.optional<Schema.Boolean>;
1370
+ readonly url: Schema.String;
1371
+ readonly name: Schema.optional<Schema.String>;
1372
+ readonly mediaType: Schema.optional<Schema.String>;
1373
+ }>>]>>;
1374
+ }>>]>>;
1375
+ readonly error: Schema.optional<Schema.String>;
1376
+ readonly providerExecuted: Schema.Boolean;
1377
+ readonly invocations: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
1378
+ readonly operationKey: Schema.String;
1379
+ readonly error: Schema.optional<Schema.String>;
1380
+ }>>>>;
1381
+ }>;
1382
+ }>, Schema.TaggedStruct<"hookBegin", {
1383
+ readonly hook: Schema.String;
1384
+ readonly kind: Schema.Literals<readonly ["inline", "background", "agentic"]>;
1385
+ /** Thread an agentic hook runs in. */
1386
+ readonly thread: Schema.optional<Schema.brand<Schema.String, "@dxos/echo/Feed/BranchId">>;
1387
+ }>, Schema.TaggedStruct<"hookEnd", {
1388
+ readonly begin: import("@dxos/keys").EntityIdClass;
1389
+ /** Output of an inline hook, which the model sees. */
1390
+ readonly blocks: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"anchor", {
1391
+ readonly pending: Schema.optional<Schema.Boolean>;
1392
+ readonly objectId: import("@dxos/keys").EntityIdClass;
1393
+ readonly version: Schema.Unknown;
1394
+ }>, Schema.TaggedStruct<"change", {
1395
+ readonly pending: Schema.optional<Schema.Boolean>;
1396
+ readonly before: Schema.String;
1397
+ readonly after: Schema.String;
1398
+ }>, Schema.TaggedStruct<"file", {
1399
+ readonly pending: Schema.optional<Schema.Boolean>;
1400
+ readonly url: Schema.String;
1401
+ readonly name: Schema.optional<Schema.String>;
1402
+ readonly mediaType: Schema.optional<Schema.String>;
1403
+ }>, Schema.TaggedStruct<"image", {
1404
+ readonly pending: Schema.optional<Schema.Boolean>;
1405
+ readonly id: Schema.optional<Schema.String>;
1406
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
1407
+ readonly type: Schema.Literal<"base64">;
1408
+ readonly mediaType: Schema.String;
1409
+ readonly data: Schema.String;
1410
+ }>, Schema.Struct<{
1411
+ readonly type: Schema.Literal<"http">;
1412
+ readonly url: Schema.String;
1413
+ }>]>>;
1414
+ }>, Schema.TaggedStruct<"json", {
1415
+ readonly pending: Schema.optional<Schema.Boolean>;
1416
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
1417
+ readonly data: Schema.String;
1418
+ }>, Schema.TaggedStruct<"proposal", {
1419
+ readonly pending: Schema.optional<Schema.Boolean>;
1420
+ readonly text: Schema.String;
1421
+ }>, Schema.TaggedStruct<"reasoning", {
1422
+ readonly pending: Schema.optional<Schema.Boolean>;
1423
+ readonly reasoningText: Schema.optional<Schema.String>;
1424
+ readonly redactedText: Schema.optional<Schema.String>;
1425
+ readonly signature: Schema.optional<Schema.String>;
1426
+ }>, Schema.TaggedStruct<"reference", {
1427
+ readonly pending: Schema.optional<Schema.Boolean>;
1428
+ readonly reference: Ref.RefSchema<Obj.Unknown>;
1429
+ }>, Schema.TaggedStruct<"request", {
1430
+ readonly pending: Schema.optional<Schema.Boolean>;
1431
+ readonly requestId: Schema.String;
1432
+ readonly title: Schema.String;
1433
+ readonly toolCallId: Schema.optional<Schema.String>;
1434
+ readonly options: Schema.$Array<Schema.Struct<{
1435
+ readonly id: Schema.String;
1436
+ readonly label: Schema.String;
1437
+ readonly kind: Schema.Literals<readonly ["allow_once", "allow_always", "reject_once", "reject_always"]>;
1438
+ }>>;
1439
+ readonly preview: Schema.optional<Schema.Struct<{
1440
+ readonly label: Schema.String;
1441
+ readonly text: Schema.String;
1442
+ }>>;
1443
+ readonly resolution: Schema.optional<Schema.Struct<{
1444
+ readonly outcome: Schema.Literals<readonly ["selected", "cancelled"]>;
1445
+ readonly optionId: Schema.optional<Schema.String>;
1446
+ }>>;
1447
+ }>, Schema.TaggedStruct<"select", {
1448
+ readonly pending: Schema.optional<Schema.Boolean>;
1449
+ readonly options: Schema.mutable<Schema.$Array<Schema.String>>;
1450
+ }>, Schema.TaggedStruct<"status", {
1451
+ readonly pending: Schema.optional<Schema.Boolean>;
1452
+ readonly statusText: Schema.String;
1453
+ }>, Schema.TaggedStruct<"suggestion", {
1454
+ readonly pending: Schema.optional<Schema.Boolean>;
1455
+ readonly text: Schema.String;
1456
+ }>, Schema.TaggedStruct<"stats", {
1457
+ readonly pending: Schema.optional<Schema.Boolean>;
1458
+ readonly mimeType: Schema.optional<Schema.String>;
1459
+ readonly message: Schema.optional<Schema.String>;
1460
+ readonly model: Schema.optional<Schema.String>;
1461
+ readonly usage: Schema.optional<Schema.Struct<{
1462
+ readonly inputTokens: Schema.optional<Schema.Number>;
1463
+ readonly outputTokens: Schema.optional<Schema.Number>;
1464
+ readonly totalTokens: Schema.optional<Schema.Number>;
1465
+ readonly cacheReadTokens: Schema.optional<Schema.Number>;
1466
+ readonly cacheWriteTokens: Schema.optional<Schema.Number>;
1467
+ }>>;
1468
+ readonly toolCalls: Schema.optional<Schema.Number>;
1469
+ readonly errors: Schema.optional<Schema.Number>;
1470
+ readonly duration: Schema.optional<Schema.Number>;
1471
+ readonly finishReason: Schema.optional<Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>>;
1472
+ }>, Schema.TaggedStruct<"surface", {
1473
+ readonly pending: Schema.optional<Schema.Boolean>;
1474
+ readonly role: Schema.String;
1475
+ readonly data: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
1476
+ }>, Schema.TaggedStruct<"text", {
1477
+ readonly pending: Schema.optional<Schema.Boolean>;
1478
+ readonly mimeType: Schema.optional<Schema.String>;
1479
+ readonly text: Schema.String;
1480
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
1481
+ }>, Schema.TaggedStruct<"summary", {
1482
+ readonly pending: Schema.optional<Schema.Boolean>;
1483
+ readonly content: Schema.String;
1484
+ }>, Schema.TaggedStruct<"toolkit", {
1485
+ readonly pending: Schema.optional<Schema.Boolean>;
1486
+ }>, Schema.TaggedStruct<"toolCall", {
1487
+ readonly pending: Schema.optional<Schema.Boolean>;
1488
+ readonly toolCallId: Schema.String;
1489
+ readonly name: Schema.String;
1490
+ readonly input: Schema.String;
1491
+ readonly providerExecuted: Schema.Boolean;
1492
+ readonly operationKey: Schema.optional<Schema.String>;
1493
+ readonly operationName: Schema.optional<Schema.String>;
1494
+ readonly operationIcon: Schema.optional<Schema.String>;
1495
+ readonly displayName: Schema.optional<Schema.String>;
1496
+ readonly displayIcon: Schema.optional<Schema.String>;
1497
+ }>, Schema.TaggedStruct<"toolResult", {
1498
+ readonly pending: Schema.optional<Schema.Boolean>;
1499
+ readonly toolCallId: Schema.String;
1500
+ readonly name: Schema.String;
1501
+ readonly result: Schema.optional<Schema.Union<readonly [Schema.String, Schema.suspend<Schema.TaggedStruct<"~@dxos/types/ContentBlock.ContentBlockResult", {
1502
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"text", {
1503
+ readonly pending: Schema.optional<Schema.Boolean>;
1504
+ readonly mimeType: Schema.optional<Schema.String>;
1505
+ readonly text: Schema.String;
1506
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
1507
+ }>, Schema.suspend<Schema.TaggedStruct<"image", {
1508
+ readonly pending: Schema.optional<Schema.Boolean>;
1509
+ readonly id: Schema.optional<Schema.String>;
1510
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
1511
+ readonly type: Schema.Literal<"base64">;
1512
+ readonly mediaType: Schema.String;
1513
+ readonly data: Schema.String;
1514
+ }>, Schema.Struct<{
1515
+ readonly type: Schema.Literal<"http">;
1516
+ readonly url: Schema.String;
1517
+ }>]>>;
1518
+ }>>, Schema.suspend<Schema.TaggedStruct<"file", {
1519
+ readonly pending: Schema.optional<Schema.Boolean>;
1520
+ readonly url: Schema.String;
1521
+ readonly name: Schema.optional<Schema.String>;
1522
+ readonly mediaType: Schema.optional<Schema.String>;
1523
+ }>>]>>;
1524
+ }>>]>>;
1525
+ readonly error: Schema.optional<Schema.String>;
1526
+ readonly providerExecuted: Schema.Boolean;
1527
+ readonly invocations: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
1528
+ readonly operationKey: Schema.String;
1529
+ readonly error: Schema.optional<Schema.String>;
1530
+ }>>>>;
1531
+ }>, Schema.TaggedStruct<"transcript", {
1532
+ readonly pending: Schema.optional<Schema.Boolean>;
1533
+ readonly started: Schema.String;
1534
+ readonly text: Schema.String;
1535
+ readonly corrected: Schema.optional<Schema.String>;
1536
+ readonly references: Schema.optional<Schema.mutable<Schema.$Array<Ref.RefSchema<Obj.Unknown>>>>;
1537
+ readonly candidates: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
1538
+ readonly text: Schema.String;
1539
+ readonly kind: Schema.Literals<readonly ["noun", "proper-noun"]>;
1540
+ readonly start: Schema.Number;
1541
+ readonly end: Schema.Number;
1542
+ readonly suggested: Schema.optional<Schema.Struct<{
1543
+ readonly typename: Schema.String;
1544
+ }>>;
1545
+ }>>>>;
1546
+ readonly translation: Schema.optional<Schema.String>;
1547
+ }>]>>>;
1548
+ readonly error: Schema.optional<Schema.String>;
1549
+ }>, Schema.TaggedStruct<"compact", {
1550
+ readonly from: import("@dxos/keys").EntityIdClass;
1551
+ readonly to: import("@dxos/keys").EntityIdClass;
1552
+ readonly summary: Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"anchor", {
1553
+ readonly pending: Schema.optional<Schema.Boolean>;
1554
+ readonly objectId: import("@dxos/keys").EntityIdClass;
1555
+ readonly version: Schema.Unknown;
1556
+ }>, Schema.TaggedStruct<"change", {
1557
+ readonly pending: Schema.optional<Schema.Boolean>;
1558
+ readonly before: Schema.String;
1559
+ readonly after: Schema.String;
1560
+ }>, Schema.TaggedStruct<"file", {
1561
+ readonly pending: Schema.optional<Schema.Boolean>;
1562
+ readonly url: Schema.String;
1563
+ readonly name: Schema.optional<Schema.String>;
1564
+ readonly mediaType: Schema.optional<Schema.String>;
1565
+ }>, Schema.TaggedStruct<"image", {
1566
+ readonly pending: Schema.optional<Schema.Boolean>;
1567
+ readonly id: Schema.optional<Schema.String>;
1568
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
1569
+ readonly type: Schema.Literal<"base64">;
1570
+ readonly mediaType: Schema.String;
1571
+ readonly data: Schema.String;
1572
+ }>, Schema.Struct<{
1573
+ readonly type: Schema.Literal<"http">;
1574
+ readonly url: Schema.String;
1575
+ }>]>>;
1576
+ }>, Schema.TaggedStruct<"json", {
1577
+ readonly pending: Schema.optional<Schema.Boolean>;
1578
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
1579
+ readonly data: Schema.String;
1580
+ }>, Schema.TaggedStruct<"proposal", {
1581
+ readonly pending: Schema.optional<Schema.Boolean>;
1582
+ readonly text: Schema.String;
1583
+ }>, Schema.TaggedStruct<"reasoning", {
1584
+ readonly pending: Schema.optional<Schema.Boolean>;
1585
+ readonly reasoningText: Schema.optional<Schema.String>;
1586
+ readonly redactedText: Schema.optional<Schema.String>;
1587
+ readonly signature: Schema.optional<Schema.String>;
1588
+ }>, Schema.TaggedStruct<"reference", {
1589
+ readonly pending: Schema.optional<Schema.Boolean>;
1590
+ readonly reference: Ref.RefSchema<Obj.Unknown>;
1591
+ }>, Schema.TaggedStruct<"request", {
1592
+ readonly pending: Schema.optional<Schema.Boolean>;
1593
+ readonly requestId: Schema.String;
1594
+ readonly title: Schema.String;
1595
+ readonly toolCallId: Schema.optional<Schema.String>;
1596
+ readonly options: Schema.$Array<Schema.Struct<{
1597
+ readonly id: Schema.String;
1598
+ readonly label: Schema.String;
1599
+ readonly kind: Schema.Literals<readonly ["allow_once", "allow_always", "reject_once", "reject_always"]>;
1600
+ }>>;
1601
+ readonly preview: Schema.optional<Schema.Struct<{
1602
+ readonly label: Schema.String;
1603
+ readonly text: Schema.String;
1604
+ }>>;
1605
+ readonly resolution: Schema.optional<Schema.Struct<{
1606
+ readonly outcome: Schema.Literals<readonly ["selected", "cancelled"]>;
1607
+ readonly optionId: Schema.optional<Schema.String>;
1608
+ }>>;
1609
+ }>, Schema.TaggedStruct<"select", {
1610
+ readonly pending: Schema.optional<Schema.Boolean>;
1611
+ readonly options: Schema.mutable<Schema.$Array<Schema.String>>;
1612
+ }>, Schema.TaggedStruct<"status", {
1613
+ readonly pending: Schema.optional<Schema.Boolean>;
1614
+ readonly statusText: Schema.String;
1615
+ }>, Schema.TaggedStruct<"suggestion", {
1616
+ readonly pending: Schema.optional<Schema.Boolean>;
1617
+ readonly text: Schema.String;
1618
+ }>, Schema.TaggedStruct<"stats", {
1619
+ readonly pending: Schema.optional<Schema.Boolean>;
1620
+ readonly mimeType: Schema.optional<Schema.String>;
1621
+ readonly message: Schema.optional<Schema.String>;
1622
+ readonly model: Schema.optional<Schema.String>;
1623
+ readonly usage: Schema.optional<Schema.Struct<{
1624
+ readonly inputTokens: Schema.optional<Schema.Number>;
1625
+ readonly outputTokens: Schema.optional<Schema.Number>;
1626
+ readonly totalTokens: Schema.optional<Schema.Number>;
1627
+ readonly cacheReadTokens: Schema.optional<Schema.Number>;
1628
+ readonly cacheWriteTokens: Schema.optional<Schema.Number>;
1629
+ }>>;
1630
+ readonly toolCalls: Schema.optional<Schema.Number>;
1631
+ readonly errors: Schema.optional<Schema.Number>;
1632
+ readonly duration: Schema.optional<Schema.Number>;
1633
+ readonly finishReason: Schema.optional<Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>>;
1634
+ }>, Schema.TaggedStruct<"surface", {
1635
+ readonly pending: Schema.optional<Schema.Boolean>;
1636
+ readonly role: Schema.String;
1637
+ readonly data: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
1638
+ }>, Schema.TaggedStruct<"text", {
1639
+ readonly pending: Schema.optional<Schema.Boolean>;
1640
+ readonly mimeType: Schema.optional<Schema.String>;
1641
+ readonly text: Schema.String;
1642
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
1643
+ }>, Schema.TaggedStruct<"summary", {
1644
+ readonly pending: Schema.optional<Schema.Boolean>;
1645
+ readonly content: Schema.String;
1646
+ }>, Schema.TaggedStruct<"toolkit", {
1647
+ readonly pending: Schema.optional<Schema.Boolean>;
1648
+ }>, Schema.TaggedStruct<"toolCall", {
1649
+ readonly pending: Schema.optional<Schema.Boolean>;
1650
+ readonly toolCallId: Schema.String;
1651
+ readonly name: Schema.String;
1652
+ readonly input: Schema.String;
1653
+ readonly providerExecuted: Schema.Boolean;
1654
+ readonly operationKey: Schema.optional<Schema.String>;
1655
+ readonly operationName: Schema.optional<Schema.String>;
1656
+ readonly operationIcon: Schema.optional<Schema.String>;
1657
+ readonly displayName: Schema.optional<Schema.String>;
1658
+ readonly displayIcon: Schema.optional<Schema.String>;
1659
+ }>, Schema.TaggedStruct<"toolResult", {
1660
+ readonly pending: Schema.optional<Schema.Boolean>;
1661
+ readonly toolCallId: Schema.String;
1662
+ readonly name: Schema.String;
1663
+ readonly result: Schema.optional<Schema.Union<readonly [Schema.String, Schema.suspend<Schema.TaggedStruct<"~@dxos/types/ContentBlock.ContentBlockResult", {
1664
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"text", {
1665
+ readonly pending: Schema.optional<Schema.Boolean>;
1666
+ readonly mimeType: Schema.optional<Schema.String>;
1667
+ readonly text: Schema.String;
1668
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
1669
+ }>, Schema.suspend<Schema.TaggedStruct<"image", {
1670
+ readonly pending: Schema.optional<Schema.Boolean>;
1671
+ readonly id: Schema.optional<Schema.String>;
1672
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
1673
+ readonly type: Schema.Literal<"base64">;
1674
+ readonly mediaType: Schema.String;
1675
+ readonly data: Schema.String;
1676
+ }>, Schema.Struct<{
1677
+ readonly type: Schema.Literal<"http">;
1678
+ readonly url: Schema.String;
1679
+ }>]>>;
1680
+ }>>, Schema.suspend<Schema.TaggedStruct<"file", {
1681
+ readonly pending: Schema.optional<Schema.Boolean>;
1682
+ readonly url: Schema.String;
1683
+ readonly name: Schema.optional<Schema.String>;
1684
+ readonly mediaType: Schema.optional<Schema.String>;
1685
+ }>>]>>;
1686
+ }>>]>>;
1687
+ readonly error: Schema.optional<Schema.String>;
1688
+ readonly providerExecuted: Schema.Boolean;
1689
+ readonly invocations: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
1690
+ readonly operationKey: Schema.String;
1691
+ readonly error: Schema.optional<Schema.String>;
1692
+ }>>>>;
1693
+ }>, Schema.TaggedStruct<"transcript", {
1694
+ readonly pending: Schema.optional<Schema.Boolean>;
1695
+ readonly started: Schema.String;
1696
+ readonly text: Schema.String;
1697
+ readonly corrected: Schema.optional<Schema.String>;
1698
+ readonly references: Schema.optional<Schema.mutable<Schema.$Array<Ref.RefSchema<Obj.Unknown>>>>;
1699
+ readonly candidates: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
1700
+ readonly text: Schema.String;
1701
+ readonly kind: Schema.Literals<readonly ["noun", "proper-noun"]>;
1702
+ readonly start: Schema.Number;
1703
+ readonly end: Schema.Number;
1704
+ readonly suggested: Schema.optional<Schema.Struct<{
1705
+ readonly typename: Schema.String;
1706
+ }>>;
1707
+ }>>>>;
1708
+ readonly translation: Schema.optional<Schema.String>;
1709
+ }>]>>;
1710
+ /** Threads whose merged entries the range holds; a thread still running is never in it. */
1711
+ readonly closure: Schema.optional<Schema.$Array<Schema.brand<Schema.String, "@dxos/echo/Feed/BranchId">>>;
1712
+ }>, Schema.TaggedStruct<"requestResolve", {
1713
+ readonly message: import("@dxos/keys").EntityIdClass;
1714
+ readonly requestId: Schema.String;
1715
+ readonly resolution: Schema.Struct<{
1716
+ readonly outcome: Schema.Literals<readonly ["selected", "cancelled"]>;
1717
+ readonly optionId: Schema.optional<Schema.String>;
1718
+ }>;
1719
+ }>, Schema.TaggedStruct<"rewind", {
1720
+ /** First event discarded. */
1721
+ readonly from: import("@dxos/keys").EntityIdClass;
1722
+ }>, Schema.TaggedStruct<"fork", {
1723
+ readonly from: Schema.Struct<{
1724
+ /** Feed of another conversation; absent for the current one. */
1725
+ readonly feed: Schema.optional<Ref.RefSchema<Feed.Feed & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>>;
1726
+ /** Parent thread; absent for the main thread. */
1727
+ readonly thread: Schema.optional<Schema.brand<Schema.String, "@dxos/echo/Feed/BranchId">>;
1728
+ /**
1729
+ * Last event of the parent that was visible: the last event the writer had folded when it wrote the opener, so an
1730
+ * event that syncs in afterwards stays out of what the thread saw.
1731
+ */
1732
+ readonly event: import("@dxos/keys").EntityIdClass;
1733
+ }>;
1734
+ }>, Schema.TaggedStruct<"threadOpen", {
1735
+ readonly mode: Schema.Literals<readonly ["fork", "fresh", "light"]>;
1736
+ /** Where a `fork` or `light` thread branches from; a `fresh` thread starts with no history. */
1737
+ readonly from: Schema.optional<Schema.Struct<{
1738
+ /** Feed of another conversation; absent for the current one. */
1739
+ readonly feed: Schema.optional<Ref.RefSchema<Feed.Feed & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>>;
1740
+ /** Parent thread; absent for the main thread. */
1741
+ readonly thread: Schema.optional<Schema.brand<Schema.String, "@dxos/echo/Feed/BranchId">>;
1742
+ /**
1743
+ * Last event of the parent that was visible: the last event the writer had folded when it wrote the opener, so an
1744
+ * event that syncs in afterwards stays out of what the thread saw.
1745
+ */
1746
+ readonly event: import("@dxos/keys").EntityIdClass;
1747
+ }>>;
1748
+ readonly purpose: Schema.optional<Schema.String>;
1749
+ /** `light` only: threads (or turns on main) still running when it opened, whose work it starts with. */
1750
+ readonly siblings: Schema.optional<Schema.$Array<Schema.brand<Schema.String, "@dxos/echo/Feed/BranchId">>>;
1751
+ }>, Schema.TaggedStruct<"threadMerge", {
1752
+ readonly mode: Schema.Literals<readonly ["raw", "summary"]>;
1753
+ readonly summary: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"anchor", {
1754
+ readonly pending: Schema.optional<Schema.Boolean>;
1755
+ readonly objectId: import("@dxos/keys").EntityIdClass;
1756
+ readonly version: Schema.Unknown;
1757
+ }>, Schema.TaggedStruct<"change", {
1758
+ readonly pending: Schema.optional<Schema.Boolean>;
1759
+ readonly before: Schema.String;
1760
+ readonly after: Schema.String;
1761
+ }>, Schema.TaggedStruct<"file", {
1762
+ readonly pending: Schema.optional<Schema.Boolean>;
1763
+ readonly url: Schema.String;
1764
+ readonly name: Schema.optional<Schema.String>;
1765
+ readonly mediaType: Schema.optional<Schema.String>;
1766
+ }>, Schema.TaggedStruct<"image", {
1767
+ readonly pending: Schema.optional<Schema.Boolean>;
1768
+ readonly id: Schema.optional<Schema.String>;
1769
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
1770
+ readonly type: Schema.Literal<"base64">;
1771
+ readonly mediaType: Schema.String;
1772
+ readonly data: Schema.String;
1773
+ }>, Schema.Struct<{
1774
+ readonly type: Schema.Literal<"http">;
1775
+ readonly url: Schema.String;
1776
+ }>]>>;
1777
+ }>, Schema.TaggedStruct<"json", {
1778
+ readonly pending: Schema.optional<Schema.Boolean>;
1779
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
1780
+ readonly data: Schema.String;
1781
+ }>, Schema.TaggedStruct<"proposal", {
1782
+ readonly pending: Schema.optional<Schema.Boolean>;
1783
+ readonly text: Schema.String;
1784
+ }>, Schema.TaggedStruct<"reasoning", {
1785
+ readonly pending: Schema.optional<Schema.Boolean>;
1786
+ readonly reasoningText: Schema.optional<Schema.String>;
1787
+ readonly redactedText: Schema.optional<Schema.String>;
1788
+ readonly signature: Schema.optional<Schema.String>;
1789
+ }>, Schema.TaggedStruct<"reference", {
1790
+ readonly pending: Schema.optional<Schema.Boolean>;
1791
+ readonly reference: Ref.RefSchema<Obj.Unknown>;
1792
+ }>, Schema.TaggedStruct<"request", {
1793
+ readonly pending: Schema.optional<Schema.Boolean>;
1794
+ readonly requestId: Schema.String;
1795
+ readonly title: Schema.String;
1796
+ readonly toolCallId: Schema.optional<Schema.String>;
1797
+ readonly options: Schema.$Array<Schema.Struct<{
1798
+ readonly id: Schema.String;
1799
+ readonly label: Schema.String;
1800
+ readonly kind: Schema.Literals<readonly ["allow_once", "allow_always", "reject_once", "reject_always"]>;
1801
+ }>>;
1802
+ readonly preview: Schema.optional<Schema.Struct<{
1803
+ readonly label: Schema.String;
1804
+ readonly text: Schema.String;
1805
+ }>>;
1806
+ readonly resolution: Schema.optional<Schema.Struct<{
1807
+ readonly outcome: Schema.Literals<readonly ["selected", "cancelled"]>;
1808
+ readonly optionId: Schema.optional<Schema.String>;
1809
+ }>>;
1810
+ }>, Schema.TaggedStruct<"select", {
1811
+ readonly pending: Schema.optional<Schema.Boolean>;
1812
+ readonly options: Schema.mutable<Schema.$Array<Schema.String>>;
1813
+ }>, Schema.TaggedStruct<"status", {
1814
+ readonly pending: Schema.optional<Schema.Boolean>;
1815
+ readonly statusText: Schema.String;
1816
+ }>, Schema.TaggedStruct<"suggestion", {
1817
+ readonly pending: Schema.optional<Schema.Boolean>;
1818
+ readonly text: Schema.String;
1819
+ }>, Schema.TaggedStruct<"stats", {
1820
+ readonly pending: Schema.optional<Schema.Boolean>;
1821
+ readonly mimeType: Schema.optional<Schema.String>;
1822
+ readonly message: Schema.optional<Schema.String>;
1823
+ readonly model: Schema.optional<Schema.String>;
1824
+ readonly usage: Schema.optional<Schema.Struct<{
1825
+ readonly inputTokens: Schema.optional<Schema.Number>;
1826
+ readonly outputTokens: Schema.optional<Schema.Number>;
1827
+ readonly totalTokens: Schema.optional<Schema.Number>;
1828
+ readonly cacheReadTokens: Schema.optional<Schema.Number>;
1829
+ readonly cacheWriteTokens: Schema.optional<Schema.Number>;
1830
+ }>>;
1831
+ readonly toolCalls: Schema.optional<Schema.Number>;
1832
+ readonly errors: Schema.optional<Schema.Number>;
1833
+ readonly duration: Schema.optional<Schema.Number>;
1834
+ readonly finishReason: Schema.optional<Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>>;
1835
+ }>, Schema.TaggedStruct<"surface", {
1836
+ readonly pending: Schema.optional<Schema.Boolean>;
1837
+ readonly role: Schema.String;
1838
+ readonly data: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
1839
+ }>, Schema.TaggedStruct<"text", {
1840
+ readonly pending: Schema.optional<Schema.Boolean>;
1841
+ readonly mimeType: Schema.optional<Schema.String>;
1842
+ readonly text: Schema.String;
1843
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
1844
+ }>, Schema.TaggedStruct<"summary", {
1845
+ readonly pending: Schema.optional<Schema.Boolean>;
1846
+ readonly content: Schema.String;
1847
+ }>, Schema.TaggedStruct<"toolkit", {
1848
+ readonly pending: Schema.optional<Schema.Boolean>;
1849
+ }>, Schema.TaggedStruct<"toolCall", {
1850
+ readonly pending: Schema.optional<Schema.Boolean>;
1851
+ readonly toolCallId: Schema.String;
1852
+ readonly name: Schema.String;
1853
+ readonly input: Schema.String;
1854
+ readonly providerExecuted: Schema.Boolean;
1855
+ readonly operationKey: Schema.optional<Schema.String>;
1856
+ readonly operationName: Schema.optional<Schema.String>;
1857
+ readonly operationIcon: Schema.optional<Schema.String>;
1858
+ readonly displayName: Schema.optional<Schema.String>;
1859
+ readonly displayIcon: Schema.optional<Schema.String>;
1860
+ }>, Schema.TaggedStruct<"toolResult", {
1861
+ readonly pending: Schema.optional<Schema.Boolean>;
1862
+ readonly toolCallId: Schema.String;
1863
+ readonly name: Schema.String;
1864
+ readonly result: Schema.optional<Schema.Union<readonly [Schema.String, Schema.suspend<Schema.TaggedStruct<"~@dxos/types/ContentBlock.ContentBlockResult", {
1865
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"text", {
1866
+ readonly pending: Schema.optional<Schema.Boolean>;
1867
+ readonly mimeType: Schema.optional<Schema.String>;
1868
+ readonly text: Schema.String;
1869
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
1870
+ }>, Schema.suspend<Schema.TaggedStruct<"image", {
1871
+ readonly pending: Schema.optional<Schema.Boolean>;
1872
+ readonly id: Schema.optional<Schema.String>;
1873
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
1874
+ readonly type: Schema.Literal<"base64">;
1875
+ readonly mediaType: Schema.String;
1876
+ readonly data: Schema.String;
1877
+ }>, Schema.Struct<{
1878
+ readonly type: Schema.Literal<"http">;
1879
+ readonly url: Schema.String;
1880
+ }>]>>;
1881
+ }>>, Schema.suspend<Schema.TaggedStruct<"file", {
1882
+ readonly pending: Schema.optional<Schema.Boolean>;
1883
+ readonly url: Schema.String;
1884
+ readonly name: Schema.optional<Schema.String>;
1885
+ readonly mediaType: Schema.optional<Schema.String>;
1886
+ }>>]>>;
1887
+ }>>]>>;
1888
+ readonly error: Schema.optional<Schema.String>;
1889
+ readonly providerExecuted: Schema.Boolean;
1890
+ readonly invocations: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
1891
+ readonly operationKey: Schema.String;
1892
+ readonly error: Schema.optional<Schema.String>;
1893
+ }>>>>;
1894
+ }>, Schema.TaggedStruct<"transcript", {
1895
+ readonly pending: Schema.optional<Schema.Boolean>;
1896
+ readonly started: Schema.String;
1897
+ readonly text: Schema.String;
1898
+ readonly corrected: Schema.optional<Schema.String>;
1899
+ readonly references: Schema.optional<Schema.mutable<Schema.$Array<Ref.RefSchema<Obj.Unknown>>>>;
1900
+ readonly candidates: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
1901
+ readonly text: Schema.String;
1902
+ readonly kind: Schema.Literals<readonly ["noun", "proper-noun"]>;
1903
+ readonly start: Schema.Number;
1904
+ readonly end: Schema.Number;
1905
+ readonly suggested: Schema.optional<Schema.Struct<{
1906
+ readonly typename: Schema.String;
1907
+ }>>;
1908
+ }>>>>;
1909
+ readonly translation: Schema.optional<Schema.String>;
1910
+ }>]>>>;
1911
+ }>, Schema.TaggedStruct<"threadWait", {
1912
+ readonly on: Schema.brand<Schema.String, "@dxos/echo/Feed/BranchId">;
1913
+ }>, Schema.TaggedStruct<"threadClose", {
1914
+ readonly status: Schema.Literals<readonly ["completed", "failed", "cancelled"]>;
1915
+ }>, Schema.TaggedStruct<"modelChange", {
1916
+ readonly model: Schema.Codec<DXN.DXN, DXN.DXN, never, never>;
1917
+ }>, Schema.TaggedStruct<"custom", {
1918
+ /** Namespaced extension type (e.g. `org.example.checkpoint`). */
1919
+ readonly type: Schema.String;
1920
+ readonly visible: Schema.Boolean;
1921
+ readonly data: Schema.optional<Schema.Unknown>;
1922
+ readonly blocks: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"anchor", {
1923
+ readonly pending: Schema.optional<Schema.Boolean>;
1924
+ readonly objectId: import("@dxos/keys").EntityIdClass;
1925
+ readonly version: Schema.Unknown;
1926
+ }>, Schema.TaggedStruct<"change", {
1927
+ readonly pending: Schema.optional<Schema.Boolean>;
1928
+ readonly before: Schema.String;
1929
+ readonly after: Schema.String;
1930
+ }>, Schema.TaggedStruct<"file", {
1931
+ readonly pending: Schema.optional<Schema.Boolean>;
1932
+ readonly url: Schema.String;
1933
+ readonly name: Schema.optional<Schema.String>;
1934
+ readonly mediaType: Schema.optional<Schema.String>;
1935
+ }>, Schema.TaggedStruct<"image", {
1936
+ readonly pending: Schema.optional<Schema.Boolean>;
1937
+ readonly id: Schema.optional<Schema.String>;
1938
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
1939
+ readonly type: Schema.Literal<"base64">;
1940
+ readonly mediaType: Schema.String;
1941
+ readonly data: Schema.String;
1942
+ }>, Schema.Struct<{
1943
+ readonly type: Schema.Literal<"http">;
1944
+ readonly url: Schema.String;
1945
+ }>]>>;
1946
+ }>, Schema.TaggedStruct<"json", {
1947
+ readonly pending: Schema.optional<Schema.Boolean>;
1948
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
1949
+ readonly data: Schema.String;
1950
+ }>, Schema.TaggedStruct<"proposal", {
1951
+ readonly pending: Schema.optional<Schema.Boolean>;
1952
+ readonly text: Schema.String;
1953
+ }>, Schema.TaggedStruct<"reasoning", {
1954
+ readonly pending: Schema.optional<Schema.Boolean>;
1955
+ readonly reasoningText: Schema.optional<Schema.String>;
1956
+ readonly redactedText: Schema.optional<Schema.String>;
1957
+ readonly signature: Schema.optional<Schema.String>;
1958
+ }>, Schema.TaggedStruct<"reference", {
1959
+ readonly pending: Schema.optional<Schema.Boolean>;
1960
+ readonly reference: Ref.RefSchema<Obj.Unknown>;
1961
+ }>, Schema.TaggedStruct<"request", {
1962
+ readonly pending: Schema.optional<Schema.Boolean>;
1963
+ readonly requestId: Schema.String;
1964
+ readonly title: Schema.String;
1965
+ readonly toolCallId: Schema.optional<Schema.String>;
1966
+ readonly options: Schema.$Array<Schema.Struct<{
1967
+ readonly id: Schema.String;
1968
+ readonly label: Schema.String;
1969
+ readonly kind: Schema.Literals<readonly ["allow_once", "allow_always", "reject_once", "reject_always"]>;
1970
+ }>>;
1971
+ readonly preview: Schema.optional<Schema.Struct<{
1972
+ readonly label: Schema.String;
1973
+ readonly text: Schema.String;
1974
+ }>>;
1975
+ readonly resolution: Schema.optional<Schema.Struct<{
1976
+ readonly outcome: Schema.Literals<readonly ["selected", "cancelled"]>;
1977
+ readonly optionId: Schema.optional<Schema.String>;
1978
+ }>>;
1979
+ }>, Schema.TaggedStruct<"select", {
1980
+ readonly pending: Schema.optional<Schema.Boolean>;
1981
+ readonly options: Schema.mutable<Schema.$Array<Schema.String>>;
1982
+ }>, Schema.TaggedStruct<"status", {
1983
+ readonly pending: Schema.optional<Schema.Boolean>;
1984
+ readonly statusText: Schema.String;
1985
+ }>, Schema.TaggedStruct<"suggestion", {
1986
+ readonly pending: Schema.optional<Schema.Boolean>;
1987
+ readonly text: Schema.String;
1988
+ }>, Schema.TaggedStruct<"stats", {
1989
+ readonly pending: Schema.optional<Schema.Boolean>;
1990
+ readonly mimeType: Schema.optional<Schema.String>;
1991
+ readonly message: Schema.optional<Schema.String>;
1992
+ readonly model: Schema.optional<Schema.String>;
1993
+ readonly usage: Schema.optional<Schema.Struct<{
1994
+ readonly inputTokens: Schema.optional<Schema.Number>;
1995
+ readonly outputTokens: Schema.optional<Schema.Number>;
1996
+ readonly totalTokens: Schema.optional<Schema.Number>;
1997
+ readonly cacheReadTokens: Schema.optional<Schema.Number>;
1998
+ readonly cacheWriteTokens: Schema.optional<Schema.Number>;
1999
+ }>>;
2000
+ readonly toolCalls: Schema.optional<Schema.Number>;
2001
+ readonly errors: Schema.optional<Schema.Number>;
2002
+ readonly duration: Schema.optional<Schema.Number>;
2003
+ readonly finishReason: Schema.optional<Schema.Literals<readonly ["stop", "length", "content-filter", "tool-calls", "error", "pause", "other", "unknown"]>>;
2004
+ }>, Schema.TaggedStruct<"surface", {
2005
+ readonly pending: Schema.optional<Schema.Boolean>;
2006
+ readonly role: Schema.String;
2007
+ readonly data: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
2008
+ }>, Schema.TaggedStruct<"text", {
2009
+ readonly pending: Schema.optional<Schema.Boolean>;
2010
+ readonly mimeType: Schema.optional<Schema.String>;
2011
+ readonly text: Schema.String;
2012
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
2013
+ }>, Schema.TaggedStruct<"summary", {
2014
+ readonly pending: Schema.optional<Schema.Boolean>;
2015
+ readonly content: Schema.String;
2016
+ }>, Schema.TaggedStruct<"toolkit", {
2017
+ readonly pending: Schema.optional<Schema.Boolean>;
2018
+ }>, Schema.TaggedStruct<"toolCall", {
2019
+ readonly pending: Schema.optional<Schema.Boolean>;
2020
+ readonly toolCallId: Schema.String;
2021
+ readonly name: Schema.String;
2022
+ readonly input: Schema.String;
2023
+ readonly providerExecuted: Schema.Boolean;
2024
+ readonly operationKey: Schema.optional<Schema.String>;
2025
+ readonly operationName: Schema.optional<Schema.String>;
2026
+ readonly operationIcon: Schema.optional<Schema.String>;
2027
+ readonly displayName: Schema.optional<Schema.String>;
2028
+ readonly displayIcon: Schema.optional<Schema.String>;
2029
+ }>, Schema.TaggedStruct<"toolResult", {
2030
+ readonly pending: Schema.optional<Schema.Boolean>;
2031
+ readonly toolCallId: Schema.String;
2032
+ readonly name: Schema.String;
2033
+ readonly result: Schema.optional<Schema.Union<readonly [Schema.String, Schema.suspend<Schema.TaggedStruct<"~@dxos/types/ContentBlock.ContentBlockResult", {
2034
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.TaggedStruct<"text", {
2035
+ readonly pending: Schema.optional<Schema.Boolean>;
2036
+ readonly mimeType: Schema.optional<Schema.String>;
2037
+ readonly text: Schema.String;
2038
+ readonly disposition: Schema.optional<Schema.Literals<readonly ["user", "synthetic", "cot", "version-pin", "summary"]>>;
2039
+ }>, Schema.suspend<Schema.TaggedStruct<"image", {
2040
+ readonly pending: Schema.optional<Schema.Boolean>;
2041
+ readonly id: Schema.optional<Schema.String>;
2042
+ readonly source: Schema.optional<Schema.Union<readonly [Schema.Struct<{
2043
+ readonly type: Schema.Literal<"base64">;
2044
+ readonly mediaType: Schema.String;
2045
+ readonly data: Schema.String;
2046
+ }>, Schema.Struct<{
2047
+ readonly type: Schema.Literal<"http">;
2048
+ readonly url: Schema.String;
2049
+ }>]>>;
2050
+ }>>, Schema.suspend<Schema.TaggedStruct<"file", {
2051
+ readonly pending: Schema.optional<Schema.Boolean>;
2052
+ readonly url: Schema.String;
2053
+ readonly name: Schema.optional<Schema.String>;
2054
+ readonly mediaType: Schema.optional<Schema.String>;
2055
+ }>>]>>;
2056
+ }>>]>>;
2057
+ readonly error: Schema.optional<Schema.String>;
2058
+ readonly providerExecuted: Schema.Boolean;
2059
+ readonly invocations: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
2060
+ readonly operationKey: Schema.String;
2061
+ readonly error: Schema.optional<Schema.String>;
2062
+ }>>>>;
2063
+ }>, Schema.TaggedStruct<"transcript", {
2064
+ readonly pending: Schema.optional<Schema.Boolean>;
2065
+ readonly started: Schema.String;
2066
+ readonly text: Schema.String;
2067
+ readonly corrected: Schema.optional<Schema.String>;
2068
+ readonly references: Schema.optional<Schema.mutable<Schema.$Array<Ref.RefSchema<Obj.Unknown>>>>;
2069
+ readonly candidates: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
2070
+ readonly text: Schema.String;
2071
+ readonly kind: Schema.Literals<readonly ["noun", "proper-noun"]>;
2072
+ readonly start: Schema.Number;
2073
+ readonly end: Schema.Number;
2074
+ readonly suggested: Schema.optional<Schema.Struct<{
2075
+ readonly typename: Schema.String;
2076
+ }>>;
2077
+ }>>>>;
2078
+ readonly translation: Schema.optional<Schema.String>;
2079
+ }>]>>>;
2080
+ }>]>;
2081
+ export type Payload = Schema.Schema.Type<typeof Payload>;
2082
+ export type PayloadTag = Payload['_tag'];
2083
+ export type PayloadOf<T extends PayloadTag> = Extract<Payload, {
2084
+ _tag: T;
2085
+ }>;
2086
+ declare const Event_base: Type.ObjClass<Event, {
2087
+ readonly sender: {
2088
+ readonly role: "assistant" | "event" | "tool" | "user";
2089
+ readonly identity?: IdentityDid | undefined;
2090
+ readonly subject?: import("@dxos/echo/internal").Ref<Obj.Unknown> | undefined;
2091
+ readonly name?: string | undefined;
2092
+ };
2093
+ readonly created: string;
2094
+ readonly payload: {
2095
+ readonly _tag: "message";
2096
+ readonly blocks: readonly ({
2097
+ readonly _tag: "anchor";
2098
+ readonly pending?: boolean | undefined;
2099
+ readonly objectId: string;
2100
+ readonly version: unknown;
2101
+ } | {
2102
+ readonly _tag: "change";
2103
+ readonly pending?: boolean | undefined;
2104
+ readonly before: string;
2105
+ readonly after: string;
2106
+ } | {
2107
+ readonly _tag: "file";
2108
+ readonly pending?: boolean | undefined;
2109
+ readonly url: string;
2110
+ readonly name?: string | undefined;
2111
+ readonly mediaType?: string | undefined;
2112
+ } | {
2113
+ readonly _tag: "image";
2114
+ readonly pending?: boolean | undefined;
2115
+ readonly id?: string | undefined;
2116
+ readonly source?: {
2117
+ readonly type: "base64";
2118
+ readonly mediaType: string;
2119
+ readonly data: string;
2120
+ } | {
2121
+ readonly type: "http";
2122
+ readonly url: string;
2123
+ } | undefined;
2124
+ } | {
2125
+ readonly _tag: "json";
2126
+ readonly pending?: boolean | undefined;
2127
+ readonly disposition?: "cot" | "summary" | "synthetic" | "user" | "version-pin" | undefined;
2128
+ readonly data: string;
2129
+ } | {
2130
+ readonly _tag: "proposal";
2131
+ readonly pending?: boolean | undefined;
2132
+ readonly text: string;
2133
+ } | {
2134
+ readonly _tag: "reasoning";
2135
+ readonly pending?: boolean | undefined;
2136
+ readonly reasoningText?: string | undefined;
2137
+ readonly redactedText?: string | undefined;
2138
+ readonly signature?: string | undefined;
2139
+ } | {
2140
+ readonly _tag: "reference";
2141
+ readonly pending?: boolean | undefined;
2142
+ readonly reference: import("@dxos/echo/internal").Ref<Obj.Unknown>;
2143
+ } | {
2144
+ readonly _tag: "request";
2145
+ readonly pending?: boolean | undefined;
2146
+ readonly requestId: string;
2147
+ readonly title: string;
2148
+ readonly toolCallId?: string | undefined;
2149
+ readonly options: readonly {
2150
+ readonly id: string;
2151
+ readonly label: string;
2152
+ readonly kind: "allow_always" | "allow_once" | "reject_always" | "reject_once";
2153
+ }[];
2154
+ readonly preview?: {
2155
+ readonly label: string;
2156
+ readonly text: string;
2157
+ } | undefined;
2158
+ readonly resolution?: {
2159
+ readonly outcome: "cancelled" | "selected";
2160
+ readonly optionId?: string | undefined;
2161
+ } | undefined;
2162
+ } | {
2163
+ readonly _tag: "select";
2164
+ readonly pending?: boolean | undefined;
2165
+ readonly options: string[];
2166
+ } | {
2167
+ readonly _tag: "status";
2168
+ readonly pending?: boolean | undefined;
2169
+ readonly statusText: string;
2170
+ } | {
2171
+ readonly _tag: "suggestion";
2172
+ readonly pending?: boolean | undefined;
2173
+ readonly text: string;
2174
+ } | {
2175
+ readonly _tag: "stats";
2176
+ readonly pending?: boolean | undefined;
2177
+ readonly mimeType?: string | undefined;
2178
+ readonly message?: string | undefined;
2179
+ readonly model?: string | undefined;
2180
+ readonly usage?: {
2181
+ readonly inputTokens?: number | undefined;
2182
+ readonly outputTokens?: number | undefined;
2183
+ readonly totalTokens?: number | undefined;
2184
+ readonly cacheReadTokens?: number | undefined;
2185
+ readonly cacheWriteTokens?: number | undefined;
2186
+ } | undefined;
2187
+ readonly toolCalls?: number | undefined;
2188
+ readonly errors?: number | undefined;
2189
+ readonly duration?: number | undefined;
2190
+ readonly finishReason?: "content-filter" | "error" | "length" | "other" | "pause" | "stop" | "tool-calls" | "unknown" | undefined;
2191
+ } | {
2192
+ readonly _tag: "surface";
2193
+ readonly pending?: boolean | undefined;
2194
+ readonly role: string;
2195
+ readonly data?: {
2196
+ readonly [x: string]: unknown;
2197
+ } | undefined;
2198
+ } | {
2199
+ readonly _tag: "text";
2200
+ readonly pending?: boolean | undefined;
2201
+ readonly mimeType?: string | undefined;
2202
+ readonly text: string;
2203
+ readonly disposition?: "cot" | "summary" | "synthetic" | "user" | "version-pin" | undefined;
2204
+ } | {
2205
+ readonly _tag: "summary";
2206
+ readonly pending?: boolean | undefined;
2207
+ readonly content: string;
2208
+ } | {
2209
+ readonly _tag: "toolkit";
2210
+ readonly pending?: boolean | undefined;
2211
+ } | {
2212
+ readonly _tag: "toolCall";
2213
+ readonly pending?: boolean | undefined;
2214
+ readonly toolCallId: string;
2215
+ readonly name: string;
2216
+ readonly input: string;
2217
+ readonly providerExecuted: boolean;
2218
+ readonly operationKey?: string | undefined;
2219
+ readonly operationName?: string | undefined;
2220
+ readonly operationIcon?: string | undefined;
2221
+ readonly displayName?: string | undefined;
2222
+ readonly displayIcon?: string | undefined;
2223
+ } | {
2224
+ readonly _tag: "toolResult";
2225
+ readonly pending?: boolean | undefined;
2226
+ readonly toolCallId: string;
2227
+ readonly name: string;
2228
+ readonly result?: string | {
2229
+ readonly _tag: "~@dxos/types/ContentBlock.ContentBlockResult";
2230
+ readonly content: readonly ({
2231
+ readonly _tag: "text";
2232
+ readonly pending?: boolean | undefined;
2233
+ readonly mimeType?: string | undefined;
2234
+ readonly text: string;
2235
+ readonly disposition?: "cot" | "summary" | "synthetic" | "user" | "version-pin" | undefined;
2236
+ } | {
2237
+ readonly _tag: "image";
2238
+ readonly pending?: boolean | undefined;
2239
+ readonly id?: string | undefined;
2240
+ readonly source?: {
2241
+ readonly type: "base64";
2242
+ readonly mediaType: string;
2243
+ readonly data: string;
2244
+ } | {
2245
+ readonly type: "http";
2246
+ readonly url: string;
2247
+ } | undefined;
2248
+ } | {
2249
+ readonly _tag: "file";
2250
+ readonly pending?: boolean | undefined;
2251
+ readonly url: string;
2252
+ readonly name?: string | undefined;
2253
+ readonly mediaType?: string | undefined;
2254
+ })[];
2255
+ } | undefined;
2256
+ readonly error?: string | undefined;
2257
+ readonly providerExecuted: boolean;
2258
+ readonly invocations?: {
2259
+ readonly operationKey: string;
2260
+ readonly error?: string | undefined;
2261
+ }[] | undefined;
2262
+ } | {
2263
+ readonly _tag: "transcript";
2264
+ readonly pending?: boolean | undefined;
2265
+ readonly started: string;
2266
+ readonly text: string;
2267
+ readonly corrected?: string | undefined;
2268
+ readonly references?: import("@dxos/echo/internal").Ref<Obj.Unknown>[] | undefined;
2269
+ readonly candidates?: {
2270
+ readonly text: string;
2271
+ readonly kind: "noun" | "proper-noun";
2272
+ readonly start: number;
2273
+ readonly end: number;
2274
+ readonly suggested?: {
2275
+ readonly typename: string;
2276
+ } | undefined;
2277
+ }[] | undefined;
2278
+ readonly translation?: string | undefined;
2279
+ })[];
2280
+ readonly attachments?: readonly {
2281
+ readonly name?: string | undefined;
2282
+ readonly ref: import("@dxos/echo/internal").Ref<Obj.Unknown>;
2283
+ readonly contentId?: string | undefined;
2284
+ }[] | undefined;
2285
+ readonly properties?: {
2286
+ readonly [x: string]: any;
2287
+ } | undefined;
2288
+ } | {
2289
+ readonly _tag: "turnBegin";
2290
+ readonly model?: DXN.DXN | undefined;
2291
+ readonly from?: {
2292
+ readonly feed?: import("@dxos/echo/internal").Ref<Feed.Feed & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown> | undefined;
2293
+ readonly thread?: (string & import("effect/Brand").Brand<"@dxos/echo/Feed/BranchId">) | undefined;
2294
+ readonly event: string;
2295
+ } | undefined;
2296
+ } | {
2297
+ readonly _tag: "turnEnd";
2298
+ readonly finishReason: "content-filter" | "error" | "length" | "other" | "pause" | "stop" | "tool-calls" | "unknown";
2299
+ readonly usage?: {
2300
+ readonly inputTokens?: number | undefined;
2301
+ readonly outputTokens?: number | undefined;
2302
+ readonly cacheReadTokens?: number | undefined;
2303
+ readonly cacheWriteTokens?: number | undefined;
2304
+ } | undefined;
2305
+ readonly error?: string | undefined;
2306
+ } | {
2307
+ readonly _tag: "promptConsume";
2308
+ readonly message: string;
2309
+ } | {
2310
+ readonly _tag: "promptCancel";
2311
+ readonly message: string;
2312
+ } | {
2313
+ readonly _tag: "contextBind";
2314
+ readonly skills: readonly import("@dxos/echo/internal").Ref<Skill.Skill & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>[];
2315
+ readonly objects: readonly import("@dxos/echo/internal").Ref<Obj.Unknown>[];
2316
+ readonly connections?: readonly import("@dxos/echo/internal").Ref<Obj.Unknown>[] | undefined;
2317
+ } | {
2318
+ readonly _tag: "contextUnbind";
2319
+ readonly skills: readonly import("@dxos/echo/internal").Ref<Skill.Skill & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>[];
2320
+ readonly objects: readonly import("@dxos/echo/internal").Ref<Obj.Unknown>[];
2321
+ readonly connections?: readonly import("@dxos/echo/internal").Ref<Obj.Unknown>[] | undefined;
2322
+ } | {
2323
+ readonly _tag: "alarmSet";
2324
+ readonly wakeAt: number;
2325
+ readonly message?: string | undefined;
2326
+ } | {
2327
+ readonly _tag: "alarmCancel";
2328
+ readonly alarm: string;
2329
+ } | {
2330
+ readonly _tag: "alarmFire";
2331
+ readonly alarm: string;
2332
+ } | {
2333
+ readonly _tag: "toolBackground";
2334
+ readonly toolCallId: string;
2335
+ readonly pid?: string | undefined;
2336
+ } | {
2337
+ readonly _tag: "toolDeliver";
2338
+ readonly toolCallId: string;
2339
+ readonly result: {
2340
+ readonly _tag: "toolResult";
2341
+ readonly pending?: boolean | undefined;
2342
+ readonly toolCallId: string;
2343
+ readonly name: string;
2344
+ readonly result?: string | {
2345
+ readonly _tag: "~@dxos/types/ContentBlock.ContentBlockResult";
2346
+ readonly content: readonly ({
2347
+ readonly _tag: "text";
2348
+ readonly pending?: boolean | undefined;
2349
+ readonly mimeType?: string | undefined;
2350
+ readonly text: string;
2351
+ readonly disposition?: "cot" | "summary" | "synthetic" | "user" | "version-pin" | undefined;
2352
+ } | {
2353
+ readonly _tag: "image";
2354
+ readonly pending?: boolean | undefined;
2355
+ readonly id?: string | undefined;
2356
+ readonly source?: {
2357
+ readonly type: "base64";
2358
+ readonly mediaType: string;
2359
+ readonly data: string;
2360
+ } | {
2361
+ readonly type: "http";
2362
+ readonly url: string;
2363
+ } | undefined;
2364
+ } | {
2365
+ readonly _tag: "file";
2366
+ readonly pending?: boolean | undefined;
2367
+ readonly url: string;
2368
+ readonly name?: string | undefined;
2369
+ readonly mediaType?: string | undefined;
2370
+ })[];
2371
+ } | undefined;
2372
+ readonly error?: string | undefined;
2373
+ readonly providerExecuted: boolean;
2374
+ readonly invocations?: {
2375
+ readonly operationKey: string;
2376
+ readonly error?: string | undefined;
2377
+ }[] | undefined;
2378
+ };
2379
+ } | {
2380
+ readonly _tag: "hookBegin";
2381
+ readonly hook: string;
2382
+ readonly kind: "agentic" | "background" | "inline";
2383
+ readonly thread?: (string & import("effect/Brand").Brand<"@dxos/echo/Feed/BranchId">) | undefined;
2384
+ } | {
2385
+ readonly _tag: "hookEnd";
2386
+ readonly begin: string;
2387
+ readonly blocks?: readonly ({
2388
+ readonly _tag: "anchor";
2389
+ readonly pending?: boolean | undefined;
2390
+ readonly objectId: string;
2391
+ readonly version: unknown;
2392
+ } | {
2393
+ readonly _tag: "change";
2394
+ readonly pending?: boolean | undefined;
2395
+ readonly before: string;
2396
+ readonly after: string;
2397
+ } | {
2398
+ readonly _tag: "file";
2399
+ readonly pending?: boolean | undefined;
2400
+ readonly url: string;
2401
+ readonly name?: string | undefined;
2402
+ readonly mediaType?: string | undefined;
2403
+ } | {
2404
+ readonly _tag: "image";
2405
+ readonly pending?: boolean | undefined;
2406
+ readonly id?: string | undefined;
2407
+ readonly source?: {
2408
+ readonly type: "base64";
2409
+ readonly mediaType: string;
2410
+ readonly data: string;
2411
+ } | {
2412
+ readonly type: "http";
2413
+ readonly url: string;
2414
+ } | undefined;
2415
+ } | {
2416
+ readonly _tag: "json";
2417
+ readonly pending?: boolean | undefined;
2418
+ readonly disposition?: "cot" | "summary" | "synthetic" | "user" | "version-pin" | undefined;
2419
+ readonly data: string;
2420
+ } | {
2421
+ readonly _tag: "proposal";
2422
+ readonly pending?: boolean | undefined;
2423
+ readonly text: string;
2424
+ } | {
2425
+ readonly _tag: "reasoning";
2426
+ readonly pending?: boolean | undefined;
2427
+ readonly reasoningText?: string | undefined;
2428
+ readonly redactedText?: string | undefined;
2429
+ readonly signature?: string | undefined;
2430
+ } | {
2431
+ readonly _tag: "reference";
2432
+ readonly pending?: boolean | undefined;
2433
+ readonly reference: import("@dxos/echo/internal").Ref<Obj.Unknown>;
2434
+ } | {
2435
+ readonly _tag: "request";
2436
+ readonly pending?: boolean | undefined;
2437
+ readonly requestId: string;
2438
+ readonly title: string;
2439
+ readonly toolCallId?: string | undefined;
2440
+ readonly options: readonly {
2441
+ readonly id: string;
2442
+ readonly label: string;
2443
+ readonly kind: "allow_always" | "allow_once" | "reject_always" | "reject_once";
2444
+ }[];
2445
+ readonly preview?: {
2446
+ readonly label: string;
2447
+ readonly text: string;
2448
+ } | undefined;
2449
+ readonly resolution?: {
2450
+ readonly outcome: "cancelled" | "selected";
2451
+ readonly optionId?: string | undefined;
2452
+ } | undefined;
2453
+ } | {
2454
+ readonly _tag: "select";
2455
+ readonly pending?: boolean | undefined;
2456
+ readonly options: string[];
2457
+ } | {
2458
+ readonly _tag: "status";
2459
+ readonly pending?: boolean | undefined;
2460
+ readonly statusText: string;
2461
+ } | {
2462
+ readonly _tag: "suggestion";
2463
+ readonly pending?: boolean | undefined;
2464
+ readonly text: string;
2465
+ } | {
2466
+ readonly _tag: "stats";
2467
+ readonly pending?: boolean | undefined;
2468
+ readonly mimeType?: string | undefined;
2469
+ readonly message?: string | undefined;
2470
+ readonly model?: string | undefined;
2471
+ readonly usage?: {
2472
+ readonly inputTokens?: number | undefined;
2473
+ readonly outputTokens?: number | undefined;
2474
+ readonly totalTokens?: number | undefined;
2475
+ readonly cacheReadTokens?: number | undefined;
2476
+ readonly cacheWriteTokens?: number | undefined;
2477
+ } | undefined;
2478
+ readonly toolCalls?: number | undefined;
2479
+ readonly errors?: number | undefined;
2480
+ readonly duration?: number | undefined;
2481
+ readonly finishReason?: "content-filter" | "error" | "length" | "other" | "pause" | "stop" | "tool-calls" | "unknown" | undefined;
2482
+ } | {
2483
+ readonly _tag: "surface";
2484
+ readonly pending?: boolean | undefined;
2485
+ readonly role: string;
2486
+ readonly data?: {
2487
+ readonly [x: string]: unknown;
2488
+ } | undefined;
2489
+ } | {
2490
+ readonly _tag: "text";
2491
+ readonly pending?: boolean | undefined;
2492
+ readonly mimeType?: string | undefined;
2493
+ readonly text: string;
2494
+ readonly disposition?: "cot" | "summary" | "synthetic" | "user" | "version-pin" | undefined;
2495
+ } | {
2496
+ readonly _tag: "summary";
2497
+ readonly pending?: boolean | undefined;
2498
+ readonly content: string;
2499
+ } | {
2500
+ readonly _tag: "toolkit";
2501
+ readonly pending?: boolean | undefined;
2502
+ } | {
2503
+ readonly _tag: "toolCall";
2504
+ readonly pending?: boolean | undefined;
2505
+ readonly toolCallId: string;
2506
+ readonly name: string;
2507
+ readonly input: string;
2508
+ readonly providerExecuted: boolean;
2509
+ readonly operationKey?: string | undefined;
2510
+ readonly operationName?: string | undefined;
2511
+ readonly operationIcon?: string | undefined;
2512
+ readonly displayName?: string | undefined;
2513
+ readonly displayIcon?: string | undefined;
2514
+ } | {
2515
+ readonly _tag: "toolResult";
2516
+ readonly pending?: boolean | undefined;
2517
+ readonly toolCallId: string;
2518
+ readonly name: string;
2519
+ readonly result?: string | {
2520
+ readonly _tag: "~@dxos/types/ContentBlock.ContentBlockResult";
2521
+ readonly content: readonly ({
2522
+ readonly _tag: "text";
2523
+ readonly pending?: boolean | undefined;
2524
+ readonly mimeType?: string | undefined;
2525
+ readonly text: string;
2526
+ readonly disposition?: "cot" | "summary" | "synthetic" | "user" | "version-pin" | undefined;
2527
+ } | {
2528
+ readonly _tag: "image";
2529
+ readonly pending?: boolean | undefined;
2530
+ readonly id?: string | undefined;
2531
+ readonly source?: {
2532
+ readonly type: "base64";
2533
+ readonly mediaType: string;
2534
+ readonly data: string;
2535
+ } | {
2536
+ readonly type: "http";
2537
+ readonly url: string;
2538
+ } | undefined;
2539
+ } | {
2540
+ readonly _tag: "file";
2541
+ readonly pending?: boolean | undefined;
2542
+ readonly url: string;
2543
+ readonly name?: string | undefined;
2544
+ readonly mediaType?: string | undefined;
2545
+ })[];
2546
+ } | undefined;
2547
+ readonly error?: string | undefined;
2548
+ readonly providerExecuted: boolean;
2549
+ readonly invocations?: {
2550
+ readonly operationKey: string;
2551
+ readonly error?: string | undefined;
2552
+ }[] | undefined;
2553
+ } | {
2554
+ readonly _tag: "transcript";
2555
+ readonly pending?: boolean | undefined;
2556
+ readonly started: string;
2557
+ readonly text: string;
2558
+ readonly corrected?: string | undefined;
2559
+ readonly references?: import("@dxos/echo/internal").Ref<Obj.Unknown>[] | undefined;
2560
+ readonly candidates?: {
2561
+ readonly text: string;
2562
+ readonly kind: "noun" | "proper-noun";
2563
+ readonly start: number;
2564
+ readonly end: number;
2565
+ readonly suggested?: {
2566
+ readonly typename: string;
2567
+ } | undefined;
2568
+ }[] | undefined;
2569
+ readonly translation?: string | undefined;
2570
+ })[] | undefined;
2571
+ readonly error?: string | undefined;
2572
+ } | {
2573
+ readonly _tag: "compact";
2574
+ readonly from: string;
2575
+ readonly to: string;
2576
+ readonly summary: readonly ({
2577
+ readonly _tag: "anchor";
2578
+ readonly pending?: boolean | undefined;
2579
+ readonly objectId: string;
2580
+ readonly version: unknown;
2581
+ } | {
2582
+ readonly _tag: "change";
2583
+ readonly pending?: boolean | undefined;
2584
+ readonly before: string;
2585
+ readonly after: string;
2586
+ } | {
2587
+ readonly _tag: "file";
2588
+ readonly pending?: boolean | undefined;
2589
+ readonly url: string;
2590
+ readonly name?: string | undefined;
2591
+ readonly mediaType?: string | undefined;
2592
+ } | {
2593
+ readonly _tag: "image";
2594
+ readonly pending?: boolean | undefined;
2595
+ readonly id?: string | undefined;
2596
+ readonly source?: {
2597
+ readonly type: "base64";
2598
+ readonly mediaType: string;
2599
+ readonly data: string;
2600
+ } | {
2601
+ readonly type: "http";
2602
+ readonly url: string;
2603
+ } | undefined;
2604
+ } | {
2605
+ readonly _tag: "json";
2606
+ readonly pending?: boolean | undefined;
2607
+ readonly disposition?: "cot" | "summary" | "synthetic" | "user" | "version-pin" | undefined;
2608
+ readonly data: string;
2609
+ } | {
2610
+ readonly _tag: "proposal";
2611
+ readonly pending?: boolean | undefined;
2612
+ readonly text: string;
2613
+ } | {
2614
+ readonly _tag: "reasoning";
2615
+ readonly pending?: boolean | undefined;
2616
+ readonly reasoningText?: string | undefined;
2617
+ readonly redactedText?: string | undefined;
2618
+ readonly signature?: string | undefined;
2619
+ } | {
2620
+ readonly _tag: "reference";
2621
+ readonly pending?: boolean | undefined;
2622
+ readonly reference: import("@dxos/echo/internal").Ref<Obj.Unknown>;
2623
+ } | {
2624
+ readonly _tag: "request";
2625
+ readonly pending?: boolean | undefined;
2626
+ readonly requestId: string;
2627
+ readonly title: string;
2628
+ readonly toolCallId?: string | undefined;
2629
+ readonly options: readonly {
2630
+ readonly id: string;
2631
+ readonly label: string;
2632
+ readonly kind: "allow_always" | "allow_once" | "reject_always" | "reject_once";
2633
+ }[];
2634
+ readonly preview?: {
2635
+ readonly label: string;
2636
+ readonly text: string;
2637
+ } | undefined;
2638
+ readonly resolution?: {
2639
+ readonly outcome: "cancelled" | "selected";
2640
+ readonly optionId?: string | undefined;
2641
+ } | undefined;
2642
+ } | {
2643
+ readonly _tag: "select";
2644
+ readonly pending?: boolean | undefined;
2645
+ readonly options: string[];
2646
+ } | {
2647
+ readonly _tag: "status";
2648
+ readonly pending?: boolean | undefined;
2649
+ readonly statusText: string;
2650
+ } | {
2651
+ readonly _tag: "suggestion";
2652
+ readonly pending?: boolean | undefined;
2653
+ readonly text: string;
2654
+ } | {
2655
+ readonly _tag: "stats";
2656
+ readonly pending?: boolean | undefined;
2657
+ readonly mimeType?: string | undefined;
2658
+ readonly message?: string | undefined;
2659
+ readonly model?: string | undefined;
2660
+ readonly usage?: {
2661
+ readonly inputTokens?: number | undefined;
2662
+ readonly outputTokens?: number | undefined;
2663
+ readonly totalTokens?: number | undefined;
2664
+ readonly cacheReadTokens?: number | undefined;
2665
+ readonly cacheWriteTokens?: number | undefined;
2666
+ } | undefined;
2667
+ readonly toolCalls?: number | undefined;
2668
+ readonly errors?: number | undefined;
2669
+ readonly duration?: number | undefined;
2670
+ readonly finishReason?: "content-filter" | "error" | "length" | "other" | "pause" | "stop" | "tool-calls" | "unknown" | undefined;
2671
+ } | {
2672
+ readonly _tag: "surface";
2673
+ readonly pending?: boolean | undefined;
2674
+ readonly role: string;
2675
+ readonly data?: {
2676
+ readonly [x: string]: unknown;
2677
+ } | undefined;
2678
+ } | {
2679
+ readonly _tag: "text";
2680
+ readonly pending?: boolean | undefined;
2681
+ readonly mimeType?: string | undefined;
2682
+ readonly text: string;
2683
+ readonly disposition?: "cot" | "summary" | "synthetic" | "user" | "version-pin" | undefined;
2684
+ } | {
2685
+ readonly _tag: "summary";
2686
+ readonly pending?: boolean | undefined;
2687
+ readonly content: string;
2688
+ } | {
2689
+ readonly _tag: "toolkit";
2690
+ readonly pending?: boolean | undefined;
2691
+ } | {
2692
+ readonly _tag: "toolCall";
2693
+ readonly pending?: boolean | undefined;
2694
+ readonly toolCallId: string;
2695
+ readonly name: string;
2696
+ readonly input: string;
2697
+ readonly providerExecuted: boolean;
2698
+ readonly operationKey?: string | undefined;
2699
+ readonly operationName?: string | undefined;
2700
+ readonly operationIcon?: string | undefined;
2701
+ readonly displayName?: string | undefined;
2702
+ readonly displayIcon?: string | undefined;
2703
+ } | {
2704
+ readonly _tag: "toolResult";
2705
+ readonly pending?: boolean | undefined;
2706
+ readonly toolCallId: string;
2707
+ readonly name: string;
2708
+ readonly result?: string | {
2709
+ readonly _tag: "~@dxos/types/ContentBlock.ContentBlockResult";
2710
+ readonly content: readonly ({
2711
+ readonly _tag: "text";
2712
+ readonly pending?: boolean | undefined;
2713
+ readonly mimeType?: string | undefined;
2714
+ readonly text: string;
2715
+ readonly disposition?: "cot" | "summary" | "synthetic" | "user" | "version-pin" | undefined;
2716
+ } | {
2717
+ readonly _tag: "image";
2718
+ readonly pending?: boolean | undefined;
2719
+ readonly id?: string | undefined;
2720
+ readonly source?: {
2721
+ readonly type: "base64";
2722
+ readonly mediaType: string;
2723
+ readonly data: string;
2724
+ } | {
2725
+ readonly type: "http";
2726
+ readonly url: string;
2727
+ } | undefined;
2728
+ } | {
2729
+ readonly _tag: "file";
2730
+ readonly pending?: boolean | undefined;
2731
+ readonly url: string;
2732
+ readonly name?: string | undefined;
2733
+ readonly mediaType?: string | undefined;
2734
+ })[];
2735
+ } | undefined;
2736
+ readonly error?: string | undefined;
2737
+ readonly providerExecuted: boolean;
2738
+ readonly invocations?: {
2739
+ readonly operationKey: string;
2740
+ readonly error?: string | undefined;
2741
+ }[] | undefined;
2742
+ } | {
2743
+ readonly _tag: "transcript";
2744
+ readonly pending?: boolean | undefined;
2745
+ readonly started: string;
2746
+ readonly text: string;
2747
+ readonly corrected?: string | undefined;
2748
+ readonly references?: import("@dxos/echo/internal").Ref<Obj.Unknown>[] | undefined;
2749
+ readonly candidates?: {
2750
+ readonly text: string;
2751
+ readonly kind: "noun" | "proper-noun";
2752
+ readonly start: number;
2753
+ readonly end: number;
2754
+ readonly suggested?: {
2755
+ readonly typename: string;
2756
+ } | undefined;
2757
+ }[] | undefined;
2758
+ readonly translation?: string | undefined;
2759
+ })[];
2760
+ readonly closure?: readonly (string & import("effect/Brand").Brand<"@dxos/echo/Feed/BranchId">)[] | undefined;
2761
+ } | {
2762
+ readonly _tag: "requestResolve";
2763
+ readonly message: string;
2764
+ readonly requestId: string;
2765
+ readonly resolution: {
2766
+ readonly outcome: "cancelled" | "selected";
2767
+ readonly optionId?: string | undefined;
2768
+ };
2769
+ } | {
2770
+ readonly _tag: "rewind";
2771
+ readonly from: string;
2772
+ } | {
2773
+ readonly _tag: "fork";
2774
+ readonly from: {
2775
+ readonly feed?: import("@dxos/echo/internal").Ref<Feed.Feed & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown> | undefined;
2776
+ readonly thread?: (string & import("effect/Brand").Brand<"@dxos/echo/Feed/BranchId">) | undefined;
2777
+ readonly event: string;
2778
+ };
2779
+ } | {
2780
+ readonly _tag: "threadOpen";
2781
+ readonly mode: "fork" | "fresh" | "light";
2782
+ readonly from?: {
2783
+ readonly feed?: import("@dxos/echo/internal").Ref<Feed.Feed & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown> | undefined;
2784
+ readonly thread?: (string & import("effect/Brand").Brand<"@dxos/echo/Feed/BranchId">) | undefined;
2785
+ readonly event: string;
2786
+ } | undefined;
2787
+ readonly purpose?: string | undefined;
2788
+ readonly siblings?: readonly (string & import("effect/Brand").Brand<"@dxos/echo/Feed/BranchId">)[] | undefined;
2789
+ } | {
2790
+ readonly _tag: "threadMerge";
2791
+ readonly mode: "raw" | "summary";
2792
+ readonly summary?: readonly ({
2793
+ readonly _tag: "anchor";
2794
+ readonly pending?: boolean | undefined;
2795
+ readonly objectId: string;
2796
+ readonly version: unknown;
2797
+ } | {
2798
+ readonly _tag: "change";
2799
+ readonly pending?: boolean | undefined;
2800
+ readonly before: string;
2801
+ readonly after: string;
2802
+ } | {
2803
+ readonly _tag: "file";
2804
+ readonly pending?: boolean | undefined;
2805
+ readonly url: string;
2806
+ readonly name?: string | undefined;
2807
+ readonly mediaType?: string | undefined;
2808
+ } | {
2809
+ readonly _tag: "image";
2810
+ readonly pending?: boolean | undefined;
2811
+ readonly id?: string | undefined;
2812
+ readonly source?: {
2813
+ readonly type: "base64";
2814
+ readonly mediaType: string;
2815
+ readonly data: string;
2816
+ } | {
2817
+ readonly type: "http";
2818
+ readonly url: string;
2819
+ } | undefined;
2820
+ } | {
2821
+ readonly _tag: "json";
2822
+ readonly pending?: boolean | undefined;
2823
+ readonly disposition?: "cot" | "summary" | "synthetic" | "user" | "version-pin" | undefined;
2824
+ readonly data: string;
2825
+ } | {
2826
+ readonly _tag: "proposal";
2827
+ readonly pending?: boolean | undefined;
2828
+ readonly text: string;
2829
+ } | {
2830
+ readonly _tag: "reasoning";
2831
+ readonly pending?: boolean | undefined;
2832
+ readonly reasoningText?: string | undefined;
2833
+ readonly redactedText?: string | undefined;
2834
+ readonly signature?: string | undefined;
2835
+ } | {
2836
+ readonly _tag: "reference";
2837
+ readonly pending?: boolean | undefined;
2838
+ readonly reference: import("@dxos/echo/internal").Ref<Obj.Unknown>;
2839
+ } | {
2840
+ readonly _tag: "request";
2841
+ readonly pending?: boolean | undefined;
2842
+ readonly requestId: string;
2843
+ readonly title: string;
2844
+ readonly toolCallId?: string | undefined;
2845
+ readonly options: readonly {
2846
+ readonly id: string;
2847
+ readonly label: string;
2848
+ readonly kind: "allow_always" | "allow_once" | "reject_always" | "reject_once";
2849
+ }[];
2850
+ readonly preview?: {
2851
+ readonly label: string;
2852
+ readonly text: string;
2853
+ } | undefined;
2854
+ readonly resolution?: {
2855
+ readonly outcome: "cancelled" | "selected";
2856
+ readonly optionId?: string | undefined;
2857
+ } | undefined;
2858
+ } | {
2859
+ readonly _tag: "select";
2860
+ readonly pending?: boolean | undefined;
2861
+ readonly options: string[];
2862
+ } | {
2863
+ readonly _tag: "status";
2864
+ readonly pending?: boolean | undefined;
2865
+ readonly statusText: string;
2866
+ } | {
2867
+ readonly _tag: "suggestion";
2868
+ readonly pending?: boolean | undefined;
2869
+ readonly text: string;
2870
+ } | {
2871
+ readonly _tag: "stats";
2872
+ readonly pending?: boolean | undefined;
2873
+ readonly mimeType?: string | undefined;
2874
+ readonly message?: string | undefined;
2875
+ readonly model?: string | undefined;
2876
+ readonly usage?: {
2877
+ readonly inputTokens?: number | undefined;
2878
+ readonly outputTokens?: number | undefined;
2879
+ readonly totalTokens?: number | undefined;
2880
+ readonly cacheReadTokens?: number | undefined;
2881
+ readonly cacheWriteTokens?: number | undefined;
2882
+ } | undefined;
2883
+ readonly toolCalls?: number | undefined;
2884
+ readonly errors?: number | undefined;
2885
+ readonly duration?: number | undefined;
2886
+ readonly finishReason?: "content-filter" | "error" | "length" | "other" | "pause" | "stop" | "tool-calls" | "unknown" | undefined;
2887
+ } | {
2888
+ readonly _tag: "surface";
2889
+ readonly pending?: boolean | undefined;
2890
+ readonly role: string;
2891
+ readonly data?: {
2892
+ readonly [x: string]: unknown;
2893
+ } | undefined;
2894
+ } | {
2895
+ readonly _tag: "text";
2896
+ readonly pending?: boolean | undefined;
2897
+ readonly mimeType?: string | undefined;
2898
+ readonly text: string;
2899
+ readonly disposition?: "cot" | "summary" | "synthetic" | "user" | "version-pin" | undefined;
2900
+ } | {
2901
+ readonly _tag: "summary";
2902
+ readonly pending?: boolean | undefined;
2903
+ readonly content: string;
2904
+ } | {
2905
+ readonly _tag: "toolkit";
2906
+ readonly pending?: boolean | undefined;
2907
+ } | {
2908
+ readonly _tag: "toolCall";
2909
+ readonly pending?: boolean | undefined;
2910
+ readonly toolCallId: string;
2911
+ readonly name: string;
2912
+ readonly input: string;
2913
+ readonly providerExecuted: boolean;
2914
+ readonly operationKey?: string | undefined;
2915
+ readonly operationName?: string | undefined;
2916
+ readonly operationIcon?: string | undefined;
2917
+ readonly displayName?: string | undefined;
2918
+ readonly displayIcon?: string | undefined;
2919
+ } | {
2920
+ readonly _tag: "toolResult";
2921
+ readonly pending?: boolean | undefined;
2922
+ readonly toolCallId: string;
2923
+ readonly name: string;
2924
+ readonly result?: string | {
2925
+ readonly _tag: "~@dxos/types/ContentBlock.ContentBlockResult";
2926
+ readonly content: readonly ({
2927
+ readonly _tag: "text";
2928
+ readonly pending?: boolean | undefined;
2929
+ readonly mimeType?: string | undefined;
2930
+ readonly text: string;
2931
+ readonly disposition?: "cot" | "summary" | "synthetic" | "user" | "version-pin" | undefined;
2932
+ } | {
2933
+ readonly _tag: "image";
2934
+ readonly pending?: boolean | undefined;
2935
+ readonly id?: string | undefined;
2936
+ readonly source?: {
2937
+ readonly type: "base64";
2938
+ readonly mediaType: string;
2939
+ readonly data: string;
2940
+ } | {
2941
+ readonly type: "http";
2942
+ readonly url: string;
2943
+ } | undefined;
2944
+ } | {
2945
+ readonly _tag: "file";
2946
+ readonly pending?: boolean | undefined;
2947
+ readonly url: string;
2948
+ readonly name?: string | undefined;
2949
+ readonly mediaType?: string | undefined;
2950
+ })[];
2951
+ } | undefined;
2952
+ readonly error?: string | undefined;
2953
+ readonly providerExecuted: boolean;
2954
+ readonly invocations?: {
2955
+ readonly operationKey: string;
2956
+ readonly error?: string | undefined;
2957
+ }[] | undefined;
2958
+ } | {
2959
+ readonly _tag: "transcript";
2960
+ readonly pending?: boolean | undefined;
2961
+ readonly started: string;
2962
+ readonly text: string;
2963
+ readonly corrected?: string | undefined;
2964
+ readonly references?: import("@dxos/echo/internal").Ref<Obj.Unknown>[] | undefined;
2965
+ readonly candidates?: {
2966
+ readonly text: string;
2967
+ readonly kind: "noun" | "proper-noun";
2968
+ readonly start: number;
2969
+ readonly end: number;
2970
+ readonly suggested?: {
2971
+ readonly typename: string;
2972
+ } | undefined;
2973
+ }[] | undefined;
2974
+ readonly translation?: string | undefined;
2975
+ })[] | undefined;
2976
+ } | {
2977
+ readonly _tag: "threadWait";
2978
+ readonly on: string & import("effect/Brand").Brand<"@dxos/echo/Feed/BranchId">;
2979
+ } | {
2980
+ readonly _tag: "threadClose";
2981
+ readonly status: "cancelled" | "completed" | "failed";
2982
+ } | {
2983
+ readonly _tag: "modelChange";
2984
+ readonly model: DXN.DXN;
2985
+ } | {
2986
+ readonly _tag: "custom";
2987
+ readonly type: string;
2988
+ readonly visible: boolean;
2989
+ readonly data?: unknown;
2990
+ readonly blocks?: readonly ({
2991
+ readonly _tag: "anchor";
2992
+ readonly pending?: boolean | undefined;
2993
+ readonly objectId: string;
2994
+ readonly version: unknown;
2995
+ } | {
2996
+ readonly _tag: "change";
2997
+ readonly pending?: boolean | undefined;
2998
+ readonly before: string;
2999
+ readonly after: string;
3000
+ } | {
3001
+ readonly _tag: "file";
3002
+ readonly pending?: boolean | undefined;
3003
+ readonly url: string;
3004
+ readonly name?: string | undefined;
3005
+ readonly mediaType?: string | undefined;
3006
+ } | {
3007
+ readonly _tag: "image";
3008
+ readonly pending?: boolean | undefined;
3009
+ readonly id?: string | undefined;
3010
+ readonly source?: {
3011
+ readonly type: "base64";
3012
+ readonly mediaType: string;
3013
+ readonly data: string;
3014
+ } | {
3015
+ readonly type: "http";
3016
+ readonly url: string;
3017
+ } | undefined;
3018
+ } | {
3019
+ readonly _tag: "json";
3020
+ readonly pending?: boolean | undefined;
3021
+ readonly disposition?: "cot" | "summary" | "synthetic" | "user" | "version-pin" | undefined;
3022
+ readonly data: string;
3023
+ } | {
3024
+ readonly _tag: "proposal";
3025
+ readonly pending?: boolean | undefined;
3026
+ readonly text: string;
3027
+ } | {
3028
+ readonly _tag: "reasoning";
3029
+ readonly pending?: boolean | undefined;
3030
+ readonly reasoningText?: string | undefined;
3031
+ readonly redactedText?: string | undefined;
3032
+ readonly signature?: string | undefined;
3033
+ } | {
3034
+ readonly _tag: "reference";
3035
+ readonly pending?: boolean | undefined;
3036
+ readonly reference: import("@dxos/echo/internal").Ref<Obj.Unknown>;
3037
+ } | {
3038
+ readonly _tag: "request";
3039
+ readonly pending?: boolean | undefined;
3040
+ readonly requestId: string;
3041
+ readonly title: string;
3042
+ readonly toolCallId?: string | undefined;
3043
+ readonly options: readonly {
3044
+ readonly id: string;
3045
+ readonly label: string;
3046
+ readonly kind: "allow_always" | "allow_once" | "reject_always" | "reject_once";
3047
+ }[];
3048
+ readonly preview?: {
3049
+ readonly label: string;
3050
+ readonly text: string;
3051
+ } | undefined;
3052
+ readonly resolution?: {
3053
+ readonly outcome: "cancelled" | "selected";
3054
+ readonly optionId?: string | undefined;
3055
+ } | undefined;
3056
+ } | {
3057
+ readonly _tag: "select";
3058
+ readonly pending?: boolean | undefined;
3059
+ readonly options: string[];
3060
+ } | {
3061
+ readonly _tag: "status";
3062
+ readonly pending?: boolean | undefined;
3063
+ readonly statusText: string;
3064
+ } | {
3065
+ readonly _tag: "suggestion";
3066
+ readonly pending?: boolean | undefined;
3067
+ readonly text: string;
3068
+ } | {
3069
+ readonly _tag: "stats";
3070
+ readonly pending?: boolean | undefined;
3071
+ readonly mimeType?: string | undefined;
3072
+ readonly message?: string | undefined;
3073
+ readonly model?: string | undefined;
3074
+ readonly usage?: {
3075
+ readonly inputTokens?: number | undefined;
3076
+ readonly outputTokens?: number | undefined;
3077
+ readonly totalTokens?: number | undefined;
3078
+ readonly cacheReadTokens?: number | undefined;
3079
+ readonly cacheWriteTokens?: number | undefined;
3080
+ } | undefined;
3081
+ readonly toolCalls?: number | undefined;
3082
+ readonly errors?: number | undefined;
3083
+ readonly duration?: number | undefined;
3084
+ readonly finishReason?: "content-filter" | "error" | "length" | "other" | "pause" | "stop" | "tool-calls" | "unknown" | undefined;
3085
+ } | {
3086
+ readonly _tag: "surface";
3087
+ readonly pending?: boolean | undefined;
3088
+ readonly role: string;
3089
+ readonly data?: {
3090
+ readonly [x: string]: unknown;
3091
+ } | undefined;
3092
+ } | {
3093
+ readonly _tag: "text";
3094
+ readonly pending?: boolean | undefined;
3095
+ readonly mimeType?: string | undefined;
3096
+ readonly text: string;
3097
+ readonly disposition?: "cot" | "summary" | "synthetic" | "user" | "version-pin" | undefined;
3098
+ } | {
3099
+ readonly _tag: "summary";
3100
+ readonly pending?: boolean | undefined;
3101
+ readonly content: string;
3102
+ } | {
3103
+ readonly _tag: "toolkit";
3104
+ readonly pending?: boolean | undefined;
3105
+ } | {
3106
+ readonly _tag: "toolCall";
3107
+ readonly pending?: boolean | undefined;
3108
+ readonly toolCallId: string;
3109
+ readonly name: string;
3110
+ readonly input: string;
3111
+ readonly providerExecuted: boolean;
3112
+ readonly operationKey?: string | undefined;
3113
+ readonly operationName?: string | undefined;
3114
+ readonly operationIcon?: string | undefined;
3115
+ readonly displayName?: string | undefined;
3116
+ readonly displayIcon?: string | undefined;
3117
+ } | {
3118
+ readonly _tag: "toolResult";
3119
+ readonly pending?: boolean | undefined;
3120
+ readonly toolCallId: string;
3121
+ readonly name: string;
3122
+ readonly result?: string | {
3123
+ readonly _tag: "~@dxos/types/ContentBlock.ContentBlockResult";
3124
+ readonly content: readonly ({
3125
+ readonly _tag: "text";
3126
+ readonly pending?: boolean | undefined;
3127
+ readonly mimeType?: string | undefined;
3128
+ readonly text: string;
3129
+ readonly disposition?: "cot" | "summary" | "synthetic" | "user" | "version-pin" | undefined;
3130
+ } | {
3131
+ readonly _tag: "image";
3132
+ readonly pending?: boolean | undefined;
3133
+ readonly id?: string | undefined;
3134
+ readonly source?: {
3135
+ readonly type: "base64";
3136
+ readonly mediaType: string;
3137
+ readonly data: string;
3138
+ } | {
3139
+ readonly type: "http";
3140
+ readonly url: string;
3141
+ } | undefined;
3142
+ } | {
3143
+ readonly _tag: "file";
3144
+ readonly pending?: boolean | undefined;
3145
+ readonly url: string;
3146
+ readonly name?: string | undefined;
3147
+ readonly mediaType?: string | undefined;
3148
+ })[];
3149
+ } | undefined;
3150
+ readonly error?: string | undefined;
3151
+ readonly providerExecuted: boolean;
3152
+ readonly invocations?: {
3153
+ readonly operationKey: string;
3154
+ readonly error?: string | undefined;
3155
+ }[] | undefined;
3156
+ } | {
3157
+ readonly _tag: "transcript";
3158
+ readonly pending?: boolean | undefined;
3159
+ readonly started: string;
3160
+ readonly text: string;
3161
+ readonly corrected?: string | undefined;
3162
+ readonly references?: import("@dxos/echo/internal").Ref<Obj.Unknown>[] | undefined;
3163
+ readonly candidates?: {
3164
+ readonly text: string;
3165
+ readonly kind: "noun" | "proper-noun";
3166
+ readonly start: number;
3167
+ readonly end: number;
3168
+ readonly suggested?: {
3169
+ readonly typename: string;
3170
+ } | undefined;
3171
+ }[] | undefined;
3172
+ readonly translation?: string | undefined;
3173
+ })[] | undefined;
3174
+ };
3175
+ }, {}>;
3176
+ /**
3177
+ * One immutable entry in an agent trajectory; every conversation state (history, queue, alarms, bindings, threads)
3178
+ * is a reduction over the feed's events in feed order.
3179
+ */
3180
+ export declare class Event extends Event_base {
3181
+ }
3182
+ /**
3183
+ * An event narrowed to one payload kind.
3184
+ */
3185
+ export type EventOf<T extends PayloadTag> = Event & {
3186
+ readonly payload: PayloadOf<T>;
3187
+ };
3188
+ export type MakeProps<T extends Payload = Payload> = {
3189
+ /** Set only when converting a record that already has an id, so references to it still resolve. */
3190
+ id?: EventId;
3191
+ payload: T;
3192
+ sender: Sender;
3193
+ /** The thread the event is written in: an append continues its branch. Absent for the main thread. */
3194
+ thread?: ThreadId;
3195
+ created?: string;
3196
+ };
3197
+ /**
3198
+ * Creates an event (not yet appended to a feed).
3199
+ */
3200
+ export declare const make: <T extends Payload>({ id, payload, sender, thread, created }: MakeProps<T>) => Event;
3201
+ /**
3202
+ * The thread an event belongs to: the branch it was written on, absent for the main thread. An opener (`turnBegin`,
3203
+ * `threadOpen`) is the base of its branch, so its thread is the one it opens.
3204
+ */
3205
+ export declare const threadOf: (event: Event) => ThreadId | undefined;
3206
+ /**
3207
+ * Narrows an event by payload tag.
3208
+ */
3209
+ export declare const is: <T extends PayloadTag>(event: Event, tag: T) => event is EventOf<T>;
3210
+ export {};
3211
+ //# sourceMappingURL=Trajectory.d.ts.map