@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.
Files changed (33) hide show
  1. package/dist/auth/auth-schema.d.ts +82 -82
  2. package/dist/auth/auth.d.ts +57 -57
  3. package/dist/auth/permissions.d.ts +13 -13
  4. package/dist/client-exports.d.ts +3 -3
  5. package/dist/context/TemplateEngine.d.ts +0 -6
  6. package/dist/context/TemplateEngine.js +4 -18
  7. package/dist/data-access/manage/agents.d.ts +46 -46
  8. package/dist/data-access/manage/artifactComponents.d.ts +14 -14
  9. package/dist/data-access/manage/contextConfigs.d.ts +20 -20
  10. package/dist/data-access/manage/dataComponents.d.ts +6 -6
  11. package/dist/data-access/manage/functionTools.d.ts +18 -18
  12. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
  13. package/dist/data-access/manage/subAgentRelations.d.ts +34 -34
  14. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
  15. package/dist/data-access/manage/subAgents.d.ts +18 -18
  16. package/dist/data-access/manage/tools.d.ts +30 -30
  17. package/dist/data-access/runtime/apiKeys.d.ts +20 -20
  18. package/dist/data-access/runtime/conversations.d.ts +27 -27
  19. package/dist/data-access/runtime/messages.d.ts +15 -15
  20. package/dist/data-access/runtime/tasks.d.ts +6 -6
  21. package/dist/db/manage/manage-schema.d.ts +377 -377
  22. package/dist/db/runtime/runtime-schema.d.ts +181 -181
  23. package/dist/utils/JsonTransformer.d.ts +1 -3
  24. package/dist/utils/JsonTransformer.js +14 -23
  25. package/dist/utils/jmespath-utils.d.ts +152 -0
  26. package/dist/utils/jmespath-utils.js +213 -0
  27. package/dist/utils/signature-validation.d.ts +2 -39
  28. package/dist/utils/signature-validation.js +1 -69
  29. package/dist/utils/trigger-auth.js +3 -5
  30. package/dist/validation/dolt-schemas.d.ts +1 -1
  31. package/dist/validation/schemas.d.ts +1438 -1438
  32. package/dist/validation/schemas.js +32 -36
  33. 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: z.string().optional().describe("JMESPath expression for payload transformation"),
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) try {
353
- new RegExp(config.signature.regex);
354
- } catch (error) {
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: ${error instanceof Error ? error.message : String(error)}`,
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) try {
366
- jmespathExt.compile(config.signature.key);
367
- } catch (error) {
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: ${error instanceof Error ? error.message : String(error)}`,
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) try {
380
- new RegExp(component.regex);
381
- } catch (error) {
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: ${error instanceof Error ? error.message : String(error)}`,
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) try {
394
- jmespathExt.compile(component.key);
395
- } catch (error) {
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: ${error instanceof Error ? error.message : String(error)}`,
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") try {
408
- jmespathExt.compile(component.value);
409
- } catch (error) {
410
- if (component.value.includes(".") || component.value.includes("[")) ctx.addIssue({
411
- code: z.ZodIssueCode.custom,
412
- message: `Invalid JMESPath expression in signedComponents[${index}].value: ${error instanceof Error ? error.message : String(error)}`,
413
- path: [
414
- "signatureVerification",
415
- "signedComponents",
416
- index,
417
- "value"
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-20260125001234",
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",