saeeol 1.2.0 → 1.2.2

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 (193) hide show
  1. package/package.json +14 -14
  2. package/src/cli/cmd/tui/component/dialog/dialog-agent.tsx +32 -0
  3. package/src/cli/cmd/tui/component/dialog/dialog-command.tsx +190 -0
  4. package/src/cli/cmd/tui/component/dialog/dialog-console-org.tsx +103 -0
  5. package/src/cli/cmd/tui/component/dialog/dialog-go-upsell.tsx +159 -0
  6. package/src/cli/cmd/tui/component/dialog/dialog-mcp.tsx +86 -0
  7. package/src/cli/cmd/tui/component/dialog/dialog-model.tsx +238 -0
  8. package/src/cli/cmd/tui/component/dialog/dialog-provider.tsx +343 -0
  9. package/src/cli/cmd/tui/component/dialog/dialog-session-delete-failed.tsx +103 -0
  10. package/src/cli/cmd/tui/component/dialog/dialog-session-list.tsx +301 -0
  11. package/src/cli/cmd/tui/component/dialog/dialog-session-rename.tsx +35 -0
  12. package/src/cli/cmd/tui/component/dialog/dialog-skill.tsx +37 -0
  13. package/src/cli/cmd/tui/component/dialog/dialog-stash.tsx +87 -0
  14. package/src/cli/cmd/tui/component/dialog/dialog-status.tsx +190 -0
  15. package/src/cli/cmd/tui/component/dialog/dialog-tag.tsx +44 -0
  16. package/src/cli/cmd/tui/component/dialog/dialog-theme-list.tsx +50 -0
  17. package/src/cli/cmd/tui/component/dialog/dialog-variant.tsx +39 -0
  18. package/src/cli/cmd/tui/component/dialog/dialog-workspace-create.tsx +200 -0
  19. package/src/cli/cmd/tui/component/dialog/dialog-workspace-unavailable.tsx +81 -0
  20. package/src/cli/cmd/tui/component/dialog-agent.tsx +1 -32
  21. package/src/cli/cmd/tui/component/dialog-command.tsx +1 -190
  22. package/src/cli/cmd/tui/component/dialog-console-org.tsx +1 -103
  23. package/src/cli/cmd/tui/component/dialog-go-upsell.tsx +1 -159
  24. package/src/cli/cmd/tui/component/dialog-mcp.tsx +1 -86
  25. package/src/cli/cmd/tui/component/dialog-model.tsx +1 -238
  26. package/src/cli/cmd/tui/component/dialog-provider.tsx +1 -343
  27. package/src/cli/cmd/tui/component/dialog-session-delete-failed.tsx +1 -103
  28. package/src/cli/cmd/tui/component/dialog-session-list.tsx +1 -301
  29. package/src/cli/cmd/tui/component/dialog-session-rename.tsx +1 -35
  30. package/src/cli/cmd/tui/component/dialog-skill.tsx +1 -37
  31. package/src/cli/cmd/tui/component/dialog-stash.tsx +1 -87
  32. package/src/cli/cmd/tui/component/dialog-status.tsx +1 -190
  33. package/src/cli/cmd/tui/component/dialog-tag.tsx +1 -44
  34. package/src/cli/cmd/tui/component/dialog-theme-list.tsx +1 -50
  35. package/src/cli/cmd/tui/component/dialog-variant.tsx +1 -39
  36. package/src/cli/cmd/tui/component/dialog-workspace-create.tsx +1 -200
  37. package/src/cli/cmd/tui/component/dialog-workspace-unavailable.tsx +1 -81
  38. package/src/session/compaction-helpers.ts +1 -169
  39. package/src/session/compaction.ts +1 -712
  40. package/src/session/core/compaction/compaction-helpers.ts +169 -0
  41. package/src/session/core/compaction/compaction.ts +712 -0
  42. package/src/session/core/compaction/overflow.ts +28 -0
  43. package/src/session/core/instruction.ts +234 -0
  44. package/src/session/core/llm.ts +504 -0
  45. package/src/session/core/network.ts +392 -0
  46. package/src/session/core/processor.ts +731 -0
  47. package/src/session/core/projectors.ts +139 -0
  48. package/src/session/core/resolve-tools.ts +241 -0
  49. package/src/session/core/retry.ts +149 -0
  50. package/src/session/core/revert.ts +173 -0
  51. package/src/session/core/run-state.ts +110 -0
  52. package/src/session/core/schema.ts +35 -0
  53. package/src/session/core/session-types.ts +160 -0
  54. package/src/session/core/session.sql.ts +124 -0
  55. package/src/session/core/session.ts +948 -0
  56. package/src/session/core/shell-exec.ts +205 -0
  57. package/src/session/core/status.ts +100 -0
  58. package/src/session/core/subtask.ts +268 -0
  59. package/src/session/core/summary.ts +173 -0
  60. package/src/session/core/system.ts +114 -0
  61. package/src/session/core/todo.ts +86 -0
  62. package/src/session/core/user-part.ts +293 -0
  63. package/src/session/instruction.ts +1 -234
  64. package/src/session/llm.ts +1 -504
  65. package/src/session/message/message-errors.ts +83 -0
  66. package/src/session/message/message-parts.ts +89 -0
  67. package/src/session/message/message-query.ts +107 -0
  68. package/src/session/message/message-transform.ts +156 -0
  69. package/src/session/message/message-types.ts +68 -0
  70. package/src/session/message/message-v2.ts +73 -0
  71. package/src/session/message/message.ts +192 -0
  72. package/src/session/message-errors.ts +1 -83
  73. package/src/session/message-parts.ts +1 -89
  74. package/src/session/message-query.ts +1 -107
  75. package/src/session/message-transform.ts +1 -156
  76. package/src/session/message-types.ts +1 -68
  77. package/src/session/message-v2.ts +1 -73
  78. package/src/session/message.ts +1 -192
  79. package/src/session/network.ts +1 -392
  80. package/src/session/overflow.ts +1 -28
  81. package/src/session/processor.ts +1 -731
  82. package/src/session/projectors.ts +2 -139
  83. package/src/session/prompt/prompt-command.ts +93 -0
  84. package/src/session/prompt/prompt-loop.ts +299 -0
  85. package/src/session/prompt/prompt-model.ts +44 -0
  86. package/src/session/prompt/prompt-reminders.ts +120 -0
  87. package/src/session/prompt/prompt-resolve.ts +42 -0
  88. package/src/session/prompt/prompt-schemas.ts +128 -0
  89. package/src/session/prompt/prompt-title.ts +55 -0
  90. package/src/session/prompt/prompt-types.ts +47 -0
  91. package/src/session/prompt/prompt-user-msg.ts +80 -0
  92. package/src/session/prompt/prompt.ts +211 -0
  93. package/src/session/prompt-command.ts +1 -93
  94. package/src/session/prompt-loop.ts +1 -299
  95. package/src/session/prompt-model.ts +1 -44
  96. package/src/session/prompt-reminders.ts +1 -120
  97. package/src/session/prompt-resolve.ts +1 -42
  98. package/src/session/prompt-schemas.ts +1 -128
  99. package/src/session/prompt-title.ts +1 -55
  100. package/src/session/prompt-types.ts +1 -47
  101. package/src/session/prompt-user-msg.ts +1 -80
  102. package/src/session/prompt.ts +1 -211
  103. package/src/session/resolve-tools.ts +1 -241
  104. package/src/session/retry.ts +1 -149
  105. package/src/session/revert.ts +1 -173
  106. package/src/session/run-state.ts +1 -110
  107. package/src/session/schema.ts +1 -35
  108. package/src/session/session-types.ts +1 -160
  109. package/src/session/session.sql.ts +1 -124
  110. package/src/session/session.ts +1 -948
  111. package/src/session/shell-exec.ts +1 -205
  112. package/src/session/status.ts +1 -100
  113. package/src/session/subtask.ts +1 -268
  114. package/src/session/summary.ts +1 -173
  115. package/src/session/system.ts +1 -114
  116. package/src/session/todo.ts +1 -86
  117. package/src/session/user-part.ts +1 -293
  118. package/src/tool/apply_patch.ts +1 -334
  119. package/src/tool/bash.ts +1 -656
  120. package/src/tool/core/external-directory.ts +55 -0
  121. package/src/tool/core/invalid.ts +21 -0
  122. package/src/tool/core/recall.ts +164 -0
  123. package/src/tool/core/recall.txt +12 -0
  124. package/src/tool/core/schema.ts +16 -0
  125. package/src/tool/core/tool.ts +162 -0
  126. package/src/tool/core/truncate.ts +160 -0
  127. package/src/tool/core/truncation-dir.ts +4 -0
  128. package/src/tool/diagnostics.ts +1 -20
  129. package/src/tool/edit-replacers.ts +1 -288
  130. package/src/tool/edit-utils.ts +1 -86
  131. package/src/tool/edit.ts +1 -262
  132. package/src/tool/external-directory.ts +1 -55
  133. package/src/tool/file/apply_patch.ts +334 -0
  134. package/src/tool/file/apply_patch.txt +33 -0
  135. package/src/tool/file/bash.ts +656 -0
  136. package/src/tool/file/bash.txt +119 -0
  137. package/src/tool/file/edit-replacers.ts +288 -0
  138. package/src/tool/file/edit-utils.ts +86 -0
  139. package/src/tool/file/edit.ts +262 -0
  140. package/src/tool/file/edit.txt +10 -0
  141. package/src/tool/file/read.ts +389 -0
  142. package/src/tool/file/read.txt +14 -0
  143. package/src/tool/file/write.ts +114 -0
  144. package/src/tool/file/write.txt +8 -0
  145. package/src/tool/glob.ts +1 -115
  146. package/src/tool/grep.ts +1 -151
  147. package/src/tool/integration/diagnostics.ts +20 -0
  148. package/src/tool/integration/lsp.ts +113 -0
  149. package/src/tool/integration/lsp.txt +24 -0
  150. package/src/tool/integration/mcp-exa.ts +73 -0
  151. package/src/tool/integration/package.ts +168 -0
  152. package/src/tool/integration/registry.ts +375 -0
  153. package/src/tool/invalid.ts +1 -21
  154. package/src/tool/lsp.ts +1 -113
  155. package/src/tool/mcp-exa.ts +1 -73
  156. package/src/tool/package.ts +1 -168
  157. package/src/tool/plan.ts +1 -30
  158. package/src/tool/question.ts +1 -52
  159. package/src/tool/read.ts +1 -389
  160. package/src/tool/recall.ts +1 -164
  161. package/src/tool/registry.ts +1 -375
  162. package/src/tool/schema.ts +1 -16
  163. package/src/tool/search/glob.ts +115 -0
  164. package/src/tool/search/glob.txt +6 -0
  165. package/src/tool/search/grep.ts +151 -0
  166. package/src/tool/search/grep.txt +8 -0
  167. package/src/tool/search/warpgrep.ts +107 -0
  168. package/src/tool/search/warpgrep.txt +10 -0
  169. package/src/tool/search/webfetch.ts +202 -0
  170. package/src/tool/search/webfetch.txt +13 -0
  171. package/src/tool/search/websearch.ts +71 -0
  172. package/src/tool/search/websearch.txt +14 -0
  173. package/src/tool/skill.ts +1 -91
  174. package/src/tool/task.ts +1 -197
  175. package/src/tool/todo.ts +1 -62
  176. package/src/tool/tool.ts +1 -162
  177. package/src/tool/truncate.ts +1 -160
  178. package/src/tool/truncation-dir.ts +1 -4
  179. package/src/tool/warpgrep.ts +1 -107
  180. package/src/tool/webfetch.ts +1 -202
  181. package/src/tool/websearch.ts +1 -71
  182. package/src/tool/workflow/plan-enter.txt +14 -0
  183. package/src/tool/workflow/plan-exit.txt +13 -0
  184. package/src/tool/workflow/plan.ts +30 -0
  185. package/src/tool/workflow/question.ts +52 -0
  186. package/src/tool/workflow/question.txt +11 -0
  187. package/src/tool/workflow/skill.ts +91 -0
  188. package/src/tool/workflow/skill.txt +5 -0
  189. package/src/tool/workflow/task.ts +197 -0
  190. package/src/tool/workflow/task.txt +57 -0
  191. package/src/tool/workflow/todo.ts +62 -0
  192. package/src/tool/workflow/todowrite.txt +167 -0
  193. package/src/tool/write.ts +1 -114
