@sentry/junior 0.108.0 → 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-NU5HK3PS.js → agent-hooks-FHHVLNPA.js} +12 -12
- package/dist/api/conversations/events.d.ts +1 -1
- package/dist/api/conversations/schema.d.ts +57 -6
- package/dist/api/schema.js +1 -1
- package/dist/api.js +108 -22
- package/dist/app.d.ts +1 -0
- package/dist/app.js +1481 -420
- package/dist/{catalog-runtime-FOFNPR3P.js → catalog-runtime-DMGJSLV2.js} +6 -4
- 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/runtime/slack-resume.d.ts +2 -2
- 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 +2 -2
- package/dist/chunk-3SXUV423.js +10 -0
- package/dist/{chunk-3RGQLX2F.js → chunk-72OMGPDS.js} +1010 -26
- package/dist/{chunk-2XXEKR44.js → chunk-7Q6WCISF.js} +1 -1
- package/dist/{chunk-TE4QHJH4.js → chunk-FENLIFJD.js} +72 -591
- package/dist/{chunk-XKB7LGIW.js → chunk-FWJRXN4F.js} +3 -3
- package/dist/{chunk-PUAMO4PI.js → chunk-HHVY4SMP.js} +41 -7
- package/dist/{chunk-B5I5LMSP.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-KPMPQ6AA.js → chunk-IXKSQGIO.js} +90 -100
- package/dist/{chunk-SS67LUOK.js → chunk-JNAVF45E.js} +6 -7
- package/dist/{chunk-DY7TRYB5.js → chunk-MGUMR35T.js} +1 -1
- package/dist/{chunk-A5CO2EHL.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-H3QYZL7K.js → chunk-OUHNWH46.js} +28 -3
- package/dist/{chunk-VIXFG2VC.js → chunk-PLB7MRCQ.js} +1 -2
- package/dist/{chunk-UD6THJ2I.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-AMRBAT5D.js → db-V3NU72O2.js} +8 -6
- package/dist/instrumentation.js +3 -2
- package/dist/nitro.js +5 -4
- package/dist/{runner-TQH5GAJ4.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 +9 -5
- package/dist/chunk-AHJR2IFF.js +0 -115
- package/dist/chunk-G3E7SCME.js +0 -28
- package/dist/chunk-J3B3FPP2.js +0 -1061
- package/dist/chunk-TWINAEZQ.js +0 -1283
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CooperativeTurnYieldError,
|
|
3
|
+
JUNIOR_THREAD_STATE_TTL_MS,
|
|
3
4
|
TurnInputCommitLostError,
|
|
4
5
|
TurnSliceLimitExceededError,
|
|
5
6
|
abandonReplacedPendingAuth,
|
|
@@ -8,23 +9,20 @@ import {
|
|
|
8
9
|
getAgentContextCompactionTriggerTokens,
|
|
9
10
|
getInterruptionMarker,
|
|
10
11
|
isTurnInputCommitLostError,
|
|
12
|
+
loadConnectedMcpProviders,
|
|
13
|
+
loadConversationProjection,
|
|
11
14
|
loadTurnSessionRecord,
|
|
12
15
|
mergeArtifactsState,
|
|
16
|
+
openConversationProjection,
|
|
13
17
|
persistAuthPauseSessionRecord,
|
|
14
18
|
persistContinuationSessionRecord,
|
|
15
19
|
persistRunningSessionRecord,
|
|
16
20
|
persistYieldSessionRecord,
|
|
17
|
-
updateConversationStats
|
|
18
|
-
} from "./chunk-3RGQLX2F.js";
|
|
19
|
-
import {
|
|
20
|
-
JUNIOR_THREAD_STATE_TTL_MS,
|
|
21
|
-
loadConnectedMcpProviders,
|
|
22
|
-
loadConversationProjection,
|
|
23
|
-
openConversationProjection,
|
|
24
21
|
recordAuthorizationRequested,
|
|
25
22
|
recordMcpProviderConnected,
|
|
26
|
-
recordToolExecutionStarted
|
|
27
|
-
|
|
23
|
+
recordToolExecutionStarted,
|
|
24
|
+
updateConversationStats
|
|
25
|
+
} from "./chunk-72OMGPDS.js";
|
|
28
26
|
import {
|
|
29
27
|
buildNonInteractiveShellScript,
|
|
30
28
|
createSandboxInstance,
|
|
@@ -34,7 +32,7 @@ import {
|
|
|
34
32
|
isSnapshotMissingError,
|
|
35
33
|
resolveRuntimeDependencySnapshot,
|
|
36
34
|
runNonInteractiveCommand
|
|
37
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-HO5NT6OE.js";
|
|
38
36
|
import {
|
|
39
37
|
addAgentTurnUsage,
|
|
40
38
|
hasAgentTurnUsage
|
|
@@ -44,27 +42,23 @@ import {
|
|
|
44
42
|
} from "./chunk-UIE3R5XU.js";
|
|
45
43
|
import {
|
|
46
44
|
createPluginHookRunner,
|
|
45
|
+
createPluginLogger,
|
|
47
46
|
getPluginSystemPromptContributions,
|
|
48
47
|
getPluginTools,
|
|
49
48
|
getPluginUserPromptContributions,
|
|
50
49
|
getPlugins,
|
|
51
50
|
getSlackToolContext,
|
|
52
51
|
resolveChannelCapabilities
|
|
53
|
-
} from "./chunk-
|
|
54
|
-
import {
|
|
55
|
-
createPluginLogger
|
|
56
|
-
} from "./chunk-AHJR2IFF.js";
|
|
52
|
+
} from "./chunk-QY636HZU.js";
|
|
57
53
|
import {
|
|
58
54
|
SANDBOX_DATA_ROOT,
|
|
59
55
|
SANDBOX_SKILLS_ROOT,
|
|
60
56
|
SANDBOX_WORKSPACE_ROOT,
|
|
57
|
+
acquireActiveLock,
|
|
58
|
+
getStateAdapter,
|
|
61
59
|
sandboxSkillDir,
|
|
62
60
|
sandboxSkillFile
|
|
63
|
-
} from "./chunk-
|
|
64
|
-
import {
|
|
65
|
-
acquireActiveLock,
|
|
66
|
-
getStateAdapter
|
|
67
|
-
} from "./chunk-H3QYZL7K.js";
|
|
61
|
+
} from "./chunk-OUHNWH46.js";
|
|
68
62
|
import {
|
|
69
63
|
SlackActionError,
|
|
70
64
|
downloadPrivateSlackFile,
|
|
@@ -74,7 +68,7 @@ import {
|
|
|
74
68
|
isDmChannel,
|
|
75
69
|
normalizeSlackConversationId,
|
|
76
70
|
withSlackRetries
|
|
77
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-RGX4V75M.js";
|
|
78
72
|
import {
|
|
79
73
|
contextProvenance,
|
|
80
74
|
getConversationEventStore,
|
|
@@ -83,7 +77,7 @@ import {
|
|
|
83
77
|
getDb,
|
|
84
78
|
instructionActors,
|
|
85
79
|
instructionProvenanceFor
|
|
86
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-FENLIFJD.js";
|
|
87
81
|
import {
|
|
88
82
|
sleep
|
|
89
83
|
} from "./chunk-4ZNGQH7C.js";
|
|
@@ -126,7 +120,7 @@ import {
|
|
|
126
120
|
stripRuntimeTurnContext,
|
|
127
121
|
trimTrailingAssistantMessages,
|
|
128
122
|
unwrapCurrentInstruction
|
|
129
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-JNAVF45E.js";
|
|
130
124
|
import {
|
|
131
125
|
parseSlackThreadId,
|
|
132
126
|
resolveConversationPrivacy,
|
|
@@ -136,26 +130,29 @@ import {
|
|
|
136
130
|
toGenAiMessagesTraceAttributes,
|
|
137
131
|
toGenAiPayloadMetadata,
|
|
138
132
|
toGenAiPayloadTraceAttributes
|
|
139
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-O3JMSZLI.js";
|
|
140
134
|
import {
|
|
141
135
|
parseDestination
|
|
142
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-SYAQIR5Z.js";
|
|
143
137
|
import {
|
|
144
138
|
discoverSkills,
|
|
145
139
|
findSkillByName,
|
|
146
140
|
loadSkillsByName,
|
|
147
141
|
parseSkillInvocation
|
|
148
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-WHMOBKT7.js";
|
|
143
|
+
import {
|
|
144
|
+
pluginCatalogRuntime
|
|
145
|
+
} from "./chunk-3SXUV423.js";
|
|
149
146
|
import {
|
|
150
147
|
CredentialUnavailableError,
|
|
151
148
|
credentialContextSchema,
|
|
152
|
-
|
|
149
|
+
credentialUserSubjectId,
|
|
153
150
|
resolveAuthTokenPlaceholder,
|
|
154
151
|
resolvePluginCommandEnv
|
|
155
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-TT6GMXNA.js";
|
|
156
153
|
import {
|
|
157
154
|
isUserActor
|
|
158
|
-
} from "./chunk-
|
|
155
|
+
} from "./chunk-PLB7MRCQ.js";
|
|
159
156
|
import {
|
|
160
157
|
extractGenAiUsageAttributes,
|
|
161
158
|
extractGenAiUsageSummary,
|
|
@@ -171,8 +168,9 @@ import {
|
|
|
171
168
|
setSpanStatus,
|
|
172
169
|
setTags,
|
|
173
170
|
summarizeMessageText,
|
|
171
|
+
withLogContext,
|
|
174
172
|
withSpan
|
|
175
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-ISMWX44P.js";
|
|
176
174
|
import {
|
|
177
175
|
isRecord
|
|
178
176
|
} from "./chunk-OB42YVAE.js";
|
|
@@ -180,16 +178,16 @@ import {
|
|
|
180
178
|
startInactiveSpan,
|
|
181
179
|
withActiveSpan
|
|
182
180
|
} from "./chunk-6GWA276C.js";
|
|
183
|
-
import {
|
|
184
|
-
parseSlackChannelId,
|
|
185
|
-
parseSlackMessageTs,
|
|
186
|
-
parseSlackUserId
|
|
187
|
-
} from "./chunk-7FBGKXPE.js";
|
|
188
181
|
import {
|
|
189
182
|
listReferenceFiles,
|
|
190
183
|
soulPathCandidates,
|
|
191
184
|
worldPathCandidates
|
|
192
185
|
} from "./chunk-3V7OFJZC.js";
|
|
186
|
+
import {
|
|
187
|
+
parseSlackChannelId,
|
|
188
|
+
parseSlackMessageTs,
|
|
189
|
+
parseSlackUserId
|
|
190
|
+
} from "./chunk-IVVGFRQQ.js";
|
|
193
191
|
|
|
194
192
|
// src/chat/configuration/defaults.ts
|
|
195
193
|
var installDefaults = {};
|
|
@@ -1073,9 +1071,9 @@ async function selectTurnRoute(args) {
|
|
|
1073
1071
|
messageText: args.messageText
|
|
1074
1072
|
});
|
|
1075
1073
|
const logContext = {
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1074
|
+
messageConversationId: args.context?.threadId,
|
|
1075
|
+
destinationName: args.context?.channelId,
|
|
1076
|
+
userId: args.context?.actorId,
|
|
1079
1077
|
runId: args.context?.runId,
|
|
1080
1078
|
modelId: args.fastModelId
|
|
1081
1079
|
};
|
|
@@ -14633,7 +14631,7 @@ async function writeSandboxGeneratedArtifacts(sandbox, files) {
|
|
|
14633
14631
|
// src/chat/agent/tools.ts
|
|
14634
14632
|
async function wireAgentTools(args) {
|
|
14635
14633
|
const runSource = args.routing.source;
|
|
14636
|
-
const
|
|
14634
|
+
const credentialUserId = args.routing.credentialContext ? credentialUserSubjectId(args.routing.credentialContext) : void 0;
|
|
14637
14635
|
const userTokenStore = createUserTokenStore();
|
|
14638
14636
|
const pluginHooks = createPluginHookRunner({
|
|
14639
14637
|
actor: args.currentActor,
|
|
@@ -14681,7 +14679,7 @@ async function wireAgentTools(args) {
|
|
|
14681
14679
|
abortAgent: args.abortAgent,
|
|
14682
14680
|
conversationId: args.conversationId,
|
|
14683
14681
|
sessionId: args.turnId,
|
|
14684
|
-
actorId:
|
|
14682
|
+
actorId: credentialUserId,
|
|
14685
14683
|
channelId: slackChannelId,
|
|
14686
14684
|
destination: args.routing.destination,
|
|
14687
14685
|
source: runSource,
|
|
@@ -14702,7 +14700,7 @@ async function wireAgentTools(args) {
|
|
|
14702
14700
|
abortAgent: args.abortAgent,
|
|
14703
14701
|
conversationId: args.conversationId,
|
|
14704
14702
|
sessionId: args.turnId,
|
|
14705
|
-
actorId:
|
|
14703
|
+
actorId: credentialUserId,
|
|
14706
14704
|
channelId: slackChannelId,
|
|
14707
14705
|
destination: args.routing.destination,
|
|
14708
14706
|
source: runSource,
|
|
@@ -14836,32 +14834,25 @@ async function wireAgentTools(args) {
|
|
|
14836
14834
|
})
|
|
14837
14835
|
);
|
|
14838
14836
|
const pendingMcpProvider = args.state.pendingAuth?.kind === "mcp" ? args.state.pendingAuth.provider : void 0;
|
|
14839
|
-
|
|
14840
|
-
|
|
14841
|
-
|
|
14842
|
-
|
|
14843
|
-
|
|
14844
|
-
|
|
14845
|
-
|
|
14846
|
-
|
|
14847
|
-
|
|
14848
|
-
|
|
14849
|
-
|
|
14850
|
-
|
|
14851
|
-
|
|
14852
|
-
|
|
14853
|
-
|
|
14854
|
-
|
|
14855
|
-
|
|
14856
|
-
|
|
14857
|
-
|
|
14858
|
-
}
|
|
14859
|
-
if (await mcpToolManager.activateForSkill(skill)) {
|
|
14860
|
-
await args.recordConnectedMcpProvider(skill.pluginProvider);
|
|
14861
|
-
}
|
|
14862
|
-
if (mcpAuth.getPendingPause()) {
|
|
14863
|
-
args.resume.captureResumeSnapshot(args.preAgentPromptMessages());
|
|
14864
|
-
throw mcpAuth.getPendingPause();
|
|
14837
|
+
if (credentialUserId) {
|
|
14838
|
+
const providersToRestore = /* @__PURE__ */ new Set([
|
|
14839
|
+
...args.connectedMcpProviders,
|
|
14840
|
+
...inferActiveMcpProvidersFromPiMessages(args.priorPiMessages),
|
|
14841
|
+
...args.activeSkills.flatMap(
|
|
14842
|
+
(skill) => skill.pluginProvider ? [skill.pluginProvider] : []
|
|
14843
|
+
)
|
|
14844
|
+
]);
|
|
14845
|
+
for (const provider of providersToRestore) {
|
|
14846
|
+
if (provider === pendingMcpProvider) {
|
|
14847
|
+
continue;
|
|
14848
|
+
}
|
|
14849
|
+
if (await mcpToolManager.activateProvider(provider)) {
|
|
14850
|
+
await args.recordConnectedMcpProvider(provider);
|
|
14851
|
+
}
|
|
14852
|
+
if (mcpAuth.getPendingPause()) {
|
|
14853
|
+
args.resume.captureResumeSnapshot(args.preAgentPromptMessages());
|
|
14854
|
+
throw mcpAuth.getPendingPause();
|
|
14855
|
+
}
|
|
14865
14856
|
}
|
|
14866
14857
|
}
|
|
14867
14858
|
const activeMcpCatalogs = toActiveMcpCatalogSummaries(
|
|
@@ -15326,9 +15317,9 @@ async function maybeCompactWithDeps(args, deps) {
|
|
|
15326
15317
|
logWarn(
|
|
15327
15318
|
"context_compaction_summary_failed",
|
|
15328
15319
|
{
|
|
15329
|
-
|
|
15330
|
-
|
|
15331
|
-
|
|
15320
|
+
messageConversationId: args.metadata?.threadId,
|
|
15321
|
+
userId: args.metadata?.actorId,
|
|
15322
|
+
destinationName: args.metadata?.channelId,
|
|
15332
15323
|
runId: args.metadata?.runId,
|
|
15333
15324
|
assistantUserName: botConfig.userName,
|
|
15334
15325
|
modelId: botConfig.fastModelId
|
|
@@ -15478,12 +15469,35 @@ async function executeAgentRun(request) {
|
|
|
15478
15469
|
// a compatibility fallback for callers that have not projected it yet.
|
|
15479
15470
|
visibility: request.routing.destinationVisibility ?? request.routing.slackConversation?.visibility
|
|
15480
15471
|
});
|
|
15481
|
-
|
|
15482
|
-
|
|
15483
|
-
|
|
15472
|
+
const credentialActor = request.routing.credentialContext?.actor;
|
|
15473
|
+
const actor = actorFromRouting(request.routing);
|
|
15474
|
+
const userActor = actor && "userId" in actor ? actor : void 0;
|
|
15475
|
+
const runLogContext = {
|
|
15476
|
+
conversationId: request.conversationId,
|
|
15477
|
+
platform: request.routing.source.platform,
|
|
15478
|
+
messageConversationId: request.routing.source.platform === "slack" ? request.conversationId : request.routing.source.conversationId,
|
|
15479
|
+
destinationName: request.routing.destination.platform === "slack" ? request.routing.destination.channelId : request.routing.destination.conversationId,
|
|
15480
|
+
userId: userActor?.userId,
|
|
15481
|
+
userName: userActor?.userName,
|
|
15482
|
+
userEmail: userActor?.email,
|
|
15483
|
+
runId: request.runId,
|
|
15484
|
+
actorType: credentialActor ? "type" in credentialActor ? credentialActor.type : "system" : void 0,
|
|
15485
|
+
actorId: credentialActor ? "type" in credentialActor ? credentialActor.userId : credentialActor.name : void 0,
|
|
15486
|
+
assistantUserName: botConfig.userName
|
|
15487
|
+
};
|
|
15488
|
+
return withLogContext(
|
|
15489
|
+
runLogContext,
|
|
15490
|
+
() => runWithConversationPrivacy(
|
|
15491
|
+
conversationPrivacy ?? "private",
|
|
15492
|
+
() => executeAgentRunInPrivacyContext(
|
|
15493
|
+
request,
|
|
15494
|
+
conversationPrivacy,
|
|
15495
|
+
runLogContext
|
|
15496
|
+
)
|
|
15497
|
+
)
|
|
15484
15498
|
);
|
|
15485
15499
|
}
|
|
15486
|
-
async function executeAgentRunInPrivacyContext(request, conversationPrivacy) {
|
|
15500
|
+
async function executeAgentRunInPrivacyContext(request, conversationPrivacy, runLogContext) {
|
|
15487
15501
|
const { conversationId, input, routing, runId, turnId } = request;
|
|
15488
15502
|
const policy = request.policy ?? {};
|
|
15489
15503
|
const signal = policy.signal;
|
|
@@ -15560,16 +15574,7 @@ async function executeAgentRunInPrivacyContext(request, conversationPrivacy) {
|
|
|
15560
15574
|
activeModelProfile = projection.modelProfile;
|
|
15561
15575
|
activeModelId = modelIdForProfile(botConfig, activeModelProfile);
|
|
15562
15576
|
const shouldTrace = shouldEmitDevAgentTrace();
|
|
15563
|
-
const spanContext = {
|
|
15564
|
-
conversationId,
|
|
15565
|
-
slackThreadId: slackSource ? conversationId : void 0,
|
|
15566
|
-
slackUserId: slackActor?.userId,
|
|
15567
|
-
slackChannelId: slackDestination?.channelId,
|
|
15568
|
-
runId,
|
|
15569
|
-
...credentialActorLogContext,
|
|
15570
|
-
assistantUserName: botConfig.userName,
|
|
15571
|
-
modelId: activeModelId
|
|
15572
|
-
};
|
|
15577
|
+
const spanContext = { modelId: activeModelId };
|
|
15573
15578
|
const availableSkills = await discoverRunSkills({
|
|
15574
15579
|
skillDirs: policy.skillDirs,
|
|
15575
15580
|
spanContext
|
|
@@ -15789,13 +15794,7 @@ async function executeAgentRunInPrivacyContext(request, conversationPrivacy) {
|
|
|
15789
15794
|
})
|
|
15790
15795
|
};
|
|
15791
15796
|
setTags({
|
|
15792
|
-
|
|
15793
|
-
slackThreadId: slackSource ? conversationId : void 0,
|
|
15794
|
-
slackUserId: slackActor?.userId,
|
|
15795
|
-
slackChannelId: slackDestination?.channelId,
|
|
15796
|
-
runId,
|
|
15797
|
-
...credentialActorLogContext,
|
|
15798
|
-
assistantUserName: botConfig.userName,
|
|
15797
|
+
...runLogContext,
|
|
15799
15798
|
modelId: activeModelId
|
|
15800
15799
|
});
|
|
15801
15800
|
const wiring = await wireAgentTools({
|
|
@@ -16303,16 +16302,7 @@ async function executeAgentRunInPrivacyContext(request, conversationPrivacy) {
|
|
|
16303
16302
|
logException(
|
|
16304
16303
|
error,
|
|
16305
16304
|
"assistant_reply_generation_failed",
|
|
16306
|
-
{
|
|
16307
|
-
conversationId,
|
|
16308
|
-
slackThreadId: slackSource ? conversationId : void 0,
|
|
16309
|
-
slackUserId: slackActor?.userId,
|
|
16310
|
-
slackChannelId: slackDestination?.channelId,
|
|
16311
|
-
runId,
|
|
16312
|
-
...credentialActorLogContext,
|
|
16313
|
-
assistantUserName: botConfig.userName,
|
|
16314
|
-
modelId: activeModelId
|
|
16315
|
-
},
|
|
16305
|
+
{ modelId: activeModelId },
|
|
16316
16306
|
{},
|
|
16317
16307
|
"executeAgentRun failed"
|
|
16318
16308
|
);
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
toCanonicalInputMessage,
|
|
5
5
|
toCanonicalOutputMessage,
|
|
6
6
|
toGenAiMessagesTraceAttributes
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-O3JMSZLI.js";
|
|
8
8
|
import {
|
|
9
9
|
extractGenAiUsageAttributes,
|
|
10
10
|
logException,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
normalizeGenAiFinishReason,
|
|
13
13
|
serializeGenAiAttribute,
|
|
14
14
|
withSpan
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ISMWX44P.js";
|
|
16
16
|
|
|
17
17
|
// src/chat/xml.ts
|
|
18
18
|
function escapeXml(value) {
|
|
@@ -403,14 +403,14 @@ async function completeText(params) {
|
|
|
403
403
|
}
|
|
404
404
|
function logContextFromMetadata(modelId, metadata) {
|
|
405
405
|
const conversationId = typeof metadata?.conversationId === "string" ? metadata.conversationId : typeof metadata?.threadId === "string" ? metadata.threadId : void 0;
|
|
406
|
-
const
|
|
407
|
-
const
|
|
406
|
+
const messageConversationId = typeof metadata?.threadId === "string" ? metadata.threadId : void 0;
|
|
407
|
+
const destinationName = typeof metadata?.channelId === "string" ? metadata.channelId : void 0;
|
|
408
408
|
const runId = typeof metadata?.runId === "string" ? metadata.runId : void 0;
|
|
409
409
|
return {
|
|
410
410
|
modelId,
|
|
411
411
|
...conversationId ? { conversationId } : {},
|
|
412
|
-
...
|
|
413
|
-
...
|
|
412
|
+
...messageConversationId ? { messageConversationId } : {},
|
|
413
|
+
...destinationName ? { destinationName } : {},
|
|
414
414
|
...runId ? { runId } : {}
|
|
415
415
|
};
|
|
416
416
|
}
|
|
@@ -869,7 +869,6 @@ function setSlackReactionConfig(overrides) {
|
|
|
869
869
|
export {
|
|
870
870
|
toOptionalTrimmed,
|
|
871
871
|
escapeXml,
|
|
872
|
-
unescapeXml,
|
|
873
872
|
renderCurrentInstruction,
|
|
874
873
|
unwrapCurrentInstruction,
|
|
875
874
|
TURN_CONTEXT_TAG,
|
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
} from "./chunk-KNFROR7R.js";
|
|
6
6
|
import {
|
|
7
7
|
clearPendingAuth,
|
|
8
|
+
coerceThreadConversationState,
|
|
9
|
+
getAgentTurnSessionRecord,
|
|
8
10
|
getInterruptionMarker,
|
|
9
11
|
getPersistedThreadState,
|
|
10
12
|
hydrateConversationMessages,
|
|
@@ -12,26 +14,20 @@ import {
|
|
|
12
14
|
markTurnCompleted,
|
|
13
15
|
mergeArtifactsState,
|
|
14
16
|
updateConversationStats
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
coerceThreadConversationState,
|
|
18
|
-
getAgentTurnSessionRecord
|
|
19
|
-
} from "./chunk-J3B3FPP2.js";
|
|
17
|
+
} from "./chunk-72OMGPDS.js";
|
|
20
18
|
import {
|
|
21
19
|
createPluginEmbedder,
|
|
20
|
+
createPluginLogger,
|
|
22
21
|
createPluginModel,
|
|
22
|
+
createPluginState,
|
|
23
23
|
getPlugins
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import {
|
|
26
|
-
createPluginLogger,
|
|
27
|
-
createPluginState
|
|
28
|
-
} from "./chunk-AHJR2IFF.js";
|
|
24
|
+
} from "./chunk-QY636HZU.js";
|
|
29
25
|
import {
|
|
30
26
|
getStateAdapter
|
|
31
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-OUHNWH46.js";
|
|
32
28
|
import {
|
|
33
29
|
getDb
|
|
34
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-FENLIFJD.js";
|
|
35
31
|
import {
|
|
36
32
|
getPiMessageRole,
|
|
37
33
|
instructionTextForProjection,
|
|
@@ -39,13 +35,13 @@ import {
|
|
|
39
35
|
isToolResultMessage,
|
|
40
36
|
normalizeToolNameFromResult,
|
|
41
37
|
stripRuntimeTurnContext
|
|
42
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-JNAVF45E.js";
|
|
43
39
|
import {
|
|
44
40
|
buildTurnFailureResponse
|
|
45
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-ISMWX44P.js";
|
|
46
42
|
import {
|
|
47
43
|
parseSlackMessageTs
|
|
48
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-IVVGFRQQ.js";
|
|
49
45
|
|
|
50
46
|
// src/chat/services/turn-failure-response.ts
|
|
51
47
|
function requireTurnFailureEventId(eventId, eventName) {
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// package.json
|
|
2
|
+
var package_default = {
|
|
3
|
+
name: "@sentry/junior",
|
|
4
|
+
version: "0.109.0",
|
|
5
|
+
private: false,
|
|
6
|
+
publishConfig: {
|
|
7
|
+
access: "public"
|
|
8
|
+
},
|
|
9
|
+
type: "module",
|
|
10
|
+
types: "./dist/app.d.ts",
|
|
11
|
+
repository: {
|
|
12
|
+
type: "git",
|
|
13
|
+
url: "git+https://github.com/getsentry/junior.git",
|
|
14
|
+
directory: "packages/junior"
|
|
15
|
+
},
|
|
16
|
+
bin: {
|
|
17
|
+
junior: "bin/junior.mjs"
|
|
18
|
+
},
|
|
19
|
+
exports: {
|
|
20
|
+
".": {
|
|
21
|
+
types: "./dist/app.d.ts",
|
|
22
|
+
default: "./dist/app.js"
|
|
23
|
+
},
|
|
24
|
+
"./instrumentation": {
|
|
25
|
+
types: "./dist/instrumentation.d.ts",
|
|
26
|
+
default: "./dist/instrumentation.js"
|
|
27
|
+
},
|
|
28
|
+
"./nitro": {
|
|
29
|
+
types: "./dist/nitro.d.ts",
|
|
30
|
+
default: "./dist/nitro.js"
|
|
31
|
+
},
|
|
32
|
+
"./api": {
|
|
33
|
+
types: "./dist/api.d.ts",
|
|
34
|
+
default: "./dist/api.js"
|
|
35
|
+
},
|
|
36
|
+
"./api/schema": {
|
|
37
|
+
types: "./dist/api/schema.d.ts",
|
|
38
|
+
default: "./dist/api/schema.js"
|
|
39
|
+
},
|
|
40
|
+
"./vercel": {
|
|
41
|
+
types: "./dist/vercel.d.ts",
|
|
42
|
+
default: "./dist/vercel.js"
|
|
43
|
+
},
|
|
44
|
+
"./version": {
|
|
45
|
+
types: "./dist/version.d.ts",
|
|
46
|
+
default: "./dist/version.js"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
files: [
|
|
50
|
+
"dist",
|
|
51
|
+
"bin",
|
|
52
|
+
"migrations"
|
|
53
|
+
],
|
|
54
|
+
scripts: {
|
|
55
|
+
prepare: "pnpm run build",
|
|
56
|
+
prepack: "pnpm run build",
|
|
57
|
+
build: "tsup && tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
58
|
+
"db:generate": "pnpm exec drizzle-kit generate --config drizzle.config.ts",
|
|
59
|
+
lint: "oxlint --config .oxlintrc.json --deny-warnings src tests scripts bin tsup.config.ts && depcruise --config .dependency-cruiser.mjs src/chat",
|
|
60
|
+
"lint:fix": "oxlint --config .oxlintrc.json --deny-warnings --fix src tests scripts bin tsup.config.ts",
|
|
61
|
+
test: "vitest run --maxWorkers=4",
|
|
62
|
+
"test:watch": "vitest",
|
|
63
|
+
typecheck: "tsc --noEmit",
|
|
64
|
+
"skills:check": "node scripts/check-skills.mjs",
|
|
65
|
+
"test:coverage": "vitest run --maxWorkers=4 --coverage --reporter=default --reporter=junit --outputFile.junit=coverage/results.junit.xml"
|
|
66
|
+
},
|
|
67
|
+
dependencies: {
|
|
68
|
+
"@ai-sdk/gateway": "^3.0.119",
|
|
69
|
+
"@chat-adapter/slack": "4.29.0",
|
|
70
|
+
"@chat-adapter/state-memory": "4.29.0",
|
|
71
|
+
"@chat-adapter/state-redis": "4.29.0",
|
|
72
|
+
"@earendil-works/pi-agent-core": "0.80.6",
|
|
73
|
+
"@earendil-works/pi-ai": "0.80.6",
|
|
74
|
+
"@logtape/logtape": "^2.1.1",
|
|
75
|
+
"@modelcontextprotocol/sdk": "1.29.0",
|
|
76
|
+
"@neondatabase/serverless": "^1.1.0",
|
|
77
|
+
"@sentry/junior-plugin-api": "workspace:*",
|
|
78
|
+
"@sentry/node": "catalog:",
|
|
79
|
+
"@sinclair/typebox": "^0.34.49",
|
|
80
|
+
"@slack/web-api": "^7.16.0",
|
|
81
|
+
"@vercel/functions": "^3.6.0",
|
|
82
|
+
"@vercel/queue": "^0.2.0",
|
|
83
|
+
"@vercel/sandbox": "2.8.0",
|
|
84
|
+
ai: "^6.0.190",
|
|
85
|
+
"bash-tool": "^1.3.16",
|
|
86
|
+
chat: "4.29.0",
|
|
87
|
+
commander: "^14.0.3",
|
|
88
|
+
"drizzle-orm": "catalog:",
|
|
89
|
+
hono: "^4.12.22",
|
|
90
|
+
jiti: "^2.7.0",
|
|
91
|
+
jose: "^6.2.3",
|
|
92
|
+
"just-bash": "3.0.1",
|
|
93
|
+
"node-html-markdown": "^2.0.0",
|
|
94
|
+
pg: "^8.16.3",
|
|
95
|
+
yaml: "^2.9.0",
|
|
96
|
+
zod: "catalog:"
|
|
97
|
+
},
|
|
98
|
+
devDependencies: {
|
|
99
|
+
"@emnapi/core": "^1.10.0",
|
|
100
|
+
"@emnapi/runtime": "^1.10.0",
|
|
101
|
+
"@sentry/junior-github": "workspace:*",
|
|
102
|
+
"@sentry/junior-memory": "workspace:*",
|
|
103
|
+
"@sentry/junior-scheduler": "workspace:*",
|
|
104
|
+
"@sentry/junior-testing": "workspace:*",
|
|
105
|
+
"@types/node": "^25.9.1",
|
|
106
|
+
"@types/pg": "^8.15.6",
|
|
107
|
+
"@vitest/coverage-v8": "4.1.7",
|
|
108
|
+
"dependency-cruiser": "^17.4.0",
|
|
109
|
+
"drizzle-kit": "catalog:",
|
|
110
|
+
msw: "^2.14.6",
|
|
111
|
+
nitro: "3.0.260522-beta",
|
|
112
|
+
oxlint: "^1.66.0",
|
|
113
|
+
tsup: "^8.5.1",
|
|
114
|
+
typescript: "^6.0.3",
|
|
115
|
+
vercel: "^54.4.0",
|
|
116
|
+
vitest: "^4.1.7"
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
// src/version.ts
|
|
121
|
+
var JUNIOR_VERSION = typeof package_default.version === "string" && package_default.version.trim() ? package_default.version : "unknown";
|
|
122
|
+
|
|
123
|
+
export {
|
|
124
|
+
JUNIOR_VERSION
|
|
125
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getChatConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JNAVF45E.js";
|
|
4
4
|
|
|
5
5
|
// src/chat/state/adapter.ts
|
|
6
6
|
import { createMemoryState } from "@chat-adapter/state-memory";
|
|
@@ -271,10 +271,35 @@ async function disconnectStateAdapter() {
|
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
+
// src/chat/sandbox/paths.ts
|
|
275
|
+
function normalizeWorkspaceRoot(input) {
|
|
276
|
+
const candidate = (input ?? "").trim();
|
|
277
|
+
if (!candidate) {
|
|
278
|
+
return "/vercel/sandbox";
|
|
279
|
+
}
|
|
280
|
+
const normalized = candidate.replace(/\/+$/, "");
|
|
281
|
+
return normalized.startsWith("/") ? normalized : `/${normalized}`;
|
|
282
|
+
}
|
|
283
|
+
var SANDBOX_WORKSPACE_ROOT = normalizeWorkspaceRoot(
|
|
284
|
+
process.env.VERCEL_SANDBOX_WORKSPACE_DIR
|
|
285
|
+
);
|
|
286
|
+
var SANDBOX_SKILLS_ROOT = `${SANDBOX_WORKSPACE_ROOT}/skills`;
|
|
287
|
+
var SANDBOX_DATA_ROOT = `${SANDBOX_WORKSPACE_ROOT}/data`;
|
|
288
|
+
function sandboxSkillDir(skillName) {
|
|
289
|
+
return `${SANDBOX_SKILLS_ROOT}/${skillName}`;
|
|
290
|
+
}
|
|
291
|
+
function sandboxSkillFile(skillName) {
|
|
292
|
+
return `${sandboxSkillDir(skillName)}/SKILL.md`;
|
|
293
|
+
}
|
|
294
|
+
|
|
274
295
|
export {
|
|
275
296
|
acquireActiveLock,
|
|
276
|
-
getConnectedStateContext,
|
|
277
297
|
getDefaultRedisStateAdapterFor,
|
|
278
298
|
getStateAdapter,
|
|
279
|
-
disconnectStateAdapter
|
|
299
|
+
disconnectStateAdapter,
|
|
300
|
+
SANDBOX_WORKSPACE_ROOT,
|
|
301
|
+
SANDBOX_SKILLS_ROOT,
|
|
302
|
+
SANDBOX_DATA_ROOT,
|
|
303
|
+
sandboxSkillDir,
|
|
304
|
+
sandboxSkillFile
|
|
280
305
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseSlackTeamId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IVVGFRQQ.js";
|
|
4
4
|
|
|
5
5
|
// src/chat/actor.ts
|
|
6
6
|
import { z } from "zod";
|
|
@@ -170,7 +170,6 @@ function createSlackResumeActor(args) {
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
export {
|
|
173
|
-
storedSlackActorSchema,
|
|
174
173
|
isUserActor,
|
|
175
174
|
parseActorUserId,
|
|
176
175
|
isActorUserId,
|