@inkeep/agents-core 0.22.9 → 0.22.12
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/{chunk-F3AFTJB7.js → chunk-4SE2FOJY.js} +1 -1
- package/dist/{chunk-PR3DDXVU.js → chunk-5B6IOJZY.js} +1 -0
- package/dist/{chunk-TSKVAFS4.js → chunk-NLZO4BB6.js} +125 -40
- package/dist/client-exports.cjs +1 -0
- package/dist/client-exports.d.cts +2 -2
- package/dist/client-exports.d.ts +2 -2
- package/dist/client-exports.js +2 -2
- package/dist/db/schema.cjs +1 -0
- package/dist/db/schema.d.cts +2 -2
- package/dist/db/schema.d.ts +2 -2
- package/dist/db/schema.js +1 -1
- package/dist/index.cjs +106 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +24 -9
- package/dist/{schema-lnJ7dKE3.d.cts → schema-Bo7m08k2.d.ts} +26 -1
- package/dist/{schema-9o975__r.d.ts → schema-HuJ7Qh0C.d.cts} +26 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/{utility-DmLVF565.d.cts → utility-usOTNbMG.d.cts} +142 -0
- package/dist/{utility-DmLVF565.d.ts → utility-usOTNbMG.d.ts} +142 -0
- package/dist/validation/index.cjs +127 -39
- package/dist/validation/index.d.cts +54 -36
- package/dist/validation/index.d.ts +54 -36
- package/dist/validation/index.js +2 -2
- package/drizzle/0010_wet_vampiro.sql +2 -0
- package/drizzle/meta/0010_snapshot.json +2751 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +1 -1
|
@@ -4260,6 +4260,31 @@ declare const DataComponentSelectSchema: drizzle_zod.BuildSchema<"select", {
|
|
|
4260
4260
|
}, {}, {
|
|
4261
4261
|
$type: Record<string, unknown>;
|
|
4262
4262
|
}>;
|
|
4263
|
+
preview: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
4264
|
+
name: "preview";
|
|
4265
|
+
tableName: "data_components";
|
|
4266
|
+
dataType: "json";
|
|
4267
|
+
columnType: "SQLiteBlobJson";
|
|
4268
|
+
data: {
|
|
4269
|
+
code: string;
|
|
4270
|
+
data: Record<string, unknown>;
|
|
4271
|
+
};
|
|
4272
|
+
driverParam: Buffer<ArrayBufferLike>;
|
|
4273
|
+
notNull: false;
|
|
4274
|
+
hasDefault: false;
|
|
4275
|
+
isPrimaryKey: false;
|
|
4276
|
+
isAutoincrement: false;
|
|
4277
|
+
hasRuntimeDefault: false;
|
|
4278
|
+
enumValues: undefined;
|
|
4279
|
+
baseColumn: never;
|
|
4280
|
+
identity: undefined;
|
|
4281
|
+
generated: undefined;
|
|
4282
|
+
}, {}, {
|
|
4283
|
+
$type: {
|
|
4284
|
+
code: string;
|
|
4285
|
+
data: Record<string, unknown>;
|
|
4286
|
+
};
|
|
4287
|
+
}>;
|
|
4263
4288
|
name: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
4264
4289
|
name: "name";
|
|
4265
4290
|
tableName: "data_components";
|
|
@@ -4360,6 +4385,19 @@ declare const DataComponentInsertSchema: z.ZodObject<{
|
|
|
4360
4385
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
4361
4386
|
updatedAt: z.ZodOptional<z.ZodString>;
|
|
4362
4387
|
props: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
|
|
4388
|
+
preview: z.ZodOptional<z.ZodNullable<z.ZodType<{
|
|
4389
|
+
code: string;
|
|
4390
|
+
data: Record<string, unknown>;
|
|
4391
|
+
}, {
|
|
4392
|
+
code: string;
|
|
4393
|
+
data: Record<string, unknown>;
|
|
4394
|
+
}, z.core.$ZodTypeInternals<{
|
|
4395
|
+
code: string;
|
|
4396
|
+
data: Record<string, unknown>;
|
|
4397
|
+
}, {
|
|
4398
|
+
code: string;
|
|
4399
|
+
data: Record<string, unknown>;
|
|
4400
|
+
}>>>>;
|
|
4363
4401
|
name: z.ZodString;
|
|
4364
4402
|
description: z.ZodString;
|
|
4365
4403
|
projectId: z.ZodString;
|
|
@@ -4376,6 +4414,19 @@ declare const DataComponentBaseSchema: z.ZodObject<{
|
|
|
4376
4414
|
name: z.ZodString;
|
|
4377
4415
|
description: z.ZodString;
|
|
4378
4416
|
props: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
|
|
4417
|
+
preview: z.ZodOptional<z.ZodNullable<z.ZodType<{
|
|
4418
|
+
code: string;
|
|
4419
|
+
data: Record<string, unknown>;
|
|
4420
|
+
}, {
|
|
4421
|
+
code: string;
|
|
4422
|
+
data: Record<string, unknown>;
|
|
4423
|
+
}, z.core.$ZodTypeInternals<{
|
|
4424
|
+
code: string;
|
|
4425
|
+
data: Record<string, unknown>;
|
|
4426
|
+
}, {
|
|
4427
|
+
code: string;
|
|
4428
|
+
data: Record<string, unknown>;
|
|
4429
|
+
}>>>>;
|
|
4379
4430
|
}, {
|
|
4380
4431
|
out: {};
|
|
4381
4432
|
in: {};
|
|
@@ -4384,6 +4435,19 @@ declare const DataComponentUpdateSchema: z.ZodObject<{
|
|
|
4384
4435
|
createdAt: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
4385
4436
|
updatedAt: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
4386
4437
|
props: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>>;
|
|
4438
|
+
preview: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodType<{
|
|
4439
|
+
code: string;
|
|
4440
|
+
data: Record<string, unknown>;
|
|
4441
|
+
}, {
|
|
4442
|
+
code: string;
|
|
4443
|
+
data: Record<string, unknown>;
|
|
4444
|
+
}, z.core.$ZodTypeInternals<{
|
|
4445
|
+
code: string;
|
|
4446
|
+
data: Record<string, unknown>;
|
|
4447
|
+
}, {
|
|
4448
|
+
code: string;
|
|
4449
|
+
data: Record<string, unknown>;
|
|
4450
|
+
}>>>>>;
|
|
4387
4451
|
name: z.ZodOptional<z.ZodString>;
|
|
4388
4452
|
description: z.ZodOptional<z.ZodString>;
|
|
4389
4453
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -4400,6 +4464,19 @@ declare const DataComponentApiSelectSchema: z.ZodObject<{
|
|
|
4400
4464
|
createdAt: z.ZodString;
|
|
4401
4465
|
updatedAt: z.ZodString;
|
|
4402
4466
|
props: z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
4467
|
+
preview: z.ZodNullable<z.ZodType<{
|
|
4468
|
+
code: string;
|
|
4469
|
+
data: Record<string, unknown>;
|
|
4470
|
+
}, {
|
|
4471
|
+
code: string;
|
|
4472
|
+
data: Record<string, unknown>;
|
|
4473
|
+
}, z.core.$ZodTypeInternals<{
|
|
4474
|
+
code: string;
|
|
4475
|
+
data: Record<string, unknown>;
|
|
4476
|
+
}, {
|
|
4477
|
+
code: string;
|
|
4478
|
+
data: Record<string, unknown>;
|
|
4479
|
+
}>>>;
|
|
4403
4480
|
}, z.core.$strip>;
|
|
4404
4481
|
declare const DataComponentApiInsertSchema: z.ZodObject<{
|
|
4405
4482
|
id: z.ZodString;
|
|
@@ -4408,6 +4485,19 @@ declare const DataComponentApiInsertSchema: z.ZodObject<{
|
|
|
4408
4485
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
4409
4486
|
updatedAt: z.ZodOptional<z.ZodString>;
|
|
4410
4487
|
props: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
|
|
4488
|
+
preview: z.ZodOptional<z.ZodNullable<z.ZodType<{
|
|
4489
|
+
code: string;
|
|
4490
|
+
data: Record<string, unknown>;
|
|
4491
|
+
}, {
|
|
4492
|
+
code: string;
|
|
4493
|
+
data: Record<string, unknown>;
|
|
4494
|
+
}, z.core.$ZodTypeInternals<{
|
|
4495
|
+
code: string;
|
|
4496
|
+
data: Record<string, unknown>;
|
|
4497
|
+
}, {
|
|
4498
|
+
code: string;
|
|
4499
|
+
data: Record<string, unknown>;
|
|
4500
|
+
}>>>>;
|
|
4411
4501
|
}, z.core.$strip>;
|
|
4412
4502
|
declare const DataComponentApiUpdateSchema: z.ZodObject<{
|
|
4413
4503
|
id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
@@ -4416,6 +4506,19 @@ declare const DataComponentApiUpdateSchema: z.ZodObject<{
|
|
|
4416
4506
|
createdAt: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodString>>>;
|
|
4417
4507
|
updatedAt: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodString>>>;
|
|
4418
4508
|
props: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>>>;
|
|
4509
|
+
preview: z.ZodOptional<z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodType<{
|
|
4510
|
+
code: string;
|
|
4511
|
+
data: Record<string, unknown>;
|
|
4512
|
+
}, {
|
|
4513
|
+
code: string;
|
|
4514
|
+
data: Record<string, unknown>;
|
|
4515
|
+
}, z.core.$ZodTypeInternals<{
|
|
4516
|
+
code: string;
|
|
4517
|
+
data: Record<string, unknown>;
|
|
4518
|
+
}, {
|
|
4519
|
+
code: string;
|
|
4520
|
+
data: Record<string, unknown>;
|
|
4521
|
+
}>>>>>>;
|
|
4419
4522
|
}, z.core.$strip>;
|
|
4420
4523
|
declare const SubAgentDataComponentSelectSchema: drizzle_zod.BuildSchema<"select", {
|
|
4421
4524
|
dataComponentId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
@@ -8496,6 +8599,19 @@ declare const FullProjectDefinitionSchema: z.ZodObject<{
|
|
|
8496
8599
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
8497
8600
|
updatedAt: z.ZodOptional<z.ZodString>;
|
|
8498
8601
|
props: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
|
|
8602
|
+
preview: z.ZodOptional<z.ZodNullable<z.ZodType<{
|
|
8603
|
+
code: string;
|
|
8604
|
+
data: Record<string, unknown>;
|
|
8605
|
+
}, {
|
|
8606
|
+
code: string;
|
|
8607
|
+
data: Record<string, unknown>;
|
|
8608
|
+
}, z.core.$ZodTypeInternals<{
|
|
8609
|
+
code: string;
|
|
8610
|
+
data: Record<string, unknown>;
|
|
8611
|
+
}, {
|
|
8612
|
+
code: string;
|
|
8613
|
+
data: Record<string, unknown>;
|
|
8614
|
+
}>>>>;
|
|
8499
8615
|
}, z.core.$strip>>>;
|
|
8500
8616
|
artifactComponents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
8501
8617
|
id: z.ZodString;
|
|
@@ -9183,6 +9299,19 @@ declare const DataComponentResponse: z.ZodObject<{
|
|
|
9183
9299
|
createdAt: z.ZodString;
|
|
9184
9300
|
updatedAt: z.ZodString;
|
|
9185
9301
|
props: z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
9302
|
+
preview: z.ZodNullable<z.ZodType<{
|
|
9303
|
+
code: string;
|
|
9304
|
+
data: Record<string, unknown>;
|
|
9305
|
+
}, {
|
|
9306
|
+
code: string;
|
|
9307
|
+
data: Record<string, unknown>;
|
|
9308
|
+
}, z.core.$ZodTypeInternals<{
|
|
9309
|
+
code: string;
|
|
9310
|
+
data: Record<string, unknown>;
|
|
9311
|
+
}, {
|
|
9312
|
+
code: string;
|
|
9313
|
+
data: Record<string, unknown>;
|
|
9314
|
+
}>>>;
|
|
9186
9315
|
}, z.core.$strip>;
|
|
9187
9316
|
}, z.core.$strip>;
|
|
9188
9317
|
declare const ArtifactComponentResponse: z.ZodObject<{
|
|
@@ -9954,6 +10083,19 @@ declare const DataComponentListResponse: z.ZodObject<{
|
|
|
9954
10083
|
createdAt: z.ZodString;
|
|
9955
10084
|
updatedAt: z.ZodString;
|
|
9956
10085
|
props: z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
10086
|
+
preview: z.ZodNullable<z.ZodType<{
|
|
10087
|
+
code: string;
|
|
10088
|
+
data: Record<string, unknown>;
|
|
10089
|
+
}, {
|
|
10090
|
+
code: string;
|
|
10091
|
+
data: Record<string, unknown>;
|
|
10092
|
+
}, z.core.$ZodTypeInternals<{
|
|
10093
|
+
code: string;
|
|
10094
|
+
data: Record<string, unknown>;
|
|
10095
|
+
}, {
|
|
10096
|
+
code: string;
|
|
10097
|
+
data: Record<string, unknown>;
|
|
10098
|
+
}>>>;
|
|
9957
10099
|
}, z.core.$strip>>;
|
|
9958
10100
|
pagination: z.ZodObject<{
|
|
9959
10101
|
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
@@ -1,54 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var zod = require('zod');
|
|
4
3
|
var zodOpenapi = require('@hono/zod-openapi');
|
|
5
4
|
var drizzleZod = require('drizzle-zod');
|
|
6
5
|
var drizzleOrm = require('drizzle-orm');
|
|
7
6
|
var sqliteCore = require('drizzle-orm/sqlite-core');
|
|
7
|
+
var zod = require('zod');
|
|
8
8
|
var Ajv = require('ajv');
|
|
9
9
|
|
|
10
10
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
|
|
12
12
|
var Ajv__default = /*#__PURE__*/_interopDefault(Ajv);
|
|
13
13
|
|
|
14
|
-
// src/validation/
|
|
15
|
-
var TransferDataSchema = zod.z.object({
|
|
16
|
-
fromSubAgent: zod.z.string().describe("ID of the sub-agent transferring control"),
|
|
17
|
-
targetSubAgent: zod.z.string().describe("ID of the sub-agent receiving control"),
|
|
18
|
-
reason: zod.z.string().optional().describe("Reason for the transfer"),
|
|
19
|
-
context: zod.z.any().optional().describe("Additional context data")
|
|
20
|
-
});
|
|
21
|
-
var DelegationSentDataSchema = zod.z.object({
|
|
22
|
-
delegationId: zod.z.string().describe("Unique identifier for this delegation"),
|
|
23
|
-
fromSubAgent: zod.z.string().describe("ID of the delegating sub-agent"),
|
|
24
|
-
targetSubAgent: zod.z.string().describe("ID of the sub-agent receiving the delegation"),
|
|
25
|
-
taskDescription: zod.z.string().describe("Description of the delegated task"),
|
|
26
|
-
context: zod.z.any().optional().describe("Additional context data")
|
|
27
|
-
});
|
|
28
|
-
var DelegationReturnedDataSchema = zod.z.object({
|
|
29
|
-
delegationId: zod.z.string().describe("Unique identifier matching the original delegation"),
|
|
30
|
-
fromSubAgent: zod.z.string().describe("ID of the sub-agent that completed the task"),
|
|
31
|
-
targetSubAgent: zod.z.string().describe("ID of the sub-agent receiving the result"),
|
|
32
|
-
result: zod.z.any().optional().describe("Result data from the delegated task")
|
|
33
|
-
});
|
|
34
|
-
var DataOperationDetailsSchema = zod.z.object({
|
|
35
|
-
timestamp: zod.z.number().describe("Unix timestamp in milliseconds"),
|
|
36
|
-
subAgentId: zod.z.string().describe("ID of the sub-agent that generated this data"),
|
|
37
|
-
data: zod.z.any().describe("The actual data payload")
|
|
38
|
-
});
|
|
39
|
-
var DataOperationEventSchema = zod.z.object({
|
|
40
|
-
type: zod.z.string().describe("Event type identifier"),
|
|
41
|
-
label: zod.z.string().describe("Human-readable label for the event"),
|
|
42
|
-
details: DataOperationDetailsSchema
|
|
43
|
-
});
|
|
44
|
-
var A2AMessageMetadataSchema = zod.z.object({
|
|
45
|
-
fromSubAgentId: zod.z.string().optional().describe("ID of the sending sub-agent"),
|
|
46
|
-
toSubAgentId: zod.z.string().optional().describe("ID of the receiving sub-agent"),
|
|
47
|
-
fromExternalAgentId: zod.z.string().optional().describe("ID of the sending external agent"),
|
|
48
|
-
toExternalAgentId: zod.z.string().optional().describe("ID of the receiving external agent"),
|
|
49
|
-
taskId: zod.z.string().optional().describe("Associated task ID"),
|
|
50
|
-
a2aTaskId: zod.z.string().optional().describe("A2A-specific task ID")
|
|
51
|
-
});
|
|
14
|
+
// src/validation/schemas.ts
|
|
52
15
|
var tenantScoped = {
|
|
53
16
|
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
54
17
|
id: sqliteCore.text("id").notNull()
|
|
@@ -263,6 +226,7 @@ var dataComponents = sqliteCore.sqliteTable(
|
|
|
263
226
|
...projectScoped,
|
|
264
227
|
...uiProperties,
|
|
265
228
|
props: sqliteCore.blob("props", { mode: "json" }).$type(),
|
|
229
|
+
preview: sqliteCore.blob("preview", { mode: "json" }).$type(),
|
|
266
230
|
...timestamps
|
|
267
231
|
},
|
|
268
232
|
(table) => [
|
|
@@ -1769,6 +1733,43 @@ function validateAgentStructure(agentData, projectResources) {
|
|
|
1769
1733
|
}
|
|
1770
1734
|
validateAgentRelationships(agentData);
|
|
1771
1735
|
}
|
|
1736
|
+
var TransferDataSchema = zod.z.object({
|
|
1737
|
+
fromSubAgent: zod.z.string().describe("ID of the sub-agent transferring control"),
|
|
1738
|
+
targetSubAgent: zod.z.string().describe("ID of the sub-agent receiving control"),
|
|
1739
|
+
reason: zod.z.string().optional().describe("Reason for the transfer"),
|
|
1740
|
+
context: zod.z.any().optional().describe("Additional context data")
|
|
1741
|
+
});
|
|
1742
|
+
var DelegationSentDataSchema = zod.z.object({
|
|
1743
|
+
delegationId: zod.z.string().describe("Unique identifier for this delegation"),
|
|
1744
|
+
fromSubAgent: zod.z.string().describe("ID of the delegating sub-agent"),
|
|
1745
|
+
targetSubAgent: zod.z.string().describe("ID of the sub-agent receiving the delegation"),
|
|
1746
|
+
taskDescription: zod.z.string().describe("Description of the delegated task"),
|
|
1747
|
+
context: zod.z.any().optional().describe("Additional context data")
|
|
1748
|
+
});
|
|
1749
|
+
var DelegationReturnedDataSchema = zod.z.object({
|
|
1750
|
+
delegationId: zod.z.string().describe("Unique identifier matching the original delegation"),
|
|
1751
|
+
fromSubAgent: zod.z.string().describe("ID of the sub-agent that completed the task"),
|
|
1752
|
+
targetSubAgent: zod.z.string().describe("ID of the sub-agent receiving the result"),
|
|
1753
|
+
result: zod.z.any().optional().describe("Result data from the delegated task")
|
|
1754
|
+
});
|
|
1755
|
+
var DataOperationDetailsSchema = zod.z.object({
|
|
1756
|
+
timestamp: zod.z.number().describe("Unix timestamp in milliseconds"),
|
|
1757
|
+
subAgentId: zod.z.string().describe("ID of the sub-agent that generated this data"),
|
|
1758
|
+
data: zod.z.any().describe("The actual data payload")
|
|
1759
|
+
});
|
|
1760
|
+
var DataOperationEventSchema = zod.z.object({
|
|
1761
|
+
type: zod.z.string().describe("Event type identifier"),
|
|
1762
|
+
label: zod.z.string().describe("Human-readable label for the event"),
|
|
1763
|
+
details: DataOperationDetailsSchema
|
|
1764
|
+
});
|
|
1765
|
+
var A2AMessageMetadataSchema = zod.z.object({
|
|
1766
|
+
fromSubAgentId: zod.z.string().optional().describe("ID of the sending sub-agent"),
|
|
1767
|
+
toSubAgentId: zod.z.string().optional().describe("ID of the receiving sub-agent"),
|
|
1768
|
+
fromExternalAgentId: zod.z.string().optional().describe("ID of the sending external agent"),
|
|
1769
|
+
toExternalAgentId: zod.z.string().optional().describe("ID of the receiving external agent"),
|
|
1770
|
+
taskId: zod.z.string().optional().describe("Associated task ID"),
|
|
1771
|
+
a2aTaskId: zod.z.string().optional().describe("A2A-specific task ID")
|
|
1772
|
+
});
|
|
1772
1773
|
|
|
1773
1774
|
// src/validation/id-validation.ts
|
|
1774
1775
|
function isValidResourceId(id) {
|
|
@@ -1787,6 +1788,92 @@ function generateIdFromName(name) {
|
|
|
1787
1788
|
}
|
|
1788
1789
|
return truncatedId;
|
|
1789
1790
|
}
|
|
1791
|
+
|
|
1792
|
+
// src/validation/preview-validation.ts
|
|
1793
|
+
var MAX_CODE_SIZE = 5e4;
|
|
1794
|
+
var MAX_DATA_SIZE = 1e4;
|
|
1795
|
+
var DANGEROUS_PATTERNS = [
|
|
1796
|
+
/\beval\s*\(/i,
|
|
1797
|
+
/\bFunction\s*\(/i,
|
|
1798
|
+
/dangerouslySetInnerHTML/i,
|
|
1799
|
+
/<script\b/i,
|
|
1800
|
+
/\bon\w+\s*=/i,
|
|
1801
|
+
// inline event handlers like onclick=
|
|
1802
|
+
/document\.write/i,
|
|
1803
|
+
/window\.location/i,
|
|
1804
|
+
/\.innerHTML\s*=/i
|
|
1805
|
+
];
|
|
1806
|
+
var ALLOWED_IMPORTS = ["lucide-react"];
|
|
1807
|
+
function validatePreview(preview) {
|
|
1808
|
+
const errors = [];
|
|
1809
|
+
if (!preview.code || typeof preview.code !== "string") {
|
|
1810
|
+
return {
|
|
1811
|
+
isValid: false,
|
|
1812
|
+
errors: [{ field: "preview.code", message: "Code must be a non-empty string" }]
|
|
1813
|
+
};
|
|
1814
|
+
}
|
|
1815
|
+
if (!preview.data || typeof preview.data !== "object") {
|
|
1816
|
+
return {
|
|
1817
|
+
isValid: false,
|
|
1818
|
+
errors: [{ field: "preview.data", message: "Data must be an object" }]
|
|
1819
|
+
};
|
|
1820
|
+
}
|
|
1821
|
+
if (preview.code.length > MAX_CODE_SIZE) {
|
|
1822
|
+
errors.push({
|
|
1823
|
+
field: "preview.code",
|
|
1824
|
+
message: `Code size exceeds maximum allowed (${MAX_CODE_SIZE} characters)`
|
|
1825
|
+
});
|
|
1826
|
+
}
|
|
1827
|
+
const dataString = JSON.stringify(preview.data);
|
|
1828
|
+
if (dataString.length > MAX_DATA_SIZE) {
|
|
1829
|
+
errors.push({
|
|
1830
|
+
field: "preview.data",
|
|
1831
|
+
message: `Data size exceeds maximum allowed (${MAX_DATA_SIZE} characters)`
|
|
1832
|
+
});
|
|
1833
|
+
}
|
|
1834
|
+
for (const pattern of DANGEROUS_PATTERNS) {
|
|
1835
|
+
if (pattern.test(preview.code)) {
|
|
1836
|
+
errors.push({
|
|
1837
|
+
field: "preview.code",
|
|
1838
|
+
message: `Code contains potentially dangerous pattern: ${pattern.source}`
|
|
1839
|
+
});
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
const importMatches = preview.code.matchAll(/import\s+.*?\s+from\s+['"]([^'"]+)['"]/g);
|
|
1843
|
+
for (const match of importMatches) {
|
|
1844
|
+
const importPath = match[1];
|
|
1845
|
+
if (!ALLOWED_IMPORTS.includes(importPath)) {
|
|
1846
|
+
errors.push({
|
|
1847
|
+
field: "preview.code",
|
|
1848
|
+
message: `Import from "${importPath}" is not allowed. Only imports from ${ALLOWED_IMPORTS.join(", ")} are permitted`
|
|
1849
|
+
});
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
const hasFunctionDeclaration = /function\s+\w+\s*\(/.test(preview.code);
|
|
1853
|
+
if (!hasFunctionDeclaration) {
|
|
1854
|
+
errors.push({
|
|
1855
|
+
field: "preview.code",
|
|
1856
|
+
message: "Code must contain a function declaration"
|
|
1857
|
+
});
|
|
1858
|
+
}
|
|
1859
|
+
const hasReturn = /return\s*\(?\s*</.test(preview.code);
|
|
1860
|
+
if (!hasReturn) {
|
|
1861
|
+
errors.push({
|
|
1862
|
+
field: "preview.code",
|
|
1863
|
+
message: "Component function must have a return statement with JSX"
|
|
1864
|
+
});
|
|
1865
|
+
}
|
|
1866
|
+
if (/\bexport\s+(default\s+)?/i.test(preview.code)) {
|
|
1867
|
+
errors.push({
|
|
1868
|
+
field: "preview.code",
|
|
1869
|
+
message: "Code should not contain export statements"
|
|
1870
|
+
});
|
|
1871
|
+
}
|
|
1872
|
+
return {
|
|
1873
|
+
isValid: errors.length === 0,
|
|
1874
|
+
errors
|
|
1875
|
+
};
|
|
1876
|
+
}
|
|
1790
1877
|
function validatePropsAsJsonSchema(props) {
|
|
1791
1878
|
if (!props || typeof props === "object" && Object.keys(props).length === 0) {
|
|
1792
1879
|
return {
|
|
@@ -2119,5 +2206,6 @@ exports.validateAgentStructure = validateAgentStructure;
|
|
|
2119
2206
|
exports.validateAndTypeAgentData = validateAndTypeAgentData;
|
|
2120
2207
|
exports.validateArtifactComponentReferences = validateArtifactComponentReferences;
|
|
2121
2208
|
exports.validateDataComponentReferences = validateDataComponentReferences;
|
|
2209
|
+
exports.validatePreview = validatePreview;
|
|
2122
2210
|
exports.validatePropsAsJsonSchema = validatePropsAsJsonSchema;
|
|
2123
2211
|
exports.validateToolReferences = validateToolReferences;
|
|
@@ -1,11 +1,44 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { d5 as SubAgentDefinition, d4 as InternalSubAgentDefinition, cL as ExternalSubAgentApiInsert, fN as AgentWithinContextOfProjectSchema, z as FullAgentDefinition } from '../utility-
|
|
3
|
-
export { dW as AgentApiInsertSchema, dV as AgentApiSelectSchema, dX as AgentApiUpdateSchema, dT as AgentInsertSchema, gh as AgentListResponse, g1 as AgentResponse, dS as AgentSelectSchema, e as AgentStopWhen, b as AgentStopWhenSchema, dU as AgentUpdateSchema, e_ as AllAgentSchema, f3 as ApiKeyApiCreationResponseSchema, f4 as ApiKeyApiInsertSchema, f2 as ApiKeyApiSelectSchema, A as ApiKeyApiUpdateSchema, f0 as ApiKeyInsertSchema, gl as ApiKeyListResponse, g5 as ApiKeyResponse, e$ as ApiKeySelectSchema, f1 as ApiKeyUpdateSchema, eM as ArtifactComponentApiInsertSchema, eL as ArtifactComponentApiSelectSchema, eN as ArtifactComponentApiUpdateSchema, eJ as ArtifactComponentInsertSchema, gq as ArtifactComponentListResponse, ga as ArtifactComponentResponse, eI as ArtifactComponentSelectSchema, eK as ArtifactComponentUpdateSchema, fM as CanUseItemSchema, et as ContextCacheApiInsertSchema, es as ContextCacheApiSelectSchema, eu as ContextCacheApiUpdateSchema, eq as ContextCacheInsertSchema, ep as ContextCacheSelectSchema, er as ContextCacheUpdateSchema, fw as ContextConfigApiInsertSchema, fv as ContextConfigApiSelectSchema, fx as ContextConfigApiUpdateSchema, ft as ContextConfigInsertSchema, gk as ContextConfigListResponse, g4 as ContextConfigResponse, fs as ContextConfigSelectSchema, fu as ContextConfigUpdateSchema, eh as ConversationApiInsertSchema, eg as ConversationApiSelectSchema, ei as ConversationApiUpdateSchema, ee as ConversationInsertSchema, gt as ConversationListResponse, gd as ConversationResponse, ed as ConversationSelectSchema, ef as ConversationUpdateSchema, f9 as CredentialReferenceApiInsertSchema, f8 as CredentialReferenceApiSelectSchema, fa as CredentialReferenceApiUpdateSchema, f6 as CredentialReferenceInsertSchema, gm as CredentialReferenceListResponse, g6 as CredentialReferenceResponse, f5 as CredentialReferenceSelectSchema, f7 as CredentialReferenceUpdateSchema, eA as DataComponentApiInsertSchema, ez as DataComponentApiSelectSchema, eB as DataComponentApiUpdateSchema, ex as DataComponentBaseSchema, ew as DataComponentInsertSchema, gp as DataComponentListResponse, g9 as DataComponentResponse, ev as DataComponentSelectSchema, ey as DataComponentUpdateSchema, fR as ErrorResponseSchema, fS as ExistsResponseSchema, eY as ExternalAgentApiInsertSchema, eX as ExternalAgentApiSelectSchema, eZ as ExternalAgentApiUpdateSchema, eV as ExternalAgentInsertSchema, gj as ExternalAgentListResponse, g3 as ExternalAgentResponse, eU as ExternalAgentSelectSchema, eW as ExternalAgentUpdateSchema, dR as ExternalSubAgentRelationApiInsertSchema, dQ as ExternalSubAgentRelationInsertSchema, fq as FetchConfigSchema, fr as FetchDefinitionSchema, a as FullAgentAgentInsertSchema, f_ as FullProjectDefinitionSchema, F as FunctionApiInsertSchema, j as FunctionApiSelectSchema, k as FunctionApiUpdateSchema, fo as FunctionInsertSchema, gn as FunctionListResponse, g7 as FunctionResponse, fn as FunctionSelectSchema, fl as FunctionToolApiInsertSchema, fk as FunctionToolApiSelectSchema, fm as FunctionToolApiUpdateSchema, dC as FunctionToolConfig, dB as FunctionToolConfigSchema, fi as FunctionToolInsertSchema, go as FunctionToolListResponse, g8 as FunctionToolResponse, fh as FunctionToolSelectSchema, fj as FunctionToolUpdateSchema, fp as FunctionUpdateSchema, gz as HeadersScopeSchema, fI as LedgerArtifactApiInsertSchema, fH as LedgerArtifactApiSelectSchema, fJ as LedgerArtifactApiUpdateSchema, fF as LedgerArtifactInsertSchema, fE as LedgerArtifactSelectSchema, fG as LedgerArtifactUpdateSchema, fP as ListResponseSchema, dw as MAX_ID_LENGTH, fc as MCPToolConfigSchema, dv as MIN_ID_LENGTH, ea as McpToolDefinitionSchema, fb as McpToolSchema, e8 as McpTransportConfigSchema, en as MessageApiInsertSchema, em as MessageApiSelectSchema, eo as MessageApiUpdateSchema, ek as MessageInsertSchema, gu as MessageListResponse, ge as MessageResponse, ej as MessageSelectSchema, el as MessageUpdateSchema, dz as ModelSchema, g as ModelSettings, M as ModelSettingsSchema, gI as PaginationQueryParamsSchema, fO as PaginationSchema, fY as ProjectApiInsertSchema, fX as ProjectApiSelectSchema, fZ as ProjectApiUpdateSchema, fV as ProjectInsertSchema, gf as ProjectListResponse, dA as ProjectModelSchema, f$ as ProjectResponse, fU as ProjectSelectSchema, fW as ProjectUpdateSchema, fT as RemovedResponseSchema, fQ as SingleResponseSchema, fK as StatusComponentSchema, fL as StatusUpdateSchema, d as StopWhen, S as StopWhenSchema, dH as SubAgentApiInsertSchema, dG as SubAgentApiSelectSchema, dI as SubAgentApiUpdateSchema, eS as SubAgentArtifactComponentApiInsertSchema, eR as SubAgentArtifactComponentApiSelectSchema, eT as SubAgentArtifactComponentApiUpdateSchema, eP as SubAgentArtifactComponentInsertSchema, gy as SubAgentArtifactComponentListResponse, gw as SubAgentArtifactComponentResponse, eO as SubAgentArtifactComponentSelectSchema, eQ as SubAgentArtifactComponentUpdateSchema, eG as SubAgentDataComponentApiInsertSchema, eF as SubAgentDataComponentApiSelectSchema, eH as SubAgentDataComponentApiUpdateSchema, eD as SubAgentDataComponentInsertSchema, gx as SubAgentDataComponentListResponse, gv as SubAgentDataComponentResponse, eC as SubAgentDataComponentSelectSchema, eE as SubAgentDataComponentUpdateSchema, dE as SubAgentInsertSchema, gg as SubAgentListResponse, dN as SubAgentRelationApiInsertSchema, dM as SubAgentRelationApiSelectSchema, dO as SubAgentRelationApiUpdateSchema, dK as SubAgentRelationInsertSchema, gr as SubAgentRelationListResponse, dP as SubAgentRelationQuerySchema, gb as SubAgentRelationResponse, dJ as SubAgentRelationSelectSchema, dL as SubAgentRelationUpdateSchema, g0 as SubAgentResponse, dD as SubAgentSelectSchema, f as SubAgentStopWhen, c as SubAgentStopWhenSchema, fC as SubAgentToolRelationApiInsertSchema, fB as SubAgentToolRelationApiSelectSchema, fD as SubAgentToolRelationApiUpdateSchema, fz as SubAgentToolRelationInsertSchema, gs as SubAgentToolRelationListResponse, gc as SubAgentToolRelationResponse, fy as SubAgentToolRelationSelectSchema, fA as SubAgentToolRelationUpdateSchema, dF as SubAgentUpdateSchema, e0 as TaskApiInsertSchema, d$ as TaskApiSelectSchema, e1 as TaskApiUpdateSchema, dZ as TaskInsertSchema, e6 as TaskRelationApiInsertSchema, e5 as TaskRelationApiSelectSchema, e7 as TaskRelationApiUpdateSchema, e3 as TaskRelationInsertSchema, e2 as TaskRelationSelectSchema, e4 as TaskRelationUpdateSchema, dY as TaskSelectSchema, d_ as TaskUpdateSchema, gB as TenantIdParamsSchema, gA as TenantParamsSchema, gF as TenantProjectAgentIdParamsSchema, gE as TenantProjectAgentParamsSchema, gH as TenantProjectAgentSubAgentIdParamsSchema, gG as TenantProjectAgentSubAgentParamsSchema, gD as TenantProjectIdParamsSchema, gC as TenantProjectParamsSchema, ff as ToolApiInsertSchema, fe as ToolApiSelectSchema, fg as ToolApiUpdateSchema, ec as ToolInsertSchema, gi as ToolListResponse, g2 as ToolResponse, eb as ToolSelectSchema, e9 as ToolStatusSchema, fd as ToolUpdateSchema, dx as URL_SAFE_ID_PATTERN, dy as resourceIdSchema } from '../utility-
|
|
2
|
+
import { d5 as SubAgentDefinition, d4 as InternalSubAgentDefinition, cL as ExternalSubAgentApiInsert, fN as AgentWithinContextOfProjectSchema, z as FullAgentDefinition } from '../utility-usOTNbMG.cjs';
|
|
3
|
+
export { dW as AgentApiInsertSchema, dV as AgentApiSelectSchema, dX as AgentApiUpdateSchema, dT as AgentInsertSchema, gh as AgentListResponse, g1 as AgentResponse, dS as AgentSelectSchema, e as AgentStopWhen, b as AgentStopWhenSchema, dU as AgentUpdateSchema, e_ as AllAgentSchema, f3 as ApiKeyApiCreationResponseSchema, f4 as ApiKeyApiInsertSchema, f2 as ApiKeyApiSelectSchema, A as ApiKeyApiUpdateSchema, f0 as ApiKeyInsertSchema, gl as ApiKeyListResponse, g5 as ApiKeyResponse, e$ as ApiKeySelectSchema, f1 as ApiKeyUpdateSchema, eM as ArtifactComponentApiInsertSchema, eL as ArtifactComponentApiSelectSchema, eN as ArtifactComponentApiUpdateSchema, eJ as ArtifactComponentInsertSchema, gq as ArtifactComponentListResponse, ga as ArtifactComponentResponse, eI as ArtifactComponentSelectSchema, eK as ArtifactComponentUpdateSchema, fM as CanUseItemSchema, et as ContextCacheApiInsertSchema, es as ContextCacheApiSelectSchema, eu as ContextCacheApiUpdateSchema, eq as ContextCacheInsertSchema, ep as ContextCacheSelectSchema, er as ContextCacheUpdateSchema, fw as ContextConfigApiInsertSchema, fv as ContextConfigApiSelectSchema, fx as ContextConfigApiUpdateSchema, ft as ContextConfigInsertSchema, gk as ContextConfigListResponse, g4 as ContextConfigResponse, fs as ContextConfigSelectSchema, fu as ContextConfigUpdateSchema, eh as ConversationApiInsertSchema, eg as ConversationApiSelectSchema, ei as ConversationApiUpdateSchema, ee as ConversationInsertSchema, gt as ConversationListResponse, gd as ConversationResponse, ed as ConversationSelectSchema, ef as ConversationUpdateSchema, f9 as CredentialReferenceApiInsertSchema, f8 as CredentialReferenceApiSelectSchema, fa as CredentialReferenceApiUpdateSchema, f6 as CredentialReferenceInsertSchema, gm as CredentialReferenceListResponse, g6 as CredentialReferenceResponse, f5 as CredentialReferenceSelectSchema, f7 as CredentialReferenceUpdateSchema, eA as DataComponentApiInsertSchema, ez as DataComponentApiSelectSchema, eB as DataComponentApiUpdateSchema, ex as DataComponentBaseSchema, ew as DataComponentInsertSchema, gp as DataComponentListResponse, g9 as DataComponentResponse, ev as DataComponentSelectSchema, ey as DataComponentUpdateSchema, fR as ErrorResponseSchema, fS as ExistsResponseSchema, eY as ExternalAgentApiInsertSchema, eX as ExternalAgentApiSelectSchema, eZ as ExternalAgentApiUpdateSchema, eV as ExternalAgentInsertSchema, gj as ExternalAgentListResponse, g3 as ExternalAgentResponse, eU as ExternalAgentSelectSchema, eW as ExternalAgentUpdateSchema, dR as ExternalSubAgentRelationApiInsertSchema, dQ as ExternalSubAgentRelationInsertSchema, fq as FetchConfigSchema, fr as FetchDefinitionSchema, a as FullAgentAgentInsertSchema, f_ as FullProjectDefinitionSchema, F as FunctionApiInsertSchema, j as FunctionApiSelectSchema, k as FunctionApiUpdateSchema, fo as FunctionInsertSchema, gn as FunctionListResponse, g7 as FunctionResponse, fn as FunctionSelectSchema, fl as FunctionToolApiInsertSchema, fk as FunctionToolApiSelectSchema, fm as FunctionToolApiUpdateSchema, dC as FunctionToolConfig, dB as FunctionToolConfigSchema, fi as FunctionToolInsertSchema, go as FunctionToolListResponse, g8 as FunctionToolResponse, fh as FunctionToolSelectSchema, fj as FunctionToolUpdateSchema, fp as FunctionUpdateSchema, gz as HeadersScopeSchema, fI as LedgerArtifactApiInsertSchema, fH as LedgerArtifactApiSelectSchema, fJ as LedgerArtifactApiUpdateSchema, fF as LedgerArtifactInsertSchema, fE as LedgerArtifactSelectSchema, fG as LedgerArtifactUpdateSchema, fP as ListResponseSchema, dw as MAX_ID_LENGTH, fc as MCPToolConfigSchema, dv as MIN_ID_LENGTH, ea as McpToolDefinitionSchema, fb as McpToolSchema, e8 as McpTransportConfigSchema, en as MessageApiInsertSchema, em as MessageApiSelectSchema, eo as MessageApiUpdateSchema, ek as MessageInsertSchema, gu as MessageListResponse, ge as MessageResponse, ej as MessageSelectSchema, el as MessageUpdateSchema, dz as ModelSchema, g as ModelSettings, M as ModelSettingsSchema, gI as PaginationQueryParamsSchema, fO as PaginationSchema, fY as ProjectApiInsertSchema, fX as ProjectApiSelectSchema, fZ as ProjectApiUpdateSchema, fV as ProjectInsertSchema, gf as ProjectListResponse, dA as ProjectModelSchema, f$ as ProjectResponse, fU as ProjectSelectSchema, fW as ProjectUpdateSchema, fT as RemovedResponseSchema, fQ as SingleResponseSchema, fK as StatusComponentSchema, fL as StatusUpdateSchema, d as StopWhen, S as StopWhenSchema, dH as SubAgentApiInsertSchema, dG as SubAgentApiSelectSchema, dI as SubAgentApiUpdateSchema, eS as SubAgentArtifactComponentApiInsertSchema, eR as SubAgentArtifactComponentApiSelectSchema, eT as SubAgentArtifactComponentApiUpdateSchema, eP as SubAgentArtifactComponentInsertSchema, gy as SubAgentArtifactComponentListResponse, gw as SubAgentArtifactComponentResponse, eO as SubAgentArtifactComponentSelectSchema, eQ as SubAgentArtifactComponentUpdateSchema, eG as SubAgentDataComponentApiInsertSchema, eF as SubAgentDataComponentApiSelectSchema, eH as SubAgentDataComponentApiUpdateSchema, eD as SubAgentDataComponentInsertSchema, gx as SubAgentDataComponentListResponse, gv as SubAgentDataComponentResponse, eC as SubAgentDataComponentSelectSchema, eE as SubAgentDataComponentUpdateSchema, dE as SubAgentInsertSchema, gg as SubAgentListResponse, dN as SubAgentRelationApiInsertSchema, dM as SubAgentRelationApiSelectSchema, dO as SubAgentRelationApiUpdateSchema, dK as SubAgentRelationInsertSchema, gr as SubAgentRelationListResponse, dP as SubAgentRelationQuerySchema, gb as SubAgentRelationResponse, dJ as SubAgentRelationSelectSchema, dL as SubAgentRelationUpdateSchema, g0 as SubAgentResponse, dD as SubAgentSelectSchema, f as SubAgentStopWhen, c as SubAgentStopWhenSchema, fC as SubAgentToolRelationApiInsertSchema, fB as SubAgentToolRelationApiSelectSchema, fD as SubAgentToolRelationApiUpdateSchema, fz as SubAgentToolRelationInsertSchema, gs as SubAgentToolRelationListResponse, gc as SubAgentToolRelationResponse, fy as SubAgentToolRelationSelectSchema, fA as SubAgentToolRelationUpdateSchema, dF as SubAgentUpdateSchema, e0 as TaskApiInsertSchema, d$ as TaskApiSelectSchema, e1 as TaskApiUpdateSchema, dZ as TaskInsertSchema, e6 as TaskRelationApiInsertSchema, e5 as TaskRelationApiSelectSchema, e7 as TaskRelationApiUpdateSchema, e3 as TaskRelationInsertSchema, e2 as TaskRelationSelectSchema, e4 as TaskRelationUpdateSchema, dY as TaskSelectSchema, d_ as TaskUpdateSchema, gB as TenantIdParamsSchema, gA as TenantParamsSchema, gF as TenantProjectAgentIdParamsSchema, gE as TenantProjectAgentParamsSchema, gH as TenantProjectAgentSubAgentIdParamsSchema, gG as TenantProjectAgentSubAgentParamsSchema, gD as TenantProjectIdParamsSchema, gC as TenantProjectParamsSchema, ff as ToolApiInsertSchema, fe as ToolApiSelectSchema, fg as ToolApiUpdateSchema, ec as ToolInsertSchema, gi as ToolListResponse, g2 as ToolResponse, eb as ToolSelectSchema, e9 as ToolStatusSchema, fd as ToolUpdateSchema, dx as URL_SAFE_ID_PATTERN, dy as resourceIdSchema } from '../utility-usOTNbMG.cjs';
|
|
4
4
|
export { P as PropsValidationResult, v as validatePropsAsJsonSchema } from '../props-validation-BMR1qNiy.cjs';
|
|
5
5
|
import 'drizzle-zod';
|
|
6
6
|
import 'drizzle-orm/sqlite-core';
|
|
7
7
|
import '@hono/zod-openapi';
|
|
8
8
|
|
|
9
|
+
declare function isInternalAgent(agent: SubAgentDefinition): agent is InternalSubAgentDefinition;
|
|
10
|
+
declare function isExternalAgent(agent: SubAgentDefinition): agent is ExternalSubAgentApiInsert;
|
|
11
|
+
declare function validateAndTypeAgentData(data: unknown): z.infer<typeof AgentWithinContextOfProjectSchema>;
|
|
12
|
+
/**
|
|
13
|
+
* Validates that all tool IDs referenced in agents exist in the tools record
|
|
14
|
+
* Note: With scoped architecture, tool validation should be done at the project level
|
|
15
|
+
* This function is kept for backward compatibility but will need project-scoped tool data
|
|
16
|
+
*/
|
|
17
|
+
declare function validateToolReferences(agentData: FullAgentDefinition, availableToolIds?: Set<string>): void;
|
|
18
|
+
/**
|
|
19
|
+
* Validates that all dataComponent IDs referenced in agents exist in the dataComponents record
|
|
20
|
+
* Note: With scoped architecture, dataComponent validation should be done at the project level
|
|
21
|
+
*/
|
|
22
|
+
declare function validateDataComponentReferences(agentData: FullAgentDefinition, availableDataComponentIds?: Set<string>): void;
|
|
23
|
+
/**
|
|
24
|
+
* Validates that all artifactComponent IDs referenced in agents exist in the artifactComponents record.
|
|
25
|
+
* Note: With scoped architecture, artifactComponent validation should be done at the project level
|
|
26
|
+
*/
|
|
27
|
+
declare function validateArtifactComponentReferences(agentData: FullAgentDefinition, availableArtifactComponentIds?: Set<string>): void;
|
|
28
|
+
/**
|
|
29
|
+
* Validates agent relationships (transfer and delegation targets exist)
|
|
30
|
+
*/
|
|
31
|
+
declare function validateAgentRelationships(agentData: FullAgentDefinition): void;
|
|
32
|
+
/**
|
|
33
|
+
* Validates the agent structure before creation/update
|
|
34
|
+
* Note: With scoped architecture, project-scoped resource validation should be done at project level
|
|
35
|
+
*/
|
|
36
|
+
declare function validateAgentStructure(agentData: FullAgentDefinition, projectResources?: {
|
|
37
|
+
toolIds?: Set<string>;
|
|
38
|
+
dataComponentIds?: Set<string>;
|
|
39
|
+
artifactComponentIds?: Set<string>;
|
|
40
|
+
}): void;
|
|
41
|
+
|
|
9
42
|
/**
|
|
10
43
|
* Agent transfer event data
|
|
11
44
|
* Used when an agent transfers control to another agent
|
|
@@ -78,39 +111,6 @@ declare const A2AMessageMetadataSchema: z.ZodObject<{
|
|
|
78
111
|
}, z.core.$strip>;
|
|
79
112
|
type A2AMessageMetadata = z.infer<typeof A2AMessageMetadataSchema>;
|
|
80
113
|
|
|
81
|
-
declare function isInternalAgent(agent: SubAgentDefinition): agent is InternalSubAgentDefinition;
|
|
82
|
-
declare function isExternalAgent(agent: SubAgentDefinition): agent is ExternalSubAgentApiInsert;
|
|
83
|
-
declare function validateAndTypeAgentData(data: unknown): z.infer<typeof AgentWithinContextOfProjectSchema>;
|
|
84
|
-
/**
|
|
85
|
-
* Validates that all tool IDs referenced in agents exist in the tools record
|
|
86
|
-
* Note: With scoped architecture, tool validation should be done at the project level
|
|
87
|
-
* This function is kept for backward compatibility but will need project-scoped tool data
|
|
88
|
-
*/
|
|
89
|
-
declare function validateToolReferences(agentData: FullAgentDefinition, availableToolIds?: Set<string>): void;
|
|
90
|
-
/**
|
|
91
|
-
* Validates that all dataComponent IDs referenced in agents exist in the dataComponents record
|
|
92
|
-
* Note: With scoped architecture, dataComponent validation should be done at the project level
|
|
93
|
-
*/
|
|
94
|
-
declare function validateDataComponentReferences(agentData: FullAgentDefinition, availableDataComponentIds?: Set<string>): void;
|
|
95
|
-
/**
|
|
96
|
-
* Validates that all artifactComponent IDs referenced in agents exist in the artifactComponents record.
|
|
97
|
-
* Note: With scoped architecture, artifactComponent validation should be done at the project level
|
|
98
|
-
*/
|
|
99
|
-
declare function validateArtifactComponentReferences(agentData: FullAgentDefinition, availableArtifactComponentIds?: Set<string>): void;
|
|
100
|
-
/**
|
|
101
|
-
* Validates agent relationships (transfer and delegation targets exist)
|
|
102
|
-
*/
|
|
103
|
-
declare function validateAgentRelationships(agentData: FullAgentDefinition): void;
|
|
104
|
-
/**
|
|
105
|
-
* Validates the agent structure before creation/update
|
|
106
|
-
* Note: With scoped architecture, project-scoped resource validation should be done at project level
|
|
107
|
-
*/
|
|
108
|
-
declare function validateAgentStructure(agentData: FullAgentDefinition, projectResources?: {
|
|
109
|
-
toolIds?: Set<string>;
|
|
110
|
-
dataComponentIds?: Set<string>;
|
|
111
|
-
artifactComponentIds?: Set<string>;
|
|
112
|
-
}): void;
|
|
113
|
-
|
|
114
114
|
/**
|
|
115
115
|
* Valid URL-safe characters for resource IDs based on RFC 3986.
|
|
116
116
|
*
|
|
@@ -133,4 +133,22 @@ declare function isValidResourceId(id: string): boolean;
|
|
|
133
133
|
*/
|
|
134
134
|
declare function generateIdFromName(name: string): string;
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Validation utilities for component preview code
|
|
138
|
+
*/
|
|
139
|
+
interface PreviewValidationResult {
|
|
140
|
+
isValid: boolean;
|
|
141
|
+
errors: Array<{
|
|
142
|
+
field: string;
|
|
143
|
+
message: string;
|
|
144
|
+
}>;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Validates component preview code and data
|
|
148
|
+
*/
|
|
149
|
+
declare function validatePreview(preview: {
|
|
150
|
+
code: string;
|
|
151
|
+
data: Record<string, unknown>;
|
|
152
|
+
}): PreviewValidationResult;
|
|
153
|
+
|
|
154
|
+
export { type A2AMessageMetadata, A2AMessageMetadataSchema, AgentWithinContextOfProjectSchema, type DataOperationDetails, DataOperationDetailsSchema, type DataOperationEvent, DataOperationEventSchema, type DelegationReturnedData, DelegationReturnedDataSchema, type DelegationSentData, DelegationSentDataSchema, type PreviewValidationResult, type TransferData, TransferDataSchema, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validatePreview, validateToolReferences };
|