@inkeep/agents-core 0.0.0-dev-20260206223853 → 0.0.0-dev-20260207223415

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 (34) hide show
  1. package/dist/auth/auth-schema.d.ts +83 -83
  2. package/dist/auth/auth.d.ts +53 -53
  3. package/dist/auth/authz/config.d.ts +5 -1
  4. package/dist/auth/authz/config.js +8 -3
  5. package/dist/auth/init.js +11 -1
  6. package/dist/auth/permissions.d.ts +13 -13
  7. package/dist/auth/spicedb-schema.d.ts +9 -0
  8. package/dist/auth/spicedb-schema.js +24 -0
  9. package/dist/client-exports.d.ts +4 -192
  10. package/dist/client-exports.js +2 -97
  11. package/dist/data-access/manage/agents.d.ts +10 -10
  12. package/dist/data-access/manage/artifactComponents.d.ts +4 -4
  13. package/dist/data-access/manage/functionTools.d.ts +8 -8
  14. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +12 -12
  15. package/dist/data-access/manage/subAgentRelations.d.ts +4 -4
  16. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +6 -6
  17. package/dist/data-access/manage/subAgents.d.ts +6 -6
  18. package/dist/data-access/manage/tools.d.ts +15 -15
  19. package/dist/data-access/manage/tools.js +1 -1
  20. package/dist/data-access/manage/triggers.d.ts +2 -2
  21. package/dist/data-access/runtime/apiKeys.d.ts +4 -4
  22. package/dist/data-access/runtime/conversations.d.ts +11 -11
  23. package/dist/data-access/runtime/tasks.d.ts +2 -2
  24. package/dist/db/manage/manage-schema.d.ts +4 -4
  25. package/dist/db/runtime/runtime-schema.d.ts +6 -6
  26. package/dist/index.d.ts +2 -2
  27. package/dist/index.js +5 -5
  28. package/dist/types/index.js +1 -1
  29. package/dist/validation/dolt-schemas.d.ts +1 -1
  30. package/dist/validation/index.d.ts +2 -2
  31. package/dist/validation/index.js +2 -2
  32. package/dist/validation/schemas.d.ts +1400 -1399
  33. package/dist/validation/schemas.js +3 -2
  34. package/package.json +5 -2
@@ -6,197 +6,21 @@ import { ConversationHistoryConfig, CredentialStoreType, MCPTransportType } from
6
6
  import "./types/index.js";
7
7
  import { DEFAULT_NANGO_STORE_ID } from "./credential-stores/default-constants.js";
8
8
  import { detectAuthenticationRequired } from "./utils/auth-detection.js";
9
- import { validatePropsAsJsonSchema } from "./validation/props-validation.js";
10
- import { AgentStopWhen, AgentStopWhenSchema, ApiKeyApiUpdateSchema, FullAgentAgentInsertSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, ModelSettings, ModelSettingsSchema, ResourceIdSchema, SignatureSource, SignatureVerificationConfig, SignatureVerificationConfigSchema, SignedComponent, StopWhen, StopWhenSchema, SubAgentStopWhen, SubAgentStopWhenSchema, TriggerApiInsertSchema, TriggerApiSelectSchema, TriggerApiUpdateSchema, TriggerInvocationApiSelectSchema, TriggerInvocationListResponse, TriggerInvocationResponse, TriggerInvocationStatusEnum, TriggerListResponse, TriggerResponse, TriggerWithWebhookUrlListResponse, TriggerWithWebhookUrlResponse, TriggerWithWebhookUrlSchema } from "./validation/schemas.js";
9
+ import { AgentApiInsertSchema, AgentStopWhen, AgentWithinContextOfProjectResponse, AgentWithinContextOfProjectSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiSelectSchema, CredentialReferenceApiInsertSchema, ExternalAgentApiInsertSchema, FullAgentAgentInsertSchema, FunctionApiInsertSchema, HeadersSchema, ModelSettings, StopWhen, ToolApiInsertSchema, TriggerApiSelectSchema, TriggerInvocationApiSelectSchema } from "./validation/schemas.js";
11
10
  import { z } from "@hono/zod-openapi";
12
- import { convertJsonSchemaToZod } from "zod-from-json-schema";
13
11
 
14
12
  //#region src/client-exports.d.ts
