@inkeep/agents-core 0.0.0-dev-20260331193342 → 0.0.0-dev-20260331210432

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/auth-schema.d.ts +108 -108
  2. package/dist/auth/auth-validation-schemas.d.ts +154 -154
  3. package/dist/auth/auth.d.ts +6 -6
  4. package/dist/auth/permissions.d.ts +13 -13
  5. package/dist/data-access/manage/agents.d.ts +32 -32
  6. package/dist/data-access/manage/artifactComponents.d.ts +6 -6
  7. package/dist/data-access/manage/contextConfigs.d.ts +12 -12
  8. package/dist/data-access/manage/dataComponents.d.ts +2 -2
  9. package/dist/data-access/manage/functionTools.d.ts +8 -8
  10. package/dist/data-access/manage/skills.d.ts +7 -7
  11. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +6 -6
  12. package/dist/data-access/manage/subAgentRelations.d.ts +14 -14
  13. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +6 -6
  14. package/dist/data-access/manage/subAgents.d.ts +12 -12
  15. package/dist/data-access/manage/tools.d.ts +9 -9
  16. package/dist/data-access/manage/tools.js +41 -4
  17. package/dist/data-access/runtime/apiKeys.d.ts +12 -12
  18. package/dist/data-access/runtime/apps.d.ts +12 -12
  19. package/dist/data-access/runtime/conversations.d.ts +32 -32
  20. package/dist/data-access/runtime/messages.d.ts +21 -21
  21. package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +4 -4
  22. package/dist/data-access/runtime/tasks.d.ts +8 -8
  23. package/dist/db/manage/manage-schema.d.ts +445 -445
  24. package/dist/db/runtime/runtime-schema.d.ts +378 -378
  25. package/dist/dolt/backfill-skill-files.d.ts +41 -0
  26. package/dist/dolt/backfill-skill-files.js +209 -0
  27. package/dist/dolt/run-sql-file-on-all-branches.d.ts +29 -0
  28. package/dist/dolt/run-sql-file-on-all-branches.js +177 -0
  29. package/dist/utils/error.d.ts +51 -51
  30. package/dist/utils/mcp-client.d.ts +1 -1
  31. package/dist/utils/mcp-client.js +1 -1
  32. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  33. package/dist/validation/schemas/skills.d.ts +33 -33
  34. package/dist/validation/schemas.d.ts +2079 -2079
  35. package/package.json +3 -1
@@ -12,9 +12,9 @@ declare const getSubAgentTeamAgentRelationById: (db: AgentsManageDatabaseClient)
12
12
  id: string;
13
13
  createdAt: string;
14
14
  updatedAt: string;
15
+ tenantId: string;
15
16
  agentId: string;
16
17
  projectId: string;
17
- tenantId: string;
18
18
  subAgentId: string;
19
19
  headers: Record<string, string> | null;
20
20
  targetAgentId: string;
@@ -47,9 +47,9 @@ declare const getSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) =>
47
47
  id: string;
48
48
  createdAt: string;
49
49
  updatedAt: string;
50
+ tenantId: string;
50
51
  agentId: string;
51
52
  projectId: string;
52
- tenantId: string;
53
53
  subAgentId: string;
54
54
  headers: Record<string, string> | null;
55
55
  targetAgentId: string;
