@inkeep/agents-core 0.0.0-dev-20251108014948 → 0.0.0-dev-20251110174655
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-PPBBIDK4.js → chunk-DCMDYQKE.js} +1 -1
- package/dist/{chunk-RBUBOGX6.js → chunk-SLRVWIQY.js} +58 -8
- package/dist/client-exports.cjs +69 -12
- package/dist/client-exports.js +15 -7
- package/dist/index.cjs +234 -73
- package/dist/index.d.cts +53 -1
- package/dist/index.d.ts +53 -1
- package/dist/index.js +189 -101
- package/dist/validation/index.cjs +56 -7
- package/dist/validation/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AgentWithinContextOfProjectSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-
|
|
1
|
+
import { AgentWithinContextOfProjectSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-SLRVWIQY.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
// src/validation/cycleDetection.ts
|
|
@@ -4,9 +4,53 @@ import { z } from '@hono/zod-openapi';
|
|
|
4
4
|
import { createSelectSchema, createInsertSchema } from 'drizzle-zod';
|
|
5
5
|
import Ajv from 'ajv';
|
|
6
6
|
|
|
7
|
+
// src/constants/schema-validation/defaults.ts
|
|
8
|
+
var schemaValidationDefaults = {
|
|
9
|
+
// Agent Execution Transfer Count
|
|
10
|
+
// Controls how many times an agent can transfer control to sub-agents in a single conversation turn.
|
|
11
|
+
// This prevents infinite transfer loops while allowing multi-agent collaboration workflows.
|
|
12
|
+
AGENT_EXECUTION_TRANSFER_COUNT_MIN: 1,
|
|
13
|
+
AGENT_EXECUTION_TRANSFER_COUNT_MAX: 1e3,
|
|
14
|
+
AGENT_EXECUTION_TRANSFER_COUNT_DEFAULT: 10,
|
|
15
|
+
// Sub-Agent Turn Generation Steps
|
|
16
|
+
// Limits how many AI generation steps a sub-agent can perform within a single turn.
|
|
17
|
+
// Each generation step typically involves sending a prompt to the LLM and processing its response.
|
|
18
|
+
// This prevents runaway token usage while allowing complex multi-step reasoning.
|
|
19
|
+
SUB_AGENT_TURN_GENERATION_STEPS_MIN: 1,
|
|
20
|
+
SUB_AGENT_TURN_GENERATION_STEPS_MAX: 1e3,
|
|
21
|
+
SUB_AGENT_TURN_GENERATION_STEPS_DEFAULT: 12,
|
|
22
|
+
// Status Update Thresholds
|
|
23
|
+
// Real-time status updates are triggered when either threshold is exceeded during longer operations.
|
|
24
|
+
// MAX_NUM_EVENTS: Maximum number of internal events before forcing a status update to the client.
|
|
25
|
+
// MAX_INTERVAL_SECONDS: Maximum time between status updates regardless of event count.
|
|
26
|
+
STATUS_UPDATE_MAX_NUM_EVENTS: 100,
|
|
27
|
+
STATUS_UPDATE_MAX_INTERVAL_SECONDS: 600,
|
|
28
|
+
// 10 minutes
|
|
29
|
+
// Prompt Text Length Validation
|
|
30
|
+
// Maximum character limits for agent and sub-agent system prompts to prevent excessive token usage.
|
|
31
|
+
// Enforced during agent configuration to ensure prompts remain focused and manageable.
|
|
32
|
+
VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS: 2e3,
|
|
33
|
+
VALIDATION_AGENT_PROMPT_MAX_CHARS: 5e3,
|
|
34
|
+
// Context Fetcher HTTP Timeout
|
|
35
|
+
// Maximum time allowed for HTTP requests made by Context Fetchers (e.g., CRM lookups, external API calls).
|
|
36
|
+
// Context Fetchers automatically retrieve external data at the start of a conversation to enrich agent context.
|
|
37
|
+
CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT: 1e4
|
|
38
|
+
// 10 seconds
|
|
39
|
+
};
|
|
40
|
+
var {
|
|
41
|
+
AGENT_EXECUTION_TRANSFER_COUNT_MAX,
|
|
42
|
+
AGENT_EXECUTION_TRANSFER_COUNT_MIN,
|
|
43
|
+
CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT,
|
|
44
|
+
STATUS_UPDATE_MAX_INTERVAL_SECONDS,
|
|
45
|
+
STATUS_UPDATE_MAX_NUM_EVENTS,
|
|
46
|
+
SUB_AGENT_TURN_GENERATION_STEPS_MAX,
|
|
47
|
+
SUB_AGENT_TURN_GENERATION_STEPS_MIN,
|
|
48
|
+
VALIDATION_AGENT_PROMPT_MAX_CHARS,
|
|
49
|
+
VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS
|
|
50
|
+
} = schemaValidationDefaults;
|
|
7
51
|
var StopWhenSchema = z.object({
|
|
8
|
-
transferCountIs: z.number().min(
|
|
9
|
-
stepCountIs: z.number().min(
|
|
52
|
+
transferCountIs: z.number().min(AGENT_EXECUTION_TRANSFER_COUNT_MIN).max(AGENT_EXECUTION_TRANSFER_COUNT_MAX).optional().describe("The maximum number of transfers to trigger the stop condition."),
|
|
53
|
+
stepCountIs: z.number().min(SUB_AGENT_TURN_GENERATION_STEPS_MIN).max(SUB_AGENT_TURN_GENERATION_STEPS_MAX).optional().describe("The maximum number of steps to trigger the stop condition.")
|
|
10
54
|
}).openapi("StopWhen");
|
|
11
55
|
var AgentStopWhenSchema = StopWhenSchema.pick({ transferCountIs: true }).openapi(
|
|
12
56
|
"AgentStopWhen"
|
|
@@ -485,7 +529,7 @@ var FetchConfigSchema = z.object({
|
|
|
485
529
|
body: z.record(z.string(), z.unknown()).optional(),
|
|
486
530
|
transform: z.string().optional(),
|
|
487
531
|
// JSONPath or JS transform function
|
|
488
|
-
timeout: z.number().min(0).optional().default(
|
|
532
|
+
timeout: z.number().min(0).optional().default(CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT).optional()
|
|
489
533
|
}).openapi("FetchConfig");
|
|
490
534
|
var FetchDefinitionSchema = z.object({
|
|
491
535
|
id: z.string().min(1, "Fetch definition ID is required"),
|
|
@@ -604,9 +648,12 @@ var StatusComponentSchema = z.object({
|
|
|
604
648
|
}).openapi("StatusComponent");
|
|
605
649
|
var StatusUpdateSchema = z.object({
|
|
606
650
|
enabled: z.boolean().optional(),
|
|
607
|
-
numEvents: z.number().min(1).max(
|
|
608
|
-
timeInSeconds: z.number().min(1).max(
|
|
609
|
-
prompt: z.string().max(
|
|
651
|
+
numEvents: z.number().min(1).max(STATUS_UPDATE_MAX_NUM_EVENTS).optional(),
|
|
652
|
+
timeInSeconds: z.number().min(1).max(STATUS_UPDATE_MAX_INTERVAL_SECONDS).optional(),
|
|
653
|
+
prompt: z.string().max(
|
|
654
|
+
VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS,
|
|
655
|
+
`Custom prompt cannot exceed ${VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS} characters`
|
|
656
|
+
).optional(),
|
|
610
657
|
statusComponents: z.array(StatusComponentSchema).optional()
|
|
611
658
|
}).openapi("StatusUpdate");
|
|
612
659
|
var CanUseItemSchema = z.object({
|
|
@@ -665,7 +712,10 @@ var AgentWithinContextOfProjectSchema = AgentApiInsertSchema.extend({
|
|
|
665
712
|
statusUpdates: z.optional(StatusUpdateSchema),
|
|
666
713
|
models: ModelSchema.optional(),
|
|
667
714
|
stopWhen: AgentStopWhenSchema.optional(),
|
|
668
|
-
prompt: z.string().max(
|
|
715
|
+
prompt: z.string().max(
|
|
716
|
+
VALIDATION_AGENT_PROMPT_MAX_CHARS,
|
|
717
|
+
`Agent prompt cannot exceed ${VALIDATION_AGENT_PROMPT_MAX_CHARS} characters`
|
|
718
|
+
).optional()
|
|
669
719
|
});
|
|
670
720
|
var PaginationSchema = z.object({
|
|
671
721
|
page: z.coerce.number().min(1).default(1),
|
|
@@ -976,4 +1026,4 @@ function validatePropsAsJsonSchema(props) {
|
|
|
976
1026
|
}
|
|
977
1027
|
}
|
|
978
1028
|
|
|
979
|
-
export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ComponentAssociationSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigListResponse, ContextConfigResponse, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationListResponse, ConversationResponse, ConversationSelectSchema, ConversationUpdateSchema, CreateCredentialInStoreRequestSchema, CreateCredentialInStoreResponseSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceListResponse, CredentialReferenceResponse, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, CredentialStoreListResponseSchema, CredentialStoreSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentListResponse, DataComponentResponse, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullAgentAgentInsertSchema, FullProjectDefinitionSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionListResponse, FunctionResponse, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolListResponse, FunctionToolResponse, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, OAuthCallbackQuerySchema, OAuthLoginQuerySchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RelatedAgentInfoSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentListResponse, SubAgentArtifactComponentResponse, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentListResponse, SubAgentDataComponentResponse, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiSelectSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentExternalAgentRelationInsertSchema, SubAgentExternalAgentRelationSelectSchema, SubAgentExternalAgentRelationUpdateSchema, SubAgentInsertSchema, SubAgentListResponse, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentResponse, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentTeamAgentRelationApiInsertSchema, SubAgentTeamAgentRelationApiSelectSchema, SubAgentTeamAgentRelationApiUpdateSchema, SubAgentTeamAgentRelationInsertSchema, SubAgentTeamAgentRelationSelectSchema, SubAgentTeamAgentRelationUpdateSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TeamAgentSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, canDelegateToExternalAgentSchema, canDelegateToTeamAgentSchema, resourceIdSchema, validatePropsAsJsonSchema };
|
|
1029
|
+
export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ComponentAssociationSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigListResponse, ContextConfigResponse, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationListResponse, ConversationResponse, ConversationSelectSchema, ConversationUpdateSchema, CreateCredentialInStoreRequestSchema, CreateCredentialInStoreResponseSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceListResponse, CredentialReferenceResponse, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, CredentialStoreListResponseSchema, CredentialStoreSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentListResponse, DataComponentResponse, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullAgentAgentInsertSchema, FullProjectDefinitionSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionListResponse, FunctionResponse, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolListResponse, FunctionToolResponse, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, OAuthCallbackQuerySchema, OAuthLoginQuerySchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RelatedAgentInfoSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentListResponse, SubAgentArtifactComponentResponse, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentListResponse, SubAgentDataComponentResponse, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiSelectSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentExternalAgentRelationInsertSchema, SubAgentExternalAgentRelationSelectSchema, SubAgentExternalAgentRelationUpdateSchema, SubAgentInsertSchema, SubAgentListResponse, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentResponse, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentTeamAgentRelationApiInsertSchema, SubAgentTeamAgentRelationApiSelectSchema, SubAgentTeamAgentRelationApiUpdateSchema, SubAgentTeamAgentRelationInsertSchema, SubAgentTeamAgentRelationSelectSchema, SubAgentTeamAgentRelationUpdateSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TeamAgentSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, canDelegateToExternalAgentSchema, canDelegateToTeamAgentSchema, resourceIdSchema, schemaValidationDefaults, validatePropsAsJsonSchema };
|
package/dist/client-exports.cjs
CHANGED
|
@@ -14,6 +14,38 @@ var Ajv__default = /*#__PURE__*/_interopDefault(Ajv);
|
|
|
14
14
|
|
|
15
15
|
// src/client-exports.ts
|
|
16
16
|
|
|
17
|
+
// src/constants/schema-validation/defaults.ts
|
|
18
|
+
var schemaValidationDefaults = {
|
|
19
|
+
// Agent Execution Transfer Count
|
|
20
|
+
// Controls how many times an agent can transfer control to sub-agents in a single conversation turn.
|
|
21
|
+
// This prevents infinite transfer loops while allowing multi-agent collaboration workflows.
|
|
22
|
+
AGENT_EXECUTION_TRANSFER_COUNT_MIN: 1,
|
|
23
|
+
AGENT_EXECUTION_TRANSFER_COUNT_MAX: 1e3,
|
|
24
|
+
// Sub-Agent Turn Generation Steps
|
|
25
|
+
// Limits how many AI generation steps a sub-agent can perform within a single turn.
|
|
26
|
+
// Each generation step typically involves sending a prompt to the LLM and processing its response.
|
|
27
|
+
// This prevents runaway token usage while allowing complex multi-step reasoning.
|
|
28
|
+
SUB_AGENT_TURN_GENERATION_STEPS_MIN: 1,
|
|
29
|
+
SUB_AGENT_TURN_GENERATION_STEPS_MAX: 1e3,
|
|
30
|
+
// Status Update Thresholds
|
|
31
|
+
// Real-time status updates are triggered when either threshold is exceeded during longer operations.
|
|
32
|
+
// MAX_NUM_EVENTS: Maximum number of internal events before forcing a status update to the client.
|
|
33
|
+
// MAX_INTERVAL_SECONDS: Maximum time between status updates regardless of event count.
|
|
34
|
+
STATUS_UPDATE_MAX_NUM_EVENTS: 100,
|
|
35
|
+
STATUS_UPDATE_MAX_INTERVAL_SECONDS: 600,
|
|
36
|
+
// 10 minutes
|
|
37
|
+
// Prompt Text Length Validation
|
|
38
|
+
// Maximum character limits for agent and sub-agent system prompts to prevent excessive token usage.
|
|
39
|
+
// Enforced during agent configuration to ensure prompts remain focused and manageable.
|
|
40
|
+
VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS: 2e3,
|
|
41
|
+
VALIDATION_AGENT_PROMPT_MAX_CHARS: 5e3,
|
|
42
|
+
// Context Fetcher HTTP Timeout
|
|
43
|
+
// Maximum time allowed for HTTP requests made by Context Fetchers (e.g., CRM lookups, external API calls).
|
|
44
|
+
// Context Fetchers automatically retrieve external data at the start of a conversation to enrich agent context.
|
|
45
|
+
CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT: 1e4
|
|
46
|
+
// 10 seconds
|
|
47
|
+
};
|
|
48
|
+
|
|
17
49
|
// src/types/utility.ts
|
|
18
50
|
var TOOL_STATUS_VALUES = ["healthy", "unhealthy", "unknown", "needs_auth"];
|
|
19
51
|
var VALID_RELATION_TYPES = ["transfer", "delegate"];
|
|
@@ -962,9 +994,20 @@ drizzleOrm.relations(
|
|
|
962
994
|
);
|
|
963
995
|
|
|
964
996
|
// src/validation/schemas.ts
|
|
997
|
+
var {
|
|
998
|
+
AGENT_EXECUTION_TRANSFER_COUNT_MAX,
|
|
999
|
+
AGENT_EXECUTION_TRANSFER_COUNT_MIN,
|
|
1000
|
+
CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT,
|
|
1001
|
+
STATUS_UPDATE_MAX_INTERVAL_SECONDS,
|
|
1002
|
+
STATUS_UPDATE_MAX_NUM_EVENTS,
|
|
1003
|
+
SUB_AGENT_TURN_GENERATION_STEPS_MAX,
|
|
1004
|
+
SUB_AGENT_TURN_GENERATION_STEPS_MIN,
|
|
1005
|
+
VALIDATION_AGENT_PROMPT_MAX_CHARS,
|
|
1006
|
+
VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS
|
|
1007
|
+
} = schemaValidationDefaults;
|
|
965
1008
|
var StopWhenSchema = zodOpenapi.z.object({
|
|
966
|
-
transferCountIs: zodOpenapi.z.number().min(
|
|
967
|
-
stepCountIs: zodOpenapi.z.number().min(
|
|
1009
|
+
transferCountIs: zodOpenapi.z.number().min(AGENT_EXECUTION_TRANSFER_COUNT_MIN).max(AGENT_EXECUTION_TRANSFER_COUNT_MAX).optional().describe("The maximum number of transfers to trigger the stop condition."),
|
|
1010
|
+
stepCountIs: zodOpenapi.z.number().min(SUB_AGENT_TURN_GENERATION_STEPS_MIN).max(SUB_AGENT_TURN_GENERATION_STEPS_MAX).optional().describe("The maximum number of steps to trigger the stop condition.")
|
|
968
1011
|
}).openapi("StopWhen");
|
|
969
1012
|
var AgentStopWhenSchema = StopWhenSchema.pick({ transferCountIs: true }).openapi(
|
|
970
1013
|
"AgentStopWhen"
|
|
@@ -1443,7 +1486,7 @@ var FetchConfigSchema = zodOpenapi.z.object({
|
|
|
1443
1486
|
body: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).optional(),
|
|
1444
1487
|
transform: zodOpenapi.z.string().optional(),
|
|
1445
1488
|
// JSONPath or JS transform function
|
|
1446
|
-
timeout: zodOpenapi.z.number().min(0).optional().default(
|
|
1489
|
+
timeout: zodOpenapi.z.number().min(0).optional().default(CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT).optional()
|
|
1447
1490
|
}).openapi("FetchConfig");
|
|
1448
1491
|
zodOpenapi.z.object({
|
|
1449
1492
|
id: zodOpenapi.z.string().min(1, "Fetch definition ID is required"),
|
|
@@ -1562,9 +1605,12 @@ var StatusComponentSchema = zodOpenapi.z.object({
|
|
|
1562
1605
|
}).openapi("StatusComponent");
|
|
1563
1606
|
var StatusUpdateSchema = zodOpenapi.z.object({
|
|
1564
1607
|
enabled: zodOpenapi.z.boolean().optional(),
|
|
1565
|
-
numEvents: zodOpenapi.z.number().min(1).max(
|
|
1566
|
-
timeInSeconds: zodOpenapi.z.number().min(1).max(
|
|
1567
|
-
prompt: zodOpenapi.z.string().max(
|
|
1608
|
+
numEvents: zodOpenapi.z.number().min(1).max(STATUS_UPDATE_MAX_NUM_EVENTS).optional(),
|
|
1609
|
+
timeInSeconds: zodOpenapi.z.number().min(1).max(STATUS_UPDATE_MAX_INTERVAL_SECONDS).optional(),
|
|
1610
|
+
prompt: zodOpenapi.z.string().max(
|
|
1611
|
+
VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS,
|
|
1612
|
+
`Custom prompt cannot exceed ${VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS} characters`
|
|
1613
|
+
).optional(),
|
|
1568
1614
|
statusComponents: zodOpenapi.z.array(StatusComponentSchema).optional()
|
|
1569
1615
|
}).openapi("StatusUpdate");
|
|
1570
1616
|
var CanUseItemSchema = zodOpenapi.z.object({
|
|
@@ -1623,7 +1669,10 @@ var AgentWithinContextOfProjectSchema = AgentApiInsertSchema.extend({
|
|
|
1623
1669
|
statusUpdates: zodOpenapi.z.optional(StatusUpdateSchema),
|
|
1624
1670
|
models: ModelSchema.optional(),
|
|
1625
1671
|
stopWhen: AgentStopWhenSchema.optional(),
|
|
1626
|
-
prompt: zodOpenapi.z.string().max(
|
|
1672
|
+
prompt: zodOpenapi.z.string().max(
|
|
1673
|
+
VALIDATION_AGENT_PROMPT_MAX_CHARS,
|
|
1674
|
+
`Agent prompt cannot exceed ${VALIDATION_AGENT_PROMPT_MAX_CHARS} characters`
|
|
1675
|
+
).optional()
|
|
1627
1676
|
});
|
|
1628
1677
|
var PaginationSchema = zodOpenapi.z.object({
|
|
1629
1678
|
page: zodOpenapi.z.coerce.number().min(1).default(1),
|
|
@@ -2268,6 +2317,14 @@ var detectAuthenticationRequired = async ({
|
|
|
2268
2317
|
};
|
|
2269
2318
|
|
|
2270
2319
|
// src/client-exports.ts
|
|
2320
|
+
var {
|
|
2321
|
+
AGENT_EXECUTION_TRANSFER_COUNT_MAX: AGENT_EXECUTION_TRANSFER_COUNT_MAX2,
|
|
2322
|
+
AGENT_EXECUTION_TRANSFER_COUNT_MIN: AGENT_EXECUTION_TRANSFER_COUNT_MIN2,
|
|
2323
|
+
STATUS_UPDATE_MAX_INTERVAL_SECONDS: STATUS_UPDATE_MAX_INTERVAL_SECONDS2,
|
|
2324
|
+
STATUS_UPDATE_MAX_NUM_EVENTS: STATUS_UPDATE_MAX_NUM_EVENTS2,
|
|
2325
|
+
VALIDATION_AGENT_PROMPT_MAX_CHARS: VALIDATION_AGENT_PROMPT_MAX_CHARS2,
|
|
2326
|
+
VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS: VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS2
|
|
2327
|
+
} = schemaValidationDefaults;
|
|
2271
2328
|
var TenantParamsSchema2 = zod.z.object({
|
|
2272
2329
|
tenantId: zod.z.string()
|
|
2273
2330
|
});
|
|
@@ -2399,14 +2456,14 @@ var FullAgentDefinitionSchema = AgentAgentApiInsertSchema.extend({
|
|
|
2399
2456
|
}).optional()
|
|
2400
2457
|
}).optional(),
|
|
2401
2458
|
stopWhen: zod.z.object({
|
|
2402
|
-
transferCountIs: zod.z.number().min(
|
|
2459
|
+
transferCountIs: zod.z.number().min(AGENT_EXECUTION_TRANSFER_COUNT_MIN2).max(AGENT_EXECUTION_TRANSFER_COUNT_MAX2).optional()
|
|
2403
2460
|
}).optional(),
|
|
2404
|
-
prompt: zod.z.string().max(
|
|
2461
|
+
prompt: zod.z.string().max(VALIDATION_AGENT_PROMPT_MAX_CHARS2).optional(),
|
|
2405
2462
|
statusUpdates: zod.z.object({
|
|
2406
2463
|
enabled: zod.z.boolean().optional(),
|
|
2407
|
-
numEvents: zod.z.number().min(1).max(
|
|
2408
|
-
timeInSeconds: zod.z.number().min(1).max(
|
|
2409
|
-
prompt: zod.z.string().max(
|
|
2464
|
+
numEvents: zod.z.number().min(1).max(STATUS_UPDATE_MAX_NUM_EVENTS2).optional(),
|
|
2465
|
+
timeInSeconds: zod.z.number().min(1).max(STATUS_UPDATE_MAX_INTERVAL_SECONDS2).optional(),
|
|
2466
|
+
prompt: zod.z.string().max(VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS2).optional(),
|
|
2410
2467
|
statusComponents: zod.z.array(
|
|
2411
2468
|
zod.z.object({
|
|
2412
2469
|
type: zod.z.string(),
|
package/dist/client-exports.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
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, FullAgentAgentInsertSchema, ArtifactComponentApiInsertSchema } from './chunk-
|
|
3
|
-
export { AgentStopWhenSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, ModelSettingsSchema, StopWhenSchema, SubAgentStopWhenSchema, validatePropsAsJsonSchema } from './chunk-
|
|
2
|
+
import { ModelSettingsSchema, schemaValidationDefaults, FullAgentAgentInsertSchema, ArtifactComponentApiInsertSchema } from './chunk-SLRVWIQY.js';
|
|
3
|
+
export { AgentStopWhenSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, ModelSettingsSchema, StopWhenSchema, SubAgentStopWhenSchema, validatePropsAsJsonSchema } from './chunk-SLRVWIQY.js';
|
|
4
4
|
import { CredentialStoreType } from './chunk-YFHT5M2R.js';
|
|
5
5
|
export { CredentialStoreType, MCPTransportType } from './chunk-YFHT5M2R.js';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
|
|
8
|
+
var {
|
|
9
|
+
AGENT_EXECUTION_TRANSFER_COUNT_MAX,
|
|
10
|
+
AGENT_EXECUTION_TRANSFER_COUNT_MIN,
|
|
11
|
+
STATUS_UPDATE_MAX_INTERVAL_SECONDS,
|
|
12
|
+
STATUS_UPDATE_MAX_NUM_EVENTS,
|
|
13
|
+
VALIDATION_AGENT_PROMPT_MAX_CHARS,
|
|
14
|
+
VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS
|
|
15
|
+
} = schemaValidationDefaults;
|
|
8
16
|
var TenantParamsSchema = z.object({
|
|
9
17
|
tenantId: z.string()
|
|
10
18
|
});
|
|
@@ -136,14 +144,14 @@ var FullAgentDefinitionSchema = AgentAgentApiInsertSchema.extend({
|
|
|
136
144
|
}).optional()
|
|
137
145
|
}).optional(),
|
|
138
146
|
stopWhen: z.object({
|
|
139
|
-
transferCountIs: z.number().min(
|
|
147
|
+
transferCountIs: z.number().min(AGENT_EXECUTION_TRANSFER_COUNT_MIN).max(AGENT_EXECUTION_TRANSFER_COUNT_MAX).optional()
|
|
140
148
|
}).optional(),
|
|
141
|
-
prompt: z.string().max(
|
|
149
|
+
prompt: z.string().max(VALIDATION_AGENT_PROMPT_MAX_CHARS).optional(),
|
|
142
150
|
statusUpdates: z.object({
|
|
143
151
|
enabled: z.boolean().optional(),
|
|
144
|
-
numEvents: z.number().min(1).max(
|
|
145
|
-
timeInSeconds: z.number().min(1).max(
|
|
146
|
-
prompt: z.string().max(
|
|
152
|
+
numEvents: z.number().min(1).max(STATUS_UPDATE_MAX_NUM_EVENTS).optional(),
|
|
153
|
+
timeInSeconds: z.number().min(1).max(STATUS_UPDATE_MAX_INTERVAL_SECONDS).optional(),
|
|
154
|
+
prompt: z.string().max(VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS).optional(),
|
|
147
155
|
statusComponents: z.array(
|
|
148
156
|
z.object({
|
|
149
157
|
type: z.string(),
|