@townco/ui 0.1.17 → 0.1.18

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 (207) hide show
  1. package/dist/core/hooks/use-chat-input.d.ts +17 -17
  2. package/dist/core/hooks/use-chat-input.js +55 -64
  3. package/dist/core/hooks/use-chat-messages.js +114 -121
  4. package/dist/core/hooks/use-chat-session.d.ts +1 -1
  5. package/dist/core/hooks/use-chat-session.js +80 -78
  6. package/dist/gui/components/Button.d.ts +7 -23
  7. package/dist/gui/components/Button.js +27 -40
  8. package/dist/gui/components/Card.d.ts +7 -26
  9. package/dist/gui/components/Card.js +8 -54
  10. package/dist/gui/components/ChatSecondaryPanel.d.ts +25 -14
  11. package/dist/gui/components/ChatSecondaryPanel.js +60 -115
  12. package/dist/gui/components/ChatStatus.d.ts +2 -4
  13. package/dist/gui/components/ChatStatus.js +34 -45
  14. package/dist/gui/components/Conversation.d.ts +14 -17
  15. package/dist/gui/components/Conversation.js +83 -143
  16. package/dist/gui/components/Dialog.d.ts +11 -57
  17. package/dist/gui/components/HeightTransition.d.ts +7 -12
  18. package/dist/gui/components/HeightTransition.js +77 -88
  19. package/dist/gui/components/Input.d.ts +6 -13
  20. package/dist/gui/components/Input.js +16 -27
  21. package/dist/gui/components/Label.d.ts +1 -7
  22. package/dist/gui/components/MarkdownRenderer.d.ts +4 -6
  23. package/dist/gui/components/MarkdownRenderer.js +81 -178
  24. package/dist/gui/components/MessageContent.d.ts +22 -29
  25. package/dist/gui/components/PanelTabsHeader.d.ts +17 -0
  26. package/dist/gui/components/PanelTabsHeader.js +31 -0
  27. package/dist/gui/components/Reasoning.d.ts +24 -30
  28. package/dist/gui/components/Reasoning.js +60 -187
  29. package/dist/gui/components/Response.d.ts +9 -11
  30. package/dist/gui/components/Response.js +90 -229
  31. package/dist/gui/components/Select.d.ts +10 -69
  32. package/dist/gui/components/Tabs.d.ts +4 -24
  33. package/dist/gui/components/Task.d.ts +24 -28
  34. package/dist/gui/components/Task.js +31 -164
  35. package/dist/gui/components/Textarea.d.ts +7 -15
  36. package/dist/gui/components/Textarea.js +46 -63
  37. package/dist/gui/components/ThinkingBlock.d.ts +10 -20
  38. package/dist/gui/components/ThinkingBlock.js +35 -134
  39. package/dist/gui/components/TodoList.d.ts +10 -12
  40. package/dist/gui/components/TodoList.js +7 -22
  41. package/dist/gui/components/TodoListItem.d.ts +6 -9
  42. package/dist/gui/components/TodoListItem.js +4 -18
  43. package/dist/gui/components/index.d.ts +1 -0
  44. package/dist/gui/components/index.js +1 -0
  45. package/dist/gui/lib/utils.js +1 -1
  46. package/dist/index.test.js +1 -0
  47. package/dist/sdk/client/acp-client.d.ts +76 -88
  48. package/dist/sdk/client/acp-client.js +217 -215
  49. package/dist/sdk/schemas/agent.d.ts +64 -111
  50. package/dist/sdk/schemas/agent.js +24 -24
  51. package/dist/sdk/schemas/message.d.ts +147 -245
  52. package/dist/sdk/schemas/message.js +40 -40
  53. package/dist/sdk/schemas/session.d.ts +6 -6
  54. package/dist/sdk/transports/http.d.ts +55 -55
  55. package/dist/sdk/transports/stdio.d.ts +20 -20
  56. package/dist/sdk/transports/types.d.ts +42 -42
  57. package/dist/sdk/transports/websocket.d.ts +12 -12
  58. package/dist/sdk/transports/websocket.js +46 -52
  59. package/dist/tui/components/ChatView.d.ts +2 -4
  60. package/dist/tui/components/GameOfLife.js +35 -64
  61. package/dist/tui/components/InputBox.d.ts +11 -18
  62. package/dist/tui/components/InputBox.js +10 -70
  63. package/dist/tui/components/ReadlineInput.d.ts +6 -12
  64. package/dist/tui/components/ReadlineInput.js +237 -252
  65. package/dist/tui/components/SingleSelect.d.ts +9 -15
  66. package/dist/tui/components/SingleSelect.js +43 -84
  67. package/dist/tui/components/StatusBar.d.ts +6 -11
  68. package/dist/tui/components/StatusBar.js +67 -102
  69. package/package.json +2 -2
  70. package/dist/core/hooks/index.d.ts.map +0 -1
  71. package/dist/core/hooks/index.js.map +0 -1
  72. package/dist/core/hooks/use-chat-input.d.ts.map +0 -1
  73. package/dist/core/hooks/use-chat-input.js.map +0 -1
  74. package/dist/core/hooks/use-chat-messages.d.ts.map +0 -1
  75. package/dist/core/hooks/use-chat-messages.js.map +0 -1
  76. package/dist/core/hooks/use-chat-session.d.ts.map +0 -1
  77. package/dist/core/hooks/use-chat-session.js.map +0 -1
  78. package/dist/core/index.d.ts.map +0 -1
  79. package/dist/core/index.js.map +0 -1
  80. package/dist/core/schemas/chat.d.ts.map +0 -1
  81. package/dist/core/schemas/chat.js.map +0 -1
  82. package/dist/core/schemas/index.d.ts.map +0 -1
  83. package/dist/core/schemas/index.js.map +0 -1
  84. package/dist/core/store/chat-store.d.ts.map +0 -1
  85. package/dist/core/store/chat-store.js.map +0 -1
  86. package/dist/gui/components/Button.d.ts.map +0 -1
  87. package/dist/gui/components/Button.js.map +0 -1
  88. package/dist/gui/components/Card.d.ts.map +0 -1
  89. package/dist/gui/components/Card.js.map +0 -1
  90. package/dist/gui/components/ChatInput.d.ts.map +0 -1
  91. package/dist/gui/components/ChatInput.js.map +0 -1
  92. package/dist/gui/components/ChatInterface.d.ts +0 -12
  93. package/dist/gui/components/ChatInterface.d.ts.map +0 -1
  94. package/dist/gui/components/ChatInterface.js +0 -204
  95. package/dist/gui/components/ChatInterface.js.map +0 -1
  96. package/dist/gui/components/ChatPreview.d.ts +0 -12
  97. package/dist/gui/components/ChatPreview.d.ts.map +0 -1
  98. package/dist/gui/components/ChatPreview.js +0 -214
  99. package/dist/gui/components/ChatPreview.js.map +0 -1
  100. package/dist/gui/components/ChatSecondaryPanel.d.ts.map +0 -1
  101. package/dist/gui/components/ChatSecondaryPanel.js.map +0 -1
  102. package/dist/gui/components/ChatStatus.d.ts.map +0 -1
  103. package/dist/gui/components/ChatStatus.js.map +0 -1
  104. package/dist/gui/components/ChatView.d.ts +0 -8
  105. package/dist/gui/components/ChatView.d.ts.map +0 -1
  106. package/dist/gui/components/ChatView.js +0 -42
  107. package/dist/gui/components/ChatView.js.map +0 -1
  108. package/dist/gui/components/ConfigPanel.d.ts +0 -20
  109. package/dist/gui/components/ConfigPanel.d.ts.map +0 -1
  110. package/dist/gui/components/ConfigPanel.js +0 -225
  111. package/dist/gui/components/ConfigPanel.js.map +0 -1
  112. package/dist/gui/components/Conversation.d.ts.map +0 -1
  113. package/dist/gui/components/Conversation.js.map +0 -1
  114. package/dist/gui/components/Dialog.d.ts.map +0 -1
  115. package/dist/gui/components/Dialog.js.map +0 -1
  116. package/dist/gui/components/HeightTransition.d.ts.map +0 -1
  117. package/dist/gui/components/HeightTransition.js.map +0 -1
  118. package/dist/gui/components/Input.d.ts.map +0 -1
  119. package/dist/gui/components/Input.js.map +0 -1
  120. package/dist/gui/components/InputBox.d.ts +0 -21
  121. package/dist/gui/components/InputBox.d.ts.map +0 -1
  122. package/dist/gui/components/InputBox.js +0 -90
  123. package/dist/gui/components/InputBox.js.map +0 -1
  124. package/dist/gui/components/Label.d.ts.map +0 -1
  125. package/dist/gui/components/Label.js.map +0 -1
  126. package/dist/gui/components/MarkdownRenderer.d.ts.map +0 -1
  127. package/dist/gui/components/MarkdownRenderer.js.map +0 -1
  128. package/dist/gui/components/Message.d.ts.map +0 -1
  129. package/dist/gui/components/Message.js.map +0 -1
  130. package/dist/gui/components/MessageContent.d.ts.map +0 -1
  131. package/dist/gui/components/MessageContent.js.map +0 -1
  132. package/dist/gui/components/MessageList.d.ts.map +0 -1
  133. package/dist/gui/components/MessageList.js.map +0 -1
  134. package/dist/gui/components/PlaygroundLayout.d.ts +0 -14
  135. package/dist/gui/components/PlaygroundLayout.d.ts.map +0 -1
  136. package/dist/gui/components/PlaygroundLayout.js +0 -49
  137. package/dist/gui/components/PlaygroundLayout.js.map +0 -1
  138. package/dist/gui/components/Reasoning.d.ts.map +0 -1
  139. package/dist/gui/components/Reasoning.js.map +0 -1
  140. package/dist/gui/components/Response.d.ts.map +0 -1
  141. package/dist/gui/components/Response.js.map +0 -1
  142. package/dist/gui/components/Select.d.ts.map +0 -1
  143. package/dist/gui/components/Select.js.map +0 -1
  144. package/dist/gui/components/StatusBar.d.ts +0 -12
  145. package/dist/gui/components/StatusBar.d.ts.map +0 -1
  146. package/dist/gui/components/StatusBar.js +0 -58
  147. package/dist/gui/components/StatusBar.js.map +0 -1
  148. package/dist/gui/components/Tabs.d.ts.map +0 -1
  149. package/dist/gui/components/Tabs.js.map +0 -1
  150. package/dist/gui/components/Task.d.ts.map +0 -1
  151. package/dist/gui/components/Task.js.map +0 -1
  152. package/dist/gui/components/Textarea.d.ts.map +0 -1
  153. package/dist/gui/components/Textarea.js.map +0 -1
  154. package/dist/gui/components/ThinkingBlock.d.ts.map +0 -1
  155. package/dist/gui/components/ThinkingBlock.js.map +0 -1
  156. package/dist/gui/components/TodoList.d.ts.map +0 -1
  157. package/dist/gui/components/TodoList.js.map +0 -1
  158. package/dist/gui/components/TodoListItem.d.ts.map +0 -1
  159. package/dist/gui/components/TodoListItem.js.map +0 -1
  160. package/dist/gui/components/index.d.ts.map +0 -1
  161. package/dist/gui/components/index.js.map +0 -1
  162. package/dist/gui/index.d.ts.map +0 -1
  163. package/dist/gui/index.js.map +0 -1
  164. package/dist/gui/lib/utils.d.ts.map +0 -1
  165. package/dist/gui/lib/utils.js.map +0 -1
  166. package/dist/index.d.ts.map +0 -1
  167. package/dist/index.js.map +0 -1
  168. package/dist/sdk/client/acp-client.d.ts.map +0 -1
  169. package/dist/sdk/client/acp-client.js.map +0 -1
  170. package/dist/sdk/client/index.d.ts.map +0 -1
  171. package/dist/sdk/client/index.js.map +0 -1
  172. package/dist/sdk/index.d.ts.map +0 -1
  173. package/dist/sdk/index.js.map +0 -1
  174. package/dist/sdk/schemas/agent.d.ts.map +0 -1
  175. package/dist/sdk/schemas/agent.js.map +0 -1
  176. package/dist/sdk/schemas/index.d.ts.map +0 -1
  177. package/dist/sdk/schemas/index.js.map +0 -1
  178. package/dist/sdk/schemas/message.d.ts.map +0 -1
  179. package/dist/sdk/schemas/message.js.map +0 -1
  180. package/dist/sdk/schemas/session.d.ts.map +0 -1
  181. package/dist/sdk/schemas/session.js.map +0 -1
  182. package/dist/sdk/transports/http.d.ts.map +0 -1
  183. package/dist/sdk/transports/http.js.map +0 -1
  184. package/dist/sdk/transports/index.d.ts.map +0 -1
  185. package/dist/sdk/transports/index.js.map +0 -1
  186. package/dist/sdk/transports/stdio.d.ts.map +0 -1
  187. package/dist/sdk/transports/stdio.js.map +0 -1
  188. package/dist/sdk/transports/types.d.ts.map +0 -1
  189. package/dist/sdk/transports/types.js.map +0 -1
  190. package/dist/sdk/transports/websocket.d.ts.map +0 -1
  191. package/dist/sdk/transports/websocket.js.map +0 -1
  192. package/dist/tui/components/ChatView.d.ts.map +0 -1
  193. package/dist/tui/components/ChatView.js.map +0 -1
  194. package/dist/tui/components/GameOfLife.d.ts.map +0 -1
  195. package/dist/tui/components/GameOfLife.js.map +0 -1
  196. package/dist/tui/components/InputBox.d.ts.map +0 -1
  197. package/dist/tui/components/InputBox.js.map +0 -1
  198. package/dist/tui/components/MessageList.d.ts.map +0 -1
  199. package/dist/tui/components/MessageList.js.map +0 -1
  200. package/dist/tui/components/ReadlineInput.d.ts.map +0 -1
  201. package/dist/tui/components/ReadlineInput.js.map +0 -1
  202. package/dist/tui/components/StatusBar.d.ts.map +0 -1
  203. package/dist/tui/components/StatusBar.js.map +0 -1
  204. package/dist/tui/components/index.d.ts.map +0 -1
  205. package/dist/tui/components/index.js.map +0 -1
  206. package/dist/tui/index.d.ts.map +0 -1
  207. package/dist/tui/index.js.map +0 -1
