@sentry/junior 0.191.0 → 0.193.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-HIWWBBKO.js → agent-hooks-DWY3MZZ7.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 +50 -83
- package/dist/{catalog-runtime-4OKH4265.js → catalog-runtime-NAD44W5K.js} +4 -4
- package/dist/chat/agent/prompt.d.ts +1 -1
- package/dist/chat/agent-dispatch/types.d.ts +2 -1
- package/dist/chat/agent-dispatch/validation.d.ts +1 -1
- package/dist/chat/agent-invocations/types.d.ts +24 -28
- package/dist/chat/event-tasks/tool-support.d.ts +10 -1
- package/dist/chat/plugins/agent-hooks.d.ts +2 -2
- package/dist/chat/prompt.d.ts +4 -5
- package/dist/chat/services/turn-session-routing.d.ts +4 -3
- package/dist/chat/slack/tool-support/context.d.ts +3 -6
- package/dist/chat/source.d.ts +4 -6
- package/dist/chat/tasks/execution-stats.d.ts +12 -0
- package/dist/chat/tools/delete-event-task.d.ts +1 -1
- package/dist/chat/tools/types.d.ts +10 -9
- package/dist/chat/tools/update-event-task.d.ts +1 -1
- package/dist/{chunk-S7NSFCCW.js → chunk-2CYWEVOP.js} +4 -4
- package/dist/{chunk-6KISW5UY.js → chunk-3YZ2Q6AW.js} +2 -2
- package/dist/{chunk-X6PQKQTY.js → chunk-42N6CDWF.js} +4 -4
- package/dist/{chunk-Q32BSFN4.js → chunk-4UA5C7AM.js} +32 -25
- package/dist/{chunk-VGYZ3YZM.js → chunk-5E5SLAVD.js} +21 -21
- package/dist/{chunk-3PDR63SX.js → chunk-5LEVZYXF.js} +4 -4
- package/dist/{chunk-SEIZ2XLD.js → chunk-5S6AQFNG.js} +1 -1
- package/dist/{chunk-AWFSSFAX.js → chunk-AZVDODSP.js} +11 -11
- package/dist/{chunk-LOYTPSAK.js → chunk-BFP3ZKG6.js} +12 -8
- package/dist/{chunk-GQN4REF5.js → chunk-COCVPDWX.js} +11 -7
- package/dist/{chunk-CECRMPXJ.js → chunk-D4XQZOHB.js} +8 -8
- package/dist/{chunk-WNIVCR74.js → chunk-D5YQPCEG.js} +2 -2
- package/dist/{chunk-CCPOZMS4.js → chunk-DVU734PI.js} +3 -3
- package/dist/{chunk-EQZUBYRF.js → chunk-DXFUYLHX.js} +1 -1
- package/dist/{chunk-PFAZSRGR.js → chunk-EYIMZY5O.js} +114 -19
- package/dist/{chunk-NK3UEKAW.js → chunk-FQ5HFSFR.js} +81 -33
- package/dist/{chunk-K2NKG42A.js → chunk-GTXQHZ2O.js} +5 -5
- package/dist/{chunk-BVWC5DBM.js → chunk-GUKGU6R7.js} +1 -1
- package/dist/{chunk-ZJRGWZZ2.js → chunk-GUMBIDDL.js} +74 -4
- package/dist/{chunk-DP6H3U2X.js → chunk-HMBTX5RK.js} +1 -1
- package/dist/{chunk-CUUE5MGF.js → chunk-IBXXTO3J.js} +3 -3
- package/dist/{chunk-YNRLCUCB.js → chunk-IOUUS6H4.js} +1 -1
- package/dist/{chunk-MFZOIKET.js → chunk-IQCL5JGL.js} +1 -1
- package/dist/{chunk-WCSXTDOL.js → chunk-K47OVEO4.js} +1 -1
- package/dist/{chunk-7PYCRKQL.js → chunk-KWXZMHJS.js} +3 -3
- package/dist/{chunk-5IMKUVMS.js → chunk-LG7Q4OW4.js} +9 -9
- package/dist/{chunk-HNMRX2EN.js → chunk-LXRTHE43.js} +6 -7
- package/dist/{chunk-RZS4F5K4.js → chunk-N6Q2PNSI.js} +3 -3
- package/dist/{chunk-BVYUIVXE.js → chunk-OICYQPKP.js} +1 -1
- package/dist/{chunk-NY5SJGJZ.js → chunk-PYBFVK6K.js} +73 -64
- package/dist/{chunk-ZNFNGDT7.js → chunk-QDU5MW2R.js} +1 -1
- package/dist/{chunk-QRNJO7DZ.js → chunk-QWY4KI2V.js} +1 -1
- package/dist/{chunk-L4JLLS6C.js → chunk-QY2IU47O.js} +1 -1
- package/dist/{chunk-UTL3MHPC.js → chunk-RC745GGZ.js} +8 -1
- package/dist/{chunk-SGRL7NV6.js → chunk-S5HS6WRH.js} +5 -5
- package/dist/{chunk-WBNQYVCM.js → chunk-THFNL3TL.js} +3 -4
- package/dist/{chunk-ZRN3OS7M.js → chunk-THYNA2QN.js} +1 -1
- package/dist/{chunk-TH6LMEOW.js → chunk-WH5VV2RW.js} +1 -1
- package/dist/{chunk-2JAWOTUT.js → chunk-WJJDQLVL.js} +2 -2
- package/dist/{chunk-KTW62MG5.js → chunk-ZFPEPWOO.js} +6 -6
- 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 +16 -0
- package/dist/db/schema/stats.d.ts +5 -1
- package/dist/db/schema.d.ts +16 -0
- package/dist/{db-LG4ZEWA3.js → db-H5MDRQEY.js} +6 -6
- package/dist/instrumentation.js +3 -3
- package/dist/nitro.js +6 -6
- package/dist/{oauth-callback-server-KI7ZRTOG.js → oauth-callback-server-IOU3NUHT.js} +29 -29
- package/dist/reporting-schema.d.ts +2 -2
- package/dist/{runner-K2EOSAZQ.js → runner-FZ5ZHLFG.js} +21 -21
- package/dist/{skills-JTRDFKMA.js → skills-AR3WD6BX.js} +5 -5
- package/dist/spawn-ZU6JABR7.js +42 -0
- package/dist/task-runner-EEGGG2PM.js +36 -0
- package/dist/{validation-NBWURHAP.js → validation-VYE7TQY7.js} +5 -5
- package/dist/version.js +1 -1
- package/dist/{work-35TBEAUI.js → work-CTQFWYKE.js} +21 -21
- package/dist/{worker-F762M6XM.js → worker-6WQU3IT5.js} +10 -10
- package/package.json +5 -5
- package/dist/spawn-SRBETYCF.js +0 -42
- package/dist/task-runner-INQIQ4VF.js +0 -36
package/dist/app.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
processConversationWork
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-42N6CDWF.js";
|
|
4
4
|
import {
|
|
5
5
|
bindSpawnAgent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-THFNL3TL.js";
|
|
7
7
|
import {
|
|
8
8
|
createAgentInvocationWorker,
|
|
9
9
|
enqueueAgentInvocation,
|
|
10
10
|
listPendingAgentInvocationMailboxAppends,
|
|
11
11
|
resolveAgentInvocationId
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-AZVDODSP.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-5E5SLAVD.js";
|
|
41
41
|
import "./chunk-FA6POGLH.js";
|
|
42
42
|
import {
|
|
43
43
|
AgentRunError,
|
|
44
44
|
executeTurn
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-DVU734PI.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-GTXQHZ2O.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-4UA5C7AM.js";
|
|
77
77
|
import {
|
|
78
78
|
ConversationTurnLifecycleService,
|
|
79
79
|
getTurnLifecycle
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-WH5VV2RW.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-S5HS6WRH.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-LG7Q4OW4.js";
|
|
105
105
|
import {
|
|
106
106
|
createWebAuthorization,
|
|
107
107
|
deleteWebAuthorization
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-THYNA2QN.js";
|
|
109
109
|
import {
|
|
110
110
|
recordTaskExecution
|
|
111
|
-
} from "./chunk-
|
|
112
|
-
import "./chunk-
|
|
111
|
+
} from "./chunk-GUMBIDDL.js";
|
|
112
|
+
import "./chunk-RC745GGZ.js";
|
|
113
113
|
import {
|
|
114
114
|
createVercelPluginTaskCallback,
|
|
115
115
|
queueCallback,
|
|
116
116
|
registerVercelPluginTaskDevConsumer
|
|
117
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-N6Q2PNSI.js";
|
|
118
118
|
import {
|
|
119
119
|
validatePluginEgressCredentialHooks,
|
|
120
120
|
validatePluginRegistrations
|
|
121
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-GUKGU6R7.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-PYBFVK6K.js";
|
|
162
162
|
import {
|
|
163
163
|
AuthorizationFlowDisabledError,
|
|
164
164
|
PluginCredentialFailureError
|
|
165
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-LXRTHE43.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-D4XQZOHB.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-COCVPDWX.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-K47OVEO4.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-ZFPEPWOO.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-BFP3ZKG6.js";
|
|
253
253
|
import {
|
|
254
254
|
parseSlackThreadId
|
|
255
|
-
} from "./chunk-
|
|
255
|
+
} from "./chunk-HMBTX5RK.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-5LEVZYXF.js";
|
|
271
271
|
import {
|
|
272
272
|
buildDeterministicAssistantMessageId,
|
|
273
273
|
buildDeterministicTurnId
|
|
274
274
|
} from "./chunk-DA2KGZZI.js";
|
|
275
|
-
import "./chunk-
|
|
275
|
+
import "./chunk-D5YQPCEG.js";
|
|
276
276
|
import {
|
|
277
277
|
getSandboxResourceConfig,
|
|
278
278
|
setSandboxResourceConfig
|
|
279
|
-
} from "./chunk-
|
|
279
|
+
} from "./chunk-IBXXTO3J.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-IQCL5JGL.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-FQ5HFSFR.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-2CYWEVOP.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-5S6AQFNG.js";
|
|
345
|
+
import "./chunk-KWXZMHJS.js";
|
|
346
346
|
import {
|
|
347
347
|
acquireActiveLock,
|
|
348
348
|
getStateAdapter,
|
|
349
349
|
withActiveLock
|
|
350
|
-
} from "./chunk-
|
|
350
|
+
} from "./chunk-IOUUS6H4.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-WJJDQLVL.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-OICYQPKP.js";
|
|
378
|
+
import "./chunk-3YZ2Q6AW.js";
|
|
379
379
|
import {
|
|
380
380
|
pluginCatalogRuntime
|
|
381
|
-
} from "./chunk-
|
|
382
|
-
import "./chunk-
|
|
381
|
+
} from "./chunk-DXFUYLHX.js";
|
|
382
|
+
import "./chunk-QWY4KI2V.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-QY2IU47O.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-QDU5MW2R.js";
|
|
425
425
|
|
|
426
426
|
// src/app.ts
|
|
427
427
|
import { createRequire } from "module";
|
|
@@ -551,11 +551,6 @@ async function recoverConversationWork(args) {
|
|
|
551
551
|
return result;
|
|
552
552
|
}
|
|
553
553
|
|
|
554
|
-
// src/chat/scheduled-tasks/heartbeat.ts
|
|
555
|
-
import {
|
|
556
|
-
createSlackSource
|
|
557
|
-
} from "@sentry/junior-plugin-api";
|
|
558
|
-
|
|
559
554
|
// src/chat/agent-dispatch/work.ts
|
|
560
555
|
import { z } from "zod";
|
|
561
556
|
var agentDispatchMailboxMetadataSchema = z.object({
|
|
@@ -935,23 +930,6 @@ function dispatchOptionsErrorMessage(issues) {
|
|
|
935
930
|
if (hasIssueUnderPath(issues, ["destination", "channelId"])) {
|
|
936
931
|
return "Dispatch destination channelId must be a Slack channel id";
|
|
937
932
|
}
|
|
938
|
-
if (issues.some(
|
|
939
|
-
(issue) => issue.code === "unrecognized_keys" && issue.path[0] === "source"
|
|
940
|
-
)) {
|
|
941
|
-
return "Dispatch source must not include unknown fields";
|
|
942
|
-
}
|
|
943
|
-
if (hasIssueAtPath(issues, ["source"])) {
|
|
944
|
-
return "Dispatch Source kind is required";
|
|
945
|
-
}
|
|
946
|
-
if (hasIssueUnderPath(issues, ["source", "teamId"])) {
|
|
947
|
-
return "Dispatch source teamId must be a Slack team id";
|
|
948
|
-
}
|
|
949
|
-
if (hasIssueUnderPath(issues, ["source", "channelId"])) {
|
|
950
|
-
return "Dispatch source channelId must be a Slack channel id";
|
|
951
|
-
}
|
|
952
|
-
if (hasIssueUnderPath(issues, ["source", "conversationId"])) {
|
|
953
|
-
return "Dispatch source conversationId must be a local conversation id";
|
|
954
|
-
}
|
|
955
933
|
if (hasIssueUnderPath(issues, ["idempotencyKey"])) {
|
|
956
934
|
const tooLong = issues.some(
|
|
957
935
|
(issue) => issue.path[0] === "idempotencyKey" && issue.code === "too_big"
|
|
@@ -1030,7 +1008,7 @@ var MAX_DISPATCHES_PER_HEARTBEAT = 25;
|
|
|
1030
1008
|
function bindDispatchCredentialSubject(options, plugin) {
|
|
1031
1009
|
const { credentialSubject, ...baseOptions } = options;
|
|
1032
1010
|
if (!credentialSubject) {
|
|
1033
|
-
return baseOptions;
|
|
1011
|
+
return { ...baseOptions, source: { kind: "plugin_dispatch" } };
|
|
1034
1012
|
}
|
|
1035
1013
|
if ("binding" in credentialSubject) {
|
|
1036
1014
|
throw new Error("Dispatch credentialSubject binding is runtime-owned");
|
|
@@ -1048,7 +1026,8 @@ function bindDispatchCredentialSubject(options, plugin) {
|
|
|
1048
1026
|
}
|
|
1049
1027
|
return {
|
|
1050
1028
|
...baseOptions,
|
|
1051
|
-
credentialSubject: boundSubject
|
|
1029
|
+
credentialSubject: boundSubject,
|
|
1030
|
+
source: { kind: "plugin_dispatch" }
|
|
1052
1031
|
};
|
|
1053
1032
|
}
|
|
1054
1033
|
async function dispatch(args) {
|
|
@@ -1119,7 +1098,8 @@ async function dispatchEventTask(args) {
|
|
|
1119
1098
|
}
|
|
1120
1099
|
const options = {
|
|
1121
1100
|
...unboundOptions,
|
|
1122
|
-
...boundSubject ? { credentialSubject: boundSubject } : void 0
|
|
1101
|
+
...boundSubject ? { credentialSubject: boundSubject } : void 0,
|
|
1102
|
+
source: { kind: "event_task" }
|
|
1123
1103
|
};
|
|
1124
1104
|
return await dispatch({
|
|
1125
1105
|
conversationWorkQueue: args.conversationWorkQueue,
|
|
@@ -1141,7 +1121,8 @@ async function dispatchScheduledTask(args) {
|
|
|
1141
1121
|
}
|
|
1142
1122
|
const options = {
|
|
1143
1123
|
...unboundOptions,
|
|
1144
|
-
...boundSubject ? { credentialSubject: boundSubject } : void 0
|
|
1124
|
+
...boundSubject ? { credentialSubject: boundSubject } : void 0,
|
|
1125
|
+
source: { kind: "scheduled_task" }
|
|
1145
1126
|
};
|
|
1146
1127
|
return await dispatch({
|
|
1147
1128
|
conversationWorkQueue: args.conversationWorkQueue,
|
|
@@ -1575,13 +1556,6 @@ function replyAttribution(task) {
|
|
|
1575
1556
|
detail: `Every ${recurrence.interval} ${frequency.unit}s`
|
|
1576
1557
|
};
|
|
1577
1558
|
}
|
|
1578
|
-
function dispatchSource(task) {
|
|
1579
|
-
return createSlackSource({
|
|
1580
|
-
teamId: task.destination.teamId,
|
|
1581
|
-
channelId: task.destination.channelId,
|
|
1582
|
-
visibility: task.conversationAccess.visibility
|
|
1583
|
-
});
|
|
1584
|
-
}
|
|
1585
1559
|
function shouldSkipRun(task, run) {
|
|
1586
1560
|
if (task.status === "deleted") {
|
|
1587
1561
|
return `Scheduled task ${task.id} was deleted before the run started.`;
|
|
@@ -1835,8 +1809,7 @@ async function runScheduledTaskHeartbeat(args) {
|
|
|
1835
1809
|
destinationVisibility: task.conversationAccess.visibility,
|
|
1836
1810
|
input: buildDispatchInput(task),
|
|
1837
1811
|
metadata,
|
|
1838
|
-
replyAttribution: replyAttribution(task)
|
|
1839
|
-
source: dispatchSource(task)
|
|
1812
|
+
replyAttribution: replyAttribution(task)
|
|
1840
1813
|
}
|
|
1841
1814
|
});
|
|
1842
1815
|
} catch (error) {
|
|
@@ -6191,7 +6164,7 @@ function createJuniorRuntimeServices(overrides = {}) {
|
|
|
6191
6164
|
}
|
|
6192
6165
|
|
|
6193
6166
|
// src/chat/providers/slack/turn.ts
|
|
6194
|
-
import { createSlackSource
|
|
6167
|
+
import { createSlackSource } from "@sentry/junior-plugin-api";
|
|
6195
6168
|
|
|
6196
6169
|
// src/chat/slack/message/identity.ts
|
|
6197
6170
|
function getMessageTimestamp(message) {
|
|
@@ -6490,7 +6463,7 @@ function createSlackTurn(deps) {
|
|
|
6490
6463
|
const threadTs = getThreadTs(threadId) ?? assistantThreadContext?.threadTs;
|
|
6491
6464
|
const messageTs = getMessageTs(message);
|
|
6492
6465
|
const teamId = destination.teamId;
|
|
6493
|
-
const source = options.execution?.source ??
|
|
6466
|
+
const source = options.execution?.source ?? createSlackSource({
|
|
6494
6467
|
channelId: channelId ?? destination.channelId,
|
|
6495
6468
|
messageTs,
|
|
6496
6469
|
teamId,
|
|
@@ -9506,7 +9479,6 @@ async function publicArtifactGET(args) {
|
|
|
9506
9479
|
// src/chat/event-tasks/ingest.ts
|
|
9507
9480
|
import { createHash as createHash2 } from "crypto";
|
|
9508
9481
|
import {
|
|
9509
|
-
createSlackSource as createSlackSource3,
|
|
9510
9482
|
RESOURCE_EVENT_SUMMARY_MAX_LENGTH,
|
|
9511
9483
|
RESOURCE_EVENT_TEXT_MAX_LENGTH,
|
|
9512
9484
|
resourceEventSchema
|
|
@@ -9569,12 +9541,7 @@ async function ingestEventTasks(input, options) {
|
|
|
9569
9541
|
destinationVisibility: task.destinationVisibility,
|
|
9570
9542
|
input: eventInput(task, event),
|
|
9571
9543
|
metadata: { eventTaskId: task.id },
|
|
9572
|
-
replyAttribution: replyAttribution2(task)
|
|
9573
|
-
source: createSlackSource3({
|
|
9574
|
-
teamId: task.destination.teamId,
|
|
9575
|
-
channelId: task.destination.channelId,
|
|
9576
|
-
visibility: task.destinationVisibility
|
|
9577
|
-
})
|
|
9544
|
+
replyAttribution: replyAttribution2(task)
|
|
9578
9545
|
}
|
|
9579
9546
|
});
|
|
9580
9547
|
if (dispatch2.status === "created") {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pluginCatalogRuntime
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-DXFUYLHX.js";
|
|
4
|
+
import "./chunk-QWY4KI2V.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-QY2IU47O.js";
|
|
10
10
|
import "./chunk-PEQXYSSE.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-QDU5MW2R.js";
|
|
12
12
|
export {
|
|
13
13
|
pluginCatalogRuntime
|
|
14
14
|
};
|
|
@@ -73,7 +73,7 @@ export declare function assemblePrompt(args: {
|
|
|
73
73
|
explicitSkill: Skill | null;
|
|
74
74
|
priorPiMessages?: PiMessage[];
|
|
75
75
|
resumedFromSessionRecord: boolean;
|
|
76
|
-
run: Pick<AgentRun, "source" | "destination" | "dispatch" | "slackConversation">;
|
|
76
|
+
run: Pick<AgentRun, "source" | "destination" | "dispatch" | "slackConversation" | "location" | "delivery">;
|
|
77
77
|
spanContext: LogContext;
|
|
78
78
|
turnId: string;
|
|
79
79
|
toolGuidance: Array<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DispatchOptions, DestinationVisibility, ReplyAttribution, Source, SlackDestination } from "@sentry/junior-plugin-api";
|
|
1
|
+
import type { DispatchOptions, DestinationVisibility, EventTaskSource, PluginDispatchSource, ReplyAttribution, ScheduledTaskSource, Source, SlackDestination } from "@sentry/junior-plugin-api";
|
|
2
2
|
import type { CredentialContext, CredentialSubject, CredentialSystemActor } from "@/chat/credentials/context";
|
|
3
3
|
import type { AgentDispatch } from "@/chat/agent/types";
|
|
4
4
|
import type { AgentTurnSurface } from "@/chat/task-execution/checkpoint";
|
|
@@ -9,6 +9,7 @@ export type SlackDispatchOptions = Omit<DispatchOptions, "destination"> & {
|
|
|
9
9
|
};
|
|
10
10
|
export interface BoundDispatchOptions extends Omit<SlackDispatchOptions, "credentialSubject"> {
|
|
11
11
|
credentialSubject?: CredentialSubject;
|
|
12
|
+
source: EventTaskSource | PluginDispatchSource | ScheduledTaskSource;
|
|
12
13
|
}
|
|
13
14
|
export interface DispatchRecord {
|
|
14
15
|
actor: CredentialSystemActor;
|
|
@@ -2,4 +2,4 @@ import type { BoundDispatchOptions, SlackDispatchOptions } from "./types";
|
|
|
2
2
|
/** Validate plugin-provided dispatch options before core persists them. */
|
|
3
3
|
export declare function validateDispatchOptions(options: unknown): asserts options is SlackDispatchOptions;
|
|
4
4
|
/** Verify runtime-owned access requirements for delegated dispatch credentials. */
|
|
5
|
-
export declare function verifyDispatchCredentialSubjectAccess(options: BoundDispatchOptions, plugin: string): Promise<void>;
|
|
5
|
+
export declare function verifyDispatchCredentialSubjectAccess(options: Pick<BoundDispatchOptions, "credentialSubject" | "destination">, plugin: string): Promise<void>;
|
|
@@ -126,6 +126,14 @@ 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>, z.ZodObject<{
|
|
130
|
+
kind: z.ZodLiteral<"scheduled_task">;
|
|
131
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
132
|
+
kind: z.ZodLiteral<"event_task">;
|
|
133
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
134
|
+
kind: z.ZodLiteral<"plugin_dispatch">;
|
|
135
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
136
|
+
kind: z.ZodLiteral<"agent_invocation">;
|
|
129
137
|
}, z.core.$strict>], "kind">, unknown>;
|
|
130
138
|
updatedAtMs: z.ZodNumber;
|
|
131
139
|
status: z.ZodEnum<{
|
|
@@ -253,6 +261,14 @@ export declare const agentInvocationSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
253
261
|
eventType: z.ZodString;
|
|
254
262
|
identifier: z.ZodString;
|
|
255
263
|
namespace: z.ZodString;
|
|
264
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
265
|
+
kind: z.ZodLiteral<"scheduled_task">;
|
|
266
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
267
|
+
kind: z.ZodLiteral<"event_task">;
|
|
268
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
269
|
+
kind: z.ZodLiteral<"plugin_dispatch">;
|
|
270
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
271
|
+
kind: z.ZodLiteral<"agent_invocation">;
|
|
256
272
|
}, z.core.$strict>], "kind">, unknown>;
|
|
257
273
|
updatedAtMs: z.ZodNumber;
|
|
258
274
|
result: z.ZodString;
|
|
@@ -378,6 +394,14 @@ export declare const agentInvocationSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
378
394
|
eventType: z.ZodString;
|
|
379
395
|
identifier: z.ZodString;
|
|
380
396
|
namespace: z.ZodString;
|
|
397
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
398
|
+
kind: z.ZodLiteral<"scheduled_task">;
|
|
399
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
400
|
+
kind: z.ZodLiteral<"event_task">;
|
|
401
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
402
|
+
kind: z.ZodLiteral<"plugin_dispatch">;
|
|
403
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
404
|
+
kind: z.ZodLiteral<"agent_invocation">;
|
|
381
405
|
}, z.core.$strict>], "kind">, unknown>;
|
|
382
406
|
updatedAtMs: z.ZodNumber;
|
|
383
407
|
errorMessage: z.ZodString;
|
|
@@ -474,34 +498,6 @@ export declare const createAgentInvocationSchema: z.ZodObject<{
|
|
|
474
498
|
xhigh: "xhigh";
|
|
475
499
|
none: "none";
|
|
476
500
|
}>>;
|
|
477
|
-
source: z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
478
|
-
kind: z.ZodLiteral<"slack">;
|
|
479
|
-
teamId: z.ZodString;
|
|
480
|
-
channelId: z.ZodString;
|
|
481
|
-
visibility: z.ZodEnum<{
|
|
482
|
-
private: "private";
|
|
483
|
-
public: "public";
|
|
484
|
-
}>;
|
|
485
|
-
messageTs: z.ZodOptional<z.ZodString>;
|
|
486
|
-
threadTs: z.ZodOptional<z.ZodString>;
|
|
487
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
488
|
-
kind: z.ZodLiteral<"local">;
|
|
489
|
-
visibility: z.ZodLiteral<"private">;
|
|
490
|
-
conversationId: z.ZodString;
|
|
491
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
492
|
-
kind: z.ZodLiteral<"web">;
|
|
493
|
-
visibility: z.ZodEnum<{
|
|
494
|
-
private: "private";
|
|
495
|
-
public: "public";
|
|
496
|
-
}>;
|
|
497
|
-
conversationId: z.ZodString;
|
|
498
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
499
|
-
kind: z.ZodLiteral<"resource_event">;
|
|
500
|
-
eventKey: z.ZodString;
|
|
501
|
-
eventType: z.ZodString;
|
|
502
|
-
identifier: z.ZodString;
|
|
503
|
-
namespace: z.ZodString;
|
|
504
|
-
}, z.core.$strict>], "kind">, unknown>;
|
|
505
501
|
}, z.core.$strict>;
|
|
506
502
|
export type AgentBinding = z.output<typeof agentBindingSchema>;
|
|
507
503
|
export type AgentInvocation = z.output<typeof agentInvocationSchema>;
|
|
@@ -106,7 +106,16 @@ export declare function eventTaskMatchesDestination(task: EventTask, destination
|
|
|
106
106
|
channelId: string;
|
|
107
107
|
teamId: string;
|
|
108
108
|
}): boolean;
|
|
109
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* Return whether the active destination may update or delete this task.
|
|
111
|
+
* Same-destination tasks stay local. Public tasks may be managed by id from
|
|
112
|
+
* another destination in the same workspace.
|
|
113
|
+
*/
|
|
114
|
+
export declare function eventTaskIsWritableFrom(task: EventTask, destination: {
|
|
115
|
+
channelId: string;
|
|
116
|
+
teamId: string;
|
|
117
|
+
}): boolean;
|
|
118
|
+
/** Load one task the active destination may update or delete. */
|
|
110
119
|
export declare function writableEventTask(context: ToolRuntimeContext, id: string): Promise<EventTask>;
|
|
111
120
|
export declare function eventTaskTriggerAvailable(task: EventTask, catalog: ResourceEventCatalog): boolean;
|
|
112
121
|
/** Project an event task into the bounded tool-result shape. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PluginRoute, PluginSandbox, PluginOperationalReport, PluginRouteApp, ResourceEvent, SlackConversationLink, PluginRegistration, User } from "@sentry/junior-plugin-api";
|
|
1
|
+
import type { PluginRoute, PluginSandbox, PluginOperationalReport, PluginRouteApp, Platform, ResourceEvent, SlackConversationLink, PluginRegistration, User } from "@sentry/junior-plugin-api";
|
|
2
2
|
import type { PluginPromptContributionContext } from "@/chat/plugins/prompt";
|
|
3
3
|
import type { AnyToolDefinition } from "@/chat/tools/definition";
|
|
4
4
|
import type { ToolRuntimeContext } from "@/chat/tools/types";
|
|
@@ -50,7 +50,7 @@ export declare function getPlugins(): PluginRegistration[];
|
|
|
50
50
|
/** Apply plugin Markdown rewrites before destination delivery formatting. */
|
|
51
51
|
export declare function applyPluginFormatMarkdown(text: string): string;
|
|
52
52
|
/** Collect stable plugin prompt contributions for the static system prompt. */
|
|
53
|
-
export declare function getPluginSystemPromptContributions(
|
|
53
|
+
export declare function getPluginSystemPromptContributions(platform: Platform): Promise<PluginPromptContributionContext[]>;
|
|
54
54
|
/** Collect request-scoped plugin prompt contributions. */
|
|
55
55
|
export declare function getPluginUserPromptContributions(args: {
|
|
56
56
|
context: Pick<ToolRuntimeContext, "conversationId" | "locationId" | "destination" | "actor" | "resolveActorIdentity" | "source" | "userText">;
|
package/dist/chat/prompt.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { SlackConversationContext } from "@/chat/slack/conversation-context
|
|
|
2
2
|
import type { SkillMetadata } from "@/chat/skills";
|
|
3
3
|
import type { ActiveMcpCatalogSummary } from "@/chat/tool-support/skill/mcp-tool-summary";
|
|
4
4
|
import type { PluginPromptContributionContext } from "@/chat/plugins/prompt";
|
|
5
|
-
import type { Destination, Source, SystemActor } from "@sentry/junior-plugin-api";
|
|
5
|
+
import type { Destination, Platform, Source, SystemActor } from "@sentry/junior-plugin-api";
|
|
6
6
|
export declare const JUNIOR_PERSONALITY: string;
|
|
7
7
|
export declare const JUNIOR_WORLD: string | null;
|
|
8
8
|
interface ToolPromptContext {
|
|
@@ -10,6 +10,7 @@ interface ToolPromptContext {
|
|
|
10
10
|
promptGuidelines?: string[];
|
|
11
11
|
promptSnippet?: string;
|
|
12
12
|
}
|
|
13
|
+
type PromptPlatform = Platform;
|
|
13
14
|
/** Render plugin system prompt additions under a core-owned wrapper. */
|
|
14
15
|
export declare function buildPluginSystemPromptContributions(contributions: PluginPromptContributionContext[]): string | null;
|
|
15
16
|
type TurnContextPromptInput = {
|
|
@@ -36,10 +37,8 @@ type TurnContextPromptInput = {
|
|
|
36
37
|
};
|
|
37
38
|
configuration?: Record<string, unknown>;
|
|
38
39
|
};
|
|
39
|
-
/** Return
|
|
40
|
-
export declare function buildSystemPrompt(
|
|
41
|
-
source: Source;
|
|
42
|
-
}): string;
|
|
40
|
+
/** Return the fixed instructions shared by every Conversation and Turn. */
|
|
41
|
+
export declare function buildSystemPrompt(platform: PromptPlatform): string;
|
|
43
42
|
/** Build volatile runtime context that belongs in the user turn, not the system prompt. */
|
|
44
43
|
export declare function buildTurnContextPrompt(params: TurnContextPromptInput): string | null;
|
|
45
44
|
export {};
|
|
@@ -5,18 +5,19 @@
|
|
|
5
5
|
* parent reads through that relation. Later Turns and mailbox wakes use the
|
|
6
6
|
* same Destination so tools stay consistent for the whole Conversation.
|
|
7
7
|
*/
|
|
8
|
-
import type { Destination
|
|
8
|
+
import type { Destination } from "@sentry/junior-plugin-api";
|
|
9
9
|
import type { ConversationStore } from "@/chat/conversations/store";
|
|
10
10
|
import type { Location } from "@/chat/conversations/location";
|
|
11
|
+
import type { SessionSource } from "@/chat/source";
|
|
11
12
|
export interface TurnSessionRouting {
|
|
12
13
|
destination: Destination;
|
|
13
14
|
location?: Location;
|
|
14
15
|
/** Present when the conversation already stores a session source. */
|
|
15
|
-
source?:
|
|
16
|
+
source?: SessionSource;
|
|
16
17
|
}
|
|
17
18
|
/** Conversation data with a required Destination and Source. */
|
|
18
19
|
export type RequiredTurnSessionRouting = TurnSessionRouting & {
|
|
19
|
-
source:
|
|
20
|
+
source: SessionSource;
|
|
20
21
|
};
|
|
21
22
|
/**
|
|
22
23
|
* Resolve the Conversation Location, Destination, and session Source.
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import type { ToolRuntimeContext } from "@/chat/tools/types";
|
|
2
|
-
import type { SlackDestination } from "@sentry/junior-plugin-api";
|
|
3
|
-
import type { SlackSource } from "@sentry/junior-plugin-api";
|
|
4
2
|
import type { SlackActor } from "@/chat/actor";
|
|
5
3
|
import { type SlackChannelId, type SlackTeamId } from "@/chat/slack/ids";
|
|
6
4
|
import { type SlackMessageTs } from "@/chat/slack/timestamp";
|
|
7
5
|
export interface SlackToolContext {
|
|
8
|
-
destination: SlackDestination;
|
|
9
|
-
source: SlackSource;
|
|
10
6
|
actor?: SlackActor;
|
|
11
7
|
destinationChannelId: SlackChannelId;
|
|
8
|
+
locationChannelId: SlackChannelId;
|
|
9
|
+
messageChannelId?: SlackChannelId;
|
|
12
10
|
messageTs?: SlackMessageTs;
|
|
13
|
-
sourceChannelId: SlackChannelId;
|
|
14
11
|
teamId: SlackTeamId;
|
|
15
12
|
threadTs?: SlackMessageTs;
|
|
16
13
|
}
|
|
17
|
-
/** Resolve Slack
|
|
14
|
+
/** Resolve Slack tool context from the Conversation Location. */
|
|
18
15
|
export declare function getSlackToolContext(context: ToolRuntimeContext): SlackToolContext | undefined;
|
package/dist/chat/source.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Source } from "@sentry/junior-plugin-api";
|
|
2
|
-
/**
|
|
2
|
+
/** Legacy provider Source fields stored on a Conversation. */
|
|
3
3
|
export type SessionSource = Extract<Source, {
|
|
4
4
|
kind: "web";
|
|
5
5
|
}> | Extract<Source, {
|
|
@@ -8,11 +8,9 @@ export type SessionSource = Extract<Source, {
|
|
|
8
8
|
kind: "slack";
|
|
9
9
|
}>, "messageTs">;
|
|
10
10
|
/**
|
|
11
|
-
* Normalize a
|
|
12
|
-
*
|
|
13
|
-
* thread anchor; channel-level turns (scheduled/event dispatch) keep the
|
|
14
|
-
* channel locator without inventing a threadTs.
|
|
11
|
+
* Normalize a Turn Source into legacy provider fields stored on a Conversation.
|
|
12
|
+
* System Sources do not contain a Conversation Location.
|
|
15
13
|
*/
|
|
16
14
|
export declare function normalizeSessionSource(value: Source | undefined): SessionSource | undefined;
|
|
17
|
-
/** Parse a serialized Source into
|
|
15
|
+
/** Parse a serialized Source into legacy provider fields stored on a Conversation. */
|
|
18
16
|
export declare function parseSessionSource(value: unknown): SessionSource | undefined;
|