@@ -1,68 +1 @@
1
- /** User/Assistant 스키마 + Events + Cursor — message-v2.ts에서 분리 */
2
-
3
- import { SessionID, MessageID, PartID } from "./schema"
4
- import { Snapshot } from "@/snapshot"
5
- import { SyncEvent } from "../sync"
6
- import { BusEvent } from "@/bus/bus-event"
7
- import { Effect, Schema, Types } from "effect"
8
- import { zod } from "@/util/effect-zod"
9
- import { NonNegativeInt, withStatics } from "@/util/schema"
10
- import { ModelID, ProviderID } from "@/provider/schema"
11
- import { _Part } from "./message-parts"
12
- import { AssistantErrorSchema, AssistantErrorZod, _Format } from "./message-errors"
13
- export { AssistantErrorSchema, AssistantErrorZod, _Format, _Part as Part }
14
- export type { AssistantError } from "./message-errors"
15
- import z from "zod"
16
-
17
- const messageBase = { id: MessageID, sessionID: SessionID }
18
-
19
- export const EditorContext = Schema.Struct({
20
- visibleFiles: Schema.optional(Schema.Array(Schema.String)), openTabs: Schema.optional(Schema.Array(Schema.String)),
21
- activeFile: Schema.optional(Schema.String), shell: Schema.optional(Schema.String),
22
- })
23
- export type EditorContext = Types.DeepMutable<Schema.Schema.Type<typeof EditorContext>>
24
-
25
- export const User = Schema.Struct({
26
- ...messageBase, role: Schema.Literal("user"), time: Schema.Struct({ created: NonNegativeInt }), format: Schema.optional(_Format),
27
- summary: Schema.optional(Schema.Struct({ title: Schema.optional(Schema.String), body: Schema.optional(Schema.String), diffs: Schema.Array(Snapshot.FileDiff) })),
28
- agent: Schema.String, model: Schema.Struct({ providerID: ProviderID, modelID: ModelID, variant: Schema.optional(Schema.String) }),
29
- system: Schema.optional(Schema.String), tools: Schema.optional(Schema.Record(Schema.String, Schema.Boolean)), editorContext: Schema.optional(EditorContext),
30
- }).annotate({ identifier: "UserMessage" }).pipe(withStatics((s) => ({ zod: zod(s) })))
31
- export type User = Types.DeepMutable<Schema.Schema.Type<typeof User>>
32
-
33
- export const Assistant = Schema.Struct({
34
- ...messageBase, role: Schema.Literal("assistant"), time: Schema.Struct({ created: NonNegativeInt, completed: Schema.optional(NonNegativeInt) }),
35
- error: Schema.optional(AssistantErrorSchema), parentID: MessageID, modelID: ModelID, providerID: ProviderID, mode: Schema.String, agent: Schema.String,
36
- path: Schema.Struct({ cwd: Schema.String, root: Schema.String }), summary: Schema.optional(Schema.Boolean), cost: Schema.Finite,
37
- tokens: Schema.Struct({ total: Schema.optional(NonNegativeInt), input: NonNegativeInt, output: NonNegativeInt, reasoning: NonNegativeInt, cache: Schema.Struct({ read: NonNegativeInt, write: NonNegativeInt }) }),
38
- structured: Schema.optional(Schema.Any), variant: Schema.optional(Schema.String), finish: Schema.optional(Schema.String),
39
- }).annotate({ identifier: "AssistantMessage" }).pipe(withStatics((s) => ({ zod: zod(s) })))
40
- export type Assistant = Omit<Types.DeepMutable<Schema.Schema.Type<typeof Assistant>>, "error"> & { error?: import("./message-errors").AssistantError }
41
-
42
- const _Info = Schema.Union([User, Assistant]).annotate({ discriminator: "role", identifier: "Message" })
43
- export const Info = Object.assign(_Info, { zod: zod(_Info) as unknown as z.ZodType<User | Assistant> })
44
- export type Info = User | Assistant
45
-
46
- export const WithParts = Schema.Struct({ info: _Info, parts: Schema.Array(_Part) }).pipe(withStatics((s) => ({ zod: zod(s) })))
47
- export type WithParts = { info: Info; parts: import("./message-parts").Part[] }
48
-
49
- const UpdatedEventSchema = Schema.Struct({ sessionID: SessionID, info: _Info })
50
- const RemovedEventSchema = Schema.Struct({ sessionID: SessionID, messageID: MessageID })
51
- const PartUpdatedEventSchema = Schema.Struct({ sessionID: SessionID, part: _Part, time: NonNegativeInt })
52
- const PartRemovedEventSchema = Schema.Struct({ sessionID: SessionID, messageID: MessageID, partID: PartID })
53
-
54
- export const Event = {
55
- Updated: SyncEvent.define({ type: "message.updated", version: 1, aggregate: "sessionID", schema: UpdatedEventSchema }),
56
- Removed: SyncEvent.define({ type: "message.removed", version: 1, aggregate: "sessionID", schema: RemovedEventSchema }),
57
- PartUpdated: SyncEvent.define({ type: "message.part.updated", version: 1, aggregate: "sessionID", schema: PartUpdatedEventSchema }),
58
- PartDelta: BusEvent.define("message.part.delta", Schema.Struct({ sessionID: SessionID, messageID: MessageID, partID: PartID, field: Schema.String, delta: Schema.String })),
59
- PartRemoved: SyncEvent.define({ type: "message.part.removed", version: 1, aggregate: "sessionID", schema: PartRemovedEventSchema }),
60
- }
61
-
62
- const Cursor = Schema.Struct({ id: MessageID, time: Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0)) })
63
- type Cursor = typeof Cursor.Type
64
- const decodeCursor = Schema.decodeUnknownSync(Cursor)
65
- export const cursor = {
66
- encode(input: Cursor) { return Buffer.from(JSON.stringify(input)).toString("base64url") },
67
- decode(input: string) { return decodeCursor(JSON.parse(Buffer.from(input, "base64url").toString("utf8"))) },
68
- }
1
+ export * from "./message/message-types"
@@ -1,73 +1 @@
1
- export {
2
- OutputLengthError,
3
- AbortedError,
4
- StructuredOutputError,
5
- AuthError,
6
- APIError,
7
- ContextOverflowError,
8
- OutputFormatText,
9
- OutputFormatJsonSchema,
10
- Format,
11
- fromError,
12
- } from "./message-errors"
13
- export type { OutputFormat } from "./message-errors"
14
-
15
- export {
16
- SnapshotPart,
17
- PatchPart,
18
- TextPart,
19
- ReasoningPart,
20
- FileSource,
21
- SymbolSource,
22
- ResourceSource,
23
- FilePartSource,
24
- FilePart,
25
- AgentPart,
26
- CompactionPart,
27
- SubtaskPart,
28
- RetryPart,
29
- StepStartPart,
30
- StepFinishPart,
31
- ToolStatePending,
32
- ToolStateRunning,
33
- ToolStateCompleted,
34
- ToolStateError,
35
- ToolState,
36
- ToolPart,
37
- truncateToolOutput,
38
- TextPartInput,
39
- FilePartInput,
40
- AgentPartInput,
41
- SubtaskPartInput,
42
- Part,
43
- } from "./message-parts"
44
-
45
- export {
46
- EditorContext,
47
- User,
48
- Assistant,
49
- Info,
50
- WithParts,
51
- Event,
52
- cursor,
53
- } from "./message-types"
54
-
55
- export {
56
- SYNTHETIC_ATTACHMENT_PROMPT,
57
- isMedia,
58
- stripPartMetadata,
59
- stripMessageMetadata,
60
- toModelMessagesEffect,
61
- toModelMessages,
62
- } from "./message-transform"
63
-
64
- export {
65
- page,
66
- stream,
67
- parts,
68
- get,
69
- filterCompacted,
70
- filterCompactedEffect,
71
- } from "./message-query"
72
-
73
- export * as MessageV2 from "./message-v2"
1
+ export * from "./message/message-v2"
@@ -1,192 +1 @@
1
- import { Schema } from "effect"
2
- import { SessionID } from "./schema"
3
- import { ModelID, ProviderID } from "../provider/schema"
4
- import { zod } from "@/util/effect-zod"
5
- import { NonNegativeInt, withStatics } from "@/util/schema"
6
- import { namedSchemaError } from "@/util/named-schema-error"
7
-
8
- export const OutputLengthError = namedSchemaError("MessageOutputLengthError", {})
9
- export const AuthError = namedSchemaError("ProviderAuthError", {
10
- providerID: Schema.String,
11
- message: Schema.String,
12
- })
13
-
14
- const AuthErrorEffect = Schema.Struct({
15
- name: Schema.Literal("ProviderAuthError"),
16
- data: Schema.Struct({
17
- providerID: Schema.String,
18
- message: Schema.String,
19
- }),
20
- })
21
-
22
- const OutputLengthErrorEffect = Schema.Struct({
23
- name: Schema.Literal("MessageOutputLengthError"),
24
- data: Schema.Struct({}),
25
- })
26
-
27
- const UnknownErrorEffect = Schema.Struct({
28
- name: Schema.Literal("UnknownError"),
29
- data: Schema.Struct({
30
- message: Schema.String,
31
- }),
32
- })
33
-
34
- export const ToolCall = Schema.Struct({
35
- state: Schema.Literal("call"),
36
- step: Schema.optional(NonNegativeInt),
37
- toolCallId: Schema.String,
38
- toolName: Schema.String,
39
- args: Schema.Unknown,
40
- })
41
- .annotate({ identifier: "ToolCall" })
42
- .pipe(withStatics((s) => ({ zod: zod(s) })))
43
- export type ToolCall = Schema.Schema.Type<typeof ToolCall>
44
-
45
- export const ToolPartialCall = Schema.Struct({
46
- state: Schema.Literal("partial-call"),
47
- step: Schema.optional(NonNegativeInt),
48
- toolCallId: Schema.String,
49
- toolName: Schema.String,
50
- args: Schema.Unknown,
51
- })
52
- .annotate({ identifier: "ToolPartialCall" })
53
- .pipe(withStatics((s) => ({ zod: zod(s) })))
54
- export type ToolPartialCall = Schema.Schema.Type<typeof ToolPartialCall>
55
-
56
- export const ToolResult = Schema.Struct({
57
- state: Schema.Literal("result"),
58
- step: Schema.optional(NonNegativeInt),
59
- toolCallId: Schema.String,
60
- toolName: Schema.String,
61
- args: Schema.Unknown,
62
- result: Schema.String,
63
- })
64
- .annotate({ identifier: "ToolResult" })
65
- .pipe(withStatics((s) => ({ zod: zod(s) })))
66
- export type ToolResult = Schema.Schema.Type<typeof ToolResult>
67
-
68
- export const ToolInvocation = Schema.Union([ToolCall, ToolPartialCall, ToolResult])
69
- .annotate({ identifier: "ToolInvocation", discriminator: "state" })
70
- .pipe(withStatics((s) => ({ zod: zod(s) })))
71
- export type ToolInvocation = Schema.Schema.Type<typeof ToolInvocation>
72
-
73
- export const TextPart = Schema.Struct({
74
- type: Schema.Literal("text"),
75
- text: Schema.String,
76
- })
77
- .annotate({ identifier: "TextPart" })
78
- .pipe(withStatics((s) => ({ zod: zod(s) })))
79
- export type TextPart = Schema.Schema.Type<typeof TextPart>
80
-
81
- export const ReasoningPart = Schema.Struct({
82
- type: Schema.Literal("reasoning"),
83
- text: Schema.String,
84
- providerMetadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
85
- })
86
- .annotate({ identifier: "ReasoningPart" })
87
- .pipe(withStatics((s) => ({ zod: zod(s) })))
88
- export type ReasoningPart = Schema.Schema.Type<typeof ReasoningPart>
89
-
90
- export const ToolInvocationPart = Schema.Struct({
91
- type: Schema.Literal("tool-invocation"),
92
- toolInvocation: ToolInvocation,
93
- })
94
- .annotate({ identifier: "ToolInvocationPart" })
95
- .pipe(withStatics((s) => ({ zod: zod(s) })))
96
- export type ToolInvocationPart = Schema.Schema.Type<typeof ToolInvocationPart>
97
-
98
- export const SourceUrlPart = Schema.Struct({
99
- type: Schema.Literal("source-url"),
100
- sourceId: Schema.String,
101
- url: Schema.String,
102
- title: Schema.optional(Schema.String),
103
- providerMetadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
104
- })
105
- .annotate({ identifier: "SourceUrlPart" })
106
- .pipe(withStatics((s) => ({ zod: zod(s) })))
107
- export type SourceUrlPart = Schema.Schema.Type<typeof SourceUrlPart>
108
-
109
- export const FilePart = Schema.Struct({
110
- type: Schema.Literal("file"),
111
- mediaType: Schema.String,
112
- filename: Schema.optional(Schema.String),
113
- url: Schema.String,
114
- })
115
- .annotate({ identifier: "FilePart" })
116
- .pipe(withStatics((s) => ({ zod: zod(s) })))
117
- export type FilePart = Schema.Schema.Type<typeof FilePart>
118
-
119
- export const StepStartPart = Schema.Struct({
120
- type: Schema.Literal("step-start"),
121
- })
122
- .annotate({ identifier: "StepStartPart" })
123
- .pipe(withStatics((s) => ({ zod: zod(s) })))
124
- export type StepStartPart = Schema.Schema.Type<typeof StepStartPart>
125
-
126
- export const MessagePart = Schema.Union([
127
- TextPart,
128
- ReasoningPart,
129
- ToolInvocationPart,
130
- SourceUrlPart,
131
- FilePart,
132
- StepStartPart,
133
- ])
134
- .annotate({ identifier: "MessagePart", discriminator: "type" })
135
- .pipe(withStatics((s) => ({ zod: zod(s) })))
136
- export type MessagePart = Schema.Schema.Type<typeof MessagePart>
137
-
138
- export const Info = Schema.Struct({
139
- id: Schema.String,
140
- role: Schema.Literals(["user", "assistant"]),
141
- parts: Schema.Array(MessagePart),
142
- metadata: Schema.Struct({
143
- time: Schema.Struct({
144
- created: NonNegativeInt,
145
- completed: Schema.optional(NonNegativeInt),
146
- }),
147
- error: Schema.optional(Schema.Union([AuthErrorEffect, UnknownErrorEffect, OutputLengthErrorEffect])),
148
- sessionID: SessionID,
149
- tool: Schema.Record(
150
- Schema.String,
151
- Schema.StructWithRest(
152
- Schema.Struct({
153
- title: Schema.String,
154
- snapshot: Schema.optional(Schema.String),
155
- time: Schema.Struct({
156
- start: NonNegativeInt,
157
- end: NonNegativeInt,
158
- }),
159
- }),
160
- [Schema.Record(Schema.String, Schema.Unknown)],
161
- ),
162
- ),
163
- assistant: Schema.optional(
164
- Schema.Struct({
165
- system: Schema.Array(Schema.String),
166
- modelID: ModelID,
167
- providerID: ProviderID,
168
- path: Schema.Struct({
169
- cwd: Schema.String,
170
- root: Schema.String,
171
- }),
172
- cost: Schema.Finite,
173
- summary: Schema.optional(Schema.Boolean),
174
- tokens: Schema.Struct({
175
- input: NonNegativeInt,
176
- output: NonNegativeInt,
177
- reasoning: NonNegativeInt,
178
- cache: Schema.Struct({
179
- read: NonNegativeInt,
180
- write: NonNegativeInt,
181
- }),
182
- }),
183
- }),
184
- ),
185
- snapshot: Schema.optional(Schema.String),
186
- }).annotate({ identifier: "MessageMetadata" }),
187
- })
188
- .annotate({ identifier: "Message" })
189
- .pipe(withStatics((s) => ({ zod: zod(s) })))
190
- export type Info = Schema.Schema.Type<typeof Info>
191
-
192
- export * as Message from "./message"
1
+ export * from "./message/message"