@@ -3,48 +3,48 @@ import { z } from "zod";
3
3
  * Agent capability schema
4
4
  */
5
5
  export const AgentCapability = z.object({
6
- name: z.string(),
7
- description: z.string().optional(),
8
- parameters: z.record(z.string(), z.unknown()).optional(),
6
+ name: z.string(),
7
+ description: z.string().optional(),
8
+ parameters: z.record(z.string(), z.unknown()).optional(),
9
9
  });
10
10
  /**
11
11
  * Agent tool schema
12
12
  */
13
13
  export const AgentTool = z.object({
14
- name: z.string(),
15
- description: z.string(),
16
- parameters: z.record(z.string(), z.unknown()),
17
- required: z.array(z.string()).optional(),
14
+ name: z.string(),
15
+ description: z.string(),
16
+ parameters: z.record(z.string(), z.unknown()),
17
+ required: z.array(z.string()).optional(),
18
18
  });
19
19
  /**
20
20
  * Agent information schema
21
21
  */
22
22
  export const AgentInfo = z.object({
23
- name: z.string(),
24
- version: z.string().optional(),
25
- description: z.string().optional(),
26
- author: z.string().optional(),
27
- capabilities: z.array(AgentCapability).optional(),
28
- tools: z.array(AgentTool).optional(),
29
- supportedFormats: z.array(z.string()).optional(),
23
+ name: z.string(),
24
+ version: z.string().optional(),
25
+ description: z.string().optional(),
26
+ author: z.string().optional(),
27
+ capabilities: z.array(AgentCapability).optional(),
28
+ tools: z.array(AgentTool).optional(),
29
+ supportedFormats: z.array(z.string()).optional(),
30
30
  });
