@inkeep/agents-core 0.33.1 → 0.33.2

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.
@@ -1,4 +1,4 @@
1
- import { AgentWithinContextOfProjectSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-JFSIBQHO.js';
1
+ import { AgentWithinContextOfProjectSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-6MC5N2NE.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  // src/validation/cycleDetection.ts
@@ -1,5 +1,5 @@
1
- import { subAgents, subAgentRelations, agents, tasks, taskRelations, conversations, messages, contextCache, dataComponents, subAgentDataComponents, artifactComponents, subAgentArtifactComponents, externalAgents, apiKeys, credentialReferences, tools, functionTools, functions, contextConfigs, subAgentToolRelations, subAgentExternalAgentRelations, subAgentTeamAgentRelations, ledgerArtifacts, projects } from './chunk-VSQY72K5.js';
2
1
  import { VALID_RELATION_TYPES, MCPTransportType, TOOL_STATUS_VALUES, CredentialStoreType, MCPServerType } from './chunk-YFHT5M2R.js';
2
+ import { subAgents, subAgentRelations, agents, tasks, taskRelations, conversations, messages, contextCache, dataComponents, subAgentDataComponents, artifactComponents, subAgentArtifactComponents, externalAgents, apiKeys, credentialReferences, tools, functionTools, functions, contextConfigs, subAgentToolRelations, subAgentExternalAgentRelations, subAgentTeamAgentRelations, ledgerArtifacts, projects } from './chunk-S75NGJ6E.js';
3
3
  import { z } from '@hono/zod-openapi';
4
4
  import { createSelectSchema as createSelectSchema$1, createInsertSchema as createInsertSchema$1 } from 'drizzle-zod';
5
5
  import Ajv from 'ajv';
@@ -165,9 +165,13 @@ var subAgents = pgTable(
165
165
  ...agentScoped,
166
166
  ...uiProperties,
167
167
  prompt: text("prompt").notNull(),
168
- conversationHistoryConfig: jsonb(
169
- "conversation_history_config"
170
- ).$type(),
168
+ conversationHistoryConfig: jsonb("conversation_history_config").$type().notNull().default({
169
+ mode: "full",
170
+ limit: 50,
171
+ maxOutputTokens: 4e3,
172
+ includeInternal: false,
173
+ messageTypes: ["chat", "tool-result"]
174
+ }),
171
175
  models: jsonb("models").$type(),
172
176
  stopWhen: jsonb("stop_when").$type(),
173
177
  ...timestamps
@@ -171,9 +171,13 @@ var subAgents = pgCore.pgTable(
171
171
  ...agentScoped,
172
172
  ...uiProperties,
173
173
  prompt: pgCore.text("prompt").notNull(),
174
- conversationHistoryConfig: pgCore.jsonb(
175
- "conversation_history_config"
176
- ).$type(),
174
+ conversationHistoryConfig: pgCore.jsonb("conversation_history_config").$type().notNull().default({
175
+ mode: "full",
176
+ limit: 50,
177
+ maxOutputTokens: 4e3,
178
+ includeInternal: false,
179
+ messageTypes: ["chat", "tool-result"]
180
+ }),
177
181
  models: pgCore.jsonb("models").$type(),
178
182
  stopWhen: pgCore.jsonb("stop_when").$type(),
179
183
  ...timestamps
@@ -1,7 +1,7 @@
1
1
  export { i as ACTIVITY_NAMES, g as ACTIVITY_STATUS, f as ACTIVITY_TYPES, h as AGENT_IDS, p as AGGREGATE_OPERATORS, A as AI_OPERATIONS, j as AI_TOOL_TYPES, o as DATA_SOURCES, k as DATA_TYPES, D as DELEGATION_FROM_SUB_AGENT_ID, b as DELEGATION_ID, a as DELEGATION_TO_SUB_AGENT_ID, F as FIELD_TYPES, O as OPERATORS, m as ORDER_DIRECTIONS, P as PANEL_TYPES, q as QUERY_DEFAULTS, l as QUERY_EXPRESSIONS, Q as QUERY_FIELD_CONFIGS, n as QUERY_TYPES, R as REDUCE_OPERATIONS, e as SPAN_KEYS, S as SPAN_NAMES, T as TRANSFER_FROM_SUB_AGENT_ID, c as TRANSFER_TO_SUB_AGENT_ID, U as UNKNOWN_VALUE, d as detectAuthenticationRequired } from './auth-detection-CGqhPDnj.cjs';
2
2
  import { z } from 'zod';
3
- import { C as ConversationHistoryConfig, F as FunctionApiInsertSchema, A as ApiKeyApiUpdateSchema, a as FullAgentAgentInsertSchema } from './utility-aMKDDNv4.cjs';
4
- export { e as AgentStopWhen, b as AgentStopWhenSchema, h as CredentialStoreType, j as FunctionApiSelectSchema, k as FunctionApiUpdateSchema, i as MCPTransportType, g as ModelSettings, M as ModelSettingsSchema, d as StopWhen, S as StopWhenSchema, f as SubAgentStopWhen, c as SubAgentStopWhenSchema } from './utility-aMKDDNv4.cjs';
3
+ import { C as ConversationHistoryConfig, F as FunctionApiInsertSchema, A as ApiKeyApiUpdateSchema, a as FullAgentAgentInsertSchema } from './utility-B73oHEd8.cjs';
4
+ export { e as AgentStopWhen, b as AgentStopWhenSchema, h as CredentialStoreType, j as FunctionApiSelectSchema, k as FunctionApiUpdateSchema, i as MCPTransportType, g as ModelSettings, M as ModelSettingsSchema, d as StopWhen, S as StopWhenSchema, f as SubAgentStopWhen, c as SubAgentStopWhenSchema } from './utility-B73oHEd8.cjs';
5
5
  export { v as validatePropsAsJsonSchema } from './props-validation-BMR1qNiy.cjs';
6
6
  import 'pino';
7
7
  import 'drizzle-zod';
@@ -134,8 +134,8 @@ declare const DataComponentApiInsertSchema: z.ZodObject<{
134
134
  }, z.core.$strip>>>;
135
135
  }, z.core.$strip>;
136
136
  declare const ArtifactComponentApiInsertSchema: z.ZodObject<{
137
- id: z.ZodString;
138
137
  name: z.ZodString;
138
+ id: z.ZodString;
139
139
  description: z.ZodString;
140
140
  props: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
141
141
  }, {
@@ -170,8 +170,8 @@ declare const FullAgentDefinitionSchema: z.ZodObject<{
170
170
  description: z.ZodOptional<z.ZodString>;
171
171
  defaultSubAgentId: z.ZodOptional<z.ZodString>;
172
172
  subAgents: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
173
- id: z.ZodString;
174
173
  name: z.ZodString;
174
+ id: z.ZodString;
175
175
  description: z.ZodString;
176
176
  createdAt: z.ZodOptional<z.ZodString>;
177
177
  updatedAt: z.ZodOptional<z.ZodString>;
@@ -198,7 +198,7 @@ declare const FullAgentDefinitionSchema: z.ZodObject<{
198
198
  }, {
199
199
  stepCountIs?: number | undefined;
200
200
  }>>>>;
201
- conversationHistoryConfig: z.ZodOptional<z.ZodNullable<z.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>>;
201
+ conversationHistoryConfig: z.ZodOptional<z.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>;
202
202
  type: z.ZodLiteral<"internal">;
203
203
  canUse: z.ZodArray<z.ZodObject<{
204
204
  agentToolRelationId: z.ZodOptional<z.ZodString>;
@@ -1,7 +1,7 @@
1
1
  export { i as ACTIVITY_NAMES, g as ACTIVITY_STATUS, f as ACTIVITY_TYPES, h as AGENT_IDS, p as AGGREGATE_OPERATORS, A as AI_OPERATIONS, j as AI_TOOL_TYPES, o as DATA_SOURCES, k as DATA_TYPES, D as DELEGATION_FROM_SUB_AGENT_ID, b as DELEGATION_ID, a as DELEGATION_TO_SUB_AGENT_ID, F as FIELD_TYPES, O as OPERATORS, m as ORDER_DIRECTIONS, P as PANEL_TYPES, q as QUERY_DEFAULTS, l as QUERY_EXPRESSIONS, Q as QUERY_FIELD_CONFIGS, n as QUERY_TYPES, R as REDUCE_OPERATIONS, e as SPAN_KEYS, S as SPAN_NAMES, T as TRANSFER_FROM_SUB_AGENT_ID, c as TRANSFER_TO_SUB_AGENT_ID, U as UNKNOWN_VALUE, d as detectAuthenticationRequired } from './auth-detection-CGqhPDnj.js';
2
2
  import { z } from 'zod';
3
- import { C as ConversationHistoryConfig, F as FunctionApiInsertSchema, A as ApiKeyApiUpdateSchema, a as FullAgentAgentInsertSchema } from './utility-aMKDDNv4.js';
4
- export { e as AgentStopWhen, b as AgentStopWhenSchema, h as CredentialStoreType, j as FunctionApiSelectSchema, k as FunctionApiUpdateSchema, i as MCPTransportType, g as ModelSettings, M as ModelSettingsSchema, d as StopWhen, S as StopWhenSchema, f as SubAgentStopWhen, c as SubAgentStopWhenSchema } from './utility-aMKDDNv4.js';
3
+ import { C as ConversationHistoryConfig, F as FunctionApiInsertSchema, A as ApiKeyApiUpdateSchema, a as FullAgentAgentInsertSchema } from './utility-B73oHEd8.js';
4
+ export { e as AgentStopWhen, b as AgentStopWhenSchema, h as CredentialStoreType, j as FunctionApiSelectSchema, k as FunctionApiUpdateSchema, i as MCPTransportType, g as ModelSettings, M as ModelSettingsSchema, d as StopWhen, S as StopWhenSchema, f as SubAgentStopWhen, c as SubAgentStopWhenSchema } from './utility-B73oHEd8.js';
5
5
  export { v as validatePropsAsJsonSchema } from './props-validation-BMR1qNiy.js';
6
6
  import 'pino';
7
7
  import 'drizzle-zod';
@@ -134,8 +134,8 @@ declare const DataComponentApiInsertSchema: z.ZodObject<{
134
134
  }, z.core.$strip>>>;
135
135
  }, z.core.$strip>;
136
136
  declare const ArtifactComponentApiInsertSchema: z.ZodObject<{
137
- id: z.ZodString;
138
137
  name: z.ZodString;
138
+ id: z.ZodString;
139
139
  description: z.ZodString;
140
140
  props: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
141
141
  }, {
@@ -170,8 +170,8 @@ declare const FullAgentDefinitionSchema: z.ZodObject<{
170
170
  description: z.ZodOptional<z.ZodString>;
171
171
  defaultSubAgentId: z.ZodOptional<z.ZodString>;
172
172
  subAgents: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
173
- id: z.ZodString;
174
173
  name: z.ZodString;
174
+ id: z.ZodString;
175
175
  description: z.ZodString;
176
176
  createdAt: z.ZodOptional<z.ZodString>;
177
177
  updatedAt: z.ZodOptional<z.ZodString>;
@@ -198,7 +198,7 @@ declare const FullAgentDefinitionSchema: z.ZodObject<{
198
198
  }, {
199
199
  stepCountIs?: number | undefined;
200
200
  }>>>>;
201
- conversationHistoryConfig: z.ZodOptional<z.ZodNullable<z.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>>;
201
+ conversationHistoryConfig: z.ZodOptional<z.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>;
202
202
  type: z.ZodLiteral<"internal">;
203
203
  canUse: z.ZodArray<z.ZodObject<{
204
204
  agentToolRelationId: z.ZodOptional<z.ZodString>;
@@ -1,6 +1,6 @@
1
1
  export { ACTIVITY_NAMES, ACTIVITY_STATUS, ACTIVITY_TYPES, AGENT_IDS, AGGREGATE_OPERATORS, AI_OPERATIONS, AI_TOOL_TYPES, DATA_SOURCES, DATA_TYPES, DELEGATION_FROM_SUB_AGENT_ID, DELEGATION_ID, DELEGATION_TO_SUB_AGENT_ID, FIELD_TYPES, OPERATORS, ORDER_DIRECTIONS, PANEL_TYPES, QUERY_DEFAULTS, QUERY_EXPRESSIONS, QUERY_FIELD_CONFIGS, QUERY_TYPES, REDUCE_OPERATIONS, SPAN_KEYS, SPAN_NAMES, TRANSFER_FROM_SUB_AGENT_ID, TRANSFER_TO_SUB_AGENT_ID, UNKNOWN_VALUE, detectAuthenticationRequired } from './chunk-OP3KPT4T.js';
2
- import { ModelSettingsSchema, schemaValidationDefaults, FullAgentAgentInsertSchema, ArtifactComponentApiInsertSchema } from './chunk-JFSIBQHO.js';
3
- export { AgentStopWhenSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, ModelSettingsSchema, StopWhenSchema, SubAgentStopWhenSchema, validatePropsAsJsonSchema } from './chunk-JFSIBQHO.js';
2
+ import { ModelSettingsSchema, schemaValidationDefaults, FullAgentAgentInsertSchema, ArtifactComponentApiInsertSchema } from './chunk-6MC5N2NE.js';
3
+ export { AgentStopWhenSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, ModelSettingsSchema, StopWhenSchema, SubAgentStopWhenSchema, validatePropsAsJsonSchema } from './chunk-6MC5N2NE.js';
4
4
  import { CredentialStoreType } from './chunk-YFHT5M2R.js';
5
5
  export { CredentialStoreType, MCPTransportType } from './chunk-YFHT5M2R.js';
6
6
  import { z } from 'zod';
@@ -113,9 +113,13 @@ var subAgents = pgCore.pgTable(
113
113
  ...agentScoped,
114
114
  ...uiProperties,
115
115
  prompt: pgCore.text("prompt").notNull(),
116
- conversationHistoryConfig: pgCore.jsonb(
117
- "conversation_history_config"
118
- ).$type(),
116
+ conversationHistoryConfig: pgCore.jsonb("conversation_history_config").$type().notNull().default({
117
+ mode: "full",
118
+ limit: 50,
119
+ maxOutputTokens: 4e3,
120
+ includeInternal: false,
121
+ messageTypes: ["chat", "tool-result"]
122
+ }),
119
123
  models: pgCore.jsonb("models").$type(),
120
124
  stopWhen: pgCore.jsonb("stop_when").$type(),
121
125
  ...timestamps
@@ -1,7 +1,7 @@
1
1
  import 'drizzle-orm';
2
2
  import 'drizzle-orm/pg-core';
3
- import '../utility-aMKDDNv4.cjs';
4
- export { G as agentRelations, J as agentToolRelationsRelations, a as agents, y as apiKeys, I as apiKeysRelations, j as artifactComponents, O as artifactComponentsRelations, b as contextCache, E as contextCacheRelations, c as contextConfigs, D as contextConfigsRelations, v as conversations, M as conversationsRelations, z as credentialReferences, K as credentialReferencesRelations, h as dataComponents, Q as dataComponentsRelations, f as externalAgents, H as externalAgentsRelations, m as functionTools, V as functionToolsRelations, n as functions, T as functionsRelations, x as ledgerArtifacts, S as ledgerArtifactsRelations, w as messages, N as messagesRelations, p as projects, B as projectsRelations, k as subAgentArtifactComponents, P as subAgentArtifactComponentsRelations, i as subAgentDataComponents, R as subAgentDataComponentsRelations, q as subAgentExternalAgentRelations, X as subAgentExternalAgentRelationsRelations, u as subAgentFunctionToolRelations, W as subAgentFunctionToolRelationsRelations, e as subAgentRelations, U as subAgentRelationsRelations, r as subAgentTeamAgentRelations, Y as subAgentTeamAgentRelationsRelations, o as subAgentToolRelations, d as subAgents, F as subAgentsRelations, g as taskRelations, C as taskRelationsRelations, t as tasks, A as tasksRelations, l as tools, L as toolsRelations } from '../schema-aKVr9nIb.cjs';
3
+ import '../utility-B73oHEd8.cjs';
4
+ export { G as agentRelations, J as agentToolRelationsRelations, a as agents, y as apiKeys, I as apiKeysRelations, j as artifactComponents, O as artifactComponentsRelations, b as contextCache, E as contextCacheRelations, c as contextConfigs, D as contextConfigsRelations, v as conversations, M as conversationsRelations, z as credentialReferences, K as credentialReferencesRelations, h as dataComponents, Q as dataComponentsRelations, f as externalAgents, H as externalAgentsRelations, m as functionTools, V as functionToolsRelations, n as functions, T as functionsRelations, x as ledgerArtifacts, S as ledgerArtifactsRelations, w as messages, N as messagesRelations, p as projects, B as projectsRelations, k as subAgentArtifactComponents, P as subAgentArtifactComponentsRelations, i as subAgentDataComponents, R as subAgentDataComponentsRelations, q as subAgentExternalAgentRelations, X as subAgentExternalAgentRelationsRelations, u as subAgentFunctionToolRelations, W as subAgentFunctionToolRelationsRelations, e as subAgentRelations, U as subAgentRelationsRelations, r as subAgentTeamAgentRelations, Y as subAgentTeamAgentRelationsRelations, o as subAgentToolRelations, d as subAgents, F as subAgentsRelations, g as taskRelations, C as taskRelationsRelations, t as tasks, A as tasksRelations, l as tools, L as toolsRelations } from '../schema-dODUpZEu.cjs';
5
5
  import 'zod';
6
6
  import 'drizzle-zod';
7
7
  import '@hono/zod-openapi';
@@ -1,7 +1,7 @@
1
1
  import 'drizzle-orm';
2
2
  import 'drizzle-orm/pg-core';
3
- import '../utility-aMKDDNv4.js';
4
- export { G as agentRelations, J as agentToolRelationsRelations, a as agents, y as apiKeys, I as apiKeysRelations, j as artifactComponents, O as artifactComponentsRelations, b as contextCache, E as contextCacheRelations, c as contextConfigs, D as contextConfigsRelations, v as conversations, M as conversationsRelations, z as credentialReferences, K as credentialReferencesRelations, h as dataComponents, Q as dataComponentsRelations, f as externalAgents, H as externalAgentsRelations, m as functionTools, V as functionToolsRelations, n as functions, T as functionsRelations, x as ledgerArtifacts, S as ledgerArtifactsRelations, w as messages, N as messagesRelations, p as projects, B as projectsRelations, k as subAgentArtifactComponents, P as subAgentArtifactComponentsRelations, i as subAgentDataComponents, R as subAgentDataComponentsRelations, q as subAgentExternalAgentRelations, X as subAgentExternalAgentRelationsRelations, u as subAgentFunctionToolRelations, W as subAgentFunctionToolRelationsRelations, e as subAgentRelations, U as subAgentRelationsRelations, r as subAgentTeamAgentRelations, Y as subAgentTeamAgentRelationsRelations, o as subAgentToolRelations, d as subAgents, F as subAgentsRelations, g as taskRelations, C as taskRelationsRelations, t as tasks, A as tasksRelations, l as tools, L as toolsRelations } from '../schema-BceDktlR.js';
3
+ import '../utility-B73oHEd8.js';
4
+ export { G as agentRelations, J as agentToolRelationsRelations, a as agents, y as apiKeys, I as apiKeysRelations, j as artifactComponents, O as artifactComponentsRelations, b as contextCache, E as contextCacheRelations, c as contextConfigs, D as contextConfigsRelations, v as conversations, M as conversationsRelations, z as credentialReferences, K as credentialReferencesRelations, h as dataComponents, Q as dataComponentsRelations, f as externalAgents, H as externalAgentsRelations, m as functionTools, V as functionToolsRelations, n as functions, T as functionsRelations, x as ledgerArtifacts, S as ledgerArtifactsRelations, w as messages, N as messagesRelations, p as projects, B as projectsRelations, k as subAgentArtifactComponents, P as subAgentArtifactComponentsRelations, i as subAgentDataComponents, R as subAgentDataComponentsRelations, q as subAgentExternalAgentRelations, X as subAgentExternalAgentRelationsRelations, u as subAgentFunctionToolRelations, W as subAgentFunctionToolRelationsRelations, e as subAgentRelations, U as subAgentRelationsRelations, r as subAgentTeamAgentRelations, Y as subAgentTeamAgentRelationsRelations, o as subAgentToolRelations, d as subAgents, F as subAgentsRelations, g as taskRelations, C as taskRelationsRelations, t as tasks, A as tasksRelations, l as tools, L as toolsRelations } from '../schema-DYCQuSqA.js';
5
5
  import 'zod';
6
6
  import 'drizzle-zod';
7
7
  import '@hono/zod-openapi';
package/dist/db/schema.js CHANGED
@@ -1 +1 @@
1
- export { agentRelations, agentToolRelationsRelations, agents, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, dataComponentsRelations, externalAgents, externalAgentsRelations, functionTools, functionToolsRelations, functions, functionsRelations, ledgerArtifacts, ledgerArtifactsRelations, messages, messagesRelations, projects, projectsRelations, subAgentArtifactComponents, subAgentArtifactComponentsRelations, subAgentDataComponents, subAgentDataComponentsRelations, subAgentExternalAgentRelations, subAgentExternalAgentRelationsRelations, subAgentFunctionToolRelations, subAgentFunctionToolRelationsRelations, subAgentRelations, subAgentRelationsRelations, subAgentTeamAgentRelations, subAgentTeamAgentRelationsRelations, subAgentToolRelations, subAgents, subAgentsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from '../chunk-VSQY72K5.js';
1
+ export { agentRelations, agentToolRelationsRelations, agents, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, dataComponentsRelations, externalAgents, externalAgentsRelations, functionTools, functionToolsRelations, functions, functionsRelations, ledgerArtifacts, ledgerArtifactsRelations, messages, messagesRelations, projects, projectsRelations, subAgentArtifactComponents, subAgentArtifactComponentsRelations, subAgentDataComponents, subAgentDataComponentsRelations, subAgentExternalAgentRelations, subAgentExternalAgentRelationsRelations, subAgentFunctionToolRelations, subAgentFunctionToolRelationsRelations, subAgentRelations, subAgentRelationsRelations, subAgentTeamAgentRelations, subAgentTeamAgentRelationsRelations, subAgentToolRelations, subAgents, subAgentsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from '../chunk-S75NGJ6E.js';
package/dist/index.cjs CHANGED
@@ -212976,7 +212976,8 @@ var executionLimitsSharedDefaults = {
212976
212976
  // CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT: Maximum number of tokens from previous conversation messages
212977
212977
  // to include in the LLM prompt. Prevents excessive token usage while maintaining relevant conversation context.
212978
212978
  // Messages exceeding this limit are truncated from the beginning of the conversation.
212979
- CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT: 4e3
212979
+ // Increased from 4,000 to 8,000 to accommodate tool results in conversation history.
212980
+ CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT: 8e3
212980
212981
  };
212981
212982
 
212982
212983
  // src/constants/execution-limits-shared/index.ts
@@ -213769,9 +213770,13 @@ var subAgents = pgCore.pgTable(
213769
213770
  ...agentScoped,
213770
213771
  ...uiProperties,
213771
213772
  prompt: pgCore.text("prompt").notNull(),
213772
- conversationHistoryConfig: pgCore.jsonb(
213773
- "conversation_history_config"
213774
- ).$type(),
213773
+ conversationHistoryConfig: pgCore.jsonb("conversation_history_config").$type().notNull().default({
213774
+ mode: "full",
213775
+ limit: 50,
213776
+ maxOutputTokens: 4e3,
213777
+ includeInternal: false,
213778
+ messageTypes: ["chat", "tool-result"]
213779
+ }),
213775
213780
  models: pgCore.jsonb("models").$type(),
213776
213781
  stopWhen: pgCore.jsonb("stop_when").$type(),
213777
213782
  ...timestamps
@@ -218842,7 +218847,7 @@ var errorSchemaFactory = (code, description) => ({
218842
218847
  // description: "A URI reference that identifies the problem type.",
218843
218848
  // example: `${ERROR_DOCS_BASE_URL}#${code}`,
218844
218849
  // }),
218845
- status: zodOpenapi.z.literal(errorCodeToHttpStatus[code]).openapi({
218850
+ status: zodOpenapi.z.number().int().openapi({
218846
218851
  description: "The HTTP status code.",
218847
218852
  example: errorCodeToHttpStatus[code]
218848
218853
  }),
@@ -220872,17 +220877,23 @@ var updateDataComponent = (db) => async (params) => {
220872
220877
  const propsValidation = validatePropsAsJsonSchema(params.data.props);
220873
220878
  if (!propsValidation.isValid) {
220874
220879
  const errorMessages = propsValidation.errors.map((e) => `${e.field}: ${e.message}`).join(", ");
220875
- throw new Error(`Invalid props schema: ${errorMessages}`);
220880
+ throw createApiError({
220881
+ code: "bad_request",
220882
+ message: `Invalid props schema: ${errorMessages}`
220883
+ });
220876
220884
  }
220877
220885
  }
220878
- if (params.data.render !== void 0 && params.data.render !== null) {
220879
- if (typeof params.data.render === "object" && params.data.render !== null && "component" in params.data.render && "mockData" in params.data.render) {
220886
+ if (params.data.render) {
220887
+ if (typeof params.data.render === "object" && "component" in params.data.render && "mockData" in params.data.render) {
220880
220888
  const renderValidation = validateRender(
220881
220889
  params.data.render
220882
220890
  );
220883
220891
  if (!renderValidation.isValid) {
220884
220892
  const errorMessages = renderValidation.errors.map((e) => `${e.field}: ${e.message}`).join(", ");
220885
- throw new Error(`Invalid render: ${errorMessages}`);
220893
+ throw createApiError({
220894
+ code: "bad_request",
220895
+ message: `Invalid render: ${errorMessages}`
220896
+ });
220886
220897
  }
220887
220898
  }
220888
220899
  }
@@ -222886,7 +222897,8 @@ var getConversationHistory = (db) => async (params) => {
222886
222897
  const {
222887
222898
  limit = options.limit ?? 50,
222888
222899
  includeInternal = options.includeInternal ?? false,
222889
- maxOutputTokens
222900
+ maxOutputTokens,
222901
+ messageTypes
222890
222902
  } = options;
222891
222903
  const whereConditions = [
222892
222904
  drizzleOrm.eq(messages.tenantId, tenantId),
@@ -222896,6 +222908,9 @@ var getConversationHistory = (db) => async (params) => {
222896
222908
  if (!includeInternal) {
222897
222909
  whereConditions.push(drizzleOrm.eq(messages.visibility, "user-facing"));
222898
222910
  }
222911
+ if (messageTypes && messageTypes.length > 0) {
222912
+ whereConditions.push(drizzleOrm.inArray(messages.messageType, messageTypes));
222913
+ }
222899
222914
  const messageHistory = await db.select().from(messages).where(drizzleOrm.and(...whereConditions)).orderBy(drizzleOrm.desc(messages.createdAt)).limit(limit);
222900
222915
  const chronologicalHistory = messageHistory.reverse();
222901
222916
  if (maxOutputTokens) {
@@ -225263,7 +225278,6 @@ function validationHelper(jsonSchema) {
225263
225278
  return getCachedValidator(jsonSchema);
225264
225279
  }
225265
225280
  function validateAgainstJsonSchema(jsonSchema, context) {
225266
- logger11.debug({ jsonSchema, context }, "Validating context against JSON Schema");
225267
225281
  const validate = validationHelper(jsonSchema);
225268
225282
  return validate(context);
225269
225283
  }
@@ -225628,7 +225642,6 @@ var ContextFetcher = class {
225628
225642
  definition.credentialReferenceId
225629
225643
  );
225630
225644
  const response = await this.performRequest(resolvedConfig);
225631
- logger12.info({ response }, "ContextFetcher Response");
225632
225645
  let transformedData = response.data;
225633
225646
  if (definition.fetchConfig.transform) {
225634
225647
  transformedData = this.transformResponse(response.data, definition.fetchConfig.transform);
@@ -225860,14 +225873,6 @@ var ContextFetcher = class {
225860
225873
  if (!isValid) {
225861
225874
  throw new Error("Data does not match JSON Schema");
225862
225875
  }
225863
- logger12.debug(
225864
- {
225865
- definitionId,
225866
- dataType: typeof data,
225867
- validationResult: "success"
225868
- },
225869
- "JSON Schema response validation passed"
225870
- );
225871
225876
  } catch (error) {
225872
225877
  const errorMessage = error instanceof Error ? error.message : "Unknown validation error";
225873
225878
  logger12.error(