@inkeep/agents-core 0.73.3 → 0.73.5

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 (35) hide show
  1. package/dist/auth/permissions.d.ts +9 -9
  2. package/dist/constants/models.d.ts +3 -0
  3. package/dist/constants/models.js +3 -0
  4. package/dist/data-access/manage/agents.d.ts +21 -21
  5. package/dist/data-access/manage/artifactComponents.d.ts +12 -12
  6. package/dist/data-access/manage/contextConfigs.d.ts +12 -12
  7. package/dist/data-access/manage/dataComponents.d.ts +6 -6
  8. package/dist/data-access/manage/functionTools.d.ts +18 -18
  9. package/dist/data-access/manage/skills.d.ts +15 -15
  10. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
  11. package/dist/data-access/manage/subAgentRelations.d.ts +30 -30
  12. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +24 -24
  13. package/dist/data-access/manage/subAgents.d.ts +15 -15
  14. package/dist/data-access/manage/tools.d.ts +27 -27
  15. package/dist/data-access/manage/triggers.d.ts +5 -5
  16. package/dist/data-access/runtime/apiKeys.d.ts +12 -12
  17. package/dist/data-access/runtime/apps.d.ts +8 -8
  18. package/dist/data-access/runtime/conversations.d.ts +24 -24
  19. package/dist/data-access/runtime/events.d.ts +5 -5
  20. package/dist/data-access/runtime/feedback.d.ts +6 -6
  21. package/dist/data-access/runtime/messages.d.ts +15 -15
  22. package/dist/data-access/runtime/scheduledTriggerUsers.d.ts +1 -1
  23. package/dist/data-access/runtime/tasks.d.ts +6 -6
  24. package/dist/db/manage/manage-client.js +3 -0
  25. package/dist/db/manage/manage-schema.d.ts +4 -4
  26. package/dist/db/runtime/runtime-client.js +2 -0
  27. package/dist/db/runtime/runtime-schema.d.ts +2 -2
  28. package/dist/types/@vercel__functions/index.d.ts +3 -3
  29. package/dist/utils/database-pool.d.ts +8 -0
  30. package/dist/utils/database-pool.js +36 -0
  31. package/dist/utils/error.d.ts +51 -51
  32. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  33. package/dist/validation/schemas/skills.d.ts +37 -37
  34. package/dist/validation/schemas.d.ts +516 -516
  35. package/package.json +2 -2
@@ -7,15 +7,15 @@ import { EventInsert } from "../../types/entities.js";
7
7
  //#region src/data-access/runtime/events.d.ts
