@sentry/junior 0.189.0 → 0.191.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-6QRYH6PX.js → agent-hooks-HIWWBBKO.js} +11 -11
- package/dist/api.js +27 -27
- package/dist/app.js +134 -152
- package/dist/{catalog-runtime-IETJLJFG.js → catalog-runtime-4OKH4265.js} +4 -4
- package/dist/chat/actor.d.ts +7 -2
- package/dist/chat/agent/resume.d.ts +0 -1
- package/dist/chat/agent/types.d.ts +0 -1
- package/dist/chat/agent-invocations/types.d.ts +44 -308
- package/dist/chat/event-tasks/tool-support.d.ts +1 -1
- package/dist/chat/providers/slack/runtime.d.ts +1 -2
- package/dist/chat/providers/slack/system-turn.d.ts +9 -4
- package/dist/chat/providers/slack/turn.d.ts +0 -1
- package/dist/chat/resource-events/actor.d.ts +2 -2
- package/dist/chat/services/turn-router.d.ts +1 -1
- package/dist/chat/slack/dispatch-turn.d.ts +0 -1
- package/dist/chat/slack/timestamp-param.d.ts +1 -1
- package/dist/chat/source.d.ts +3 -3
- package/dist/chat/task-execution/assistant-message.d.ts +7 -7
- package/dist/chat/task-execution/checkpoint.d.ts +0 -1
- package/dist/chat/task-execution/conversation-turn.d.ts +2 -2
- package/dist/chat/task-execution/mailbox-turn.d.ts +16 -6
- package/dist/chat/task-execution/state.d.ts +2 -5
- package/dist/chat/task-execution/store.d.ts +1 -2
- package/dist/chat/task-execution/turn-cursor.d.ts +10 -3
- package/dist/chat/task-execution/worker.d.ts +0 -1
- package/dist/chat/tools/types.d.ts +9 -2
- package/dist/{chunk-BYBSI5TI.js → chunk-2JAWOTUT.js} +2 -2
- package/dist/{chunk-WN6VLHOU.js → chunk-3PDR63SX.js} +30 -9
- package/dist/{chunk-SR6OMO5C.js → chunk-5IMKUVMS.js} +8 -11
- package/dist/{chunk-YYSEH2WC.js → chunk-6KISW5UY.js} +2 -2
- package/dist/{chunk-WDHPN2GH.js → chunk-7PYCRKQL.js} +3 -3
- package/dist/{chunk-YNZPOFF3.js → chunk-AWFSSFAX.js} +9 -11
- package/dist/{chunk-OEIITG5F.js → chunk-BVWC5DBM.js} +1 -1
- package/dist/{chunk-DYXVAO2E.js → chunk-BVYUIVXE.js} +1 -1
- package/dist/{chunk-WYDF6PGK.js → chunk-CCPOZMS4.js} +3 -3
- package/dist/{chunk-YYZNESC3.js → chunk-CECRMPXJ.js} +9 -8
- package/dist/{chunk-6AUR6PWR.js → chunk-CUUE5MGF.js} +3 -3
- package/dist/{chunk-MVPLEPSI.js → chunk-DP6H3U2X.js} +1 -1
- package/dist/{chunk-E3PDZPGV.js → chunk-EQZUBYRF.js} +1 -1
- package/dist/{chunk-PCPSX4ES.js → chunk-GQN4REF5.js} +14 -12
- package/dist/{chunk-AC7MDOJW.js → chunk-HNMRX2EN.js} +5 -5
- package/dist/{chunk-7R5JRPCY.js → chunk-K2NKG42A.js} +5 -5
- package/dist/{chunk-MFSET7Q7.js → chunk-KTW62MG5.js} +31 -13
- package/dist/{chunk-PY3EIEAF.js → chunk-L4JLLS6C.js} +1 -1
- package/dist/{chunk-CMWIMFM6.js → chunk-LOYTPSAK.js} +5 -5
- package/dist/{chunk-S3SGZUOI.js → chunk-MFZOIKET.js} +1 -1
- package/dist/{chunk-MI6ZBDTS.js → chunk-NK3UEKAW.js} +25 -10
- package/dist/{chunk-QNIOBNOY.js → chunk-NY5SJGJZ.js} +52 -46
- package/dist/{chunk-4RHJ3CXR.js → chunk-Q32BSFN4.js} +13 -12
- package/dist/{chunk-ZV6PFUA4.js → chunk-QRNJO7DZ.js} +1 -1
- package/dist/{chunk-KN32OWL2.js → chunk-RZS4F5K4.js} +3 -3
- package/dist/{chunk-CUYFCI4G.js → chunk-S7NSFCCW.js} +16 -13
- package/dist/{chunk-5VWAY27R.js → chunk-SEIZ2XLD.js} +1 -1
- package/dist/{chunk-MRXMFB4L.js → chunk-SGRL7NV6.js} +5 -5
- package/dist/{chunk-WWYUYKKV.js → chunk-TH6LMEOW.js} +1 -1
- package/dist/{chunk-WMUAKAIF.js → chunk-VGYZ3YZM.js} +85 -41
- package/dist/{chunk-ZUPDSJUE.js → chunk-WBNQYVCM.js} +2 -2
- package/dist/{chunk-GP32KD2J.js → chunk-WCSXTDOL.js} +1 -1
- package/dist/{chunk-O35GZCKL.js → chunk-WNIVCR74.js} +2 -2
- package/dist/{chunk-UCWO5MKP.js → chunk-X6PQKQTY.js} +5 -7
- package/dist/{chunk-5CXCGDIL.js → chunk-YNRLCUCB.js} +1 -1
- package/dist/{chunk-LHKZKAZ4.js → chunk-ZJRGWZZ2.js} +3 -3
- package/dist/{chunk-NY2F7BZA.js → chunk-ZNFNGDT7.js} +1 -1
- package/dist/{chunk-VKQWU4PO.js → chunk-ZRN3OS7M.js} +1 -1
- package/dist/cli/chat.js +33 -33
- package/dist/cli/check.js +5 -5
- package/dist/cli/plugins.js +12 -12
- package/dist/cli/snapshot-create.js +9 -9
- package/dist/cli/upgrade.js +6 -6
- package/dist/db/schema/agent-invocations.d.ts +18 -6
- package/dist/db/schema.d.ts +18 -6
- package/dist/{db-LPJKR2EO.js → db-LG4ZEWA3.js} +6 -6
- package/dist/instrumentation.js +3 -3
- package/dist/nitro.js +6 -6
- package/dist/{oauth-callback-server-DMXF4TTQ.js → oauth-callback-server-KI7ZRTOG.js} +29 -29
- package/dist/{runner-L5DPVYCN.js → runner-K2EOSAZQ.js} +21 -21
- package/dist/{skills-NXG3LBCK.js → skills-JTRDFKMA.js} +5 -5
- package/dist/spawn-SRBETYCF.js +42 -0
- package/dist/task-runner-INQIQ4VF.js +36 -0
- package/dist/{validation-CH36LTOS.js → validation-NBWURHAP.js} +5 -5
- package/dist/version.js +1 -1
- package/dist/{work-HBC5Y5VZ.js → work-35TBEAUI.js} +21 -21
- package/dist/{worker-5RDZHLXH.js → worker-F762M6XM.js} +10 -10
- package/package.json +6 -6
- package/dist/spawn-VRUIGKWW.js +0 -42
- package/dist/task-runner-7YTBSPXW.js +0 -36
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
PluginCredentialFailureError,
|
|
8
8
|
agentNameSchema,
|
|
9
9
|
createPluginAuthOrchestration
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HNMRX2EN.js";
|
|
11
11
|
import {
|
|
12
12
|
parseSandboxEgressAuthRequiredSignal,
|
|
13
13
|
parseSandboxEgressPermissionDeniedSignal,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
searchSlackUsers,
|
|
39
39
|
selectPluginGrant,
|
|
40
40
|
toMcpProviderError
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-CECRMPXJ.js";
|
|
42
42
|
import {
|
|
43
43
|
RetryableDeliveryError,
|
|
44
44
|
actorFromRun,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
surfaceFromRun,
|
|
53
53
|
toolInvocationDestination,
|
|
54
54
|
uploadFilesToConversation
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-GQN4REF5.js";
|
|
56
56
|
import {
|
|
57
57
|
CooperativeTurnYieldError,
|
|
58
58
|
NO_REPLY_MARKER,
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
isNoReplyMarker,
|
|
66
66
|
isTurnInputCommitLostError,
|
|
67
67
|
sanitizeAssistantText
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-WCSXTDOL.js";
|
|
69
69
|
import {
|
|
70
70
|
AGENTS_REMOVAL_NOTICE,
|
|
71
71
|
AGENTS_REPLACEMENT_NOTICE,
|
|
@@ -119,7 +119,7 @@ import {
|
|
|
119
119
|
stripRuntimeTurnContext,
|
|
120
120
|
trimTrailingAssistantMessages,
|
|
121
121
|
truncateText
|
|
122
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-KTW62MG5.js";
|
|
123
123
|
import {
|
|
124
124
|
SCHEDULED_TASK_SYSTEM_ACTOR,
|
|
125
125
|
WORKSPACE_SNAPSHOT_FAILED_EVENT,
|
|
@@ -160,13 +160,13 @@ import {
|
|
|
160
160
|
workspaceSnapshotFinishedEvent,
|
|
161
161
|
workspaceSnapshotWatch,
|
|
162
162
|
writableEventTask
|
|
163
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-LOYTPSAK.js";
|
|
164
164
|
import {
|
|
165
165
|
parseSlackThreadId
|
|
166
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-DP6H3U2X.js";
|
|
167
167
|
import {
|
|
168
168
|
appendAndEnqueueInboundMessage
|
|
169
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-3PDR63SX.js";
|
|
170
170
|
import {
|
|
171
171
|
SHORT_TITLE_MAX_LENGTH,
|
|
172
172
|
ToolInputError,
|
|
@@ -174,7 +174,7 @@ import {
|
|
|
174
174
|
generateShortTitle,
|
|
175
175
|
hasAgentTurnUsage,
|
|
176
176
|
resolveTaskTitle
|
|
177
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-WNIVCR74.js";
|
|
178
178
|
import {
|
|
179
179
|
bindSandboxFileSystem,
|
|
180
180
|
createSandboxSession,
|
|
@@ -185,7 +185,7 @@ import {
|
|
|
185
185
|
resolve,
|
|
186
186
|
setSnapshotSpanAttributes,
|
|
187
187
|
stopSession
|
|
188
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-CUUE5MGF.js";
|
|
189
189
|
import {
|
|
190
190
|
privateTraceResultAttributes
|
|
191
191
|
} from "./chunk-UIE3R5XU.js";
|
|
@@ -195,7 +195,7 @@ import {
|
|
|
195
195
|
} from "./chunk-X6GDDWQH.js";
|
|
196
196
|
import {
|
|
197
197
|
getTurnRequestDeadline
|
|
198
|
-
} from "./chunk-
|
|
198
|
+
} from "./chunk-MFZOIKET.js";
|
|
199
199
|
import {
|
|
200
200
|
getVercelConversationWorkQueue
|
|
201
201
|
} from "./chunk-DKIJ2RP5.js";
|
|
@@ -242,19 +242,19 @@ import {
|
|
|
242
242
|
updateWorkspace,
|
|
243
243
|
withSlackRetries,
|
|
244
244
|
workspaceRepoCheckoutPath
|
|
245
|
-
} from "./chunk-
|
|
245
|
+
} from "./chunk-NK3UEKAW.js";
|
|
246
246
|
import {
|
|
247
247
|
getConversationEventStore,
|
|
248
248
|
getConversationMessageSearchStore,
|
|
249
249
|
getConversationStore,
|
|
250
250
|
getDb,
|
|
251
251
|
getSqlExecutor
|
|
252
|
-
} from "./chunk-
|
|
252
|
+
} from "./chunk-S7NSFCCW.js";
|
|
253
253
|
import {
|
|
254
254
|
juniorArtifacts,
|
|
255
255
|
juniorIdentities,
|
|
256
256
|
juniorSchedulerRuns
|
|
257
|
-
} from "./chunk-
|
|
257
|
+
} from "./chunk-SEIZ2XLD.js";
|
|
258
258
|
import {
|
|
259
259
|
SANDBOX_DATA_ROOT,
|
|
260
260
|
SANDBOX_REPOS_ROOT,
|
|
@@ -285,12 +285,12 @@ import {
|
|
|
285
285
|
throwSandboxOperationError,
|
|
286
286
|
workspaceSnapshotNotReadyUserMessage,
|
|
287
287
|
wrapSandboxSetupError
|
|
288
|
-
} from "./chunk-
|
|
288
|
+
} from "./chunk-7PYCRKQL.js";
|
|
289
289
|
import {
|
|
290
290
|
fenceLock,
|
|
291
291
|
getStateAdapter,
|
|
292
292
|
withLock
|
|
293
|
-
} from "./chunk-
|
|
293
|
+
} from "./chunk-YNRLCUCB.js";
|
|
294
294
|
import {
|
|
295
295
|
KNOWN_CONVERSATION_EVENT_TYPES,
|
|
296
296
|
contextProvenance,
|
|
@@ -323,7 +323,7 @@ import {
|
|
|
323
323
|
resolveGatewayCredential,
|
|
324
324
|
resolveGatewayModel,
|
|
325
325
|
unwrapCurrentInstruction
|
|
326
|
-
} from "./chunk-
|
|
326
|
+
} from "./chunk-2JAWOTUT.js";
|
|
327
327
|
import {
|
|
328
328
|
ModelProfileNotConfiguredError,
|
|
329
329
|
TURN_REASONING_LEVELS,
|
|
@@ -340,16 +340,16 @@ import {
|
|
|
340
340
|
toGenAiMessagesTraceAttributes,
|
|
341
341
|
toGenAiPayloadMetadata,
|
|
342
342
|
toGenAiPayloadTraceAttributes
|
|
343
|
-
} from "./chunk-
|
|
343
|
+
} from "./chunk-BVYUIVXE.js";
|
|
344
344
|
import {
|
|
345
345
|
discoverSkills,
|
|
346
346
|
findSkillByName,
|
|
347
347
|
loadSkillsByName,
|
|
348
348
|
parseSkillInvocation
|
|
349
|
-
} from "./chunk-
|
|
349
|
+
} from "./chunk-6KISW5UY.js";
|
|
350
350
|
import {
|
|
351
351
|
pluginCatalogRuntime
|
|
352
|
-
} from "./chunk-
|
|
352
|
+
} from "./chunk-EQZUBYRF.js";
|
|
353
353
|
import {
|
|
354
354
|
CredentialUnavailableError,
|
|
355
355
|
OAuthProviderError,
|
|
@@ -357,7 +357,7 @@ import {
|
|
|
357
357
|
getOAuthProviderErrorAttributes,
|
|
358
358
|
resolveAuthTokenPlaceholder,
|
|
359
359
|
resolvePluginCommandEnv
|
|
360
|
-
} from "./chunk-
|
|
360
|
+
} from "./chunk-QRNJO7DZ.js";
|
|
361
361
|
import {
|
|
362
362
|
credentialContextForActor,
|
|
363
363
|
credentialUserSubjectId
|
|
@@ -393,7 +393,7 @@ import {
|
|
|
393
393
|
summarizeMessageText,
|
|
394
394
|
withLogContext,
|
|
395
395
|
withSpan
|
|
396
|
-
} from "./chunk-
|
|
396
|
+
} from "./chunk-L4JLLS6C.js";
|
|
397
397
|
import {
|
|
398
398
|
startInactiveSpan,
|
|
399
399
|
withActiveSpan
|
|
@@ -1840,21 +1840,28 @@ function buildRuntimeSection(params) {
|
|
|
1840
1840
|
return renderTagBlock("runtime", lines.join("\n"));
|
|
1841
1841
|
}
|
|
1842
1842
|
function formatSourceLines(source) {
|
|
1843
|
-
switch (source.
|
|
1843
|
+
switch (source.kind) {
|
|
1844
1844
|
case "web":
|
|
1845
1845
|
case "local":
|
|
1846
1846
|
return [
|
|
1847
|
-
`- source.
|
|
1847
|
+
`- source.kind: ${source.kind}`,
|
|
1848
1848
|
`- source.conversation_id: ${escapeXml(source.conversationId)}`
|
|
1849
1849
|
];
|
|
1850
1850
|
case "slack":
|
|
1851
1851
|
return [
|
|
1852
|
-
"- source.
|
|
1852
|
+
"- source.kind: slack",
|
|
1853
1853
|
`- source.team_id: ${escapeXml(source.teamId)}`,
|
|
1854
1854
|
`- source.channel_id: ${escapeXml(source.channelId)}`,
|
|
1855
1855
|
...source.messageTs ? [`- source.message_ts: ${escapeXml(source.messageTs)}`] : [],
|
|
1856
1856
|
...source.threadTs ? [`- source.thread_ts: ${escapeXml(source.threadTs)}`] : []
|
|
1857
1857
|
];
|
|
1858
|
+
case "resource_event":
|
|
1859
|
+
return [
|
|
1860
|
+
"- source.kind: resource_event",
|
|
1861
|
+
`- source.namespace: ${escapeXml(source.namespace)}`,
|
|
1862
|
+
`- source.identifier: ${escapeXml(source.identifier)}`,
|
|
1863
|
+
`- source.event_type: ${escapeXml(source.eventType)}`
|
|
1864
|
+
];
|
|
1858
1865
|
}
|
|
1859
1866
|
}
|
|
1860
1867
|
function formatDestinationLines(destination) {
|
|
@@ -1999,7 +2006,7 @@ var STATIC_SYSTEM_PROMPTS = {
|
|
|
1999
2006
|
slack: buildStaticSystemPrompt("slack")
|
|
2000
2007
|
};
|
|
2001
2008
|
function buildSystemPrompt(params) {
|
|
2002
|
-
const platform = params.source.
|
|
2009
|
+
const platform = params.source.kind === "slack" ? "slack" : "local";
|
|
2003
2010
|
return STATIC_SYSTEM_PROMPTS[platform];
|
|
2004
2011
|
}
|
|
2005
2012
|
function buildTurnContextPrompt(params) {
|
|
@@ -3213,10 +3220,6 @@ function createResourceEventInboundMessage(input) {
|
|
|
3213
3220
|
delivery: "defer",
|
|
3214
3221
|
source: "resource_event",
|
|
3215
3222
|
receivedAtMs: input.receivedAtMs ?? Date.now(),
|
|
3216
|
-
// TODO(dcramer): Store the final publish fact here after resource-event
|
|
3217
|
-
// ingress loads the Conversation. Then remove the worker's Location-based
|
|
3218
|
-
// publish default. Resource events only wake the mailbox until that change.
|
|
3219
|
-
publishExternally: false,
|
|
3220
3223
|
input: {
|
|
3221
3224
|
text: input.text,
|
|
3222
3225
|
authorId: RESOURCE_EVENT_AUTHOR_ID,
|
|
@@ -9133,7 +9136,7 @@ function createUpdateEventTaskTool(context, catalog) {
|
|
|
9133
9136
|
|
|
9134
9137
|
// src/chat/tools/event-tasks.ts
|
|
9135
9138
|
function createEventTaskTools(context, catalog) {
|
|
9136
|
-
if (context.source.
|
|
9139
|
+
if (context.source.kind !== "slack" || context.destination.platform !== "slack" || context.actor?.platform !== "slack") {
|
|
9137
9140
|
return {};
|
|
9138
9141
|
}
|
|
9139
9142
|
const canCreate = hasPluginResourceEventCatalogEntries(catalog);
|
|
@@ -9803,7 +9806,7 @@ function requireActiveConversation(context) {
|
|
|
9803
9806
|
if (!parsed.success) {
|
|
9804
9807
|
const source = context.source;
|
|
9805
9808
|
const issues = parsed.error.issues;
|
|
9806
|
-
if (!source || source.
|
|
9809
|
+
if (!source || source.kind !== "slack") {
|
|
9807
9810
|
throwToolInputError("No active Slack conversation is available.");
|
|
9808
9811
|
}
|
|
9809
9812
|
if (issues.some((issue) => issue.code === "unrecognized_keys")) {
|
|
@@ -9819,7 +9822,7 @@ function requireActiveConversation(context) {
|
|
|
9819
9822
|
}
|
|
9820
9823
|
throwToolInputError("No active Slack conversation is available.");
|
|
9821
9824
|
}
|
|
9822
|
-
if (parsed.data.
|
|
9825
|
+
if (parsed.data.kind !== "slack") {
|
|
9823
9826
|
throwToolInputError("No active Slack conversation is available.");
|
|
9824
9827
|
}
|
|
9825
9828
|
return {
|
|
@@ -10399,7 +10402,7 @@ function createSlackScheduleUpdateTaskTool(context) {
|
|
|
10399
10402
|
|
|
10400
10403
|
// src/chat/tools/scheduled-tasks.ts
|
|
10401
10404
|
function scheduledTaskToolContext(context) {
|
|
10402
|
-
if (context.source.
|
|
10405
|
+
if (context.source.kind !== "slack" || context.destination.platform !== "slack" || context.actor?.platform !== "slack" || !context.resolveActorIdentity) {
|
|
10403
10406
|
return void 0;
|
|
10404
10407
|
}
|
|
10405
10408
|
return {
|
|
@@ -13696,7 +13699,7 @@ async function resolveAccessScope(conversationStore, context, currentConversatio
|
|
|
13696
13699
|
currentConversationId,
|
|
13697
13700
|
current.parentConversationId
|
|
13698
13701
|
) : currentConversationId;
|
|
13699
|
-
if (context.source.
|
|
13702
|
+
if (context.source.kind === "slack") {
|
|
13700
13703
|
return {
|
|
13701
13704
|
currentConversationId,
|
|
13702
13705
|
currentRootConversationId,
|
|
@@ -14926,7 +14929,7 @@ function createTools(availableSkills, hooks = {}, context, options = {}) {
|
|
|
14926
14929
|
context.conversationId
|
|
14927
14930
|
);
|
|
14928
14931
|
}
|
|
14929
|
-
if (context.source.
|
|
14932
|
+
if (context.source.kind === "slack") {
|
|
14930
14933
|
tools.slackPublicSearch = createSlackPublicSearchTool(
|
|
14931
14934
|
context.slackActionToken
|
|
14932
14935
|
);
|
|
@@ -17513,7 +17516,7 @@ async function tryRecordSkillLoadStat(skill) {
|
|
|
17513
17516
|
}
|
|
17514
17517
|
function resolveToolRuntimeRoute(args) {
|
|
17515
17518
|
const destination = toolInvocationDestination(args.run);
|
|
17516
|
-
switch (args.run.source.
|
|
17519
|
+
switch (args.run.source.kind) {
|
|
17517
17520
|
case "slack": {
|
|
17518
17521
|
if (destination.platform !== "slack") {
|
|
17519
17522
|
throw new TypeError("Slack tool runtime requires a Slack destination");
|
|
@@ -17541,6 +17544,12 @@ function resolveToolRuntimeRoute(args) {
|
|
|
17541
17544
|
actor: args.actor?.platform === "web" ? args.actor : void 0,
|
|
17542
17545
|
source: args.run.source
|
|
17543
17546
|
};
|
|
17547
|
+
case "resource_event":
|
|
17548
|
+
return {
|
|
17549
|
+
destination,
|
|
17550
|
+
actor: args.actor?.platform === "system" ? args.actor : void 0,
|
|
17551
|
+
source: args.run.source
|
|
17552
|
+
};
|
|
17544
17553
|
}
|
|
17545
17554
|
}
|
|
17546
17555
|
async function wireAgentTools(args) {
|
|
@@ -17579,7 +17588,7 @@ async function wireAgentTools(args) {
|
|
|
17579
17588
|
channelId: slackChannelId,
|
|
17580
17589
|
destination: args.run.destination,
|
|
17581
17590
|
source: runSource,
|
|
17582
|
-
threadTs: args.run.source.
|
|
17591
|
+
threadTs: args.run.source.kind === "slack" ? args.run.source.threadTs : void 0,
|
|
17583
17592
|
toolChannelId: args.run.toolChannelId,
|
|
17584
17593
|
userMessage: args.userInput,
|
|
17585
17594
|
pendingAuth: args.state.pendingAuth,
|
|
@@ -17600,7 +17609,7 @@ async function wireAgentTools(args) {
|
|
|
17600
17609
|
channelId: slackChannelId,
|
|
17601
17610
|
destination: args.run.destination,
|
|
17602
17611
|
source: runSource,
|
|
17603
|
-
threadTs: args.run.source.
|
|
17612
|
+
threadTs: args.run.source.kind === "slack" ? args.run.source.threadTs : void 0,
|
|
17604
17613
|
userMessage: args.userInput,
|
|
17605
17614
|
pendingAuth: args.state.pendingAuth,
|
|
17606
17615
|
recordPendingAuth: args.durability.recordPendingAuth,
|
|
@@ -17868,7 +17877,6 @@ function createResumeState(args) {
|
|
|
17868
17877
|
channelName: args.channelName,
|
|
17869
17878
|
destination: args.destination,
|
|
17870
17879
|
dispatchId: args.dispatchId,
|
|
17871
|
-
publishExternally: args.publishExternally,
|
|
17872
17880
|
source: args.runSource,
|
|
17873
17881
|
actor: args.actor,
|
|
17874
17882
|
surface: args.surface
|
|
@@ -18634,9 +18642,9 @@ async function executeAgentRun(run, streamFn) {
|
|
|
18634
18642
|
const userActor = actor && "userId" in actor ? actor : void 0;
|
|
18635
18643
|
const runLogContext = {
|
|
18636
18644
|
conversationId: run.conversationId,
|
|
18637
|
-
platform: run.source.
|
|
18638
|
-
messageConversationId: run.source.
|
|
18639
|
-
destinationName: run.location?.channelId ?? (run.source.
|
|
18645
|
+
platform: run.source.kind,
|
|
18646
|
+
messageConversationId: run.source.kind === "slack" ? run.conversationId : run.source.kind === "web" || run.source.kind === "local" ? run.source.conversationId : run.conversationId,
|
|
18647
|
+
destinationName: run.location?.channelId ?? (run.source.kind === "slack" ? run.source.channelId : run.source.kind === "web" || run.source.kind === "local" ? run.source.conversationId : run.conversationId),
|
|
18640
18648
|
userId: userActor?.userId,
|
|
18641
18649
|
userName: userActor?.userName,
|
|
18642
18650
|
userEmail: userActor?.email,
|
|
@@ -18679,7 +18687,6 @@ async function executeAgentRunInPrivacyContext(run, conversationPrivacy, runLogC
|
|
|
18679
18687
|
slackConversation: run.slackConversation,
|
|
18680
18688
|
slackActionToken: run.slackActionToken,
|
|
18681
18689
|
destination: run.destination,
|
|
18682
|
-
publishExternally: run.publishExternally,
|
|
18683
18690
|
surface: run.surface,
|
|
18684
18691
|
dispatch: run.dispatch,
|
|
18685
18692
|
toolChannelId: run.toolChannelId
|
|
@@ -18748,7 +18755,7 @@ async function executeAgentRunInPrivacyContext(run, conversationPrivacy, runLogC
|
|
|
18748
18755
|
const actor = actorFromRun(run);
|
|
18749
18756
|
const surface = surfaceFromRun(run);
|
|
18750
18757
|
const runSource = routing.source;
|
|
18751
|
-
const slackSource = runSource.
|
|
18758
|
+
const slackSource = runSource.kind === "slack" ? runSource : void 0;
|
|
18752
18759
|
const slackChannelId = run.location?.channelId ?? slackSource?.channelId;
|
|
18753
18760
|
const slackActor = actor?.platform === "slack" ? actor : void 0;
|
|
18754
18761
|
const userInput = input.messageText;
|
|
@@ -18834,7 +18841,6 @@ async function executeAgentRunInPrivacyContext(run, conversationPrivacy, runLogC
|
|
|
18834
18841
|
...routing.dispatch?.id ? { dispatchId: routing.dispatch.id } : void 0,
|
|
18835
18842
|
durability,
|
|
18836
18843
|
recordActiveMcpProviders,
|
|
18837
|
-
publishExternally: checkpoint.record?.publishExternally ?? routing.publishExternally ?? false,
|
|
18838
18844
|
actor,
|
|
18839
18845
|
runSource,
|
|
18840
18846
|
conversationId,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
coerceThreadConversationState,
|
|
3
3
|
getPersistedThreadState
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SGRL7NV6.js";
|
|
5
5
|
import {
|
|
6
6
|
recordTaskExecution
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZJRGWZZ2.js";
|
|
8
8
|
import {
|
|
9
9
|
pluginTaskId,
|
|
10
10
|
pluginTaskParamsSchema,
|
|
11
11
|
sendVercelPluginTask
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-RZS4F5K4.js";
|
|
13
13
|
import {
|
|
14
14
|
getPiMessageRole,
|
|
15
15
|
getTurnRecord,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
isToolResultMessage,
|
|
20
20
|
normalizeToolNameFromResult,
|
|
21
21
|
stripRuntimeTurnContext
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-KTW62MG5.js";
|
|
23
23
|
import {
|
|
24
24
|
createPluginConversationEvents,
|
|
25
25
|
createPluginEmbedder,
|
|
@@ -28,17 +28,17 @@ import {
|
|
|
28
28
|
createPluginState,
|
|
29
29
|
getPlugins,
|
|
30
30
|
readActorIdentity
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-NK3UEKAW.js";
|
|
32
32
|
import {
|
|
33
33
|
JUNIOR_THREAD_STATE_TTL_MS
|
|
34
34
|
} from "./chunk-3Y47VMHV.js";
|
|
35
35
|
import {
|
|
36
36
|
getConversationStore,
|
|
37
37
|
getDb
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-S7NSFCCW.js";
|
|
39
39
|
import {
|
|
40
40
|
getStateAdapter
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-YNRLCUCB.js";
|
|
42
42
|
import {
|
|
43
43
|
sameActorIdentity
|
|
44
44
|
} from "./chunk-GFBR4S3Q.js";
|
|
@@ -71,12 +71,12 @@ async function loadConversationChain(conversationId, conversationStore) {
|
|
|
71
71
|
return chain;
|
|
72
72
|
}
|
|
73
73
|
function slackSourceForDestination(args) {
|
|
74
|
-
if (args.source?.
|
|
74
|
+
if (args.source?.kind !== "slack" || args.source.channelId !== args.destination.channelId) {
|
|
75
75
|
return void 0;
|
|
76
76
|
}
|
|
77
77
|
const threadTs = args.source.threadTs?.trim();
|
|
78
78
|
return {
|
|
79
|
-
|
|
79
|
+
kind: "slack",
|
|
80
80
|
visibility: args.source.visibility ?? "public",
|
|
81
81
|
teamId: args.source.teamId?.trim() || args.destination.teamId,
|
|
82
82
|
channelId: args.source.channelId,
|
|
@@ -84,7 +84,7 @@ function slackSourceForDestination(args) {
|
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
async function resolveConversationRouting(args) {
|
|
87
|
-
const conversationStore = args.conversationStore ?? (await import("./db-
|
|
87
|
+
const conversationStore = args.conversationStore ?? (await import("./db-LG4ZEWA3.js")).getConversationStore();
|
|
88
88
|
const chain = await loadConversationChain(
|
|
89
89
|
args.conversationId,
|
|
90
90
|
conversationStore
|
|
@@ -611,7 +611,7 @@ function messageExistedAtRunCompletion(message, completedAtMs) {
|
|
|
611
611
|
return messageTimestampMs !== void 0 && messageTimestampMs <= completedAtMs;
|
|
612
612
|
}
|
|
613
613
|
async function loadConversationContextTranscriptEntries(record, source, runActor) {
|
|
614
|
-
switch (source.
|
|
614
|
+
switch (source.kind) {
|
|
615
615
|
case "slack":
|
|
616
616
|
if (source.visibility === "private") {
|
|
617
617
|
return [];
|
|
@@ -619,6 +619,7 @@ async function loadConversationContextTranscriptEntries(record, source, runActor
|
|
|
619
619
|
break;
|
|
620
620
|
case "web":
|
|
621
621
|
case "local":
|
|
622
|
+
case "resource_event":
|
|
622
623
|
return [];
|
|
623
624
|
}
|
|
624
625
|
const state = await getPersistedThreadState(record.conversationId);
|
|
@@ -680,7 +681,7 @@ async function loadPluginRun(params) {
|
|
|
680
681
|
const routing = await resolveTurnSessionRouting({
|
|
681
682
|
conversationId: params.conversationId
|
|
682
683
|
});
|
|
683
|
-
const runActor = record.actors[0] ?? (record.dispatchId ? (await getDispatchRecord(record.dispatchId))?.actor : void 0);
|
|
684
|
+
const runActor = record.actor ?? record.actors[0] ?? (record.dispatchId ? (await getDispatchRecord(record.dispatchId))?.actor : void 0);
|
|
684
685
|
const actorUser = runActor ? (await readActorIdentity(runActor))?.user : void 0;
|
|
685
686
|
const runEntries = turnMessagesWithProvenance(record).map(
|
|
686
687
|
({ message, provenance }) => runTranscriptEntry(message, provenance, runActor)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runWithTurnRequestDeadline
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MFZOIKET.js";
|
|
4
4
|
import {
|
|
5
5
|
QUEUE_SIGNATURE_MAX_AGE_MS,
|
|
6
6
|
createVercelQueueClient,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-7H2VZTWN.js";
|
|
10
10
|
import {
|
|
11
11
|
logWarn
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-L4JLLS6C.js";
|
|
13
13
|
|
|
14
14
|
// src/chat/plugins/task-queue.ts
|
|
15
15
|
import { createHash } from "crypto";
|
|
@@ -129,7 +129,7 @@ function pluginTaskCallback() {
|
|
|
129
129
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
130
130
|
// Load the runner on first use so this module can send without a cycle.
|
|
131
131
|
run: async (message) => {
|
|
132
|
-
const { processPluginTask } = await import("./task-runner-
|
|
132
|
+
const { processPluginTask } = await import("./task-runner-INQIQ4VF.js");
|
|
133
133
|
await processPluginTask(message);
|
|
134
134
|
},
|
|
135
135
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
juniorConversations,
|
|
9
9
|
juniorIdentities,
|
|
10
10
|
juniorUsers
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-SEIZ2XLD.js";
|
|
12
12
|
import {
|
|
13
13
|
conversationEventDataSchema,
|
|
14
14
|
decodeStoredConversationEvent,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "./chunk-VFUK3X5B.js";
|
|
21
21
|
import {
|
|
22
22
|
getChatConfig
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-2JAWOTUT.js";
|
|
24
24
|
import {
|
|
25
25
|
parseActorUserId,
|
|
26
26
|
parseSlackChannelReferenceId,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
} from "./chunk-N7TMSOZH.js";
|
|
29
29
|
import {
|
|
30
30
|
normalizeIdentityEmail
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-L4JLLS6C.js";
|
|
32
32
|
|
|
33
33
|
// src/chat/conversations/sql/store.ts
|
|
34
34
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
@@ -257,23 +257,26 @@ function normalizeSessionSource(value) {
|
|
|
257
257
|
if (!value) {
|
|
258
258
|
return void 0;
|
|
259
259
|
}
|
|
260
|
-
if (value.
|
|
260
|
+
if (value.kind === "local") {
|
|
261
261
|
return {
|
|
262
|
-
|
|
262
|
+
kind: "local",
|
|
263
263
|
visibility: value.visibility,
|
|
264
264
|
conversationId: value.conversationId
|
|
265
265
|
};
|
|
266
266
|
}
|
|
267
|
-
if (value.
|
|
267
|
+
if (value.kind === "web") {
|
|
268
268
|
return {
|
|
269
|
-
|
|
269
|
+
kind: "web",
|
|
270
270
|
visibility: value.visibility,
|
|
271
271
|
conversationId: value.conversationId
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
|
+
if (value.kind === "resource_event") {
|
|
275
|
+
return void 0;
|
|
276
|
+
}
|
|
274
277
|
const threadTs = value.threadTs?.trim();
|
|
275
278
|
return {
|
|
276
|
-
|
|
279
|
+
kind: "slack",
|
|
277
280
|
visibility: value.visibility,
|
|
278
281
|
teamId: value.teamId,
|
|
279
282
|
channelId: value.channelId,
|
|
@@ -424,7 +427,7 @@ import { locationSchema } from "@sentry/junior-plugin-api";
|
|
|
424
427
|
function locationForWrite(args) {
|
|
425
428
|
const location = args.location ? locationSchema.parse(args.location) : void 0;
|
|
426
429
|
const destination = args.destination?.platform === "slack" ? args.destination : void 0;
|
|
427
|
-
const source = args.sessionSource?.
|
|
430
|
+
const source = args.sessionSource?.kind === "slack" ? args.sessionSource : void 0;
|
|
428
431
|
if (location) {
|
|
429
432
|
if (destination && (location.id !== args.destinationId || location.teamId !== destination.teamId || location.channelId !== destination.channelId) || source && (location.teamId !== source.teamId || location.channelId !== source.channelId)) {
|
|
430
433
|
throw new Error("Conversation Location changed");
|
|
@@ -455,7 +458,7 @@ function locationFromRow(value, row, sessionSource) {
|
|
|
455
458
|
if (row.provider !== "slack") {
|
|
456
459
|
throw new Error("Conversation Location provider is not supported");
|
|
457
460
|
}
|
|
458
|
-
const slackSource = sessionSource?.
|
|
461
|
+
const slackSource = sessionSource?.kind === "slack" && sessionSource.teamId === row.providerTenantId && sessionSource.channelId === row.providerDestinationId ? sessionSource : void 0;
|
|
459
462
|
return locationSchema.parse({
|
|
460
463
|
id: row.id,
|
|
461
464
|
provider: "slack",
|
|
@@ -1166,9 +1169,9 @@ async function loadConversationSlackTenantId(executor, conversationId) {
|
|
|
1166
1169
|
if (destinationTenant) {
|
|
1167
1170
|
return destinationTenant;
|
|
1168
1171
|
}
|
|
1169
|
-
const sessionSource = row?.sessionSource;
|
|
1170
|
-
if (
|
|
1171
|
-
return sessionSource.teamId
|
|
1172
|
+
const sessionSource = parseSessionSource(row?.sessionSource);
|
|
1173
|
+
if (sessionSource?.kind === "slack") {
|
|
1174
|
+
return sessionSource.teamId;
|
|
1172
1175
|
}
|
|
1173
1176
|
return void 0;
|
|
1174
1177
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
persistConversationMessages
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KTW62MG5.js";
|
|
4
4
|
import {
|
|
5
5
|
JUNIOR_THREAD_STATE_TTL_MS
|
|
6
6
|
} from "./chunk-3Y47VMHV.js";
|
|
7
7
|
import {
|
|
8
8
|
getDb
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-S7NSFCCW.js";
|
|
10
10
|
import {
|
|
11
11
|
juniorLocationConfigurations
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SEIZ2XLD.js";
|
|
13
13
|
import {
|
|
14
14
|
getStateAdapter
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-YNRLCUCB.js";
|
|
16
16
|
import {
|
|
17
17
|
juniorDestinations
|
|
18
18
|
} from "./chunk-VFUK3X5B.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
isRecord,
|
|
21
21
|
toOptionalNumber,
|
|
22
22
|
toOptionalString
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-L4JLLS6C.js";
|
|
24
24
|
|
|
25
25
|
// src/chat/state/conversation.ts
|
|
26
26
|
function defaultConversationState() {
|