@inkeep/agents-core 0.65.0 → 0.65.2
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/auth/auth-schema.d.ts +108 -108
- package/dist/auth/auth-validation-schemas.d.ts +154 -154
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/client-exports.d.ts +3 -3
- package/dist/client-exports.js +3 -3
- package/dist/constants/otel-attributes.d.ts +1 -0
- package/dist/constants/otel-attributes.js +1 -0
- package/dist/data-access/index.d.ts +2 -1
- package/dist/data-access/index.js +2 -1
- package/dist/data-access/manage/agents.d.ts +25 -25
- 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 +10 -10
- package/dist/data-access/manage/skills.d.ts +12 -12
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgentRelations.d.ts +20 -20
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgents.d.ts +15 -15
- package/dist/data-access/manage/tools.d.ts +27 -27
- package/dist/data-access/manage/triggers.d.ts +2 -2
- package/dist/data-access/runtime/apiKeys.d.ts +12 -12
- package/dist/data-access/runtime/apps.d.ts +10 -10
- package/dist/data-access/runtime/conversations.d.ts +16 -16
- package/dist/data-access/runtime/feedback.d.ts +101 -0
- package/dist/data-access/runtime/feedback.js +83 -0
- 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 +3 -3
- 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 +449 -449
- package/dist/db/runtime/runtime-client.js +7 -1
- package/dist/db/runtime/runtime-schema.d.ts +543 -365
- package/dist/db/runtime/runtime-schema.js +73 -2
- package/dist/dolt/merge.js +7 -9
- package/dist/dolt/ref-scope.js +9 -3
- package/dist/index.d.ts +8 -7
- package/dist/index.js +7 -6
- package/dist/types/entities.d.ts +5 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/error.d.ts +7 -1
- 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/logger.d.ts +21 -2
- package/dist/utils/logger.js +67 -11
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/index.d.ts +3 -3
- package/dist/validation/index.js +3 -3
- package/dist/validation/schemas/shared.d.ts +3 -1
- package/dist/validation/schemas/shared.js +6 -1
- package/dist/validation/schemas/skills.d.ts +41 -41
- package/dist/validation/schemas.d.ts +2567 -2139
- package/dist/validation/schemas.js +29 -6
- package/drizzle/runtime/0034_simple_sphinx.sql +17 -0
- package/drizzle/runtime/meta/0034_snapshot.json +5288 -0
- package/drizzle/runtime/meta/_journal.json +8 -1
- package/package.json +1 -1
|
@@ -18,6 +18,8 @@ var runtime_schema_exports = /* @__PURE__ */ __exportAll({
|
|
|
18
18
|
deviceCode: () => deviceCode,
|
|
19
19
|
evaluationResult: () => evaluationResult,
|
|
20
20
|
evaluationRun: () => evaluationRun,
|
|
21
|
+
feedback: () => feedback,
|
|
22
|
+
feedbackRelations: () => feedbackRelations,
|
|
21
23
|
invitation: () => invitation,
|
|
22
24
|
ledgerArtifacts: () => ledgerArtifacts,
|
|
23
25
|
ledgerArtifactsRelations: () => ledgerArtifactsRelations,
|
|
@@ -434,6 +436,48 @@ const messages = pgTable("messages", {
|
|
|
434
436
|
],
|
|
435
437
|
name: "messages_conversation_fk"
|
|
436
438
|
}).onDelete("cascade")]);
|
|
439
|
+
const feedback = pgTable("feedback", {
|
|
440
|
+
...projectScoped,
|
|
441
|
+
conversationId: varchar("conversation_id", { length: 256 }).notNull(),
|
|
442
|
+
messageId: varchar("message_id", { length: 256 }),
|
|
443
|
+
type: varchar("type", { length: 20 }).$type().notNull(),
|
|
444
|
+
details: text("details"),
|
|
445
|
+
...timestamps
|
|
446
|
+
}, (table) => [
|
|
447
|
+
primaryKey({ columns: [
|
|
448
|
+
table.tenantId,
|
|
449
|
+
table.projectId,
|
|
450
|
+
table.id
|
|
451
|
+
] }),
|
|
452
|
+
index("feedback_conversation_id_idx").on(table.tenantId, table.projectId, table.conversationId),
|
|
453
|
+
index("feedback_message_id_idx").on(table.tenantId, table.projectId, table.messageId),
|
|
454
|
+
foreignKey({
|
|
455
|
+
columns: [
|
|
456
|
+
table.tenantId,
|
|
457
|
+
table.projectId,
|
|
458
|
+
table.conversationId
|
|
459
|
+
],
|
|
460
|
+
foreignColumns: [
|
|
461
|
+
conversations.tenantId,
|
|
462
|
+
conversations.projectId,
|
|
463
|
+
conversations.id
|
|
464
|
+
],
|
|
465
|
+
name: "feedback_conversation_fk"
|
|
466
|
+
}).onDelete("cascade"),
|
|
467
|
+
foreignKey({
|
|
468
|
+
columns: [
|
|
469
|
+
table.tenantId,
|
|
470
|
+
table.projectId,
|
|
471
|
+
table.messageId
|
|
472
|
+
],
|
|
473
|
+
foreignColumns: [
|
|
474
|
+
messages.tenantId,
|
|
475
|
+
messages.projectId,
|
|
476
|
+
messages.id
|
|
477
|
+
],
|
|
478
|
+
name: "feedback_message_fk"
|
|
479
|
+
}).onDelete("cascade")
|
|
480
|
+
]);
|
|
437
481
|
const taskRelations = pgTable("task_relations", {
|
|
438
482
|
...projectScoped,
|
|
439
483
|
parentTaskId: varchar("parent_task_id", { length: 256 }).notNull(),
|
|
@@ -719,7 +763,34 @@ const messagesRelations = relations(messages, ({ one, many }) => ({
|
|
|
719
763
|
references: [messages.id],
|
|
720
764
|
relationName: "parentChild"
|
|
721
765
|
}),
|
|
722
|
-
childMessages: many(messages, { relationName: "parentChild" })
|
|
766
|
+
childMessages: many(messages, { relationName: "parentChild" }),
|
|
767
|
+
feedback: many(feedback)
|
|
768
|
+
}));
|
|
769
|
+
const feedbackRelations = relations(feedback, ({ one }) => ({
|
|
770
|
+
conversation: one(conversations, {
|
|
771
|
+
fields: [
|
|
772
|
+
feedback.tenantId,
|
|
773
|
+
feedback.projectId,
|
|
774
|
+
feedback.conversationId
|
|
775
|
+
],
|
|
776
|
+
references: [
|
|
777
|
+
conversations.tenantId,
|
|
778
|
+
conversations.projectId,
|
|
779
|
+
conversations.id
|
|
780
|
+
]
|
|
781
|
+
}),
|
|
782
|
+
message: one(messages, {
|
|
783
|
+
fields: [
|
|
784
|
+
feedback.tenantId,
|
|
785
|
+
feedback.projectId,
|
|
786
|
+
feedback.messageId
|
|
787
|
+
],
|
|
788
|
+
references: [
|
|
789
|
+
messages.tenantId,
|
|
790
|
+
messages.projectId,
|
|
791
|
+
messages.id
|
|
792
|
+
]
|
|
793
|
+
})
|
|
723
794
|
}));
|
|
724
795
|
const tasksRelations = relations(tasks, ({ many }) => ({
|
|
725
796
|
messages: many(messages),
|
|
@@ -942,4 +1013,4 @@ const orgEntitlement = pgTable("org_entitlement", {
|
|
|
942
1013
|
]);
|
|
943
1014
|
|
|
944
1015
|
//#endregion
|
|
945
|
-
export { USAGE_GENERATION_TYPES, account, apiKeys, apps, contextCache, conversations, conversationsRelations, datasetRun, datasetRunConversationRelations, deviceCode, evaluationResult, evaluationRun, invitation, ledgerArtifacts, ledgerArtifactsRelations, member, messages, messagesRelations, orgEntitlement, organization, projectMetadata, runtime_schema_exports, scheduledTriggerInvocations, scheduledTriggerUsers, scheduledTriggers, schedulerState, session, ssoProvider, streamChunks, taskRelations, taskRelationsRelations, tasks, tasksRelations, triggerInvocations, user, userProfile, userProfileRelations, verification, workAppGitHubInstallations, workAppGitHubInstallationsRelations, workAppGitHubMcpToolAccessMode, workAppGitHubMcpToolRepositoryAccess, workAppGitHubMcpToolRepositoryAccessRelations, workAppGitHubProjectAccessMode, workAppGitHubProjectRepositoryAccess, workAppGitHubProjectRepositoryAccessRelations, workAppGitHubRepositories, workAppGitHubRepositoriesRelations, workAppSlackChannelAgentConfigs, workAppSlackMcpToolAccessConfig, workAppSlackUserMappings, workAppSlackWorkspaces, workflowExecutions };
|
|
1016
|
+
export { USAGE_GENERATION_TYPES, account, apiKeys, apps, contextCache, conversations, conversationsRelations, datasetRun, datasetRunConversationRelations, deviceCode, evaluationResult, evaluationRun, feedback, feedbackRelations, invitation, ledgerArtifacts, ledgerArtifactsRelations, member, messages, messagesRelations, orgEntitlement, organization, projectMetadata, runtime_schema_exports, scheduledTriggerInvocations, scheduledTriggerUsers, scheduledTriggers, schedulerState, session, ssoProvider, streamChunks, taskRelations, taskRelationsRelations, tasks, tasksRelations, triggerInvocations, user, userProfile, userProfileRelations, verification, workAppGitHubInstallations, workAppGitHubInstallationsRelations, workAppGitHubMcpToolAccessMode, workAppGitHubMcpToolRepositoryAccess, workAppGitHubMcpToolRepositoryAccessRelations, workAppGitHubProjectAccessMode, workAppGitHubProjectRepositoryAccess, workAppGitHubProjectRepositoryAccessRelations, workAppGitHubRepositories, workAppGitHubRepositoriesRelations, workAppSlackChannelAgentConfigs, workAppSlackMcpToolAccessConfig, workAppSlackUserMappings, workAppSlackWorkspaces, workflowExecutions };
|
package/dist/dolt/merge.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getLogger } from "../utils/logger.js";
|
|
2
|
+
import { createApiError, getDatabaseErrorLogContext } from "../utils/error.js";
|
|
2
3
|
import { doltAddAndCommit } from "./commit.js";
|
|
3
|
-
import { createApiError } from "../utils/error.js";
|
|
4
4
|
import { managePkMap } from "./pk-map.js";
|
|
5
5
|
import { ResolutionValidationError, applyResolutions } from "./resolve-conflicts.js";
|
|
6
6
|
import { doltCheckout } from "./branch.js";
|
|
@@ -80,14 +80,9 @@ const doltMerge = (db) => async (params) => {
|
|
|
80
80
|
result = await db.execute(sql.raw(`SELECT DOLT_MERGE(${args.join(", ")})`));
|
|
81
81
|
logger.info({ result }, "DOLT_MERGE result");
|
|
82
82
|
} catch (error) {
|
|
83
|
-
const cause = error?.cause;
|
|
84
83
|
logger.error({
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
severity: cause?.severity,
|
|
88
|
-
detail: cause?.detail,
|
|
89
|
-
hint: cause?.hint,
|
|
90
|
-
query: error?.query,
|
|
84
|
+
error,
|
|
85
|
+
...getDatabaseErrorLogContext(error),
|
|
91
86
|
fromBranch: params.fromBranch,
|
|
92
87
|
toBranch: params.toBranch
|
|
93
88
|
}, "Error merging branch");
|
|
@@ -142,7 +137,10 @@ const doltMerge = (db) => async (params) => {
|
|
|
142
137
|
if (!txFinalized) try {
|
|
143
138
|
await db.execute(sql.raw("ROLLBACK"));
|
|
144
139
|
} catch (rollbackError) {
|
|
145
|
-
logger.error({
|
|
140
|
+
logger.error({
|
|
141
|
+
error: rollbackError,
|
|
142
|
+
...getDatabaseErrorLogContext(rollbackError)
|
|
143
|
+
}, "Failed to rollback transaction");
|
|
146
144
|
}
|
|
147
145
|
}
|
|
148
146
|
};
|
package/dist/dolt/ref-scope.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { manage_schema_exports } from "../db/manage/manage-schema.js";
|
|
2
2
|
import { getLogger } from "../utils/logger.js";
|
|
3
|
+
import { getDatabaseErrorLogContext } from "../utils/error.js";
|
|
3
4
|
import { generateId } from "../utils/conversations.js";
|
|
4
5
|
import { doltAddAndCommit, doltReset, doltStatus } from "./commit.js";
|
|
5
6
|
import { checkoutBranch } from "./branches-api.js";
|
|
6
|
-
import { drizzle } from "drizzle-orm/node-postgres";
|
|
7
7
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
8
|
+
import { drizzle } from "drizzle-orm/node-postgres";
|
|
8
9
|
|
|
9
10
|
//#region src/dolt/ref-scope.ts
|
|
10
11
|
const logger = getLogger("ref-scope");
|
|
@@ -159,9 +160,11 @@ async function withRef(pool, resolvedRef, dataAccessFn, options) {
|
|
|
159
160
|
} catch (commitError) {
|
|
160
161
|
logger.error({
|
|
161
162
|
error: commitError,
|
|
163
|
+
...getDatabaseErrorLogContext(commitError),
|
|
162
164
|
branch: resolvedRef.name,
|
|
163
165
|
connectionId
|
|
164
|
-
}, "Failed to auto-commit changes");
|
|
166
|
+
}, "Failed to auto-commit changes — uncommitted writes will be lost on connection release");
|
|
167
|
+
throw commitError;
|
|
165
168
|
}
|
|
166
169
|
logger.debug({
|
|
167
170
|
ref: resolvedRef.name,
|
|
@@ -182,6 +185,7 @@ async function withRef(pool, resolvedRef, dataAccessFn, options) {
|
|
|
182
185
|
} catch (resetError) {
|
|
183
186
|
logger.error({
|
|
184
187
|
error: resetError,
|
|
188
|
+
...getDatabaseErrorLogContext(resetError),
|
|
185
189
|
branch: resolvedRef.name,
|
|
186
190
|
connectionId
|
|
187
191
|
}, "Failed to reset changes after error");
|
|
@@ -190,7 +194,8 @@ async function withRef(pool, resolvedRef, dataAccessFn, options) {
|
|
|
190
194
|
ref: resolvedRef.name,
|
|
191
195
|
duration: Date.now() - startTime,
|
|
192
196
|
connectionId,
|
|
193
|
-
error
|
|
197
|
+
error,
|
|
198
|
+
...getDatabaseErrorLogContext(error)
|
|
194
199
|
}, "Ref scope failed");
|
|
195
200
|
throw error;
|
|
196
201
|
} finally {
|
|
@@ -213,6 +218,7 @@ async function withRef(pool, resolvedRef, dataAccessFn, options) {
|
|
|
213
218
|
}, "withRef cleanup failed");
|
|
214
219
|
logger.error({
|
|
215
220
|
error: cleanupError,
|
|
221
|
+
...getDatabaseErrorLogContext(cleanupError),
|
|
216
222
|
tempBranch,
|
|
217
223
|
connectionId
|
|
218
224
|
}, "Error during ref scope cleanup");
|