8
8
  declare const createEvent: (db: AgentsRunDatabaseClient) => (params: EventInsert) => Promise<{
9
9
  row: {
10
- tenantId: string;
11
- projectId: string;
12
10
  id: string;
13
- metadata: Record<string, unknown> | null;
11
+ createdAt: string;
12
+ updatedAt: string;
14
13
  type: string;
14
+ metadata: Record<string, unknown> | null;
15
15
  properties: Record<string, unknown> | null;
16
16
  agentId: string | null;
17
- createdAt: string;
18
- updatedAt: string;
17
+ projectId: string;
18
+ tenantId: string;
19
19
  conversationId: string | null;
20
20
  userProperties: Record<string, unknown> | null;
21
21
  messageId: string | null;
@@ -70,12 +70,12 @@ declare const getFeedbackByIds: (db: AgentsRunDatabaseClient) => (params: {
70
70
  agentId: string | null;
71
71
  }[]>;
72
72
  declare const createFeedback: (db: AgentsRunDatabaseClient) => (params: FeedbackInsert) => Promise<{
73
- tenantId: string;
74
- projectId: string;
75
73
  id: string;
76
- type: "positive" | "negative";
77
74
  createdAt: string;
78
75
  updatedAt: string;
76
+ type: "positive" | "negative";
77
+ projectId: string;
78
+ tenantId: string;
79
79
  conversationId: string;
80
80
  messageId: string | null;
81
81
  details: string | null;
@@ -100,12 +100,12 @@ declare const deleteFeedback: (db: AgentsRunDatabaseClient) => (params: {
100
100
  scopes: ProjectScopeConfig;
101
101
  feedbackId: string;
102
102
  }) => Promise<{
103
- tenantId: string;
104
- projectId: string;
105
103
  id: string;
106
- type: "positive" | "negative";
107
104
  createdAt: string;
108
105
  updatedAt: string;
106
+ type: "positive" | "negative";
107
+ projectId: string;
108
+ tenantId: string;
109
109
  conversationId: string;
110
110
  messageId: string | null;
111
111
  details: string | null;
@@ -10,15 +10,15 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
10
10
  scopes: ProjectScopeConfig;
11
11
  messageId: string;
12
12
  }) => Promise<{
13
- tenantId: string;
14
- projectId: string;
15
13
  id: string;
16
- metadata: MessageMetadata | null;
17
- content: MessageContent;
18
- properties: Record<string, unknown> | null;
19
14
  createdAt: string;
20
15
  updatedAt: string;
16
+ metadata: MessageMetadata | null;
21
17
  role: string;
18
+ properties: Record<string, unknown> | null;
19
+ projectId: string;
20
+ tenantId: string;
21
+ content: MessageContent;
22
22
  conversationId: string;
23
23
  userProperties: Record<string, unknown> | null;
24
24
  fromSubAgentId: string | null;
@@ -154,15 +154,15 @@ declare const createMessage: (db: AgentsRunDatabaseClient) => (params: {
154
154
  scopes: ProjectScopeConfig;
155
155
  data: Omit<MessageInsert, "tenantId" | "projectId">;
156
156
  }) => Promise<{
157
- tenantId: string;
158
- projectId: string;
159
157
  id: string;
160
- metadata: MessageMetadata | null;
161
- content: MessageContent;
162
- properties: Record<string, unknown> | null;
163
158
  createdAt: string;
164
159
  updatedAt: string;
160
+ metadata: MessageMetadata | null;
165
161
  role: string;
162
+ properties: Record<string, unknown> | null;
163
+ projectId: string;
164
+ tenantId: string;
165
+ content: MessageContent;
166
166
  conversationId: string;
167
167
  userProperties: Record<string, unknown> | null;
168
168
  fromSubAgentId: string | null;
@@ -211,15 +211,15 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
211
211
  scopes: ProjectScopeConfig;
212
212
  messageId: string;
213
213
  }) => Promise<{
214
- tenantId: string;
215
- projectId: string;
216
214
  id: string;
217
- metadata: MessageMetadata | null;
218
- content: MessageContent;
219
- properties: Record<string, unknown> | null;
220
215
  createdAt: string;
221
216
  updatedAt: string;
217
+ metadata: MessageMetadata | null;
222
218
  role: string;
219
+ properties: Record<string, unknown> | null;
220
+ projectId: string;
221
+ tenantId: string;
222
+ content: MessageContent;
223
223
  conversationId: string;
224
224
  userProperties: Record<string, unknown> | null;
225
225
  fromSubAgentId: string | null;
@@ -15,9 +15,9 @@ declare const createScheduledTriggerUser: (db: AgentsRunDatabaseClient) => (para
15
15
  scheduledTriggerId: string;
16
16
  userId: string;
17
17
  }) => Promise<{
18
- tenantId: string;
19
18
  createdAt: string;
20
19
  userId: string;
20
+ tenantId: string;
21
21
  scheduledTriggerId: string;
22
22
  }>;
23
23
  declare const deleteScheduledTriggerUser: (db: AgentsRunDatabaseClient) => (params: {
@@ -7,13 +7,7 @@ import { TaskInsert, TaskSelect } from "../../types/entities.js";
7
7
 
8
8
  //#region src/data-access/runtime/tasks.d.ts
9
9
  declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert) => Promise<{
10
- tenantId: string;
11
- projectId: string;
12
10
  id: string;
13
- metadata: TaskMetadataConfig | null;
14
- agentId: string;
15
- subAgentId: string;
16
- status: string;
17
11
  createdAt: string;
18
12
  updatedAt: string;
19
13
  ref: {
@@ -21,7 +15,13 @@ declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert)
21
15
  name: string;
22
16
  hash: string;
23
17
  } | null;
18
+ metadata: TaskMetadataConfig | null;
19
+ status: string;
20
+ agentId: string;
21
+ projectId: string;
22
+ tenantId: string;
24
23
  contextId: string;
24
+ subAgentId: string;
25
25
  }>;
26
26
  declare const getTask: (db: AgentsRunDatabaseClient) => (params: {
27
27
  id: string;
@@ -1,6 +1,7 @@
1
1
  import { manage_schema_exports } from "./manage-schema.js";
2
2
  import { env, loadEnvironmentFiles } from "../../env.js";
3
3
  import { getLogger } from "../../utils/logger.js";
4
+ import { tryAttachDatabasePool } from "../../utils/database-pool.js";
4
5
  import { getDatabaseErrorLogContext } from "../../utils/error.js";
5
6
  import { createTestManageDatabaseClientNoMigrations } from "./test-manage-client.js";
6
7
  import { drizzle } from "drizzle-orm/node-postgres";
@@ -20,6 +21,7 @@ function createAgentsManageDatabasePool(config) {
20
21
  connectionTimeoutMillis: 1e4,
21
22
  idleTimeoutMillis: 3e4
22
23
  });
24
+ tryAttachDatabasePool(pool);
23
25
  pool.on("error", (err) => {
24
26
  managePoolLogger.error({
25
27
  error: err,
@@ -43,6 +45,7 @@ function createAgentsManageDatabaseClient(config) {
43
45
  connectionTimeoutMillis: 1e4,
44
46
  idleTimeoutMillis: 3e4
45
47
  });
48
+ tryAttachDatabasePool(pool);
46
49
  pool.on("error", (err) => {
47
50
  managePoolLogger.error({
48
51
  error: err,
@@ -855,8 +855,8 @@ declare const triggers: drizzle_orm_pg_core1567.PgTableWithColumns<{
855
855
  dataType: "json";
856
856
  columnType: "PgJsonb";
857
857
  data: {
858
- algorithm: "md5" | "sha256" | "sha512" | "sha384" | "sha1";
859
- encoding: "base64" | "hex";
858
+ algorithm: "sha256" | "sha512" | "sha384" | "sha1" | "md5";
859
+ encoding: "hex" | "base64";
860
860
  signature: {
861
861
  source: "query" | "body" | "header";
862
862
  key: string;
@@ -892,8 +892,8 @@ declare const triggers: drizzle_orm_pg_core1567.PgTableWithColumns<{
892
892
  generated: undefined;
893
893
  }, {}, {
894
894
  $type: {
895
- algorithm: "md5" | "sha256" | "sha512" | "sha384" | "sha1";
896
- encoding: "base64" | "hex";
895
+ algorithm: "sha256" | "sha512" | "sha384" | "sha1" | "md5";
896
+ encoding: "hex" | "base64";
897
897
  signature: {
898
898
  source: "query" | "body" | "header";
899
899
  key: string;
@@ -1,6 +1,7 @@
1
1
  import { runtime_schema_exports } from "./runtime-schema.js";
2
2
  import { env, loadEnvironmentFiles } from "../../env.js";
3
3
  import { getLogger } from "../../utils/logger.js";
4
+ import { tryAttachDatabasePool } from "../../utils/database-pool.js";
4
5
  import { getDatabaseErrorLogContext } from "../../utils/error.js";
5
6
  import { createTestRuntimeDatabaseClientNoMigrations } from "./test-runtime-client.js";
6
7
  import { drizzle } from "drizzle-orm/node-postgres";
@@ -24,6 +25,7 @@ function createAgentsRunDatabaseClient(config) {
24
25
  connectionTimeoutMillis: 1e4,
25
26
  idleTimeoutMillis: 3e4
26
27
  });
28
+ tryAttachDatabasePool(pool);
27
29
  pool.on("error", (err) => {
28
30
  runtimePoolLogger.error({
29
31
  error: err,
@@ -6181,7 +6181,7 @@ declare const workAppGitHubInstallations: drizzle_orm_pg_core1944.PgTableWithCol
6181
6181
  tableName: "work_app_github_installations";
6182
6182
  dataType: "string";
6183
6183
  columnType: "PgVarchar";
6184
- data: "User" | "Organization";
6184
+ data: "Organization" | "User";
6185
6185
  driverParam: string;
6186
6186
  notNull: true;
6187
6187
  hasDefault: false;
@@ -6194,7 +6194,7 @@ declare const workAppGitHubInstallations: drizzle_orm_pg_core1944.PgTableWithCol
6194
6194
  generated: undefined;
6195
6195
  }, {}, {
6196
6196
  length: 20;
6197
- $type: "User" | "Organization";
6197
+ $type: "Organization" | "User";
6198
6198
  }>;
6199
6199
  status: drizzle_orm_pg_core1944.PgColumn<{
6200
6200
  name: "status";
@@ -1,11 +1,11 @@
1
1
  //#region src/types/@vercel__functions/index.d.ts
2
2
  /**
3
3
  * Minimal type declarations for @vercel/functions.
4
- * The actual package is a dependency of agents-api; agents-core uses
5
- * dynamic `import('@vercel/functions')` that resolves at runtime from
6
- * the host application's node_modules.
4
+ * agents-core uses dynamic `import('@vercel/functions')` so Vercel
5
+ * runtime helpers are loaded lazily only in Vercel environments.
7
6
  */
8
7
 
9
8
  declare module '@vercel/functions' {
10
9
  export function waitUntil(promise: Promise<unknown>): void;
10
+ export function attachDatabasePool(dbPool: unknown): void;
11
11
  }
@@ -0,0 +1,8 @@
1
+ //#region src/utils/database-pool.d.ts
2
+ declare function tryAttachDatabasePool(dbPool: unknown): Promise<void>;
3
+ /**
4
+ * Reset internal cache. Exposed only for testing.
5
+ */
6
+ declare function _resetAttachDatabasePoolCache(): void;
7
+ //#endregion
8
+ export { _resetAttachDatabasePoolCache, tryAttachDatabasePool };
@@ -0,0 +1,36 @@
1
+ import { getLogger } from "./logger.js";
2
+
3
+ //#region src/utils/database-pool.ts
4
+ const logger = getLogger("database-pool");
5
+ let _importPromise;
6
+ async function getAttachDatabasePool() {
7
+ if (_importPromise) return _importPromise;
8
+ _importPromise = (async () => {
9
+ if (!process.env.VERCEL) return void 0;
10
+ try {
11
+ return (await import("@vercel/functions")).attachDatabasePool;
12
+ } catch (e) {
13
+ logger.warn({ error: e }, "Failed to import @vercel/functions, database pool attachment unavailable");
14
+ return;
15
+ }
16
+ })();
17
+ return _importPromise;
18
+ }
19
+ async function tryAttachDatabasePool(dbPool) {
20
+ const attachDatabasePool = await getAttachDatabasePool();
21
+ if (!attachDatabasePool) return;
22
+ try {
23
+ attachDatabasePool(dbPool);
24
+ } catch (e) {
25
+ logger.warn({ error: e }, "Failed to attach database pool to Vercel Fluid Compute");
26
+ }
27
+ }
28
+ /**
29
+ * Reset internal cache. Exposed only for testing.
30
+ */
31
+ function _resetAttachDatabasePoolCache() {
32
+ _importPromise = void 0;
33
+ }
34
+
35
+ //#endregion
36
+ export { _resetAttachDatabasePoolCache, tryAttachDatabasePool };