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.
- package/dist/Configs.d.ts +187 -56
- package/dist/Configs.js +256 -34
- package/dist/Integrations.js +1 -1
- package/dist/ModelEvents.d.ts +302 -155
- package/dist/ModelEvents.js +184 -0
- package/dist/Notifications.d.ts +23 -10
- package/dist/Notifications.js +12 -0
- package/dist/RunHistoryTypes.d.ts +7 -3
- package/dist/RunHistoryTypes.js +5 -6
- package/dist/Tools.d.ts +299 -168
- package/dist/Tools.js +171 -164
- package/dist/ToolsTypes.d.ts +4 -0
- package/dist/ToolsTypes.js +5 -1
- package/dist/types.d.ts +4797 -685
- package/dist/types.js +722 -103
- package/package.json +46 -42
package/dist/ModelEvents.js
CHANGED
|
@@ -1,9 +1,79 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { EntityType } from "./Entities.js";
|
|
3
|
+
export const entityTypeSchema = z.enum(EntityType);
|
|
1
4
|
export var ChangeEventType;
|
|
2
5
|
(function (ChangeEventType) {
|
|
3
6
|
ChangeEventType["CREATED"] = "CREATED";
|
|
4
7
|
ChangeEventType["UPDATED"] = "UPDATED";
|
|
5
8
|
ChangeEventType["ACTION_EXECUTED"] = "ACTION_EXECUTED";
|
|
6
9
|
})(ChangeEventType || (ChangeEventType = {}));
|
|
10
|
+
export const changeEventTypeSchema = z.enum(ChangeEventType);
|
|
11
|
+
export const sharedErrorContextSchema = z.object({
|
|
12
|
+
error: z.unknown()
|
|
13
|
+
});
|
|
14
|
+
export const changedItemSchema = z.object({
|
|
15
|
+
type_name: entityTypeSchema,
|
|
16
|
+
id: z.string(),
|
|
17
|
+
change_event_type: changeEventTypeSchema
|
|
18
|
+
});
|
|
19
|
+
export const runErrorSchema = z.object({
|
|
20
|
+
error: z.string(),
|
|
21
|
+
code: z.string().optional(),
|
|
22
|
+
timestamp: z.number()
|
|
23
|
+
});
|
|
24
|
+
export const cancelledSchema = z.object({
|
|
25
|
+
reason: z.string().optional(),
|
|
26
|
+
timestamp: z.number()
|
|
27
|
+
});
|
|
28
|
+
export const functionCallSchema = z.object({
|
|
29
|
+
function_name: z.string(),
|
|
30
|
+
result: z.string(),
|
|
31
|
+
step_id: z.string()
|
|
32
|
+
});
|
|
33
|
+
export const naturalStopSchema = z.object({
|
|
34
|
+
step_id: z.string(),
|
|
35
|
+
timestamp: z.number()
|
|
36
|
+
});
|
|
37
|
+
export const sendModelRequestSchema = z.object({
|
|
38
|
+
user_message: z.string(),
|
|
39
|
+
timezone: z.string(),
|
|
40
|
+
ui_state: z.string().optional(),
|
|
41
|
+
client_turn_id: z.string(),
|
|
42
|
+
template_id: z.string().optional()
|
|
43
|
+
});
|
|
44
|
+
export const toolApprovalResponseSchema = z.object({
|
|
45
|
+
step_id: z.string(),
|
|
46
|
+
approved: z.boolean(),
|
|
47
|
+
rejection_reason: z.string().optional(),
|
|
48
|
+
timestamp: z.number()
|
|
49
|
+
});
|
|
50
|
+
export const toolApprovalRequestSchema = z.object({
|
|
51
|
+
step_id: z.string(),
|
|
52
|
+
name: z.string(),
|
|
53
|
+
arguments: z.string(),
|
|
54
|
+
timestamp: z.number()
|
|
55
|
+
});
|
|
56
|
+
export const textDeltaSchema = z.object({
|
|
57
|
+
delta: z.string(),
|
|
58
|
+
step_id: z.string(),
|
|
59
|
+
timestamp: z.number()
|
|
60
|
+
});
|
|
61
|
+
export const toolCallGeneratingSchema = z.object({
|
|
62
|
+
tool_name: z.string(),
|
|
63
|
+
step_id: z.string(),
|
|
64
|
+
timestamp: z.number()
|
|
65
|
+
});
|
|
66
|
+
export const toolCallSchema = z.object({
|
|
67
|
+
summary: z.string(),
|
|
68
|
+
step_id: z.string(),
|
|
69
|
+
parameters: z.string(),
|
|
70
|
+
integration: z.string(),
|
|
71
|
+
timestamp: z.number()
|
|
72
|
+
});
|
|
73
|
+
export const thinkingSchema = z.object({
|
|
74
|
+
step_id: z.string(),
|
|
75
|
+
timestamp: z.number()
|
|
76
|
+
});
|
|
7
77
|
export var ToolCallExecutionStatus;
|
|
8
78
|
(function (ToolCallExecutionStatus) {
|
|
9
79
|
ToolCallExecutionStatus["COMPLETED"] = "completed";
|
|
@@ -11,6 +81,25 @@ export var ToolCallExecutionStatus;
|
|
|
11
81
|
ToolCallExecutionStatus["FAILED"] = "failed";
|
|
12
82
|
ToolCallExecutionStatus["UNKNOWN"] = "unknown";
|
|
13
83
|
})(ToolCallExecutionStatus || (ToolCallExecutionStatus = {}));
|
|
84
|
+
export const toolCallExecutionStatusSchema = z.enum(ToolCallExecutionStatus);
|
|
85
|
+
export const toolCallCompleteSchema = z.object({
|
|
86
|
+
tool_name: z.string(),
|
|
87
|
+
timestamp: z.number(),
|
|
88
|
+
status: toolCallExecutionStatusSchema,
|
|
89
|
+
step_id: z.string(),
|
|
90
|
+
changed_items: z.array(changedItemSchema),
|
|
91
|
+
integration: z.string(),
|
|
92
|
+
url: z.string().optional(),
|
|
93
|
+
result: z.string().optional(),
|
|
94
|
+
errorContext: sharedErrorContextSchema.optional()
|
|
95
|
+
});
|
|
96
|
+
export const filterResultSchema = z.object({
|
|
97
|
+
isRelevant: z.boolean(),
|
|
98
|
+
reason: z.string(),
|
|
99
|
+
confidence: z.number(),
|
|
100
|
+
step_id: z.string(),
|
|
101
|
+
timestamp: z.number()
|
|
102
|
+
});
|
|
14
103
|
export var SandboxStage;
|
|
15
104
|
(function (SandboxStage) {
|
|
16
105
|
SandboxStage["DOWNLOADING_SOURCE"] = "downloading_source";
|
|
@@ -19,6 +108,7 @@ export var SandboxStage;
|
|
|
19
108
|
SandboxStage["INSTALLING_CLI"] = "installing_cli";
|
|
20
109
|
SandboxStage["RUNNING"] = "running";
|
|
21
110
|
})(SandboxStage || (SandboxStage = {}));
|
|
111
|
+
export const sandboxStageSchema = z.enum(SandboxStage);
|
|
22
112
|
export const SANDBOX_STAGE_LABELS = {
|
|
23
113
|
[SandboxStage.DOWNLOADING_SOURCE]: "Downloading source code",
|
|
24
114
|
[SandboxStage.BOOTING]: "Booting sandbox",
|
|
@@ -26,3 +116,97 @@ export const SANDBOX_STAGE_LABELS = {
|
|
|
26
116
|
[SandboxStage.INSTALLING_CLI]: "Installing CLI",
|
|
27
117
|
[SandboxStage.RUNNING]: "Running agent"
|
|
28
118
|
};
|
|
119
|
+
export const userMessageSchema = z.object({
|
|
120
|
+
message: z.string(),
|
|
121
|
+
step_id: z.string(),
|
|
122
|
+
client_turn_id: z.string(),
|
|
123
|
+
timestamp: z.number()
|
|
124
|
+
});
|
|
125
|
+
export const multipleChoiceOptionSchema = z.object({
|
|
126
|
+
label: z.string(),
|
|
127
|
+
value: z.string()
|
|
128
|
+
});
|
|
129
|
+
export const snippetVariantSchema = z.discriminatedUnion("type", [
|
|
130
|
+
z.object({
|
|
131
|
+
type: z.literal("button"),
|
|
132
|
+
label: z.string(),
|
|
133
|
+
url: z.string()
|
|
134
|
+
}),
|
|
135
|
+
z.object({
|
|
136
|
+
type: z.literal("integration_prompt"),
|
|
137
|
+
integration: z.string(),
|
|
138
|
+
message: z.string(),
|
|
139
|
+
stateToken: z.string().optional()
|
|
140
|
+
}),
|
|
141
|
+
z.object({
|
|
142
|
+
type: z.literal("navigate"),
|
|
143
|
+
path: z.string()
|
|
144
|
+
}),
|
|
145
|
+
z.object({
|
|
146
|
+
type: z.literal("multiple_choice"),
|
|
147
|
+
questionId: z.string(),
|
|
148
|
+
question: z.string(),
|
|
149
|
+
options: z.array(multipleChoiceOptionSchema),
|
|
150
|
+
allowMultiple: z.boolean().optional()
|
|
151
|
+
}),
|
|
152
|
+
z.object({
|
|
153
|
+
type: z.literal("image"),
|
|
154
|
+
url: z.string()
|
|
155
|
+
})
|
|
156
|
+
]);
|
|
157
|
+
export const chatSnippetSchema = z.intersection(z.object({
|
|
158
|
+
id: z.string().optional(),
|
|
159
|
+
step_id: z.string().optional(),
|
|
160
|
+
selectedValue: z.string().optional()
|
|
161
|
+
}), snippetVariantSchema);
|
|
162
|
+
export const modelEventSchema = z.discriminatedUnion("type", [
|
|
163
|
+
toolApprovalResponseSchema.extend({
|
|
164
|
+
type: z.literal("ToolApprovalResponse")
|
|
165
|
+
}),
|
|
166
|
+
toolApprovalRequestSchema.extend({
|
|
167
|
+
type: z.literal("ToolApprovalRequest")
|
|
168
|
+
}),
|
|
169
|
+
toolCallGeneratingSchema.extend({
|
|
170
|
+
type: z.literal("ToolCallGenerating")
|
|
171
|
+
}),
|
|
172
|
+
toolCallSchema.extend({
|
|
173
|
+
type: z.literal("ToolCall")
|
|
174
|
+
}),
|
|
175
|
+
toolCallCompleteSchema.extend({
|
|
176
|
+
type: z.literal("ToolCallComplete")
|
|
177
|
+
}),
|
|
178
|
+
textDeltaSchema.extend({
|
|
179
|
+
type: z.literal("TextDelta")
|
|
180
|
+
}),
|
|
181
|
+
runErrorSchema.extend({
|
|
182
|
+
type: z.literal("RunError")
|
|
183
|
+
}),
|
|
184
|
+
cancelledSchema.extend({
|
|
185
|
+
type: z.literal("Cancelled")
|
|
186
|
+
}),
|
|
187
|
+
naturalStopSchema.extend({
|
|
188
|
+
type: z.literal("NaturalStop")
|
|
189
|
+
}),
|
|
190
|
+
filterResultSchema.extend({
|
|
191
|
+
type: z.literal("FilterResult")
|
|
192
|
+
}),
|
|
193
|
+
userMessageSchema.extend({
|
|
194
|
+
type: z.literal("UserMessage")
|
|
195
|
+
}),
|
|
196
|
+
thinkingSchema.extend({
|
|
197
|
+
type: z.literal("Thinking")
|
|
198
|
+
}),
|
|
199
|
+
z.object({
|
|
200
|
+
type: z.literal("Snippet"),
|
|
201
|
+
timestamp: z.number(),
|
|
202
|
+
snippet: chatSnippetSchema
|
|
203
|
+
})
|
|
204
|
+
]);
|
|
205
|
+
export const modelRequestSchema = z.discriminatedUnion("type", [
|
|
206
|
+
sendModelRequestSchema.extend({
|
|
207
|
+
type: z.literal("SendModelRequest")
|
|
208
|
+
}),
|
|
209
|
+
toolApprovalResponseSchema.extend({
|
|
210
|
+
type: z.literal("ToolApprovalResponse")
|
|
211
|
+
})
|
|
212
|
+
]);
|
package/dist/Notifications.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
import { RunHistoryActionType } from "./RunHistoryTypes.js";
|
|
2
3
|
export interface NotificationDestination {
|
|
3
4
|
id: string;
|
|
@@ -30,13 +31,25 @@ export interface SlackNotificationDestination extends NotificationDestination {
|
|
|
30
31
|
slackUserId?: string;
|
|
31
32
|
slackUserName?: string;
|
|
32
33
|
}
|
|
33
|
-
export
|
|
34
|
-
type: NotificationDestinationType
|
|
35
|
-
email
|
|
36
|
-
integrationId
|
|
37
|
-
slackChannelId
|
|
38
|
-
slackChannelName
|
|
39
|
-
slackUserId
|
|
40
|
-
slackUserName
|
|
41
|
-
isActive
|
|
42
|
-
}
|
|
34
|
+
export declare const createNotificationDestinationRequestSchema: z.ZodObject<{
|
|
35
|
+
type: z.ZodEnum<typeof NotificationDestinationType>;
|
|
36
|
+
email: z.ZodOptional<z.ZodEmail>;
|
|
37
|
+
integrationId: z.ZodOptional<z.ZodString>;
|
|
38
|
+
slackChannelId: z.ZodOptional<z.ZodString>;
|
|
39
|
+
slackChannelName: z.ZodOptional<z.ZodString>;
|
|
40
|
+
slackUserId: z.ZodOptional<z.ZodString>;
|
|
41
|
+
slackUserName: z.ZodOptional<z.ZodString>;
|
|
42
|
+
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export type CreateNotificationDestinationRequest = z.infer<typeof createNotificationDestinationRequestSchema>;
|
|
45
|
+
export declare const updateNotificationDestinationRequestSchema: z.ZodObject<{
|
|
46
|
+
type: z.ZodOptional<z.ZodEnum<typeof NotificationDestinationType>>;
|
|
47
|
+
email: z.ZodOptional<z.ZodOptional<z.ZodEmail>>;
|
|
48
|
+
integrationId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
49
|
+
slackChannelId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
50
|
+
slackChannelName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
51
|
+
slackUserId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
52
|
+
slackUserName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
53
|
+
isActive: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
export type UpdateNotificationDestinationRequest = z.infer<typeof updateNotificationDestinationRequestSchema>;
|
package/dist/Notifications.js
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
export var NotificationDestinationType;
|
|
2
3
|
(function (NotificationDestinationType) {
|
|
3
4
|
NotificationDestinationType["EMAIL"] = "email";
|
|
4
5
|
NotificationDestinationType["SLACK"] = "slack";
|
|
5
6
|
})(NotificationDestinationType || (NotificationDestinationType = {}));
|
|
7
|
+
export const createNotificationDestinationRequestSchema = z.object({
|
|
8
|
+
type: z.enum(NotificationDestinationType),
|
|
9
|
+
email: z.email().optional(),
|
|
10
|
+
integrationId: z.string().optional(),
|
|
11
|
+
slackChannelId: z.string().optional(),
|
|
12
|
+
slackChannelName: z.string().optional(),
|
|
13
|
+
slackUserId: z.string().optional(),
|
|
14
|
+
slackUserName: z.string().optional(),
|
|
15
|
+
isActive: z.boolean().optional()
|
|
16
|
+
});
|
|
17
|
+
export const updateNotificationDestinationRequestSchema = createNotificationDestinationRequestSchema.partial();
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import { ConfigType } from "./Configs.js";
|
|
3
2
|
import { IntegrationType } from "./Integrations.js";
|
|
4
3
|
import type { ModelEvent } from "./ModelEvents.js";
|
|
5
4
|
import type { User } from "./types.js";
|
|
@@ -14,6 +13,11 @@ export declare enum RunHistoryStatus {
|
|
|
14
13
|
export type RunHistoryDecisionAction = "processed" | "skipped";
|
|
15
14
|
export declare const RUN_HISTORY_ACTION_TYPES: readonly ["create", "update", "delete", "read", "approve", "error"];
|
|
16
15
|
export type RunHistoryActionType = (typeof RUN_HISTORY_ACTION_TYPES)[number];
|
|
16
|
+
export declare const outputItemSchema: z.ZodObject<{
|
|
17
|
+
output_item_id: z.ZodString;
|
|
18
|
+
output_item_type: z.ZodEnum<typeof import("./Configs.js").ConfigType>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type OutputItem = z.infer<typeof outputItemSchema>;
|
|
17
21
|
export declare const runHistoryActionBaseSchema: z.ZodObject<{
|
|
18
22
|
action: z.ZodString;
|
|
19
23
|
integration: z.ZodEnum<typeof IntegrationType>;
|
|
@@ -22,17 +26,17 @@ export declare const runHistoryActionBaseSchema: z.ZodObject<{
|
|
|
22
26
|
url: z.ZodOptional<z.ZodString>;
|
|
23
27
|
step_id: z.ZodOptional<z.ZodString>;
|
|
24
28
|
type: z.ZodEnum<{
|
|
29
|
+
error: "error";
|
|
25
30
|
create: "create";
|
|
26
31
|
update: "update";
|
|
27
32
|
delete: "delete";
|
|
28
33
|
read: "read";
|
|
29
34
|
approve: "approve";
|
|
30
|
-
error: "error";
|
|
31
35
|
}>;
|
|
32
36
|
isReadOnly: z.ZodOptional<z.ZodBoolean>;
|
|
33
37
|
output_items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
34
38
|
output_item_id: z.ZodString;
|
|
35
|
-
output_item_type: z.ZodEnum<typeof ConfigType>;
|
|
39
|
+
output_item_type: z.ZodEnum<typeof import("./Configs.js").ConfigType>;
|
|
36
40
|
}, z.core.$strip>>>;
|
|
37
41
|
}, z.core.$strip>;
|
|
38
42
|
export type RunHistoryAction = z.infer<typeof runHistoryActionBaseSchema>;
|
package/dist/RunHistoryTypes.js
CHANGED
|
@@ -11,6 +11,10 @@ export var RunHistoryStatus;
|
|
|
11
11
|
RunHistoryStatus["AWAITING_APPROVAL"] = "awaiting_approval";
|
|
12
12
|
})(RunHistoryStatus || (RunHistoryStatus = {}));
|
|
13
13
|
export const RUN_HISTORY_ACTION_TYPES = ["create", "update", "delete", "read", "approve", "error"];
|
|
14
|
+
export const outputItemSchema = z.object({
|
|
15
|
+
output_item_id: z.string(),
|
|
16
|
+
output_item_type: configTypeEnum
|
|
17
|
+
});
|
|
14
18
|
export const runHistoryActionBaseSchema = z.object({
|
|
15
19
|
action: z.string(),
|
|
16
20
|
integration: integrationTypeEnum,
|
|
@@ -20,10 +24,5 @@ export const runHistoryActionBaseSchema = z.object({
|
|
|
20
24
|
step_id: z.string().optional(),
|
|
21
25
|
type: z.enum(RUN_HISTORY_ACTION_TYPES),
|
|
22
26
|
isReadOnly: z.boolean().optional(),
|
|
23
|
-
output_items: z
|
|
24
|
-
.array(z.object({
|
|
25
|
-
output_item_id: z.string(),
|
|
26
|
-
output_item_type: configTypeEnum
|
|
27
|
-
}))
|
|
28
|
-
.optional()
|
|
27
|
+
output_items: z.array(outputItemSchema).optional()
|
|
29
28
|
});
|