@sentry/junior 0.153.0 → 0.155.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-7BWOB7SN.js → agent-hooks-AWVTLAV2.js} +11 -12
- package/dist/api/conversations/list.d.ts +5 -3
- package/dist/api/conversations/membership.d.ts +16 -0
- package/dist/api/locations/detail.d.ts +1 -0
- package/dist/api/schema/conversation.d.ts +3 -0
- package/dist/api/schema/location.d.ts +1 -0
- package/dist/api/schema/person.d.ts +1 -0
- package/dist/api/schema.js +1 -1
- package/dist/api.js +318 -187
- package/dist/app.js +39 -39
- package/dist/catalog-runtime-V6YD6KH5.js +16 -0
- package/dist/chat/conversations/sql/event-actor.d.ts +14 -0
- package/dist/chat/conversations/sql/event-lock.d.ts +1 -1
- package/dist/chat/conversations/sql/participants.d.ts +17 -0
- package/dist/chat/plugins/unfinished-work.d.ts +2 -0
- package/dist/chat/runtime/agent-runner.d.ts +2 -0
- package/dist/chat/runtime/slack-resume.d.ts +1 -1
- package/dist/chat/state/conversation.d.ts +1 -0
- package/dist/{chunk-O2YXWWPM.js → chunk-2AHVM3HK.js} +92 -9
- package/dist/{chunk-VXWTGOLW.js → chunk-2WLJDM23.js} +1 -1
- package/dist/{chunk-4TWLKHOM.js → chunk-37G5HJ2X.js} +4 -4
- package/dist/{chunk-ISEROVYZ.js → chunk-4K5N6HTX.js} +5 -5
- package/dist/{chunk-ET54Q4TD.js → chunk-773XC7P4.js} +116 -82
- package/dist/{chunk-HUO3UTAQ.js → chunk-7MA4HV4W.js} +1 -1
- package/dist/{chunk-HMU2QP5M.js → chunk-7NYEB2TM.js} +1 -1
- package/dist/{chunk-URFV5RWN.js → chunk-AENPRXCG.js} +23 -56
- package/dist/{chunk-TIV3PX5H.js → chunk-APHDJYN7.js} +2 -2
- package/dist/{chunk-RUIXF3YQ.js → chunk-BDUENQD3.js} +1 -1
- package/dist/{chunk-5TXDKTET.js → chunk-CPQBTTI6.js} +7 -7
- package/dist/{chunk-A5SROS6H.js → chunk-ELOTIL5F.js} +5 -5
- package/dist/{chunk-JJAMURMR.js → chunk-EORR34UB.js} +1 -1
- package/dist/{chunk-5QBK3QHJ.js → chunk-J2SYI36O.js} +6 -8
- package/dist/{chunk-K4LK6KYO.js → chunk-J7MWZFFP.js} +4 -4
- package/dist/{chunk-COC65LIW.js → chunk-JFZBGFNX.js} +3 -1
- package/dist/{chunk-YECBSG77.js → chunk-JIC33O5L.js} +2 -2
- package/dist/{chunk-XAYXN4EG.js → chunk-JJX77MB7.js} +366 -138
- package/dist/{chunk-FLEY546A.js → chunk-KBT2I5ER.js} +7 -7
- package/dist/{chunk-37LMRT7G.js → chunk-KTVHAHUV.js} +1 -1
- package/dist/{chunk-PMJAY6JS.js → chunk-LQT3SWFA.js} +5 -5
- package/dist/{chunk-HYEAR6HL.js → chunk-MLBH7J7J.js} +1 -1
- package/dist/{chunk-5DMPHA4V.js → chunk-NKFRRZIT.js} +27 -37
- package/dist/{chunk-HOK7MEWG.js → chunk-NWSKFYOH.js} +1 -1
- package/dist/{chunk-JY2HJYJT.js → chunk-RN3AWYEP.js} +2 -2
- package/dist/{chunk-RKW5QGGN.js → chunk-RQ62VKM7.js} +1 -1
- package/dist/{chunk-XQPKMLRI.js → chunk-SDRJ2LE3.js} +1 -1
- package/dist/{chunk-JAJVUQV7.js → chunk-TKJ7277U.js} +3 -3
- package/dist/{chunk-EPOA52SD.js → chunk-TVXAN43I.js} +1 -1
- package/dist/{chunk-2NS3ACHB.js → chunk-UWTXAYBP.js} +11 -11
- package/dist/{chunk-2J4VCHRX.js → chunk-V57LZDHN.js} +8 -10
- package/dist/{chunk-HZF5P5UN.js → chunk-V7YE4WCP.js} +58 -7
- package/dist/{chunk-PGJBNO3I.js → chunk-XFZLQANQ.js} +2 -2
- package/dist/{chunk-5XBRH3N7.js → chunk-Y6MVGU7L.js} +12 -11
- package/dist/{chunk-WTKAALLV.js → chunk-Y7ZUBP2K.js} +6 -6
- package/dist/{chunk-UG5UCHHJ.js → chunk-ZLSFOSDK.js} +2 -1
- package/dist/cli/chat.js +36 -36
- package/dist/cli/check.js +8 -9
- package/dist/cli/init.js +41 -7
- package/dist/cli/plugins.js +15 -16
- package/dist/cli/snapshot-create.js +11 -12
- package/dist/cli/upgrade.js +9 -10
- package/dist/db/schema/conversation-events.d.ts +20 -0
- package/dist/db/schema/conversation-participants.d.ts +63 -0
- package/dist/db/schema.d.ts +77 -1
- package/dist/{db-QNQM5YRR.js → db-WT7P56AH.js} +8 -8
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-ERQPIR27.js → oauth-callback-server-R2PK2MCA.js} +26 -26
- package/dist/{runner-BX46SQIE.js → runner-O7YYUIHT.js} +15 -16
- package/dist/{sandbox-egress-signals-EKPAVWQL.js → sandbox-egress-signals-U3ZX7C5W.js} +3 -4
- package/dist/{skills-JL44EIRX.js → skills-S6HLQRH7.js} +8 -9
- package/dist/spawn-B4SBFFA2.js +37 -0
- package/dist/{validation-UU2AIJIY.js → validation-46WD2OAR.js} +8 -9
- package/dist/version.js +1 -1
- package/dist/{work-SS7RU5CH.js → work-YT5QUBS3.js} +20 -21
- package/dist/worker-4C5BEDWN.js +24 -0
- package/migrations/0026_conversation_event_actor_and_participants.sql +140 -0
- package/migrations/meta/0026_snapshot.json +2424 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +8 -6
- package/dist/catalog-runtime-CGUDNL3D.js +0 -17
- package/dist/chunk-F3B2YJ76.js +0 -57
- package/dist/spawn-W6FO32T4.js +0 -38
- package/dist/worker-5P2E7LVI.js +0 -25
|
@@ -4,28 +4,28 @@ import {
|
|
|
4
4
|
isDmChannel,
|
|
5
5
|
normalizeSlackConversationId,
|
|
6
6
|
withSlackRetries
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TKJ7277U.js";
|
|
8
8
|
import {
|
|
9
9
|
parseDestination
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JJX77MB7.js";
|
|
11
11
|
import {
|
|
12
12
|
getStateAdapter
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SDRJ2LE3.js";
|
|
14
14
|
import {
|
|
15
15
|
normalizeSlackEmojiName
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XFZLQANQ.js";
|
|
17
17
|
import {
|
|
18
18
|
pluginCatalogRuntime
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-TVXAN43I.js";
|
|
20
20
|
import {
|
|
21
21
|
parseSlackMessageTs,
|
|
22
22
|
parseSlackUserId
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-V7YE4WCP.js";
|
|
24
24
|
import {
|
|
25
25
|
isRecord,
|
|
26
26
|
logInfo,
|
|
27
27
|
logWarn
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-7NYEB2TM.js";
|
|
29
29
|
|
|
30
30
|
// src/chat/slack/outbound.ts
|
|
31
31
|
var MAX_SLACK_MESSAGE_TEXT_CHARS = 4e4;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ToolInputError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-J2SYI36O.js";
|
|
4
4
|
import {
|
|
5
5
|
canRouteResourceEvents,
|
|
6
6
|
getPlugins
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-V57LZDHN.js";
|
|
8
8
|
import {
|
|
9
9
|
getDb
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JJX77MB7.js";
|
|
11
11
|
import {
|
|
12
12
|
juniorEventTasks,
|
|
13
13
|
juniorSchedulerRuns,
|
|
14
14
|
juniorSchedulerTasks,
|
|
15
15
|
juniorStats
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-773XC7P4.js";
|
|
17
17
|
import {
|
|
18
18
|
juniorDestinations
|
|
19
19
|
} from "./chunk-VFUK3X5B.js";
|
|
20
20
|
import {
|
|
21
21
|
logInfo
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-7NYEB2TM.js";
|
|
23
23
|
|
|
24
24
|
// src/chat/event-tasks/store.ts
|
|
25
25
|
import { and, asc, desc, eq, inArray, or, sql } from "drizzle-orm";
|
|
@@ -3,15 +3,15 @@ import {
|
|
|
3
3
|
} from "./chunk-FA6POGLH.js";
|
|
4
4
|
import {
|
|
5
5
|
getTurnRequestDeadline
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NWSKFYOH.js";
|
|
7
7
|
import {
|
|
8
8
|
buildSentryConversationUrl,
|
|
9
9
|
deleteWebAuthorization
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KTVHAHUV.js";
|
|
11
11
|
import {
|
|
12
12
|
ensureConversationWake,
|
|
13
13
|
requestConversationWork
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ELOTIL5F.js";
|
|
15
15
|
import {
|
|
16
16
|
buildDeliveredTurnStatePatch,
|
|
17
17
|
finalizeFailedTurnReplyWithEvent,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
requireTurnFailureEventId,
|
|
25
25
|
resolveTurnSessionRouting,
|
|
26
26
|
scheduleSessionCompletedPluginTasks
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-UWTXAYBP.js";
|
|
28
28
|
import {
|
|
29
29
|
ConversationTurnLifecycleService,
|
|
30
30
|
coerceThreadConversationState,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
getPersistedSandboxState,
|
|
34
34
|
getPersistedThreadState,
|
|
35
35
|
persistThreadStateById
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-4K5N6HTX.js";
|
|
37
37
|
import {
|
|
38
38
|
getVercelConversationWorkQueue
|
|
39
39
|
} from "./chunk-WR76IVA5.js";
|
|
@@ -45,8 +45,9 @@ import {
|
|
|
45
45
|
getMcpProviderErrorAttributes,
|
|
46
46
|
getMcpStoredOAuthCredentials,
|
|
47
47
|
lookupSlackUserProfile,
|
|
48
|
-
resolvePluginOAuthAccount
|
|
49
|
-
|
|
48
|
+
resolvePluginOAuthAccount,
|
|
49
|
+
runAgentWithTimeout
|
|
50
|
+
} from "./chunk-2AHVM3HK.js";
|
|
50
51
|
import {
|
|
51
52
|
RetryableDeliveryError
|
|
52
53
|
} from "./chunk-RF6J3DIO.js";
|
|
@@ -62,13 +63,13 @@ import {
|
|
|
62
63
|
removeReactionFromMessage,
|
|
63
64
|
resolveBaseUrl,
|
|
64
65
|
truncateStatusText
|
|
65
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-KBT2I5ER.js";
|
|
66
67
|
import {
|
|
67
68
|
parseSlackThreadId,
|
|
68
69
|
readSlackRawMessageContext,
|
|
69
70
|
resolveSlackChannelIdFromMessage,
|
|
70
71
|
resolveSlackChannelIdFromThreadId
|
|
71
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-APHDJYN7.js";
|
|
72
73
|
import {
|
|
73
74
|
CooperativeTurnYieldError,
|
|
74
75
|
TurnSliceLimitExceededError,
|
|
@@ -95,29 +96,29 @@ import {
|
|
|
95
96
|
recordTurnSummary,
|
|
96
97
|
saveTurnCheckpoint,
|
|
97
98
|
turnHasReply
|
|
98
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-J2SYI36O.js";
|
|
99
100
|
import {
|
|
100
101
|
getDashboardConversationLink,
|
|
101
102
|
getPluginSlackConversationLink
|
|
102
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-V57LZDHN.js";
|
|
103
104
|
import {
|
|
104
105
|
SlackActionError,
|
|
105
106
|
getHeaderString,
|
|
106
107
|
getSlackClient,
|
|
107
108
|
isDmChannel,
|
|
108
109
|
normalizeSlackConversationId
|
|
109
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-TKJ7277U.js";
|
|
110
111
|
import {
|
|
111
112
|
getConversationEventStore,
|
|
112
113
|
getSqlExecutor,
|
|
113
114
|
requireSlackDestination,
|
|
114
115
|
upsertIdentity,
|
|
115
116
|
upsertLinkedIdentity
|
|
116
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-JJX77MB7.js";
|
|
117
118
|
import {
|
|
118
119
|
acquireActiveLock,
|
|
119
120
|
getStateAdapter
|
|
120
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-SDRJ2LE3.js";
|
|
121
122
|
import {
|
|
122
123
|
botConfig,
|
|
123
124
|
escapeXml,
|
|
@@ -125,26 +126,24 @@ import {
|
|
|
125
126
|
getRuntimeMetadata,
|
|
126
127
|
normalizeSlackEmojiName,
|
|
127
128
|
standardModelId
|
|
128
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-XFZLQANQ.js";
|
|
129
130
|
import {
|
|
130
131
|
discoverSkills
|
|
131
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-JIC33O5L.js";
|
|
132
133
|
import {
|
|
133
134
|
pluginCatalogRuntime
|
|
134
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-TVXAN43I.js";
|
|
135
136
|
import {
|
|
136
137
|
buildOAuthTokenRequest,
|
|
137
138
|
hasRequiredOAuthScope,
|
|
138
139
|
parseOAuthTokenResponse
|
|
139
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-RN3AWYEP.js";
|
|
140
141
|
import {
|
|
141
142
|
createSlackResumeActor,
|
|
142
|
-
isUserActor
|
|
143
|
-
} from "./chunk-HZF5P5UN.js";
|
|
144
|
-
import {
|
|
143
|
+
isUserActor,
|
|
145
144
|
parseSlackMessageTs,
|
|
146
145
|
parseSlackUserId
|
|
147
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-V7YE4WCP.js";
|
|
148
147
|
import {
|
|
149
148
|
buildTurnFailureResponse,
|
|
150
149
|
logException,
|
|
@@ -154,7 +153,7 @@ import {
|
|
|
154
153
|
setTags,
|
|
155
154
|
toOptionalString,
|
|
156
155
|
withLogContext
|
|
157
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-7NYEB2TM.js";
|
|
158
157
|
import {
|
|
159
158
|
homeDir
|
|
160
159
|
} from "./chunk-H4HBKISO.js";
|
|
@@ -1512,21 +1511,12 @@ async function resumeSlackTurnInContext(args) {
|
|
|
1512
1511
|
surface: "slack"
|
|
1513
1512
|
});
|
|
1514
1513
|
}
|
|
1515
|
-
const replyPromise = runArgs.agentRunner.run(replyContext);
|
|
1516
1514
|
const replyTimeoutMs = resolveReplyTimeoutMs(runArgs.replyTimeoutMs);
|
|
1517
|
-
const outcome =
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
new Error(
|
|
1523
|
-
`executeAgentRun timed out after ${replyTimeoutMs}ms`
|
|
1524
|
-
)
|
|
1525
|
-
),
|
|
1526
|
-
replyTimeoutMs
|
|
1527
|
-
)
|
|
1528
|
-
)
|
|
1529
|
-
]) : await replyPromise;
|
|
1515
|
+
const outcome = await runAgentWithTimeout(
|
|
1516
|
+
runArgs.agentRunner,
|
|
1517
|
+
replyContext,
|
|
1518
|
+
replyTimeoutMs
|
|
1519
|
+
);
|
|
1530
1520
|
if (outcome.status !== "completed") {
|
|
1531
1521
|
await status.clear();
|
|
1532
1522
|
const onAuthPause = runArgs.onAuthPause;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
credentialUserSubjectId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BDUENQD3.js";
|
|
4
4
|
import {
|
|
5
5
|
logInfo,
|
|
6
6
|
logWarn,
|
|
7
7
|
setSpanAttributes
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-7NYEB2TM.js";
|
|
9
9
|
import {
|
|
10
10
|
discoverInstalledPluginPackageContent,
|
|
11
11
|
normalizePluginPackageNames
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
} from "./chunk-EM225ITJ.js";
|
|
4
4
|
import {
|
|
5
5
|
getSlackBotToken
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XFZLQANQ.js";
|
|
7
7
|
import {
|
|
8
8
|
parseSlackChannelReferenceId
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-V7YE4WCP.js";
|
|
10
10
|
import {
|
|
11
11
|
logWarn,
|
|
12
12
|
setSpanAttributes,
|
|
13
13
|
setSpanStatus,
|
|
14
14
|
withSpan
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-7NYEB2TM.js";
|
|
16
16
|
|
|
17
17
|
// src/chat/slack/client.ts
|
|
18
18
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
coerceThreadConversationState,
|
|
3
3
|
getPersistedThreadState,
|
|
4
4
|
persistThreadStateById
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4K5N6HTX.js";
|
|
6
6
|
import {
|
|
7
7
|
pluginTaskId,
|
|
8
8
|
pluginTaskParamsSchema,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
markTurnCompleted,
|
|
23
23
|
normalizeToolNameFromResult,
|
|
24
24
|
stripRuntimeTurnContext
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-J2SYI36O.js";
|
|
26
26
|
import {
|
|
27
27
|
JUNIOR_THREAD_STATE_TTL_MS
|
|
28
28
|
} from "./chunk-3Y47VMHV.js";
|
|
@@ -33,35 +33,35 @@ import {
|
|
|
33
33
|
createPluginModel,
|
|
34
34
|
createPluginState,
|
|
35
35
|
getPlugins
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-V57LZDHN.js";
|
|
37
37
|
import {
|
|
38
38
|
getConversationStore,
|
|
39
39
|
getDb,
|
|
40
40
|
sameActorIdentity
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-JJX77MB7.js";
|
|
42
42
|
import {
|
|
43
43
|
juniorConversations,
|
|
44
44
|
juniorTaskExecutions
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-773XC7P4.js";
|
|
46
46
|
import {
|
|
47
47
|
getStateAdapter
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-SDRJ2LE3.js";
|
|
49
49
|
import {
|
|
50
50
|
ProviderError,
|
|
51
51
|
findProviderError,
|
|
52
52
|
getProviderErrorAttributes,
|
|
53
53
|
getProviderErrorUserMessage
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-XFZLQANQ.js";
|
|
55
55
|
import {
|
|
56
56
|
credentialSubjectSchema
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-BDUENQD3.js";
|
|
58
58
|
import {
|
|
59
59
|
parseSlackMessageTs
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-V7YE4WCP.js";
|
|
61
61
|
import {
|
|
62
62
|
buildTurnFailureResponse,
|
|
63
63
|
logWarn
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-7NYEB2TM.js";
|
|
65
65
|
|
|
66
66
|
// src/chat/runtime/delivered-turn-state.ts
|
|
67
67
|
function buildDeliveredTurnStatePatch(args) {
|
|
@@ -87,7 +87,7 @@ import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
|
|
|
87
87
|
|
|
88
88
|
// src/chat/services/turn-session-routing.ts
|
|
89
89
|
async function resolveTurnSessionRouting(args) {
|
|
90
|
-
const conversationStore = args.conversationStore ?? (await import("./db-
|
|
90
|
+
const conversationStore = args.conversationStore ?? (await import("./db-WT7P56AH.js")).getConversationStore();
|
|
91
91
|
const conversation = await conversationStore.get({
|
|
92
92
|
conversationId: args.conversationId
|
|
93
93
|
});
|
|
@@ -4,45 +4,43 @@ import {
|
|
|
4
4
|
isConversationScopedChannel,
|
|
5
5
|
isDmChannel,
|
|
6
6
|
normalizeSlackConversationId
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TKJ7277U.js";
|
|
8
8
|
import {
|
|
9
9
|
getConversationEventStore,
|
|
10
10
|
getDb
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JJX77MB7.js";
|
|
12
12
|
import {
|
|
13
13
|
juniorConversationAnnotations,
|
|
14
14
|
juniorConversationEvents,
|
|
15
15
|
juniorIdentities,
|
|
16
16
|
juniorUsers
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-773XC7P4.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-SDRJ2LE3.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-XFZLQANQ.js";
|
|
31
31
|
import {
|
|
32
32
|
isActorUserId,
|
|
33
|
-
parseActorUserId
|
|
34
|
-
} from "./chunk-HZF5P5UN.js";
|
|
35
|
-
import {
|
|
33
|
+
parseActorUserId,
|
|
36
34
|
parseSlackChannelReferenceId,
|
|
37
35
|
parseSlackMessageTs,
|
|
38
36
|
parseSlackTeamId
|
|
39
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-V7YE4WCP.js";
|
|
40
38
|
import {
|
|
41
39
|
logException,
|
|
42
40
|
logInfo,
|
|
43
41
|
logWarn,
|
|
44
42
|
normalizeIdentityEmail
|
|
45
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-7NYEB2TM.js";
|
|
46
44
|
|
|
47
45
|
// src/chat/plugins/agent-hooks.ts
|
|
48
46
|
import {
|
|
@@ -1,17 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// src/chat/slack/timestamp.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var slackMessageTsSchema = z.string().trim().regex(/^\d+(?:\.\d+)?$/).brand();
|
|
4
|
+
function parseSlackMessageTs(value) {
|
|
5
|
+
const parsed = slackMessageTsSchema.safeParse(value);
|
|
6
|
+
return parsed.success ? parsed.data : void 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// src/chat/slack/ids.ts
|
|
10
|
+
import { z as z2 } from "zod";
|
|
11
|
+
var slackChannelIdSchema = z2.string().regex(/^[CDG][A-Z0-9]+$/).brand();
|
|
12
|
+
var slackTeamIdSchema = z2.string().regex(/^T[A-Z0-9]+$/).brand();
|
|
13
|
+
var slackUserIdSchema = z2.string().regex(/^[UW][A-Z0-9]+$/).brand();
|
|
14
|
+
function slackChannelReferenceCandidate(value) {
|
|
15
|
+
const trimmed = value.trim();
|
|
16
|
+
if (!trimmed.startsWith("slack:")) {
|
|
17
|
+
return trimmed;
|
|
18
|
+
}
|
|
19
|
+
const parts = trimmed.split(":");
|
|
20
|
+
if (parts.length === 2) {
|
|
21
|
+
return parts[1]?.trim() ?? "";
|
|
22
|
+
}
|
|
23
|
+
if (parts.length === 3 && parseSlackMessageTs(parts[2])) {
|
|
24
|
+
return parts[1]?.trim() ?? "";
|
|
25
|
+
}
|
|
26
|
+
return "";
|
|
27
|
+
}
|
|
28
|
+
function parseSlackChannelId(value) {
|
|
29
|
+
if (typeof value !== "string") return void 0;
|
|
30
|
+
const parsed = slackChannelIdSchema.safeParse(value.trim());
|
|
31
|
+
return parsed.success ? parsed.data : void 0;
|
|
32
|
+
}
|
|
33
|
+
function parseSlackChannelReferenceId(value) {
|
|
34
|
+
if (typeof value !== "string") return void 0;
|
|
35
|
+
const parsed = slackChannelIdSchema.safeParse(
|
|
36
|
+
slackChannelReferenceCandidate(value)
|
|
37
|
+
);
|
|
38
|
+
return parsed.success ? parsed.data : void 0;
|
|
39
|
+
}
|
|
40
|
+
function parseSlackTeamId(value) {
|
|
41
|
+
if (typeof value !== "string") return void 0;
|
|
42
|
+
const parsed = slackTeamIdSchema.safeParse(value.trim());
|
|
43
|
+
return parsed.success ? parsed.data : void 0;
|
|
44
|
+
}
|
|
45
|
+
function parseSlackUserId(value) {
|
|
46
|
+
if (typeof value !== "string") return void 0;
|
|
47
|
+
const parsed = slackUserIdSchema.safeParse(value.trim());
|
|
48
|
+
return parsed.success ? parsed.data : void 0;
|
|
49
|
+
}
|
|
4
50
|
|
|
5
51
|
// src/chat/actor.ts
|
|
6
|
-
import { z } from "zod";
|
|
52
|
+
import { z as z3 } from "zod";
|
|
7
53
|
import { actorSchema } from "@sentry/junior-plugin-api";
|
|
8
54
|
var SLACK_USER_ID_DISPLAY_PATTERN = /^[UW][A-Z0-9]{5,}$/;
|
|
9
55
|
var EMAIL_PATTERN = /^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/;
|
|
10
|
-
var exactStoredStringSchema =
|
|
11
|
-
var storedSlackActorSchema =
|
|
56
|
+
var exactStoredStringSchema = z3.string().min(1).refine((value) => value === value.trim());
|
|
57
|
+
var storedSlackActorSchema = z3.object({
|
|
12
58
|
email: exactStoredStringSchema.optional(),
|
|
13
59
|
fullName: exactStoredStringSchema.optional(),
|
|
14
|
-
platform:
|
|
60
|
+
platform: z3.literal("slack").optional(),
|
|
15
61
|
slackUserId: exactStoredStringSchema.optional(),
|
|
16
62
|
slackUserName: exactStoredStringSchema.optional(),
|
|
17
63
|
teamId: exactStoredStringSchema.optional()
|
|
@@ -170,6 +216,11 @@ function createSlackResumeActor(args) {
|
|
|
170
216
|
}
|
|
171
217
|
|
|
172
218
|
export {
|
|
219
|
+
parseSlackMessageTs,
|
|
220
|
+
parseSlackChannelId,
|
|
221
|
+
parseSlackChannelReferenceId,
|
|
222
|
+
parseSlackTeamId,
|
|
223
|
+
parseSlackUserId,
|
|
173
224
|
isUserActor,
|
|
174
225
|
parseActorUserId,
|
|
175
226
|
isActorUserId,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
toCanonicalInputMessage,
|
|
4
4
|
toCanonicalOutputMessage,
|
|
5
5
|
toGenAiMessagesTraceAttributes
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2WLJDM23.js";
|
|
7
7
|
import {
|
|
8
8
|
extractGenAiUsageAttributes,
|
|
9
9
|
logException,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
normalizeGenAiFinishReason,
|
|
12
12
|
serializeGenAiAttribute,
|
|
13
13
|
withSpan
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-7NYEB2TM.js";
|
|
15
15
|
|
|
16
16
|
// src/chat/services/provider-error.ts
|
|
17
17
|
var ProviderError = class extends Error {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWebAuthorization,
|
|
3
3
|
deleteWebAuthorization
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KTVHAHUV.js";
|
|
5
5
|
import {
|
|
6
6
|
appendAndEnqueueInboundMessage
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ELOTIL5F.js";
|
|
8
8
|
import {
|
|
9
9
|
buildDeliveredTurnStatePatch,
|
|
10
10
|
completeAuthPauseTurn,
|
|
@@ -12,20 +12,20 @@ import {
|
|
|
12
12
|
getTurnUserMessage,
|
|
13
13
|
processPluginTask,
|
|
14
14
|
scheduleSessionCompletedPluginTasks
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-UWTXAYBP.js";
|
|
16
16
|
import {
|
|
17
17
|
ConversationTurnLifecycleService,
|
|
18
18
|
coerceThreadConversationState,
|
|
19
19
|
getPersistedSandboxState,
|
|
20
20
|
getPersistedThreadState,
|
|
21
21
|
persistThreadStateById
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-4K5N6HTX.js";
|
|
23
23
|
import {
|
|
24
24
|
healthReportSchema
|
|
25
25
|
} from "./chunk-UTL3MHPC.js";
|
|
26
26
|
import {
|
|
27
27
|
parseSlackThreadId
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-APHDJYN7.js";
|
|
29
29
|
import {
|
|
30
30
|
TurnInputCommitLostError,
|
|
31
31
|
abandonTurnRecord,
|
|
@@ -48,26 +48,26 @@ import {
|
|
|
48
48
|
saveTurnCheckpoint,
|
|
49
49
|
startActiveTurn,
|
|
50
50
|
upsertConversationMessage
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-J2SYI36O.js";
|
|
52
52
|
import {
|
|
53
53
|
normalizeSlackConversationId
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-TKJ7277U.js";
|
|
55
55
|
import {
|
|
56
56
|
getConversationEventStore,
|
|
57
57
|
getConversationStore
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-JJX77MB7.js";
|
|
59
59
|
import {
|
|
60
60
|
getSlackBotToken
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-XFZLQANQ.js";
|
|
62
62
|
import {
|
|
63
63
|
credentialContextForActor
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-BDUENQD3.js";
|
|
65
65
|
import {
|
|
66
66
|
logException,
|
|
67
67
|
logWarn,
|
|
68
68
|
setTags,
|
|
69
69
|
withLogContext
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-7NYEB2TM.js";
|
|
71
71
|
|
|
72
72
|
// src/handlers/health.ts
|
|
73
73
|
function readHealthReport() {
|
|
@@ -561,6 +561,7 @@ function createApiTurnWorker(options) {
|
|
|
561
561
|
text: normalizeConversationText(text),
|
|
562
562
|
createdAtMs: startedAtMs,
|
|
563
563
|
author: {
|
|
564
|
+
...actor.email ? { email: actor.email } : {},
|
|
564
565
|
...actor.fullName ? { fullName: actor.fullName } : {},
|
|
565
566
|
userId: actor.userId,
|
|
566
567
|
...actor.userName ? { userName: actor.userName } : {}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
appendAndEnqueueInboundMessage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ELOTIL5F.js";
|
|
4
4
|
import {
|
|
5
5
|
ConversationTurnLifecycleService,
|
|
6
6
|
getPersistedSandboxState,
|
|
7
7
|
getPersistedThreadState,
|
|
8
8
|
persistThreadStateById
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4K5N6HTX.js";
|
|
10
10
|
import {
|
|
11
11
|
AgentInvocationBusyError,
|
|
12
12
|
AgentInvocationLimitError,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
agentBindingSchema,
|
|
16
16
|
agentInvocationSchema,
|
|
17
17
|
createAgentInvocationSchema
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-CPQBTTI6.js";
|
|
19
19
|
import {
|
|
20
20
|
TurnInputCommitLostError,
|
|
21
21
|
failTurnRecord,
|
|
@@ -26,16 +26,16 @@ import {
|
|
|
26
26
|
isTurnInputCommitLostError,
|
|
27
27
|
openConversationProjection,
|
|
28
28
|
saveTurnCheckpoint
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-J2SYI36O.js";
|
|
30
30
|
import {
|
|
31
31
|
getConversationEventStore,
|
|
32
32
|
getConversationStore,
|
|
33
33
|
getSqlExecutor
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-JJX77MB7.js";
|
|
35
35
|
import {
|
|
36
36
|
juniorAgentBindings,
|
|
37
37
|
juniorAgentInvocations
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-773XC7P4.js";
|
|
39
39
|
|
|
40
40
|
// src/chat/agent-invocations/work.ts
|
|
41
41
|
import { z } from "zod";
|