@inkeep/agents-core 0.0.0-dev-20251124215857 → 0.0.0-dev-20251124234228

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 (42) hide show
  1. package/dist/auth/auth-validation-schemas.js +17 -17
  2. package/dist/auth/auth.d.ts +3 -3
  3. package/dist/auth/auth.js +4 -3
  4. package/dist/{auth-detection-CGqhPDnj.d.ts → auth-detection-7G0Dxt55.d.ts} +11 -0
  5. package/dist/{chunk-OEHP46F7.js → chunk-6XW4J5LI.js} +67 -63
  6. package/dist/{chunk-KMLLKRUY.js → chunk-ATWIYWOU.js} +5 -4
  7. package/dist/chunk-CMNLBV2A.js +39 -0
  8. package/dist/chunk-CUM6BY2Y.js +320 -0
  9. package/dist/{chunk-AUIQTGXL.js → chunk-K3UNCRSA.js} +359 -68
  10. package/dist/{chunk-SG75RA63.js → chunk-K54FZSDH.js} +1 -1
  11. package/dist/{chunk-FOK3JSQN.js → chunk-MB2ZIPZS.js} +5 -5
  12. package/dist/{chunk-TGESM3JG.js → chunk-MQMMFK2K.js} +14 -3
  13. package/dist/{chunk-ZCEKN54E.js → chunk-N7TIJHWC.js} +315 -313
  14. package/dist/{chunk-4RVJB4KV.js → chunk-NMBNWFIZ.js} +10 -8
  15. package/dist/{chunk-NFYCSHD3.js → chunk-OHZDHXP7.js} +1 -0
  16. package/dist/chunk-OUXC23J7.js +12534 -0
  17. package/dist/{chunk-7GZHUB4J.js → chunk-SSRRHYU4.js} +5 -4
  18. package/dist/{client-CnpNkGsH.d.ts → client-B_3j-V4-.d.ts} +1 -1
  19. package/dist/client-exports.d.ts +6 -3
  20. package/dist/client-exports.js +127 -126
  21. package/dist/constants/schema-validation/index.js +1 -1
  22. package/dist/credential-stores/index.d.ts +3 -3
  23. package/dist/credential-stores/index.js +1 -1
  24. package/dist/db/schema.d.ts +2 -2
  25. package/dist/db/schema.js +1 -1
  26. package/dist/db/test-client.d.ts +3 -3
  27. package/dist/db/test-client.js +1 -1
  28. package/dist/index.d.ts +126 -9
  29. package/dist/index.js +282 -62
  30. package/dist/{schema-Cgkp_geg.d.ts → schema-DKbG39on.d.ts} +24 -1
  31. package/dist/server-BXoUiBMg.d.ts +127 -0
  32. package/dist/types/index.d.ts +33 -113
  33. package/dist/types/index.js +1 -1
  34. package/dist/{utility-C_tTZ7-k.d.ts → utility-Lo5NoRHK.d.ts} +141 -11
  35. package/dist/utils/schema-conversion.js +1 -1
  36. package/dist/validation/index.d.ts +2 -2
  37. package/dist/validation/index.js +2 -2
  38. package/drizzle/{0001_fair_malice.sql → 0001_calm_sheva_callister.sql} +1 -16
  39. package/drizzle/meta/0001_snapshot.json +7 -1
  40. package/drizzle/meta/_journal.json +2 -2
  41. package/package.json +10 -8
  42. package/dist/chunk-H2F72PDA.js +0 -15
@@ -1,6 +1,6 @@
1
1
  import { user, session, account, organization, member, invitation, verification } from '../chunk-NOPEANIU.js';
2
+ import { external_exports } from '../chunk-OUXC23J7.js';
2
3
  import { createSelectSchema, createInsertSchema } from 'drizzle-zod';
3
- import { z } from 'zod';
4
4
 
5
5
  var UserSelectSchema = createSelectSchema(user);
