@sentry/junior 0.124.2 → 0.125.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-hooks-HJQTURNC.js → agent-hooks-MF5UZRCO.js} +8 -8
- package/dist/api/conversations/auxiliary-costs.d.ts +6 -0
- package/dist/api/conversations/detail.d.ts +10 -0
- package/dist/api/conversations/list.d.ts +11 -0
- package/dist/api/conversations/projection.d.ts +2 -1
- package/dist/api/locations/detail.d.ts +20 -0
- package/dist/api/people/profile.d.ts +10 -0
- package/dist/api/people/shared.d.ts +36 -0
- package/dist/api/plugin-reports.d.ts +1 -0
- package/dist/api/schema/conversation.d.ts +40 -0
- package/dist/api/schema/location.d.ts +10 -0
- package/dist/api/schema/person.d.ts +10 -0
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +4 -2
- package/dist/api.js +322 -169
- package/dist/app.js +22 -23
- package/dist/{catalog-runtime-F356WNZS.js → catalog-runtime-V6SJTUV7.js} +5 -5
- package/dist/chat/agent/prompt.d.ts +1 -0
- package/dist/chat/conversations/history.d.ts +4 -2
- package/dist/chat/conversations/sql/conversation-row.d.ts +7 -4
- package/dist/chat/conversations/sql/store.d.ts +2 -1
- package/dist/chat/conversations/store.d.ts +9 -1
- package/dist/chat/pi/client.d.ts +1 -0
- package/dist/chat/plugins/agent-hooks.d.ts +1 -0
- package/dist/chat/plugins/conversation-event-stats.d.ts +3 -0
- package/dist/chat/plugins/conversation-events.d.ts +1 -1
- package/dist/chat/slack/source-link.d.ts +5 -0
- package/dist/chat/source.d.ts +16 -0
- package/dist/{chunk-VMRKIKGO.js → chunk-2R5MASH3.js} +1 -1
- package/dist/{chunk-EOSC6JOC.js → chunk-2U5CLBYF.js} +1 -1
- package/dist/{chunk-AYQZCJZJ.js → chunk-6ZBSTNYN.js} +14 -0
- package/dist/{chunk-CMYDYVOD.js → chunk-7K57FJXR.js} +6 -5
- package/dist/{chunk-SMTAXLX4.js → chunk-CAPBVX4L.js} +2 -2
- package/dist/{chunk-7P7YVJKH.js → chunk-EXD2Z3YR.js} +2 -2
- package/dist/{chunk-SS7MAJF5.js → chunk-HT7DSLKL.js} +16 -14
- package/dist/{chunk-PR3M62LK.js → chunk-HX236W2U.js} +6 -4
- package/dist/{chunk-WKBPFZ25.js → chunk-IHNBJHEP.js} +1 -1
- package/dist/{chunk-DW6SLS5F.js → chunk-IS4DGI5J.js} +73 -17
- package/dist/{chunk-4JW3YNQZ.js → chunk-JT3YMQR3.js} +7 -9
- package/dist/{chunk-L7EZRQ2J.js → chunk-K6MQWEEJ.js} +7 -7
- package/dist/{chunk-574YK7QW.js → chunk-KN7QI56S.js} +23 -3
- package/dist/{chunk-NNKVDYXN.js → chunk-LG5TXWXI.js} +11 -11
- package/dist/{chunk-ASK74NM6.js → chunk-MVYNJECP.js} +1 -1
- package/dist/{chunk-AQKVWIPR.js → chunk-MYKSUTUV.js} +4 -4
- package/dist/{chunk-ZO6E537B.js → chunk-NM3PMQS6.js} +1 -1
- package/dist/{chunk-IXTIJQ7Z.js → chunk-ODB55JM7.js} +162 -15
- package/dist/{chunk-IMLJE2NY.js → chunk-Q3UF3K77.js} +2 -2
- package/dist/{chunk-GCGJGSQL.js → chunk-S4PUICSB.js} +2 -0
- package/dist/{chunk-PE44LDDQ.js → chunk-UTL3MHPC.js} +1 -0
- package/dist/{chunk-KYKLQYSU.js → chunk-XJYGLTYI.js} +1 -1
- package/dist/{chunk-7LDOW4QA.js → chunk-ZXGBLAYQ.js} +1 -1
- package/dist/cli/chat.js +23 -23
- package/dist/cli/check.js +6 -6
- package/dist/cli/plugins.js +11 -11
- package/dist/cli/snapshot-create.js +8 -8
- package/dist/cli/upgrade.js +6 -6
- package/dist/db/schema/conversations.d.ts +20 -0
- package/dist/db/schema.d.ts +19 -0
- package/dist/{db-4SU2HJSV.js → db-JSDSWK7T.js} +6 -6
- package/dist/instrumentation.js +2 -2
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-MMCH5QV6.js → oauth-callback-server-UMS2T3HN.js} +16 -17
- package/dist/reporting-schema.d.ts +2 -0
- package/dist/{runner-ZDSNVGYA.js → runner-RGOANIRV.js} +11 -12
- package/dist/{skills-7G7LBHLK.js → skills-GBLPOQOD.js} +6 -6
- package/dist/{validation-2ETDADPB.js → validation-BMQY6CD4.js} +6 -6
- package/dist/version.js +1 -1
- package/migrations/0013_conversation_session_source.sql +38 -0
- package/migrations/meta/0013_snapshot.json +1250 -0
- package/migrations/meta/_journal.json +8 -1
- package/package.json +6 -6
- package/dist/chunk-BA5KHLPQ.js +0 -55
|
@@ -4,18 +4,18 @@ import {
|
|
|
4
4
|
juniorConversations,
|
|
5
5
|
juniorIdentities,
|
|
6
6
|
juniorUsers
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-S4PUICSB.js";
|
|
8
8
|
import {
|
|
9
9
|
TURN_REASONING_LEVELS,
|
|
10
10
|
getChatConfig,
|
|
11
11
|
modelProfileSchema
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KN7QI56S.js";
|
|
13
13
|
import {
|
|
14
14
|
juniorDestinations
|
|
15
15
|
} from "./chunk-VFUK3X5B.js";
|
|
16
16
|
import {
|
|
17
17
|
normalizeIdentityEmail
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-MVYNJECP.js";
|
|
19
19
|
import {
|
|
20
20
|
parseSlackChannelReferenceId,
|
|
21
21
|
parseSlackTeamId
|
|
@@ -167,6 +167,36 @@ async function upsertIdentity(executor, identity, nowMs = Date.now()) {
|
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
+
// src/chat/source.ts
|
|
171
|
+
import { sourceSchema } from "@sentry/junior-plugin-api";
|
|
172
|
+
function normalizeSessionSource(value) {
|
|
173
|
+
if (!value) {
|
|
174
|
+
return void 0;
|
|
175
|
+
}
|
|
176
|
+
if (value.platform === "local") {
|
|
177
|
+
return {
|
|
178
|
+
platform: "local",
|
|
179
|
+
type: "priv",
|
|
180
|
+
conversationId: value.conversationId
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
const threadTs = value.threadTs?.trim();
|
|
184
|
+
if (!threadTs) {
|
|
185
|
+
return void 0;
|
|
186
|
+
}
|
|
187
|
+
return {
|
|
188
|
+
platform: "slack",
|
|
189
|
+
type: value.type,
|
|
190
|
+
teamId: value.teamId,
|
|
191
|
+
channelId: value.channelId,
|
|
192
|
+
threadTs
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function parseSessionSource(value) {
|
|
196
|
+
const parsed = sourceSchema.safeParse(value);
|
|
197
|
+
return parsed.success ? normalizeSessionSource(parsed.data) : void 0;
|
|
198
|
+
}
|
|
199
|
+
|
|
170
200
|
// src/chat/conversations/sql/store.ts
|
|
171
201
|
var CONVERSATION_MUTATION_LOCK_PREFIX = "junior_conversation";
|
|
172
202
|
function now() {
|
|
@@ -343,6 +373,10 @@ function conversationFromRow(readRow) {
|
|
|
343
373
|
if (row.source !== void 0 && row.source !== null && !source) {
|
|
344
374
|
throw new Error("Conversation record source is invalid");
|
|
345
375
|
}
|
|
376
|
+
const sessionSource = row.sessionSource === void 0 || row.sessionSource === null ? void 0 : parseSessionSource(row.sessionSource);
|
|
377
|
+
if (row.sessionSource !== void 0 && row.sessionSource !== null && !sessionSource) {
|
|
378
|
+
throw new Error("Conversation record session source is invalid");
|
|
379
|
+
}
|
|
346
380
|
const execution = {
|
|
347
381
|
status: executionStatusFromValue(row.executionStatus),
|
|
348
382
|
lastCheckpointAtMs: msFromDate(row.lastCheckpointAt),
|
|
@@ -367,6 +401,7 @@ function conversationFromRow(readRow) {
|
|
|
367
401
|
...msFromDate(row.archivedAt) !== void 0 ? { archivedAtMs: msFromDate(row.archivedAt) } : {},
|
|
368
402
|
...row.channelName ? { channelName: row.channelName } : {},
|
|
369
403
|
...source ? { source } : {},
|
|
404
|
+
...sessionSource ? { sessionSource } : {},
|
|
370
405
|
...row.title ? { title: row.title } : {},
|
|
371
406
|
...msFromDate(row.transcriptPurgedAt) !== void 0 ? { transcriptPurgedAtMs: msFromDate(row.transcriptPurgedAt) } : {},
|
|
372
407
|
...visibility ? { visibility } : {}
|
|
@@ -381,6 +416,7 @@ function emptyConversation(args) {
|
|
|
381
416
|
updatedAtMs: args.nowMs,
|
|
382
417
|
...args.destination ? { destination: args.destination } : {},
|
|
383
418
|
...args.source ? { source: args.source } : {},
|
|
419
|
+
...args.sessionSource ? { sessionSource: args.sessionSource } : {},
|
|
384
420
|
execution: {
|
|
385
421
|
status: "idle",
|
|
386
422
|
updatedAtMs: args.nowMs
|
|
@@ -461,6 +497,7 @@ var SqlStore = class {
|
|
|
461
497
|
async recordActivity(args) {
|
|
462
498
|
const nowMs = args.nowMs ?? now();
|
|
463
499
|
const activityAtMs = args.activityAtMs ?? nowMs;
|
|
500
|
+
const sessionSource = normalizeSessionSource(args.sessionSource);
|
|
464
501
|
await this.withConversationMutation(args.conversationId, async () => {
|
|
465
502
|
const existing = await this.get({
|
|
466
503
|
conversationId: args.conversationId
|
|
@@ -476,14 +513,20 @@ var SqlStore = class {
|
|
|
476
513
|
conversationId: args.conversationId,
|
|
477
514
|
destination: args.destination,
|
|
478
515
|
nowMs,
|
|
479
|
-
source: args.source
|
|
516
|
+
source: args.source,
|
|
517
|
+
...sessionSource ? { sessionSource } : {}
|
|
480
518
|
});
|
|
481
|
-
const {
|
|
519
|
+
const {
|
|
520
|
+
sessionSource: _persistedSessionSource,
|
|
521
|
+
visibility: _persistedVisibility,
|
|
522
|
+
...currentWithoutPersistedSignals
|
|
523
|
+
} = current2;
|
|
482
524
|
await this.upsertConversation({
|
|
483
525
|
conversation: {
|
|
484
|
-
...
|
|
526
|
+
...currentWithoutPersistedSignals,
|
|
485
527
|
destination: current2.destination ?? args.destination,
|
|
486
528
|
source: current2.source ?? args.source,
|
|
529
|
+
...sessionSource ? { sessionSource } : {},
|
|
487
530
|
channelName: current2.channelName ?? args.channelName,
|
|
488
531
|
actor: mergeActor(current2.actor, args.actor),
|
|
489
532
|
title: current2.title ?? args.title,
|
|
@@ -637,6 +680,7 @@ var SqlStore = class {
|
|
|
637
680
|
conversationId: conversation.conversationId,
|
|
638
681
|
schemaVersion: 1,
|
|
639
682
|
source: conversation.source ?? null,
|
|
683
|
+
sessionSource: conversation.sessionSource ?? null,
|
|
640
684
|
originType: originTypeFromSource(conversation.source) ?? null,
|
|
641
685
|
originId: null,
|
|
642
686
|
originRunId: null,
|
|
@@ -662,6 +706,7 @@ var SqlStore = class {
|
|
|
662
706
|
target: juniorConversations.conversationId,
|
|
663
707
|
set: {
|
|
664
708
|
source: sql2`coalesce(excluded.source, ${juniorConversations.source})`,
|
|
709
|
+
sessionSource: sql2`coalesce(${juniorConversations.sessionSource}, excluded.source_json)`,
|
|
665
710
|
originType: sql2`coalesce(excluded.origin_type, ${juniorConversations.originType})`,
|
|
666
711
|
originId: sql2`coalesce(excluded.origin_id, ${juniorConversations.originId})`,
|
|
667
712
|
originRunId: sql2`coalesce(excluded.origin_run_id, ${juniorConversations.originRunId})`,
|
|
@@ -1099,15 +1144,22 @@ var newConversationEventSchema = z2.object({
|
|
|
1099
1144
|
|
|
1100
1145
|
// src/chat/conversations/sql/conversation-row.ts
|
|
1101
1146
|
import { sql as sql3 } from "drizzle-orm";
|
|
1102
|
-
async function ensureConversationRow(executor, conversationId, atMs) {
|
|
1147
|
+
async function ensureConversationRow(executor, conversationId, atMs, options = {}) {
|
|
1103
1148
|
const at = new Date(atMs);
|
|
1104
|
-
|
|
1149
|
+
const insert = executor.db().insert(juniorConversations).values({
|
|
1105
1150
|
conversationId,
|
|
1106
1151
|
createdAt: at,
|
|
1107
1152
|
lastActivityAt: at,
|
|
1108
1153
|
updatedAt: at,
|
|
1109
1154
|
executionStatus: "idle"
|
|
1110
|
-
})
|
|
1155
|
+
});
|
|
1156
|
+
if (options.activity === "preserve") {
|
|
1157
|
+
await insert.onConflictDoNothing({
|
|
1158
|
+
target: juniorConversations.conversationId
|
|
1159
|
+
});
|
|
1160
|
+
return;
|
|
1161
|
+
}
|
|
1162
|
+
await insert.onConflictDoUpdate({
|
|
1111
1163
|
target: juniorConversations.conversationId,
|
|
1112
1164
|
set: {
|
|
1113
1165
|
lastActivityAt: sql3`greatest(${juniorConversations.lastActivityAt}, excluded.last_activity_at)`,
|
|
@@ -1192,7 +1244,7 @@ var SqlConversationEventStore = class {
|
|
|
1192
1244
|
this.executor = executor;
|
|
1193
1245
|
}
|
|
1194
1246
|
executor;
|
|
1195
|
-
async append(conversationId, events) {
|
|
1247
|
+
async append(conversationId, events, options = {}) {
|
|
1196
1248
|
const parsed = events.map(
|
|
1197
1249
|
(event) => newConversationEventSchema.parse(event)
|
|
1198
1250
|
);
|
|
@@ -1231,14 +1283,17 @@ var SqlConversationEventStore = class {
|
|
|
1231
1283
|
await ensureConversationRow(
|
|
1232
1284
|
this.executor,
|
|
1233
1285
|
conversationId,
|
|
1234
|
-
newestCreatedAtMs
|
|
1235
|
-
|
|
1236
|
-
await this.executor.db().update(juniorConversations).set({ archivedAt: null }).where(
|
|
1237
|
-
and3(
|
|
1238
|
-
eq3(juniorConversations.conversationId, conversationId),
|
|
1239
|
-
isNotNull(juniorConversations.archivedAt)
|
|
1240
|
-
)
|
|
1286
|
+
newestCreatedAtMs,
|
|
1287
|
+
options
|
|
1241
1288
|
);
|
|
1289
|
+
if (options.activity !== "preserve") {
|
|
1290
|
+
await this.executor.db().update(juniorConversations).set({ archivedAt: null }).where(
|
|
1291
|
+
and3(
|
|
1292
|
+
eq3(juniorConversations.conversationId, conversationId),
|
|
1293
|
+
isNotNull(juniorConversations.archivedAt)
|
|
1294
|
+
)
|
|
1295
|
+
);
|
|
1296
|
+
}
|
|
1242
1297
|
const cursor = await this.readCursor(conversationId);
|
|
1243
1298
|
const historyVersion = cursor.maxHistoryVersion ?? 0;
|
|
1244
1299
|
let seq = cursor.nextSeq;
|
|
@@ -1540,6 +1595,7 @@ export {
|
|
|
1540
1595
|
parseDestination,
|
|
1541
1596
|
requireSlackDestination,
|
|
1542
1597
|
sameDestination,
|
|
1598
|
+
parseSessionSource,
|
|
1543
1599
|
instructionProvenanceFor,
|
|
1544
1600
|
contextProvenance,
|
|
1545
1601
|
sameActorIdentity,
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createPluginConversationEvents
|
|
3
|
-
} from "./chunk-BA5KHLPQ.js";
|
|
4
1
|
import {
|
|
5
2
|
pluginTaskId,
|
|
6
3
|
pluginTaskParamsSchema,
|
|
@@ -25,30 +22,31 @@ import {
|
|
|
25
22
|
persistThreadStateById,
|
|
26
23
|
stripRuntimeTurnContext,
|
|
27
24
|
updateConversationStats
|
|
28
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-7K57FJXR.js";
|
|
29
26
|
import {
|
|
27
|
+
createPluginConversationEvents,
|
|
30
28
|
createPluginEmbedder,
|
|
31
29
|
createPluginLogger,
|
|
32
30
|
createPluginModel,
|
|
33
31
|
createPluginState,
|
|
34
32
|
getPlugins
|
|
35
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-ODB55JM7.js";
|
|
36
34
|
import {
|
|
37
35
|
getDb,
|
|
38
36
|
sameActorIdentity
|
|
39
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-IS4DGI5J.js";
|
|
40
38
|
import {
|
|
41
39
|
getStateAdapter
|
|
42
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-XJYGLTYI.js";
|
|
43
41
|
import {
|
|
44
42
|
ProviderError,
|
|
45
43
|
findProviderError,
|
|
46
44
|
getProviderErrorAttributes,
|
|
47
45
|
getProviderErrorUserMessage
|
|
48
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-KN7QI56S.js";
|
|
49
47
|
import {
|
|
50
48
|
buildTurnFailureResponse
|
|
51
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-MVYNJECP.js";
|
|
52
50
|
import {
|
|
53
51
|
parseSlackMessageTs
|
|
54
52
|
} from "./chunk-F3B2YJ76.js";
|
|
@@ -6,29 +6,29 @@ import {
|
|
|
6
6
|
isDmChannel,
|
|
7
7
|
normalizeSlackConversationId,
|
|
8
8
|
withSlackRetries
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ODB55JM7.js";
|
|
10
10
|
import {
|
|
11
11
|
getDb,
|
|
12
12
|
parseDestination
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-IS4DGI5J.js";
|
|
14
14
|
import {
|
|
15
15
|
acquireActiveLock,
|
|
16
16
|
getStateAdapter,
|
|
17
17
|
sleep
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-XJYGLTYI.js";
|
|
19
19
|
import {
|
|
20
20
|
normalizeSlackEmojiName
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-KN7QI56S.js";
|
|
22
22
|
import {
|
|
23
23
|
pluginCatalogRuntime
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-NM3PMQS6.js";
|
|
25
25
|
import {
|
|
26
26
|
fetchWithBoundedOAuthErrorBodies
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-2U5CLBYF.js";
|
|
28
28
|
import {
|
|
29
29
|
logInfo,
|
|
30
30
|
logWarn
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-MVYNJECP.js";
|
|
32
32
|
import {
|
|
33
33
|
isRecord
|
|
34
34
|
} from "./chunk-OB42YVAE.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
normalizeGenAiFinishReason,
|
|
13
13
|
serializeGenAiAttribute,
|
|
14
14
|
withSpan
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-MVYNJECP.js";
|
|
16
16
|
|
|
17
17
|
// src/chat/config.ts
|
|
18
18
|
import { getModel as getModel2 } from "@earendil-works/pi-ai/compat";
|
|
@@ -322,7 +322,22 @@ var GEN_AI_SERVER_ADDRESS = "ai-gateway.vercel.sh";
|
|
|
322
322
|
var GEN_AI_SERVER_PORT = 443;
|
|
323
323
|
var GEN_AI_OPERATION_CHAT = "chat";
|
|
324
324
|
var GEN_AI_OPERATION_EMBEDDINGS = "embeddings";
|
|
325
|
+
var EMBEDDING_INPUT_COST_USD_PER_MILLION_TOKENS = {
|
|
326
|
+
"cohere/embed-v4.0": 0.12,
|
|
327
|
+
"google/gemini-embedding-001": 0.15,
|
|
328
|
+
"google/text-embedding-005": 0.025,
|
|
329
|
+
"mistral/mistral-embed": 0.1,
|
|
330
|
+
"openai/text-embedding-3-large": 0.13,
|
|
331
|
+
"openai/text-embedding-3-small": 0.02,
|
|
332
|
+
"openai/text-embedding-ada-002": 0.1,
|
|
333
|
+
"voyage/voyage-3.5": 0.06,
|
|
334
|
+
"voyage/voyage-3.5-lite": 0.02
|
|
335
|
+
};
|
|
325
336
|
var MISSING_GATEWAY_CREDENTIALS_ERROR = "Missing AI gateway credentials (AI_GATEWAY_API_KEY or VERCEL_OIDC_TOKEN)";
|
|
337
|
+
function embeddingCostUsd(modelId, inputTokens) {
|
|
338
|
+
const costPerMillionTokens = EMBEDDING_INPUT_COST_USD_PER_MILLION_TOKENS[modelId];
|
|
339
|
+
return costPerMillionTokens === void 0 ? void 0 : inputTokens * costPerMillionTokens / 1e6;
|
|
340
|
+
}
|
|
326
341
|
function getGatewayApiKey() {
|
|
327
342
|
return toOptionalTrimmed(getEnvApiKey("vercel-ai-gateway")) ?? toOptionalTrimmed(process.env.VERCEL_OIDC_TOKEN);
|
|
328
343
|
}
|
|
@@ -566,11 +581,15 @@ async function embedTexts(params) {
|
|
|
566
581
|
}
|
|
567
582
|
);
|
|
568
583
|
}
|
|
584
|
+
const costUsd = embeddingCostUsd(params.modelId, result2.usage.tokens);
|
|
569
585
|
setSpanAttributes({
|
|
570
586
|
"gen_ai.embeddings.dimension.count": dimensions,
|
|
571
|
-
...extractGenAiUsageAttributes(
|
|
587
|
+
...extractGenAiUsageAttributes({
|
|
588
|
+
inputTokens: result2.usage.tokens,
|
|
589
|
+
...costUsd !== void 0 ? { cost: { input: costUsd, total: costUsd } } : {}
|
|
590
|
+
})
|
|
572
591
|
});
|
|
573
|
-
return { dimensions, result: result2 };
|
|
592
|
+
return { costUsd, dimensions, result: result2 };
|
|
574
593
|
},
|
|
575
594
|
{
|
|
576
595
|
"gen_ai.provider.name": GEN_AI_PROVIDER_NAME,
|
|
@@ -581,6 +600,7 @@ async function embedTexts(params) {
|
|
|
581
600
|
}
|
|
582
601
|
);
|
|
583
602
|
return {
|
|
603
|
+
...result.costUsd !== void 0 ? { costUsd: result.costUsd } : {},
|
|
584
604
|
dimensions: result.dimensions,
|
|
585
605
|
model: params.modelId,
|
|
586
606
|
provider: GEN_AI_PROVIDER_NAME,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
persistAuthPauseTurnState,
|
|
14
14
|
requireTurnFailureEventId,
|
|
15
15
|
scheduleSessionCompletedPluginTasks
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JT3YMQR3.js";
|
|
17
17
|
import {
|
|
18
18
|
buildSentryConversationUrl
|
|
19
19
|
} from "./chunk-4CODA7P5.js";
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
resolveBaseUrl,
|
|
41
41
|
resolvePluginOAuthAccount,
|
|
42
42
|
truncateStatusText
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-K6MQWEEJ.js";
|
|
44
44
|
import {
|
|
45
45
|
JUNIOR_THREAD_STATE_TTL_MS,
|
|
46
46
|
TurnSliceLimitExceededError,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
recordDeliveredAssistantMessage,
|
|
74
74
|
turnHasReply,
|
|
75
75
|
updateConversationStats
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-7K57FJXR.js";
|
|
77
77
|
import {
|
|
78
78
|
SlackActionError,
|
|
79
79
|
getDashboardConversationLink,
|
|
@@ -82,19 +82,19 @@ import {
|
|
|
82
82
|
getSlackClient,
|
|
83
83
|
isDmChannel,
|
|
84
84
|
normalizeSlackConversationId
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-ODB55JM7.js";
|
|
86
86
|
import {
|
|
87
87
|
getConversationEventStore,
|
|
88
88
|
getConversationStore,
|
|
89
89
|
parseDestination,
|
|
90
90
|
requireSlackDestination,
|
|
91
91
|
sameDestination
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-IS4DGI5J.js";
|
|
93
93
|
import {
|
|
94
94
|
acquireActiveLock,
|
|
95
95
|
getDefaultRedisStateAdapterFor,
|
|
96
96
|
getStateAdapter
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-XJYGLTYI.js";
|
|
98
98
|
import {
|
|
99
99
|
FUNCTION_TIMEOUT_BUFFER_SECONDS,
|
|
100
100
|
botConfig,
|
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
getRuntimeMetadata,
|
|
104
104
|
normalizeSlackEmojiName,
|
|
105
105
|
standardModelId
|
|
106
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-KN7QI56S.js";
|
|
107
107
|
import {
|
|
108
108
|
parseSlackThreadId,
|
|
109
109
|
readSlackRawMessageContext,
|
|
@@ -112,15 +112,15 @@ import {
|
|
|
112
112
|
} from "./chunk-S7G34U75.js";
|
|
113
113
|
import {
|
|
114
114
|
discoverSkills
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-CAPBVX4L.js";
|
|
116
116
|
import {
|
|
117
117
|
pluginCatalogRuntime
|
|
118
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-NM3PMQS6.js";
|
|
119
119
|
import {
|
|
120
120
|
buildOAuthTokenRequest,
|
|
121
121
|
hasRequiredOAuthScope,
|
|
122
122
|
parseOAuthTokenResponse
|
|
123
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-2U5CLBYF.js";
|
|
124
124
|
import {
|
|
125
125
|
createSlackResumeActor,
|
|
126
126
|
isUserActor,
|
|
@@ -133,7 +133,7 @@ import {
|
|
|
133
133
|
logWarn,
|
|
134
134
|
setTags,
|
|
135
135
|
withLogContext
|
|
136
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-MVYNJECP.js";
|
|
137
137
|
import {
|
|
138
138
|
isRecord,
|
|
139
139
|
toOptionalNumber,
|
|
@@ -2,18 +2,18 @@ import {
|
|
|
2
2
|
SANDBOX_WORKSPACE_ROOT,
|
|
3
3
|
getStateAdapter,
|
|
4
4
|
sleep
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XJYGLTYI.js";
|
|
6
6
|
import {
|
|
7
7
|
toOptionalTrimmed
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KN7QI56S.js";
|
|
9
9
|
import {
|
|
10
10
|
pluginCatalogRuntime
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-NM3PMQS6.js";
|
|
12
12
|
import {
|
|
13
13
|
setSpanAttributes,
|
|
14
14
|
setSpanStatus,
|
|
15
15
|
withSpan
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-MVYNJECP.js";
|
|
17
17
|
|
|
18
18
|
// src/chat/sandbox/snapshot/profile.ts
|
|
19
19
|
import { createHash } from "crypto";
|