@inkeep/agents-core 0.0.0-dev-20260120222159 → 0.0.0-dev-20260121022749

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 (64) hide show
  1. package/dist/auth/auth.d.ts +53 -53
  2. package/dist/auth/auth.js +1 -1
  3. package/dist/auth/permissions.d.ts +13 -13
  4. package/dist/context/ContextConfig.js +3 -3
  5. package/dist/data-access/index.d.ts +5 -5
  6. package/dist/data-access/index.js +5 -5
  7. package/dist/data-access/manage/agents.d.ts +37 -37
  8. package/dist/data-access/manage/artifactComponents.d.ts +12 -12
  9. package/dist/data-access/manage/contextConfigs.d.ts +12 -12
  10. package/dist/data-access/manage/dataComponents.d.ts +6 -6
  11. package/dist/data-access/manage/evalConfig.d.ts +12 -2
  12. package/dist/data-access/manage/evalConfig.js +25 -1
  13. package/dist/data-access/manage/functionTools.d.ts +14 -14
  14. package/dist/data-access/manage/projectFull.d.ts +0 -4
  15. package/dist/data-access/manage/projectFull.js +8 -21
  16. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
  17. package/dist/data-access/manage/subAgentRelations.d.ts +36 -36
  18. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
  19. package/dist/data-access/manage/subAgents.d.ts +27 -27
  20. package/dist/data-access/manage/tools.d.ts +41 -34
  21. package/dist/data-access/manage/tools.js +9 -1
  22. package/dist/data-access/manage/triggers.d.ts +0 -4
  23. package/dist/data-access/manage/triggers.js +1 -15
  24. package/dist/data-access/runtime/apiKeys.d.ts +20 -20
  25. package/dist/data-access/runtime/conversations.d.ts +31 -31
  26. package/dist/data-access/runtime/messages.d.ts +18 -18
  27. package/dist/data-access/runtime/organizations.d.ts +10 -1
  28. package/dist/data-access/runtime/organizations.js +13 -1
  29. package/dist/data-access/runtime/tasks.d.ts +7 -7
  30. package/dist/db/manage/manage-client.d.ts +3 -1
  31. package/dist/db/manage/manage-client.js +13 -1
  32. package/dist/db/manage/manage-schema.d.ts +375 -375
  33. package/dist/db/migrations/cleanup-old-trigger-auth.d.ts +1 -0
  34. package/dist/db/migrations/cleanup-old-trigger-auth.js +68 -0
  35. package/dist/db/runtime/runtime-schema.d.ts +181 -181
  36. package/dist/dolt/branch.d.ts +4 -53
  37. package/dist/dolt/branch.js +23 -81
  38. package/dist/dolt/branches-api.js +1 -1
  39. package/dist/dolt/index.d.ts +5 -3
  40. package/dist/dolt/index.js +5 -3
  41. package/dist/dolt/migrate-all-branches.js +1 -1
  42. package/dist/dolt/{ref.d.ts → ref-helpers.d.ts} +5 -2
  43. package/dist/dolt/{ref.js → ref-helpers.js} +15 -3
  44. package/dist/dolt/ref-middleware.d.ts +82 -0
  45. package/dist/dolt/ref-middleware.js +217 -0
  46. package/dist/dolt/ref-scope.d.ts +101 -0
  47. package/dist/dolt/ref-scope.js +231 -0
  48. package/dist/env.d.ts +2 -2
  49. package/dist/env.js +1 -1
  50. package/dist/index.d.ts +12 -10
  51. package/dist/index.js +15 -13
  52. package/dist/types/entities.d.ts +3 -2
  53. package/dist/types/index.d.ts +2 -2
  54. package/dist/utils/index.d.ts +2 -2
  55. package/dist/utils/index.js +2 -2
  56. package/dist/utils/third-party-mcp-servers/composio-client.js +23 -23
  57. package/dist/utils/trigger-auth.d.ts +37 -7
  58. package/dist/utils/trigger-auth.js +72 -77
  59. package/dist/validation/dolt-schemas.d.ts +1 -1
  60. package/dist/validation/index.d.ts +2 -2
  61. package/dist/validation/index.js +2 -2
  62. package/dist/validation/schemas.d.ts +473 -486
  63. package/dist/validation/schemas.js +23 -28
  64. package/package.json +2 -1