31
31
  /**
32
32
  * Agent status schema
33
33
  */
34
34
  export const AgentStatus = z.enum([
35
- "initializing",
36
- "ready",
37
- "busy",
38
- "error",
39
- "terminated",
35
+ "initializing",
36
+ "ready",
37
+ "busy",
38
+ "error",
39
+ "terminated",
40
40
  ]);
41
41
  /**
42
42
  * Agent state schema
43
43
  */
44
44
  export const AgentState = z.object({
45
- status: AgentStatus,
46
- info: AgentInfo.optional(),
47
- pid: z.number().optional(),
48
- error: z.string().optional(),
49
- uptime: z.number().optional(),
45
+ status: AgentStatus,
46
+ info: AgentInfo.optional(),
47
+ pid: z.number().optional(),
48
+ error: z.string().optional(),
49
+ uptime: z.number().optional(),
50
50
  });
@@ -3,291 +3,193 @@ import { z } from "zod";
3
3
  * Message role types
4
4
  */
5
5
  export declare const MessageRole: z.ZodEnum<{
6
- user: "user";
7
- assistant: "assistant";
8
- system: "system";
9
- tool: "tool";
6
+ user: "user";
7
+ assistant: "assistant";
8
+ system: "system";
9
+ tool: "tool";
10
10
  }>;
