terse-types 0.0.1 → 0.0.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.
@@ -1,137 +1,124 @@
1
+ import * as z from "zod";
1
2
  import { EntityType } from "./Entities.js";
2
- import type { MultipleChoiceOption } from "./Survey.js";
3
+ export declare const entityTypeSchema: z.ZodEnum<typeof EntityType>;
3
4
  export declare enum ChangeEventType {
4
5
  CREATED = "CREATED",
5
6
  UPDATED = "UPDATED",
6
7
  ACTION_EXECUTED = "ACTION_EXECUTED"
7
8
  }
8
- export type SharedErrorContext = {
9
- error: Error | unknown;
10
- };
11
- export type ChangedItem = {
12
- type_name: EntityType;
13
- id: string;
14
- change_event_type: ChangeEventType;
15
- };
16
- /** Run-level / agent-level error (e.g. context window exceeded). Use optional code for specific UI handling. */
17
- export type RunError = {
18
- error: string;
19
- code?: string;
20
- timestamp: number;
21
- };
22
- export type Cancelled = {
23
- reason?: string;
24
- timestamp: number;
25
- };
26
- export type FunctionCall = {
27
- function_name: string;
28
- result: string;
29
- step_id: string;
30
- };
31
- export type ModelEvent = (({
32
- type: "ToolApprovalResponse";
33
- } & ToolApprovalResponse) | ({
34
- type: "ToolApprovalRequest";
35
- } & ToolApprovalRequest) | ({
36
- type: "ToolCallGenerating";
37
- } & ToolCallGenerating) | ({
38
- type: "ToolCall";
39
- } & ToolCall) | ({
40
- type: "ToolCallComplete";
41
- } & ToolCallComplete) | ({
42
- type: "TextDelta";
43
- } & TextDelta) | ({
44
- type: "RunError";
45
- } & RunError) | ({
46
- type: "Cancelled";
47
- } & Cancelled) | ({
48
- type: "NaturalStop";
49
- } & NaturalStop) | ({
50
- type: "FilterResult";
51
- } & FilterResult) | ({
52
- type: "UserMessage";
53
- } & UserMessage) | ({
54
- type: "Thinking";
55
- } & Thinking) | ({
56
- type: "Snippet";
57
- } & {
58
- snippet: ChatSnippet;
59
- })) & {
60
- timestamp: number;
61
- };
62
- export type NaturalStop = {
63
- step_id: string;
64
- timestamp: number;
65
- };
66
- export type ModelRequest = ({
67
- type: "SendModelRequest";
68
- } & SendModelRequest) | ({
69
- type: "ToolApprovalResponse";
70
- } & ToolApprovalResponse);
71
- export type SendModelRequest = {
72
- user_message: string;
73
- timezone: string;
74
- ui_state?: string;
75
- client_turn_id: string;
76
- template_id?: string;
77
- };
78
- export type ToolApprovalResponse = {
79
- step_id: string;
80
- approved: boolean;
81
- rejection_reason?: string;
82
- timestamp: number;
83
- };
84
- export type ToolApprovalRequest = {
85
- step_id: string;
86
- name: string;
87
- arguments: string;
88
- timestamp: number;
89
- };
90
- export type TextDelta = {
91
- delta: string;
92
- step_id: string;
93
- timestamp: number;
94
- };
95
- export type ToolCallGenerating = {
96
- tool_name: string;
97
- step_id: string;
98
- timestamp: number;
99
- };
100
- export type ToolCall = {
101
- summary: string;
102
- step_id: string;
103
- parameters: string;
104
- integration: string;
105
- timestamp: number;
106
- };
107
- export type Thinking = {
108
- step_id: string;
109
- timestamp: number;
110
- };
9
+ export declare const changeEventTypeSchema: z.ZodEnum<typeof ChangeEventType>;
10
+ export declare const sharedErrorContextSchema: z.ZodObject<{
11
+ error: z.ZodUnknown;
12
+ }, z.core.$strip>;
13
+ export type SharedErrorContext = z.infer<typeof sharedErrorContextSchema>;
14
+ export declare const changedItemSchema: z.ZodObject<{
15
+ type_name: z.ZodEnum<typeof EntityType>;
16
+ id: z.ZodString;
17
+ change_event_type: z.ZodEnum<typeof ChangeEventType>;
18
+ }, z.core.$strip>;
19
+ export type ChangedItem = z.infer<typeof changedItemSchema>;
20
+ export declare const runErrorSchema: z.ZodObject<{
21
+ error: z.ZodString;
22
+ code: z.ZodOptional<z.ZodString>;
23
+ timestamp: z.ZodNumber;
24
+ }, z.core.$strip>;
25
+ export type RunError = z.infer<typeof runErrorSchema>;
26
+ export declare const cancelledSchema: z.ZodObject<{
27
+ reason: z.ZodOptional<z.ZodString>;
28
+ timestamp: z.ZodNumber;
29
+ }, z.core.$strip>;
30
+ export type Cancelled = z.infer<typeof cancelledSchema>;
31
+ export declare const functionCallSchema: z.ZodObject<{
32
+ function_name: z.ZodString;
33
+ result: z.ZodString;
34
+ step_id: z.ZodString;
35
+ }, z.core.$strip>;
36
+ export type FunctionCall = z.infer<typeof functionCallSchema>;
37
+ export declare const naturalStopSchema: z.ZodObject<{
38
+ step_id: z.ZodString;
39
+ timestamp: z.ZodNumber;
40
+ }, z.core.$strip>;
41
+ export type NaturalStop = z.infer<typeof naturalStopSchema>;
42
+ export declare const sendModelRequestSchema: z.ZodObject<{
43
+ user_message: z.ZodString;
44
+ timezone: z.ZodString;
45
+ ui_state: z.ZodOptional<z.ZodString>;
46
+ client_turn_id: z.ZodString;
47
+ template_id: z.ZodOptional<z.ZodString>;
48
+ }, z.core.$strip>;
49
+ export type SendModelRequest = z.infer<typeof sendModelRequestSchema>;
50
+ export declare const toolApprovalResponseSchema: z.ZodObject<{
51
+ step_id: z.ZodString;
52
+ approved: z.ZodBoolean;
53
+ rejection_reason: z.ZodOptional<z.ZodString>;
54
+ timestamp: z.ZodNumber;
55
+ }, z.core.$strip>;
56
+ export type ToolApprovalResponse = z.infer<typeof toolApprovalResponseSchema>;
57
+ export declare const toolApprovalRequestSchema: z.ZodObject<{
58
+ step_id: z.ZodString;
59
+ name: z.ZodString;
60
+ arguments: z.ZodString;
61
+ timestamp: z.ZodNumber;
62
+ }, z.core.$strip>;
63
+ export type ToolApprovalRequest = z.infer<typeof toolApprovalRequestSchema>;
64
+ export declare const textDeltaSchema: z.ZodObject<{
65
+ delta: z.ZodString;
66
+ step_id: z.ZodString;
67
+ timestamp: z.ZodNumber;
68
+ }, z.core.$strip>;
69
+ export type TextDelta = z.infer<typeof textDeltaSchema>;
70
+ export declare const toolCallGeneratingSchema: z.ZodObject<{
71
+ tool_name: z.ZodString;
72
+ step_id: z.ZodString;
73
+ timestamp: z.ZodNumber;
74
+ }, z.core.$strip>;
75
+ export type ToolCallGenerating = z.infer<typeof toolCallGeneratingSchema>;
76
+ export declare const toolCallSchema: z.ZodObject<{
77
+ summary: z.ZodString;
78
+ step_id: z.ZodString;
79
+ parameters: z.ZodString;
80
+ integration: z.ZodString;
81
+ timestamp: z.ZodNumber;
82
+ }, z.core.$strip>;
83
+ export type ToolCall = z.infer<typeof toolCallSchema>;
84
+ export declare const thinkingSchema: z.ZodObject<{
85
+ step_id: z.ZodString;
86
+ timestamp: z.ZodNumber;
87
+ }, z.core.$strip>;
88
+ export type Thinking = z.infer<typeof thinkingSchema>;
111
89
  export declare enum ToolCallExecutionStatus {
112
90
  COMPLETED = "completed",
113
91
  INCOMPLETE = "incomplete",
114
92
  FAILED = "failed",
115
93
  UNKNOWN = "unknown"
116
94
  }
