@sentry/junior 0.189.0 → 0.190.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-3IG2FQW2.js} +11 -11
- package/dist/api.js +27 -27
- package/dist/app.js +86 -67
- package/dist/{catalog-runtime-IETJLJFG.js → catalog-runtime-2OT7S3ZC.js} +4 -4
- package/dist/chat/actor.d.ts +7 -2
- package/dist/chat/agent-invocations/types.d.ts +44 -308
- package/dist/chat/event-tasks/tool-support.d.ts +1 -1
- package/dist/chat/resource-events/actor.d.ts +2 -2
- package/dist/chat/source.d.ts +3 -3
- package/dist/chat/task-execution/mailbox-turn.d.ts +16 -6
- package/dist/chat/task-execution/state.d.ts +2 -2
- package/dist/chat/task-execution/store.d.ts +1 -1
- package/dist/chat/task-execution/turn-cursor.d.ts +10 -1
- package/dist/chat/tools/types.d.ts +9 -2
- package/dist/{chunk-6AUR6PWR.js → chunk-2MKHYSYL.js} +3 -3
- package/dist/{chunk-MI6ZBDTS.js → chunk-2MRF22J4.js} +25 -10
- package/dist/{chunk-OEIITG5F.js → chunk-3J3BCB4J.js} +1 -1
- package/dist/{chunk-SR6OMO5C.js → chunk-4BLFIYVK.js} +8 -8
- package/dist/{chunk-E3PDZPGV.js → chunk-4PKEJK5B.js} +1 -1
- package/dist/{chunk-CMWIMFM6.js → chunk-62DRKZQU.js} +5 -5
- package/dist/{chunk-ZV6PFUA4.js → chunk-663DQH5W.js} +1 -1
- package/dist/{chunk-GP32KD2J.js → chunk-67MMSYSE.js} +1 -1
- package/dist/{chunk-5CXCGDIL.js → chunk-6BXUSF7J.js} +1 -1
- package/dist/{chunk-WWYUYKKV.js → chunk-6H7YU6XH.js} +1 -1
- package/dist/{chunk-S3SGZUOI.js → chunk-7UJ6IJCK.js} +1 -1
- package/dist/{chunk-7R5JRPCY.js → chunk-7Y7XMI6P.js} +5 -5
- package/dist/{chunk-MFSET7Q7.js → chunk-BGOLRC36.js} +24 -8
- package/dist/{chunk-MVPLEPSI.js → chunk-BUJU6C2J.js} +1 -1
- package/dist/{chunk-KN32OWL2.js → chunk-CZXZKTAI.js} +3 -3
- package/dist/{chunk-QNIOBNOY.js → chunk-DJZGQ7OL.js} +52 -39
- package/dist/{chunk-DYXVAO2E.js → chunk-DVX6U6GI.js} +1 -1
- package/dist/{chunk-4RHJ3CXR.js → chunk-ECOR3OXY.js} +13 -12
- package/dist/{chunk-WMUAKAIF.js → chunk-F3K2267N.js} +29 -27
- package/dist/{chunk-YYZNESC3.js → chunk-FVFJ57RK.js} +8 -8
- package/dist/{chunk-PCPSX4ES.js → chunk-GWCFXTB6.js} +14 -12
- package/dist/{chunk-WDHPN2GH.js → chunk-HI5KXE3C.js} +3 -3
- package/dist/{chunk-WYDF6PGK.js → chunk-IRQ3RSX3.js} +3 -3
- package/dist/{chunk-NY2F7BZA.js → chunk-JV7U4665.js} +1 -1
- package/dist/{chunk-LHKZKAZ4.js → chunk-MNHJ4WLE.js} +3 -3
- package/dist/{chunk-YNZPOFF3.js → chunk-OJFX2FP7.js} +9 -9
- package/dist/{chunk-CUYFCI4G.js → chunk-OKAHLUSU.js} +16 -13
- package/dist/{chunk-VKQWU4PO.js → chunk-OON4IQHH.js} +1 -1
- package/dist/{chunk-AC7MDOJW.js → chunk-OYCOLHCR.js} +5 -5
- package/dist/{chunk-YYSEH2WC.js → chunk-REVH4BZU.js} +2 -2
- package/dist/{chunk-UCWO5MKP.js → chunk-RLYJYEIY.js} +4 -4
- package/dist/{chunk-ZUPDSJUE.js → chunk-T66GV7A3.js} +2 -2
- package/dist/{chunk-BYBSI5TI.js → chunk-VWNIDTFR.js} +2 -2
- package/dist/{chunk-MRXMFB4L.js → chunk-W2C4TPLB.js} +5 -5
- package/dist/{chunk-PY3EIEAF.js → chunk-Y4WL4OYD.js} +1 -1
- package/dist/{chunk-WN6VLHOU.js → chunk-YFU4DGZY.js} +4 -4
- package/dist/{chunk-O35GZCKL.js → chunk-YKIAUKYH.js} +2 -2
- package/dist/{chunk-5VWAY27R.js → chunk-ZFCO2TMB.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-2IFDMDDY.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-SZSS2KH6.js} +29 -29
- package/dist/{runner-L5DPVYCN.js → runner-2N4QU77X.js} +21 -21
- package/dist/{skills-NXG3LBCK.js → skills-VU2LZAKX.js} +5 -5
- package/dist/spawn-3K7RV4T5.js +42 -0
- package/dist/task-runner-52DYFHW3.js +36 -0
- package/dist/{validation-CH36LTOS.js → validation-IJGHK7NI.js} +5 -5
- package/dist/version.js +1 -1
- package/dist/{work-HBC5Y5VZ.js → work-DI45MLRL.js} +21 -21
- package/dist/{worker-5RDZHLXH.js → worker-FY7KWG2M.js} +10 -10
- package/package.json +5 -5
- 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-OYCOLHCR.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-FVFJ57RK.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-GWCFXTB6.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-67MMSYSE.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-BGOLRC36.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-62DRKZQU.js";
|
|
164
164
|
import {
|
|
165
165
|
parseSlackThreadId
|
|
166
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-BUJU6C2J.js";
|
|
167
167
|
import {
|
|
168
168
|
appendAndEnqueueInboundMessage
|
|
169
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-YFU4DGZY.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-YKIAUKYH.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-2MKHYSYL.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-7UJ6IJCK.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-2MRF22J4.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-OKAHLUSU.js";
|
|
253
253
|
import {
|
|
254
254
|
juniorArtifacts,
|
|
255
255
|
juniorIdentities,
|
|
256
256
|
juniorSchedulerRuns
|
|
257
|
-
} from "./chunk-
|
|
257
|
+
} from "./chunk-ZFCO2TMB.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-HI5KXE3C.js";
|
|
289
289
|
import {
|
|
290
290
|
fenceLock,
|
|
291
291
|
getStateAdapter,
|
|
292
292
|
withLock
|
|
293
|
-
} from "./chunk-
|
|
293
|
+
} from "./chunk-6BXUSF7J.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-VWNIDTFR.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-DVX6U6GI.js";
|
|
344
344
|
import {
|
|
345
345
|
discoverSkills,
|
|
346
346
|
findSkillByName,
|
|
347
347
|
loadSkillsByName,
|
|
348
348
|
parseSkillInvocation
|
|
349
|
-
} from "./chunk-
|
|
349
|
+
} from "./chunk-REVH4BZU.js";
|
|
350
350
|
import {
|
|
351
351
|
pluginCatalogRuntime
|
|
352
|
-
} from "./chunk-
|
|
352
|
+
} from "./chunk-4PKEJK5B.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-663DQH5W.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-Y4WL4OYD.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) {
|
|
@@ -9133,7 +9140,7 @@ function createUpdateEventTaskTool(context, catalog) {
|
|
|
9133
9140
|
|
|
9134
9141
|
// src/chat/tools/event-tasks.ts
|
|
9135
9142
|
function createEventTaskTools(context, catalog) {
|
|
9136
|
-
if (context.source.
|
|
9143
|
+
if (context.source.kind !== "slack" || context.destination.platform !== "slack" || context.actor?.platform !== "slack") {
|
|
9137
9144
|
return {};
|
|
9138
9145
|
}
|
|
9139
9146
|
const canCreate = hasPluginResourceEventCatalogEntries(catalog);
|
|
@@ -9803,7 +9810,7 @@ function requireActiveConversation(context) {
|
|
|
9803
9810
|
if (!parsed.success) {
|
|
9804
9811
|
const source = context.source;
|
|
9805
9812
|
const issues = parsed.error.issues;
|
|
9806
|
-
if (!source || source.
|
|
9813
|
+
if (!source || source.kind !== "slack") {
|
|
9807
9814
|
throwToolInputError("No active Slack conversation is available.");
|
|
9808
9815
|
}
|
|
9809
9816
|
if (issues.some((issue) => issue.code === "unrecognized_keys")) {
|
|
@@ -9819,7 +9826,7 @@ function requireActiveConversation(context) {
|
|
|
9819
9826
|
}
|
|
9820
9827
|
throwToolInputError("No active Slack conversation is available.");
|
|
9821
9828
|
}
|
|
9822
|
-
if (parsed.data.
|
|
9829
|
+
if (parsed.data.kind !== "slack") {
|
|
9823
9830
|
throwToolInputError("No active Slack conversation is available.");
|
|
9824
9831
|
}
|
|
9825
9832
|
return {
|
|
@@ -10399,7 +10406,7 @@ function createSlackScheduleUpdateTaskTool(context) {
|
|
|
10399
10406
|
|
|
10400
10407
|
// src/chat/tools/scheduled-tasks.ts
|
|
10401
10408
|
function scheduledTaskToolContext(context) {
|
|
10402
|
-
if (context.source.
|
|
10409
|
+
if (context.source.kind !== "slack" || context.destination.platform !== "slack" || context.actor?.platform !== "slack" || !context.resolveActorIdentity) {
|
|
10403
10410
|
return void 0;
|
|
10404
10411
|
}
|
|
10405
10412
|
return {
|
|
@@ -13696,7 +13703,7 @@ async function resolveAccessScope(conversationStore, context, currentConversatio
|
|
|
13696
13703
|
currentConversationId,
|
|
13697
13704
|
current.parentConversationId
|
|
13698
13705
|
) : currentConversationId;
|
|
13699
|
-
if (context.source.
|
|
13706
|
+
if (context.source.kind === "slack") {
|
|
13700
13707
|
return {
|
|
13701
13708
|
currentConversationId,
|
|
13702
13709
|
currentRootConversationId,
|
|
@@ -14926,7 +14933,7 @@ function createTools(availableSkills, hooks = {}, context, options = {}) {
|
|
|
14926
14933
|
context.conversationId
|
|
14927
14934
|
);
|
|
14928
14935
|
}
|
|
14929
|
-
if (context.source.
|
|
14936
|
+
if (context.source.kind === "slack") {
|
|
14930
14937
|
tools.slackPublicSearch = createSlackPublicSearchTool(
|
|
14931
14938
|
context.slackActionToken
|
|
14932
14939
|
);
|
|
@@ -17513,7 +17520,7 @@ async function tryRecordSkillLoadStat(skill) {
|
|
|
17513
17520
|
}
|
|
17514
17521
|
function resolveToolRuntimeRoute(args) {
|
|
17515
17522
|
const destination = toolInvocationDestination(args.run);
|
|
17516
|
-
switch (args.run.source.
|
|
17523
|
+
switch (args.run.source.kind) {
|
|
17517
17524
|
case "slack": {
|
|
17518
17525
|
if (destination.platform !== "slack") {
|
|
17519
17526
|
throw new TypeError("Slack tool runtime requires a Slack destination");
|
|
@@ -17541,6 +17548,12 @@ function resolveToolRuntimeRoute(args) {
|
|
|
17541
17548
|
actor: args.actor?.platform === "web" ? args.actor : void 0,
|
|
17542
17549
|
source: args.run.source
|
|
17543
17550
|
};
|
|
17551
|
+
case "resource_event":
|
|
17552
|
+
return {
|
|
17553
|
+
destination,
|
|
17554
|
+
actor: args.actor?.platform === "system" ? args.actor : void 0,
|
|
17555
|
+
source: args.run.source
|
|
17556
|
+
};
|
|
17544
17557
|
}
|
|
17545
17558
|
}
|
|
17546
17559
|
async function wireAgentTools(args) {
|
|
@@ -17579,7 +17592,7 @@ async function wireAgentTools(args) {
|
|
|
17579
17592
|
channelId: slackChannelId,
|
|
17580
17593
|
destination: args.run.destination,
|
|
17581
17594
|
source: runSource,
|
|
17582
|
-
threadTs: args.run.source.
|
|
17595
|
+
threadTs: args.run.source.kind === "slack" ? args.run.source.threadTs : void 0,
|
|
17583
17596
|
toolChannelId: args.run.toolChannelId,
|
|
17584
17597
|
userMessage: args.userInput,
|
|
17585
17598
|
pendingAuth: args.state.pendingAuth,
|
|
@@ -17600,7 +17613,7 @@ async function wireAgentTools(args) {
|
|
|
17600
17613
|
channelId: slackChannelId,
|
|
17601
17614
|
destination: args.run.destination,
|
|
17602
17615
|
source: runSource,
|
|
17603
|
-
threadTs: args.run.source.
|
|
17616
|
+
threadTs: args.run.source.kind === "slack" ? args.run.source.threadTs : void 0,
|
|
17604
17617
|
userMessage: args.userInput,
|
|
17605
17618
|
pendingAuth: args.state.pendingAuth,
|
|
17606
17619
|
recordPendingAuth: args.durability.recordPendingAuth,
|
|
@@ -18634,9 +18647,9 @@ async function executeAgentRun(run, streamFn) {
|
|
|
18634
18647
|
const userActor = actor && "userId" in actor ? actor : void 0;
|
|
18635
18648
|
const runLogContext = {
|
|
18636
18649
|
conversationId: run.conversationId,
|
|
18637
|
-
platform: run.source.
|
|
18638
|
-
messageConversationId: run.source.
|
|
18639
|
-
destinationName: run.location?.channelId ?? (run.source.
|
|
18650
|
+
platform: run.source.kind,
|
|
18651
|
+
messageConversationId: run.source.kind === "slack" ? run.conversationId : run.source.kind === "web" || run.source.kind === "local" ? run.source.conversationId : run.conversationId,
|
|
18652
|
+
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
18653
|
userId: userActor?.userId,
|
|
18641
18654
|
userName: userActor?.userName,
|
|
18642
18655
|
userEmail: userActor?.email,
|
|
@@ -18748,7 +18761,7 @@ async function executeAgentRunInPrivacyContext(run, conversationPrivacy, runLogC
|
|
|
18748
18761
|
const actor = actorFromRun(run);
|
|
18749
18762
|
const surface = surfaceFromRun(run);
|
|
18750
18763
|
const runSource = routing.source;
|
|
18751
|
-
const slackSource = runSource.
|
|
18764
|
+
const slackSource = runSource.kind === "slack" ? runSource : void 0;
|
|
18752
18765
|
const slackChannelId = run.location?.channelId ?? slackSource?.channelId;
|
|
18753
18766
|
const slackActor = actor?.platform === "slack" ? actor : void 0;
|
|
18754
18767
|
const userInput = input.messageText;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
coerceThreadConversationState,
|
|
3
3
|
getPersistedThreadState
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-W2C4TPLB.js";
|
|
5
5
|
import {
|
|
6
6
|
recordTaskExecution
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MNHJ4WLE.js";
|
|
8
8
|
import {
|
|
9
9
|
pluginTaskId,
|
|
10
10
|
pluginTaskParamsSchema,
|
|
11
11
|
sendVercelPluginTask
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CZXZKTAI.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-BGOLRC36.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-2MRF22J4.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-OKAHLUSU.js";
|
|
39
39
|
import {
|
|
40
40
|
getStateAdapter
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-6BXUSF7J.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-2IFDMDDY.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)
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
AgentRunError,
|
|
6
6
|
executeTurn
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IRQ3RSX3.js";
|
|
8
8
|
import {
|
|
9
9
|
buildDeliveredTurnStatePatch,
|
|
10
10
|
finalizeFailedTurnReplyWithEvent,
|
|
@@ -15,14 +15,14 @@ import {
|
|
|
15
15
|
getTurnUserSlackMessageTs,
|
|
16
16
|
persistAuthPauseTurnState,
|
|
17
17
|
requireTurnFailureEventId
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-7Y7XMI6P.js";
|
|
19
19
|
import {
|
|
20
20
|
resolveTurnSessionRouting,
|
|
21
21
|
scheduleSessionCompletedPluginTasks
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-ECOR3OXY.js";
|
|
23
23
|
import {
|
|
24
24
|
getTurnLifecycle
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-6H7YU6XH.js";
|
|
26
26
|
import {
|
|
27
27
|
coerceThreadConversationState,
|
|
28
28
|
configValueSchema,
|
|
@@ -30,11 +30,11 @@ import {
|
|
|
30
30
|
getPersistedSandboxState,
|
|
31
31
|
getPersistedThreadState,
|
|
32
32
|
persistThreadStateById
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-W2C4TPLB.js";
|
|
34
34
|
import {
|
|
35
35
|
buildSentryConversationUrl,
|
|
36
36
|
deleteWebAuthorization
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-OON4IQHH.js";
|
|
38
38
|
import {
|
|
39
39
|
createUserTokenStore,
|
|
40
40
|
deleteMcpAuthSession,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
getMcpStoredOAuthCredentials,
|
|
45
45
|
lookupSlackUserProfile,
|
|
46
46
|
resolvePluginOAuthAccount
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-FVFJ57RK.js";
|
|
48
48
|
import {
|
|
49
49
|
RetryableDeliveryError,
|
|
50
50
|
addReactionToMessage,
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
removeReactionFromMessage,
|
|
59
59
|
resolveBaseUrl,
|
|
60
60
|
truncateStatusText
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-GWCFXTB6.js";
|
|
62
62
|
import {
|
|
63
63
|
CooperativeTurnYieldError,
|
|
64
64
|
clearPendingAuth,
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
isCooperativeTurnYieldError,
|
|
68
68
|
isPendingAuthLatestRequest,
|
|
69
69
|
markTurnFailed
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-67MMSYSE.js";
|
|
71
71
|
import {
|
|
72
72
|
TurnSliceLimitExceededError,
|
|
73
73
|
abandonTurnRecord,
|
|
@@ -87,20 +87,20 @@ import {
|
|
|
87
87
|
recordTurnSummary,
|
|
88
88
|
saveTurnCheckpoint,
|
|
89
89
|
turnHasReply
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-BGOLRC36.js";
|
|
91
91
|
import {
|
|
92
92
|
parseSlackThreadId,
|
|
93
93
|
readSlackRawMessageContext,
|
|
94
94
|
resolveSlackChannelIdFromMessage,
|
|
95
95
|
resolveSlackChannelIdFromThreadId
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-BUJU6C2J.js";
|
|
97
97
|
import {
|
|
98
98
|
ensureConversationWake,
|
|
99
99
|
requestConversationWork
|
|
100
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-YFU4DGZY.js";
|
|
101
101
|
import {
|
|
102
102
|
getTurnRequestDeadline
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-7UJ6IJCK.js";
|
|
104
104
|
import {
|
|
105
105
|
getVercelConversationWorkQueue
|
|
106
106
|
} from "./chunk-DKIJ2RP5.js";
|
|
@@ -112,39 +112,39 @@ import {
|
|
|
112
112
|
getSlackClient,
|
|
113
113
|
isDmChannel,
|
|
114
114
|
normalizeSlackConversationId
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-2MRF22J4.js";
|
|
116
116
|
import {
|
|
117
117
|
getConversationStore,
|
|
118
118
|
getSqlExecutor,
|
|
119
119
|
requireSlackDestination,
|
|
120
120
|
upsertIdentity,
|
|
121
121
|
upsertLinkedIdentity
|
|
122
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-OKAHLUSU.js";
|
|
123
123
|
import {
|
|
124
124
|
acquireActiveLock,
|
|
125
125
|
getStateAdapter
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-6BXUSF7J.js";
|
|
127
127
|
import {
|
|
128
128
|
botConfig,
|
|
129
129
|
escapeXml,
|
|
130
130
|
getChatConfig,
|
|
131
131
|
getRuntimeMetadata,
|
|
132
132
|
normalizeSlackEmojiName
|
|
133
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-VWNIDTFR.js";
|
|
134
134
|
import {
|
|
135
135
|
defaultModelId
|
|
136
136
|
} from "./chunk-D4YV5TDV.js";
|
|
137
137
|
import {
|
|
138
138
|
discoverSkills
|
|
139
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-REVH4BZU.js";
|
|
140
140
|
import {
|
|
141
141
|
pluginCatalogRuntime
|
|
142
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-4PKEJK5B.js";
|
|
143
143
|
import {
|
|
144
144
|
buildOAuthTokenRequest,
|
|
145
145
|
hasRequiredOAuthScope,
|
|
146
146
|
parseOAuthTokenResponse
|
|
147
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-663DQH5W.js";
|
|
148
148
|
import {
|
|
149
149
|
createSlackResumeActor,
|
|
150
150
|
isUserActor,
|
|
@@ -163,7 +163,7 @@ import {
|
|
|
163
163
|
setTags,
|
|
164
164
|
toOptionalString,
|
|
165
165
|
withLogContext
|
|
166
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-Y4WL4OYD.js";
|
|
167
167
|
|
|
168
168
|
// src/chat/slack/assistant-thread/status-render.ts
|
|
169
169
|
var DEFAULT_STATUS_CONTEXTS = {
|
|
@@ -1268,7 +1268,7 @@ function buildResumedRun(args, statusSession, delivery) {
|
|
|
1268
1268
|
...savedRun.instruction ?? { text: args.messageText },
|
|
1269
1269
|
text: args.messageText
|
|
1270
1270
|
},
|
|
1271
|
-
source: source.
|
|
1271
|
+
source: source.kind === "slack" ? {
|
|
1272
1272
|
...source,
|
|
1273
1273
|
channelId: args.channelId,
|
|
1274
1274
|
...args.threadTs ? { threadTs: args.threadTs } : void 0
|
|
@@ -2033,6 +2033,7 @@ async function resumeAuthorizedMcpTurn(args) {
|
|
|
2033
2033
|
let actor;
|
|
2034
2034
|
try {
|
|
2035
2035
|
actor = createSlackResumeActor({
|
|
2036
|
+
actor: lockedSessionRecord.actor,
|
|
2036
2037
|
teamId: destination.teamId,
|
|
2037
2038
|
userId: authSession.userId
|
|
2038
2039
|
});
|
|
@@ -2178,7 +2179,7 @@ async function isCurrentMcpAuthorizationAttempt(authSession, provider) {
|
|
|
2178
2179
|
return pendingAuth?.authSessionId === authSession.authSessionId && pendingAuth.sessionId === authSession.sessionId;
|
|
2179
2180
|
}
|
|
2180
2181
|
function mcpConversationId(authSession) {
|
|
2181
|
-
if (authSession.destination?.platform === "local" || authSession.source?.
|
|
2182
|
+
if (authSession.destination?.platform === "local" || authSession.source?.kind === "web") {
|
|
2182
2183
|
return authSession.conversationId;
|
|
2183
2184
|
}
|
|
2184
2185
|
if (authSession.channelId && authSession.threadTs) {
|
|
@@ -2274,7 +2275,7 @@ async function GET(request, provider, waitUntil, options) {
|
|
|
2274
2275
|
"app.credential.provider": provider
|
|
2275
2276
|
});
|
|
2276
2277
|
}
|
|
2277
|
-
if (authSession.source?.
|
|
2278
|
+
if (authSession.source?.kind === "web" && authSession.destination) {
|
|
2278
2279
|
waitUntil(async () => {
|
|
2279
2280
|
const turn = await getTurnRecord(
|
|
2280
2281
|
authSession.conversationId,
|
|
@@ -2319,7 +2320,7 @@ async function GET(request, provider, waitUntil, options) {
|
|
|
2319
2320
|
return htmlResponse("success", {
|
|
2320
2321
|
// Web roots keep a local destination for conversation-only delivery.
|
|
2321
2322
|
// Only the CLI path should get the local-client success copy.
|
|
2322
|
-
local: authSession.destination?.platform === "local" && authSession.source?.
|
|
2323
|
+
local: authSession.destination?.platform === "local" && authSession.source?.kind !== "web"
|
|
2323
2324
|
});
|
|
2324
2325
|
} catch (callbackError) {
|
|
2325
2326
|
if (callbackError instanceof McpOAuthAttemptExpiredError) {
|
|
@@ -2694,6 +2695,7 @@ async function resumeOAuthSessionRecordTurn(stored, options) {
|
|
|
2694
2695
|
let actor;
|
|
2695
2696
|
try {
|
|
2696
2697
|
actor = createSlackResumeActor({
|
|
2698
|
+
actor: lockedSessionRecord.actor,
|
|
2697
2699
|
teamId: destination.teamId,
|
|
2698
2700
|
userId: lockedUserMessage.author.userId
|
|
2699
2701
|
});
|
|
@@ -3045,7 +3047,7 @@ async function GET2(request, provider, waitUntil, options) {
|
|
|
3045
3047
|
{ "app.credential.provider": provider }
|
|
3046
3048
|
);
|
|
3047
3049
|
}
|
|
3048
|
-
if (stored.destination?.platform !== "local" && stored.source?.
|
|
3050
|
+
if (stored.destination?.platform !== "local" && stored.source?.kind !== "web") {
|
|
3049
3051
|
waitUntil(async () => {
|
|
3050
3052
|
try {
|
|
3051
3053
|
await publishAppHomeView(
|
|
@@ -3058,7 +3060,7 @@ async function GET2(request, provider, waitUntil, options) {
|
|
|
3058
3060
|
});
|
|
3059
3061
|
}
|
|
3060
3062
|
const resumesWebTurn = Boolean(
|
|
3061
|
-
stored.source?.
|
|
3063
|
+
stored.source?.kind === "web" && stored.destination && stored.resumeConversationId && stored.resumeSessionId
|
|
3062
3064
|
);
|
|
3063
3065
|
const resumesAgentTurn = Boolean(
|
|
3064
3066
|
stored.destination?.platform !== "local" && stored.resumeConversationId && stored.resumeSessionId
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveBaseUrl
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GWCFXTB6.js";
|
|
4
4
|
import {
|
|
5
5
|
createPluginLogger,
|
|
6
6
|
getPlugins,
|
|
7
7
|
getSlackClient,
|
|
8
8
|
withSlackRetries
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2MRF22J4.js";
|
|
10
10
|
import {
|
|
11
11
|
getDb,
|
|
12
12
|
parseDestination
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-OKAHLUSU.js";
|
|
14
14
|
import {
|
|
15
15
|
sleep
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-HI5KXE3C.js";
|
|
17
17
|
import {
|
|
18
18
|
acquireActiveLock,
|
|
19
19
|
getStateAdapter
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-6BXUSF7J.js";
|
|
21
21
|
import {
|
|
22
22
|
pluginCatalogRuntime
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-4PKEJK5B.js";
|
|
24
24
|
import {
|
|
25
25
|
fetchWithBoundedOAuthErrorBodies
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-663DQH5W.js";
|
|
27
27
|
import {
|
|
28
28
|
isRecord
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-Y4WL4OYD.js";
|
|
30
30
|
|
|
31
31
|
// src/chat/capabilities/router.ts
|
|
32
32
|
var ProviderCredentialRouter = class {
|