@sentry/junior 0.148.0 → 0.150.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-VAUYT6PD.js → agent-hooks-SEOGOGKX.js} +10 -10
- package/dist/api/conversations/aggregate.d.ts +2 -0
- package/dist/api/conversations/create.d.ts +1 -1
- package/dist/api/conversations/pending-messages.d.ts +15 -0
- package/dist/api/people/shared.d.ts +2 -0
- package/dist/api/schema/conversation.d.ts +78 -4
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +7 -1
- package/dist/api.d.ts +1 -1
- package/dist/api.js +186 -35
- package/dist/app.js +152 -186
- package/dist/{catalog-runtime-WADOZVTB.js → catalog-runtime-HA7RIWYT.js} +5 -5
- package/dist/chat/agent/index.d.ts +5 -4
- package/dist/chat/agent/prompt.d.ts +8 -5
- package/dist/chat/agent/resume.d.ts +2 -2
- package/dist/chat/agent/tools.d.ts +4 -7
- package/dist/chat/agent/{request.d.ts → types.d.ts} +138 -129
- package/dist/chat/agent-dispatch/types.d.ts +2 -2
- package/dist/chat/agent-invocations/spawn.d.ts +2 -2
- package/dist/chat/api-turns/work.d.ts +6 -1
- package/dist/chat/app/services.d.ts +1 -1
- package/dist/chat/plugins/viewer.d.ts +4 -0
- package/dist/chat/runtime/agent-runner.d.ts +7 -5
- package/dist/chat/runtime/reply-executor.d.ts +0 -2
- package/dist/chat/runtime/slack-resume.d.ts +3 -3
- package/dist/chat/services/conversation-memory.d.ts +2 -2
- package/dist/chat/services/conversation-title.d.ts +20 -0
- package/dist/chat/slack/assistant-thread/title.d.ts +10 -27
- package/dist/chat/state/conversation.d.ts +1 -0
- package/dist/chat/task-execution/paused-turn.d.ts +2 -2
- package/dist/chat/tools/types.d.ts +1 -1
- package/dist/{chunk-QOWHHM3F.js → chunk-3GL327SC.js} +1 -1
- package/dist/{chunk-45LOR4PU.js → chunk-3JVUWLR7.js} +45 -1
- package/dist/{chunk-4GXJUYJV.js → chunk-3ZMKDHCT.js} +2 -2
- package/dist/{chunk-DUY5CDAM.js → chunk-4KAYAIBV.js} +1 -1
- package/dist/{chunk-ULAU5ZGU.js → chunk-4VH7KLGC.js} +106 -113
- package/dist/{chunk-V2FXMOEA.js → chunk-64K7GKRW.js} +2 -2
- package/dist/{chunk-2B3PT3V2.js → chunk-6PFDWAK2.js} +1 -1
- package/dist/{chunk-LNVEIJ2L.js → chunk-7D4GNUV2.js} +5 -5
- package/dist/{chunk-ZPL2RR7F.js → chunk-7GOP6VFJ.js} +40 -36
- package/dist/{chunk-HWQGBIH7.js → chunk-7NLW2NF5.js} +1 -1
- package/dist/{chunk-55F4QU2V.js → chunk-7QB2CKCW.js} +1 -1
- package/dist/{chunk-WCN4YSH7.js → chunk-DWETNV66.js} +6 -6
- package/dist/{chunk-D3WPMGEX.js → chunk-F5NMSEBL.js} +1 -1
- package/dist/{chunk-IL4EDBMV.js → chunk-FEFEIA3Z.js} +5 -5
- package/dist/{chunk-WOONT5ZP.js → chunk-H2RLIJ7G.js} +1 -1
- package/dist/{chunk-VRHTNBA6.js → chunk-ILYL6YFD.js} +3 -3
- package/dist/{chunk-VCYSOXON.js → chunk-IPGNWXA3.js} +545 -7
- package/dist/{chunk-LAZGHEYU.js → chunk-IZRSLANA.js} +1 -1
- package/dist/{chunk-EAI67NTM.js → chunk-JQXJ2E53.js} +1 -1
- package/dist/{chunk-HLPLT3NY.js → chunk-M5OZSVJI.js} +8 -4
- package/dist/{chunk-XJ42NBP5.js → chunk-MCNP7A7T.js} +8 -8
- package/dist/{chunk-OJCP3C3J.js → chunk-NCGVQXX5.js} +22 -26
- package/dist/{chunk-4AQZYNHM.js → chunk-NNOCRVQO.js} +2 -2
- package/dist/{chunk-GXYDVZKM.js → chunk-P43QM7JY.js} +5 -5
- package/dist/{chunk-EINWQFXI.js → chunk-QPIPYVGE.js} +5 -5
- package/dist/{chunk-GDFF3BQG.js → chunk-RF6J3DIO.js} +34 -36
- package/dist/{chunk-D6YX4NNN.js → chunk-SH6ZKJFZ.js} +4 -4
- package/dist/{chunk-LE5H7LMT.js → chunk-SHDREBGC.js} +1 -1
- package/dist/{chunk-VMNRXKAH.js → chunk-TZLYAO2J.js} +191 -134
- package/dist/{chunk-RRJV5UR5.js → chunk-UIMBNY6O.js} +11 -337
- package/dist/{chunk-ZCHIC2GM.js → chunk-UOFQEVR5.js} +15 -6
- package/dist/{chunk-7OEIXFC3.js → chunk-Y2VZ54CQ.js} +12 -12
- package/dist/{chunk-VY6W3T43.js → chunk-ZBOGYZ53.js} +4 -4
- package/dist/{chunk-POSZWRGL.js → chunk-ZUQT35YC.js} +1 -1
- package/dist/cli/chat.js +31 -32
- package/dist/cli/check.js +6 -6
- package/dist/cli/plugins.js +13 -13
- package/dist/cli/snapshot-create.js +9 -9
- package/dist/cli/upgrade.js +7 -7
- package/dist/{db-XUKZRFFK.js → db-HUW75QG7.js} +7 -7
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-LPZMMGFI.js → oauth-callback-server-DP7NIZPQ.js} +24 -25
- package/dist/{runner-DGKUTMPX.js → runner-AINV7K3M.js} +47 -45
- package/dist/{skills-P7YUFSXM.js → skills-PKS37E6B.js} +6 -6
- package/dist/spawn-NJCDEPPL.js +38 -0
- package/dist/{validation-S7U5M5NR.js → validation-PDC3MVMM.js} +6 -6
- package/dist/version.js +1 -1
- package/dist/{work-GAA7TVAD.js → work-KJLJRPXS.js} +17 -17
- package/dist/{worker-JXPJH3QB.js → worker-TYQ7YVIR.js} +11 -11
- package/package.json +5 -5
- package/dist/chunk-4EA2SFK2.js +0 -137
- package/dist/spawn-DSK3ZEVD.js +0 -38
package/dist/api.js
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
conversationFeedQuerySchema,
|
|
14
14
|
conversationFeedSchema,
|
|
15
15
|
conversationParamsSchema,
|
|
16
|
+
conversationPendingMessagesReportSchema,
|
|
16
17
|
conversationReportEventSchema,
|
|
17
18
|
conversationStatsReportSchema,
|
|
18
19
|
createConversationBodySchema,
|
|
@@ -32,7 +33,7 @@ import {
|
|
|
32
33
|
taskListSchema,
|
|
33
34
|
taskParamsSchema,
|
|
34
35
|
taskRunListSchema
|
|
35
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-3JVUWLR7.js";
|
|
36
37
|
import {
|
|
37
38
|
appendAndEnqueueApiConversationMessage,
|
|
38
39
|
createAndEnqueueApiConversation,
|
|
@@ -40,11 +41,13 @@ import {
|
|
|
40
41
|
readHealthReport,
|
|
41
42
|
resolveSlackConversationContextFromThreadId,
|
|
42
43
|
webActorFromEmail
|
|
43
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-7GOP6VFJ.js";
|
|
44
45
|
import {
|
|
45
46
|
buildSentryConversationUrl
|
|
46
47
|
} from "./chunk-4CODA7P5.js";
|
|
47
|
-
import
|
|
48
|
+
import {
|
|
49
|
+
getConversation
|
|
50
|
+
} from "./chunk-M5OZSVJI.js";
|
|
48
51
|
import {
|
|
49
52
|
readTaskExecutionByConversationId,
|
|
50
53
|
readTaskExecutionDays,
|
|
@@ -52,8 +55,8 @@ import {
|
|
|
52
55
|
readTaskExecutionSummaries,
|
|
53
56
|
readTaskExecutions,
|
|
54
57
|
readTaskRuns
|
|
55
|
-
} from "./chunk-
|
|
56
|
-
import "./chunk-
|
|
58
|
+
} from "./chunk-UIMBNY6O.js";
|
|
59
|
+
import "./chunk-FEFEIA3Z.js";
|
|
57
60
|
import {
|
|
58
61
|
healthReportSchema,
|
|
59
62
|
pluginOperationalReportFeedSchema,
|
|
@@ -77,18 +80,16 @@ import {
|
|
|
77
80
|
listPublicEventTasksForTeams,
|
|
78
81
|
listPublicScheduledTasksForTeams,
|
|
79
82
|
readStats
|
|
80
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-P43QM7JY.js";
|
|
81
84
|
import {
|
|
82
85
|
parseSlackThreadId
|
|
83
|
-
} from "./chunk-
|
|
84
|
-
import {
|
|
85
|
-
fallbackShortTitle
|
|
86
|
-
} from "./chunk-4EA2SFK2.js";
|
|
86
|
+
} from "./chunk-H2RLIJ7G.js";
|
|
87
87
|
import {
|
|
88
88
|
agentTurnUsageSchema,
|
|
89
|
+
fallbackShortTitle,
|
|
89
90
|
hasAgentTurnUsage,
|
|
90
91
|
renderJuniorNativeConversationEvent
|
|
91
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-IPGNWXA3.js";
|
|
92
93
|
import "./chunk-3Y47VMHV.js";
|
|
93
94
|
import "./chunk-PDO5BLNM.js";
|
|
94
95
|
import {
|
|
@@ -96,12 +97,13 @@ import {
|
|
|
96
97
|
getPlugins,
|
|
97
98
|
listConversationAnnotations,
|
|
98
99
|
renderPluginConversationEvent,
|
|
99
|
-
resolveViewerUser
|
|
100
|
-
|
|
100
|
+
resolveViewerUser,
|
|
101
|
+
updateViewerDisplayName
|
|
102
|
+
} from "./chunk-UOFQEVR5.js";
|
|
101
103
|
import {
|
|
102
104
|
getSlackClient,
|
|
103
105
|
withSlackRetries
|
|
104
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-64K7GKRW.js";
|
|
105
107
|
import {
|
|
106
108
|
decodeStoredConversationEvent,
|
|
107
109
|
getConversationStore,
|
|
@@ -109,23 +111,23 @@ import {
|
|
|
109
111
|
getSqlExecutor,
|
|
110
112
|
locationFromRow,
|
|
111
113
|
parseSessionSource
|
|
112
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-ILYL6YFD.js";
|
|
113
115
|
import {
|
|
114
116
|
juniorApiTokens,
|
|
115
117
|
juniorConversationEvents,
|
|
116
118
|
juniorConversations,
|
|
117
119
|
juniorIdentities,
|
|
118
120
|
juniorUsers
|
|
119
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-F5NMSEBL.js";
|
|
120
122
|
import "./chunk-EM225ITJ.js";
|
|
121
|
-
import "./chunk-
|
|
122
|
-
import "./chunk-
|
|
123
|
+
import "./chunk-6PFDWAK2.js";
|
|
124
|
+
import "./chunk-3ZMKDHCT.js";
|
|
123
125
|
import {
|
|
124
126
|
juniorDestinations
|
|
125
127
|
} from "./chunk-VFUK3X5B.js";
|
|
126
128
|
import {
|
|
127
129
|
canExposeConversationPayload
|
|
128
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-SHDREBGC.js";
|
|
129
131
|
import "./chunk-RUIXF3YQ.js";
|
|
130
132
|
import "./chunk-HZF5P5UN.js";
|
|
131
133
|
import {
|
|
@@ -135,10 +137,10 @@ import {
|
|
|
135
137
|
} from "./chunk-F3B2YJ76.js";
|
|
136
138
|
import {
|
|
137
139
|
logException
|
|
138
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-JQXJ2E53.js";
|
|
139
141
|
import "./chunk-6GWA276C.js";
|
|
140
|
-
import "./chunk-
|
|
141
|
-
import "./chunk-
|
|
142
|
+
import "./chunk-IZRSLANA.js";
|
|
143
|
+
import "./chunk-7QB2CKCW.js";
|
|
142
144
|
import "./chunk-MLKGABMK.js";
|
|
143
145
|
|
|
144
146
|
// src/api.ts
|
|
@@ -290,7 +292,8 @@ async function createConversationForViewer(viewer, body) {
|
|
|
290
292
|
{
|
|
291
293
|
actor: actorFromViewer(viewer),
|
|
292
294
|
idempotencyKey: body.idempotencyKey,
|
|
293
|
-
message: body.message
|
|
295
|
+
message: body.message,
|
|
296
|
+
...body.visibility ? { visibility: body.visibility } : {}
|
|
294
297
|
},
|
|
295
298
|
{
|
|
296
299
|
conversationStore: getConversationStore(),
|
|
@@ -827,6 +830,7 @@ function reportEventData(args) {
|
|
|
827
830
|
type: "message",
|
|
828
831
|
messageId: data.messageId,
|
|
829
832
|
role: data.role,
|
|
833
|
+
...data.meta?.source === "web" ? { source: "web" } : {},
|
|
830
834
|
...actorIdentity ? { actorIdentity } : {},
|
|
831
835
|
...typeof data.meta?.eventType === "string" ? { eventType: data.meta.eventType } : {},
|
|
832
836
|
...args.canExposePayload ? { text: data.text } : { redacted: true }
|
|
@@ -2335,12 +2339,132 @@ async function readConversationEvents(conversationId, beforeValue, options = {})
|
|
|
2335
2339
|
});
|
|
2336
2340
|
}
|
|
2337
2341
|
|
|
2342
|
+
// src/api/conversations/pending-messages.ts
|
|
2343
|
+
import { z as z4 } from "zod";
|
|
2344
|
+
var apiTurnMailboxMetadataSchema = z4.object({
|
|
2345
|
+
authorEmail: z4.string().email(),
|
|
2346
|
+
authorFullName: z4.string().min(1).optional(),
|
|
2347
|
+
authorUserId: z4.string().min(1),
|
|
2348
|
+
authorUserName: z4.string().min(1).optional(),
|
|
2349
|
+
kind: z4.literal("api_turn"),
|
|
2350
|
+
messageId: z4.string().min(1)
|
|
2351
|
+
}).strict();
|
|
2352
|
+
var slackMailboxAuthorSchema = z4.object({
|
|
2353
|
+
userId: z4.string(),
|
|
2354
|
+
userName: z4.string().optional(),
|
|
2355
|
+
fullName: z4.string().optional(),
|
|
2356
|
+
isMe: z4.boolean().optional()
|
|
2357
|
+
}).passthrough();
|
|
2358
|
+
var slackMailboxMessageSchema = z4.object({
|
|
2359
|
+
author: slackMailboxAuthorSchema,
|
|
2360
|
+
id: z4.string().min(1)
|
|
2361
|
+
}).passthrough();
|
|
2362
|
+
var slackMailboxMetadataSchema = z4.object({
|
|
2363
|
+
message: slackMailboxMessageSchema,
|
|
2364
|
+
platform: z4.literal("slack")
|
|
2365
|
+
}).passthrough();
|
|
2366
|
+
function isoFromMs(value) {
|
|
2367
|
+
return new Date(value).toISOString();
|
|
2368
|
+
}
|
|
2369
|
+
function actorIdentityFromApiMetadata(metadata2) {
|
|
2370
|
+
return {
|
|
2371
|
+
email: metadata2.authorEmail.trim().toLowerCase(),
|
|
2372
|
+
...metadata2.authorFullName ? { fullName: metadata2.authorFullName } : {}
|
|
2373
|
+
};
|
|
2374
|
+
}
|
|
2375
|
+
function actorIdentityFromSlackMetadata(metadata2) {
|
|
2376
|
+
if (metadata2.message.author.isMe === true) return void 0;
|
|
2377
|
+
const slackUserId = metadata2.message.author.userId.trim();
|
|
2378
|
+
if (!slackUserId) return void 0;
|
|
2379
|
+
const slackUserName = metadata2.message.author.userName?.trim();
|
|
2380
|
+
const fullName = metadata2.message.author.fullName?.trim();
|
|
2381
|
+
return {
|
|
2382
|
+
slackUserId,
|
|
2383
|
+
...slackUserName ? { slackUserName } : {},
|
|
2384
|
+
...fullName ? { fullName } : {}
|
|
2385
|
+
};
|
|
2386
|
+
}
|
|
2387
|
+
function projectPendingMessage(message2, canExposePayload) {
|
|
2388
|
+
if (message2.source === "web") {
|
|
2389
|
+
const metadata2 = apiTurnMailboxMetadataSchema.safeParse(
|
|
2390
|
+
message2.input.metadata
|
|
2391
|
+
);
|
|
2392
|
+
if (!metadata2.success) return void 0;
|
|
2393
|
+
const text = message2.input.text.trim();
|
|
2394
|
+
if (!text) return void 0;
|
|
2395
|
+
return {
|
|
2396
|
+
createdAt: isoFromMs(message2.createdAtMs),
|
|
2397
|
+
delivery: message2.delivery,
|
|
2398
|
+
inboundMessageId: message2.inboundMessageId,
|
|
2399
|
+
messageId: metadata2.data.messageId,
|
|
2400
|
+
receivedAt: isoFromMs(message2.receivedAtMs),
|
|
2401
|
+
role: "user",
|
|
2402
|
+
source: "web",
|
|
2403
|
+
...canExposePayload ? {
|
|
2404
|
+
actorIdentity: actorIdentityFromApiMetadata(metadata2.data),
|
|
2405
|
+
text
|
|
2406
|
+
} : { redacted: true }
|
|
2407
|
+
};
|
|
2408
|
+
}
|
|
2409
|
+
if (message2.source === "slack") {
|
|
2410
|
+
const metadata2 = slackMailboxMetadataSchema.safeParse(
|
|
2411
|
+
message2.input.metadata
|
|
2412
|
+
);
|
|
2413
|
+
if (!metadata2.success) return void 0;
|
|
2414
|
+
if (metadata2.data.message.author.isMe === true) return void 0;
|
|
2415
|
+
const text = message2.input.text.trim();
|
|
2416
|
+
if (!text) return void 0;
|
|
2417
|
+
const actorIdentity = actorIdentityFromSlackMetadata(metadata2.data);
|
|
2418
|
+
return {
|
|
2419
|
+
createdAt: isoFromMs(message2.createdAtMs),
|
|
2420
|
+
delivery: message2.delivery,
|
|
2421
|
+
inboundMessageId: message2.inboundMessageId,
|
|
2422
|
+
messageId: metadata2.data.message.id,
|
|
2423
|
+
receivedAt: isoFromMs(message2.receivedAtMs),
|
|
2424
|
+
role: "user",
|
|
2425
|
+
source: "slack",
|
|
2426
|
+
...canExposePayload ? {
|
|
2427
|
+
...actorIdentity ? { actorIdentity } : {},
|
|
2428
|
+
text
|
|
2429
|
+
} : { redacted: true }
|
|
2430
|
+
};
|
|
2431
|
+
}
|
|
2432
|
+
return void 0;
|
|
2433
|
+
}
|
|
2434
|
+
async function readConversationPendingMessages(conversationId, options = {}) {
|
|
2435
|
+
const conversation = await getConversationStore().get({ conversationId });
|
|
2436
|
+
if (!conversation) return void 0;
|
|
2437
|
+
const access = (await readConversationAccessFromSql(getDb(), [conversationId], options.viewer)).get(conversationId);
|
|
2438
|
+
const canExposePayload = access?.canViewPrivateContent ?? false;
|
|
2439
|
+
const work = await getConversation({ conversationId });
|
|
2440
|
+
const messages = (work?.execution.pendingMessages ?? []).map((message2) => projectPendingMessage(message2, canExposePayload)).filter(
|
|
2441
|
+
(message2) => Boolean(message2)
|
|
2442
|
+
);
|
|
2443
|
+
return conversationPendingMessagesReportSchema.parse({
|
|
2444
|
+
conversationId,
|
|
2445
|
+
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2446
|
+
messages
|
|
2447
|
+
});
|
|
2448
|
+
}
|
|
2449
|
+
async function requireConversationPendingMessages(conversationId, options = {}) {
|
|
2450
|
+
const report = await readConversationPendingMessages(conversationId, options);
|
|
2451
|
+
if (!report) throwApiError(404, "Conversation not found.");
|
|
2452
|
+
return report;
|
|
2453
|
+
}
|
|
2454
|
+
|
|
2338
2455
|
// src/api/conversations/stats.query.ts
|
|
2339
2456
|
import { and as and8, eq as eq9, gte, isNull as isNull4, lte, sql as sql6 } from "drizzle-orm";
|
|
2340
2457
|
import { alias as alias4 } from "drizzle-orm/pg-core";
|
|
2341
2458
|
|
|
2342
2459
|
// src/api/conversations/aggregate.ts
|
|
2343
2460
|
import { sql as sql5 } from "drizzle-orm";
|
|
2461
|
+
function usageTokenValue(source, field) {
|
|
2462
|
+
return sql5`CASE
|
|
2463
|
+
WHEN ${source.usage}->>${field} IS NOT NULL
|
|
2464
|
+
THEN (${source.usage}->>${field})::double precision
|
|
2465
|
+
ELSE NULL
|
|
2466
|
+
END`;
|
|
2467
|
+
}
|
|
2344
2468
|
function tokenValue(source) {
|
|
2345
2469
|
return sql5`
|
|
2346
2470
|
CASE
|
|
@@ -2388,11 +2512,13 @@ function conversationAggregateColumns(sources) {
|
|
|
2388
2512
|
WHERE ${roots.executionStatus} NOT IN ('idle', 'failed')
|
|
2389
2513
|
)::integer`,
|
|
2390
2514
|
conversations: sql5`${conversationCount}::integer`,
|
|
2515
|
+
cachedInputTokens: sql5`SUM(${usageTokenValue(metrics, "cachedInputTokens")})::double precision`,
|
|
2391
2516
|
costUsd: sql5`SUM(${costValue(metrics)})::double precision`,
|
|
2392
2517
|
durationMs: sql5`COALESCE(SUM(${metrics.durationMs}), 0)::double precision`,
|
|
2393
2518
|
failed: sql5`${conversationCount} FILTER (
|
|
2394
2519
|
WHERE ${roots.executionStatus} = 'failed'
|
|
2395
2520
|
)::integer`,
|
|
2521
|
+
inputTokens: sql5`SUM(${usageTokenValue(metrics, "inputTokens")})::double precision`,
|
|
2396
2522
|
tokens: sql5`SUM(${tokenValue(metrics)})::double precision`
|
|
2397
2523
|
};
|
|
2398
2524
|
}
|
|
@@ -2498,7 +2624,9 @@ function metricDays(rows, endMs) {
|
|
|
2498
2624
|
conversations: row?.conversations ?? 0,
|
|
2499
2625
|
date,
|
|
2500
2626
|
durationMs: row?.durationMs ?? 0,
|
|
2627
|
+
...row?.cachedInputTokens !== null && row?.cachedInputTokens !== void 0 ? { cachedInputTokens: row.cachedInputTokens } : {},
|
|
2501
2628
|
...row?.costUsd !== null && row?.costUsd !== void 0 ? { costUsd: addUsd(void 0, row.costUsd) } : {},
|
|
2629
|
+
...row?.inputTokens !== null && row?.inputTokens !== void 0 ? { inputTokens: row.inputTokens } : {},
|
|
2502
2630
|
...row?.tokens !== null && row?.tokens !== void 0 ? { tokens: row.tokens } : {}
|
|
2503
2631
|
});
|
|
2504
2632
|
}
|
|
@@ -2609,10 +2737,12 @@ async function aggregateStats(db, start, end) {
|
|
|
2609
2737
|
juniorDestinations.visibility
|
|
2610
2738
|
),
|
|
2611
2739
|
db.select({
|
|
2740
|
+
cachedInputTokens: treeAggregateColumns.cachedInputTokens,
|
|
2612
2741
|
conversations: treeAggregateColumns.conversations,
|
|
2613
2742
|
costUsd: treeAggregateColumns.costUsd,
|
|
2614
2743
|
date: activityDate,
|
|
2615
2744
|
durationMs: treeAggregateColumns.durationMs,
|
|
2745
|
+
inputTokens: treeAggregateColumns.inputTokens,
|
|
2616
2746
|
tokens: treeAggregateColumns.tokens
|
|
2617
2747
|
}).from(juniorConversations).innerJoin(
|
|
2618
2748
|
treeConversation,
|
|
@@ -2668,6 +2798,7 @@ async function readConversationStatsFromSql() {
|
|
|
2668
2798
|
}
|
|
2669
2799
|
return {
|
|
2670
2800
|
active: totals?.active ?? 0,
|
|
2801
|
+
...totals?.cachedInputTokens !== null && totals?.cachedInputTokens !== void 0 ? { cachedInputTokens: totals.cachedInputTokens } : {},
|
|
2671
2802
|
conversations: totals?.conversations ?? 0,
|
|
2672
2803
|
durationMs: totals?.durationMs ?? 0,
|
|
2673
2804
|
failed: totals?.failed ?? 0,
|
|
@@ -2678,6 +2809,7 @@ async function readConversationStatsFromSql() {
|
|
|
2678
2809
|
actors: statsItems(actors),
|
|
2679
2810
|
source: "conversation_index",
|
|
2680
2811
|
...totals?.costUsd !== null && totals?.costUsd !== void 0 ? { costUsd: addUsd(void 0, totals.costUsd) } : {},
|
|
2812
|
+
...totals?.inputTokens !== null && totals?.inputTokens !== void 0 ? { inputTokens: totals.inputTokens } : {},
|
|
2681
2813
|
...totals?.tokens !== null && totals?.tokens !== void 0 ? { tokens: totals.tokens } : {},
|
|
2682
2814
|
windowEnd: end.toISOString(),
|
|
2683
2815
|
windowStart: start.toISOString()
|
|
@@ -2802,6 +2934,24 @@ function createConversationRoutes() {
|
|
|
2802
2934
|
return jsonResponse(conversationEventPageSchema, report);
|
|
2803
2935
|
}
|
|
2804
2936
|
);
|
|
2937
|
+
app.get(
|
|
2938
|
+
"/:conversationId/pending-messages",
|
|
2939
|
+
validateRequest(
|
|
2940
|
+
"param",
|
|
2941
|
+
conversationParamsSchema,
|
|
2942
|
+
"Invalid route parameters."
|
|
2943
|
+
),
|
|
2944
|
+
async (context) => {
|
|
2945
|
+
const { conversationId } = context.req.valid("param");
|
|
2946
|
+
const viewer = context.get("viewer");
|
|
2947
|
+
return jsonResponse(
|
|
2948
|
+
conversationPendingMessagesReportSchema,
|
|
2949
|
+
await requireConversationPendingMessages(conversationId, {
|
|
2950
|
+
viewer
|
|
2951
|
+
})
|
|
2952
|
+
);
|
|
2953
|
+
}
|
|
2954
|
+
);
|
|
2805
2955
|
app.get(
|
|
2806
2956
|
"/:conversationId",
|
|
2807
2957
|
validateRequest(
|
|
@@ -3957,7 +4107,7 @@ function createPersonalTokenRoutes() {
|
|
|
3957
4107
|
|
|
3958
4108
|
// src/api/user-pages/routes.ts
|
|
3959
4109
|
import { Hono as Hono5 } from "hono";
|
|
3960
|
-
import { z as
|
|
4110
|
+
import { z as z5 } from "zod";
|
|
3961
4111
|
import {
|
|
3962
4112
|
pluginUserPageContentSchema as pluginUserPageContentSchema2,
|
|
3963
4113
|
pluginUserPageInputSchema,
|
|
@@ -4023,20 +4173,20 @@ async function readPluginUserPage(input) {
|
|
|
4023
4173
|
}
|
|
4024
4174
|
|
|
4025
4175
|
// src/api/user-pages/routes.ts
|
|
4026
|
-
var userPageQuerySchema =
|
|
4027
|
-
cursor:
|
|
4176
|
+
var userPageQuerySchema = z5.object({
|
|
4177
|
+
cursor: z5.preprocess(
|
|
4028
4178
|
(value) => value || void 0,
|
|
4029
4179
|
pluginUserPageInputSchema.shape.cursor
|
|
4030
4180
|
),
|
|
4031
|
-
filter:
|
|
4181
|
+
filter: z5.preprocess(
|
|
4032
4182
|
(value) => value || void 0,
|
|
4033
4183
|
pluginUserPageInputSchema.shape.filter
|
|
4034
4184
|
),
|
|
4035
|
-
limit:
|
|
4185
|
+
limit: z5.preprocess(
|
|
4036
4186
|
(value) => value === "" ? void 0 : value,
|
|
4037
|
-
|
|
4187
|
+
z5.coerce.number().int().min(1).max(50).default(20)
|
|
4038
4188
|
),
|
|
4039
|
-
q:
|
|
4189
|
+
q: z5.preprocess(
|
|
4040
4190
|
(value) => value || void 0,
|
|
4041
4191
|
pluginUserPageInputSchema.shape.query
|
|
4042
4192
|
)
|
|
@@ -4160,7 +4310,7 @@ function readDescriptionText(home) {
|
|
|
4160
4310
|
}
|
|
4161
4311
|
}
|
|
4162
4312
|
async function readSkillReports() {
|
|
4163
|
-
const { discoverSkills } = await import("./skills-
|
|
4313
|
+
const { discoverSkills } = await import("./skills-PKS37E6B.js");
|
|
4164
4314
|
const skills = await discoverSkills();
|
|
4165
4315
|
return skillReportsSchema.parse(
|
|
4166
4316
|
skills.map((skill) => ({
|
|
@@ -4170,7 +4320,7 @@ async function readSkillReports() {
|
|
|
4170
4320
|
);
|
|
4171
4321
|
}
|
|
4172
4322
|
async function readPlugins() {
|
|
4173
|
-
const { pluginCatalogRuntime } = await import("./catalog-runtime-
|
|
4323
|
+
const { pluginCatalogRuntime } = await import("./catalog-runtime-HA7RIWYT.js");
|
|
4174
4324
|
return pluginsSchema.parse(
|
|
4175
4325
|
pluginCatalogRuntime.getProviders().map((plugin) => ({
|
|
4176
4326
|
configKeys: plugin.manifest.configKeys ?? [],
|
|
@@ -4183,7 +4333,7 @@ async function readPlugins() {
|
|
|
4183
4333
|
async function readRuntimeInfoReport() {
|
|
4184
4334
|
const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
|
|
4185
4335
|
import("./discovery-GUFTFBTL.js"),
|
|
4186
|
-
import("./catalog-runtime-
|
|
4336
|
+
import("./catalog-runtime-HA7RIWYT.js"),
|
|
4187
4337
|
readPlugins(),
|
|
4188
4338
|
readSkillReports()
|
|
4189
4339
|
]);
|
|
@@ -4199,7 +4349,7 @@ async function readRuntimeInfoReport() {
|
|
|
4199
4349
|
}
|
|
4200
4350
|
async function readPluginOperationalReportFeed() {
|
|
4201
4351
|
const nowMs = Date.now();
|
|
4202
|
-
const { getPluginOperationalReports } = await import("./agent-hooks-
|
|
4352
|
+
const { getPluginOperationalReports } = await import("./agent-hooks-SEOGOGKX.js");
|
|
4203
4353
|
return pluginOperationalReportFeedSchema.parse({
|
|
4204
4354
|
source: "plugins",
|
|
4205
4355
|
generatedAt: new Date(nowMs).toISOString(),
|
|
@@ -4274,5 +4424,6 @@ export {
|
|
|
4274
4424
|
authenticatePersonalToken,
|
|
4275
4425
|
createJuniorApi,
|
|
4276
4426
|
jsonResponse,
|
|
4277
|
-
resolveViewerUser
|
|
4427
|
+
resolveViewerUser,
|
|
4428
|
+
updateViewerDisplayName
|
|
4278
4429
|
};
|