@sentry/junior 0.257.0 → 0.259.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/{actor-BTtLaeWy.js → actor-tlxzqaRe.js} +3 -6
- package/dist/adapter-Bn0gFVSF.js +270 -0
- package/dist/{admin-DgIkm6Vy.js → admin-C8xz2f10.js} +2 -3
- package/dist/{agent-hooks-BjtTzvru.js → agent-hooks-B00FaKdP.js} +70 -109
- package/dist/{agent-invocations-Bdu3ROfo.js → agent-invocations-Qfz7dWgU.js} +6 -12
- package/dist/{agent-runner-D7OboVb3.js → agent-runner-CPSd7rKm.js} +324 -742
- package/dist/api/schema.d.ts +442 -447
- package/dist/api/schema.js +6 -6
- package/dist/api.d.ts +2 -12
- package/dist/api.js +165 -158
- package/dist/{app-BsU5QNBd.d.ts → app-Bbxrehjf.d.ts} +25 -45
- package/dist/app.d.ts +3 -3
- package/dist/app.js +206 -321
- package/dist/{assistant-reply-CbTPebzL.js → assistant-reply-CqthTerd.js} +3 -5
- package/dist/{automation-CHdlHVZP.js → automation-DWBFBenG.js} +6 -11
- package/dist/{briefs-oLOldnDM.js → briefs-DNYbQ9cD.js} +8 -11
- package/dist/{cadence-D00SCzT1.js → cadence-R7Em4RjE.js} +1 -2
- package/dist/{catalog-runtime-CZzhGQ7F.js → catalog-runtime-B8SuFPGb.js} +3 -4
- package/dist/cli/chat.d.ts +2 -4
- package/dist/cli/chat.js +22 -24
- package/dist/cli/check.d.ts +1 -3
- package/dist/cli/check.js +4 -5
- package/dist/cli/env.d.ts +1 -3
- package/dist/cli/env.js +1 -2
- package/dist/cli/init.d.ts +1 -3
- package/dist/cli/init.js +3 -3
- package/dist/cli/main.d.ts +1 -3
- package/dist/cli/main.js +8 -5
- package/dist/cli/plugins.d.ts +2 -4
- package/dist/cli/plugins.js +7 -8
- package/dist/cli/run.d.ts +3 -3
- package/dist/cli/run.js +3 -3
- package/dist/cli/snapshot-create.d.ts +1 -3
- package/dist/cli/snapshot-create.js +5 -5
- package/dist/cli/upgrade.d.ts +3 -6
- package/dist/cli/upgrade.js +11 -17
- package/dist/{client-D8HnkOQX.js → client-BZdxgKyL.js} +64 -18
- package/dist/{config-CJRnWK9H.js → config-Deqpfpg9.js} +21 -15
- package/dist/{connections-ClYrKzpX.js → connections-9gJkfS85.js} +179 -20
- package/dist/{conversation-CKNLYBJt.js → conversation-DjN3mlog.js} +8 -15
- package/dist/{conversation-privacy-C8b1nphZ.js → conversation-privacy-CFhNKxp-.js} +2 -3
- package/dist/{conversation-work-C6y3T5Hx.js → conversation-work-BaT_T6EB.js} +1 -2
- package/dist/{credential-sync-BXfohNmJ.js → credential-sync-BABGymK3.js} +23 -190
- package/dist/{db-Ca9Nt5ci.d.ts → db-BnRqQ7G5.d.ts} +1 -1
- package/dist/{executor-Do0THDRR.js → executor-Bb3eQb8q.js} +30 -52
- package/dist/{experimental-CQIvMUO7.js → experimental-BNK1l1jv.js} +2 -4
- package/dist/{history-9pO1Zd4Y.js → history-AY8rs-FR.js} +5 -9
- package/dist/{history-DvqWZlYX.d.ts → history-BgI33Kie.d.ts} +12 -20
- package/dist/{images-BN_BiBXF.js → images-BbSdVHC6.js} +5 -6
- package/dist/instrumentation.d.ts +1 -3
- package/dist/instrumentation.js +6 -8
- package/dist/{job-queue-B6SV9uVa.js → job-queue-vdGU-5ge.js} +6 -12
- package/dist/{logging-CWxiIuCF.js → logging-BStXN56b.js} +7 -12
- package/dist/{message-TUOdbSBW.js → message-DRf6m4uO.js} +5 -6
- package/dist/{model-profile-BwU8mqwD.js → model-profile-Bg8EoCKD.js} +2 -4
- package/dist/nitro.d.ts +3 -5
- package/dist/nitro.js +12 -17
- package/dist/{oauth-authorization-BA4Dt6a7.js → oauth-authorization-djQn5Nhy.js} +2 -4
- package/dist/{oauth-callback-server-Dj5UJODo.js → oauth-callback-server-JmOgLcGl.js} +3 -4
- package/dist/{oauth-relay-CdCnu80W.js → oauth-relay-CTygMkNx.js} +2 -3
- package/dist/{package-discovery-BVvSnQBB.js → package-discovery-DJBompdd.js} +17 -21
- package/dist/{pending-auth-s_QFribU.js → pending-auth-rG5U_QS1.js} +92 -83
- package/dist/{plugin-module-CVvEUSMH.js → plugin-module-Cf5gVPWP.js} +1 -2
- package/dist/{plugins-CjfUP5gJ.d.ts → plugins-B_0Cr0MO.d.ts} +5 -5
- package/dist/{plugins-egKWjgue.js → plugins-DOm9Y6qI.js} +2 -3
- package/dist/{private-trace-result-BLvBjy_e.js → private-trace-result-CE7_lEdq.js} +1 -2
- package/dist/{profile-h-72wM78.js → profile-qBM6B_-V.js} +14 -295
- package/dist/{prompt-DyoEj9c2.js → prompt-xgpyMtg7.js} +5 -9
- package/dist/{queue-B5SnqRln.d.ts → queue-C37RbDVc.d.ts} +0 -2
- package/dist/{registry-sLTr-sV9.js → registry-B_M_x_iS.js} +56 -30
- package/dist/{resolve-ncQPZROQ.js → resolve-BzpuLh8c.js} +8 -12
- package/dist/{result-C883vngT.js → result-DEZH_AnZ.js} +13 -17
- package/dist/{rolldown-runtime-B4FMCO8f.js → rolldown-runtime-nwUcYXjP.js} +1 -2
- package/dist/{runner-CzYImdOF.js → runner-BqQlG10t.js} +12 -13
- package/dist/{sandbox-egress-signals-CZbMINHI.js → sandbox-egress-signals-DCq3WLs5.js} +2 -3
- package/dist/{schema-Dy69D4Ge.js → schema-CF9HqNRY.js} +30 -27
- package/dist/{sentry-CgWZM_kV.js → sentry-BBUlHih9.js} +2 -3
- package/dist/service-account-BqTBkyD7.js +120 -0
- package/dist/service-account-BzhW7kXu.js +661 -0
- package/dist/{session-stop-CQjKd4a2.js → session-stop-CV65ZlU3.js} +23 -33
- package/dist/{skills-C22SLruK.js → skills-CiWS5_Ub.js} +9 -9
- package/dist/{spawn-DY9CLXDL.js → spawn-BSAQ7UQZ.js} +4 -5
- package/dist/{store-DXFIQy-G.js → store-B1GES4gC.js} +13 -15
- package/dist/{store-DoewL5mG.d.ts → store-CG0VJyye.d.ts} +0 -14
- package/dist/{task-queue-B17vV0La.js → task-queue-BAeGEMjJ.js} +5 -7
- package/dist/{task-runner-DUjvzYXj.js → task-runner-BlGhcQPi.js} +22 -26
- package/dist/{tasks-D_WIJtvO.js → tasks-DieKX3d4.js} +63 -78
- package/dist/{thread-state-Ch4yuCqG.js → thread-state-DpSWS4Rr.js} +13 -19
- package/dist/{turn-failure-response-C5nBKC4S.js → turn-failure-response-DQljogGJ.js} +16 -22
- package/dist/{turn-lifecycle-CO-ylUmV.js → turn-lifecycle-BLgrkV_L.js} +2 -3
- package/dist/{turn-session-routing-B3LWooK5.js → turn-session-routing-BlajheOU.js} +2 -3
- package/dist/{validation-CXYxaNYx.js → validation-23d7K9tX.js} +3 -4
- package/dist/vercel.d.ts +1 -3
- package/dist/vercel.js +1 -2
- package/dist/{version-BcdZy2zg.js → version-B_XumRx-.js} +3 -5
- package/dist/{version-CnXZ614E.d.ts → version-Cc2OFd9G.d.ts} +0 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -2
- package/dist/{viewer-DSZXygMU.js → viewer-B2_ABsYi.js} +26 -57
- package/dist/{web-input-B9Bv0_lR.js → web-input-BZDyxpzR.js} +101 -158
- package/dist/{web-message-id-xPI_EFSC.js → web-message-id-CJSUiksE.js} +3 -6
- package/dist/{work-nAfDSUFP.js → work-D3QKiV0O.js} +14 -16
- package/dist/{worker-vGXZ6XFT.js → worker-C8mUjYf9.js} +7 -8
- package/package.json +10 -9
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { J as abandonTurnRecord, ln as estimateTextTokens } from "./tasks-
|
|
3
|
-
import { r as isExperimentalFeatureEnabled } from "./experimental-
|
|
4
|
-
|
|
5
|
-
//#region src/chat/state/turn-id.ts
|
|
1
|
+
import { y as isProviderRetryError } from "./client-BZdxgKyL.js";
|
|
2
|
+
import { J as abandonTurnRecord, ln as estimateTextTokens } from "./tasks-DieKX3d4.js";
|
|
3
|
+
import { r as isExperimentalFeatureEnabled } from "./experimental-BNK1l1jv.js";
|
|
4
|
+
// src/chat/state/turn-id.ts
|
|
6
5
|
/** Build a stable turn identifier from a message ID. */
|
|
7
6
|
function buildDeterministicTurnId(messageId) {
|
|
8
7
|
return `turn_${messageId.replace(/[^a-zA-Z0-9_-]/g, "_")}`;
|
|
@@ -11,8 +10,7 @@ function buildDeterministicTurnId(messageId) {
|
|
|
11
10
|
function buildDeterministicAssistantMessageId(turnId) {
|
|
12
11
|
return `${turnId}:assistant:1`;
|
|
13
12
|
}
|
|
14
|
-
|
|
15
|
-
//#region src/chat/services/subscribed-reply-router-policy.ts
|
|
13
|
+
// src/chat/services/subscribed-reply-router-policy.ts
|
|
16
14
|
/**
|
|
17
15
|
* Passive subscribed-thread reply router policy.
|
|
18
16
|
*
|
|
@@ -26,7 +24,7 @@ function buildDeterministicAssistantMessageId(turnId) {
|
|
|
26
24
|
*/
|
|
27
25
|
function buildSubscribedReplyRouterPolicy(assistantName) {
|
|
28
26
|
return `You are judging whether the Slack assistant named ${assistantName} should reply to one latest message in a subscribed thread.
|
|
29
|
-
Assess conversation floor ownership and whether the latest message continues work ${assistantName} was already doing.
|
|
27
|
+
Assess conversation floor ownership and whether the latest message continues work ${assistantName} was already doing. Choose the route only after that assessment. Your primary objective is to re-engage when the thread is still talking to ${assistantName}, while staying quiet for human-to-human side conversation.
|
|
30
28
|
|
|
31
29
|
# Evidence Handling
|
|
32
30
|
- Core-supplied routing signals and the assistant name are authoritative facts.
|
|
@@ -43,37 +41,54 @@ Assess conversation floor ownership and whether the latest message continues wor
|
|
|
43
41
|
- If one or more humans spoke after ${assistantName}, the floor is human-to-human unless the latest message turns back to ${assistantName} or clearly continues work ${assistantName} was already handling.
|
|
44
42
|
- Shared topic vocabulary alone does not give ${assistantName} the floor.
|
|
45
43
|
- Explicit @mentions of another person usually mean the floor is not with ${assistantName}, unless the message also clearly asks ${assistantName} to act.
|
|
44
|
+
- A message that starts by addressing another person by name is aimed at that person, not at ${assistantName}.
|
|
45
|
+
- After one human addresses another human, later messages from either of them stay in that human exchange until one of them clearly turns back to ${assistantName}.
|
|
46
46
|
|
|
47
47
|
# Reply Policy
|
|
48
|
-
-
|
|
49
|
-
-
|
|
48
|
+
- route=reply when the latest message is explicitly aimed at ${assistantName}.
|
|
49
|
+
- route=reply when the latest message is a natural follow-up to ${assistantName}'s prior question, answer, analysis, plan, or requested next step.
|
|
50
50
|
- Natural follow-ups include questions, corrections, added constraints, choices, requests to act, and topic-specific continuations, even without words like "you" or "${assistantName}".
|
|
51
|
-
- Terse continuations such as "which one?", "why?", "what about auth?", "is that the right approach?", or "can you check on this?" can be
|
|
52
|
-
- Attachment-only messages can be
|
|
53
|
-
-
|
|
54
|
-
-
|
|
51
|
+
- Terse continuations such as "which one?", "why?", "what about auth?", "is that the right approach?", or "can you check on this?" can be route=reply when they continue ${assistantName}'s immediately preceding contribution.
|
|
52
|
+
- Attachment-only messages can be route=reply when the thread context makes them a continuation of work ${assistantName} was doing.
|
|
53
|
+
- route=stay_quiet for acknowledgments, reactions, status chatter, and team coordination that do not ask ${assistantName} to continue.
|
|
54
|
+
- route=stay_quiet when the latest message is plainly human-to-human, even if it discusses the same project.
|
|
55
55
|
|
|
56
56
|
# Unsubscribe Policy
|
|
57
|
-
-
|
|
58
|
-
- If should_unsubscribe=true, should_reply must be false.
|
|
57
|
+
- route=unsubscribe when the latest message clearly tells ${assistantName} to stop or leave the thread.
|
|
59
58
|
- Ordinary disagreement, correction, or "not yet" is not an unsubscribe.
|
|
60
59
|
|
|
61
60
|
# Decision Policy
|
|
62
|
-
- Prefer
|
|
63
|
-
- Prefer
|
|
64
|
-
-
|
|
65
|
-
- Keep the reason to one concise sentence under 160 characters grounded in floor ownership or continuity.`;
|
|
61
|
+
- Prefer route=reply for clear continuations of ${assistantName}'s work.
|
|
62
|
+
- Prefer route=stay_quiet for clear side conversation.
|
|
63
|
+
- Spread probability across routes only for genuinely ambiguous floor ownership. Do not lower the reply probability merely because the assistant was addressed implicitly.`;
|
|
66
64
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
65
|
+
/** Build the decision question for one passive subscribed-thread message. */
|
|
66
|
+
function buildSubscribedReplyRouterQuestions(assistantName) {
|
|
67
|
+
return { route: {
|
|
68
|
+
type: "choice",
|
|
69
|
+
instructions: buildSubscribedReplyRouterPolicy(assistantName),
|
|
70
|
+
criteria: {
|
|
71
|
+
reply: `The latest message is aimed at ${assistantName}. It addresses ${assistantName}, or it continues ${assistantName}'s latest answer, question, or plan and no human-to-human exchange started after it.`,
|
|
72
|
+
stay_quiet: `The latest message is aimed at another person or at the room. It addresses someone else by name or @mention, continues a human-to-human exchange, only shares topic words with earlier ${assistantName} messages, or is an acknowledgment or status chatter.`,
|
|
73
|
+
unsubscribe: `The latest message clearly tells ${assistantName} to stop or leave the thread.`
|
|
74
|
+
}
|
|
75
|
+
} };
|
|
76
|
+
}
|
|
77
|
+
// src/chat/services/subscribed-decision.ts
|
|
78
|
+
/** Why the subscribed-thread router chose to reply or stay silent. */
|
|
79
|
+
const SubscribedReplyReason = {
|
|
80
|
+
ThreadOptOut: "thread_opt_out",
|
|
81
|
+
ExplicitMention: "explicit_mention",
|
|
82
|
+
DirectedFollowUp: "directed_follow_up",
|
|
83
|
+
DirectedToOtherParty: "directed_to_other_party",
|
|
84
|
+
EmptyMessage: "empty_message",
|
|
85
|
+
Classifier: "llm_classifier",
|
|
86
|
+
SideConversation: "side_conversation",
|
|
87
|
+
LowConfidence: "low_confidence",
|
|
88
|
+
ClassifierError: "classifier_error",
|
|
89
|
+
PassiveDisabled: "passive_disabled"
|
|
90
|
+
};
|
|
75
91
|
const ROUTER_CONFIDENCE_THRESHOLD = .7;
|
|
76
|
-
const ROUTER_CLASSIFIER_MAX_TOKENS = 400;
|
|
77
92
|
const MAX_MESSAGE_TRANSCRIPT_TOKENS = 1e4;
|
|
78
93
|
const MAX_MESSAGE_ENTRY_TOKENS = 2e3;
|
|
79
94
|
const RECENT_ASSISTANT_ENTRY_LIMIT = 40;
|
|
@@ -131,13 +146,13 @@ function getThreadStopDecision(args) {
|
|
|
131
146
|
if (hasBangStop(rawText, text)) return {
|
|
132
147
|
shouldReply: false,
|
|
133
148
|
shouldUnsubscribe: true,
|
|
134
|
-
reason:
|
|
149
|
+
reason: SubscribedReplyReason.ThreadOptOut,
|
|
135
150
|
reasonDetail: "!stop"
|
|
136
151
|
};
|
|
137
152
|
if (isBareStop(rawText, text)) return {
|
|
138
153
|
shouldReply: false,
|
|
139
154
|
shouldUnsubscribe: true,
|
|
140
|
-
reason:
|
|
155
|
+
reason: SubscribedReplyReason.ThreadOptOut,
|
|
141
156
|
reasonDetail: "stop"
|
|
142
157
|
};
|
|
143
158
|
}
|
|
@@ -167,7 +182,7 @@ function parseTranscriptMessages(conversationContext) {
|
|
|
167
182
|
const lines = conversationContext.split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
|
|
168
183
|
for (const line of lines) {
|
|
169
184
|
const match = line.match(TRANSCRIPT_MESSAGE_LINE_RE);
|
|
170
|
-
if (!match) continue;
|
|
185
|
+
if (!match?.[1]) continue;
|
|
171
186
|
const role = match[1].toLowerCase();
|
|
172
187
|
if (role !== "assistant" && role !== "user") continue;
|
|
173
188
|
messages.push({
|
|
@@ -279,11 +294,11 @@ function getSubscribedReplyPreflightDecision(args) {
|
|
|
279
294
|
if (!leadingOtherPartyAddress) return;
|
|
280
295
|
return {
|
|
281
296
|
shouldReply: false,
|
|
282
|
-
reason:
|
|
297
|
+
reason: SubscribedReplyReason.DirectedToOtherParty,
|
|
283
298
|
reasonDetail: leadingOtherPartyAddress
|
|
284
299
|
};
|
|
285
300
|
}
|
|
286
|
-
/** Decide whether to reply to a message in a subscribed thread using
|
|
301
|
+
/** Decide whether to reply to a message in a subscribed thread using a decision model. */
|
|
287
302
|
async function decideSubscribedThreadReply(args) {
|
|
288
303
|
const text = args.input.text.trim();
|
|
289
304
|
const rawText = args.input.rawText.trim();
|
|
@@ -303,36 +318,33 @@ async function decideSubscribedThreadReply(args) {
|
|
|
303
318
|
if (preflightDecision) return preflightDecision;
|
|
304
319
|
if (!text && !args.input.hasAttachments) return {
|
|
305
320
|
shouldReply: false,
|
|
306
|
-
reason:
|
|
321
|
+
reason: SubscribedReplyReason.EmptyMessage
|
|
307
322
|
};
|
|
308
323
|
if (args.input.isExplicitMention) return {
|
|
309
324
|
shouldReply: true,
|
|
310
|
-
reason:
|
|
325
|
+
reason: SubscribedReplyReason.ExplicitMention
|
|
311
326
|
};
|
|
312
327
|
if (!isExperimentalFeatureEnabled("passive-routing")) return {
|
|
313
328
|
shouldReply: false,
|
|
314
|
-
reason:
|
|
329
|
+
reason: SubscribedReplyReason.PassiveDisabled,
|
|
315
330
|
reasonDetail: "passive-routing"
|
|
316
331
|
};
|
|
317
332
|
if (!args.input.hasAttachments && isAcknowledgmentOnly(text)) return {
|
|
318
333
|
shouldReply: false,
|
|
319
|
-
reason:
|
|
334
|
+
reason: SubscribedReplyReason.SideConversation,
|
|
320
335
|
reasonDetail: "acknowledgment"
|
|
321
336
|
};
|
|
322
337
|
const evidence = buildRouterEvidence(args.input);
|
|
323
338
|
if (evidence.assistantWasLastSpeaker && evidence.humanMessagesSinceLastAssistant === 0 && !evidence.currentMessageHasAttachments && (evidence.currentMessageHasDirectedFollowUpCue || evidence.currentMessageIsTerseClarification)) return {
|
|
324
339
|
shouldReply: true,
|
|
325
|
-
reason:
|
|
340
|
+
reason: SubscribedReplyReason.DirectedFollowUp,
|
|
326
341
|
reasonDetail: evidence.currentMessageIsTerseClarification ? "immediate terse clarification" : "immediate directed follow-up cue"
|
|
327
342
|
};
|
|
328
343
|
try {
|
|
329
|
-
const result = await args.
|
|
344
|
+
const result = await args.completeDecision({
|
|
330
345
|
modelId: args.modelId,
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
temperature: 0,
|
|
334
|
-
system: buildSubscribedReplyRouterPolicy(args.botUserName),
|
|
335
|
-
prompt: buildRouterPrompt(rawText, evidence),
|
|
346
|
+
state: buildRouterPrompt(rawText, evidence),
|
|
347
|
+
questions: buildSubscribedReplyRouterQuestions(args.botUserName),
|
|
336
348
|
metadata: {
|
|
337
349
|
modelId: args.modelId,
|
|
338
350
|
threadId: args.input.context.threadId ?? "",
|
|
@@ -342,52 +354,50 @@ async function decideSubscribedThreadReply(args) {
|
|
|
342
354
|
},
|
|
343
355
|
promptName: "junior.passive_reply_route"
|
|
344
356
|
});
|
|
345
|
-
const parsed = replyDecisionSchema.parse(result.object);
|
|
346
|
-
const reason = parsed.reason?.trim() || "classifier";
|
|
347
|
-
if (parsed.should_unsubscribe) {
|
|
348
|
-
if (parsed.confidence < ROUTER_CONFIDENCE_THRESHOLD) return {
|
|
349
|
-
...result.costUsd !== void 0 ? { costUsd: result.costUsd } : void 0,
|
|
350
|
-
shouldReply: false,
|
|
351
|
-
reason: "low_confidence",
|
|
352
|
-
reasonDetail: `${parsed.confidence.toFixed(2)}: ${reason}`
|
|
353
|
-
};
|
|
354
|
-
return {
|
|
355
|
-
...result.costUsd !== void 0 ? { costUsd: result.costUsd } : void 0,
|
|
356
|
-
shouldReply: false,
|
|
357
|
-
shouldUnsubscribe: true,
|
|
358
|
-
reason: "thread_opt_out",
|
|
359
|
-
reasonDetail: reason
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
|
-
if (!parsed.should_reply) return {
|
|
363
|
-
...result.costUsd !== void 0 ? { costUsd: result.costUsd } : void 0,
|
|
364
|
-
shouldReply: false,
|
|
365
|
-
reason: "side_conversation",
|
|
366
|
-
reasonDetail: reason
|
|
367
|
-
};
|
|
368
|
-
if (parsed.confidence < ROUTER_CONFIDENCE_THRESHOLD) return {
|
|
369
|
-
...result.costUsd !== void 0 ? { costUsd: result.costUsd } : void 0,
|
|
370
|
-
shouldReply: false,
|
|
371
|
-
reason: "low_confidence",
|
|
372
|
-
reasonDetail: `${parsed.confidence.toFixed(2)}: ${reason}`
|
|
373
|
-
};
|
|
374
357
|
return {
|
|
375
358
|
...result.costUsd !== void 0 ? { costUsd: result.costUsd } : void 0,
|
|
376
|
-
|
|
377
|
-
reason: "llm_classifier",
|
|
378
|
-
reasonDetail: reason
|
|
359
|
+
...routeDecisionResult(result.answers.route)
|
|
379
360
|
};
|
|
380
361
|
} catch (error) {
|
|
381
362
|
if (isProviderRetryError(error)) throw error;
|
|
382
363
|
args.logClassifierFailure(error, args.input);
|
|
383
364
|
return {
|
|
384
365
|
shouldReply: false,
|
|
385
|
-
reason:
|
|
366
|
+
reason: SubscribedReplyReason.ClassifierError
|
|
386
367
|
};
|
|
387
368
|
}
|
|
388
369
|
}
|
|
389
|
-
|
|
390
|
-
|
|
370
|
+
function isSubscribedReplyRoute(value) {
|
|
371
|
+
return value === "reply" || value === "stay_quiet" || value === "unsubscribe";
|
|
372
|
+
}
|
|
373
|
+
function routeDecisionResult(answer) {
|
|
374
|
+
const route = answer.choice;
|
|
375
|
+
if (!isSubscribedReplyRoute(route)) throw new Error(`Decision model returned unknown route: ${route}`);
|
|
376
|
+
const probability = answer.probabilities?.[route] ?? 1;
|
|
377
|
+
const detail = `${route} p=${probability.toFixed(2)}`;
|
|
378
|
+
if (route === "stay_quiet") return {
|
|
379
|
+
shouldReply: false,
|
|
380
|
+
reason: SubscribedReplyReason.SideConversation,
|
|
381
|
+
reasonDetail: detail
|
|
382
|
+
};
|
|
383
|
+
if (probability < ROUTER_CONFIDENCE_THRESHOLD) return {
|
|
384
|
+
shouldReply: false,
|
|
385
|
+
reason: SubscribedReplyReason.LowConfidence,
|
|
386
|
+
reasonDetail: detail
|
|
387
|
+
};
|
|
388
|
+
if (route === "unsubscribe") return {
|
|
389
|
+
shouldReply: false,
|
|
390
|
+
shouldUnsubscribe: true,
|
|
391
|
+
reason: SubscribedReplyReason.ThreadOptOut,
|
|
392
|
+
reasonDetail: detail
|
|
393
|
+
};
|
|
394
|
+
return {
|
|
395
|
+
shouldReply: true,
|
|
396
|
+
reason: SubscribedReplyReason.Classifier,
|
|
397
|
+
reasonDetail: detail
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
// src/chat/services/pending-auth.ts
|
|
391
401
|
const AUTH_LINK_REUSE_WINDOW_MS = 6e5;
|
|
392
402
|
/** Decide whether the same agent-run session can reuse its fresh auth link. */
|
|
393
403
|
function canReusePendingAuthLink(args) {
|
|
@@ -425,9 +435,8 @@ function wasPendingAuthStopped(conversation, pendingAuth) {
|
|
|
425
435
|
const message = conversation.messages[index];
|
|
426
436
|
if (message?.role !== "user") continue;
|
|
427
437
|
if (buildDeterministicTurnId(message.id) === pendingAuth.sessionId) return false;
|
|
428
|
-
if (message.meta?.skippedReason?.startsWith(
|
|
438
|
+
if (message.meta?.skippedReason?.startsWith(`${SubscribedReplyReason.ThreadOptOut}:`)) return true;
|
|
429
439
|
}
|
|
430
440
|
return false;
|
|
431
441
|
}
|
|
432
|
-
|
|
433
|
-
export { wasPendingAuthStopped as a, getThreadStopDecision as c, getConversationPendingAuth as i, buildDeterministicAssistantMessageId as l, canReusePendingAuthLink as n, decideSubscribedThreadReply as o, clearPendingAuth as r, getSubscribedReplyPreflightDecision as s, abandonReplacedPendingAuth as t, buildDeterministicTurnId as u };
|
|
442
|
+
export { wasPendingAuthStopped as a, getSubscribedReplyPreflightDecision as c, buildDeterministicTurnId as d, getConversationPendingAuth as i, getThreadStopDecision as l, canReusePendingAuthLink as n, SubscribedReplyReason as o, clearPendingAuth as r, decideSubscribedThreadReply as s, abandonReplacedPendingAuth as t, buildDeterministicAssistantMessageId as u };
|
|
@@ -2,7 +2,7 @@ import { createRequire } from "node:module";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { statSync } from "node:fs";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
|
-
|
|
5
|
+
// src/plugin-module.ts
|
|
6
6
|
const PLUGIN_MODULE_EXTENSIONS = [
|
|
7
7
|
"",
|
|
8
8
|
".ts",
|
|
@@ -77,5 +77,4 @@ async function loadAppPluginSet(cwd, importModule) {
|
|
|
77
77
|
}
|
|
78
78
|
return await loadPluginSetFromModule(pluginModule, importModule);
|
|
79
79
|
}
|
|
80
|
-
//#endregion
|
|
81
80
|
export { loadPluginSetFromModule as n, resolvePluginModule as r, loadAppPluginSet as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { PluginMcpConfig, PluginRegistration, PluginRuntimePostinstallCommand } from "@sentry/junior-plugin-api";
|
|
2
|
-
//#region src/chat/plugins/types.d.ts
|
|
1
|
+
import { PluginMcpConfig, PluginRegistration, PluginRuntimePostinstallCommand, PluginServiceAccountConfig } from "@sentry/junior-plugin-api";
|
|
3
2
|
interface PluginOAuthConfig {
|
|
4
3
|
clientIdEnv: string;
|
|
5
4
|
clientSecretEnv: string;
|
|
@@ -69,14 +68,16 @@ interface PluginManifestConfig {
|
|
|
69
68
|
wrappedTools?: string[] | null;
|
|
70
69
|
} | null;
|
|
71
70
|
oauth?: PluginOAuthConfigPatch | null;
|
|
71
|
+
accounts?: {
|
|
72
|
+
userOAuth?: boolean | null;
|
|
73
|
+
serviceAccount?: PluginServiceAccountConfig | null;
|
|
74
|
+
} | null;
|
|
72
75
|
target?: {
|
|
73
76
|
type?: string;
|
|
74
77
|
configKey?: string;
|
|
75
78
|
commandFlags?: string[] | null;
|
|
76
79
|
} | null;
|
|
77
80
|
}
|
|
78
|
-
//#endregion
|
|
79
|
-
//#region src/plugins.d.ts
|
|
80
81
|
type JuniorPluginInput = PluginRegistration | string;
|
|
81
82
|
interface JuniorPluginSetOptions {
|
|
82
83
|
/** Install-level manifest overrides applied before validation. */
|
|
@@ -93,5 +94,4 @@ interface JuniorPluginSet {
|
|
|
93
94
|
}
|
|
94
95
|
/** Define package-name plugins and JS plugin definitions for one app. */
|
|
95
96
|
declare function defineJuniorPlugins(inputs: JuniorPluginInput[], options?: JuniorPluginSetOptions): JuniorPluginSet;
|
|
96
|
-
//#endregion
|
|
97
97
|
export { defineJuniorPlugins as i, JuniorPluginSet as n, JuniorPluginSetOptions as r, JuniorPluginInput as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
+
// src/plugins.ts
|
|
3
3
|
var plugins_exports = /* @__PURE__ */ __exportAll({
|
|
4
4
|
defineJuniorPlugins: () => defineJuniorPlugins,
|
|
5
5
|
pluginCatalogConfigFromEnv: () => pluginCatalogConfigFromEnv,
|
|
@@ -95,5 +95,4 @@ function pluginRuntimeRegistrationsFromPluginSet(pluginSet) {
|
|
|
95
95
|
function pluginCliRegistrationsFromPluginSet(pluginSet) {
|
|
96
96
|
return pluginSet?.registrations.filter((plugin) => plugin.cli) ?? [];
|
|
97
97
|
}
|
|
98
|
-
//#endregion
|
|
99
98
|
export { pluginRuntimeRegistrationsFromPluginSet as a, pluginCliRegistrationsFromPluginSet as i, pluginCatalogConfigFromEnv as n, plugins_exports as o, pluginCatalogConfigFromPluginSet as r, defineJuniorPlugins as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
-
|
|
2
|
+
// src/chat/tool-support/private-trace-result.ts
|
|
3
3
|
const PRIVATE_TRACE_RESULT_ATTRIBUTE = "gen_ai.tool.call.result.exposure";
|
|
4
4
|
const privateTraceResultToken = randomUUID();
|
|
5
5
|
/** Mark one tool result as an adapter-approved private trace projection. */
|
|
@@ -12,5 +12,4 @@ function consumePrivateTraceResultMarker(attributes) {
|
|
|
12
12
|
delete attributes[PRIVATE_TRACE_RESULT_ATTRIBUTE];
|
|
13
13
|
return projected;
|
|
14
14
|
}
|
|
15
|
-
//#endregion
|
|
16
15
|
export { privateTraceResultAttributes as n, consumePrivateTraceResultMarker as t };
|