@inkeep/agents-core 0.0.0-dev-20260125001234 → 0.0.0-dev-20260126174131
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/auth/auth-schema.d.ts +82 -82
- package/dist/auth/auth.d.ts +57 -57
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/client-exports.d.ts +3 -3
- package/dist/context/TemplateEngine.d.ts +0 -6
- package/dist/context/TemplateEngine.js +4 -18
- package/dist/data-access/manage/agents.d.ts +46 -46
- package/dist/data-access/manage/artifactComponents.d.ts +14 -14
- package/dist/data-access/manage/contextConfigs.d.ts +20 -20
- package/dist/data-access/manage/dataComponents.d.ts +6 -6
- package/dist/data-access/manage/functionTools.d.ts +18 -18
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgentRelations.d.ts +34 -34
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgents.d.ts +18 -18
- package/dist/data-access/manage/tools.d.ts +30 -30
- package/dist/data-access/runtime/apiKeys.d.ts +20 -20
- package/dist/data-access/runtime/conversations.d.ts +27 -27
- package/dist/data-access/runtime/messages.d.ts +15 -15
- package/dist/data-access/runtime/tasks.d.ts +6 -6
- package/dist/db/manage/manage-schema.d.ts +377 -377
- package/dist/db/runtime/runtime-schema.d.ts +181 -181
- package/dist/utils/JsonTransformer.d.ts +1 -3
- package/dist/utils/JsonTransformer.js +14 -23
- package/dist/utils/jmespath-utils.d.ts +152 -0
- package/dist/utils/jmespath-utils.js +213 -0
- package/dist/utils/signature-validation.d.ts +2 -39
- package/dist/utils/signature-validation.js +1 -69
- package/dist/utils/trigger-auth.js +3 -5
- package/dist/validation/dolt-schemas.d.ts +1 -1
- package/dist/validation/schemas.d.ts +1438 -1438
- package/dist/validation/schemas.js +32 -36
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { schemaValidationDefaults } from "../constants/schema-validation/defaults.js";
|
|
2
2
|
import { CredentialStoreType, MCPServerType, MCPTransportType, TOOL_STATUS_VALUES, VALID_RELATION_TYPES } from "../types/utility.js";
|
|
3
|
+
import { jmespathString, validateJMESPathSecure, validateRegex } from "../utils/jmespath-utils.js";
|
|
3
4
|
import { agents, artifactComponents, contextConfigs, credentialReferences, dataComponents, dataset, datasetItem, datasetRunConfig, datasetRunConfigAgentRelations, evaluationJobConfig, evaluationJobConfigEvaluatorRelations, evaluationRunConfig, evaluationRunConfigEvaluationSuiteConfigRelations, evaluationSuiteConfig, evaluationSuiteConfigEvaluatorRelations, evaluator, externalAgents, functionTools, functions, projects, subAgentArtifactComponents, subAgentDataComponents, subAgentExternalAgentRelations, subAgentFunctionToolRelations, subAgentRelations, subAgentTeamAgentRelations, subAgentToolRelations, subAgents, tools, triggers } from "../db/manage/manage-schema.js";
|
|
4
5
|
import { apiKeys, contextCache, conversations, datasetRun, datasetRunConversationRelations, evaluationResult, evaluationRun, ledgerArtifacts, messages, projectMetadata, taskRelations, tasks, triggerInvocations } from "../db/runtime/runtime-schema.js";
|
|
5
6
|
import { ResolvedRefSchema } from "./dolt-schemas.js";
|
|
6
7
|
import { MAX_ID_LENGTH, MIN_ID_LENGTH, URL_SAFE_ID_PATTERN, createInsertSchema, createResourceIdSchema, createSelectSchema, registerFieldSchemas, resourceIdSchema } from "./drizzle-schema-helpers.js";
|
|
7
8
|
import { z } from "@hono/zod-openapi";
|
|
8
|
-
import * as jmespath$1 from "jmespath";
|
|
9
9
|
|
|
10
10
|
//#region src/validation/schemas.ts
|
|
11
11
|
const { AGENT_EXECUTION_TRANSFER_COUNT_MAX, AGENT_EXECUTION_TRANSFER_COUNT_MIN, CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT, STATUS_UPDATE_MAX_INTERVAL_SECONDS, STATUS_UPDATE_MAX_NUM_EVENTS, SUB_AGENT_TURN_GENERATION_STEPS_MAX, SUB_AGENT_TURN_GENERATION_STEPS_MIN, VALIDATION_AGENT_PROMPT_MAX_CHARS, VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS } = schemaValidationDefaults;
|
|
@@ -163,7 +163,7 @@ const TriggerAuthHeaderStoredSchema = z.object({
|
|
|
163
163
|
const TriggerAuthenticationStoredSchema = z.object({ headers: z.array(TriggerAuthHeaderStoredSchema).optional().describe("Array of headers with hashed values") }).openapi("TriggerAuthenticationStored");
|
|
164
164
|
const TriggerAuthenticationSchema = TriggerAuthenticationInputSchema;
|
|
165
165
|
const TriggerOutputTransformSchema = z.object({
|
|
166
|
-
jmespath:
|
|
166
|
+
jmespath: jmespathString().optional(),
|
|
167
167
|
objectTransformation: z.record(z.string(), z.string()).optional().describe("Object transformation mapping")
|
|
168
168
|
}).openapi("TriggerOutputTransform");
|
|
169
169
|
/**
|
|
@@ -333,7 +333,6 @@ const TriggerSelectSchema = registerFieldSchemas(createSelectSchema(triggers).ex
|
|
|
333
333
|
signingSecretCredentialReferenceId: z.string().nullable().optional(),
|
|
334
334
|
signatureVerification: SignatureVerificationConfigSchema.nullable().optional()
|
|
335
335
|
}));
|
|
336
|
-
const jmespathExt = jmespath$1;
|
|
337
336
|
const TriggerInsertSchemaBase = createInsertSchema(triggers, {
|
|
338
337
|
id: () => resourceIdSchema,
|
|
339
338
|
name: () => z.string().trim().nonempty().describe("Trigger name"),
|
|
@@ -349,12 +348,11 @@ const TriggerInsertSchemaBase = createInsertSchema(triggers, {
|
|
|
349
348
|
const TriggerInsertSchema = TriggerInsertSchemaBase.superRefine((data, ctx) => {
|
|
350
349
|
const config = data.signatureVerification;
|
|
351
350
|
if (!config) return;
|
|
352
|
-
if (config.signature.regex)
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
ctx.addIssue({
|
|
351
|
+
if (config.signature.regex) {
|
|
352
|
+
const regexResult = validateRegex(config.signature.regex);
|
|
353
|
+
if (!regexResult.valid) ctx.addIssue({
|
|
356
354
|
code: z.ZodIssueCode.custom,
|
|
357
|
-
message: `Invalid regex pattern in signature.regex: ${
|
|
355
|
+
message: `Invalid regex pattern in signature.regex: ${regexResult.error}`,
|
|
358
356
|
path: [
|
|
359
357
|
"signatureVerification",
|
|
360
358
|
"signature",
|
|
@@ -362,12 +360,11 @@ const TriggerInsertSchema = TriggerInsertSchemaBase.superRefine((data, ctx) => {
|
|
|
362
360
|
]
|
|
363
361
|
});
|
|
364
362
|
}
|
|
365
|
-
if (config.signature.source === "body" && config.signature.key)
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
ctx.addIssue({
|
|
363
|
+
if (config.signature.source === "body" && config.signature.key) {
|
|
364
|
+
const jmespathResult = validateJMESPathSecure(config.signature.key);
|
|
365
|
+
if (!jmespathResult.valid) ctx.addIssue({
|
|
369
366
|
code: z.ZodIssueCode.custom,
|
|
370
|
-
message: `Invalid JMESPath expression in signature.key: ${
|
|
367
|
+
message: `Invalid JMESPath expression in signature.key: ${jmespathResult.error}`,
|
|
371
368
|
path: [
|
|
372
369
|
"signatureVerification",
|
|
373
370
|
"signature",
|
|
@@ -376,12 +373,11 @@ const TriggerInsertSchema = TriggerInsertSchemaBase.superRefine((data, ctx) => {
|
|
|
376
373
|
});
|
|
377
374
|
}
|
|
378
375
|
config.signedComponents.forEach((component, index) => {
|
|
379
|
-
if (component.regex)
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
ctx.addIssue({
|
|
376
|
+
if (component.regex) {
|
|
377
|
+
const regexResult = validateRegex(component.regex);
|
|
378
|
+
if (!regexResult.valid) ctx.addIssue({
|
|
383
379
|
code: z.ZodIssueCode.custom,
|
|
384
|
-
message: `Invalid regex pattern in signedComponents[${index}].regex: ${
|
|
380
|
+
message: `Invalid regex pattern in signedComponents[${index}].regex: ${regexResult.error}`,
|
|
385
381
|
path: [
|
|
386
382
|
"signatureVerification",
|
|
387
383
|
"signedComponents",
|
|
@@ -390,12 +386,11 @@ const TriggerInsertSchema = TriggerInsertSchemaBase.superRefine((data, ctx) => {
|
|
|
390
386
|
]
|
|
391
387
|
});
|
|
392
388
|
}
|
|
393
|
-
if (component.source === "body" && component.key)
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
ctx.addIssue({
|
|
389
|
+
if (component.source === "body" && component.key) {
|
|
390
|
+
const jmespathResult = validateJMESPathSecure(component.key);
|
|
391
|
+
if (!jmespathResult.valid) ctx.addIssue({
|
|
397
392
|
code: z.ZodIssueCode.custom,
|
|
398
|
-
message: `Invalid JMESPath expression in signedComponents[${index}].key: ${
|
|
393
|
+
message: `Invalid JMESPath expression in signedComponents[${index}].key: ${jmespathResult.error}`,
|
|
399
394
|
path: [
|
|
400
395
|
"signatureVerification",
|
|
401
396
|
"signedComponents",
|
|
@@ -404,19 +399,20 @@ const TriggerInsertSchema = TriggerInsertSchemaBase.superRefine((data, ctx) => {
|
|
|
404
399
|
]
|
|
405
400
|
});
|
|
406
401
|
}
|
|
407
|
-
if (component.value && component.source !== "literal")
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
402
|
+
if (component.value && component.source !== "literal") {
|
|
403
|
+
if (component.value.includes(".") || component.value.includes("[")) {
|
|
404
|
+
const jmespathResult = validateJMESPathSecure(component.value);
|
|
405
|
+
if (!jmespathResult.valid) ctx.addIssue({
|
|
406
|
+
code: z.ZodIssueCode.custom,
|
|
407
|
+
message: `Invalid JMESPath expression in signedComponents[${index}].value: ${jmespathResult.error}`,
|
|
408
|
+
path: [
|
|
409
|
+
"signatureVerification",
|
|
410
|
+
"signedComponents",
|
|
411
|
+
index,
|
|
412
|
+
"value"
|
|
413
|
+
]
|
|
414
|
+
});
|
|
415
|
+
}
|
|
420
416
|
}
|
|
421
417
|
});
|
|
422
418
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-core",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20260126174131",
|
|
4
4
|
"description": "Agents Core contains the database schema, types, and validation schemas for Inkeep Agent Framework, along with core components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|