@sentry/junior 0.192.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-3JY76L5X.js → agent-hooks-DWY3MZZ7.js} +11 -11
- package/dist/api.js +24 -24
- package/dist/app.js +49 -82
- package/dist/{catalog-runtime-5JVLWXRY.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/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-AKR6W7VV.js → chunk-2CYWEVOP.js} +4 -4
- package/dist/{chunk-PYVGXGKC.js → chunk-3YZ2Q6AW.js} +2 -2
- package/dist/{chunk-47JFLZSF.js → chunk-42N6CDWF.js} +4 -4
- package/dist/{chunk-ITTEDZGY.js → chunk-4UA5C7AM.js} +32 -25
- package/dist/{chunk-3O2NXVGB.js → chunk-5E5SLAVD.js} +21 -21
- package/dist/{chunk-G4E5WIRL.js → chunk-5LEVZYXF.js} +4 -4
- package/dist/{chunk-IBO4YFFZ.js → chunk-5S6AQFNG.js} +1 -1
- package/dist/{chunk-4CCQZHD3.js → chunk-AZVDODSP.js} +11 -11
- package/dist/{chunk-EIYOABL4.js → chunk-BFP3ZKG6.js} +12 -8
- package/dist/{chunk-SSR6YBWW.js → chunk-COCVPDWX.js} +11 -7
- package/dist/{chunk-YE6DVM43.js → chunk-D4XQZOHB.js} +8 -8
- package/dist/{chunk-OBN7UEQJ.js → chunk-D5YQPCEG.js} +2 -2
- package/dist/{chunk-BGLMT6KP.js → chunk-DVU734PI.js} +3 -3
- package/dist/{chunk-FGYWKKTJ.js → chunk-DXFUYLHX.js} +1 -1
- package/dist/{chunk-BUTAWPUV.js → chunk-FQ5HFSFR.js} +37 -31
- package/dist/{chunk-YRWGJ5OO.js → chunk-GTXQHZ2O.js} +5 -5
- package/dist/{chunk-5V4BAUCH.js → chunk-GUKGU6R7.js} +1 -1
- package/dist/{chunk-MB2CTEPD.js → chunk-GUMBIDDL.js} +3 -3
- package/dist/{chunk-4WIA45WD.js → chunk-HMBTX5RK.js} +1 -1
- package/dist/{chunk-3UJSII43.js → chunk-IBXXTO3J.js} +3 -3
- package/dist/{chunk-LRTEMMCZ.js → chunk-IOUUS6H4.js} +1 -1
- package/dist/{chunk-SZ2O3CGS.js → chunk-IQCL5JGL.js} +1 -1
- package/dist/{chunk-7XO7PTZE.js → chunk-K47OVEO4.js} +1 -1
- package/dist/{chunk-6LX6KV5C.js → chunk-KWXZMHJS.js} +3 -3
- package/dist/{chunk-KR5F3QSP.js → chunk-LG7Q4OW4.js} +8 -8
- package/dist/{chunk-PXP2M32M.js → chunk-LXRTHE43.js} +6 -7
- package/dist/{chunk-RWBZZMW6.js → chunk-N6Q2PNSI.js} +3 -3
- package/dist/{chunk-EYNUOZCN.js → chunk-OICYQPKP.js} +1 -1
- package/dist/{chunk-4B4DQGOM.js → chunk-PYBFVK6K.js} +73 -64
- package/dist/{chunk-ARSUYYQG.js → chunk-QDU5MW2R.js} +1 -1
- package/dist/{chunk-6FCKJDKS.js → chunk-QWY4KI2V.js} +1 -1
- package/dist/{chunk-3ADPXQBL.js → chunk-QY2IU47O.js} +1 -1
- package/dist/{chunk-Z4DNJI5F.js → chunk-S5HS6WRH.js} +5 -5
- package/dist/{chunk-4AFSQJD6.js → chunk-THFNL3TL.js} +3 -4
- package/dist/{chunk-H5Q2T5VC.js → chunk-THYNA2QN.js} +1 -1
- package/dist/{chunk-PXUBRZBU.js → chunk-WH5VV2RW.js} +1 -1
- package/dist/{chunk-4Z7B5WVV.js → chunk-WJJDQLVL.js} +2 -2
- package/dist/{chunk-VF3EDS7P.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.d.ts +16 -0
- package/dist/{db-LRM6AP66.js → db-H5MDRQEY.js} +6 -6
- package/dist/instrumentation.js +3 -3
- package/dist/nitro.js +6 -6
- package/dist/{oauth-callback-server-BKCDVYVH.js → oauth-callback-server-IOU3NUHT.js} +29 -29
- package/dist/{runner-RUXGS3E6.js → runner-FZ5ZHLFG.js} +21 -21
- package/dist/{skills-DXP2RCJF.js → skills-AR3WD6BX.js} +5 -5
- package/dist/spawn-ZU6JABR7.js +42 -0
- package/dist/task-runner-EEGGG2PM.js +36 -0
- package/dist/{validation-F4KYLIF2.js → validation-VYE7TQY7.js} +5 -5
- package/dist/version.js +1 -1
- package/dist/{work-UUNMNSML.js → work-CTQFWYKE.js} +21 -21
- package/dist/{worker-PMIJ5NLD.js → worker-6WQU3IT5.js} +10 -10
- package/package.json +4 -4
- package/dist/spawn-HH7GH7XT.js +0 -42
- package/dist/task-runner-H5I7R3LJ.js +0 -36
|
@@ -7,23 +7,23 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
formatProviderLabel,
|
|
9
9
|
startOAuthFlow
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-COCVPDWX.js";
|
|
11
11
|
import {
|
|
12
12
|
abandonReplacedPendingAuth,
|
|
13
13
|
canReusePendingAuthLink
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-K47OVEO4.js";
|
|
15
15
|
import {
|
|
16
16
|
recordAuthorizationRequested
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ZFPEPWOO.js";
|
|
18
18
|
import {
|
|
19
19
|
AGENT_INVOCATION_MAILBOX_STATUSES
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5S6AQFNG.js";
|
|
21
21
|
import {
|
|
22
22
|
TURN_REASONING_LEVELS
|
|
23
23
|
} from "./chunk-D4YV5TDV.js";
|
|
24
24
|
import {
|
|
25
25
|
pluginCatalogRuntime
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-DXFUYLHX.js";
|
|
27
27
|
import {
|
|
28
28
|
credentialContextSchema
|
|
29
29
|
} from "./chunk-CEMMLV5L.js";
|
|
@@ -302,8 +302,7 @@ var createAgentInvocationSchema = z.object({
|
|
|
302
302
|
idempotencyKey: exactStringSchema,
|
|
303
303
|
input: exactStringSchema,
|
|
304
304
|
parentConversationId: exactStringSchema,
|
|
305
|
-
reasoningLevel: z.enum(TURN_REASONING_LEVELS).optional()
|
|
306
|
-
source: sourceSchema
|
|
305
|
+
reasoningLevel: z.enum(TURN_REASONING_LEVELS).optional()
|
|
307
306
|
}).strict();
|
|
308
307
|
|
|
309
308
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runWithTurnRequestDeadline
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IQCL5JGL.js";
|
|
4
4
|
import {
|
|
5
5
|
QUEUE_SIGNATURE_MAX_AGE_MS,
|
|
6
6
|
createVercelQueueClient,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-7H2VZTWN.js";
|
|
10
10
|
import {
|
|
11
11
|
logWarn
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QY2IU47O.js";
|
|
13
13
|
|
|
14
14
|
// src/chat/plugins/task-queue.ts
|
|
15
15
|
import { createHash } from "crypto";
|
|
@@ -129,7 +129,7 @@ function pluginTaskCallback() {
|
|
|
129
129
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
130
130
|
// Load the runner on first use so this module can send without a cycle.
|
|
131
131
|
run: async (message) => {
|
|
132
|
-
const { processPluginTask } = await import("./task-runner-
|
|
132
|
+
const { processPluginTask } = await import("./task-runner-EEGGG2PM.js");
|
|
133
133
|
await processPluginTask(message);
|
|
134
134
|
},
|
|
135
135
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
PluginCredentialFailureError,
|
|
8
8
|
agentNameSchema,
|
|
9
9
|
createPluginAuthOrchestration
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LXRTHE43.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-D4XQZOHB.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-COCVPDWX.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-K47OVEO4.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-ZFPEPWOO.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-BFP3ZKG6.js";
|
|
164
164
|
import {
|
|
165
165
|
parseSlackThreadId
|
|
166
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-HMBTX5RK.js";
|
|
167
167
|
import {
|
|
168
168
|
appendAndEnqueueInboundMessage
|
|
169
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-5LEVZYXF.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-D5YQPCEG.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-IBXXTO3J.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-IQCL5JGL.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-FQ5HFSFR.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-2CYWEVOP.js";
|
|
253
253
|
import {
|
|
254
254
|
juniorArtifacts,
|
|
255
255
|
juniorIdentities,
|
|
256
256
|
juniorSchedulerRuns
|
|
257
|
-
} from "./chunk-
|
|
257
|
+
} from "./chunk-5S6AQFNG.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-KWXZMHJS.js";
|
|
289
289
|
import {
|
|
290
290
|
fenceLock,
|
|
291
291
|
getStateAdapter,
|
|
292
292
|
withLock
|
|
293
|
-
} from "./chunk-
|
|
293
|
+
} from "./chunk-IOUUS6H4.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-WJJDQLVL.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-OICYQPKP.js";
|
|
344
344
|
import {
|
|
345
345
|
discoverSkills,
|
|
346
346
|
findSkillByName,
|
|
347
347
|
loadSkillsByName,
|
|
348
348
|
parseSkillInvocation
|
|
349
|
-
} from "./chunk-
|
|
349
|
+
} from "./chunk-3YZ2Q6AW.js";
|
|
350
350
|
import {
|
|
351
351
|
pluginCatalogRuntime
|
|
352
|
-
} from "./chunk-
|
|
352
|
+
} from "./chunk-DXFUYLHX.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-QWY4KI2V.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-QY2IU47O.js";
|
|
397
397
|
import {
|
|
398
398
|
startInactiveSpan,
|
|
399
399
|
withActiveSpan
|
|
@@ -1724,7 +1724,7 @@ var TOOL_POLICY_RULES = [
|
|
|
1724
1724
|
"- When a tool result includes a subscription, those events are already watched; do not call watchResourceEvents for them. When a tool result includes a subscribable resource with suggestedEvents, use watchResourceEvents only for those remaining events that serve the current intent. If suggestedEvents is empty or omitted, do not invent a watch. Do not create scheduled polling tasks for events a watch can deliver. Write a concise intent summary, and tell the user when the temporary watch expires. Stop only the requested watch by id unless the user explicitly asks to stop every watch in the thread.",
|
|
1725
1725
|
"- Use createEventTask only when the user explicitly asks for an event task or durable whenever-this-happens-do-X automation. Ordinary watch, notify, and tell-me-when requests use watchResourceEvents. When an event task's resource and events are known, create it without redundant confirmation.",
|
|
1726
1726
|
"- Event tasks make the task creator's connected credentials available by default when the requested work needs user-bound authorization. Do not ask for separate confirmation merely to use credentials needed for the requested work. On creation, omit credentialMode for the creator default and set system only when the creator explicitly requires it. For later changes, creator always means the task's original createdBy actor, never the current requester. If the requester is not that creator, do not attempt to enable creator credential use or suggest that confirmation could authorize it.",
|
|
1727
|
-
"- Event tasks
|
|
1727
|
+
"- Event tasks list for the current destination, not one thread. Public tasks can also be updated or deleted by task id from another destination in the same workspace. When listing them, use createdBy to explain creator-only credential changes and warn when triggerAvailable is false; an unavailable task remains stored but cannot receive events until its plugin event is enabled again.",
|
|
1728
1728
|
"- Scheduled tasks make the task creator's connected credentials available by default when the requested work needs user-bound authorization. Do not ask for separate confirmation merely to use credentials needed for the requested work. On creation, omit credential_mode for the creator default and set system only when the creator explicitly requires it. For later changes, creator always means the task's original created_by actor, never the current requester. If the requester is not that creator, do not attempt to enable creator credential use or suggest that confirmation could authorize it.",
|
|
1729
1729
|
"- For code changes, debugging or root-cause analysis, broad refactors, and software architecture decisions, use `handoff` before substantive analysis only when it offers a profile that better matches the task. Do not switch merely because the task involves code.",
|
|
1730
1730
|
"- Run `jr-rpc config get|set|unset|list` for provider defaults and `jr-rpc plugins list` for installed plugin introspection as standalone bash commands; do not chain them with `cd`, `&&`, pipes, or provider commands.",
|
|
@@ -1862,6 +1862,11 @@ function formatSourceLines(source) {
|
|
|
1862
1862
|
`- source.identifier: ${escapeXml(source.identifier)}`,
|
|
1863
1863
|
`- source.event_type: ${escapeXml(source.eventType)}`
|
|
1864
1864
|
];
|
|
1865
|
+
case "scheduled_task":
|
|
1866
|
+
case "event_task":
|
|
1867
|
+
case "plugin_dispatch":
|
|
1868
|
+
case "agent_invocation":
|
|
1869
|
+
return [`- source.kind: ${source.kind}`];
|
|
1865
1870
|
}
|
|
1866
1871
|
}
|
|
1867
1872
|
function formatDestinationLines(destination) {
|
|
@@ -2005,8 +2010,7 @@ var STATIC_SYSTEM_PROMPTS = {
|
|
|
2005
2010
|
local: buildStaticSystemPrompt("local"),
|
|
2006
2011
|
slack: buildStaticSystemPrompt("slack")
|
|
2007
2012
|
};
|
|
2008
|
-
function buildSystemPrompt(
|
|
2009
|
-
const platform = params.source.kind === "slack" ? "slack" : "local";
|
|
2013
|
+
function buildSystemPrompt(platform) {
|
|
2010
2014
|
return STATIC_SYSTEM_PROMPTS[platform];
|
|
2011
2015
|
}
|
|
2012
2016
|
function buildTurnContextPrompt(params) {
|
|
@@ -2300,11 +2304,12 @@ async function assemblePrompt(args) {
|
|
|
2300
2304
|
userContentParts: requestContentParts
|
|
2301
2305
|
}) : void 0;
|
|
2302
2306
|
const needsBootstrapContextForPrompt = shouldPromptAgent && !replayedPrompt && !hasRuntimeTurnContext(promptHistoryMessages);
|
|
2303
|
-
const
|
|
2307
|
+
const platform = args.run.delivery && args.run.location?.provider === "slack" ? "slack" : "local";
|
|
2308
|
+
const systemPromptContributions = await getPluginSystemPromptContributions(platform);
|
|
2304
2309
|
const pluginSystemPrompt = buildPluginSystemPromptContributions(
|
|
2305
2310
|
systemPromptContributions
|
|
2306
2311
|
);
|
|
2307
|
-
const baseInstructions = [buildSystemPrompt(
|
|
2312
|
+
const baseInstructions = [buildSystemPrompt(platform), pluginSystemPrompt].filter((section) => Boolean(section)).join("\n\n");
|
|
2308
2313
|
const pluginUserPromptContributions = !shouldPromptAgent || replayedPrompt ? [] : await getPluginUserPromptContributions({
|
|
2309
2314
|
context: args.toolRuntimeContext,
|
|
2310
2315
|
turnId: args.turnId
|
|
@@ -8912,7 +8917,7 @@ function createEventTaskTool(context, catalog) {
|
|
|
8912
8917
|
readOnlyHint: false
|
|
8913
8918
|
},
|
|
8914
8919
|
executionMode: "sequential",
|
|
8915
|
-
description: "Create a durable event task that executes the supplied instruction for every matching resource event. Use for whenever-this-happens-do-X automation; ordinary watch, notify, or tell-me-when requests use watchResourceEvents instead. The task
|
|
8920
|
+
description: "Create a durable event task that executes the supplied instruction for every matching resource event. Use for whenever-this-happens-do-X automation; ordinary watch, notify, or tell-me-when requests use watchResourceEvents instead. The task may use the creator's connected credentials. Prefer a subscribable tool result when available.",
|
|
8916
8921
|
inputSchema: z22.object({
|
|
8917
8922
|
task: z22.string().trim().min(1).max(4e3),
|
|
8918
8923
|
title: z22.string().trim().min(1).max(SHORT_TITLE_MAX_LENGTH).nullable().describe(
|
|
@@ -9000,16 +9005,14 @@ function createDeleteEventTaskTool(context, catalog) {
|
|
|
9000
9005
|
readOnlyHint: false
|
|
9001
9006
|
},
|
|
9002
9007
|
executionMode: "sequential",
|
|
9003
|
-
description: "Delete an event task
|
|
9008
|
+
description: "Delete an event task.",
|
|
9004
9009
|
inputSchema: z23.object({ taskId: z23.string().min(1) }).strict(),
|
|
9005
9010
|
outputSchema: eventTaskToolResultSchema,
|
|
9006
9011
|
async execute({ taskId }) {
|
|
9007
9012
|
const current = await writableEventTask(context, taskId);
|
|
9008
9013
|
const deleted = await deleteEventTask(getDb(), current.id);
|
|
9009
9014
|
if (!deleted) {
|
|
9010
|
-
throw new ToolInputError(
|
|
9011
|
-
"Event task was not found in this Slack channel or DM."
|
|
9012
|
-
);
|
|
9015
|
+
throw new ToolInputError("Event task was not found.");
|
|
9013
9016
|
}
|
|
9014
9017
|
return eventTaskSuccess(deleted, catalog);
|
|
9015
9018
|
}
|
|
@@ -9027,7 +9030,7 @@ function createListEventTasksTool(context, catalog) {
|
|
|
9027
9030
|
openWorldHint: false,
|
|
9028
9031
|
readOnlyHint: true
|
|
9029
9032
|
},
|
|
9030
|
-
description: "List event tasks for
|
|
9033
|
+
description: "List event tasks for the current destination. A false triggerAvailable value means the task remains stored but its plugin event is not currently enabled.",
|
|
9031
9034
|
inputSchema: z24.object({}).strict(),
|
|
9032
9035
|
outputSchema: eventTaskListToolResultSchema,
|
|
9033
9036
|
async execute() {
|
|
@@ -9060,7 +9063,7 @@ function createUpdateEventTaskTool(context, catalog) {
|
|
|
9060
9063
|
readOnlyHint: false
|
|
9061
9064
|
},
|
|
9062
9065
|
executionMode: "sequential",
|
|
9063
|
-
description: "Update the instruction, registered trigger, or credential use for an event task
|
|
9066
|
+
description: "Update the instruction, registered trigger, or credential use for an event task.",
|
|
9064
9067
|
inputSchema: z25.object({
|
|
9065
9068
|
taskId: z25.string().min(1),
|
|
9066
9069
|
task: z25.string().trim().min(1).max(4e3).nullable().optional(),
|
|
@@ -9125,9 +9128,7 @@ function createUpdateEventTaskTool(context, catalog) {
|
|
|
9125
9128
|
}
|
|
9126
9129
|
const saved = await saveEventTask(getDb(), next);
|
|
9127
9130
|
if (!saved) {
|
|
9128
|
-
throw new ToolInputError(
|
|
9129
|
-
"Event task was not found in this Slack channel or DM."
|
|
9130
|
-
);
|
|
9131
|
+
throw new ToolInputError("Event task was not found.");
|
|
9131
9132
|
}
|
|
9132
9133
|
return eventTaskSuccess(saved, catalog);
|
|
9133
9134
|
}
|
|
@@ -10700,7 +10701,7 @@ function createSlackChannelJoinTool(context) {
|
|
|
10700
10701
|
const access = await checkSlackChannelReadAccess({
|
|
10701
10702
|
currentChannelIds: [
|
|
10702
10703
|
context.destinationChannelId,
|
|
10703
|
-
context.
|
|
10704
|
+
context.locationChannelId
|
|
10704
10705
|
],
|
|
10705
10706
|
targetChannelId: target.channelId,
|
|
10706
10707
|
teamId: context.teamId
|
|
@@ -10846,7 +10847,7 @@ function createSlackChannelListMessagesTool(context) {
|
|
|
10846
10847
|
const access = await checkSlackChannelReadAccess({
|
|
10847
10848
|
currentChannelIds: [
|
|
10848
10849
|
context.destinationChannelId,
|
|
10849
|
-
context.
|
|
10850
|
+
context.locationChannelId
|
|
10850
10851
|
],
|
|
10851
10852
|
targetChannelId,
|
|
10852
10853
|
teamId: context.teamId
|
|
@@ -11482,11 +11483,11 @@ function createSlackMessageAddReactionTool(context, state) {
|
|
|
11482
11483
|
}),
|
|
11483
11484
|
outputSchema: juniorToolOutputSchema,
|
|
11484
11485
|
execute: async ({ emoji }) => {
|
|
11485
|
-
const targetChannelId = context.
|
|
11486
|
+
const targetChannelId = context.messageChannelId;
|
|
11486
11487
|
const targetMessageTs = context.messageTs;
|
|
11487
|
-
if (!targetMessageTs) {
|
|
11488
|
+
if (!targetChannelId || !targetMessageTs) {
|
|
11488
11489
|
throw new ToolInputError(
|
|
11489
|
-
"No active message
|
|
11490
|
+
"No active Slack message is available for reactions."
|
|
11490
11491
|
);
|
|
11491
11492
|
}
|
|
11492
11493
|
const normalizedEmoji = normalizeSlackEmojiName(emoji);
|
|
@@ -11572,22 +11573,14 @@ function createSendFilesTool(context, state, materializeFile, attachments) {
|
|
|
11572
11573
|
outputSchema: sendFilesResultSchema,
|
|
11573
11574
|
execute: async ({ files }, options) => {
|
|
11574
11575
|
const filesToSend = normalizeFiles(files);
|
|
11575
|
-
const activeChannelId = context.
|
|
11576
|
-
if (!activeChannelId) {
|
|
11577
|
-
throw new ToolInputError("No active Slack conversation is available.");
|
|
11578
|
-
}
|
|
11576
|
+
const activeChannelId = context.locationChannelId;
|
|
11579
11577
|
const threadTs = context.threadTs ?? context.messageTs;
|
|
11580
|
-
if (!threadTs) {
|
|
11581
|
-
throw new ToolInputError(
|
|
11582
|
-
"No active Slack conversation timestamp is available."
|
|
11583
|
-
);
|
|
11584
|
-
}
|
|
11585
11578
|
const materializedFiles = await Promise.all(
|
|
11586
11579
|
filesToSend.map((file) => materializeFile(file))
|
|
11587
11580
|
);
|
|
11588
11581
|
const operationKey = createOperationKey("sendFiles", {
|
|
11589
11582
|
channel_id: activeChannelId,
|
|
11590
|
-
thread_ts: threadTs,
|
|
11583
|
+
thread_ts: threadTs ?? null,
|
|
11591
11584
|
files: fileOperationInput(materializedFiles)
|
|
11592
11585
|
});
|
|
11593
11586
|
const cached = state.getOperationResult(operationKey);
|
|
@@ -11617,7 +11610,7 @@ function createSendFilesTool(context, state, materializeFile, attachments) {
|
|
|
11617
11610
|
await uploadFilesToConversation({
|
|
11618
11611
|
channelId: activeChannelId,
|
|
11619
11612
|
files: uploads,
|
|
11620
|
-
threadTs
|
|
11613
|
+
...threadTs ? { threadTs } : void 0
|
|
11621
11614
|
});
|
|
11622
11615
|
const delivered = stored.map(
|
|
11623
11616
|
(attachment, index) => {
|
|
@@ -12940,7 +12933,7 @@ function createSlackThreadReadTool(context) {
|
|
|
12940
12933
|
const access = await checkSlackChannelReadAccess({
|
|
12941
12934
|
currentChannelIds: [
|
|
12942
12935
|
context.destinationChannelId,
|
|
12943
|
-
context.
|
|
12936
|
+
context.locationChannelId
|
|
12944
12937
|
],
|
|
12945
12938
|
targetChannelId: channelId,
|
|
12946
12939
|
teamId: context.teamId
|
|
@@ -13699,6 +13692,14 @@ async function resolveAccessScope(conversationStore, context, currentConversatio
|
|
|
13699
13692
|
currentConversationId,
|
|
13700
13693
|
current.parentConversationId
|
|
13701
13694
|
) : currentConversationId;
|
|
13695
|
+
if (context.location?.provider === "slack") {
|
|
13696
|
+
return {
|
|
13697
|
+
currentConversationId,
|
|
13698
|
+
currentRootConversationId,
|
|
13699
|
+
provider: "slack",
|
|
13700
|
+
providerTenantId: context.location.teamId
|
|
13701
|
+
};
|
|
13702
|
+
}
|
|
13702
13703
|
if (context.source.kind === "slack") {
|
|
13703
13704
|
return {
|
|
13704
13705
|
currentConversationId,
|
|
@@ -14839,9 +14840,9 @@ function createToolState() {
|
|
|
14839
14840
|
function createTools(availableSkills, hooks = {}, context, options = {}) {
|
|
14840
14841
|
const state = createToolState();
|
|
14841
14842
|
const slackContext = getSlackToolContext(context);
|
|
14842
|
-
const
|
|
14843
|
+
const slackLocationCapabilities = slackContext ? resolveChannelCapabilities(slackContext.locationChannelId) : void 0;
|
|
14843
14844
|
const canSendFilesToActiveConversation = Boolean(
|
|
14844
|
-
slackContext &&
|
|
14845
|
+
slackContext && slackLocationCapabilities?.canSendFiles
|
|
14845
14846
|
);
|
|
14846
14847
|
const resourceEventCatalog = getResourceEventCatalog();
|
|
14847
14848
|
const tools = {
|
|
@@ -14919,7 +14920,7 @@ function createTools(availableSkills, hooks = {}, context, options = {}) {
|
|
|
14919
14920
|
tools.slackCanvasWrite = createSlackCanvasWriteTool(state);
|
|
14920
14921
|
tools.slackThreadRead = createSlackThreadReadTool(slackContext);
|
|
14921
14922
|
tools.slackChannelJoin = createSlackChannelJoinTool(slackContext);
|
|
14922
|
-
if (
|
|
14923
|
+
if (context.conversationPrivacy === "public") {
|
|
14923
14924
|
tools.searchConversationMessages = createSlackConversationMessageSearchTool(
|
|
14924
14925
|
{
|
|
14925
14926
|
kind: "public_provider_tenant",
|
|
@@ -14948,8 +14949,8 @@ function createTools(availableSkills, hooks = {}, context, options = {}) {
|
|
|
14948
14949
|
tools.slackListUpdateItem = createSlackListUpdateItemTool(state);
|
|
14949
14950
|
const outputChannelId = slackContext.destinationChannelId;
|
|
14950
14951
|
const outputCapabilities = outputChannelId ? resolveChannelCapabilities(outputChannelId) : void 0;
|
|
14951
|
-
const
|
|
14952
|
-
slackContext.
|
|
14952
|
+
const locationCapabilities = resolveChannelCapabilities(
|
|
14953
|
+
slackContext.locationChannelId
|
|
14953
14954
|
);
|
|
14954
14955
|
if (outputCapabilities?.canCreateCanvas) {
|
|
14955
14956
|
tools.slackCanvasCreate = createSlackCanvasCreateTool(
|
|
@@ -14957,7 +14958,7 @@ function createTools(availableSkills, hooks = {}, context, options = {}) {
|
|
|
14957
14958
|
state
|
|
14958
14959
|
);
|
|
14959
14960
|
}
|
|
14960
|
-
if (
|
|
14961
|
+
if (locationCapabilities.canSendFiles) {
|
|
14961
14962
|
tools.sendFiles = createSendFilesTool(
|
|
14962
14963
|
slackContext,
|
|
14963
14964
|
state,
|
|
@@ -14970,7 +14971,7 @@ function createTools(availableSkills, hooks = {}, context, options = {}) {
|
|
|
14970
14971
|
);
|
|
14971
14972
|
}
|
|
14972
14973
|
tools.slackChannelListMessages = createSlackChannelListMessagesTool(slackContext);
|
|
14973
|
-
if (
|
|
14974
|
+
if (context.source.kind === "slack" && locationCapabilities.canAddReactions) {
|
|
14974
14975
|
tools.addReaction = createSlackMessageAddReactionTool(
|
|
14975
14976
|
slackContext,
|
|
14976
14977
|
state
|
|
@@ -17545,9 +17546,13 @@ function resolveToolRuntimeRoute(args) {
|
|
|
17545
17546
|
source: args.run.source
|
|
17546
17547
|
};
|
|
17547
17548
|
case "resource_event":
|
|
17549
|
+
case "scheduled_task":
|
|
17550
|
+
case "event_task":
|
|
17551
|
+
case "plugin_dispatch":
|
|
17552
|
+
case "agent_invocation":
|
|
17548
17553
|
return {
|
|
17549
17554
|
destination,
|
|
17550
|
-
actor: args.actor
|
|
17555
|
+
actor: args.actor,
|
|
17551
17556
|
source: args.run.source
|
|
17552
17557
|
};
|
|
17553
17558
|
}
|
|
@@ -17642,7 +17647,11 @@ async function wireAgentTools(args) {
|
|
|
17642
17647
|
);
|
|
17643
17648
|
const commonToolRuntimeContext = {
|
|
17644
17649
|
conversationId: args.run.conversationId,
|
|
17645
|
-
...args.run.location ? {
|
|
17650
|
+
...args.run.location ? {
|
|
17651
|
+
location: args.run.location,
|
|
17652
|
+
locationId: args.run.location.id
|
|
17653
|
+
} : void 0,
|
|
17654
|
+
conversationPrivacy: args.conversationPrivacy,
|
|
17646
17655
|
userText: args.userInput,
|
|
17647
17656
|
configuration: args.configurationValues,
|
|
17648
17657
|
egress: createPluginEgress({
|
|
@@ -18642,7 +18651,7 @@ async function executeAgentRun(run, streamFn) {
|
|
|
18642
18651
|
const userActor = actor && "userId" in actor ? actor : void 0;
|
|
18643
18652
|
const runLogContext = {
|
|
18644
18653
|
conversationId: run.conversationId,
|
|
18645
|
-
platform: run.source.kind,
|
|
18654
|
+
platform: run.source.kind === "slack" || run.source.kind === "web" || run.source.kind === "local" ? run.source.kind : void 0,
|
|
18646
18655
|
messageConversationId: run.source.kind === "slack" ? run.conversationId : run.source.kind === "web" || run.source.kind === "local" ? run.source.conversationId : run.conversationId,
|
|
18647
18656
|
destinationName: run.location?.channelId ?? (run.source.kind === "slack" ? run.source.channelId : run.source.kind === "web" || run.source.kind === "local" ? run.source.conversationId : run.conversationId),
|
|
18648
18657
|
userId: userActor?.userId,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
persistConversationMessages
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZFPEPWOO.js";
|
|
4
4
|
import {
|
|
5
5
|
JUNIOR_THREAD_STATE_TTL_MS
|
|
6
6
|
} from "./chunk-3Y47VMHV.js";
|
|
7
7
|
import {
|
|
8
8
|
getDb
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2CYWEVOP.js";
|
|
10
10
|
import {
|
|
11
11
|
juniorLocationConfigurations
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5S6AQFNG.js";
|
|
13
13
|
import {
|
|
14
14
|
getStateAdapter
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-IOUUS6H4.js";
|
|
16
16
|
import {
|
|
17
17
|
juniorDestinations
|
|
18
18
|
} from "./chunk-VFUK3X5B.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
isRecord,
|
|
21
21
|
toOptionalNumber,
|
|
22
22
|
toOptionalString
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-QY2IU47O.js";
|
|
24
24
|
|
|
25
25
|
// src/chat/state/conversation.ts
|
|
26
26
|
function defaultConversationState() {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAndEnqueueAgentInvocation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AZVDODSP.js";
|
|
4
4
|
import {
|
|
5
5
|
actorFromRun,
|
|
6
6
|
toolInvocationDestination
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-COCVPDWX.js";
|
|
8
8
|
|
|
9
9
|
// src/chat/agent-invocations/spawn.ts
|
|
10
10
|
function bindSpawnAgent(run, options) {
|
|
@@ -24,8 +24,7 @@ function bindSpawnAgent(run, options) {
|
|
|
24
24
|
idempotencyKey: `${run.turnId}:${call.toolCallId}`,
|
|
25
25
|
input: input.task,
|
|
26
26
|
parentConversationId: run.conversationId,
|
|
27
|
-
...input.reasoningLevel ? { reasoningLevel: input.reasoningLevel } : void 0
|
|
28
|
-
source: run.source
|
|
27
|
+
...input.reasoningLevel ? { reasoningLevel: input.reasoningLevel } : void 0
|
|
29
28
|
},
|
|
30
29
|
{ ...options, queue }
|
|
31
30
|
);
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
toCanonicalInputMessage,
|
|
8
8
|
toCanonicalOutputMessage,
|
|
9
9
|
toGenAiMessagesTraceAttributes
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OICYQPKP.js";
|
|
11
11
|
import {
|
|
12
12
|
extractGenAiUsageAttributes,
|
|
13
13
|
logException,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
normalizeGenAiFinishReason,
|
|
16
16
|
serializeGenAiAttribute,
|
|
17
17
|
withSpan
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-QY2IU47O.js";
|
|
19
19
|
|
|
20
20
|
// src/chat/services/provider-error.ts
|
|
21
21
|
var ProviderError = class extends Error {
|