6
6
  var UserInsertSchema = createInsertSchema(user);
@@ -16,24 +16,24 @@ var InvitationSelectSchema = createSelectSchema(invitation);
16
16
  var InvitationInsertSchema = createInsertSchema(invitation);
17
17
  var VerificationSelectSchema = createSelectSchema(verification);
18
18
  var VerificationInsertSchema = createInsertSchema(verification);
19
- var UserOrganizationSchema = z.object({
20
- id: z.string(),
21
- userId: z.string(),
22
- organizationId: z.string(),
23
- role: z.string(),
24
- createdAt: z.union([z.string(), z.date()]).transform((val) => val instanceof Date ? val.toISOString() : val),
25
- organizationName: z.string().nullable(),
26
- organizationSlug: z.string().nullable()
19
+ var UserOrganizationSchema = external_exports.object({
20
+ id: external_exports.string(),
21
+ userId: external_exports.string(),
22
+ organizationId: external_exports.string(),
23
+ role: external_exports.string(),
24
+ createdAt: external_exports.union([external_exports.string(), external_exports.date()]).transform((val) => val instanceof Date ? val.toISOString() : val),
25
+ organizationName: external_exports.string().nullable(),
26
+ organizationSlug: external_exports.string().nullable()
27
27
  });
28
- var UserOrganizationsResponseSchema = z.array(UserOrganizationSchema);
29
- var AddUserToOrganizationRequestSchema = z.object({
30
- organizationId: z.string(),
31
- role: z.string().default("member")
28
+ var UserOrganizationsResponseSchema = external_exports.array(UserOrganizationSchema);
29
+ var AddUserToOrganizationRequestSchema = external_exports.object({
30
+ organizationId: external_exports.string(),
31
+ role: external_exports.string().default("member")
32
32
  });
33
- var AddUserToOrganizationResponseSchema = z.object({
34
- organizationId: z.string(),
35
- role: z.string(),
36
- createdAt: z.string()
33
+ var AddUserToOrganizationResponseSchema = external_exports.object({
34
+ organizationId: external_exports.string(),
35
+ role: external_exports.string(),
36
+ createdAt: external_exports.string()
37
37
  });
38
38
 
39
39
  export { AccountInsertSchema, AccountSelectSchema, AddUserToOrganizationRequestSchema, AddUserToOrganizationResponseSchema, InvitationInsertSchema, InvitationSelectSchema, MemberInsertSchema, MemberSelectSchema, OrganizationInsertSchema, OrganizationSelectSchema, SessionInsertSchema, SessionSelectSchema, UserInsertSchema, UserOrganizationSchema, UserOrganizationsResponseSchema, UserSelectSchema, VerificationInsertSchema, VerificationSelectSchema };
@@ -4,13 +4,13 @@ import * as zod from 'zod';
4
4
  import * as better_auth from 'better-auth';
5
5
  import { BetterAuthAdvancedOptions } from 'better-auth';
6
6
  import { GoogleOptions } from 'better-auth/social-providers';
7
- import { D as DatabaseClient } from '../client-CnpNkGsH.js';
7
+ import { D as DatabaseClient } from '../client-B_3j-V4-.js';
8
8
  import 'drizzle-orm/node-postgres';
9
9
  import 'drizzle-orm/pglite';
10
- import '../schema-Cgkp_geg.js';
10
+ import '../schema-DKbG39on.js';
11
11
  import 'drizzle-orm';
12
12
  import 'drizzle-orm/pg-core';
13
- import '../utility-C_tTZ7-k.js';
13
+ import '../utility-Lo5NoRHK.js';
14
14
  import 'drizzle-zod';
15
15
  import '@hono/zod-openapi';
16
16
  import './auth-schema.js';
package/dist/auth/auth.js CHANGED
@@ -1,8 +1,9 @@
1
- import { generateId } from '../chunk-AUIQTGXL.js';
1
+ import { generateId } from '../chunk-K3UNCRSA.js';
2
+ import { env } from '../chunk-NMBNWFIZ.js';
2
3
  import { ssoProvider } from '../chunk-NOPEANIU.js';
3
4
  import { ownerRole, adminRole, memberRole, ac } from '../chunk-VMSYBWFH.js';
4
5
  import { sso } from '@better-auth/sso';
5
- import { betterAuth, env } from 'better-auth';
6
+ import { betterAuth } from 'better-auth';
6
7
  import { drizzleAdapter } from 'better-auth/adapters/drizzle';
7
8
  import { organization } from 'better-auth/plugins';
8
9
  import { eq } from 'drizzle-orm';
@@ -88,7 +89,7 @@ function createAuth(config) {
88
89
  "http://localhost:3002",
89
90
  env.INKEEP_AGENTS_MANAGE_UI_URL,
90
91
  env.INKEEP_AGENTS_MANAGE_API_URL
91
- ],
92
+ ].filter((origin) => typeof origin === "string" && origin.length > 0),
92
93
  plugins: [
93
94
  sso(),
94
95
  organization({
@@ -12,6 +12,9 @@ declare const SPAN_NAMES: {
12
12
  readonly AGENT_GENERATION: "agent.generate";
13
13
  readonly CONTEXT_FETCHER: "context-fetcher.http-request";
14
14
  readonly ARTIFACT_PROCESSING: "agent_session.process_artifact";
15
+ readonly TOOL_APPROVAL_REQUESTED: "tool.approval_requested";
16
+ readonly TOOL_APPROVAL_APPROVED: "tool.approval_approved";
17
+ readonly TOOL_APPROVAL_DENIED: "tool.approval_denied";
15
18
  };
16
19
  declare const AI_OPERATIONS: {
17
20
  readonly GENERATE_TEXT: "ai.generateText.doGenerate";
@@ -53,6 +56,8 @@ declare const SPAN_KEYS: {
53
56
  readonly AI_TOOL_CALL_ID: "ai.toolCall.id";
54
57
  readonly AI_TOOL_TYPE: "ai.toolType";
55
58
  readonly TOOL_PURPOSE: "tool.purpose";
59
+ readonly TOOL_NAME: "tool.name";
60
+ readonly TOOL_CALL_ID: "tool.callId";
56
61
  readonly GEN_AI_USAGE_INPUT_TOKENS: "gen_ai.usage.input_tokens";
57
62
  readonly GEN_AI_USAGE_OUTPUT_TOKENS: "gen_ai.usage.output_tokens";
58
63
  readonly CONTEXT_URL: "context.url";
@@ -92,6 +97,9 @@ declare const ACTIVITY_TYPES: {
92
97
  readonly AI_ASSISTANT_MESSAGE: "ai_assistant_message";
93
98
  readonly AI_MODEL_STREAMED_TEXT: "ai_model_streamed_text";
94
99
  readonly AI_MODEL_STREAMED_OBJECT: "ai_model_streamed_object";
100
+ readonly TOOL_APPROVAL_REQUESTED: "tool_approval_requested";
101
+ readonly TOOL_APPROVAL_APPROVED: "tool_approval_approved";
102
+ readonly TOOL_APPROVAL_DENIED: "tool_approval_denied";
95
103
  };
96
104
  /** Activity Status Values */
97
105
  declare const ACTIVITY_STATUS: {
@@ -223,6 +231,9 @@ declare const QUERY_EXPRESSIONS: {
223
231
  readonly AGENT_GENERATIONS: "agentGenerations";
224
232
  readonly SPANS_WITH_ERRORS: "spansWithErrors";
225
233
  readonly ARTIFACT_PROCESSING: "artifactProcessing";
234
+ readonly TOOL_APPROVAL_REQUESTED: "toolApprovalRequested";
235
+ readonly TOOL_APPROVAL_APPROVED: "toolApprovalApproved";
236
+ readonly TOOL_APPROVAL_DENIED: "toolApprovalDenied";
226
237
  };
227
238
  /** Query Reduce Operations */
228
239
  declare const REDUCE_OPERATIONS: {
@@ -1,5 +1,5 @@
1
- import { AgentWithinContextOfProjectSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-ZCEKN54E.js';
2
- import { z } from 'zod';
1
+ import { AgentWithinContextOfProjectSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-N7TIJHWC.js';
2
+ import { external_exports } from './chunk-OUXC23J7.js';
3
3
 
4
4
  // src/validation/cycleDetection.ts
5
5
  function detectDelegationCycles(agentData) {
@@ -181,42 +181,44 @@ function validateAgentStructure(agentData, projectResources) {
181
181
  }
182
182
  validateAgentRelationships(agentData);
183
183
  }
184
- var TransferDataSchema = z.object({
185
- fromSubAgent: z.string().describe("ID of the sub-agent transferring control"),
186
- targetSubAgent: z.string().describe("ID of the sub-agent receiving control"),
187
- reason: z.string().optional().describe("Reason for the transfer"),
188
- context: z.any().optional().describe("Additional context data")
184
+
185
+ // src/validation/event-schemas.ts
186
+ var TransferDataSchema = external_exports.object({
187
+ fromSubAgent: external_exports.string().describe("ID of the sub-agent transferring control"),
188
+ targetSubAgent: external_exports.string().describe("ID of the sub-agent receiving control"),
189
+ reason: external_exports.string().optional().describe("Reason for the transfer"),
190
+ context: external_exports.any().optional().describe("Additional context data")
189
191
  });
190
- var DelegationSentDataSchema = z.object({
191
- delegationId: z.string().describe("Unique identifier for this delegation"),
192
- fromSubAgent: z.string().describe("ID of the delegating sub-agent"),
193
- targetSubAgent: z.string().describe("ID of the sub-agent receiving the delegation"),
194
- taskDescription: z.string().describe("Description of the delegated task"),
195
- context: z.any().optional().describe("Additional context data")
192
+ var DelegationSentDataSchema = external_exports.object({
193
+ delegationId: external_exports.string().describe("Unique identifier for this delegation"),
194
+ fromSubAgent: external_exports.string().describe("ID of the delegating sub-agent"),
195
+ targetSubAgent: external_exports.string().describe("ID of the sub-agent receiving the delegation"),
196
+ taskDescription: external_exports.string().describe("Description of the delegated task"),
197
+ context: external_exports.any().optional().describe("Additional context data")
196
198
  });
197
- var DelegationReturnedDataSchema = z.object({
198
- delegationId: z.string().describe("Unique identifier matching the original delegation"),
199
- fromSubAgent: z.string().describe("ID of the sub-agent that completed the task"),
200
- targetSubAgent: z.string().describe("ID of the sub-agent receiving the result"),
201
- result: z.any().optional().describe("Result data from the delegated task")
199
+ var DelegationReturnedDataSchema = external_exports.object({
200
+ delegationId: external_exports.string().describe("Unique identifier matching the original delegation"),
201
+ fromSubAgent: external_exports.string().describe("ID of the sub-agent that completed the task"),
202
+ targetSubAgent: external_exports.string().describe("ID of the sub-agent receiving the result"),
203
+ result: external_exports.any().optional().describe("Result data from the delegated task")
202
204
  });
203
- var DataOperationDetailsSchema = z.object({
204
- timestamp: z.number().describe("Unix timestamp in milliseconds"),
205
- subAgentId: z.string().describe("ID of the sub-agent that generated this data"),
206
- data: z.any().describe("The actual data payload")
205
+ var DataOperationDetailsSchema = external_exports.object({
206
+ timestamp: external_exports.number().describe("Unix timestamp in milliseconds"),
207
+ subAgentId: external_exports.string().describe("ID of the sub-agent that generated this data"),
208
+ data: external_exports.any().describe("The actual data payload")
207
209
  });
208
- var DataOperationEventSchema = z.object({
209
- type: z.string().describe("Event type identifier"),
210
- label: z.string().describe("Human-readable label for the event"),
210
+ var DataOperationEventSchema = external_exports.object({
211
+ type: external_exports.string().describe("Event type identifier"),
212
+ label: external_exports.string().describe("Human-readable label for the event"),
211
213
  details: DataOperationDetailsSchema
212
214
  });
213
- var A2AMessageMetadataSchema = z.object({
214
- fromSubAgentId: z.string().optional().describe("ID of the sending sub-agent"),
215
- toSubAgentId: z.string().optional().describe("ID of the receiving sub-agent"),
216
- fromExternalAgentId: z.string().optional().describe("ID of the sending external agent"),
217
- toExternalAgentId: z.string().optional().describe("ID of the receiving external agent"),
218
- taskId: z.string().optional().describe("Associated task ID"),
219
- a2aTaskId: z.string().optional().describe("A2A-specific task ID")
215
+ var A2AMessageMetadataSchema = external_exports.object({
216
+ fromSubAgentId: external_exports.string().optional().describe("ID of the sending sub-agent"),
217
+ toSubAgentId: external_exports.string().optional().describe("ID of the receiving sub-agent"),
218
+ fromExternalAgentId: external_exports.string().optional().describe("ID of the sending external agent"),
219
+ toExternalAgentId: external_exports.string().optional().describe("ID of the receiving external agent"),
220
+ taskId: external_exports.string().optional().describe("Associated task ID"),
221
+ a2aTaskId: external_exports.string().optional().describe("A2A-specific task ID")
220
222
  });
221
223
 
222
224
  // src/validation/id-validation.ts
@@ -339,48 +341,50 @@ function validateRender(render) {
339
341
  errors
340
342
  };
341
343
  }
342
- var TextStartEventSchema = z.object({
343
- type: z.literal("text-start"),
344
- id: z.string()
344
+
345
+ // src/validation/stream-event-schemas.ts
346
+ var TextStartEventSchema = external_exports.object({
347
+ type: external_exports.literal("text-start"),
348
+ id: external_exports.string()
345
349
  });
346
- var TextDeltaEventSchema = z.object({
347
- type: z.literal("text-delta"),
348
- id: z.string(),
349
- delta: z.string()
350
+ var TextDeltaEventSchema = external_exports.object({
351
+ type: external_exports.literal("text-delta"),
352
+ id: external_exports.string(),
353
+ delta: external_exports.string()
350
354
  });
351
- var TextEndEventSchema = z.object({
352
- type: z.literal("text-end"),
353
- id: z.string()
355
+ var TextEndEventSchema = external_exports.object({
356
+ type: external_exports.literal("text-end"),
357
+ id: external_exports.string()
354
358
  });
355
- var DataComponentStreamEventSchema = z.object({
356
- type: z.literal("data-component"),
357
- id: z.string(),
358
- data: z.any()
359
+ var DataComponentStreamEventSchema = external_exports.object({
360
+ type: external_exports.literal("data-component"),
361
+ id: external_exports.string(),
362
+ data: external_exports.any()
359
363
  });
360
- var DataOperationStreamEventSchema = z.object({
361
- type: z.literal("data-operation"),
362
- data: z.any()
364
+ var DataOperationStreamEventSchema = external_exports.object({
365
+ type: external_exports.literal("data-operation"),
366
+ data: external_exports.any()
363
367
  // Contains OperationEvent types (AgentInitializingEvent, CompletionEvent, etc.)
364
368
  });
365
- var DataSummaryStreamEventSchema = z.object({
366
- type: z.literal("data-summary"),
367
- data: z.any()
369
+ var DataSummaryStreamEventSchema = external_exports.object({
370
+ type: external_exports.literal("data-summary"),
371
+ data: external_exports.any()
368
372
  // Contains SummaryEvent from entities.ts
369
373
  });
370
- var StreamErrorEventSchema = z.object({
371
- type: z.literal("error"),
372
- error: z.string()
374
+ var StreamErrorEventSchema = external_exports.object({
375
+ type: external_exports.literal("error"),
376
+ error: external_exports.string()
373
377
  });
374
- var StreamFinishEventSchema = z.object({
375
- type: z.literal("finish"),
376
- finishReason: z.string().optional(),
377
- usage: z.object({
378
- promptTokens: z.number().optional(),
379
- completionTokens: z.number().optional(),
380
- totalTokens: z.number().optional()
378
+ var StreamFinishEventSchema = external_exports.object({
379
+ type: external_exports.literal("finish"),
380
+ finishReason: external_exports.string().optional(),
381
+ usage: external_exports.object({
382
+ promptTokens: external_exports.number().optional(),
383
+ completionTokens: external_exports.number().optional(),
384
+ totalTokens: external_exports.number().optional()
381
385
  }).optional()
382
386
  });
383
- var StreamEventSchema = z.discriminatedUnion("type", [
387
+ var StreamEventSchema = external_exports.discriminatedUnion("type", [
384
388
  TextStartEventSchema,
385
389
  TextDeltaEventSchema,
386
390
  TextEndEventSchema,
@@ -1,13 +1,14 @@
1
1
  import { schemaValidationDefaults } from './chunk-Z64UK4CA.js';
2
- import { loadEnvironmentFiles } from './chunk-4RVJB4KV.js';
3
- import { z } from 'zod';
2
+ import { loadEnvironmentFiles } from './chunk-NMBNWFIZ.js';
3
+ import { external_exports } from './chunk-OUXC23J7.js';
4
4
 
5
+ // src/constants/schema-validation/index.ts
5
6
  loadEnvironmentFiles();
6
- var constantsSchema = z.object(
7
+ var constantsSchema = external_exports.object(
7
8
  Object.fromEntries(
8
9
  Object.keys(schemaValidationDefaults).map((key) => [
9
10
  `AGENTS_${key}`,
10
- z.coerce.number().optional()
11
+ external_exports.coerce.number().optional()
11
12
  ])
12
13
  )
13
14
  );
@@ -0,0 +1,39 @@
1
+ // src/types/a2a.ts
2
+ var TaskState = /* @__PURE__ */ ((TaskState2) => {
3
+ TaskState2["Submitted"] = "submitted";
4
+ TaskState2["Working"] = "working";
5
+ TaskState2["InputRequired"] = "input-required";
6
+ TaskState2["Completed"] = "completed";
7
+ TaskState2["Canceled"] = "canceled";
8
+ TaskState2["Failed"] = "failed";
9
+ TaskState2["Rejected"] = "rejected";
10
+ TaskState2["AuthRequired"] = "auth-required";
11
+ TaskState2["Unknown"] = "unknown";
12
+ return TaskState2;
13
+ })(TaskState || {});
14
+
15
+ // src/types/tool-policies.ts
16
+ function normalizeToolSelections(selections) {
17
+ if (!selections || selections.length === 0) {
18
+ return { selectedTools: [], toolPolicies: {} };
19
+ }
20
+ const selectedTools = [];
21
+ const toolPolicies = {};
22
+ for (const selection of selections) {
23
+ if (typeof selection === "string") {
24
+ selectedTools.push(selection);
25
+ } else {
26
+ selectedTools.push(selection.name);
27
+ const policy = {};
28
+ if (selection.needsApproval !== void 0) {
29
+ policy.needsApproval = selection.needsApproval;
30
+ }
31
+ if (Object.keys(policy).length > 0) {
32
+ toolPolicies[selection.name] = policy;
33
+ }
34
+ }
35
+ }
36
+ return { selectedTools, toolPolicies };
37
+ }
38
+
39
+ export { TaskState, normalizeToolSelections };