@inkeep/agents-core 0.15.0 → 0.16.1
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-FLKAMXLV.js → chunk-L53XWAYG.js} +1 -1
- package/dist/chunk-R2EERZSW.js +223 -0
- package/dist/{chunk-FMCAYVO7.js → chunk-TO2HNKGP.js} +167 -10
- package/dist/{chunk-AHSEMW6N.js → chunk-VPJ6Z5QZ.js} +43 -7
- package/dist/client-exports.cjs +215 -21
- package/dist/client-exports.d.cts +16 -12
- package/dist/client-exports.d.ts +16 -12
- package/dist/client-exports.js +4 -10
- package/dist/db/schema.cjs +42 -6
- 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 +3274 -2819
- package/dist/index.d.cts +365 -314
- package/dist/index.d.ts +365 -314
- package/dist/index.js +2519 -2494
- package/dist/props-validation-BMR1qNiy.d.cts +15 -0
- package/dist/props-validation-BMR1qNiy.d.ts +15 -0
- package/dist/{schema-D0E2bG9V.d.ts → schema-BtdvdyOA.d.ts} +253 -64
- package/dist/{schema-CTBfyt-o.d.cts → schema-DVnfWYwH.d.cts} +253 -64
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/{utility-BMAHFZX6.d.cts → utility-BaVsvScm.d.cts} +873 -326
- package/dist/{utility-BMAHFZX6.d.ts → utility-BaVsvScm.d.ts} +873 -326
- package/dist/utils/schema-conversion.cjs +236 -0
- package/dist/utils/schema-conversion.d.cts +26 -0
- package/dist/utils/schema-conversion.d.ts +26 -0
- package/dist/utils/schema-conversion.js +1 -0
- package/dist/validation/index.cjs +218 -14
- package/dist/validation/index.d.cts +3 -2
- package/dist/validation/index.d.ts +3 -2
- package/dist/validation/index.js +2 -2
- package/drizzle/0002_bumpy_romulus.sql +3 -0
- package/drizzle/0003_soft_forgotten_one.sql +39 -0
- package/drizzle/0004_melted_omega_flight.sql +3 -0
- package/drizzle/meta/0002_snapshot.json +2428 -0
- package/drizzle/meta/0003_snapshot.json +2559 -0
- package/drizzle/meta/0004_snapshot.json +2547 -0
- package/drizzle/meta/_journal.json +21 -0
- package/package.json +1 -1
package/dist/client-exports.cjs
CHANGED
|
@@ -5,6 +5,11 @@ var zodOpenapi = require('@hono/zod-openapi');
|
|
|
5
5
|
var drizzleZod = require('drizzle-zod');
|
|
6
6
|
var drizzleOrm = require('drizzle-orm');
|
|
7
7
|
var sqliteCore = require('drizzle-orm/sqlite-core');
|
|
8
|
+
var Ajv = require('ajv');
|
|
9
|
+
|
|
10
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
|
|
12
|
+
var Ajv__default = /*#__PURE__*/_interopDefault(Ajv);
|
|
8
13
|
|
|
9
14
|
// src/client-exports.ts
|
|
10
15
|
|
|
@@ -57,6 +62,8 @@ var projects = sqliteCore.sqliteTable(
|
|
|
57
62
|
models: sqliteCore.text("models", { mode: "json" }).$type(),
|
|
58
63
|
// Project-level stopWhen configuration that can be inherited by graphs and agents
|
|
59
64
|
stopWhen: sqliteCore.text("stop_when", { mode: "json" }).$type(),
|
|
65
|
+
// Project-level sandbox configuration for function execution
|
|
66
|
+
sandboxConfig: sqliteCore.text("sandbox_config", { mode: "json" }).$type(),
|
|
60
67
|
...timestamps
|
|
61
68
|
},
|
|
62
69
|
(table) => [sqliteCore.primaryKey({ columns: [table.tenantId, table.id] })]
|
|
@@ -94,9 +101,8 @@ var contextConfigs = sqliteCore.sqliteTable(
|
|
|
94
101
|
"context_configs",
|
|
95
102
|
{
|
|
96
103
|
...graphScoped,
|
|
97
|
-
...uiProperties,
|
|
98
104
|
// Developer-defined Zod schema for validating incoming request context
|
|
99
|
-
|
|
105
|
+
headersSchema: sqliteCore.blob("headers_schema", { mode: "json" }).$type(),
|
|
100
106
|
// Stores serialized Zod schema
|
|
101
107
|
// Object mapping template keys to fetch definitions that use request context data
|
|
102
108
|
contextVariables: sqliteCore.blob("context_variables", { mode: "json" }).$type(),
|
|
@@ -303,8 +309,7 @@ var artifactComponents = sqliteCore.sqliteTable(
|
|
|
303
309
|
{
|
|
304
310
|
...projectScoped,
|
|
305
311
|
...uiProperties,
|
|
306
|
-
|
|
307
|
-
fullProps: sqliteCore.blob("full_props", { mode: "json" }).$type(),
|
|
312
|
+
props: sqliteCore.blob("props", { mode: "json" }).$type(),
|
|
308
313
|
...timestamps
|
|
309
314
|
},
|
|
310
315
|
(table) => [
|
|
@@ -350,13 +355,16 @@ var tools = sqliteCore.sqliteTable(
|
|
|
350
355
|
{
|
|
351
356
|
...projectScoped,
|
|
352
357
|
name: sqliteCore.text("name").notNull(),
|
|
353
|
-
|
|
358
|
+
description: sqliteCore.text("description"),
|
|
359
|
+
// Tool configuration - supports both MCP and function tools
|
|
354
360
|
config: sqliteCore.blob("config", { mode: "json" }).$type().notNull(),
|
|
361
|
+
// For function tools, reference the global functions table
|
|
362
|
+
functionId: sqliteCore.text("function_id"),
|
|
355
363
|
credentialReferenceId: sqliteCore.text("credential_reference_id"),
|
|
356
364
|
headers: sqliteCore.blob("headers", { mode: "json" }).$type(),
|
|
357
365
|
// Image URL for custom tool icon (supports regular URLs and base64 encoded images)
|
|
358
366
|
imageUrl: sqliteCore.text("image_url"),
|
|
359
|
-
// Server capabilities and status
|
|
367
|
+
// Server capabilities and status (only for MCP tools)
|
|
360
368
|
capabilities: sqliteCore.blob("capabilities", { mode: "json" }).$type(),
|
|
361
369
|
lastError: sqliteCore.text("last_error"),
|
|
362
370
|
...timestamps
|
|
@@ -367,6 +375,30 @@ var tools = sqliteCore.sqliteTable(
|
|
|
367
375
|
columns: [table.tenantId, table.projectId],
|
|
368
376
|
foreignColumns: [projects.tenantId, projects.id],
|
|
369
377
|
name: "tools_project_fk"
|
|
378
|
+
}).onDelete("cascade"),
|
|
379
|
+
// Foreign key constraint to functions table (for function tools)
|
|
380
|
+
sqliteCore.foreignKey({
|
|
381
|
+
columns: [table.tenantId, table.projectId, table.functionId],
|
|
382
|
+
foreignColumns: [functions.tenantId, functions.projectId, functions.id],
|
|
383
|
+
name: "tools_function_fk"
|
|
384
|
+
}).onDelete("cascade")
|
|
385
|
+
]
|
|
386
|
+
);
|
|
387
|
+
var functions = sqliteCore.sqliteTable(
|
|
388
|
+
"functions",
|
|
389
|
+
{
|
|
390
|
+
...projectScoped,
|
|
391
|
+
inputSchema: sqliteCore.blob("input_schema", { mode: "json" }).$type(),
|
|
392
|
+
executeCode: sqliteCore.text("execute_code").notNull(),
|
|
393
|
+
dependencies: sqliteCore.blob("dependencies", { mode: "json" }).$type(),
|
|
394
|
+
...timestamps
|
|
395
|
+
},
|
|
396
|
+
(table) => [
|
|
397
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
398
|
+
sqliteCore.foreignKey({
|
|
399
|
+
columns: [table.tenantId, table.projectId],
|
|
400
|
+
foreignColumns: [projects.tenantId, projects.id],
|
|
401
|
+
name: "functions_project_fk"
|
|
370
402
|
}).onDelete("cascade")
|
|
371
403
|
]
|
|
372
404
|
);
|
|
@@ -701,6 +733,10 @@ drizzleOrm.relations(tools, ({ one, many }) => ({
|
|
|
701
733
|
credentialReference: one(credentialReferences, {
|
|
702
734
|
fields: [tools.credentialReferenceId],
|
|
703
735
|
references: [credentialReferences.id]
|
|
736
|
+
}),
|
|
737
|
+
function: one(functions, {
|
|
738
|
+
fields: [tools.functionId],
|
|
739
|
+
references: [functions.id]
|
|
704
740
|
})
|
|
705
741
|
}));
|
|
706
742
|
drizzleOrm.relations(conversations, ({ one, many }) => ({
|
|
@@ -798,6 +834,9 @@ drizzleOrm.relations(ledgerArtifacts, ({ one }) => ({
|
|
|
798
834
|
references: [tasks.id]
|
|
799
835
|
})
|
|
800
836
|
}));
|
|
837
|
+
drizzleOrm.relations(functions, ({ many }) => ({
|
|
838
|
+
tools: many(tools)
|
|
839
|
+
}));
|
|
801
840
|
drizzleOrm.relations(agentRelations, ({ one }) => ({
|
|
802
841
|
graph: one(agentGraph, {
|
|
803
842
|
fields: [agentRelations.graphId],
|
|
@@ -849,6 +888,19 @@ var ProjectModelSchema = zodOpenapi.z.object({
|
|
|
849
888
|
structuredOutput: ModelSettingsSchema.optional(),
|
|
850
889
|
summarizer: ModelSettingsSchema.optional()
|
|
851
890
|
});
|
|
891
|
+
var SandboxConfigSchema = zodOpenapi.z.object({
|
|
892
|
+
provider: zodOpenapi.z.enum(["vercel", "local"]),
|
|
893
|
+
runtime: zodOpenapi.z.enum(["node22", "typescript"]),
|
|
894
|
+
timeout: zodOpenapi.z.number().min(1e3).max(3e5).optional(),
|
|
895
|
+
vcpus: zodOpenapi.z.number().min(1).max(8).optional()
|
|
896
|
+
});
|
|
897
|
+
zodOpenapi.z.object({
|
|
898
|
+
name: zodOpenapi.z.string(),
|
|
899
|
+
description: zodOpenapi.z.string(),
|
|
900
|
+
inputSchema: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()),
|
|
901
|
+
dependencies: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.string()).optional(),
|
|
902
|
+
execute: zodOpenapi.z.union([zodOpenapi.z.function(), zodOpenapi.z.string()])
|
|
903
|
+
});
|
|
852
904
|
var createApiSchema = (schema) => schema.omit({ tenantId: true, projectId: true });
|
|
853
905
|
var createApiInsertSchema = (schema) => schema.omit({ tenantId: true, projectId: true });
|
|
854
906
|
var createApiUpdateSchema = (schema) => schema.omit({ tenantId: true, projectId: true }).partial();
|
|
@@ -985,7 +1037,33 @@ var McpToolDefinitionSchema = zodOpenapi.z.object({
|
|
|
985
1037
|
var ToolSelectSchema = drizzleZod.createSelectSchema(tools);
|
|
986
1038
|
var ToolInsertSchema = drizzleZod.createInsertSchema(tools).extend({
|
|
987
1039
|
id: resourceIdSchema,
|
|
988
|
-
imageUrl: imageUrlSchema
|
|
1040
|
+
imageUrl: imageUrlSchema,
|
|
1041
|
+
functionId: resourceIdSchema.optional(),
|
|
1042
|
+
// For function tools, reference to global functions table
|
|
1043
|
+
config: zodOpenapi.z.discriminatedUnion("type", [
|
|
1044
|
+
// MCP tools
|
|
1045
|
+
zodOpenapi.z.object({
|
|
1046
|
+
type: zodOpenapi.z.literal("mcp"),
|
|
1047
|
+
mcp: zodOpenapi.z.object({
|
|
1048
|
+
server: zodOpenapi.z.object({
|
|
1049
|
+
url: zodOpenapi.z.string().url()
|
|
1050
|
+
}),
|
|
1051
|
+
transport: zodOpenapi.z.object({
|
|
1052
|
+
type: zodOpenapi.z.enum(MCPTransportType),
|
|
1053
|
+
requestInit: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).optional(),
|
|
1054
|
+
eventSourceInit: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).optional(),
|
|
1055
|
+
reconnectionOptions: zodOpenapi.z.custom().optional(),
|
|
1056
|
+
sessionId: zodOpenapi.z.string().optional()
|
|
1057
|
+
}).optional(),
|
|
1058
|
+
activeTools: zodOpenapi.z.array(zodOpenapi.z.string()).optional()
|
|
1059
|
+
})
|
|
1060
|
+
}),
|
|
1061
|
+
// Function tools (reference-only, no inline duplication)
|
|
1062
|
+
zodOpenapi.z.object({
|
|
1063
|
+
type: zodOpenapi.z.literal("function")
|
|
1064
|
+
// No inline function details - they're in the functions table via functionId
|
|
1065
|
+
})
|
|
1066
|
+
])
|
|
989
1067
|
});
|
|
990
1068
|
var ConversationSelectSchema = drizzleZod.createSelectSchema(conversations);
|
|
991
1069
|
var ConversationInsertSchema = drizzleZod.createInsertSchema(conversations).extend({
|
|
@@ -1194,6 +1272,14 @@ var ToolUpdateSchema = ToolInsertSchema.partial();
|
|
|
1194
1272
|
createApiSchema(ToolSelectSchema);
|
|
1195
1273
|
var ToolApiInsertSchema = createApiInsertSchema(ToolInsertSchema);
|
|
1196
1274
|
createApiUpdateSchema(ToolUpdateSchema);
|
|
1275
|
+
var FunctionSelectSchema = drizzleZod.createSelectSchema(functions);
|
|
1276
|
+
var FunctionInsertSchema = drizzleZod.createInsertSchema(functions).extend({
|
|
1277
|
+
id: resourceIdSchema
|
|
1278
|
+
});
|
|
1279
|
+
var FunctionUpdateSchema = FunctionInsertSchema.partial();
|
|
1280
|
+
var FunctionApiSelectSchema = createApiSchema(FunctionSelectSchema);
|
|
1281
|
+
var FunctionApiInsertSchema = createApiInsertSchema(FunctionInsertSchema);
|
|
1282
|
+
var FunctionApiUpdateSchema = createApiUpdateSchema(FunctionUpdateSchema);
|
|
1197
1283
|
var FetchConfigSchema = zodOpenapi.z.object({
|
|
1198
1284
|
url: zodOpenapi.z.string().min(1, "URL is required"),
|
|
1199
1285
|
method: zodOpenapi.z.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).optional().default("GET"),
|
|
@@ -1214,11 +1300,11 @@ zodOpenapi.z.object({
|
|
|
1214
1300
|
credential: CredentialReferenceApiInsertSchema.optional()
|
|
1215
1301
|
});
|
|
1216
1302
|
var ContextConfigSelectSchema = drizzleZod.createSelectSchema(contextConfigs).extend({
|
|
1217
|
-
|
|
1303
|
+
headersSchema: zodOpenapi.z.unknown().optional()
|
|
1218
1304
|
});
|
|
1219
1305
|
var ContextConfigInsertSchema = drizzleZod.createInsertSchema(contextConfigs).extend({
|
|
1220
|
-
id: resourceIdSchema,
|
|
1221
|
-
|
|
1306
|
+
id: resourceIdSchema.optional(),
|
|
1307
|
+
headersSchema: zodOpenapi.z.unknown().optional()
|
|
1222
1308
|
}).omit({
|
|
1223
1309
|
createdAt: true,
|
|
1224
1310
|
updatedAt: true
|
|
@@ -1282,6 +1368,7 @@ var CanUseItemSchema = zodOpenapi.z.object({
|
|
|
1282
1368
|
var FullGraphAgentInsertSchema = AgentApiInsertSchema.extend({
|
|
1283
1369
|
type: zodOpenapi.z.literal("internal"),
|
|
1284
1370
|
canUse: zodOpenapi.z.array(CanUseItemSchema),
|
|
1371
|
+
// All tools (both MCP and function tools)
|
|
1285
1372
|
dataComponents: zodOpenapi.z.array(zodOpenapi.z.string()).optional(),
|
|
1286
1373
|
artifactComponents: zodOpenapi.z.array(zodOpenapi.z.string()).optional(),
|
|
1287
1374
|
canTransferTo: zodOpenapi.z.array(zodOpenapi.z.string()).optional(),
|
|
@@ -1289,9 +1376,11 @@ var FullGraphAgentInsertSchema = AgentApiInsertSchema.extend({
|
|
|
1289
1376
|
});
|
|
1290
1377
|
AgentGraphApiInsertSchema.extend({
|
|
1291
1378
|
agents: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.union([FullGraphAgentInsertSchema, ExternalAgentApiInsertSchema])),
|
|
1292
|
-
//
|
|
1293
|
-
|
|
1294
|
-
//
|
|
1379
|
+
// Lookup maps for UI to resolve canUse items
|
|
1380
|
+
tools: zodOpenapi.z.record(zodOpenapi.z.string(), ToolApiInsertSchema).optional(),
|
|
1381
|
+
// Get tool name/description from toolId
|
|
1382
|
+
functions: zodOpenapi.z.record(zodOpenapi.z.string(), FunctionApiInsertSchema).optional(),
|
|
1383
|
+
// Get function code for function tools
|
|
1295
1384
|
contextConfig: zodOpenapi.z.optional(ContextConfigApiInsertSchema),
|
|
1296
1385
|
statusUpdates: zodOpenapi.z.optional(StatusUpdateSchema),
|
|
1297
1386
|
models: ModelSchema.optional(),
|
|
@@ -1333,7 +1422,8 @@ zodOpenapi.z.object({
|
|
|
1333
1422
|
var ProjectSelectSchema = drizzleZod.createSelectSchema(projects);
|
|
1334
1423
|
var ProjectInsertSchema = drizzleZod.createInsertSchema(projects).extend({
|
|
1335
1424
|
models: ProjectModelSchema,
|
|
1336
|
-
stopWhen: StopWhenSchema.optional()
|
|
1425
|
+
stopWhen: StopWhenSchema.optional(),
|
|
1426
|
+
sandboxConfig: SandboxConfigSchema.optional()
|
|
1337
1427
|
}).omit({
|
|
1338
1428
|
createdAt: true,
|
|
1339
1429
|
updatedAt: true
|
|
@@ -1345,6 +1435,9 @@ ProjectUpdateSchema.omit({ tenantId: true });
|
|
|
1345
1435
|
ProjectApiInsertSchema.extend({
|
|
1346
1436
|
graphs: zodOpenapi.z.record(zodOpenapi.z.string(), GraphWithinContextOfProjectSchema),
|
|
1347
1437
|
tools: zodOpenapi.z.record(zodOpenapi.z.string(), ToolApiInsertSchema),
|
|
1438
|
+
// Now includes both MCP and function tools
|
|
1439
|
+
functions: zodOpenapi.z.record(zodOpenapi.z.string(), FunctionApiInsertSchema).optional(),
|
|
1440
|
+
// Global functions
|
|
1348
1441
|
dataComponents: zodOpenapi.z.record(zodOpenapi.z.string(), DataComponentApiInsertSchema).optional(),
|
|
1349
1442
|
artifactComponents: zodOpenapi.z.record(zodOpenapi.z.string(), ArtifactComponentApiInsertSchema).optional(),
|
|
1350
1443
|
statusUpdates: zodOpenapi.z.optional(StatusUpdateSchema),
|
|
@@ -1436,6 +1529,108 @@ zodOpenapi.z.object({
|
|
|
1436
1529
|
page: zodOpenapi.z.coerce.number().min(1).default(1),
|
|
1437
1530
|
limit: zodOpenapi.z.coerce.number().min(1).max(100).default(10)
|
|
1438
1531
|
});
|
|
1532
|
+
function validatePropsAsJsonSchema(props) {
|
|
1533
|
+
if (!props || typeof props === "object" && Object.keys(props).length === 0) {
|
|
1534
|
+
return {
|
|
1535
|
+
isValid: true,
|
|
1536
|
+
errors: []
|
|
1537
|
+
};
|
|
1538
|
+
}
|
|
1539
|
+
if (typeof props !== "object" || Array.isArray(props)) {
|
|
1540
|
+
return {
|
|
1541
|
+
isValid: false,
|
|
1542
|
+
errors: [
|
|
1543
|
+
{
|
|
1544
|
+
field: "props",
|
|
1545
|
+
message: "Props must be a valid JSON Schema object",
|
|
1546
|
+
value: props
|
|
1547
|
+
}
|
|
1548
|
+
]
|
|
1549
|
+
};
|
|
1550
|
+
}
|
|
1551
|
+
if (!props.type) {
|
|
1552
|
+
return {
|
|
1553
|
+
isValid: false,
|
|
1554
|
+
errors: [
|
|
1555
|
+
{
|
|
1556
|
+
field: "props.type",
|
|
1557
|
+
message: 'JSON Schema must have a "type" field'
|
|
1558
|
+
}
|
|
1559
|
+
]
|
|
1560
|
+
};
|
|
1561
|
+
}
|
|
1562
|
+
if (props.type !== "object") {
|
|
1563
|
+
return {
|
|
1564
|
+
isValid: false,
|
|
1565
|
+
errors: [
|
|
1566
|
+
{
|
|
1567
|
+
field: "props.type",
|
|
1568
|
+
message: 'JSON Schema type must be "object" for component props',
|
|
1569
|
+
value: props.type
|
|
1570
|
+
}
|
|
1571
|
+
]
|
|
1572
|
+
};
|
|
1573
|
+
}
|
|
1574
|
+
if (!props.properties || typeof props.properties !== "object") {
|
|
1575
|
+
return {
|
|
1576
|
+
isValid: false,
|
|
1577
|
+
errors: [
|
|
1578
|
+
{
|
|
1579
|
+
field: "props.properties",
|
|
1580
|
+
message: 'JSON Schema must have a "properties" object'
|
|
1581
|
+
}
|
|
1582
|
+
]
|
|
1583
|
+
};
|
|
1584
|
+
}
|
|
1585
|
+
if (props.required !== void 0 && !Array.isArray(props.required)) {
|
|
1586
|
+
return {
|
|
1587
|
+
isValid: false,
|
|
1588
|
+
errors: [
|
|
1589
|
+
{
|
|
1590
|
+
field: "props.required",
|
|
1591
|
+
message: 'If present, "required" must be an array'
|
|
1592
|
+
}
|
|
1593
|
+
]
|
|
1594
|
+
};
|
|
1595
|
+
}
|
|
1596
|
+
try {
|
|
1597
|
+
const schemaToValidate = { ...props };
|
|
1598
|
+
delete schemaToValidate.$schema;
|
|
1599
|
+
const schemaValidator = new Ajv__default.default({
|
|
1600
|
+
strict: false,
|
|
1601
|
+
// Allow unknown keywords like inPreview
|
|
1602
|
+
validateSchema: true,
|
|
1603
|
+
// Validate the schema itself
|
|
1604
|
+
addUsedSchema: false
|
|
1605
|
+
// Don't add schemas to the instance
|
|
1606
|
+
});
|
|
1607
|
+
const isValid = schemaValidator.validateSchema(schemaToValidate);
|
|
1608
|
+
if (!isValid) {
|
|
1609
|
+
const errors = schemaValidator.errors || [];
|
|
1610
|
+
return {
|
|
1611
|
+
isValid: false,
|
|
1612
|
+
errors: errors.map((error) => ({
|
|
1613
|
+
field: `props${error.instancePath || ""}`,
|
|
1614
|
+
message: error.message || "Invalid schema"
|
|
1615
|
+
}))
|
|
1616
|
+
};
|
|
1617
|
+
}
|
|
1618
|
+
return {
|
|
1619
|
+
isValid: true,
|
|
1620
|
+
errors: []
|
|
1621
|
+
};
|
|
1622
|
+
} catch (error) {
|
|
1623
|
+
return {
|
|
1624
|
+
isValid: false,
|
|
1625
|
+
errors: [
|
|
1626
|
+
{
|
|
1627
|
+
field: "props",
|
|
1628
|
+
message: `Schema validation failed: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
1629
|
+
}
|
|
1630
|
+
]
|
|
1631
|
+
};
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1439
1634
|
|
|
1440
1635
|
// src/client-exports.ts
|
|
1441
1636
|
var TenantParamsSchema2 = zod.z.object({
|
|
@@ -1523,13 +1718,7 @@ var DataComponentApiInsertSchema2 = zod.z.object({
|
|
|
1523
1718
|
description: zod.z.string().optional(),
|
|
1524
1719
|
props: zod.z.record(zod.z.string(), zod.z.unknown())
|
|
1525
1720
|
});
|
|
1526
|
-
var ArtifactComponentApiInsertSchema2 =
|
|
1527
|
-
id: zod.z.string(),
|
|
1528
|
-
name: zod.z.string(),
|
|
1529
|
-
description: zod.z.string().optional(),
|
|
1530
|
-
summaryProps: zod.z.record(zod.z.string(), zod.z.unknown()),
|
|
1531
|
-
fullProps: zod.z.record(zod.z.string(), zod.z.unknown())
|
|
1532
|
-
});
|
|
1721
|
+
var ArtifactComponentApiInsertSchema2 = ArtifactComponentApiInsertSchema;
|
|
1533
1722
|
var ContextConfigApiInsertSchema2 = zod.z.object({
|
|
1534
1723
|
id: zod.z.string().optional(),
|
|
1535
1724
|
name: zod.z.string().optional(),
|
|
@@ -1625,6 +1814,9 @@ exports.DataComponentApiInsertSchema = DataComponentApiInsertSchema2;
|
|
|
1625
1814
|
exports.ErrorResponseSchema = ErrorResponseSchema2;
|
|
1626
1815
|
exports.ExternalAgentApiInsertSchema = ExternalAgentApiInsertSchema2;
|
|
1627
1816
|
exports.FullGraphDefinitionSchema = FullGraphDefinitionSchema2;
|
|
1817
|
+
exports.FunctionApiInsertSchema = FunctionApiInsertSchema;
|
|
1818
|
+
exports.FunctionApiSelectSchema = FunctionApiSelectSchema;
|
|
1819
|
+
exports.FunctionApiUpdateSchema = FunctionApiUpdateSchema;
|
|
1628
1820
|
exports.GraphStopWhenSchema = GraphStopWhenSchema;
|
|
1629
1821
|
exports.IdParamsSchema = IdParamsSchema2;
|
|
1630
1822
|
exports.ListResponseSchema = ListResponseSchema;
|
|
@@ -1633,6 +1825,7 @@ exports.MCPTransportType = MCPTransportType;
|
|
|
1633
1825
|
exports.MIN_ID_LENGTH = MIN_ID_LENGTH2;
|
|
1634
1826
|
exports.ModelSettingsSchema = ModelSettingsSchema;
|
|
1635
1827
|
exports.PaginationSchema = PaginationSchema2;
|
|
1828
|
+
exports.SandboxConfigSchema = SandboxConfigSchema;
|
|
1636
1829
|
exports.SingleResponseSchema = SingleResponseSchema;
|
|
1637
1830
|
exports.StopWhenSchema = StopWhenSchema;
|
|
1638
1831
|
exports.TenantParamsSchema = TenantParamsSchema2;
|
|
@@ -1642,3 +1835,4 @@ exports.ToolApiInsertSchema = ToolApiInsertSchema2;
|
|
|
1642
1835
|
exports.URL_SAFE_ID_PATTERN = URL_SAFE_ID_PATTERN2;
|
|
1643
1836
|
exports.generateIdFromName = generateIdFromName;
|
|
1644
1837
|
exports.resourceIdSchema = resourceIdSchema2;
|
|
1838
|
+
exports.validatePropsAsJsonSchema = validatePropsAsJsonSchema;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { C as ConversationHistoryConfig, A as ApiKeyApiUpdateSchema,
|
|
3
|
-
export {
|
|
2
|
+
import { C as ConversationHistoryConfig, F as FunctionApiInsertSchema, A as ApiKeyApiUpdateSchema, a as FullGraphAgentInsertSchema } from './utility-BaVsvScm.cjs';
|
|
3
|
+
export { e as AgentStopWhen, b as AgentStopWhenSchema, g as CredentialStoreType, i as FunctionApiSelectSchema, j as FunctionApiUpdateSchema, d as GraphStopWhen, G as GraphStopWhenSchema, h as MCPTransportType, f as ModelSettings, M as ModelSettingsSchema, k as SandboxConfigSchema, c as StopWhen, S as StopWhenSchema } from './utility-BaVsvScm.cjs';
|
|
4
|
+
export { v as validatePropsAsJsonSchema } from './props-validation-BMR1qNiy.cjs';
|
|
4
5
|
import 'drizzle-zod';
|
|
5
6
|
import 'drizzle-orm/sqlite-core';
|
|
6
7
|
import '@hono/zod-openapi';
|
|
@@ -127,12 +128,14 @@ declare const DataComponentApiInsertSchema: z.ZodObject<{
|
|
|
127
128
|
props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
128
129
|
}, z.core.$strip>;
|
|
129
130
|
declare const ArtifactComponentApiInsertSchema: z.ZodObject<{
|
|
130
|
-
id: z.ZodString;
|
|
131
131
|
name: z.ZodString;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
},
|
|
132
|
+
id: z.ZodString;
|
|
133
|
+
description: z.ZodString;
|
|
134
|
+
props: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
|
|
135
|
+
}, {
|
|
136
|
+
out: {};
|
|
137
|
+
in: {};
|
|
138
|
+
}>;
|
|
136
139
|
declare const ContextConfigApiInsertSchema: z.ZodObject<{
|
|
137
140
|
id: z.ZodOptional<z.ZodString>;
|
|
138
141
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -161,13 +164,11 @@ declare const FullGraphDefinitionSchema: z.ZodObject<{
|
|
|
161
164
|
description: z.ZodOptional<z.ZodString>;
|
|
162
165
|
defaultAgentId: z.ZodOptional<z.ZodString>;
|
|
163
166
|
agents: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
164
|
-
id: z.ZodString;
|
|
165
167
|
name: z.ZodString;
|
|
166
|
-
|
|
167
|
-
prompt: z.ZodString;
|
|
168
|
+
id: z.ZodString;
|
|
168
169
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
169
170
|
updatedAt: z.ZodOptional<z.ZodString>;
|
|
170
|
-
|
|
171
|
+
description: z.ZodString;
|
|
171
172
|
models: z.ZodOptional<z.ZodObject<{
|
|
172
173
|
base: z.ZodOptional<z.ZodObject<{
|
|
173
174
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -191,6 +192,8 @@ declare const FullGraphDefinitionSchema: z.ZodObject<{
|
|
|
191
192
|
}, {
|
|
192
193
|
stepCountIs?: number | undefined;
|
|
193
194
|
}>>>>;
|
|
195
|
+
prompt: z.ZodString;
|
|
196
|
+
conversationHistoryConfig: z.ZodOptional<z.ZodNullable<z.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>>;
|
|
194
197
|
type: z.ZodLiteral<"internal">;
|
|
195
198
|
canUse: z.ZodArray<z.ZodObject<{
|
|
196
199
|
agentToolRelationId: z.ZodOptional<z.ZodString>;
|
|
@@ -254,6 +257,7 @@ declare const FullGraphDefinitionSchema: z.ZodObject<{
|
|
|
254
257
|
}, z.core.$strip>;
|
|
255
258
|
type AgentApiInsert = z.infer<typeof AgentApiInsertSchema>;
|
|
256
259
|
type ToolApiInsert = z.infer<typeof ToolApiInsertSchema>;
|
|
260
|
+
type FunctionApiInsert = z.infer<typeof FunctionApiInsertSchema>;
|
|
257
261
|
type ApiKeyApiSelect = z.infer<typeof ApiKeyApiSelectSchema>;
|
|
258
262
|
type ApiKeyApiCreationResponse = z.infer<typeof ApiKeyApiCreationResponseSchema>;
|
|
259
263
|
type ApiKeyApiUpdateResponse = z.infer<typeof ApiKeyApiUpdateSchema>;
|
|
@@ -276,4 +280,4 @@ declare function generateIdFromName(name: string): string;
|
|
|
276
280
|
type ToolInsert = ToolApiInsert;
|
|
277
281
|
type AgentGraphInsert = AgentGraphApiInsert;
|
|
278
282
|
|
|
279
|
-
export { type AgentApiInsert, AgentApiInsertSchema, type AgentGraphApiInsert, AgentGraphApiInsertSchema, type AgentGraphInsert, type ApiKeyApiCreationResponse, ApiKeyApiCreationResponseSchema, type ApiKeyApiSelect, ApiKeyApiSelectSchema, type ApiKeyApiUpdateResponse, type ArtifactComponentApiInsert, ArtifactComponentApiInsertSchema, type ContextConfigApiInsert, ContextConfigApiInsertSchema, type CredentialReferenceApiInsert, CredentialReferenceApiInsertSchema, type DataComponentApiInsert, DataComponentApiInsertSchema, type ErrorResponse, ErrorResponseSchema, type ExternalAgentApiInsert, ExternalAgentApiInsertSchema, type ExternalAgentDefinition, type FullGraphDefinition, FullGraphDefinitionSchema, IdParamsSchema, type InternalAgentDefinition, ListResponseSchema, MAX_ID_LENGTH, MIN_ID_LENGTH, PaginationSchema, SingleResponseSchema, type TenantParams, TenantParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, type ToolApiInsert, ToolApiInsertSchema, type ToolInsert, URL_SAFE_ID_PATTERN, generateIdFromName, resourceIdSchema };
|
|
283
|
+
export { type AgentApiInsert, AgentApiInsertSchema, type AgentGraphApiInsert, AgentGraphApiInsertSchema, type AgentGraphInsert, type ApiKeyApiCreationResponse, ApiKeyApiCreationResponseSchema, type ApiKeyApiSelect, ApiKeyApiSelectSchema, type ApiKeyApiUpdateResponse, type ArtifactComponentApiInsert, ArtifactComponentApiInsertSchema, type ContextConfigApiInsert, ContextConfigApiInsertSchema, type CredentialReferenceApiInsert, CredentialReferenceApiInsertSchema, type DataComponentApiInsert, DataComponentApiInsertSchema, type ErrorResponse, ErrorResponseSchema, type ExternalAgentApiInsert, ExternalAgentApiInsertSchema, type ExternalAgentDefinition, type FullGraphDefinition, FullGraphDefinitionSchema, type FunctionApiInsert, FunctionApiInsertSchema, IdParamsSchema, type InternalAgentDefinition, ListResponseSchema, MAX_ID_LENGTH, MIN_ID_LENGTH, PaginationSchema, SingleResponseSchema, type TenantParams, TenantParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, type ToolApiInsert, ToolApiInsertSchema, type ToolInsert, URL_SAFE_ID_PATTERN, generateIdFromName, resourceIdSchema };
|
package/dist/client-exports.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { C as ConversationHistoryConfig, A as ApiKeyApiUpdateSchema,
|
|
3
|
-
export {
|
|
2
|
+
import { C as ConversationHistoryConfig, F as FunctionApiInsertSchema, A as ApiKeyApiUpdateSchema, a as FullGraphAgentInsertSchema } from './utility-BaVsvScm.js';
|
|
3
|
+
export { e as AgentStopWhen, b as AgentStopWhenSchema, g as CredentialStoreType, i as FunctionApiSelectSchema, j as FunctionApiUpdateSchema, d as GraphStopWhen, G as GraphStopWhenSchema, h as MCPTransportType, f as ModelSettings, M as ModelSettingsSchema, k as SandboxConfigSchema, c as StopWhen, S as StopWhenSchema } from './utility-BaVsvScm.js';
|
|
4
|
+
export { v as validatePropsAsJsonSchema } from './props-validation-BMR1qNiy.js';
|
|
4
5
|
import 'drizzle-zod';
|
|
5
6
|
import 'drizzle-orm/sqlite-core';
|
|
6
7
|
import '@hono/zod-openapi';
|
|
@@ -127,12 +128,14 @@ declare const DataComponentApiInsertSchema: z.ZodObject<{
|
|
|
127
128
|
props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
128
129
|
}, z.core.$strip>;
|
|
129
130
|
declare const ArtifactComponentApiInsertSchema: z.ZodObject<{
|
|
130
|
-
id: z.ZodString;
|
|
131
131
|
name: z.ZodString;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
},
|
|
132
|
+
id: z.ZodString;
|
|
133
|
+
description: z.ZodString;
|
|
134
|
+
props: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
|
|
135
|
+
}, {
|
|
136
|
+
out: {};
|
|
137
|
+
in: {};
|
|
138
|
+
}>;
|
|
136
139
|
declare const ContextConfigApiInsertSchema: z.ZodObject<{
|
|
137
140
|
id: z.ZodOptional<z.ZodString>;
|
|
138
141
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -161,13 +164,11 @@ declare const FullGraphDefinitionSchema: z.ZodObject<{
|
|
|
161
164
|
description: z.ZodOptional<z.ZodString>;
|
|
162
165
|
defaultAgentId: z.ZodOptional<z.ZodString>;
|
|
163
166
|
agents: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
164
|
-
id: z.ZodString;
|
|
165
167
|
name: z.ZodString;
|
|
166
|
-
|
|
167
|
-
prompt: z.ZodString;
|
|
168
|
+
id: z.ZodString;
|
|
168
169
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
169
170
|
updatedAt: z.ZodOptional<z.ZodString>;
|
|
170
|
-
|
|
171
|
+
description: z.ZodString;
|
|
171
172
|
models: z.ZodOptional<z.ZodObject<{
|
|
172
173
|
base: z.ZodOptional<z.ZodObject<{
|
|
173
174
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -191,6 +192,8 @@ declare const FullGraphDefinitionSchema: z.ZodObject<{
|
|
|
191
192
|
}, {
|
|
192
193
|
stepCountIs?: number | undefined;
|
|
193
194
|
}>>>>;
|
|
195
|
+
prompt: z.ZodString;
|
|
196
|
+
conversationHistoryConfig: z.ZodOptional<z.ZodNullable<z.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>>;
|
|
194
197
|
type: z.ZodLiteral<"internal">;
|
|
195
198
|
canUse: z.ZodArray<z.ZodObject<{
|
|
196
199
|
agentToolRelationId: z.ZodOptional<z.ZodString>;
|
|
@@ -254,6 +257,7 @@ declare const FullGraphDefinitionSchema: z.ZodObject<{
|
|
|
254
257
|
}, z.core.$strip>;
|
|
255
258
|
type AgentApiInsert = z.infer<typeof AgentApiInsertSchema>;
|
|
256
259
|
type ToolApiInsert = z.infer<typeof ToolApiInsertSchema>;
|
|
260
|
+
type FunctionApiInsert = z.infer<typeof FunctionApiInsertSchema>;
|
|
257
261
|
type ApiKeyApiSelect = z.infer<typeof ApiKeyApiSelectSchema>;
|
|
258
262
|
type ApiKeyApiCreationResponse = z.infer<typeof ApiKeyApiCreationResponseSchema>;
|
|
259
263
|
type ApiKeyApiUpdateResponse = z.infer<typeof ApiKeyApiUpdateSchema>;
|
|
@@ -276,4 +280,4 @@ declare function generateIdFromName(name: string): string;
|
|
|
276
280
|
type ToolInsert = ToolApiInsert;
|
|
277
281
|
type AgentGraphInsert = AgentGraphApiInsert;
|
|
278
282
|
|
|
279
|
-
export { type AgentApiInsert, AgentApiInsertSchema, type AgentGraphApiInsert, AgentGraphApiInsertSchema, type AgentGraphInsert, type ApiKeyApiCreationResponse, ApiKeyApiCreationResponseSchema, type ApiKeyApiSelect, ApiKeyApiSelectSchema, type ApiKeyApiUpdateResponse, type ArtifactComponentApiInsert, ArtifactComponentApiInsertSchema, type ContextConfigApiInsert, ContextConfigApiInsertSchema, type CredentialReferenceApiInsert, CredentialReferenceApiInsertSchema, type DataComponentApiInsert, DataComponentApiInsertSchema, type ErrorResponse, ErrorResponseSchema, type ExternalAgentApiInsert, ExternalAgentApiInsertSchema, type ExternalAgentDefinition, type FullGraphDefinition, FullGraphDefinitionSchema, IdParamsSchema, type InternalAgentDefinition, ListResponseSchema, MAX_ID_LENGTH, MIN_ID_LENGTH, PaginationSchema, SingleResponseSchema, type TenantParams, TenantParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, type ToolApiInsert, ToolApiInsertSchema, type ToolInsert, URL_SAFE_ID_PATTERN, generateIdFromName, resourceIdSchema };
|
|
283
|
+
export { type AgentApiInsert, AgentApiInsertSchema, type AgentGraphApiInsert, AgentGraphApiInsertSchema, type AgentGraphInsert, type ApiKeyApiCreationResponse, ApiKeyApiCreationResponseSchema, type ApiKeyApiSelect, ApiKeyApiSelectSchema, type ApiKeyApiUpdateResponse, type ArtifactComponentApiInsert, ArtifactComponentApiInsertSchema, type ContextConfigApiInsert, ContextConfigApiInsertSchema, type CredentialReferenceApiInsert, CredentialReferenceApiInsertSchema, type DataComponentApiInsert, DataComponentApiInsertSchema, type ErrorResponse, ErrorResponseSchema, type ExternalAgentApiInsert, ExternalAgentApiInsertSchema, type ExternalAgentDefinition, type FullGraphDefinition, FullGraphDefinitionSchema, type FunctionApiInsert, FunctionApiInsertSchema, IdParamsSchema, type InternalAgentDefinition, ListResponseSchema, MAX_ID_LENGTH, MIN_ID_LENGTH, PaginationSchema, SingleResponseSchema, type TenantParams, TenantParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, type ToolApiInsert, ToolApiInsertSchema, type ToolInsert, URL_SAFE_ID_PATTERN, generateIdFromName, resourceIdSchema };
|
package/dist/client-exports.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ModelSettingsSchema, FullGraphAgentInsertSchema } from './chunk-
|
|
2
|
-
export { AgentStopWhenSchema, GraphStopWhenSchema, ModelSettingsSchema, StopWhenSchema } from './chunk-
|
|
1
|
+
import { ModelSettingsSchema, FullGraphAgentInsertSchema, ArtifactComponentApiInsertSchema } from './chunk-TO2HNKGP.js';
|
|
2
|
+
export { AgentStopWhenSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, GraphStopWhenSchema, ModelSettingsSchema, SandboxConfigSchema, StopWhenSchema, validatePropsAsJsonSchema } from './chunk-TO2HNKGP.js';
|
|
3
3
|
import { CredentialStoreType } from './chunk-YFHT5M2R.js';
|
|
4
4
|
export { CredentialStoreType, MCPTransportType } from './chunk-YFHT5M2R.js';
|
|
5
5
|
import { z } from 'zod';
|
|
@@ -89,13 +89,7 @@ var DataComponentApiInsertSchema = z.object({
|
|
|
89
89
|
description: z.string().optional(),
|
|
90
90
|
props: z.record(z.string(), z.unknown())
|
|
91
91
|
});
|
|
92
|
-
var
|
|
93
|
-
id: z.string(),
|
|
94
|
-
name: z.string(),
|
|
95
|
-
description: z.string().optional(),
|
|
96
|
-
summaryProps: z.record(z.string(), z.unknown()),
|
|
97
|
-
fullProps: z.record(z.string(), z.unknown())
|
|
98
|
-
});
|
|
92
|
+
var ArtifactComponentApiInsertSchema2 = ArtifactComponentApiInsertSchema;
|
|
99
93
|
var ContextConfigApiInsertSchema = z.object({
|
|
100
94
|
id: z.string().optional(),
|
|
101
95
|
name: z.string().optional(),
|
|
@@ -178,4 +172,4 @@ function generateIdFromName(name) {
|
|
|
178
172
|
return name.toLowerCase().replace(/[^a-zA-Z0-9]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "").slice(0, MAX_ID_LENGTH);
|
|
179
173
|
}
|
|
180
174
|
|
|
181
|
-
export { AgentApiInsertSchema, AgentGraphApiInsertSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiSelectSchema, ArtifactComponentApiInsertSchema, ContextConfigApiInsertSchema, CredentialReferenceApiInsertSchema, DataComponentApiInsertSchema, ErrorResponseSchema, ExternalAgentApiInsertSchema, FullGraphDefinitionSchema, IdParamsSchema, ListResponseSchema, MAX_ID_LENGTH, MIN_ID_LENGTH, PaginationSchema, SingleResponseSchema, TenantParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, URL_SAFE_ID_PATTERN, generateIdFromName, resourceIdSchema };
|
|
175
|
+
export { AgentApiInsertSchema, AgentGraphApiInsertSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiSelectSchema, ArtifactComponentApiInsertSchema2 as ArtifactComponentApiInsertSchema, ContextConfigApiInsertSchema, CredentialReferenceApiInsertSchema, DataComponentApiInsertSchema, ErrorResponseSchema, ExternalAgentApiInsertSchema, FullGraphDefinitionSchema, IdParamsSchema, ListResponseSchema, MAX_ID_LENGTH, MIN_ID_LENGTH, PaginationSchema, SingleResponseSchema, TenantParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, URL_SAFE_ID_PATTERN, generateIdFromName, resourceIdSchema };
|
package/dist/db/schema.cjs
CHANGED
|
@@ -37,6 +37,8 @@ var projects = sqliteCore.sqliteTable(
|
|
|
37
37
|
models: sqliteCore.text("models", { mode: "json" }).$type(),
|
|
38
38
|
// Project-level stopWhen configuration that can be inherited by graphs and agents
|
|
39
39
|
stopWhen: sqliteCore.text("stop_when", { mode: "json" }).$type(),
|
|
40
|
+
// Project-level sandbox configuration for function execution
|
|
41
|
+
sandboxConfig: sqliteCore.text("sandbox_config", { mode: "json" }).$type(),
|
|
40
42
|
...timestamps
|
|
41
43
|
},
|
|
42
44
|
(table) => [sqliteCore.primaryKey({ columns: [table.tenantId, table.id] })]
|
|
@@ -74,9 +76,8 @@ var contextConfigs = sqliteCore.sqliteTable(
|
|
|
74
76
|
"context_configs",
|
|
75
77
|
{
|
|
76
78
|
...graphScoped,
|
|
77
|
-
...uiProperties,
|
|
78
79
|
// Developer-defined Zod schema for validating incoming request context
|
|
79
|
-
|
|
80
|
+
headersSchema: sqliteCore.blob("headers_schema", { mode: "json" }).$type(),
|
|
80
81
|
// Stores serialized Zod schema
|
|
81
82
|
// Object mapping template keys to fetch definitions that use request context data
|
|
82
83
|
contextVariables: sqliteCore.blob("context_variables", { mode: "json" }).$type(),
|
|
@@ -283,8 +284,7 @@ var artifactComponents = sqliteCore.sqliteTable(
|
|
|
283
284
|
{
|
|
284
285
|
...projectScoped,
|
|
285
286
|
...uiProperties,
|
|
286
|
-
|
|
287
|
-
fullProps: sqliteCore.blob("full_props", { mode: "json" }).$type(),
|
|
287
|
+
props: sqliteCore.blob("props", { mode: "json" }).$type(),
|
|
288
288
|
...timestamps
|
|
289
289
|
},
|
|
290
290
|
(table) => [
|
|
@@ -330,13 +330,16 @@ var tools = sqliteCore.sqliteTable(
|
|
|
330
330
|
{
|
|
331
331
|
...projectScoped,
|
|
332
332
|
name: sqliteCore.text("name").notNull(),
|
|
333
|
-
|
|
333
|
+
description: sqliteCore.text("description"),
|
|
334
|
+
// Tool configuration - supports both MCP and function tools
|
|
334
335
|
config: sqliteCore.blob("config", { mode: "json" }).$type().notNull(),
|
|
336
|
+
// For function tools, reference the global functions table
|
|
337
|
+
functionId: sqliteCore.text("function_id"),
|
|
335
338
|
credentialReferenceId: sqliteCore.text("credential_reference_id"),
|
|
336
339
|
headers: sqliteCore.blob("headers", { mode: "json" }).$type(),
|
|
337
340
|
// Image URL for custom tool icon (supports regular URLs and base64 encoded images)
|
|
338
341
|
imageUrl: sqliteCore.text("image_url"),
|
|
339
|
-
// Server capabilities and status
|
|
342
|
+
// Server capabilities and status (only for MCP tools)
|
|
340
343
|
capabilities: sqliteCore.blob("capabilities", { mode: "json" }).$type(),
|
|
341
344
|
lastError: sqliteCore.text("last_error"),
|
|
342
345
|
...timestamps
|
|
@@ -347,6 +350,30 @@ var tools = sqliteCore.sqliteTable(
|
|
|
347
350
|
columns: [table.tenantId, table.projectId],
|
|
348
351
|
foreignColumns: [projects.tenantId, projects.id],
|
|
349
352
|
name: "tools_project_fk"
|
|
353
|
+
}).onDelete("cascade"),
|
|
354
|
+
// Foreign key constraint to functions table (for function tools)
|
|
355
|
+
sqliteCore.foreignKey({
|
|
356
|
+
columns: [table.tenantId, table.projectId, table.functionId],
|
|
357
|
+
foreignColumns: [functions.tenantId, functions.projectId, functions.id],
|
|
358
|
+
name: "tools_function_fk"
|
|
359
|
+
}).onDelete("cascade")
|
|
360
|
+
]
|
|
361
|
+
);
|
|
362
|
+
var functions = sqliteCore.sqliteTable(
|
|
363
|
+
"functions",
|
|
364
|
+
{
|
|
365
|
+
...projectScoped,
|
|
366
|
+
inputSchema: sqliteCore.blob("input_schema", { mode: "json" }).$type(),
|
|
367
|
+
executeCode: sqliteCore.text("execute_code").notNull(),
|
|
368
|
+
dependencies: sqliteCore.blob("dependencies", { mode: "json" }).$type(),
|
|
369
|
+
...timestamps
|
|
370
|
+
},
|
|
371
|
+
(table) => [
|
|
372
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
373
|
+
sqliteCore.foreignKey({
|
|
374
|
+
columns: [table.tenantId, table.projectId],
|
|
375
|
+
foreignColumns: [projects.tenantId, projects.id],
|
|
376
|
+
name: "functions_project_fk"
|
|
350
377
|
}).onDelete("cascade")
|
|
351
378
|
]
|
|
352
379
|
);
|
|
@@ -681,6 +708,10 @@ var toolsRelations = drizzleOrm.relations(tools, ({ one, many }) => ({
|
|
|
681
708
|
credentialReference: one(credentialReferences, {
|
|
682
709
|
fields: [tools.credentialReferenceId],
|
|
683
710
|
references: [credentialReferences.id]
|
|
711
|
+
}),
|
|
712
|
+
function: one(functions, {
|
|
713
|
+
fields: [tools.functionId],
|
|
714
|
+
references: [functions.id]
|
|
684
715
|
})
|
|
685
716
|
}));
|
|
686
717
|
var conversationsRelations = drizzleOrm.relations(conversations, ({ one, many }) => ({
|
|
@@ -778,6 +809,9 @@ var ledgerArtifactsRelations = drizzleOrm.relations(ledgerArtifacts, ({ one }) =
|
|
|
778
809
|
references: [tasks.id]
|
|
779
810
|
})
|
|
780
811
|
}));
|
|
812
|
+
var functionsRelations = drizzleOrm.relations(functions, ({ many }) => ({
|
|
813
|
+
tools: many(tools)
|
|
814
|
+
}));
|
|
781
815
|
var agentRelationsRelations = drizzleOrm.relations(agentRelations, ({ one }) => ({
|
|
782
816
|
graph: one(agentGraph, {
|
|
783
817
|
fields: [agentRelations.graphId],
|
|
@@ -827,6 +861,8 @@ exports.dataComponents = dataComponents;
|
|
|
827
861
|
exports.dataComponentsRelations = dataComponentsRelations;
|
|
828
862
|
exports.externalAgents = externalAgents;
|
|
829
863
|
exports.externalAgentsRelations = externalAgentsRelations;
|
|
864
|
+
exports.functions = functions;
|
|
865
|
+
exports.functionsRelations = functionsRelations;
|
|
830
866
|
exports.ledgerArtifacts = ledgerArtifacts;
|
|
831
867
|
exports.ledgerArtifactsRelations = ledgerArtifactsRelations;
|
|
832
868
|
exports.messages = messages;
|