@@ -60,9 +60,9 @@ declare const getSubAgentTeamAgentRelationsByAgent: (db: AgentsManageDatabaseCli
60
60
  id: string;
61
61
  createdAt: string;
62
62
  updatedAt: string;
63
+ tenantId: string;
63
64
  agentId: string;
64
65
  projectId: string;
65
- tenantId: string;
66
66
  subAgentId: string;
67
67
  headers: Record<string, string> | null;
68
68
  targetAgentId: string;
@@ -225,9 +225,9 @@ declare const createSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
225
225
  id: string;
226
226
  createdAt: string;
227
227
  updatedAt: string;
228
+ tenantId: string;
228
229
  agentId: string;
229
230
  projectId: string;
230
- tenantId: string;
231
231
  subAgentId: string;
232
232
  headers: Record<string, string> | null;
233
233
  targetAgentId: string;
@@ -242,9 +242,9 @@ declare const getSubAgentTeamAgentRelationByParams: (db: AgentsManageDatabaseCli
242
242
  id: string;
243
243
  createdAt: string;
244
244
  updatedAt: string;
245
+ tenantId: string;
245
246
  agentId: string;
246
247
  projectId: string;
247
- tenantId: string;
248
248
  subAgentId: string;
249
249
  headers: Record<string, string> | null;
250
250
  targetAgentId: string;
@@ -263,9 +263,9 @@ declare const upsertSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
263
263
  id: string;
264
264
  createdAt: string;
265
265
  updatedAt: string;
266
+ tenantId: string;
266
267
  agentId: string;
267
268
  projectId: string;
268
- tenantId: string;
269
269
  subAgentId: string;
270
270
  headers: Record<string, string> | null;
271
271
  targetAgentId: string;
@@ -10,13 +10,14 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
10
10
  subAgentId: string;
11
11
  }) => Promise<{
12
12
  id: string;
13
- createdAt: string;
14
13
  name: string;
14
+ createdAt: string;
15
15
  updatedAt: string;
16
- agentId: string;
17
- projectId: string;
18
16
  tenantId: string;
17
+ agentId: string;
19
18
  description: string | null;
19
+ projectId: string;
20
+ prompt: string | null;
20
21
  models: {
21
22
  base?: {
22
23
  model?: string | undefined;
@@ -37,7 +38,6 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
37
38
  allowedProviders?: string[] | undefined;
38
39
  } | undefined;
39
40
  } | null;
40
- prompt: string | null;
41
41
  stopWhen: {
42
42
  stepCountIs?: number | undefined;
43
43
  } | null;
@@ -47,13 +47,14 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
47
47
  scopes: AgentScopeConfig;
48
48
  }) => Promise<{
49
49
  id: string;
50
- createdAt: string;
51
50
  name: string;
51
+ createdAt: string;
52
52
  updatedAt: string;
53
- agentId: string;
54
- projectId: string;
55
53
  tenantId: string;
54
+ agentId: string;
56
55
  description: string | null;
56
+ projectId: string;
57
+ prompt: string | null;
57
58
  models: {
58
59
  base?: {
59
60
  model?: string | undefined;
@@ -74,7 +75,6 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
74
75
  allowedProviders?: string[] | undefined;
75
76
  } | undefined;
76
77
  } | null;
77
- prompt: string | null;
78
78
  stopWhen: {
79
79
  stepCountIs?: number | undefined;
80
80
  } | null;
@@ -128,13 +128,14 @@ declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (param
128
128
  }>;
129
129
  declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAgentInsert) => Promise<{
130
130
  id: string;
131
- createdAt: string;
132
131
  name: string;
132
+ createdAt: string;
133
133
  updatedAt: string;
134
- agentId: string;
135
- projectId: string;
136
134
  tenantId: string;
135
+ agentId: string;
137
136
  description: string | null;
137
+ projectId: string;
138
+ prompt: string | null;
138
139
  models: {
139
140
  base?: {
140
141
  model?: string | undefined;
@@ -155,7 +156,6 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
155
156
  allowedProviders?: string[] | undefined;
156
157
  } | undefined;
157
158
  } | null;
158
- prompt: string | null;
159
159
  stopWhen: {
160
160
  stepCountIs?: number | undefined;
161
161
  } | null;
@@ -21,12 +21,12 @@ declare const getToolById: (db: AgentsManageDatabaseClient) => (params: {
21
21
  toolId: string;
22
22
  }) => Promise<{
23
23
  id: string;
24
- createdAt: string;
25
24
  name: string;
25
+ createdAt: string;
26
26
  updatedAt: string;
27
- projectId: string;
28
27
  tenantId: string;
29
28
  description: string | null;
29
+ projectId: string;
30
30
  config: {
31
31
  type: "mcp";
32
32
  mcp: ToolMcpConfig;
@@ -79,12 +79,12 @@ declare const listTools: (db: AgentsManageDatabaseClient) => (params: {
79
79
  }>;
80
80
  declare const createTool: (db: AgentsManageDatabaseClient) => (params: ToolInsert) => Promise<{
81
81
  id: string;
82
- createdAt: string;
83
82
  name: string;
83
+ createdAt: string;
84
84
  updatedAt: string;
85
- projectId: string;
86
85
  tenantId: string;
87
86
  description: string | null;
87
+ projectId: string;
88
88
  config: {
89
89
  type: "mcp";
90
90
  mcp: ToolMcpConfig;
@@ -138,9 +138,9 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
138
138
  id: string;
139
139
  createdAt: string;
140
140
  updatedAt: string;
141
+ tenantId: string;
141
142
  agentId: string;
142
143
  projectId: string;
143
- tenantId: string;
144
144
  subAgentId: string;
145
145
  toolId: string;
146
146
  headers: Record<string, string> | null;
@@ -157,9 +157,9 @@ declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params:
157
157
  id: string;
158
158
  createdAt: string;
159
159
  updatedAt: string;
160
+ tenantId: string;
160
161
  agentId: string;
161
162
  projectId: string;
162
- tenantId: string;
163
163
  subAgentId: string;
164
164
  toolId: string;
165
165
  headers: Record<string, string> | null;
@@ -185,9 +185,9 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
185
185
  id: string;
186
186
  createdAt: string;
187
187
  updatedAt: string;
188
+ tenantId: string;
188
189
  agentId: string;
189
190
  projectId: string;
190
- tenantId: string;
191
191
  subAgentId: string;
192
192
  toolId: string;
193
193
  headers: Record<string, string> | null;
@@ -203,12 +203,12 @@ declare const upsertTool: (db: AgentsManageDatabaseClient) => (params: {
203
203
  data: ToolInsert;
204
204
  }) => Promise<{
205
205
  id: string;
206
- createdAt: string;
207
206
  name: string;
207
+ createdAt: string;
208
208
  updatedAt: string;
209
- projectId: string;
210
209
  tenantId: string;
211
210
  description: string | null;
211
+ projectId: string;
212
212
  config: {
213
213
  type: "mcp";
214
214
  mcp: ToolMcpConfig;
@@ -23,20 +23,45 @@ import "../../utils/index.js";
23
23
  import { isGithubWorkAppTool } from "../runtime/github-work-app-installations.js";
24
24
  import { getCredentialReference, getUserScopedCredentialReference } from "./credentialReferences.js";
25
25
  import { and, count, desc, eq } from "drizzle-orm";
26
+ import { UnauthorizedError } from "@modelcontextprotocol/sdk/client/auth.js";
27
+ import { StreamableHTTPError } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
26
28
  import { ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
27
29
 
28
30
  //#region src/data-access/manage/tools.ts
29
31
  /**
30
- * Check if an error is a timeout/connection error.
32
+ * Check if an error is a timeout/connection error (transient, not auth-related).
31
33
  * Uses MCP SDK ErrorCode for proper type safety.
32
34
  */
33
35
  function isTimeoutOrConnectionError(error) {
34
- if (error instanceof McpError) return error.code === ErrorCode.RequestTimeout || error.code === ErrorCode.ConnectionClosed;
36
+ if (error instanceof McpError) return error.code === ErrorCode.RequestTimeout || error.code === ErrorCode.ConnectionClosed || error.code === ErrorCode.InternalError;
37
+ if (error instanceof StreamableHTTPError) return error.code !== void 0 && error.code >= 500;
35
38
  if (error instanceof Error) {
36
39
  const message = error.message.toLowerCase();
37
40
  const cause = error.cause;
38
- if (message.includes("timed out") || message.includes("timeout")) return true;
39
- if (cause?.code === "ETIMEDOUT" || cause?.code === "ECONNABORTED" || cause?.code === "ECONNRESET") return true;
41
+ if (message.includes("timed out") || message.includes("timeout") || message.includes("fetch failed")) return true;
42
+ if (cause?.code && [
43
+ "ETIMEDOUT",
44
+ "ECONNABORTED",
45
+ "ECONNRESET",
46
+ "ECONNREFUSED",
47
+ "ENOTFOUND",
48
+ "EHOSTUNREACH",
49
+ "ENETUNREACH",
50
+ "EPIPE"
51
+ ].includes(cause.code)) return true;
52
+ }
53
+ return false;
54
+ }
55
+ /**
56
+ * Check if an error indicates the credential is invalid/expired/revoked.
57
+ * These errors mean the user genuinely needs to re-authenticate.
58
+ */
59
+ function isAuthenticationError(error) {
60
+ if (error instanceof UnauthorizedError) return true;
61
+ if (error instanceof StreamableHTTPError) return error.code === 401 || error.code === 403;
62
+ if (error instanceof Error) {
63
+ const message = error.message.toLowerCase();
64
+ if (message.includes("unauthorized") || message.includes("forbidden") || message.includes("invalid_token") || message.includes("token expired") || message.includes("invalid_grant")) return true;
40
65
  }
41
66
  return false;
42
67
  }
@@ -243,6 +268,18 @@ const dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry, re
243
268
  if (isTimeoutOrConnectionError(error)) {
244
269
  status = "unavailable";
245
270
  lastErrorComputed = `Connection failed - the MCP server may be slow or temporarily unreachable.${error instanceof McpError ? ` (MCP error ${error.code})` : ""} ${errorMessage}`;
271
+ } else if (isAuthenticationError(error)) {
272
+ status = "needs_auth";
273
+ lastErrorComputed = `Authentication required - OAuth login needed. ${errorMessage}`;
274
+ } else if (credentialReference) {
275
+ logger.warn({
276
+ toolId: dbResult.id,
277
+ credentialId: credentialReference.id,
278
+ errorCode: error instanceof McpError ? error.code : void 0,
279
+ errorMessage
280
+ }, "MCP server discovery failed with existing credential — treating as transient");
281
+ status = "unavailable";
282
+ lastErrorComputed = `Server temporarily unavailable. ${errorMessage}`;
246
283
  } else {
247
284
  const toolNeedsAuth = await detectAuthenticationRequired({
248
285
  serverUrl: mcpServerUrl,
@@ -9,48 +9,48 @@ declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
9
9
  id: string;
10
10
  }) => Promise<{
11
11
  id: string;
12
- createdAt: string;
13
12
  name: string | null;
13
+ createdAt: string;
14
14
  updatedAt: string;
15
+ expiresAt: string | null;
16
+ tenantId: string;
15
17
  agentId: string;
16
18
  projectId: string;
17
- tenantId: string;
18
19
  publicId: string;
19
20
  keyHash: string;
20
21
  keyPrefix: string;
21
22
  lastUsedAt: string | null;
22
- expiresAt: string | null;
23
23
  } | undefined>;
24
24
  declare const getApiKeyByPublicId: (db: AgentsRunDatabaseClient) => (publicId: string) => Promise<{
25
25
  id: string;
26
- createdAt: string;
27
26
  name: string | null;
27
+ createdAt: string;
28
28
  updatedAt: string;
29
+ expiresAt: string | null;
30
+ tenantId: string;
29
31
  agentId: string;
30
32
  projectId: string;
31
- tenantId: string;
32
33
  publicId: string;
33
34
  keyHash: string;
34
35
  keyPrefix: string;
35
36
  lastUsedAt: string | null;
36
- expiresAt: string | null;
37
37
  } | undefined>;
38
38
  declare const listApiKeys: (db: AgentsRunDatabaseClient) => (params: {
39
39
  scopes: ProjectScopeConfig;
40
40
  agentId?: string;
41
41
  }) => Promise<{
42
42
  id: string;
43
- createdAt: string;
44
43
  name: string | null;
44
+ createdAt: string;
45
45
  updatedAt: string;
46
+ expiresAt: string | null;
47
+ tenantId: string;
46
48
  agentId: string;
47
49
  projectId: string;
48
- tenantId: string;
49
50
  publicId: string;
50
51
  keyHash: string;
51
52
  keyPrefix: string;
52
53
  lastUsedAt: string | null;
53
- expiresAt: string | null;
54
54
  }[]>;
55
55
  declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
56
56
  scopes: ProjectScopeConfig;
@@ -67,17 +67,17 @@ declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
67
67
  }>;
68
68
  declare const createApiKey: (db: AgentsRunDatabaseClient) => (params: ApiKeyInsert) => Promise<{
69
69
  id: string;
70
- createdAt: string;
71
70
  name: string | null;
71
+ createdAt: string;
72
72
  updatedAt: string;
73
+ expiresAt: string | null;
74
+ tenantId: string;
73
75
  agentId: string;
74
76
  projectId: string;
75
- tenantId: string;
76
77
  publicId: string;
77
78
  keyHash: string;
78
79
  keyPrefix: string;
79
80
  lastUsedAt: string | null;
80
- expiresAt: string | null;
81
81
  }>;
82
82
  declare const updateApiKey: (db: AgentsRunDatabaseClient) => (params: {
83
83
  scopes: ProjectScopeConfig;
@@ -7,14 +7,17 @@ import { AppInsert, AppSelect, AppUpdate } from "../../types/entities.js";
7
7
  declare const getAppById: (db: AgentsRunDatabaseClient) => (id: string) => Promise<{
8
8
  type: AppType;
9
9
  id: string;
10
- createdAt: string;
11
10
  name: string;
11
+ createdAt: string;
12
12
  updatedAt: string;
13
- projectId: string | null;
14
13
  tenantId: string | null;
15
14
  description: string | null;
16
- enabled: boolean;
15
+ projectId: string | null;
16
+ lastUsedAt: string | null;
17
+ defaultProjectId: string | null;
18
+ defaultAgentId: string | null;
17
19
  prompt: string | null;
20
+ enabled: boolean;
18
21
  config: {
19
22
  type: "web_client";
20
23
  webClient: {
@@ -35,9 +38,6 @@ declare const getAppById: (db: AgentsRunDatabaseClient) => (id: string) => Promi
35
38
  type: "api";
36
39
  api: Record<string, never>;
37
40
  };
38
- lastUsedAt: string | null;
39
- defaultProjectId: string | null;
40
- defaultAgentId: string | null;
41
41
  } | undefined>;
42
42
  declare const updateAppLastUsed: (db: AgentsRunDatabaseClient) => (id: string) => Promise<void>;
43
43
  declare const getAppByIdForTenant: (db: AgentsRunDatabaseClient) => (params: {
@@ -66,14 +66,17 @@ declare const listAppsPaginated: (db: AgentsRunDatabaseClient) => (params: {
66
66
  declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) => Promise<{
67
67
  type: AppType;
68
68
  id: string;
69
- createdAt: string;
70
69
  name: string;
70
+ createdAt: string;
71
71
  updatedAt: string;
72
- projectId: string | null;
73
72
  tenantId: string | null;
74
73
  description: string | null;
75
- enabled: boolean;
74
+ projectId: string | null;
75
+ lastUsedAt: string | null;
76
+ defaultProjectId: string | null;
77
+ defaultAgentId: string | null;
76
78
  prompt: string | null;
79
+ enabled: boolean;
77
80
  config: {
78
81
  type: "web_client";
79
82
  webClient: {
@@ -94,9 +97,6 @@ declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) =>
94
97
  type: "api";
95
98
  api: Record<string, never>;
96
99
  };
97
- lastUsedAt: string | null;
98
- defaultProjectId: string | null;
99
- defaultAgentId: string | null;
100
100
  }>;
101
101
  declare const updateAppForTenant: (db: AgentsRunDatabaseClient) => (params: {
102
102
  scopes: TenantScopeConfig;
@@ -16,21 +16,21 @@ declare const listConversations: (db: AgentsRunDatabaseClient) => (params: {
16
16
  }>;
17
17
  declare const createConversation: (db: AgentsRunDatabaseClient) => (params: ConversationInsert) => Promise<{
18
18
  id: string;
19
- createdAt: string;
20
- updatedAt: string;
21
- agentId: string | null;
22
- projectId: string;
23
- tenantId: string;
24
- title: string | null;
25
- metadata: ConversationMetadata | null;
26
- userId: string | null;
27
19
  ref: {
28
20
  type: "commit" | "tag" | "branch";
29
21
  name: string;
30
22
  hash: string;
31
23
  } | null;
24
+ createdAt: string;
25
+ updatedAt: string;
26
+ userId: string | null;
27
+ metadata: ConversationMetadata | null;
28
+ tenantId: string;
29
+ agentId: string | null;
32
30
  activeSubAgentId: string;
31
+ title: string | null;
33
32
  lastContextResolution: string | null;
33
+ projectId: string;
34
34
  }>;
35
35
  declare const updateConversation: (db: AgentsRunDatabaseClient) => (params: {
36
36
  scopes: ProjectScopeConfig;
@@ -85,21 +85,21 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
85
85
  conversationId: string;
86
86
  }) => Promise<{
87
87
  id: string;
88
- createdAt: string;
89
- updatedAt: string;
90
- agentId: string | null;
91
- projectId: string;
92
- tenantId: string;
93
- title: string | null;
94
- metadata: ConversationMetadata | null;
95
- userId: string | null;
96
88
  ref: {
97
89
  type: "commit" | "tag" | "branch";
98
90
  name: string;
99
91
  hash: string;
100
92
  } | null;
93
+ createdAt: string;
94
+ updatedAt: string;
95
+ userId: string | null;
96
+ metadata: ConversationMetadata | null;
97
+ tenantId: string;
98
+ agentId: string | null;
101
99
  activeSubAgentId: string;
100
+ title: string | null;
102
101
  lastContextResolution: string | null;
102
+ projectId: string;
103
103
  } | undefined>;
104
104
  declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input: ConversationInsert) => Promise<{
105
105
  activeSubAgentId: string;
@@ -121,21 +121,21 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
121
121
  contextConfigId?: string | undefined;
122
122
  } | {
123
123
  id: string;
124
- createdAt: string;
125
- updatedAt: string;
126
- agentId: string | null;
127
- projectId: string;
128
- tenantId: string;
129
- title: string | null;
130
- metadata: ConversationMetadata | null;
131
- userId: string | null;
132
124
  ref: {
133
125
  type: "commit" | "tag" | "branch";
134
126
  name: string;
135
127
  hash: string;
136
128
  } | null;
129
+ createdAt: string;
130
+ updatedAt: string;
131
+ userId: string | null;
132
+ metadata: ConversationMetadata | null;
133
+ tenantId: string;
134
+ agentId: string | null;
137
135
  activeSubAgentId: string;
136
+ title: string | null;
138
137
  lastContextResolution: string | null;
138
+ projectId: string;
139
139
  }>;
140
140
  /**
141
141
  * Get conversation history with filtering and context management
@@ -153,21 +153,21 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
153
153
  conversationId: string;
154
154
  }) => Promise<{
155
155
  id: string;
156
- createdAt: string;
157
- updatedAt: string;
158
- agentId: string | null;
159
- projectId: string;
160
- tenantId: string;
161
- title: string | null;
162
- metadata: ConversationMetadata | null;
163
- userId: string | null;
164
156
  ref: {
165
157
  type: "commit" | "tag" | "branch";
166
158
  name: string;
167
159
  hash: string;
168
160
  } | null;
161
+ createdAt: string;
162
+ updatedAt: string;
163
+ userId: string | null;
164
+ metadata: ConversationMetadata | null;
165
+ tenantId: string;
166
+ agentId: string | null;
169
167
  activeSubAgentId: string;
168
+ title: string | null;
170
169
  lastContextResolution: string | null;
170
+ projectId: string;
171
171
  } | undefined>;
172
172
  /**
173
173
  * Set active agent for a conversation (upsert operation)
@@ -13,23 +13,23 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
13
13
  id: string;
14
14
  createdAt: string;
15
15
  updatedAt: string;
16
- projectId: string;
17
- tenantId: string;
18
16
  metadata: MessageMetadata | null;
19
- content: MessageContent;
17
+ role: string;
18
+ tenantId: string;
19
+ projectId: string;
20
+ conversationId: string;
20
21
  fromSubAgentId: string | null;
21
22
  toSubAgentId: string | null;
22
23
  fromExternalAgentId: string | null;
23
24
  toExternalAgentId: string | null;
24
- taskId: string | null;
25
- a2aTaskId: string | null;
26
- conversationId: string;
27
- role: string;
28
25
  fromTeamAgentId: string | null;
29
26
  toTeamAgentId: string | null;
27
+ content: MessageContent;
30
28
  visibility: string;
31
29
  messageType: string;
30
+ taskId: string | null;
32
31
  parentMessageId: string | null;
32
+ a2aTaskId: string | null;
33
33
  a2aSessionId: string | null;
34
34
  } | undefined>;
35
35
  declare const listMessages: (db: AgentsRunDatabaseClient) => (params: {
@@ -147,23 +147,23 @@ declare const createMessage: (db: AgentsRunDatabaseClient) => (params: {
147
147
  id: string;
148
148
  createdAt: string;
149
149
  updatedAt: string;
150
- projectId: string;
151
- tenantId: string;
152
150
  metadata: MessageMetadata | null;
153
- content: MessageContent;
151
+ role: string;
152
+ tenantId: string;
153
+ projectId: string;
154
+ conversationId: string;
154
155
  fromSubAgentId: string | null;
155
156
  toSubAgentId: string | null;
156
157
  fromExternalAgentId: string | null;
157
158
  toExternalAgentId: string | null;
158
- taskId: string | null;
159
- a2aTaskId: string | null;
160
- conversationId: string;
161
- role: string;
162
159
  fromTeamAgentId: string | null;
163
160
  toTeamAgentId: string | null;
161
+ content: MessageContent;
164
162
  visibility: string;
165
163
  messageType: string;
164
+ taskId: string | null;
166
165
  parentMessageId: string | null;
166
+ a2aTaskId: string | null;
167
167
  a2aSessionId: string | null;
168
168
  }>;
169
169
  declare const updateMessage: (db: AgentsRunDatabaseClient) => (params: {
@@ -200,23 +200,23 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
200
200
  id: string;
201
201
  createdAt: string;
202
202
  updatedAt: string;
203
- projectId: string;
204
- tenantId: string;
205
203
  metadata: MessageMetadata | null;
206
- content: MessageContent;
204
+ role: string;
205
+ tenantId: string;
206
+ projectId: string;
207
+ conversationId: string;
207
208
  fromSubAgentId: string | null;
208
209
  toSubAgentId: string | null;
209
210
  fromExternalAgentId: string | null;
210
211
  toExternalAgentId: string | null;
211
- taskId: string | null;
212
- a2aTaskId: string | null;
213
- conversationId: string;
214
- role: string;
215
212
  fromTeamAgentId: string | null;
216
213
  toTeamAgentId: string | null;
214
+ content: MessageContent;
217
215
  visibility: string;
218
216
  messageType: string;
217
+ taskId: string | null;
219
218
  parentMessageId: string | null;
219
+ a2aTaskId: string | null;
220
220
  a2aSessionId: string | null;
221
221
  }>;
222
222
  declare const countMessagesByConversation: (db: AgentsRunDatabaseClient) => (params: {
@@ -40,7 +40,7 @@ declare const listScheduledTriggerInvocationsPaginated: (db: AgentsRunDatabaseCl
40
40
  name: string;
41
41
  hash: string;
42
42
  } | null;
43
- status: "pending" | "failed" | "running" | "completed" | "cancelled";
43
+ status: "pending" | "running" | "completed" | "failed" | "cancelled";
44
44
  scheduledFor: string;
45
45
  startedAt: string | null;
46
46
  completedAt: string | null;
@@ -194,7 +194,7 @@ declare const listUpcomingInvocationsForAgentPaginated: (db: AgentsRunDatabaseCl
194
194
  name: string;
195
195
  hash: string;
196
196
  } | null;
197
- status: "pending" | "failed" | "running" | "completed" | "cancelled";
197
+ status: "pending" | "running" | "completed" | "failed" | "cancelled";
198
198
  scheduledFor: string;
199
199
  startedAt: string | null;
200
200
  completedAt: string | null;
@@ -233,7 +233,7 @@ declare const listProjectScheduledTriggerInvocationsPaginated: (db: AgentsRunDat
233
233
  name: string;
234
234
  hash: string;
235
235
  } | null;
236
- status: "pending" | "failed" | "running" | "completed" | "cancelled";
236
+ status: "pending" | "running" | "completed" | "failed" | "cancelled";
237
237
  scheduledFor: string;
238
238
  startedAt: string | null;
239
239
  completedAt: string | null;
@@ -285,7 +285,7 @@ declare const listScheduledTriggerInvocationsByTriggerId: (db: AgentsRunDatabase
285
285
  name: string;
286
286
  hash: string;
287
287
  } | null;
288
- status: "pending" | "failed" | "running" | "completed" | "cancelled";
288
+ status: "pending" | "running" | "completed" | "failed" | "cancelled";
289
289
  scheduledFor: string;
290
290
  startedAt: string | null;
291
291
  completedAt: string | null;