@inkeep/agents-api 0.0.0-dev-20260211191741 → 0.0.0-dev-20260211213109
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/flow.cjs +44 -44
- package/dist/.well-known/workflow/v1/flow.cjs.debug.json +2 -2
- package/dist/.well-known/workflow/v1/manifest.debug.json +5 -5
- package/dist/.well-known/workflow/v1/step.cjs +536 -338
- package/dist/.well-known/workflow/v1/step.cjs.debug.json +2 -2
- package/dist/createApp.d.ts +2 -2
- package/dist/createApp.js +12 -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/invitations.d.ts +2 -2
- package/dist/domains/manage/routes/mcp.d.ts +2 -2
- package/dist/domains/manage/routes/passwordResetLinks.d.ts +2 -2
- package/dist/domains/manage/routes/signoz.d.ts +2 -2
- package/dist/domains/manage/routes/users.d.ts +2 -2
- package/dist/domains/mcp/routes/mcp.d.ts +2 -2
- package/dist/domains/run/agents/relationTools.d.ts +2 -2
- package/dist/domains/run/utils/token-estimator.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/env.d.ts +2 -2
- package/dist/factory.d.ts +21 -21
- package/dist/index.d.ts +20 -20
- 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 +3 -2
- package/dist/middleware/index.js +3 -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 +71 -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/middleware/workAppsAuth.d.ts +7 -0
- package/dist/middleware/workAppsAuth.js +30 -0
- package/dist/openapi.d.ts +5 -0
- package/dist/openapi.js +6 -1
- package/package.json +5 -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");
|
|
@@ -39660,8 +39660,8 @@ var require_logging = __commonJS({
|
|
|
39660
39660
|
return _logger;
|
|
39661
39661
|
}, "getLogger");
|
|
39662
39662
|
exports2.getLogger = getLogger2;
|
|
39663
|
-
var setLogger = /* @__PURE__ */ __name((
|
|
39664
|
-
_logger =
|
|
39663
|
+
var setLogger = /* @__PURE__ */ __name((logger26) => {
|
|
39664
|
+
_logger = logger26;
|
|
39665
39665
|
}, "setLogger");
|
|
39666
39666
|
exports2.setLogger = setLogger;
|
|
39667
39667
|
var setLoggerVerbosity = /* @__PURE__ */ __name((verbosity) => {
|
|
@@ -64242,8 +64242,8 @@ var require_src3 = __commonJS({
|
|
|
64242
64242
|
throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead");
|
|
64243
64243
|
}, "load");
|
|
64244
64244
|
exports2.load = load;
|
|
64245
|
-
var setLogger = /* @__PURE__ */ __name((
|
|
64246
|
-
logging.setLogger(
|
|
64245
|
+
var setLogger = /* @__PURE__ */ __name((logger26) => {
|
|
64246
|
+
logging.setLogger(logger26);
|
|
64247
64247
|
}, "setLogger");
|
|
64248
64248
|
exports2.setLogger = setLogger;
|
|
64249
64249
|
var setLogVerbosity = /* @__PURE__ */ __name((verbosity) => {
|
|
@@ -94104,12 +94104,12 @@ var require_ComponentLogger = __commonJS({
|
|
|
94104
94104
|
};
|
|
94105
94105
|
exports2.DiagComponentLogger = DiagComponentLogger;
|
|
94106
94106
|
function logProxy(funcName, namespace, args2) {
|
|
94107
|
-
const
|
|
94108
|
-
if (!
|
|
94107
|
+
const logger26 = (0, global_utils_1.getGlobal)("diag");
|
|
94108
|
+
if (!logger26) {
|
|
94109
94109
|
return;
|
|
94110
94110
|
}
|
|
94111
94111
|
args2.unshift(namespace);
|
|
94112
|
-
return
|
|
94112
|
+
return logger26[funcName](...args2);
|
|
94113
94113
|
}
|
|
94114
94114
|
__name(logProxy, "logProxy");
|
|
94115
94115
|
}
|
|
@@ -94145,17 +94145,17 @@ var require_logLevelLogger = __commonJS({
|
|
|
94145
94145
|
});
|
|
94146
94146
|
exports2.createLogLevelDiagLogger = void 0;
|
|
94147
94147
|
var types_1 = require_types3();
|
|
94148
|
-
function createLogLevelDiagLogger(maxLevel,
|
|
94148
|
+
function createLogLevelDiagLogger(maxLevel, logger26) {
|
|
94149
94149
|
if (maxLevel < types_1.DiagLogLevel.NONE) {
|
|
94150
94150
|
maxLevel = types_1.DiagLogLevel.NONE;
|
|
94151
94151
|
} else if (maxLevel > types_1.DiagLogLevel.ALL) {
|
|
94152
94152
|
maxLevel = types_1.DiagLogLevel.ALL;
|
|
94153
94153
|
}
|
|
94154
|
-
|
|
94154
|
+
logger26 = logger26 || {};
|
|
94155
94155
|
function _filterFunc(funcName, theLevel) {
|
|
94156
|
-
const theFunc =
|
|
94156
|
+
const theFunc = logger26[funcName];
|
|
94157
94157
|
if (typeof theFunc === "function" && maxLevel >= theLevel) {
|
|
94158
|
-
return theFunc.bind(
|
|
94158
|
+
return theFunc.bind(logger26);
|
|
94159
94159
|
}
|
|
94160
94160
|
return function() {
|
|
94161
94161
|
};
|
|
@@ -94198,18 +94198,18 @@ var require_diag = __commonJS({
|
|
|
94198
94198
|
constructor() {
|
|
94199
94199
|
function _logProxy(funcName) {
|
|
94200
94200
|
return function(...args2) {
|
|
94201
|
-
const
|
|
94202
|
-
if (!
|
|
94203
|
-
return
|
|
94201
|
+
const logger26 = (0, global_utils_1.getGlobal)("diag");
|
|
94202
|
+
if (!logger26) return;
|
|
94203
|
+
return logger26[funcName](...args2);
|
|
94204
94204
|
};
|
|
94205
94205
|
}
|
|
94206
94206
|
__name(_logProxy, "_logProxy");
|
|
94207
94207
|
const self2 = this;
|
|
94208
|
-
const setLogger = /* @__PURE__ */ __name((
|
|
94208
|
+
const setLogger = /* @__PURE__ */ __name((logger26, optionsOrLogLevel = {
|
|
94209
94209
|
logLevel: types_1.DiagLogLevel.INFO
|
|
94210
94210
|
}) => {
|
|
94211
94211
|
var _a19, _b17, _c;
|
|
94212
|
-
if (
|
|
94212
|
+
if (logger26 === self2) {
|
|
94213
94213
|
const err2 = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
|
|
94214
94214
|
self2.error((_a19 = err2.stack) !== null && _a19 !== void 0 ? _a19 : err2.message);
|
|
94215
94215
|
return false;
|
|
@@ -94220,7 +94220,7 @@ var require_diag = __commonJS({
|
|
|
94220
94220
|
};
|
|
94221
94221
|
}
|
|
94222
94222
|
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,
|
|
94223
|
+
const newLogger = (0, logLevelLogger_1.createLogLevelDiagLogger)((_b17 = optionsOrLogLevel.logLevel) !== null && _b17 !== void 0 ? _b17 : types_1.DiagLogLevel.INFO, logger26);
|
|
94224
94224
|
if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
|
|
94225
94225
|
const stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
|
|
94226
94226
|
oldLogger.warn(`Current logger will be overwritten from ${stack}`);
|
|
@@ -126363,7 +126363,10 @@ var runtime_schema_exports = /* @__PURE__ */ __exportAll({
|
|
|
126363
126363
|
workAppGitHubProjectRepositoryAccess: /* @__PURE__ */ __name(() => workAppGitHubProjectRepositoryAccess, "workAppGitHubProjectRepositoryAccess"),
|
|
126364
126364
|
workAppGitHubProjectRepositoryAccessRelations: /* @__PURE__ */ __name(() => workAppGitHubProjectRepositoryAccessRelations, "workAppGitHubProjectRepositoryAccessRelations"),
|
|
126365
126365
|
workAppGitHubRepositories: /* @__PURE__ */ __name(() => workAppGitHubRepositories, "workAppGitHubRepositories"),
|
|
126366
|
-
workAppGitHubRepositoriesRelations: /* @__PURE__ */ __name(() => workAppGitHubRepositoriesRelations, "workAppGitHubRepositoriesRelations")
|
|
126366
|
+
workAppGitHubRepositoriesRelations: /* @__PURE__ */ __name(() => workAppGitHubRepositoriesRelations, "workAppGitHubRepositoriesRelations"),
|
|
126367
|
+
workAppSlackChannelAgentConfigs: /* @__PURE__ */ __name(() => workAppSlackChannelAgentConfigs, "workAppSlackChannelAgentConfigs"),
|
|
126368
|
+
workAppSlackUserMappings: /* @__PURE__ */ __name(() => workAppSlackUserMappings, "workAppSlackUserMappings"),
|
|
126369
|
+
workAppSlackWorkspaces: /* @__PURE__ */ __name(() => workAppSlackWorkspaces, "workAppSlackWorkspaces")
|
|
126367
126370
|
});
|
|
126368
126371
|
var tenantScoped2 = {
|
|
126369
126372
|
tenantId: varchar("tenant_id", {
|
|
@@ -126548,6 +126551,131 @@ var triggerInvocations = pgTable("trigger_invocations", {
|
|
|
126548
126551
|
index("trigger_invocations_trigger_idx").on(table.triggerId, table.createdAt),
|
|
126549
126552
|
index("trigger_invocations_status_idx").on(table.triggerId, table.status)
|
|
126550
126553
|
]);
|
|
126554
|
+
var workAppSlackWorkspaces = pgTable("work_app_slack_workspaces", {
|
|
126555
|
+
id: varchar("id", {
|
|
126556
|
+
length: 256
|
|
126557
|
+
}).primaryKey(),
|
|
126558
|
+
tenantId: varchar("tenant_id", {
|
|
126559
|
+
length: 256
|
|
126560
|
+
}).notNull().references(() => organization.id, {
|
|
126561
|
+
onDelete: "cascade"
|
|
126562
|
+
}),
|
|
126563
|
+
slackTeamId: varchar("slack_team_id", {
|
|
126564
|
+
length: 256
|
|
126565
|
+
}).notNull(),
|
|
126566
|
+
slackEnterpriseId: varchar("slack_enterprise_id", {
|
|
126567
|
+
length: 256
|
|
126568
|
+
}),
|
|
126569
|
+
slackAppId: varchar("slack_app_id", {
|
|
126570
|
+
length: 256
|
|
126571
|
+
}),
|
|
126572
|
+
slackTeamName: varchar("slack_team_name", {
|
|
126573
|
+
length: 512
|
|
126574
|
+
}),
|
|
126575
|
+
nangoProviderConfigKey: varchar("nango_provider_config_key", {
|
|
126576
|
+
length: 256
|
|
126577
|
+
}).notNull().default("work-apps-slack"),
|
|
126578
|
+
nangoConnectionId: varchar("nango_connection_id", {
|
|
126579
|
+
length: 256
|
|
126580
|
+
}).notNull(),
|
|
126581
|
+
status: varchar("status", {
|
|
126582
|
+
length: 20
|
|
126583
|
+
}).notNull().default("active"),
|
|
126584
|
+
installedByUserId: text("installed_by_user_id").references(() => user.id, {
|
|
126585
|
+
onDelete: "set null"
|
|
126586
|
+
}),
|
|
126587
|
+
...timestamps2
|
|
126588
|
+
}, (table) => [
|
|
126589
|
+
unique("work_app_slack_workspaces_tenant_team_unique").on(table.tenantId, table.slackTeamId),
|
|
126590
|
+
unique("work_app_slack_workspaces_nango_connection_unique").on(table.nangoConnectionId),
|
|
126591
|
+
index("work_app_slack_workspaces_tenant_idx").on(table.tenantId),
|
|
126592
|
+
index("work_app_slack_workspaces_team_idx").on(table.slackTeamId)
|
|
126593
|
+
]);
|
|
126594
|
+
var workAppSlackUserMappings = pgTable("work_app_slack_user_mappings", {
|
|
126595
|
+
id: varchar("id", {
|
|
126596
|
+
length: 256
|
|
126597
|
+
}).primaryKey(),
|
|
126598
|
+
tenantId: varchar("tenant_id", {
|
|
126599
|
+
length: 256
|
|
126600
|
+
}).notNull().references(() => organization.id, {
|
|
126601
|
+
onDelete: "cascade"
|
|
126602
|
+
}),
|
|
126603
|
+
clientId: varchar("client_id", {
|
|
126604
|
+
length: 256
|
|
126605
|
+
}).notNull().default("work-apps-slack"),
|
|
126606
|
+
slackUserId: varchar("slack_user_id", {
|
|
126607
|
+
length: 256
|
|
126608
|
+
}).notNull(),
|
|
126609
|
+
slackTeamId: varchar("slack_team_id", {
|
|
126610
|
+
length: 256
|
|
126611
|
+
}).notNull(),
|
|
126612
|
+
slackEnterpriseId: varchar("slack_enterprise_id", {
|
|
126613
|
+
length: 256
|
|
126614
|
+
}),
|
|
126615
|
+
inkeepUserId: text("inkeep_user_id").notNull().references(() => user.id, {
|
|
126616
|
+
onDelete: "cascade"
|
|
126617
|
+
}),
|
|
126618
|
+
slackUsername: varchar("slack_username", {
|
|
126619
|
+
length: 256
|
|
126620
|
+
}),
|
|
126621
|
+
slackEmail: varchar("slack_email", {
|
|
126622
|
+
length: 256
|
|
126623
|
+
}),
|
|
126624
|
+
linkedAt: timestamp("linked_at", {
|
|
126625
|
+
mode: "string"
|
|
126626
|
+
}).notNull().defaultNow(),
|
|
126627
|
+
lastUsedAt: timestamp("last_used_at", {
|
|
126628
|
+
mode: "string"
|
|
126629
|
+
}),
|
|
126630
|
+
...timestamps2
|
|
126631
|
+
}, (table) => [
|
|
126632
|
+
unique("work_app_slack_user_mappings_unique").on(table.tenantId, table.clientId, table.slackTeamId, table.slackUserId),
|
|
126633
|
+
index("work_app_slack_user_mappings_tenant_idx").on(table.tenantId),
|
|
126634
|
+
index("work_app_slack_user_mappings_user_idx").on(table.inkeepUserId),
|
|
126635
|
+
index("work_app_slack_user_mappings_team_idx").on(table.slackTeamId),
|
|
126636
|
+
index("work_app_slack_user_mappings_slack_user_idx").on(table.slackUserId)
|
|
126637
|
+
]);
|
|
126638
|
+
var workAppSlackChannelAgentConfigs = pgTable("work_app_slack_channel_agent_configs", {
|
|
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
|
+
slackChannelId: varchar("slack_channel_id", {
|
|
126651
|
+
length: 256
|
|
126652
|
+
}).notNull(),
|
|
126653
|
+
slackChannelName: varchar("slack_channel_name", {
|
|
126654
|
+
length: 256
|
|
126655
|
+
}),
|
|
126656
|
+
slackChannelType: varchar("slack_channel_type", {
|
|
126657
|
+
length: 50
|
|
126658
|
+
}),
|
|
126659
|
+
projectId: varchar("project_id", {
|
|
126660
|
+
length: 256
|
|
126661
|
+
}).notNull(),
|
|
126662
|
+
agentId: varchar("agent_id", {
|
|
126663
|
+
length: 256
|
|
126664
|
+
}).notNull(),
|
|
126665
|
+
agentName: varchar("agent_name", {
|
|
126666
|
+
length: 256
|
|
126667
|
+
}),
|
|
126668
|
+
configuredByUserId: text("configured_by_user_id").references(() => user.id, {
|
|
126669
|
+
onDelete: "set null"
|
|
126670
|
+
}),
|
|
126671
|
+
enabled: boolean("enabled").notNull().default(true),
|
|
126672
|
+
...timestamps2
|
|
126673
|
+
}, (table) => [
|
|
126674
|
+
unique("work_app_slack_channel_agent_configs_unique").on(table.tenantId, table.slackTeamId, table.slackChannelId),
|
|
126675
|
+
index("work_app_slack_channel_agent_configs_tenant_idx").on(table.tenantId),
|
|
126676
|
+
index("work_app_slack_channel_agent_configs_team_idx").on(table.slackTeamId),
|
|
126677
|
+
index("work_app_slack_channel_agent_configs_channel_idx").on(table.slackChannelId)
|
|
126678
|
+
]);
|
|
126551
126679
|
var messages = pgTable("messages", {
|
|
126552
126680
|
...projectScoped2,
|
|
126553
126681
|
conversationId: varchar("conversation_id", {
|
|
@@ -144968,6 +145096,34 @@ var WorkAppGitHubAccessGetResponseSchema = external_exports.object({
|
|
|
144968
145096
|
mode: WorkAppGitHubAccessModeSchema,
|
|
144969
145097
|
repositories: external_exports.array(WorkAppGitHubRepositorySelectSchema)
|
|
144970
145098
|
});
|
|
145099
|
+
var WorkAppSlackWorkspaceStatusSchema = external_exports.enum([
|
|
145100
|
+
"active",
|
|
145101
|
+
"suspended",
|
|
145102
|
+
"disconnected"
|
|
145103
|
+
]);
|
|
145104
|
+
var WorkAppSlackWorkspaceSelectSchema = createSelectSchema2(workAppSlackWorkspaces);
|
|
145105
|
+
var WorkAppSlackWorkspaceInsertSchema = createInsertSchema2(workAppSlackWorkspaces).omit({
|
|
145106
|
+
createdAt: true,
|
|
145107
|
+
updatedAt: true
|
|
145108
|
+
}).extend({
|
|
145109
|
+
status: WorkAppSlackWorkspaceStatusSchema.optional().default("active")
|
|
145110
|
+
});
|
|
145111
|
+
var WorkAppSlackWorkspaceUpdateSchema = WorkAppSlackWorkspaceInsertSchema.partial();
|
|
145112
|
+
var WorkAppSlackUserMappingSelectSchema = createSelectSchema2(workAppSlackUserMappings);
|
|
145113
|
+
var WorkAppSlackUserMappingInsertSchema = createInsertSchema2(workAppSlackUserMappings).omit({
|
|
145114
|
+
createdAt: true,
|
|
145115
|
+
updatedAt: true,
|
|
145116
|
+
linkedAt: true
|
|
145117
|
+
}).extend({
|
|
145118
|
+
clientId: external_exports.string().optional().default("work-apps-slack")
|
|
145119
|
+
});
|
|
145120
|
+
var WorkAppSlackUserMappingUpdateSchema = WorkAppSlackUserMappingInsertSchema.partial();
|
|
145121
|
+
var WorkAppSlackChannelAgentConfigSelectSchema = createSelectSchema2(workAppSlackChannelAgentConfigs);
|
|
145122
|
+
var WorkAppSlackChannelAgentConfigInsertSchema = createInsertSchema2(workAppSlackChannelAgentConfigs).omit({
|
|
145123
|
+
createdAt: true,
|
|
145124
|
+
updatedAt: true
|
|
145125
|
+
});
|
|
145126
|
+
var WorkAppSlackChannelAgentConfigUpdateSchema = WorkAppSlackChannelAgentConfigInsertSchema.partial();
|
|
144971
145127
|
|
|
144972
145128
|
// ../packages/agents-core/dist/utils/colors.js
|
|
144973
145129
|
var import_iwanthue = __toESM(require_iwanthue(), 1);
|
|
@@ -147311,12 +147467,12 @@ var LoggerFactory = class {
|
|
|
147311
147467
|
if (!logger$12) throw new Error(`Logger '${name18}' not found in cache`);
|
|
147312
147468
|
return logger$12;
|
|
147313
147469
|
}
|
|
147314
|
-
let
|
|
147315
|
-
if (this.config.loggerFactory)
|
|
147316
|
-
else if (this.config.defaultLogger)
|
|
147317
|
-
else
|
|
147318
|
-
this.loggers.set(name18,
|
|
147319
|
-
return
|
|
147470
|
+
let logger26;
|
|
147471
|
+
if (this.config.loggerFactory) logger26 = this.config.loggerFactory(name18);
|
|
147472
|
+
else if (this.config.defaultLogger) logger26 = this.config.defaultLogger;
|
|
147473
|
+
else logger26 = new PinoLogger(name18, this.config.pinoConfig);
|
|
147474
|
+
this.loggers.set(name18, logger26);
|
|
147475
|
+
return logger26;
|
|
147320
147476
|
}
|
|
147321
147477
|
/**
|
|
147322
147478
|
* Reset factory to default state
|
|
@@ -179582,7 +179738,7 @@ var PglitePreparedQuery = class extends PgPreparedQuery {
|
|
|
179582
179738
|
static {
|
|
179583
179739
|
__name(this, "PglitePreparedQuery");
|
|
179584
179740
|
}
|
|
179585
|
-
constructor(client, queryString, params,
|
|
179741
|
+
constructor(client, queryString, params, logger26, cache, queryMetadata, cacheConfig, fields, name18, _isResponseInArrayMode, customResultMapper) {
|
|
179586
179742
|
super({
|
|
179587
179743
|
sql: queryString,
|
|
179588
179744
|
params
|
|
@@ -179590,7 +179746,7 @@ var PglitePreparedQuery = class extends PgPreparedQuery {
|
|
|
179590
179746
|
this.client = client;
|
|
179591
179747
|
this.queryString = queryString;
|
|
179592
179748
|
this.params = params;
|
|
179593
|
-
this.logger =
|
|
179749
|
+
this.logger = logger26;
|
|
179594
179750
|
this.fields = fields;
|
|
179595
179751
|
this._isResponseInArrayMode = _isResponseInArrayMode;
|
|
179596
179752
|
this.customResultMapper = customResultMapper;
|
|
@@ -179743,11 +179899,11 @@ function construct(client, config4 = {}) {
|
|
|
179743
179899
|
const dialect = new PgDialect({
|
|
179744
179900
|
casing: config4.casing
|
|
179745
179901
|
});
|
|
179746
|
-
let
|
|
179902
|
+
let logger26;
|
|
179747
179903
|
if (config4.logger === true) {
|
|
179748
|
-
|
|
179904
|
+
logger26 = new DefaultLogger();
|
|
179749
179905
|
} else if (config4.logger !== false) {
|
|
179750
|
-
|
|
179906
|
+
logger26 = config4.logger;
|
|
179751
179907
|
}
|
|
179752
179908
|
let schema;
|
|
179753
179909
|
if (config4.schema) {
|
|
@@ -179759,7 +179915,7 @@ function construct(client, config4 = {}) {
|
|
|
179759
179915
|
};
|
|
179760
179916
|
}
|
|
179761
179917
|
const driver = new PgliteDriver(client, dialect, {
|
|
179762
|
-
logger:
|
|
179918
|
+
logger: logger26,
|
|
179763
179919
|
cache: config4.cache
|
|
179764
179920
|
});
|
|
179765
179921
|
const session2 = driver.createSession(schema);
|
|
@@ -179828,7 +179984,7 @@ var NodePgPreparedQuery = class extends PgPreparedQuery {
|
|
|
179828
179984
|
static {
|
|
179829
179985
|
__name(this, "NodePgPreparedQuery");
|
|
179830
179986
|
}
|
|
179831
|
-
constructor(client, queryString, params,
|
|
179987
|
+
constructor(client, queryString, params, logger26, cache, queryMetadata, cacheConfig, fields, name18, _isResponseInArrayMode, customResultMapper) {
|
|
179832
179988
|
super({
|
|
179833
179989
|
sql: queryString,
|
|
179834
179990
|
params
|
|
@@ -179836,7 +179992,7 @@ var NodePgPreparedQuery = class extends PgPreparedQuery {
|
|
|
179836
179992
|
this.client = client;
|
|
179837
179993
|
this.queryString = queryString;
|
|
179838
179994
|
this.params = params;
|
|
179839
|
-
this.logger =
|
|
179995
|
+
this.logger = logger26;
|
|
179840
179996
|
this.fields = fields;
|
|
179841
179997
|
this._isResponseInArrayMode = _isResponseInArrayMode;
|
|
179842
179998
|
this.customResultMapper = customResultMapper;
|
|
@@ -180060,11 +180216,11 @@ function construct2(client, config4 = {}) {
|
|
|
180060
180216
|
const dialect = new PgDialect({
|
|
180061
180217
|
casing: config4.casing
|
|
180062
180218
|
});
|
|
180063
|
-
let
|
|
180219
|
+
let logger26;
|
|
180064
180220
|
if (config4.logger === true) {
|
|
180065
|
-
|
|
180221
|
+
logger26 = new DefaultLogger();
|
|
180066
180222
|
} else if (config4.logger !== false) {
|
|
180067
|
-
|
|
180223
|
+
logger26 = config4.logger;
|
|
180068
180224
|
}
|
|
180069
180225
|
let schema;
|
|
180070
180226
|
if (config4.schema) {
|
|
@@ -180076,7 +180232,7 @@ function construct2(client, config4 = {}) {
|
|
|
180076
180232
|
};
|
|
180077
180233
|
}
|
|
180078
180234
|
const driver = new NodePgDriver(client, dialect, {
|
|
180079
|
-
logger:
|
|
180235
|
+
logger: logger26,
|
|
180080
180236
|
cache: config4.cache
|
|
180081
180237
|
});
|
|
180082
180238
|
const session2 = driver.createSession(schema);
|
|
@@ -182221,11 +182377,11 @@ var parseLogLevel = /* @__PURE__ */ __name((maybeLevel, sourceName, client) => {
|
|
|
182221
182377
|
function noop2() {
|
|
182222
182378
|
}
|
|
182223
182379
|
__name(noop2, "noop");
|
|
182224
|
-
function makeLogFn(fnLevel,
|
|
182225
|
-
if (!
|
|
182380
|
+
function makeLogFn(fnLevel, logger26, logLevel) {
|
|
182381
|
+
if (!logger26 || levelNumbers[fnLevel] > levelNumbers[logLevel]) {
|
|
182226
182382
|
return noop2;
|
|
182227
182383
|
} else {
|
|
182228
|
-
return
|
|
182384
|
+
return logger26[fnLevel].bind(logger26);
|
|
182229
182385
|
}
|
|
182230
182386
|
}
|
|
182231
182387
|
__name(makeLogFn, "makeLogFn");
|
|
@@ -182237,22 +182393,22 @@ var noopLogger = {
|
|
|
182237
182393
|
};
|
|
182238
182394
|
var cachedLoggers = /* @__PURE__ */ new WeakMap();
|
|
182239
182395
|
function loggerFor(client) {
|
|
182240
|
-
const
|
|
182396
|
+
const logger26 = client.logger;
|
|
182241
182397
|
const logLevel = client.logLevel ?? "off";
|
|
182242
|
-
if (!
|
|
182398
|
+
if (!logger26) {
|
|
182243
182399
|
return noopLogger;
|
|
182244
182400
|
}
|
|
182245
|
-
const cachedLogger = cachedLoggers.get(
|
|
182401
|
+
const cachedLogger = cachedLoggers.get(logger26);
|
|
182246
182402
|
if (cachedLogger && cachedLogger[0] === logLevel) {
|
|
182247
182403
|
return cachedLogger[1];
|
|
182248
182404
|
}
|
|
182249
182405
|
const levelLogger = {
|
|
182250
|
-
error: makeLogFn("error",
|
|
182251
|
-
warn: makeLogFn("warn",
|
|
182252
|
-
info: makeLogFn("info",
|
|
182253
|
-
debug: makeLogFn("debug",
|
|
182406
|
+
error: makeLogFn("error", logger26, logLevel),
|
|
182407
|
+
warn: makeLogFn("warn", logger26, logLevel),
|
|
182408
|
+
info: makeLogFn("info", logger26, logLevel),
|
|
182409
|
+
debug: makeLogFn("debug", logger26, logLevel)
|
|
182254
182410
|
};
|
|
182255
|
-
cachedLoggers.set(
|
|
182411
|
+
cachedLoggers.set(logger26, [
|
|
182256
182412
|
logLevel,
|
|
182257
182413
|
levelLogger
|
|
182258
182414
|
]);
|
|
@@ -188491,11 +188647,11 @@ var parseLogLevel2 = /* @__PURE__ */ __name((maybeLevel, sourceName, client) =>
|
|
|
188491
188647
|
function noop3() {
|
|
188492
188648
|
}
|
|
188493
188649
|
__name(noop3, "noop");
|
|
188494
|
-
function makeLogFn2(fnLevel,
|
|
188495
|
-
if (!
|
|
188650
|
+
function makeLogFn2(fnLevel, logger26, logLevel) {
|
|
188651
|
+
if (!logger26 || levelNumbers2[fnLevel] > levelNumbers2[logLevel]) {
|
|
188496
188652
|
return noop3;
|
|
188497
188653
|
} else {
|
|
188498
|
-
return
|
|
188654
|
+
return logger26[fnLevel].bind(logger26);
|
|
188499
188655
|
}
|
|
188500
188656
|
}
|
|
188501
188657
|
__name(makeLogFn2, "makeLogFn");
|
|
@@ -188507,22 +188663,22 @@ var noopLogger2 = {
|
|
|
188507
188663
|
};
|
|
188508
188664
|
var cachedLoggers2 = /* @__PURE__ */ new WeakMap();
|
|
188509
188665
|
function loggerFor2(client) {
|
|
188510
|
-
const
|
|
188666
|
+
const logger26 = client.logger;
|
|
188511
188667
|
const logLevel = client.logLevel ?? "off";
|
|
188512
|
-
if (!
|
|
188668
|
+
if (!logger26) {
|
|
188513
188669
|
return noopLogger2;
|
|
188514
188670
|
}
|
|
188515
|
-
const cachedLogger = cachedLoggers2.get(
|
|
188671
|
+
const cachedLogger = cachedLoggers2.get(logger26);
|
|
188516
188672
|
if (cachedLogger && cachedLogger[0] === logLevel) {
|
|
188517
188673
|
return cachedLogger[1];
|
|
188518
188674
|
}
|
|
188519
188675
|
const levelLogger = {
|
|
188520
|
-
error: makeLogFn2("error",
|
|
188521
|
-
warn: makeLogFn2("warn",
|
|
188522
|
-
info: makeLogFn2("info",
|
|
188523
|
-
debug: makeLogFn2("debug",
|
|
188676
|
+
error: makeLogFn2("error", logger26, logLevel),
|
|
188677
|
+
warn: makeLogFn2("warn", logger26, logLevel),
|
|
188678
|
+
info: makeLogFn2("info", logger26, logLevel),
|
|
188679
|
+
debug: makeLogFn2("debug", logger26, logLevel)
|
|
188524
188680
|
};
|
|
188525
|
-
cachedLoggers2.set(
|
|
188681
|
+
cachedLoggers2.set(logger26, [
|
|
188526
188682
|
logLevel,
|
|
188527
188683
|
levelLogger
|
|
188528
188684
|
]);
|
|
@@ -188567,7 +188723,7 @@ var Stream = class _Stream {
|
|
|
188567
188723
|
}
|
|
188568
188724
|
static fromSSEResponse(response, controller, client) {
|
|
188569
188725
|
let consumed = false;
|
|
188570
|
-
const
|
|
188726
|
+
const logger26 = client ? loggerFor2(client) : console;
|
|
188571
188727
|
async function* iterator2() {
|
|
188572
188728
|
if (consumed) {
|
|
188573
188729
|
throw new OpenAIError("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");
|
|
@@ -188586,8 +188742,8 @@ var Stream = class _Stream {
|
|
|
188586
188742
|
try {
|
|
188587
188743
|
data = JSON.parse(sse.data);
|
|
188588
188744
|
} catch (e) {
|
|
188589
|
-
|
|
188590
|
-
|
|
188745
|
+
logger26.error(`Could not parse message into JSON:`, sse.data);
|
|
188746
|
+
logger26.error(`From chunk:`, sse.raw);
|
|
188591
188747
|
throw e;
|
|
188592
188748
|
}
|
|
188593
188749
|
if (data && data.error) {
|
|
@@ -201303,12 +201459,12 @@ var logWarnings = /* @__PURE__ */ __name((options) => {
|
|
|
201303
201459
|
if (options.warnings.length === 0) {
|
|
201304
201460
|
return;
|
|
201305
201461
|
}
|
|
201306
|
-
const
|
|
201307
|
-
if (
|
|
201462
|
+
const logger26 = globalThis.AI_SDK_LOG_WARNINGS;
|
|
201463
|
+
if (logger26 === false) {
|
|
201308
201464
|
return;
|
|
201309
201465
|
}
|
|
201310
|
-
if (typeof
|
|
201311
|
-
|
|
201466
|
+
if (typeof logger26 === "function") {
|
|
201467
|
+
logger26(options);
|
|
201312
201468
|
return;
|
|
201313
201469
|
}
|
|
201314
201470
|
if (!hasLoggedBefore) {
|
|
@@ -227973,11 +228129,116 @@ var ModelFactory = class ModelFactory2 {
|
|
|
227973
228129
|
// ../packages/agents-core/dist/utils/service-token-auth.js
|
|
227974
228130
|
var logger15 = getLogger("service-token-auth");
|
|
227975
228131
|
|
|
228132
|
+
// ../packages/agents-core/dist/utils/slack-link-token.js
|
|
228133
|
+
var logger16 = getLogger("slack-link-token");
|
|
228134
|
+
var ISSUER = "inkeep-auth";
|
|
228135
|
+
var AUDIENCE = "slack-link";
|
|
228136
|
+
var TOKEN_USE = "slackLinkCode";
|
|
228137
|
+
var SlackLinkTokenPayloadSchema = external_exports.object({
|
|
228138
|
+
iss: external_exports.literal(ISSUER),
|
|
228139
|
+
aud: external_exports.literal(AUDIENCE),
|
|
228140
|
+
sub: external_exports.string().min(1),
|
|
228141
|
+
iat: external_exports.number(),
|
|
228142
|
+
exp: external_exports.number(),
|
|
228143
|
+
jti: external_exports.string().optional(),
|
|
228144
|
+
tokenUse: external_exports.literal(TOKEN_USE),
|
|
228145
|
+
tenantId: external_exports.string().min(1),
|
|
228146
|
+
slack: external_exports.object({
|
|
228147
|
+
teamId: external_exports.string().min(1),
|
|
228148
|
+
userId: external_exports.string().min(1),
|
|
228149
|
+
enterpriseId: external_exports.string().min(1).optional(),
|
|
228150
|
+
username: external_exports.string().optional()
|
|
228151
|
+
})
|
|
228152
|
+
});
|
|
228153
|
+
|
|
228154
|
+
// ../packages/agents-core/dist/utils/slack-user-token.js
|
|
228155
|
+
var logger17 = getLogger("slack-user-token");
|
|
228156
|
+
var ISSUER2 = "inkeep-auth";
|
|
228157
|
+
var AUDIENCE2 = "inkeep-api";
|
|
228158
|
+
var TOKEN_USE2 = "slackUser";
|
|
228159
|
+
var ACTOR_SUB = "inkeep-work-app-slack";
|
|
228160
|
+
var SlackAccessTokenPayloadSchema = external_exports.object({
|
|
228161
|
+
iss: external_exports.literal(ISSUER2),
|
|
228162
|
+
aud: external_exports.literal(AUDIENCE2),
|
|
228163
|
+
sub: external_exports.string().min(1),
|
|
228164
|
+
iat: external_exports.number(),
|
|
228165
|
+
exp: external_exports.number(),
|
|
228166
|
+
jti: external_exports.string().optional(),
|
|
228167
|
+
tokenUse: external_exports.literal(TOKEN_USE2),
|
|
228168
|
+
act: external_exports.object({
|
|
228169
|
+
sub: external_exports.literal(ACTOR_SUB)
|
|
228170
|
+
}),
|
|
228171
|
+
tenantId: external_exports.string().min(1),
|
|
228172
|
+
slack: external_exports.object({
|
|
228173
|
+
teamId: external_exports.string().min(1),
|
|
228174
|
+
userId: external_exports.string().min(1),
|
|
228175
|
+
enterpriseId: external_exports.string().min(1).optional(),
|
|
228176
|
+
email: external_exports.string().email().optional()
|
|
228177
|
+
})
|
|
228178
|
+
});
|
|
228179
|
+
|
|
228180
|
+
// ../packages/agents-core/dist/utils/sse-parser.js
|
|
228181
|
+
function parseSSEResponse(sseText) {
|
|
228182
|
+
let textContent = "";
|
|
228183
|
+
let hasError = false;
|
|
228184
|
+
let errorMessage = "";
|
|
228185
|
+
const lines = sseText.split("\n").filter((line2) => line2.startsWith("data: "));
|
|
228186
|
+
for (const line2 of lines) {
|
|
228187
|
+
const jsonStr = line2.slice(6).trim();
|
|
228188
|
+
if (!jsonStr || jsonStr === "[DONE]") continue;
|
|
228189
|
+
try {
|
|
228190
|
+
const data = JSON.parse(jsonStr);
|
|
228191
|
+
if (data.object === "chat.completion.chunk" && data.choices?.[0]?.delta) {
|
|
228192
|
+
const delta = data.choices[0].delta;
|
|
228193
|
+
if (delta.content && typeof delta.content === "string") try {
|
|
228194
|
+
const parsedContent = JSON.parse(delta.content);
|
|
228195
|
+
if (parsedContent.type === "data-operation") {
|
|
228196
|
+
if (parsedContent.data?.type === "error") {
|
|
228197
|
+
hasError = true;
|
|
228198
|
+
errorMessage = parsedContent.data.message || "Unknown error occurred";
|
|
228199
|
+
}
|
|
228200
|
+
continue;
|
|
228201
|
+
}
|
|
228202
|
+
textContent += delta.content;
|
|
228203
|
+
} catch {
|
|
228204
|
+
textContent += delta.content;
|
|
228205
|
+
}
|
|
228206
|
+
continue;
|
|
228207
|
+
}
|
|
228208
|
+
if (data.type === "text-delta" && data.delta) {
|
|
228209
|
+
textContent += data.delta;
|
|
228210
|
+
continue;
|
|
228211
|
+
}
|
|
228212
|
+
if (data.type === "text-start" || data.type === "text-end") continue;
|
|
228213
|
+
if (data.type === "data-operation") {
|
|
228214
|
+
if (data.data?.type === "error") {
|
|
228215
|
+
hasError = true;
|
|
228216
|
+
errorMessage = data.data.message || "Unknown error occurred";
|
|
228217
|
+
}
|
|
228218
|
+
continue;
|
|
228219
|
+
}
|
|
228220
|
+
if (data.type === "error") {
|
|
228221
|
+
hasError = true;
|
|
228222
|
+
errorMessage = data.message || "Unknown error occurred";
|
|
228223
|
+
}
|
|
228224
|
+
} catch {
|
|
228225
|
+
}
|
|
228226
|
+
}
|
|
228227
|
+
if (hasError) return {
|
|
228228
|
+
text: textContent.trim(),
|
|
228229
|
+
error: errorMessage
|
|
228230
|
+
};
|
|
228231
|
+
return {
|
|
228232
|
+
text: textContent.trim()
|
|
228233
|
+
};
|
|
228234
|
+
}
|
|
228235
|
+
__name(parseSSEResponse, "parseSSEResponse");
|
|
228236
|
+
|
|
227976
228237
|
// ../packages/agents-core/dist/utils/third-party-mcp-servers/composio-client.js
|
|
227977
228238
|
var logger$1 = getLogger("composio-client");
|
|
227978
228239
|
|
|
227979
228240
|
// ../packages/agents-core/dist/utils/third-party-mcp-servers/third-party-check.js
|
|
227980
|
-
var
|
|
228241
|
+
var logger18 = getLogger("third-party-check");
|
|
227981
228242
|
|
|
227982
228243
|
// ../packages/agents-core/dist/utils/trigger-auth.js
|
|
227983
228244
|
var import_node_crypto7 = require("node:crypto");
|
|
@@ -227985,10 +228246,10 @@ var import_node_util3 = require("node:util");
|
|
|
227985
228246
|
var scryptAsync2 = (0, import_node_util3.promisify)(import_node_crypto7.scrypt);
|
|
227986
228247
|
|
|
227987
228248
|
// ../packages/agents-core/dist/utils/tracer-factory.js
|
|
227988
|
-
var
|
|
228249
|
+
var logger19 = getLogger("tracer");
|
|
227989
228250
|
|
|
227990
228251
|
// ../packages/agents-core/dist/data-access/manage/tools.js
|
|
227991
|
-
var
|
|
228252
|
+
var logger20 = getLogger("tools");
|
|
227992
228253
|
var listTools = /* @__PURE__ */ __name((db) => async (params) => {
|
|
227993
228254
|
const page = params.pagination?.page || 1;
|
|
227994
228255
|
const limit3 = Math.min(params.pagination?.limit || 10, 100);
|
|
@@ -228443,10 +228704,10 @@ var defaultLogger = {
|
|
|
228443
228704
|
error: /* @__PURE__ */ __name(() => {
|
|
228444
228705
|
}, "error")
|
|
228445
228706
|
};
|
|
228446
|
-
var getFullAgent = /* @__PURE__ */ __name((db,
|
|
228707
|
+
var getFullAgent = /* @__PURE__ */ __name((db, logger26 = defaultLogger) => async (params) => {
|
|
228447
228708
|
const { scopes } = params;
|
|
228448
228709
|
const { tenantId, projectId } = scopes;
|
|
228449
|
-
|
|
228710
|
+
logger26.info({
|
|
228450
228711
|
tenantId,
|
|
228451
228712
|
agentId: scopes.agentId
|
|
228452
228713
|
}, "Retrieving full agent definition");
|
|
@@ -228459,20 +228720,20 @@ var getFullAgent = /* @__PURE__ */ __name((db, logger24 = defaultLogger) => asyn
|
|
|
228459
228720
|
}
|
|
228460
228721
|
});
|
|
228461
228722
|
if (!agent) {
|
|
228462
|
-
|
|
228723
|
+
logger26.info({
|
|
228463
228724
|
tenantId,
|
|
228464
228725
|
agentId: scopes.agentId
|
|
228465
228726
|
}, "Agent not found");
|
|
228466
228727
|
return null;
|
|
228467
228728
|
}
|
|
228468
|
-
|
|
228729
|
+
logger26.info({
|
|
228469
228730
|
tenantId,
|
|
228470
228731
|
agentId: scopes.agentId,
|
|
228471
228732
|
agentCount: Object.keys(agent.subAgents).length
|
|
228472
228733
|
}, "Full agent retrieved successfully");
|
|
228473
228734
|
return agent;
|
|
228474
228735
|
} catch (error92) {
|
|
228475
|
-
|
|
228736
|
+
logger26.error({
|
|
228476
228737
|
tenantId,
|
|
228477
228738
|
agentId: scopes.agentId,
|
|
228478
228739
|
error: error92 instanceof Error ? error92.message : "Unknown error"
|
|
@@ -228638,11 +228899,11 @@ var filterConversationsForJob = /* @__PURE__ */ __name((db) => async (params) =>
|
|
|
228638
228899
|
loadEnvironmentFiles();
|
|
228639
228900
|
|
|
228640
228901
|
// ../packages/agents-core/dist/dolt/ref-middleware.js
|
|
228641
|
-
var
|
|
228902
|
+
var logger21 = getLogger("ref-middleware");
|
|
228642
228903
|
|
|
228643
228904
|
// ../packages/agents-core/dist/dolt/ref-scope.js
|
|
228644
228905
|
var import_node_async_hooks2 = require("node:async_hooks");
|
|
228645
|
-
var
|
|
228906
|
+
var logger22 = getLogger("ref-scope");
|
|
228646
228907
|
var refScopeStorage = new import_node_async_hooks2.AsyncLocalStorage();
|
|
228647
228908
|
var NestedRefScopeError = class extends Error {
|
|
228648
228909
|
static {
|
|
@@ -228660,7 +228921,7 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228660
228921
|
const existingScope = refScopeStorage.getStore();
|
|
228661
228922
|
if (existingScope) {
|
|
228662
228923
|
if (existingScope.ref === resolvedRef.name) {
|
|
228663
|
-
|
|
228924
|
+
logger22.debug({
|
|
228664
228925
|
ref: resolvedRef.name,
|
|
228665
228926
|
existingConnectionId: existingScope.connectionId
|
|
228666
228927
|
}, "Reusing existing ref scope");
|
|
@@ -228683,7 +228944,7 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228683
228944
|
connection$1.release();
|
|
228684
228945
|
}
|
|
228685
228946
|
}
|
|
228686
|
-
|
|
228947
|
+
logger22.debug({
|
|
228687
228948
|
ref: resolvedRef.name,
|
|
228688
228949
|
refType: resolvedRef.type,
|
|
228689
228950
|
connectionId
|
|
@@ -228695,7 +228956,7 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228695
228956
|
schema: manage_schema_exports
|
|
228696
228957
|
});
|
|
228697
228958
|
if (resolvedRef.type === "branch") {
|
|
228698
|
-
|
|
228959
|
+
logger22.debug({
|
|
228699
228960
|
branch: resolvedRef.name,
|
|
228700
228961
|
connectionId
|
|
228701
228962
|
}, "Checking out branch");
|
|
@@ -228705,7 +228966,7 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228705
228966
|
});
|
|
228706
228967
|
} else {
|
|
228707
228968
|
tempBranch = `temp_${resolvedRef.type}_${Date.now()}_${generateId()}`;
|
|
228708
|
-
|
|
228969
|
+
logger22.debug({
|
|
228709
228970
|
tempBranch,
|
|
228710
228971
|
hash: resolvedRef.hash,
|
|
228711
228972
|
refType: resolvedRef.type,
|
|
@@ -228723,7 +228984,7 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228723
228984
|
}, () => dataAccessFn(db));
|
|
228724
228985
|
if (commit && resolvedRef.type === "branch") try {
|
|
228725
228986
|
if ((await doltStatus(db)()).length > 0) {
|
|
228726
|
-
|
|
228987
|
+
logger22.info({
|
|
228727
228988
|
branch: resolvedRef.name,
|
|
228728
228989
|
message: commitMessage,
|
|
228729
228990
|
connectionId
|
|
@@ -228735,19 +228996,19 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228735
228996
|
email: "api@inkeep.com"
|
|
228736
228997
|
}
|
|
228737
228998
|
});
|
|
228738
|
-
|
|
228999
|
+
logger22.info({
|
|
228739
229000
|
branch: resolvedRef.name,
|
|
228740
229001
|
connectionId
|
|
228741
229002
|
}, "Successfully committed changes");
|
|
228742
229003
|
}
|
|
228743
229004
|
} catch (commitError) {
|
|
228744
|
-
|
|
229005
|
+
logger22.error({
|
|
228745
229006
|
error: commitError,
|
|
228746
229007
|
branch: resolvedRef.name,
|
|
228747
229008
|
connectionId
|
|
228748
229009
|
}, "Failed to auto-commit changes");
|
|
228749
229010
|
}
|
|
228750
|
-
|
|
229011
|
+
logger22.debug({
|
|
228751
229012
|
ref: resolvedRef.name,
|
|
228752
229013
|
duration: Date.now() - startTime,
|
|
228753
229014
|
connectionId
|
|
@@ -228760,19 +229021,19 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228760
229021
|
});
|
|
228761
229022
|
if ((await doltStatus(db)()).length > 0) {
|
|
228762
229023
|
await doltReset(db)();
|
|
228763
|
-
|
|
229024
|
+
logger22.info({
|
|
228764
229025
|
branch: resolvedRef.name,
|
|
228765
229026
|
connectionId
|
|
228766
229027
|
}, "Reset uncommitted changes due to failed operation");
|
|
228767
229028
|
}
|
|
228768
229029
|
} catch (resetError) {
|
|
228769
|
-
|
|
229030
|
+
logger22.error({
|
|
228770
229031
|
error: resetError,
|
|
228771
229032
|
branch: resolvedRef.name,
|
|
228772
229033
|
connectionId
|
|
228773
229034
|
}, "Failed to reset changes after error");
|
|
228774
229035
|
}
|
|
228775
|
-
|
|
229036
|
+
logger22.error({
|
|
228776
229037
|
ref: resolvedRef.name,
|
|
228777
229038
|
duration: Date.now() - startTime,
|
|
228778
229039
|
connectionId,
|
|
@@ -228783,7 +229044,7 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228783
229044
|
try {
|
|
228784
229045
|
await connection.query(`SELECT DOLT_CHECKOUT('main')`);
|
|
228785
229046
|
if (tempBranch) {
|
|
228786
|
-
|
|
229047
|
+
logger22.debug({
|
|
228787
229048
|
tempBranch,
|
|
228788
229049
|
connectionId
|
|
228789
229050
|
}, "Deleting temporary branch");
|
|
@@ -228792,14 +229053,14 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228792
229053
|
]);
|
|
228793
229054
|
}
|
|
228794
229055
|
} catch (cleanupError) {
|
|
228795
|
-
|
|
229056
|
+
logger22.error({
|
|
228796
229057
|
error: cleanupError,
|
|
228797
229058
|
tempBranch,
|
|
228798
229059
|
connectionId
|
|
228799
229060
|
}, "Error during ref scope cleanup");
|
|
228800
229061
|
} finally {
|
|
228801
229062
|
connection.release();
|
|
228802
|
-
|
|
229063
|
+
logger22.debug({
|
|
228803
229064
|
ref: resolvedRef.name,
|
|
228804
229065
|
duration: Date.now() - startTime,
|
|
228805
229066
|
connectionId
|
|
@@ -228915,7 +229176,7 @@ var runDbClient = createAgentsRunDatabaseClient({
|
|
|
228915
229176
|
var runDbClient_default = runDbClient;
|
|
228916
229177
|
|
|
228917
229178
|
// src/domains/evals/services/EvaluationService.ts
|
|
228918
|
-
var
|
|
229179
|
+
var logger23 = getLogger("EvaluationService");
|
|
228919
229180
|
var EvaluationService = class {
|
|
228920
229181
|
static {
|
|
228921
229182
|
__name(this, "EvaluationService");
|
|
@@ -228965,7 +229226,7 @@ var EvaluationService = class {
|
|
|
228965
229226
|
messages: initialMessages
|
|
228966
229227
|
});
|
|
228967
229228
|
} catch (error92) {
|
|
228968
|
-
|
|
229229
|
+
logger23.error({
|
|
228969
229230
|
error: error92 instanceof Error ? error92.message : String(error92),
|
|
228970
229231
|
datasetItemId: datasetItem2.id
|
|
228971
229232
|
}, "Error running dataset item through chat API");
|
|
@@ -229000,7 +229261,7 @@ var EvaluationService = class {
|
|
|
229000
229261
|
"x-inkeep-dataset-run-id": datasetRunId
|
|
229001
229262
|
}
|
|
229002
229263
|
};
|
|
229003
|
-
|
|
229264
|
+
logger23.info({
|
|
229004
229265
|
tenantId,
|
|
229005
229266
|
projectId,
|
|
229006
229267
|
agentId,
|
|
@@ -229015,7 +229276,7 @@ var EvaluationService = class {
|
|
|
229015
229276
|
});
|
|
229016
229277
|
if (!response.ok) {
|
|
229017
229278
|
const errorText = await response.text();
|
|
229018
|
-
|
|
229279
|
+
logger23.error({
|
|
229019
229280
|
status: response.status,
|
|
229020
229281
|
statusText: response.statusText,
|
|
229021
229282
|
errorText,
|
|
@@ -229028,9 +229289,9 @@ var EvaluationService = class {
|
|
|
229028
229289
|
};
|
|
229029
229290
|
}
|
|
229030
229291
|
const responseText = await response.text();
|
|
229031
|
-
const parseResult =
|
|
229292
|
+
const parseResult = parseSSEResponse(responseText);
|
|
229032
229293
|
if (parseResult.error) {
|
|
229033
|
-
|
|
229294
|
+
logger23.error({
|
|
229034
229295
|
datasetItemId: datasetItem2.id,
|
|
229035
229296
|
conversationId,
|
|
229036
229297
|
errorMessage: parseResult.error
|
|
@@ -229040,7 +229301,7 @@ var EvaluationService = class {
|
|
|
229040
229301
|
error: parseResult.error
|
|
229041
229302
|
};
|
|
229042
229303
|
}
|
|
229043
|
-
|
|
229304
|
+
logger23.info({
|
|
229044
229305
|
datasetItemId: datasetItem2.id,
|
|
229045
229306
|
conversationId,
|
|
229046
229307
|
responseLength: parseResult.text?.length || 0
|
|
@@ -229055,7 +229316,7 @@ var EvaluationService = class {
|
|
|
229055
229316
|
*/
|
|
229056
229317
|
async runDatasetItemWithSimulation(params) {
|
|
229057
229318
|
const { tenantId, projectId, agentId, datasetItem: datasetItem2, datasetRunId, conversationId, apiKey, initialMessages, simulationAgent } = params;
|
|
229058
|
-
|
|
229319
|
+
logger23.info({
|
|
229059
229320
|
tenantId,
|
|
229060
229321
|
projectId,
|
|
229061
229322
|
agentId,
|
|
@@ -229095,7 +229356,7 @@ var EvaluationService = class {
|
|
|
229095
229356
|
while (stepCount < maxSteps) {
|
|
229096
229357
|
try {
|
|
229097
229358
|
const simulationPrompt = this.buildSimulationPrompt(simulationAgent.prompt, conversationHistory);
|
|
229098
|
-
|
|
229359
|
+
logger23.debug({
|
|
229099
229360
|
stepCount,
|
|
229100
229361
|
maxSteps,
|
|
229101
229362
|
conversationHistoryLength: conversationHistory.length
|
|
@@ -229106,7 +229367,7 @@ var EvaluationService = class {
|
|
|
229106
229367
|
});
|
|
229107
229368
|
const nextUserMessage = simulationResponse.text.trim();
|
|
229108
229369
|
if (!nextUserMessage) {
|
|
229109
|
-
|
|
229370
|
+
logger23.warn({
|
|
229110
229371
|
stepCount,
|
|
229111
229372
|
datasetItemId: datasetItem2.id
|
|
229112
229373
|
}, "Simulation agent returned empty message, stopping conversation");
|
|
@@ -229132,7 +229393,7 @@ var EvaluationService = class {
|
|
|
229132
229393
|
]
|
|
229133
229394
|
});
|
|
229134
229395
|
if (agentResponse.error || !agentResponse.response) {
|
|
229135
|
-
|
|
229396
|
+
logger23.warn({
|
|
229136
229397
|
stepCount,
|
|
229137
229398
|
error: agentResponse.error,
|
|
229138
229399
|
datasetItemId: datasetItem2.id
|
|
@@ -229145,7 +229406,7 @@ var EvaluationService = class {
|
|
|
229145
229406
|
});
|
|
229146
229407
|
stepCount++;
|
|
229147
229408
|
} catch (error92) {
|
|
229148
|
-
|
|
229409
|
+
logger23.error({
|
|
229149
229410
|
error: error92 instanceof Error ? error92.message : String(error92),
|
|
229150
229411
|
stepCount,
|
|
229151
229412
|
datasetItemId: datasetItem2.id
|
|
@@ -229153,7 +229414,7 @@ var EvaluationService = class {
|
|
|
229153
229414
|
break;
|
|
229154
229415
|
}
|
|
229155
229416
|
}
|
|
229156
|
-
|
|
229417
|
+
logger23.info({
|
|
229157
229418
|
datasetItemId: datasetItem2.id,
|
|
229158
229419
|
conversationId,
|
|
229159
229420
|
finalStepCount: stepCount,
|
|
@@ -229207,7 +229468,7 @@ Generate the next user message:`;
|
|
|
229207
229468
|
const validMessages = input.messages.map((msg) => {
|
|
229208
229469
|
const mappedRole = roleMap[msg.role.toLowerCase()];
|
|
229209
229470
|
if (!mappedRole) {
|
|
229210
|
-
|
|
229471
|
+
logger23.warn({
|
|
229211
229472
|
datasetItemId: datasetItem2.id,
|
|
229212
229473
|
invalidRole: msg.role
|
|
229213
229474
|
}, "Invalid message role found, skipping message");
|
|
@@ -229219,7 +229480,7 @@ Generate the next user message:`;
|
|
|
229219
229480
|
};
|
|
229220
229481
|
}).filter((msg) => msg !== null);
|
|
229221
229482
|
if (validMessages.length === 0) {
|
|
229222
|
-
|
|
229483
|
+
logger23.warn({
|
|
229223
229484
|
datasetItemId: datasetItem2.id,
|
|
229224
229485
|
totalMessages: input.messages.length
|
|
229225
229486
|
}, "No valid messages found after filtering roles");
|
|
@@ -229234,7 +229495,7 @@ Generate the next user message:`;
|
|
|
229234
229495
|
const validMessages = parsed.messages.map((msg) => {
|
|
229235
229496
|
const mappedRole = roleMap[msg.role?.toLowerCase()];
|
|
229236
229497
|
if (!mappedRole) {
|
|
229237
|
-
|
|
229498
|
+
logger23.warn({
|
|
229238
229499
|
datasetItemId: datasetItem2.id,
|
|
229239
229500
|
invalidRole: msg.role
|
|
229240
229501
|
}, "Invalid message role found in parsed input, skipping message");
|
|
@@ -229259,69 +229520,6 @@ Generate the next user message:`;
|
|
|
229259
229520
|
return null;
|
|
229260
229521
|
}
|
|
229261
229522
|
/**
|
|
229262
|
-
* Parse SSE (Server-Sent Events) response from chat API
|
|
229263
|
-
* Handles text deltas, error operations, and other data operations
|
|
229264
|
-
*/
|
|
229265
|
-
parseSSEResponse(sseText) {
|
|
229266
|
-
let textContent = "";
|
|
229267
|
-
let hasError = false;
|
|
229268
|
-
let errorMessage = "";
|
|
229269
|
-
const lines = sseText.split("\n").filter((line2) => line2.startsWith("data: "));
|
|
229270
|
-
for (const line2 of lines) {
|
|
229271
|
-
try {
|
|
229272
|
-
const data = JSON.parse(line2.slice(6));
|
|
229273
|
-
if (data.object === "chat.completion.chunk" && data.choices?.[0]?.delta) {
|
|
229274
|
-
const delta = data.choices[0].delta;
|
|
229275
|
-
if (delta.content) {
|
|
229276
|
-
textContent += delta.content;
|
|
229277
|
-
}
|
|
229278
|
-
if (delta.content && typeof delta.content === "string") {
|
|
229279
|
-
try {
|
|
229280
|
-
const parsedContent = JSON.parse(delta.content);
|
|
229281
|
-
if (parsedContent.type === "data-operation" && parsedContent.data?.type === "error") {
|
|
229282
|
-
hasError = true;
|
|
229283
|
-
errorMessage = parsedContent.data.message || "Unknown error occurred";
|
|
229284
|
-
logger21.warn({
|
|
229285
|
-
errorMessage,
|
|
229286
|
-
errorData: parsedContent.data
|
|
229287
|
-
}, "Received error operation from chat API");
|
|
229288
|
-
}
|
|
229289
|
-
} catch {
|
|
229290
|
-
}
|
|
229291
|
-
}
|
|
229292
|
-
} else if (data.type === "text-delta" && data.delta) {
|
|
229293
|
-
textContent += data.delta;
|
|
229294
|
-
} else if (data.type === "data-operation" && data.data?.type === "error") {
|
|
229295
|
-
hasError = true;
|
|
229296
|
-
errorMessage = data.data.message || "Unknown error occurred";
|
|
229297
|
-
logger21.warn({
|
|
229298
|
-
errorMessage,
|
|
229299
|
-
errorData: data.data
|
|
229300
|
-
}, "Received error operation from chat API");
|
|
229301
|
-
} else if (data.type === "error") {
|
|
229302
|
-
hasError = true;
|
|
229303
|
-
errorMessage = data.message || "Unknown error occurred";
|
|
229304
|
-
logger21.warn({
|
|
229305
|
-
errorMessage,
|
|
229306
|
-
errorData: data
|
|
229307
|
-
}, "Received error event from chat API");
|
|
229308
|
-
} else if (data.content) {
|
|
229309
|
-
textContent += typeof data.content === "string" ? data.content : JSON.stringify(data.content);
|
|
229310
|
-
}
|
|
229311
|
-
} catch {
|
|
229312
|
-
}
|
|
229313
|
-
}
|
|
229314
|
-
if (hasError) {
|
|
229315
|
-
return {
|
|
229316
|
-
text: textContent.trim(),
|
|
229317
|
-
error: errorMessage
|
|
229318
|
-
};
|
|
229319
|
-
}
|
|
229320
|
-
return {
|
|
229321
|
-
text: textContent.trim()
|
|
229322
|
-
};
|
|
229323
|
-
}
|
|
229324
|
-
/**
|
|
229325
229523
|
* Run an evaluation job based on an evaluation job config
|
|
229326
229524
|
* Filters conversations based on jobFilters and runs evaluations with configured evaluators
|
|
229327
229525
|
*/
|
|
@@ -229332,7 +229530,7 @@ Generate the next user message:`;
|
|
|
229332
229530
|
if (!resolvedRef) {
|
|
229333
229531
|
throw new Error("Failed to resolve ref");
|
|
229334
229532
|
}
|
|
229335
|
-
|
|
229533
|
+
logger23.info({
|
|
229336
229534
|
tenantId,
|
|
229337
229535
|
projectId,
|
|
229338
229536
|
evaluationJobConfigId,
|
|
@@ -229369,7 +229567,7 @@ Generate the next user message:`;
|
|
|
229369
229567
|
if (validEvaluators.length === 0) {
|
|
229370
229568
|
throw new Error(`No valid evaluators found for job config: ${evaluationJobConfigId}`);
|
|
229371
229569
|
}
|
|
229372
|
-
|
|
229570
|
+
logger23.info({
|
|
229373
229571
|
tenantId,
|
|
229374
229572
|
projectId,
|
|
229375
229573
|
evaluationJobConfigId,
|
|
@@ -229385,7 +229583,7 @@ Generate the next user message:`;
|
|
|
229385
229583
|
if (sampleRate !== void 0 && sampleRate !== null) {
|
|
229386
229584
|
const originalCount = conversationsToEvaluate.length;
|
|
229387
229585
|
conversationsToEvaluate = this.applySampleRate(conversationsToEvaluate, sampleRate);
|
|
229388
|
-
|
|
229586
|
+
logger23.info({
|
|
229389
229587
|
tenantId,
|
|
229390
229588
|
projectId,
|
|
229391
229589
|
evaluationJobConfigId,
|
|
@@ -229394,14 +229592,14 @@ Generate the next user message:`;
|
|
|
229394
229592
|
sampleRate
|
|
229395
229593
|
}, "Applied sample rate to conversations");
|
|
229396
229594
|
}
|
|
229397
|
-
|
|
229595
|
+
logger23.info({
|
|
229398
229596
|
tenantId,
|
|
229399
229597
|
projectId,
|
|
229400
229598
|
evaluationJobConfigId,
|
|
229401
229599
|
conversationCount: conversationsToEvaluate.length
|
|
229402
229600
|
}, "Found conversations for evaluation");
|
|
229403
229601
|
if (conversationsToEvaluate.length === 0) {
|
|
229404
|
-
|
|
229602
|
+
logger23.warn({
|
|
229405
229603
|
tenantId,
|
|
229406
229604
|
projectId,
|
|
229407
229605
|
evaluationJobConfigId
|
|
@@ -229418,7 +229616,7 @@ Generate the next user message:`;
|
|
|
229418
229616
|
for (const conversation of conversationsToEvaluate) {
|
|
229419
229617
|
for (const evaluator2 of validEvaluators) {
|
|
229420
229618
|
try {
|
|
229421
|
-
|
|
229619
|
+
logger23.info({
|
|
229422
229620
|
tenantId,
|
|
229423
229621
|
conversationId: conversation.id,
|
|
229424
229622
|
evaluatorId: evaluator2.id
|
|
@@ -229451,14 +229649,14 @@ Generate the next user message:`;
|
|
|
229451
229649
|
if (updatedResult) {
|
|
229452
229650
|
results.push(updatedResult);
|
|
229453
229651
|
}
|
|
229454
|
-
|
|
229652
|
+
logger23.info({
|
|
229455
229653
|
tenantId,
|
|
229456
229654
|
conversationId: conversation.id,
|
|
229457
229655
|
evaluatorId: evaluator2.id,
|
|
229458
229656
|
resultId: evalResult.id
|
|
229459
229657
|
}, "Evaluation completed successfully");
|
|
229460
229658
|
} catch (error92) {
|
|
229461
|
-
|
|
229659
|
+
logger23.error({
|
|
229462
229660
|
error: error92,
|
|
229463
229661
|
tenantId,
|
|
229464
229662
|
conversationId: conversation.id,
|
|
@@ -229483,7 +229681,7 @@ Generate the next user message:`;
|
|
|
229483
229681
|
}
|
|
229484
229682
|
}
|
|
229485
229683
|
} catch (error92) {
|
|
229486
|
-
|
|
229684
|
+
logger23.error({
|
|
229487
229685
|
error: error92 instanceof Error ? error92.message : String(error92),
|
|
229488
229686
|
tenantId,
|
|
229489
229687
|
conversationId: conversation.id,
|
|
@@ -229492,7 +229690,7 @@ Generate the next user message:`;
|
|
|
229492
229690
|
}
|
|
229493
229691
|
}
|
|
229494
229692
|
}
|
|
229495
|
-
|
|
229693
|
+
logger23.info({
|
|
229496
229694
|
tenantId,
|
|
229497
229695
|
projectId,
|
|
229498
229696
|
evaluationJobConfigId,
|
|
@@ -229562,20 +229760,20 @@ Generate the next user message:`;
|
|
|
229562
229760
|
}
|
|
229563
229761
|
}));
|
|
229564
229762
|
} else {
|
|
229565
|
-
|
|
229763
|
+
logger23.warn({
|
|
229566
229764
|
conversationId: conversation.id,
|
|
229567
229765
|
agentId: conversation.agentId
|
|
229568
229766
|
}, "AgentId not found, cannot get agent definition");
|
|
229569
229767
|
}
|
|
229570
229768
|
} catch (error92) {
|
|
229571
|
-
|
|
229769
|
+
logger23.warn({
|
|
229572
229770
|
error: error92,
|
|
229573
229771
|
conversationId: conversation.id,
|
|
229574
229772
|
agentId: conversation.agentId
|
|
229575
229773
|
}, "Failed to fetch agent definition for evaluation");
|
|
229576
229774
|
}
|
|
229577
229775
|
const prettifiedTrace = await this.fetchTraceFromSigNoz(conversation.id);
|
|
229578
|
-
|
|
229776
|
+
logger23.info({
|
|
229579
229777
|
conversationId: conversation.id,
|
|
229580
229778
|
hasTrace: !!prettifiedTrace,
|
|
229581
229779
|
traceActivityCount: prettifiedTrace?.timeline?.length || 0
|
|
@@ -229589,7 +229787,7 @@ Generate the next user message:`;
|
|
|
229589
229787
|
try {
|
|
229590
229788
|
schemaObj = JSON.parse(evaluator2.schema);
|
|
229591
229789
|
} catch (error92) {
|
|
229592
|
-
|
|
229790
|
+
logger23.error({
|
|
229593
229791
|
error: error92,
|
|
229594
229792
|
schemaString: evaluator2.schema
|
|
229595
229793
|
}, "Failed to parse evaluator schema string");
|
|
@@ -229598,7 +229796,7 @@ Generate the next user message:`;
|
|
|
229598
229796
|
} else {
|
|
229599
229797
|
schemaObj = evaluator2.schema;
|
|
229600
229798
|
}
|
|
229601
|
-
|
|
229799
|
+
logger23.info({
|
|
229602
229800
|
evaluatorId: evaluator2.id,
|
|
229603
229801
|
schemaType: typeof schemaObj,
|
|
229604
229802
|
schemaKeys: schemaObj && typeof schemaObj === "object" ? Object.keys(schemaObj) : []
|
|
@@ -229663,13 +229861,13 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229663
229861
|
let resultSchema;
|
|
229664
229862
|
try {
|
|
229665
229863
|
resultSchema = external_exports.fromJSONSchema(schema);
|
|
229666
|
-
|
|
229864
|
+
logger23.info({
|
|
229667
229865
|
schemaType: typeof schema,
|
|
229668
229866
|
schemaKeys: schema && typeof schema === "object" ? Object.keys(schema) : [],
|
|
229669
229867
|
convertedSchema: "success"
|
|
229670
229868
|
}, "Converted JSON schema to Zod");
|
|
229671
229869
|
} catch (error92) {
|
|
229672
|
-
|
|
229870
|
+
logger23.error({
|
|
229673
229871
|
error: error92,
|
|
229674
229872
|
schema
|
|
229675
229873
|
}, "Failed to convert JSON schema to Zod, using fallback");
|
|
@@ -229677,7 +229875,7 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229677
229875
|
}
|
|
229678
229876
|
const evaluationSchema = resultSchema;
|
|
229679
229877
|
try {
|
|
229680
|
-
|
|
229878
|
+
logger23.info({
|
|
229681
229879
|
promptLength: prompt.length,
|
|
229682
229880
|
model: modelConfig.model
|
|
229683
229881
|
}, "Calling generateObject");
|
|
@@ -229695,7 +229893,7 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229695
229893
|
};
|
|
229696
229894
|
} catch (error92) {
|
|
229697
229895
|
const errorMessage = error92 instanceof Error ? error92.message : String(error92);
|
|
229698
|
-
|
|
229896
|
+
logger23.error({
|
|
229699
229897
|
error: errorMessage,
|
|
229700
229898
|
schema: JSON.stringify(schema, null, 2),
|
|
229701
229899
|
promptPreview: prompt.substring(0, 500)
|
|
@@ -229712,7 +229910,7 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229712
229910
|
const retryDelayMs = 2e4;
|
|
229713
229911
|
const initialDelayMs = 3e4;
|
|
229714
229912
|
try {
|
|
229715
|
-
|
|
229913
|
+
logger23.info({
|
|
229716
229914
|
conversationId,
|
|
229717
229915
|
manageUIUrl,
|
|
229718
229916
|
initialDelayMs
|
|
@@ -229720,21 +229918,21 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229720
229918
|
await new Promise((resolve4) => setTimeout(resolve4, initialDelayMs));
|
|
229721
229919
|
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
229722
229920
|
try {
|
|
229723
|
-
|
|
229921
|
+
logger23.info({
|
|
229724
229922
|
conversationId,
|
|
229725
229923
|
attempt: attempt + 1,
|
|
229726
229924
|
maxRetries: maxRetries + 1
|
|
229727
229925
|
}, "Fetching trace from SigNoz");
|
|
229728
229926
|
const traceResponse = await fetch(`${manageUIUrl}/api/signoz/conversations/${conversationId}`);
|
|
229729
229927
|
if (!traceResponse.ok) {
|
|
229730
|
-
|
|
229928
|
+
logger23.warn({
|
|
229731
229929
|
conversationId,
|
|
229732
229930
|
status: traceResponse.status,
|
|
229733
229931
|
statusText: traceResponse.statusText,
|
|
229734
229932
|
attempt: attempt + 1
|
|
229735
229933
|
}, "Failed to fetch trace from SigNoz");
|
|
229736
229934
|
if (attempt < maxRetries) {
|
|
229737
|
-
|
|
229935
|
+
logger23.info({
|
|
229738
229936
|
conversationId,
|
|
229739
229937
|
retryDelayMs
|
|
229740
229938
|
}, "Retrying trace fetch after delay");
|
|
@@ -229744,34 +229942,34 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229744
229942
|
return null;
|
|
229745
229943
|
}
|
|
229746
229944
|
const conversationDetail = await traceResponse.json();
|
|
229747
|
-
|
|
229945
|
+
logger23.debug({
|
|
229748
229946
|
conversationId,
|
|
229749
229947
|
activityTypes: conversationDetail.activities?.map((a2) => a2.type) || [],
|
|
229750
229948
|
activityCount: conversationDetail.activities?.length || 0
|
|
229751
229949
|
}, "Checking activities for ai_assistant_message type");
|
|
229752
229950
|
const hasAssistantMessage = conversationDetail.activities?.some((activity) => activity.type === "ai_assistant_message");
|
|
229753
229951
|
if (!hasAssistantMessage) {
|
|
229754
|
-
|
|
229952
|
+
logger23.warn({
|
|
229755
229953
|
conversationId,
|
|
229756
229954
|
attempt: attempt + 1,
|
|
229757
229955
|
activityCount: conversationDetail.activities?.length || 0,
|
|
229758
229956
|
activityTypes: conversationDetail.activities?.slice(0, 5).map((a2) => a2.type) || []
|
|
229759
229957
|
}, "Trace fetched but ai_assistant_message not found in activities");
|
|
229760
229958
|
if (attempt < maxRetries) {
|
|
229761
|
-
|
|
229959
|
+
logger23.info({
|
|
229762
229960
|
conversationId,
|
|
229763
229961
|
retryDelayMs
|
|
229764
229962
|
}, "Retrying trace fetch after delay to wait for assistant message");
|
|
229765
229963
|
await new Promise((resolve4) => setTimeout(resolve4, retryDelayMs));
|
|
229766
229964
|
continue;
|
|
229767
229965
|
}
|
|
229768
|
-
|
|
229966
|
+
logger23.warn({
|
|
229769
229967
|
conversationId,
|
|
229770
229968
|
maxRetries,
|
|
229771
229969
|
activityCount: conversationDetail.activities?.length || 0
|
|
229772
229970
|
}, "Max retries reached, ai_assistant_message not found - proceeding with available trace data");
|
|
229773
229971
|
} else {
|
|
229774
|
-
|
|
229972
|
+
logger23.info({
|
|
229775
229973
|
conversationId,
|
|
229776
229974
|
activityCount: conversationDetail.activities?.length || 0,
|
|
229777
229975
|
attempt: attempt + 1
|
|
@@ -229780,13 +229978,13 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229780
229978
|
const prettifiedTrace = this.formatConversationAsPrettifiedTrace(conversationDetail);
|
|
229781
229979
|
return prettifiedTrace;
|
|
229782
229980
|
} catch (fetchError) {
|
|
229783
|
-
|
|
229981
|
+
logger23.warn({
|
|
229784
229982
|
error: fetchError,
|
|
229785
229983
|
conversationId,
|
|
229786
229984
|
attempt: attempt + 1
|
|
229787
229985
|
}, "Error fetching trace from SigNoz");
|
|
229788
229986
|
if (attempt < maxRetries) {
|
|
229789
|
-
|
|
229987
|
+
logger23.info({
|
|
229790
229988
|
conversationId,
|
|
229791
229989
|
retryDelayMs
|
|
229792
229990
|
}, "Retrying trace fetch after delay");
|
|
@@ -229798,7 +229996,7 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229798
229996
|
}
|
|
229799
229997
|
return null;
|
|
229800
229998
|
} catch (error92) {
|
|
229801
|
-
|
|
229999
|
+
logger23.warn({
|
|
229802
230000
|
error: error92,
|
|
229803
230001
|
conversationId,
|
|
229804
230002
|
manageUIUrl
|
|
@@ -229834,124 +230032,8 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229834
230032
|
}
|
|
229835
230033
|
};
|
|
229836
230034
|
|
|
229837
|
-
// src/domains/evals/workflow/functions/evaluateConversation.ts
|
|
229838
|
-
var logger22 = getLogger("workflow-evaluate-conversation");
|
|
229839
|
-
async function getConversationStep(payload) {
|
|
229840
|
-
const { tenantId, projectId, conversationId } = payload;
|
|
229841
|
-
const conv = await getConversation(runDbClient_default)({
|
|
229842
|
-
scopes: {
|
|
229843
|
-
tenantId,
|
|
229844
|
-
projectId
|
|
229845
|
-
},
|
|
229846
|
-
conversationId
|
|
229847
|
-
});
|
|
229848
|
-
if (!conv) {
|
|
229849
|
-
throw new Error(`Conversation not found: ${conversationId}`);
|
|
229850
|
-
}
|
|
229851
|
-
return conv;
|
|
229852
|
-
}
|
|
229853
|
-
__name(getConversationStep, "getConversationStep");
|
|
229854
|
-
async function getEvaluatorsStep(payload) {
|
|
229855
|
-
const { tenantId, projectId, evaluatorIds } = payload;
|
|
229856
|
-
const projectMain = await getProjectMainResolvedRef(manageDbClient_default)(tenantId, projectId);
|
|
229857
|
-
const evals = await withRef(manageDbPool_default, projectMain, (db) => getEvaluatorsByIds(db)({
|
|
229858
|
-
scopes: {
|
|
229859
|
-
tenantId,
|
|
229860
|
-
projectId
|
|
229861
|
-
},
|
|
229862
|
-
evaluatorIds
|
|
229863
|
-
}));
|
|
229864
|
-
return evals;
|
|
229865
|
-
}
|
|
229866
|
-
__name(getEvaluatorsStep, "getEvaluatorsStep");
|
|
229867
|
-
async function executeEvaluatorStep(payload, evaluatorId, conversation) {
|
|
229868
|
-
const { tenantId, projectId, conversationId, evaluationRunId } = payload;
|
|
229869
|
-
const projectMain = await getProjectMainResolvedRef(manageDbClient_default)(tenantId, projectId);
|
|
229870
|
-
const evaluator2 = await withRef(manageDbPool_default, projectMain, (db) => getEvaluatorById(db)({
|
|
229871
|
-
scopes: {
|
|
229872
|
-
tenantId,
|
|
229873
|
-
projectId,
|
|
229874
|
-
evaluatorId
|
|
229875
|
-
}
|
|
229876
|
-
}));
|
|
229877
|
-
if (!evaluator2) {
|
|
229878
|
-
throw new Error(`Evaluator not found: ${evaluatorId}`);
|
|
229879
|
-
}
|
|
229880
|
-
const evalResult = await createEvaluationResult(runDbClient_default)({
|
|
229881
|
-
id: generateId(),
|
|
229882
|
-
tenantId,
|
|
229883
|
-
projectId,
|
|
229884
|
-
conversationId,
|
|
229885
|
-
evaluatorId: evaluator2.id,
|
|
229886
|
-
evaluationRunId
|
|
229887
|
-
});
|
|
229888
|
-
try {
|
|
229889
|
-
const evaluationService = new EvaluationService();
|
|
229890
|
-
const output = await evaluationService.executeEvaluation({
|
|
229891
|
-
conversation,
|
|
229892
|
-
evaluator: evaluator2,
|
|
229893
|
-
tenantId,
|
|
229894
|
-
projectId
|
|
229895
|
-
});
|
|
229896
|
-
const updated = await updateEvaluationResult(runDbClient_default)({
|
|
229897
|
-
scopes: {
|
|
229898
|
-
tenantId,
|
|
229899
|
-
projectId,
|
|
229900
|
-
evaluationResultId: evalResult.id
|
|
229901
|
-
},
|
|
229902
|
-
data: {
|
|
229903
|
-
output
|
|
229904
|
-
}
|
|
229905
|
-
});
|
|
229906
|
-
logger22.info({
|
|
229907
|
-
conversationId,
|
|
229908
|
-
evaluatorId: evaluator2.id,
|
|
229909
|
-
resultId: evalResult.id
|
|
229910
|
-
}, "Evaluation completed successfully");
|
|
229911
|
-
return updated;
|
|
229912
|
-
} catch (error92) {
|
|
229913
|
-
const errorMessage = error92 instanceof Error ? error92.message : "Unknown error";
|
|
229914
|
-
logger22.error({
|
|
229915
|
-
error: error92,
|
|
229916
|
-
conversationId,
|
|
229917
|
-
evaluatorId: evaluator2.id,
|
|
229918
|
-
resultId: evalResult.id
|
|
229919
|
-
}, "Evaluation execution failed");
|
|
229920
|
-
const failed = await updateEvaluationResult(runDbClient_default)({
|
|
229921
|
-
scopes: {
|
|
229922
|
-
tenantId,
|
|
229923
|
-
projectId,
|
|
229924
|
-
evaluationResultId: evalResult.id
|
|
229925
|
-
},
|
|
229926
|
-
data: {
|
|
229927
|
-
output: {
|
|
229928
|
-
text: `Evaluation failed: ${errorMessage}`
|
|
229929
|
-
}
|
|
229930
|
-
}
|
|
229931
|
-
});
|
|
229932
|
-
return failed;
|
|
229933
|
-
}
|
|
229934
|
-
}
|
|
229935
|
-
__name(executeEvaluatorStep, "executeEvaluatorStep");
|
|
229936
|
-
async function logStep(message, data) {
|
|
229937
|
-
logger22.info(data, message);
|
|
229938
|
-
}
|
|
229939
|
-
__name(logStep, "logStep");
|
|
229940
|
-
async function _evaluateConversationWorkflow(payload) {
|
|
229941
|
-
throw new Error("You attempted to execute workflow _evaluateConversationWorkflow function directly. To start a workflow, use start(_evaluateConversationWorkflow) from workflow/api");
|
|
229942
|
-
}
|
|
229943
|
-
__name(_evaluateConversationWorkflow, "_evaluateConversationWorkflow");
|
|
229944
|
-
_evaluateConversationWorkflow.workflowId = "workflow//src/domains/evals/workflow/functions/evaluateConversation.ts//_evaluateConversationWorkflow";
|
|
229945
|
-
var evaluateConversationWorkflow = Object.assign(_evaluateConversationWorkflow, {
|
|
229946
|
-
workflowId: "workflow//src/domains/evals/workflow/functions/evaluateConversation.ts//_evaluateConversationWorkflow"
|
|
229947
|
-
});
|
|
229948
|
-
registerStepFunction("step//src/domains/evals/workflow/functions/evaluateConversation.ts//getConversationStep", getConversationStep);
|
|
229949
|
-
registerStepFunction("step//src/domains/evals/workflow/functions/evaluateConversation.ts//getEvaluatorsStep", getEvaluatorsStep);
|
|
229950
|
-
registerStepFunction("step//src/domains/evals/workflow/functions/evaluateConversation.ts//executeEvaluatorStep", executeEvaluatorStep);
|
|
229951
|
-
registerStepFunction("step//src/domains/evals/workflow/functions/evaluateConversation.ts//logStep", logStep);
|
|
229952
|
-
|
|
229953
230035
|
// src/domains/evals/workflow/functions/runDatasetItem.ts
|
|
229954
|
-
var
|
|
230036
|
+
var logger24 = getLogger("workflow-run-dataset-item");
|
|
229955
230037
|
async function callChatApiStep(payload) {
|
|
229956
230038
|
const { tenantId, projectId, agentId, datasetItemId, datasetItemInput, datasetItemSimulationAgent, datasetRunId } = payload;
|
|
229957
230039
|
const evaluationService = new EvaluationService();
|
|
@@ -229967,7 +230049,7 @@ async function callChatApiStep(payload) {
|
|
|
229967
230049
|
datasetItem: datasetItem2,
|
|
229968
230050
|
datasetRunId
|
|
229969
230051
|
});
|
|
229970
|
-
|
|
230052
|
+
logger24.info({
|
|
229971
230053
|
tenantId,
|
|
229972
230054
|
projectId,
|
|
229973
230055
|
datasetItemId,
|
|
@@ -229990,7 +230072,7 @@ async function createRelationStep(payload, conversationId) {
|
|
|
229990
230072
|
conversationId,
|
|
229991
230073
|
datasetItemId
|
|
229992
230074
|
});
|
|
229993
|
-
|
|
230075
|
+
logger24.info({
|
|
229994
230076
|
tenantId,
|
|
229995
230077
|
projectId,
|
|
229996
230078
|
datasetItemId,
|
|
@@ -230004,7 +230086,7 @@ async function createRelationStep(payload, conversationId) {
|
|
|
230004
230086
|
};
|
|
230005
230087
|
} catch (error92) {
|
|
230006
230088
|
if (error92?.cause?.code === "23503" || error92?.code === "23503") {
|
|
230007
|
-
|
|
230089
|
+
logger24.warn({
|
|
230008
230090
|
tenantId,
|
|
230009
230091
|
projectId,
|
|
230010
230092
|
datasetItemId,
|
|
@@ -230021,7 +230103,7 @@ async function createRelationStep(payload, conversationId) {
|
|
|
230021
230103
|
}
|
|
230022
230104
|
}
|
|
230023
230105
|
__name(createRelationStep, "createRelationStep");
|
|
230024
|
-
async function
|
|
230106
|
+
async function executeEvaluatorStep(tenantId, projectId, conversationId, evaluatorId, evaluationRunId, expectedOutput) {
|
|
230025
230107
|
const ref = getProjectScopedRef(tenantId, projectId, "main");
|
|
230026
230108
|
const resolvedRef = await resolveRef2(manageDbClient_default)(ref);
|
|
230027
230109
|
if (!resolvedRef) {
|
|
@@ -230035,7 +230117,7 @@ async function executeEvaluatorStep2(tenantId, projectId, conversationId, evalua
|
|
|
230035
230117
|
}
|
|
230036
230118
|
}));
|
|
230037
230119
|
if (!evaluator2) {
|
|
230038
|
-
|
|
230120
|
+
logger24.warn({
|
|
230039
230121
|
evaluatorId
|
|
230040
230122
|
}, "Evaluator not found");
|
|
230041
230123
|
return null;
|
|
@@ -230077,7 +230159,7 @@ async function executeEvaluatorStep2(tenantId, projectId, conversationId, evalua
|
|
|
230077
230159
|
output
|
|
230078
230160
|
}
|
|
230079
230161
|
});
|
|
230080
|
-
|
|
230162
|
+
logger24.info({
|
|
230081
230163
|
conversationId,
|
|
230082
230164
|
evaluatorId: evaluator2.id,
|
|
230083
230165
|
resultId: evalResult.id
|
|
@@ -230085,7 +230167,7 @@ async function executeEvaluatorStep2(tenantId, projectId, conversationId, evalua
|
|
|
230085
230167
|
return evalResult.id;
|
|
230086
230168
|
} catch (error92) {
|
|
230087
230169
|
const errorMessage = error92 instanceof Error ? error92.message : "Unknown error";
|
|
230088
|
-
|
|
230170
|
+
logger24.error({
|
|
230089
230171
|
error: error92,
|
|
230090
230172
|
conversationId,
|
|
230091
230173
|
evaluatorId: evaluator2.id
|
|
@@ -230105,11 +230187,11 @@ async function executeEvaluatorStep2(tenantId, projectId, conversationId, evalua
|
|
|
230105
230187
|
return evalResult.id;
|
|
230106
230188
|
}
|
|
230107
230189
|
}
|
|
230108
|
-
__name(
|
|
230109
|
-
async function
|
|
230110
|
-
|
|
230190
|
+
__name(executeEvaluatorStep, "executeEvaluatorStep");
|
|
230191
|
+
async function logStep(message, data) {
|
|
230192
|
+
logger24.info(data, message);
|
|
230111
230193
|
}
|
|
230112
|
-
__name(
|
|
230194
|
+
__name(logStep, "logStep");
|
|
230113
230195
|
async function _runDatasetItemWorkflow(payload) {
|
|
230114
230196
|
throw new Error("You attempted to execute workflow _runDatasetItemWorkflow function directly. To start a workflow, use start(_runDatasetItemWorkflow) from workflow/api");
|
|
230115
230197
|
}
|
|
@@ -230120,8 +230202,124 @@ var runDatasetItemWorkflow = Object.assign(_runDatasetItemWorkflow, {
|
|
|
230120
230202
|
});
|
|
230121
230203
|
registerStepFunction("step//src/domains/evals/workflow/functions/runDatasetItem.ts//callChatApiStep", callChatApiStep);
|
|
230122
230204
|
registerStepFunction("step//src/domains/evals/workflow/functions/runDatasetItem.ts//createRelationStep", createRelationStep);
|
|
230123
|
-
registerStepFunction("step//src/domains/evals/workflow/functions/runDatasetItem.ts//executeEvaluatorStep",
|
|
230124
|
-
registerStepFunction("step//src/domains/evals/workflow/functions/runDatasetItem.ts//logStep",
|
|
230205
|
+
registerStepFunction("step//src/domains/evals/workflow/functions/runDatasetItem.ts//executeEvaluatorStep", executeEvaluatorStep);
|
|
230206
|
+
registerStepFunction("step//src/domains/evals/workflow/functions/runDatasetItem.ts//logStep", logStep);
|
|
230207
|
+
|
|
230208
|
+
// src/domains/evals/workflow/functions/evaluateConversation.ts
|
|
230209
|
+
var logger25 = getLogger("workflow-evaluate-conversation");
|
|
230210
|
+
async function getConversationStep(payload) {
|
|
230211
|
+
const { tenantId, projectId, conversationId } = payload;
|
|
230212
|
+
const conv = await getConversation(runDbClient_default)({
|
|
230213
|
+
scopes: {
|
|
230214
|
+
tenantId,
|
|
230215
|
+
projectId
|
|
230216
|
+
},
|
|
230217
|
+
conversationId
|
|
230218
|
+
});
|
|
230219
|
+
if (!conv) {
|
|
230220
|
+
throw new Error(`Conversation not found: ${conversationId}`);
|
|
230221
|
+
}
|
|
230222
|
+
return conv;
|
|
230223
|
+
}
|
|
230224
|
+
__name(getConversationStep, "getConversationStep");
|
|
230225
|
+
async function getEvaluatorsStep(payload) {
|
|
230226
|
+
const { tenantId, projectId, evaluatorIds } = payload;
|
|
230227
|
+
const projectMain = await getProjectMainResolvedRef(manageDbClient_default)(tenantId, projectId);
|
|
230228
|
+
const evals = await withRef(manageDbPool_default, projectMain, (db) => getEvaluatorsByIds(db)({
|
|
230229
|
+
scopes: {
|
|
230230
|
+
tenantId,
|
|
230231
|
+
projectId
|
|
230232
|
+
},
|
|
230233
|
+
evaluatorIds
|
|
230234
|
+
}));
|
|
230235
|
+
return evals;
|
|
230236
|
+
}
|
|
230237
|
+
__name(getEvaluatorsStep, "getEvaluatorsStep");
|
|
230238
|
+
async function executeEvaluatorStep2(payload, evaluatorId, conversation) {
|
|
230239
|
+
const { tenantId, projectId, conversationId, evaluationRunId } = payload;
|
|
230240
|
+
const projectMain = await getProjectMainResolvedRef(manageDbClient_default)(tenantId, projectId);
|
|
230241
|
+
const evaluator2 = await withRef(manageDbPool_default, projectMain, (db) => getEvaluatorById(db)({
|
|
230242
|
+
scopes: {
|
|
230243
|
+
tenantId,
|
|
230244
|
+
projectId,
|
|
230245
|
+
evaluatorId
|
|
230246
|
+
}
|
|
230247
|
+
}));
|
|
230248
|
+
if (!evaluator2) {
|
|
230249
|
+
throw new Error(`Evaluator not found: ${evaluatorId}`);
|
|
230250
|
+
}
|
|
230251
|
+
const evalResult = await createEvaluationResult(runDbClient_default)({
|
|
230252
|
+
id: generateId(),
|
|
230253
|
+
tenantId,
|
|
230254
|
+
projectId,
|
|
230255
|
+
conversationId,
|
|
230256
|
+
evaluatorId: evaluator2.id,
|
|
230257
|
+
evaluationRunId
|
|
230258
|
+
});
|
|
230259
|
+
try {
|
|
230260
|
+
const evaluationService = new EvaluationService();
|
|
230261
|
+
const output = await evaluationService.executeEvaluation({
|
|
230262
|
+
conversation,
|
|
230263
|
+
evaluator: evaluator2,
|
|
230264
|
+
tenantId,
|
|
230265
|
+
projectId
|
|
230266
|
+
});
|
|
230267
|
+
const updated = await updateEvaluationResult(runDbClient_default)({
|
|
230268
|
+
scopes: {
|
|
230269
|
+
tenantId,
|
|
230270
|
+
projectId,
|
|
230271
|
+
evaluationResultId: evalResult.id
|
|
230272
|
+
},
|
|
230273
|
+
data: {
|
|
230274
|
+
output
|
|
230275
|
+
}
|
|
230276
|
+
});
|
|
230277
|
+
logger25.info({
|
|
230278
|
+
conversationId,
|
|
230279
|
+
evaluatorId: evaluator2.id,
|
|
230280
|
+
resultId: evalResult.id
|
|
230281
|
+
}, "Evaluation completed successfully");
|
|
230282
|
+
return updated;
|
|
230283
|
+
} catch (error92) {
|
|
230284
|
+
const errorMessage = error92 instanceof Error ? error92.message : "Unknown error";
|
|
230285
|
+
logger25.error({
|
|
230286
|
+
error: error92,
|
|
230287
|
+
conversationId,
|
|
230288
|
+
evaluatorId: evaluator2.id,
|
|
230289
|
+
resultId: evalResult.id
|
|
230290
|
+
}, "Evaluation execution failed");
|
|
230291
|
+
const failed = await updateEvaluationResult(runDbClient_default)({
|
|
230292
|
+
scopes: {
|
|
230293
|
+
tenantId,
|
|
230294
|
+
projectId,
|
|
230295
|
+
evaluationResultId: evalResult.id
|
|
230296
|
+
},
|
|
230297
|
+
data: {
|
|
230298
|
+
output: {
|
|
230299
|
+
text: `Evaluation failed: ${errorMessage}`
|
|
230300
|
+
}
|
|
230301
|
+
}
|
|
230302
|
+
});
|
|
230303
|
+
return failed;
|
|
230304
|
+
}
|
|
230305
|
+
}
|
|
230306
|
+
__name(executeEvaluatorStep2, "executeEvaluatorStep");
|
|
230307
|
+
async function logStep2(message, data) {
|
|
230308
|
+
logger25.info(data, message);
|
|
230309
|
+
}
|
|
230310
|
+
__name(logStep2, "logStep");
|
|
230311
|
+
async function _evaluateConversationWorkflow(payload) {
|
|
230312
|
+
throw new Error("You attempted to execute workflow _evaluateConversationWorkflow function directly. To start a workflow, use start(_evaluateConversationWorkflow) from workflow/api");
|
|
230313
|
+
}
|
|
230314
|
+
__name(_evaluateConversationWorkflow, "_evaluateConversationWorkflow");
|
|
230315
|
+
_evaluateConversationWorkflow.workflowId = "workflow//src/domains/evals/workflow/functions/evaluateConversation.ts//_evaluateConversationWorkflow";
|
|
230316
|
+
var evaluateConversationWorkflow = Object.assign(_evaluateConversationWorkflow, {
|
|
230317
|
+
workflowId: "workflow//src/domains/evals/workflow/functions/evaluateConversation.ts//_evaluateConversationWorkflow"
|
|
230318
|
+
});
|
|
230319
|
+
registerStepFunction("step//src/domains/evals/workflow/functions/evaluateConversation.ts//getConversationStep", getConversationStep);
|
|
230320
|
+
registerStepFunction("step//src/domains/evals/workflow/functions/evaluateConversation.ts//getEvaluatorsStep", getEvaluatorsStep);
|
|
230321
|
+
registerStepFunction("step//src/domains/evals/workflow/functions/evaluateConversation.ts//executeEvaluatorStep", executeEvaluatorStep2);
|
|
230322
|
+
registerStepFunction("step//src/domains/evals/workflow/functions/evaluateConversation.ts//logStep", logStep2);
|
|
230125
230323
|
|
|
230126
230324
|
// ../node_modules/.pnpm/@workflow+utils@4.0.1-beta.7/node_modules/@workflow/utils/dist/index.js
|
|
230127
230325
|
var import_ms2 = __toESM(require_ms(), 1);
|
|
@@ -244161,7 +244359,7 @@ __name(linkToCurrentContext, "linkToCurrentContext");
|
|
|
244161
244359
|
// ../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
|
|
244162
244360
|
function createLogger(namespace) {
|
|
244163
244361
|
const baseDebug = (0, import_debug2.default)(`workflow:${namespace}`);
|
|
244164
|
-
const
|
|
244362
|
+
const logger26 = /* @__PURE__ */ __name((level) => {
|
|
244165
244363
|
const levelDebug = baseDebug.extend(level);
|
|
244166
244364
|
return (message, metadata2) => {
|
|
244167
244365
|
levelDebug(message, metadata2);
|
|
@@ -244177,10 +244375,10 @@ function createLogger(namespace) {
|
|
|
244177
244375
|
};
|
|
244178
244376
|
}, "logger");
|
|
244179
244377
|
return {
|
|
244180
|
-
debug:
|
|
244181
|
-
info:
|
|
244182
|
-
warn:
|
|
244183
|
-
error:
|
|
244378
|
+
debug: logger26("debug"),
|
|
244379
|
+
info: logger26("info"),
|
|
244380
|
+
warn: logger26("warn"),
|
|
244381
|
+
error: logger26("error")
|
|
244184
244382
|
};
|
|
244185
244383
|
}
|
|
244186
244384
|
__name(createLogger, "createLogger");
|