@@ -15,20 +15,20 @@ declare const listConversations: (db: AgentsRunDatabaseClient) => (params: {
15
15
  total: number;
16
16
  }>;
17
17
  declare const createConversation: (db: AgentsRunDatabaseClient) => (params: ConversationInsert) => Promise<{
18
- tenantId: string;
19
- projectId: string;
20
18
  id: string;
21
- title: string | null;
22
- agentId: string | null;
23
19
  createdAt: string;
24
20
  updatedAt: string;
25
- userId: string | null;
26
- metadata: ConversationMetadata | null;
27
21
  ref: {
28
- type: "tag" | "commit" | "branch";
22
+ type: "commit" | "tag" | "branch";
29
23
  name: string;
30
24
  hash: string;
31
25
  } | null;
26
+ userId: string | null;
27
+ metadata: ConversationMetadata | null;
28
+ title: string | null;
29
+ agentId: string | null;
30
+ projectId: string;
31
+ tenantId: string;
32
32
  activeSubAgentId: string;
33
33
  lastContextResolution: string | null;
34
34
  }>;
@@ -43,7 +43,7 @@ declare const updateConversation: (db: AgentsRunDatabaseClient) => (params: {
43
43
  agentId: string | null;
44
44
  activeSubAgentId: string;
45
45
  ref: {
46
- type: "tag" | "commit" | "branch";
46
+ type: "commit" | "tag" | "branch";
47
47
  name: string;
48
48
  hash: string;
49
49
  } | null;
@@ -69,7 +69,7 @@ declare const updateConversationActiveSubAgent: (db: AgentsRunDatabaseClient) =>
69
69
  agentId: string | null;
70
70
  activeSubAgentId: string;
71
71
  ref: {
72
- type: "tag" | "commit" | "branch";
72
+ type: "commit" | "tag" | "branch";
73
73
  name: string;
74
74
  hash: string;
75
75
  } | null;
@@ -84,20 +84,20 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
84
84
  scopes: ProjectScopeConfig;
85
85
  conversationId: string;
86
86
  }) => Promise<{
87
- tenantId: string;
88
- projectId: string;
89
87
  id: string;
90
- title: string | null;
91
- agentId: string | null;
92
88
  createdAt: string;
93
89
  updatedAt: string;
94
- userId: string | null;
95
- metadata: ConversationMetadata | null;
96
90
  ref: {
97
- type: "tag" | "commit" | "branch";
91
+ type: "commit" | "tag" | "branch";
98
92
  name: string;
99
93
  hash: string;
100
94
  } | null;
95
+ userId: string | null;
96
+ metadata: ConversationMetadata | null;
97
+ title: string | null;
98
+ agentId: string | null;
99
+ projectId: string;
100
+ tenantId: string;
101
101
  activeSubAgentId: string;
102
102
  lastContextResolution: string | null;
103
103
  } | undefined>;
@@ -107,7 +107,7 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
107
107
  tenantId: string;
108
108
  id: string;
109
109
  ref: {
110
- type: "tag" | "commit" | "branch";
110
+ type: "commit" | "tag" | "branch";
111
111
  name: string;
112
112
  hash: string;
113
113
  };
@@ -120,20 +120,20 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
120
120
  metadata?: ConversationMetadata | null | undefined;
121
121
  contextConfigId?: string | undefined;
122
122
  } | {
123
- tenantId: string;
124
- projectId: string;
125
123
  id: string;
126
- title: string | null;
127
- agentId: string | null;
128
124
  createdAt: string;
129
125
  updatedAt: string;
130
- userId: string | null;
131
- metadata: ConversationMetadata | null;
132
126
  ref: {
133
- type: "tag" | "commit" | "branch";
127
+ type: "commit" | "tag" | "branch";
134
128
  name: string;
135
129
  hash: string;
136
130
  } | null;
131
+ userId: string | null;
132
+ metadata: ConversationMetadata | null;
133
+ title: string | null;
134
+ agentId: string | null;
135
+ projectId: string;
136
+ tenantId: string;
137
137
  activeSubAgentId: string;
138
138
  lastContextResolution: string | null;
139
139
  }>;
@@ -152,20 +152,20 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
152
152
  scopes: ProjectScopeConfig;
153
153
  conversationId: string;
154
154
  }) => Promise<{
155
- tenantId: string;
156
- projectId: string;
157
155
  id: string;
158
- title: string | null;
159
- agentId: string | null;
160
156
  createdAt: string;
161
157
  updatedAt: string;
162
- userId: string | null;
163
- metadata: ConversationMetadata | null;
164
158
  ref: {
165
- type: "tag" | "commit" | "branch";
159
+ type: "commit" | "tag" | "branch";
166
160
  name: string;
167
161
  hash: string;
168
162
  } | null;
163
+ userId: string | null;
164
+ metadata: ConversationMetadata | null;
165
+ title: string | null;
166
+ agentId: string | null;
167
+ projectId: string;
168
+ tenantId: string;
169
169
  activeSubAgentId: string;
170
170
  lastContextResolution: string | null;
171
171
  } | undefined>;
@@ -9,26 +9,26 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
9
9
  scopes: ProjectScopeConfig;
10
10
  messageId: string;