15
-
16
- declare const TenantParamsSchema: z.ZodObject<{
17
- tenantId: z.ZodString;
18
- }, z.core.$strip>;
19
- declare const TenantProjectParamsSchema: z.ZodObject<{
20
- tenantId: z.ZodString;
21
- projectId: z.ZodString;
22
- }, z.core.$strip>;
23
- declare const TenantProjectIdParamsSchema: z.ZodObject<{
24
- tenantId: z.ZodString;
25
- projectId: z.ZodString;
26
- id: z.ZodString;
27
- }, z.core.$strip>;
28
- declare const IdParamsSchema: z.ZodObject<{
29
- id: z.ZodString;
30
- }, z.core.$strip>;
31
- declare const PaginationSchema: z.ZodObject<{
32
- page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
33
- limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
34
- total: z.ZodNumber;
35
- pages: z.ZodNumber;
36
- }, z.core.$strip>;
37
- declare const ListResponseSchema: <T extends z.ZodTypeAny>(itemSchema: T) => z.ZodObject<{
38
- data: z.ZodArray<T>;
39
- pagination: z.ZodObject<{
40
- page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
41
- limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
42
- total: z.ZodNumber;
43
- pages: z.ZodNumber;
44
- }, z.core.$strip>;
45
- }, z.core.$strip>;
46
- declare const SingleResponseSchema: <T extends z.ZodTypeAny>(itemSchema: T) => z.ZodObject<{
47
- data: T;
48
- }, z.core.$strip>;
49
- declare const ErrorResponseSchema: z.ZodObject<{
50
- error: z.ZodString;
51
- message: z.ZodOptional<z.ZodString>;
52
- details: z.ZodOptional<z.ZodUnknown>;
53
- }, z.core.$strip>;
54
- declare const AgentApiInsertSchema: z.ZodObject<{
55
- id: z.ZodOptional<z.ZodString>;
56
- name: z.ZodString;
57
- description: z.ZodOptional<z.ZodString>;
58
- prompt: z.ZodOptional<z.ZodString>;
59
- model: z.ZodOptional<z.ZodObject<{
60
- model: z.ZodOptional<z.ZodString>;
61
- providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
62
- }, z.core.$strip>>;
63
- tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
64
- dataComponents: z.ZodOptional<z.ZodArray<z.ZodString>>;
65
- artifactComponents: z.ZodOptional<z.ZodArray<z.ZodString>>;
66
- canTransferTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
67
- canDelegateTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
68
- type: z.ZodOptional<z.ZodEnum<{
69
- external: "external";
70
- internal: "internal";
71
- }>>;
72
- }, z.core.$strip>;
73
- declare const ToolApiInsertSchema: z.ZodObject<{
74
- id: z.ZodOptional<z.ZodString>;
75
- name: z.ZodString;
76
- description: z.ZodOptional<z.ZodString>;
77
- type: z.ZodEnum<{
78
- mcp: "mcp";
79
- hosted: "hosted";
80
- }>;
81
- config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
82
- credentialReferenceId: z.ZodOptional<z.ZodString>;
83
- }, z.core.$strip>;
84
- declare const ApiKeyApiSelectSchema: z.ZodObject<{
85
- id: z.ZodString;
86
- tenantId: z.ZodString;
87
- projectId: z.ZodString;
88
- agentId: z.ZodString;
89
- publicId: z.ZodString;
90
- keyHash: z.ZodString;
91
- keyPrefix: z.ZodString;
92
- name: z.ZodOptional<z.ZodString>;
93
- lastUsedAt: z.ZodOptional<z.ZodString>;
94
- expiresAt: z.ZodOptional<z.ZodString>;
95
- createdAt: z.ZodString;
96
- updatedAt: z.ZodString;
97
- }, z.core.$strip>;
98
- declare const ApiKeyApiCreationResponseSchema: z.ZodObject<{
99
- data: z.ZodObject<{
100
- apiKey: z.ZodObject<{
101
- id: z.ZodString;
102
- tenantId: z.ZodString;
103
- projectId: z.ZodString;
104
- agentId: z.ZodString;
105
- publicId: z.ZodString;
106
- keyHash: z.ZodString;
107
- keyPrefix: z.ZodString;
108
- name: z.ZodOptional<z.ZodString>;
109
- lastUsedAt: z.ZodOptional<z.ZodString>;
110
- expiresAt: z.ZodOptional<z.ZodString>;
111
- createdAt: z.ZodString;
112
- updatedAt: z.ZodString;
113
- }, z.core.$strip>;
114
- key: z.ZodString;
115
- }, z.core.$strip>;
116
- }, z.core.$strip>;
117
- declare const CredentialReferenceApiInsertSchema: z.ZodObject<{
118
- id: z.ZodString;
119
- tenantId: z.ZodOptional<z.ZodString>;
120
- projectId: z.ZodOptional<z.ZodString>;
121
- name: z.ZodString;
122
- type: z.ZodEnum<{
123
- readonly memory: "memory";
124
- readonly keychain: "keychain";
125
- readonly nango: "nango";
126
- }>;
127
- credentialStoreId: z.ZodString;
128
- retrievalParams: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
129
- createdAt: z.ZodOptional<z.ZodString>;
130
- updatedAt: z.ZodOptional<z.ZodString>;
131
- userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
132
- toolId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
133
- createdBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
134
- }, z.core.$strip>;
135
- declare const DataComponentApiInsertSchema: z.ZodObject<{
136
- id: z.ZodString;
137
- name: z.ZodString;
138
- description: z.ZodOptional<z.ZodString>;
139
- props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
140
- render: z.ZodOptional<z.ZodNullable<z.ZodObject<{
141
- component: z.ZodString;
142
- mockData: z.ZodRecord<z.ZodString, z.ZodUnknown>;
143
- }, z.core.$strip>>>;
144
- }, z.core.$strip>;
145
- declare const ArtifactComponentApiInsertSchema: z.ZodObject<{
146
- id: z.ZodString;
147
- name: z.ZodString;
148
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
149
- props: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
150
- render: z.ZodOptional<z.ZodNullable<z.ZodType<{
151
- component: string;
152
- mockData: Record<string, unknown>;
153
- }, {
154
- component: string;
155
- mockData: Record<string, unknown>;
156
- }, z.core.$ZodTypeInternals<{
157
- component: string;
158
- mockData: Record<string, unknown>;
159
- }, {
160
- component: string;
161
- mockData: Record<string, unknown>;
162
- }>>>>;
163
- }, {
164
- out: {};
165
- in: {};
166
- }>;
167
- declare const ContextConfigApiInsertSchema: z.ZodObject<{
168
- id: z.ZodOptional<z.ZodString>;
169
- name: z.ZodOptional<z.ZodString>;
170
- description: z.ZodOptional<z.ZodString>;
171
- type: z.ZodOptional<z.ZodString>;
172
- config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
173
- }, z.core.$strip>;
174
- declare const ExternalAgentApiInsertSchema: z.ZodObject<{
175
- id: z.ZodOptional<z.ZodString>;
176
- name: z.ZodString;
177
- description: z.ZodOptional<z.ZodString>;
178
- baseUrl: z.ZodString;
179
- headers: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
180
- credentialReferenceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
181
- type: z.ZodOptional<z.ZodLiteral<"external">>;
182
- }, z.core.$strip>;
183
- declare const AgentAgentApiInsertSchema: z.ZodObject<{
184
- id: z.ZodOptional<z.ZodString>;
185
- name: z.ZodString;
186
- description: z.ZodOptional<z.ZodString>;
187
- defaultSubAgentId: z.ZodOptional<z.ZodString>;
188
- }, z.core.$strip>;
189
13
  declare const FullAgentDefinitionSchema: z.ZodObject<{
190
14
  id: z.ZodOptional<z.ZodString>;
191
15
  name: z.ZodString;
192
16
  description: z.ZodOptional<z.ZodString>;
193
17
  defaultSubAgentId: z.ZodOptional<z.ZodString>;
194
18
  subAgents: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
195
- id: z.ZodString;
196
19
  name: z.ZodString;
20
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21
+ id: z.ZodString;
197
22
  createdAt: z.ZodOptional<z.ZodString>;
198
23
  updatedAt: z.ZodOptional<z.ZodString>;
199
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
200
24
  models: z.ZodOptional<z.ZodObject<{
201
25
  base: z.ZodOptional<z.ZodObject<{
202
26
  model: z.ZodOptional<z.ZodString>;
@@ -289,26 +113,14 @@ declare const FullAgentDefinitionSchema: z.ZodObject<{
289
113
  type AgentApiInsert = z.infer<typeof AgentApiInsertSchema>;
290
114
  type ToolApiInsert = z.infer<typeof ToolApiInsertSchema>;
291
115
  type FunctionApiInsert = z.infer<typeof FunctionApiInsertSchema>;
292
- type TriggerApiInsert = z.infer<typeof TriggerApiInsertSchema>;
293
116
  type TriggerApiSelect = z.infer<typeof TriggerApiSelectSchema>;
294
- type TriggerApiUpdate = z.infer<typeof TriggerApiUpdateSchema>;
295
117
  type TriggerInvocationApiSelect = z.infer<typeof TriggerInvocationApiSelectSchema>;
296
118
  type ApiKeyApiSelect = z.infer<typeof ApiKeyApiSelectSchema>;
297
119
  type ApiKeyApiCreationResponse = z.infer<typeof ApiKeyApiCreationResponseSchema>;
298
- type ApiKeyApiUpdateResponse = z.infer<typeof ApiKeyApiUpdateSchema>;
299
120
  type CredentialReferenceApiInsert = z.infer<typeof CredentialReferenceApiInsertSchema>;
300
- type DataComponentApiInsert = z.infer<typeof DataComponentApiInsertSchema>;
301
- type ArtifactComponentApiInsert = z.infer<typeof ArtifactComponentApiInsertSchema>;
302
- type ContextConfigApiInsert = z.infer<typeof ContextConfigApiInsertSchema>;
303
121
  type ExternalAgentApiInsert = z.infer<typeof ExternalAgentApiInsertSchema>;
304
- type AgentAgentApiInsert = z.infer<typeof AgentAgentApiInsertSchema>;
305
122
  type FullAgentDefinition = z.infer<typeof FullAgentDefinitionSchema>;
306
123
  type InternalAgentDefinition = z.infer<typeof FullAgentAgentInsertSchema>;
307
- type ExternalAgentDefinition = z.infer<typeof ExternalAgentApiInsertSchema>;
308
- type TenantParams = z.infer<typeof TenantParamsSchema>;
309
- type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
310
124
  declare function generateIdFromName(name: string): string;
311
- type ToolInsert = ToolApiInsert;
312
- type AgentAgentInsert = AgentAgentApiInsert;
313
125
  //#endregion
314
- export { ACTIVITY_NAMES, ACTIVITY_STATUS, ACTIVITY_TYPES, AGENT_IDS, AGGREGATE_OPERATORS, AI_OPERATIONS, AI_TOOL_TYPES, AgentAgentApiInsert, AgentAgentApiInsertSchema, AgentAgentInsert, AgentApiInsert, AgentApiInsertSchema, type AgentStopWhen, AgentStopWhenSchema, ApiKeyApiCreationResponse, ApiKeyApiCreationResponseSchema, ApiKeyApiSelect, ApiKeyApiSelectSchema, ApiKeyApiUpdateResponse, ArtifactComponentApiInsert, ArtifactComponentApiInsertSchema, BreakdownComponentDef, CONTEXT_BREAKDOWN_TOTAL_SPAN_ATTRIBUTE, ContextBreakdown, ContextConfigApiInsert, ContextConfigApiInsertSchema, CredentialReferenceApiInsert, CredentialReferenceApiInsertSchema, CredentialStoreType, DATA_SOURCES, DATA_TYPES, DEFAULT_NANGO_STORE_ID, DELEGATION_FROM_SUB_AGENT_ID, DELEGATION_ID, DELEGATION_TO_SUB_AGENT_ID, DataComponentApiInsert, DataComponentApiInsertSchema, ErrorResponse, ErrorResponseSchema, ExternalAgentApiInsert, ExternalAgentApiInsertSchema, ExternalAgentDefinition, FIELD_TYPES, FullAgentDefinition, FullAgentDefinitionSchema, FunctionApiInsert, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, IdParamsSchema, InternalAgentDefinition, ListResponseSchema, MCPTransportType, type ModelSettings, ModelSettingsSchema, OPERATORS, ORDER_DIRECTIONS, type OrgRole, OrgRoles, PANEL_TYPES, PaginationSchema, type ProjectRole, ProjectRoles, QUERY_DEFAULTS, QUERY_EXPRESSIONS, QUERY_FIELD_CONFIGS, QUERY_TYPES, REDUCE_OPERATIONS, ResourceIdSchema, SPAN_KEYS, SPAN_NAMES, type SignatureSource, type SignatureVerificationConfig, SignatureVerificationConfigSchema, type SignedComponent, SingleResponseSchema, type StopWhen, StopWhenSchema, type SubAgentStopWhen, SubAgentStopWhenSchema, TRANSFER_FROM_SUB_AGENT_ID, TRANSFER_TO_SUB_AGENT_ID, TenantParams, TenantParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsert, ToolApiInsertSchema, ToolInsert, TriggerApiInsert, TriggerApiInsertSchema, TriggerApiSelect, TriggerApiSelectSchema, TriggerApiUpdate, TriggerApiUpdateSchema, TriggerInvocationApiSelect, TriggerInvocationApiSelectSchema, TriggerInvocationListResponse, TriggerInvocationResponse, TriggerInvocationStatusEnum, TriggerListResponse, TriggerResponse, TriggerWithWebhookUrlListResponse, TriggerWithWebhookUrlResponse, TriggerWithWebhookUrlSchema, UNKNOWN_VALUE, V1_BREAKDOWN_SCHEMA, calculateBreakdownTotal, convertJsonSchemaToZod, createEmptyBreakdown, detectAuthenticationRequired, generateIdFromName, parseContextBreakdownFromSpan, validatePropsAsJsonSchema };
126
+ export { ACTIVITY_NAMES, ACTIVITY_STATUS, ACTIVITY_TYPES, AGENT_IDS, AGGREGATE_OPERATORS, AI_OPERATIONS, AI_TOOL_TYPES, AgentApiInsert, type AgentStopWhen, AgentWithinContextOfProjectResponse, AgentWithinContextOfProjectSchema, ApiKeyApiCreationResponse, ApiKeyApiSelect, BreakdownComponentDef, CONTEXT_BREAKDOWN_TOTAL_SPAN_ATTRIBUTE, ContextBreakdown, CredentialReferenceApiInsert, CredentialStoreType, DATA_SOURCES, DATA_TYPES, DEFAULT_NANGO_STORE_ID, DELEGATION_FROM_SUB_AGENT_ID, DELEGATION_ID, DELEGATION_TO_SUB_AGENT_ID, ExternalAgentApiInsert, FIELD_TYPES, FullAgentDefinition, FullAgentDefinitionSchema, FunctionApiInsert, HeadersSchema, InternalAgentDefinition, MCPTransportType, type ModelSettings, OPERATORS, ORDER_DIRECTIONS, type OrgRole, OrgRoles, PANEL_TYPES, type ProjectRole, ProjectRoles, QUERY_DEFAULTS, QUERY_EXPRESSIONS, QUERY_FIELD_CONFIGS, QUERY_TYPES, REDUCE_OPERATIONS, SPAN_KEYS, SPAN_NAMES, type StopWhen, TRANSFER_FROM_SUB_AGENT_ID, TRANSFER_TO_SUB_AGENT_ID, ToolApiInsert, TriggerApiSelect, TriggerInvocationApiSelect, UNKNOWN_VALUE, V1_BREAKDOWN_SCHEMA, calculateBreakdownTotal, createEmptyBreakdown, detectAuthenticationRequired, generateIdFromName, parseContextBreakdownFromSpan };
@@ -1,7 +1,6 @@
1
1
  import { schemaValidationDefaults } from "./constants/schema-validation/defaults.js";
2
2
  import { CredentialStoreType, MCPTransportType } from "./types/utility.js";
3
- import { validatePropsAsJsonSchema } from "./validation/props-validation.js";
4
- import { AgentStopWhenSchema, ArtifactComponentApiInsertSchema as ArtifactComponentApiInsertSchema$1, FullAgentAgentInsertSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, MAX_ID_LENGTH, ModelSettingsSchema, ResourceIdSchema, SignatureVerificationConfigSchema, StopWhenSchema, SubAgentStopWhenSchema, TriggerApiInsertSchema, TriggerApiSelectSchema, TriggerApiUpdateSchema, TriggerInvocationApiSelectSchema, TriggerInvocationListResponse, TriggerInvocationResponse, TriggerInvocationStatusEnum, TriggerListResponse, TriggerResponse, TriggerWithWebhookUrlListResponse, TriggerWithWebhookUrlResponse, TriggerWithWebhookUrlSchema } from "./validation/schemas.js";
3
+ import { AgentWithinContextOfProjectResponse, AgentWithinContextOfProjectSchema, FullAgentAgentInsertSchema, HeadersSchema, MAX_ID_LENGTH } from "./validation/schemas.js";
5
4
  import { DEFAULT_NANGO_STORE_ID } from "./credential-stores/default-constants.js";
6
5
  import { OrgRoles, ProjectRoles } from "./auth/authz/config.js";
7
6
  import { CONTEXT_BREAKDOWN_TOTAL_SPAN_ATTRIBUTE, V1_BREAKDOWN_SCHEMA, calculateBreakdownTotal, createEmptyBreakdown, parseContextBreakdownFromSpan } from "./constants/context-breakdown.js";
@@ -9,7 +8,6 @@ import { ACTIVITY_NAMES, ACTIVITY_STATUS, ACTIVITY_TYPES, AGENT_IDS, AI_OPERATIO
9
8
  import { AGGREGATE_OPERATORS, DATA_SOURCES, DATA_TYPES, FIELD_TYPES, OPERATORS, ORDER_DIRECTIONS, PANEL_TYPES, QUERY_DEFAULTS, QUERY_EXPRESSIONS, QUERY_FIELD_CONFIGS, QUERY_TYPES, REDUCE_OPERATIONS } from "./constants/signoz-queries.js";
10
9
  import { detectAuthenticationRequired } from "./utils/auth-detection.js";
11
10
  import { z } from "@hono/zod-openapi";
12
- import { convertJsonSchemaToZod } from "zod-from-json-schema";
13
11
 
14
12
  //#region src/client-exports.ts
15
13
  /**
@@ -20,90 +18,6 @@ import { convertJsonSchemaToZod } from "zod-from-json-schema";
20
18
  * server-side database dependencies.
21
19
  */
22
20
  const { AGENT_EXECUTION_TRANSFER_COUNT_MAX, AGENT_EXECUTION_TRANSFER_COUNT_MIN, STATUS_UPDATE_MAX_INTERVAL_SECONDS, STATUS_UPDATE_MAX_NUM_EVENTS, VALIDATION_AGENT_PROMPT_MAX_CHARS, VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS } = schemaValidationDefaults;
23
- const TenantParamsSchema = z.object({ tenantId: z.string() });
24
- const TenantProjectParamsSchema = TenantParamsSchema.extend({ projectId: z.string() });
25
- const TenantProjectIdParamsSchema = TenantProjectParamsSchema.extend({ id: z.string() });
26
- const IdParamsSchema = z.object({ id: z.string() });
27
- const PaginationSchema = z.object({
28
- page: z.coerce.number().min(1).default(1),
29
- limit: z.coerce.number().min(1).max(100).default(10),
30
- total: z.number(),
31
- pages: z.number()
32
- });
33
- const ListResponseSchema = (itemSchema) => z.object({
34
- data: z.array(itemSchema),
35
- pagination: PaginationSchema
36
- });
37
- const SingleResponseSchema = (itemSchema) => z.object({ data: itemSchema });
38
- const ErrorResponseSchema = z.object({
39
- error: z.string(),
40
- message: z.string().optional(),
41
- details: z.unknown().optional()
42
- });
43
- const AgentApiInsertSchema = z.object({
44
- id: z.string().optional(),
45
- name: z.string(),
46
- description: z.string().optional(),
47
- prompt: z.string().optional(),
48
- model: ModelSettingsSchema.optional(),
49
- tools: z.array(z.string()).optional(),
50
- dataComponents: z.array(z.string()).optional(),
51
- artifactComponents: z.array(z.string()).optional(),
52
- canTransferTo: z.array(z.string()).optional(),
53
- canDelegateTo: z.array(z.string()).optional(),
54
- type: z.enum(["internal", "external"]).optional()
55
- });
56
- const ToolApiInsertSchema = z.object({
57
- id: z.string().optional(),
58
- name: z.string(),
59
- description: z.string().optional(),
60
- type: z.enum(["mcp", "hosted"]),
61
- config: z.record(z.string(), z.unknown()),
62
- credentialReferenceId: z.string().optional()
63
- });
64
- const ApiKeyApiSelectSchema = z.object({
65
- id: z.string(),
66
- tenantId: z.string(),
67
- projectId: z.string(),
68
- agentId: z.string(),
69
- publicId: z.string(),
70
- keyHash: z.string(),
71
- keyPrefix: z.string(),
72
- name: z.string().optional(),
73
- lastUsedAt: z.string().optional(),
74
- expiresAt: z.string().optional(),
75
- createdAt: z.string(),
76
- updatedAt: z.string()
77
- });
78
- const ApiKeyApiCreationResponseSchema = z.object({ data: z.object({
79
- apiKey: ApiKeyApiSelectSchema,
80
- key: z.string()
81
- }) });
82
- const CredentialReferenceApiInsertSchema = z.object({
83
- id: z.string(),
84
- tenantId: z.string().optional(),
85
- projectId: z.string().optional(),
86
- name: z.string(),
87
- type: z.enum(CredentialStoreType),
88
- credentialStoreId: z.string(),
89
- retrievalParams: z.record(z.string(), z.unknown()).nullish(),
90
- createdAt: z.string().optional(),
91
- updatedAt: z.string().optional(),
92
- userId: z.string().nullish(),
93
- toolId: z.string().nullish(),
94
- createdBy: z.string().nullish()
95
- });
96
- const DataComponentApiInsertSchema = z.object({
97
- id: z.string(),
98
- name: z.string(),
99
- description: z.string().optional(),
100
- props: z.record(z.string(), z.unknown()),
101
- render: z.object({
102
- component: z.string(),
103
- mockData: z.record(z.string(), z.unknown())
104
- }).nullable().optional()
105
- });
106
- const ArtifactComponentApiInsertSchema = ArtifactComponentApiInsertSchema$1;
107
21
  const ContextConfigApiInsertSchema = z.object({
108
22
  id: z.string().optional(),
109
23
  name: z.string().optional(),
@@ -111,15 +25,6 @@ const ContextConfigApiInsertSchema = z.object({
111
25
  type: z.string().optional(),
112
26
  config: z.record(z.string(), z.unknown()).optional()
113
27
  });
114
- const ExternalAgentApiInsertSchema = z.object({
115
- id: z.string().optional(),
116
- name: z.string(),
117
- description: z.string().optional(),
118
- baseUrl: z.string(),
119
- headers: z.record(z.string(), z.string()).nullable().optional(),
120
- credentialReferenceId: z.string().nullable().optional(),
121
- type: z.literal("external").optional()
122
- });
123
28
  const AgentAgentApiInsertSchema = z.object({
124
29
  id: z.string().optional(),
125
30
  name: z.string(),
@@ -166,4 +71,4 @@ function generateIdFromName(name) {
166
71
  }
167
72
 
168
73
  //#endregion
169
- export { ACTIVITY_NAMES, ACTIVITY_STATUS, ACTIVITY_TYPES, AGENT_IDS, AGGREGATE_OPERATORS, AI_OPERATIONS, AI_TOOL_TYPES, AgentAgentApiInsertSchema, AgentApiInsertSchema, AgentStopWhenSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiSelectSchema, ArtifactComponentApiInsertSchema, CONTEXT_BREAKDOWN_TOTAL_SPAN_ATTRIBUTE, ContextConfigApiInsertSchema, CredentialReferenceApiInsertSchema, CredentialStoreType, DATA_SOURCES, DATA_TYPES, DEFAULT_NANGO_STORE_ID, DELEGATION_FROM_SUB_AGENT_ID, DELEGATION_ID, DELEGATION_TO_SUB_AGENT_ID, DataComponentApiInsertSchema, ErrorResponseSchema, ExternalAgentApiInsertSchema, FIELD_TYPES, FullAgentDefinitionSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, IdParamsSchema, ListResponseSchema, MCPTransportType, ModelSettingsSchema, OPERATORS, ORDER_DIRECTIONS, OrgRoles, PANEL_TYPES, PaginationSchema, ProjectRoles, QUERY_DEFAULTS, QUERY_EXPRESSIONS, QUERY_FIELD_CONFIGS, QUERY_TYPES, REDUCE_OPERATIONS, ResourceIdSchema, SPAN_KEYS, SPAN_NAMES, SignatureVerificationConfigSchema, SingleResponseSchema, StopWhenSchema, SubAgentStopWhenSchema, TRANSFER_FROM_SUB_AGENT_ID, TRANSFER_TO_SUB_AGENT_ID, TenantParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, TriggerApiInsertSchema, TriggerApiSelectSchema, TriggerApiUpdateSchema, TriggerInvocationApiSelectSchema, TriggerInvocationListResponse, TriggerInvocationResponse, TriggerInvocationStatusEnum, TriggerListResponse, TriggerResponse, TriggerWithWebhookUrlListResponse, TriggerWithWebhookUrlResponse, TriggerWithWebhookUrlSchema, UNKNOWN_VALUE, V1_BREAKDOWN_SCHEMA, calculateBreakdownTotal, convertJsonSchemaToZod, createEmptyBreakdown, detectAuthenticationRequired, generateIdFromName, parseContextBreakdownFromSpan, validatePropsAsJsonSchema };
74
+ export { ACTIVITY_NAMES, ACTIVITY_STATUS, ACTIVITY_TYPES, AGENT_IDS, AGGREGATE_OPERATORS, AI_OPERATIONS, AI_TOOL_TYPES, AgentWithinContextOfProjectResponse, AgentWithinContextOfProjectSchema, CONTEXT_BREAKDOWN_TOTAL_SPAN_ATTRIBUTE, CredentialStoreType, DATA_SOURCES, DATA_TYPES, DEFAULT_NANGO_STORE_ID, DELEGATION_FROM_SUB_AGENT_ID, DELEGATION_ID, DELEGATION_TO_SUB_AGENT_ID, FIELD_TYPES, FullAgentDefinitionSchema, HeadersSchema, MCPTransportType, OPERATORS, ORDER_DIRECTIONS, OrgRoles, PANEL_TYPES, ProjectRoles, 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, V1_BREAKDOWN_SCHEMA, calculateBreakdownTotal, createEmptyBreakdown, detectAuthenticationRequired, generateIdFromName, parseContextBreakdownFromSpan };
@@ -8,11 +8,11 @@ import { PgTable } from "drizzle-orm/pg-core";
8
8
  declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
9
9
  scopes: AgentScopeConfig;
10
10
  }) => Promise<{
11
- id: string;
12
11
  name: string;
12
+ description: string | null;
13
+ id: string;
13
14
  createdAt: string;
14
15
  updatedAt: string;
15
- description: string | null;
16
16
  projectId: string;
17
17
  tenantId: string;
18
18
  defaultSubAgentId: string | null;
@@ -54,11 +54,11 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
54
54
  declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (params: {
55
55
  scopes: AgentScopeConfig;
56
56
  }) => Promise<{
57
- id: string;
58
57
  name: string;
58
+ description: string | null;
59
+ id: string;
59
60
  createdAt: string;
60
61
  updatedAt: string;
61
- description: string | null;
62
62
  projectId: string;
63
63
  tenantId: string;
64
64
  defaultSubAgentId: string | null;
@@ -97,11 +97,11 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
97
97
  transferCountIs?: number | undefined;
98
98
  } | null;
99
99
  defaultSubAgent: {
100
- id: string;
101
100
  name: string;
101
+ description: string | null;
102
+ id: string;
102
103
  createdAt: string;
103
104
  updatedAt: string;
104
- description: string | null;
105
105
  agentId: string;
106
106
  projectId: string;
107
107
  tenantId: string;
@@ -129,11 +129,11 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
129
129
  declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
130
130
  scopes: ProjectScopeConfig;
131
131
  }) => Promise<{
132
- id: string;
133
132
  name: string;
133
+ description: string | null;
134
+ id: string;
134
135
  createdAt: string;
135
136
  updatedAt: string;
136
- description: string | null;
137
137
  projectId: string;
138
138
  tenantId: string;
139
139
  defaultSubAgentId: string | null;
@@ -245,11 +245,11 @@ declare function listAgentsAcrossProjectMainBranches(db: AgentsManageDatabaseCli
245
245
  projectIds: string[];
246
246
  }): Promise<AvailableAgentInfo[]>;
247
247
  declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInsert) => Promise<{
248
- id: string;
249
248
  name: string;
249
+ description: string | null;
250
+ id: string;
250
251
  createdAt: string;
251
252
  updatedAt: string;
252
- description: string | null;
253
253
  projectId: string;
254
254
  tenantId: string;
255
255
  defaultSubAgentId: string | null;
@@ -7,11 +7,11 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
7
7
  scopes: ProjectScopeConfig;
8
8
  id: string;
9
9
  }) => Promise<{
10
- id: string;
11
10
  name: string;
11
+ description: string | null;
12
+ id: string;
12
13
  createdAt: string;
13
14
  updatedAt: string;
14
- description: string | null;
15
15
  projectId: string;
16
16
  tenantId: string;
17
17
  props: Record<string, unknown> | null;
@@ -49,11 +49,11 @@ declare const listArtifactComponentsPaginated: (db: AgentsManageDatabaseClient)
49
49
  };
50
50
  }>;
51
51
  declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
52
- id: string;
53
52
  name: string;
53
+ description: string | null;
54
+ id: string;
54
55
  createdAt: string;
55
56
  updatedAt: string;
56
- description: string | null;
57
57
  projectId: string;
58
58
  tenantId: string;
59
59
  props: Record<string, unknown> | null;
@@ -53,11 +53,11 @@ declare const createFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
53
53
  data: FunctionToolApiInsert;
54
54
  scopes: AgentScopeConfig;
55
55
  }) => Promise<{
56
- id: string;
57
56
  name: string;
57
+ description: string | null;
58
+ id: string;
58
59
  createdAt: string;
59
60
  updatedAt: string;
60
- description: string | null;
61
61
  agentId: string;
62
62
  projectId: string;
63
63
  tenantId: string;
@@ -95,11 +95,11 @@ declare const upsertFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
95
95
  data: FunctionToolApiInsert;
96
96
  scopes: AgentScopeConfig;
97
97
  }) => Promise<{
98
- id: string;
99
98
  name: string;
99
+ description: string | null;
100
+ id: string;
100
101
  createdAt: string;
101
102
  updatedAt: string;
102
- description: string | null;
103
103
  agentId: string;
104
104
  projectId: string;
105
105
  tenantId: string;
@@ -167,11 +167,11 @@ declare const addFunctionToolToSubAgent: (db: AgentsManageDatabaseClient) => (pa
167
167
  agentId: string;
168
168
  projectId: string;
169
169
  tenantId: string;
170
+ subAgentId: string;
171
+ functionToolId: string;
170
172
  toolPolicies: Record<string, {
171
173
  needsApproval?: boolean;
172
174
  }> | null;
173
- subAgentId: string;
174
- functionToolId: string;
175
175
  }>;
176
176
  /**
177
177
  * Update an agent-function tool relation
@@ -232,11 +232,11 @@ declare const associateFunctionToolWithSubAgent: (db: AgentsManageDatabaseClient
232
232
  agentId: string;
233
233
  projectId: string;
234
234
  tenantId: string;
235
+ subAgentId: string;
236
+ functionToolId: string;
235
237
  toolPolicies: Record<string, {
236
238
  needsApproval?: boolean;
237
239
  }> | null;
238
- subAgentId: string;
239
- functionToolId: string;
240
240
  }>;
241
241
  //#endregion
242
242
  export { addFunctionToolToSubAgent, associateFunctionToolWithSubAgent, createFunctionTool, deleteFunctionTool, getFunctionToolById, getFunctionToolsForSubAgent, getSubAgentsUsingFunctionTool, isFunctionToolAssociatedWithSubAgent, listFunctionTools, removeFunctionToolFromSubAgent, updateFunctionTool, updateSubAgentFunctionToolRelation, upsertFunctionTool, upsertSubAgentFunctionToolRelation };
@@ -11,12 +11,12 @@ declare const getSubAgentExternalAgentRelationById: (db: AgentsManageDatabaseCli
11
11
  id: string;
12
12
  createdAt: string;
13
13
  updatedAt: string;
14
- headers: Record<string, string> | null;
15
14
  agentId: string;
16
15
  projectId: string;
17
16
  tenantId: string;
18
- externalAgentId: string;
19
17
  subAgentId: string;
18
+ headers: Record<string, string> | null;
19
+ externalAgentId: string;
20
20
  } | undefined>;
21
21
  declare const listSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
22
22
  scopes: SubAgentScopeConfig;
@@ -46,12 +46,12 @@ declare const getSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient
46
46
  id: string;
47
47
  createdAt: string;
48
48
  updatedAt: string;
49
- headers: Record<string, string> | null;
50
49
  agentId: string;
51
50
  projectId: string;
52
51
  tenantId: string;
53
- externalAgentId: string;
54
52
  subAgentId: string;
53
+ headers: Record<string, string> | null;
54
+ externalAgentId: string;
55
55
  }[]>;
56
56
  declare const getSubAgentExternalAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
57
57
  scopes: AgentScopeConfig;
@@ -59,12 +59,12 @@ declare const getSubAgentExternalAgentRelationsByAgent: (db: AgentsManageDatabas
59
59
  id: string;
60
60
  createdAt: string;
61
61
  updatedAt: string;
62
- headers: Record<string, string> | null;
63
62
  agentId: string;
64
63
  projectId: string;
65
64
  tenantId: string;
66
- externalAgentId: string;
67
65
  subAgentId: string;
66
+ headers: Record<string, string> | null;
67
+ externalAgentId: string;
68
68
  }[]>;
69
69
  declare const getSubAgentExternalAgentRelationsByExternalAgent: (db: AgentsManageDatabaseClient) => (params: {
70
70
  scopes: AgentScopeConfig;
@@ -182,12 +182,12 @@ declare const createSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
182
182
  id: string;
183
183
  createdAt: string;
184
184
  updatedAt: string;
185
- headers: Record<string, string> | null;
186
185
  agentId: string;
187
186
  projectId: string;
188
187
  tenantId: string;
189
- externalAgentId: string;
190
188
  subAgentId: string;
189
+ headers: Record<string, string> | null;
190
+ externalAgentId: string;
191
191
  }>;
192
192
  /**
193
193
  * Check if sub-agent external agent relation exists by params
@@ -199,12 +199,12 @@ declare const getSubAgentExternalAgentRelationByParams: (db: AgentsManageDatabas
199
199
  id: string;
200
200
  createdAt: string;
201
201
  updatedAt: string;
202
- headers: Record<string, string> | null;
203
202
  agentId: string;
204
203
  projectId: string;
205
204
  tenantId: string;
206
- externalAgentId: string;
207
205
  subAgentId: string;
206
+ headers: Record<string, string> | null;
207
+ externalAgentId: string;
208
208
  } | undefined>;
209
209
  /**
210
210
  * Upsert sub-agent external agent relation (create if it doesn't exist, update if it does)
@@ -220,12 +220,12 @@ declare const upsertSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
220
220
  id: string;
221
221
  createdAt: string;
222
222
  updatedAt: string;
223
- headers: Record<string, string> | null;
224
223
  agentId: string;
225
224
  projectId: string;
226
225
  tenantId: string;
227
- externalAgentId: string;
228
226
  subAgentId: string;
227
+ headers: Record<string, string> | null;
228
+ externalAgentId: string;
229
229
  }>;
230
230
  declare const updateSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClient) => (params: {
231
231
  scopes: SubAgentScopeConfig;
@@ -206,15 +206,15 @@ declare const createAgentToolRelation: (db: AgentsManageDatabaseClient) => (para
206
206
  id: string;
207
207
  createdAt: string;
208
208
  updatedAt: string;
209
- headers: Record<string, string> | null;
210
209
  agentId: string;
211
210
  projectId: string;
212
211
  tenantId: string;
212
+ subAgentId: string;
213
+ headers: Record<string, string> | null;
213
214
  toolId: string;
214
215
  toolPolicies: Record<string, {
215
216
  needsApproval?: boolean;
216
217
  }> | null;
217
- subAgentId: string;
218
218
  selectedTools: string[] | null;
219
219
  }>;
220
220
  declare const updateAgentToolRelation: (db: AgentsManageDatabaseClient) => (params: {
@@ -250,15 +250,15 @@ declare const getAgentToolRelationById: (db: AgentsManageDatabaseClient) => (par
250
250
  id: string;
251
251
  createdAt: string;
252
252
  updatedAt: string;
253
- headers: Record<string, string> | null;
254
253
  agentId: string;
255
254
  projectId: string;
256
255
  tenantId: string;
256
+ subAgentId: string;
257
+ headers: Record<string, string> | null;
257
258
  toolId: string;
258
259
  toolPolicies: Record<string, {
259
260
  needsApproval?: boolean;
260
261
  }> | null;
261
- subAgentId: string;
262
262
  selectedTools: string[] | null;
263
263
  } | undefined>;
264
264
  declare const getAgentToolRelationByAgent: (db: AgentsManageDatabaseClient) => (params: {