@opencode-ai/schema 0.0.0-next-14855 → 0.0.0-reserved.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 (147) hide show
  1. package/README.md +3 -0
  2. package/index.js +1 -0
  3. package/package.json +3 -26
  4. package/dist/agent.d.ts +0 -159
  5. package/dist/agent.js +0 -43
  6. package/dist/catalog.d.ts +0 -69
  7. package/dist/catalog.js +0 -4
  8. package/dist/command.d.ts +0 -112
  9. package/dist/command.js +0 -18
  10. package/dist/config.d.ts +0 -69
  11. package/dist/config.js +0 -7
  12. package/dist/connection.d.ts +0 -28
  13. package/dist/connection.js +0 -15
  14. package/dist/credential.d.ts +0 -36
  15. package/dist/credential.js +0 -23
  16. package/dist/durable-event-manifest.d.ts +0 -2370
  17. package/dist/durable-event-manifest.js +0 -9
  18. package/dist/event-log.d.ts +0 -45
  19. package/dist/event-log.js +0 -43
  20. package/dist/event-manifest.d.ts +0 -15273
  21. package/dist/event-manifest.js +0 -52
  22. package/dist/event.d.ts +0 -142
  23. package/dist/event.js +0 -102
  24. package/dist/file-diff.d.ts +0 -11
  25. package/dist/file-diff.js +0 -10
  26. package/dist/filesystem-v1.d.ts +0 -1
  27. package/dist/filesystem-v1.js +0 -1
  28. package/dist/filesystem.d.ts +0 -118
  29. package/dist/filesystem.js +0 -35
  30. package/dist/form.d.ts +0 -1279
  31. package/dist/form.js +0 -112
  32. package/dist/ide-event.d.ts +0 -76
  33. package/dist/ide-event.js +0 -10
  34. package/dist/identifier.d.ts +0 -3
  35. package/dist/identifier.js +0 -24
  36. package/dist/index.d.ts +0 -32
  37. package/dist/index.js +0 -32
  38. package/dist/installation-event.d.ts +0 -149
  39. package/dist/installation-event.js +0 -16
  40. package/dist/integration-id.d.ts +0 -5
  41. package/dist/integration-id.js +0 -3
  42. package/dist/integration.d.ts +0 -532
  43. package/dist/integration.js +0 -93
  44. package/dist/legacy-event.d.ts +0 -1
  45. package/dist/legacy-event.js +0 -1
  46. package/dist/llm.d.ts +0 -28
  47. package/dist/llm.js +0 -19
  48. package/dist/location.d.ts +0 -36
  49. package/dist/location.js +0 -21
  50. package/dist/lsp-event.d.ts +0 -67
  51. package/dist/lsp-event.js +0 -4
  52. package/dist/mcp-event.d.ts +0 -188
  53. package/dist/mcp-event.js +0 -25
  54. package/dist/mcp.d.ts +0 -39
  55. package/dist/mcp.js +0 -38
  56. package/dist/model.d.ts +0 -213
  57. package/dist/model.js +0 -86
  58. package/dist/models-dev.d.ts +0 -69
  59. package/dist/models-dev.js +0 -7
  60. package/dist/permission-saved.d.ts +0 -18
  61. package/dist/permission-saved.js +0 -12
  62. package/dist/permission-v1.d.ts +0 -1
  63. package/dist/permission-v1.js +0 -1
  64. package/dist/permission.d.ts +0 -306
  65. package/dist/permission.js +0 -45
  66. package/dist/plugin.d.ts +0 -85
  67. package/dist/plugin.js +0 -12
  68. package/dist/project-copy.d.ts +0 -29
  69. package/dist/project-copy.js +0 -21
  70. package/dist/project-directories.d.ts +0 -85
  71. package/dist/project-directories.js +0 -8
  72. package/dist/project-id.d.ts +0 -5
  73. package/dist/project-id.js +0 -3
  74. package/dist/project.d.ts +0 -258
  75. package/dist/project.js +0 -44
  76. package/dist/prompt-input.d.ts +0 -106
  77. package/dist/prompt-input.js +0 -19
  78. package/dist/prompt.d.ts +0 -177
  79. package/dist/prompt.js +0 -43
  80. package/dist/provider.d.ts +0 -118
  81. package/dist/provider.js +0 -55
  82. package/dist/pty-ticket.d.ts +0 -8
  83. package/dist/pty-ticket.js +0 -7
  84. package/dist/pty.d.ts +0 -462
  85. package/dist/pty.js +0 -43
  86. package/dist/question-v1.d.ts +0 -1
  87. package/dist/question-v1.js +0 -1
  88. package/dist/question.d.ts +0 -456
  89. package/dist/question.js +0 -64
  90. package/dist/reference.d.ts +0 -120
  91. package/dist/reference.js +0 -31
  92. package/dist/revert.d.ts +0 -35
  93. package/dist/revert.js +0 -19
  94. package/dist/schema.d.ts +0 -10
  95. package/dist/schema.js +0 -14
  96. package/dist/server-event.d.ts +0 -132
  97. package/dist/server-event.js +0 -5
  98. package/dist/session-compaction-event.d.ts +0 -87
  99. package/dist/session-compaction-event.js +0 -10
  100. package/dist/session-context-entry.d.ts +0 -15
  101. package/dist/session-context-entry.js +0 -15
  102. package/dist/session-delivery.d.ts +0 -4
  103. package/dist/session-delivery.js +0 -3
  104. package/dist/session-event.d.ts +0 -12728
  105. package/dist/session-event.js +0 -423
  106. package/dist/session-id.d.ts +0 -6
  107. package/dist/session-id.js +0 -10
  108. package/dist/session-input.d.ts +0 -146
  109. package/dist/session-input.js +0 -18
  110. package/dist/session-message.d.ts +0 -1390
  111. package/dist/session-message.js +0 -175
  112. package/dist/session-status-event.d.ts +0 -299
  113. package/dist/session-status-event.js +0 -43
  114. package/dist/session-todo.d.ts +0 -117
  115. package/dist/session-todo.js +0 -21
  116. package/dist/session-v1.d.ts +0 -1
  117. package/dist/session-v1.js +0 -1
  118. package/dist/session.d.ts +0 -142
  119. package/dist/session.js +0 -43
  120. package/dist/shell.d.ts +0 -381
  121. package/dist/shell.js +0 -58
  122. package/dist/skill.d.ts +0 -126
  123. package/dist/skill.js +0 -45
  124. package/dist/tui-event.d.ts +0 -307
  125. package/dist/tui-event.js +0 -53
  126. package/dist/v1/filesystem.d.ts +0 -78
  127. package/dist/v1/filesystem.js +0 -8
  128. package/dist/v1/legacy-event.d.ts +0 -108
  129. package/dist/v1/legacy-event.js +0 -15
  130. package/dist/v1/permission.d.ts +0 -316
  131. package/dist/v1/permission.js +0 -41
  132. package/dist/v1/question.d.ts +0 -444
  133. package/dist/v1/question.js +0 -57
  134. package/dist/v1/session.d.ts +0 -7657
  135. package/dist/v1/session.js +0 -535
  136. package/dist/vcs-event.d.ts +0 -76
  137. package/dist/vcs-event.js +0 -11
  138. package/dist/vcs.d.ts +0 -12
  139. package/dist/vcs.js +0 -10
  140. package/dist/workspace-event.d.ts +0 -247
  141. package/dist/workspace-event.js +0 -25
  142. package/dist/workspace-id.d.ts +0 -6
  143. package/dist/workspace-id.js +0 -16
  144. package/dist/workspace.d.ts +0 -9
  145. package/dist/workspace.js +0 -5
  146. package/dist/worktree-event.d.ts +0 -153
  147. package/dist/worktree-event.js +0 -18
