@sentry/junior 0.147.0 → 0.149.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-HS6VGUPM.js → agent-hooks-CWMCXAMT.js} +10 -10
- package/dist/api/conversations/access.d.ts +2 -1
- package/dist/api/conversations/aggregate.d.ts +2 -0
- package/dist/api/conversations/archive.d.ts +3 -5
- package/dist/api/conversations/create.d.ts +6 -0
- package/dist/api/conversations/detail.d.ts +2 -296
- package/dist/api/conversations/event-list.d.ts +2 -193
- package/dist/api/conversations/list.d.ts +4 -66
- package/dist/api/conversations/pending-messages.d.ts +15 -0
- package/dist/api/conversations/routes.d.ts +1 -1
- package/dist/api/conversations/stats.d.ts +0 -54
- package/dist/api/http.d.ts +2 -6
- package/dist/api/locations/detail.d.ts +3 -111
- package/dist/api/locations/list.d.ts +0 -45
- package/dist/api/locations/query.d.ts +2 -1
- package/dist/api/locations/routes.d.ts +1 -1
- package/dist/api/people/list.d.ts +0 -29
- package/dist/api/people/profile.d.ts +2 -106
- package/dist/api/people/profile.query.d.ts +2 -1
- package/dist/api/people/routes.d.ts +1 -1
- package/dist/api/people/shared.d.ts +3 -1
- package/dist/api/people/spend.d.ts +3 -4
- package/dist/api/personal-tokens/routes.d.ts +2 -2
- package/dist/api/route.d.ts +8 -14
- package/dist/api/schema/conversation.d.ts +130 -25
- package/dist/api/schema/location.d.ts +4 -0
- package/dist/api/schema/person.d.ts +7 -3
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +13 -1
- package/dist/api/stats.d.ts +0 -13
- package/dist/api/validation.d.ts +7 -0
- package/dist/api/viewer.d.ts +3 -0
- package/dist/api.d.ts +2 -1
- package/dist/api.js +772 -561
- package/dist/app.js +241 -204
- package/dist/{catalog-runtime-M6ZTPYRV.js → catalog-runtime-GAW5APVI.js} +5 -5
- package/dist/chat/actor.d.ts +4 -1
- package/dist/chat/agent/request.d.ts +2 -0
- package/dist/chat/agent/resume.d.ts +1 -0
- package/dist/chat/agent-dispatch/context.d.ts +2 -2
- package/dist/chat/agent-invocations/types.d.ts +52 -0
- package/dist/chat/api-turns/work.d.ts +108 -0
- package/dist/chat/app/services.d.ts +1 -1
- package/dist/chat/conversations/history.d.ts +60 -0
- package/dist/chat/conversations/provenance.d.ts +6 -0
- package/dist/chat/conversations/sql/actor-identity.d.ts +19 -0
- package/dist/chat/conversations/store.d.ts +1 -1
- package/dist/chat/resource-events/store.d.ts +1 -1
- package/dist/chat/runtime/reply-executor.d.ts +1 -3
- package/dist/chat/runtime/slack-runtime.d.ts +2 -1
- package/dist/chat/runtime/turn-preparation.d.ts +9 -0
- package/dist/chat/scheduled-tasks/tool-support.d.ts +5 -5
- package/dist/chat/scheduled-tasks/tools/create.d.ts +2 -2
- package/dist/chat/scheduled-tasks/tools/delete.d.ts +2 -2
- package/dist/chat/scheduled-tasks/tools/list.d.ts +2 -2
- package/dist/chat/scheduled-tasks/tools/run-now.d.ts +2 -2
- package/dist/chat/scheduled-tasks/tools/update.d.ts +2 -2
- package/dist/chat/services/conversation-memory.d.ts +2 -2
- package/dist/chat/services/conversation-title.d.ts +20 -0
- package/dist/chat/slack/assistant-thread/title.d.ts +10 -27
- package/dist/chat/slack/channel.d.ts +26 -0
- package/dist/chat/slack/dispatch-turn.d.ts +1 -0
- package/dist/chat/slack/timestamp-param.d.ts +0 -2
- package/dist/chat/slack/{tools → tool-support}/canvas/api.d.ts +1 -1
- package/dist/chat/slack/{tools → tool-support}/canvas/context.d.ts +3 -0
- package/dist/chat/slack/tool-support/channel-access.d.ts +42 -0
- package/dist/chat/slack/tool-support/channel-target.d.ts +27 -0
- package/dist/chat/slack/tool-support/list/params.d.ts +5 -0
- package/dist/chat/slack/tools/canvas/create.d.ts +1 -1
- package/dist/chat/slack/tools/channel-join.d.ts +28 -0
- package/dist/chat/slack/tools/channel-list-messages.d.ts +3 -2
- package/dist/chat/slack/tools/conversation-message-search.d.ts +2 -8
- package/dist/chat/slack/tools/message-add-reaction.d.ts +1 -1
- package/dist/chat/slack/tools/public-search.d.ts +63 -2
- package/dist/chat/slack/tools/send-files.d.ts +1 -1
- package/dist/chat/slack/tools/thread-read.d.ts +2 -5
- package/dist/chat/source.d.ts +2 -0
- package/dist/chat/state/conversation.d.ts +1 -0
- package/dist/chat/task-execution/checkpoint.d.ts +1 -0
- package/dist/chat/task-execution/state.d.ts +9 -4
- package/dist/chat/task-execution/store.d.ts +3 -2
- package/dist/chat/task-execution/turn-cursor.d.ts +2 -0
- package/dist/chat/task-execution/worker.d.ts +2 -0
- package/dist/chat/tasks/read.d.ts +1 -1
- package/dist/chat/tools/search-conversation-events.d.ts +1 -1
- package/dist/chat/tools/types.d.ts +11 -4
- package/dist/chat/tools/watch-resource-events.d.ts +2 -2
- package/dist/{chunk-ORO3PWKQ.js → chunk-25SC7D6Z.js} +1 -1
- package/dist/{chunk-GGB4WL5A.js → chunk-2JHKISQA.js} +1 -1
- package/dist/{chunk-AVZDSUFB.js → chunk-2P6BQQER.js} +4 -4
- package/dist/{chunk-7NVJVJID.js → chunk-32CXPIZE.js} +2 -2
- package/dist/{chunk-YSB2N563.js → chunk-3GYZ5YEH.js} +121 -87
- package/dist/{chunk-DU74WPIC.js → chunk-3I2IVWSZ.js} +1 -1
- package/dist/{chunk-SVHUEHUL.js → chunk-3JVUWLR7.js} +65 -4
- package/dist/{chunk-RXBVB2JM.js → chunk-3KGQOKIG.js} +1 -1
- package/dist/{chunk-YBVXBNSV.js → chunk-4JGM7FXO.js} +2 -2
- package/dist/{chunk-AZ7EAOBE.js → chunk-4YKPOYRV.js} +5 -5
- package/dist/chunk-5CWUQXXT.js +806 -0
- package/dist/{chunk-DLDRQHG5.js → chunk-6G5RCDKP.js} +1 -1
- package/dist/{chunk-AYU72WO7.js → chunk-75DSYFFB.js} +47 -70
- package/dist/{chunk-YHDERDRO.js → chunk-7BH46NB4.js} +91 -75
- package/dist/{chunk-745QJ3ZA.js → chunk-ALJG73MQ.js} +2 -2
- package/dist/chunk-ART7P442.js +48 -0
- package/dist/{chunk-7A4M7PCV.js → chunk-DK5UT6PQ.js} +1180 -556
- package/dist/{chunk-AIOK6LAG.js → chunk-EW2LNCRL.js} +813 -44
- package/dist/chunk-EXW76GW4.js +36 -0
- package/dist/chunk-GDFF3BQG.js +136 -0
- package/dist/{chunk-7UQIVT6G.js → chunk-JMH3DBM5.js} +6 -6
- package/dist/{chunk-CWP5RHVX.js → chunk-JMSMXXED.js} +12 -5
- package/dist/{chunk-CSZINQJ2.js → chunk-MEMURSBG.js} +1 -1
- package/dist/{chunk-YNTTROJT.js → chunk-QIW7OQEO.js} +1 -1
- package/dist/{chunk-Q4R73I43.js → chunk-RB26T3LU.js} +58 -28
- package/dist/{chunk-4LJO56OJ.js → chunk-RLVZIWNQ.js} +1 -1
- package/dist/{chunk-SGZO7UWH.js → chunk-SWHPVZBV.js} +2 -2
- package/dist/{chunk-PVNG6UMU.js → chunk-TFBNBXPU.js} +22 -10
- package/dist/{chunk-EFLJ2WJH.js → chunk-URDCZAL4.js} +5 -5
- package/dist/{chunk-6H5SZR24.js → chunk-UZGASGOD.js} +300 -383
- package/dist/{chunk-YEO3VX72.js → chunk-W7UONUIZ.js} +8 -6
- package/dist/{chunk-JUUKWRBE.js → chunk-X22XXSZA.js} +1 -1
- package/dist/{chunk-X5UY34KT.js → chunk-XPYWWMHR.js} +8 -8
- package/dist/{chunk-IIOOO4FQ.js → chunk-ZYMYLLWG.js} +2 -1
- package/dist/cli/chat.js +32 -35
- package/dist/cli/check.js +6 -6
- package/dist/cli/plugins.js +13 -13
- package/dist/cli/snapshot-create.js +9 -9
- package/dist/cli/upgrade.js +7 -7
- package/dist/db/schema/agent-invocations.d.ts +20 -0
- package/dist/db/schema/conversation-annotations.d.ts +2 -2
- package/dist/db/schema.d.ts +22 -2
- package/dist/{db-CSEW4RII.js → db-JBZLRIVY.js} +7 -7
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-FUEV5HNG.js → oauth-callback-server-MNTVYY2I.js} +24 -26
- package/dist/{runner-U3XHSKSH.js → runner-K24BWZSZ.js} +23 -25
- package/dist/{skills-AKE6W3WI.js → skills-AU5ST2CG.js} +6 -6
- package/dist/spawn-6PO7CVJ6.js +38 -0
- package/dist/{validation-WDTAULUF.js → validation-IXGZCFRO.js} +6 -6
- package/dist/version.js +1 -1
- package/dist/{work-C3HAO2BG.js → work-WCZIYILX.js} +18 -19
- package/dist/{worker-LNP4YKBM.js → worker-U2AACBEY.js} +11 -10
- package/package.json +6 -5
- package/dist/api/health.d.ts +0 -7
- package/dist/api/personal-tokens/create.d.ts +0 -11
- package/dist/api/personal-tokens/list.d.ts +0 -12
- package/dist/api/personal-tokens/revoke.d.ts +0 -5
- package/dist/api/plugin-reports.d.ts +0 -63
- package/dist/api/plugins.d.ts +0 -8
- package/dist/api/runtime.d.ts +0 -24
- package/dist/api/skills.d.ts +0 -6
- package/dist/chat/slack/tools/channel-access.d.ts +0 -30
- package/dist/chunk-34GS7B6L.js +0 -115
- package/dist/chunk-AVOCH2Z5.js +0 -285
- package/dist/chunk-HLXXQI5Q.js +0 -238
- package/dist/chunk-K4SZAP3K.js +0 -67
- package/dist/chunk-R776HKPK.js +0 -81
- package/dist/chunk-Z4YU7Z4L.js +0 -76
- package/dist/spawn-B6GDTWJ4.js +0 -39
- /package/dist/chat/slack/{tools → tool-support}/canvas/markdown.d.ts +0 -0
- /package/dist/chat/slack/{tools → tool-support}/channel-capabilities.d.ts +0 -0
- /package/dist/chat/slack/{tools → tool-support}/context.d.ts +0 -0
- /package/dist/chat/slack/{tools → tool-support}/list/api.d.ts +0 -0
- /package/dist/chat/slack/{tools → tool-support}/slack-message-url.d.ts +0 -0
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
relayLocalOAuthCallback
|
|
3
3
|
} from "./chunk-FA6POGLH.js";
|
|
4
|
+
import {
|
|
5
|
+
getTurnRequestDeadline
|
|
6
|
+
} from "./chunk-EXW76GW4.js";
|
|
7
|
+
import {
|
|
8
|
+
persistAuthPauseTurnState
|
|
9
|
+
} from "./chunk-ART7P442.js";
|
|
10
|
+
import {
|
|
11
|
+
buildSentryConversationUrl
|
|
12
|
+
} from "./chunk-4CODA7P5.js";
|
|
4
13
|
import {
|
|
5
14
|
ensureConversationWake,
|
|
6
15
|
requestConversationWork
|
|
7
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JMSMXXED.js";
|
|
8
17
|
import {
|
|
9
|
-
buildConversationContext,
|
|
10
18
|
buildDeliveredTurnStatePatch,
|
|
11
19
|
finalizeFailedTurnReplyWithEvent,
|
|
12
20
|
getInterruptionMarker,
|
|
@@ -14,14 +22,10 @@ import {
|
|
|
14
22
|
getTurnUserMessageId,
|
|
15
23
|
getTurnUserReplyAttachmentContext,
|
|
16
24
|
getTurnUserSlackMessageTs,
|
|
17
|
-
markConversationMessage,
|
|
18
|
-
persistAuthPauseTurnState,
|
|
19
|
-
recordDeliveredAssistantMessage,
|
|
20
25
|
requireTurnFailureEventId,
|
|
21
26
|
resolveTurnSessionRouting,
|
|
22
|
-
scheduleSessionCompletedPluginTasks
|
|
23
|
-
|
|
24
|
-
} from "./chunk-6H5SZR24.js";
|
|
27
|
+
scheduleSessionCompletedPluginTasks
|
|
28
|
+
} from "./chunk-UZGASGOD.js";
|
|
25
29
|
import {
|
|
26
30
|
ConversationTurnLifecycleService,
|
|
27
31
|
coerceThreadConversationState,
|
|
@@ -30,10 +34,7 @@ import {
|
|
|
30
34
|
getPersistedSandboxState,
|
|
31
35
|
getPersistedThreadState,
|
|
32
36
|
persistThreadStateById
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import {
|
|
35
|
-
buildSentryConversationUrl
|
|
36
|
-
} from "./chunk-4CODA7P5.js";
|
|
37
|
+
} from "./chunk-4YKPOYRV.js";
|
|
37
38
|
import {
|
|
38
39
|
getVercelConversationWorkQueue
|
|
39
40
|
} from "./chunk-WR76IVA5.js";
|
|
@@ -46,10 +47,10 @@ import {
|
|
|
46
47
|
getMcpStoredOAuthCredentials,
|
|
47
48
|
lookupSlackUserProfile,
|
|
48
49
|
resolvePluginOAuthAccount
|
|
49
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-RB26T3LU.js";
|
|
50
51
|
import {
|
|
51
52
|
RetryableDeliveryError
|
|
52
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-GDFF3BQG.js";
|
|
53
54
|
import {
|
|
54
55
|
addReactionToMessage,
|
|
55
56
|
escapeSlackMrkdwnText,
|
|
@@ -62,10 +63,17 @@ import {
|
|
|
62
63
|
removeReactionFromMessage,
|
|
63
64
|
resolveBaseUrl,
|
|
64
65
|
truncateStatusText
|
|
65
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-JMH3DBM5.js";
|
|
67
|
+
import {
|
|
68
|
+
parseSlackThreadId,
|
|
69
|
+
readSlackRawMessageContext,
|
|
70
|
+
resolveSlackChannelIdFromMessage,
|
|
71
|
+
resolveSlackChannelIdFromThreadId
|
|
72
|
+
} from "./chunk-MEMURSBG.js";
|
|
66
73
|
import {
|
|
67
74
|
TurnSliceLimitExceededError,
|
|
68
75
|
abandonTurnRecord,
|
|
76
|
+
buildConversationContext,
|
|
69
77
|
buildTurnLimitResponse,
|
|
70
78
|
clearPendingAuth,
|
|
71
79
|
commitAcceptedReply,
|
|
@@ -77,61 +85,57 @@ import {
|
|
|
77
85
|
isPendingAuthLatestRequest,
|
|
78
86
|
loadProjection,
|
|
79
87
|
loadTurnCheckpoint,
|
|
88
|
+
markConversationMessage,
|
|
80
89
|
markTurnFailed,
|
|
81
90
|
persistWithRetry,
|
|
82
91
|
recordAuthenticationLinked,
|
|
83
92
|
recordAuthorizationCompleted,
|
|
93
|
+
recordDeliveredAssistantMessage,
|
|
84
94
|
recordTurnSummary,
|
|
85
|
-
saveTurnCheckpoint
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
parseSlackThreadId,
|
|
89
|
-
readSlackRawMessageContext,
|
|
90
|
-
resolveSlackChannelIdFromMessage,
|
|
91
|
-
resolveSlackChannelIdFromThreadId
|
|
92
|
-
} from "./chunk-CSZINQJ2.js";
|
|
95
|
+
saveTurnCheckpoint,
|
|
96
|
+
turnHasReply
|
|
97
|
+
} from "./chunk-EW2LNCRL.js";
|
|
93
98
|
import {
|
|
94
99
|
getDashboardConversationLink,
|
|
95
100
|
getPluginSlackConversationLink
|
|
96
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-7BH46NB4.js";
|
|
97
102
|
import {
|
|
98
103
|
SlackActionError,
|
|
99
104
|
getHeaderString,
|
|
100
105
|
getSlackClient,
|
|
101
106
|
isDmChannel,
|
|
102
107
|
normalizeSlackConversationId
|
|
103
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-SWHPVZBV.js";
|
|
104
109
|
import {
|
|
105
110
|
getConversationEventStore,
|
|
106
111
|
getSqlExecutor,
|
|
107
112
|
requireSlackDestination,
|
|
108
113
|
upsertIdentity,
|
|
109
114
|
upsertLinkedIdentity
|
|
110
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-3GYZ5YEH.js";
|
|
111
116
|
import {
|
|
112
117
|
acquireActiveLock,
|
|
113
118
|
getStateAdapter
|
|
114
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-25SC7D6Z.js";
|
|
115
120
|
import {
|
|
116
|
-
FUNCTION_TIMEOUT_BUFFER_SECONDS,
|
|
117
121
|
botConfig,
|
|
118
122
|
escapeXml,
|
|
119
123
|
getChatConfig,
|
|
120
124
|
getRuntimeMetadata,
|
|
121
125
|
normalizeSlackEmojiName,
|
|
122
126
|
standardModelId
|
|
123
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-32CXPIZE.js";
|
|
124
128
|
import {
|
|
125
129
|
discoverSkills
|
|
126
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-4JGM7FXO.js";
|
|
127
131
|
import {
|
|
128
132
|
pluginCatalogRuntime
|
|
129
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-X22XXSZA.js";
|
|
130
134
|
import {
|
|
131
135
|
buildOAuthTokenRequest,
|
|
132
136
|
hasRequiredOAuthScope,
|
|
133
137
|
parseOAuthTokenResponse
|
|
134
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-2JHKISQA.js";
|
|
135
139
|
import {
|
|
136
140
|
createSlackResumeActor,
|
|
137
141
|
isUserActor
|
|
@@ -149,7 +153,7 @@ import {
|
|
|
149
153
|
setTags,
|
|
150
154
|
toOptionalString,
|
|
151
155
|
withLogContext
|
|
152
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-RLVZIWNQ.js";
|
|
153
157
|
import {
|
|
154
158
|
homeDir
|
|
155
159
|
} from "./chunk-H4HBKISO.js";
|
|
@@ -1076,33 +1080,6 @@ function buildAuthPauseResponse(slackUserId, providerDisplayName, requestText) {
|
|
|
1076
1080
|
I sent you a link.`;
|
|
1077
1081
|
}
|
|
1078
1082
|
|
|
1079
|
-
// src/chat/runtime/request-deadline.ts
|
|
1080
|
-
import { AsyncLocalStorage } from "async_hooks";
|
|
1081
|
-
var requestDeadlineStorage = new AsyncLocalStorage();
|
|
1082
|
-
function createTurnRequestDeadline(startedAtMs) {
|
|
1083
|
-
const requestBudgetMs = Math.max(
|
|
1084
|
-
1,
|
|
1085
|
-
getChatConfig().functionMaxDurationSeconds * 1e3 - FUNCTION_TIMEOUT_BUFFER_SECONDS * 1e3
|
|
1086
|
-
);
|
|
1087
|
-
return {
|
|
1088
|
-
startedAtMs,
|
|
1089
|
-
deadlineAtMs: startedAtMs + requestBudgetMs
|
|
1090
|
-
};
|
|
1091
|
-
}
|
|
1092
|
-
function getTurnRequestDeadline() {
|
|
1093
|
-
return requestDeadlineStorage.getStore();
|
|
1094
|
-
}
|
|
1095
|
-
function runWithTurnRequestDeadline(callback, startedAtMs = Date.now()) {
|
|
1096
|
-
const existingDeadline = requestDeadlineStorage.getStore();
|
|
1097
|
-
if (existingDeadline) {
|
|
1098
|
-
return callback();
|
|
1099
|
-
}
|
|
1100
|
-
return requestDeadlineStorage.run(
|
|
1101
|
-
createTurnRequestDeadline(startedAtMs),
|
|
1102
|
-
callback
|
|
1103
|
-
);
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
1083
|
// src/chat/runtime/slack-resume.ts
|
|
1107
1084
|
function resolveReplyTimeoutMs(explicitTimeoutMs) {
|
|
1108
1085
|
if (typeof explicitTimeoutMs === "number" && explicitTimeoutMs > 0) {
|
|
@@ -1436,15 +1413,17 @@ async function resumeSlackTurnInContext(args) {
|
|
|
1436
1413
|
}
|
|
1437
1414
|
failureCode = "delivery_failed";
|
|
1438
1415
|
const deliveryState2 = await getDeliveryConversation();
|
|
1439
|
-
let slackMessageTs;
|
|
1416
|
+
let slackMessageTs = [];
|
|
1440
1417
|
try {
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1418
|
+
if (runArgs.replyContext?.routing.publishExternally !== false) {
|
|
1419
|
+
slackMessageTs = await sendSlackReply({
|
|
1420
|
+
channelId: runArgs.channelId,
|
|
1421
|
+
conversationId: runArgs.conversationId,
|
|
1422
|
+
replyAttribution: runArgs.replyContext?.routing.dispatch?.replyAttribution,
|
|
1423
|
+
text,
|
|
1424
|
+
threadTs: runArgs.threadTs
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1448
1427
|
} catch (error) {
|
|
1449
1428
|
if (isRetryableSlackPostError(error)) {
|
|
1450
1429
|
throw new RetryableDeliveryError(error);
|
|
@@ -3185,8 +3164,6 @@ export {
|
|
|
3185
3164
|
shouldKeepProcessingReactionForToolInvocation,
|
|
3186
3165
|
startSlackProcessingReaction,
|
|
3187
3166
|
buildAuthPauseResponse,
|
|
3188
|
-
getTurnRequestDeadline,
|
|
3189
|
-
runWithTurnRequestDeadline,
|
|
3190
3167
|
resumeSlackTurn,
|
|
3191
3168
|
getPausedTurnRequest,
|
|
3192
3169
|
wakePausedTurn,
|
|
@@ -4,30 +4,30 @@ import {
|
|
|
4
4
|
isConversationScopedChannel,
|
|
5
5
|
isDmChannel,
|
|
6
6
|
normalizeSlackConversationId
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SWHPVZBV.js";
|
|
8
8
|
import {
|
|
9
9
|
getConversationEventStore,
|
|
10
10
|
getDb
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-3GYZ5YEH.js";
|
|
12
12
|
import {
|
|
13
13
|
juniorConversationAnnotations,
|
|
14
14
|
juniorConversationEvents,
|
|
15
15
|
juniorIdentities,
|
|
16
16
|
juniorUsers
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-3I2IVWSZ.js";
|
|
18
18
|
import {
|
|
19
19
|
SANDBOX_WORKSPACE_ROOT
|
|
20
20
|
} from "./chunk-EM225ITJ.js";
|
|
21
21
|
import {
|
|
22
22
|
getStateAdapter
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-25SC7D6Z.js";
|
|
24
24
|
import {
|
|
25
25
|
botConfig,
|
|
26
26
|
completeObject,
|
|
27
27
|
embedTexts,
|
|
28
28
|
getSlackBotToken,
|
|
29
29
|
standardModelId
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-32CXPIZE.js";
|
|
31
31
|
import {
|
|
32
32
|
isActorUserId,
|
|
33
33
|
parseActorUserId
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
logInfo,
|
|
43
43
|
logWarn,
|
|
44
44
|
normalizeIdentityEmail
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-RLVZIWNQ.js";
|
|
46
46
|
|
|
47
47
|
// src/chat/plugins/agent-hooks.ts
|
|
48
48
|
import {
|
|
@@ -460,7 +460,7 @@ function createResourceEventTeamIdResolver() {
|
|
|
460
460
|
};
|
|
461
461
|
}
|
|
462
462
|
|
|
463
|
-
// src/chat/slack/
|
|
463
|
+
// src/chat/slack/tool-support/context.ts
|
|
464
464
|
function getSlackToolContext(context) {
|
|
465
465
|
if (context.source.platform !== "slack") {
|
|
466
466
|
return void 0;
|
|
@@ -740,7 +740,7 @@ function verifyEventTaskCredentialSubject(input) {
|
|
|
740
740
|
return timingSafeMatch(expected, binding.signature);
|
|
741
741
|
}
|
|
742
742
|
|
|
743
|
-
// src/chat/slack/
|
|
743
|
+
// src/chat/slack/tool-support/channel-capabilities.ts
|
|
744
744
|
function resolveChannelCapabilities(channelId) {
|
|
745
745
|
return {
|
|
746
746
|
canCreateCanvas: isConversationScopedChannel(channelId),
|
|
@@ -805,6 +805,40 @@ function systemPromptPluginContext(plugin) {
|
|
|
805
805
|
...basePluginContext(plugin)
|
|
806
806
|
};
|
|
807
807
|
}
|
|
808
|
+
function pluginInvocationContext(context) {
|
|
809
|
+
const common = { conversationId: context.conversationId };
|
|
810
|
+
switch (context.source.platform) {
|
|
811
|
+
case "slack": {
|
|
812
|
+
if (context.destination.platform !== "slack") {
|
|
813
|
+
throw new TypeError("Slack plugin context requires Slack destination");
|
|
814
|
+
}
|
|
815
|
+
return {
|
|
816
|
+
...common,
|
|
817
|
+
actor: context.actor?.platform === "slack" ? context.actor : void 0,
|
|
818
|
+
destination: context.destination,
|
|
819
|
+
source: context.source
|
|
820
|
+
};
|
|
821
|
+
}
|
|
822
|
+
case "local": {
|
|
823
|
+
if (context.destination.platform !== "local") {
|
|
824
|
+
throw new TypeError("Local plugin context requires local destination");
|
|
825
|
+
}
|
|
826
|
+
return {
|
|
827
|
+
...common,
|
|
828
|
+
actor: context.actor?.platform === "local" ? context.actor : void 0,
|
|
829
|
+
destination: context.destination,
|
|
830
|
+
source: context.source
|
|
831
|
+
};
|
|
832
|
+
}
|
|
833
|
+
case "web":
|
|
834
|
+
return {
|
|
835
|
+
...common,
|
|
836
|
+
actor: context.actor?.platform === "web" ? context.actor : void 0,
|
|
837
|
+
destination: context.destination,
|
|
838
|
+
source: context.source
|
|
839
|
+
};
|
|
840
|
+
}
|
|
841
|
+
}
|
|
808
842
|
function invocationPluginContext(plugin, context, turnId) {
|
|
809
843
|
const base = basePluginContext(plugin);
|
|
810
844
|
const common = {
|
|
@@ -824,27 +858,9 @@ function invocationPluginContext(plugin, context, turnId) {
|
|
|
824
858
|
text: context.userText ?? "",
|
|
825
859
|
state: createPluginState(plugin.manifest.name)
|
|
826
860
|
};
|
|
827
|
-
if (context.source.platform === "slack") {
|
|
828
|
-
if (context.destination.platform !== "slack") {
|
|
829
|
-
throw new TypeError(
|
|
830
|
-
"Slack plugin prompt context requires Slack destination"
|
|
831
|
-
);
|
|
832
|
-
}
|
|
833
|
-
return {
|
|
834
|
-
...common,
|
|
835
|
-
destination: context.destination,
|
|
836
|
-
actor: context.actor?.platform === "slack" ? context.actor : void 0
|
|
837
|
-
};
|
|
838
|
-
}
|
|
839
|
-
if (context.destination.platform !== "local") {
|
|
840
|
-
throw new TypeError(
|
|
841
|
-
"Local plugin prompt context requires local destination"
|
|
842
|
-
);
|
|
843
|
-
}
|
|
844
861
|
return {
|
|
845
862
|
...common,
|
|
846
|
-
|
|
847
|
-
actor: context.actor?.platform === "local" ? context.actor : void 0
|
|
863
|
+
...pluginInvocationContext(context)
|
|
848
864
|
};
|
|
849
865
|
}
|
|
850
866
|
function pluginMcpContext(plugin, context) {
|
|
@@ -990,7 +1006,8 @@ async function getPluginSystemPromptContributions(source) {
|
|
|
990
1006
|
try {
|
|
991
1007
|
const pluginContributions = await hook({
|
|
992
1008
|
...systemPromptPluginContext(plugin),
|
|
993
|
-
|
|
1009
|
+
// Plugin system prompts only distinguish Slack vs non-Slack surfaces.
|
|
1010
|
+
platform: source.platform === "slack" ? "slack" : "local"
|
|
994
1011
|
});
|
|
995
1012
|
const result = systemPromptMessageArraySchema.safeParse(pluginContributions);
|
|
996
1013
|
if (!result.success) {
|
|
@@ -1127,54 +1144,53 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
|
|
|
1127
1144
|
canSubscribe: context.source.platform === "slack" && canRouteResourceEvents()
|
|
1128
1145
|
};
|
|
1129
1146
|
const resolveActor = context.resolveActorIdentity ?? (async () => void 0);
|
|
1147
|
+
const common = {
|
|
1148
|
+
...basePluginContext(plugin),
|
|
1149
|
+
...annotations ? { annotations } : {},
|
|
1150
|
+
conversationId: context.conversationId,
|
|
1151
|
+
userText: context.userText,
|
|
1152
|
+
embedder: createPluginEmbedder(pluginName),
|
|
1153
|
+
egress: context.egress,
|
|
1154
|
+
...mcp ? { mcp } : {},
|
|
1155
|
+
model: createPluginModel(pluginName, plugin.model),
|
|
1156
|
+
resourceEvents,
|
|
1157
|
+
sandbox,
|
|
1158
|
+
state: createPluginState(pluginName),
|
|
1159
|
+
users: { resolveActor }
|
|
1160
|
+
};
|
|
1130
1161
|
let pluginContext;
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
"Slack plugin
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
"
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
actor: context.actor?.platform === "local" ? context.actor : void 0,
|
|
1164
|
-
conversationId: context.conversationId,
|
|
1165
|
-
...annotations ? { annotations } : {},
|
|
1166
|
-
destination: context.destination,
|
|
1167
|
-
source: context.source,
|
|
1168
|
-
userText: context.userText,
|
|
1169
|
-
embedder: createPluginEmbedder(pluginName),
|
|
1170
|
-
egress: context.egress,
|
|
1171
|
-
...mcp ? { mcp } : {},
|
|
1172
|
-
model: createPluginModel(pluginName, plugin.model),
|
|
1173
|
-
resourceEvents,
|
|
1174
|
-
sandbox,
|
|
1175
|
-
state: createPluginState(pluginName),
|
|
1176
|
-
users: { resolveActor }
|
|
1177
|
-
};
|
|
1162
|
+
switch (context.source.platform) {
|
|
1163
|
+
case "slack":
|
|
1164
|
+
if (context.destination.platform !== "slack") {
|
|
1165
|
+
throw new TypeError("Slack plugin context requires Slack destination");
|
|
1166
|
+
}
|
|
1167
|
+
pluginContext = {
|
|
1168
|
+
...common,
|
|
1169
|
+
actor: context.actor?.platform === "slack" ? context.actor : void 0,
|
|
1170
|
+
destination: context.destination,
|
|
1171
|
+
slack: slackContext,
|
|
1172
|
+
source: context.source
|
|
1173
|
+
};
|
|
1174
|
+
break;
|
|
1175
|
+
case "local":
|
|
1176
|
+
if (context.destination.platform !== "local") {
|
|
1177
|
+
throw new TypeError("Local plugin context requires local destination");
|
|
1178
|
+
}
|
|
1179
|
+
pluginContext = {
|
|
1180
|
+
...common,
|
|
1181
|
+
actor: context.actor?.platform === "local" ? context.actor : void 0,
|
|
1182
|
+
destination: context.destination,
|
|
1183
|
+
source: context.source
|
|
1184
|
+
};
|
|
1185
|
+
break;
|
|
1186
|
+
case "web":
|
|
1187
|
+
pluginContext = {
|
|
1188
|
+
...common,
|
|
1189
|
+
actor: context.actor?.platform === "web" ? context.actor : void 0,
|
|
1190
|
+
destination: context.destination,
|
|
1191
|
+
source: context.source
|
|
1192
|
+
};
|
|
1193
|
+
break;
|
|
1178
1194
|
}
|
|
1179
1195
|
const pluginTools = hook(pluginContext);
|
|
1180
1196
|
const namespace = pluginToolNamespace(pluginName);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAndEnqueueAgentInvocation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-W7UONUIZ.js";
|
|
4
4
|
import {
|
|
5
5
|
actorFromRouting,
|
|
6
6
|
toolInvocationDestination
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GDFF3BQG.js";
|
|
8
8
|
|
|
9
9
|
// src/chat/agent-invocations/spawn.ts
|
|
10
10
|
function bindSpawnAgent(request, options) {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getTurnUserMessageId
|
|
3
|
+
} from "./chunk-UZGASGOD.js";
|
|
4
|
+
import {
|
|
5
|
+
coerceThreadConversationState,
|
|
6
|
+
getPersistedThreadState,
|
|
7
|
+
persistThreadStateById
|
|
8
|
+
} from "./chunk-4YKPOYRV.js";
|
|
9
|
+
import {
|
|
10
|
+
hydrateConversationMessages,
|
|
11
|
+
markConversationMessage,
|
|
12
|
+
markTurnClosed
|
|
13
|
+
} from "./chunk-EW2LNCRL.js";
|
|
14
|
+
|
|
15
|
+
// src/chat/runtime/auth-pause-state.ts
|
|
16
|
+
function completeAuthPauseTurn(args) {
|
|
17
|
+
markConversationMessage(
|
|
18
|
+
args.conversation,
|
|
19
|
+
getTurnUserMessageId(args.conversation, args.sessionId),
|
|
20
|
+
{
|
|
21
|
+
replied: true,
|
|
22
|
+
skippedReason: void 0
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
markTurnClosed({
|
|
26
|
+
conversation: args.conversation,
|
|
27
|
+
nowMs: Date.now(),
|
|
28
|
+
sessionId: args.sessionId
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
async function persistAuthPauseTurnState(args) {
|
|
32
|
+
const currentState = await getPersistedThreadState(args.threadStateId);
|
|
33
|
+
const conversation = coerceThreadConversationState(currentState);
|
|
34
|
+
await hydrateConversationMessages({
|
|
35
|
+
conversation,
|
|
36
|
+
conversationId: args.threadStateId
|
|
37
|
+
});
|
|
38
|
+
completeAuthPauseTurn({
|
|
39
|
+
conversation,
|
|
40
|
+
sessionId: args.sessionId
|
|
41
|
+
});
|
|
42
|
+
await persistThreadStateById(args.threadStateId, { conversation });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export {
|
|
46
|
+
completeAuthPauseTurn,
|
|
47
|
+
persistAuthPauseTurnState
|
|
48
|
+
};
|