@sentry/junior 0.190.0 → 0.192.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-3IG2FQW2.js → agent-hooks-3JY76L5X.js} +11 -11
- package/dist/api/activity.d.ts +3 -1
- package/dist/api/code/overview.d.ts +12 -0
- package/dist/api/locations/detail.d.ts +8 -0
- package/dist/api/locations/list.d.ts +5 -0
- package/dist/api/people/code.d.ts +6 -0
- package/dist/api/people/shared.d.ts +2 -0
- package/dist/api/reporting-window.d.ts +40 -0
- package/dist/api/schema/code.d.ts +14 -0
- package/dist/api/schema/conversation.d.ts +27 -0
- package/dist/api/schema/location.d.ts +15 -0
- package/dist/api/schema/person.d.ts +104 -0
- package/dist/api/schema/task.d.ts +15 -2
- package/dist/api/schema.d.ts +1 -1
- package/dist/api/schema.js +2 -2
- package/dist/api.js +536 -141
- package/dist/app.js +93 -130
- package/dist/{catalog-runtime-2OT7S3ZC.js → catalog-runtime-5JVLWXRY.js} +4 -4
- 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 +4 -4
- 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/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/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/state.d.ts +0 -3
- package/dist/chat/task-execution/store.d.ts +0 -1
- package/dist/chat/task-execution/turn-cursor.d.ts +0 -2
- package/dist/chat/task-execution/worker.d.ts +0 -1
- package/dist/chat/tasks/execution-stats.d.ts +12 -0
- package/dist/{chunk-Y4WL4OYD.js → chunk-3ADPXQBL.js} +1 -1
- package/dist/{chunk-F3K2267N.js → chunk-3O2NXVGB.js} +77 -35
- package/dist/{chunk-2MKHYSYL.js → chunk-3UJSII43.js} +3 -3
- package/dist/{chunk-RLYJYEIY.js → chunk-47JFLZSF.js} +5 -7
- package/dist/{chunk-T66GV7A3.js → chunk-4AFSQJD6.js} +2 -2
- package/dist/{chunk-DJZGQ7OL.js → chunk-4B4DQGOM.js} +22 -29
- package/dist/{chunk-OJFX2FP7.js → chunk-4CCQZHD3.js} +9 -11
- package/dist/{chunk-BUJU6C2J.js → chunk-4WIA45WD.js} +1 -1
- package/dist/{chunk-VWNIDTFR.js → chunk-4Z7B5WVV.js} +2 -2
- package/dist/{chunk-3J3BCB4J.js → chunk-5V4BAUCH.js} +1 -1
- package/dist/{chunk-663DQH5W.js → chunk-6FCKJDKS.js} +1 -1
- package/dist/{chunk-HI5KXE3C.js → chunk-6LX6KV5C.js} +3 -3
- package/dist/{chunk-67MMSYSE.js → chunk-7XO7PTZE.js} +1 -1
- package/dist/{chunk-OKAHLUSU.js → chunk-AKR6W7VV.js} +3 -3
- package/dist/{chunk-JV7U4665.js → chunk-ARSUYYQG.js} +1 -1
- package/dist/{chunk-IRQ3RSX3.js → chunk-BGLMT6KP.js} +3 -3
- package/dist/{chunk-2MRF22J4.js → chunk-BUTAWPUV.js} +50 -8
- package/dist/{chunk-62DRKZQU.js → chunk-EIYOABL4.js} +4 -4
- package/dist/{chunk-PFAZSRGR.js → chunk-EYIMZY5O.js} +114 -19
- package/dist/{chunk-DVX6U6GI.js → chunk-EYNUOZCN.js} +1 -1
- package/dist/{chunk-4PKEJK5B.js → chunk-FGYWKKTJ.js} +1 -1
- package/dist/{chunk-YFU4DGZY.js → chunk-G4E5WIRL.js} +30 -9
- package/dist/{chunk-OON4IQHH.js → chunk-H5Q2T5VC.js} +1 -1
- package/dist/{chunk-ZFCO2TMB.js → chunk-IBO4YFFZ.js} +1 -1
- package/dist/{chunk-ECOR3OXY.js → chunk-ITTEDZGY.js} +8 -8
- package/dist/{chunk-4BLFIYVK.js → chunk-KR5F3QSP.js} +9 -12
- package/dist/{chunk-6BXUSF7J.js → chunk-LRTEMMCZ.js} +1 -1
- package/dist/{chunk-MNHJ4WLE.js → chunk-MB2CTEPD.js} +74 -4
- package/dist/{chunk-YKIAUKYH.js → chunk-OBN7UEQJ.js} +2 -2
- package/dist/{chunk-OYCOLHCR.js → chunk-PXP2M32M.js} +5 -5
- package/dist/{chunk-6H7YU6XH.js → chunk-PXUBRZBU.js} +1 -1
- package/dist/{chunk-REVH4BZU.js → chunk-PYVGXGKC.js} +2 -2
- package/dist/{chunk-UTL3MHPC.js → chunk-RC745GGZ.js} +8 -1
- package/dist/{chunk-CZXZKTAI.js → chunk-RWBZZMW6.js} +3 -3
- package/dist/{chunk-GWCFXTB6.js → chunk-SSR6YBWW.js} +6 -6
- package/dist/{chunk-7UJ6IJCK.js → chunk-SZ2O3CGS.js} +1 -1
- package/dist/{chunk-BGOLRC36.js → chunk-VF3EDS7P.js} +13 -11
- package/dist/{chunk-FVFJ57RK.js → chunk-YE6DVM43.js} +9 -8
- package/dist/{chunk-7Y7XMI6P.js → chunk-YRWGJ5OO.js} +5 -5
- package/dist/{chunk-W2C4TPLB.js → chunk-Z4DNJI5F.js} +5 -5
- 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/stats.d.ts +5 -1
- package/dist/{db-2IFDMDDY.js → db-LRM6AP66.js} +6 -6
- package/dist/instrumentation.js +3 -3
- package/dist/nitro.js +6 -6
- package/dist/{oauth-callback-server-SZSS2KH6.js → oauth-callback-server-BKCDVYVH.js} +29 -29
- package/dist/reporting-schema.d.ts +2 -2
- package/dist/{runner-2N4QU77X.js → runner-RUXGS3E6.js} +21 -21
- package/dist/{skills-VU2LZAKX.js → skills-DXP2RCJF.js} +5 -5
- package/dist/spawn-HH7GH7XT.js +42 -0
- package/dist/task-runner-H5I7R3LJ.js +36 -0
- package/dist/{validation-IJGHK7NI.js → validation-F4KYLIF2.js} +5 -5
- package/dist/version.js +1 -1
- package/dist/{work-DI45MLRL.js → work-UUNMNSML.js} +21 -21
- package/dist/{worker-FY7KWG2M.js → worker-PMIJ5NLD.js} +10 -10
- package/package.json +6 -6
- package/dist/spawn-3K7RV4T5.js +0 -42
- package/dist/task-runner-52DYFHW3.js +0 -36
package/dist/app.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
processConversationWork
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-47JFLZSF.js";
|
|
4
4
|
import {
|
|
5
5
|
bindSpawnAgent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4AFSQJD6.js";
|
|
7
7
|
import {
|
|
8
8
|
createAgentInvocationWorker,
|
|
9
9
|
enqueueAgentInvocation,
|
|
10
10
|
listPendingAgentInvocationMailboxAppends,
|
|
11
11
|
resolveAgentInvocationId
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4CCQZHD3.js";
|
|
13
13
|
import {
|
|
14
14
|
GET as GET2,
|
|
15
15
|
GET2 as GET3,
|
|
@@ -37,12 +37,12 @@ import {
|
|
|
37
37
|
startProcessingReaction,
|
|
38
38
|
stripLeadingBotMention,
|
|
39
39
|
wakePausedTurn
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-3O2NXVGB.js";
|
|
41
41
|
import "./chunk-FA6POGLH.js";
|
|
42
42
|
import {
|
|
43
43
|
AgentRunError,
|
|
44
44
|
executeTurn
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-BGLMT6KP.js";
|
|
46
46
|
import {
|
|
47
47
|
buildDeliveredTurnStatePatch,
|
|
48
48
|
completeAuthPauseTurn,
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
getTurnUserSlackMessageTs,
|
|
54
54
|
persistAuthPauseTurnState,
|
|
55
55
|
requireTurnFailureEventId
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-YRWGJ5OO.js";
|
|
57
57
|
import {
|
|
58
58
|
claimDispatchMailboxAppend,
|
|
59
59
|
confirmDispatchMailboxAppend,
|
|
@@ -73,11 +73,11 @@ import {
|
|
|
73
73
|
processPluginTask,
|
|
74
74
|
resolveTurnSessionRouting,
|
|
75
75
|
scheduleSessionCompletedPluginTasks
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-ITTEDZGY.js";
|
|
77
77
|
import {
|
|
78
78
|
ConversationTurnLifecycleService,
|
|
79
79
|
getTurnLifecycle
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-PXUBRZBU.js";
|
|
81
81
|
import {
|
|
82
82
|
coerceThreadConversationState,
|
|
83
83
|
getLocationConfigurationService,
|
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
persistThreadRuntimeState,
|
|
87
87
|
persistThreadState,
|
|
88
88
|
persistThreadStateById
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-Z4DNJI5F.js";
|
|
90
90
|
import {
|
|
91
91
|
GET,
|
|
92
92
|
appendAndEnqueueWebMessage,
|
|
@@ -101,24 +101,24 @@ import {
|
|
|
101
101
|
resolveSlackChannelTypeFromMessage,
|
|
102
102
|
resolveSlackConversationContext,
|
|
103
103
|
webActorFromEmail
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-KR5F3QSP.js";
|
|
105
105
|
import {
|
|
106
106
|
createWebAuthorization,
|
|
107
107
|
deleteWebAuthorization
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-H5Q2T5VC.js";
|
|
109
109
|
import {
|
|
110
110
|
recordTaskExecution
|
|
111
|
-
} from "./chunk-
|
|
112
|
-
import "./chunk-
|
|
111
|
+
} from "./chunk-MB2CTEPD.js";
|
|
112
|
+
import "./chunk-RC745GGZ.js";
|
|
113
113
|
import {
|
|
114
114
|
createVercelPluginTaskCallback,
|
|
115
115
|
queueCallback,
|
|
116
116
|
registerVercelPluginTaskDevConsumer
|
|
117
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-RWBZZMW6.js";
|
|
118
118
|
import {
|
|
119
119
|
validatePluginEgressCredentialHooks,
|
|
120
120
|
validatePluginRegistrations
|
|
121
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-5V4BAUCH.js";
|
|
122
122
|
import {
|
|
123
123
|
defineJuniorPlugins,
|
|
124
124
|
pluginCatalogConfigFromEnv,
|
|
@@ -158,11 +158,11 @@ import {
|
|
|
158
158
|
shouldEmitDevAgentTrace,
|
|
159
159
|
shouldPropagateSandboxEgressTrace,
|
|
160
160
|
unpublishedArtifactHeaders
|
|
161
|
-
} from "./chunk-
|
|
161
|
+
} from "./chunk-4B4DQGOM.js";
|
|
162
162
|
import {
|
|
163
163
|
AuthorizationFlowDisabledError,
|
|
164
164
|
PluginCredentialFailureError
|
|
165
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-PXP2M32M.js";
|
|
166
166
|
import "./chunk-6Y5B5PEX.js";
|
|
167
167
|
import "./chunk-DIB4GX3G.js";
|
|
168
168
|
import {
|
|
@@ -170,14 +170,14 @@ import {
|
|
|
170
170
|
deleteMcpAuthSessionsForUserProvider,
|
|
171
171
|
deleteMcpServerSessionId,
|
|
172
172
|
deleteMcpStoredOAuthCredentials
|
|
173
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-YE6DVM43.js";
|
|
174
174
|
import {
|
|
175
175
|
RetryableDeliveryError,
|
|
176
176
|
createAgentRunner,
|
|
177
177
|
formatProviderLabel,
|
|
178
178
|
postSlackMessage,
|
|
179
179
|
startOAuthFlow
|
|
180
|
-
} from "./chunk-
|
|
180
|
+
} from "./chunk-SSR6YBWW.js";
|
|
181
181
|
import {
|
|
182
182
|
ConversationTurnBoundaryError,
|
|
183
183
|
CooperativeTurnYieldError,
|
|
@@ -193,7 +193,7 @@ import {
|
|
|
193
193
|
markTurnCompleted,
|
|
194
194
|
markTurnFailed,
|
|
195
195
|
startActiveTurn
|
|
196
|
-
} from "./chunk-
|
|
196
|
+
} from "./chunk-7XO7PTZE.js";
|
|
197
197
|
import {
|
|
198
198
|
abandonTurnRecord,
|
|
199
199
|
appendThreadContextMessages,
|
|
@@ -229,7 +229,7 @@ import {
|
|
|
229
229
|
trimTrailingAssistantMessages,
|
|
230
230
|
turnHasReply,
|
|
231
231
|
upsertConversationMessage
|
|
232
|
-
} from "./chunk-
|
|
232
|
+
} from "./chunk-VF3EDS7P.js";
|
|
233
233
|
import {
|
|
234
234
|
getExperimentalFeatures,
|
|
235
235
|
isExperimentalFeatureEnabled,
|
|
@@ -249,10 +249,10 @@ import {
|
|
|
249
249
|
scheduledRunId,
|
|
250
250
|
scheduledRunSchema,
|
|
251
251
|
withScheduledTaskLock
|
|
252
|
-
} from "./chunk-
|
|
252
|
+
} from "./chunk-EIYOABL4.js";
|
|
253
253
|
import {
|
|
254
254
|
parseSlackThreadId
|
|
255
|
-
} from "./chunk-
|
|
255
|
+
} from "./chunk-4WIA45WD.js";
|
|
256
256
|
import {
|
|
257
257
|
CONVERSATION_WORK_STALE_ENQUEUE_MS,
|
|
258
258
|
appendAndEnqueueInboundMessage,
|
|
@@ -267,16 +267,16 @@ import {
|
|
|
267
267
|
removeActiveConversation,
|
|
268
268
|
requestConversationWork,
|
|
269
269
|
stopConversationWork
|
|
270
|
-
} from "./chunk-
|
|
270
|
+
} from "./chunk-G4E5WIRL.js";
|
|
271
271
|
import {
|
|
272
272
|
buildDeterministicAssistantMessageId,
|
|
273
273
|
buildDeterministicTurnId
|
|
274
274
|
} from "./chunk-DA2KGZZI.js";
|
|
275
|
-
import "./chunk-
|
|
275
|
+
import "./chunk-OBN7UEQJ.js";
|
|
276
276
|
import {
|
|
277
277
|
getSandboxResourceConfig,
|
|
278
278
|
setSandboxResourceConfig
|
|
279
|
-
} from "./chunk-
|
|
279
|
+
} from "./chunk-3UJSII43.js";
|
|
280
280
|
import "./chunk-PDO5BLNM.js";
|
|
281
281
|
import "./chunk-UIE3R5XU.js";
|
|
282
282
|
import {
|
|
@@ -285,7 +285,7 @@ import {
|
|
|
285
285
|
} from "./chunk-X6GDDWQH.js";
|
|
286
286
|
import {
|
|
287
287
|
getTurnRequestDeadline
|
|
288
|
-
} from "./chunk-
|
|
288
|
+
} from "./chunk-SZ2O3CGS.js";
|
|
289
289
|
import {
|
|
290
290
|
getVercelConversationWorkQueue,
|
|
291
291
|
resolveConversationWorkQueueTopic,
|
|
@@ -321,7 +321,7 @@ import {
|
|
|
321
321
|
verifyEventTaskCredentialSubject,
|
|
322
322
|
verifyScheduledTaskCredentialSubject,
|
|
323
323
|
verifySlackDirectCredentialSubject
|
|
324
|
-
} from "./chunk-
|
|
324
|
+
} from "./chunk-BUTAWPUV.js";
|
|
325
325
|
import "./chunk-3Y47VMHV.js";
|
|
326
326
|
import {
|
|
327
327
|
createSlackDestination,
|
|
@@ -333,7 +333,7 @@ import {
|
|
|
333
333
|
requireSlackDestination,
|
|
334
334
|
withConversationEventLock,
|
|
335
335
|
withConversationMutationLock
|
|
336
|
-
} from "./chunk-
|
|
336
|
+
} from "./chunk-AKR6W7VV.js";
|
|
337
337
|
import {
|
|
338
338
|
juniorAgentBindings,
|
|
339
339
|
juniorAgentInvocations,
|
|
@@ -341,13 +341,13 @@ import {
|
|
|
341
341
|
juniorConversations,
|
|
342
342
|
juniorSchedulerRuns,
|
|
343
343
|
juniorSchedulerTasks
|
|
344
|
-
} from "./chunk-
|
|
345
|
-
import "./chunk-
|
|
344
|
+
} from "./chunk-IBO4YFFZ.js";
|
|
345
|
+
import "./chunk-6LX6KV5C.js";
|
|
346
346
|
import {
|
|
347
347
|
acquireActiveLock,
|
|
348
348
|
getStateAdapter,
|
|
349
349
|
withActiveLock
|
|
350
|
-
} from "./chunk-
|
|
350
|
+
} from "./chunk-LRTEMMCZ.js";
|
|
351
351
|
import {
|
|
352
352
|
instructionProvenanceFor
|
|
353
353
|
} from "./chunk-GFBR4S3Q.js";
|
|
@@ -369,17 +369,17 @@ import {
|
|
|
369
369
|
isProviderRetryError,
|
|
370
370
|
setProfiles,
|
|
371
371
|
setSlackReactionConfig
|
|
372
|
-
} from "./chunk-
|
|
372
|
+
} from "./chunk-4Z7B5WVV.js";
|
|
373
373
|
import {
|
|
374
374
|
defaultModelId,
|
|
375
375
|
modelIdForProfile
|
|
376
376
|
} from "./chunk-D4YV5TDV.js";
|
|
377
|
-
import "./chunk-
|
|
378
|
-
import "./chunk-
|
|
377
|
+
import "./chunk-EYNUOZCN.js";
|
|
378
|
+
import "./chunk-PYVGXGKC.js";
|
|
379
379
|
import {
|
|
380
380
|
pluginCatalogRuntime
|
|
381
|
-
} from "./chunk-
|
|
382
|
-
import "./chunk-
|
|
381
|
+
} from "./chunk-FGYWKKTJ.js";
|
|
382
|
+
import "./chunk-6FCKJDKS.js";
|
|
383
383
|
import {
|
|
384
384
|
credentialContextForActor
|
|
385
385
|
} from "./chunk-CEMMLV5L.js";
|
|
@@ -415,13 +415,13 @@ import {
|
|
|
415
415
|
withContext,
|
|
416
416
|
withLogContext,
|
|
417
417
|
withSpan
|
|
418
|
-
} from "./chunk-
|
|
418
|
+
} from "./chunk-3ADPXQBL.js";
|
|
419
419
|
import {
|
|
420
420
|
continueTrace
|
|
421
421
|
} from "./chunk-PEQXYSSE.js";
|
|
422
422
|
import {
|
|
423
423
|
JUNIOR_VERSION
|
|
424
|
-
} from "./chunk-
|
|
424
|
+
} from "./chunk-ARSUYYQG.js";
|
|
425
425
|
|
|
426
426
|
// src/app.ts
|
|
427
427
|
import { createRequire } from "module";
|
|
@@ -597,7 +597,6 @@ function buildAgentDispatchInboundMessage(dispatch2, nowMs = Date.now()) {
|
|
|
597
597
|
}
|
|
598
598
|
},
|
|
599
599
|
receivedAtMs: nowMs,
|
|
600
|
-
publishExternally: true,
|
|
601
600
|
source: "plugin"
|
|
602
601
|
};
|
|
603
602
|
}
|
|
@@ -3277,7 +3276,6 @@ function createSlackConversationWorker(options) {
|
|
|
3277
3276
|
if (!latestRecord) {
|
|
3278
3277
|
return { status: "completed" };
|
|
3279
3278
|
}
|
|
3280
|
-
const publishExternally = latestRecord.publishExternally ?? context.publishExternally;
|
|
3281
3279
|
const latestMetadata = parseSlackMetadata(latestRecord.input.metadata);
|
|
3282
3280
|
if (!latestMetadata) {
|
|
3283
3281
|
throw new Error(
|
|
@@ -3341,9 +3339,7 @@ function createSlackConversationWorker(options) {
|
|
|
3341
3339
|
};
|
|
3342
3340
|
const drainSteeringMessages = async (accept) => {
|
|
3343
3341
|
await context.attempt.drain(async (pendingRecords) => {
|
|
3344
|
-
const candidates = pendingRecords.
|
|
3345
|
-
(record) => record.publishExternally === publishExternally
|
|
3346
|
-
).map((record) => ({
|
|
3342
|
+
const candidates = pendingRecords.map((record) => ({
|
|
3347
3343
|
inboundMessageId: record.inboundMessageId,
|
|
3348
3344
|
message: restoreMessage({
|
|
3349
3345
|
adapter,
|
|
@@ -3360,7 +3356,6 @@ function createSlackConversationWorker(options) {
|
|
|
3360
3356
|
await options.runtime.handleNewMention(thread, latestMessage, {
|
|
3361
3357
|
conversationId: context.conversationId,
|
|
3362
3358
|
destination,
|
|
3363
|
-
publishExternally,
|
|
3364
3359
|
messageContext,
|
|
3365
3360
|
drainSteeringMessages,
|
|
3366
3361
|
ack,
|
|
@@ -3374,7 +3369,6 @@ function createSlackConversationWorker(options) {
|
|
|
3374
3369
|
{
|
|
3375
3370
|
conversationId: context.conversationId,
|
|
3376
3371
|
destination,
|
|
3377
|
-
publishExternally,
|
|
3378
3372
|
messageContext,
|
|
3379
3373
|
drainSteeringMessages,
|
|
3380
3374
|
ack,
|
|
@@ -3426,7 +3420,6 @@ function buildSlackInboundMessage(args) {
|
|
|
3426
3420
|
source: "slack",
|
|
3427
3421
|
createdAtMs: args.message.metadata.dateSent.getTime(),
|
|
3428
3422
|
receivedAtMs: args.receivedAtMs,
|
|
3429
|
-
publishExternally: true,
|
|
3430
3423
|
input: {
|
|
3431
3424
|
text: args.message.text || " ",
|
|
3432
3425
|
authorId,
|
|
@@ -3694,7 +3687,8 @@ async function handleUnlink(event, actorId, provider) {
|
|
|
3694
3687
|
await postEphemeral(event, `Unknown provider: \`${provider}\``);
|
|
3695
3688
|
return;
|
|
3696
3689
|
}
|
|
3697
|
-
|
|
3690
|
+
const supportsUnlink = Boolean(pluginCatalogRuntime.getOAuthConfig(provider)) || Boolean(pluginCatalogRuntime.getDefinition(provider)?.manifest.mcp);
|
|
3691
|
+
if (!supportsUnlink) {
|
|
3698
3692
|
await postEphemeral(
|
|
3699
3693
|
event,
|
|
3700
3694
|
`${formatProviderLabel(provider)} doesn't support account unlinking.`
|
|
@@ -4978,9 +4972,6 @@ function buildLogContext(deps, args) {
|
|
|
4978
4972
|
function actorUserName(message) {
|
|
4979
4973
|
return getMessageActorIdentity(message)?.userName;
|
|
4980
4974
|
}
|
|
4981
|
-
function shouldPublishExternally(publishExternally) {
|
|
4982
|
-
return publishExternally !== false;
|
|
4983
|
-
}
|
|
4984
4975
|
function createSlackTurnRuntime(deps) {
|
|
4985
4976
|
const turnLifecycle = getTurnLifecycle();
|
|
4986
4977
|
const logContext = (args) => buildLogContext(deps, args);
|
|
@@ -5295,7 +5286,6 @@ function createSlackTurnRuntime(deps) {
|
|
|
5295
5286
|
conversationId: hooks.conversationId,
|
|
5296
5287
|
destination: hooks.destination,
|
|
5297
5288
|
queuedMessages,
|
|
5298
|
-
publishExternally: shouldPublishExternally(hooks.publishExternally),
|
|
5299
5289
|
ack,
|
|
5300
5290
|
onToolInvocation: toolInvocationHook,
|
|
5301
5291
|
onTurnCompleted,
|
|
@@ -5353,13 +5343,11 @@ function createSlackTurnRuntime(deps) {
|
|
|
5353
5343
|
lifecycleError = error2;
|
|
5354
5344
|
}
|
|
5355
5345
|
await hooks.beforeFirstResponsePost?.();
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
});
|
|
5362
|
-
}
|
|
5346
|
+
await postFallbackErrorReplyWithLogging({
|
|
5347
|
+
thread,
|
|
5348
|
+
eventId,
|
|
5349
|
+
postFailureEventName: "mention.handler.failure_reply_post.failed"
|
|
5350
|
+
});
|
|
5363
5351
|
if (lifecycleError) throw lifecycleError;
|
|
5364
5352
|
} finally {
|
|
5365
5353
|
if (completed) {
|
|
@@ -5584,7 +5572,6 @@ function createSlackTurnRuntime(deps) {
|
|
|
5584
5572
|
conversationId: hooks.conversationId,
|
|
5585
5573
|
destination: hooks.destination,
|
|
5586
5574
|
preparedState,
|
|
5587
|
-
publishExternally: shouldPublishExternally(hooks.publishExternally),
|
|
5588
5575
|
beforeFirstResponsePost: hooks.beforeFirstResponsePost,
|
|
5589
5576
|
queuedMessages,
|
|
5590
5577
|
ack,
|
|
@@ -5644,13 +5631,11 @@ function createSlackTurnRuntime(deps) {
|
|
|
5644
5631
|
lifecycleError = error2;
|
|
5645
5632
|
}
|
|
5646
5633
|
await hooks.beforeFirstResponsePost?.();
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
});
|
|
5653
|
-
}
|
|
5634
|
+
await postFallbackErrorReplyWithLogging({
|
|
5635
|
+
thread,
|
|
5636
|
+
eventId,
|
|
5637
|
+
postFailureEventName: "subscribed_message.handler.failure_reply_post.failed"
|
|
5638
|
+
});
|
|
5654
5639
|
if (lifecycleError) throw lifecycleError;
|
|
5655
5640
|
} finally {
|
|
5656
5641
|
if (completed) {
|
|
@@ -6478,9 +6463,6 @@ async function loadPiMessagesForTurn(args) {
|
|
|
6478
6463
|
}
|
|
6479
6464
|
return {};
|
|
6480
6465
|
}
|
|
6481
|
-
function shouldPublishExternally2(publishExternally) {
|
|
6482
|
-
return publishExternally !== false;
|
|
6483
|
-
}
|
|
6484
6466
|
function createSlackTurn(deps) {
|
|
6485
6467
|
const turnLifecycle = getTurnLifecycle();
|
|
6486
6468
|
return async function executeSlackTurn(thread, message, options) {
|
|
@@ -6624,9 +6606,6 @@ function createSlackTurn(deps) {
|
|
|
6624
6606
|
);
|
|
6625
6607
|
try {
|
|
6626
6608
|
await beforeFirstResponsePost();
|
|
6627
|
-
if (!shouldPublishExternally2(options.publishExternally)) {
|
|
6628
|
-
return;
|
|
6629
|
-
}
|
|
6630
6609
|
if (channelId && threadTs) {
|
|
6631
6610
|
await sendSlackReply({
|
|
6632
6611
|
channelId,
|
|
@@ -6781,9 +6760,7 @@ function createSlackTurn(deps) {
|
|
|
6781
6760
|
});
|
|
6782
6761
|
if (configReply) {
|
|
6783
6762
|
await beforeFirstResponsePost();
|
|
6784
|
-
|
|
6785
|
-
await thread.post(buildSlackOutputMessage(configReply.text));
|
|
6786
|
-
}
|
|
6763
|
+
await thread.post(buildSlackOutputMessage(configReply.text));
|
|
6787
6764
|
markConversationMessage(
|
|
6788
6765
|
preparedState.conversation,
|
|
6789
6766
|
preparedState.userMessageId,
|
|
@@ -6949,21 +6926,19 @@ function createSlackTurn(deps) {
|
|
|
6949
6926
|
let slackMessageTs2 = [];
|
|
6950
6927
|
await beforeFirstResponsePost();
|
|
6951
6928
|
try {
|
|
6952
|
-
if (
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
|
|
6956
|
-
|
|
6957
|
-
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
slackMessageTs2.push(postedMessageTs);
|
|
6966
|
-
}
|
|
6929
|
+
if (channelId && thread.adapter.name === "slack") {
|
|
6930
|
+
slackMessageTs2 = await sendSlackReply({
|
|
6931
|
+
channelId,
|
|
6932
|
+
conversationId,
|
|
6933
|
+
replyAttribution: options.execution?.dispatch?.replyAttribution,
|
|
6934
|
+
text,
|
|
6935
|
+
...threadTs ? { threadTs } : void 0
|
|
6936
|
+
});
|
|
6937
|
+
} else {
|
|
6938
|
+
for (const part of splitSlackReplyText(text)) {
|
|
6939
|
+
const postedMessageTs = (await thread.post(buildSlackOutputMessage(part))).id;
|
|
6940
|
+
if (postedMessageTs) {
|
|
6941
|
+
slackMessageTs2.push(postedMessageTs);
|
|
6967
6942
|
}
|
|
6968
6943
|
}
|
|
6969
6944
|
}
|
|
@@ -7172,9 +7147,6 @@ function createSlackTurn(deps) {
|
|
|
7172
7147
|
source,
|
|
7173
7148
|
...location ? { location } : void 0,
|
|
7174
7149
|
destination,
|
|
7175
|
-
publishExternally: shouldPublishExternally2(
|
|
7176
|
-
options.publishExternally
|
|
7177
|
-
),
|
|
7178
7150
|
surface: options.execution?.surface ?? "slack",
|
|
7179
7151
|
dispatch: options.execution?.dispatch,
|
|
7180
7152
|
toolChannelId,
|
|
@@ -7865,7 +7837,6 @@ function createSlackDispatchTurnRunner(options) {
|
|
|
7865
7837
|
ack: hooks.ack,
|
|
7866
7838
|
conversationId,
|
|
7867
7839
|
destination: dispatch2.destination,
|
|
7868
|
-
publishExternally: true,
|
|
7869
7840
|
execution: {
|
|
7870
7841
|
disabledFeatures: ["interactive-auth"],
|
|
7871
7842
|
locationConfiguration: options.getLocationConfiguration(
|
|
@@ -8371,11 +8342,6 @@ async function runPausedTurnInContext(payload, options, runOptions) {
|
|
|
8371
8342
|
destination: routingDestination,
|
|
8372
8343
|
...dispatch2 ? { dispatch: dispatch2 } : void 0,
|
|
8373
8344
|
...routing.location ? { location: routing.location } : void 0,
|
|
8374
|
-
// Slack resume publishes unless the checkpoint opted out.
|
|
8375
|
-
// Missing means legacy/in-flight Slack turns still post.
|
|
8376
|
-
// TODO(dcramer): Remove this missing-as-publish fallback after no
|
|
8377
|
-
// stored Turn checkpoint can omit publishExternally.
|
|
8378
|
-
publishExternally: activeTurn.publishExternally !== false,
|
|
8379
8345
|
source,
|
|
8380
8346
|
...surface ? { surface } : void 0,
|
|
8381
8347
|
toolChannelId: destination.channelId,
|
|
@@ -8603,9 +8569,9 @@ async function commitAssistantMessage(args) {
|
|
|
8603
8569
|
text: args.text,
|
|
8604
8570
|
userMessageId: args.userMessageId
|
|
8605
8571
|
});
|
|
8606
|
-
if (args.
|
|
8572
|
+
if (args.deliveryResult?.providerMessageId) {
|
|
8607
8573
|
markConversationMessage(args.conversation, conversationMessageId, {
|
|
8608
|
-
slackTs: args.
|
|
8574
|
+
slackTs: args.deliveryResult.providerMessageId
|
|
8609
8575
|
});
|
|
8610
8576
|
}
|
|
8611
8577
|
try {
|
|
@@ -8615,7 +8581,7 @@ async function commitAssistantMessage(args) {
|
|
|
8615
8581
|
conversation: args.conversation,
|
|
8616
8582
|
conversationMessageId,
|
|
8617
8583
|
conversationId: args.conversationId,
|
|
8618
|
-
providerConversationBindings: args.
|
|
8584
|
+
providerConversationBindings: args.deliveryResult?.providerConversationBindings
|
|
8619
8585
|
})
|
|
8620
8586
|
);
|
|
8621
8587
|
} catch (error) {
|
|
@@ -8860,7 +8826,7 @@ async function completeCancelledConversationTurn(args) {
|
|
|
8860
8826
|
});
|
|
8861
8827
|
await args.acknowledge();
|
|
8862
8828
|
}
|
|
8863
|
-
function createConversationTurnWorker(agentRunner,
|
|
8829
|
+
function createConversationTurnWorker(agentRunner, deliverMessage) {
|
|
8864
8830
|
return async (context, resolved) => {
|
|
8865
8831
|
const lifecycle = new ConversationTurnLifecycleService(
|
|
8866
8832
|
getConversationEventStore()
|
|
@@ -8900,7 +8866,7 @@ function createConversationTurnWorker(agentRunner, publishMessage) {
|
|
|
8900
8866
|
conversationId: context.conversationId
|
|
8901
8867
|
});
|
|
8902
8868
|
const savedTurn = isResume ? await getTurnRecord(context.conversationId, turnId) : void 0;
|
|
8903
|
-
let
|
|
8869
|
+
let savedMessageIsResourceEvent = false;
|
|
8904
8870
|
if (isResume) {
|
|
8905
8871
|
const userMessage = getTurnUserMessage(conversation, turnId);
|
|
8906
8872
|
if (!userMessage) {
|
|
@@ -8908,7 +8874,7 @@ function createConversationTurnWorker(agentRunner, publishMessage) {
|
|
|
8908
8874
|
`Unable to locate the persisted user message for Turn "${turnId}"`
|
|
8909
8875
|
);
|
|
8910
8876
|
}
|
|
8911
|
-
|
|
8877
|
+
savedMessageIsResourceEvent = isResourceEventConversationMessage(userMessage);
|
|
8912
8878
|
turnInputFacts = turnInputFactsFromConversationMessage(userMessage, {
|
|
8913
8879
|
conversationId: context.conversationId,
|
|
8914
8880
|
location: storedConversation?.location,
|
|
@@ -8933,10 +8899,9 @@ function createConversationTurnWorker(agentRunner, publishMessage) {
|
|
|
8933
8899
|
visibility: storedConversation?.visibility
|
|
8934
8900
|
});
|
|
8935
8901
|
const webActor = actor.platform === "web" ? actor : void 0;
|
|
8936
|
-
const
|
|
8937
|
-
|
|
8938
|
-
|
|
8939
|
-
const surface = publish ? "slack" : "api";
|
|
8902
|
+
const conversationLocation = storedConversation?.location;
|
|
8903
|
+
const deliverToProvider = Boolean(conversationLocation) && (source.kind === "resource_event" || savedMessageIsResourceEvent);
|
|
8904
|
+
const surface = deliverToProvider ? "slack" : "api";
|
|
8940
8905
|
return await withLogContext(
|
|
8941
8906
|
{
|
|
8942
8907
|
conversationId: context.conversationId,
|
|
@@ -9031,24 +8996,26 @@ function createConversationTurnWorker(agentRunner, publishMessage) {
|
|
|
9031
8996
|
return;
|
|
9032
8997
|
}
|
|
9033
8998
|
failureCode = "delivery_failed";
|
|
9034
|
-
|
|
9035
|
-
if (
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
8999
|
+
let deliveryResult;
|
|
9000
|
+
if (deliverToProvider) {
|
|
9001
|
+
if (!conversationLocation || !deliverMessage) {
|
|
9002
|
+
throw new Error(
|
|
9003
|
+
`Conversation ${context.conversationId} cannot deliver to its Location`
|
|
9004
|
+
);
|
|
9005
|
+
}
|
|
9006
|
+
deliveryResult = await deliverMessage({
|
|
9007
|
+
conversationId: context.conversationId,
|
|
9008
|
+
location: conversationLocation,
|
|
9009
|
+
text: replyText
|
|
9010
|
+
});
|
|
9039
9011
|
}
|
|
9040
|
-
const publishedMessage = publish && location && publishMessage ? await publishMessage({
|
|
9041
|
-
conversationId: context.conversationId,
|
|
9042
|
-
location,
|
|
9043
|
-
text: replyText
|
|
9044
|
-
}) : void 0;
|
|
9045
9012
|
await commitAssistantMessage({
|
|
9046
9013
|
...agentMessage ? { agentMessage } : void 0,
|
|
9047
9014
|
conversation,
|
|
9048
9015
|
conversationId: context.conversationId,
|
|
9049
|
-
...
|
|
9016
|
+
...deliveryResult ? { deliveryResult } : void 0,
|
|
9050
9017
|
sessionId: turnId,
|
|
9051
|
-
...
|
|
9018
|
+
...deliveryResult ? { source: "slack" } : source.kind === "web" ? { source: "web" } : void 0,
|
|
9052
9019
|
text: replyText,
|
|
9053
9020
|
userMessageId
|
|
9054
9021
|
});
|
|
@@ -9116,11 +9083,8 @@ function createConversationTurnWorker(agentRunner, publishMessage) {
|
|
|
9116
9083
|
// TODO(dcramer): Remove AgentRun.destination after agent and tool
|
|
9117
9084
|
// code reads AgentRun.location and no Run consumer needs it.
|
|
9118
9085
|
destination,
|
|
9119
|
-
// TODO(dcramer): Remove AgentRun.publishExternally after the
|
|
9120
|
-
// saved Turn publish choice controls optional Delivery.
|
|
9121
|
-
publishExternally: publish,
|
|
9122
9086
|
source,
|
|
9123
|
-
...
|
|
9087
|
+
...conversationLocation ? { location: conversationLocation } : void 0,
|
|
9124
9088
|
surface,
|
|
9125
9089
|
...stopSignal ? { signal: stopSignal } : void 0,
|
|
9126
9090
|
...webActor ? {
|
|
@@ -9194,7 +9158,6 @@ function createConversationTurnWorker(agentRunner, publishMessage) {
|
|
|
9194
9158
|
// TODO(dcramer): Remove checkpoint Destination after resume
|
|
9195
9159
|
// reads the Conversation Location.
|
|
9196
9160
|
destination,
|
|
9197
|
-
publishExternally: publish,
|
|
9198
9161
|
source,
|
|
9199
9162
|
actor,
|
|
9200
9163
|
surface
|
|
@@ -9323,11 +9286,11 @@ function createConversationTurnWorker(agentRunner, publishMessage) {
|
|
|
9323
9286
|
}
|
|
9324
9287
|
|
|
9325
9288
|
// src/chat/providers/slack/system-turn.ts
|
|
9326
|
-
function
|
|
9289
|
+
function createSlackSystemTurnDelivery(args) {
|
|
9327
9290
|
return async ({ conversationId, location, text }) => {
|
|
9328
9291
|
if (location.provider !== "slack") {
|
|
9329
9292
|
throw new Error(
|
|
9330
|
-
`Slack system Turn cannot
|
|
9293
|
+
`Slack system Turn cannot deliver to ${location.provider} Location`
|
|
9331
9294
|
);
|
|
9332
9295
|
}
|
|
9333
9296
|
let messageIds;
|
|
@@ -9424,7 +9387,7 @@ function createConversationWork(options) {
|
|
|
9424
9387
|
const invocationWorker = createAgentInvocationWorker(options.agentRunner);
|
|
9425
9388
|
const conversationTurnWorker = createConversationTurnWorker(
|
|
9426
9389
|
options.agentRunner,
|
|
9427
|
-
|
|
9390
|
+
createSlackSystemTurnDelivery({
|
|
9428
9391
|
getSlackAdapter: options.getSlackAdapter,
|
|
9429
9392
|
state: options.state
|
|
9430
9393
|
})
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pluginCatalogRuntime
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-FGYWKKTJ.js";
|
|
4
|
+
import "./chunk-6FCKJDKS.js";
|
|
5
5
|
import "./chunk-CEMMLV5L.js";
|
|
6
6
|
import "./chunk-N7TMSOZH.js";
|
|
7
7
|
import "./chunk-DWPN6SCH.js";
|
|
8
8
|
import "./chunk-TXKUKMVO.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-3ADPXQBL.js";
|
|
10
10
|
import "./chunk-PEQXYSSE.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-ARSUYYQG.js";
|
|
12
12
|
export {
|
|
13
13
|
pluginCatalogRuntime
|
|
14
14
|
};
|
|
@@ -126,7 +126,7 @@ export declare const agentInvocationSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
126
126
|
eventType: z.ZodString;
|
|
127
127
|
identifier: z.ZodString;
|
|
128
128
|
namespace: z.ZodString;
|
|
129
|
-
}, z.core.$strict>], "kind"
|
|
129
|
+
}, z.core.$strict>], "kind">, unknown>;
|
|
130
130
|
updatedAtMs: z.ZodNumber;
|
|
131
131
|
status: z.ZodEnum<{
|
|
132
132
|
pending: "pending";
|
|
@@ -253,7 +253,7 @@ export declare const agentInvocationSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
253
253
|
eventType: z.ZodString;
|
|
254
254
|
identifier: z.ZodString;
|
|
255
255
|
namespace: z.ZodString;
|
|
256
|
-
}, z.core.$strict>], "kind"
|
|
256
|
+
}, z.core.$strict>], "kind">, unknown>;
|
|
257
257
|
updatedAtMs: z.ZodNumber;
|
|
258
258
|
result: z.ZodString;
|
|
259
259
|
status: z.ZodLiteral<"completed">;
|
|
@@ -378,7 +378,7 @@ export declare const agentInvocationSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
378
378
|
eventType: z.ZodString;
|
|
379
379
|
identifier: z.ZodString;
|
|
380
380
|
namespace: z.ZodString;
|
|
381
|
-
}, z.core.$strict>], "kind"
|
|
381
|
+
}, z.core.$strict>], "kind">, unknown>;
|
|
382
382
|
updatedAtMs: z.ZodNumber;
|
|
383
383
|
errorMessage: z.ZodString;
|
|
384
384
|
status: z.ZodEnum<{
|
|
@@ -501,7 +501,7 @@ export declare const createAgentInvocationSchema: z.ZodObject<{
|
|
|
501
501
|
eventType: z.ZodString;
|
|
502
502
|
identifier: z.ZodString;
|
|
503
503
|
namespace: z.ZodString;
|
|
504
|
-
}, z.core.$strict>], "kind"
|
|
504
|
+
}, z.core.$strict>], "kind">, unknown>;
|
|
505
505
|
}, z.core.$strict>;
|
|
506
506
|
export type AgentBinding = z.output<typeof agentBindingSchema>;
|
|
507
507
|
export type AgentInvocation = z.output<typeof agentInvocationSchema>;
|