@opencode-ai/schema 0.0.0-next-14829 → 0.0.0-next-14834
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 +142 -66
- package/dist/event-manifest.d.ts +304 -152
- package/dist/session-event.d.ts +740 -360
- package/dist/session-event.js +38 -38
- package/dist/session-message.d.ts +58 -6
- package/dist/session-message.js +3 -3
- package/package.json +1 -1
package/dist/session-event.js
CHANGED
|
@@ -11,6 +11,7 @@ import { SessionID } from "./session-id.js";
|
|
|
11
11
|
import { Location } from "./location.js";
|
|
12
12
|
import { SessionMessage } from "./session-message.js";
|
|
13
13
|
import { Revert } from "./revert.js";
|
|
14
|
+
import { Shell as ShellSchema } from "./shell.js";
|
|
14
15
|
export { FileAttachment };
|
|
15
16
|
export const Source = Schema.Struct({
|
|
16
17
|
start: NonNegativeInt,
|
|
@@ -42,7 +43,7 @@ const stepSettlementOptions = {
|
|
|
42
43
|
};
|
|
43
44
|
export const UnknownError = SessionMessage.UnknownError;
|
|
44
45
|
export const AgentSelected = Event.durable({
|
|
45
|
-
type: "agent.selected",
|
|
46
|
+
type: "session.agent.selected",
|
|
46
47
|
...options,
|
|
47
48
|
schema: {
|
|
48
49
|
...Base,
|
|
@@ -50,7 +51,7 @@ export const AgentSelected = Event.durable({
|
|
|
50
51
|
},
|
|
51
52
|
});
|
|
52
53
|
export const ModelSelected = Event.durable({
|
|
53
|
-
type: "model.selected",
|
|
54
|
+
type: "session.model.selected",
|
|
54
55
|
...options,
|
|
55
56
|
schema: {
|
|
56
57
|
...Base,
|
|
@@ -67,7 +68,7 @@ export const Moved = Event.durable({
|
|
|
67
68
|
},
|
|
68
69
|
});
|
|
69
70
|
export const Renamed = Event.durable({
|
|
70
|
-
type: "renamed",
|
|
71
|
+
type: "session.renamed",
|
|
71
72
|
...options,
|
|
72
73
|
schema: {
|
|
73
74
|
...Base,
|
|
@@ -75,7 +76,7 @@ export const Renamed = Event.durable({
|
|
|
75
76
|
},
|
|
76
77
|
});
|
|
77
78
|
export const Forked = Event.durable({
|
|
78
|
-
type: "forked",
|
|
79
|
+
type: "session.forked",
|
|
79
80
|
...options,
|
|
80
81
|
schema: {
|
|
81
82
|
...Base,
|
|
@@ -84,7 +85,7 @@ export const Forked = Event.durable({
|
|
|
84
85
|
},
|
|
85
86
|
});
|
|
86
87
|
export const PromptPromoted = Event.durable({
|
|
87
|
-
type: "prompt.promoted",
|
|
88
|
+
type: "session.prompt.promoted",
|
|
88
89
|
...options,
|
|
89
90
|
schema: {
|
|
90
91
|
sessionID: SessionID,
|
|
@@ -92,12 +93,12 @@ export const PromptPromoted = Event.durable({
|
|
|
92
93
|
},
|
|
93
94
|
});
|
|
94
95
|
export const PromptAdmitted = Event.durable({
|
|
95
|
-
type: "prompt.admitted",
|
|
96
|
+
type: "session.prompt.admitted",
|
|
96
97
|
...options,
|
|
97
98
|
schema: PromptFields,
|
|
98
99
|
});
|
|
99
100
|
export const ExecutionSettled = Event.ephemeral({
|
|
100
|
-
type: "execution.settled",
|
|
101
|
+
type: "session.execution.settled",
|
|
101
102
|
schema: {
|
|
102
103
|
...Base,
|
|
103
104
|
outcome: Schema.Literals(["success", "failure", "interrupted"]),
|
|
@@ -113,7 +114,7 @@ export const ContextUpdated = Event.durable({
|
|
|
113
114
|
},
|
|
114
115
|
});
|
|
115
116
|
export const Synthetic = Event.durable({
|
|
116
|
-
type: "synthetic",
|
|
117
|
+
type: "session.synthetic",
|
|
117
118
|
...options,
|
|
118
119
|
schema: {
|
|
119
120
|
...Base,
|
|
@@ -125,7 +126,7 @@ export const Synthetic = Event.durable({
|
|
|
125
126
|
export var Skill;
|
|
126
127
|
(function (Skill) {
|
|
127
128
|
Skill.Activated = Event.durable({
|
|
128
|
-
type: "skill.activated",
|
|
129
|
+
type: "session.skill.activated",
|
|
129
130
|
...options,
|
|
130
131
|
schema: {
|
|
131
132
|
...Base,
|
|
@@ -137,28 +138,27 @@ export var Skill;
|
|
|
137
138
|
export var Shell;
|
|
138
139
|
(function (Shell) {
|
|
139
140
|
Shell.Started = Event.durable({
|
|
140
|
-
type: "shell.started",
|
|
141
|
+
type: "session.shell.started",
|
|
141
142
|
...options,
|
|
142
143
|
schema: {
|
|
143
144
|
...Base,
|
|
144
|
-
|
|
145
|
-
command: Schema.String,
|
|
145
|
+
shell: ShellSchema.Info,
|
|
146
146
|
},
|
|
147
147
|
});
|
|
148
148
|
Shell.Ended = Event.durable({
|
|
149
|
-
type: "shell.ended",
|
|
149
|
+
type: "session.shell.ended",
|
|
150
150
|
...options,
|
|
151
151
|
schema: {
|
|
152
152
|
...Base,
|
|
153
|
-
|
|
154
|
-
output:
|
|
153
|
+
shell: ShellSchema.Info,
|
|
154
|
+
output: ShellSchema.Output,
|
|
155
155
|
},
|
|
156
156
|
});
|
|
157
157
|
})(Shell || (Shell = {}));
|
|
158
158
|
export var Step;
|
|
159
159
|
(function (Step) {
|
|
160
160
|
Step.Started = Event.durable({
|
|
161
|
-
type: "step.started",
|
|
161
|
+
type: "session.step.started",
|
|
162
162
|
...options,
|
|
163
163
|
schema: {
|
|
164
164
|
...Base,
|
|
@@ -169,7 +169,7 @@ export var Step;
|
|
|
169
169
|
},
|
|
170
170
|
});
|
|
171
171
|
Step.Ended = Event.durable({
|
|
172
|
-
type: "step.ended",
|
|
172
|
+
type: "session.step.ended",
|
|
173
173
|
...stepSettlementOptions,
|
|
174
174
|
schema: {
|
|
175
175
|
...Base,
|
|
@@ -190,7 +190,7 @@ export var Step;
|
|
|
190
190
|
},
|
|
191
191
|
});
|
|
192
192
|
Step.Failed = Event.durable({
|
|
193
|
-
type: "step.failed",
|
|
193
|
+
type: "session.step.failed",
|
|
194
194
|
...stepSettlementOptions,
|
|
195
195
|
schema: {
|
|
196
196
|
...Base,
|
|
@@ -202,7 +202,7 @@ export var Step;
|
|
|
202
202
|
export var Text;
|
|
203
203
|
(function (Text) {
|
|
204
204
|
Text.Started = Event.durable({
|
|
205
|
-
type: "text.started",
|
|
205
|
+
type: "session.text.started",
|
|
206
206
|
...options,
|
|
207
207
|
schema: {
|
|
208
208
|
...Base,
|
|
@@ -212,7 +212,7 @@ export var Text;
|
|
|
212
212
|
});
|
|
213
213
|
// Stream fragments are live-only; Text.Ended is the replayable full-value boundary.
|
|
214
214
|
Text.Delta = Event.ephemeral({
|
|
215
|
-
type: "text.delta",
|
|
215
|
+
type: "session.text.delta",
|
|
216
216
|
schema: {
|
|
217
217
|
...Base,
|
|
218
218
|
assistantMessageID: SessionMessage.ID,
|
|
@@ -221,7 +221,7 @@ export var Text;
|
|
|
221
221
|
},
|
|
222
222
|
});
|
|
223
223
|
Text.Ended = Event.durable({
|
|
224
|
-
type: "text.ended",
|
|
224
|
+
type: "session.text.ended",
|
|
225
225
|
...options,
|
|
226
226
|
schema: {
|
|
227
227
|
...Base,
|
|
@@ -234,7 +234,7 @@ export var Text;
|
|
|
234
234
|
export var Reasoning;
|
|
235
235
|
(function (Reasoning) {
|
|
236
236
|
Reasoning.Started = Event.durable({
|
|
237
|
-
type: "reasoning.started",
|
|
237
|
+
type: "session.reasoning.started",
|
|
238
238
|
...options,
|
|
239
239
|
schema: {
|
|
240
240
|
...Base,
|
|
@@ -245,7 +245,7 @@ export var Reasoning;
|
|
|
245
245
|
});
|
|
246
246
|
// Stream fragments are live-only; Reasoning.Ended is the replayable full-value boundary.
|
|
247
247
|
Reasoning.Delta = Event.ephemeral({
|
|
248
|
-
type: "reasoning.delta",
|
|
248
|
+
type: "session.reasoning.delta",
|
|
249
249
|
schema: {
|
|
250
250
|
...Base,
|
|
251
251
|
assistantMessageID: SessionMessage.ID,
|
|
@@ -254,7 +254,7 @@ export var Reasoning;
|
|
|
254
254
|
},
|
|
255
255
|
});
|
|
256
256
|
Reasoning.Ended = Event.durable({
|
|
257
|
-
type: "reasoning.ended",
|
|
257
|
+
type: "session.reasoning.ended",
|
|
258
258
|
...options,
|
|
259
259
|
schema: {
|
|
260
260
|
...Base,
|
|
@@ -275,7 +275,7 @@ export var Tool;
|
|
|
275
275
|
let Input;
|
|
276
276
|
(function (Input) {
|
|
277
277
|
Input.Started = Event.durable({
|
|
278
|
-
type: "tool.input.started",
|
|
278
|
+
type: "session.tool.input.started",
|
|
279
279
|
...options,
|
|
280
280
|
schema: {
|
|
281
281
|
...ToolBase,
|
|
@@ -284,14 +284,14 @@ export var Tool;
|
|
|
284
284
|
});
|
|
285
285
|
// Stream fragments are live-only; Input.Ended is the replayable raw-input boundary.
|
|
286
286
|
Input.Delta = Event.ephemeral({
|
|
287
|
-
type: "tool.input.delta",
|
|
287
|
+
type: "session.tool.input.delta",
|
|
288
288
|
schema: {
|
|
289
289
|
...ToolBase,
|
|
290
290
|
delta: Schema.String,
|
|
291
291
|
},
|
|
292
292
|
});
|
|
293
293
|
Input.Ended = Event.durable({
|
|
294
|
-
type: "tool.input.ended",
|
|
294
|
+
type: "session.tool.input.ended",
|
|
295
295
|
...options,
|
|
296
296
|
schema: {
|
|
297
297
|
...ToolBase,
|
|
@@ -300,7 +300,7 @@ export var Tool;
|
|
|
300
300
|
});
|
|
301
301
|
})(Input = Tool.Input || (Tool.Input = {}));
|
|
302
302
|
Tool.Called = Event.durable({
|
|
303
|
-
type: "tool.called",
|
|
303
|
+
type: "session.tool.called",
|
|
304
304
|
...options,
|
|
305
305
|
schema: {
|
|
306
306
|
...ToolBase,
|
|
@@ -317,7 +317,7 @@ export var Tool;
|
|
|
317
317
|
* transitions or at a bounded cadence, not persist every stdout/stderr chunk.
|
|
318
318
|
*/
|
|
319
319
|
Tool.Progress = Event.durable({
|
|
320
|
-
type: "tool.progress",
|
|
320
|
+
type: "session.tool.progress",
|
|
321
321
|
...options,
|
|
322
322
|
schema: {
|
|
323
323
|
...ToolBase,
|
|
@@ -326,7 +326,7 @@ export var Tool;
|
|
|
326
326
|
},
|
|
327
327
|
});
|
|
328
328
|
Tool.Success = Event.durable({
|
|
329
|
-
type: "tool.success",
|
|
329
|
+
type: "session.tool.success",
|
|
330
330
|
...options,
|
|
331
331
|
schema: {
|
|
332
332
|
...ToolBase,
|
|
@@ -341,7 +341,7 @@ export var Tool;
|
|
|
341
341
|
},
|
|
342
342
|
});
|
|
343
343
|
Tool.Failed = Event.durable({
|
|
344
|
-
type: "tool.failed",
|
|
344
|
+
type: "session.tool.failed",
|
|
345
345
|
...options,
|
|
346
346
|
schema: {
|
|
347
347
|
...ToolBase,
|
|
@@ -365,7 +365,7 @@ export const RetryError = Schema.Struct({
|
|
|
365
365
|
identifier: "session.retry.error",
|
|
366
366
|
});
|
|
367
367
|
export const Retried = Event.durable({
|
|
368
|
-
type: "retried",
|
|
368
|
+
type: "session.retried",
|
|
369
369
|
...options,
|
|
370
370
|
schema: {
|
|
371
371
|
...Base,
|
|
@@ -376,7 +376,7 @@ export const Retried = Event.durable({
|
|
|
376
376
|
export var Compaction;
|
|
377
377
|
(function (Compaction) {
|
|
378
378
|
Compaction.Started = Event.durable({
|
|
379
|
-
type: "compaction.started",
|
|
379
|
+
type: "session.compaction.started",
|
|
380
380
|
...options,
|
|
381
381
|
schema: {
|
|
382
382
|
...Base,
|
|
@@ -384,14 +384,14 @@ export var Compaction;
|
|
|
384
384
|
},
|
|
385
385
|
});
|
|
386
386
|
Compaction.Delta = Event.ephemeral({
|
|
387
|
-
type: "compaction.delta",
|
|
387
|
+
type: "session.compaction.delta",
|
|
388
388
|
schema: {
|
|
389
389
|
...Base,
|
|
390
390
|
text: Schema.String,
|
|
391
391
|
},
|
|
392
392
|
});
|
|
393
393
|
Compaction.Ended = Event.durable({
|
|
394
|
-
type: "compaction.ended",
|
|
394
|
+
type: "session.compaction.ended",
|
|
395
395
|
...options,
|
|
396
396
|
schema: {
|
|
397
397
|
...Base,
|
|
@@ -404,13 +404,13 @@ export var Compaction;
|
|
|
404
404
|
export var RevertEvent;
|
|
405
405
|
(function (RevertEvent) {
|
|
406
406
|
RevertEvent.Staged = Event.durable({
|
|
407
|
-
type: "revert.staged",
|
|
407
|
+
type: "session.revert.staged",
|
|
408
408
|
...options,
|
|
409
409
|
schema: { ...Base, revert: Revert.State },
|
|
410
410
|
});
|
|
411
|
-
RevertEvent.Cleared = Event.durable({ type: "revert.cleared", ...options, schema: Base });
|
|
411
|
+
RevertEvent.Cleared = Event.durable({ type: "session.revert.cleared", ...options, schema: Base });
|
|
412
412
|
RevertEvent.Committed = Event.durable({
|
|
413
|
-
type: "revert.committed",
|
|
413
|
+
type: "session.revert.committed",
|
|
414
414
|
...options,
|
|
415
415
|
schema: { ...Base, messageID: SessionMessage.ID },
|
|
416
416
|
});
|
|
@@ -199,9 +199,35 @@ export interface Shell extends Schema.Schema.Type<typeof Shell> {
|
|
|
199
199
|
}
|
|
200
200
|
export declare const Shell: Schema.Struct<{
|
|
201
201
|
readonly type: Schema.Literal<"shell">;
|
|
202
|
-
readonly
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
readonly shell: Schema.Struct<{
|
|
203
|
+
readonly id: Schema.brand<Schema.String, "ShellID"> & {
|
|
204
|
+
create: () => string & import("effect/Brand").Brand<"ShellID">;
|
|
205
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"ShellID">;
|
|
206
|
+
};
|
|
207
|
+
readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
|
|
208
|
+
readonly command: Schema.String;
|
|
209
|
+
readonly cwd: Schema.String;
|
|
210
|
+
readonly shell: Schema.String;
|
|
211
|
+
readonly file: Schema.String;
|
|
212
|
+
readonly pid: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
213
|
+
readonly exit: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Number>>, Schema.optionalKey<Schema.Number>, never, never>;
|
|
214
|
+
readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
215
|
+
readonly time: Schema.Struct<{
|
|
216
|
+
readonly started: Schema.Number;
|
|
217
|
+
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Number>>, Schema.optionalKey<Schema.Number>, never, never>;
|
|
218
|
+
}>;
|
|
219
|
+
}>;
|
|
220
|
+
readonly output: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
221
|
+
readonly output: Schema.String;
|
|
222
|
+
readonly cursor: Schema.Int;
|
|
223
|
+
readonly size: Schema.Int;
|
|
224
|
+
readonly truncated: Schema.Boolean;
|
|
225
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
226
|
+
readonly output: Schema.String;
|
|
227
|
+
readonly cursor: Schema.Int;
|
|
228
|
+
readonly size: Schema.Int;
|
|
229
|
+
readonly truncated: Schema.Boolean;
|
|
230
|
+
}>>, never, never>;
|
|
205
231
|
readonly time: Schema.Struct<{
|
|
206
232
|
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
207
233
|
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
|
|
@@ -1105,9 +1131,35 @@ export declare const Message: Schema.Union<readonly [Schema.Struct<{
|
|
|
1105
1131
|
}>;
|
|
1106
1132
|
}>, Schema.Struct<{
|
|
1107
1133
|
readonly type: Schema.Literal<"shell">;
|
|
1108
|
-
readonly
|
|
1109
|
-
|
|
1110
|
-
|
|
1134
|
+
readonly shell: Schema.Struct<{
|
|
1135
|
+
readonly id: Schema.brand<Schema.String, "ShellID"> & {
|
|
1136
|
+
create: () => string & import("effect/Brand").Brand<"ShellID">;
|
|
1137
|
+
ascending: (id?: string) => string & import("effect/Brand").Brand<"ShellID">;
|
|
1138
|
+
};
|
|
1139
|
+
readonly status: Schema.Literals<readonly ["running", "exited", "timeout", "killed"]>;
|
|
1140
|
+
readonly command: Schema.String;
|
|
1141
|
+
readonly cwd: Schema.String;
|
|
1142
|
+
readonly shell: Schema.String;
|
|
1143
|
+
readonly file: Schema.String;
|
|
1144
|
+
readonly pid: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
1145
|
+
readonly exit: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Number>>, Schema.optionalKey<Schema.Number>, never, never>;
|
|
1146
|
+
readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
1147
|
+
readonly time: Schema.Struct<{
|
|
1148
|
+
readonly started: Schema.Number;
|
|
1149
|
+
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Number>>, Schema.optionalKey<Schema.Number>, never, never>;
|
|
1150
|
+
}>;
|
|
1151
|
+
}>;
|
|
1152
|
+
readonly output: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
1153
|
+
readonly output: Schema.String;
|
|
1154
|
+
readonly cursor: Schema.Int;
|
|
1155
|
+
readonly size: Schema.Int;
|
|
1156
|
+
readonly truncated: Schema.Boolean;
|
|
1157
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
1158
|
+
readonly output: Schema.String;
|
|
1159
|
+
readonly cursor: Schema.Int;
|
|
1160
|
+
readonly size: Schema.Int;
|
|
1161
|
+
readonly truncated: Schema.Boolean;
|
|
1162
|
+
}>>, never, never>;
|
|
1111
1163
|
readonly time: Schema.Struct<{
|
|
1112
1164
|
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
1113
1165
|
readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
|
package/dist/session-message.js
CHANGED
|
@@ -8,6 +8,7 @@ import { DateTimeUtcFromMillis, RelativePath, statics } from "./schema.js";
|
|
|
8
8
|
import { SessionID } from "./session-id.js";
|
|
9
9
|
import { ascending } from "./identifier.js";
|
|
10
10
|
import { Event } from "./event.js";
|
|
11
|
+
import { Shell as ShellSchema } from "./shell.js";
|
|
11
12
|
export const ID = Schema.String.check(Schema.isStartsWith("msg_")).pipe(Schema.brand("Session.Message.ID"), statics((schema) => ({
|
|
12
13
|
create: () => schema.make("msg_" + ascending()),
|
|
13
14
|
fromEvent: (eventID) => schema.make(eventID.replace(/^evt_/, "msg_")),
|
|
@@ -59,9 +60,8 @@ export const Skill = Schema.Struct({
|
|
|
59
60
|
export const Shell = Schema.Struct({
|
|
60
61
|
...Base,
|
|
61
62
|
type: Schema.Literal("shell"),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
output: Schema.String,
|
|
63
|
+
shell: ShellSchema.Info,
|
|
64
|
+
output: ShellSchema.Output.pipe(optional),
|
|
65
65
|
time: Schema.Struct({
|
|
66
66
|
created: DateTimeUtcFromMillis,
|
|
67
67
|
completed: DateTimeUtcFromMillis.pipe(optional),
|