@inkeep/agents-core 0.26.2 → 0.28.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/{chunk-HMVAAUTK.js → chunk-2GL6WAMT.js} +25 -31
- package/dist/{chunk-ALZI4IXB.js → chunk-FDR5SA4O.js} +60 -2
- package/dist/{chunk-NXC2HZQL.js → chunk-OYTJILYZ.js} +51 -12
- package/dist/client-exports.cjs +111 -12
- package/dist/client-exports.d.cts +10 -2
- package/dist/client-exports.d.ts +10 -2
- package/dist/client-exports.js +7 -3
- package/dist/db/schema.cjs +59 -1
- 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 +1984 -1257
- package/dist/index.d.cts +404 -33
- package/dist/index.d.ts +404 -33
- package/dist/index.js +1677 -1068
- package/dist/{schema-P1kG10Kn.d.cts → schema-Dl4IdQS5.d.cts} +233 -9
- package/dist/{schema-CDKDLrBu.d.ts → schema-O4RZSGWH.d.ts} +233 -9
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/{utility-CWjvUL4k.d.cts → utility-aTj9Dhgx.d.cts} +411 -88
- package/dist/{utility-CWjvUL4k.d.ts → utility-aTj9Dhgx.d.ts} +411 -88
- package/dist/validation/index.cjs +218 -121
- package/dist/validation/index.d.cts +10 -10
- package/dist/validation/index.d.ts +10 -10
- package/dist/validation/index.js +2 -2
- package/drizzle/0012_salty_psynapse.sql +17 -0
- package/drizzle/0013_shocking_blur.sql +19 -0
- package/drizzle/meta/0012_snapshot.json +2985 -0
- package/drizzle/meta/0013_snapshot.json +2988 -0
- package/drizzle/meta/_journal.json +14 -0
- package/package.json +2 -1
|
@@ -224,7 +224,7 @@ var dataComponents = sqliteCore.sqliteTable(
|
|
|
224
224
|
...projectScoped,
|
|
225
225
|
...uiProperties,
|
|
226
226
|
props: sqliteCore.blob("props", { mode: "json" }).$type(),
|
|
227
|
-
|
|
227
|
+
render: sqliteCore.blob("render", { mode: "json" }).$type(),
|
|
228
228
|
...timestamps
|
|
229
229
|
},
|
|
230
230
|
(table) => [
|
|
@@ -410,6 +410,28 @@ var subAgentExternalAgentRelations = sqliteCore.sqliteTable(
|
|
|
410
410
|
}).onDelete("cascade")
|
|
411
411
|
]
|
|
412
412
|
);
|
|
413
|
+
var subAgentTeamAgentRelations = sqliteCore.sqliteTable(
|
|
414
|
+
"sub_agent_team_agent_relations",
|
|
415
|
+
{
|
|
416
|
+
...subAgentScoped,
|
|
417
|
+
targetAgentId: sqliteCore.text("target_agent_id").notNull(),
|
|
418
|
+
headers: sqliteCore.blob("headers", { mode: "json" }).$type(),
|
|
419
|
+
...timestamps
|
|
420
|
+
},
|
|
421
|
+
(table) => [
|
|
422
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
423
|
+
sqliteCore.foreignKey({
|
|
424
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
425
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
426
|
+
name: "sub_agent_team_agent_relations_sub_agent_fk"
|
|
427
|
+
}).onDelete("cascade"),
|
|
428
|
+
sqliteCore.foreignKey({
|
|
429
|
+
columns: [table.tenantId, table.projectId, table.targetAgentId],
|
|
430
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
431
|
+
name: "sub_agent_team_agent_relations_target_agent_fk"
|
|
432
|
+
}).onDelete("cascade")
|
|
433
|
+
]
|
|
434
|
+
);
|
|
413
435
|
var subAgentFunctionToolRelations = sqliteCore.sqliteTable(
|
|
414
436
|
"sub_agent_function_tool_relations",
|
|
415
437
|
{
|
|
@@ -466,6 +488,8 @@ var messages = sqliteCore.sqliteTable(
|
|
|
466
488
|
toSubAgentId: sqliteCore.text("to_sub_agent_id"),
|
|
467
489
|
fromExternalAgentId: sqliteCore.text("from_external_sub_agent_id"),
|
|
468
490
|
toExternalAgentId: sqliteCore.text("to_external_sub_agent_id"),
|
|
491
|
+
fromTeamAgentId: sqliteCore.text("from_team_agent_id"),
|
|
492
|
+
toTeamAgentId: sqliteCore.text("to_team_agent_id"),
|
|
469
493
|
content: sqliteCore.blob("content", { mode: "json" }).$type().notNull(),
|
|
470
494
|
visibility: sqliteCore.text("visibility").notNull().default("user-facing"),
|
|
471
495
|
messageType: sqliteCore.text("message_type").notNull().default("chat"),
|
|
@@ -742,6 +766,16 @@ drizzleOrm.relations(messages, ({ one, many }) => ({
|
|
|
742
766
|
references: [subAgents.id],
|
|
743
767
|
relationName: "receivedMessages"
|
|
744
768
|
}),
|
|
769
|
+
fromTeamAgent: one(agents, {
|
|
770
|
+
fields: [messages.fromTeamAgentId],
|
|
771
|
+
references: [agents.id],
|
|
772
|
+
relationName: "receivedTeamMessages"
|
|
773
|
+
}),
|
|
774
|
+
toTeamAgent: one(agents, {
|
|
775
|
+
fields: [messages.toTeamAgentId],
|
|
776
|
+
references: [agents.id],
|
|
777
|
+
relationName: "sentTeamMessages"
|
|
778
|
+
}),
|
|
745
779
|
fromExternalAgent: one(externalAgents, {
|
|
746
780
|
fields: [messages.tenantId, messages.projectId, messages.fromExternalAgentId],
|
|
747
781
|
references: [externalAgents.tenantId, externalAgents.projectId, externalAgents.id],
|
|
@@ -885,6 +919,28 @@ drizzleOrm.relations(
|
|
|
885
919
|
})
|
|
886
920
|
})
|
|
887
921
|
);
|
|
922
|
+
drizzleOrm.relations(
|
|
923
|
+
subAgentTeamAgentRelations,
|
|
924
|
+
({ one }) => ({
|
|
925
|
+
subAgent: one(subAgents, {
|
|
926
|
+
fields: [
|
|
927
|
+
subAgentTeamAgentRelations.tenantId,
|
|
928
|
+
subAgentTeamAgentRelations.projectId,
|
|
929
|
+
subAgentTeamAgentRelations.agentId,
|
|
930
|
+
subAgentTeamAgentRelations.subAgentId
|
|
931
|
+
],
|
|
932
|
+
references: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id]
|
|
933
|
+
}),
|
|
934
|
+
targetAgent: one(agents, {
|
|
935
|
+
fields: [
|
|
936
|
+
subAgentTeamAgentRelations.tenantId,
|
|
937
|
+
subAgentTeamAgentRelations.projectId,
|
|
938
|
+
subAgentTeamAgentRelations.targetAgentId
|
|
939
|
+
],
|
|
940
|
+
references: [agents.tenantId, agents.projectId, agents.id]
|
|
941
|
+
})
|
|
942
|
+
})
|
|
943
|
+
);
|
|
888
944
|
|
|
889
945
|
// src/types/utility.ts
|
|
890
946
|
var TOOL_STATUS_VALUES = ["healthy", "unhealthy", "unknown", "needs_auth"];
|
|
@@ -965,7 +1021,8 @@ var SubAgentRelationInsertSchema = drizzleZod.createInsertSchema(subAgentRelatio
|
|
|
965
1021
|
agentId: resourceIdSchema,
|
|
966
1022
|
sourceSubAgentId: resourceIdSchema,
|
|
967
1023
|
targetSubAgentId: resourceIdSchema.optional(),
|
|
968
|
-
externalSubAgentId: resourceIdSchema.optional()
|
|
1024
|
+
externalSubAgentId: resourceIdSchema.optional(),
|
|
1025
|
+
teamSubAgentId: resourceIdSchema.optional()
|
|
969
1026
|
});
|
|
970
1027
|
var SubAgentRelationUpdateSchema = SubAgentRelationInsertSchema.partial();
|
|
971
1028
|
var SubAgentRelationApiSelectSchema = createAgentScopedApiSchema(
|
|
@@ -979,11 +1036,13 @@ var SubAgentRelationApiInsertSchema = createAgentScopedApiInsertSchema(
|
|
|
979
1036
|
(data) => {
|
|
980
1037
|
const hasTarget = data.targetSubAgentId != null;
|
|
981
1038
|
const hasExternal = data.externalSubAgentId != null;
|
|
982
|
-
|
|
1039
|
+
const hasTeam = data.teamSubAgentId != null;
|
|
1040
|
+
const count = [hasTarget, hasExternal, hasTeam].filter(Boolean).length;
|
|
1041
|
+
return count === 1;
|
|
983
1042
|
},
|
|
984
1043
|
{
|
|
985
|
-
message: "Must specify exactly one of targetSubAgentId or
|
|
986
|
-
path: ["targetSubAgentId", "externalSubAgentId"]
|
|
1044
|
+
message: "Must specify exactly one of targetSubAgentId, externalSubAgentId, or teamSubAgentId",
|
|
1045
|
+
path: ["targetSubAgentId", "externalSubAgentId", "teamSubAgentId"]
|
|
987
1046
|
}
|
|
988
1047
|
).openapi("SubAgentRelationCreate");
|
|
989
1048
|
var SubAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
|
|
@@ -994,20 +1053,23 @@ var SubAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
|
|
|
994
1053
|
(data) => {
|
|
995
1054
|
const hasTarget = data.targetSubAgentId != null;
|
|
996
1055
|
const hasExternal = data.externalSubAgentId != null;
|
|
997
|
-
|
|
1056
|
+
const hasTeam = data.teamSubAgentId != null;
|
|
1057
|
+
const count = [hasTarget, hasExternal, hasTeam].filter(Boolean).length;
|
|
1058
|
+
if (count === 0) {
|
|
998
1059
|
return true;
|
|
999
1060
|
}
|
|
1000
|
-
return
|
|
1061
|
+
return count === 1;
|
|
1001
1062
|
},
|
|
1002
1063
|
{
|
|
1003
|
-
message: "Must specify exactly one of targetSubAgentId or
|
|
1004
|
-
path: ["targetSubAgentId", "externalSubAgentId"]
|
|
1064
|
+
message: "Must specify exactly one of targetSubAgentId, externalSubAgentId, or teamSubAgentId when updating sub-agent relationships",
|
|
1065
|
+
path: ["targetSubAgentId", "externalSubAgentId", "teamSubAgentId"]
|
|
1005
1066
|
}
|
|
1006
1067
|
).openapi("SubAgentRelationUpdate");
|
|
1007
1068
|
var SubAgentRelationQuerySchema = zodOpenapi.z.object({
|
|
1008
1069
|
sourceSubAgentId: zodOpenapi.z.string().optional(),
|
|
1009
1070
|
targetSubAgentId: zodOpenapi.z.string().optional(),
|
|
1010
|
-
externalSubAgentId: zodOpenapi.z.string().optional()
|
|
1071
|
+
externalSubAgentId: zodOpenapi.z.string().optional(),
|
|
1072
|
+
teamSubAgentId: zodOpenapi.z.string().optional()
|
|
1011
1073
|
});
|
|
1012
1074
|
var ExternalSubAgentRelationInsertSchema = drizzleZod.createInsertSchema(subAgentRelations).extend({
|
|
1013
1075
|
id: resourceIdSchema,
|
|
@@ -1421,6 +1483,25 @@ var SubAgentExternalAgentRelationApiInsertSchema = createAgentScopedApiInsertSch
|
|
|
1421
1483
|
var SubAgentExternalAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
|
|
1422
1484
|
SubAgentExternalAgentRelationUpdateSchema
|
|
1423
1485
|
).openapi("SubAgentExternalAgentRelationUpdate");
|
|
1486
|
+
var SubAgentTeamAgentRelationSelectSchema = drizzleZod.createSelectSchema(subAgentTeamAgentRelations);
|
|
1487
|
+
var SubAgentTeamAgentRelationInsertSchema = drizzleZod.createInsertSchema(
|
|
1488
|
+
subAgentTeamAgentRelations
|
|
1489
|
+
).extend({
|
|
1490
|
+
id: resourceIdSchema,
|
|
1491
|
+
subAgentId: resourceIdSchema,
|
|
1492
|
+
targetAgentId: resourceIdSchema,
|
|
1493
|
+
headers: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.string()).nullish()
|
|
1494
|
+
});
|
|
1495
|
+
var SubAgentTeamAgentRelationUpdateSchema = SubAgentTeamAgentRelationInsertSchema.partial();
|
|
1496
|
+
var SubAgentTeamAgentRelationApiSelectSchema = createAgentScopedApiSchema(
|
|
1497
|
+
SubAgentTeamAgentRelationSelectSchema
|
|
1498
|
+
).openapi("SubAgentTeamAgentRelation");
|
|
1499
|
+
var SubAgentTeamAgentRelationApiInsertSchema = createAgentScopedApiInsertSchema(
|
|
1500
|
+
SubAgentTeamAgentRelationInsertSchema
|
|
1501
|
+
).omit({ id: true, subAgentId: true }).openapi("SubAgentTeamAgentRelationCreate");
|
|
1502
|
+
var SubAgentTeamAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
|
|
1503
|
+
SubAgentTeamAgentRelationUpdateSchema
|
|
1504
|
+
).openapi("SubAgentTeamAgentRelationUpdate");
|
|
1424
1505
|
var LedgerArtifactSelectSchema = drizzleZod.createSelectSchema(ledgerArtifacts);
|
|
1425
1506
|
var LedgerArtifactInsertSchema = drizzleZod.createInsertSchema(ledgerArtifacts);
|
|
1426
1507
|
var LedgerArtifactUpdateSchema = LedgerArtifactInsertSchema.partial();
|
|
@@ -1454,6 +1535,16 @@ var canDelegateToExternalAgentSchema = zodOpenapi.z.object({
|
|
|
1454
1535
|
subAgentExternalAgentRelationId: zodOpenapi.z.string().optional(),
|
|
1455
1536
|
headers: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.string()).nullish()
|
|
1456
1537
|
});
|
|
1538
|
+
var canDelegateToTeamAgentSchema = zodOpenapi.z.object({
|
|
1539
|
+
agentId: zodOpenapi.z.string(),
|
|
1540
|
+
subAgentTeamAgentRelationId: zodOpenapi.z.string().optional(),
|
|
1541
|
+
headers: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.string()).nullish()
|
|
1542
|
+
});
|
|
1543
|
+
var TeamAgentSchema = zodOpenapi.z.object({
|
|
1544
|
+
id: zodOpenapi.z.string(),
|
|
1545
|
+
name: zodOpenapi.z.string(),
|
|
1546
|
+
description: zodOpenapi.z.string()
|
|
1547
|
+
});
|
|
1457
1548
|
var FullAgentAgentInsertSchema = SubAgentApiInsertSchema.extend({
|
|
1458
1549
|
type: zodOpenapi.z.literal("internal"),
|
|
1459
1550
|
canUse: zodOpenapi.z.array(CanUseItemSchema),
|
|
@@ -1465,8 +1556,10 @@ var FullAgentAgentInsertSchema = SubAgentApiInsertSchema.extend({
|
|
|
1465
1556
|
zodOpenapi.z.union([
|
|
1466
1557
|
zodOpenapi.z.string(),
|
|
1467
1558
|
// Internal subAgent ID
|
|
1468
|
-
canDelegateToExternalAgentSchema
|
|
1559
|
+
canDelegateToExternalAgentSchema,
|
|
1469
1560
|
// External agent with headers
|
|
1561
|
+
canDelegateToTeamAgentSchema
|
|
1562
|
+
// Team agent with headers
|
|
1470
1563
|
])
|
|
1471
1564
|
).optional()
|
|
1472
1565
|
});
|
|
@@ -1477,6 +1570,8 @@ var AgentWithinContextOfProjectSchema = AgentApiInsertSchema.extend({
|
|
|
1477
1570
|
// MCP tools (project-scoped)
|
|
1478
1571
|
externalAgents: zodOpenapi.z.record(zodOpenapi.z.string(), ExternalAgentApiInsertSchema).optional(),
|
|
1479
1572
|
// External agents (project-scoped)
|
|
1573
|
+
teamAgents: zodOpenapi.z.record(zodOpenapi.z.string(), TeamAgentSchema).optional(),
|
|
1574
|
+
// Team agents contain basic metadata for the agent to be delegated to
|
|
1480
1575
|
functionTools: zodOpenapi.z.record(zodOpenapi.z.string(), FunctionToolApiInsertSchema).optional(),
|
|
1481
1576
|
// Function tools (agent-scoped)
|
|
1482
1577
|
functions: zodOpenapi.z.record(zodOpenapi.z.string(), FunctionApiInsertSchema).optional(),
|
|
@@ -1879,115 +1974,6 @@ function generateIdFromName(name) {
|
|
|
1879
1974
|
}
|
|
1880
1975
|
return truncatedId;
|
|
1881
1976
|
}
|
|
1882
|
-
|
|
1883
|
-
// src/validation/preview-validation.ts
|
|
1884
|
-
var MAX_CODE_SIZE = 5e4;
|
|
1885
|
-
var MAX_DATA_SIZE = 1e4;
|
|
1886
|
-
var DANGEROUS_PATTERNS = [
|
|
1887
|
-
{
|
|
1888
|
-
pattern: /\beval\s*\(/i,
|
|
1889
|
-
message: "eval() is not allowed"
|
|
1890
|
-
},
|
|
1891
|
-
{
|
|
1892
|
-
pattern: /\bFunction\s*\(/i,
|
|
1893
|
-
message: "Function constructor is not allowed"
|
|
1894
|
-
},
|
|
1895
|
-
{
|
|
1896
|
-
pattern: /dangerouslySetInnerHTML/i,
|
|
1897
|
-
message: "dangerouslySetInnerHTML is not allowed"
|
|
1898
|
-
},
|
|
1899
|
-
{
|
|
1900
|
-
pattern: /<script\b/i,
|
|
1901
|
-
message: "Script tags are not allowed"
|
|
1902
|
-
},
|
|
1903
|
-
{
|
|
1904
|
-
pattern: /\bon\w+\s*=/i,
|
|
1905
|
-
message: "Inline event handlers (onClick=, onLoad=, etc.) are not allowed"
|
|
1906
|
-
},
|
|
1907
|
-
{
|
|
1908
|
-
pattern: /document\.write/i,
|
|
1909
|
-
message: "document.write is not allowed"
|
|
1910
|
-
},
|
|
1911
|
-
{
|
|
1912
|
-
pattern: /window\.location/i,
|
|
1913
|
-
message: "window.location is not allowed"
|
|
1914
|
-
},
|
|
1915
|
-
{
|
|
1916
|
-
pattern: /\.innerHTML\s*=/i,
|
|
1917
|
-
message: "innerHTML manipulation is not allowed"
|
|
1918
|
-
}
|
|
1919
|
-
];
|
|
1920
|
-
var ALLOWED_IMPORTS = ["lucide-react"];
|
|
1921
|
-
function validatePreview(preview) {
|
|
1922
|
-
const errors = [];
|
|
1923
|
-
if (!preview.code || typeof preview.code !== "string") {
|
|
1924
|
-
return {
|
|
1925
|
-
isValid: false,
|
|
1926
|
-
errors: [{ field: "preview.code", message: "Code must be a non-empty string" }]
|
|
1927
|
-
};
|
|
1928
|
-
}
|
|
1929
|
-
if (!preview.data || typeof preview.data !== "object") {
|
|
1930
|
-
return {
|
|
1931
|
-
isValid: false,
|
|
1932
|
-
errors: [{ field: "preview.data", message: "Data must be an object" }]
|
|
1933
|
-
};
|
|
1934
|
-
}
|
|
1935
|
-
if (preview.code.length > MAX_CODE_SIZE) {
|
|
1936
|
-
errors.push({
|
|
1937
|
-
field: "preview.code",
|
|
1938
|
-
message: `Code size exceeds maximum allowed (${MAX_CODE_SIZE} characters)`
|
|
1939
|
-
});
|
|
1940
|
-
}
|
|
1941
|
-
const dataString = JSON.stringify(preview.data);
|
|
1942
|
-
if (dataString.length > MAX_DATA_SIZE) {
|
|
1943
|
-
errors.push({
|
|
1944
|
-
field: "preview.data",
|
|
1945
|
-
message: `Data size exceeds maximum allowed (${MAX_DATA_SIZE} characters)`
|
|
1946
|
-
});
|
|
1947
|
-
}
|
|
1948
|
-
for (const { pattern, message } of DANGEROUS_PATTERNS) {
|
|
1949
|
-
if (pattern.test(preview.code)) {
|
|
1950
|
-
errors.push({
|
|
1951
|
-
field: "preview.code",
|
|
1952
|
-
message: `Code contains potentially dangerous pattern: ${message}`
|
|
1953
|
-
});
|
|
1954
|
-
}
|
|
1955
|
-
}
|
|
1956
|
-
const importMatches = preview.code.matchAll(/import\s+.*?\s+from\s+['"]([^'"]+)['"]/g);
|
|
1957
|
-
for (const match of importMatches) {
|
|
1958
|
-
const importPath = match[1];
|
|
1959
|
-
if (!ALLOWED_IMPORTS.includes(importPath)) {
|
|
1960
|
-
errors.push({
|
|
1961
|
-
field: "preview.code",
|
|
1962
|
-
message: `Import from "${importPath}" is not allowed. Only imports from ${ALLOWED_IMPORTS.join(", ")} are permitted`
|
|
1963
|
-
});
|
|
1964
|
-
}
|
|
1965
|
-
}
|
|
1966
|
-
const hasFunctionDeclaration = /function\s+\w+\s*\(/.test(preview.code);
|
|
1967
|
-
if (!hasFunctionDeclaration) {
|
|
1968
|
-
errors.push({
|
|
1969
|
-
field: "preview.code",
|
|
1970
|
-
message: "Code must contain a function declaration"
|
|
1971
|
-
});
|
|
1972
|
-
}
|
|
1973
|
-
const hasReturn = /return\s*\(?\s*</.test(preview.code);
|
|
1974
|
-
if (!hasReturn) {
|
|
1975
|
-
errors.push({
|
|
1976
|
-
field: "preview.code",
|
|
1977
|
-
message: "Component function must have a return statement with JSX"
|
|
1978
|
-
});
|
|
1979
|
-
}
|
|
1980
|
-
if (/\bexport\s+(default\s+)?/i.test(preview.code)) {
|
|
1981
|
-
errors.push({
|
|
1982
|
-
field: "preview.code",
|
|
1983
|
-
message: "Code should not contain export statements"
|
|
1984
|
-
});
|
|
1985
|
-
}
|
|
1986
|
-
return {
|
|
1987
|
-
isValid: errors.length === 0,
|
|
1988
|
-
errors
|
|
1989
|
-
};
|
|
1990
|
-
}
|
|
1991
1977
|
function validatePropsAsJsonSchema(props) {
|
|
1992
1978
|
if (!props || typeof props === "object" && Object.keys(props).length === 0) {
|
|
1993
1979
|
return {
|
|
@@ -2091,6 +2077,109 @@ function validatePropsAsJsonSchema(props) {
|
|
|
2091
2077
|
}
|
|
2092
2078
|
}
|
|
2093
2079
|
|
|
2080
|
+
// src/validation/render-validation.ts
|
|
2081
|
+
var MAX_CODE_SIZE = 5e4;
|
|
2082
|
+
var MAX_DATA_SIZE = 1e4;
|
|
2083
|
+
var DANGEROUS_PATTERNS = [
|
|
2084
|
+
{
|
|
2085
|
+
pattern: /\beval\s*\(/i,
|
|
2086
|
+
message: "eval() is not allowed"
|
|
2087
|
+
},
|
|
2088
|
+
{
|
|
2089
|
+
pattern: /\bFunction\s*\(/i,
|
|
2090
|
+
message: "Function constructor is not allowed"
|
|
2091
|
+
},
|
|
2092
|
+
{
|
|
2093
|
+
pattern: /dangerouslySetInnerHTML/i,
|
|
2094
|
+
message: "dangerouslySetInnerHTML is not allowed"
|
|
2095
|
+
},
|
|
2096
|
+
{
|
|
2097
|
+
pattern: /<script\b/i,
|
|
2098
|
+
message: "Script tags are not allowed"
|
|
2099
|
+
},
|
|
2100
|
+
{
|
|
2101
|
+
pattern: /\bon\w+\s*=/i,
|
|
2102
|
+
message: "Inline event handlers (onClick=, onLoad=, etc.) are not allowed"
|
|
2103
|
+
},
|
|
2104
|
+
{
|
|
2105
|
+
pattern: /document\.write/i,
|
|
2106
|
+
message: "document.write is not allowed"
|
|
2107
|
+
},
|
|
2108
|
+
{
|
|
2109
|
+
pattern: /window\.location/i,
|
|
2110
|
+
message: "window.location is not allowed"
|
|
2111
|
+
},
|
|
2112
|
+
{
|
|
2113
|
+
pattern: /\.innerHTML\s*=/i,
|
|
2114
|
+
message: "innerHTML manipulation is not allowed"
|
|
2115
|
+
}
|
|
2116
|
+
];
|
|
2117
|
+
var ALLOWED_IMPORTS = ["lucide-react"];
|
|
2118
|
+
function validateRender(render) {
|
|
2119
|
+
const errors = [];
|
|
2120
|
+
if (!render.component || typeof render.component !== "string") {
|
|
2121
|
+
return {
|
|
2122
|
+
isValid: false,
|
|
2123
|
+
errors: [{ field: "render.component", message: "Component must be a non-empty string" }]
|
|
2124
|
+
};
|
|
2125
|
+
}
|
|
2126
|
+
if (!render.mockData || typeof render.mockData !== "object") {
|
|
2127
|
+
return {
|
|
2128
|
+
isValid: false,
|
|
2129
|
+
errors: [{ field: "render.mockData", message: "MockData must be an object" }]
|
|
2130
|
+
};
|
|
2131
|
+
}
|
|
2132
|
+
if (render.component.length > MAX_CODE_SIZE) {
|
|
2133
|
+
errors.push({
|
|
2134
|
+
field: "render.component",
|
|
2135
|
+
message: `Component size exceeds maximum allowed (${MAX_CODE_SIZE} characters)`
|
|
2136
|
+
});
|
|
2137
|
+
}
|
|
2138
|
+
const dataString = JSON.stringify(render.mockData);
|
|
2139
|
+
if (dataString.length > MAX_DATA_SIZE) {
|
|
2140
|
+
errors.push({
|
|
2141
|
+
field: "render.mockData",
|
|
2142
|
+
message: `MockData size exceeds maximum allowed (${MAX_DATA_SIZE} characters)`
|
|
2143
|
+
});
|
|
2144
|
+
}
|
|
2145
|
+
for (const { pattern, message } of DANGEROUS_PATTERNS) {
|
|
2146
|
+
if (pattern.test(render.component)) {
|
|
2147
|
+
errors.push({
|
|
2148
|
+
field: "render.component",
|
|
2149
|
+
message: `Component contains potentially dangerous pattern: ${message}`
|
|
2150
|
+
});
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2153
|
+
const importMatches = render.component.matchAll(/import\s+.*?\s+from\s+['"]([^'"]+)['"]/g);
|
|
2154
|
+
for (const match of importMatches) {
|
|
2155
|
+
const importPath = match[1];
|
|
2156
|
+
if (!ALLOWED_IMPORTS.includes(importPath) && !importPath.startsWith(".")) {
|
|
2157
|
+
errors.push({
|
|
2158
|
+
field: "render.component",
|
|
2159
|
+
message: `Import from "${importPath}" is not allowed. Only imports from ${ALLOWED_IMPORTS.join(", ")} are permitted`
|
|
2160
|
+
});
|
|
2161
|
+
}
|
|
2162
|
+
}
|
|
2163
|
+
const hasFunctionDeclaration = /function\s+\w+\s*\(/.test(render.component);
|
|
2164
|
+
if (!hasFunctionDeclaration) {
|
|
2165
|
+
errors.push({
|
|
2166
|
+
field: "render.component",
|
|
2167
|
+
message: "Component must contain a function declaration"
|
|
2168
|
+
});
|
|
2169
|
+
}
|
|
2170
|
+
const hasReturn = /return\s*\(?\s*</.test(render.component);
|
|
2171
|
+
if (!hasReturn) {
|
|
2172
|
+
errors.push({
|
|
2173
|
+
field: "render.component",
|
|
2174
|
+
message: "Component function must have a return statement with JSX"
|
|
2175
|
+
});
|
|
2176
|
+
}
|
|
2177
|
+
return {
|
|
2178
|
+
isValid: errors.length === 0,
|
|
2179
|
+
errors
|
|
2180
|
+
};
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2094
2183
|
exports.A2AMessageMetadataSchema = A2AMessageMetadataSchema;
|
|
2095
2184
|
exports.AgentApiInsertSchema = AgentApiInsertSchema;
|
|
2096
2185
|
exports.AgentApiSelectSchema = AgentApiSelectSchema;
|
|
@@ -2276,6 +2365,12 @@ exports.SubAgentRelationUpdateSchema = SubAgentRelationUpdateSchema;
|
|
|
2276
2365
|
exports.SubAgentResponse = SubAgentResponse;
|
|
2277
2366
|
exports.SubAgentSelectSchema = SubAgentSelectSchema;
|
|
2278
2367
|
exports.SubAgentStopWhenSchema = SubAgentStopWhenSchema;
|
|
2368
|
+
exports.SubAgentTeamAgentRelationApiInsertSchema = SubAgentTeamAgentRelationApiInsertSchema;
|
|
2369
|
+
exports.SubAgentTeamAgentRelationApiSelectSchema = SubAgentTeamAgentRelationApiSelectSchema;
|
|
2370
|
+
exports.SubAgentTeamAgentRelationApiUpdateSchema = SubAgentTeamAgentRelationApiUpdateSchema;
|
|
2371
|
+
exports.SubAgentTeamAgentRelationInsertSchema = SubAgentTeamAgentRelationInsertSchema;
|
|
2372
|
+
exports.SubAgentTeamAgentRelationSelectSchema = SubAgentTeamAgentRelationSelectSchema;
|
|
2373
|
+
exports.SubAgentTeamAgentRelationUpdateSchema = SubAgentTeamAgentRelationUpdateSchema;
|
|
2279
2374
|
exports.SubAgentToolRelationApiInsertSchema = SubAgentToolRelationApiInsertSchema;
|
|
2280
2375
|
exports.SubAgentToolRelationApiSelectSchema = SubAgentToolRelationApiSelectSchema;
|
|
2281
2376
|
exports.SubAgentToolRelationApiUpdateSchema = SubAgentToolRelationApiUpdateSchema;
|
|
@@ -2297,6 +2392,7 @@ exports.TaskRelationSelectSchema = TaskRelationSelectSchema;
|
|
|
2297
2392
|
exports.TaskRelationUpdateSchema = TaskRelationUpdateSchema;
|
|
2298
2393
|
exports.TaskSelectSchema = TaskSelectSchema;
|
|
2299
2394
|
exports.TaskUpdateSchema = TaskUpdateSchema;
|
|
2395
|
+
exports.TeamAgentSchema = TeamAgentSchema;
|
|
2300
2396
|
exports.TenantIdParamsSchema = TenantIdParamsSchema;
|
|
2301
2397
|
exports.TenantParamsSchema = TenantParamsSchema;
|
|
2302
2398
|
exports.TenantProjectAgentIdParamsSchema = TenantProjectAgentIdParamsSchema;
|
|
@@ -2317,6 +2413,7 @@ exports.ToolUpdateSchema = ToolUpdateSchema;
|
|
|
2317
2413
|
exports.TransferDataSchema = TransferDataSchema;
|
|
2318
2414
|
exports.URL_SAFE_ID_PATTERN = URL_SAFE_ID_PATTERN;
|
|
2319
2415
|
exports.canDelegateToExternalAgentSchema = canDelegateToExternalAgentSchema;
|
|
2416
|
+
exports.canDelegateToTeamAgentSchema = canDelegateToTeamAgentSchema;
|
|
2320
2417
|
exports.generateIdFromName = generateIdFromName;
|
|
2321
2418
|
exports.isValidResourceId = isValidResourceId;
|
|
2322
2419
|
exports.resourceIdSchema = resourceIdSchema;
|
|
@@ -2325,7 +2422,7 @@ exports.validateAgentStructure = validateAgentStructure;
|
|
|
2325
2422
|
exports.validateAndTypeAgentData = validateAndTypeAgentData;
|
|
2326
2423
|
exports.validateArtifactComponentReferences = validateArtifactComponentReferences;
|
|
2327
2424
|
exports.validateDataComponentReferences = validateDataComponentReferences;
|
|
2328
|
-
exports.validatePreview = validatePreview;
|
|
2329
2425
|
exports.validatePropsAsJsonSchema = validatePropsAsJsonSchema;
|
|
2426
|
+
exports.validateRender = validateRender;
|
|
2330
2427
|
exports.validateSubAgentExternalAgentRelations = validateSubAgentExternalAgentRelations;
|
|
2331
2428
|
exports.validateToolReferences = validateToolReferences;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { gc as AgentWithinContextOfProjectSchema, v as FullAgentDefinition } from '../utility-aTj9Dhgx.cjs';
|
|
3
|
+
export { e6 as AgentApiInsertSchema, e5 as AgentApiSelectSchema, e7 as AgentApiUpdateSchema, e3 as AgentInsertSchema, gI as AgentListResponse, gs as AgentResponse, e2 as AgentSelectSchema, e as AgentStopWhen, b as AgentStopWhenSchema, e4 as AgentUpdateSchema, fa as AllAgentSchema, ff as ApiKeyApiCreationResponseSchema, fg as ApiKeyApiInsertSchema, fe as ApiKeyApiSelectSchema, A as ApiKeyApiUpdateSchema, fc as ApiKeyInsertSchema, gM as ApiKeyListResponse, gw as ApiKeyResponse, fb as ApiKeySelectSchema, fd as ApiKeyUpdateSchema, eY as ArtifactComponentApiInsertSchema, eX as ArtifactComponentApiSelectSchema, eZ as ArtifactComponentApiUpdateSchema, eV as ArtifactComponentInsertSchema, gR as ArtifactComponentListResponse, gB as ArtifactComponentResponse, eU as ArtifactComponentSelectSchema, eW as ArtifactComponentUpdateSchema, g8 as CanUseItemSchema, eF as ContextCacheApiInsertSchema, eE as ContextCacheApiSelectSchema, eG as ContextCacheApiUpdateSchema, eC as ContextCacheInsertSchema, eB as ContextCacheSelectSchema, eD as ContextCacheUpdateSchema, fI as ContextConfigApiInsertSchema, fH as ContextConfigApiSelectSchema, fJ as ContextConfigApiUpdateSchema, fF as ContextConfigInsertSchema, gL as ContextConfigListResponse, gv as ContextConfigResponse, fE as ContextConfigSelectSchema, fG as ContextConfigUpdateSchema, et as ConversationApiInsertSchema, es as ConversationApiSelectSchema, eu as ConversationApiUpdateSchema, eq as ConversationInsertSchema, gU as ConversationListResponse, gE as ConversationResponse, ep as ConversationSelectSchema, er as ConversationUpdateSchema, fl as CredentialReferenceApiInsertSchema, fk as CredentialReferenceApiSelectSchema, fm as CredentialReferenceApiUpdateSchema, fi as CredentialReferenceInsertSchema, gN as CredentialReferenceListResponse, gx as CredentialReferenceResponse, fh as CredentialReferenceSelectSchema, fj as CredentialReferenceUpdateSchema, eM as DataComponentApiInsertSchema, eL as DataComponentApiSelectSchema, eN as DataComponentApiUpdateSchema, eJ as DataComponentBaseSchema, eI as DataComponentInsertSchema, gQ as DataComponentListResponse, gA as DataComponentResponse, eH as DataComponentSelectSchema, eK as DataComponentUpdateSchema, gg as ErrorResponseSchema, gh as ExistsResponseSchema, f8 as ExternalAgentApiInsertSchema, f7 as ExternalAgentApiSelectSchema, f9 as ExternalAgentApiUpdateSchema, f5 as ExternalAgentInsertSchema, gK as ExternalAgentListResponse, gu as ExternalAgentResponse, f4 as ExternalAgentSelectSchema, f6 as ExternalAgentUpdateSchema, e1 as ExternalSubAgentRelationApiInsertSchema, e0 as ExternalSubAgentRelationInsertSchema, fC as FetchConfigSchema, fD as FetchDefinitionSchema, a as FullAgentAgentInsertSchema, gp as FullProjectDefinitionSchema, F as FunctionApiInsertSchema, j as FunctionApiSelectSchema, k as FunctionApiUpdateSchema, fA as FunctionInsertSchema, gO as FunctionListResponse, gy as FunctionResponse, fz as FunctionSelectSchema, fx as FunctionToolApiInsertSchema, fw as FunctionToolApiSelectSchema, fy as FunctionToolApiUpdateSchema, dO as FunctionToolConfig, dN as FunctionToolConfigSchema, fu as FunctionToolInsertSchema, gP as FunctionToolListResponse, gz as FunctionToolResponse, ft as FunctionToolSelectSchema, fv as FunctionToolUpdateSchema, fB as FunctionUpdateSchema, g_ as HeadersScopeSchema, g4 as LedgerArtifactApiInsertSchema, g3 as LedgerArtifactApiSelectSchema, g5 as LedgerArtifactApiUpdateSchema, g1 as LedgerArtifactInsertSchema, g0 as LedgerArtifactSelectSchema, g2 as LedgerArtifactUpdateSchema, ge as ListResponseSchema, dI as MAX_ID_LENGTH, fo as MCPToolConfigSchema, dH as MIN_ID_LENGTH, em as McpToolDefinitionSchema, fn as McpToolSchema, ek as McpTransportConfigSchema, ez as MessageApiInsertSchema, ey as MessageApiSelectSchema, eA as MessageApiUpdateSchema, ew as MessageInsertSchema, gV as MessageListResponse, gF as MessageResponse, ev as MessageSelectSchema, ex as MessageUpdateSchema, dL as ModelSchema, g as ModelSettings, M as ModelSettingsSchema, h7 as PaginationQueryParamsSchema, gd as PaginationSchema, gn as ProjectApiInsertSchema, gm as ProjectApiSelectSchema, go as ProjectApiUpdateSchema, gk as ProjectInsertSchema, gG as ProjectListResponse, dM as ProjectModelSchema, gq as ProjectResponse, gj as ProjectSelectSchema, gl as ProjectUpdateSchema, gi as RemovedResponseSchema, gf as SingleResponseSchema, g6 as StatusComponentSchema, g7 as StatusUpdateSchema, d as StopWhen, S as StopWhenSchema, dT as SubAgentApiInsertSchema, dS as SubAgentApiSelectSchema, dU as SubAgentApiUpdateSchema, f2 as SubAgentArtifactComponentApiInsertSchema, f1 as SubAgentArtifactComponentApiSelectSchema, f3 as SubAgentArtifactComponentApiUpdateSchema, e$ as SubAgentArtifactComponentInsertSchema, gZ as SubAgentArtifactComponentListResponse, gX as SubAgentArtifactComponentResponse, e_ as SubAgentArtifactComponentSelectSchema, f0 as SubAgentArtifactComponentUpdateSchema, eS as SubAgentDataComponentApiInsertSchema, eR as SubAgentDataComponentApiSelectSchema, eT as SubAgentDataComponentApiUpdateSchema, eP as SubAgentDataComponentInsertSchema, gY as SubAgentDataComponentListResponse, gW as SubAgentDataComponentResponse, eO as SubAgentDataComponentSelectSchema, eQ as SubAgentDataComponentUpdateSchema, fU as SubAgentExternalAgentRelationApiInsertSchema, fT as SubAgentExternalAgentRelationApiSelectSchema, fV as SubAgentExternalAgentRelationApiUpdateSchema, fR as SubAgentExternalAgentRelationInsertSchema, fQ as SubAgentExternalAgentRelationSelectSchema, fS as SubAgentExternalAgentRelationUpdateSchema, dQ as SubAgentInsertSchema, gH as SubAgentListResponse, dZ as SubAgentRelationApiInsertSchema, dY as SubAgentRelationApiSelectSchema, d_ as SubAgentRelationApiUpdateSchema, dW as SubAgentRelationInsertSchema, gS as SubAgentRelationListResponse, d$ as SubAgentRelationQuerySchema, gC as SubAgentRelationResponse, dV as SubAgentRelationSelectSchema, dX as SubAgentRelationUpdateSchema, gr as SubAgentResponse, dP as SubAgentSelectSchema, f as SubAgentStopWhen, c as SubAgentStopWhenSchema, f_ as SubAgentTeamAgentRelationApiInsertSchema, fZ as SubAgentTeamAgentRelationApiSelectSchema, f$ as SubAgentTeamAgentRelationApiUpdateSchema, fX as SubAgentTeamAgentRelationInsertSchema, fW as SubAgentTeamAgentRelationSelectSchema, fY as SubAgentTeamAgentRelationUpdateSchema, fO as SubAgentToolRelationApiInsertSchema, fN as SubAgentToolRelationApiSelectSchema, fP as SubAgentToolRelationApiUpdateSchema, fL as SubAgentToolRelationInsertSchema, gT as SubAgentToolRelationListResponse, gD as SubAgentToolRelationResponse, fK as SubAgentToolRelationSelectSchema, fM as SubAgentToolRelationUpdateSchema, dR as SubAgentUpdateSchema, ec as TaskApiInsertSchema, eb as TaskApiSelectSchema, ed as TaskApiUpdateSchema, e9 as TaskInsertSchema, ei as TaskRelationApiInsertSchema, eh as TaskRelationApiSelectSchema, ej as TaskRelationApiUpdateSchema, ef as TaskRelationInsertSchema, ee as TaskRelationSelectSchema, eg as TaskRelationUpdateSchema, e8 as TaskSelectSchema, ea as TaskUpdateSchema, gb as TeamAgentSchema, h0 as TenantIdParamsSchema, g$ as TenantParamsSchema, h4 as TenantProjectAgentIdParamsSchema, h3 as TenantProjectAgentParamsSchema, h6 as TenantProjectAgentSubAgentIdParamsSchema, h5 as TenantProjectAgentSubAgentParamsSchema, h2 as TenantProjectIdParamsSchema, h1 as TenantProjectParamsSchema, fr as ToolApiInsertSchema, fq as ToolApiSelectSchema, fs as ToolApiUpdateSchema, eo as ToolInsertSchema, gJ as ToolListResponse, gt as ToolResponse, en as ToolSelectSchema, el as ToolStatusSchema, fp as ToolUpdateSchema, dJ as URL_SAFE_ID_PATTERN, g9 as canDelegateToExternalAgentSchema, ga as canDelegateToTeamAgentSchema, dK as resourceIdSchema } from '../utility-aTj9Dhgx.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';
|
|
@@ -134,9 +134,9 @@ declare function isValidResourceId(id: string): boolean;
|
|
|
134
134
|
declare function generateIdFromName(name: string): string;
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
|
-
* Validation utilities for component
|
|
137
|
+
* Validation utilities for component render code
|
|
138
138
|
*/
|
|
139
|
-
interface
|
|
139
|
+
interface RenderValidationResult {
|
|
140
140
|
isValid: boolean;
|
|
141
141
|
errors: Array<{
|
|
142
142
|
field: string;
|
|
@@ -144,11 +144,11 @@ interface PreviewValidationResult {
|
|
|
144
144
|
}>;
|
|
145
145
|
}
|
|
146
146
|
/**
|
|
147
|
-
* Validates component
|
|
147
|
+
* Validates component render code and data
|
|
148
148
|
*/
|
|
149
|
-
declare function
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}):
|
|
149
|
+
declare function validateRender(render: {
|
|
150
|
+
component: string;
|
|
151
|
+
mockData: Record<string, unknown>;
|
|
152
|
+
}): RenderValidationResult;
|
|
153
153
|
|
|
154
|
-
export { type A2AMessageMetadata, A2AMessageMetadataSchema, AgentWithinContextOfProjectSchema, type DataOperationDetails, DataOperationDetailsSchema, type DataOperationEvent, DataOperationEventSchema, type DelegationReturnedData, DelegationReturnedDataSchema, type DelegationSentData, DelegationSentDataSchema, type
|
|
154
|
+
export { type A2AMessageMetadata, A2AMessageMetadataSchema, AgentWithinContextOfProjectSchema, type DataOperationDetails, DataOperationDetailsSchema, type DataOperationEvent, DataOperationEventSchema, type DelegationReturnedData, DelegationReturnedDataSchema, type DelegationSentData, DelegationSentDataSchema, type RenderValidationResult, type TransferData, TransferDataSchema, generateIdFromName, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validateRender, validateSubAgentExternalAgentRelations, validateToolReferences };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { gc as AgentWithinContextOfProjectSchema, v as FullAgentDefinition } from '../utility-aTj9Dhgx.js';
|
|
3
|
+
export { e6 as AgentApiInsertSchema, e5 as AgentApiSelectSchema, e7 as AgentApiUpdateSchema, e3 as AgentInsertSchema, gI as AgentListResponse, gs as AgentResponse, e2 as AgentSelectSchema, e as AgentStopWhen, b as AgentStopWhenSchema, e4 as AgentUpdateSchema, fa as AllAgentSchema, ff as ApiKeyApiCreationResponseSchema, fg as ApiKeyApiInsertSchema, fe as ApiKeyApiSelectSchema, A as ApiKeyApiUpdateSchema, fc as ApiKeyInsertSchema, gM as ApiKeyListResponse, gw as ApiKeyResponse, fb as ApiKeySelectSchema, fd as ApiKeyUpdateSchema, eY as ArtifactComponentApiInsertSchema, eX as ArtifactComponentApiSelectSchema, eZ as ArtifactComponentApiUpdateSchema, eV as ArtifactComponentInsertSchema, gR as ArtifactComponentListResponse, gB as ArtifactComponentResponse, eU as ArtifactComponentSelectSchema, eW as ArtifactComponentUpdateSchema, g8 as CanUseItemSchema, eF as ContextCacheApiInsertSchema, eE as ContextCacheApiSelectSchema, eG as ContextCacheApiUpdateSchema, eC as ContextCacheInsertSchema, eB as ContextCacheSelectSchema, eD as ContextCacheUpdateSchema, fI as ContextConfigApiInsertSchema, fH as ContextConfigApiSelectSchema, fJ as ContextConfigApiUpdateSchema, fF as ContextConfigInsertSchema, gL as ContextConfigListResponse, gv as ContextConfigResponse, fE as ContextConfigSelectSchema, fG as ContextConfigUpdateSchema, et as ConversationApiInsertSchema, es as ConversationApiSelectSchema, eu as ConversationApiUpdateSchema, eq as ConversationInsertSchema, gU as ConversationListResponse, gE as ConversationResponse, ep as ConversationSelectSchema, er as ConversationUpdateSchema, fl as CredentialReferenceApiInsertSchema, fk as CredentialReferenceApiSelectSchema, fm as CredentialReferenceApiUpdateSchema, fi as CredentialReferenceInsertSchema, gN as CredentialReferenceListResponse, gx as CredentialReferenceResponse, fh as CredentialReferenceSelectSchema, fj as CredentialReferenceUpdateSchema, eM as DataComponentApiInsertSchema, eL as DataComponentApiSelectSchema, eN as DataComponentApiUpdateSchema, eJ as DataComponentBaseSchema, eI as DataComponentInsertSchema, gQ as DataComponentListResponse, gA as DataComponentResponse, eH as DataComponentSelectSchema, eK as DataComponentUpdateSchema, gg as ErrorResponseSchema, gh as ExistsResponseSchema, f8 as ExternalAgentApiInsertSchema, f7 as ExternalAgentApiSelectSchema, f9 as ExternalAgentApiUpdateSchema, f5 as ExternalAgentInsertSchema, gK as ExternalAgentListResponse, gu as ExternalAgentResponse, f4 as ExternalAgentSelectSchema, f6 as ExternalAgentUpdateSchema, e1 as ExternalSubAgentRelationApiInsertSchema, e0 as ExternalSubAgentRelationInsertSchema, fC as FetchConfigSchema, fD as FetchDefinitionSchema, a as FullAgentAgentInsertSchema, gp as FullProjectDefinitionSchema, F as FunctionApiInsertSchema, j as FunctionApiSelectSchema, k as FunctionApiUpdateSchema, fA as FunctionInsertSchema, gO as FunctionListResponse, gy as FunctionResponse, fz as FunctionSelectSchema, fx as FunctionToolApiInsertSchema, fw as FunctionToolApiSelectSchema, fy as FunctionToolApiUpdateSchema, dO as FunctionToolConfig, dN as FunctionToolConfigSchema, fu as FunctionToolInsertSchema, gP as FunctionToolListResponse, gz as FunctionToolResponse, ft as FunctionToolSelectSchema, fv as FunctionToolUpdateSchema, fB as FunctionUpdateSchema, g_ as HeadersScopeSchema, g4 as LedgerArtifactApiInsertSchema, g3 as LedgerArtifactApiSelectSchema, g5 as LedgerArtifactApiUpdateSchema, g1 as LedgerArtifactInsertSchema, g0 as LedgerArtifactSelectSchema, g2 as LedgerArtifactUpdateSchema, ge as ListResponseSchema, dI as MAX_ID_LENGTH, fo as MCPToolConfigSchema, dH as MIN_ID_LENGTH, em as McpToolDefinitionSchema, fn as McpToolSchema, ek as McpTransportConfigSchema, ez as MessageApiInsertSchema, ey as MessageApiSelectSchema, eA as MessageApiUpdateSchema, ew as MessageInsertSchema, gV as MessageListResponse, gF as MessageResponse, ev as MessageSelectSchema, ex as MessageUpdateSchema, dL as ModelSchema, g as ModelSettings, M as ModelSettingsSchema, h7 as PaginationQueryParamsSchema, gd as PaginationSchema, gn as ProjectApiInsertSchema, gm as ProjectApiSelectSchema, go as ProjectApiUpdateSchema, gk as ProjectInsertSchema, gG as ProjectListResponse, dM as ProjectModelSchema, gq as ProjectResponse, gj as ProjectSelectSchema, gl as ProjectUpdateSchema, gi as RemovedResponseSchema, gf as SingleResponseSchema, g6 as StatusComponentSchema, g7 as StatusUpdateSchema, d as StopWhen, S as StopWhenSchema, dT as SubAgentApiInsertSchema, dS as SubAgentApiSelectSchema, dU as SubAgentApiUpdateSchema, f2 as SubAgentArtifactComponentApiInsertSchema, f1 as SubAgentArtifactComponentApiSelectSchema, f3 as SubAgentArtifactComponentApiUpdateSchema, e$ as SubAgentArtifactComponentInsertSchema, gZ as SubAgentArtifactComponentListResponse, gX as SubAgentArtifactComponentResponse, e_ as SubAgentArtifactComponentSelectSchema, f0 as SubAgentArtifactComponentUpdateSchema, eS as SubAgentDataComponentApiInsertSchema, eR as SubAgentDataComponentApiSelectSchema, eT as SubAgentDataComponentApiUpdateSchema, eP as SubAgentDataComponentInsertSchema, gY as SubAgentDataComponentListResponse, gW as SubAgentDataComponentResponse, eO as SubAgentDataComponentSelectSchema, eQ as SubAgentDataComponentUpdateSchema, fU as SubAgentExternalAgentRelationApiInsertSchema, fT as SubAgentExternalAgentRelationApiSelectSchema, fV as SubAgentExternalAgentRelationApiUpdateSchema, fR as SubAgentExternalAgentRelationInsertSchema, fQ as SubAgentExternalAgentRelationSelectSchema, fS as SubAgentExternalAgentRelationUpdateSchema, dQ as SubAgentInsertSchema, gH as SubAgentListResponse, dZ as SubAgentRelationApiInsertSchema, dY as SubAgentRelationApiSelectSchema, d_ as SubAgentRelationApiUpdateSchema, dW as SubAgentRelationInsertSchema, gS as SubAgentRelationListResponse, d$ as SubAgentRelationQuerySchema, gC as SubAgentRelationResponse, dV as SubAgentRelationSelectSchema, dX as SubAgentRelationUpdateSchema, gr as SubAgentResponse, dP as SubAgentSelectSchema, f as SubAgentStopWhen, c as SubAgentStopWhenSchema, f_ as SubAgentTeamAgentRelationApiInsertSchema, fZ as SubAgentTeamAgentRelationApiSelectSchema, f$ as SubAgentTeamAgentRelationApiUpdateSchema, fX as SubAgentTeamAgentRelationInsertSchema, fW as SubAgentTeamAgentRelationSelectSchema, fY as SubAgentTeamAgentRelationUpdateSchema, fO as SubAgentToolRelationApiInsertSchema, fN as SubAgentToolRelationApiSelectSchema, fP as SubAgentToolRelationApiUpdateSchema, fL as SubAgentToolRelationInsertSchema, gT as SubAgentToolRelationListResponse, gD as SubAgentToolRelationResponse, fK as SubAgentToolRelationSelectSchema, fM as SubAgentToolRelationUpdateSchema, dR as SubAgentUpdateSchema, ec as TaskApiInsertSchema, eb as TaskApiSelectSchema, ed as TaskApiUpdateSchema, e9 as TaskInsertSchema, ei as TaskRelationApiInsertSchema, eh as TaskRelationApiSelectSchema, ej as TaskRelationApiUpdateSchema, ef as TaskRelationInsertSchema, ee as TaskRelationSelectSchema, eg as TaskRelationUpdateSchema, e8 as TaskSelectSchema, ea as TaskUpdateSchema, gb as TeamAgentSchema, h0 as TenantIdParamsSchema, g$ as TenantParamsSchema, h4 as TenantProjectAgentIdParamsSchema, h3 as TenantProjectAgentParamsSchema, h6 as TenantProjectAgentSubAgentIdParamsSchema, h5 as TenantProjectAgentSubAgentParamsSchema, h2 as TenantProjectIdParamsSchema, h1 as TenantProjectParamsSchema, fr as ToolApiInsertSchema, fq as ToolApiSelectSchema, fs as ToolApiUpdateSchema, eo as ToolInsertSchema, gJ as ToolListResponse, gt as ToolResponse, en as ToolSelectSchema, el as ToolStatusSchema, fp as ToolUpdateSchema, dJ as URL_SAFE_ID_PATTERN, g9 as canDelegateToExternalAgentSchema, ga as canDelegateToTeamAgentSchema, dK as resourceIdSchema } from '../utility-aTj9Dhgx.js';
|
|
4
4
|
export { P as PropsValidationResult, v as validatePropsAsJsonSchema } from '../props-validation-BMR1qNiy.js';
|
|
5
5
|
import 'drizzle-zod';
|
|
6
6
|
import 'drizzle-orm/sqlite-core';
|
|
@@ -134,9 +134,9 @@ declare function isValidResourceId(id: string): boolean;
|
|
|
134
134
|
declare function generateIdFromName(name: string): string;
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
|
-
* Validation utilities for component
|
|
137
|
+
* Validation utilities for component render code
|
|
138
138
|
*/
|
|
139
|
-
interface
|
|
139
|
+
interface RenderValidationResult {
|
|
140
140
|
isValid: boolean;
|
|
141
141
|
errors: Array<{
|
|
142
142
|
field: string;
|
|
@@ -144,11 +144,11 @@ interface PreviewValidationResult {
|
|
|
144
144
|
}>;
|
|
145
145
|
}
|
|
146
146
|
/**
|
|
147
|
-
* Validates component
|
|
147
|
+
* Validates component render code and data
|
|
148
148
|
*/
|
|
149
|
-
declare function
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}):
|
|
149
|
+
declare function validateRender(render: {
|
|
150
|
+
component: string;
|
|
151
|
+
mockData: Record<string, unknown>;
|
|
152
|
+
}): RenderValidationResult;
|
|
153
153
|
|
|
154
|
-
export { type A2AMessageMetadata, A2AMessageMetadataSchema, AgentWithinContextOfProjectSchema, type DataOperationDetails, DataOperationDetailsSchema, type DataOperationEvent, DataOperationEventSchema, type DelegationReturnedData, DelegationReturnedDataSchema, type DelegationSentData, DelegationSentDataSchema, type
|
|
154
|
+
export { type A2AMessageMetadata, A2AMessageMetadataSchema, AgentWithinContextOfProjectSchema, type DataOperationDetails, DataOperationDetailsSchema, type DataOperationEvent, DataOperationEventSchema, type DelegationReturnedData, DelegationReturnedDataSchema, type DelegationSentData, DelegationSentDataSchema, type RenderValidationResult, type TransferData, TransferDataSchema, generateIdFromName, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validateRender, validateSubAgentExternalAgentRelations, validateToolReferences };
|