@inkeep/agents-core 0.59.1 → 0.59.3

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 (35) hide show
  1. package/dist/auth/auth-schema.d.ts +108 -108
  2. package/dist/auth/permissions.d.ts +9 -9
  3. package/dist/client-exports.d.ts +2 -2
  4. package/dist/client-exports.js +2 -2
  5. package/dist/constants/signoz-queries.d.ts +30 -106
  6. package/dist/constants/signoz-queries.js +55 -108
  7. package/dist/data-access/manage/agents.d.ts +30 -30
  8. package/dist/data-access/manage/artifactComponents.d.ts +10 -10
  9. package/dist/data-access/manage/contextConfigs.d.ts +8 -8
  10. package/dist/data-access/manage/dataComponents.d.ts +2 -2
  11. package/dist/data-access/manage/functionTools.d.ts +14 -14
  12. package/dist/data-access/manage/skills.d.ts +19 -19
  13. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
  14. package/dist/data-access/manage/subAgentRelations.d.ts +22 -22
  15. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
  16. package/dist/data-access/manage/subAgents.d.ts +18 -18
  17. package/dist/data-access/manage/tools.d.ts +30 -30
  18. package/dist/data-access/manage/triggers.d.ts +1 -1
  19. package/dist/data-access/runtime/apiKeys.d.ts +20 -20
  20. package/dist/data-access/runtime/apps.d.ts +16 -16
  21. package/dist/data-access/runtime/conversations.d.ts +24 -24
  22. package/dist/data-access/runtime/messages.d.ts +21 -21
  23. package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +3 -3
  24. package/dist/data-access/runtime/tasks.d.ts +5 -5
  25. package/dist/db/manage/manage-schema.d.ts +451 -451
  26. package/dist/db/runtime/runtime-schema.d.ts +332 -332
  27. package/dist/index.d.ts +3 -3
  28. package/dist/index.js +3 -3
  29. package/dist/utils/index.d.ts +2 -2
  30. package/dist/utils/index.js +2 -2
  31. package/dist/utils/schema-conversion.d.ts +27 -1
  32. package/dist/utils/schema-conversion.js +68 -1
  33. package/dist/utils/work-app-mcp.js +4 -3
  34. package/dist/validation/schemas.d.ts +532 -532
  35. package/package.json +1 -1
@@ -20,9 +20,35 @@ declare function convertZodToJsonSchemaWithPreview(zodSchema: z.ZodTypeAny): Rec
20
20
  * Type guard to check if a value is a Zod schema
21
21
  */
22
22
  declare function isZodSchema(value: any): value is z.ZodObject<any>;
23
+ /**
24
+ * Strips JSON Schema numeric constraints that are not supported by all LLM providers.
25
+ *
26
+ * Anthropic structured output rejects `minimum`, `maximum`, `exclusiveMinimum`,
27
+ * `exclusiveMaximum`, and `multipleOf` on `number`/`integer` types.
28
+ * Applied recursively to handle nested objects and arrays.
29
+ */
30
+ declare function stripUnsupportedConstraints<T extends Record<string, unknown> | null | undefined>(schema: T): T;
31
+ /**
32
+ * Makes all properties required in an object schema, wrapping originally-optional
33
+ * fields as `{ anyOf: [<schema>, { type: 'null' }] }`.
34
+ *
35
+ * OpenAI strict-mode structured output requires every key in `properties` to also
36
+ * appear in `required`. Applied recursively to handle nested objects and arrays.
37
+ */
38
+ declare function makeAllPropertiesRequired<T extends Record<string, unknown> | null | undefined>(schema: T): T;
39
+ /**
40
+ * Normalizes a data component JSON Schema for cross-provider LLM compatibility.
41
+ *
42
+ * Applies two transformations in order:
43
+ * 1. `stripUnsupportedConstraints` — removes `minimum`/`maximum`/etc. from numbers
44
+ * (Anthropic structured output rejects these)
45
+ * 2. `makeAllPropertiesRequired` — ensures every property appears in `required`,
46
+ * wrapping optional fields as nullable (OpenAI strict-mode requires this)
47
+ */
48
+ declare function normalizeDataComponentSchema<T extends Record<string, unknown> | null | undefined>(schema: T): T;
23
49
  /**
24
50
  * Extract preview fields from either JSON Schema or Zod schema
25
51
  */
26
52
  declare function extractPreviewFields(schema: any): string[];
27
53
  //#endregion
28
- export { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, preview };
54
+ export { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, makeAllPropertiesRequired, normalizeDataComponentSchema, preview, stripUnsupportedConstraints };
@@ -46,6 +46,73 @@ function isZodSchema(value) {
46
46
  return value?._def?.type === "object";
47
47
  }
