portercode 0.1.4 → 0.1.11

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 (188) hide show
  1. package/LICENSE +174 -21
  2. package/README.md +162 -68
  3. package/dist/auth/index.d.ts +99 -0
  4. package/dist/brand/index.d.ts +7 -0
  5. package/dist/brand/loader.d.ts +463 -0
  6. package/dist/brand/rules.d.ts +25 -0
  7. package/dist/brand/schema.d.ts +246 -0
  8. package/dist/cli/auth.d.ts +14 -2
  9. package/dist/cli/brand.d.ts +6 -0
  10. package/dist/config/config.d.ts +0 -720
  11. package/dist/constants/index.d.ts +6 -9
  12. package/dist/constants/version.d.ts +5 -0
  13. package/dist/gateway/index.d.ts +5 -4
  14. package/dist/global/index.d.ts +12 -0
  15. package/dist/index.js +39 -1
  16. package/dist/prompt/template.d.ts +24 -0
  17. package/dist/provider/models.d.ts +0 -3
  18. package/dist/provider/provider.d.ts +5 -1
  19. package/dist/server/services/agent.d.ts +11 -0
  20. package/dist/session/context-cache.d.ts +75 -0
  21. package/dist/session/context-optimization.d.ts +5 -0
  22. package/dist/session/llm.d.ts +38 -1
  23. package/dist/session/message-optimizer.d.ts +32 -0
  24. package/dist/session/session.d.ts +101 -9
  25. package/dist/session/types.d.ts +92 -16
  26. package/dist/src/auth/index.d.ts +202 -0
  27. package/dist/src/brand/index.d.ts +7 -0
  28. package/dist/src/bus/bus-event.d.ts +10 -0
  29. package/dist/src/bus/global.d.ts +7 -0
  30. package/dist/src/bus/index.d.ts +26 -0
  31. package/dist/src/cli/auth.d.ts +23 -0
  32. package/dist/src/cli/index.d.ts +1 -0
  33. package/dist/src/cli/ui.d.ts +26 -0
  34. package/dist/src/command/index.d.ts +54 -0
  35. package/dist/src/config/config.d.ts +6036 -0
  36. package/dist/src/config/index.d.ts +2 -0
  37. package/dist/src/config/markdown.d.ts +415 -0
  38. package/dist/src/constants/index.d.ts +6 -0
  39. package/dist/src/constants/version.d.ts +5 -0
  40. package/dist/src/diff/engine.d.ts +15 -0
  41. package/dist/src/diff/index.d.ts +8 -0
  42. package/dist/src/diff/types.d.ts +66 -0
  43. package/dist/src/file/ignore.d.ts +7 -0
  44. package/dist/src/flag/index.d.ts +19 -0
  45. package/dist/src/gateway/bridge.d.ts +11 -0
  46. package/dist/src/gateway/handlers/llm.d.ts +7 -0
  47. package/dist/src/gateway/handlers/permission.d.ts +15 -0
  48. package/dist/src/gateway/handlers/session.d.ts +7 -0
  49. package/dist/src/gateway/handlers/system.d.ts +7 -0
  50. package/dist/src/gateway/handlers/tool.d.ts +7 -0
  51. package/dist/src/gateway/index.d.ts +18 -0
  52. package/dist/src/gateway/protocol.d.ts +159 -0
  53. package/dist/src/gateway/router.d.ts +7 -0
  54. package/dist/src/gateway/server.d.ts +24 -0
  55. package/dist/src/global/index.d.ts +23 -0
  56. package/dist/src/index.d.ts +2 -0
  57. package/dist/src/permission/index.d.ts +2 -0
  58. package/dist/src/permission/permission.d.ts +172 -0
  59. package/dist/src/permission/types.d.ts +109 -0
  60. package/dist/src/project/index.d.ts +3 -0
  61. package/dist/src/project/instance.d.ts +33 -0
  62. package/dist/src/project/project.d.ts +82 -0
  63. package/dist/src/project/state.d.ts +4 -0
  64. package/dist/src/prompt/index.d.ts +5 -0
  65. package/dist/src/prompt/system.d.ts +29 -0
  66. package/dist/src/prompt/template.d.ts +24 -0
  67. package/dist/src/provider/index.d.ts +3 -0
  68. package/dist/src/provider/models.d.ts +14 -0
  69. package/dist/src/provider/provider.d.ts +848 -0
  70. package/dist/src/provider/types.d.ts +328 -0
  71. package/dist/src/server/index.d.ts +21 -0
  72. package/dist/src/server/routes/api.d.ts +2 -0
  73. package/dist/src/server/routes/auth.d.ts +2 -0
  74. package/dist/src/server/routes/events.d.ts +2 -0
  75. package/dist/src/server/routes/health.d.ts +2 -0
  76. package/dist/src/server/routes/sessions.d.ts +2 -0
  77. package/dist/src/server/services/agent.d.ts +40 -0
  78. package/dist/src/server/services/permission.d.ts +43 -0
  79. package/dist/src/server/sse/emitter.d.ts +57 -0
  80. package/dist/src/session/context-cache.d.ts +75 -0
  81. package/dist/src/session/context-optimization.d.ts +165 -0
  82. package/dist/src/session/index.d.ts +5 -0
  83. package/dist/src/session/llm.d.ts +68 -0
  84. package/dist/src/session/message-optimizer.d.ts +32 -0
  85. package/dist/src/session/session.d.ts +524 -0
  86. package/dist/src/session/title-generator.d.ts +11 -0
  87. package/dist/src/session/types.d.ts +713 -0
  88. package/dist/src/snapshot/index.d.ts +40 -0
  89. package/dist/src/storage/index.d.ts +1 -0
  90. package/dist/src/storage/storage.d.ts +34 -0
  91. package/dist/src/theme.d.ts +66 -0
  92. package/dist/src/tool/bash.d.ts +19 -0
  93. package/dist/src/tool/edit.d.ts +21 -0
  94. package/dist/src/tool/glob.d.ts +15 -0
  95. package/dist/src/tool/grep.d.ts +20 -0
  96. package/dist/src/tool/image.d.ts +22 -0
  97. package/dist/src/tool/index.d.ts +11 -0
  98. package/dist/src/tool/ls.d.ts +14 -0
  99. package/dist/src/tool/read.d.ts +17 -0
  100. package/dist/src/tool/registry.d.ts +30 -0
  101. package/dist/src/tool/think.d.ts +11 -0
  102. package/dist/src/tool/todo.d.ts +76 -0
  103. package/dist/src/tool/tool.d.ts +65 -0
  104. package/dist/src/tool/webfetch.d.ts +15 -0
  105. package/dist/src/tool/websearch.d.ts +18 -0
  106. package/dist/src/tool/write.d.ts +16 -0
  107. package/dist/src/tui/App.d.ts +10 -0
  108. package/dist/src/tui/components/Header.d.ts +13 -0
  109. package/dist/src/tui/components/LoadingIndicator.d.ts +26 -0
  110. package/dist/src/tui/components/Message/AssistantMessage.d.ts +11 -0
  111. package/dist/src/tui/components/Message/ReasoningMessage.d.ts +21 -0
  112. package/dist/src/tui/components/Message/ToolCallMessage.d.ts +26 -0
  113. package/dist/src/tui/components/Message/UserMessage.d.ts +12 -0
  114. package/dist/src/tui/components/Message/index.d.ts +16 -0
  115. package/dist/src/tui/components/PermissionPrompt.d.ts +6 -0
  116. package/dist/src/tui/components/PromptInput.d.ts +33 -0
  117. package/dist/src/tui/components/REPL.d.ts +22 -0
  118. package/dist/src/tui/components/Spinner.d.ts +13 -0
  119. package/dist/src/tui/components/StatusBar.d.ts +13 -0
  120. package/dist/src/tui/components/TodoList.d.ts +17 -0
  121. package/dist/src/tui/components/WelcomeBox.d.ts +13 -0
  122. package/dist/src/tui/components/dialogs/DiagnosticsPanel.d.ts +12 -0
  123. package/dist/src/tui/components/dialogs/HelpPanel.d.ts +11 -0
  124. package/dist/src/tui/components/dialogs/ModelSelector.d.ts +14 -0
  125. package/dist/src/tui/components/dialogs/PermissionPrompt.d.ts +17 -0
  126. package/dist/src/tui/components/dialogs/SessionPicker.d.ts +20 -0
  127. package/dist/src/tui/components/dialogs/index.d.ts +10 -0
  128. package/dist/src/tui/components/diff/DiffHunk.d.ts +12 -0
  129. package/dist/src/tui/components/diff/DiffLine.d.ts +14 -0
  130. package/dist/src/tui/components/diff/DiffStats.d.ts +12 -0
  131. package/dist/src/tui/components/diff/DiffView.d.ts +15 -0
  132. package/dist/src/tui/components/diff/index.d.ts +9 -0
  133. package/dist/src/tui/hooks/useAnimatedLabel.d.ts +12 -0
  134. package/dist/src/tui/hooks/usePermission.d.ts +34 -0
  135. package/dist/src/tui/hooks/useTermWidth.d.ts +13 -0
  136. package/dist/src/tui/index.d.ts +20 -0
  137. package/dist/src/tui/theme.d.ts +8 -0
  138. package/dist/src/tui/utils/Cursor.d.ts +37 -0
  139. package/dist/src/tui/utils/clipboard.d.ts +3 -0
  140. package/dist/src/tui/utils/keypress.d.ts +39 -0
  141. package/dist/src/tui/utils/markdown.d.ts +13 -0
  142. package/dist/src/tui/utils/openContent.d.ts +22 -0
  143. package/dist/src/util/ascii.d.ts +22 -0
  144. package/dist/src/util/bell.d.ts +14 -0
  145. package/dist/src/util/color.d.ts +28 -0
  146. package/dist/src/util/context.d.ts +10 -0
  147. package/dist/src/util/debug.d.ts +51 -0
  148. package/dist/src/util/error.d.ts +294 -0
  149. package/dist/src/util/example-commands.d.ts +18 -0
  150. package/dist/src/util/filesystem.d.ts +17 -0
  151. package/dist/src/util/id.d.ts +24 -0
  152. package/dist/src/util/iife.d.ts +1 -0
  153. package/dist/src/util/index.d.ts +7 -0
  154. package/dist/src/util/lazy.d.ts +1 -0
  155. package/dist/src/util/log.d.ts +26 -0
  156. package/dist/src/util/paths.d.ts +45 -0
  157. package/dist/src/util/shell.d.ts +36 -0
  158. package/dist/src/util/timeout.d.ts +1 -0
  159. package/dist/src/util/wildcard.d.ts +8 -0
  160. package/dist/theme.d.ts +64 -0
  161. package/dist/tool/image.d.ts +3 -4
  162. package/dist/tool/think.d.ts +11 -0
  163. package/dist/tool/webfetch.d.ts +15 -0
  164. package/dist/tool/websearch.d.ts +18 -0
  165. package/dist/tools/think.d.ts +2 -0
  166. package/dist/tui/App.d.ts +1 -1
  167. package/dist/tui/components/Header.d.ts +2 -1
  168. package/dist/tui/components/LoadingIndicator.d.ts +26 -0
  169. package/dist/tui/components/Message/AssistantMessage.d.ts +2 -1
  170. package/dist/tui/components/Message/ReasoningMessage.d.ts +2 -1
  171. package/dist/tui/components/Message/ToolCallMessage.d.ts +3 -2
  172. package/dist/tui/components/Message/UserMessage.d.ts +2 -1
  173. package/dist/tui/components/Message/index.d.ts +4 -1
  174. package/dist/tui/components/PromptInput.d.ts +2 -1
  175. package/dist/tui/components/REPL.d.ts +6 -1
  176. package/dist/tui/components/StatusBar.d.ts +2 -1
  177. package/dist/tui/components/dialogs/SessionPicker.d.ts +6 -1
  178. package/dist/tui/hooks/useAnimatedLabel.d.ts +12 -0
  179. package/dist/tui/hooks/usePermission.d.ts +9 -1
  180. package/dist/tui/hooks/useTermWidth.d.ts +13 -0
  181. package/dist/tui/index.d.ts +5 -0
  182. package/dist/tui/theme.d.ts +4 -23
  183. package/dist/util/ascii.d.ts +22 -0
  184. package/dist/util/bell.d.ts +14 -0
  185. package/dist/util/color.d.ts +28 -0
  186. package/dist/util/paths.d.ts +45 -0
  187. package/dist/util/shell.d.ts +36 -0
  188. package/package.json +21 -1
