@flexkit/agent-protocol 0.3.9 → 0.3.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.
- package/dist/index.d.ts +89 -15
- package/dist/index.js +38 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,27 @@ declare const userQuestionAnswerSchema: z.ZodObject<{
|
|
|
23
23
|
other: z.ZodOptional<z.ZodString>;
|
|
24
24
|
selected: z.ZodArray<z.ZodString>;
|
|
25
25
|
}, z.core.$strip>;
|
|
26
|
+
/** Where a passage sits in its knowledge source: page (PDF), slide (PowerPoint) or heading path (Word, Markdown, HTML). */
|
|
27
|
+
declare const knowledgeLocatorSchema: z.ZodObject<{
|
|
28
|
+
headingPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
29
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
slide: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
/** One passage the Search Knowledge tool returned; the chat lists it under "Used N sources". */
|
|
33
|
+
declare const knowledgeCitationSchema: z.ZodObject<{
|
|
34
|
+
excerpt: z.ZodString;
|
|
35
|
+
locator: z.ZodObject<{
|
|
36
|
+
headingPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
37
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
slide: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
passageId: z.ZodString;
|
|
41
|
+
sourceId: z.ZodString;
|
|
42
|
+
sourceTitle: z.ZodString;
|
|
43
|
+
versionId: z.ZodString;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
type KnowledgeLocator = z.infer<typeof knowledgeLocatorSchema>;
|
|
46
|
+
type KnowledgeCitation = z.infer<typeof knowledgeCitationSchema>;
|
|
26
47
|
declare const dataPartSchema: z.ZodObject<{
|
|
27
48
|
'plugin-connection': z.ZodObject<{
|
|
28
49
|
pluginId: z.ZodString;
|
|
@@ -41,9 +62,9 @@ declare const dataPartSchema: z.ZodObject<{
|
|
|
41
62
|
pluginId: z.ZodString;
|
|
42
63
|
tool: z.ZodString;
|
|
43
64
|
status: z.ZodEnum<{
|
|
65
|
+
error: "error";
|
|
44
66
|
loading: "loading";
|
|
45
67
|
done: "done";
|
|
46
|
-
error: "error";
|
|
47
68
|
}>;
|
|
48
69
|
error: z.ZodOptional<z.ZodObject<{
|
|
49
70
|
message: z.ZodString;
|
|
@@ -77,8 +98,8 @@ declare const dataPartSchema: z.ZodObject<{
|
|
|
77
98
|
}, z.core.$strip>>;
|
|
78
99
|
resultPreview: z.ZodOptional<z.ZodString>;
|
|
79
100
|
status: z.ZodEnum<{
|
|
80
|
-
done: "done";
|
|
81
101
|
error: "error";
|
|
102
|
+
done: "done";
|
|
82
103
|
running: "running";
|
|
83
104
|
}>;
|
|
84
105
|
stepsUsed: z.ZodOptional<z.ZodNumber>;
|
|
@@ -98,9 +119,9 @@ declare const dataPartSchema: z.ZodObject<{
|
|
|
98
119
|
'create-sandbox': z.ZodObject<{
|
|
99
120
|
sandboxId: z.ZodOptional<z.ZodString>;
|
|
100
121
|
status: z.ZodEnum<{
|
|
122
|
+
error: "error";
|
|
101
123
|
loading: "loading";
|
|
102
124
|
done: "done";
|
|
103
|
-
error: "error";
|
|
104
125
|
}>;
|
|
105
126
|
error: z.ZodOptional<z.ZodObject<{
|
|
106
127
|
message: z.ZodString;
|
|
@@ -109,8 +130,8 @@ declare const dataPartSchema: z.ZodObject<{
|
|
|
109
130
|
'generating-files': z.ZodObject<{
|
|
110
131
|
paths: z.ZodArray<z.ZodString>;
|
|
111
132
|
status: z.ZodEnum<{
|
|
112
|
-
done: "done";
|
|
113
133
|
error: "error";
|
|
134
|
+
done: "done";
|
|
114
135
|
generating: "generating";
|
|
115
136
|
uploading: "uploading";
|
|
116
137
|
uploaded: "uploaded";
|
|
@@ -134,8 +155,8 @@ declare const dataPartSchema: z.ZodObject<{
|
|
|
134
155
|
}>>;
|
|
135
156
|
sizeBytes: z.ZodOptional<z.ZodNumber>;
|
|
136
157
|
status: z.ZodEnum<{
|
|
137
|
-
done: "done";
|
|
138
158
|
error: "error";
|
|
159
|
+
done: "done";
|
|
139
160
|
uploading: "uploading";
|
|
140
161
|
}>;
|
|
141
162
|
url: z.ZodOptional<z.ZodString>;
|
|
@@ -146,8 +167,8 @@ declare const dataPartSchema: z.ZodObject<{
|
|
|
146
167
|
command: z.ZodString;
|
|
147
168
|
args: z.ZodArray<z.ZodString>;
|
|
148
169
|
status: z.ZodEnum<{
|
|
149
|
-
done: "done";
|
|
150
170
|
error: "error";
|
|
171
|
+
done: "done";
|
|
151
172
|
running: "running";
|
|
152
173
|
executing: "executing";
|
|
153
174
|
waiting: "waiting";
|
|
@@ -160,9 +181,9 @@ declare const dataPartSchema: z.ZodObject<{
|
|
|
160
181
|
'search-schema': z.ZodObject<{
|
|
161
182
|
query: z.ZodOptional<z.ZodString>;
|
|
162
183
|
status: z.ZodEnum<{
|
|
184
|
+
error: "error";
|
|
163
185
|
loading: "loading";
|
|
164
186
|
done: "done";
|
|
165
|
-
error: "error";
|
|
166
187
|
}>;
|
|
167
188
|
error: z.ZodOptional<z.ZodObject<{
|
|
168
189
|
message: z.ZodString;
|
|
@@ -171,9 +192,49 @@ declare const dataPartSchema: z.ZodObject<{
|
|
|
171
192
|
'web-search': z.ZodObject<{
|
|
172
193
|
query: z.ZodString;
|
|
173
194
|
status: z.ZodEnum<{
|
|
195
|
+
error: "error";
|
|
196
|
+
loading: "loading";
|
|
197
|
+
done: "done";
|
|
198
|
+
}>;
|
|
199
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
200
|
+
message: z.ZodString;
|
|
201
|
+
}, z.core.$strip>>;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
'knowledge-search': z.ZodObject<{
|
|
204
|
+
query: z.ZodString;
|
|
205
|
+
results: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
206
|
+
excerpt: z.ZodString;
|
|
207
|
+
locator: z.ZodObject<{
|
|
208
|
+
headingPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
209
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
210
|
+
slide: z.ZodOptional<z.ZodNumber>;
|
|
211
|
+
}, z.core.$strip>;
|
|
212
|
+
passageId: z.ZodString;
|
|
213
|
+
sourceId: z.ZodString;
|
|
214
|
+
sourceTitle: z.ZodString;
|
|
215
|
+
versionId: z.ZodString;
|
|
216
|
+
}, z.core.$strip>>>;
|
|
217
|
+
status: z.ZodEnum<{
|
|
218
|
+
error: "error";
|
|
174
219
|
loading: "loading";
|
|
175
220
|
done: "done";
|
|
221
|
+
}>;
|
|
222
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
223
|
+
message: z.ZodString;
|
|
224
|
+
}, z.core.$strip>>;
|
|
225
|
+
}, z.core.$strip>;
|
|
226
|
+
'read-source': z.ZodObject<{
|
|
227
|
+
sourceId: z.ZodString;
|
|
228
|
+
sourceTitle: z.ZodOptional<z.ZodString>;
|
|
229
|
+
locator: z.ZodOptional<z.ZodObject<{
|
|
230
|
+
headingPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
231
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
232
|
+
slide: z.ZodOptional<z.ZodNumber>;
|
|
233
|
+
}, z.core.$strip>>;
|
|
234
|
+
status: z.ZodEnum<{
|
|
176
235
|
error: "error";
|
|
236
|
+
loading: "loading";
|
|
237
|
+
done: "done";
|
|
177
238
|
}>;
|
|
178
239
|
error: z.ZodOptional<z.ZodObject<{
|
|
179
240
|
message: z.ZodString;
|
|
@@ -187,9 +248,9 @@ declare const dataPartSchema: z.ZodObject<{
|
|
|
187
248
|
teams: "teams";
|
|
188
249
|
}>;
|
|
189
250
|
status: z.ZodEnum<{
|
|
251
|
+
error: "error";
|
|
190
252
|
loading: "loading";
|
|
191
253
|
done: "done";
|
|
192
|
-
error: "error";
|
|
193
254
|
}>;
|
|
194
255
|
error: z.ZodOptional<z.ZodObject<{
|
|
195
256
|
message: z.ZodString;
|
|
@@ -197,8 +258,8 @@ declare const dataPartSchema: z.ZodObject<{
|
|
|
197
258
|
}, z.core.$strip>;
|
|
198
259
|
'validate-graphql': z.ZodObject<{
|
|
199
260
|
status: z.ZodEnum<{
|
|
200
|
-
loading: "loading";
|
|
201
261
|
error: "error";
|
|
262
|
+
loading: "loading";
|
|
202
263
|
valid: "valid";
|
|
203
264
|
invalid: "invalid";
|
|
204
265
|
}>;
|
|
@@ -213,9 +274,9 @@ declare const dataPartSchema: z.ZodObject<{
|
|
|
213
274
|
mutation: "mutation";
|
|
214
275
|
}>>;
|
|
215
276
|
status: z.ZodEnum<{
|
|
277
|
+
error: "error";
|
|
216
278
|
loading: "loading";
|
|
217
279
|
done: "done";
|
|
218
|
-
error: "error";
|
|
219
280
|
}>;
|
|
220
281
|
error: z.ZodOptional<z.ZodObject<{
|
|
221
282
|
message: z.ZodString;
|
|
@@ -232,9 +293,9 @@ declare const dataPartSchema: z.ZodObject<{
|
|
|
232
293
|
}>;
|
|
233
294
|
rowCount: z.ZodNumber;
|
|
234
295
|
status: z.ZodEnum<{
|
|
296
|
+
error: "error";
|
|
235
297
|
loading: "loading";
|
|
236
298
|
done: "done";
|
|
237
|
-
error: "error";
|
|
238
299
|
}>;
|
|
239
300
|
}, z.core.$strip>;
|
|
240
301
|
'mutation-approval': z.ZodObject<{
|
|
@@ -263,9 +324,9 @@ declare const dataPartSchema: z.ZodObject<{
|
|
|
263
324
|
operationName: z.ZodString;
|
|
264
325
|
processedItems: z.ZodOptional<z.ZodNumber>;
|
|
265
326
|
status: z.ZodEnum<{
|
|
327
|
+
error: "error";
|
|
266
328
|
loading: "loading";
|
|
267
329
|
done: "done";
|
|
268
|
-
error: "error";
|
|
269
330
|
running: "running";
|
|
270
331
|
}>;
|
|
271
332
|
totalItems: z.ZodOptional<z.ZodNumber>;
|
|
@@ -275,9 +336,9 @@ declare const dataPartSchema: z.ZodObject<{
|
|
|
275
336
|
}, z.core.$strip>;
|
|
276
337
|
'update-memory': z.ZodObject<{
|
|
277
338
|
status: z.ZodEnum<{
|
|
339
|
+
error: "error";
|
|
278
340
|
loading: "loading";
|
|
279
341
|
done: "done";
|
|
280
|
-
error: "error";
|
|
281
342
|
}>;
|
|
282
343
|
error: z.ZodOptional<z.ZodObject<{
|
|
283
344
|
message: z.ZodString;
|
|
@@ -287,9 +348,9 @@ declare const dataPartSchema: z.ZodObject<{
|
|
|
287
348
|
attached: z.ZodOptional<z.ZodBoolean>;
|
|
288
349
|
skillName: z.ZodOptional<z.ZodString>;
|
|
289
350
|
status: z.ZodEnum<{
|
|
351
|
+
error: "error";
|
|
290
352
|
loading: "loading";
|
|
291
353
|
done: "done";
|
|
292
|
-
error: "error";
|
|
293
354
|
}>;
|
|
294
355
|
error: z.ZodOptional<z.ZodObject<{
|
|
295
356
|
message: z.ZodString;
|
|
@@ -318,6 +379,8 @@ declare const dataPartSchema: z.ZodObject<{
|
|
|
318
379
|
mediaType: z.ZodString;
|
|
319
380
|
sizeBytes: z.ZodNumber;
|
|
320
381
|
url: z.ZodString;
|
|
382
|
+
sha256: z.ZodOptional<z.ZodString>;
|
|
383
|
+
knowledgeSourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
321
384
|
}, z.core.$strip>>;
|
|
322
385
|
messageId: z.ZodString;
|
|
323
386
|
monitorEvent: z.ZodOptional<z.ZodObject<{
|
|
@@ -597,6 +660,13 @@ interface AgentChatAttachment {
|
|
|
597
660
|
mediaType: string;
|
|
598
661
|
sizeBytes: number;
|
|
599
662
|
url: string;
|
|
663
|
+
/** Lowercase hex SHA-256 of the file, computed by the Studio while uploading. */
|
|
664
|
+
sha256?: string;
|
|
665
|
+
/**
|
|
666
|
+
* Set by the platform when a chat is read: the Knowledge document with the
|
|
667
|
+
* same content the reader may see, or null when there is none.
|
|
668
|
+
*/
|
|
669
|
+
knowledgeSourceId?: string | null;
|
|
600
670
|
}
|
|
601
671
|
/** UIMessage-shaped part persisted for finished turns. */
|
|
602
672
|
interface AgentChatPart {
|
|
@@ -610,6 +680,10 @@ interface AgentChatPart {
|
|
|
610
680
|
output?: unknown;
|
|
611
681
|
/** `file` parts: byte size of a user attachment. */
|
|
612
682
|
sizeBytes?: number;
|
|
683
|
+
/** `file` parts: SHA-256 of the attachment when the Studio computed it. */
|
|
684
|
+
sha256?: string;
|
|
685
|
+
/** `file` parts: the Knowledge document with the same content the reader may see, or null; set when a chat is read. */
|
|
686
|
+
knowledgeSourceId?: string | null;
|
|
613
687
|
state?: string;
|
|
614
688
|
text?: string;
|
|
615
689
|
toolCallId?: string;
|
|
@@ -698,4 +772,4 @@ type AgentChatQuestionResponse = {
|
|
|
698
772
|
action: 'dismiss';
|
|
699
773
|
};
|
|
700
774
|
|
|
701
|
-
export { type ActivityItem, type ActivityItemKind, type ActivityItemResolution, type ActivityItemState, type ActivityItemsPage, type ActivitySummary, type AgentChat, type AgentChatAttachment, type AgentChatFollowUp, type AgentChatFollowUpDelivery, type AgentChatFollowUpResult, type AgentChatMessage, type AgentChatMessageKind, type AgentChatMessageRole, type AgentChatMessageStatus, type AgentChatMonitor, type AgentChatPart, type AgentChatQuestion, type AgentChatQuestionAnswer, type AgentChatQuestionItem, type AgentChatQuestionResponse, type AgentChatQuestionStatus, type AgentChatTurn, type AgentMonitorSourceType, type AgentMonitorStatus, type AutomationApproval, type AutomationApprovalKind, type AutomationApprovalOperation, type AutomationApprovalPreview, type AutomationApprovalPreviewKind, type AutomationApprovalPreviewOperation, type AutomationApprovalPreviewRow, type AutomationApprovalStatus, type AutomationChangeField, type AutomationChangePreview, type AutomationMutationPolicy, type AutomationNotifyRule, type AutomationProposalPlugin, type AutomationProposalPreview, type AutomationRun, type AutomationRunStatus, type AutomationToolAllowRule, type AutomationTriggerType, type AutomationVisibility, type CreatedAutomationResult, DATA_PART_TYPES, type DataPart, type DataPartMessageType, type DataPartType, type SchemaChangePreviewSummary, dataPartSchema, errorSchema, isDataPartType, userQuestionAnswerSchema, userQuestionSchema };
|
|
775
|
+
export { type ActivityItem, type ActivityItemKind, type ActivityItemResolution, type ActivityItemState, type ActivityItemsPage, type ActivitySummary, type AgentChat, type AgentChatAttachment, type AgentChatFollowUp, type AgentChatFollowUpDelivery, type AgentChatFollowUpResult, type AgentChatMessage, type AgentChatMessageKind, type AgentChatMessageRole, type AgentChatMessageStatus, type AgentChatMonitor, type AgentChatPart, type AgentChatQuestion, type AgentChatQuestionAnswer, type AgentChatQuestionItem, type AgentChatQuestionResponse, type AgentChatQuestionStatus, type AgentChatTurn, type AgentMonitorSourceType, type AgentMonitorStatus, type AutomationApproval, type AutomationApprovalKind, type AutomationApprovalOperation, type AutomationApprovalPreview, type AutomationApprovalPreviewKind, type AutomationApprovalPreviewOperation, type AutomationApprovalPreviewRow, type AutomationApprovalStatus, type AutomationChangeField, type AutomationChangePreview, type AutomationMutationPolicy, type AutomationNotifyRule, type AutomationProposalPlugin, type AutomationProposalPreview, type AutomationRun, type AutomationRunStatus, type AutomationToolAllowRule, type AutomationTriggerType, type AutomationVisibility, type CreatedAutomationResult, DATA_PART_TYPES, type DataPart, type DataPartMessageType, type DataPartType, type KnowledgeCitation, type KnowledgeLocator, type SchemaChangePreviewSummary, dataPartSchema, errorSchema, isDataPartType, knowledgeCitationSchema, knowledgeLocatorSchema, userQuestionAnswerSchema, userQuestionSchema };
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,19 @@ var userQuestionAnswerSchema = z.object({
|
|
|
21
21
|
other: z.string().optional(),
|
|
22
22
|
selected: z.array(z.string())
|
|
23
23
|
});
|
|
24
|
+
var knowledgeLocatorSchema = z.object({
|
|
25
|
+
headingPath: z.array(z.string()).optional(),
|
|
26
|
+
page: z.number().int().positive().optional(),
|
|
27
|
+
slide: z.number().int().positive().optional()
|
|
28
|
+
});
|
|
29
|
+
var knowledgeCitationSchema = z.object({
|
|
30
|
+
excerpt: z.string(),
|
|
31
|
+
locator: knowledgeLocatorSchema,
|
|
32
|
+
passageId: z.string(),
|
|
33
|
+
sourceId: z.string(),
|
|
34
|
+
sourceTitle: z.string(),
|
|
35
|
+
versionId: z.string()
|
|
36
|
+
});
|
|
24
37
|
var dataPartSchema = z.object({
|
|
25
38
|
/** The agent needs a plugin connected (or reconnected): the chat shows a connect card. */
|
|
26
39
|
"plugin-connection": z.object({ pluginId: z.string(), connectionId: z.string().optional() }),
|
|
@@ -119,6 +132,21 @@ var dataPartSchema = z.object({
|
|
|
119
132
|
status: z.enum(["loading", "done", "error"]),
|
|
120
133
|
error: errorSchema.optional()
|
|
121
134
|
}),
|
|
135
|
+
/** A search over the project's knowledge sources; `results` holds the citations once it finished. */
|
|
136
|
+
"knowledge-search": z.object({
|
|
137
|
+
query: z.string(),
|
|
138
|
+
results: z.array(knowledgeCitationSchema).optional(),
|
|
139
|
+
status: z.enum(["loading", "done", "error"]),
|
|
140
|
+
error: errorSchema.optional()
|
|
141
|
+
}),
|
|
142
|
+
/** The agent reading a window of one knowledge source. */
|
|
143
|
+
"read-source": z.object({
|
|
144
|
+
sourceId: z.string(),
|
|
145
|
+
sourceTitle: z.string().optional(),
|
|
146
|
+
locator: knowledgeLocatorSchema.optional(),
|
|
147
|
+
status: z.enum(["loading", "done", "error"]),
|
|
148
|
+
error: errorSchema.optional()
|
|
149
|
+
}),
|
|
122
150
|
"tool-delivery": z.object({
|
|
123
151
|
channelId: z.string(),
|
|
124
152
|
channelName: z.string(),
|
|
@@ -201,7 +229,14 @@ var dataPartSchema = z.object({
|
|
|
201
229
|
*/
|
|
202
230
|
"mid-turn-message": z.object({
|
|
203
231
|
attachments: z.array(
|
|
204
|
-
z.object({
|
|
232
|
+
z.object({
|
|
233
|
+
filename: z.string(),
|
|
234
|
+
mediaType: z.string(),
|
|
235
|
+
sizeBytes: z.number(),
|
|
236
|
+
url: z.string(),
|
|
237
|
+
sha256: z.string().optional(),
|
|
238
|
+
knowledgeSourceId: z.string().nullable().optional()
|
|
239
|
+
})
|
|
205
240
|
),
|
|
206
241
|
messageId: z.string(),
|
|
207
242
|
monitorEvent: monitorEventSchema.optional(),
|
|
@@ -231,6 +266,8 @@ export {
|
|
|
231
266
|
dataPartSchema,
|
|
232
267
|
errorSchema,
|
|
233
268
|
isDataPartType,
|
|
269
|
+
knowledgeCitationSchema,
|
|
270
|
+
knowledgeLocatorSchema,
|
|
234
271
|
userQuestionAnswerSchema,
|
|
235
272
|
userQuestionSchema
|
|
236
273
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/data-parts.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Custom `data-*` parts streamed by the Flexkit agent platform and rendered by\n * Studio. The server validates what it writes against these schemas and the\n * UI derives its part types from them, so the two can never drift.\n */\nexport const errorSchema = z.object({\n message: z.string(),\n});\n\n/** A batch of one monitor's events as the chat card shows it; the model reads a text summary. */\nconst monitorEventSchema = z.object({\n description: z.string(),\n events: z.array(z.object({ createdAt: z.string(), id: z.string(), summary: z.string() })),\n monitorId: z.string(),\n /** Events this message carries, including any beyond the listed ones. */\n total: z.number(),\n});\n\n/** One multiple-choice question the chat agent asks with Ask User Question. */\nexport const userQuestionSchema = z.object({\n /** Short chip label, at most 12 characters. */\n header: z.string(),\n multiSelect: z.boolean(),\n options: z.array(z.object({ description: z.string(), label: z.string() })),\n question: z.string(),\n});\n\n/** The user's answer to one question, by position: chosen option labels plus optional own words. */\nexport const userQuestionAnswerSchema = z.object({\n other: z.string().optional(),\n selected: z.array(z.string()),\n});\n\nexport const dataPartSchema = z.object({\n /** The agent needs a plugin connected (or reconnected): the chat shows a connect card. */\n 'plugin-connection': z.object({ pluginId: z.string(), connectionId: z.string().optional() }),\n /** On a `plugin_connected` message: which plugin the user connected, and the account the agent will use. */\n 'plugin-connected': z.object({\n accountName: z.string().optional(),\n pluginId: z.string(),\n pluginName: z.string(),\n scope: z.enum(['project', 'personal']),\n }),\n /** Lifecycle of one plugin tool call, so the UI can name the in-flight call in its status line. */\n 'plugin-call': z.object({\n pluginId: z.string(),\n tool: z.string(),\n status: z.enum(['loading', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n /** Written when the chat history was summarized before or during a turn. */\n 'context-compaction': z.object({\n reason: z.enum(['threshold', 'context_length_error']),\n status: z.enum(['done']),\n summarizedMessageCount: z.number(),\n }),\n /** The agent's working plan; replaced in place as steps complete. */\n plan: z.object({\n explanation: z.string().optional(),\n steps: z.array(\n z.object({\n status: z.enum(['pending', 'in_progress', 'completed']),\n step: z.string(),\n })\n ),\n updatedAt: z.string(),\n }),\n /** A delegated subtask of an automation run. */\n subtask: z.object({\n error: errorSchema.optional(),\n resultPreview: z.string().optional(),\n status: z.enum(['running', 'done', 'error']),\n stepsUsed: z.number().optional(),\n subtaskId: z.string(),\n title: z.string(),\n }),\n /** json-render patch lines, extracted from the assistant text by the stream pipeline. */\n spec: z.union([\n z.object({\n type: z.literal('patch'),\n patch: z.unknown(),\n }),\n z.object({\n type: z.literal('flat'),\n spec: z.unknown(),\n }),\n z.object({\n type: z.literal('nested'),\n spec: z.unknown(),\n }),\n ]),\n 'create-sandbox': z.object({\n sandboxId: z.string().optional(),\n status: z.enum(['loading', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n 'generating-files': z.object({\n paths: z.array(z.string()),\n status: z.enum(['generating', 'uploading', 'uploaded', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n 'run-artifact': z.object({\n artifactId: z.string().optional(),\n contentType: z.string().optional(),\n error: errorSchema.optional(),\n filename: z.string(),\n kind: z.enum(['html', 'pdf', 'csv', 'json']).optional(),\n sizeBytes: z.number().optional(),\n status: z.enum(['uploading', 'done', 'error']),\n /** Persistent public URL of the stored artifact. */\n url: z.string().optional(),\n }),\n 'run-command': z.object({\n sandboxId: z.string(),\n commandId: z.string().optional(),\n command: z.string(),\n args: z.array(z.string()),\n status: z.enum(['executing', 'running', 'waiting', 'done', 'error']),\n exitCode: z.number().optional(),\n error: errorSchema.optional(),\n }),\n 'search-schema': z.object({\n query: z.string().optional(),\n status: z.enum(['loading', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n 'web-search': z.object({\n query: z.string(),\n status: z.enum(['loading', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n 'tool-delivery': z.object({\n channelId: z.string(),\n channelName: z.string(),\n provider: z.enum(['slack', 'teams']),\n status: z.enum(['loading', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n 'validate-graphql': z.object({\n status: z.enum(['loading', 'valid', 'invalid', 'error']),\n errorCount: z.number().optional(),\n error: errorSchema.optional(),\n }),\n 'execute-graphql': z.object({\n operationType: z.enum(['query', 'mutation']).optional(),\n status: z.enum(['loading', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n /** A data export the server pages through; the file arrives as a `run-artifact` part. */\n 'export-records': z.object({\n error: errorSchema.optional(),\n filename: z.string(),\n format: z.enum(['csv', 'json']),\n /** Rows written so far, then in total. */\n rowCount: z.number(),\n status: z.enum(['loading', 'done', 'error']),\n }),\n /** Emitted for proposals; the UI fetches the full proposal from the approvals API by id. */\n 'mutation-approval': z.object({\n approvalId: z.string(),\n affectedCount: z.number().nullable().optional(),\n decidedBy: z.string().optional(),\n operationsSummary: z.string(),\n reason: z.string().optional(),\n status: z.enum(['pending', 'approved', 'rejected', 'expired', 'cancelled', 'executed', 'error']),\n error: errorSchema.optional(),\n }),\n 'bulk-graphql-action': z.object({\n changedItems: z.number().optional(),\n failedItems: z.number().optional(),\n jobId: z.string().optional(),\n operationName: z.string(),\n processedItems: z.number().optional(),\n status: z.enum(['loading', 'running', 'done', 'error']),\n totalItems: z.number().optional(),\n error: errorSchema.optional(),\n }),\n 'update-memory': z.object({\n status: z.enum(['loading', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n 'load-skill': z.object({\n /** True for skills attached to the automation, injected at run start rather than loaded on demand. */\n attached: z.boolean().optional(),\n skillName: z.string().optional(),\n status: z.enum(['loading', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n /** Marker written by the run workflow for the trigger event so a run replays as a conversation. */\n 'user-message': z.object({\n parts: z.array(z.unknown()),\n }),\n /** Final report written by the run workflow when the agent finishes. */\n 'run-summary': z.object({\n status: z.enum(['success', 'skipped', 'failed']),\n summary: z.string(),\n }),\n /** A chat turn that ended with an error. */\n 'turn-error': z.object({\n message: z.string(),\n }),\n /** One follow-up instruction offered under a finished chat reply; clicking it fills the composer. */\n 'suggested-prompt': z.object({\n prompt: z.string(),\n }),\n /**\n * A message the user sent while the turn was running, at the point in the\n * reply where the agent received it. The UI shows it there, in place of the\n * stored user message it refers to. `monitorEvent` is set when a monitor,\n * not the user, sent it.\n */\n 'mid-turn-message': z.object({\n attachments: z.array(\n z.object({ filename: z.string(), mediaType: z.string(), sizeBytes: z.number(), url: z.string() })\n ),\n messageId: z.string(),\n monitorEvent: monitorEventSchema.optional(),\n text: z.string(),\n }),\n /**\n * Questions the chat agent asked; the turn waits until the user answers.\n * `answers` follow `questions` by position. `message` is set instead when\n * the user answered by typing in the composer.\n */\n 'user-question': z.object({\n answers: z.array(userQuestionAnswerSchema).optional(),\n message: z.string().optional(),\n questionId: z.string(),\n questions: z.array(userQuestionSchema),\n status: z.enum(['pending', 'answered', 'dismissed', 'expired', 'cancelled']),\n }),\n /** Events a chat monitor delivered, on the `monitor_event` message that carries them. */\n 'monitor-event': monitorEventSchema,\n});\n\nexport type DataPart = z.infer<typeof dataPartSchema>;\nexport type DataPartType = keyof DataPart;\n\nexport const DATA_PART_TYPES = Object.keys(dataPartSchema.shape) as DataPartType[];\n\nexport function isDataPartType(type: string): type is DataPartType {\n return (DATA_PART_TYPES as string[]).includes(type);\n}\n\n/** The `type` of a UI message part carrying this data part. */\nexport type DataPartMessageType = `data-${DataPartType}`;\n"],"mappings":";AAAA,SAAS,SAAS;AAOX,IAAM,cAAc,EAAE,OAAO;AAAA,EAClC,SAAS,EAAE,OAAO;AACpB,CAAC;AAGD,I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Q,EAAE,KAAK,CAAC,WAAW,WAAW,QAAQ,CAAC;AAAA,IAC/C,SAAS,EAAE,OAAO;AAAA,EACpB,CAAC;AAAA;AAAA,EAED,cAAc,EAAE,OAAO;AAAA,IACrB,SAAS,EAAE,OAAO;AAAA,EACpB,CAAC;AAAA;AAAA,EAED,oBAAoB,EAAE,OAAO;AAAA,IAC3B,QAAQ,EAAE,OAAO;AAAA,EACnB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOD,oBAAoB,EAAE,OAAO;AAAA,IAC3B,aAAa,EAAE;AAAA,MACb,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,GAAG,WAAW,EAAE,OAAO,GAAG,WAAW,EAAE,OAAO,GAAG,KAAK,EAAE,OAAO,EAAE,CAAC;AAAA,IAClG;AAAA,IACA,WAAW,EAAE,OAAO;AAAA,IACpB,cAAc,mBAAmB,SAAS;AAAA,IAC1C,MAAM,EAAE,OAAO;AAAA,EACjB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMD,iBAAiB,EAAE,OAAO;AAAA,IACxB,SAAS,EAAE,MAAM,wBAAwB,EAAE,SAAS;AAAA,IACpD,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,IAC7B,YAAY,EAAE,OAAO;AAAA,IACrB,WAAW,EAAE,MAAM,kBAAkB;AAAA,IACrC,QAAQ,EAAE,KAAK,CAAC,WAAW,YAAY,aAAa,WAAW,WAAW,CAAC;AAAA,EAC7E,CAAC;AAAA;AAAA,EAED,iBAAiB;AACnB,CAAC;AAKM,IAAM,kBAAkB,OAAO,KAAK,eAAe,KAAK;AAExD,SAAS,eAAe,MAAoC;AACjE,SAAQ,gBAA6B,SAAS,IAAI;AACpD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/data-parts.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Custom `data-*` parts streamed by the Flexkit agent platform and rendered by\n * Studio. The server validates what it writes against these schemas and the\n * UI derives its part types from them, so the two can never drift.\n */\nexport const errorSchema = z.object({\n message: z.string(),\n});\n\n/** A batch of one monitor's events as the chat card shows it; the model reads a text summary. */\nconst monitorEventSchema = z.object({\n description: z.string(),\n events: z.array(z.object({ createdAt: z.string(), id: z.string(), summary: z.string() })),\n monitorId: z.string(),\n /** Events this message carries, including any beyond the listed ones. */\n total: z.number(),\n});\n\n/** One multiple-choice question the chat agent asks with Ask User Question. */\nexport const userQuestionSchema = z.object({\n /** Short chip label, at most 12 characters. */\n header: z.string(),\n multiSelect: z.boolean(),\n options: z.array(z.object({ description: z.string(), label: z.string() })),\n question: z.string(),\n});\n\n/** The user's answer to one question, by position: chosen option labels plus optional own words. */\nexport const userQuestionAnswerSchema = z.object({\n other: z.string().optional(),\n selected: z.array(z.string()),\n});\n\n/** Where a passage sits in its knowledge source: page (PDF), slide (PowerPoint) or heading path (Word, Markdown, HTML). */\nexport const knowledgeLocatorSchema = z.object({\n headingPath: z.array(z.string()).optional(),\n page: z.number().int().positive().optional(),\n slide: z.number().int().positive().optional(),\n});\n\n/** One passage the Search Knowledge tool returned; the chat lists it under \"Used N sources\". */\nexport const knowledgeCitationSchema = z.object({\n excerpt: z.string(),\n locator: knowledgeLocatorSchema,\n passageId: z.string(),\n sourceId: z.string(),\n sourceTitle: z.string(),\n versionId: z.string(),\n});\n\nexport type KnowledgeLocator = z.infer<typeof knowledgeLocatorSchema>;\n\nexport type KnowledgeCitation = z.infer<typeof knowledgeCitationSchema>;\n\nexport const dataPartSchema = z.object({\n /** The agent needs a plugin connected (or reconnected): the chat shows a connect card. */\n 'plugin-connection': z.object({ pluginId: z.string(), connectionId: z.string().optional() }),\n /** On a `plugin_connected` message: which plugin the user connected, and the account the agent will use. */\n 'plugin-connected': z.object({\n accountName: z.string().optional(),\n pluginId: z.string(),\n pluginName: z.string(),\n scope: z.enum(['project', 'personal']),\n }),\n /** Lifecycle of one plugin tool call, so the UI can name the in-flight call in its status line. */\n 'plugin-call': z.object({\n pluginId: z.string(),\n tool: z.string(),\n status: z.enum(['loading', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n /** Written when the chat history was summarized before or during a turn. */\n 'context-compaction': z.object({\n reason: z.enum(['threshold', 'context_length_error']),\n status: z.enum(['done']),\n summarizedMessageCount: z.number(),\n }),\n /** The agent's working plan; replaced in place as steps complete. */\n plan: z.object({\n explanation: z.string().optional(),\n steps: z.array(\n z.object({\n status: z.enum(['pending', 'in_progress', 'completed']),\n step: z.string(),\n })\n ),\n updatedAt: z.string(),\n }),\n /** A delegated subtask of an automation run. */\n subtask: z.object({\n error: errorSchema.optional(),\n resultPreview: z.string().optional(),\n status: z.enum(['running', 'done', 'error']),\n stepsUsed: z.number().optional(),\n subtaskId: z.string(),\n title: z.string(),\n }),\n /** json-render patch lines, extracted from the assistant text by the stream pipeline. */\n spec: z.union([\n z.object({\n type: z.literal('patch'),\n patch: z.unknown(),\n }),\n z.object({\n type: z.literal('flat'),\n spec: z.unknown(),\n }),\n z.object({\n type: z.literal('nested'),\n spec: z.unknown(),\n }),\n ]),\n 'create-sandbox': z.object({\n sandboxId: z.string().optional(),\n status: z.enum(['loading', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n 'generating-files': z.object({\n paths: z.array(z.string()),\n status: z.enum(['generating', 'uploading', 'uploaded', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n 'run-artifact': z.object({\n artifactId: z.string().optional(),\n contentType: z.string().optional(),\n error: errorSchema.optional(),\n filename: z.string(),\n kind: z.enum(['html', 'pdf', 'csv', 'json']).optional(),\n sizeBytes: z.number().optional(),\n status: z.enum(['uploading', 'done', 'error']),\n /** Persistent public URL of the stored artifact. */\n url: z.string().optional(),\n }),\n 'run-command': z.object({\n sandboxId: z.string(),\n commandId: z.string().optional(),\n command: z.string(),\n args: z.array(z.string()),\n status: z.enum(['executing', 'running', 'waiting', 'done', 'error']),\n exitCode: z.number().optional(),\n error: errorSchema.optional(),\n }),\n 'search-schema': z.object({\n query: z.string().optional(),\n status: z.enum(['loading', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n 'web-search': z.object({\n query: z.string(),\n status: z.enum(['loading', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n /** A search over the project's knowledge sources; `results` holds the citations once it finished. */\n 'knowledge-search': z.object({\n query: z.string(),\n results: z.array(knowledgeCitationSchema).optional(),\n status: z.enum(['loading', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n /** The agent reading a window of one knowledge source. */\n 'read-source': z.object({\n sourceId: z.string(),\n sourceTitle: z.string().optional(),\n locator: knowledgeLocatorSchema.optional(),\n status: z.enum(['loading', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n 'tool-delivery': z.object({\n channelId: z.string(),\n channelName: z.string(),\n provider: z.enum(['slack', 'teams']),\n status: z.enum(['loading', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n 'validate-graphql': z.object({\n status: z.enum(['loading', 'valid', 'invalid', 'error']),\n errorCount: z.number().optional(),\n error: errorSchema.optional(),\n }),\n 'execute-graphql': z.object({\n operationType: z.enum(['query', 'mutation']).optional(),\n status: z.enum(['loading', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n /** A data export the server pages through; the file arrives as a `run-artifact` part. */\n 'export-records': z.object({\n error: errorSchema.optional(),\n filename: z.string(),\n format: z.enum(['csv', 'json']),\n /** Rows written so far, then in total. */\n rowCount: z.number(),\n status: z.enum(['loading', 'done', 'error']),\n }),\n /** Emitted for proposals; the UI fetches the full proposal from the approvals API by id. */\n 'mutation-approval': z.object({\n approvalId: z.string(),\n affectedCount: z.number().nullable().optional(),\n decidedBy: z.string().optional(),\n operationsSummary: z.string(),\n reason: z.string().optional(),\n status: z.enum(['pending', 'approved', 'rejected', 'expired', 'cancelled', 'executed', 'error']),\n error: errorSchema.optional(),\n }),\n 'bulk-graphql-action': z.object({\n changedItems: z.number().optional(),\n failedItems: z.number().optional(),\n jobId: z.string().optional(),\n operationName: z.string(),\n processedItems: z.number().optional(),\n status: z.enum(['loading', 'running', 'done', 'error']),\n totalItems: z.number().optional(),\n error: errorSchema.optional(),\n }),\n 'update-memory': z.object({\n status: z.enum(['loading', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n 'load-skill': z.object({\n /** True for skills attached to the automation, injected at run start rather than loaded on demand. */\n attached: z.boolean().optional(),\n skillName: z.string().optional(),\n status: z.enum(['loading', 'done', 'error']),\n error: errorSchema.optional(),\n }),\n /** Marker written by the run workflow for the trigger event so a run replays as a conversation. */\n 'user-message': z.object({\n parts: z.array(z.unknown()),\n }),\n /** Final report written by the run workflow when the agent finishes. */\n 'run-summary': z.object({\n status: z.enum(['success', 'skipped', 'failed']),\n summary: z.string(),\n }),\n /** A chat turn that ended with an error. */\n 'turn-error': z.object({\n message: z.string(),\n }),\n /** One follow-up instruction offered under a finished chat reply; clicking it fills the composer. */\n 'suggested-prompt': z.object({\n prompt: z.string(),\n }),\n /**\n * A message the user sent while the turn was running, at the point in the\n * reply where the agent received it. The UI shows it there, in place of the\n * stored user message it refers to. `monitorEvent` is set when a monitor,\n * not the user, sent it.\n */\n 'mid-turn-message': z.object({\n attachments: z.array(\n z.object({\n filename: z.string(),\n mediaType: z.string(),\n sizeBytes: z.number(),\n url: z.string(),\n sha256: z.string().optional(),\n knowledgeSourceId: z.string().nullable().optional(),\n })\n ),\n messageId: z.string(),\n monitorEvent: monitorEventSchema.optional(),\n text: z.string(),\n }),\n /**\n * Questions the chat agent asked; the turn waits until the user answers.\n * `answers` follow `questions` by position. `message` is set instead when\n * the user answered by typing in the composer.\n */\n 'user-question': z.object({\n answers: z.array(userQuestionAnswerSchema).optional(),\n message: z.string().optional(),\n questionId: z.string(),\n questions: z.array(userQuestionSchema),\n status: z.enum(['pending', 'answered', 'dismissed', 'expired', 'cancelled']),\n }),\n /** Events a chat monitor delivered, on the `monitor_event` message that carries them. */\n 'monitor-event': monitorEventSchema,\n});\n\nexport type DataPart = z.infer<typeof dataPartSchema>;\nexport type DataPartType = keyof DataPart;\n\nexport const DATA_PART_TYPES = Object.keys(dataPartSchema.shape) as DataPartType[];\n\nexport function isDataPartType(type: string): type is DataPartType {\n return (DATA_PART_TYPES as string[]).includes(type);\n}\n\n/** The `type` of a UI message part carrying this data part. */\nexport type DataPartMessageType = `data-${DataPartType}`;\n"],"mappings":";AAAA,SAAS,SAAS;AAOX,IAAM,cAAc,EAAE,OAAO;AAAA,EAClC,SAAS,EAAE,OAAO;AACpB,CAAC;AAGD,IAAM,qBAAqB,EAAE,OAAO;AAAA,EAClC,aAAa,EAAE,OAAO;AAAA,EACtB,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,GAAG,IAAI,EAAE,OAAO,GAAG,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;AAAA,EACxF,WAAW,EAAE,OAAO;AAAA;AAAA,EAEpB,OAAO,EAAE,OAAO;AAClB,CAAC;AAGM,IAAM,qBAAqB,EAAE,OAAO;AAAA;AAAA,EAEzC,QAAQ,EAAE,OAAO;AAAA,EACjB,aAAa,EAAE,QAAQ;AAAA,EACvB,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;AAAA,EACzE,UAAU,EAAE,OAAO;AACrB,CAAC;AAGM,IAAM,2BAA2B,EAAE,OAAO;AAAA,EAC/C,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC;AAC9B,CAAC;AAGM,IAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS;AAAA,EAC1C,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS;AAAA,EAC3C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS;AAC9C,CAAC;AAGM,IAAM,0BAA0B,EAAE,OAAO;AAAA,EAC9C,SAAS,EAAE,OAAO;AAAA,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