117
- export type ToolCallComplete = {
118
- tool_name: string;
119
- timestamp: number;
120
- status: ToolCallExecutionStatus;
121
- step_id: string;
122
- changed_items: ChangedItem[];
123
- integration: string;
124
- url?: string;
125
- result?: string;
126
- errorContext?: SharedErrorContext;
127
- };
128
- export type FilterResult = {
129
- isRelevant: boolean;
130
- reason: string;
131
- confidence: number;
132
- step_id: string;
133
- timestamp: number;
134
- };
95
+ export declare const toolCallExecutionStatusSchema: z.ZodEnum<typeof ToolCallExecutionStatus>;
96
+ export declare const toolCallCompleteSchema: z.ZodObject<{
97
+ tool_name: z.ZodString;
98
+ timestamp: z.ZodNumber;
99
+ status: z.ZodEnum<typeof ToolCallExecutionStatus>;
100
+ step_id: z.ZodString;
101
+ changed_items: z.ZodArray<z.ZodObject<{
102
+ type_name: z.ZodEnum<typeof EntityType>;
103
+ id: z.ZodString;
104
+ change_event_type: z.ZodEnum<typeof ChangeEventType>;
105
+ }, z.core.$strip>>;
106
+ integration: z.ZodString;
107
+ url: z.ZodOptional<z.ZodString>;
108
+ result: z.ZodOptional<z.ZodString>;
109
+ errorContext: z.ZodOptional<z.ZodObject<{
110
+ error: z.ZodUnknown;
111
+ }, z.core.$strip>>;
112
+ }, z.core.$strip>;
113
+ export type ToolCallComplete = z.infer<typeof toolCallCompleteSchema>;
114
+ export declare const filterResultSchema: z.ZodObject<{
115
+ isRelevant: z.ZodBoolean;
116
+ reason: z.ZodString;
117
+ confidence: z.ZodNumber;
118
+ step_id: z.ZodString;
119
+ timestamp: z.ZodNumber;
120
+ }, z.core.$strip>;
121
+ export type FilterResult = z.infer<typeof filterResultSchema>;
135
122
  export declare enum SandboxStage {
136
123
  DOWNLOADING_SOURCE = "downloading_source",
137
124
  BOOTING = "booting",
@@ -139,37 +126,197 @@ export declare enum SandboxStage {
139
126
  INSTALLING_CLI = "installing_cli",
140
127
  RUNNING = "running"
141
128
  }
129
+ export declare const sandboxStageSchema: z.ZodEnum<typeof SandboxStage>;
142
130
  export declare const SANDBOX_STAGE_LABELS: Record<SandboxStage, string>;
143
- export type UserMessage = {
144
- message: string;
145
- step_id: string;
146
- client_turn_id: string;
147
- timestamp: number;
148
- };
149
- export type SnippetVariant = {
150
- type: "button";
151
- label: string;
152
- url: string;
153
- } | {
154
- type: "integration_prompt";
155
- integration: string;
156
- message: string;
157
- stateToken?: string;
158
- } | {
159
- type: "navigate";
160
- path: string;
161
- } | {
162
- type: "multiple_choice";
163
- questionId: string;
164
- question: string;
165
- options: MultipleChoiceOption[];
166
- allowMultiple?: boolean;
167
- } | {
168
- type: "image";
169
- url: string;
170
- };
171
- export type ChatSnippet = {
172
- id?: string;
173
- step_id?: string;
174
- selectedValue?: string;
175
- } & SnippetVariant;
131
+ export declare const userMessageSchema: z.ZodObject<{
132
+ message: z.ZodString;
133
+ step_id: z.ZodString;
134
+ client_turn_id: z.ZodString;
135
+ timestamp: z.ZodNumber;
136
+ }, z.core.$strip>;
137
+ export type UserMessage = z.infer<typeof userMessageSchema>;
138
+ export declare const multipleChoiceOptionSchema: z.ZodObject<{
139
+ label: z.ZodString;
140
+ value: z.ZodString;
141
+ }, z.core.$strip>;
142
+ export declare const snippetVariantSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
143
+ type: z.ZodLiteral<"button">;
144
+ label: z.ZodString;
145
+ url: z.ZodString;
146
+ }, z.core.$strip>, z.ZodObject<{
147
+ type: z.ZodLiteral<"integration_prompt">;
148
+ integration: z.ZodString;
149
+ message: z.ZodString;
150
+ stateToken: z.ZodOptional<z.ZodString>;
151
+ }, z.core.$strip>, z.ZodObject<{
152
+ type: z.ZodLiteral<"navigate">;
153
+ path: z.ZodString;
154
+ }, z.core.$strip>, z.ZodObject<{
155
+ type: z.ZodLiteral<"multiple_choice">;
156
+ questionId: z.ZodString;
157
+ question: z.ZodString;
158
+ options: z.ZodArray<z.ZodObject<{
159
+ label: z.ZodString;
160
+ value: z.ZodString;
161
+ }, z.core.$strip>>;
162
+ allowMultiple: z.ZodOptional<z.ZodBoolean>;
163
+ }, z.core.$strip>, z.ZodObject<{
164
+ type: z.ZodLiteral<"image">;
165
+ url: z.ZodString;
166
+ }, z.core.$strip>], "type">;
167
+ export type SnippetVariant = z.infer<typeof snippetVariantSchema>;
168
+ export declare const chatSnippetSchema: z.ZodIntersection<z.ZodObject<{
169
+ id: z.ZodOptional<z.ZodString>;
170
+ step_id: z.ZodOptional<z.ZodString>;
171
+ selectedValue: z.ZodOptional<z.ZodString>;
172
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
173
+ type: z.ZodLiteral<"button">;
174
+ label: z.ZodString;
175
+ url: z.ZodString;
176
+ }, z.core.$strip>, z.ZodObject<{
177
+ type: z.ZodLiteral<"integration_prompt">;
178
+ integration: z.ZodString;
179
+ message: z.ZodString;
180
+ stateToken: z.ZodOptional<z.ZodString>;
181
+ }, z.core.$strip>, z.ZodObject<{
182
+ type: z.ZodLiteral<"navigate">;
183
+ path: z.ZodString;
184
+ }, z.core.$strip>, z.ZodObject<{
185
+ type: z.ZodLiteral<"multiple_choice">;
186
+ questionId: z.ZodString;
187
+ question: z.ZodString;
188
+ options: z.ZodArray<z.ZodObject<{
189
+ label: z.ZodString;
190
+ value: z.ZodString;
191
+ }, z.core.$strip>>;
192
+ allowMultiple: z.ZodOptional<z.ZodBoolean>;
193
+ }, z.core.$strip>, z.ZodObject<{
194
+ type: z.ZodLiteral<"image">;
195
+ url: z.ZodString;
196
+ }, z.core.$strip>], "type">>;
197
+ export type ChatSnippet = z.infer<typeof chatSnippetSchema>;
198
+ export declare const modelEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
199
+ step_id: z.ZodString;
200
+ approved: z.ZodBoolean;
201
+ rejection_reason: z.ZodOptional<z.ZodString>;
202
+ timestamp: z.ZodNumber;
203
+ type: z.ZodLiteral<"ToolApprovalResponse">;
204
+ }, z.core.$strip>, z.ZodObject<{
205
+ step_id: z.ZodString;
206
+ name: z.ZodString;
207
+ arguments: z.ZodString;
208
+ timestamp: z.ZodNumber;
209
+ type: z.ZodLiteral<"ToolApprovalRequest">;
210
+ }, z.core.$strip>, z.ZodObject<{
211
+ tool_name: z.ZodString;
212
+ step_id: z.ZodString;
213
+ timestamp: z.ZodNumber;
214
+ type: z.ZodLiteral<"ToolCallGenerating">;
215
+ }, z.core.$strip>, z.ZodObject<{
216
+ summary: z.ZodString;
217
+ step_id: z.ZodString;
218
+ parameters: z.ZodString;
219
+ integration: z.ZodString;
220
+ timestamp: z.ZodNumber;
221
+ type: z.ZodLiteral<"ToolCall">;
222
+ }, z.core.$strip>, z.ZodObject<{
223
+ tool_name: z.ZodString;
224
+ timestamp: z.ZodNumber;
225
+ status: z.ZodEnum<typeof ToolCallExecutionStatus>;
226
+ step_id: z.ZodString;
227
+ changed_items: z.ZodArray<z.ZodObject<{
228
+ type_name: z.ZodEnum<typeof EntityType>;
229
+ id: z.ZodString;
230
+ change_event_type: z.ZodEnum<typeof ChangeEventType>;
231
+ }, z.core.$strip>>;
232
+ integration: z.ZodString;
233
+ url: z.ZodOptional<z.ZodString>;
234
+ result: z.ZodOptional<z.ZodString>;
235
+ errorContext: z.ZodOptional<z.ZodObject<{
236
+ error: z.ZodUnknown;
237
+ }, z.core.$strip>>;
238
+ type: z.ZodLiteral<"ToolCallComplete">;
239
+ }, z.core.$strip>, z.ZodObject<{
240
+ delta: z.ZodString;
241
+ step_id: z.ZodString;
242
+ timestamp: z.ZodNumber;
243
+ type: z.ZodLiteral<"TextDelta">;
244
+ }, z.core.$strip>, z.ZodObject<{
245
+ error: z.ZodString;
246
+ code: z.ZodOptional<z.ZodString>;
247
+ timestamp: z.ZodNumber;
248
+ type: z.ZodLiteral<"RunError">;
249
+ }, z.core.$strip>, z.ZodObject<{
250
+ reason: z.ZodOptional<z.ZodString>;
251
+ timestamp: z.ZodNumber;
252
+ type: z.ZodLiteral<"Cancelled">;
253
+ }, z.core.$strip>, z.ZodObject<{
254
+ step_id: z.ZodString;
255
+ timestamp: z.ZodNumber;
256
+ type: z.ZodLiteral<"NaturalStop">;
257
+ }, z.core.$strip>, z.ZodObject<{
258
+ isRelevant: z.ZodBoolean;
259
+ reason: z.ZodString;
260
+ confidence: z.ZodNumber;
261
+ step_id: z.ZodString;
262
+ timestamp: z.ZodNumber;
263
+ type: z.ZodLiteral<"FilterResult">;
264
+ }, z.core.$strip>, z.ZodObject<{
265
+ message: z.ZodString;
266
+ step_id: z.ZodString;
267
+ client_turn_id: z.ZodString;
268
+ timestamp: z.ZodNumber;
269
+ type: z.ZodLiteral<"UserMessage">;
270
+ }, z.core.$strip>, z.ZodObject<{
271
+ step_id: z.ZodString;
272
+ timestamp: z.ZodNumber;
273
+ type: z.ZodLiteral<"Thinking">;
274
+ }, z.core.$strip>, z.ZodObject<{
275
+ type: z.ZodLiteral<"Snippet">;
276
+ timestamp: z.ZodNumber;
277
+ snippet: z.ZodIntersection<z.ZodObject<{
278
+ id: z.ZodOptional<z.ZodString>;
279
+ step_id: z.ZodOptional<z.ZodString>;
280
+ selectedValue: z.ZodOptional<z.ZodString>;
281
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
282
+ type: z.ZodLiteral<"button">;
283
+ label: z.ZodString;
284
+ url: z.ZodString;
285
+ }, z.core.$strip>, z.ZodObject<{
286
+ type: z.ZodLiteral<"integration_prompt">;
287
+ integration: z.ZodString;
288
+ message: z.ZodString;
289
+ stateToken: z.ZodOptional<z.ZodString>;
290
+ }, z.core.$strip>, z.ZodObject<{
291
+ type: z.ZodLiteral<"navigate">;
292
+ path: z.ZodString;
293
+ }, z.core.$strip>, z.ZodObject<{
294
+ type: z.ZodLiteral<"multiple_choice">;
295
+ questionId: z.ZodString;
296
+ question: z.ZodString;
297
+ options: z.ZodArray<z.ZodObject<{
298
+ label: z.ZodString;
299
+ value: z.ZodString;
300
+ }, z.core.$strip>>;
301
+ allowMultiple: z.ZodOptional<z.ZodBoolean>;
302
+ }, z.core.$strip>, z.ZodObject<{
303
+ type: z.ZodLiteral<"image">;
304
+ url: z.ZodString;
305
+ }, z.core.$strip>], "type">>;
306
+ }, z.core.$strip>], "type">;
307
+ export type ModelEvent = z.infer<typeof modelEventSchema>;
308
+ export declare const modelRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
309
+ user_message: z.ZodString;
310
+ timezone: z.ZodString;
311
+ ui_state: z.ZodOptional<z.ZodString>;
312
+ client_turn_id: z.ZodString;
313
+ template_id: z.ZodOptional<z.ZodString>;
314
+ type: z.ZodLiteral<"SendModelRequest">;
315
+ }, z.core.$strip>, z.ZodObject<{
316
+ step_id: z.ZodString;
317
+ approved: z.ZodBoolean;
318
+ rejection_reason: z.ZodOptional<z.ZodString>;
319
+ timestamp: z.ZodNumber;
320
+ type: z.ZodLiteral<"ToolApprovalResponse">;
321
+ }, z.core.$strip>], "type">;
322
+ export type ModelRequest = z.infer<typeof modelRequestSchema>;