@@ -19,6 +19,17 @@ export declare const SessionInfo: z.ZodObject<{
19
19
  title: z.ZodString;
20
20
  createdAt: z.ZodNumber;
21
21
  updatedAt: z.ZodNumber;
22
+ promptHistory: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
23
+ tokens: z.ZodOptional<z.ZodObject<{
24
+ input: z.ZodNumber;
25
+ output: z.ZodNumber;
26
+ }, "strip", z.ZodTypeAny, {
27
+ input: number;
28
+ output: number;
29
+ }, {
30
+ input: number;
31
+ output: number;
32
+ }>>;
22
33
  }, "strip", z.ZodTypeAny, {
23
34
  id: string;
24
35
  directory: string;
@@ -27,6 +38,11 @@ export declare const SessionInfo: z.ZodObject<{
27
38
  createdAt: number;
28
39
  updatedAt: number;
29
40
  parentId?: string | undefined;
41
+ promptHistory?: string[] | undefined;
42
+ tokens?: {
43
+ input: number;
44
+ output: number;
45
+ } | undefined;
30
46
  }, {
31
47
  id: string;
32
48
  directory: string;
@@ -35,6 +51,11 @@ export declare const SessionInfo: z.ZodObject<{
35
51
  createdAt: number;
36
52
  updatedAt: number;
37
53
  parentId?: string | undefined;
54
+ promptHistory?: string[] | undefined;
55
+ tokens?: {
56
+ input: number;
57
+ output: number;
58
+ } | undefined;
38
59
  }>;
39
60
  export type SessionInfo = z.infer<typeof SessionInfo>;
40
61
  /**
@@ -51,18 +72,21 @@ export declare const TextPart: z.ZodObject<{
51
72
  messageId: z.ZodString;
52
73
  sessionId: z.ZodString;
53
74
  content: z.ZodString;
75
+ sequence: z.ZodOptional<z.ZodNumber>;
54
76
  }, "strip", z.ZodTypeAny, {
55
77
  type: "text";
56
78
  id: string;
57
79
  sessionId: string;
58
80
  content: string;
59
81
  messageId: string;
82
+ sequence?: number | undefined;
60
83
  }, {
61
84
  type: "text";
62
85
  id: string;
63
86
  sessionId: string;
64
87
  content: string;
65
88
  messageId: string;
89
+ sequence?: number | undefined;
66
90
  }>;
67
91
  export type TextPart = z.infer<typeof TextPart>;
68
92
  /**
@@ -74,18 +98,21 @@ export declare const ReasoningPart: z.ZodObject<{
74
98
  messageId: z.ZodString;
75
99
  sessionId: z.ZodString;
76
100
  content: z.ZodString;
101
+ sequence: z.ZodOptional<z.ZodNumber>;
77
102
  }, "strip", z.ZodTypeAny, {
78
103
  type: "reasoning";
79
104
  id: string;
80
105
  sessionId: string;
81
106
  content: string;
82
107
  messageId: string;
108
+ sequence?: number | undefined;
83
109
  }, {
84
110
  type: "reasoning";
85
111
  id: string;
86
112
  sessionId: string;
87
113
  content: string;
88
114
  messageId: string;
115
+ sequence?: number | undefined;
89
116
  }>;
90
117
  export type ReasoningPart = z.infer<typeof ReasoningPart>;
91
118
  /**
@@ -100,24 +127,27 @@ export declare const ToolCallPart: z.ZodObject<{
100
127
  toolName: z.ZodString;
101
128
  input: z.ZodRecord<z.ZodString, z.ZodAny>;
102
129
  state: z.ZodEnum<["pending", "running", "completed", "failed"]>;
130
+ sequence: z.ZodOptional<z.ZodNumber>;
103
131
  }, "strip", z.ZodTypeAny, {
132
+ state: "completed" | "pending" | "running" | "failed";
104
133
  type: "tool-call";
105
134
  id: string;
106
- state: "completed" | "pending" | "running" | "failed";
107
135
  input: Record<string, any>;
108
136
  sessionId: string;
109
137
  toolId: string;
110
138
  messageId: string;
111
139
  toolName: string;
140
+ sequence?: number | undefined;
112
141
  }, {
142
+ state: "completed" | "pending" | "running" | "failed";
113
143
  type: "tool-call";
114
144
  id: string;
115
- state: "completed" | "pending" | "running" | "failed";
116
145
  input: Record<string, any>;
117
146
  sessionId: string;
118
147
  toolId: string;
119
148
  messageId: string;
120
149
  toolName: string;
150
+ sequence?: number | undefined;
121
151
  }>;
122
152
  export type ToolCallPart = z.infer<typeof ToolCallPart>;
123
153
  /**
@@ -133,6 +163,7 @@ export declare const ToolResultPart: z.ZodObject<{
133
163
  input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
134
164
  output: z.ZodString;
135
165
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
166
+ sequence: z.ZodOptional<z.ZodNumber>;
136
167
  }, "strip", z.ZodTypeAny, {
137
168
  type: "tool-result";
138
169
  id: string;
@@ -141,6 +172,7 @@ export declare const ToolResultPart: z.ZodObject<{
141
172
  messageId: string;
142
173
  toolCallId: string;
143
174
  input?: Record<string, any> | undefined;
175
+ sequence?: number | undefined;
144
176
  toolName?: string | undefined;
145
177
  metadata?: Record<string, any> | undefined;
146
178
  }, {
@@ -151,6 +183,7 @@ export declare const ToolResultPart: z.ZodObject<{
151
183
  messageId: string;
152
184
  toolCallId: string;
153
185
  input?: Record<string, any> | undefined;
186
+ sequence?: number | undefined;
154
187
  toolName?: string | undefined;
155
188
  metadata?: Record<string, any> | undefined;
156
189
  }>;
@@ -166,21 +199,24 @@ export declare const ImagePart: z.ZodObject<{
166
199
  mimeType: z.ZodEnum<["image/png", "image/jpeg", "image/gif", "image/webp"]>;
167
200
  data: z.ZodString;
168
201
  filename: z.ZodOptional<z.ZodString>;
202
+ sequence: z.ZodOptional<z.ZodNumber>;
169
203
  }, "strip", z.ZodTypeAny, {
170
204
  type: "image";
171
205
  id: string;
206
+ data: string;
172
207
  sessionId: string;
173
208
  messageId: string;
174
209
  mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
175
- data: string;
210
+ sequence?: number | undefined;
176
211
  filename?: string | undefined;
177
212
  }, {
178
213
  type: "image";
179
214
  id: string;
215
+ data: string;
180
216
  sessionId: string;
181
217
  messageId: string;
182
218
  mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
183
- data: string;
219
+ sequence?: number | undefined;
184
220
  filename?: string | undefined;
185
221
  }>;
186
222
  export type ImagePart = z.infer<typeof ImagePart>;
@@ -193,36 +229,42 @@ export declare const MessagePart: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
193
229
  messageId: z.ZodString;
194
230
  sessionId: z.ZodString;
195
231
  content: z.ZodString;
232
+ sequence: z.ZodOptional<z.ZodNumber>;
196
233
  }, "strip", z.ZodTypeAny, {
197
234
  type: "text";
198
235
  id: string;
199
236
  sessionId: string;
200
237
  content: string;
201
238
  messageId: string;
239
+ sequence?: number | undefined;
202
240
  }, {
203
241
  type: "text";
204
242
  id: string;
205
243
  sessionId: string;
206
244
  content: string;
207
245
  messageId: string;
246
+ sequence?: number | undefined;
208
247
  }>, z.ZodObject<{
209
248
  type: z.ZodLiteral<"reasoning">;
210
249
  id: z.ZodString;
211
250
  messageId: z.ZodString;
212
251
  sessionId: z.ZodString;
213
252
  content: z.ZodString;
253
+ sequence: z.ZodOptional<z.ZodNumber>;
214
254
  }, "strip", z.ZodTypeAny, {
215
255
  type: "reasoning";
216
256
  id: string;
217
257
  sessionId: string;
218
258
  content: string;
219
259
  messageId: string;
260
+ sequence?: number | undefined;
220
261
  }, {
221
262
  type: "reasoning";
222
263
  id: string;
223
264
  sessionId: string;
224
265
  content: string;
225
266
  messageId: string;
267
+ sequence?: number | undefined;
226
268
  }>, z.ZodObject<{
227
269
  type: z.ZodLiteral<"tool-call">;
228
270
  id: z.ZodString;
@@ -232,24 +274,27 @@ export declare const MessagePart: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
232
274
  toolName: z.ZodString;
233
275
  input: z.ZodRecord<z.ZodString, z.ZodAny>;
234
276
  state: z.ZodEnum<["pending", "running", "completed", "failed"]>;
277
+ sequence: z.ZodOptional<z.ZodNumber>;
235
278
  }, "strip", z.ZodTypeAny, {
279
+ state: "completed" | "pending" | "running" | "failed";
236
280
  type: "tool-call";
237
281
  id: string;
238
- state: "completed" | "pending" | "running" | "failed";
239
282
  input: Record<string, any>;
240
283
  sessionId: string;
241
284
  toolId: string;
242
285
  messageId: string;
243
286
  toolName: string;
287
+ sequence?: number | undefined;
244
288
  }, {
289
+ state: "completed" | "pending" | "running" | "failed";
245
290
  type: "tool-call";
246
291
  id: string;
247
- state: "completed" | "pending" | "running" | "failed";
248
292
  input: Record<string, any>;
249
293
  sessionId: string;
250
294
  toolId: string;
251
295
  messageId: string;
252
296
  toolName: string;
297
+ sequence?: number | undefined;
253
298
  }>, z.ZodObject<{
254
299
  type: z.ZodLiteral<"tool-result">;
255
300
  id: z.ZodString;
@@ -260,6 +305,7 @@ export declare const MessagePart: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
260
305
  input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
261
306
  output: z.ZodString;
262
307
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
308
+ sequence: z.ZodOptional<z.ZodNumber>;
263
309
  }, "strip", z.ZodTypeAny, {
264
310
  type: "tool-result";
265
311
  id: string;
@@ -268,6 +314,7 @@ export declare const MessagePart: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
268
314
  messageId: string;
269
315
  toolCallId: string;
270
316
  input?: Record<string, any> | undefined;
317
+ sequence?: number | undefined;
271
318
  toolName?: string | undefined;
272
319
  metadata?: Record<string, any> | undefined;
273
320
  }, {
@@ -278,6 +325,7 @@ export declare const MessagePart: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
278
325
  messageId: string;
279
326
  toolCallId: string;
280
327
  input?: Record<string, any> | undefined;
328
+ sequence?: number | undefined;
281
329
  toolName?: string | undefined;
282
330
  metadata?: Record<string, any> | undefined;
283
331
  }>, z.ZodObject<{
@@ -288,21 +336,24 @@ export declare const MessagePart: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
288
336
  mimeType: z.ZodEnum<["image/png", "image/jpeg", "image/gif", "image/webp"]>;
289
337
  data: z.ZodString;
290
338
  filename: z.ZodOptional<z.ZodString>;
339
+ sequence: z.ZodOptional<z.ZodNumber>;
291
340
  }, "strip", z.ZodTypeAny, {
292
341
  type: "image";
293
342
  id: string;
343
+ data: string;
294
344
  sessionId: string;
295
345
  messageId: string;
296
346
  mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
297
- data: string;
347
+ sequence?: number | undefined;
298
348
  filename?: string | undefined;
299
349
  }, {
300
350
  type: "image";
301
351
  id: string;
352
+ data: string;
302
353
  sessionId: string;
303
354
  messageId: string;
304
355
  mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
305
- data: string;
356
+ sequence?: number | undefined;
306
357
  filename?: string | undefined;
307
358
  }>]>;
308
359
  export type MessagePart = z.infer<typeof MessagePart>;
@@ -364,36 +415,42 @@ export declare const MessageWithParts: z.ZodObject<{
364
415
  messageId: z.ZodString;
365
416
  sessionId: z.ZodString;
366
417
  content: z.ZodString;
418
+ sequence: z.ZodOptional<z.ZodNumber>;
367
419
  }, "strip", z.ZodTypeAny, {
368
420
  type: "text";
369
421
  id: string;
370
422
  sessionId: string;
371
423
  content: string;
372
424
  messageId: string;
425
+ sequence?: number | undefined;
373
426
  }, {
374
427
  type: "text";
375
428
  id: string;
376
429
  sessionId: string;
377
430
  content: string;
378
431
  messageId: string;
432
+ sequence?: number | undefined;
379
433
  }>, z.ZodObject<{
380
434
  type: z.ZodLiteral<"reasoning">;
381
435
  id: z.ZodString;
382
436
  messageId: z.ZodString;
383
437
  sessionId: z.ZodString;
384
438
  content: z.ZodString;
439
+ sequence: z.ZodOptional<z.ZodNumber>;
385
440
  }, "strip", z.ZodTypeAny, {
386
441
  type: "reasoning";
387
442
  id: string;
388
443
  sessionId: string;
389
444
  content: string;
390
445
  messageId: string;
446
+ sequence?: number | undefined;
391
447
  }, {
392
448
  type: "reasoning";
393
449
  id: string;
394
450
  sessionId: string;
395
451
  content: string;
396
452
  messageId: string;
453
+ sequence?: number | undefined;
397
454
  }>, z.ZodObject<{
398
455
  type: z.ZodLiteral<"tool-call">;
399
456
  id: z.ZodString;
@@ -403,24 +460,27 @@ export declare const MessageWithParts: z.ZodObject<{
403
460
  toolName: z.ZodString;
404
461
  input: z.ZodRecord<z.ZodString, z.ZodAny>;
405
462
  state: z.ZodEnum<["pending", "running", "completed", "failed"]>;
463
+ sequence: z.ZodOptional<z.ZodNumber>;
406
464
  }, "strip", z.ZodTypeAny, {
465
+ state: "completed" | "pending" | "running" | "failed";
407
466
  type: "tool-call";
408
467
  id: string;
409
- state: "completed" | "pending" | "running" | "failed";
410
468
  input: Record<string, any>;
411
469
  sessionId: string;
412
470
  toolId: string;
413
471
  messageId: string;
414
472
  toolName: string;
473
+ sequence?: number | undefined;
415
474
  }, {
475
+ state: "completed" | "pending" | "running" | "failed";
416
476
  type: "tool-call";
417
477
  id: string;
418
- state: "completed" | "pending" | "running" | "failed";
419
478
  input: Record<string, any>;
420
479
  sessionId: string;
421
480
  toolId: string;
422
481
  messageId: string;
423
482
  toolName: string;
483
+ sequence?: number | undefined;
424
484
  }>, z.ZodObject<{
425
485
  type: z.ZodLiteral<"tool-result">;
426
486
  id: z.ZodString;
@@ -431,6 +491,7 @@ export declare const MessageWithParts: z.ZodObject<{
431
491
  input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
432
492
  output: z.ZodString;
433
493
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
494
+ sequence: z.ZodOptional<z.ZodNumber>;
434
495
  }, "strip", z.ZodTypeAny, {
435
496
  type: "tool-result";
436
497
  id: string;
@@ -439,6 +500,7 @@ export declare const MessageWithParts: z.ZodObject<{
439
500
  messageId: string;
440
501
  toolCallId: string;
441
502
  input?: Record<string, any> | undefined;
503
+ sequence?: number | undefined;
442
504
  toolName?: string | undefined;
443
505
  metadata?: Record<string, any> | undefined;
444
506
  }, {
@@ -449,6 +511,7 @@ export declare const MessageWithParts: z.ZodObject<{
449
511
  messageId: string;
450
512
  toolCallId: string;
451
513
  input?: Record<string, any> | undefined;
514
+ sequence?: number | undefined;
452
515
  toolName?: string | undefined;
453
516
  metadata?: Record<string, any> | undefined;
454
517
  }>, z.ZodObject<{
@@ -459,21 +522,24 @@ export declare const MessageWithParts: z.ZodObject<{
459
522
  mimeType: z.ZodEnum<["image/png", "image/jpeg", "image/gif", "image/webp"]>;
460
523
  data: z.ZodString;
461
524
  filename: z.ZodOptional<z.ZodString>;
525
+ sequence: z.ZodOptional<z.ZodNumber>;
462
526
  }, "strip", z.ZodTypeAny, {
463
527
  type: "image";
464
528
  id: string;
529
+ data: string;
465
530
  sessionId: string;
466
531
  messageId: string;
467
532
  mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
468
- data: string;
533
+ sequence?: number | undefined;
469
534
  filename?: string | undefined;
470
535
  }, {
471
536
  type: "image";
472
537
  id: string;
538
+ data: string;
473
539
  sessionId: string;
474
540
  messageId: string;
475
541
  mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
476
- data: string;
542
+ sequence?: number | undefined;
477
543
  filename?: string | undefined;
478
544
  }>]>, "many">;
479
545
  }, "strip", z.ZodTypeAny, {
@@ -491,21 +557,24 @@ export declare const MessageWithParts: z.ZodObject<{
491
557
  sessionId: string;
492
558
  content: string;
493
559
  messageId: string;
560
+ sequence?: number | undefined;
494
561
  } | {
495
562
  type: "reasoning";
496
563
  id: string;
497
564
  sessionId: string;
498
565
  content: string;
499
566
  messageId: string;
567
+ sequence?: number | undefined;
500
568
  } | {
569
+ state: "completed" | "pending" | "running" | "failed";
501
570
  type: "tool-call";
502
571
  id: string;
503
- state: "completed" | "pending" | "running" | "failed";
504
572
  input: Record<string, any>;
505
573
  sessionId: string;
506
574
  toolId: string;
507
575
  messageId: string;
508
576
  toolName: string;
577
+ sequence?: number | undefined;
509
578
  } | {
510
579
  type: "tool-result";
511
580
  id: string;
@@ -514,15 +583,17 @@ export declare const MessageWithParts: z.ZodObject<{
514
583
  messageId: string;
515
584
  toolCallId: string;
516
585
  input?: Record<string, any> | undefined;
586
+ sequence?: number | undefined;
517
587
  toolName?: string | undefined;
518
588
  metadata?: Record<string, any> | undefined;
519
589
  } | {
520
590
  type: "image";
521
591
  id: string;
592
+ data: string;
522
593
  sessionId: string;
523
594
  messageId: string;
524
595
  mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
525
- data: string;
596
+ sequence?: number | undefined;
526
597
  filename?: string | undefined;
527
598
  })[];
528
599
  }, {
@@ -540,21 +611,24 @@ export declare const MessageWithParts: z.ZodObject<{
540
611
  sessionId: string;
541
612
  content: string;
542
613
  messageId: string;
614
+ sequence?: number | undefined;
543
615
  } | {
544
616
  type: "reasoning";
545
617
  id: string;
546
618
  sessionId: string;
547
619
  content: string;
548
620
  messageId: string;
621
+ sequence?: number | undefined;
549
622
  } | {
623
+ state: "completed" | "pending" | "running" | "failed";
550
624
  type: "tool-call";
551
625
  id: string;
552
- state: "completed" | "pending" | "running" | "failed";
553
626
  input: Record<string, any>;
554
627
  sessionId: string;
555
628
  toolId: string;
556
629
  messageId: string;
557
630
  toolName: string;
631
+ sequence?: number | undefined;
558
632
  } | {
559
633
  type: "tool-result";
560
634
  id: string;
@@ -563,15 +637,17 @@ export declare const MessageWithParts: z.ZodObject<{
563
637
  messageId: string;
564
638
  toolCallId: string;
565
639
  input?: Record<string, any> | undefined;
640
+ sequence?: number | undefined;
566
641
  toolName?: string | undefined;
567
642
  metadata?: Record<string, any> | undefined;
568
643
  } | {
569
644
  type: "image";
570
645
  id: string;
646
+ data: string;
571
647
  sessionId: string;
572
648
  messageId: string;
573
649
  mimeType: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
574
- data: string;
650
+ sequence?: number | undefined;
575
651
  filename?: string | undefined;
576
652
  })[];
577
653
  }>;
@@ -0,0 +1,202 @@
1
+ import { z } from "zod";
2
+ export declare namespace Auth {
3
+ const Oauth: z.ZodObject<{
4
+ type: z.ZodLiteral<"oauth">;
5
+ refresh: z.ZodString;
6
+ access: z.ZodString;
7
+ expires: z.ZodNumber;
8
+ enterpriseUrl: z.ZodOptional<z.ZodString>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ type: "oauth";
11
+ refresh: string;
12
+ access: string;
13
+ expires: number;
14
+ enterpriseUrl?: string | undefined;
15
+ }, {
16
+ type: "oauth";
17
+ refresh: string;
18
+ access: string;
19
+ expires: number;
20
+ enterpriseUrl?: string | undefined;
21
+ }>;
22
+ const Api: z.ZodObject<{
23
+ type: z.ZodLiteral<"api">;
24
+ key: z.ZodString;
25
+ }, "strip", z.ZodTypeAny, {
26
+ type: "api";
27
+ key: string;
28
+ }, {
29
+ type: "api";
30
+ key: string;
31
+ }>;
32
+ const WellKnown: z.ZodObject<{
33
+ type: z.ZodLiteral<"wellknown">;
34
+ key: z.ZodString;
35
+ token: z.ZodString;
36
+ }, "strip", z.ZodTypeAny, {
37
+ type: "wellknown";
38
+ key: string;
39
+ token: string;
40
+ }, {
41
+ type: "wellknown";
42
+ key: string;
43
+ token: string;
44
+ }>;
45
+ const ServiceAccount: z.ZodObject<{
46
+ type: z.ZodLiteral<"service-account">;
47
+ serviceAccount: z.ZodObject<{
48
+ project_id: z.ZodString;
49
+ client_email: z.ZodString;
50
+ private_key: z.ZodString;
51
+ location: z.ZodOptional<z.ZodString>;
52
+ }, "strip", z.ZodTypeAny, {
53
+ project_id: string;
54
+ client_email: string;
55
+ private_key: string;
56
+ location?: string | undefined;
57
+ }, {
58
+ project_id: string;
59
+ client_email: string;
60
+ private_key: string;
61
+ location?: string | undefined;
62
+ }>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ type: "service-account";
65
+ serviceAccount: {
66
+ project_id: string;
67
+ client_email: string;
68
+ private_key: string;
69
+ location?: string | undefined;
70
+ };
71
+ }, {
72
+ type: "service-account";
73
+ serviceAccount: {
74
+ project_id: string;
75
+ client_email: string;
76
+ private_key: string;
77
+ location?: string | undefined;
78
+ };
79
+ }>;
80
+ const PerplexityApiKey: z.ZodObject<{
81
+ type: z.ZodLiteral<"perplexity-api-key">;
82
+ apiKey: z.ZodString;
83
+ }, "strip", z.ZodTypeAny, {
84
+ type: "perplexity-api-key";
85
+ apiKey: string;
86
+ }, {
87
+ type: "perplexity-api-key";
88
+ apiKey: string;
89
+ }>;
90
+ const Info: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
91
+ type: z.ZodLiteral<"oauth">;
92
+ refresh: z.ZodString;
93
+ access: z.ZodString;
94
+ expires: z.ZodNumber;
95
+ enterpriseUrl: z.ZodOptional<z.ZodString>;
96
+ }, "strip", z.ZodTypeAny, {
97
+ type: "oauth";
98
+ refresh: string;
99
+ access: string;
100
+ expires: number;
101
+ enterpriseUrl?: string | undefined;
102
+ }, {
103
+ type: "oauth";
104
+ refresh: string;
105
+ access: string;
106
+ expires: number;
107
+ enterpriseUrl?: string | undefined;
108
+ }>, z.ZodObject<{
109
+ type: z.ZodLiteral<"api">;
110
+ key: z.ZodString;
111
+ }, "strip", z.ZodTypeAny, {
112
+ type: "api";
113
+ key: string;
114
+ }, {
115
+ type: "api";
116
+ key: string;
117
+ }>, z.ZodObject<{
118
+ type: z.ZodLiteral<"wellknown">;
119
+ key: z.ZodString;
120
+ token: z.ZodString;
121
+ }, "strip", z.ZodTypeAny, {
122
+ type: "wellknown";
123
+ key: string;
124
+ token: string;
125
+ }, {
126
+ type: "wellknown";
127
+ key: string;
128
+ token: string;
129
+ }>, z.ZodObject<{
130
+ type: z.ZodLiteral<"service-account">;
131
+ serviceAccount: z.ZodObject<{
132
+ project_id: z.ZodString;
133
+ client_email: z.ZodString;
134
+ private_key: z.ZodString;
135
+ location: z.ZodOptional<z.ZodString>;
136
+ }, "strip", z.ZodTypeAny, {
137
+ project_id: string;
138
+ client_email: string;
139
+ private_key: string;
140
+ location?: string | undefined;
141
+ }, {
142
+ project_id: string;
143
+ client_email: string;
144
+ private_key: string;
145
+ location?: string | undefined;
146
+ }>;
147
+ }, "strip", z.ZodTypeAny, {
148
+ type: "service-account";
149
+ serviceAccount: {
150
+ project_id: string;
151
+ client_email: string;
152
+ private_key: string;
153
+ location?: string | undefined;
154
+ };
155
+ }, {
156
+ type: "service-account";
157
+ serviceAccount: {
158
+ project_id: string;
159
+ client_email: string;
160
+ private_key: string;
161
+ location?: string | undefined;
162
+ };
163
+ }>, z.ZodObject<{
164
+ type: z.ZodLiteral<"perplexity-api-key">;
165
+ apiKey: z.ZodString;
166
+ }, "strip", z.ZodTypeAny, {
167
+ type: "perplexity-api-key";
168
+ apiKey: string;
169
+ }, {
170
+ type: "perplexity-api-key";
171
+ apiKey: string;
172
+ }>]>;
173
+ type Info = z.infer<typeof Info>;
174
+ function get(providerID: string): Promise<{
175
+ type: "oauth";
176
+ refresh: string;
177
+ access: string;
178
+ expires: number;
179
+ enterpriseUrl?: string | undefined;
180
+ } | {
181
+ type: "api";
182
+ key: string;
183
+ } | {
184
+ type: "wellknown";
185
+ key: string;
186
+ token: string;
187
+ } | {
188
+ type: "service-account";
189
+ serviceAccount: {
190
+ project_id: string;
191
+ client_email: string;
192
+ private_key: string;
193
+ location?: string | undefined;
194
+ };
195
+ } | {
196
+ type: "perplexity-api-key";
197
+ apiKey: string;
198
+ }>;
199
+ function all(): Promise<Record<string, Info>>;
200
+ function set(key: string, info: Info): Promise<void>;
201
+ function remove(key: string): Promise<void>;
202
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Brand Module
3
+ *
4
+ * Re-exports brand configuration from theme.ts for backward compatibility
5
+ */
6
+ export { PRODUCT_NAME, PRODUCT_COMMAND, CONFIG_DIR, CONFIG_FILE, RULES_FILE, ENV_PREFIX, LOGO_SIMPLE, LOGO_EXTENDED, LOGO_ASCII, LOCAL_RULE_FILES, GLOBAL_RULE_FILES, DEFAULT_THEME, PRIMARY_COLOR, themes, getTheme, setTheme, getThemeNames, initTheme, } from "../theme";
7
+ export type { Theme } from "../theme";