@@ -1,535 +0,0 @@
1
- export * as SessionV1 from "./session.js";
2
- import { Effect, Schema, Types } from "effect";
3
- import { durable, ephemeral, inventory } from "../event.js";
4
- import { FileDiff } from "../file-diff.js";
5
- import { Project } from "../project.js";
6
- import { Provider } from "../provider.js";
7
- import { Model } from "../model.js";
8
- import { NonNegativeInt, optional, statics } from "../schema.js";
9
- import { ascending } from "../identifier.js";
10
- import { SessionID } from "../session-id.js";
11
- import { WorkspaceID } from "../workspace-id.js";
12
- import { PermissionV1 } from "./permission.js";
13
- const Timestamp = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));
14
- export const MessageID = Schema.String.check(Schema.isStartsWith("msg")).pipe(Schema.brand("MessageID"), statics((schema) => ({ ascending: (id) => schema.make(id ?? "msg_" + ascending()) })));
15
- export const PartID = Schema.String.check(Schema.isStartsWith("prt")).pipe(Schema.brand("PartID"), statics((schema) => ({ ascending: (id) => schema.make(id ?? "prt_" + ascending()) })));
16
- const namedError = (name, fields) => {
17
- const schema = Schema.Struct({ name: Schema.Literal(name), data: Schema.Struct(fields) }).annotate({
18
- identifier: name,
19
- });
20
- return { Schema: schema, EffectSchema: schema };
21
- };
22
- export const OutputLengthError = namedError("MessageOutputLengthError", {});
23
- export const AuthError = namedError("ProviderAuthError", {
24
- providerID: Schema.String,
25
- message: Schema.String,
26
- });
27
- export const AbortedError = namedError("MessageAbortedError", { message: Schema.String });
28
- export const StructuredOutputError = namedError("StructuredOutputError", {
29
- message: Schema.String,
30
- retries: NonNegativeInt,
31
- });
32
- export const APIError = namedError("APIError", {
33
- message: Schema.String,
34
- statusCode: Schema.optional(NonNegativeInt),
35
- isRetryable: Schema.Boolean,
36
- responseHeaders: Schema.optional(Schema.Record(Schema.String, Schema.String)),
37
- responseBody: Schema.optional(Schema.String),
38
- metadata: Schema.optional(Schema.Record(Schema.String, Schema.String)),
39
- });
40
- export const ContextOverflowError = namedError("ContextOverflowError", {
41
- message: Schema.String,
42
- responseBody: Schema.optional(Schema.String),
43
- });
44
- export const ContentFilterError = namedError("ContentFilterError", {
45
- message: Schema.String,
46
- });
47
- export class OutputFormatText extends Schema.Class("OutputFormatText")({
48
- type: Schema.Literal("text"),
49
- }) {
50
- }
51
- export class OutputFormatJsonSchema extends Schema.Class("OutputFormatJsonSchema")({
52
- type: Schema.Literal("json_schema"),
53
- schema: Schema.Record(Schema.String, Schema.Any).annotate({ identifier: "JSONSchema" }),
54
- retryCount: NonNegativeInt.pipe(Schema.optional, Schema.withDecodingDefault(Effect.succeed(2))),
55
- }) {
56
- }
57
- export const Format = Schema.Union([OutputFormatText, OutputFormatJsonSchema]).annotate({
58
- discriminator: "type",
59
- identifier: "OutputFormat",
60
- });
61
- const partBase = {
62
- id: PartID,
63
- sessionID: SessionID,
64
- messageID: MessageID,
65
- };
66
- export const SnapshotPart = Schema.Struct({
67
- ...partBase,
68
- type: Schema.Literal("snapshot"),
69
- snapshot: Schema.String,
70
- }).annotate({ identifier: "SnapshotPart" });
71
- export const PatchPart = Schema.Struct({
72
- ...partBase,
73
- type: Schema.Literal("patch"),
74
- hash: Schema.String,
75
- files: Schema.Array(Schema.String),
76
- }).annotate({ identifier: "PatchPart" });
77
- export const TextPart = Schema.Struct({
78
- ...partBase,
79
- type: Schema.Literal("text"),
80
- text: Schema.String,
81
- synthetic: Schema.optional(Schema.Boolean),
82
- ignored: Schema.optional(Schema.Boolean),
83
- time: Schema.optional(Schema.Struct({
84
- start: NonNegativeInt,
85
- end: Schema.optional(NonNegativeInt),
86
- })),
87
- metadata: Schema.optional(Schema.Record(Schema.String, Schema.Any)),
88
- }).annotate({ identifier: "TextPart" });
89
- export const ReasoningPart = Schema.Struct({
90
- ...partBase,
91
- type: Schema.Literal("reasoning"),
92
- text: Schema.String,
93
- metadata: Schema.optional(Schema.Record(Schema.String, Schema.Any)),
94
- time: Schema.Struct({
95
- start: NonNegativeInt,
96
- end: Schema.optional(NonNegativeInt),
97
- }),
98
- }).annotate({ identifier: "ReasoningPart" });
99
- const filePartSourceBase = {
100
- text: Schema.Struct({
101
- value: Schema.String,
102
- start: Schema.Finite,
103
- end: Schema.Finite,
104
- }).annotate({ identifier: "FilePartSourceText" }),
105
- };
106
- export const Range = Schema.Struct({
107
- start: Schema.Struct({ line: NonNegativeInt, character: NonNegativeInt }),
108
- end: Schema.Struct({ line: NonNegativeInt, character: NonNegativeInt }),
109
- }).annotate({ identifier: "Range" });
110
- export const FileSource = Schema.Struct({
111
- ...filePartSourceBase,
112
- type: Schema.Literal("file"),
113
- path: Schema.String,
114
- }).annotate({ identifier: "FileSource" });
115
- export const SymbolSource = Schema.Struct({
116
- ...filePartSourceBase,
117
- type: Schema.Literal("symbol"),
118
- path: Schema.String,
119
- range: Range,
120
- name: Schema.String,
121
- kind: NonNegativeInt,
122
- }).annotate({ identifier: "SymbolSource" });
123
- export const ResourceSource = Schema.Struct({
124
- ...filePartSourceBase,
125
- type: Schema.Literal("resource"),
126
- clientName: Schema.String,
127
- uri: Schema.String,
128
- }).annotate({ identifier: "ResourceSource" });
129
- export const FilePartSource = Schema.Union([FileSource, SymbolSource, ResourceSource]).annotate({
130
- discriminator: "type",
131
- identifier: "FilePartSource",
132
- });
133
- export const FilePart = Schema.Struct({
134
- ...partBase,
135
- type: Schema.Literal("file"),
136
- mime: Schema.String,
137
- filename: Schema.optional(Schema.String),
138
- url: Schema.String,
139
- source: Schema.optional(FilePartSource),
140
- }).annotate({ identifier: "FilePart" });
141
- export const AgentPart = Schema.Struct({
142
- ...partBase,
143
- type: Schema.Literal("agent"),
144
- name: Schema.String,
145
- source: Schema.optional(Schema.Struct({
146
- value: Schema.String,
147
- start: NonNegativeInt,
148
- end: NonNegativeInt,
149
- })),
150
- }).annotate({ identifier: "AgentPart" });
151
- export const CompactionPart = Schema.Struct({
152
- ...partBase,
153
- type: Schema.Literal("compaction"),
154
- auto: Schema.Boolean,
155
- overflow: Schema.optional(Schema.Boolean),
156
- tail_start_id: Schema.optional(MessageID),
157
- }).annotate({ identifier: "CompactionPart" });
158
- export const SubtaskPart = Schema.Struct({
159
- ...partBase,
160
- type: Schema.Literal("subtask"),
161
- prompt: Schema.String,
162
- description: Schema.String,
163
- agent: Schema.String,
164
- model: Schema.optional(Schema.Struct({
165
- providerID: Provider.ID,
166
- modelID: Model.ID,
167
- })),
168
- command: Schema.optional(Schema.String),
169
- }).annotate({ identifier: "SubtaskPart" });
170
- export const RetryPart = Schema.Struct({
171
- ...partBase,
172
- type: Schema.Literal("retry"),
173
- attempt: NonNegativeInt,
174
- error: APIError.EffectSchema,
175
- time: Schema.Struct({
176
- created: NonNegativeInt,
177
- }),
178
- }).annotate({ identifier: "RetryPart" });
179
- export const StepStartPart = Schema.Struct({
180
- ...partBase,
181
- type: Schema.Literal("step-start"),
182
- snapshot: Schema.optional(Schema.String),
183
- }).annotate({ identifier: "StepStartPart" });
184
- export const StepFinishPart = Schema.Struct({
185
- ...partBase,
186
- type: Schema.Literal("step-finish"),
187
- reason: Schema.String,
188
- snapshot: Schema.optional(Schema.String),
189
- cost: Schema.Finite,
190
- tokens: Schema.Struct({
191
- total: Schema.optional(Schema.Finite),
192
- input: Schema.Finite,
193
- output: Schema.Finite,
194
- reasoning: Schema.Finite,
195
- cache: Schema.Struct({
196
- read: Schema.Finite,
197
- write: Schema.Finite,
198
- }),
199
- }),
200
- }).annotate({ identifier: "StepFinishPart" });
201
- export const ToolStatePending = Schema.Struct({
202
- status: Schema.Literal("pending"),
203
- input: Schema.Record(Schema.String, Schema.Any),
204
- raw: Schema.String,
205
- }).annotate({ identifier: "ToolStatePending" });
206
- export const ToolStateRunning = Schema.Struct({
207
- status: Schema.Literal("running"),
208
- input: Schema.Record(Schema.String, Schema.Any),
209
- title: Schema.optional(Schema.String),
210
- metadata: Schema.optional(Schema.Record(Schema.String, Schema.Any)),
211
- time: Schema.Struct({
212
- start: NonNegativeInt,
213
- }),
214
- }).annotate({ identifier: "ToolStateRunning" });
215
- export const ToolStateCompleted = Schema.Struct({
216
- status: Schema.Literal("completed"),
217
- input: Schema.Record(Schema.String, Schema.Any),
218
- output: Schema.String,
219
- title: Schema.String,
220
- metadata: Schema.Record(Schema.String, Schema.Any),
221
- time: Schema.Struct({
222
- start: NonNegativeInt,
223
- end: NonNegativeInt,
224
- compacted: Schema.optional(NonNegativeInt),
225
- }),
226
- attachments: Schema.optional(Schema.Array(FilePart)),
227
- }).annotate({ identifier: "ToolStateCompleted" });
228
- export const ToolStateError = Schema.Struct({
229
- status: Schema.Literal("error"),
230
- input: Schema.Record(Schema.String, Schema.Any),
231
- error: Schema.String,
232
- metadata: Schema.optional(Schema.Record(Schema.String, Schema.Any)),
233
- time: Schema.Struct({
234
- start: NonNegativeInt,
235
- end: NonNegativeInt,
236
- }),
237
- }).annotate({ identifier: "ToolStateError" });
238
- export const ToolState = Schema.Union([
239
- ToolStatePending,
240
- ToolStateRunning,
241
- ToolStateCompleted,
242
- ToolStateError,
243
- ]).annotate({
244
- discriminator: "status",
245
- identifier: "ToolState",
246
- });
247
- export const ToolPart = Schema.Struct({
248
- ...partBase,
249
- type: Schema.Literal("tool"),
250
- callID: Schema.String,
251
- tool: Schema.String,
252
- state: ToolState,
253
- metadata: Schema.optional(Schema.Record(Schema.String, Schema.Any)),
254
- }).annotate({ identifier: "ToolPart" });
255
- const messageBase = {
256
- id: MessageID,
257
- sessionID: partBase.sessionID,
258
- };
259
- export const User = Schema.Struct({
260
- ...messageBase,
261
- role: Schema.Literal("user"),
262
- time: Schema.Struct({
263
- created: Timestamp,
264
- }),
265
- format: Schema.optional(Format),
266
- summary: Schema.optional(Schema.Struct({
267
- title: Schema.optional(Schema.String),
268
- body: Schema.optional(Schema.String),
269
- diffs: Schema.Array(FileDiff.Info),
270
- })),
271
- agent: Schema.String,
272
- model: Schema.Struct({
273
- providerID: Provider.ID,
274
- modelID: Model.ID,
275
- variant: Schema.optional(Schema.String),
276
- }),
277
- system: Schema.optional(Schema.String),
278
- tools: Schema.optional(Schema.Record(Schema.String, Schema.Boolean)),
279
- }).annotate({ identifier: "UserMessage" });
280
- export const Part = Schema.Union([
281
- TextPart,
282
- SubtaskPart,
283
- ReasoningPart,
284
- FilePart,
285
- ToolPart,
286
- StepStartPart,
287
- StepFinishPart,
288
- SnapshotPart,
289
- PatchPart,
290
- AgentPart,
291
- RetryPart,
292
- CompactionPart,
293
- ]).annotate({ discriminator: "type", identifier: "Part" });
294
- const AssistantErrorSchema = Schema.Union([
295
- AuthError.EffectSchema,
296
- namedError("UnknownError", { message: Schema.String, ref: Schema.optional(Schema.String) }).EffectSchema,
297
- OutputLengthError.EffectSchema,
298
- AbortedError.EffectSchema,
299
- StructuredOutputError.EffectSchema,
300
- ContextOverflowError.EffectSchema,
301
- ContentFilterError.EffectSchema,
302
- APIError.EffectSchema,
303
- ]).annotate({ discriminator: "name" });
304
- export const TextPartInput = Schema.Struct({
305
- id: Schema.optional(PartID),
306
- type: Schema.Literal("text"),
307
- text: Schema.String,
308
- synthetic: Schema.optional(Schema.Boolean),
309
- ignored: Schema.optional(Schema.Boolean),
310
- time: Schema.optional(Schema.Struct({
311
- start: NonNegativeInt,
312
- end: Schema.optional(NonNegativeInt),
313
- })),
314
- metadata: Schema.optional(Schema.Record(Schema.String, Schema.Any)),
315
- }).annotate({ identifier: "TextPartInput" });
316
- export const FilePartInput = Schema.Struct({
317
- id: Schema.optional(PartID),
318
- type: Schema.Literal("file"),
319
- mime: Schema.String,
320
- filename: Schema.optional(Schema.String),
321
- url: Schema.String,
322
- source: Schema.optional(FilePartSource),
323
- }).annotate({ identifier: "FilePartInput" });
324
- export const AgentPartInput = Schema.Struct({
325
- id: Schema.optional(PartID),
326
- type: Schema.Literal("agent"),
327
- name: Schema.String,
328
- source: Schema.optional(Schema.Struct({
329
- value: Schema.String,
330
- start: NonNegativeInt,
331
- end: NonNegativeInt,
332
- })),
333
- }).annotate({ identifier: "AgentPartInput" });
334
- export const SubtaskPartInput = Schema.Struct({
335
- id: Schema.optional(PartID),
336
- type: Schema.Literal("subtask"),
337
- prompt: Schema.String,
338
- description: Schema.String,
339
- agent: Schema.String,
340
- model: Schema.optional(Schema.Struct({
341
- providerID: Provider.ID,
342
- modelID: Model.ID,
343
- })),
344
- command: Schema.optional(Schema.String),
345
- }).annotate({ identifier: "SubtaskPartInput" });
346
- export const Assistant = Schema.Struct({
347
- ...messageBase,
348
- role: Schema.Literal("assistant"),
349
- time: Schema.Struct({
350
- created: NonNegativeInt,
351
- completed: Schema.optional(NonNegativeInt),
352
- }),
353
- error: Schema.optional(AssistantErrorSchema),
354
- parentID: MessageID,
355
- modelID: Model.ID,
356
- providerID: Provider.ID,
357
- mode: Schema.String,
358
- agent: Schema.String,
359
- path: Schema.Struct({
360
- cwd: Schema.String,
361
- root: Schema.String,
362
- }),
363
- summary: Schema.optional(Schema.Boolean),
364
- cost: Schema.Finite,
365
- tokens: Schema.Struct({
366
- total: Schema.optional(Schema.Finite),
367
- input: Schema.Finite,
368
- output: Schema.Finite,
369
- reasoning: Schema.Finite,
370
- cache: Schema.Struct({
371
- read: Schema.Finite,
372
- write: Schema.Finite,
373
- }),
374
- }),
375
- structured: Schema.optional(Schema.Any),
376
- variant: Schema.optional(Schema.String),
377
- finish: Schema.optional(Schema.String),
378
- }).annotate({ identifier: "AssistantMessage" });
379
- export const Info = Schema.Union([User, Assistant]).annotate({ discriminator: "role", identifier: "Message" });
380
- export const WithParts = Schema.Struct({
381
- info: Info,
382
- parts: Schema.Array(Part),
383
- });
384
- const options = {
385
- durable: {
386
- aggregate: "sessionID",
387
- version: 1,
388
- },
389
- };
390
- const SessionSummary = Schema.Struct({
391
- additions: Schema.Finite,
392
- deletions: Schema.Finite,
393
- files: Schema.Finite,
394
- diffs: optional(Schema.Array(FileDiff.Info)),
395
- });
396
- const SessionTokens = Schema.Struct({
397
- input: Schema.Finite,
398
- output: Schema.Finite,
399
- reasoning: Schema.Finite,
400
- cache: Schema.Struct({
401
- read: Schema.Finite,
402
- write: Schema.Finite,
403
- }),
404
- });
405
- const SessionShare = Schema.Struct({
406
- url: Schema.String,
407
- });
408
- const SessionRevert = Schema.Struct({
409
- messageID: MessageID,
410
- partID: optional(PartID),
411
- snapshot: optional(Schema.String),
412
- diff: optional(Schema.String),
413
- });
414
- const SessionModel = Schema.Struct({
415
- id: Model.ID,
416
- providerID: Provider.ID,
417
- variant: optional(Schema.String),
418
- });
419
- export const SessionInfo = Schema.Struct({
420
- id: SessionID,
421
- slug: Schema.String,
422
- projectID: Project.ID,
423
- workspaceID: optional(WorkspaceID),
424
- directory: Schema.String,
425
- path: optional(Schema.String),
426
- parentID: optional(SessionID),
427
- summary: optional(SessionSummary),
428
- cost: optional(Schema.Finite),
429
- tokens: optional(SessionTokens),
430
- share: optional(SessionShare),
431
- title: Schema.String,
432
- agent: optional(Schema.String),
433
- model: optional(SessionModel),
434
- version: Schema.String,
435
- metadata: optional(Schema.Record(Schema.String, Schema.Any)),
436
- time: Schema.Struct({
437
- created: NonNegativeInt,
438
- updated: NonNegativeInt,
439
- compacting: optional(NonNegativeInt),
440
- archived: optional(Schema.Finite),
441
- }),
442
- permission: optional(PermissionV1.Ruleset),
443
- revert: optional(SessionRevert),
444
- }).annotate({ identifier: "Session" });
445
- const events = {
446
- Created: durable({
447
- type: "session.created",
448
- ...options,
449
- schema: {
450
- sessionID: SessionID,
451
- info: SessionInfo,
452
- },
453
- }),
454
- Updated: durable({
455
- type: "session.updated",
456
- ...options,
457
- schema: {
458
- sessionID: SessionID,
459
- info: SessionInfo,
460
- },
461
- }),
462
- Deleted: durable({
463
- type: "session.deleted",
464
- ...options,
465
- schema: {
466
- sessionID: SessionID,
467
- info: SessionInfo,
468
- },
469
- }),
470
- MessageUpdated: durable({
471
- type: "message.updated",
472
- ...options,
473
- schema: {
474
- sessionID: SessionID,
475
- info: Info,
476
- },
477
- }),
478
- MessageRemoved: durable({
479
- type: "message.removed",
480
- ...options,
481
- schema: {
482
- sessionID: SessionID,
483
- messageID: MessageID,
484
- },
485
- }),
486
- PartUpdated: durable({
487
- type: "message.part.updated",
488
- ...options,
489
- schema: {
490
- sessionID: SessionID,
491
- part: Part,
492
- time: Schema.Finite,
493
- },
494
- }),
495
- PartRemoved: durable({
496
- type: "message.part.removed",
497
- ...options,
498
- schema: {
499
- sessionID: SessionID,
500
- messageID: MessageID,
501
- partID: PartID,
502
- },
503
- }),
504
- };
505
- export const PartDelta = ephemeral({
506
- type: "message.part.delta",
507
- schema: {
508
- sessionID: SessionID,
509
- messageID: MessageID,
510
- partID: PartID,
511
- field: Schema.String,
512
- delta: Schema.String,
513
- },
514
- });
515
- export const Diff = ephemeral({
516
- type: "session.diff",
517
- schema: {
518
- sessionID: SessionID,
519
- diff: Schema.Array(FileDiff.Info),
520
- },
521
- });
522
- export const Error = ephemeral({
523
- type: "session.error",
524
- schema: {
525
- sessionID: Schema.optional(SessionID),
526
- error: Assistant.fields.error,
527
- },
528
- });
529
- export const Event = {
530
- ...events,
531
- PartDelta,
532
- Diff,
533
- Error,
534
- Definitions: inventory(events.Created, events.Updated, events.Deleted, events.MessageUpdated, events.MessageRemoved, events.PartUpdated, events.PartRemoved, PartDelta, Diff, Error),
535
- };
@@ -1,76 +0,0 @@
1
- export * as VcsEvent from "./vcs-event.js";
2
- import { Schema } from "effect";
3
- export declare const BranchUpdated: Schema.Struct<{
4
- readonly id: Schema.brand<Schema.String, "Event.ID"> & {
5
- create: () => string & import("effect/Brand").Brand<"Event.ID">;
6
- };
7
- readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
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>;
9
- readonly type: Schema.Literal<"vcs.branch.updated">;
10
- readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
11
- readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
12
- readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
13
- ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
14
- create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
15
- }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
16
- ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
17
- create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
18
- }>, never, never>;
19
- }>>>, Schema.optionalKey<Schema.Struct<{
20
- readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
21
- readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
22
- ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
23
- create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
24
- }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
25
- ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
26
- create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
27
- }>, never, never>;
28
- }>>, never, never>;
29
- readonly data: Schema.Struct<{
30
- readonly branch: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
31
- }>;
32
- }> & {
33
- type: "vcs.branch.updated";
34
- durability: "ephemeral";
35
- durable: undefined;
36
- data: Schema.Struct<{
37
- readonly branch: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
38
- }>;
39
- };
40
- export declare const Definitions: readonly [Schema.Struct<{
41
- readonly id: Schema.brand<Schema.String, "Event.ID"> & {
42
- create: () => string & import("effect/Brand").Brand<"Event.ID">;
43
- };
44
- readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
45
- readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
46
- readonly type: Schema.Literal<"vcs.branch.updated">;
47
- readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
48
- readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
49
- readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
50
- ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
51
- create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
52
- }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
53
- ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
54
- create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
55
- }>, never, never>;
56
- }>>>, Schema.optionalKey<Schema.Struct<{
57
- readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
58
- readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
59
- ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
60
- create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
61
- }>>, Schema.optionalKey<Schema.brand<Schema.String, "WorkspaceV2.ID"> & {
62
- ascending: (id?: string) => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
63
- create: () => string & import("effect/Brand").Brand<"WorkspaceV2.ID">;
64
- }>, never, never>;
65
- }>>, never, never>;
66
- readonly data: Schema.Struct<{
67
- readonly branch: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
68
- }>;
69
- }> & {
70
- type: "vcs.branch.updated";
71
- durability: "ephemeral";
72
- durable: undefined;
73
- data: Schema.Struct<{
74
- readonly branch: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
75
- }>;
76
- }];
package/dist/vcs-event.js DELETED
@@ -1,11 +0,0 @@
1
- export * as VcsEvent from "./vcs-event.js";
2
- import { Schema } from "effect";
3
- import { optional } from "./schema.js";
4
- import { Event } from "./event.js";
5
- export const BranchUpdated = Event.ephemeral({
6
- type: "vcs.branch.updated",
7
- schema: {
8
- branch: optional(Schema.String),
9
- },
10
- });
11
- export const Definitions = Event.inventory(BranchUpdated);
package/dist/vcs.d.ts DELETED
@@ -1,12 +0,0 @@
1
- export * as Vcs from "./vcs.js";
2
- import { Schema } from "effect";
3
- export declare const Mode: Schema.Literals<readonly ["working", "branch"]>;
4
- export type Mode = typeof Mode.Type;
5
- export declare const FileStatus: Schema.Struct<{
6
- readonly file: Schema.String;
7
- readonly additions: Schema.Int;
8
- readonly deletions: Schema.Int;
9
- readonly status: Schema.Literals<readonly ["added", "deleted", "modified"]>;
10
- }>;
11
- export interface FileStatus extends Schema.Schema.Type<typeof FileStatus> {
12
- }
package/dist/vcs.js DELETED
@@ -1,10 +0,0 @@
1
- export * as Vcs from "./vcs.js";
2
- import { Schema } from "effect";
3
- import { NonNegativeInt } from "./schema.js";
4
- export const Mode = Schema.Literals(["working", "branch"]).annotate({ identifier: "Vcs.Mode" });
5
- export const FileStatus = Schema.Struct({
6
- file: Schema.String,
7
- additions: NonNegativeInt,
8
- deletions: NonNegativeInt,
9
- status: Schema.Literals(["added", "deleted", "modified"]),
10
- }).annotate({ identifier: "Vcs.FileStatus" });