11
11
  export type MessageRole = z.infer<typeof MessageRole>;
12
12
  /**
13
13
  * Content type for messages
14
14
  */
15
15
  export declare const ContentType: z.ZodEnum<{
16
- text: "text";
17
- image: "image";
18
- file: "file";
19
- tool_call: "tool_call";
20
- tool_result: "tool_result";
16
+ file: "file";
17
+ text: "text";
18
+ image: "image";
19
+ tool_call: "tool_call";
20
+ tool_result: "tool_result";
21
21
  }>;
22
22
  export type ContentType = z.infer<typeof ContentType>;
23
23
  /**
24
24
  * Base content schema
25
25
  */
26
- export declare const BaseContent: z.ZodObject<
27
- {
28
- type: z.ZodEnum<{
29
- text: "text";
30
- image: "image";
31
- file: "file";
32
- tool_call: "tool_call";
33
- tool_result: "tool_result";
34
- }>;
35
- },
36
- z.core.$strip
37
- >;
26
+ export declare const BaseContent: z.ZodObject<{
27
+ type: z.ZodEnum<{
28
+ file: "file";
29
+ text: "text";
30
+ image: "image";
31
+ tool_call: "tool_call";
32
+ tool_result: "tool_result";
33
+ }>;
34
+ }, z.core.$strip>;
38
35
  /**
39
36
  * Text content
40
37
  */
