@inkeep/agents-api 0.0.0-dev-20260204182014 → 0.0.0-dev-20260204210021
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/manifest.debug.json +5 -5
- package/dist/.well-known/workflow/v1/step.cjs +233 -570
- package/dist/createApp.d.ts +2 -2
- package/dist/createApp.js +1 -46
- package/dist/data/db/manageDbClient.d.ts +2 -2
- package/dist/data/db/runDbClient.d.ts +2 -2
- 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 +5 -0
- package/dist/domains/evals/services/EvaluationService.js +51 -2
- 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/run/agents/relationTools.d.ts +2 -2
- package/dist/domains/run/utils/token-estimator.d.ts +2 -2
- package/dist/factory.d.ts +20 -20
- package/dist/index.d.ts +18 -18
- package/dist/middleware/cors.d.ts +1 -6
- package/dist/middleware/cors.js +1 -27
- 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 +1 -16
- 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 +1 -48
- 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 +0 -8
- package/dist/openapi.js +1 -9
- package/package.json +5 -10
- package/dist/domains/work-apps/index.d.ts +0 -13
- package/dist/domains/work-apps/index.js +0 -23
- package/dist/domains/work-apps/types.d.ts +0 -7
- package/dist/domains/work-apps/types.js +0 -1
|
@@ -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(logger24) {
|
|
8523
|
+
if (logger24 === false) return noLogs;
|
|
8524
|
+
if (logger24 === void 0) return console;
|
|
8525
|
+
if (logger24.log && logger24.warn && logger24.error) return logger24;
|
|
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.28.6/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.28.6/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 &&
|
|
21117
|
+
if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) {
|
|
21118
21118
|
return;
|
|
21119
21119
|
}
|
|
21120
21120
|
const node = this.startNodeAt(startLoc);
|
|
@@ -21587,18 +21587,8 @@ var require_lib = __commonJS({
|
|
|
21587
21587
|
}
|
|
21588
21588
|
parseClassSuper(node) {
|
|
21589
21589
|
super.parseClassSuper(node);
|
|
21590
|
-
if (node.superClass) {
|
|
21591
|
-
|
|
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
|
-
}
|
|
21590
|
+
if (node.superClass && (this.match(47) || this.match(51))) {
|
|
21591
|
+
node.superTypeParameters = this.tsParseTypeArgumentsInExpression();
|
|
21602
21592
|
}
|
|
21603
21593
|
if (this.eatContextual(113)) {
|
|
21604
21594
|
node.implements = this.tsParseHeritageClause("implements");
|
|
@@ -39670,8 +39660,8 @@ var require_logging = __commonJS({
|
|
|
39670
39660
|
return _logger;
|
|
39671
39661
|
}, "getLogger");
|
|
39672
39662
|
exports2.getLogger = getLogger2;
|
|
39673
|
-
var setLogger = /* @__PURE__ */ __name((
|
|
39674
|
-
_logger =
|
|
39663
|
+
var setLogger = /* @__PURE__ */ __name((logger24) => {
|
|
39664
|
+
_logger = logger24;
|
|
39675
39665
|
}, "setLogger");
|
|
39676
39666
|
exports2.setLogger = setLogger;
|
|
39677
39667
|
var setLoggerVerbosity = /* @__PURE__ */ __name((verbosity) => {
|
|
@@ -64252,8 +64242,8 @@ var require_src3 = __commonJS({
|
|
|
64252
64242
|
throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead");
|
|
64253
64243
|
}, "load");
|
|
64254
64244
|
exports2.load = load;
|
|
64255
|
-
var setLogger = /* @__PURE__ */ __name((
|
|
64256
|
-
logging.setLogger(
|
|
64245
|
+
var setLogger = /* @__PURE__ */ __name((logger24) => {
|
|
64246
|
+
logging.setLogger(logger24);
|
|
64257
64247
|
}, "setLogger");
|
|
64258
64248
|
exports2.setLogger = setLogger;
|
|
64259
64249
|
var setLogVerbosity = /* @__PURE__ */ __name((verbosity) => {
|
|
@@ -94114,12 +94104,12 @@ var require_ComponentLogger = __commonJS({
|
|
|
94114
94104
|
};
|
|
94115
94105
|
exports2.DiagComponentLogger = DiagComponentLogger;
|
|
94116
94106
|
function logProxy(funcName, namespace, args2) {
|
|
94117
|
-
const
|
|
94118
|
-
if (!
|
|
94107
|
+
const logger24 = (0, global_utils_1.getGlobal)("diag");
|
|
94108
|
+
if (!logger24) {
|
|
94119
94109
|
return;
|
|
94120
94110
|
}
|
|
94121
94111
|
args2.unshift(namespace);
|
|
94122
|
-
return
|
|
94112
|
+
return logger24[funcName](...args2);
|
|
94123
94113
|
}
|
|
94124
94114
|
__name(logProxy, "logProxy");
|
|
94125
94115
|
}
|
|
@@ -94155,17 +94145,17 @@ var require_logLevelLogger = __commonJS({
|
|
|
94155
94145
|
});
|
|
94156
94146
|
exports2.createLogLevelDiagLogger = void 0;
|
|
94157
94147
|
var types_1 = require_types3();
|
|
94158
|
-
function createLogLevelDiagLogger(maxLevel,
|
|
94148
|
+
function createLogLevelDiagLogger(maxLevel, logger24) {
|
|
94159
94149
|
if (maxLevel < types_1.DiagLogLevel.NONE) {
|
|
94160
94150
|
maxLevel = types_1.DiagLogLevel.NONE;
|
|
94161
94151
|
} else if (maxLevel > types_1.DiagLogLevel.ALL) {
|
|
94162
94152
|
maxLevel = types_1.DiagLogLevel.ALL;
|
|
94163
94153
|
}
|
|
94164
|
-
|
|
94154
|
+
logger24 = logger24 || {};
|
|
94165
94155
|
function _filterFunc(funcName, theLevel) {
|
|
94166
|
-
const theFunc =
|
|
94156
|
+
const theFunc = logger24[funcName];
|
|
94167
94157
|
if (typeof theFunc === "function" && maxLevel >= theLevel) {
|
|
94168
|
-
return theFunc.bind(
|
|
94158
|
+
return theFunc.bind(logger24);
|
|
94169
94159
|
}
|
|
94170
94160
|
return function() {
|
|
94171
94161
|
};
|
|
@@ -94208,18 +94198,18 @@ var require_diag = __commonJS({
|
|
|
94208
94198
|
constructor() {
|
|
94209
94199
|
function _logProxy(funcName) {
|
|
94210
94200
|
return function(...args2) {
|
|
94211
|
-
const
|
|
94212
|
-
if (!
|
|
94213
|
-
return
|
|
94201
|
+
const logger24 = (0, global_utils_1.getGlobal)("diag");
|
|
94202
|
+
if (!logger24) return;
|
|
94203
|
+
return logger24[funcName](...args2);
|
|
94214
94204
|
};
|
|
94215
94205
|
}
|
|
94216
94206
|
__name(_logProxy, "_logProxy");
|
|
94217
94207
|
const self2 = this;
|
|
94218
|
-
const setLogger = /* @__PURE__ */ __name((
|
|
94208
|
+
const setLogger = /* @__PURE__ */ __name((logger24, optionsOrLogLevel = {
|
|
94219
94209
|
logLevel: types_1.DiagLogLevel.INFO
|
|
94220
94210
|
}) => {
|
|
94221
94211
|
var _a19, _b17, _c;
|
|
94222
|
-
if (
|
|
94212
|
+
if (logger24 === self2) {
|
|
94223
94213
|
const err2 = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
|
|
94224
94214
|
self2.error((_a19 = err2.stack) !== null && _a19 !== void 0 ? _a19 : err2.message);
|
|
94225
94215
|
return false;
|
|
@@ -94230,7 +94220,7 @@ var require_diag = __commonJS({
|
|
|
94230
94220
|
};
|
|
94231
94221
|
}
|
|
94232
94222
|
const oldLogger = (0, global_utils_1.getGlobal)("diag");
|
|
94233
|
-
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, logger24);
|
|
94234
94224
|
if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
|
|
94235
94225
|
const stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
|
|
94236
94226
|
oldLogger.warn(`Current logger will be overwritten from ${stack}`);
|
|
@@ -124642,9 +124632,7 @@ var manage_schema_exports = /* @__PURE__ */ __exportAll({
|
|
|
124642
124632
|
subAgentsRelations: /* @__PURE__ */ __name(() => subAgentsRelations, "subAgentsRelations"),
|
|
124643
124633
|
tools: /* @__PURE__ */ __name(() => tools, "tools"),
|
|
124644
124634
|
toolsRelations: /* @__PURE__ */ __name(() => toolsRelations, "toolsRelations"),
|
|
124645
|
-
triggers: /* @__PURE__ */ __name(() => triggers, "triggers")
|
|
124646
|
-
workAppConfigs: /* @__PURE__ */ __name(() => workAppConfigs, "workAppConfigs"),
|
|
124647
|
-
workAppConfigsRelations: /* @__PURE__ */ __name(() => workAppConfigsRelations, "workAppConfigsRelations")
|
|
124635
|
+
triggers: /* @__PURE__ */ __name(() => triggers, "triggers")
|
|
124648
124636
|
});
|
|
124649
124637
|
var tenantScoped = {
|
|
124650
124638
|
tenantId: varchar("tenant_id", {
|
|
@@ -126160,58 +126148,6 @@ var datasetRunConfigAgentRelations = pgTable("dataset_run_config_agent_relations
|
|
|
126160
126148
|
name: "dataset_run_config_agent_relations_agent_fk"
|
|
126161
126149
|
}).onDelete("cascade")
|
|
126162
126150
|
]);
|
|
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
|
-
}));
|
|
126215
126151
|
|
|
126216
126152
|
// ../packages/agents-core/dist/auth/auth-schema.js
|
|
126217
126153
|
var user = pgTable("user", {
|
|
@@ -126446,11 +126382,7 @@ var runtime_schema_exports = /* @__PURE__ */ __exportAll({
|
|
|
126446
126382
|
workAppGitHubProjectRepositoryAccess: /* @__PURE__ */ __name(() => workAppGitHubProjectRepositoryAccess, "workAppGitHubProjectRepositoryAccess"),
|
|
126447
126383
|
workAppGitHubProjectRepositoryAccessRelations: /* @__PURE__ */ __name(() => workAppGitHubProjectRepositoryAccessRelations, "workAppGitHubProjectRepositoryAccessRelations"),
|
|
126448
126384
|
workAppGitHubRepositories: /* @__PURE__ */ __name(() => workAppGitHubRepositories, "workAppGitHubRepositories"),
|
|
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")
|
|
126385
|
+
workAppGitHubRepositoriesRelations: /* @__PURE__ */ __name(() => workAppGitHubRepositoriesRelations, "workAppGitHubRepositoriesRelations")
|
|
126454
126386
|
});
|
|
126455
126387
|
var tenantScoped2 = {
|
|
126456
126388
|
tenantId: varchar("tenant_id", {
|
|
@@ -126635,162 +126567,6 @@ var triggerInvocations = pgTable("trigger_invocations", {
|
|
|
126635
126567
|
index("trigger_invocations_trigger_idx").on(table.triggerId, table.createdAt),
|
|
126636
126568
|
index("trigger_invocations_status_idx").on(table.triggerId, table.status)
|
|
126637
126569
|
]);
|
|
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
|
-
]);
|
|
126794
126570
|
var messages = pgTable("messages", {
|
|
126795
126571
|
...projectScoped2,
|
|
126796
126572
|
conversationId: varchar("conversation_id", {
|
|
@@ -143261,7 +143037,7 @@ var MAX_ID_LENGTH = 255;
|
|
|
143261
143037
|
var URL_SAFE_ID_PATTERN = /^[a-zA-Z0-9\-_.]+$/;
|
|
143262
143038
|
var ResourceIdSchema = external_exports.string().min(MIN_ID_LENGTH).max(MAX_ID_LENGTH).regex(URL_SAFE_ID_PATTERN, {
|
|
143263
143039
|
message: "ID must contain only letters, numbers, hyphens, underscores, and dots"
|
|
143264
|
-
}).openapi({
|
|
143040
|
+
}).refine((value) => value !== "new", 'Must not use a reserved name "new"').openapi({
|
|
143265
143041
|
description: "Resource identifier",
|
|
143266
143042
|
example: "resource_789"
|
|
143267
143043
|
});
|
|
@@ -144871,77 +144647,6 @@ var WorkAppGitHubAccessGetResponseSchema = external_exports.object({
|
|
|
144871
144647
|
mode: WorkAppGitHubAccessModeSchema,
|
|
144872
144648
|
repositories: external_exports.array(WorkAppGitHubRepositorySelectSchema)
|
|
144873
144649
|
});
|
|
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");
|
|
144945
144650
|
|
|
144946
144651
|
// ../packages/agents-core/dist/utils/colors.js
|
|
144947
144652
|
var import_iwanthue = __toESM(require_iwanthue(), 1);
|
|
@@ -145085,7 +144790,7 @@ crypto2 = globalThis.crypto?.webcrypto ?? // Node.js [18-16] REPL
|
|
|
145085
144790
|
globalThis.crypto ?? // Node.js >18
|
|
145086
144791
|
import("node:crypto").then((m4) => m4.webcrypto);
|
|
145087
144792
|
|
|
145088
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
144793
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.1_zod@4.2.1/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
145089
144794
|
var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
145090
144795
|
var JSONRPC_VERSION = "2.0";
|
|
145091
144796
|
var AssertObjectSchema = custom((v3) => v3 !== null && (typeof v3 === "object" || typeof v3 === "function"));
|
|
@@ -146671,7 +146376,7 @@ var ServerResultSchema = union2([
|
|
|
146671
146376
|
CreateTaskResultSchema
|
|
146672
146377
|
]);
|
|
146673
146378
|
|
|
146674
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
146379
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.1_zod@4.2.1/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
|
|
146675
146380
|
var SafeUrlSchema = url().superRefine((val, ctx) => {
|
|
146676
146381
|
if (!URL.canParse(val)) {
|
|
146677
146382
|
ctx.addIssue({
|
|
@@ -146816,7 +146521,7 @@ var OAuthTokenRevocationRequestSchema = object({
|
|
|
146816
146521
|
token_type_hint: string2().optional()
|
|
146817
146522
|
}).strip();
|
|
146818
146523
|
|
|
146819
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
146524
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.1_zod@4.2.1/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/errors.js
|
|
146820
146525
|
var OAuthError = class extends Error {
|
|
146821
146526
|
static {
|
|
146822
146527
|
__name(this, "OAuthError");
|
|
@@ -147281,12 +146986,12 @@ var LoggerFactory = class {
|
|
|
147281
146986
|
if (!logger$12) throw new Error(`Logger '${name18}' not found in cache`);
|
|
147282
146987
|
return logger$12;
|
|
147283
146988
|
}
|
|
147284
|
-
let
|
|
147285
|
-
if (this.config.loggerFactory)
|
|
147286
|
-
else if (this.config.defaultLogger)
|
|
147287
|
-
else
|
|
147288
|
-
this.loggers.set(name18,
|
|
147289
|
-
return
|
|
146989
|
+
let logger24;
|
|
146990
|
+
if (this.config.loggerFactory) logger24 = this.config.loggerFactory(name18);
|
|
146991
|
+
else if (this.config.defaultLogger) logger24 = this.config.defaultLogger;
|
|
146992
|
+
else logger24 = new PinoLogger(name18, this.config.pinoConfig);
|
|
146993
|
+
this.loggers.set(name18, logger24);
|
|
146994
|
+
return logger24;
|
|
147290
146995
|
}
|
|
147291
146996
|
/**
|
|
147292
146997
|
* Reset factory to default state
|
|
@@ -179552,7 +179257,7 @@ var PglitePreparedQuery = class extends PgPreparedQuery {
|
|
|
179552
179257
|
static {
|
|
179553
179258
|
__name(this, "PglitePreparedQuery");
|
|
179554
179259
|
}
|
|
179555
|
-
constructor(client, queryString, params,
|
|
179260
|
+
constructor(client, queryString, params, logger24, cache, queryMetadata, cacheConfig, fields, name18, _isResponseInArrayMode, customResultMapper) {
|
|
179556
179261
|
super({
|
|
179557
179262
|
sql: queryString,
|
|
179558
179263
|
params
|
|
@@ -179560,7 +179265,7 @@ var PglitePreparedQuery = class extends PgPreparedQuery {
|
|
|
179560
179265
|
this.client = client;
|
|
179561
179266
|
this.queryString = queryString;
|
|
179562
179267
|
this.params = params;
|
|
179563
|
-
this.logger =
|
|
179268
|
+
this.logger = logger24;
|
|
179564
179269
|
this.fields = fields;
|
|
179565
179270
|
this._isResponseInArrayMode = _isResponseInArrayMode;
|
|
179566
179271
|
this.customResultMapper = customResultMapper;
|
|
@@ -179713,11 +179418,11 @@ function construct(client, config3 = {}) {
|
|
|
179713
179418
|
const dialect = new PgDialect({
|
|
179714
179419
|
casing: config3.casing
|
|
179715
179420
|
});
|
|
179716
|
-
let
|
|
179421
|
+
let logger24;
|
|
179717
179422
|
if (config3.logger === true) {
|
|
179718
|
-
|
|
179423
|
+
logger24 = new DefaultLogger();
|
|
179719
179424
|
} else if (config3.logger !== false) {
|
|
179720
|
-
|
|
179425
|
+
logger24 = config3.logger;
|
|
179721
179426
|
}
|
|
179722
179427
|
let schema;
|
|
179723
179428
|
if (config3.schema) {
|
|
@@ -179729,7 +179434,7 @@ function construct(client, config3 = {}) {
|
|
|
179729
179434
|
};
|
|
179730
179435
|
}
|
|
179731
179436
|
const driver = new PgliteDriver(client, dialect, {
|
|
179732
|
-
logger:
|
|
179437
|
+
logger: logger24,
|
|
179733
179438
|
cache: config3.cache
|
|
179734
179439
|
});
|
|
179735
179440
|
const session2 = driver.createSession(schema);
|
|
@@ -179798,7 +179503,7 @@ var NodePgPreparedQuery = class extends PgPreparedQuery {
|
|
|
179798
179503
|
static {
|
|
179799
179504
|
__name(this, "NodePgPreparedQuery");
|
|
179800
179505
|
}
|
|
179801
|
-
constructor(client, queryString, params,
|
|
179506
|
+
constructor(client, queryString, params, logger24, cache, queryMetadata, cacheConfig, fields, name18, _isResponseInArrayMode, customResultMapper) {
|
|
179802
179507
|
super({
|
|
179803
179508
|
sql: queryString,
|
|
179804
179509
|
params
|
|
@@ -179806,7 +179511,7 @@ var NodePgPreparedQuery = class extends PgPreparedQuery {
|
|
|
179806
179511
|
this.client = client;
|
|
179807
179512
|
this.queryString = queryString;
|
|
179808
179513
|
this.params = params;
|
|
179809
|
-
this.logger =
|
|
179514
|
+
this.logger = logger24;
|
|
179810
179515
|
this.fields = fields;
|
|
179811
179516
|
this._isResponseInArrayMode = _isResponseInArrayMode;
|
|
179812
179517
|
this.customResultMapper = customResultMapper;
|
|
@@ -180030,11 +179735,11 @@ function construct2(client, config3 = {}) {
|
|
|
180030
179735
|
const dialect = new PgDialect({
|
|
180031
179736
|
casing: config3.casing
|
|
180032
179737
|
});
|
|
180033
|
-
let
|
|
179738
|
+
let logger24;
|
|
180034
179739
|
if (config3.logger === true) {
|
|
180035
|
-
|
|
179740
|
+
logger24 = new DefaultLogger();
|
|
180036
179741
|
} else if (config3.logger !== false) {
|
|
180037
|
-
|
|
179742
|
+
logger24 = config3.logger;
|
|
180038
179743
|
}
|
|
180039
179744
|
let schema;
|
|
180040
179745
|
if (config3.schema) {
|
|
@@ -180046,7 +179751,7 @@ function construct2(client, config3 = {}) {
|
|
|
180046
179751
|
};
|
|
180047
179752
|
}
|
|
180048
179753
|
const driver = new NodePgDriver(client, dialect, {
|
|
180049
|
-
logger:
|
|
179754
|
+
logger: logger24,
|
|
180050
179755
|
cache: config3.cache
|
|
180051
179756
|
});
|
|
180052
179757
|
const session2 = driver.createSession(schema);
|
|
@@ -182179,11 +181884,11 @@ var parseLogLevel = /* @__PURE__ */ __name((maybeLevel, sourceName, client) => {
|
|
|
182179
181884
|
function noop2() {
|
|
182180
181885
|
}
|
|
182181
181886
|
__name(noop2, "noop");
|
|
182182
|
-
function makeLogFn(fnLevel,
|
|
182183
|
-
if (!
|
|
181887
|
+
function makeLogFn(fnLevel, logger24, logLevel) {
|
|
181888
|
+
if (!logger24 || levelNumbers[fnLevel] > levelNumbers[logLevel]) {
|
|
182184
181889
|
return noop2;
|
|
182185
181890
|
} else {
|
|
182186
|
-
return
|
|
181891
|
+
return logger24[fnLevel].bind(logger24);
|
|
182187
181892
|
}
|
|
182188
181893
|
}
|
|
182189
181894
|
__name(makeLogFn, "makeLogFn");
|
|
@@ -182195,22 +181900,22 @@ var noopLogger = {
|
|
|
182195
181900
|
};
|
|
182196
181901
|
var cachedLoggers = /* @__PURE__ */ new WeakMap();
|
|
182197
181902
|
function loggerFor(client) {
|
|
182198
|
-
const
|
|
181903
|
+
const logger24 = client.logger;
|
|
182199
181904
|
const logLevel = client.logLevel ?? "off";
|
|
182200
|
-
if (!
|
|
181905
|
+
if (!logger24) {
|
|
182201
181906
|
return noopLogger;
|
|
182202
181907
|
}
|
|
182203
|
-
const cachedLogger = cachedLoggers.get(
|
|
181908
|
+
const cachedLogger = cachedLoggers.get(logger24);
|
|
182204
181909
|
if (cachedLogger && cachedLogger[0] === logLevel) {
|
|
182205
181910
|
return cachedLogger[1];
|
|
182206
181911
|
}
|
|
182207
181912
|
const levelLogger = {
|
|
182208
|
-
error: makeLogFn("error",
|
|
182209
|
-
warn: makeLogFn("warn",
|
|
182210
|
-
info: makeLogFn("info",
|
|
182211
|
-
debug: makeLogFn("debug",
|
|
181913
|
+
error: makeLogFn("error", logger24, logLevel),
|
|
181914
|
+
warn: makeLogFn("warn", logger24, logLevel),
|
|
181915
|
+
info: makeLogFn("info", logger24, logLevel),
|
|
181916
|
+
debug: makeLogFn("debug", logger24, logLevel)
|
|
182212
181917
|
};
|
|
182213
|
-
cachedLoggers.set(
|
|
181918
|
+
cachedLoggers.set(logger24, [
|
|
182214
181919
|
logLevel,
|
|
182215
181920
|
levelLogger
|
|
182216
181921
|
]);
|
|
@@ -188449,11 +188154,11 @@ var parseLogLevel2 = /* @__PURE__ */ __name((maybeLevel, sourceName, client) =>
|
|
|
188449
188154
|
function noop3() {
|
|
188450
188155
|
}
|
|
188451
188156
|
__name(noop3, "noop");
|
|
188452
|
-
function makeLogFn2(fnLevel,
|
|
188453
|
-
if (!
|
|
188157
|
+
function makeLogFn2(fnLevel, logger24, logLevel) {
|
|
188158
|
+
if (!logger24 || levelNumbers2[fnLevel] > levelNumbers2[logLevel]) {
|
|
188454
188159
|
return noop3;
|
|
188455
188160
|
} else {
|
|
188456
|
-
return
|
|
188161
|
+
return logger24[fnLevel].bind(logger24);
|
|
188457
188162
|
}
|
|
188458
188163
|
}
|
|
188459
188164
|
__name(makeLogFn2, "makeLogFn");
|
|
@@ -188465,22 +188170,22 @@ var noopLogger2 = {
|
|
|
188465
188170
|
};
|
|
188466
188171
|
var cachedLoggers2 = /* @__PURE__ */ new WeakMap();
|
|
188467
188172
|
function loggerFor2(client) {
|
|
188468
|
-
const
|
|
188173
|
+
const logger24 = client.logger;
|
|
188469
188174
|
const logLevel = client.logLevel ?? "off";
|
|
188470
|
-
if (!
|
|
188175
|
+
if (!logger24) {
|
|
188471
188176
|
return noopLogger2;
|
|
188472
188177
|
}
|
|
188473
|
-
const cachedLogger = cachedLoggers2.get(
|
|
188178
|
+
const cachedLogger = cachedLoggers2.get(logger24);
|
|
188474
188179
|
if (cachedLogger && cachedLogger[0] === logLevel) {
|
|
188475
188180
|
return cachedLogger[1];
|
|
188476
188181
|
}
|
|
188477
188182
|
const levelLogger = {
|
|
188478
|
-
error: makeLogFn2("error",
|
|
188479
|
-
warn: makeLogFn2("warn",
|
|
188480
|
-
info: makeLogFn2("info",
|
|
188481
|
-
debug: makeLogFn2("debug",
|
|
188183
|
+
error: makeLogFn2("error", logger24, logLevel),
|
|
188184
|
+
warn: makeLogFn2("warn", logger24, logLevel),
|
|
188185
|
+
info: makeLogFn2("info", logger24, logLevel),
|
|
188186
|
+
debug: makeLogFn2("debug", logger24, logLevel)
|
|
188482
188187
|
};
|
|
188483
|
-
cachedLoggers2.set(
|
|
188188
|
+
cachedLoggers2.set(logger24, [
|
|
188484
188189
|
logLevel,
|
|
188485
188190
|
levelLogger
|
|
188486
188191
|
]);
|
|
@@ -188525,7 +188230,7 @@ var Stream = class _Stream {
|
|
|
188525
188230
|
}
|
|
188526
188231
|
static fromSSEResponse(response, controller, client) {
|
|
188527
188232
|
let consumed = false;
|
|
188528
|
-
const
|
|
188233
|
+
const logger24 = client ? loggerFor2(client) : console;
|
|
188529
188234
|
async function* iterator2() {
|
|
188530
188235
|
if (consumed) {
|
|
188531
188236
|
throw new OpenAIError("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");
|
|
@@ -188544,8 +188249,8 @@ var Stream = class _Stream {
|
|
|
188544
188249
|
try {
|
|
188545
188250
|
data = JSON.parse(sse.data);
|
|
188546
188251
|
} catch (e) {
|
|
188547
|
-
|
|
188548
|
-
|
|
188252
|
+
logger24.error(`Could not parse message into JSON:`, sse.data);
|
|
188253
|
+
logger24.error(`From chunk:`, sse.raw);
|
|
188549
188254
|
throw e;
|
|
188550
188255
|
}
|
|
188551
188256
|
if (data && data.error) {
|
|
@@ -197276,7 +196981,7 @@ var logger13 = getLogger("JsonTransformer");
|
|
|
197276
196981
|
// ../packages/agents-core/dist/utils/json-parser.js
|
|
197277
196982
|
var import_traverse = __toESM(require_traverse(), 1);
|
|
197278
196983
|
|
|
197279
|
-
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.
|
|
196984
|
+
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.25.3_hono@4.11.1_zod@4.2.1/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
|
|
197280
196985
|
var import_ajv2 = __toESM(require_ajv(), 1);
|
|
197281
196986
|
var import_ajv_formats = __toESM(require_dist3(), 1);
|
|
197282
196987
|
|
|
@@ -201261,12 +200966,12 @@ var logWarnings = /* @__PURE__ */ __name((options) => {
|
|
|
201261
200966
|
if (options.warnings.length === 0) {
|
|
201262
200967
|
return;
|
|
201263
200968
|
}
|
|
201264
|
-
const
|
|
201265
|
-
if (
|
|
200969
|
+
const logger24 = globalThis.AI_SDK_LOG_WARNINGS;
|
|
200970
|
+
if (logger24 === false) {
|
|
201266
200971
|
return;
|
|
201267
200972
|
}
|
|
201268
|
-
if (typeof
|
|
201269
|
-
|
|
200973
|
+
if (typeof logger24 === "function") {
|
|
200974
|
+
logger24(options);
|
|
201270
200975
|
return;
|
|
201271
200976
|
}
|
|
201272
200977
|
if (!hasLoggedBefore) {
|
|
@@ -227931,116 +227636,11 @@ var ModelFactory = class ModelFactory2 {
|
|
|
227931
227636
|
// ../packages/agents-core/dist/utils/service-token-auth.js
|
|
227932
227637
|
var logger15 = getLogger("service-token-auth");
|
|
227933
227638
|
|
|
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
|
-
|
|
228039
227639
|
// ../packages/agents-core/dist/utils/third-party-mcp-servers/composio-client.js
|
|
228040
227640
|
var logger$1 = getLogger("composio-client");
|
|
228041
227641
|
|
|
228042
227642
|
// ../packages/agents-core/dist/utils/third-party-mcp-servers/third-party-check.js
|
|
228043
|
-
var
|
|
227643
|
+
var logger16 = getLogger("third-party-check");
|
|
228044
227644
|
|
|
228045
227645
|
// ../packages/agents-core/dist/utils/trigger-auth.js
|
|
228046
227646
|
var import_node_crypto7 = require("node:crypto");
|
|
@@ -228048,10 +227648,10 @@ var import_node_util3 = require("node:util");
|
|
|
228048
227648
|
var scryptAsync2 = (0, import_node_util3.promisify)(import_node_crypto7.scrypt);
|
|
228049
227649
|
|
|
228050
227650
|
// ../packages/agents-core/dist/utils/tracer-factory.js
|
|
228051
|
-
var
|
|
227651
|
+
var logger17 = getLogger("tracer");
|
|
228052
227652
|
|
|
228053
227653
|
// ../packages/agents-core/dist/data-access/manage/tools.js
|
|
228054
|
-
var
|
|
227654
|
+
var logger18 = getLogger("tools");
|
|
228055
227655
|
var listTools = /* @__PURE__ */ __name((db) => async (params) => {
|
|
228056
227656
|
const page = params.pagination?.page || 1;
|
|
228057
227657
|
const limit3 = Math.min(params.pagination?.limit || 10, 100);
|
|
@@ -228506,10 +228106,10 @@ var defaultLogger = {
|
|
|
228506
228106
|
error: /* @__PURE__ */ __name(() => {
|
|
228507
228107
|
}, "error")
|
|
228508
228108
|
};
|
|
228509
|
-
var getFullAgent = /* @__PURE__ */ __name((db,
|
|
228109
|
+
var getFullAgent = /* @__PURE__ */ __name((db, logger24 = defaultLogger) => async (params) => {
|
|
228510
228110
|
const { scopes } = params;
|
|
228511
228111
|
const { tenantId, projectId } = scopes;
|
|
228512
|
-
|
|
228112
|
+
logger24.info({
|
|
228513
228113
|
tenantId,
|
|
228514
228114
|
agentId: scopes.agentId
|
|
228515
228115
|
}, "Retrieving full agent definition");
|
|
@@ -228522,20 +228122,20 @@ var getFullAgent = /* @__PURE__ */ __name((db, logger26 = defaultLogger) => asyn
|
|
|
228522
228122
|
}
|
|
228523
228123
|
});
|
|
228524
228124
|
if (!agent) {
|
|
228525
|
-
|
|
228125
|
+
logger24.info({
|
|
228526
228126
|
tenantId,
|
|
228527
228127
|
agentId: scopes.agentId
|
|
228528
228128
|
}, "Agent not found");
|
|
228529
228129
|
return null;
|
|
228530
228130
|
}
|
|
228531
|
-
|
|
228131
|
+
logger24.info({
|
|
228532
228132
|
tenantId,
|
|
228533
228133
|
agentId: scopes.agentId,
|
|
228534
228134
|
agentCount: Object.keys(agent.subAgents).length
|
|
228535
228135
|
}, "Full agent retrieved successfully");
|
|
228536
228136
|
return agent;
|
|
228537
228137
|
} catch (error46) {
|
|
228538
|
-
|
|
228138
|
+
logger24.error({
|
|
228539
228139
|
tenantId,
|
|
228540
228140
|
agentId: scopes.agentId,
|
|
228541
228141
|
error: error46 instanceof Error ? error46.message : "Unknown error"
|
|
@@ -228701,11 +228301,11 @@ var filterConversationsForJob = /* @__PURE__ */ __name((db) => async (params) =>
|
|
|
228701
228301
|
loadEnvironmentFiles();
|
|
228702
228302
|
|
|
228703
228303
|
// ../packages/agents-core/dist/dolt/ref-middleware.js
|
|
228704
|
-
var
|
|
228304
|
+
var logger19 = getLogger("ref-middleware");
|
|
228705
228305
|
|
|
228706
228306
|
// ../packages/agents-core/dist/dolt/ref-scope.js
|
|
228707
228307
|
var import_node_async_hooks2 = require("node:async_hooks");
|
|
228708
|
-
var
|
|
228308
|
+
var logger20 = getLogger("ref-scope");
|
|
228709
228309
|
var refScopeStorage = new import_node_async_hooks2.AsyncLocalStorage();
|
|
228710
228310
|
var NestedRefScopeError = class extends Error {
|
|
228711
228311
|
static {
|
|
@@ -228723,7 +228323,7 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228723
228323
|
const existingScope = refScopeStorage.getStore();
|
|
228724
228324
|
if (existingScope) {
|
|
228725
228325
|
if (existingScope.ref === resolvedRef.name) {
|
|
228726
|
-
|
|
228326
|
+
logger20.debug({
|
|
228727
228327
|
ref: resolvedRef.name,
|
|
228728
228328
|
existingConnectionId: existingScope.connectionId
|
|
228729
228329
|
}, "Reusing existing ref scope");
|
|
@@ -228746,7 +228346,7 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228746
228346
|
connection$1.release();
|
|
228747
228347
|
}
|
|
228748
228348
|
}
|
|
228749
|
-
|
|
228349
|
+
logger20.debug({
|
|
228750
228350
|
ref: resolvedRef.name,
|
|
228751
228351
|
refType: resolvedRef.type,
|
|
228752
228352
|
connectionId
|
|
@@ -228758,7 +228358,7 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228758
228358
|
schema: manage_schema_exports
|
|
228759
228359
|
});
|
|
228760
228360
|
if (resolvedRef.type === "branch") {
|
|
228761
|
-
|
|
228361
|
+
logger20.debug({
|
|
228762
228362
|
branch: resolvedRef.name,
|
|
228763
228363
|
connectionId
|
|
228764
228364
|
}, "Checking out branch");
|
|
@@ -228768,7 +228368,7 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228768
228368
|
});
|
|
228769
228369
|
} else {
|
|
228770
228370
|
tempBranch = `temp_${resolvedRef.type}_${Date.now()}_${generateId()}`;
|
|
228771
|
-
|
|
228371
|
+
logger20.debug({
|
|
228772
228372
|
tempBranch,
|
|
228773
228373
|
hash: resolvedRef.hash,
|
|
228774
228374
|
refType: resolvedRef.type,
|
|
@@ -228786,7 +228386,7 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228786
228386
|
}, () => dataAccessFn(db));
|
|
228787
228387
|
if (commit && resolvedRef.type === "branch") try {
|
|
228788
228388
|
if ((await doltStatus(db)()).length > 0) {
|
|
228789
|
-
|
|
228389
|
+
logger20.info({
|
|
228790
228390
|
branch: resolvedRef.name,
|
|
228791
228391
|
message: commitMessage,
|
|
228792
228392
|
connectionId
|
|
@@ -228798,19 +228398,19 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228798
228398
|
email: "api@inkeep.com"
|
|
228799
228399
|
}
|
|
228800
228400
|
});
|
|
228801
|
-
|
|
228401
|
+
logger20.info({
|
|
228802
228402
|
branch: resolvedRef.name,
|
|
228803
228403
|
connectionId
|
|
228804
228404
|
}, "Successfully committed changes");
|
|
228805
228405
|
}
|
|
228806
228406
|
} catch (commitError) {
|
|
228807
|
-
|
|
228407
|
+
logger20.error({
|
|
228808
228408
|
error: commitError,
|
|
228809
228409
|
branch: resolvedRef.name,
|
|
228810
228410
|
connectionId
|
|
228811
228411
|
}, "Failed to auto-commit changes");
|
|
228812
228412
|
}
|
|
228813
|
-
|
|
228413
|
+
logger20.debug({
|
|
228814
228414
|
ref: resolvedRef.name,
|
|
228815
228415
|
duration: Date.now() - startTime,
|
|
228816
228416
|
connectionId
|
|
@@ -228823,19 +228423,19 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228823
228423
|
});
|
|
228824
228424
|
if ((await doltStatus(db)()).length > 0) {
|
|
228825
228425
|
await doltReset(db)();
|
|
228826
|
-
|
|
228426
|
+
logger20.info({
|
|
228827
228427
|
branch: resolvedRef.name,
|
|
228828
228428
|
connectionId
|
|
228829
228429
|
}, "Reset uncommitted changes due to failed operation");
|
|
228830
228430
|
}
|
|
228831
228431
|
} catch (resetError) {
|
|
228832
|
-
|
|
228432
|
+
logger20.error({
|
|
228833
228433
|
error: resetError,
|
|
228834
228434
|
branch: resolvedRef.name,
|
|
228835
228435
|
connectionId
|
|
228836
228436
|
}, "Failed to reset changes after error");
|
|
228837
228437
|
}
|
|
228838
|
-
|
|
228438
|
+
logger20.error({
|
|
228839
228439
|
ref: resolvedRef.name,
|
|
228840
228440
|
duration: Date.now() - startTime,
|
|
228841
228441
|
connectionId,
|
|
@@ -228846,7 +228446,7 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228846
228446
|
try {
|
|
228847
228447
|
await connection.query(`SELECT DOLT_CHECKOUT('main')`);
|
|
228848
228448
|
if (tempBranch) {
|
|
228849
|
-
|
|
228449
|
+
logger20.debug({
|
|
228850
228450
|
tempBranch,
|
|
228851
228451
|
connectionId
|
|
228852
228452
|
}, "Deleting temporary branch");
|
|
@@ -228855,14 +228455,14 @@ async function withRef(pool2, resolvedRef, dataAccessFn, options) {
|
|
|
228855
228455
|
]);
|
|
228856
228456
|
}
|
|
228857
228457
|
} catch (cleanupError) {
|
|
228858
|
-
|
|
228458
|
+
logger20.error({
|
|
228859
228459
|
error: cleanupError,
|
|
228860
228460
|
tempBranch,
|
|
228861
228461
|
connectionId
|
|
228862
228462
|
}, "Error during ref scope cleanup");
|
|
228863
228463
|
} finally {
|
|
228864
228464
|
connection.release();
|
|
228865
|
-
|
|
228465
|
+
logger20.debug({
|
|
228866
228466
|
ref: resolvedRef.name,
|
|
228867
228467
|
duration: Date.now() - startTime,
|
|
228868
228468
|
connectionId
|
|
@@ -228977,10 +228577,10 @@ var runDbClient = createAgentsRunDatabaseClient({
|
|
|
228977
228577
|
var runDbClient_default = runDbClient;
|
|
228978
228578
|
|
|
228979
228579
|
// src/domains/evals/services/EvaluationService.ts
|
|
228980
|
-
var
|
|
228580
|
+
var logger21 = getLogger("EvaluationService");
|
|
228981
228581
|
function jsonSchemaToZod3(jsonSchema3) {
|
|
228982
228582
|
if (!jsonSchema3 || typeof jsonSchema3 !== "object") {
|
|
228983
|
-
|
|
228583
|
+
logger21.warn({
|
|
228984
228584
|
jsonSchema: jsonSchema3
|
|
228985
228585
|
}, "Invalid JSON schema provided, using string fallback");
|
|
228986
228586
|
return external_exports.string();
|
|
@@ -229019,7 +228619,7 @@ function jsonSchemaToZod3(jsonSchema3) {
|
|
|
229019
228619
|
case "null":
|
|
229020
228620
|
return external_exports.null();
|
|
229021
228621
|
default:
|
|
229022
|
-
|
|
228622
|
+
logger21.warn({
|
|
229023
228623
|
unsupportedType: jsonSchema3.type,
|
|
229024
228624
|
schema: jsonSchema3
|
|
229025
228625
|
}, "Unsupported JSON schema type, using unknown validation");
|
|
@@ -229076,7 +228676,7 @@ var EvaluationService = class {
|
|
|
229076
228676
|
messages: initialMessages
|
|
229077
228677
|
});
|
|
229078
228678
|
} catch (error46) {
|
|
229079
|
-
|
|
228679
|
+
logger21.error({
|
|
229080
228680
|
error: error46 instanceof Error ? error46.message : String(error46),
|
|
229081
228681
|
datasetItemId: datasetItem2.id
|
|
229082
228682
|
}, "Error running dataset item through chat API");
|
|
@@ -229111,7 +228711,7 @@ var EvaluationService = class {
|
|
|
229111
228711
|
"x-inkeep-dataset-run-id": datasetRunId
|
|
229112
228712
|
}
|
|
229113
228713
|
};
|
|
229114
|
-
|
|
228714
|
+
logger21.info({
|
|
229115
228715
|
tenantId,
|
|
229116
228716
|
projectId,
|
|
229117
228717
|
agentId,
|
|
@@ -229126,7 +228726,7 @@ var EvaluationService = class {
|
|
|
229126
228726
|
});
|
|
229127
228727
|
if (!response.ok) {
|
|
229128
228728
|
const errorText = await response.text();
|
|
229129
|
-
|
|
228729
|
+
logger21.error({
|
|
229130
228730
|
status: response.status,
|
|
229131
228731
|
statusText: response.statusText,
|
|
229132
228732
|
errorText,
|
|
@@ -229139,9 +228739,9 @@ var EvaluationService = class {
|
|
|
229139
228739
|
};
|
|
229140
228740
|
}
|
|
229141
228741
|
const responseText = await response.text();
|
|
229142
|
-
const parseResult = parseSSEResponse(responseText);
|
|
228742
|
+
const parseResult = this.parseSSEResponse(responseText);
|
|
229143
228743
|
if (parseResult.error) {
|
|
229144
|
-
|
|
228744
|
+
logger21.error({
|
|
229145
228745
|
datasetItemId: datasetItem2.id,
|
|
229146
228746
|
conversationId,
|
|
229147
228747
|
errorMessage: parseResult.error
|
|
@@ -229151,7 +228751,7 @@ var EvaluationService = class {
|
|
|
229151
228751
|
error: parseResult.error
|
|
229152
228752
|
};
|
|
229153
228753
|
}
|
|
229154
|
-
|
|
228754
|
+
logger21.info({
|
|
229155
228755
|
datasetItemId: datasetItem2.id,
|
|
229156
228756
|
conversationId,
|
|
229157
228757
|
responseLength: parseResult.text?.length || 0
|
|
@@ -229166,7 +228766,7 @@ var EvaluationService = class {
|
|
|
229166
228766
|
*/
|
|
229167
228767
|
async runDatasetItemWithSimulation(params) {
|
|
229168
228768
|
const { tenantId, projectId, agentId, datasetItem: datasetItem2, datasetRunId, conversationId, apiKey, initialMessages, simulationAgent } = params;
|
|
229169
|
-
|
|
228769
|
+
logger21.info({
|
|
229170
228770
|
tenantId,
|
|
229171
228771
|
projectId,
|
|
229172
228772
|
agentId,
|
|
@@ -229206,7 +228806,7 @@ var EvaluationService = class {
|
|
|
229206
228806
|
while (stepCount < maxSteps) {
|
|
229207
228807
|
try {
|
|
229208
228808
|
const simulationPrompt = this.buildSimulationPrompt(simulationAgent.prompt, conversationHistory);
|
|
229209
|
-
|
|
228809
|
+
logger21.debug({
|
|
229210
228810
|
stepCount,
|
|
229211
228811
|
maxSteps,
|
|
229212
228812
|
conversationHistoryLength: conversationHistory.length
|
|
@@ -229217,7 +228817,7 @@ var EvaluationService = class {
|
|
|
229217
228817
|
});
|
|
229218
228818
|
const nextUserMessage = simulationResponse.text.trim();
|
|
229219
228819
|
if (!nextUserMessage) {
|
|
229220
|
-
|
|
228820
|
+
logger21.warn({
|
|
229221
228821
|
stepCount,
|
|
229222
228822
|
datasetItemId: datasetItem2.id
|
|
229223
228823
|
}, "Simulation agent returned empty message, stopping conversation");
|
|
@@ -229243,7 +228843,7 @@ var EvaluationService = class {
|
|
|
229243
228843
|
]
|
|
229244
228844
|
});
|
|
229245
228845
|
if (agentResponse.error || !agentResponse.response) {
|
|
229246
|
-
|
|
228846
|
+
logger21.warn({
|
|
229247
228847
|
stepCount,
|
|
229248
228848
|
error: agentResponse.error,
|
|
229249
228849
|
datasetItemId: datasetItem2.id
|
|
@@ -229256,7 +228856,7 @@ var EvaluationService = class {
|
|
|
229256
228856
|
});
|
|
229257
228857
|
stepCount++;
|
|
229258
228858
|
} catch (error46) {
|
|
229259
|
-
|
|
228859
|
+
logger21.error({
|
|
229260
228860
|
error: error46 instanceof Error ? error46.message : String(error46),
|
|
229261
228861
|
stepCount,
|
|
229262
228862
|
datasetItemId: datasetItem2.id
|
|
@@ -229264,7 +228864,7 @@ var EvaluationService = class {
|
|
|
229264
228864
|
break;
|
|
229265
228865
|
}
|
|
229266
228866
|
}
|
|
229267
|
-
|
|
228867
|
+
logger21.info({
|
|
229268
228868
|
datasetItemId: datasetItem2.id,
|
|
229269
228869
|
conversationId,
|
|
229270
228870
|
finalStepCount: stepCount,
|
|
@@ -229318,7 +228918,7 @@ Generate the next user message:`;
|
|
|
229318
228918
|
const validMessages = input.messages.map((msg) => {
|
|
229319
228919
|
const mappedRole = roleMap[msg.role.toLowerCase()];
|
|
229320
228920
|
if (!mappedRole) {
|
|
229321
|
-
|
|
228921
|
+
logger21.warn({
|
|
229322
228922
|
datasetItemId: datasetItem2.id,
|
|
229323
228923
|
invalidRole: msg.role
|
|
229324
228924
|
}, "Invalid message role found, skipping message");
|
|
@@ -229330,7 +228930,7 @@ Generate the next user message:`;
|
|
|
229330
228930
|
};
|
|
229331
228931
|
}).filter((msg) => msg !== null);
|
|
229332
228932
|
if (validMessages.length === 0) {
|
|
229333
|
-
|
|
228933
|
+
logger21.warn({
|
|
229334
228934
|
datasetItemId: datasetItem2.id,
|
|
229335
228935
|
totalMessages: input.messages.length
|
|
229336
228936
|
}, "No valid messages found after filtering roles");
|
|
@@ -229345,7 +228945,7 @@ Generate the next user message:`;
|
|
|
229345
228945
|
const validMessages = parsed.messages.map((msg) => {
|
|
229346
228946
|
const mappedRole = roleMap[msg.role?.toLowerCase()];
|
|
229347
228947
|
if (!mappedRole) {
|
|
229348
|
-
|
|
228948
|
+
logger21.warn({
|
|
229349
228949
|
datasetItemId: datasetItem2.id,
|
|
229350
228950
|
invalidRole: msg.role
|
|
229351
228951
|
}, "Invalid message role found in parsed input, skipping message");
|
|
@@ -229370,6 +228970,69 @@ Generate the next user message:`;
|
|
|
229370
228970
|
return null;
|
|
229371
228971
|
}
|
|
229372
228972
|
/**
|
|
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
|
+
/**
|
|
229373
229036
|
* Run an evaluation job based on an evaluation job config
|
|
229374
229037
|
* Filters conversations based on jobFilters and runs evaluations with configured evaluators
|
|
229375
229038
|
*/
|
|
@@ -229380,7 +229043,7 @@ Generate the next user message:`;
|
|
|
229380
229043
|
if (!resolvedRef) {
|
|
229381
229044
|
throw new Error("Failed to resolve ref");
|
|
229382
229045
|
}
|
|
229383
|
-
|
|
229046
|
+
logger21.info({
|
|
229384
229047
|
tenantId,
|
|
229385
229048
|
projectId,
|
|
229386
229049
|
evaluationJobConfigId,
|
|
@@ -229417,7 +229080,7 @@ Generate the next user message:`;
|
|
|
229417
229080
|
if (validEvaluators.length === 0) {
|
|
229418
229081
|
throw new Error(`No valid evaluators found for job config: ${evaluationJobConfigId}`);
|
|
229419
229082
|
}
|
|
229420
|
-
|
|
229083
|
+
logger21.info({
|
|
229421
229084
|
tenantId,
|
|
229422
229085
|
projectId,
|
|
229423
229086
|
evaluationJobConfigId,
|
|
@@ -229433,7 +229096,7 @@ Generate the next user message:`;
|
|
|
229433
229096
|
if (sampleRate !== void 0 && sampleRate !== null) {
|
|
229434
229097
|
const originalCount = conversationsToEvaluate.length;
|
|
229435
229098
|
conversationsToEvaluate = this.applySampleRate(conversationsToEvaluate, sampleRate);
|
|
229436
|
-
|
|
229099
|
+
logger21.info({
|
|
229437
229100
|
tenantId,
|
|
229438
229101
|
projectId,
|
|
229439
229102
|
evaluationJobConfigId,
|
|
@@ -229442,14 +229105,14 @@ Generate the next user message:`;
|
|
|
229442
229105
|
sampleRate
|
|
229443
229106
|
}, "Applied sample rate to conversations");
|
|
229444
229107
|
}
|
|
229445
|
-
|
|
229108
|
+
logger21.info({
|
|
229446
229109
|
tenantId,
|
|
229447
229110
|
projectId,
|
|
229448
229111
|
evaluationJobConfigId,
|
|
229449
229112
|
conversationCount: conversationsToEvaluate.length
|
|
229450
229113
|
}, "Found conversations for evaluation");
|
|
229451
229114
|
if (conversationsToEvaluate.length === 0) {
|
|
229452
|
-
|
|
229115
|
+
logger21.warn({
|
|
229453
229116
|
tenantId,
|
|
229454
229117
|
projectId,
|
|
229455
229118
|
evaluationJobConfigId
|
|
@@ -229466,7 +229129,7 @@ Generate the next user message:`;
|
|
|
229466
229129
|
for (const conversation of conversationsToEvaluate) {
|
|
229467
229130
|
for (const evaluator2 of validEvaluators) {
|
|
229468
229131
|
try {
|
|
229469
|
-
|
|
229132
|
+
logger21.info({
|
|
229470
229133
|
tenantId,
|
|
229471
229134
|
conversationId: conversation.id,
|
|
229472
229135
|
evaluatorId: evaluator2.id
|
|
@@ -229499,14 +229162,14 @@ Generate the next user message:`;
|
|
|
229499
229162
|
if (updatedResult) {
|
|
229500
229163
|
results.push(updatedResult);
|
|
229501
229164
|
}
|
|
229502
|
-
|
|
229165
|
+
logger21.info({
|
|
229503
229166
|
tenantId,
|
|
229504
229167
|
conversationId: conversation.id,
|
|
229505
229168
|
evaluatorId: evaluator2.id,
|
|
229506
229169
|
resultId: evalResult.id
|
|
229507
229170
|
}, "Evaluation completed successfully");
|
|
229508
229171
|
} catch (error46) {
|
|
229509
|
-
|
|
229172
|
+
logger21.error({
|
|
229510
229173
|
error: error46,
|
|
229511
229174
|
tenantId,
|
|
229512
229175
|
conversationId: conversation.id,
|
|
@@ -229531,7 +229194,7 @@ Generate the next user message:`;
|
|
|
229531
229194
|
}
|
|
229532
229195
|
}
|
|
229533
229196
|
} catch (error46) {
|
|
229534
|
-
|
|
229197
|
+
logger21.error({
|
|
229535
229198
|
error: error46 instanceof Error ? error46.message : String(error46),
|
|
229536
229199
|
tenantId,
|
|
229537
229200
|
conversationId: conversation.id,
|
|
@@ -229540,7 +229203,7 @@ Generate the next user message:`;
|
|
|
229540
229203
|
}
|
|
229541
229204
|
}
|
|
229542
229205
|
}
|
|
229543
|
-
|
|
229206
|
+
logger21.info({
|
|
229544
229207
|
tenantId,
|
|
229545
229208
|
projectId,
|
|
229546
229209
|
evaluationJobConfigId,
|
|
@@ -229610,20 +229273,20 @@ Generate the next user message:`;
|
|
|
229610
229273
|
}
|
|
229611
229274
|
}));
|
|
229612
229275
|
} else {
|
|
229613
|
-
|
|
229276
|
+
logger21.warn({
|
|
229614
229277
|
conversationId: conversation.id,
|
|
229615
229278
|
agentId: conversation.agentId
|
|
229616
229279
|
}, "AgentId not found, cannot get agent definition");
|
|
229617
229280
|
}
|
|
229618
229281
|
} catch (error46) {
|
|
229619
|
-
|
|
229282
|
+
logger21.warn({
|
|
229620
229283
|
error: error46,
|
|
229621
229284
|
conversationId: conversation.id,
|
|
229622
229285
|
agentId: conversation.agentId
|
|
229623
229286
|
}, "Failed to fetch agent definition for evaluation");
|
|
229624
229287
|
}
|
|
229625
229288
|
const prettifiedTrace = await this.fetchTraceFromSigNoz(conversation.id);
|
|
229626
|
-
|
|
229289
|
+
logger21.info({
|
|
229627
229290
|
conversationId: conversation.id,
|
|
229628
229291
|
hasTrace: !!prettifiedTrace,
|
|
229629
229292
|
traceActivityCount: prettifiedTrace?.timeline?.length || 0
|
|
@@ -229637,7 +229300,7 @@ Generate the next user message:`;
|
|
|
229637
229300
|
try {
|
|
229638
229301
|
schemaObj = JSON.parse(evaluator2.schema);
|
|
229639
229302
|
} catch (error46) {
|
|
229640
|
-
|
|
229303
|
+
logger21.error({
|
|
229641
229304
|
error: error46,
|
|
229642
229305
|
schemaString: evaluator2.schema
|
|
229643
229306
|
}, "Failed to parse evaluator schema string");
|
|
@@ -229646,7 +229309,7 @@ Generate the next user message:`;
|
|
|
229646
229309
|
} else {
|
|
229647
229310
|
schemaObj = evaluator2.schema;
|
|
229648
229311
|
}
|
|
229649
|
-
|
|
229312
|
+
logger21.info({
|
|
229650
229313
|
evaluatorId: evaluator2.id,
|
|
229651
229314
|
schemaType: typeof schemaObj,
|
|
229652
229315
|
schemaKeys: schemaObj && typeof schemaObj === "object" ? Object.keys(schemaObj) : []
|
|
@@ -229711,13 +229374,13 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229711
229374
|
let resultSchema;
|
|
229712
229375
|
try {
|
|
229713
229376
|
resultSchema = jsonSchemaToZod3(schema);
|
|
229714
|
-
|
|
229377
|
+
logger21.info({
|
|
229715
229378
|
schemaType: typeof schema,
|
|
229716
229379
|
schemaKeys: schema && typeof schema === "object" ? Object.keys(schema) : [],
|
|
229717
229380
|
convertedSchema: "success"
|
|
229718
229381
|
}, "Converted JSON schema to Zod");
|
|
229719
229382
|
} catch (error46) {
|
|
229720
|
-
|
|
229383
|
+
logger21.error({
|
|
229721
229384
|
error: error46,
|
|
229722
229385
|
schema
|
|
229723
229386
|
}, "Failed to convert JSON schema to Zod, using fallback");
|
|
@@ -229725,7 +229388,7 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229725
229388
|
}
|
|
229726
229389
|
const evaluationSchema = resultSchema;
|
|
229727
229390
|
try {
|
|
229728
|
-
|
|
229391
|
+
logger21.info({
|
|
229729
229392
|
promptLength: prompt.length,
|
|
229730
229393
|
model: modelConfig.model
|
|
229731
229394
|
}, "Calling generateObject");
|
|
@@ -229743,7 +229406,7 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229743
229406
|
};
|
|
229744
229407
|
} catch (error46) {
|
|
229745
229408
|
const errorMessage = error46 instanceof Error ? error46.message : String(error46);
|
|
229746
|
-
|
|
229409
|
+
logger21.error({
|
|
229747
229410
|
error: errorMessage,
|
|
229748
229411
|
schema: JSON.stringify(schema, null, 2),
|
|
229749
229412
|
promptPreview: prompt.substring(0, 500)
|
|
@@ -229760,7 +229423,7 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229760
229423
|
const retryDelayMs = 2e4;
|
|
229761
229424
|
const initialDelayMs = 3e4;
|
|
229762
229425
|
try {
|
|
229763
|
-
|
|
229426
|
+
logger21.info({
|
|
229764
229427
|
conversationId,
|
|
229765
229428
|
manageUIUrl,
|
|
229766
229429
|
initialDelayMs
|
|
@@ -229768,21 +229431,21 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229768
229431
|
await new Promise((resolve4) => setTimeout(resolve4, initialDelayMs));
|
|
229769
229432
|
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
229770
229433
|
try {
|
|
229771
|
-
|
|
229434
|
+
logger21.info({
|
|
229772
229435
|
conversationId,
|
|
229773
229436
|
attempt: attempt + 1,
|
|
229774
229437
|
maxRetries: maxRetries + 1
|
|
229775
229438
|
}, "Fetching trace from SigNoz");
|
|
229776
229439
|
const traceResponse = await fetch(`${manageUIUrl}/api/signoz/conversations/${conversationId}`);
|
|
229777
229440
|
if (!traceResponse.ok) {
|
|
229778
|
-
|
|
229441
|
+
logger21.warn({
|
|
229779
229442
|
conversationId,
|
|
229780
229443
|
status: traceResponse.status,
|
|
229781
229444
|
statusText: traceResponse.statusText,
|
|
229782
229445
|
attempt: attempt + 1
|
|
229783
229446
|
}, "Failed to fetch trace from SigNoz");
|
|
229784
229447
|
if (attempt < maxRetries) {
|
|
229785
|
-
|
|
229448
|
+
logger21.info({
|
|
229786
229449
|
conversationId,
|
|
229787
229450
|
retryDelayMs
|
|
229788
229451
|
}, "Retrying trace fetch after delay");
|
|
@@ -229792,34 +229455,34 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229792
229455
|
return null;
|
|
229793
229456
|
}
|
|
229794
229457
|
const conversationDetail = await traceResponse.json();
|
|
229795
|
-
|
|
229458
|
+
logger21.debug({
|
|
229796
229459
|
conversationId,
|
|
229797
229460
|
activityTypes: conversationDetail.activities?.map((a2) => a2.type) || [],
|
|
229798
229461
|
activityCount: conversationDetail.activities?.length || 0
|
|
229799
229462
|
}, "Checking activities for ai_assistant_message type");
|
|
229800
229463
|
const hasAssistantMessage = conversationDetail.activities?.some((activity) => activity.type === "ai_assistant_message");
|
|
229801
229464
|
if (!hasAssistantMessage) {
|
|
229802
|
-
|
|
229465
|
+
logger21.warn({
|
|
229803
229466
|
conversationId,
|
|
229804
229467
|
attempt: attempt + 1,
|
|
229805
229468
|
activityCount: conversationDetail.activities?.length || 0,
|
|
229806
229469
|
activityTypes: conversationDetail.activities?.slice(0, 5).map((a2) => a2.type) || []
|
|
229807
229470
|
}, "Trace fetched but ai_assistant_message not found in activities");
|
|
229808
229471
|
if (attempt < maxRetries) {
|
|
229809
|
-
|
|
229472
|
+
logger21.info({
|
|
229810
229473
|
conversationId,
|
|
229811
229474
|
retryDelayMs
|
|
229812
229475
|
}, "Retrying trace fetch after delay to wait for assistant message");
|
|
229813
229476
|
await new Promise((resolve4) => setTimeout(resolve4, retryDelayMs));
|
|
229814
229477
|
continue;
|
|
229815
229478
|
}
|
|
229816
|
-
|
|
229479
|
+
logger21.warn({
|
|
229817
229480
|
conversationId,
|
|
229818
229481
|
maxRetries,
|
|
229819
229482
|
activityCount: conversationDetail.activities?.length || 0
|
|
229820
229483
|
}, "Max retries reached, ai_assistant_message not found - proceeding with available trace data");
|
|
229821
229484
|
} else {
|
|
229822
|
-
|
|
229485
|
+
logger21.info({
|
|
229823
229486
|
conversationId,
|
|
229824
229487
|
activityCount: conversationDetail.activities?.length || 0,
|
|
229825
229488
|
attempt: attempt + 1
|
|
@@ -229828,13 +229491,13 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229828
229491
|
const prettifiedTrace = this.formatConversationAsPrettifiedTrace(conversationDetail);
|
|
229829
229492
|
return prettifiedTrace;
|
|
229830
229493
|
} catch (fetchError) {
|
|
229831
|
-
|
|
229494
|
+
logger21.warn({
|
|
229832
229495
|
error: fetchError,
|
|
229833
229496
|
conversationId,
|
|
229834
229497
|
attempt: attempt + 1
|
|
229835
229498
|
}, "Error fetching trace from SigNoz");
|
|
229836
229499
|
if (attempt < maxRetries) {
|
|
229837
|
-
|
|
229500
|
+
logger21.info({
|
|
229838
229501
|
conversationId,
|
|
229839
229502
|
retryDelayMs
|
|
229840
229503
|
}, "Retrying trace fetch after delay");
|
|
@@ -229846,7 +229509,7 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229846
229509
|
}
|
|
229847
229510
|
return null;
|
|
229848
229511
|
} catch (error46) {
|
|
229849
|
-
|
|
229512
|
+
logger21.warn({
|
|
229850
229513
|
error: error46,
|
|
229851
229514
|
conversationId,
|
|
229852
229515
|
manageUIUrl
|
|
@@ -229883,7 +229546,7 @@ Return your evaluation as a JSON object matching the schema above.`;
|
|
|
229883
229546
|
};
|
|
229884
229547
|
|
|
229885
229548
|
// src/domains/evals/workflow/functions/evaluateConversation.ts
|
|
229886
|
-
var
|
|
229549
|
+
var logger22 = getLogger("workflow-evaluate-conversation");
|
|
229887
229550
|
async function getConversationStep(payload) {
|
|
229888
229551
|
const { tenantId, projectId, conversationId } = payload;
|
|
229889
229552
|
const conv = await getConversation(runDbClient_default)({
|
|
@@ -229951,7 +229614,7 @@ async function executeEvaluatorStep(payload, evaluatorId, conversation) {
|
|
|
229951
229614
|
output
|
|
229952
229615
|
}
|
|
229953
229616
|
});
|
|
229954
|
-
|
|
229617
|
+
logger22.info({
|
|
229955
229618
|
conversationId,
|
|
229956
229619
|
evaluatorId: evaluator2.id,
|
|
229957
229620
|
resultId: evalResult.id
|
|
@@ -229959,7 +229622,7 @@ async function executeEvaluatorStep(payload, evaluatorId, conversation) {
|
|
|
229959
229622
|
return updated;
|
|
229960
229623
|
} catch (error46) {
|
|
229961
229624
|
const errorMessage = error46 instanceof Error ? error46.message : "Unknown error";
|
|
229962
|
-
|
|
229625
|
+
logger22.error({
|
|
229963
229626
|
error: error46,
|
|
229964
229627
|
conversationId,
|
|
229965
229628
|
evaluatorId: evaluator2.id,
|
|
@@ -229982,7 +229645,7 @@ async function executeEvaluatorStep(payload, evaluatorId, conversation) {
|
|
|
229982
229645
|
}
|
|
229983
229646
|
__name(executeEvaluatorStep, "executeEvaluatorStep");
|
|
229984
229647
|
async function logStep(message, data) {
|
|
229985
|
-
|
|
229648
|
+
logger22.info(data, message);
|
|
229986
229649
|
}
|
|
229987
229650
|
__name(logStep, "logStep");
|
|
229988
229651
|
async function _evaluateConversationWorkflow(payload) {
|
|
@@ -229999,7 +229662,7 @@ registerStepFunction("step//src/domains/evals/workflow/functions/evaluateConvers
|
|
|
229999
229662
|
registerStepFunction("step//src/domains/evals/workflow/functions/evaluateConversation.ts//logStep", logStep);
|
|
230000
229663
|
|
|
230001
229664
|
// src/domains/evals/workflow/functions/runDatasetItem.ts
|
|
230002
|
-
var
|
|
229665
|
+
var logger23 = getLogger("workflow-run-dataset-item");
|
|
230003
229666
|
async function callChatApiStep(payload) {
|
|
230004
229667
|
const { tenantId, projectId, agentId, datasetItemId, datasetItemInput, datasetItemSimulationAgent, datasetRunId } = payload;
|
|
230005
229668
|
const evaluationService = new EvaluationService();
|
|
@@ -230015,7 +229678,7 @@ async function callChatApiStep(payload) {
|
|
|
230015
229678
|
datasetItem: datasetItem2,
|
|
230016
229679
|
datasetRunId
|
|
230017
229680
|
});
|
|
230018
|
-
|
|
229681
|
+
logger23.info({
|
|
230019
229682
|
tenantId,
|
|
230020
229683
|
projectId,
|
|
230021
229684
|
datasetItemId,
|
|
@@ -230038,7 +229701,7 @@ async function createRelationStep(payload, conversationId) {
|
|
|
230038
229701
|
conversationId,
|
|
230039
229702
|
datasetItemId
|
|
230040
229703
|
});
|
|
230041
|
-
|
|
229704
|
+
logger23.info({
|
|
230042
229705
|
tenantId,
|
|
230043
229706
|
projectId,
|
|
230044
229707
|
datasetItemId,
|
|
@@ -230052,7 +229715,7 @@ async function createRelationStep(payload, conversationId) {
|
|
|
230052
229715
|
};
|
|
230053
229716
|
} catch (error46) {
|
|
230054
229717
|
if (error46?.cause?.code === "23503" || error46?.code === "23503") {
|
|
230055
|
-
|
|
229718
|
+
logger23.warn({
|
|
230056
229719
|
tenantId,
|
|
230057
229720
|
projectId,
|
|
230058
229721
|
datasetItemId,
|
|
@@ -230083,7 +229746,7 @@ async function executeEvaluatorStep2(tenantId, projectId, conversationId, evalua
|
|
|
230083
229746
|
}
|
|
230084
229747
|
}));
|
|
230085
229748
|
if (!evaluator2) {
|
|
230086
|
-
|
|
229749
|
+
logger23.warn({
|
|
230087
229750
|
evaluatorId
|
|
230088
229751
|
}, "Evaluator not found");
|
|
230089
229752
|
return null;
|
|
@@ -230125,7 +229788,7 @@ async function executeEvaluatorStep2(tenantId, projectId, conversationId, evalua
|
|
|
230125
229788
|
output
|
|
230126
229789
|
}
|
|
230127
229790
|
});
|
|
230128
|
-
|
|
229791
|
+
logger23.info({
|
|
230129
229792
|
conversationId,
|
|
230130
229793
|
evaluatorId: evaluator2.id,
|
|
230131
229794
|
resultId: evalResult.id
|
|
@@ -230133,7 +229796,7 @@ async function executeEvaluatorStep2(tenantId, projectId, conversationId, evalua
|
|
|
230133
229796
|
return evalResult.id;
|
|
230134
229797
|
} catch (error46) {
|
|
230135
229798
|
const errorMessage = error46 instanceof Error ? error46.message : "Unknown error";
|
|
230136
|
-
|
|
229799
|
+
logger23.error({
|
|
230137
229800
|
error: error46,
|
|
230138
229801
|
conversationId,
|
|
230139
229802
|
evaluatorId: evaluator2.id
|
|
@@ -230155,7 +229818,7 @@ async function executeEvaluatorStep2(tenantId, projectId, conversationId, evalua
|
|
|
230155
229818
|
}
|
|
230156
229819
|
__name(executeEvaluatorStep2, "executeEvaluatorStep");
|
|
230157
229820
|
async function logStep2(message, data) {
|
|
230158
|
-
|
|
229821
|
+
logger23.info(data, message);
|
|
230159
229822
|
}
|
|
230160
229823
|
__name(logStep2, "logStep");
|
|
230161
229824
|
async function _runDatasetItemWorkflow(payload) {
|
|
@@ -230801,7 +230464,7 @@ __name(linkToCurrentContext, "linkToCurrentContext");
|
|
|
230801
230464
|
// ../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
|
|
230802
230465
|
function createLogger(namespace) {
|
|
230803
230466
|
const baseDebug = (0, import_debug2.default)(`workflow:${namespace}`);
|
|
230804
|
-
const
|
|
230467
|
+
const logger24 = /* @__PURE__ */ __name((level) => {
|
|
230805
230468
|
const levelDebug = baseDebug.extend(level);
|
|
230806
230469
|
return (message, metadata2) => {
|
|
230807
230470
|
levelDebug(message, metadata2);
|
|
@@ -230817,10 +230480,10 @@ function createLogger(namespace) {
|
|
|
230817
230480
|
};
|
|
230818
230481
|
}, "logger");
|
|
230819
230482
|
return {
|
|
230820
|
-
debug:
|
|
230821
|
-
info:
|
|
230822
|
-
warn:
|
|
230823
|
-
error:
|
|
230483
|
+
debug: logger24("debug"),
|
|
230484
|
+
info: logger24("info"),
|
|
230485
|
+
warn: logger24("warn"),
|
|
230486
|
+
error: logger24("error")
|
|
230824
230487
|
};
|
|
230825
230488
|
}
|
|
230826
230489
|
__name(createLogger, "createLogger");
|