@inkeep/agents-api 0.0.0-dev-20260204170416 → 0.0.0-dev-20260204182014
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/.well-known/workflow/v1/step.cjs +569 -232
- package/dist/createApp.js +46 -1
- package/dist/domains/evals/routes/datasetTriggers.d.ts +2 -2
- package/dist/domains/evals/routes/index.d.ts +2 -2
- package/dist/domains/evals/services/EvaluationService.d.ts +0 -5
- package/dist/domains/evals/services/EvaluationService.js +2 -51
- package/dist/domains/evals/workflow/routes.d.ts +2 -2
- package/dist/domains/manage/routes/availableAgents.d.ts +2 -2
- package/dist/domains/manage/routes/conversations.d.ts +2 -2
- package/dist/domains/manage/routes/index.d.ts +2 -2
- package/dist/domains/manage/routes/invitations.d.ts +2 -2
- package/dist/domains/manage/routes/mcp.d.ts +2 -2
- package/dist/domains/manage/routes/signoz.d.ts +2 -2
- package/dist/domains/manage/routes/userOrganizations.d.ts +2 -2
- package/dist/domains/mcp/routes/mcp.d.ts +2 -2
- package/dist/domains/work-apps/index.d.ts +13 -0
- package/dist/domains/work-apps/index.js +23 -0
- package/dist/domains/work-apps/types.d.ts +7 -0
- package/dist/domains/work-apps/types.js +1 -0
- package/dist/factory.d.ts +18 -18
- package/dist/index.d.ts +18 -18
- package/dist/middleware/cors.d.ts +6 -1
- package/dist/middleware/cors.js +27 -1
- package/dist/middleware/evalsAuth.d.ts +2 -2
- package/dist/middleware/index.d.ts +2 -2
- package/dist/middleware/index.js +2 -2
- package/dist/middleware/manageAuth.d.ts +2 -2
- package/dist/middleware/manageAuth.js +16 -1
- package/dist/middleware/projectAccess.d.ts +2 -2
- package/dist/middleware/projectConfig.d.ts +3 -3
- package/dist/middleware/requirePermission.d.ts +2 -2
- package/dist/middleware/runAuth.d.ts +4 -4
- package/dist/middleware/runAuth.js +48 -1
- package/dist/middleware/sessionAuth.d.ts +3 -3
- package/dist/middleware/tenantAccess.d.ts +2 -2
- package/dist/middleware/tracing.d.ts +3 -3
- package/dist/openapi.d.ts +8 -0
- package/dist/openapi.js +9 -1
- package/package.json +10 -5
|
@@ -8519,10 +8519,10 @@ var require_core = __commonJS({
|
|
|
8519
8519
|
error() {
|
|
8520
8520
|
}
|
|
8521
8521
|
};
|
|
8522
|
-
function getLogger2(
|
|
8523
|
-
if (
|
|
8524
|
-
if (
|
|
8525
|
-
if (
|
|
8522
|
+
function getLogger2(logger26) {
|
|
8523
|
+
if (logger26 === false) return noLogs;
|
|
8524
|
+
if (logger26 === void 0) return console;
|
|
8525
|
+
if (logger26.log && logger26.warn && logger26.error) return logger26;
|
|
8526
8526
|
throw new Error("logger must implement log, warn and error methods");
|
|
8527
8527
|
}
|
|
8528
8528
|
__name(getLogger2, "getLogger");
|
|
@@ -10884,9 +10884,9 @@ var require_ajv = __commonJS({
|
|
|
10884
10884
|
}
|
|
10885
10885
|
});
|
|
10886
10886
|
|
|
10887
|
-
// ../node_modules/.pnpm/@babel+parser@7.
|
|
10887
|
+
// ../node_modules/.pnpm/@babel+parser@7.29.0/node_modules/@babel/parser/lib/index.js
|
|
10888
10888
|
var require_lib = __commonJS({
|
|
10889
|
-
"../node_modules/.pnpm/@babel+parser@7.
|
|
10889
|
+
"../node_modules/.pnpm/@babel+parser@7.29.0/node_modules/@babel/parser/lib/index.js"(exports2) {
|
|
10890
10890
|
"use strict";
|
|
10891
10891
|
Object.defineProperty(exports2, "__esModule", {
|
|
10892
10892
|
value: true
|
|
@@ -21114,7 +21114,7 @@ var require_lib = __commonJS({
|
|
|
21114
21114
|
return this.finishCallExpression(node2, state.optionalChainMember);
|
|
21115
21115
|
}
|
|
21116
21116
|
const tokenType = this.state.type;
|
|
21117
|
-
if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) {
|
|
21117
|
+
if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && tokenType !== 93 && tokenType !== 120 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) {
|
|
21118
21118
|
return;
|
|
21119
21119
|
}
|
|
21120
21120
|
const node = this.startNodeAt(startLoc);
|
|
@@ -21587,8 +21587,18 @@ var require_lib = __commonJS({
|
|
|
21587
21587
|
}
|
|
21588
21588
|
parseClassSuper(node) {
|
|
21589
21589
|
super.parseClassSuper(node);
|
|
21590
|
-
if (node.superClass
|
|
21591
|
-
node.
|
|
21590
|
+
if (node.superClass) {
|
|
21591
|
+
if (node.superClass.type === "TSInstantiationExpression") {
|
|
21592
|
+
const tsInstantiationExpression = node.superClass;
|
|
21593
|
+
const superClass2 = tsInstantiationExpression.expression;
|
|
21594
|
+
this.takeSurroundingComments(superClass2, superClass2.start, superClass2.end);
|
|
21595
|
+
const superTypeArguments = tsInstantiationExpression.typeParameters;
|
|
21596
|
+
this.takeSurroundingComments(superTypeArguments, superTypeArguments.start, superTypeArguments.end);
|
|
21597
|
+
node.superClass = superClass2;
|
|
21598
|
+
node.superTypeParameters = superTypeArguments;
|
|
21599
|
+
} else if (this.match(47) || this.match(51)) {
|
|
21600
|
+
node.superTypeParameters = this.tsParseTypeArgumentsInExpression();
|
|
21601
|
+
}
|
|
21592
21602
|
}
|
|
21593
21603
|
if (this.eatContextual(113)) {
|
|
21594
21604
|
node.implements = this.tsParseHeritageClause("implements");
|
|
@@ -39660,8 +39670,8 @@ var require_logging = __commonJS({
|
|
|
39660
39670
|
return _logger;
|
|
39661
39671
|
}, "getLogger");
|
|
39662
39672
|
exports2.getLogger = getLogger2;
|
|
39663
|
-
var setLogger = /* @__PURE__ */ __name((
|
|
39664
|
-
_logger =
|
|
39673
|
+
var setLogger = /* @__PURE__ */ __name((logger26) => {
|
|
39674
|
+
_logger = logger26;
|
|
39665
39675
|
}, "setLogger");
|
|
39666
39676
|
exports2.setLogger = setLogger;
|
|
39667
39677
|
var setLoggerVerbosity = /* @__PURE__ */ __name((verbosity) => {
|
|
@@ -64242,8 +64252,8 @@ var require_src3 = __commonJS({
|
|
|
64242
64252
|
throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead");
|
|
64243
64253
|
}, "load");
|
|
64244
64254
|
exports2.load = load;
|
|
64245
|
-
var setLogger = /* @__PURE__ */ __name((
|
|
64246
|
-
logging.setLogger(
|
|
64255
|
+
var setLogger = /* @__PURE__ */ __name((logger26) => {
|
|
64256
|
+
logging.setLogger(logger26);
|
|
64247
64257
|
}, "setLogger");
|
|
64248
64258
|
exports2.setLogger = setLogger;
|
|
64249
64259
|
var setLogVerbosity = /* @__PURE__ */ __name((verbosity) => {
|
|
@@ -94104,12 +94114,12 @@ var require_ComponentLogger = __commonJS({
|
|
|
94104
94114
|
};
|
|
94105
94115
|
exports2.DiagComponentLogger = DiagComponentLogger;
|
|
94106
94116
|
function logProxy(funcName, namespace, args2) {
|
|
94107
|
-
const
|
|
94108
|
-
if (!
|
|
94117
|
+
const logger26 = (0, global_utils_1.getGlobal)("diag");
|
|
94118
|
+
if (!logger26) {
|
|
94109
94119
|
return;
|
|
94110
94120
|
}
|
|
94111
94121
|
args2.unshift(namespace);
|
|
94112
|
-
return
|
|
94122
|
+
return logger26[funcName](...args2);
|
|
94113
94123
|
}
|
|
94114
94124
|
__name(logProxy, "logProxy");
|
|
94115
94125
|
}
|
|
@@ -94145,17 +94155,17 @@ var require_logLevelLogger = __commonJS({
|
|
|
94145
94155
|
});
|
|
94146
94156
|
exports2.createLogLevelDiagLogger = void 0;
|
|
94147
94157
|
var types_1 = require_types3();
|
|
94148
|
-
function createLogLevelDiagLogger(maxLevel,
|
|
94158
|
+
function createLogLevelDiagLogger(maxLevel, logger26) {
|
|
94149
94159
|
if (maxLevel < types_1.DiagLogLevel.NONE) {
|
|
94150
94160
|
maxLevel = types_1.DiagLogLevel.NONE;
|
|
94151
94161
|
} else if (maxLevel > types_1.DiagLogLevel.ALL) {
|
|
94152
94162
|
maxLevel = types_1.DiagLogLevel.ALL;
|
|
94153
94163
|
}
|
|
94154
|
-
|
|
94164
|
+
logger26 = logger26 || {};
|
|
94155
94165
|
function _filterFunc(funcName, theLevel) {
|
|
94156
|
-
const theFunc =
|
|
94166
|
+
const theFunc = logger26[funcName];
|
|
94157
94167
|
if (typeof theFunc === "function" && maxLevel >= theLevel) {
|
|
94158
|
-
return theFunc.bind(
|
|
94168
|
+
return theFunc.bind(logger26);
|
|
94159
94169
|
}
|
|
94160
94170
|
return function() {
|
|
94161
94171
|
};
|
|
@@ -94198,18 +94208,18 @@ var require_diag = __commonJS({
|
|
|
94198
94208
|
constructor() {
|
|
94199
94209
|
function _logProxy(funcName) {
|
|
94200
94210
|
return function(...args2) {
|
|
94201
|
-
const
|
|
94202
|
-
if (!
|
|
94203
|
-
return
|
|
94211
|
+
const logger26 = (0, global_utils_1.getGlobal)("diag");
|
|
94212
|
+
if (!logger26) return;
|
|
94213
|
+
return logger26[funcName](...args2);
|
|
94204
94214
|
};
|
|
94205
94215
|
}
|
|
94206
94216
|
__name(_logProxy, "_logProxy");
|
|
94207
94217
|
const self2 = this;
|
|
94208
|
-
const setLogger = /* @__PURE__ */ __name((
|
|
94218
|
+
const setLogger = /* @__PURE__ */ __name((logger26, optionsOrLogLevel = {
|
|
94209
94219
|
logLevel: types_1.DiagLogLevel.INFO
|
|
94210
94220
|
}) => {
|
|
94211
94221
|
var _a19, _b17, _c;
|
|
94212
|
-
if (
|
|
94222
|
+
if (logger26 === self2) {
|
|
94213
94223
|
const err2 = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
|
|
94214
94224
|
self2.error((_a19 = err2.stack) !== null && _a19 !== void 0 ? _a19 : err2.message);
|
|
94215
94225
|
return false;
|
|
@@ -94220,7 +94230,7 @@ var require_diag = __commonJS({
|
|
|
94220
94230
|
};
|
|
94221
94231
|
}
|
|
94222
94232
|
const oldLogger = (0, global_utils_1.getGlobal)("diag");
|
|
94223
|
-
const newLogger = (0, logLevelLogger_1.createLogLevelDiagLogger)((_b17 = optionsOrLogLevel.logLevel) !== null && _b17 !== void 0 ? _b17 : types_1.DiagLogLevel.INFO,
|
|
94233
|
+
const newLogger = (0, logLevelLogger_1.createLogLevelDiagLogger)((_b17 = optionsOrLogLevel.logLevel) !== null && _b17 !== void 0 ? _b17 : types_1.DiagLogLevel.INFO, logger26);
|
|
94224
94234
|
if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
|
|
94225
94235
|
const stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
|
|
94226
94236
|
oldLogger.warn(`Current logger will be overwritten from ${stack}`);
|
|
@@ -124632,7 +124642,9 @@ var manage_schema_exports = /* @__PURE__ */ __exportAll({
|
|
|
124632
124642
|
subAgentsRelations: /* @__PURE__ */ __name(() => subAgentsRelations, "subAgentsRelations"),
|
|
124633
124643
|
tools: /* @__PURE__ */ __name(() => tools, "tools"),
|
|
124634
124644
|
toolsRelations: /* @__PURE__ */ __name(() => toolsRelations, "toolsRelations"),
|
|
124635
|
-
triggers: /* @__PURE__ */ __name(() => triggers, "triggers")
|
|
124645
|
+
triggers: /* @__PURE__ */ __name(() => triggers, "triggers"),
|
|
124646
|
+
workAppConfigs: /* @__PURE__ */ __name(() => workAppConfigs, "workAppConfigs"),
|
|
124647
|
+
workAppConfigsRelations: /* @__PURE__ */ __name(() => workAppConfigsRelations, "workAppConfigsRelations")
|
|
124636
124648
|
});
|
|
124637
124649
|
var tenantScoped = {
|
|
124638
124650
|
tenantId: varchar("tenant_id", {
|
|
@@ -126148,6 +126160,58 @@ var datasetRunConfigAgentRelations = pgTable("dataset_run_config_agent_relations
|
|
|
126148
126160
|
name: "dataset_run_config_agent_relations_agent_fk"
|
|
126149
126161
|
}).onDelete("cascade")
|
|
126150
126162
|
]);
|
|
126163
|
+
var workAppConfigs = pgTable("work_app_configs", {
|
|
126164
|
+
...tenantScoped,
|
|
126165
|
+
appType: varchar("app_type", {
|
|
126166
|
+
length: 50
|
|
126167
|
+
}).notNull().$type(),
|
|
126168
|
+
workspaceId: varchar("workspace_id", {
|
|
126169
|
+
length: 256
|
|
126170
|
+
}).notNull(),
|
|
126171
|
+
channelId: varchar("channel_id", {
|
|
126172
|
+
length: 256
|
|
126173
|
+
}),
|
|
126174
|
+
projectId: varchar("project_id", {
|
|
126175
|
+
length: 256
|
|
126176
|
+
}).notNull(),
|
|
126177
|
+
agentId: varchar("agent_id", {
|
|
126178
|
+
length: 256
|
|
126179
|
+
}).notNull(),
|
|
126180
|
+
enabled: boolean("enabled").notNull().default(true),
|
|
126181
|
+
metadata: jsonb("metadata").$type(),
|
|
126182
|
+
...timestamps
|
|
126183
|
+
}, (table) => [
|
|
126184
|
+
primaryKey({
|
|
126185
|
+
columns: [
|
|
126186
|
+
table.tenantId,
|
|
126187
|
+
table.id
|
|
126188
|
+
]
|
|
126189
|
+
}),
|
|
126190
|
+
foreignKey({
|
|
126191
|
+
columns: [
|
|
126192
|
+
table.tenantId,
|
|
126193
|
+
table.projectId
|
|
126194
|
+
],
|
|
126195
|
+
foreignColumns: [
|
|
126196
|
+
projects.tenantId,
|
|
126197
|
+
projects.id
|
|
126198
|
+
],
|
|
126199
|
+
name: "work_app_configs_project_fk"
|
|
126200
|
+
}).onDelete("cascade"),
|
|
126201
|
+
unique("work_app_configs_workspace_channel_unique").on(table.tenantId, table.appType, table.workspaceId, table.channelId)
|
|
126202
|
+
]);
|
|
126203
|
+
var workAppConfigsRelations = relations(workAppConfigs, ({ one }) => ({
|
|
126204
|
+
project: one(projects, {
|
|
126205
|
+
fields: [
|
|
126206
|
+
workAppConfigs.tenantId,
|
|
126207
|
+
workAppConfigs.projectId
|
|
126208
|
+
],
|
|
126209
|
+
references: [
|
|
126210
|
+
projects.tenantId,
|
|
126211
|
+
projects.id
|
|
126212
|
+
]
|
|
126213
|
+
})
|
|
126214
|
+
}));
|
|
126151
126215
|
|
|
126152
126216
|
// ../packages/agents-core/dist/auth/auth-schema.js
|
|
126153
126217
|
var user = pgTable("user", {
|
|
@@ -126382,7 +126446,11 @@ var runtime_schema_exports = /* @__PURE__ */ __exportAll({
|
|
|
126382
126446
|
workAppGitHubProjectRepositoryAccess: /* @__PURE__ */ __name(() => workAppGitHubProjectRepositoryAccess, "workAppGitHubProjectRepositoryAccess"),
|
|
126383
126447
|
workAppGitHubProjectRepositoryAccessRelations: /* @__PURE__ */ __name(() => workAppGitHubProjectRepositoryAccessRelations, "workAppGitHubProjectRepositoryAccessRelations"),
|
|
126384
126448
|
workAppGitHubRepositories: /* @__PURE__ */ __name(() => workAppGitHubRepositories, "workAppGitHubRepositories"),
|
|
126385
|
-
workAppGitHubRepositoriesRelations: /* @__PURE__ */ __name(() => workAppGitHubRepositoriesRelations, "workAppGitHubRepositoriesRelations")
|
|
126449
|
+
workAppGitHubRepositoriesRelations: /* @__PURE__ */ __name(() => workAppGitHubRepositoriesRelations, "workAppGitHubRepositoriesRelations"),
|
|
126450
|
+
workAppSlackChannelAgentConfigs: /* @__PURE__ */ __name(() => workAppSlackChannelAgentConfigs, "workAppSlackChannelAgentConfigs"),
|
|
126451
|
+
workAppSlackUserMappings: /* @__PURE__ */ __name(() => workAppSlackUserMappings, "workAppSlackUserMappings"),
|
|
126452
|
+
workAppSlackUserSettings: /* @__PURE__ */ __name(() => workAppSlackUserSettings, "workAppSlackUserSettings"),
|
|
126453
|
+
workAppSlackWorkspaces: /* @__PURE__ */ __name(() => workAppSlackWorkspaces, "workAppSlackWorkspaces")
|
|
126386
126454
|
});
|
|
126387
126455
|
var tenantScoped2 = {
|
|
126388
126456
|
tenantId: varchar("tenant_id", {
|
|
@@ -126567,6 +126635,162 @@ var triggerInvocations = pgTable("trigger_invocations", {
|
|
|
126567
126635
|
index("trigger_invocations_trigger_idx").on(table.triggerId, table.createdAt),
|
|
126568
126636
|
index("trigger_invocations_status_idx").on(table.triggerId, table.status)
|
|
126569
126637
|
]);
|
|
126638
|
+
var workAppSlackWorkspaces = pgTable("work_app_slack_workspaces", {
|
|
126639
|
+
id: varchar("id", {
|
|
126640
|
+
length: 256
|
|
126641
|
+
}).primaryKey(),
|
|
126642
|
+
tenantId: varchar("tenant_id", {
|
|
126643
|
+
length: 256
|
|
126644
|
+
}).notNull().references(() => organization.id, {
|
|
126645
|
+
onDelete: "cascade"
|
|
126646
|
+
}),
|
|
126647
|
+
slackTeamId: varchar("slack_team_id", {
|
|
126648
|
+
length: 256
|
|
126649
|
+
}).notNull(),
|
|
126650
|
+
slackEnterpriseId: varchar("slack_enterprise_id", {
|
|
126651
|
+
length: 256
|
|
126652
|
+
}),
|
|
126653
|
+
slackAppId: varchar("slack_app_id", {
|
|
126654
|
+
length: 256
|
|
126655
|
+
}),
|
|
126656
|
+
slackTeamName: varchar("slack_team_name", {
|
|
126657
|
+
length: 512
|
|
126658
|
+
}),
|
|
126659
|
+
nangoProviderConfigKey: varchar("nango_provider_config_key", {
|
|
126660
|
+
length: 256
|
|
126661
|
+
}).notNull().default("work-apps-slack"),
|
|
126662
|
+
nangoConnectionId: varchar("nango_connection_id", {
|
|
126663
|
+
length: 256
|
|
126664
|
+
}).notNull(),
|
|
126665
|
+
status: varchar("status", {
|
|
126666
|
+
length: 20
|
|
126667
|
+
}).notNull().default("active"),
|
|
126668
|
+
installedByUserId: text("installed_by_user_id").references(() => user.id, {
|
|
126669
|
+
onDelete: "set null"
|
|
126670
|
+
}),
|
|
126671
|
+
...timestamps2
|
|
126672
|
+
}, (table) => [
|
|
126673
|
+
unique("work_app_slack_workspaces_tenant_team_unique").on(table.tenantId, table.slackTeamId),
|
|
126674
|
+
index("work_app_slack_workspaces_tenant_idx").on(table.tenantId),
|
|
126675
|
+
index("work_app_slack_workspaces_team_idx").on(table.slackTeamId),
|
|
126676
|
+
index("work_app_slack_workspaces_nango_idx").on(table.nangoConnectionId)
|
|
126677
|
+
]);
|
|
126678
|
+
var workAppSlackUserMappings = pgTable("work_app_slack_user_mappings", {
|
|
126679
|
+
id: varchar("id", {
|
|
126680
|
+
length: 256
|
|
126681
|
+
}).primaryKey(),
|
|
126682
|
+
tenantId: varchar("tenant_id", {
|
|
126683
|
+
length: 256
|
|
126684
|
+
}).notNull().references(() => organization.id, {
|
|
126685
|
+
onDelete: "cascade"
|
|
126686
|
+
}),
|
|
126687
|
+
clientId: varchar("client_id", {
|
|
126688
|
+
length: 256
|
|
126689
|
+
}).notNull().default("work-apps-slack"),
|
|
126690
|
+
slackUserId: varchar("slack_user_id", {
|
|
126691
|
+
length: 256
|
|
126692
|
+
}).notNull(),
|
|
126693
|
+
slackTeamId: varchar("slack_team_id", {
|
|
126694
|
+
length: 256
|
|
126695
|
+
}).notNull(),
|
|
126696
|
+
slackEnterpriseId: varchar("slack_enterprise_id", {
|
|
126697
|
+
length: 256
|
|
126698
|
+
}),
|
|
126699
|
+
inkeepUserId: text("inkeep_user_id").notNull().references(() => user.id, {
|
|
126700
|
+
onDelete: "cascade"
|
|
126701
|
+
}),
|
|
126702
|
+
slackUsername: varchar("slack_username", {
|
|
126703
|
+
length: 256
|
|
126704
|
+
}),
|
|
126705
|
+
slackEmail: varchar("slack_email", {
|
|
126706
|
+
length: 256
|
|
126707
|
+
}),
|
|
126708
|
+
linkedAt: timestamp("linked_at", {
|
|
126709
|
+
mode: "string"
|
|
126710
|
+
}).notNull().defaultNow(),
|
|
126711
|
+
lastUsedAt: timestamp("last_used_at", {
|
|
126712
|
+
mode: "string"
|
|
126713
|
+
}),
|
|
126714
|
+
...timestamps2
|
|
126715
|
+
}, (table) => [
|
|
126716
|
+
unique("work_app_slack_user_mappings_unique").on(table.tenantId, table.clientId, table.slackTeamId, table.slackUserId),
|
|
126717
|
+
index("work_app_slack_user_mappings_tenant_idx").on(table.tenantId),
|
|
126718
|
+
index("work_app_slack_user_mappings_user_idx").on(table.inkeepUserId),
|
|
126719
|
+
index("work_app_slack_user_mappings_team_idx").on(table.slackTeamId),
|
|
126720
|
+
index("work_app_slack_user_mappings_slack_user_idx").on(table.slackUserId)
|
|
126721
|
+
]);
|
|
126722
|
+
var workAppSlackChannelAgentConfigs = pgTable("work_app_slack_channel_agent_configs", {
|
|
126723
|
+
id: varchar("id", {
|
|
126724
|
+
length: 256
|
|
126725
|
+
}).primaryKey(),
|
|
126726
|
+
tenantId: varchar("tenant_id", {
|
|
126727
|
+
length: 256
|
|
126728
|
+
}).notNull().references(() => organization.id, {
|
|
126729
|
+
onDelete: "cascade"
|
|
126730
|
+
}),
|
|
126731
|
+
slackTeamId: varchar("slack_team_id", {
|
|
126732
|
+
length: 256
|
|
126733
|
+
}).notNull(),
|
|
126734
|
+
slackChannelId: varchar("slack_channel_id", {
|
|
126735
|
+
length: 256
|
|
126736
|
+
}).notNull(),
|
|
126737
|
+
slackChannelName: varchar("slack_channel_name", {
|
|
126738
|
+
length: 256
|
|
126739
|
+
}),
|
|
126740
|
+
slackChannelType: varchar("slack_channel_type", {
|
|
126741
|
+
length: 50
|
|
126742
|
+
}),
|
|
126743
|
+
projectId: varchar("project_id", {
|
|
126744
|
+
length: 256
|
|
126745
|
+
}).notNull(),
|
|
126746
|
+
agentId: varchar("agent_id", {
|
|
126747
|
+
length: 256
|
|
126748
|
+
}).notNull(),
|
|
126749
|
+
agentName: varchar("agent_name", {
|
|
126750
|
+
length: 256
|
|
126751
|
+
}),
|
|
126752
|
+
configuredByUserId: text("configured_by_user_id").references(() => user.id, {
|
|
126753
|
+
onDelete: "set null"
|
|
126754
|
+
}),
|
|
126755
|
+
enabled: boolean("enabled").notNull().default(true),
|
|
126756
|
+
...timestamps2
|
|
126757
|
+
}, (table) => [
|
|
126758
|
+
unique("work_app_slack_channel_agent_configs_unique").on(table.tenantId, table.slackTeamId, table.slackChannelId),
|
|
126759
|
+
index("work_app_slack_channel_agent_configs_tenant_idx").on(table.tenantId),
|
|
126760
|
+
index("work_app_slack_channel_agent_configs_team_idx").on(table.slackTeamId),
|
|
126761
|
+
index("work_app_slack_channel_agent_configs_channel_idx").on(table.slackChannelId)
|
|
126762
|
+
]);
|
|
126763
|
+
var workAppSlackUserSettings = pgTable("work_app_slack_user_settings", {
|
|
126764
|
+
id: varchar("id", {
|
|
126765
|
+
length: 256
|
|
126766
|
+
}).primaryKey(),
|
|
126767
|
+
tenantId: varchar("tenant_id", {
|
|
126768
|
+
length: 256
|
|
126769
|
+
}).notNull().references(() => organization.id, {
|
|
126770
|
+
onDelete: "cascade"
|
|
126771
|
+
}),
|
|
126772
|
+
slackTeamId: varchar("slack_team_id", {
|
|
126773
|
+
length: 256
|
|
126774
|
+
}).notNull(),
|
|
126775
|
+
slackUserId: varchar("slack_user_id", {
|
|
126776
|
+
length: 256
|
|
126777
|
+
}).notNull(),
|
|
126778
|
+
defaultProjectId: varchar("default_project_id", {
|
|
126779
|
+
length: 256
|
|
126780
|
+
}),
|
|
126781
|
+
defaultAgentId: varchar("default_agent_id", {
|
|
126782
|
+
length: 256
|
|
126783
|
+
}),
|
|
126784
|
+
defaultAgentName: varchar("default_agent_name", {
|
|
126785
|
+
length: 256
|
|
126786
|
+
}),
|
|
126787
|
+
...timestamps2
|
|
126788
|
+
}, (table) => [
|
|
126789
|
+
unique("work_app_slack_user_settings_unique").on(table.tenantId, table.slackTeamId, table.slackUserId),
|
|
126790
|
+
index("work_app_slack_user_settings_tenant_idx").on(table.tenantId),
|
|
126791
|
+
index("work_app_slack_user_settings_team_idx").on(table.slackTeamId),
|
|
126792
|
+
index("work_app_slack_user_settings_user_idx").on(table.slackUserId)
|
|
126793
|
+
]);
|
|
126570
126794
|
var messages = pgTable("messages", {
|
|
126571
126795
|
...projectScoped2,
|
|
126572
126796
|
conversationId: varchar("conversation_id", {
|
|
@@ -144647,6 +144871,77 @@ var WorkAppGitHubAccessGetResponseSchema = external_exports.object({
|
|
|
144647
144871
|
mode: WorkAppGitHubAccessModeSchema,
|
|
144648
144872
|
repositories: external_exports.array(WorkAppGitHubRepositorySelectSchema)
|
|
144649
144873
|
});
|
|
144874
|
+
var WorkAppTypeSchema = external_exports.enum([
|
|
144875
|
+
"slack",
|
|
144876
|
+
"teams"
|
|
144877
|
+
]).openapi("WorkAppType");
|
|
144878
|
+
var WorkAppConfigMetadataSchema = external_exports.object({
|
|
144879
|
+
configuredByUserId: external_exports.string().optional(),
|
|
144880
|
+
configuredByUserName: external_exports.string().optional(),
|
|
144881
|
+
notes: external_exports.string().optional()
|
|
144882
|
+
}).openapi("WorkAppConfigMetadata");
|
|
144883
|
+
var WorkAppConfigSelectSchema = createSelectSchema2(workAppConfigs);
|
|
144884
|
+
var WorkAppConfigInsertSchema = createInsertSchema2(workAppConfigs).extend({
|
|
144885
|
+
id: ResourceIdSchema,
|
|
144886
|
+
appType: WorkAppTypeSchema,
|
|
144887
|
+
metadata: WorkAppConfigMetadataSchema.optional()
|
|
144888
|
+
});
|
|
144889
|
+
var WorkAppConfigUpdateSchema = WorkAppConfigInsertSchema.partial();
|
|
144890
|
+
var WorkAppConfigApiSelectSchema = WorkAppConfigSelectSchema.omit({
|
|
144891
|
+
tenantId: true
|
|
144892
|
+
}).openapi("WorkAppConfig");
|
|
144893
|
+
var WorkAppConfigApiInsertSchema = WorkAppConfigInsertSchema.omit({
|
|
144894
|
+
tenantId: true,
|
|
144895
|
+
createdAt: true,
|
|
144896
|
+
updatedAt: true
|
|
144897
|
+
}).openapi("WorkAppConfigCreate");
|
|
144898
|
+
var WorkAppConfigApiUpdateSchema = WorkAppConfigApiInsertSchema.partial().openapi("WorkAppConfigUpdate");
|
|
144899
|
+
var WorkAppSlackWorkspaceStatusSchema = external_exports.enum([
|
|
144900
|
+
"active",
|
|
144901
|
+
"suspended",
|
|
144902
|
+
"disconnected"
|
|
144903
|
+
]);
|
|
144904
|
+
var WorkAppSlackWorkspaceSelectSchema = createSelectSchema2(workAppSlackWorkspaces);
|
|
144905
|
+
var WorkAppSlackWorkspaceInsertSchema = createInsertSchema2(workAppSlackWorkspaces).omit({
|
|
144906
|
+
createdAt: true,
|
|
144907
|
+
updatedAt: true
|
|
144908
|
+
}).extend({
|
|
144909
|
+
status: WorkAppSlackWorkspaceStatusSchema.optional().default("active")
|
|
144910
|
+
});
|
|
144911
|
+
var WorkAppSlackWorkspaceUpdateSchema = WorkAppSlackWorkspaceInsertSchema.partial();
|
|
144912
|
+
var WorkAppSlackWorkspaceApiSelectSchema = omitTenantScope(WorkAppSlackWorkspaceSelectSchema).openapi("WorkAppSlackWorkspace");
|
|
144913
|
+
var WorkAppSlackWorkspaceApiInsertSchema = omitGeneratedFields(WorkAppSlackWorkspaceInsertSchema).openapi("WorkAppSlackWorkspaceCreate");
|
|
144914
|
+
var WorkAppSlackWorkspaceApiUpdateSchema = WorkAppSlackWorkspaceUpdateSchema.partial().openapi("WorkAppSlackWorkspaceUpdate");
|
|
144915
|
+
var WorkAppSlackUserMappingSelectSchema = createSelectSchema2(workAppSlackUserMappings);
|
|
144916
|
+
var WorkAppSlackUserMappingInsertSchema = createInsertSchema2(workAppSlackUserMappings).omit({
|
|
144917
|
+
createdAt: true,
|
|
144918
|
+
updatedAt: true,
|
|
144919
|
+
linkedAt: true
|
|
144920
|
+
}).extend({
|
|
144921
|
+
clientId: external_exports.string().optional().default("work-apps-slack")
|
|
144922
|
+
});
|
|
144923
|
+
var WorkAppSlackUserMappingUpdateSchema = WorkAppSlackUserMappingInsertSchema.partial();
|
|
144924
|
+
var WorkAppSlackUserMappingApiSelectSchema = omitTenantScope(WorkAppSlackUserMappingSelectSchema).openapi("WorkAppSlackUserMapping");
|
|
144925
|
+
var WorkAppSlackUserMappingApiInsertSchema = omitGeneratedFields(WorkAppSlackUserMappingInsertSchema).openapi("WorkAppSlackUserMappingCreate");
|
|
144926
|
+
var WorkAppSlackUserMappingApiUpdateSchema = WorkAppSlackUserMappingUpdateSchema.partial().openapi("WorkAppSlackUserMappingUpdate");
|
|
144927
|
+
var WorkAppSlackChannelAgentConfigSelectSchema = createSelectSchema2(workAppSlackChannelAgentConfigs);
|
|
144928
|
+
var WorkAppSlackChannelAgentConfigInsertSchema = createInsertSchema2(workAppSlackChannelAgentConfigs).omit({
|
|
144929
|
+
createdAt: true,
|
|
144930
|
+
updatedAt: true
|
|
144931
|
+
});
|
|
144932
|
+
var WorkAppSlackChannelAgentConfigUpdateSchema = WorkAppSlackChannelAgentConfigInsertSchema.partial();
|
|
144933
|
+
var WorkAppSlackChannelAgentConfigApiSelectSchema = omitTenantScope(WorkAppSlackChannelAgentConfigSelectSchema).openapi("WorkAppSlackChannelAgentConfig");
|
|
144934
|
+
var WorkAppSlackChannelAgentConfigApiInsertSchema = omitGeneratedFields(WorkAppSlackChannelAgentConfigInsertSchema).openapi("WorkAppSlackChannelAgentConfigCreate");
|
|
144935
|
+
var WorkAppSlackChannelAgentConfigApiUpdateSchema = WorkAppSlackChannelAgentConfigUpdateSchema.partial().openapi("WorkAppSlackChannelAgentConfigUpdate");
|
|
144936
|
+
var WorkAppSlackUserSettingsSelectSchema = createSelectSchema2(workAppSlackUserSettings);
|
|
144937
|
+
var WorkAppSlackUserSettingsInsertSchema = createInsertSchema2(workAppSlackUserSettings).omit({
|
|
144938
|
+
createdAt: true,
|
|
144939
|
+
updatedAt: true
|
|
144940
|
+
});
|
|
144941
|
+
var WorkAppSlackUserSettingsUpdateSchema = WorkAppSlackUserSettingsInsertSchema.partial();
|
|
144942
|
+
var WorkAppSlackUserSettingsApiSelectSchema = omitTenantScope(WorkAppSlackUserSettingsSelectSchema).openapi("WorkAppSlackUserSettings");
|
|
144943
|
+
var WorkAppSlackUserSettingsApiInsertSchema = omitGeneratedFields(WorkAppSlackUserSettingsInsertSchema).openapi("WorkAppSlackUserSettingsCreate");
|
|
144944
|
+
var WorkAppSlackUserSettingsApiUpdateSchema = WorkAppSlackUserSettingsUpdateSchema.partial().openapi("WorkAppSlackUserSettingsUpdate");
|
|
144650
144945
|
|
|
144651
144946
|
// ../packages/agents-core/dist/utils/colors.js
|
|
144652
144947
|
var import_iwanthue = __toESM(require_iwanthue(), 1);
|
|
@@ -144790,7 +145085,7 @@ crypto2 = globalThis.crypto?.webcrypto ?? // Node.js [18-16] REPL
|
|
|
144790
145085
|
globalThis.crypto ?? // Node.js >18
|
|
144791
145086
|
import("node:crypto").then((m4) => m4.webcrypto);
|
|
144792
145087
|
|
|
144793
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
145088
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.1_zod@4.2.1/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
144794
145089
|
var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
144795
145090
|
var JSONRPC_VERSION = "2.0";
|
|
144796
145091
|
var AssertObjectSchema = custom((v3) => v3 !== null && (typeof v3 === "object" || typeof v3 === "function"));
|
|
@@ -146376,7 +146671,7 @@ var ServerResultSchema = union2([
|
|
|
146376
146671
|
CreateTaskResultSchema
|
|
146377
146672
|
]);
|
|
146378
146673
|
|
|
146379
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
146674
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.1_zod@4.2.1/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
|
|
146380
146675
|
var SafeUrlSchema = url().superRefine((val, ctx) => {
|
|
146381
146676
|
if (!URL.canParse(val)) {
|
|
146382
146677
|
ctx.addIssue({
|
|
@@ -146521,7 +146816,7 @@ var OAuthTokenRevocationRequestSchema = object({
|
|
|
146521
146816
|
token_type_hint: string2().optional()
|
|
146522
146817
|
}).strip();
|
|
146523
146818
|
|
|
146524
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
146819
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.1_zod@4.2.1/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js
|
|
146525
146820
|
var OAuthError = class extends Error {
|
|
146526
146821
|
static {
|
|
146527
146822
|
__name(this, "OAuthError");
|
|
@@ -146986,12 +147281,12 @@ var LoggerFactory = class {
|
|
|
146986
147281
|
if (!logger$12) throw new Error(`Logger '${name18}' not found in cache`);
|
|
146987
147282
|
return logger$12;
|
|
146988
147283
|
}
|
|
146989
|
-
let
|
|
146990
|
-
if (this.config.loggerFactory)
|
|
146991
|
-
else if (this.config.defaultLogger)
|
|
146992
|
-
else
|
|
146993
|
-
this.loggers.set(name18,
|
|
146994
|
-
return
|
|
147284
|
+
let logger26;
|
|
147285
|
+
if (this.config.loggerFactory) logger26 = this.config.loggerFactory(name18);
|
|
147286
|
+
else if (this.config.defaultLogger) logger26 = this.config.defaultLogger;
|
|
147287
|
+
else logger26 = new PinoLogger(name18, this.config.pinoConfig);
|
|
147288
|
+
this.loggers.set(name18, logger26);
|
|
147289
|
+
return logger26;
|
|
146995
147290
|
}
|
|
146996
147291
|
/**
|
|
146997
147292
|
* Reset factory to default state
|
|
@@ -179257,7 +179552,7 @@ var PglitePreparedQuery = class extends PgPreparedQuery {
|
|
|
179257
179552
|
static {
|
|
179258
179553
|
__name(this, "PglitePreparedQuery");
|
|
179259
179554
|
}
|
|
179260
|
-
constructor(client, queryString, params,
|
|
179555
|
+
constructor(client, queryString, params, logger26, cache, queryMetadata, cacheConfig, fields, name18, _isResponseInArrayMode, customResultMapper) {
|
|
179261
179556
|
super({
|
|
179262
179557
|
sql: queryString,
|
|
179263
179558
|
params
|
|
@@ -179265,7 +179560,7 @@ var PglitePreparedQuery = class extends PgPreparedQuery {
|
|
|
179265
179560
|
this.client = client;
|
|
179266
179561
|
this.queryString = queryString;
|
|
179267
179562
|
this.params = params;
|
|
179268
|
-
this.logger =
|
|
179563
|
+
this.logger = logger26;
|
|
179269
179564
|
this.fields = fields;
|
|
179270
179565
|
this._isResponseInArrayMode = _isResponseInArrayMode;
|
|
179271
179566
|
this.customResultMapper = customResultMapper;
|
|
@@ -179418,11 +179713,11 @@ function construct(client, config3 = {}) {
|
|
|
179418
179713
|
const dialect = new PgDialect({
|
|
179419
179714
|
casing: config3.casing
|
|
179420
179715
|
});
|
|
179421
|
-
let
|
|
179716
|
+
let logger26;
|
|
179422
179717
|
if (config3.logger === true) {
|
|
179423
|
-
|
|
179718
|
+
logger26 = new DefaultLogger();
|
|
179424
179719
|
} else if (config3.logger !== false) {
|
|
179425
|
-
|
|
179720
|
+
logger26 = config3.logger;
|
|
179426
179721
|
}
|
|
179427
179722
|
let schema;
|
|
179428
179723
|
if (config3.schema) {
|
|
@@ -179434,7 +179729,7 @@ function construct(client, config3 = {}) {
|
|
|
179434
179729
|
};
|
|
179435
179730
|
}
|
|
179436
179731
|
const driver = new PgliteDriver(client, dialect, {
|
|
179437
|
-
logger:
|
|
179732
|
+
logger: logger26,
|
|
179438
179733
|
cache: config3.cache
|
|
179439
179734
|
});
|
|
179440
179735
|
const session2 = driver.createSession(schema);
|
|
@@ -179503,7 +179798,7 @@ var NodePgPreparedQuery = class extends PgPreparedQuery {
|
|
|
179503
179798
|
static {
|
|
179504
179799
|
__name(this, "NodePgPreparedQuery");
|
|
179505
179800
|
}
|
|
179506
|
-
constructor(client, queryString, params,
|
|
179801
|
+
constructor(client, queryString, params, logger26, cache, queryMetadata, cacheConfig, fields, name18, _isResponseInArrayMode, customResultMapper) {
|
|
179507
179802
|
super({
|
|
179508
179803
|
sql: queryString,
|
|
179509
179804
|
params
|
|
@@ -179511,7 +179806,7 @@ var NodePgPreparedQuery = class extends PgPreparedQuery {
|
|
|
179511
179806
|
this.client = client;
|
|
179512
179807
|
this.queryString = queryString;
|
|
179513
179808
|
this.params = params;
|
|
179514
|
-
this.logger =
|
|
179809
|
+
this.logger = logger26;
|
|
179515
179810
|
this.fields = fields;
|
|
179516
179811
|
this._isResponseInArrayMode = _isResponseInArrayMode;
|
|
179517
179812
|
this.customResultMapper = customResultMapper;
|
|
@@ -179735,11 +180030,11 @@ function construct2(client, config3 = {}) {
|
|
|
179735
180030
|
const dialect = new PgDialect({
|
|
179736
180031
|
casing: config3.casing
|
|
179737
180032
|
});
|
|
179738
|
-
let
|
|
180033
|
+
let logger26;
|
|
179739
180034
|
if (config3.logger === true) {
|
|
179740
|
-
|
|
180035
|
+
logger26 = new DefaultLogger();
|
|
179741
180036
|
} else if (config3.logger !== false) {
|
|
179742
|
-
|
|
180037
|
+
logger26 = config3.logger;
|
|
179743
180038
|
}
|
|
179744
180039
|
let schema;
|
|
179745
180040
|
if (config3.schema) {
|
|
@@ -179751,7 +180046,7 @@ function construct2(client, config3 = {}) {
|
|
|
179751
180046
|
};
|
|
179752
180047
|
}
|
|
179753
180048
|
const driver = new NodePgDriver(client, dialect, {
|
|
179754
|
-
logger:
|
|
180049
|
+
logger: logger26,
|
|
179755
180050
|
cache: config3.cache
|
|
179756
180051
|
});
|
|
179757
180052
|
const session2 = driver.createSession(schema);
|
|
@@ -181884,11 +182179,11 @@ var parseLogLevel = /* @__PURE__ */ __name((maybeLevel, sourceName, client) => {
|
|
|
181884
182179
|
function noop2() {
|
|
181885
182180
|
}
|
|
181886
182181
|
__name(noop2, "noop");
|
|
181887
|
-
function makeLogFn(fnLevel,
|
|
181888
|
-
if (!
|
|
182182
|
+
function makeLogFn(fnLevel, logger26, logLevel) {
|
|
182183
|
+
if (!logger26 || levelNumbers[fnLevel] > levelNumbers[logLevel]) {
|
|
181889
182184
|
return noop2;
|
|
181890
182185
|
} else {
|
|
181891
|
-
return
|
|
182186
|
+
return logger26[fnLevel].bind(logger26);
|
|
181892
182187
|
}
|
|
181893
182188
|
}
|
|
181894
182189
|
__name(makeLogFn, "makeLogFn");
|
|
@@ -181900,22 +182195,22 @@ var noopLogger = {
|
|
|
181900
182195
|
};
|
|
181901
182196
|
var cachedLoggers = /* @__PURE__ */ new WeakMap();
|
|
181902
182197
|
function loggerFor(client) {
|
|
181903
|
-
const
|
|
182198
|
+
const logger26 = client.logger;
|
|
181904
182199
|
const logLevel = client.logLevel ?? "off";
|
|
181905
|
-
if (!
|
|
182200
|
+
if (!logger26) {
|
|
181906
182201
|
return noopLogger;
|
|
181907
182202
|
}
|
|
181908
|
-
const cachedLogger = cachedLoggers.get(
|
|
182203
|
+
const cachedLogger = cachedLoggers.get(logger26);
|
|
181909
182204
|
if (cachedLogger && cachedLogger[0] === logLevel) {
|
|
181910
182205
|
return cachedLogger[1];
|
|
181911
182206
|
}
|
|
181912
182207
|
const levelLogger = {
|
|
181913
|
-
error: makeLogFn("error",
|
|
181914
|
-
warn: makeLogFn("warn",
|
|
181915
|
-
info: makeLogFn("info",
|
|
181916
|
-
debug: makeLogFn("debug",
|
|
182208
|
+
error: makeLogFn("error", logger26, logLevel),
|
|
182209
|
+
warn: makeLogFn("warn", logger26, logLevel),
|
|
182210
|
+
info: makeLogFn("info", logger26, logLevel),
|
|
182211
|
+
debug: makeLogFn("debug", logger26, logLevel)
|
|
181917
182212
|
};
|
|
181918
|
-
cachedLoggers.set(
|
|
182213
|
+
cachedLoggers.set(logger26, [
|
|
181919
182214
|
logLevel,
|
|
181920
182215
|
levelLogger
|
|
181921
182216
|
]);
|
|
@@ -188154,11 +188449,11 @@ var parseLogLevel2 = /* @__PURE__ */ __name((maybeLevel, sourceName, client) =>
|
|
|
188154
188449
|
function noop3() {
|
|
188155
188450
|
}
|
|
188156
188451
|
__name(noop3, "noop");
|
|
188157
|
-
function makeLogFn2(fnLevel,
|
|
188158
|
-
if (!
|
|
188452
|
+
function makeLogFn2(fnLevel, logger26, logLevel) {
|
|
188453
|
+
if (!logger26 || levelNumbers2[fnLevel] > levelNumbers2[logLevel]) {
|
|
188159
188454
|
return noop3;
|
|
188160
188455
|
} else {
|
|
188161
|
-
return
|
|
188456
|
+
return logger26[fnLevel].bind(logger26);
|
|
188162
188457
|
}
|
|
188163
188458
|
}
|
|
188164
188459
|
__name(makeLogFn2, "makeLogFn");
|
|
@@ -188170,22 +188465,22 @@ var noopLogger2 = {
|
|
|
188170
188465
|
};
|
|
188171
188466
|
var cachedLoggers2 = /* @__PURE__ */ new WeakMap();
|
|
188172
188467
|
function loggerFor2(client) {
|
|
188173
|
-
const
|
|
188468
|
+
const logger26 = client.logger;
|
|
188174
188469
|
const logLevel = client.logLevel ?? "off";
|
|
188175
|
-
if (!
|
|
188470
|
+
if (!logger26) {
|
|
188176
188471
|
return noopLogger2;
|
|
188177
188472
|
}
|
|
188178
|
-
const cachedLogger = cachedLoggers2.get(
|
|
188473
|
+
const cachedLogger = cachedLoggers2.get(logger26);
|
|
188179
188474
|
if (cachedLogger && cachedLogger[0] === logLevel) {
|
|
188180
188475
|
return cachedLogger[1];
|
|
188181
188476
|
}
|
|
188182
188477
|
const levelLogger = {
|
|
188183
|
-
error: makeLogFn2("error",
|
|
188184
|
-
warn: makeLogFn2("warn",
|
|
188185
|
-
info: makeLogFn2("info",
|
|
188186
|
-
debug: makeLogFn2("debug",
|
|
188478
|
+
error: makeLogFn2("error", logger26, logLevel),
|
|
188479
|
+
warn: makeLogFn2("warn", logger26, logLevel),
|
|
188480
|
+
info: makeLogFn2("info", logger26, logLevel),
|
|
188481
|
+
debug: makeLogFn2("debug", logger26, logLevel)
|
|
188187
188482
|
};
|
|
188188
|
-
cachedLoggers2.set(
|
|
188483
|
+
cachedLoggers2.set(logger26, [
|
|
188189
188484
|
logLevel,
|
|
188190
188485
|
levelLogger
|
|
188191
188486
|
]);
|
|
@@ -188230,7 +188525,7 @@ var Stream = class _Stream {
|
|
|
188230
188525
|
}
|
|
188231
188526
|
static fromSSEResponse(response, controller, client) {
|
|
188232
188527
|
let consumed = false;
|
|
188233
|
-
const
|
|
188528
|
+
const logger26 = client ? loggerFor2(client) : console;
|
|
188234
188529
|
async function* iterator2() {
|
|
188235
188530
|
if (consumed) {
|
|
188236
188531
|
throw new OpenAIError("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");
|
|
@@ -188249,8 +188544,8 @@ var Stream = class _Stream {
|
|
|
188249
188544
|
try {
|
|
188250
188545
|
data = JSON.parse(sse.data);
|
|
188251
188546
|
} catch (e) {
|
|
188252
|
-
|
|
188253
|
-
|
|
188547
|
+
logger26.error(`Could not parse message into JSON:`, sse.data);
|
|
188548
|
+
logger26.error(`From chunk:`, sse.raw);
|
|
188254
188549
|
throw e;
|
|
188255
188550
|
}
|
|
188256
188551
|
if (data && data.error) {
|
|
@@ -196981,7 +197276,7 @@ var logger13 = getLogger("JsonTransformer");
|
|
|
196981
197276
|
// ../packages/agents-core/dist/utils/json-parser.js
|
|
196982
197277
|
var import_traverse = __toESM(require_traverse(), 1);
|
|
196983
197278
|
|
|
196984
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
197279
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.2_hono@4.11.1_zod@4.2.1/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
|
|
196985
197280
|
var import_ajv2 = __toESM(require_ajv(), 1);
|
|
196986
197281
|
var import_ajv_formats = __toESM(require_dist3(), 1);
|
|
196987
197282
|
|
|
@@ -200966,12 +201261,12 @@ var logWarnings = /* @__PURE__ */ __name((options) => {
|
|
|
200966
201261
|
if (options.warnings.length === 0) {
|
|
200967
201262
|
return;
|
|
200968
201263
|
}
|
|
200969
|
-
const
|
|
200970
|
-
if (
|
|
201264
|
+
const logger26 = globalThis.AI_SDK_LOG_WARNINGS;
|
|
201265
|
+
if (logger26 === false) {
|
|
200971
201266
|
return;
|
|
200972
201267
|
}
|
|
200973
|
-
if (typeof
|
|
200974
|
-
|
|
201268
|
+
if (typeof logger26 === "function") {
|
|
201269
|
+
logger26(options);
|
|
200975
201270
|
return;
|
|
200976
201271
|
}
|
|
200977
201272
|
if (!hasLoggedBefore) {
|
|
@@ -227636,11 +227931,116 @@ var ModelFactory = class ModelFactory2 {
|
|
|
227636
227931
|
// ../packages/agents-core/dist/utils/service-token-auth.js
|
|
227637
227932
|
var logger15 = getLogger("service-token-auth");
|
|
227638
227933
|
|
|
227934
|
+
// ../packages/agents-core/dist/utils/slack-link-token.js
|
|
227935
|
+
var logger16 = getLogger("slack-link-token");
|
|
227936
|
+
var ISSUER = "inkeep-auth";
|
|
227937
|
+
var AUDIENCE = "slack-link";
|
|
227938
|
+
var TOKEN_USE = "slackLinkCode";
|
|
227939
|
+
var SlackLinkTokenPayloadSchema = external_exports.object({
|
|
227940
|
+
iss: external_exports.literal(ISSUER),
|
|
227941
|
+
aud: external_exports.literal(AUDIENCE),
|
|
227942
|
+
sub: external_exports.string().min(1),
|
|
227943
|
+
iat: external_exports.number(),
|
|
227944
|
+
exp: external_exports.number(),
|
|
227945
|
+
jti: external_exports.string().optional(),
|
|
227946
|
+
tokenUse: external_exports.literal(TOKEN_USE),
|
|
227947
|
+
tenantId: external_exports.string().min(1),
|
|
227948
|
+
slack: external_exports.object({
|
|
227949
|
+
teamId: external_exports.string().min(1),
|
|
227950
|
+
userId: external_exports.string().min(1),
|
|
227951
|
+
enterpriseId: external_exports.string().min(1).optional(),
|
|
227952
|
+
username: external_exports.string().optional()
|
|
227953
|
+
})
|
|
227954
|
+
});
|
|
227955
|
+
|
|
227956
|
+
// ../packages/agents-core/dist/utils/slack-user-token.js
|
|
227957
|
+
var logger17 = getLogger("slack-user-token");
|
|
227958
|
+
var ISSUER2 = "inkeep-auth";
|
|
227959
|
+
var AUDIENCE2 = "inkeep-api";
|
|
227960
|
+
var TOKEN_USE2 = "slackUser";
|
|
227961
|
+
var ACTOR_SUB = "inkeep-work-app-slack";
|
|
227962
|
+
var SlackAccessTokenPayloadSchema = external_exports.object({
|
|
227963
|
+
iss: external_exports.literal(ISSUER2),
|
|
227964
|
+
aud: external_exports.literal(AUDIENCE2),
|
|
227965
|
+
sub: external_exports.string().min(1),
|
|
227966
|
+
iat: external_exports.number(),
|
|
227967
|
+
exp: external_exports.number(),
|
|
227968
|
+
jti: external_exports.string().optional(),
|
|
227969
|
+
tokenUse: external_exports.literal(TOKEN_USE2),
|
|
227970
|
+
act: external_exports.object({
|
|
227971
|
+
sub: external_exports.literal(ACTOR_SUB)
|
|
227972
|
+
}),
|
|
227973
|
+
tenantId: external_exports.string().min(1),
|
|
227974
|
+
slack: external_exports.object({
|
|
227975
|
+
teamId: external_exports.string().min(1),
|
|
227976
|
+
userId: external_exports.string().min(1),
|
|
227977
|
+
enterpriseId: external_exports.string().min(1).optional(),
|
|
227978
|
+
email: external_exports.string().email().optional()
|
|
227979
|
+
})
|
|
227980
|
+
});
|
|
227981
|
+
|
|
227982
|
+
// ../packages/agents-core/dist/utils/sse-parser.js
|
|
227983
|
+
function parseSSEResponse(sseText) {
|
|
227984
|
+
let textContent = "";
|
|
227985
|
+
let hasError = false;
|
|
227986
|
+
let errorMessage = "";
|
|
227987
|
+
const lines = sseText.split("\n").filter((line2) => line2.startsWith("data: "));
|
|
227988
|
+
for (const line2 of lines) {
|
|
227989
|
+
const jsonStr = line2.slice(6).trim();
|
|
227990
|
+
if (!jsonStr || jsonStr === "[DONE]") continue;
|
|
227991
|
+
try {
|
|
227992
|
+
const data = JSON.parse(jsonStr);
|
|
227993
|
+
if (data.object === "chat.completion.chunk" && data.choices?.[0]?.delta) {
|
|
227994
|
+
const delta = data.choices[0].delta;
|
|
227995
|
+
if (delta.content && typeof delta.content === "string") try {
|
|
227996
|
+
const parsedContent = JSON.parse(delta.content);
|
|
227997
|
+
if (parsedContent.type === "data-operation") {
|
|
227998
|
+
if (parsedContent.data?.type === "error") {
|
|
227999
|
+
hasError = true;
|
|
228000
|
+
errorMessage = parsedContent.data.message || "Unknown error occurred";
|
|
228001
|
+
}
|
|
228002
|
+
continue;
|
|
228003
|
+
}
|
|
228004
|
+
textContent += delta.content;
|
|
228005
|
+
} catch {
|
|
228006
|
+
textContent += delta.content;
|
|
228007
|
+
}
|
|
228008
|
+
continue;
|
|
228009
|
+
}
|
|
228010
|
+
if (data.type === "text-delta" && data.delta) {
|
|
228011
|
+
textContent += data.delta;
|
|
228012
|
+
continue;
|
|
228013
|
+
}
|
|
228014
|
+
if (data.type === "text-start" || data.type === "text-end") continue;
|
|
228015
|
+
if (data.type === "data-operation") {
|
|
228016
|
+
if (data.data?.type === "error") {
|
|
228017
|
+
hasError = true;
|
|
228018
|
+
errorMessage = data.data.message || "Unknown error occurred";
|
|
228019
|
+
}
|
|
228020
|
+
continue;
|
|
228021
|
+
}
|
|
228022
|
+
if (data.type === "error") {
|
|
228023
|
+
hasError = true;
|
|
228024
|
+
errorMessage = data.message || "Unknown error occurred";
|
|
228025
|
+
}
|
|
228026
|
+
} catch {
|
|
228027
|
+
}
|
|
228028
|
+
}
|
|
228029
|
+
if (hasError) return {
|
|
228030
|
+
text: textContent.trim(),
|
|
228031
|
+
error: errorMessage
|
|
228032
|
+
};
|
|
228033
|
+
return {
|
|
228034
|
+
text: textContent.trim()
|
|
228035
|
+
};
|
|
228036
|
+
}
|
|
228037
|
+
__name(parseSSEResponse, "parseSSEResponse");
|
|
228038
|
+
|
|
227639
228039
|
// ../packages/agents-core/dist/utils/third-party-mcp-servers/composio-client.js
|
|
227640
228040
|
var logger$1 = getLogger("composio-client");
|
|
227641
228041
|
|
|
227642
228042
|
// ../packages/agents-core/dist/utils/third-party-mcp-servers/third-party-check.js
|
|
227643
|
-
var
|
|
228043
|
+
var logger18 = getLogger("third-party-check");
|
|
227644
228044
|
|
|
227645
228045
|
// ../packages/agents-core/dist/utils/trigger-auth.js
|
|
227646
228046
|
var import_node_crypto7 = require("node:crypto");
|
|
@@ -227648,10 +228048,10 @@ var import_node_util3 = require("node:util");
|
|
|
227648
228048
|
var scryptAsync2 = (0, import_node_util3.promisify)(import_node_crypto7.scrypt);
|
|
227649
228049
|
|
|
227650
228050
|
// ../packages/agents-core/dist/utils/tracer-factory.js
|
|
227651
|
-
var
|
|
228051
|
+
var logger19 = getLogger("tracer");
|
|
227652
228052
|
|
|
227653
228053
|
// ../packages/agents-core/dist/data-access/manage/tools.js
|
|
227654
|
-
var
|
|
228054
|
+
var logger20 = getLogger("tools");
|
|
227655
228055
|
var listTools = /* @__PURE__ */ __name((db) => async (params) => {
|
|
227656
228056
|
const page = params.pagination?.page || 1;
|
|
227657
228057
|
const limit3 = Math.min(params.pagination?.limit || 10, 100);
|
|
@@ -228106,10 +228506,10 @@ var defaultLogger = {
|
|
|
228106
228506
|
error: /* @__PURE__ */ __name(() => {
|
|
228107
228507
|
}, "error")
|
|
228108
228508
|
};
|
|
228109
|
-
var getFullAgent = /* @__PURE__ */ __name((db,
|
|
228509
|
+
var getFullAgent = /* @__PURE__ */ __name((db, logger26 = defaultLogger) => async (params) => {
|
|
228110
228510
|
const { scopes } = params;
|
|
228111
228511
|
const { tenantId, projectId } = scopes;
|
|
228112
|
-
|
|
228512
|
+
logger26.info({
|
|
228113
228513
|
tenantId,
|
|
228114
228514
|
agentId: scopes.agentId
|
|
228115
228515
|
}, "Retrieving full agent definition");
|
|
@@ -228122,20 +228522,20 @@ var getFullAgent = /* @__PURE__ */ __name((db, logger24 = defaultLogger) => asyn
|
|
|
228122
228522
|
}
|
|
228123
228523
|
});
|
|
228124
228524
|
if (!agent) {
|
|
228125
|
-
|
|
228525
|
+
logger26.info({
|
|
228126
228526
|
tenantId,
|
|
228127
228527
|
agentId: scopes.agentId
|
|
228128
228528
|
}, "Agent not found");
|
|
228129
228529
|
return null;
|
|
228130
228530
|
}
|
|
228131
|
-
|
|
228531
|
+
logger26.info({
|
|
228132
228532
|
tenantId,
|
|
228133
228533
|
agentId: scopes.agentId,
|
|
228134
228534
|
agentCount: Object.keys(agent.subAgents).length
|
|
228135
228535
|
}, "Full agent retrieved successfully");
|
|
228136
228536
|
return agent;
|
|
228137
228537
|
} catch (error46) {
|
|
228138
|
-
|
|
228538
|
+
logger26.error({
|
|
228139
228539
|
tenantId,
|
|
228140
228540
|
agentId: scopes.agentId,
|
|
228141
228541
|
error: error46 instanceof Error ? error46.message : "Unknown error"
|
|
@@ -228301,11 +228701,11 @@ var filterConversationsForJob = /* @__PURE__ */ __name((db) => async (params) =>
|
|
|
228301
228701
|
loadEnvironmentFiles();
|
|
228302
228702
|
|
|
228303
228703
|
// ../packages/agents-core/dist/dolt/ref-middleware.js
|
|
228304
|
-
var
|
|
228704
|
+
var logger21 = getLogger("ref-middleware");
|
|
228305
228705
|
|
|
228306
228706
|
// ../packages/agents-core/dist/dolt/ref-scope.js
|
|
228307
228707
|
var import_node_async_hooks2 = require("node:async_hooks");
|
|
228308
|
-
var
|
|
228708
|
+
var logger22 = getLogger("ref-scope");
|
|
228309
228709
|
var refScopeStorage = new import_node_async_hooks2.AsyncLocalStorage();
|
|
228310
228710
|
var NestedRefScopeError = class extends Error {
|
|
228311
228711
|
static {
|
|
@@ -228323,7 +228723,7 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228323
228723
|
const existingScope = refScopeStorage.getStore();
|
|
228324
228724
|
if (existingScope) {
|
|
228325
228725
|
if (existingScope.ref === resolvedRef.name) {
|
|
228326
|
-
|
|
228726
|
+
logger22.debug({
|
|
228327
228727
|
ref: resolvedRef.name,
|
|
228328
228728
|
existingConnectionId: existingScope.connectionId
|
|
228329
228729
|
}, "Reusing existing ref scope");
|
|
@@ -228346,7 +228746,7 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228346
228746
|
connection$1.release();
|
|
228347
228747
|
}
|
|
228348
228748
|
}
|
|
228349
|
-
|
|
228749
|
+
logger22.debug({
|
|
228350
228750
|
ref: resolvedRef.name,
|
|
228351
228751
|
refType: resolvedRef.type,
|
|
228352
228752
|
connectionId
|
|
@@ -228358,7 +228758,7 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228358
228758
|
schema: manage_schema_exports
|
|
228359
228759
|
});
|
|
228360
228760
|
if (resolvedRef.type === "branch") {
|
|
228361
|
-
|
|
228761
|
+
logger22.debug({
|
|
228362
228762
|
branch: resolvedRef.name,
|
|
228363
228763
|
connectionId
|
|
228364
228764
|
}, "Checking out branch");
|
|
@@ -228368,7 +228768,7 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228368
228768
|
});
|
|
228369
228769
|
} else {
|
|
228370
228770
|
tempBranch = `temp_${resolvedRef.type}_${Date.now()}_${generateId()}`;
|
|
228371
|
-
|
|
228771
|
+
logger22.debug({
|
|
228372
228772
|
tempBranch,
|
|
228373
228773
|
hash: resolvedRef.hash,
|
|
228374
228774
|
refType: resolvedRef.type,
|
|
@@ -228386,7 +228786,7 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228386
228786
|
}, () => dataAccessFn(db));
|
|
228387
228787
|
if (commit && resolvedRef.type === "branch") try {
|
|
228388
228788
|
if ((await doltStatus(db)()).length > 0) {
|
|
228389
|
-
|
|
228789
|
+
logger22.info({
|
|
228390
228790
|
branch: resolvedRef.name,
|
|
228391
228791
|
message: commitMessage,
|
|
228392
228792
|
connectionId
|
|
@@ -228398,19 +228798,19 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228398
228798
|
email: "api@inkeep.com"
|
|
228399
228799
|
}
|
|
228400
228800
|
});
|
|
228401
|
-
|
|
228801
|
+
logger22.info({
|
|
228402
228802
|
branch: resolvedRef.name,
|
|
228403
228803
|
connectionId
|
|
228404
228804
|
}, "Successfully committed changes");
|
|
228405
228805
|
}
|
|
228406
228806
|
} catch (commitError) {
|
|
228407
|
-
|
|
228807
|
+
logger22.error({
|
|
228408
228808
|
error: commitError,
|
|
228409
228809
|
branch: resolvedRef.name,
|
|
228410
228810
|
connectionId
|
|
228411
228811
|
}, "Failed to auto-commit changes");
|
|
228412
228812
|
}
|
|
228413
|
-
|
|
228813
|
+
logger22.debug({
|
|
228414
228814
|
ref: resolvedRef.name,
|
|
228415
228815
|
duration: Date.now() - startTime,
|
|
228416
228816
|
connectionId
|
|
@@ -228423,19 +228823,19 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228423
228823
|
});
|
|
228424
228824
|
if ((await doltStatus(db)()).length > 0) {
|
|
228425
228825
|
await doltReset(db)();
|
|
228426
|
-
|
|
228826
|
+
logger22.info({
|
|
228427
228827
|
branch: resolvedRef.name,
|
|
228428
228828
|
connectionId
|
|
228429
228829
|
}, "Reset uncommitted changes due to failed operation");
|
|
228430
228830
|
}
|
|
228431
228831
|
} catch (resetError) {
|
|
228432
|
-
|
|
228832
|
+
logger22.error({
|
|
228433
228833
|
error: resetError,
|
|
228434
228834
|
branch: resolvedRef.name,
|
|
228435
228835
|
connectionId
|
|
228436
228836
|
}, "Failed to reset changes after error");
|
|
228437
228837
|
}
|
|
228438
|
-
|
|
228838
|
+
logger22.error({
|
|
228439
228839
|
ref: resolvedRef.name,
|
|
228440
228840
|
duration: Date.now() - startTime,
|
|
228441
228841
|
connectionId,
|
|
@@ -228446,7 +228846,7 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228446
228846
|
try {
|
|
228447
228847
|
await connection.query(`SELECT DOLT_CHECKOUT('main')`);
|
|
228448
228848
|
if (tempBranch) {
|
|
228449
|
-
|
|
228849
|
+
logger22.debug({
|
|
228450
228850
|
tempBranch,
|
|
228451
228851
|
connectionId
|
|
228452
228852
|
}, "Deleting temporary branch");
|
|
@@ -228455,14 +228855,14 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228455
228855
|
]);
|
|
228456
228856
|
}
|
|
228457
228857
|
} catch (cleanupError) {
|
|
228458
|
-
|
|
228858
|
+
logger22.error({
|
|
228459
228859
|
error: cleanupError,
|
|
228460
228860
|
tempBranch,
|
|
228461
228861
|
connectionId
|
|
228462
228862
|
}, "Error during ref scope cleanup");
|
|
228463
228863
|
} finally {
|
|
228464
228864
|
connection.release();
|
|
228465
|
-
|
|
228865
|
+
logger22.debug({
|
|
228466
228866
|
ref: resolvedRef.name,
|
|
228467
228867
|
duration: Date.now() - startTime,
|
|
228468
228868
|
connectionId
|
|
@@ -228577,10 +228977,10 @@ var runDbClient = createAgentsRunDatabaseClient({
|
|
|
228577
228977
|
var runDbClient_default = runDbClient;
|
|
228578
228978
|
|
|
228579
228979
|
// src/domains/evals/services/EvaluationService.ts
|
|
228580
|
-
var
|
|
228980
|
+
var logger23 = getLogger("EvaluationService");
|
|
228581
228981
|
function jsonSchemaToZod3(jsonSchema3) {
|
|
228582
228982
|
if (!jsonSchema3 || typeof jsonSchema3 !== "object") {
|
|
228583
|
-
|
|
228983
|
+
logger23.warn({
|
|
228584
228984
|
jsonSchema: jsonSchema3
|
|
228585
228985
|
}, "Invalid JSON schema provided, using string fallback");
|
|
228586
228986
|
return external_exports.string();
|
|
@@ -228619,7 +229019,7 @@ function jsonSchemaToZod3(jsonSchema3) {
|
|
|
228619
229019
|
case "null":
|
|
228620
229020
|
return external_exports.null();
|
|
228621
229021
|
default:
|
|
228622
|
-
|
|
229022
|
+
logger23.warn({
|
|
228623
229023
|
unsupportedType: jsonSchema3.type,
|
|
228624
229024
|
schema: jsonSchema3
|
|
228625
229025
|
}, "Unsupported JSON schema type, using unknown validation");
|
|
@@ -228676,7 +229076,7 @@ var EvaluationService = class {
|
|
|
228676
229076
|
messages: initialMessages
|
|
228677
229077
|
});
|
|
228678
229078
|
} catch (error46) {
|
|
228679
|
-
|
|
229079
|
+
logger23.error({
|
|
228680
229080
|
error: error46 instanceof Error ? error46.message : String(error46),
|
|
228681
229081
|
datasetItemId: datasetItem2.id
|
|
228682
229082
|
}, "Error running dataset item through chat API");
|
|
@@ -228711,7 +229111,7 @@ var EvaluationService = class {
|
|
|
228711
229111
|
"x-inkeep-dataset-run-id": datasetRunId
|
|
228712
229112
|
}
|
|
228713
229113
|
};
|
|
228714
|
-
|
|
229114
|
+
logger23.info({
|
|
228715
229115
|
tenantId,
|
|
228716
229116
|
projectId,
|
|
228717
229117
|
agentId,
|
|
@@ -228726,7 +229126,7 @@ var EvaluationService = class {
|
|
|
228726
229126
|
});
|
|
228727
229127
|
if (!response.ok) {
|
|
228728
229128
|
const errorText = await response.text();
|
|
228729
|
-
|
|
229129
|
+
logger23.error({
|
|
228730
229130
|
status: response.status,
|
|
228731
229131
|
statusText: response.statusText,
|
|
228732
229132
|
errorText,
|
|
@@ -228739,9 +229139,9 @@ var EvaluationService = class {
|
|
|
228739
229139
|
};
|
|
228740
229140
|
}
|
|
228741
229141
|
const responseText = await response.text();
|
|
228742
|
-
const parseResult =
|
|
229142
|
+
const parseResult = parseSSEResponse(responseText);
|
|
228743
229143
|
if (parseResult.error) {
|
|
228744
|
-
|
|
229144
|
+
logger23.error({
|
|
228745
229145
|
datasetItemId: datasetItem2.id,
|
|
228746
229146
|
conversationId,
|
|
228747
229147
|
errorMessage: parseResult.error
|
|
@@ -228751,7 +229151,7 @@ var EvaluationService = class {
|
|
|
228751
229151
|
error: parseResult.error
|
|
228752
229152
|
};
|
|
228753
229153
|
}
|
|
228754
|
-
|
|
229154
|
+
logger23.info({
|
|
228755
229155
|
datasetItemId: datasetItem2.id,
|
|
228756
229156
|
conversationId,
|
|
228757
229157
|
responseLength: parseResult.text?.length || 0
|
|
@@ -228766,7 +229166,7 @@ var EvaluationService = class {
|
|
|
228766
229166
|
*/
|
|
228767
229167
|
async runDatasetItemWithSimulation(params) {
|
|
228768
229168
|
const { tenantId, projectId, agentId, datasetItem: datasetItem2, datasetRunId, conversationId, apiKey, initialMessages, simulationAgent } = params;
|
|
228769
|
-
|
|
229169
|
+
logger23.info({
|
|
228770
229170
|
tenantId,
|
|
228771
229171
|
projectId,
|
|
228772
229172
|
agentId,
|
|
@@ -228806,7 +229206,7 @@ var EvaluationService = class {
|
|
|
228806
229206
|
while (stepCount < maxSteps) {
|
|
228807
229207
|
try {
|
|
228808
229208
|
const simulationPrompt = this.buildSimulationPrompt(simulationAgent.prompt, conversationHistory);
|
|
228809
|
-
|
|
229209
|
+
logger23.debug({
|
|
228810
229210
|
stepCount,
|
|
228811
229211
|
maxSteps,
|
|
228812
229212
|
conversationHistoryLength: conversationHistory.length
|
|
@@ -228817,7 +229217,7 @@ var EvaluationService = class {
|
|
|
228817
229217
|
});
|
|
228818
229218
|
const nextUserMessage = simulationResponse.text.trim();
|
|
228819
229219
|
if (!nextUserMessage) {
|
|
228820
|
-
|
|
229220
|
+
logger23.warn({
|
|
228821
229221
|
stepCount,
|
|
228822
229222
|
datasetItemId: datasetItem2.id
|
|
228823
229223
|
}, "Simulation agent returned empty message, stopping conversation");
|
|
@@ -228843,7 +229243,7 @@ var EvaluationService = class {
|
|
|
228843
229243
|
]
|
|
228844
229244
|
});
|
|
228845
229245
|
if (agentResponse.error || !agentResponse.response) {
|
|
228846
|
-
|
|
229246
|
+
logger23.warn({
|
|
228847
229247
|
stepCount,
|
|
228848
229248
|
error: agentResponse.error,
|
|
228849
229249
|
datasetItemId: datasetItem2.id
|
|
@@ -228856,7 +229256,7 @@ var EvaluationService = class {
|
|
|
228856
229256
|
});
|
|
228857
229257
|
stepCount++;
|
|
228858
229258
|
} catch (error46) {
|
|
228859
|
-
|
|
229259
|
+
logger23.error({
|
|
228860
229260
|
error: error46 instanceof Error ? error46.message : String(error46),
|
|
228861
229261
|
stepCount,
|
|
228862
229262
|
datasetItemId: datasetItem2.id
|
|
@@ -228864,7 +229264,7 @@ var EvaluationService = class {
|
|
|
228864
229264
|
break;
|
|
228865
229265
|
}
|
|
228866
229266
|
}
|
|
228867
|
-
|
|
229267
|
+
logger23.info({
|
|
228868
229268
|
datasetItemId: datasetItem2.id,
|
|
228869
229269
|
conversationId,
|
|
228870
229270
|
finalStepCount: stepCount,
|
|
@@ -228918,7 +229318,7 @@ Generate the next user message:`;
|
|
|
228918
229318
|
const validMessages = input.messages.map((msg) => {
|
|
228919
229319
|
const mappedRole = roleMap[msg.role.toLowerCase()];
|
|
228920
229320
|
if (!mappedRole) {
|
|
228921
|
-
|
|
229321
|
+
logger23.warn({
|
|
228922
229322
|
datasetItemId: datasetItem2.id,
|
|
228923
229323
|
invalidRole: msg.role
|
|
228924
229324
|
}, "Invalid message role found, skipping message");
|
|
@@ -228930,7 +229330,7 @@ Generate the next user message:`;
|
|
|
228930
229330
|
};
|
|
228931
229331
|
}).filter((msg) => msg !== null);
|
|
228932
229332
|
if (validMessages.length === 0) {
|
|
228933
|
-
|
|
229333
|
+
logger23.warn({
|
|
228934
229334
|
datasetItemId: datasetItem2.id,
|
|
228935
229335
|
totalMessages: input.messages.length
|
|
228936
229336
|
}, "No valid messages found after filtering roles");
|
|
@@ -228945,7 +229345,7 @@ Generate the next user message:`;
|
|
|
228945
229345
|
const validMessages = parsed.messages.map((msg) => {
|
|
228946
229346
|
const mappedRole = roleMap[msg.role?.toLowerCase()];
|
|
228947
229347
|
if (!mappedRole) {
|
|
228948
|
-
|
|
229348
|
+
logger23.warn({
|
|
228949
229349
|
datasetItemId: datasetItem2.id,
|
|
228950
229350
|
invalidRole: msg.role
|
|
228951
229351
|
}, "Invalid message role found in parsed input, skipping message");
|
|
@@ -228970,69 +229370,6 @@ Generate the next user message:`;
|
|
|
228970
229370
|
return null;
|
|
228971
229371
|
}
|
|
228972
229372
|
/**
|
|
228973
|
-
* Parse SSE (Server-Sent Events) response from chat API
|
|
228974
|
-
* Handles text deltas, error operations, and other data operations
|
|
228975
|
-
*/
|
|
228976
|
-
parseSSEResponse(sseText) {
|
|
228977
|
-
let textContent = "";
|
|
228978
|
-
let hasError = false;
|
|
228979
|
-
let errorMessage = "";
|
|
228980
|
-
const lines = sseText.split("\n").filter((line2) => line2.startsWith("data: "));
|
|
228981
|
-
for (const line2 of lines) {
|
|
228982
|
-
try {
|
|
228983
|
-
const data = JSON.parse(line2.slice(6));
|
|
228984
|
-
if (data.object === "chat.completion.chunk" && data.choices?.[0]?.delta) {
|
|
228985
|
-
const delta = data.choices[0].delta;
|
|
228986
|
-
if (delta.content) {
|
|
228987
|
-
textContent += delta.content;
|
|
228988
|
-
}
|
|
228989
|
-
if (delta.content && typeof delta.content === "string") {
|
|
228990
|
-
try {
|
|
228991
|
-
const parsedContent = JSON.parse(delta.content);
|
|
228992
|
-
if (parsedContent.type === "data-operation" && parsedContent.data?.type === "error") {
|
|
228993
|
-
hasError = true;
|
|
228994
|
-
errorMessage = parsedContent.data.message || "Unknown error occurred";
|
|
228995
|
-
logger21.warn({
|
|
228996
|
-
errorMessage,
|
|
228997
|
-
errorData: parsedContent.data
|
|
228998
|
-
}, "Received error operation from chat API");
|
|
228999
|
-
}
|
|
229000
|
-
} catch {
|
|
229001
|
-
}
|
|
229002
|
-
}
|
|
229003
|
-
} else if (data.type === "text-delta" && data.delta) {
|
|
229004
|
-
textContent += data.delta;
|
|
229005
|
-
} else if (data.type === "data-operation" && data.data?.type === "error") {
|
|
229006
|
-
hasError = true;
|
|
229007
|
-
errorMessage = data.data.message || "Unknown error occurred";
|
|
229008
|
-
logger21.warn({
|
|
229009
|
-
errorMessage,
|
|
229010
|
-
errorData: data.data
|
|
229011
|
-
}, "Received error operation from chat API");
|
|
229012
|
-
} else if (data.type === "error") {
|
|
229013
|
-
hasError = true;
|
|
229014
|
-
errorMessage = data.message || "Unknown error occurred";
|
|
229015
|
-
logger21.warn({
|
|
229016
|
-
errorMessage,
|
|
229017
|
-
errorData: data
|
|
229018
|
-
}, "Received error event from chat API");
|
|
229019
|
-
} else if (data.content) {
|
|
229020
|
-
textContent += typeof data.content === "string" ? data.content : JSON.stringify(data.content);
|
|
229021
|
-
}
|
|
229022
|
-
} catch {
|
|
229023
|
-
}
|
|
229024
|
-
}
|
|
229025
|
-
if (hasError) {
|
|
229026
|
-
return {
|
|
229027
|
-
text: textContent.trim(),
|
|
229028
|
-
error: errorMessage
|
|
229029
|
-
};
|
|
229030
|
-
}
|
|
229031
|
-
return {
|
|
229032
|
-
text: textContent.trim()
|
|
229033
|
-
};
|
|
229034
|
-
}
|
|
229035
|
-
/**
|
|
229036
229373
|
* Run an evaluation job based on an evaluation job config
|
|
229037
229374
|
* Filters conversations based on jobFilters and runs evaluations with configured evaluators
|
|
229038
229375
|
*/
|
|
@@ -229043,7 +229380,7 @@ Generate the next user message:`;
|
|
|
229043
229380
|
if (!resolvedRef) {
|
|
229044
229381
|
throw new Error("Failed to resolve ref");
|
|
229045
229382
|
}
|
|
229046
|
-
|
|
229383
|
+
logger23.info({
|
|
229047
229384
|
tenantId,
|
|
229048
229385
|
projectId,
|
|
229049
229386
|
evaluationJobConfigId,
|
|
@@ -229080,7 +229417,7 @@ Generate the next user message:`;
|
|
|
229080
229417
|
if (validEvaluators.length === 0) {
|
|
229081
229418
|
throw new Error(`No valid evaluators found for job config: ${evaluationJobConfigId}`);
|
|
229082
229419
|
}
|
|
229083
|
-
|
|
229420
|
+
logger23.info({
|
|
229084
229421
|
tenantId,
|
|
229085
229422
|
projectId,
|
|
229086
229423
|
evaluationJobConfigId,
|
|
@@ -229096,7 +229433,7 @@ Generate the next user message:`;
|
|
|
229096
229433
|
if (sampleRate !== void 0 && sampleRate !== null) {
|
|
229097
229434
|
const originalCount = conversationsToEvaluate.length;
|
|
229098
229435
|
conversationsToEvaluate = this.applySampleRate(conversationsToEvaluate, sampleRate);
|
|
229099
|
-
|
|
229436
|
+
logger23.info({
|
|
229100
229437
|
tenantId,
|
|
229101
229438
|
projectId,
|
|
229102
229439
|
evaluationJobConfigId,
|
|
@@ -229105,14 +229442,14 @@ Generate the next user message:`;
|
|
|
229105
229442
|
sampleRate
|
|
229106
229443
|
}, "Applied sample rate to conversations");
|
|
229107
229444
|
}
|
|
229108
|
-
|
|
229445
|
+
logger23.info({
|
|
229109
229446
|
tenantId,
|
|
229110
229447
|
projectId,
|
|
229111
229448
|
evaluationJobConfigId,
|
|
229112
229449
|
conversationCount: conversationsToEvaluate.length
|
|
229113
229450
|
}, "Found conversations for evaluation");
|
|
229114
229451
|
if (conversationsToEvaluate.length === 0) {
|
|
229115
|
-
|
|
229452
|
+
logger23.warn({
|
|
229116
229453
|
tenantId,
|
|
229117
229454
|
projectId,
|
|
229118
229455
|
evaluationJobConfigId
|
|
@@ -229129,7 +229466,7 @@ Generate the next user message:`;
|
|
|
229129
229466
|
for (const conversation of conversationsToEvaluate) {
|
|
229130
229467
|
for (const evaluator2 of validEvaluators) {
|
|
229131
229468
|
try {
|
|
229132
|
-
|
|
229469
|
+
logger23.info({
|
|
229133
229470
|
tenantId,
|
|
229134
229471
|
conversationId: conversation.id,
|
|
229135
229472
|
evaluatorId: evaluator2.id
|
|
@@ -229162,14 +229499,14 @@ Generate the next user message:`;
|
|
|
229162
229499
|
if (updatedResult) {
|
|
229163
229500
|
results.push(updatedResult);
|
|
229164
229501
|
}
|
|
229165
|
-
|
|
229502
|
+
logger23.info({
|
|
229166
229503
|
tenantId,
|
|
229167
229504
|
conversationId: conversation.id,
|
|
229168
229505
|
evaluatorId: evaluator2.id,
|
|
229169
229506
|
resultId: evalResult.id
|
|
229170
229507
|
}, "Evaluation completed successfully");
|
|
229171
229508
|
} catch (error46) {
|
|
229172
|
-
|
|
229509
|
+
logger23.error({
|
|
229173
229510
|
error: error46,
|
|
229174
229511
|
tenantId,
|
|
229175
229512
|
conversationId: conversation.id,
|
|
@@ -229194,7 +229531,7 @@ Generate the next user message:`;
|
|
|
229194
229531
|
}
|
|
229195
229532
|
}
|
|
229196
229533
|
} catch (error46) {
|
|
229197
|
-
|
|
229534
|
+
logger23.error({
|
|
229198
229535
|
error: error46 instanceof Error ? error46.message : String(error46),
|
|
229199
229536
|
tenantId,
|
|
229200
229537
|
conversationId: conversation.id,
|
|
@@ -229203,7 +229540,7 @@ Generate the next user message:`;
|
|
|
229203
229540
|
}
|
|
229204
229541
|
}
|
|
229205
229542
|
}
|
|
229206
|
-
|
|
229543
|
+
logger23.info({
|
|
229207
229544
|
tenantId,
|
|
229208
229545
|
projectId,
|
|
229209
229546
|
evaluationJobConfigId,
|
|
@@ -229273,20 +229610,20 @@ Generate the next user message:`;
|
|
|
229273
229610
|
}
|
|
229274
229611
|
}));
|
|
229275
229612
|
} else {
|
|
229276
|
-
|
|
229613
|
+
logger23.warn({
|
|
229277
229614
|
conversationId: conversation.id,
|
|
229278
229615
|
agentId: conversation.agentId
|
|
229279
229616
|
}, "AgentId not found, cannot get agent definition");
|
|
229280
229617
|
}
|
|
229281
229618
|
} catch (error46) {
|
|
229282
|
-
|
|
229619
|
+
logger23.warn({
|
|
229283
229620
|
error: error46,
|
|
229284
229621
|
conversationId: conversation.id,
|
|
229285
229622
|
agentId: conversation.agentId
|
|
229286
229623
|
}, "Failed to fetch agent definition for evaluation");
|
|
229287
229624
|
}
|
|
229288
229625
|
const prettifiedTrace = await this.fetchTraceFromSigNoz(conversation.id);
|
|
229289
|
-
|
|
229626
|
+
logger23.info({
|
|
229290
229627
|
conversationId: conversation.id,
|
|
229291
229628
|
hasTrace: !!prettifiedTrace,
|
|
229292
229629
|
traceActivityCount: prettifiedTrace?.timeline?.length || 0
|
|
@@ -229300,7 +229637,7 @@ Generate the next user message:`;
|
|
|
229300
229637
|
try {
|
|
229301
229638
|
schemaObj = JSON.parse(evaluator2.schema);
|
|
229302
229639
|
} catch (error46) {
|
|
229303
|
-
|
|
229640
|
+
logger23.error({
|
|
229304
229641
|
error: error46,
|
|
229305
229642
|
schemaString: evaluator2.schema
|
|
229306
229643
|
}, "Failed to parse evaluator schema string");
|
|
@@ -229309,7 +229646,7 @@ Generate the next user message:`;
|
|
|
229309
229646
|
} else {
|
|
229310
229647
|
schemaObj = evaluator2.schema;
|
|
229311
229648
|
}
|
|
229312
|
-
|
|
229649
|
+
logger23.info({
|
|
229313
229650
|
evaluatorId: evaluator2.id,
|
|
229314
229651
|
schemaType: typeof schemaObj,
|
|
229315
229652
|
schemaKeys: schemaObj && typeof schemaObj === "object" ? Object.keys(schemaObj) : []
|
|
@@ -229374,13 +229711,13 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229374
229711
|
let resultSchema;
|
|
229375
229712
|
try {
|
|
229376
229713
|
resultSchema = jsonSchemaToZod3(schema);
|
|
229377
|
-
|
|
229714
|
+
logger23.info({
|
|
229378
229715
|
schemaType: typeof schema,
|
|
229379
229716
|
schemaKeys: schema && typeof schema === "object" ? Object.keys(schema) : [],
|
|
229380
229717
|
convertedSchema: "success"
|
|
229381
229718
|
}, "Converted JSON schema to Zod");
|
|
229382
229719
|
} catch (error46) {
|
|
229383
|
-
|
|
229720
|
+
logger23.error({
|
|
229384
229721
|
error: error46,
|
|
229385
229722
|
schema
|
|
229386
229723
|
}, "Failed to convert JSON schema to Zod, using fallback");
|
|
@@ -229388,7 +229725,7 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229388
229725
|
}
|
|
229389
229726
|
const evaluationSchema = resultSchema;
|
|
229390
229727
|
try {
|
|
229391
|
-
|
|
229728
|
+
logger23.info({
|
|
229392
229729
|
promptLength: prompt.length,
|
|
229393
229730
|
model: modelConfig.model
|
|
229394
229731
|
}, "Calling generateObject");
|
|
@@ -229406,7 +229743,7 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229406
229743
|
};
|
|
229407
229744
|
} catch (error46) {
|
|
229408
229745
|
const errorMessage = error46 instanceof Error ? error46.message : String(error46);
|
|
229409
|
-
|
|
229746
|
+
logger23.error({
|
|
229410
229747
|
error: errorMessage,
|
|
229411
229748
|
schema: JSON.stringify(schema, null, 2),
|
|
229412
229749
|
promptPreview: prompt.substring(0, 500)
|
|
@@ -229423,7 +229760,7 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229423
229760
|
const retryDelayMs = 2e4;
|
|
229424
229761
|
const initialDelayMs = 3e4;
|
|
229425
229762
|
try {
|
|
229426
|
-
|
|
229763
|
+
logger23.info({
|
|
229427
229764
|
conversationId,
|
|
229428
229765
|
manageUIUrl,
|
|
229429
229766
|
initialDelayMs
|
|
@@ -229431,21 +229768,21 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229431
229768
|
await new Promise((resolve4) => setTimeout(resolve4, initialDelayMs));
|
|
229432
229769
|
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
229433
229770
|
try {
|
|
229434
|
-
|
|
229771
|
+
logger23.info({
|
|
229435
229772
|
conversationId,
|
|
229436
229773
|
attempt: attempt + 1,
|
|
229437
229774
|
maxRetries: maxRetries + 1
|
|
229438
229775
|
}, "Fetching trace from SigNoz");
|
|
229439
229776
|
const traceResponse = await fetch(`${manageUIUrl}/api/signoz/conversations/${conversationId}`);
|
|
229440
229777
|
if (!traceResponse.ok) {
|
|
229441
|
-
|
|
229778
|
+
logger23.warn({
|
|
229442
229779
|
conversationId,
|
|
229443
229780
|
status: traceResponse.status,
|
|
229444
229781
|
statusText: traceResponse.statusText,
|
|
229445
229782
|
attempt: attempt + 1
|
|
229446
229783
|
}, "Failed to fetch trace from SigNoz");
|
|
229447
229784
|
if (attempt < maxRetries) {
|
|
229448
|
-
|
|
229785
|
+
logger23.info({
|
|
229449
229786
|
conversationId,
|
|
229450
229787
|
retryDelayMs
|
|
229451
229788
|
}, "Retrying trace fetch after delay");
|
|
@@ -229455,34 +229792,34 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229455
229792
|
return null;
|
|
229456
229793
|
}
|
|
229457
229794
|
const conversationDetail = await traceResponse.json();
|
|
229458
|
-
|
|
229795
|
+
logger23.debug({
|
|
229459
229796
|
conversationId,
|
|
229460
229797
|
activityTypes: conversationDetail.activities?.map((a2) => a2.type) || [],
|
|
229461
229798
|
activityCount: conversationDetail.activities?.length || 0
|
|
229462
229799
|
}, "Checking activities for ai_assistant_message type");
|
|
229463
229800
|
const hasAssistantMessage = conversationDetail.activities?.some((activity) => activity.type === "ai_assistant_message");
|
|
229464
229801
|
if (!hasAssistantMessage) {
|
|
229465
|
-
|
|
229802
|
+
logger23.warn({
|
|
229466
229803
|
conversationId,
|
|
229467
229804
|
attempt: attempt + 1,
|
|
229468
229805
|
activityCount: conversationDetail.activities?.length || 0,
|
|
229469
229806
|
activityTypes: conversationDetail.activities?.slice(0, 5).map((a2) => a2.type) || []
|
|
229470
229807
|
}, "Trace fetched but ai_assistant_message not found in activities");
|
|
229471
229808
|
if (attempt < maxRetries) {
|
|
229472
|
-
|
|
229809
|
+
logger23.info({
|
|
229473
229810
|
conversationId,
|
|
229474
229811
|
retryDelayMs
|
|
229475
229812
|
}, "Retrying trace fetch after delay to wait for assistant message");
|
|
229476
229813
|
await new Promise((resolve4) => setTimeout(resolve4, retryDelayMs));
|
|
229477
229814
|
continue;
|
|
229478
229815
|
}
|
|
229479
|
-
|
|
229816
|
+
logger23.warn({
|
|
229480
229817
|
conversationId,
|
|
229481
229818
|
maxRetries,
|
|
229482
229819
|
activityCount: conversationDetail.activities?.length || 0
|
|
229483
229820
|
}, "Max retries reached, ai_assistant_message not found - proceeding with available trace data");
|
|
229484
229821
|
} else {
|
|
229485
|
-
|
|
229822
|
+
logger23.info({
|
|
229486
229823
|
conversationId,
|
|
229487
229824
|
activityCount: conversationDetail.activities?.length || 0,
|
|
229488
229825
|
attempt: attempt + 1
|
|
@@ -229491,13 +229828,13 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229491
229828
|
const prettifiedTrace = this.formatConversationAsPrettifiedTrace(conversationDetail);
|
|
229492
229829
|
return prettifiedTrace;
|
|
229493
229830
|
} catch (fetchError) {
|
|
229494
|
-
|
|
229831
|
+
logger23.warn({
|
|
229495
229832
|
error: fetchError,
|
|
229496
229833
|
conversationId,
|
|
229497
229834
|
attempt: attempt + 1
|
|
229498
229835
|
}, "Error fetching trace from SigNoz");
|
|
229499
229836
|
if (attempt < maxRetries) {
|
|
229500
|
-
|
|
229837
|
+
logger23.info({
|
|
229501
229838
|
conversationId,
|
|
229502
229839
|
retryDelayMs
|
|
229503
229840
|
}, "Retrying trace fetch after delay");
|
|
@@ -229509,7 +229846,7 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229509
229846
|
}
|
|
229510
229847
|
return null;
|
|
229511
229848
|
} catch (error46) {
|
|
229512
|
-
|
|
229849
|
+
logger23.warn({
|
|
229513
229850
|
error: error46,
|
|
229514
229851
|
conversationId,
|
|
229515
229852
|
manageUIUrl
|
|
@@ -229546,7 +229883,7 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229546
229883
|
};
|
|
229547
229884
|
|
|
229548
229885
|
// src/domains/evals/workflow/functions/evaluateConversation.ts
|
|
229549
|
-
var
|
|
229886
|
+
var logger24 = getLogger("workflow-evaluate-conversation");
|
|
229550
229887
|
async function getConversationStep(payload) {
|
|
229551
229888
|
const { tenantId, projectId, conversationId } = payload;
|
|
229552
229889
|
const conv = await getConversation(runDbClient_default)({
|
|
@@ -229614,7 +229951,7 @@ async function executeEvaluatorStep(payload, evaluatorId, conversation) {
|
|
|
229614
229951
|
output
|
|
229615
229952
|
}
|
|
229616
229953
|
});
|
|
229617
|
-
|
|
229954
|
+
logger24.info({
|
|
229618
229955
|
conversationId,
|
|
229619
229956
|
evaluatorId: evaluator2.id,
|
|
229620
229957
|
resultId: evalResult.id
|
|
@@ -229622,7 +229959,7 @@ async function executeEvaluatorStep(payload, evaluatorId, conversation) {
|
|
|
229622
229959
|
return updated;
|
|
229623
229960
|
} catch (error46) {
|
|
229624
229961
|
const errorMessage = error46 instanceof Error ? error46.message : "Unknown error";
|
|
229625
|
-
|
|
229962
|
+
logger24.error({
|
|
229626
229963
|
error: error46,
|
|
229627
229964
|
conversationId,
|
|
229628
229965
|
evaluatorId: evaluator2.id,
|
|
@@ -229645,7 +229982,7 @@ async function executeEvaluatorStep(payload, evaluatorId, conversation) {
|
|
|
229645
229982
|
}
|
|
229646
229983
|
__name(executeEvaluatorStep, "executeEvaluatorStep");
|
|
229647
229984
|
async function logStep(message, data) {
|
|
229648
|
-
|
|
229985
|
+
logger24.info(data, message);
|
|
229649
229986
|
}
|
|
229650
229987
|
__name(logStep, "logStep");
|
|
229651
229988
|
async function _evaluateConversationWorkflow(payload) {
|
|
@@ -229662,7 +229999,7 @@ registerStepFunction("step//src/domains/evals/workflow/functions/evaluateConvers
|
|
|
229662
229999
|
registerStepFunction("step//src/domains/evals/workflow/functions/evaluateConversation.ts//logStep", logStep);
|
|
229663
230000
|
|
|
229664
230001
|
// src/domains/evals/workflow/functions/runDatasetItem.ts
|
|
229665
|
-
var
|
|
230002
|
+
var logger25 = getLogger("workflow-run-dataset-item");
|
|
229666
230003
|
async function callChatApiStep(payload) {
|
|
229667
230004
|
const { tenantId, projectId, agentId, datasetItemId, datasetItemInput, datasetItemSimulationAgent, datasetRunId } = payload;
|
|
229668
230005
|
const evaluationService = new EvaluationService();
|
|
@@ -229678,7 +230015,7 @@ async function callChatApiStep(payload) {
|
|
|
229678
230015
|
datasetItem: datasetItem2,
|
|
229679
230016
|
datasetRunId
|
|
229680
230017
|
});
|
|
229681
|
-
|
|
230018
|
+
logger25.info({
|
|
229682
230019
|
tenantId,
|
|
229683
230020
|
projectId,
|
|
229684
230021
|
datasetItemId,
|
|
@@ -229701,7 +230038,7 @@ async function createRelationStep(payload, conversationId) {
|
|
|
229701
230038
|
conversationId,
|
|
229702
230039
|
datasetItemId
|
|
229703
230040
|
});
|
|
229704
|
-
|
|
230041
|
+
logger25.info({
|
|
229705
230042
|
tenantId,
|
|
229706
230043
|
projectId,
|
|
229707
230044
|
datasetItemId,
|
|
@@ -229715,7 +230052,7 @@ async function createRelationStep(payload, conversationId) {
|
|
|
229715
230052
|
};
|
|
229716
230053
|
} catch (error46) {
|
|
229717
230054
|
if (error46?.cause?.code === "23503" || error46?.code === "23503") {
|
|
229718
|
-
|
|
230055
|
+
logger25.warn({
|
|
229719
230056
|
tenantId,
|
|
229720
230057
|
projectId,
|
|
229721
230058
|
datasetItemId,
|
|
@@ -229746,7 +230083,7 @@ async function executeEvaluatorStep2(tenantId, projectId, conversationId, evalua
|
|
|
229746
230083
|
}
|
|
229747
230084
|
}));
|
|
229748
230085
|
if (!evaluator2) {
|
|
229749
|
-
|
|
230086
|
+
logger25.warn({
|
|
229750
230087
|
evaluatorId
|
|
229751
230088
|
}, "Evaluator not found");
|
|
229752
230089
|
return null;
|
|
@@ -229788,7 +230125,7 @@ async function executeEvaluatorStep2(tenantId, projectId, conversationId, evalua
|
|
|
229788
230125
|
output
|
|
229789
230126
|
}
|
|
229790
230127
|
});
|
|
229791
|
-
|
|
230128
|
+
logger25.info({
|
|
229792
230129
|
conversationId,
|
|
229793
230130
|
evaluatorId: evaluator2.id,
|
|
229794
230131
|
resultId: evalResult.id
|
|
@@ -229796,7 +230133,7 @@ async function executeEvaluatorStep2(tenantId, projectId, conversationId, evalua
|
|
|
229796
230133
|
return evalResult.id;
|
|
229797
230134
|
} catch (error46) {
|
|
229798
230135
|
const errorMessage = error46 instanceof Error ? error46.message : "Unknown error";
|
|
229799
|
-
|
|
230136
|
+
logger25.error({
|
|
229800
230137
|
error: error46,
|
|
229801
230138
|
conversationId,
|
|
229802
230139
|
evaluatorId: evaluator2.id
|
|
@@ -229818,7 +230155,7 @@ async function executeEvaluatorStep2(tenantId, projectId, conversationId, evalua
|
|
|
229818
230155
|
}
|
|
229819
230156
|
__name(executeEvaluatorStep2, "executeEvaluatorStep");
|
|
229820
230157
|
async function logStep2(message, data) {
|
|
229821
|
-
|
|
230158
|
+
logger25.info(data, message);
|
|
229822
230159
|
}
|
|
229823
230160
|
__name(logStep2, "logStep");
|
|
229824
230161
|
async function _runDatasetItemWorkflow(payload) {
|
|
@@ -230464,7 +230801,7 @@ __name(linkToCurrentContext, "linkToCurrentContext");
|
|
|
230464
230801
|
// ../node_modules/.pnpm/@workflow+core@4.0.1-beta.28_@aws-sdk+client-sts@3.970.0_@opentelemetry+api@1.9.0/node_modules/@workflow/core/dist/logger.js
|
|
230465
230802
|
function createLogger(namespace) {
|
|
230466
230803
|
const baseDebug = (0, import_debug2.default)(`workflow:${namespace}`);
|
|
230467
|
-
const
|
|
230804
|
+
const logger26 = /* @__PURE__ */ __name((level) => {
|
|
230468
230805
|
const levelDebug = baseDebug.extend(level);
|
|
230469
230806
|
return (message, metadata2) => {
|
|
230470
230807
|
levelDebug(message, metadata2);
|
|
@@ -230480,10 +230817,10 @@ function createLogger(namespace) {
|
|
|
230480
230817
|
};
|
|
230481
230818
|
}, "logger");
|
|
230482
230819
|
return {
|
|
230483
|
-
debug:
|
|
230484
|
-
info:
|
|
230485
|
-
warn:
|
|
230486
|
-
error:
|
|
230820
|
+
debug: logger26("debug"),
|
|
230821
|
+
info: logger26("info"),
|
|
230822
|
+
warn: logger26("warn"),
|
|
230823
|
+
error: logger26("error")
|
|
230487
230824
|
};
|
|
230488
230825
|
}
|
|
230489
230826
|
__name(createLogger, "createLogger");
|