41
- export declare const TextContent: z.ZodObject<
42
- {
43
- type: z.ZodLiteral<"text">;
44
- text: z.ZodString;
45
- },
46
- z.core.$strip
47
- >;
38
+ export declare const TextContent: z.ZodObject<{
39
+ type: z.ZodLiteral<"text">;
40
+ text: z.ZodString;
41
+ }, z.core.$strip>;
48
42
  export type TextContent = z.infer<typeof TextContent>;
49
43
  /**
50
44
  * Image content
51
45
  */
52
- export declare const ImageContent: z.ZodObject<
53
- {
54
- type: z.ZodLiteral<"image">;
55
- url: z.ZodOptional<z.ZodString>;
56
- data: z.ZodOptional<z.ZodString>;
57
- mimeType: z.ZodOptional<z.ZodString>;
58
- },
59
- z.core.$strip
60
- >;
46
+ export declare const ImageContent: z.ZodObject<{
47
+ type: z.ZodLiteral<"image">;
48
+ url: z.ZodOptional<z.ZodString>;
49
+ data: z.ZodOptional<z.ZodString>;
50
+ mimeType: z.ZodOptional<z.ZodString>;
51
+ }, z.core.$strip>;
61
52
  export type ImageContent = z.infer<typeof ImageContent>;
62
53
  /**
63
54
  * File attachment content
64
55
  */
65
- export declare const FileContent: z.ZodObject<
66
- {
67
- type: z.ZodLiteral<"file">;
68
- name: z.ZodString;
69
- path: z.ZodOptional<z.ZodString>;
70
- url: z.ZodOptional<z.ZodString>;
71
- mimeType: z.ZodString;
72
- size: z.ZodOptional<z.ZodNumber>;
73
- },
74
- z.core.$strip
75
- >;
56
+ export declare const FileContent: z.ZodObject<{
57
+ type: z.ZodLiteral<"file">;
58
+ name: z.ZodString;
59
+ path: z.ZodOptional<z.ZodString>;
60
+ url: z.ZodOptional<z.ZodString>;
61
+ mimeType: z.ZodString;
62
+ size: z.ZodOptional<z.ZodNumber>;
63
+ }, z.core.$strip>;
76
64
  export type FileContent = z.infer<typeof FileContent>;
77
65
  /**
78
66
  * Tool call content
79
67
  */
80
- export declare const ToolCallContent: z.ZodObject<
81
- {
82
- type: z.ZodLiteral<"tool_call">;
83
- id: z.ZodString;
84
- name: z.ZodString;
85
- arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
86
- },
87
- z.core.$strip
88
- >;
68
+ export declare const ToolCallContent: z.ZodObject<{
69
+ type: z.ZodLiteral<"tool_call">;
70
+ id: z.ZodString;
71
+ name: z.ZodString;
72
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
73
+ }, z.core.$strip>;
89
74
  export type ToolCallContent = z.infer<typeof ToolCallContent>;
90
75
  /**
91
76
  * Tool result content
92
77
  */
93
- export declare const ToolResultContent: z.ZodObject<
94
- {
95
- type: z.ZodLiteral<"tool_result">;
96
- callId: z.ZodString;
97
- result: z.ZodUnknown;
98
- error: z.ZodOptional<z.ZodString>;
99
- },
100
- z.core.$strip
101
- >;
78
+ export declare const ToolResultContent: z.ZodObject<{
79
+ type: z.ZodLiteral<"tool_result">;
80
+ callId: z.ZodString;
81
+ result: z.ZodUnknown;
82
+ error: z.ZodOptional<z.ZodString>;
83
+ }, z.core.$strip>;
102
84
  export type ToolResultContent = z.infer<typeof ToolResultContent>;
103
85
  /**
104
86
  * Union of all content types
105
87
  */
