@blazingagents/sdk 0.16.0 → 0.18.0
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/contracts/api.d.ts +6 -3
- package/dist/contracts/api.js +2 -1
- package/dist/contracts/entities/agents.d.ts +2 -118
- package/dist/contracts/entities/agents.js +2 -24
- package/dist/contracts/entities/chat.d.ts +0 -12
- package/dist/contracts/entities/chat.js +1 -4
- package/dist/contracts/entities/providers.d.ts +2 -6
- package/dist/contracts/entities/providers.js +2 -9
- package/dist/contracts/entities/session-inputs.d.ts +235 -0
- package/dist/contracts/entities/session-inputs.js +80 -0
- package/dist/contracts/entities/sessions.d.ts +106 -5
- package/dist/contracts/entities/sessions.js +5 -3
- package/dist/contracts/entities/tasks.d.ts +285 -10
- package/dist/contracts/entities/tasks.js +2 -5
- package/dist/contracts/index.d.ts +4 -2
- package/dist/contracts/index.js +3 -2
- package/dist/contracts/limitations.d.ts +0 -2
- package/dist/contracts/limitations.js +0 -2
- package/dist/direct-chat-transport.d.ts +7 -1
- package/dist/direct-chat-transport.js +26 -1
- package/dist/generation.d.ts +1 -1
- package/dist/generation.js +3 -10
- package/dist/index.d.ts +6 -3
- package/dist/index.js +2 -0
- package/dist/relay.d.ts +0 -1
- package/dist/relay.js +0 -2
- package/dist/resources/agents.js +1 -33
- package/dist/resources/providers.js +1 -1
- package/dist/resources/sessions.d.ts +1 -1
- package/dist/resources/sessions.js +50 -3
- package/dist/types.d.ts +52 -23
- package/package.json +1 -1
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const sessionInputStateSchema: z.ZodEnum<{
|
|
3
|
+
accepted: "accepted";
|
|
4
|
+
cancelled: "cancelled";
|
|
5
|
+
committed: "committed";
|
|
6
|
+
consumed: "consumed";
|
|
7
|
+
delivered: "delivered";
|
|
8
|
+
uncertain: "uncertain";
|
|
9
|
+
}>;
|
|
10
|
+
export declare const sessionInputModeSchema: z.ZodEnum<{
|
|
11
|
+
queue: "queue";
|
|
12
|
+
steer: "steer";
|
|
13
|
+
}>;
|
|
14
|
+
export declare const sessionInputRequestIdSchema: z.ZodString;
|
|
15
|
+
export declare const sessionInputSchema: z.ZodObject<{
|
|
16
|
+
requestId: z.ZodString;
|
|
17
|
+
sequence: z.ZodNumber;
|
|
18
|
+
message: z.ZodObject<{
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
parts: z.ZodArray<z.ZodObject<{
|
|
21
|
+
type: z.ZodString;
|
|
22
|
+
}, z.core.$loose>>;
|
|
23
|
+
metadata: z.ZodOptional<z.ZodUnknown>;
|
|
24
|
+
role: z.ZodLiteral<"user">;
|
|
25
|
+
}, z.core.$loose>;
|
|
26
|
+
mode: z.ZodEnum<{
|
|
27
|
+
queue: "queue";
|
|
28
|
+
steer: "steer";
|
|
29
|
+
}>;
|
|
30
|
+
state: z.ZodEnum<{
|
|
31
|
+
accepted: "accepted";
|
|
32
|
+
cancelled: "cancelled";
|
|
33
|
+
committed: "committed";
|
|
34
|
+
consumed: "consumed";
|
|
35
|
+
delivered: "delivered";
|
|
36
|
+
uncertain: "uncertain";
|
|
37
|
+
}>;
|
|
38
|
+
turnId: z.ZodNullable<z.ZodString>;
|
|
39
|
+
createdAt: z.ZodISODateTime;
|
|
40
|
+
updatedAt: z.ZodISODateTime;
|
|
41
|
+
consumedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
42
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
43
|
+
deleted: "deleted";
|
|
44
|
+
failed: "failed";
|
|
45
|
+
owner_lost: "owner_lost";
|
|
46
|
+
stopped: "stopped";
|
|
47
|
+
}>>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export declare const sessionActivitySchema: z.ZodObject<{
|
|
50
|
+
state: z.ZodEnum<{
|
|
51
|
+
approval: "approval";
|
|
52
|
+
idle: "idle";
|
|
53
|
+
paused: "paused";
|
|
54
|
+
running: "running";
|
|
55
|
+
stopping: "stopping";
|
|
56
|
+
}>;
|
|
57
|
+
turnId: z.ZodNullable<z.ZodString>;
|
|
58
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
59
|
+
failed: "failed";
|
|
60
|
+
function_executor_required: "function_executor_required";
|
|
61
|
+
owner_lost: "owner_lost";
|
|
62
|
+
}>>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
export declare const sessionInputResponseSchema: z.ZodObject<{
|
|
65
|
+
data: z.ZodObject<{
|
|
66
|
+
requestId: z.ZodString;
|
|
67
|
+
sequence: z.ZodNumber;
|
|
68
|
+
message: z.ZodObject<{
|
|
69
|
+
id: z.ZodString;
|
|
70
|
+
parts: z.ZodArray<z.ZodObject<{
|
|
71
|
+
type: z.ZodString;
|
|
72
|
+
}, z.core.$loose>>;
|
|
73
|
+
metadata: z.ZodOptional<z.ZodUnknown>;
|
|
74
|
+
role: z.ZodLiteral<"user">;
|
|
75
|
+
}, z.core.$loose>;
|
|
76
|
+
mode: z.ZodEnum<{
|
|
77
|
+
queue: "queue";
|
|
78
|
+
steer: "steer";
|
|
79
|
+
}>;
|
|
80
|
+
state: z.ZodEnum<{
|
|
81
|
+
accepted: "accepted";
|
|
82
|
+
cancelled: "cancelled";
|
|
83
|
+
committed: "committed";
|
|
84
|
+
consumed: "consumed";
|
|
85
|
+
delivered: "delivered";
|
|
86
|
+
uncertain: "uncertain";
|
|
87
|
+
}>;
|
|
88
|
+
turnId: z.ZodNullable<z.ZodString>;
|
|
89
|
+
createdAt: z.ZodISODateTime;
|
|
90
|
+
updatedAt: z.ZodISODateTime;
|
|
91
|
+
consumedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
92
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
93
|
+
deleted: "deleted";
|
|
94
|
+
failed: "failed";
|
|
95
|
+
owner_lost: "owner_lost";
|
|
96
|
+
stopped: "stopped";
|
|
97
|
+
}>>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
activity: z.ZodObject<{
|
|
100
|
+
state: z.ZodEnum<{
|
|
101
|
+
approval: "approval";
|
|
102
|
+
idle: "idle";
|
|
103
|
+
paused: "paused";
|
|
104
|
+
running: "running";
|
|
105
|
+
stopping: "stopping";
|
|
106
|
+
}>;
|
|
107
|
+
turnId: z.ZodNullable<z.ZodString>;
|
|
108
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
109
|
+
failed: "failed";
|
|
110
|
+
function_executor_required: "function_executor_required";
|
|
111
|
+
owner_lost: "owner_lost";
|
|
112
|
+
}>>;
|
|
113
|
+
}, z.core.$strip>;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
export declare const sessionInputsResponseSchema: z.ZodObject<{
|
|
116
|
+
data: z.ZodArray<z.ZodObject<{
|
|
117
|
+
requestId: z.ZodString;
|
|
118
|
+
sequence: z.ZodNumber;
|
|
119
|
+
message: z.ZodObject<{
|
|
120
|
+
id: z.ZodString;
|
|
121
|
+
parts: z.ZodArray<z.ZodObject<{
|
|
122
|
+
type: z.ZodString;
|
|
123
|
+
}, z.core.$loose>>;
|
|
124
|
+
metadata: z.ZodOptional<z.ZodUnknown>;
|
|
125
|
+
role: z.ZodLiteral<"user">;
|
|
126
|
+
}, z.core.$loose>;
|
|
127
|
+
mode: z.ZodEnum<{
|
|
128
|
+
queue: "queue";
|
|
129
|
+
steer: "steer";
|
|
130
|
+
}>;
|
|
131
|
+
state: z.ZodEnum<{
|
|
132
|
+
accepted: "accepted";
|
|
133
|
+
cancelled: "cancelled";
|
|
134
|
+
committed: "committed";
|
|
135
|
+
consumed: "consumed";
|
|
136
|
+
delivered: "delivered";
|
|
137
|
+
uncertain: "uncertain";
|
|
138
|
+
}>;
|
|
139
|
+
turnId: z.ZodNullable<z.ZodString>;
|
|
140
|
+
createdAt: z.ZodISODateTime;
|
|
141
|
+
updatedAt: z.ZodISODateTime;
|
|
142
|
+
consumedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
143
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
144
|
+
deleted: "deleted";
|
|
145
|
+
failed: "failed";
|
|
146
|
+
owner_lost: "owner_lost";
|
|
147
|
+
stopped: "stopped";
|
|
148
|
+
}>>;
|
|
149
|
+
}, z.core.$strip>>;
|
|
150
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
151
|
+
activity: z.ZodObject<{
|
|
152
|
+
state: z.ZodEnum<{
|
|
153
|
+
approval: "approval";
|
|
154
|
+
idle: "idle";
|
|
155
|
+
paused: "paused";
|
|
156
|
+
running: "running";
|
|
157
|
+
stopping: "stopping";
|
|
158
|
+
}>;
|
|
159
|
+
turnId: z.ZodNullable<z.ZodString>;
|
|
160
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
161
|
+
failed: "failed";
|
|
162
|
+
function_executor_required: "function_executor_required";
|
|
163
|
+
owner_lost: "owner_lost";
|
|
164
|
+
}>>;
|
|
165
|
+
}, z.core.$strip>;
|
|
166
|
+
}, z.core.$strip>;
|
|
167
|
+
export declare const submitSessionInputBodySchema: z.ZodObject<{
|
|
168
|
+
requestId: z.ZodString;
|
|
169
|
+
message: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
|
|
170
|
+
whenBusy: z.ZodDefault<z.ZodEnum<{
|
|
171
|
+
queue: "queue";
|
|
172
|
+
steer: "steer";
|
|
173
|
+
}>>;
|
|
174
|
+
}, z.core.$strict>;
|
|
175
|
+
export declare const sessionInputsQuerySchema: z.ZodObject<{
|
|
176
|
+
includeCompleted: z.ZodDefault<z.ZodBoolean>;
|
|
177
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
178
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
179
|
+
}, z.core.$strict>;
|
|
180
|
+
export declare const stopSessionBodySchema: z.ZodObject<{
|
|
181
|
+
turnId: z.ZodString;
|
|
182
|
+
}, z.core.$strict>;
|
|
183
|
+
export declare const stopSessionResponseSchema: z.ZodObject<{
|
|
184
|
+
stoppedTurnId: z.ZodString;
|
|
185
|
+
activity: z.ZodObject<{
|
|
186
|
+
state: z.ZodEnum<{
|
|
187
|
+
approval: "approval";
|
|
188
|
+
idle: "idle";
|
|
189
|
+
paused: "paused";
|
|
190
|
+
running: "running";
|
|
191
|
+
stopping: "stopping";
|
|
192
|
+
}>;
|
|
193
|
+
turnId: z.ZodNullable<z.ZodString>;
|
|
194
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
195
|
+
failed: "failed";
|
|
196
|
+
function_executor_required: "function_executor_required";
|
|
197
|
+
owner_lost: "owner_lost";
|
|
198
|
+
}>>;
|
|
199
|
+
}, z.core.$strip>;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
export declare const resumeSessionInputsResponseSchema: z.ZodObject<{
|
|
202
|
+
activity: z.ZodObject<{
|
|
203
|
+
state: z.ZodEnum<{
|
|
204
|
+
approval: "approval";
|
|
205
|
+
idle: "idle";
|
|
206
|
+
paused: "paused";
|
|
207
|
+
running: "running";
|
|
208
|
+
stopping: "stopping";
|
|
209
|
+
}>;
|
|
210
|
+
turnId: z.ZodNullable<z.ZodString>;
|
|
211
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
212
|
+
failed: "failed";
|
|
213
|
+
function_executor_required: "function_executor_required";
|
|
214
|
+
owner_lost: "owner_lost";
|
|
215
|
+
}>>;
|
|
216
|
+
}, z.core.$strip>;
|
|
217
|
+
}, z.core.$strip>;
|
|
218
|
+
export type SessionInputState = z.infer<typeof sessionInputStateSchema>;
|
|
219
|
+
export type SessionInputMode = z.infer<typeof sessionInputModeSchema>;
|
|
220
|
+
export type SessionInput = z.infer<typeof sessionInputSchema>;
|
|
221
|
+
export type SessionActivity = z.infer<typeof sessionActivitySchema>;
|
|
222
|
+
export type SessionInputResponse = z.infer<typeof sessionInputResponseSchema>;
|
|
223
|
+
export type SessionInputsResponse = z.infer<typeof sessionInputsResponseSchema>;
|
|
224
|
+
export type SubmitSessionInputBody = z.input<typeof submitSessionInputBodySchema>;
|
|
225
|
+
export type SessionInputsQuery = z.input<typeof sessionInputsQuerySchema>;
|
|
226
|
+
export type StopSessionBody = z.infer<typeof stopSessionBodySchema>;
|
|
227
|
+
export type StopSessionResponse = z.infer<typeof stopSessionResponseSchema>;
|
|
228
|
+
export type ResumeSessionInputsResponse = z.infer<typeof resumeSessionInputsResponseSchema>;
|
|
229
|
+
export declare const runSessionInputsBodySchema: z.ZodObject<{
|
|
230
|
+
functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
231
|
+
description: z.ZodString;
|
|
232
|
+
inputSchema: z.ZodCustom<z.core.JSONSchema.JSONSchema, z.core.JSONSchema.JSONSchema>;
|
|
233
|
+
}, z.core.$strict>>>;
|
|
234
|
+
}, z.core.$strict>;
|
|
235
|
+
export type RunSessionInputsBody = z.infer<typeof runSessionInputsBodySchema>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { turnIdSchema } from "../ids.js";
|
|
3
|
+
import { chatFunctionDefinitionsSchema } from "./chat.js";
|
|
4
|
+
import { sessionMessageSchema } from "./sessions.js";
|
|
5
|
+
export const sessionInputStateSchema = z.enum([
|
|
6
|
+
"accepted",
|
|
7
|
+
"delivered",
|
|
8
|
+
"consumed",
|
|
9
|
+
"committed",
|
|
10
|
+
"cancelled",
|
|
11
|
+
"uncertain",
|
|
12
|
+
]);
|
|
13
|
+
export const sessionInputModeSchema = z.enum(["queue", "steer"]);
|
|
14
|
+
export const sessionInputRequestIdSchema = z
|
|
15
|
+
.string()
|
|
16
|
+
.min(1)
|
|
17
|
+
.max(128)
|
|
18
|
+
.refine((requestId) => requestId !== "." && requestId !== "..", {
|
|
19
|
+
message: "requestId must not be a URL dot segment.",
|
|
20
|
+
});
|
|
21
|
+
export const sessionInputSchema = z
|
|
22
|
+
.object({
|
|
23
|
+
requestId: sessionInputRequestIdSchema,
|
|
24
|
+
sequence: z.number().int().positive(),
|
|
25
|
+
message: sessionMessageSchema.extend({ role: z.literal("user") }),
|
|
26
|
+
mode: sessionInputModeSchema,
|
|
27
|
+
state: sessionInputStateSchema,
|
|
28
|
+
turnId: turnIdSchema.nullable(),
|
|
29
|
+
createdAt: z.iso.datetime({ offset: true }),
|
|
30
|
+
updatedAt: z.iso.datetime({ offset: true }),
|
|
31
|
+
consumedAt: z.iso.datetime({ offset: true }).nullable(),
|
|
32
|
+
reason: z.enum(["stopped", "failed", "owner_lost", "deleted"]).nullable(),
|
|
33
|
+
})
|
|
34
|
+
.strip();
|
|
35
|
+
export const sessionActivitySchema = z
|
|
36
|
+
.object({
|
|
37
|
+
state: z.enum(["idle", "running", "stopping", "approval", "paused"]),
|
|
38
|
+
turnId: turnIdSchema.nullable(),
|
|
39
|
+
reason: z
|
|
40
|
+
.enum(["failed", "owner_lost", "function_executor_required"])
|
|
41
|
+
.nullable(),
|
|
42
|
+
})
|
|
43
|
+
.strip();
|
|
44
|
+
export const sessionInputResponseSchema = z
|
|
45
|
+
.object({ data: sessionInputSchema, activity: sessionActivitySchema })
|
|
46
|
+
.strip();
|
|
47
|
+
export const sessionInputsResponseSchema = z
|
|
48
|
+
.object({
|
|
49
|
+
data: z.array(sessionInputSchema),
|
|
50
|
+
nextCursor: z.string().nullable(),
|
|
51
|
+
activity: sessionActivitySchema,
|
|
52
|
+
})
|
|
53
|
+
.strip();
|
|
54
|
+
export const submitSessionInputBodySchema = z
|
|
55
|
+
.object({
|
|
56
|
+
requestId: sessionInputRequestIdSchema,
|
|
57
|
+
/** The HTTP boundary validates the user message with AI SDK. */
|
|
58
|
+
message: z.unknown().refine((message) => message !== undefined),
|
|
59
|
+
whenBusy: sessionInputModeSchema.default("queue"),
|
|
60
|
+
})
|
|
61
|
+
.strict();
|
|
62
|
+
export const sessionInputsQuerySchema = z
|
|
63
|
+
.object({
|
|
64
|
+
includeCompleted: z.boolean().default(false),
|
|
65
|
+
limit: z.number().int().min(1).max(200).default(100),
|
|
66
|
+
cursor: z.string().min(1).optional(),
|
|
67
|
+
})
|
|
68
|
+
.strict();
|
|
69
|
+
export const stopSessionBodySchema = z
|
|
70
|
+
.object({ turnId: turnIdSchema })
|
|
71
|
+
.strict();
|
|
72
|
+
export const stopSessionResponseSchema = z
|
|
73
|
+
.object({ stoppedTurnId: turnIdSchema, activity: sessionActivitySchema })
|
|
74
|
+
.strip();
|
|
75
|
+
export const resumeSessionInputsResponseSchema = z
|
|
76
|
+
.object({ activity: sessionActivitySchema })
|
|
77
|
+
.strip();
|
|
78
|
+
export const runSessionInputsBodySchema = z
|
|
79
|
+
.object({ functions: chatFunctionDefinitionsSchema.optional() })
|
|
80
|
+
.strict();
|
|
@@ -4,7 +4,6 @@ import { z } from "zod";
|
|
|
4
4
|
* leak to the wire; `userId`/`metadata` come from the first successful Turn.
|
|
5
5
|
*/
|
|
6
6
|
export declare const sessionListItemSchema: z.ZodObject<{
|
|
7
|
-
agentVersion: z.ZodNullable<z.ZodNumber>;
|
|
8
7
|
id: z.ZodString;
|
|
9
8
|
messageCount: z.ZodNumber;
|
|
10
9
|
lastMessagePreview: z.ZodNullable<z.ZodString>;
|
|
@@ -15,7 +14,6 @@ export declare const sessionListItemSchema: z.ZodObject<{
|
|
|
15
14
|
}, z.core.$strip>;
|
|
16
15
|
export declare const sessionsListResponseSchema: z.ZodObject<{
|
|
17
16
|
data: z.ZodArray<z.ZodObject<{
|
|
18
|
-
agentVersion: z.ZodNullable<z.ZodNumber>;
|
|
19
17
|
id: z.ZodString;
|
|
20
18
|
messageCount: z.ZodNumber;
|
|
21
19
|
lastMessagePreview: z.ZodNullable<z.ZodString>;
|
|
@@ -26,14 +24,117 @@ export declare const sessionsListResponseSchema: z.ZodObject<{
|
|
|
26
24
|
}, z.core.$strip>>;
|
|
27
25
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
28
26
|
}, z.core.$strip>;
|
|
27
|
+
export declare const sessionResponseSchema: z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
messageCount: z.ZodNumber;
|
|
30
|
+
lastMessagePreview: z.ZodNullable<z.ZodString>;
|
|
31
|
+
userId: z.ZodString;
|
|
32
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
33
|
+
createdAt: z.ZodISODateTime;
|
|
34
|
+
updatedAt: z.ZodISODateTime;
|
|
35
|
+
agentConfig: z.ZodObject<{
|
|
36
|
+
approvalInChat: z.ZodDefault<z.ZodObject<{
|
|
37
|
+
default: z.ZodEnum<{
|
|
38
|
+
auto: "auto";
|
|
39
|
+
deny: "deny";
|
|
40
|
+
full: "full";
|
|
41
|
+
manual: "manual";
|
|
42
|
+
}>;
|
|
43
|
+
overrides: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
44
|
+
tool: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
45
|
+
type: z.ZodLiteral<"builtin">;
|
|
46
|
+
name: z.ZodEnum<{
|
|
47
|
+
activate_skill: "activate_skill";
|
|
48
|
+
bash: "bash";
|
|
49
|
+
delete_memory: "delete_memory";
|
|
50
|
+
edit: "edit";
|
|
51
|
+
get_memory: "get_memory";
|
|
52
|
+
glob: "glob";
|
|
53
|
+
grep: "grep";
|
|
54
|
+
publish_artifacts: "publish_artifacts";
|
|
55
|
+
read: "read";
|
|
56
|
+
save_memory: "save_memory";
|
|
57
|
+
search_memories: "search_memories";
|
|
58
|
+
update_memory: "update_memory";
|
|
59
|
+
write: "write";
|
|
60
|
+
write_todos: "write_todos";
|
|
61
|
+
}>;
|
|
62
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
63
|
+
type: z.ZodLiteral<"mcp">;
|
|
64
|
+
connectionId: z.ZodString;
|
|
65
|
+
name: z.ZodString;
|
|
66
|
+
}, z.core.$strict>], "type">;
|
|
67
|
+
decision: z.ZodEnum<{
|
|
68
|
+
auto: "auto";
|
|
69
|
+
deny: "deny";
|
|
70
|
+
full: "full";
|
|
71
|
+
manual: "manual";
|
|
72
|
+
}>;
|
|
73
|
+
}, z.core.$strict>>>;
|
|
74
|
+
}, z.core.$strict>>;
|
|
75
|
+
approvalInTasks: z.ZodDefault<z.ZodObject<{
|
|
76
|
+
default: z.ZodEnum<{
|
|
77
|
+
auto: "auto";
|
|
78
|
+
deny: "deny";
|
|
79
|
+
full: "full";
|
|
80
|
+
manual: "manual";
|
|
81
|
+
}>;
|
|
82
|
+
overrides: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
83
|
+
tool: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
84
|
+
type: z.ZodLiteral<"builtin">;
|
|
85
|
+
name: z.ZodEnum<{
|
|
86
|
+
activate_skill: "activate_skill";
|
|
87
|
+
bash: "bash";
|
|
88
|
+
delete_memory: "delete_memory";
|
|
89
|
+
edit: "edit";
|
|
90
|
+
get_memory: "get_memory";
|
|
91
|
+
glob: "glob";
|
|
92
|
+
grep: "grep";
|
|
93
|
+
publish_artifacts: "publish_artifacts";
|
|
94
|
+
read: "read";
|
|
95
|
+
save_memory: "save_memory";
|
|
96
|
+
search_memories: "search_memories";
|
|
97
|
+
update_memory: "update_memory";
|
|
98
|
+
write: "write";
|
|
99
|
+
write_todos: "write_todos";
|
|
100
|
+
}>;
|
|
101
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
102
|
+
type: z.ZodLiteral<"mcp">;
|
|
103
|
+
connectionId: z.ZodString;
|
|
104
|
+
name: z.ZodString;
|
|
105
|
+
}, z.core.$strict>], "type">;
|
|
106
|
+
decision: z.ZodEnum<{
|
|
107
|
+
auto: "auto";
|
|
108
|
+
deny: "deny";
|
|
109
|
+
full: "full";
|
|
110
|
+
manual: "manual";
|
|
111
|
+
}>;
|
|
112
|
+
}, z.core.$strict>>>;
|
|
113
|
+
}, z.core.$strict>>;
|
|
114
|
+
name: z.ZodString;
|
|
115
|
+
model: z.ZodNullable<z.ZodString>;
|
|
116
|
+
thinkingLevel: z.ZodNullable<z.ZodString>;
|
|
117
|
+
providerId: z.ZodNullable<z.ZodString>;
|
|
118
|
+
autoCompaction: z.ZodBoolean;
|
|
119
|
+
compactionReserveTokens: z.ZodNumber;
|
|
120
|
+
memoryInjectionEnabled: z.ZodBoolean;
|
|
121
|
+
tools: z.ZodArray<z.ZodEnum<{
|
|
122
|
+
memory: "memory";
|
|
123
|
+
workspace: "workspace";
|
|
124
|
+
write_todos: "write_todos";
|
|
125
|
+
}>>;
|
|
126
|
+
instructions: z.ZodString;
|
|
127
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
128
|
+
mcpConnectionIds: z.ZodArray<z.ZodString>;
|
|
129
|
+
}, z.core.$strip>;
|
|
130
|
+
}, z.core.$strip>;
|
|
29
131
|
/**
|
|
30
132
|
* `GET /v1/sessions/latest` list item — one per Agent: the Agent's most
|
|
31
133
|
* recently updated Session (optionally among one end user's Sessions).
|
|
32
134
|
* Carries `agentId` and the Agent's current model, Thinking level, and status,
|
|
33
|
-
* independently of the Session's
|
|
135
|
+
* independently of the Session's saved configuration.
|
|
34
136
|
*/
|
|
35
137
|
export declare const latestSessionListItemSchema: z.ZodObject<{
|
|
36
|
-
agentVersion: z.ZodNullable<z.ZodNumber>;
|
|
37
138
|
id: z.ZodString;
|
|
38
139
|
messageCount: z.ZodNumber;
|
|
39
140
|
lastMessagePreview: z.ZodNullable<z.ZodString>;
|
|
@@ -51,7 +152,6 @@ export declare const latestSessionListItemSchema: z.ZodObject<{
|
|
|
51
152
|
}, z.core.$strip>;
|
|
52
153
|
export declare const latestSessionsListResponseSchema: z.ZodObject<{
|
|
53
154
|
data: z.ZodArray<z.ZodObject<{
|
|
54
|
-
agentVersion: z.ZodNullable<z.ZodNumber>;
|
|
55
155
|
id: z.ZodString;
|
|
56
156
|
messageCount: z.ZodNumber;
|
|
57
157
|
lastMessagePreview: z.ZodNullable<z.ZodString>;
|
|
@@ -243,6 +343,7 @@ export declare const toolApprovalDecisionResponseSchema: z.ZodObject<{
|
|
|
243
343
|
}>;
|
|
244
344
|
}, z.core.$strip>;
|
|
245
345
|
export type SessionListItem = z.infer<typeof sessionListItemSchema>;
|
|
346
|
+
export type SessionResponse = z.infer<typeof sessionResponseSchema>;
|
|
246
347
|
export type SessionsListResponse = z.infer<typeof sessionsListResponseSchema>;
|
|
247
348
|
export type LatestSessionListItem = z.infer<typeof latestSessionListItemSchema>;
|
|
248
349
|
export type LatestSessionsListResponse = z.infer<typeof latestSessionsListResponseSchema>;
|
|
@@ -3,7 +3,7 @@ import { paginatedResponseSchema } from "../api.js";
|
|
|
3
3
|
import { agentIdSchema, sessionIdSchema } from "../ids.js";
|
|
4
4
|
import { DEFAULT_SESSION_MESSAGES_LIMIT, MAX_SESSION_MESSAGES_LIMIT, } from "../limitations.js";
|
|
5
5
|
import { toolExecutionReferenceSchema } from "./agent-approval.js";
|
|
6
|
-
import {
|
|
6
|
+
import { agentConfigSchema, agentSchema } from "./agents.js";
|
|
7
7
|
import { metadataSchema, userIdSchema } from "./attribution.js";
|
|
8
8
|
/**
|
|
9
9
|
* `GET /v1/agents/{agentId}/sessions` list item. `agentId`/`tenantId` never
|
|
@@ -11,7 +11,6 @@ import { metadataSchema, userIdSchema } from "./attribution.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export const sessionListItemSchema = z
|
|
13
13
|
.object({
|
|
14
|
-
agentVersion: agentVersionNumberSchema.nullable(),
|
|
15
14
|
id: sessionIdSchema,
|
|
16
15
|
messageCount: z.number().int().nonnegative(),
|
|
17
16
|
lastMessagePreview: z.string().nullable(),
|
|
@@ -22,11 +21,14 @@ export const sessionListItemSchema = z
|
|
|
22
21
|
})
|
|
23
22
|
.strip();
|
|
24
23
|
export const sessionsListResponseSchema = paginatedResponseSchema(sessionListItemSchema);
|
|
24
|
+
export const sessionResponseSchema = sessionListItemSchema
|
|
25
|
+
.extend({ agentConfig: agentConfigSchema })
|
|
26
|
+
.strip();
|
|
25
27
|
/**
|
|
26
28
|
* `GET /v1/sessions/latest` list item — one per Agent: the Agent's most
|
|
27
29
|
* recently updated Session (optionally among one end user's Sessions).
|
|
28
30
|
* Carries `agentId` and the Agent's current model, Thinking level, and status,
|
|
29
|
-
* independently of the Session's
|
|
31
|
+
* independently of the Session's saved configuration.
|
|
30
32
|
*/
|
|
31
33
|
export const latestSessionListItemSchema = sessionListItemSchema
|
|
32
34
|
.extend({
|