48
48
  /**
49
+ * Strips JSON Schema numeric constraints that are not supported by all LLM providers.
50
+ *
51
+ * Anthropic structured output rejects `minimum`, `maximum`, `exclusiveMinimum`,
52
+ * `exclusiveMaximum`, and `multipleOf` on `number`/`integer` types.
53
+ * Applied recursively to handle nested objects and arrays.
54
+ */
55
+ function stripUnsupportedConstraints(schema) {
56
+ if (!schema || typeof schema !== "object") return schema;
57
+ const stripped = { ...schema };
58
+ if (stripped.type === "number" || stripped.type === "integer") {
59
+ delete stripped.minimum;
60
+ delete stripped.maximum;
61
+ delete stripped.exclusiveMinimum;
62
+ delete stripped.exclusiveMaximum;
63
+ delete stripped.multipleOf;
64
+ }
65
+ if (stripped.properties && typeof stripped.properties === "object") {
66
+ const strippedProperties = {};
67
+ for (const [key, value] of Object.entries(stripped.properties)) strippedProperties[key] = stripUnsupportedConstraints(value);
68
+ stripped.properties = strippedProperties;
69
+ }
70
+ if (stripped.items) stripped.items = stripUnsupportedConstraints(stripped.items);
71
+ if (Array.isArray(stripped.anyOf)) stripped.anyOf = stripped.anyOf.map((s) => stripUnsupportedConstraints(s));
72
+ if (Array.isArray(stripped.oneOf)) stripped.oneOf = stripped.oneOf.map((s) => stripUnsupportedConstraints(s));
73
+ if (Array.isArray(stripped.allOf)) stripped.allOf = stripped.allOf.map((s) => stripUnsupportedConstraints(s));
74
+ return stripped;
75
+ }
76
+ /**
77
+ * Makes all properties required in an object schema, wrapping originally-optional
78
+ * fields as `{ anyOf: [<schema>, { type: 'null' }] }`.
79
+ *
80
+ * OpenAI strict-mode structured output requires every key in `properties` to also
81
+ * appear in `required`. Applied recursively to handle nested objects and arrays.
82
+ */
83
+ function makeAllPropertiesRequired(schema) {
84
+ if (!schema || typeof schema !== "object") return schema;
85
+ const normalized = { ...schema };
86
+ if (normalized.properties && typeof normalized.properties === "object") {
87
+ const originalRequired = Array.isArray(normalized.required) ? normalized.required : [];
88
+ normalized.required = Object.keys(normalized.properties);
89
+ const normalizedProperties = {};
90
+ for (const [key, value] of Object.entries(normalized.properties)) {
91
+ const processed = makeAllPropertiesRequired(value);
92
+ const alreadyNullable = Array.isArray(processed.anyOf) && processed.anyOf.some((s) => s?.type === "null") || processed.nullable === true;
93
+ normalizedProperties[key] = originalRequired.includes(key) || alreadyNullable ? processed : { anyOf: [processed, { type: "null" }] };
94
+ }
95
+ normalized.properties = normalizedProperties;
96
+ }
97
+ if (normalized.items) normalized.items = makeAllPropertiesRequired(normalized.items);
98
+ if (Array.isArray(normalized.anyOf)) normalized.anyOf = normalized.anyOf.map((s) => makeAllPropertiesRequired(s));
99
+ if (Array.isArray(normalized.oneOf)) normalized.oneOf = normalized.oneOf.map((s) => makeAllPropertiesRequired(s));
100
+ if (Array.isArray(normalized.allOf)) normalized.allOf = normalized.allOf.map((s) => makeAllPropertiesRequired(s));
101
+ return normalized;
102
+ }
103
+ /**
104
+ * Normalizes a data component JSON Schema for cross-provider LLM compatibility.
105
+ *
106
+ * Applies two transformations in order:
107
+ * 1. `stripUnsupportedConstraints` — removes `minimum`/`maximum`/etc. from numbers
108
+ * (Anthropic structured output rejects these)
109
+ * 2. `makeAllPropertiesRequired` — ensures every property appears in `required`,
110
+ * wrapping optional fields as nullable (OpenAI strict-mode requires this)
111
+ */
112
+ function normalizeDataComponentSchema(schema) {
113
+ return makeAllPropertiesRequired(stripUnsupportedConstraints(schema));
114
+ }
115
+ /**
49
116
  * Extract preview fields from either JSON Schema or Zod schema
50
117
  */
51
118
  function extractPreviewFields(schema) {
@@ -62,4 +129,4 @@ function extractPreviewFields(schema) {
62
129
  }
63
130
 
64
131
  //#endregion
65
- export { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, preview };
132
+ export { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, makeAllPropertiesRequired, normalizeDataComponentSchema, preview, stripUnsupportedConstraints };
@@ -6,9 +6,10 @@ const TRUSTED_WORK_APP_MCP_PATHS = {
6
6
  const isTrustedWorkAppMcpUrl = (url, path, baseUrl) => {
7
7
  if (!baseUrl) return false;
8
8
  try {
9
- const trusted = new URL(path, baseUrl);
10
- const toolUrl = new URL(String(url), baseUrl);
11
- return toolUrl.origin === trusted.origin && toolUrl.pathname === trusted.pathname;
9
+ const toolUrl = new URL(String(url));
10
+ const base = new URL(baseUrl);
11
+ const baseDomain = base.hostname.split(".").slice(-2).join(".");
12
+ return (toolUrl.hostname === base.hostname || toolUrl.hostname.endsWith(`.${baseDomain}`)) && toolUrl.pathname === path;
12
13
  } catch {
13
14
  return false;
14
15
  }