@inkeep/agents-core 0.65.1 → 0.66.0
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.
- package/dist/_virtual/rolldown_runtime.js +25 -1
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/constants/index.d.ts +14 -0
- package/dist/constants/index.js +15 -0
- package/dist/constants/relation-types.d.ts +5 -0
- package/dist/constants/relation-types.js +6 -0
- package/dist/constants/session-events.d.ts +13 -0
- package/dist/constants/session-events.js +14 -0
- package/dist/constants/tool-names.d.ts +7 -0
- package/dist/constants/tool-names.js +8 -0
- package/dist/constants/workflow.d.ts +7 -0
- package/dist/constants/workflow.js +8 -0
- package/dist/data-access/index.d.ts +3 -3
- package/dist/data-access/manage/agentFull.d.ts +7 -10
- package/dist/data-access/manage/agentFull.js +26 -28
- package/dist/data-access/manage/agents.d.ts +47 -47
- package/dist/data-access/manage/artifactComponents.d.ts +10 -10
- package/dist/data-access/manage/contextConfigs.d.ts +12 -12
- package/dist/data-access/manage/dataComponents.d.ts +4 -4
- package/dist/data-access/manage/dataComponents.js +1 -1
- package/dist/data-access/manage/functionTools.d.ts +16 -16
- package/dist/data-access/manage/projectFull.d.ts +6 -8
- package/dist/data-access/manage/projectFull.js +18 -18
- package/dist/data-access/manage/skills.d.ts +12 -12
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgentRelations.d.ts +20 -20
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgents.d.ts +21 -21
- package/dist/data-access/manage/tools.d.ts +24 -24
- package/dist/data-access/manage/triggers.d.ts +4 -4
- package/dist/data-access/runtime/apiKeys.d.ts +16 -16
- package/dist/data-access/runtime/apps.d.ts +10 -10
- package/dist/data-access/runtime/conversations.d.ts +24 -24
- package/dist/data-access/runtime/feedback.d.ts +4 -4
- package/dist/data-access/runtime/messages.d.ts +12 -12
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +4 -4
- package/dist/data-access/runtime/scheduledTriggerUsers.d.ts +1 -1
- package/dist/data-access/runtime/tasks.d.ts +5 -5
- package/dist/db/manage/dolt-safe-jsonb.d.ts +2 -2
- package/dist/db/manage/manage-client.js +15 -3
- package/dist/db/manage/manage-schema.d.ts +358 -358
- package/dist/db/runtime/runtime-client.js +7 -1
- package/dist/db/runtime/runtime-schema.d.ts +373 -373
- package/dist/dolt/merge.js +7 -9
- package/dist/dolt/ref-middleware.js +2 -2
- package/dist/dolt/ref-scope.js +9 -3
- package/dist/index.d.ts +9 -5
- package/dist/index.js +7 -3
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +77 -0
- package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.js +1356 -0
- package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js +1119 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js +982 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/index.js +4 -0
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/utils.js +3 -0
- package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js +1821 -0
- package/dist/node_modules/.pnpm/@vitest_spy@3.2.4/node_modules/@vitest/spy/dist/index.js +171 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +124 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.js +1334 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.js +105 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.js +118 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.js +455 -0
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/source-map.js +168 -0
- package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +3087 -0
- package/dist/node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.js +384 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +11 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +16 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +11 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +15 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +13 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +34 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +12 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +122 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +39 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +99 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +25 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +14 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +21 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +6 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +12 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +18 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +25 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +8 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +30 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +939 -0
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js +81 -0
- package/dist/node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.js +51 -0
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +81 -0
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.js +9 -0
- package/dist/node_modules/.pnpm/tinyspy@4.0.4/node_modules/tinyspy/dist/index.js +125 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +8 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +50 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +48 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +2613 -0
- package/dist/test-utils/index.d.ts +2 -0
- package/dist/test-utils/index.js +3 -0
- package/dist/test-utils/mocks/index.d.ts +2 -0
- package/dist/test-utils/mocks/index.js +3 -0
- package/dist/test-utils/mocks/logger.d.ts +27 -0
- package/dist/test-utils/mocks/logger.js +48 -0
- package/dist/utils/error.d.ts +58 -52
- package/dist/utils/error.js +63 -21
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.js +3 -3
- package/dist/utils/jwt-helpers.js +1 -1
- package/dist/utils/logger.d.ts +21 -2
- package/dist/utils/logger.js +67 -11
- package/dist/utils/third-party-mcp-servers/composio-client.js +10 -10
- package/dist/utils/tracer-factory.js +1 -1
- package/dist/validation/schemas/skills.d.ts +45 -45
- package/dist/validation/schemas.d.ts +2289 -2289
- package/drizzle/runtime/meta/_journal.json +2 -2
- package/package.json +5 -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
|
-
title: string | null;
|
|
19
18
|
id: string;
|
|
20
|
-
tenantId: string;
|
|
21
19
|
createdAt: string;
|
|
22
|
-
|
|
20
|
+
updatedAt: string;
|
|
23
21
|
ref: {
|
|
24
22
|
type: "commit" | "tag" | "branch";
|
|
25
23
|
name: string;
|
|
26
24
|
hash: string;
|
|
27
25
|
} | null;
|
|
28
|
-
updatedAt: string;
|
|
29
|
-
projectId: string;
|
|
30
|
-
agentId: string | null;
|
|
31
26
|
userId: string | null;
|
|
27
|
+
metadata: ConversationMetadata | null;
|
|
28
|
+
agentId: string | null;
|
|
29
|
+
projectId: string;
|
|
30
|
+
tenantId: string;
|
|
31
|
+
title: string | null;
|
|
32
32
|
activeSubAgentId: string;
|
|
33
33
|
lastContextResolution: string | null;
|
|
34
34
|
}>;
|
|
@@ -84,20 +84,20 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
84
84
|
scopes: ProjectScopeConfig;
|
|
85
85
|
conversationId: string;
|
|
86
86
|
}) => Promise<{
|
|
87
|
-
title: string | null;
|
|
88
87
|
id: string;
|
|
89
|
-
tenantId: string;
|
|
90
88
|
createdAt: string;
|
|
91
|
-
|
|
89
|
+
updatedAt: string;
|
|
92
90
|
ref: {
|
|
93
91
|
type: "commit" | "tag" | "branch";
|
|
94
92
|
name: string;
|
|
95
93
|
hash: string;
|
|
96
94
|
} | null;
|
|
97
|
-
updatedAt: string;
|
|
98
|
-
projectId: string;
|
|
99
|
-
agentId: string | null;
|
|
100
95
|
userId: string | null;
|
|
96
|
+
metadata: ConversationMetadata | null;
|
|
97
|
+
agentId: string | null;
|
|
98
|
+
projectId: string;
|
|
99
|
+
tenantId: string;
|
|
100
|
+
title: string | null;
|
|
101
101
|
activeSubAgentId: string;
|
|
102
102
|
lastContextResolution: string | null;
|
|
103
103
|
} | undefined>;
|
|
@@ -120,20 +120,20 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
|
|
|
120
120
|
metadata?: ConversationMetadata | null | undefined;
|
|
121
121
|
contextConfigId?: string | undefined;
|
|
122
122
|
} | {
|
|
123
|
-
title: string | null;
|
|
124
123
|
id: string;
|
|
125
|
-
tenantId: string;
|
|
126
124
|
createdAt: string;
|
|
127
|
-
|
|
125
|
+
updatedAt: string;
|
|
128
126
|
ref: {
|
|
129
127
|
type: "commit" | "tag" | "branch";
|
|
130
128
|
name: string;
|
|
131
129
|
hash: string;
|
|
132
130
|
} | null;
|
|
133
|
-
updatedAt: string;
|
|
134
|
-
projectId: string;
|
|
135
|
-
agentId: string | null;
|
|
136
131
|
userId: string | null;
|
|
132
|
+
metadata: ConversationMetadata | null;
|
|
133
|
+
agentId: string | null;
|
|
134
|
+
projectId: string;
|
|
135
|
+
tenantId: string;
|
|
136
|
+
title: string | null;
|
|
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
|
-
title: string | null;
|
|
156
155
|
id: string;
|
|
157
|
-
tenantId: string;
|
|
158
156
|
createdAt: string;
|
|
159
|
-
|
|
157
|
+
updatedAt: string;
|
|
160
158
|
ref: {
|
|
161
159
|
type: "commit" | "tag" | "branch";
|
|
162
160
|
name: string;
|
|
163
161
|
hash: string;
|
|
164
162
|
} | null;
|
|
165
|
-
updatedAt: string;
|
|
166
|
-
projectId: string;
|
|
167
|
-
agentId: string | null;
|
|
168
163
|
userId: string | null;
|
|
164
|
+
metadata: ConversationMetadata | null;
|
|
165
|
+
agentId: string | null;
|
|
166
|
+
projectId: string;
|
|
167
|
+
tenantId: string;
|
|
168
|
+
title: string | null;
|
|
169
169
|
activeSubAgentId: string;
|
|
170
170
|
lastContextResolution: string | null;
|
|
171
171
|
} | undefined>;
|
|
@@ -58,12 +58,12 @@ declare const listFeedback: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
58
58
|
total: number;
|
|
59
59
|
}>;
|
|
60
60
|
declare const createFeedback: (db: AgentsRunDatabaseClient) => (params: FeedbackInsert) => Promise<{
|
|
61
|
-
type: "positive" | "negative";
|
|
62
61
|
id: string;
|
|
63
|
-
tenantId: string;
|
|
64
62
|
createdAt: string;
|
|
65
63
|
updatedAt: string;
|
|
64
|
+
type: "positive" | "negative";
|
|
66
65
|
projectId: string;
|
|
66
|
+
tenantId: string;
|
|
67
67
|
details: string | null;
|
|
68
68
|
conversationId: string;
|
|
69
69
|
messageId: string | null;
|
|
@@ -87,12 +87,12 @@ declare const deleteFeedback: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
87
87
|
scopes: ProjectScopeConfig;
|
|
88
88
|
feedbackId: string;
|
|
89
89
|
}) => Promise<{
|
|
90
|
-
type: "positive" | "negative";
|
|
91
90
|
id: string;
|
|
92
|
-
tenantId: string;
|
|
93
91
|
createdAt: string;
|
|
94
92
|
updatedAt: string;
|
|
93
|
+
type: "positive" | "negative";
|
|
95
94
|
projectId: string;
|
|
95
|
+
tenantId: string;
|
|
96
96
|
details: string | null;
|
|
97
97
|
conversationId: string;
|
|
98
98
|
messageId: string | null;
|
|
@@ -11,13 +11,13 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
11
11
|
messageId: string;
|
|
12
12
|
}) => Promise<{
|
|
13
13
|
id: string;
|
|
14
|
-
tenantId: string;
|
|
15
14
|
createdAt: string;
|
|
16
|
-
metadata: MessageMetadata | null;
|
|
17
|
-
content: MessageContent;
|
|
18
15
|
updatedAt: string;
|
|
19
|
-
|
|
16
|
+
metadata: MessageMetadata | null;
|
|
20
17
|
role: string;
|
|
18
|
+
projectId: string;
|
|
19
|
+
tenantId: string;
|
|
20
|
+
content: MessageContent;
|
|
21
21
|
fromSubAgentId: string | null;
|
|
22
22
|
toSubAgentId: string | null;
|
|
23
23
|
fromExternalAgentId: string | null;
|
|
@@ -145,13 +145,13 @@ declare const createMessage: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
145
145
|
data: Omit<MessageInsert, "tenantId" | "projectId">;
|
|
146
146
|
}) => Promise<{
|
|
147
147
|
id: string;
|
|
148
|
-
tenantId: string;
|
|
149
148
|
createdAt: string;
|
|
150
|
-
metadata: MessageMetadata | null;
|
|
151
|
-
content: MessageContent;
|
|
152
149
|
updatedAt: string;
|
|
153
|
-
|
|
150
|
+
metadata: MessageMetadata | null;
|
|
154
151
|
role: string;
|
|
152
|
+
projectId: string;
|
|
153
|
+
tenantId: string;
|
|
154
|
+
content: MessageContent;
|
|
155
155
|
fromSubAgentId: string | null;
|
|
156
156
|
toSubAgentId: string | null;
|
|
157
157
|
fromExternalAgentId: string | null;
|
|
@@ -198,13 +198,13 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
198
198
|
messageId: string;
|
|
199
199
|
}) => Promise<{
|
|
200
200
|
id: string;
|
|
201
|
-
tenantId: string;
|
|
202
201
|
createdAt: string;
|
|
203
|
-
metadata: MessageMetadata | null;
|
|
204
|
-
content: MessageContent;
|
|
205
202
|
updatedAt: string;
|
|
206
|
-
|
|
203
|
+
metadata: MessageMetadata | null;
|
|
207
204
|
role: string;
|
|
205
|
+
projectId: string;
|
|
206
|
+
tenantId: string;
|
|
207
|
+
content: MessageContent;
|
|
208
208
|
fromSubAgentId: string | null;
|
|
209
209
|
toSubAgentId: string | null;
|
|
210
210
|
fromExternalAgentId: string | null;
|
|
@@ -40,7 +40,7 @@ declare const listScheduledTriggerInvocationsPaginated: (db: AgentsRunDatabaseCl
|
|
|
40
40
|
name: string;
|
|
41
41
|
hash: string;
|
|
42
42
|
} | null;
|
|
43
|
-
status: "pending" | "
|
|
43
|
+
status: "pending" | "failed" | "running" | "completed" | "cancelled";
|
|
44
44
|
scheduledFor: string;
|
|
45
45
|
startedAt: string | null;
|
|
46
46
|
completedAt: string | null;
|
|
@@ -199,7 +199,7 @@ declare const listUpcomingInvocationsForAgentPaginated: (db: AgentsRunDatabaseCl
|
|
|
199
199
|
name: string;
|
|
200
200
|
hash: string;
|
|
201
201
|
} | null;
|
|
202
|
-
status: "pending" | "
|
|
202
|
+
status: "pending" | "failed" | "running" | "completed" | "cancelled";
|
|
203
203
|
scheduledFor: string;
|
|
204
204
|
startedAt: string | null;
|
|
205
205
|
completedAt: string | null;
|
|
@@ -239,7 +239,7 @@ declare const listProjectScheduledTriggerInvocationsPaginated: (db: AgentsRunDat
|
|
|
239
239
|
name: string;
|
|
240
240
|
hash: string;
|
|
241
241
|
} | null;
|
|
242
|
-
status: "pending" | "
|
|
242
|
+
status: "pending" | "failed" | "running" | "completed" | "cancelled";
|
|
243
243
|
scheduledFor: string;
|
|
244
244
|
startedAt: string | null;
|
|
245
245
|
completedAt: string | null;
|
|
@@ -292,7 +292,7 @@ declare const listScheduledTriggerInvocationsByTriggerId: (db: AgentsRunDatabase
|
|
|
292
292
|
name: string;
|
|
293
293
|
hash: string;
|
|
294
294
|
} | null;
|
|
295
|
-
status: "pending" | "
|
|
295
|
+
status: "pending" | "failed" | "running" | "completed" | "cancelled";
|
|
296
296
|
scheduledFor: string;
|
|
297
297
|
startedAt: string | null;
|
|
298
298
|
completedAt: 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,19 +7,19 @@ 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
|
-
status: string;
|
|
11
10
|
id: string;
|
|
12
|
-
tenantId: string;
|
|
13
11
|
createdAt: string;
|
|
14
|
-
|
|
12
|
+
updatedAt: string;
|
|
15
13
|
ref: {
|
|
16
14
|
type: "commit" | "tag" | "branch";
|
|
17
15
|
name: string;
|
|
18
16
|
hash: string;
|
|
19
17
|
} | null;
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
metadata: TaskMetadataConfig | null;
|
|
19
|
+
status: string;
|
|
22
20
|
agentId: string;
|
|
21
|
+
projectId: string;
|
|
22
|
+
tenantId: string;
|
|
23
23
|
subAgentId: string;
|
|
24
24
|
contextId: string;
|
|
25
25
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as drizzle_orm_pg_core1846 from "drizzle-orm/pg-core";
|
|
2
2
|
|
|
3
3
|
//#region src/db/manage/dolt-safe-jsonb.d.ts
|
|
4
4
|
declare function encodeBackslashes(value: unknown): unknown;
|
|
@@ -7,6 +7,6 @@ declare function decodeBackslashes(value: unknown): unknown;
|
|
|
7
7
|
* Drop-in replacement for drizzle-orm's `jsonb()`.
|
|
8
8
|
* Encodes backslashes on write and decodes on read to work around the Doltgres bug.
|
|
9
9
|
*/
|
|
10
|
-
declare function jsonb(name: string): ReturnType<typeof
|
|
10
|
+
declare function jsonb(name: string): ReturnType<typeof drizzle_orm_pg_core1846.jsonb>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { decodeBackslashes, encodeBackslashes, jsonb };
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { manage_schema_exports } from "./manage-schema.js";
|
|
2
2
|
import { env, loadEnvironmentFiles } from "../../env.js";
|
|
3
|
+
import { getLogger } from "../../utils/logger.js";
|
|
4
|
+
import { getDatabaseErrorLogContext } from "../../utils/error.js";
|
|
3
5
|
import { createTestManageDatabaseClientNoMigrations } from "./test-manage-client.js";
|
|
4
6
|
import { drizzle } from "drizzle-orm/node-postgres";
|
|
5
7
|
import { Pool } from "pg";
|
|
6
8
|
|
|
7
9
|
//#region src/db/manage/manage-client.ts
|
|
8
10
|
loadEnvironmentFiles();
|
|
11
|
+
const managePoolLogger = getLogger("manage-db-pool");
|
|
9
12
|
function createAgentsManageDatabasePool(config) {
|
|
10
13
|
const connectionString = config.connectionString || env.INKEEP_AGENTS_MANAGE_DATABASE_URL;
|
|
11
14
|
if (!connectionString) throw new Error("INKEEP_AGENTS_MANAGE_DATABASE_URL environment variable is required. Please set it to your PostgreSQL connection string.");
|
|
@@ -18,7 +21,10 @@ function createAgentsManageDatabasePool(config) {
|
|
|
18
21
|
idleTimeoutMillis: 3e4
|
|
19
22
|
});
|
|
20
23
|
pool.on("error", (err) => {
|
|
21
|
-
|
|
24
|
+
managePoolLogger.error({
|
|
25
|
+
error: err,
|
|
26
|
+
...getDatabaseErrorLogContext(err)
|
|
27
|
+
}, "Unexpected error on agents manage database pool (Doltgres)");
|
|
22
28
|
});
|
|
23
29
|
return pool;
|
|
24
30
|
}
|
|
@@ -38,7 +44,10 @@ function createAgentsManageDatabaseClient(config) {
|
|
|
38
44
|
idleTimeoutMillis: 3e4
|
|
39
45
|
});
|
|
40
46
|
pool.on("error", (err) => {
|
|
41
|
-
|
|
47
|
+
managePoolLogger.error({
|
|
48
|
+
error: err,
|
|
49
|
+
...getDatabaseErrorLogContext(err)
|
|
50
|
+
}, "Unexpected error on agents manage database pool (Doltgres)");
|
|
42
51
|
});
|
|
43
52
|
return drizzle(pool, {
|
|
44
53
|
schema: manage_schema_exports,
|
|
@@ -57,7 +66,10 @@ function createAgentManageDatabaseConnection(config) {
|
|
|
57
66
|
connectionTimeoutMillis: 1e4
|
|
58
67
|
});
|
|
59
68
|
pool.on("error", (err) => {
|
|
60
|
-
|
|
69
|
+
managePoolLogger.error({
|
|
70
|
+
error: err,
|
|
71
|
+
...getDatabaseErrorLogContext(err)
|
|
72
|
+
}, "Unexpected error on agents manage database pool (Doltgres)");
|
|
61
73
|
});
|
|
62
74
|
return pool.connect().then((connection) => {
|
|
63
75
|
const db = drizzle(connection, {
|