@sentry/junior 0.107.1 → 0.109.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-ICPIJAFY.js → agent-hooks-FHHVLNPA.js} +12 -12
- package/dist/api/conversations/events.d.ts +1 -1
- package/dist/api/conversations/list.d.ts +1 -0
- package/dist/api/conversations/schema.d.ts +57 -6
- package/dist/api/schema.js +1 -1
- package/dist/api.js +116 -27
- package/dist/app.d.ts +1 -0
- package/dist/app.js +1741 -458
- package/dist/{catalog-runtime-FOFNPR3P.js → catalog-runtime-DMGJSLV2.js} +6 -4
- package/dist/chat/conversations/history.d.ts +16 -5
- package/dist/chat/conversations/message-projection.d.ts +3 -5
- package/dist/chat/conversations/sql/store.d.ts +0 -7
- package/dist/chat/log-context.d.ts +40 -0
- package/dist/chat/logging.d.ts +3 -26
- package/dist/chat/resource-events/store.d.ts +6 -0
- package/dist/chat/runtime/slack-resume.d.ts +2 -2
- package/dist/chat/runtime/slack-runtime.d.ts +3 -0
- package/dist/chat/services/turn-session-record.d.ts +0 -2
- package/dist/chat/slack/reply.d.ts +7 -19
- package/dist/chat/state/conversation.d.ts +1 -0
- package/dist/chat/task-execution/slack-work.d.ts +237 -10
- package/dist/chat/tool-support/turn-deadline-result.d.ts +3 -0
- package/dist/chunk-3SXUV423.js +10 -0
- package/dist/{chunk-YFQ7CQDE.js → chunk-72OMGPDS.js} +1017 -39
- package/dist/{chunk-2XXEKR44.js → chunk-7Q6WCISF.js} +1 -1
- package/dist/{chunk-NVOTGWYX.js → chunk-FENLIFJD.js} +97 -601
- package/dist/{chunk-IGHMVDWI.js → chunk-FWJRXN4F.js} +3 -3
- package/dist/{chunk-PUAMO4PI.js → chunk-HHVY4SMP.js} +41 -7
- package/dist/{chunk-SPUAJVVH.js → chunk-HO5NT6OE.js} +5 -7
- package/dist/{chunk-O24R4DCK.js → chunk-ISMWX44P.js} +93 -55
- package/dist/{chunk-7FBGKXPE.js → chunk-IVVGFRQQ.js} +5 -0
- package/dist/{chunk-EDLNHZH3.js → chunk-IXKSQGIO.js} +226 -191
- package/dist/{chunk-SS67LUOK.js → chunk-JNAVF45E.js} +6 -7
- package/dist/{chunk-DY7TRYB5.js → chunk-MGUMR35T.js} +1 -1
- package/dist/{chunk-CQ7KSO2B.js → chunk-MXW4GL53.js} +11 -15
- package/dist/{chunk-RT5BUHR5.js → chunk-O3JMSZLI.js} +1 -1
- package/dist/chunk-OCD3OZRK.js +125 -0
- package/dist/{chunk-B2Z2H66D.js → chunk-OUHNWH46.js} +60 -5
- package/dist/{chunk-VIXFG2VC.js → chunk-PLB7MRCQ.js} +1 -2
- package/dist/{chunk-RMVOAJRL.js → chunk-QY636HZU.js} +114 -12
- package/dist/{chunk-VH6KWKG2.js → chunk-RGX4V75M.js} +3 -3
- package/dist/{chunk-B7PUBQQM.js → chunk-SYAQIR5Z.js} +1 -1
- package/dist/chunk-TMBRFULF.js +471 -0
- package/dist/{chunk-YIPD3L6L.js → chunk-TT6GMXNA.js} +8 -10
- package/dist/{chunk-YT72TOEK.js → chunk-WHMOBKT7.js} +2 -2
- package/dist/cli/chat.js +23 -23
- package/dist/cli/check.js +8 -6
- package/dist/cli/plugins.js +16 -16
- package/dist/cli/snapshot-warmup.js +10 -9
- package/dist/cli/upgrade.js +314 -3505
- package/dist/db/db.d.ts +1 -1
- package/dist/{db-DIGO4TGW.js → db-V3NU72O2.js} +8 -6
- package/dist/instrumentation.js +3 -2
- package/dist/nitro.js +5 -4
- package/dist/{runner-ACR2HAIC.js → runner-JYBCQBLK.js} +17 -20
- package/dist/{skills-ITNHBARB.js → skills-U6MDAST7.js} +7 -5
- package/dist/{validation-AGQ46ZGV.js → validation-72N3JVRU.js} +7 -5
- package/dist/version.d.ts +2 -0
- package/dist/version.js +7 -0
- package/migrations/0006_drop_legacy_conversation_messages.sql +1 -0
- package/migrations/README.md +12 -9
- package/migrations/meta/0006_snapshot.json +948 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +11 -7
- package/dist/chunk-4YF7Z6IA.js +0 -1061
- package/dist/chunk-AUUOHQAT.js +0 -115
- package/dist/chunk-G3E7SCME.js +0 -28
- package/dist/chunk-YNP2ATQX.js +0 -1282
|
@@ -11,22 +11,22 @@ import {
|
|
|
11
11
|
getPlugins,
|
|
12
12
|
setPlugins,
|
|
13
13
|
validatePlugins
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-NVOTGWYX.js";
|
|
14
|
+
} from "./chunk-QY636HZU.js";
|
|
15
|
+
import "./chunk-OUHNWH46.js";
|
|
16
|
+
import "./chunk-RGX4V75M.js";
|
|
17
|
+
import "./chunk-FENLIFJD.js";
|
|
18
|
+
import "./chunk-TMBRFULF.js";
|
|
20
19
|
import "./chunk-4ZNGQH7C.js";
|
|
21
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-JNAVF45E.js";
|
|
22
21
|
import "./chunk-VFUK3X5B.js";
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-O3JMSZLI.js";
|
|
23
|
+
import "./chunk-SYAQIR5Z.js";
|
|
24
|
+
import "./chunk-PLB7MRCQ.js";
|
|
25
|
+
import "./chunk-ISMWX44P.js";
|
|
27
26
|
import "./chunk-OB42YVAE.js";
|
|
28
27
|
import "./chunk-6GWA276C.js";
|
|
29
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-IVVGFRQQ.js";
|
|
29
|
+
import "./chunk-OCD3OZRK.js";
|
|
30
30
|
import "./chunk-MLKGABMK.js";
|
|
31
31
|
export {
|
|
32
32
|
PluginHookDeniedError,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ConversationEvent } from "@/chat/conversations/history";
|
|
2
2
|
import { type ConversationReportEvent } from "./schema";
|
|
3
3
|
/** Canonical event types that can contribute to the reporting projection. */
|
|
4
|
-
export declare const conversationReportSourceEventTypes: readonly ["message", "message_handled", "tool_execution_started", "turn_started", "turn_completed", "turn_failed", "compaction", "handoff", "subagent_started", "subagent_ended"];
|
|
4
|
+
export declare const conversationReportSourceEventTypes: readonly ["message", "message_handled", "agent_step", "tool_execution_started", "turn_started", "turn_completed", "turn_failed", "compaction", "handoff", "subagent_started", "subagent_ended"];
|
|
5
5
|
/**
|
|
6
6
|
* Project canonical events into the ordered reporting boundary.
|
|
7
7
|
*
|
|
@@ -84,6 +84,7 @@ declare function conversationRows(db: JuniorDatabase, limit: number, actorEmail?
|
|
|
84
84
|
identityProvider: string | null;
|
|
85
85
|
identitySubjectId: string | null;
|
|
86
86
|
identityTenantId: string | null;
|
|
87
|
+
userDisplayName: string | null;
|
|
87
88
|
}[]>;
|
|
88
89
|
type ConversationRow = Awaited<ReturnType<typeof conversationRows>>[number];
|
|
89
90
|
/** Read one normalized conversation record directly from its SQL row. */
|
|
@@ -94,6 +94,7 @@ export declare const conversationReportEventDataSchema: z.ZodDiscriminatedUnion<
|
|
|
94
94
|
user: "user";
|
|
95
95
|
assistant: "assistant";
|
|
96
96
|
}>;
|
|
97
|
+
eventType: z.ZodOptional<z.ZodString>;
|
|
97
98
|
text: z.ZodOptional<z.ZodString>;
|
|
98
99
|
redacted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
99
100
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -101,7 +102,23 @@ export declare const conversationReportEventDataSchema: z.ZodDiscriminatedUnion<
|
|
|
101
102
|
messageId: z.ZodString;
|
|
102
103
|
}, z.core.$strict>, z.ZodObject<{
|
|
103
104
|
type: z.ZodLiteral<"tool_started">;
|
|
105
|
+
toolCallId: z.ZodString;
|
|
104
106
|
name: z.ZodString;
|
|
107
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
108
|
+
type: z.ZodLiteral<"tool_calls">;
|
|
109
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
110
|
+
toolCallId: z.ZodString;
|
|
111
|
+
name: z.ZodString;
|
|
112
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
113
|
+
}, z.core.$strict>>;
|
|
114
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
115
|
+
type: z.ZodLiteral<"tool_result">;
|
|
116
|
+
toolCallId: z.ZodString;
|
|
117
|
+
outcome: z.ZodEnum<{
|
|
118
|
+
error: "error";
|
|
119
|
+
completed: "completed";
|
|
120
|
+
}>;
|
|
121
|
+
output: z.ZodOptional<z.ZodUnknown>;
|
|
105
122
|
}, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
106
123
|
type: z.ZodLiteral<"turn_lifecycle">;
|
|
107
124
|
turnId: z.ZodString;
|
|
@@ -122,12 +139,12 @@ export declare const conversationReportEventDataSchema: z.ZodDiscriminatedUnion<
|
|
|
122
139
|
type: z.ZodLiteral<"compaction">;
|
|
123
140
|
}, z.core.$strict>, z.ZodObject<{
|
|
124
141
|
type: z.ZodLiteral<"handoff">;
|
|
125
|
-
|
|
142
|
+
triggeringToolCallId: z.ZodOptional<z.ZodString>;
|
|
126
143
|
}, z.core.$strict>, z.ZodObject<{
|
|
127
144
|
type: z.ZodLiteral<"subagent_started">;
|
|
128
145
|
childConversationId: z.ZodString;
|
|
129
146
|
subagentKind: z.ZodString;
|
|
130
|
-
|
|
147
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
131
148
|
}, z.core.$strict>, z.ZodObject<{
|
|
132
149
|
type: z.ZodLiteral<"subagent_ended">;
|
|
133
150
|
startedSeq: z.ZodNumber;
|
|
@@ -149,6 +166,7 @@ export declare const conversationReportEventSchema: z.ZodObject<{
|
|
|
149
166
|
user: "user";
|
|
150
167
|
assistant: "assistant";
|
|
151
168
|
}>;
|
|
169
|
+
eventType: z.ZodOptional<z.ZodString>;
|
|
152
170
|
text: z.ZodOptional<z.ZodString>;
|
|
153
171
|
redacted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
154
172
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -156,7 +174,23 @@ export declare const conversationReportEventSchema: z.ZodObject<{
|
|
|
156
174
|
messageId: z.ZodString;
|
|
157
175
|
}, z.core.$strict>, z.ZodObject<{
|
|
158
176
|
type: z.ZodLiteral<"tool_started">;
|
|
177
|
+
toolCallId: z.ZodString;
|
|
159
178
|
name: z.ZodString;
|
|
179
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
180
|
+
type: z.ZodLiteral<"tool_calls">;
|
|
181
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
182
|
+
toolCallId: z.ZodString;
|
|
183
|
+
name: z.ZodString;
|
|
184
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
185
|
+
}, z.core.$strict>>;
|
|
186
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
187
|
+
type: z.ZodLiteral<"tool_result">;
|
|
188
|
+
toolCallId: z.ZodString;
|
|
189
|
+
outcome: z.ZodEnum<{
|
|
190
|
+
error: "error";
|
|
191
|
+
completed: "completed";
|
|
192
|
+
}>;
|
|
193
|
+
output: z.ZodOptional<z.ZodUnknown>;
|
|
160
194
|
}, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
161
195
|
type: z.ZodLiteral<"turn_lifecycle">;
|
|
162
196
|
turnId: z.ZodString;
|
|
@@ -177,12 +211,12 @@ export declare const conversationReportEventSchema: z.ZodObject<{
|
|
|
177
211
|
type: z.ZodLiteral<"compaction">;
|
|
178
212
|
}, z.core.$strict>, z.ZodObject<{
|
|
179
213
|
type: z.ZodLiteral<"handoff">;
|
|
180
|
-
|
|
214
|
+
triggeringToolCallId: z.ZodOptional<z.ZodString>;
|
|
181
215
|
}, z.core.$strict>, z.ZodObject<{
|
|
182
216
|
type: z.ZodLiteral<"subagent_started">;
|
|
183
217
|
childConversationId: z.ZodString;
|
|
184
218
|
subagentKind: z.ZodString;
|
|
185
|
-
|
|
219
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
186
220
|
}, z.core.$strict>, z.ZodObject<{
|
|
187
221
|
type: z.ZodLiteral<"subagent_ended">;
|
|
188
222
|
startedSeq: z.ZodNumber;
|
|
@@ -296,6 +330,7 @@ export declare const conversationDetailReportSchema: z.ZodObject<{
|
|
|
296
330
|
user: "user";
|
|
297
331
|
assistant: "assistant";
|
|
298
332
|
}>;
|
|
333
|
+
eventType: z.ZodOptional<z.ZodString>;
|
|
299
334
|
text: z.ZodOptional<z.ZodString>;
|
|
300
335
|
redacted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
301
336
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -303,7 +338,23 @@ export declare const conversationDetailReportSchema: z.ZodObject<{
|
|
|
303
338
|
messageId: z.ZodString;
|
|
304
339
|
}, z.core.$strict>, z.ZodObject<{
|
|
305
340
|
type: z.ZodLiteral<"tool_started">;
|
|
341
|
+
toolCallId: z.ZodString;
|
|
306
342
|
name: z.ZodString;
|
|
343
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
344
|
+
type: z.ZodLiteral<"tool_calls">;
|
|
345
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
346
|
+
toolCallId: z.ZodString;
|
|
347
|
+
name: z.ZodString;
|
|
348
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
349
|
+
}, z.core.$strict>>;
|
|
350
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
351
|
+
type: z.ZodLiteral<"tool_result">;
|
|
352
|
+
toolCallId: z.ZodString;
|
|
353
|
+
outcome: z.ZodEnum<{
|
|
354
|
+
error: "error";
|
|
355
|
+
completed: "completed";
|
|
356
|
+
}>;
|
|
357
|
+
output: z.ZodOptional<z.ZodUnknown>;
|
|
307
358
|
}, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
308
359
|
type: z.ZodLiteral<"turn_lifecycle">;
|
|
309
360
|
turnId: z.ZodString;
|
|
@@ -324,12 +375,12 @@ export declare const conversationDetailReportSchema: z.ZodObject<{
|
|
|
324
375
|
type: z.ZodLiteral<"compaction">;
|
|
325
376
|
}, z.core.$strict>, z.ZodObject<{
|
|
326
377
|
type: z.ZodLiteral<"handoff">;
|
|
327
|
-
|
|
378
|
+
triggeringToolCallId: z.ZodOptional<z.ZodString>;
|
|
328
379
|
}, z.core.$strict>, z.ZodObject<{
|
|
329
380
|
type: z.ZodLiteral<"subagent_started">;
|
|
330
381
|
childConversationId: z.ZodString;
|
|
331
382
|
subagentKind: z.ZodString;
|
|
332
|
-
|
|
383
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
333
384
|
}, z.core.$strict>, z.ZodObject<{
|
|
334
385
|
type: z.ZodLiteral<"subagent_ended">;
|
|
335
386
|
startedSeq: z.ZodNumber;
|
package/dist/api/schema.js
CHANGED
package/dist/api.js
CHANGED
|
@@ -12,14 +12,14 @@ import {
|
|
|
12
12
|
locationDirectoryReportSchema,
|
|
13
13
|
locationParamsSchema,
|
|
14
14
|
personParamsSchema
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-HHVY4SMP.js";
|
|
16
16
|
import {
|
|
17
17
|
buildSentryConversationUrl,
|
|
18
18
|
formatSlackConversationRedactedLabel,
|
|
19
19
|
readConversationEventPrivacySnapshot,
|
|
20
20
|
readHealthReport,
|
|
21
21
|
resolveSlackConversationContextFromThreadId
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-FWJRXN4F.js";
|
|
23
23
|
import {
|
|
24
24
|
pluginOperationalReportFeedSchema,
|
|
25
25
|
pluginReportsSchema,
|
|
@@ -31,18 +31,20 @@ import {
|
|
|
31
31
|
hasAgentTurnUsage
|
|
32
32
|
} from "./chunk-MU6HHZEN.js";
|
|
33
33
|
import "./chunk-PDO5BLNM.js";
|
|
34
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-RGX4V75M.js";
|
|
35
35
|
import {
|
|
36
36
|
decodeStoredConversationEvent,
|
|
37
37
|
getDb,
|
|
38
|
-
getSqlExecutor
|
|
38
|
+
getSqlExecutor
|
|
39
|
+
} from "./chunk-FENLIFJD.js";
|
|
40
|
+
import {
|
|
39
41
|
juniorConversationEvents,
|
|
40
42
|
juniorConversations,
|
|
41
43
|
juniorIdentities,
|
|
42
44
|
juniorUsers
|
|
43
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-TMBRFULF.js";
|
|
44
46
|
import "./chunk-4ZNGQH7C.js";
|
|
45
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-JNAVF45E.js";
|
|
46
48
|
import {
|
|
47
49
|
juniorDestinations
|
|
48
50
|
} from "./chunk-VFUK3X5B.js";
|
|
@@ -50,12 +52,13 @@ import {
|
|
|
50
52
|
canExposeConversationPayload,
|
|
51
53
|
parseSlackThreadId,
|
|
52
54
|
resolveConversationPrivacy
|
|
53
|
-
} from "./chunk-
|
|
54
|
-
import "./chunk-
|
|
55
|
-
import "./chunk-
|
|
55
|
+
} from "./chunk-O3JMSZLI.js";
|
|
56
|
+
import "./chunk-SYAQIR5Z.js";
|
|
57
|
+
import "./chunk-ISMWX44P.js";
|
|
56
58
|
import "./chunk-OB42YVAE.js";
|
|
57
59
|
import "./chunk-6GWA276C.js";
|
|
58
|
-
import "./chunk-
|
|
60
|
+
import "./chunk-IVVGFRQQ.js";
|
|
61
|
+
import "./chunk-OCD3OZRK.js";
|
|
59
62
|
import "./chunk-MLKGABMK.js";
|
|
60
63
|
|
|
61
64
|
// src/api.ts
|
|
@@ -260,9 +263,11 @@ async function readConversationModelUsageFromSql(executor, conversationId) {
|
|
|
260
263
|
}
|
|
261
264
|
|
|
262
265
|
// src/api/conversations/events.ts
|
|
266
|
+
import { z as z2 } from "zod";
|
|
263
267
|
var conversationReportSourceEventTypes = [
|
|
264
268
|
"message",
|
|
265
269
|
"message_handled",
|
|
270
|
+
"agent_step",
|
|
266
271
|
"tool_execution_started",
|
|
267
272
|
"turn_started",
|
|
268
273
|
"turn_completed",
|
|
@@ -272,6 +277,80 @@ var conversationReportSourceEventTypes = [
|
|
|
272
277
|
"subagent_started",
|
|
273
278
|
"subagent_ended"
|
|
274
279
|
];
|
|
280
|
+
var reportingAssistantMessageSchema = z2.object({
|
|
281
|
+
role: z2.literal("assistant"),
|
|
282
|
+
content: z2.array(z2.unknown())
|
|
283
|
+
}).passthrough();
|
|
284
|
+
var reportingToolCallPartSchema = z2.object({
|
|
285
|
+
type: z2.literal("toolCall"),
|
|
286
|
+
id: z2.string().min(1),
|
|
287
|
+
name: z2.string().min(1),
|
|
288
|
+
arguments: z2.unknown()
|
|
289
|
+
}).passthrough();
|
|
290
|
+
var reportingToolResultMessageSchema = z2.object({
|
|
291
|
+
role: z2.literal("toolResult"),
|
|
292
|
+
toolCallId: z2.string().min(1),
|
|
293
|
+
content: z2.array(z2.unknown()),
|
|
294
|
+
details: z2.unknown().optional(),
|
|
295
|
+
isError: z2.boolean().optional()
|
|
296
|
+
}).passthrough();
|
|
297
|
+
var reportingToolResultDetailsSchema = z2.object({
|
|
298
|
+
ok: z2.boolean().optional(),
|
|
299
|
+
status: z2.string().optional()
|
|
300
|
+
}).passthrough();
|
|
301
|
+
var reportingTextPartSchema = z2.object({ type: z2.literal("text"), text: z2.string() }).passthrough();
|
|
302
|
+
var reportingMediaPartSchema = z2.object({
|
|
303
|
+
type: z2.enum(["image", "audio"]),
|
|
304
|
+
mimeType: z2.string().min(1).optional()
|
|
305
|
+
}).passthrough();
|
|
306
|
+
function sanitizeModelContentPart(value) {
|
|
307
|
+
const text = reportingTextPartSchema.safeParse(value);
|
|
308
|
+
if (text.success) return { type: "text", text: text.data.text };
|
|
309
|
+
const media = reportingMediaPartSchema.safeParse(value);
|
|
310
|
+
if (!media.success) return void 0;
|
|
311
|
+
return {
|
|
312
|
+
type: media.data.type,
|
|
313
|
+
...media.data.mimeType ? { mimeType: media.data.mimeType } : {}
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
function modelVisibleToolOutput(content) {
|
|
317
|
+
const sanitized = content.map(sanitizeModelContentPart).filter((part) => part !== void 0);
|
|
318
|
+
if (sanitized.length === 0) return void 0;
|
|
319
|
+
if (sanitized.length !== 1) return sanitized;
|
|
320
|
+
const only = sanitized[0];
|
|
321
|
+
return only.type === "text" ? only.text : only;
|
|
322
|
+
}
|
|
323
|
+
function reportToolCalls(args) {
|
|
324
|
+
const message2 = reportingAssistantMessageSchema.safeParse(args.message);
|
|
325
|
+
if (!message2.success) return void 0;
|
|
326
|
+
const calls = message2.data.content.flatMap((part) => {
|
|
327
|
+
const call = reportingToolCallPartSchema.safeParse(part);
|
|
328
|
+
if (!call.success) return [];
|
|
329
|
+
return [
|
|
330
|
+
{
|
|
331
|
+
toolCallId: call.data.id,
|
|
332
|
+
name: call.data.name,
|
|
333
|
+
...args.canExposePayload && call.data.arguments !== void 0 ? { input: call.data.arguments } : {}
|
|
334
|
+
}
|
|
335
|
+
];
|
|
336
|
+
});
|
|
337
|
+
return calls.length > 0 ? { type: "tool_calls", calls } : void 0;
|
|
338
|
+
}
|
|
339
|
+
function reportToolResult(args) {
|
|
340
|
+
const message2 = reportingToolResultMessageSchema.safeParse(args.message);
|
|
341
|
+
if (!message2.success) return void 0;
|
|
342
|
+
const details = reportingToolResultDetailsSchema.safeParse(
|
|
343
|
+
message2.data.details
|
|
344
|
+
);
|
|
345
|
+
const outcome = message2.data.isError === true || details.success && (details.data.ok === false || details.data.status === "error") ? "error" : "completed";
|
|
346
|
+
const output = modelVisibleToolOutput(message2.data.content);
|
|
347
|
+
return {
|
|
348
|
+
type: "tool_result",
|
|
349
|
+
toolCallId: message2.data.toolCallId,
|
|
350
|
+
outcome,
|
|
351
|
+
...args.canExposePayload && output !== void 0 ? { output } : {}
|
|
352
|
+
};
|
|
353
|
+
}
|
|
275
354
|
function reportEventData(args) {
|
|
276
355
|
const { data } = args;
|
|
277
356
|
switch (data.type) {
|
|
@@ -280,6 +359,7 @@ function reportEventData(args) {
|
|
|
280
359
|
type: "message",
|
|
281
360
|
messageId: data.messageId,
|
|
282
361
|
role: data.role,
|
|
362
|
+
...typeof data.meta?.eventType === "string" ? { eventType: data.meta.eventType } : {},
|
|
283
363
|
...args.canExposePayload ? { text: data.text } : { redacted: true }
|
|
284
364
|
};
|
|
285
365
|
case "message_handled":
|
|
@@ -314,21 +394,28 @@ function reportEventData(args) {
|
|
|
314
394
|
}
|
|
315
395
|
function projectConversationReportEvents(args) {
|
|
316
396
|
const subagentStarts = /* @__PURE__ */ new Map();
|
|
317
|
-
const toolStarts = /* @__PURE__ */ new Map();
|
|
318
397
|
const projected = [];
|
|
319
398
|
for (const event of args.events) {
|
|
320
399
|
let data;
|
|
321
|
-
if (event.data.type === "
|
|
322
|
-
|
|
323
|
-
|
|
400
|
+
if (event.data.type === "agent_step") {
|
|
401
|
+
const reportArgs = {
|
|
402
|
+
canExposePayload: args.canExposePayload,
|
|
403
|
+
message: event.data.message
|
|
404
|
+
};
|
|
405
|
+
data = reportToolCalls(reportArgs) ?? reportToolResult(reportArgs);
|
|
406
|
+
} else if (event.data.type === "tool_execution_started") {
|
|
407
|
+
data = {
|
|
408
|
+
type: "tool_started",
|
|
409
|
+
toolCallId: event.data.toolCallId,
|
|
410
|
+
name: event.data.toolName
|
|
411
|
+
};
|
|
324
412
|
} else if (event.data.type === "subagent_started") {
|
|
325
413
|
subagentStarts.set(event.data.subagentInvocationId, event.seq);
|
|
326
|
-
const toolStartedSeq = event.data.parentToolCallId ? toolStarts.get(event.data.parentToolCallId) : void 0;
|
|
327
414
|
data = {
|
|
328
415
|
type: "subagent_started",
|
|
329
416
|
childConversationId: event.data.childConversationId,
|
|
330
417
|
subagentKind: event.data.subagentKind,
|
|
331
|
-
...
|
|
418
|
+
...event.data.parentToolCallId ? { parentToolCallId: event.data.parentToolCallId } : {}
|
|
332
419
|
};
|
|
333
420
|
} else if (event.data.type === "subagent_ended") {
|
|
334
421
|
const startedSeq = subagentStarts.get(event.data.subagentInvocationId);
|
|
@@ -340,10 +427,9 @@ function projectConversationReportEvents(args) {
|
|
|
340
427
|
};
|
|
341
428
|
}
|
|
342
429
|
} else if (event.data.type === "handoff") {
|
|
343
|
-
const toolStartedSeq = event.data.triggeringToolCallId ? toolStarts.get(event.data.triggeringToolCallId) : void 0;
|
|
344
430
|
data = {
|
|
345
431
|
type: "handoff",
|
|
346
|
-
...
|
|
432
|
+
...event.data.triggeringToolCallId ? { triggeringToolCallId: event.data.triggeringToolCallId } : {}
|
|
347
433
|
};
|
|
348
434
|
} else {
|
|
349
435
|
data = reportEventData({
|
|
@@ -516,14 +602,15 @@ async function conversationRows(db, limit, actorEmail) {
|
|
|
516
602
|
identityHandle: juniorIdentities.handle,
|
|
517
603
|
identityProvider: juniorIdentities.provider,
|
|
518
604
|
identitySubjectId: juniorIdentities.providerSubjectId,
|
|
519
|
-
identityTenantId: juniorIdentities.providerTenantId
|
|
605
|
+
identityTenantId: juniorIdentities.providerTenantId,
|
|
606
|
+
userDisplayName: juniorUsers.displayName
|
|
520
607
|
}).from(juniorConversations).leftJoin(
|
|
521
608
|
juniorDestinations,
|
|
522
609
|
eq3(juniorDestinations.id, juniorConversations.destinationId)
|
|
523
610
|
).leftJoin(
|
|
524
611
|
juniorIdentities,
|
|
525
612
|
eq3(juniorIdentities.id, juniorConversations.actorIdentityId)
|
|
526
|
-
).where(
|
|
613
|
+
).leftJoin(juniorUsers, eq3(juniorUsers.id, juniorIdentities.userId)).where(
|
|
527
614
|
and3(
|
|
528
615
|
isNull(juniorConversations.parentConversationId),
|
|
529
616
|
isNull(juniorConversations.archivedAt),
|
|
@@ -539,10 +626,11 @@ async function conversationRows(db, limit, actorEmail) {
|
|
|
539
626
|
}
|
|
540
627
|
function conversationFromRow(row) {
|
|
541
628
|
const value = row.conversation;
|
|
629
|
+
const actorFullName = row.userDisplayName?.trim() ? row.userDisplayName : row.identityDisplayName;
|
|
542
630
|
const actor = row.identityProvider === "slack" ? {
|
|
543
631
|
platform: "slack",
|
|
544
632
|
...row.identityEmail ? { email: row.identityEmail } : {},
|
|
545
|
-
...
|
|
633
|
+
...actorFullName ? { fullName: actorFullName } : {},
|
|
546
634
|
...row.identitySubjectId ? { slackUserId: row.identitySubjectId } : {},
|
|
547
635
|
...row.identityHandle ? { slackUserName: row.identityHandle } : {},
|
|
548
636
|
...row.identityTenantId ? { teamId: row.identityTenantId } : {}
|
|
@@ -580,14 +668,15 @@ async function readConversationRecordFromSql(conversationId) {
|
|
|
580
668
|
identityHandle: juniorIdentities.handle,
|
|
581
669
|
identityProvider: juniorIdentities.provider,
|
|
582
670
|
identitySubjectId: juniorIdentities.providerSubjectId,
|
|
583
|
-
identityTenantId: juniorIdentities.providerTenantId
|
|
671
|
+
identityTenantId: juniorIdentities.providerTenantId,
|
|
672
|
+
userDisplayName: juniorUsers.displayName
|
|
584
673
|
}).from(juniorConversations).leftJoin(
|
|
585
674
|
juniorDestinations,
|
|
586
675
|
eq3(juniorDestinations.id, juniorConversations.destinationId)
|
|
587
676
|
).leftJoin(
|
|
588
677
|
juniorIdentities,
|
|
589
678
|
eq3(juniorIdentities.id, juniorConversations.actorIdentityId)
|
|
590
|
-
).where(eq3(juniorConversations.conversationId, conversationId)).limit(1);
|
|
679
|
+
).leftJoin(juniorUsers, eq3(juniorUsers.id, juniorIdentities.userId)).where(eq3(juniorConversations.conversationId, conversationId)).limit(1);
|
|
591
680
|
const row = rows[0];
|
|
592
681
|
return row ? {
|
|
593
682
|
conversation: conversationFromRow(row),
|
|
@@ -1812,7 +1901,7 @@ function readDescriptionText(home) {
|
|
|
1812
1901
|
}
|
|
1813
1902
|
}
|
|
1814
1903
|
async function readSkillReports() {
|
|
1815
|
-
const { discoverSkills } = await import("./skills-
|
|
1904
|
+
const { discoverSkills } = await import("./skills-U6MDAST7.js");
|
|
1816
1905
|
const skills = await discoverSkills();
|
|
1817
1906
|
return skillReportsSchema.parse(
|
|
1818
1907
|
skills.map((skill) => ({
|
|
@@ -1822,7 +1911,7 @@ async function readSkillReports() {
|
|
|
1822
1911
|
);
|
|
1823
1912
|
}
|
|
1824
1913
|
async function readPluginReports() {
|
|
1825
|
-
const { pluginCatalogRuntime } = await import("./catalog-runtime-
|
|
1914
|
+
const { pluginCatalogRuntime } = await import("./catalog-runtime-DMGJSLV2.js");
|
|
1826
1915
|
return pluginReportsSchema.parse(
|
|
1827
1916
|
pluginCatalogRuntime.getProviders().map((plugin) => ({
|
|
1828
1917
|
name: plugin.manifest.name
|
|
@@ -1832,7 +1921,7 @@ async function readPluginReports() {
|
|
|
1832
1921
|
async function readRuntimeInfoReport() {
|
|
1833
1922
|
const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
|
|
1834
1923
|
import("./discovery-RMHYSRL7.js"),
|
|
1835
|
-
import("./catalog-runtime-
|
|
1924
|
+
import("./catalog-runtime-DMGJSLV2.js"),
|
|
1836
1925
|
readPluginReports(),
|
|
1837
1926
|
readSkillReports()
|
|
1838
1927
|
]);
|
|
@@ -1848,7 +1937,7 @@ async function readRuntimeInfoReport() {
|
|
|
1848
1937
|
}
|
|
1849
1938
|
async function readPluginOperationalReportFeed() {
|
|
1850
1939
|
const nowMs = Date.now();
|
|
1851
|
-
const { getPluginOperationalReports } = await import("./agent-hooks-
|
|
1940
|
+
const { getPluginOperationalReports } = await import("./agent-hooks-FHHVLNPA.js");
|
|
1852
1941
|
return pluginOperationalReportFeedSchema.parse({
|
|
1853
1942
|
source: "plugins",
|
|
1854
1943
|
generatedAt: new Date(nowMs).toISOString(),
|
package/dist/app.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { type JuniorPluginSet } from "./plugins";
|
|
|
3
3
|
import { type VercelConversationWorkCallbackOptions } from "@/chat/task-execution/vercel-callback";
|
|
4
4
|
import type { WaitUntilFn } from "@/handlers/types";
|
|
5
5
|
export { defineJuniorPlugins } from "./plugins";
|
|
6
|
+
export { JUNIOR_VERSION } from "./version";
|
|
6
7
|
export type { JuniorPluginInput, JuniorPluginSet, JuniorPluginSetOptions, } from "./plugins";
|
|
7
8
|
export interface JuniorAppOptions {
|
|
8
9
|
/** Authenticated dashboard mounted by core when configured. */
|