106
- export declare const Content: z.ZodDiscriminatedUnion<
107
- [
108
- z.ZodObject<
109
- {
110
- type: z.ZodLiteral<"text">;
111
- text: z.ZodString;
112
- },
113
- z.core.$strip
114
- >,
115
- z.ZodObject<
116
- {
117
- type: z.ZodLiteral<"image">;
118
- url: z.ZodOptional<z.ZodString>;
119
- data: z.ZodOptional<z.ZodString>;
120
- mimeType: z.ZodOptional<z.ZodString>;
121
- },
122
- z.core.$strip
123
- >,
124
- z.ZodObject<
125
- {
126
- type: z.ZodLiteral<"file">;
127
- name: z.ZodString;
128
- path: z.ZodOptional<z.ZodString>;
129
- url: z.ZodOptional<z.ZodString>;
130
- mimeType: z.ZodString;
131
- size: z.ZodOptional<z.ZodNumber>;
132
- },
133
- z.core.$strip
134
- >,
135
- z.ZodObject<
136
- {
137
- type: z.ZodLiteral<"tool_call">;
138
- id: z.ZodString;
139
- name: z.ZodString;
140
- arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
141
- },
142
- z.core.$strip
143
- >,
144
- z.ZodObject<
145
- {
146
- type: z.ZodLiteral<"tool_result">;
147
- callId: z.ZodString;
148
- result: z.ZodUnknown;
149
- error: z.ZodOptional<z.ZodString>;
150
- },
151
- z.core.$strip
152
- >,
153
- ],
154
- "type"
155
- >;
88
+ export declare const Content: z.ZodDiscriminatedUnion<[z.ZodObject<{
89
+ type: z.ZodLiteral<"text">;
90
+ text: z.ZodString;
91
+ }, z.core.$strip>, z.ZodObject<{
92
+ type: z.ZodLiteral<"image">;
93
+ url: z.ZodOptional<z.ZodString>;
94
+ data: z.ZodOptional<z.ZodString>;
95
+ mimeType: z.ZodOptional<z.ZodString>;
96
+ }, z.core.$strip>, z.ZodObject<{
97
+ type: z.ZodLiteral<"file">;
98
+ name: z.ZodString;
99
+ path: z.ZodOptional<z.ZodString>;
100
+ url: z.ZodOptional<z.ZodString>;
101
+ mimeType: z.ZodString;
102
+ size: z.ZodOptional<z.ZodNumber>;
103
+ }, z.core.$strip>, z.ZodObject<{
104
+ type: z.ZodLiteral<"tool_call">;
105
+ id: z.ZodString;
106
+ name: z.ZodString;
107
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
108
+ }, z.core.$strip>, z.ZodObject<{
109
+ type: z.ZodLiteral<"tool_result">;
110
+ callId: z.ZodString;
111
+ result: z.ZodUnknown;
112
+ error: z.ZodOptional<z.ZodString>;
113
+ }, z.core.$strip>], "type">;
156
114
  export type Content = z.infer<typeof Content>;
157
115
  /**
158
116
  * Message schema
159
117
  */
160
- export declare const Message: z.ZodObject<
161
- {
162
- id: z.ZodString;
163
- role: z.ZodEnum<{
164
- user: "user";
165
- assistant: "assistant";
166
- system: "system";
167
- tool: "tool";
168
- }>;
169
- content: z.ZodArray<
170
- z.ZodDiscriminatedUnion<
171
- [
172
- z.ZodObject<
173
- {
174
- type: z.ZodLiteral<"text">;
175
- text: z.ZodString;
176
- },
177
- z.core.$strip
178
- >,
179
- z.ZodObject<
180
- {
181
- type: z.ZodLiteral<"image">;
182
- url: z.ZodOptional<z.ZodString>;
183
- data: z.ZodOptional<z.ZodString>;
184
- mimeType: z.ZodOptional<z.ZodString>;
185
- },
186
- z.core.$strip
187
- >,
188
- z.ZodObject<
189
- {
190
- type: z.ZodLiteral<"file">;
191
- name: z.ZodString;
192
- path: z.ZodOptional<z.ZodString>;
193
- url: z.ZodOptional<z.ZodString>;
194
- mimeType: z.ZodString;
195
- size: z.ZodOptional<z.ZodNumber>;
196
- },
197
- z.core.$strip
198
- >,
199
- z.ZodObject<
200
- {
201
- type: z.ZodLiteral<"tool_call">;
202
- id: z.ZodString;
203
- name: z.ZodString;
204
- arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
205
- },
206
- z.core.$strip
207
- >,
208
- z.ZodObject<
209
- {
210
- type: z.ZodLiteral<"tool_result">;
211
- callId: z.ZodString;
212
- result: z.ZodUnknown;
213
- error: z.ZodOptional<z.ZodString>;
214
- },
215
- z.core.$strip
216
- >,
217
- ],
218
- "type"
219
- >
220
- >;
221
- timestamp: z.ZodISODateTime;
222
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
223
- },
224
- z.core.$strip
225
- >;
118
+ export declare const Message: z.ZodObject<{
119
+ id: z.ZodString;
120
+ role: z.ZodEnum<{
121
+ user: "user";
122
+ assistant: "assistant";
123
+ system: "system";
124
+ tool: "tool";
125
+ }>;
126
+ content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
127
+ type: z.ZodLiteral<"text">;
128
+ text: z.ZodString;
129
+ }, z.core.$strip>, z.ZodObject<{
130
+ type: z.ZodLiteral<"image">;
131
+ url: z.ZodOptional<z.ZodString>;
132
+ data: z.ZodOptional<z.ZodString>;
133
+ mimeType: z.ZodOptional<z.ZodString>;
134
+ }, z.core.$strip>, z.ZodObject<{
135
+ type: z.ZodLiteral<"file">;
136
+ name: z.ZodString;
137
+ path: z.ZodOptional<z.ZodString>;
138
+ url: z.ZodOptional<z.ZodString>;
139
+ mimeType: z.ZodString;
140
+ size: z.ZodOptional<z.ZodNumber>;
141
+ }, z.core.$strip>, z.ZodObject<{
142
+ type: z.ZodLiteral<"tool_call">;
143
+ id: z.ZodString;
144
+ name: z.ZodString;
145
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
146
+ }, z.core.$strip>, z.ZodObject<{
147
+ type: z.ZodLiteral<"tool_result">;
148
+ callId: z.ZodString;
149
+ result: z.ZodUnknown;
150
+ error: z.ZodOptional<z.ZodString>;
151
+ }, z.core.$strip>], "type">>;
152
+ timestamp: z.ZodISODateTime;
153
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
154
+ }, z.core.$strip>;
226
155
  export type Message = z.infer<typeof Message>;