11
11
  }) => Promise<{
12
- tenantId: string;
13
- projectId: string;
14
12
  id: string;
15
13
  createdAt: string;
16
14
  updatedAt: string;
17
15
  metadata: MessageMetadata | null;
18
- content: MessageContent;
19
16
  role: string;
20
- conversationId: string;
21
17
  fromSubAgentId: string | null;
22
18
  toSubAgentId: string | null;
23
19
  fromExternalAgentId: string | null;
24
20
  toExternalAgentId: string | null;
21
+ taskId: string | null;
22
+ a2aTaskId: string | null;
23
+ projectId: string;
24
+ tenantId: string;
25
+ content: MessageContent;
26
+ conversationId: string;
25
27
  fromTeamAgentId: string | null;
26
28
  toTeamAgentId: string | null;
27
29
  visibility: string;
28
30
  messageType: string;
29
- taskId: string | null;
30
31
  parentMessageId: string | null;
31
- a2aTaskId: string | null;
32
32
  a2aSessionId: string | null;
33
33
  } | undefined>;
34
34
  declare const listMessages: (db: AgentsRunDatabaseClient) => (params: {
@@ -140,26 +140,26 @@ declare const getVisibleMessages: (db: AgentsRunDatabaseClient) => (params: {
140
140
  id: string;
141
141
  }[]>;
142
142
  declare const createMessage: (db: AgentsRunDatabaseClient) => (params: MessageInsert) => Promise<{
143
- tenantId: string;
144
- projectId: string;
145
143
  id: string;
146
144
  createdAt: string;
147
145
  updatedAt: string;
148
146
  metadata: MessageMetadata | null;
149
- content: MessageContent;
150
147
  role: string;
151
- conversationId: string;
152
148
  fromSubAgentId: string | null;
153
149
  toSubAgentId: string | null;
154
150
  fromExternalAgentId: string | null;
155
151
  toExternalAgentId: string | null;
152
+ taskId: string | null;
153
+ a2aTaskId: string | null;
154
+ projectId: string;
155
+ tenantId: string;
156
+ content: MessageContent;
157
+ conversationId: string;
156
158
  fromTeamAgentId: string | null;
157
159
  toTeamAgentId: string | null;
158
160
  visibility: string;
159
161
  messageType: string;
160
- taskId: string | null;
161
162
  parentMessageId: string | null;
162
- a2aTaskId: string | null;
163
163
  a2aSessionId: string | null;
164
164
  }>;
165
165
  declare const updateMessage: (db: AgentsRunDatabaseClient) => (params: {
@@ -193,26 +193,26 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
193
193
  scopes: ProjectScopeConfig;
194
194
  messageId: string;
195
195
  }) => Promise<{
196
- tenantId: string;
197
- projectId: string;
198
196
  id: string;
199
197
  createdAt: string;
200
198
  updatedAt: string;
201
199
  metadata: MessageMetadata | null;
202
- content: MessageContent;
203
200
  role: string;
204
- conversationId: string;
205
201
  fromSubAgentId: string | null;
206
202
  toSubAgentId: string | null;
207
203
  fromExternalAgentId: string | null;
208
204
  toExternalAgentId: string | null;
205
+ taskId: string | null;
206
+ a2aTaskId: string | null;
207
+ projectId: string;
208
+ tenantId: string;
209
+ content: MessageContent;
210
+ conversationId: string;
209
211
  fromTeamAgentId: string | null;
210
212
  toTeamAgentId: string | null;
211
213
  visibility: string;
212
214
  messageType: string;
213
- taskId: string | null;
214
215
  parentMessageId: string | null;
215
- a2aTaskId: string | null;
216
216
  a2aSessionId: string | null;
217
217
  }>;
218
218
  declare const countMessagesByConversation: (db: AgentsRunDatabaseClient) => (params: {
@@ -39,5 +39,14 @@ declare const addUserToOrganization: (db: AgentsRunDatabaseClient) => (data: {
39
39
  organizationId: string;
40
40
  role: string;
41
41
  }) => Promise<void>;
42
+ declare const upsertOrganization: (db: AgentsRunDatabaseClient) => (data: {
43
+ organizationId: string;
44
+ name: string;
45
+ slug: string;
46
+ logo?: string | null;
47
+ metadata?: string | null;
48
+ }) => Promise<{
49
+ created: boolean;
50
+ }>;
42
51
  //#endregion
43
- export { addUserToOrganization, getPendingInvitationsByEmail, getUserOrganizations };
52
+ export { addUserToOrganization, getPendingInvitationsByEmail, getUserOrganizations, upsertOrganization };
@@ -58,6 +58,18 @@ const addUserToOrganization = (db) => async (data) => {
58
58
  createdAt: /* @__PURE__ */ new Date()
59
59
  });
60
60
  };
61
+ const upsertOrganization = (db) => async (data) => {
62
+ if ((await db.select().from(organization).where(eq(organization.id, data.organizationId)).limit(1)).length > 0) return { created: false };
63
+ await db.insert(organization).values({
64
+ id: data.organizationId,
65
+ name: data.name,
66
+ slug: data.slug,
67
+ createdAt: /* @__PURE__ */ new Date(),
68
+ logo: data.logo ?? null,
69
+ metadata: data.metadata ?? null
70
+ });
71
+ return { created: true };
72
+ };
61
73
 
62
74
  //#endregion
63
- export { addUserToOrganization, getPendingInvitationsByEmail, getUserOrganizations };
75
+ export { addUserToOrganization, getPendingInvitationsByEmail, getUserOrganizations, upsertOrganization };
@@ -6,21 +6,21 @@ import { TaskInsert, TaskSelect } from "../../types/entities.js";
6
6
 
7
7
  //#region src/data-access/runtime/tasks.d.ts
8
8
  declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert) => Promise<{
9
- tenantId: string;
10
- projectId: string;
11
9
  id: string;
12
- agentId: string;
13
10
  createdAt: string;
14
11
  updatedAt: string;
15
- metadata: TaskMetadataConfig | null;
16
12
  ref: {
17
- type: "tag" | "commit" | "branch";
13
+ type: "commit" | "tag" | "branch";
18
14
  name: string;
19
15
  hash: string;
20
16
  } | null;
17
+ metadata: TaskMetadataConfig | null;
21
18
  status: string;
22
- contextId: string;
23
19
  subAgentId: string;
20
+ agentId: string;
21
+ projectId: string;
22
+ tenantId: string;
23
+ contextId: string;
24
24
  }>;
25
25
  declare const getTask: (db: AgentsRunDatabaseClient) => (params: {
26
26
  id: string;
@@ -36,7 +36,7 @@ declare const updateTask: (db: AgentsRunDatabaseClient) => (params: {
36
36
  updatedAt: string;
37
37
  contextId: string;
38
38
  ref: {
39
- type: "tag" | "commit" | "branch";
39
+ type: "commit" | "tag" | "branch";
40
40
  name: string;
41
41
  hash: string;
42
42
  } | null;
@@ -1,5 +1,6 @@
1
1
  import { manage_schema_d_exports } from "./manage-schema.js";
2
2
  import { NodePgDatabase } from "drizzle-orm/node-postgres";
3
+ import { Pool } from "pg";
3
4
  import { PgliteDatabase } from "drizzle-orm/pglite";
4
5
 
5
6
  //#region src/db/manage/manage-client.d.ts
@@ -12,6 +13,7 @@ interface AgentsManageDatabaseConfig {
12
13
  logQuery: (query: string, params: unknown[]) => void;
13
14
  };
14
15
  }
16
+ declare function createAgentsManageDatabasePool(config: AgentsManageDatabaseConfig): Pool;
15
17
  /**
16
18
  * Creates a PostgreSQL database client with connection pooling
17
19
  */
@@ -21,4 +23,4 @@ declare function createAgentManageDatabaseConnection(config: AgentsManageDatabas
21
23
  release: () => Promise<void>;
22
24
  }>;
23
25
  //#endregion
24
- export { AgentsManageDatabaseClient, AgentsManageDatabaseConfig, createAgentManageDatabaseConnection, createAgentsManageDatabaseClient };
26
+ export { AgentsManageDatabaseClient, AgentsManageDatabaseConfig, createAgentManageDatabaseConnection, createAgentsManageDatabaseClient, createAgentsManageDatabasePool };
@@ -6,6 +6,18 @@ import { Pool } from "pg";
6
6
 
7
7
  //#region src/db/manage/manage-client.ts
8
8
  loadEnvironmentFiles();
9
+ function createAgentsManageDatabasePool(config) {
10
+ const connectionString = config.connectionString || env.INKEEP_AGENTS_MANAGE_DATABASE_URL;
11
+ if (!connectionString) throw new Error("INKEEP_AGENTS_MANAGE_DATABASE_URL environment variable is required. Please set it to your PostgreSQL connection string.");
12
+ const pool = new Pool({
13
+ connectionString,
14
+ max: config.poolSize || Number(env.POSTGRES_POOL_SIZE) || 100
15
+ });
16
+ pool.on("error", (err) => {
17
+ console.error("Unexpected PostgreSQL pool error:", err);
18
+ });
19
+ return pool;
20
+ }
9
21
  /**
10
22
  * Creates a PostgreSQL database client with connection pooling
11
23
  */
@@ -53,4 +65,4 @@ function createAgentManageDatabaseConnection(config) {
53
65
  }
54
66
 
55
67
  //#endregion
56
- export { createAgentManageDatabaseConnection, createAgentsManageDatabaseClient };
68
+ export { createAgentManageDatabaseConnection, createAgentsManageDatabaseClient, createAgentsManageDatabasePool };