@takeshape/schema 11.133.1 → 11.134.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/agents.d.ts +2 -4
- package/dist/agents.js +99 -98
- package/dist/builtin-schema.js +66 -16
- package/dist/layers/refs.d.ts +1 -1
- package/dist/project-schema/latest.d.ts +6 -0
- package/dist/project-schema/v3.59.0.d.ts +6 -0
- package/dist/refs.d.ts +1 -1
- package/dist/resolvers/ai/abort-agent-message-response.d.ts +18 -5
- package/dist/resolvers/ai/abort-agent-message-response.js +4 -4
- package/dist/resolvers/ai/agent-chat-args.js +1 -2
- package/dist/resolvers/ai/agent-chat-payload.js +1 -2
- package/dist/resolvers/ai/agent-chat-response.d.ts +169 -37
- package/dist/resolvers/ai/agent-chat-response.js +11 -7
- package/dist/resolvers/ai/agent-generate-args.js +1 -2
- package/dist/resolvers/ai/agent-message-input.d.ts +73 -0
- package/dist/resolvers/ai/agent-message-input.js +39 -0
- package/dist/resolvers/ai/agent-message-output.d.ts +169 -0
- package/dist/resolvers/ai/agent-message-output.js +77 -0
- package/dist/resolvers/ai/agent-message-payload.d.ts +187 -73
- package/dist/resolvers/ai/agent-message-payload.js +20 -72
- package/dist/resolvers/ai/agent-run-mode.js +1 -2
- package/dist/resolvers/ai/agent-session-payload.d.ts +415 -5
- package/dist/resolvers/ai/agent-session-payload.js +83 -2
- package/dist/resolvers/ai/create-agent-session-response.d.ts +126 -23
- package/dist/resolvers/ai/create-agent-session-response.js +6 -11
- package/dist/resolvers/ai/get-agent-message-response.d.ts +592 -18
- package/dist/resolvers/ai/get-agent-message-response.js +43 -9
- package/dist/resolvers/ai/inspect-agent-response.d.ts +479 -70
- package/dist/resolvers/ai/inspect-agent-response.js +30 -19
- package/dist/resolvers/ai/send-agent-feedback-args.js +1 -2
- package/dist/resolvers/ai/send-agent-message-args.d.ts +8 -8
- package/dist/resolvers/ai/send-agent-message-args.js +2 -2
- package/dist/resolvers/ai/send-agent-message-response.d.ts +257 -4
- package/dist/resolvers/ai/send-agent-message-response.js +32 -2
- package/dist/resolvers/ai/types.d.ts +6 -0
- package/dist/resolvers/ai/types.js +1 -0
- package/dist/resolvers/takeshape/assets/asset.d.ts +1 -1
- package/dist/schema-util.js +4 -0
- package/dist/schemas/project-schema/latest.json +15 -0
- package/dist/schemas/project-schema/v3.59.0.json +15 -0
- package/package.json +6 -6
- package/dist/resolvers/ai/constants.d.ts +0 -9
- package/dist/resolvers/ai/constants.js +0 -9
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { FromSchema } from 'json-schema-to-ts';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const shapeName = "TSAgentSession";
|
|
3
|
+
export declare const recordSchema: {
|
|
4
|
+
readonly title: "TSAgentSession";
|
|
3
5
|
readonly type: "object";
|
|
4
6
|
readonly properties: {
|
|
5
7
|
readonly id: {
|
|
@@ -75,18 +77,363 @@ export declare const schema: {
|
|
|
75
77
|
readonly type: "integer";
|
|
76
78
|
};
|
|
77
79
|
};
|
|
80
|
+
readonly firstMessageInput: {
|
|
81
|
+
readonly title: "TSAgentMessageInput";
|
|
82
|
+
readonly description: "The input schema for agent messages.";
|
|
83
|
+
readonly discriminator: {
|
|
84
|
+
readonly propertyName: "type";
|
|
85
|
+
};
|
|
86
|
+
readonly oneOf: [{
|
|
87
|
+
readonly title: "TSAgentMessageUnknownInput";
|
|
88
|
+
readonly type: "object";
|
|
89
|
+
readonly properties: {
|
|
90
|
+
readonly type: {
|
|
91
|
+
readonly const: "unknown";
|
|
92
|
+
};
|
|
93
|
+
readonly data: {};
|
|
94
|
+
};
|
|
95
|
+
readonly required: ["type", "data"];
|
|
96
|
+
readonly additionalProperties: false;
|
|
97
|
+
}, {
|
|
98
|
+
readonly title: "TSAgentMessageStringInput";
|
|
99
|
+
readonly type: "object";
|
|
100
|
+
readonly properties: {
|
|
101
|
+
readonly type: {
|
|
102
|
+
readonly const: "string";
|
|
103
|
+
};
|
|
104
|
+
readonly content: {
|
|
105
|
+
readonly type: "string";
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
readonly required: ["type", "content"];
|
|
109
|
+
readonly additionalProperties: false;
|
|
110
|
+
}];
|
|
111
|
+
};
|
|
112
|
+
readonly lastMessageOutput: {
|
|
113
|
+
readonly title: "TSAgentMessageOutput";
|
|
114
|
+
readonly description: "The output schema for agent messages.";
|
|
115
|
+
readonly discriminator: {
|
|
116
|
+
readonly propertyName: "type";
|
|
117
|
+
};
|
|
118
|
+
readonly oneOf: [{
|
|
119
|
+
readonly title: "TSAgentGenerateStateOutput";
|
|
120
|
+
readonly type: "object";
|
|
121
|
+
readonly properties: {
|
|
122
|
+
readonly type: {
|
|
123
|
+
readonly const: "generate";
|
|
124
|
+
};
|
|
125
|
+
readonly data: {};
|
|
126
|
+
};
|
|
127
|
+
readonly required: ["type", "data"];
|
|
128
|
+
readonly additionalProperties: false;
|
|
129
|
+
}, {
|
|
130
|
+
readonly title: "TSAgentGraphQLStateOutput";
|
|
131
|
+
readonly type: "object";
|
|
132
|
+
readonly properties: {
|
|
133
|
+
readonly type: {
|
|
134
|
+
readonly const: "graphql";
|
|
135
|
+
};
|
|
136
|
+
readonly data: {};
|
|
137
|
+
};
|
|
138
|
+
readonly required: ["type", "data"];
|
|
139
|
+
readonly additionalProperties: false;
|
|
140
|
+
}, {
|
|
141
|
+
readonly title: "TSAgentChatStateOutput";
|
|
142
|
+
readonly type: "object";
|
|
143
|
+
readonly properties: {
|
|
144
|
+
readonly type: {
|
|
145
|
+
readonly const: "chat";
|
|
146
|
+
};
|
|
147
|
+
readonly data: {
|
|
148
|
+
readonly type: "object";
|
|
149
|
+
readonly properties: {
|
|
150
|
+
readonly content: {
|
|
151
|
+
readonly type: "string";
|
|
152
|
+
};
|
|
153
|
+
readonly artifact: {
|
|
154
|
+
readonly type: "object";
|
|
155
|
+
};
|
|
156
|
+
readonly references: {
|
|
157
|
+
readonly type: "array";
|
|
158
|
+
readonly items: {
|
|
159
|
+
readonly type: "object";
|
|
160
|
+
readonly properties: {
|
|
161
|
+
readonly _tid: {
|
|
162
|
+
readonly type: "string";
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
readonly required: ["_tid"];
|
|
166
|
+
readonly additionalProperties: false;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
readonly required: ["content", "references"];
|
|
171
|
+
readonly additionalProperties: false;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
readonly required: ["type", "data"];
|
|
175
|
+
readonly additionalProperties: false;
|
|
176
|
+
}, {
|
|
177
|
+
readonly title: "TSAgentUnknownStateOutput";
|
|
178
|
+
readonly type: "object";
|
|
179
|
+
readonly properties: {
|
|
180
|
+
readonly type: {
|
|
181
|
+
readonly const: "unknown";
|
|
182
|
+
};
|
|
183
|
+
readonly data: {};
|
|
184
|
+
};
|
|
185
|
+
readonly required: ["type", "data"];
|
|
186
|
+
readonly additionalProperties: false;
|
|
187
|
+
}];
|
|
188
|
+
};
|
|
189
|
+
readonly totalTokens: {
|
|
190
|
+
readonly type: "number";
|
|
191
|
+
readonly description: "The total number of tokens used in the agent session.";
|
|
192
|
+
};
|
|
193
|
+
readonly __createdRegion: {
|
|
194
|
+
readonly type: "string";
|
|
195
|
+
};
|
|
196
|
+
readonly __updatedRegion: {
|
|
197
|
+
readonly type: "string";
|
|
198
|
+
};
|
|
199
|
+
readonly ttl: {
|
|
200
|
+
readonly type: "integer";
|
|
201
|
+
};
|
|
202
|
+
readonly schemaIdAgentName: {
|
|
203
|
+
readonly type: "string";
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
readonly required: ["__createdRegion", "__updatedRegion", "ttl", "schemaIdAgentName", "id", "agentName", "createdAt", "updatedAt", "done", "currentStateId", "chatSessionIds", "sessionMemory", "hasAgentHistory", "hasFeedback", "suspend", "projectId", "schemaId", "schemaHash", "totalTokens"];
|
|
207
|
+
readonly additionalProperties: false;
|
|
208
|
+
};
|
|
209
|
+
export type AgentSessionRecord = FromSchema<typeof recordSchema>;
|
|
210
|
+
export declare const schema: {
|
|
211
|
+
readonly properties: {
|
|
212
|
+
readonly id: {
|
|
213
|
+
readonly type: "string";
|
|
214
|
+
readonly description: "The unique identifier for the agent session.";
|
|
215
|
+
};
|
|
216
|
+
readonly createdAt: {
|
|
217
|
+
readonly type: "string";
|
|
218
|
+
readonly description: "ISO8601 timestamp when the agent session was created";
|
|
219
|
+
readonly format: "date-time";
|
|
220
|
+
};
|
|
221
|
+
readonly updatedAt: {
|
|
222
|
+
readonly type: "string";
|
|
223
|
+
readonly description: "ISO8601 timestamp when the agent session was updated";
|
|
224
|
+
readonly format: "date-time";
|
|
225
|
+
};
|
|
226
|
+
readonly agentName: {
|
|
227
|
+
readonly type: "string";
|
|
228
|
+
readonly description: "The name of the agent associated with this session.";
|
|
229
|
+
};
|
|
230
|
+
readonly projectId: {
|
|
231
|
+
readonly type: "string";
|
|
232
|
+
readonly description: "The ID of the project to which this agent session belongs.";
|
|
233
|
+
};
|
|
234
|
+
readonly schemaId: {
|
|
235
|
+
readonly type: "string";
|
|
236
|
+
readonly description: "The schema ID associated with the agent session, typically in the format \"production~projectId\".";
|
|
237
|
+
};
|
|
238
|
+
readonly schemaHash: {
|
|
239
|
+
readonly type: "string";
|
|
240
|
+
readonly description: "The hash of the schema version associated with the agent session.";
|
|
241
|
+
};
|
|
242
|
+
readonly done: {
|
|
243
|
+
readonly type: "boolean";
|
|
244
|
+
readonly description: "Indicates whether the agent session is completed.";
|
|
245
|
+
};
|
|
246
|
+
readonly suspended: {
|
|
247
|
+
readonly type: "boolean";
|
|
248
|
+
readonly description: "Indicates whether the agent session is suspended.";
|
|
249
|
+
};
|
|
250
|
+
readonly previousStateId: {
|
|
251
|
+
readonly type: "string";
|
|
252
|
+
readonly description: "The ID of the previous state in the agent session, if any.";
|
|
253
|
+
};
|
|
254
|
+
readonly currentStateId: {
|
|
255
|
+
readonly type: "string";
|
|
256
|
+
readonly description: "The ID of the current state in the agent session.";
|
|
257
|
+
};
|
|
258
|
+
readonly chatSessionIds: {
|
|
259
|
+
readonly type: "object";
|
|
260
|
+
readonly description: "A mapping of chat session IDs to their corresponding state IDs.";
|
|
261
|
+
};
|
|
262
|
+
readonly sessionMemory: {
|
|
263
|
+
readonly type: "object";
|
|
264
|
+
readonly description: "Memory associated with the agent session, which can be used to store stateful information.";
|
|
265
|
+
};
|
|
266
|
+
readonly hasAgentHistory: {
|
|
267
|
+
readonly type: "boolean";
|
|
268
|
+
readonly description: "Indicates whether the agent session has an associated history of agent responses.";
|
|
269
|
+
};
|
|
270
|
+
readonly hasFeedback: {
|
|
271
|
+
readonly type: "boolean";
|
|
272
|
+
readonly description: "Indicates whether the agent session has any messages with feedback.";
|
|
273
|
+
};
|
|
274
|
+
readonly suspend: {
|
|
275
|
+
readonly type: "boolean";
|
|
276
|
+
readonly description: "Indicates whether the agent session is suspended.";
|
|
277
|
+
};
|
|
278
|
+
readonly suspendedTransitionIndices: {
|
|
279
|
+
readonly type: "array";
|
|
280
|
+
readonly description: "An array of indices of suspended transitions in the agent session.";
|
|
281
|
+
readonly items: {
|
|
282
|
+
readonly type: "integer";
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
readonly firstMessageInput: {
|
|
286
|
+
readonly title: "TSAgentMessageInput";
|
|
287
|
+
readonly description: "The input schema for agent messages.";
|
|
288
|
+
readonly discriminator: {
|
|
289
|
+
readonly propertyName: "type";
|
|
290
|
+
};
|
|
291
|
+
readonly oneOf: [{
|
|
292
|
+
readonly title: "TSAgentMessageUnknownInput";
|
|
293
|
+
readonly type: "object";
|
|
294
|
+
readonly properties: {
|
|
295
|
+
readonly type: {
|
|
296
|
+
readonly const: "unknown";
|
|
297
|
+
};
|
|
298
|
+
readonly data: {};
|
|
299
|
+
};
|
|
300
|
+
readonly required: ["type", "data"];
|
|
301
|
+
readonly additionalProperties: false;
|
|
302
|
+
}, {
|
|
303
|
+
readonly title: "TSAgentMessageStringInput";
|
|
304
|
+
readonly type: "object";
|
|
305
|
+
readonly properties: {
|
|
306
|
+
readonly type: {
|
|
307
|
+
readonly const: "string";
|
|
308
|
+
};
|
|
309
|
+
readonly content: {
|
|
310
|
+
readonly type: "string";
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
readonly required: ["type", "content"];
|
|
314
|
+
readonly additionalProperties: false;
|
|
315
|
+
}];
|
|
316
|
+
};
|
|
317
|
+
readonly lastMessageOutput: {
|
|
318
|
+
readonly title: "TSAgentMessageOutput";
|
|
319
|
+
readonly description: "The output schema for agent messages.";
|
|
320
|
+
readonly discriminator: {
|
|
321
|
+
readonly propertyName: "type";
|
|
322
|
+
};
|
|
323
|
+
readonly oneOf: [{
|
|
324
|
+
readonly title: "TSAgentGenerateStateOutput";
|
|
325
|
+
readonly type: "object";
|
|
326
|
+
readonly properties: {
|
|
327
|
+
readonly type: {
|
|
328
|
+
readonly const: "generate";
|
|
329
|
+
};
|
|
330
|
+
readonly data: {};
|
|
331
|
+
};
|
|
332
|
+
readonly required: ["type", "data"];
|
|
333
|
+
readonly additionalProperties: false;
|
|
334
|
+
}, {
|
|
335
|
+
readonly title: "TSAgentGraphQLStateOutput";
|
|
336
|
+
readonly type: "object";
|
|
337
|
+
readonly properties: {
|
|
338
|
+
readonly type: {
|
|
339
|
+
readonly const: "graphql";
|
|
340
|
+
};
|
|
341
|
+
readonly data: {};
|
|
342
|
+
};
|
|
343
|
+
readonly required: ["type", "data"];
|
|
344
|
+
readonly additionalProperties: false;
|
|
345
|
+
}, {
|
|
346
|
+
readonly title: "TSAgentChatStateOutput";
|
|
347
|
+
readonly type: "object";
|
|
348
|
+
readonly properties: {
|
|
349
|
+
readonly type: {
|
|
350
|
+
readonly const: "chat";
|
|
351
|
+
};
|
|
352
|
+
readonly data: {
|
|
353
|
+
readonly type: "object";
|
|
354
|
+
readonly properties: {
|
|
355
|
+
readonly content: {
|
|
356
|
+
readonly type: "string";
|
|
357
|
+
};
|
|
358
|
+
readonly artifact: {
|
|
359
|
+
readonly type: "object";
|
|
360
|
+
};
|
|
361
|
+
readonly references: {
|
|
362
|
+
readonly type: "array";
|
|
363
|
+
readonly items: {
|
|
364
|
+
readonly type: "object";
|
|
365
|
+
readonly properties: {
|
|
366
|
+
readonly _tid: {
|
|
367
|
+
readonly type: "string";
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
readonly required: ["_tid"];
|
|
371
|
+
readonly additionalProperties: false;
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
readonly required: ["content", "references"];
|
|
376
|
+
readonly additionalProperties: false;
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
readonly required: ["type", "data"];
|
|
380
|
+
readonly additionalProperties: false;
|
|
381
|
+
}, {
|
|
382
|
+
readonly title: "TSAgentUnknownStateOutput";
|
|
383
|
+
readonly type: "object";
|
|
384
|
+
readonly properties: {
|
|
385
|
+
readonly type: {
|
|
386
|
+
readonly const: "unknown";
|
|
387
|
+
};
|
|
388
|
+
readonly data: {};
|
|
389
|
+
};
|
|
390
|
+
readonly required: ["type", "data"];
|
|
391
|
+
readonly additionalProperties: false;
|
|
392
|
+
}];
|
|
393
|
+
};
|
|
394
|
+
readonly totalTokens: {
|
|
395
|
+
readonly type: "number";
|
|
396
|
+
readonly description: "The total number of tokens used in the agent session.";
|
|
397
|
+
};
|
|
78
398
|
};
|
|
79
|
-
readonly required: ["id", "agentName", "createdAt", "updatedAt", "done", "currentStateId", "chatSessionIds", "sessionMemory", "projectId", "schemaId", "schemaHash"];
|
|
399
|
+
readonly required: ["id", "agentName", "createdAt", "updatedAt", "done", "currentStateId", "chatSessionIds", "sessionMemory", "hasAgentHistory", "hasFeedback", "suspend", "projectId", "schemaId", "schemaHash", "totalTokens"];
|
|
80
400
|
readonly additionalProperties: false;
|
|
401
|
+
readonly title: "TSAgentSession";
|
|
402
|
+
readonly type: "object";
|
|
81
403
|
};
|
|
82
404
|
export type AgentSessionPayload = FromSchema<typeof schema>;
|
|
83
405
|
export declare const validate: import("ajv").ValidateFunction<{
|
|
84
406
|
suspended?: boolean | undefined;
|
|
85
407
|
previousStateId?: string | undefined;
|
|
86
|
-
hasAgentHistory?: boolean | undefined;
|
|
87
|
-
hasFeedback?: boolean | undefined;
|
|
88
|
-
suspend?: boolean | undefined;
|
|
89
408
|
suspendedTransitionIndices?: number[] | undefined;
|
|
409
|
+
firstMessageInput?: {
|
|
410
|
+
type: "unknown";
|
|
411
|
+
data: unknown;
|
|
412
|
+
} | {
|
|
413
|
+
type: "string";
|
|
414
|
+
content: string;
|
|
415
|
+
} | undefined;
|
|
416
|
+
lastMessageOutput?: {
|
|
417
|
+
type: "generate";
|
|
418
|
+
data: unknown;
|
|
419
|
+
} | {
|
|
420
|
+
type: "graphql";
|
|
421
|
+
data: unknown;
|
|
422
|
+
} | {
|
|
423
|
+
type: "chat";
|
|
424
|
+
data: {
|
|
425
|
+
artifact?: {
|
|
426
|
+
[x: string]: unknown;
|
|
427
|
+
} | undefined;
|
|
428
|
+
content: string;
|
|
429
|
+
references: {
|
|
430
|
+
_tid: string;
|
|
431
|
+
}[];
|
|
432
|
+
};
|
|
433
|
+
} | {
|
|
434
|
+
type: "unknown";
|
|
435
|
+
data: unknown;
|
|
436
|
+
} | undefined;
|
|
90
437
|
id: string;
|
|
91
438
|
createdAt: string;
|
|
92
439
|
updatedAt: string;
|
|
@@ -102,4 +449,67 @@ export declare const validate: import("ajv").ValidateFunction<{
|
|
|
102
449
|
sessionMemory: {
|
|
103
450
|
[x: string]: unknown;
|
|
104
451
|
};
|
|
452
|
+
hasAgentHistory: boolean;
|
|
453
|
+
hasFeedback: boolean;
|
|
454
|
+
suspend: boolean;
|
|
455
|
+
totalTokens: number;
|
|
105
456
|
}>;
|
|
457
|
+
export declare const shapeSchema: {
|
|
458
|
+
readonly properties: {
|
|
459
|
+
readonly id: {
|
|
460
|
+
readonly type: "string";
|
|
461
|
+
readonly description: "The unique identifier for the agent session.";
|
|
462
|
+
};
|
|
463
|
+
readonly createdAt: {
|
|
464
|
+
readonly type: "string";
|
|
465
|
+
readonly description: "ISO8601 timestamp when the agent session was created";
|
|
466
|
+
readonly format: "date-time";
|
|
467
|
+
};
|
|
468
|
+
readonly updatedAt: {
|
|
469
|
+
readonly type: "string";
|
|
470
|
+
readonly description: "ISO8601 timestamp when the agent session was updated";
|
|
471
|
+
readonly format: "date-time";
|
|
472
|
+
};
|
|
473
|
+
readonly agentName: {
|
|
474
|
+
readonly type: "string";
|
|
475
|
+
readonly description: "The name of the agent associated with this session.";
|
|
476
|
+
};
|
|
477
|
+
readonly done: {
|
|
478
|
+
readonly type: "boolean";
|
|
479
|
+
readonly description: "Indicates whether the agent session is completed.";
|
|
480
|
+
};
|
|
481
|
+
readonly suspended: {
|
|
482
|
+
readonly type: "boolean";
|
|
483
|
+
readonly description: "Indicates whether the agent session is suspended.";
|
|
484
|
+
};
|
|
485
|
+
readonly currentStateId: {
|
|
486
|
+
readonly type: "string";
|
|
487
|
+
readonly description: "The ID of the current state in the agent session.";
|
|
488
|
+
};
|
|
489
|
+
readonly sessionMemory: {
|
|
490
|
+
readonly type: "object";
|
|
491
|
+
readonly description: "Memory associated with the agent session, which can be used to store stateful information.";
|
|
492
|
+
};
|
|
493
|
+
readonly hasAgentHistory: {
|
|
494
|
+
readonly type: "boolean";
|
|
495
|
+
readonly description: "Indicates whether the agent session has an associated history of agent responses.";
|
|
496
|
+
};
|
|
497
|
+
readonly hasFeedback: {
|
|
498
|
+
readonly type: "boolean";
|
|
499
|
+
readonly description: "Indicates whether the agent session has any messages with feedback.";
|
|
500
|
+
};
|
|
501
|
+
readonly suspend: {
|
|
502
|
+
readonly type: "boolean";
|
|
503
|
+
readonly description: "Indicates whether the agent session is suspended.";
|
|
504
|
+
};
|
|
505
|
+
readonly totalTokens: {
|
|
506
|
+
readonly type: "number";
|
|
507
|
+
readonly description: "The total number of tokens used in the agent session.";
|
|
508
|
+
};
|
|
509
|
+
};
|
|
510
|
+
readonly required: ["id", "agentName", "createdAt", "updatedAt", "done", "sessionMemory", "hasAgentHistory", "hasFeedback", "suspend", "currentStateId", "totalTokens"];
|
|
511
|
+
readonly additionalProperties: false;
|
|
512
|
+
readonly title: "TSAgentSession";
|
|
513
|
+
readonly type: "object";
|
|
514
|
+
};
|
|
515
|
+
export type AgentSessionShapePayload = FromSchema<typeof shapeSchema>;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { createTypedValidator } from '@takeshape/json-schema';
|
|
2
|
-
|
|
2
|
+
import * as agentMessageInput from "./agent-message-input.js";
|
|
3
|
+
import * as agentMessageOutput from "./agent-message-output.js";
|
|
4
|
+
export const shapeName = 'TSAgentSession';
|
|
5
|
+
export const recordSchema = {
|
|
6
|
+
title: shapeName,
|
|
3
7
|
type: 'object',
|
|
4
8
|
properties: {
|
|
5
9
|
id: {
|
|
@@ -74,8 +78,60 @@ export const schema = {
|
|
|
74
78
|
items: {
|
|
75
79
|
type: 'integer'
|
|
76
80
|
}
|
|
81
|
+
},
|
|
82
|
+
firstMessageInput: {
|
|
83
|
+
...agentMessageInput.schema
|
|
84
|
+
},
|
|
85
|
+
lastMessageOutput: {
|
|
86
|
+
...agentMessageOutput.schema
|
|
87
|
+
},
|
|
88
|
+
totalTokens: {
|
|
89
|
+
type: 'number',
|
|
90
|
+
description: 'The total number of tokens used in the agent session.'
|
|
91
|
+
},
|
|
92
|
+
// Below are for records
|
|
93
|
+
__createdRegion: {
|
|
94
|
+
type: 'string'
|
|
95
|
+
},
|
|
96
|
+
__updatedRegion: {
|
|
97
|
+
type: 'string'
|
|
98
|
+
},
|
|
99
|
+
ttl: {
|
|
100
|
+
type: 'integer'
|
|
101
|
+
},
|
|
102
|
+
schemaIdAgentName: {
|
|
103
|
+
type: 'string'
|
|
77
104
|
}
|
|
78
105
|
},
|
|
106
|
+
required: [
|
|
107
|
+
'__createdRegion',
|
|
108
|
+
'__updatedRegion',
|
|
109
|
+
'ttl',
|
|
110
|
+
'schemaIdAgentName',
|
|
111
|
+
'id',
|
|
112
|
+
'agentName',
|
|
113
|
+
'createdAt',
|
|
114
|
+
'updatedAt',
|
|
115
|
+
'done',
|
|
116
|
+
'currentStateId',
|
|
117
|
+
'chatSessionIds',
|
|
118
|
+
'sessionMemory',
|
|
119
|
+
'hasAgentHistory',
|
|
120
|
+
'hasFeedback',
|
|
121
|
+
'suspend',
|
|
122
|
+
'projectId',
|
|
123
|
+
'schemaId',
|
|
124
|
+
'schemaHash',
|
|
125
|
+
'totalTokens'
|
|
126
|
+
],
|
|
127
|
+
additionalProperties: false
|
|
128
|
+
};
|
|
129
|
+
const { __createdRegion, __updatedRegion, ttl, schemaIdAgentName, ...schemaProperties } = recordSchema.properties;
|
|
130
|
+
export const schema = {
|
|
131
|
+
...recordSchema,
|
|
132
|
+
properties: {
|
|
133
|
+
...schemaProperties
|
|
134
|
+
},
|
|
79
135
|
required: [
|
|
80
136
|
'id',
|
|
81
137
|
'agentName',
|
|
@@ -85,10 +141,35 @@ export const schema = {
|
|
|
85
141
|
'currentStateId',
|
|
86
142
|
'chatSessionIds',
|
|
87
143
|
'sessionMemory',
|
|
144
|
+
'hasAgentHistory',
|
|
145
|
+
'hasFeedback',
|
|
146
|
+
'suspend',
|
|
88
147
|
'projectId',
|
|
89
148
|
'schemaId',
|
|
90
|
-
'schemaHash'
|
|
149
|
+
'schemaHash',
|
|
150
|
+
'totalTokens'
|
|
91
151
|
],
|
|
92
152
|
additionalProperties: false
|
|
93
153
|
};
|
|
94
154
|
export const validate = createTypedValidator(schema);
|
|
155
|
+
const { projectId, schemaId, schemaHash, firstMessageInput, lastMessageOutput, suspendedTransitionIndices, chatSessionIds, previousStateId, ...shapeSchemaProperties } = schema.properties;
|
|
156
|
+
export const shapeSchema = {
|
|
157
|
+
...schema,
|
|
158
|
+
properties: {
|
|
159
|
+
...shapeSchemaProperties
|
|
160
|
+
},
|
|
161
|
+
required: [
|
|
162
|
+
'id',
|
|
163
|
+
'agentName',
|
|
164
|
+
'createdAt',
|
|
165
|
+
'updatedAt',
|
|
166
|
+
'done',
|
|
167
|
+
'sessionMemory',
|
|
168
|
+
'hasAgentHistory',
|
|
169
|
+
'hasFeedback',
|
|
170
|
+
'suspend',
|
|
171
|
+
'currentStateId',
|
|
172
|
+
'totalTokens'
|
|
173
|
+
],
|
|
174
|
+
additionalProperties: false
|
|
175
|
+
};
|