227
156
  /**
228
157
  * Streaming message chunk
229
158
  */
230
- export declare const MessageChunk: z.ZodObject<
231
- {
232
- id: z.ZodString;
233
- role: z.ZodEnum<{
234
- user: "user";
235
- assistant: "assistant";
236
- system: "system";
237
- tool: "tool";
238
- }>;
239
- contentDelta: z.ZodDiscriminatedUnion<
240
- [
241
- z.ZodObject<
242
- {
243
- type: z.ZodLiteral<"text">;
244
- text: z.ZodString;
245
- },
246
- z.core.$strip
247
- >,
248
- z.ZodObject<
249
- {
250
- type: z.ZodLiteral<"image">;
251
- url: z.ZodOptional<z.ZodString>;
252
- data: z.ZodOptional<z.ZodString>;
253
- mimeType: z.ZodOptional<z.ZodString>;
254
- },
255
- z.core.$strip
256
- >,
257
- z.ZodObject<
258
- {
259
- type: z.ZodLiteral<"file">;
260
- name: z.ZodString;
261
- path: z.ZodOptional<z.ZodString>;
262
- url: z.ZodOptional<z.ZodString>;
263
- mimeType: z.ZodString;
264
- size: z.ZodOptional<z.ZodNumber>;
265
- },
266
- z.core.$strip
267
- >,
268
- z.ZodObject<
269
- {
270
- type: z.ZodLiteral<"tool_call">;
271
- id: z.ZodString;
272
- name: z.ZodString;
273
- arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
274
- },
275
- z.core.$strip
276
- >,
277
- z.ZodObject<
278
- {
279
- type: z.ZodLiteral<"tool_result">;
280
- callId: z.ZodString;
281
- result: z.ZodUnknown;
282
- error: z.ZodOptional<z.ZodString>;
283
- },
284
- z.core.$strip
285
- >,
286
- ],
287
- "type"
288
- >;
289
- isComplete: z.ZodBoolean;
290
- },
291
- z.core.$strip
292
- >;
159
+ export declare const MessageChunk: z.ZodObject<{
160
+ id: z.ZodString;
161
+ role: z.ZodEnum<{
162
+ user: "user";
163
+ assistant: "assistant";
164
+ system: "system";
165
+ tool: "tool";
166
+ }>;
167
+ contentDelta: z.ZodDiscriminatedUnion<[z.ZodObject<{
168
+ type: z.ZodLiteral<"text">;
169
+ text: z.ZodString;
170
+ }, z.core.$strip>, z.ZodObject<{
171
+ type: z.ZodLiteral<"image">;
172
+ url: z.ZodOptional<z.ZodString>;
173
+ data: z.ZodOptional<z.ZodString>;
174
+ mimeType: z.ZodOptional<z.ZodString>;
175
+ }, z.core.$strip>, z.ZodObject<{
176
+ type: z.ZodLiteral<"file">;
177
+ name: z.ZodString;
178
+ path: z.ZodOptional<z.ZodString>;
179
+ url: z.ZodOptional<z.ZodString>;
180
+ mimeType: z.ZodString;
181
+ size: z.ZodOptional<z.ZodNumber>;
182
+ }, z.core.$strip>, z.ZodObject<{
183
+ type: z.ZodLiteral<"tool_call">;
184
+ id: z.ZodString;
185
+ name: z.ZodString;
186
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
187
+ }, z.core.$strip>, z.ZodObject<{
188
+ type: z.ZodLiteral<"tool_result">;
189
+ callId: z.ZodString;
190
+ result: z.ZodUnknown;
191
+ error: z.ZodOptional<z.ZodString>;
192
+ }, z.core.$strip>], "type">;
193
+ isComplete: z.ZodBoolean;
194
+ }, z.core.$strip>;
293
195
  export type MessageChunk = z.infer<typeof MessageChunk>;
