@opencode-ai/schema 0.0.0-next-17343 → 0.0.0-next-17352
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/durable-event-manifest.d.ts +76 -148
- package/dist/event-manifest.d.ts +152 -296
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/session-event.d.ts +405 -769
- package/dist/session-event.js +18 -33
- package/dist/{session-pending.d.ts → session-inbox.d.ts} +117 -159
- package/dist/session-inbox.js +47 -0
- package/package.json +1 -1
- package/dist/session-delivery.d.ts +0 -4
- package/dist/session-delivery.js +0 -3
- package/dist/session-pending.js +0 -47
package/dist/session-event.js
CHANGED
|
@@ -19,7 +19,7 @@ import { Skill as SkillSchema } from "./skill.js";
|
|
|
19
19
|
import { Money } from "./money.js";
|
|
20
20
|
import { Snapshot } from "./snapshot.js";
|
|
21
21
|
import { TokenUsage } from "./token-usage.js";
|
|
22
|
-
import {
|
|
22
|
+
import { SessionInbox } from "./session-inbox.js";
|
|
23
23
|
import { Project } from "./project.js";
|
|
24
24
|
import { SessionFork } from "./session-fork.js";
|
|
25
25
|
export { FileAttachment };
|
|
@@ -78,9 +78,7 @@ export const Moved = Event.durable({
|
|
|
78
78
|
...options,
|
|
79
79
|
schema: {
|
|
80
80
|
...Base,
|
|
81
|
-
|
|
82
|
-
projectID: Project.ID.pipe(optional),
|
|
83
|
-
subpath: RelativePath.pipe(optional),
|
|
81
|
+
...SessionInbox.MovePayload.fields,
|
|
84
82
|
},
|
|
85
83
|
});
|
|
86
84
|
export const Renamed = Event.durable({
|
|
@@ -130,37 +128,32 @@ export const Forked = Event.durable({
|
|
|
130
128
|
instructions: Instruction.Values.pipe(optional),
|
|
131
129
|
},
|
|
132
130
|
});
|
|
133
|
-
const
|
|
131
|
+
const InboxRef = {
|
|
134
132
|
...Base,
|
|
135
|
-
|
|
133
|
+
inboxID: SessionMessage.ID,
|
|
136
134
|
};
|
|
137
|
-
export const
|
|
138
|
-
type: "session.
|
|
135
|
+
export const InboxDelivered = Event.durable({
|
|
136
|
+
type: "session.inbox.delivered",
|
|
139
137
|
...options,
|
|
140
|
-
schema:
|
|
138
|
+
schema: InboxRef,
|
|
141
139
|
});
|
|
142
|
-
export const
|
|
143
|
-
type: "session.
|
|
140
|
+
export const InboxEnqueued = Event.durable({
|
|
141
|
+
type: "session.inbox.enqueued",
|
|
144
142
|
...options,
|
|
145
143
|
schema: {
|
|
146
|
-
...
|
|
147
|
-
|
|
144
|
+
...InboxRef,
|
|
145
|
+
item: SessionInbox.Item,
|
|
148
146
|
},
|
|
149
147
|
});
|
|
150
|
-
export const
|
|
151
|
-
type: "session.
|
|
148
|
+
export const InboxCancelled = Event.durable({
|
|
149
|
+
type: "session.inbox.cancelled",
|
|
152
150
|
...options,
|
|
153
|
-
schema:
|
|
151
|
+
schema: InboxRef,
|
|
154
152
|
});
|
|
155
|
-
export const
|
|
156
|
-
type: "session.
|
|
153
|
+
export const InboxDeliveryChanged = Event.durable({
|
|
154
|
+
type: "session.inbox.delivery.changed",
|
|
157
155
|
...options,
|
|
158
|
-
schema:
|
|
159
|
-
});
|
|
160
|
-
export const InputQueued = Event.durable({
|
|
161
|
-
type: "session.input.queued",
|
|
162
|
-
...options,
|
|
163
|
-
schema: InputRef,
|
|
156
|
+
schema: { ...InboxRef, delivery: SessionInbox.Delivery },
|
|
164
157
|
});
|
|
165
158
|
export var Execution;
|
|
166
159
|
(function (Execution) {
|
|
@@ -444,14 +437,6 @@ export const RetryScheduled = Event.durable({
|
|
|
444
437
|
});
|
|
445
438
|
export var Compaction;
|
|
446
439
|
(function (Compaction) {
|
|
447
|
-
Compaction.Admitted = Event.durable({
|
|
448
|
-
type: "session.compaction.admitted",
|
|
449
|
-
...options,
|
|
450
|
-
schema: {
|
|
451
|
-
...Base,
|
|
452
|
-
inputID: SessionMessage.ID,
|
|
453
|
-
},
|
|
454
|
-
});
|
|
455
440
|
Compaction.Started = Event.durable({
|
|
456
441
|
type: "session.compaction.started",
|
|
457
442
|
...options,
|
|
@@ -504,7 +489,7 @@ export var RevertEvent;
|
|
|
504
489
|
schema: { ...Base, to: SessionMessage.ID },
|
|
505
490
|
});
|
|
506
491
|
})(RevertEvent || (RevertEvent = {}));
|
|
507
|
-
export const Definitions = Event.inventory(Created, AgentSelected, ModelSelected, Moved, Renamed, UsageUpdated, Deleted, Forked,
|
|
492
|
+
export const Definitions = Event.inventory(Created, AgentSelected, ModelSelected, Moved, Renamed, UsageUpdated, Deleted, Forked, InboxDelivered, InboxEnqueued, InboxCancelled, InboxDeliveryChanged, Execution.Started, Execution.Succeeded, Execution.Failed, Execution.Interrupted, InstructionsUpdated, Synthetic, Skill.Activated, Shell.Started, Shell.Ended, Step.Started, Step.Ended, Step.Failed, Text.Started, Text.Delta, Text.Ended, Reasoning.Started, Reasoning.Delta, Reasoning.Ended, Tool.Input.Started, Tool.Input.Delta, Tool.Input.Ended, Tool.Called, Tool.Progress, Tool.Success, Tool.Failed, RetryScheduled, Compaction.Started, Compaction.Delta, Compaction.Ended, Compaction.Failed, RevertEvent.Staged, RevertEvent.Cleared, RevertEvent.Committed);
|
|
508
493
|
// UsageRecorded is durable but internal: excluded from Definitions so it never reaches the public manifest.
|
|
509
494
|
export const DurableDefinitions = Event.inventory(...Definitions.filter((definition) => definition.durability === "durable"), UsageRecorded);
|
|
510
495
|
export const EphemeralDefinitions = Event.inventory(...Definitions.filter((definition) => definition.durability === "ephemeral"));
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
export * as
|
|
1
|
+
export * as SessionInbox from "./session-inbox.js";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
|
-
import { SessionDelivery } from "./session-delivery.js";
|
|
4
3
|
export declare const Delivery: Schema.Literals<readonly ["steer", "queue"]>;
|
|
5
|
-
export type Delivery =
|
|
6
|
-
export interface
|
|
4
|
+
export type Delivery = typeof Delivery.Type;
|
|
5
|
+
export interface UserPayload extends Schema.Schema.Type<typeof UserPayload> {
|
|
7
6
|
}
|
|
8
|
-
export declare const
|
|
7
|
+
export declare const UserPayload: Schema.Struct<{
|
|
9
8
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
10
9
|
readonly text: Schema.String;
|
|
11
10
|
readonly files: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
@@ -136,164 +135,37 @@ export declare const UserData: Schema.Struct<{
|
|
|
136
135
|
}>>, never, never>;
|
|
137
136
|
}>>>, never, never>;
|
|
138
137
|
}>;
|
|
139
|
-
export interface
|
|
138
|
+
export interface SyntheticPayload extends Schema.Schema.Type<typeof SyntheticPayload> {
|
|
140
139
|
}
|
|
141
|
-
export declare const
|
|
140
|
+
export declare const SyntheticPayload: Schema.Struct<{
|
|
142
141
|
readonly text: Schema.String;
|
|
143
142
|
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
144
143
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
145
144
|
}>;
|
|
146
|
-
export interface
|
|
145
|
+
export interface CompactionPayload extends Schema.Schema.Type<typeof CompactionPayload> {
|
|
147
146
|
}
|
|
148
|
-
export declare const
|
|
149
|
-
|
|
150
|
-
readonly data: Schema.Struct<{
|
|
151
|
-
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
152
|
-
readonly text: Schema.String;
|
|
153
|
-
readonly files: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
154
|
-
readonly data: Schema.String;
|
|
155
|
-
readonly mime: Schema.String;
|
|
156
|
-
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
157
|
-
readonly type: Schema.Literal<"inline">;
|
|
158
|
-
}>, Schema.Struct<{
|
|
159
|
-
readonly type: Schema.Literal<"uri">;
|
|
160
|
-
readonly uri: Schema.String;
|
|
161
|
-
}>]>;
|
|
162
|
-
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
163
|
-
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
164
|
-
readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
165
|
-
readonly start: Schema.Finite;
|
|
166
|
-
readonly end: Schema.Finite;
|
|
167
|
-
readonly text: Schema.String;
|
|
168
|
-
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
169
|
-
readonly start: Schema.Finite;
|
|
170
|
-
readonly end: Schema.Finite;
|
|
171
|
-
readonly text: Schema.String;
|
|
172
|
-
}>>, never, never>;
|
|
173
|
-
}> & {
|
|
174
|
-
create: (input: import("./prompt.js").FileAttachment) => {
|
|
175
|
-
readonly data: string;
|
|
176
|
-
readonly source: {
|
|
177
|
-
readonly type: "inline";
|
|
178
|
-
} | {
|
|
179
|
-
readonly type: "uri";
|
|
180
|
-
readonly uri: string;
|
|
181
|
-
};
|
|
182
|
-
readonly mime: string;
|
|
183
|
-
readonly description?: string | undefined;
|
|
184
|
-
readonly name?: string | undefined;
|
|
185
|
-
readonly mention?: {
|
|
186
|
-
readonly start: number;
|
|
187
|
-
readonly end: number;
|
|
188
|
-
readonly text: string;
|
|
189
|
-
} | undefined;
|
|
190
|
-
};
|
|
191
|
-
}>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
192
|
-
readonly data: Schema.String;
|
|
193
|
-
readonly mime: Schema.String;
|
|
194
|
-
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
195
|
-
readonly type: Schema.Literal<"inline">;
|
|
196
|
-
}>, Schema.Struct<{
|
|
197
|
-
readonly type: Schema.Literal<"uri">;
|
|
198
|
-
readonly uri: Schema.String;
|
|
199
|
-
}>]>;
|
|
200
|
-
readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
201
|
-
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
202
|
-
readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
203
|
-
readonly start: Schema.Finite;
|
|
204
|
-
readonly end: Schema.Finite;
|
|
205
|
-
readonly text: Schema.String;
|
|
206
|
-
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
207
|
-
readonly start: Schema.Finite;
|
|
208
|
-
readonly end: Schema.Finite;
|
|
209
|
-
readonly text: Schema.String;
|
|
210
|
-
}>>, never, never>;
|
|
211
|
-
}> & {
|
|
212
|
-
create: (input: import("./prompt.js").FileAttachment) => {
|
|
213
|
-
readonly data: string;
|
|
214
|
-
readonly source: {
|
|
215
|
-
readonly type: "inline";
|
|
216
|
-
} | {
|
|
217
|
-
readonly type: "uri";
|
|
218
|
-
readonly uri: string;
|
|
219
|
-
};
|
|
220
|
-
readonly mime: string;
|
|
221
|
-
readonly description?: string | undefined;
|
|
222
|
-
readonly name?: string | undefined;
|
|
223
|
-
readonly mention?: {
|
|
224
|
-
readonly start: number;
|
|
225
|
-
readonly end: number;
|
|
226
|
-
readonly text: string;
|
|
227
|
-
} | undefined;
|
|
228
|
-
};
|
|
229
|
-
}>>, never, never>;
|
|
230
|
-
readonly agents: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
231
|
-
readonly name: Schema.String;
|
|
232
|
-
readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
233
|
-
readonly start: Schema.Finite;
|
|
234
|
-
readonly end: Schema.Finite;
|
|
235
|
-
readonly text: Schema.String;
|
|
236
|
-
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
237
|
-
readonly start: Schema.Finite;
|
|
238
|
-
readonly end: Schema.Finite;
|
|
239
|
-
readonly text: Schema.String;
|
|
240
|
-
}>>, never, never>;
|
|
241
|
-
}>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
242
|
-
readonly name: Schema.String;
|
|
243
|
-
readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
244
|
-
readonly start: Schema.Finite;
|
|
245
|
-
readonly end: Schema.Finite;
|
|
246
|
-
readonly text: Schema.String;
|
|
247
|
-
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
248
|
-
readonly start: Schema.Finite;
|
|
249
|
-
readonly end: Schema.Finite;
|
|
250
|
-
readonly text: Schema.String;
|
|
251
|
-
}>>, never, never>;
|
|
252
|
-
}>>>, never, never>;
|
|
253
|
-
readonly skills: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
254
|
-
readonly id: Schema.brand<Schema.String, "Skill.ID">;
|
|
255
|
-
readonly name: Schema.brand<Schema.String, "Skill.Name">;
|
|
256
|
-
readonly text: Schema.String;
|
|
257
|
-
readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
258
|
-
readonly start: Schema.Finite;
|
|
259
|
-
readonly end: Schema.Finite;
|
|
260
|
-
readonly text: Schema.String;
|
|
261
|
-
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
262
|
-
readonly start: Schema.Finite;
|
|
263
|
-
readonly end: Schema.Finite;
|
|
264
|
-
readonly text: Schema.String;
|
|
265
|
-
}>>, never, never>;
|
|
266
|
-
}>>>>, Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
267
|
-
readonly id: Schema.brand<Schema.String, "Skill.ID">;
|
|
268
|
-
readonly name: Schema.brand<Schema.String, "Skill.Name">;
|
|
269
|
-
readonly text: Schema.String;
|
|
270
|
-
readonly mention: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
271
|
-
readonly start: Schema.Finite;
|
|
272
|
-
readonly end: Schema.Finite;
|
|
273
|
-
readonly text: Schema.String;
|
|
274
|
-
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
275
|
-
readonly start: Schema.Finite;
|
|
276
|
-
readonly end: Schema.Finite;
|
|
277
|
-
readonly text: Schema.String;
|
|
278
|
-
}>>, never, never>;
|
|
279
|
-
}>>>, never, never>;
|
|
280
|
-
}>;
|
|
281
|
-
readonly delivery: Schema.Literals<readonly ["steer", "queue"]>;
|
|
282
|
-
}>;
|
|
283
|
-
export interface SyntheticMessage extends Schema.Schema.Type<typeof SyntheticMessage> {
|
|
147
|
+
export declare const CompactionPayload: Schema.Struct<{}>;
|
|
148
|
+
export interface MovePayload extends Schema.Schema.Type<typeof MovePayload> {
|
|
284
149
|
}
|
|
285
|
-
export declare const
|
|
286
|
-
readonly
|
|
287
|
-
|
|
288
|
-
readonly
|
|
289
|
-
|
|
290
|
-
|
|
150
|
+
export declare const MovePayload: Schema.Struct<{
|
|
151
|
+
readonly location: Schema.Struct<{
|
|
152
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
153
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
154
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
155
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
156
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
157
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
158
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
159
|
+
}>, never, never>;
|
|
291
160
|
}>;
|
|
292
|
-
readonly
|
|
161
|
+
readonly projectID: Schema.brand<Schema.String, "Project.ID"> & {
|
|
162
|
+
global: string & import("effect/Brand").Brand<"Project.ID">;
|
|
163
|
+
};
|
|
164
|
+
readonly subpath: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "RelativePath">>>, Schema.optionalKey<Schema.brand<Schema.String, "RelativePath">>, never, never>;
|
|
293
165
|
}>;
|
|
294
|
-
export declare const
|
|
166
|
+
export declare const Item: Schema.Union<readonly [Schema.Struct<{
|
|
295
167
|
readonly type: Schema.tag<"user">;
|
|
296
|
-
readonly
|
|
168
|
+
readonly payload: Schema.Struct<{
|
|
297
169
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
298
170
|
readonly text: Schema.String;
|
|
299
171
|
readonly files: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
@@ -427,19 +299,42 @@ export declare const Message: Schema.Union<readonly [Schema.Struct<{
|
|
|
427
299
|
readonly delivery: Schema.Literals<readonly ["steer", "queue"]>;
|
|
428
300
|
}>, Schema.Struct<{
|
|
429
301
|
readonly type: Schema.tag<"synthetic">;
|
|
430
|
-
readonly
|
|
302
|
+
readonly payload: Schema.Struct<{
|
|
431
303
|
readonly text: Schema.String;
|
|
432
304
|
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
433
305
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
434
306
|
}>;
|
|
435
307
|
readonly delivery: Schema.Literals<readonly ["steer", "queue"]>;
|
|
308
|
+
}>, Schema.Struct<{
|
|
309
|
+
readonly type: Schema.tag<"compaction">;
|
|
310
|
+
readonly payload: Schema.Struct<{}>;
|
|
311
|
+
readonly delivery: Schema.Literals<readonly ["steer", "queue"]>;
|
|
312
|
+
}>, Schema.Struct<{
|
|
313
|
+
readonly type: Schema.tag<"move">;
|
|
314
|
+
readonly payload: Schema.Struct<{
|
|
315
|
+
readonly location: Schema.Struct<{
|
|
316
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
317
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
318
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
319
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
320
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
321
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
322
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
323
|
+
}>, never, never>;
|
|
324
|
+
}>;
|
|
325
|
+
readonly projectID: Schema.brand<Schema.String, "Project.ID"> & {
|
|
326
|
+
global: string & import("effect/Brand").Brand<"Project.ID">;
|
|
327
|
+
};
|
|
328
|
+
readonly subpath: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "RelativePath">>>, Schema.optionalKey<Schema.brand<Schema.String, "RelativePath">>, never, never>;
|
|
329
|
+
}>;
|
|
330
|
+
readonly delivery: Schema.Literals<readonly ["steer", "queue"]>;
|
|
436
331
|
}>]>;
|
|
437
|
-
export type
|
|
332
|
+
export type Item = typeof Item.Type;
|
|
438
333
|
export interface User extends Schema.Schema.Type<typeof User> {
|
|
439
334
|
}
|
|
440
335
|
export declare const User: Schema.Struct<{
|
|
441
336
|
readonly type: Schema.tag<"user">;
|
|
442
|
-
readonly
|
|
337
|
+
readonly payload: Schema.Struct<{
|
|
443
338
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
444
339
|
readonly text: Schema.String;
|
|
445
340
|
readonly files: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
@@ -585,7 +480,7 @@ export interface Synthetic extends Schema.Schema.Type<typeof Synthetic> {
|
|
|
585
480
|
}
|
|
586
481
|
export declare const Synthetic: Schema.Struct<{
|
|
587
482
|
readonly type: Schema.tag<"synthetic">;
|
|
588
|
-
readonly
|
|
483
|
+
readonly payload: Schema.Struct<{
|
|
589
484
|
readonly text: Schema.String;
|
|
590
485
|
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
591
486
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
@@ -605,6 +500,39 @@ export interface Compaction extends Schema.Schema.Type<typeof Compaction> {
|
|
|
605
500
|
}
|
|
606
501
|
export declare const Compaction: Schema.Struct<{
|
|
607
502
|
readonly type: Schema.tag<"compaction">;
|
|
503
|
+
readonly payload: Schema.Struct<{}>;
|
|
504
|
+
readonly delivery: Schema.Literals<readonly ["steer", "queue"]>;
|
|
505
|
+
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
506
|
+
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
507
|
+
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
508
|
+
};
|
|
509
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
510
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
511
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
512
|
+
};
|
|
513
|
+
readonly timeCreated: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
514
|
+
}>;
|
|
515
|
+
export interface Move extends Schema.Schema.Type<typeof Move> {
|
|
516
|
+
}
|
|
517
|
+
export declare const Move: Schema.Struct<{
|
|
518
|
+
readonly type: Schema.tag<"move">;
|
|
519
|
+
readonly payload: Schema.Struct<{
|
|
520
|
+
readonly location: Schema.Struct<{
|
|
521
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
522
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
523
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
524
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
525
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
526
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
527
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
528
|
+
}>, never, never>;
|
|
529
|
+
}>;
|
|
530
|
+
readonly projectID: Schema.brand<Schema.String, "Project.ID"> & {
|
|
531
|
+
global: string & import("effect/Brand").Brand<"Project.ID">;
|
|
532
|
+
};
|
|
533
|
+
readonly subpath: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "RelativePath">>>, Schema.optionalKey<Schema.brand<Schema.String, "RelativePath">>, never, never>;
|
|
534
|
+
}>;
|
|
535
|
+
readonly delivery: Schema.Literals<readonly ["steer", "queue"]>;
|
|
608
536
|
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
609
537
|
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
610
538
|
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
@@ -617,7 +545,7 @@ export declare const Compaction: Schema.Struct<{
|
|
|
617
545
|
}>;
|
|
618
546
|
export declare const Info: Schema.Union<readonly [Schema.Struct<{
|
|
619
547
|
readonly type: Schema.tag<"user">;
|
|
620
|
-
readonly
|
|
548
|
+
readonly payload: Schema.Struct<{
|
|
621
549
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
622
550
|
readonly text: Schema.String;
|
|
623
551
|
readonly files: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.Struct<{
|
|
@@ -760,7 +688,7 @@ export declare const Info: Schema.Union<readonly [Schema.Struct<{
|
|
|
760
688
|
readonly timeCreated: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
761
689
|
}>, Schema.Struct<{
|
|
762
690
|
readonly type: Schema.tag<"synthetic">;
|
|
763
|
-
readonly
|
|
691
|
+
readonly payload: Schema.Struct<{
|
|
764
692
|
readonly text: Schema.String;
|
|
765
693
|
readonly description: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
766
694
|
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
@@ -777,6 +705,36 @@ export declare const Info: Schema.Union<readonly [Schema.Struct<{
|
|
|
777
705
|
readonly timeCreated: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
778
706
|
}>, Schema.Struct<{
|
|
779
707
|
readonly type: Schema.tag<"compaction">;
|
|
708
|
+
readonly payload: Schema.Struct<{}>;
|
|
709
|
+
readonly delivery: Schema.Literals<readonly ["steer", "queue"]>;
|
|
710
|
+
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
711
|
+
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
712
|
+
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
713
|
+
};
|
|
714
|
+
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
715
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
716
|
+
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
717
|
+
};
|
|
718
|
+
readonly timeCreated: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
719
|
+
}>, Schema.Struct<{
|
|
720
|
+
readonly type: Schema.tag<"move">;
|
|
721
|
+
readonly payload: Schema.Struct<{
|
|
722
|
+
readonly location: Schema.Struct<{
|
|
723
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
724
|
+
readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
725
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
726
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
727
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
|
|
728
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
729
|
+
create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
|
|
730
|
+
}>, never, never>;
|
|
731
|
+
}>;
|
|
732
|
+
readonly projectID: Schema.brand<Schema.String, "Project.ID"> & {
|
|
733
|
+
global: string & import("effect/Brand").Brand<"Project.ID">;
|
|
734
|
+
};
|
|
735
|
+
readonly subpath: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "RelativePath">>>, Schema.optionalKey<Schema.brand<Schema.String, "RelativePath">>, never, never>;
|
|
736
|
+
}>;
|
|
737
|
+
readonly delivery: Schema.Literals<readonly ["steer", "queue"]>;
|
|
780
738
|
readonly id: Schema.brand<Schema.String, "Session.Message.ID"> & {
|
|
781
739
|
create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
782
740
|
fromEvent: (eventID: import("./event.js").ID) => string & import("effect/Brand").Brand<"Session.Message.ID">;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export * as SessionInbox from "./session-inbox.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { Location } from "./location.js";
|
|
4
|
+
import { Project } from "./project.js";
|
|
5
|
+
import { Prompt } from "./prompt.js";
|
|
6
|
+
import { DateTimeUtcFromMillis, optional, RelativePath } from "./schema.js";
|
|
7
|
+
import { SessionID } from "./session-id.js";
|
|
8
|
+
import { SessionMessage } from "./session-message.js";
|
|
9
|
+
export const Delivery = Schema.Literals(["steer", "queue"]).annotate({ identifier: "Session.Inbox.Delivery" });
|
|
10
|
+
export const UserPayload = Schema.Struct({
|
|
11
|
+
...Prompt.fields,
|
|
12
|
+
metadata: Schema.Record(Schema.String, Schema.Unknown).pipe(optional),
|
|
13
|
+
}).annotate({ identifier: "Session.Inbox.UserPayload" });
|
|
14
|
+
export const SyntheticPayload = Schema.Struct({
|
|
15
|
+
text: Schema.String,
|
|
16
|
+
description: Schema.String.pipe(optional),
|
|
17
|
+
metadata: Schema.Record(Schema.String, Schema.Unknown).pipe(optional),
|
|
18
|
+
}).annotate({ identifier: "Session.Inbox.SyntheticPayload" });
|
|
19
|
+
export const CompactionPayload = Schema.Struct({}).annotate({ identifier: "Session.Inbox.CompactionPayload" });
|
|
20
|
+
export const MovePayload = Schema.Struct({
|
|
21
|
+
location: Location.Ref,
|
|
22
|
+
projectID: Project.ID,
|
|
23
|
+
subpath: RelativePath.pipe(optional),
|
|
24
|
+
}).annotate({ identifier: "Session.Inbox.MovePayload" });
|
|
25
|
+
const UserItem = Schema.Struct({ type: Schema.tag("user"), payload: UserPayload, delivery: Delivery });
|
|
26
|
+
const SyntheticItem = Schema.Struct({ type: Schema.tag("synthetic"), payload: SyntheticPayload, delivery: Delivery });
|
|
27
|
+
const CompactionItem = Schema.Struct({
|
|
28
|
+
type: Schema.tag("compaction"),
|
|
29
|
+
payload: CompactionPayload,
|
|
30
|
+
delivery: Delivery,
|
|
31
|
+
});
|
|
32
|
+
const MoveItem = Schema.Struct({ type: Schema.tag("move"), payload: MovePayload, delivery: Delivery });
|
|
33
|
+
export const Item = Schema.Union([UserItem, SyntheticItem, CompactionItem, MoveItem]).pipe(Schema.toTaggedUnion("type"), Schema.annotate({ identifier: "Session.Inbox.Item" }));
|
|
34
|
+
const Enqueued = {
|
|
35
|
+
id: SessionMessage.ID,
|
|
36
|
+
sessionID: SessionID,
|
|
37
|
+
timeCreated: DateTimeUtcFromMillis,
|
|
38
|
+
};
|
|
39
|
+
export const User = Schema.Struct({ ...Enqueued, ...UserItem.fields }).annotate({ identifier: "Session.Inbox.User" });
|
|
40
|
+
export const Synthetic = Schema.Struct({ ...Enqueued, ...SyntheticItem.fields }).annotate({
|
|
41
|
+
identifier: "Session.Inbox.Synthetic",
|
|
42
|
+
});
|
|
43
|
+
export const Compaction = Schema.Struct({ ...Enqueued, ...CompactionItem.fields }).annotate({
|
|
44
|
+
identifier: "Session.Inbox.Compaction",
|
|
45
|
+
});
|
|
46
|
+
export const Move = Schema.Struct({ ...Enqueued, ...MoveItem.fields }).annotate({ identifier: "Session.Inbox.Move" });
|
|
47
|
+
export const Info = Schema.Union([User, Synthetic, Compaction, Move]).pipe(Schema.toTaggedUnion("type"), Schema.annotate({ identifier: "Session.Inbox.Info" }));
|
package/package.json
CHANGED
package/dist/session-delivery.js
DELETED
package/dist/session-pending.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export * as SessionPending from "./session-pending.js";
|
|
2
|
-
import { Schema } from "effect";
|
|
3
|
-
import { optional } from "./schema.js";
|
|
4
|
-
import { Prompt } from "./prompt.js";
|
|
5
|
-
import { DateTimeUtcFromMillis } from "./schema.js";
|
|
6
|
-
import { SessionDelivery } from "./session-delivery.js";
|
|
7
|
-
import { SessionID } from "./session-id.js";
|
|
8
|
-
import { SessionMessage } from "./session-message.js";
|
|
9
|
-
export const Delivery = SessionDelivery.Delivery;
|
|
10
|
-
export const UserData = Schema.Struct({
|
|
11
|
-
...Prompt.fields,
|
|
12
|
-
metadata: Schema.Record(Schema.String, Schema.Unknown).pipe(optional),
|
|
13
|
-
}).annotate({ identifier: "SessionPending.UserData" });
|
|
14
|
-
export const SyntheticData = Schema.Struct({
|
|
15
|
-
text: Schema.String,
|
|
16
|
-
description: Schema.String.pipe(optional),
|
|
17
|
-
metadata: Schema.Record(Schema.String, Schema.Unknown).pipe(optional),
|
|
18
|
-
}).annotate({ identifier: "SessionPending.SyntheticData" });
|
|
19
|
-
export const UserMessage = Schema.Struct({
|
|
20
|
-
type: Schema.tag("user"),
|
|
21
|
-
data: UserData,
|
|
22
|
-
delivery: Delivery,
|
|
23
|
-
}).annotate({ identifier: "SessionPending.UserMessage" });
|
|
24
|
-
export const SyntheticMessage = Schema.Struct({
|
|
25
|
-
type: Schema.tag("synthetic"),
|
|
26
|
-
data: SyntheticData,
|
|
27
|
-
delivery: Delivery,
|
|
28
|
-
}).annotate({ identifier: "SessionPending.SyntheticMessage" });
|
|
29
|
-
export const Message = Schema.Union([UserMessage, SyntheticMessage]).pipe(Schema.toTaggedUnion("type"), Schema.annotate({ identifier: "SessionPending.Message" }));
|
|
30
|
-
const Admitted = {
|
|
31
|
-
id: SessionMessage.ID,
|
|
32
|
-
sessionID: SessionID,
|
|
33
|
-
timeCreated: DateTimeUtcFromMillis,
|
|
34
|
-
};
|
|
35
|
-
export const User = Schema.Struct({
|
|
36
|
-
...Admitted,
|
|
37
|
-
...UserMessage.fields,
|
|
38
|
-
}).annotate({ identifier: "SessionPending.User" });
|
|
39
|
-
export const Synthetic = Schema.Struct({
|
|
40
|
-
...Admitted,
|
|
41
|
-
...SyntheticMessage.fields,
|
|
42
|
-
}).annotate({ identifier: "SessionPending.Synthetic" });
|
|
43
|
-
export const Compaction = Schema.Struct({
|
|
44
|
-
...Admitted,
|
|
45
|
-
type: Schema.tag("compaction"),
|
|
46
|
-
}).annotate({ identifier: "SessionPending.Compaction" });
|
|
47
|
-
export const Info = Schema.Union([User, Synthetic, Compaction]).pipe(Schema.toTaggedUnion("type"), Schema.annotate({ identifier: "SessionPending.Info" }));
|