@@ -7,89 +7,89 @@ export const MessageRole = z.enum(["user", "assistant", "system", "tool"]);
7
7
  * Content type for messages
8
8
  */
9
9
  export const ContentType = z.enum([
10
- "text",
11
- "image",
12
- "file",
13
- "tool_call",
14
- "tool_result",
10
+ "text",
11
+ "image",
12
+ "file",
13
+ "tool_call",
14
+ "tool_result",
15
15
  ]);
16
16
  /**
17
17
  * Base content schema
18
18
  */
19
19
  export const BaseContent = z.object({
20
- type: ContentType,
20
+ type: ContentType,
21
21
  });
22
22
  /**
23
23
  * Text content
24
24
  */
25
25
  export const TextContent = BaseContent.extend({
26
- type: z.literal("text"),
27
- text: z.string(),
26
+ type: z.literal("text"),
27
+ text: z.string(),
28
28
  });
29
29
  /**
30
30
  * Image content
31
31
  */
32
32
  export const ImageContent = BaseContent.extend({
33
- type: z.literal("image"),
34
- url: z.string().url().optional(),
35
- data: z.string().optional(), // Base64 encoded
36
- mimeType: z.string().optional(),
33
+ type: z.literal("image"),
34
+ url: z.string().url().optional(),
35
+ data: z.string().optional(), // Base64 encoded
36
+ mimeType: z.string().optional(),
37
37
  });
38
38
  /**
39
39
  * File attachment content
40
40
  */
41
41
  export const FileContent = BaseContent.extend({
42
- type: z.literal("file"),
43
- name: z.string(),
44
- path: z.string().optional(),
45
- url: z.string().url().optional(),
46
- mimeType: z.string(),
47
- size: z.number().optional(),
42
+ type: z.literal("file"),
43
+ name: z.string(),
44
+ path: z.string().optional(),
45
+ url: z.string().url().optional(),
46
+ mimeType: z.string(),
47
+ size: z.number().optional(),
48
48
  });
49
49
  /**
50
50
  * Tool call content
51
51
  */
52
52
  export const ToolCallContent = BaseContent.extend({
53
- type: z.literal("tool_call"),
54
- id: z.string(),
55
- name: z.string(),
56
- arguments: z.record(z.string(), z.unknown()),
53
+ type: z.literal("tool_call"),
54
+ id: z.string(),
55
+ name: z.string(),
56
+ arguments: z.record(z.string(), z.unknown()),
57
57
  });
58
58
  /**
59
59
  * Tool result content
60
60
  */
61
61
  export const ToolResultContent = BaseContent.extend({
62
- type: z.literal("tool_result"),
63
- callId: z.string(),
64
- result: z.unknown(),
65
- error: z.string().optional(),
62
+ type: z.literal("tool_result"),
63
+ callId: z.string(),
64
+ result: z.unknown(),
65
+ error: z.string().optional(),
66
66
  });
67
67
  /**
68
68
  * Union of all content types
69
69
  */
70
70
  export const Content = z.discriminatedUnion("type", [
71
- TextContent,
72
- ImageContent,
73
- FileContent,
74
- ToolCallContent,
75
- ToolResultContent,
71
+ TextContent,
72
+ ImageContent,
73
+ FileContent,
74
+ ToolCallContent,
75
+ ToolResultContent,
76
76
  ]);
77
77
  /**
78
78
  * Message schema
79
79
  */
80
80
  export const Message = z.object({
81
- id: z.string(),
82
- role: MessageRole,
83
- content: z.array(Content),
84
- timestamp: z.iso.datetime(),
85
- metadata: z.record(z.string(), z.unknown()).optional(),
81
+ id: z.string(),
82
+ role: MessageRole,
83
+ content: z.array(Content),
84
+ timestamp: z.iso.datetime(),
85
+ metadata: z.record(z.string(), z.unknown()).optional(),
86
86
  });
87
87
  /**
88
88
  * Streaming message chunk
89
89
  */
90
90
  export const MessageChunk = z.object({
91
- id: z.string(),
92
- role: MessageRole,
93
- contentDelta: Content,
94
- isComplete: z.boolean(),
91
+ id: z.string(),
92
+ role: MessageRole,
93
+ contentDelta: Content,
94
+ isComplete: z.boolean(),
95
95
  });