@sentry/junior 0.154.0 → 0.156.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-VEHV2QUA.js → agent-hooks-CCAR46PQ.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 +2 -0
- package/dist/api/schema/conversation.d.ts +22 -4
- package/dist/api/schema/location.d.ts +2 -0
- package/dist/api/schema/person.d.ts +2 -0
- package/dist/api/schema.js +1 -1
- package/dist/api.js +331 -188
- package/dist/app.js +154 -51
- package/dist/catalog-runtime-3SNKYCBG.js +16 -0
- package/dist/chat/agent/types.d.ts +2 -0
- package/dist/chat/attachments/storage.d.ts +12 -0
- package/dist/chat/attachments/store.d.ts +52 -0
- package/dist/chat/attachments/vercel.d.ts +3 -0
- package/dist/chat/conversations/retention.d.ts +4 -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/ingress/bot-mention.d.ts +13 -0
- package/dist/chat/plugins/unfinished-work.d.ts +8 -0
- package/dist/chat/runtime/agent-runner.d.ts +4 -0
- package/dist/chat/runtime/slack-resume.d.ts +1 -1
- package/dist/chat/services/conversation-memory.d.ts +1 -1
- package/dist/chat/slack/tools/send-files.d.ts +17 -11
- package/dist/chat/state/conversation.d.ts +3 -1
- package/dist/chat/tools/types.d.ts +2 -0
- package/dist/{chunk-XYMCZGH6.js → chunk-3FFUC32L.js} +8 -10
- package/dist/{chunk-4U4MNYGP.js → chunk-3L2PMOSR.js} +6 -8
- package/dist/{chunk-PTJ75ZWR.js → chunk-4ZZDTHFC.js} +94 -9
- package/dist/{chunk-DAJZZFU7.js → chunk-53W3LZEW.js} +386 -93
- package/dist/{chunk-F7QUK3YP.js → chunk-6CINHXIL.js} +5 -5
- package/dist/{chunk-6VWMX7NS.js → chunk-6JUU7J2B.js} +4 -4
- package/dist/{chunk-HUO3UTAQ.js → chunk-7MA4HV4W.js} +1 -1
- package/dist/{chunk-O4AQDOKA.js → chunk-7RAETIYO.js} +7 -7
- package/dist/{chunk-4R2XCKUH.js → chunk-A6WPDFHQ.js} +1 -1
- package/dist/{chunk-CZD6M57V.js → chunk-AIJRG227.js} +191 -126
- package/dist/{chunk-RUIXF3YQ.js → chunk-BDUENQD3.js} +1 -1
- package/dist/{chunk-NUG3VYHL.js → chunk-CK2H7CFO.js} +2 -2
- package/dist/{chunk-HOGJ6TBT.js → chunk-CN2XSVKF.js} +6 -6
- package/dist/{chunk-3567VGCN.js → chunk-EDJ64P2P.js} +1 -1
- package/dist/{chunk-6PJXR4BC.js → chunk-GKC43TLS.js} +2 -2
- package/dist/{chunk-A6LWN4K6.js → chunk-GSBPZHLQ.js} +11 -11
- package/dist/{chunk-Y654CTW2.js → chunk-IIO5PFZX.js} +366 -138
- package/dist/{chunk-F2Q3ZHW2.js → chunk-IZEBHYI4.js} +1 -1
- package/dist/{chunk-QGR6QTC4.js → chunk-JUJR6WTL.js} +4 -4
- package/dist/{chunk-ZQT4RHUO.js → chunk-KBGMYLSV.js} +4 -1
- package/dist/{chunk-DK2FSQHS.js → chunk-KCA5MKHU.js} +5 -5
- package/dist/{chunk-NNN2WYAD.js → chunk-MC57E5U5.js} +1 -1
- package/dist/{chunk-6AF5GOZA.js → chunk-MJE7XKWP.js} +1 -1
- package/dist/{chunk-7CPN5JTA.js → chunk-NTNU6T2D.js} +3 -3
- package/dist/{chunk-NG4IAOVD.js → chunk-OGZPRMZA.js} +1 -1
- package/dist/{chunk-UCH55IGZ.js → chunk-OMQJB7YN.js} +28 -37
- package/dist/{chunk-2XNVS6RC.js → chunk-PMFGVLDU.js} +12 -11
- package/dist/{chunk-65IAU2L2.js → chunk-SE3D225X.js} +1 -1
- package/dist/{chunk-CCAU73CE.js → chunk-SRJA6QLM.js} +2 -2
- package/dist/{chunk-7RFWIHPM.js → chunk-TN4LVILT.js} +5 -5
- package/dist/{chunk-3ZR2R5EQ.js → chunk-TNXGMFWV.js} +1 -1
- package/dist/{chunk-HZF5P5UN.js → chunk-V7YE4WCP.js} +58 -7
- package/dist/{chunk-MSOZLASC.js → chunk-WD7SEUZO.js} +2 -2
- package/dist/{chunk-UG5UCHHJ.js → chunk-X5NZQH5U.js} +4 -2
- package/dist/{chunk-3HX67UPN.js → chunk-X7W45B5G.js} +1 -1
- package/dist/{chunk-FVY7AJ46.js → chunk-ZNWRYNCA.js} +7 -7
- 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/attachments.d.ts +178 -0
- 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 +255 -1
- package/dist/{db-SOJJLMJK.js → db-TYUUKGJX.js} +8 -8
- package/dist/handlers/retention.d.ts +4 -1
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-GCJROMVO.js → oauth-callback-server-AWVDKPR5.js} +26 -26
- package/dist/{runner-SY6KDQCN.js → runner-JUQXMACC.js} +15 -16
- package/dist/{sandbox-egress-signals-EKPAVWQL.js → sandbox-egress-signals-U3ZX7C5W.js} +3 -4
- package/dist/{skills-XJ2LJ2ML.js → skills-4GZTZX4V.js} +8 -9
- package/dist/spawn-32SSRWU4.js +37 -0
- package/dist/{validation-XQWY6QRY.js → validation-DRLNJRND.js} +8 -9
- package/dist/version.js +1 -1
- package/dist/{work-FFT5JAOU.js → work-TGIXRRJY.js} +20 -21
- package/dist/worker-IFXZOYED.js +24 -0
- package/migrations/0026_conversation_event_actor_and_participants.sql +140 -0
- package/migrations/0027_attachment_storage.sql +16 -0
- package/migrations/meta/0026_snapshot.json +2424 -0
- package/migrations/meta/0027_snapshot.json +2554 -0
- package/migrations/meta/_journal.json +15 -1
- package/package.json +10 -7
- package/dist/catalog-runtime-AK5MY63F.js +0 -17
- package/dist/chunk-F3B2YJ76.js +0 -57
- package/dist/spawn-QFCQREEP.js +0 -38
- package/dist/worker-JAITK72F.js +0 -25
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getTurnRequestDeadline
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-A6WPDFHQ.js";
|
|
4
4
|
import {
|
|
5
5
|
CONVERSATION_WORK_CHECK_IN_INTERVAL_MS,
|
|
6
6
|
CONVERSATION_WORK_MAX_RETRIES,
|
|
@@ -21,20 +21,20 @@ import {
|
|
|
21
21
|
releaseConversationWork,
|
|
22
22
|
requestAnotherSlice,
|
|
23
23
|
startConversationWork
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-6CINHXIL.js";
|
|
25
25
|
import {
|
|
26
26
|
ConversationQueueMessageRejectedError
|
|
27
27
|
} from "./chunk-JAL3CH4G.js";
|
|
28
28
|
import {
|
|
29
29
|
getChatConfig,
|
|
30
30
|
isProviderRetryError
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-GKC43TLS.js";
|
|
32
32
|
import {
|
|
33
33
|
logException,
|
|
34
34
|
logInfo,
|
|
35
35
|
logWarn,
|
|
36
36
|
withLogContext
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-X7W45B5G.js";
|
|
38
38
|
|
|
39
39
|
// src/chat/task-execution/worker.ts
|
|
40
40
|
var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "@sentry/junior",
|
|
4
|
-
version: "0.
|
|
4
|
+
version: "0.156.0",
|
|
5
5
|
private: false,
|
|
6
6
|
publishConfig: {
|
|
7
7
|
access: "public"
|
|
@@ -77,10 +77,13 @@ var package_default = {
|
|
|
77
77
|
"@logtape/logtape": "^2.1.1",
|
|
78
78
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
79
79
|
"@neondatabase/serverless": "^1.1.0",
|
|
80
|
+
"@opentelemetry/api": "catalog:",
|
|
81
|
+
"@opentelemetry/core": "catalog:",
|
|
80
82
|
"@sentry/junior-plugin-api": "workspace:*",
|
|
81
83
|
"@sentry/node": "catalog:",
|
|
82
84
|
"@sinclair/typebox": "^0.34.49",
|
|
83
85
|
"@slack/web-api": "^7.16.0",
|
|
86
|
+
"@vercel/blob": "^2.4.0",
|
|
84
87
|
"@vercel/functions": "^3.6.0",
|
|
85
88
|
"@vercel/oidc": "^3.4.1",
|
|
86
89
|
"@vercel/queue": "^0.2.0",
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ToolInputError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3L2PMOSR.js";
|
|
4
4
|
import {
|
|
5
5
|
canRouteResourceEvents,
|
|
6
6
|
getPlugins
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3FFUC32L.js";
|
|
8
8
|
import {
|
|
9
9
|
getDb
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IIO5PFZX.js";
|
|
11
11
|
import {
|
|
12
12
|
juniorEventTasks,
|
|
13
13
|
juniorSchedulerRuns,
|
|
14
14
|
juniorSchedulerTasks,
|
|
15
15
|
juniorStats
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AIJRG227.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-X7W45B5G.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,16 +3,16 @@ import {
|
|
|
3
3
|
} from "./chunk-EM225ITJ.js";
|
|
4
4
|
import {
|
|
5
5
|
getSlackBotToken
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GKC43TLS.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-X7W45B5G.js";
|
|
16
16
|
|
|
17
17
|
// src/chat/slack/client.ts
|
|
18
18
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
|
|
@@ -3,15 +3,15 @@ import {
|
|
|
3
3
|
} from "./chunk-FA6POGLH.js";
|
|
4
4
|
import {
|
|
5
5
|
getTurnRequestDeadline
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-A6WPDFHQ.js";
|
|
7
7
|
import {
|
|
8
8
|
buildSentryConversationUrl,
|
|
9
9
|
deleteWebAuthorization
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SE3D225X.js";
|
|
11
11
|
import {
|
|
12
12
|
ensureConversationWake,
|
|
13
13
|
requestConversationWork
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-6CINHXIL.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-GSBPZHLQ.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-TN4LVILT.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-4ZZDTHFC.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-7RAETIYO.js";
|
|
66
67
|
import {
|
|
67
68
|
parseSlackThreadId,
|
|
68
69
|
readSlackRawMessageContext,
|
|
69
70
|
resolveSlackChannelIdFromMessage,
|
|
70
71
|
resolveSlackChannelIdFromThreadId
|
|
71
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-CK2H7CFO.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-3L2PMOSR.js";
|
|
99
100
|
import {
|
|
100
101
|
getDashboardConversationLink,
|
|
101
102
|
getPluginSlackConversationLink
|
|
102
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-3FFUC32L.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-NTNU6T2D.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-IIO5PFZX.js";
|
|
117
118
|
import {
|
|
118
119
|
acquireActiveLock,
|
|
119
120
|
getStateAdapter
|
|
120
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-MC57E5U5.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-GKC43TLS.js";
|
|
129
130
|
import {
|
|
130
131
|
discoverSkills
|
|
131
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-SRJA6QLM.js";
|
|
132
133
|
import {
|
|
133
134
|
pluginCatalogRuntime
|
|
134
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-EDJ64P2P.js";
|
|
135
136
|
import {
|
|
136
137
|
buildOAuthTokenRequest,
|
|
137
138
|
hasRequiredOAuthScope,
|
|
138
139
|
parseOAuthTokenResponse
|
|
139
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-WD7SEUZO.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-X7W45B5G.js";
|
|
158
157
|
import {
|
|
159
158
|
homeDir
|
|
160
159
|
} from "./chunk-H4HBKISO.js";
|
|
@@ -1433,6 +1432,7 @@ async function resumeSlackTurnInContext(args) {
|
|
|
1433
1432
|
const recordedMessageId = recordDeliveredAssistantMessage({
|
|
1434
1433
|
conversation: deliveryState2.conversation,
|
|
1435
1434
|
sessionId: deliveryState2.sessionId,
|
|
1435
|
+
source: "slack",
|
|
1436
1436
|
text,
|
|
1437
1437
|
userMessageId: deliveryState2.userMessageId
|
|
1438
1438
|
});
|
|
@@ -1512,21 +1512,12 @@ async function resumeSlackTurnInContext(args) {
|
|
|
1512
1512
|
surface: "slack"
|
|
1513
1513
|
});
|
|
1514
1514
|
}
|
|
1515
|
-
const replyPromise = runArgs.agentRunner.run(replyContext);
|
|
1516
1515
|
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;
|
|
1516
|
+
const outcome = await runAgentWithTimeout(
|
|
1517
|
+
runArgs.agentRunner,
|
|
1518
|
+
replyContext,
|
|
1519
|
+
replyTimeoutMs
|
|
1520
|
+
);
|
|
1530
1521
|
if (outcome.status !== "completed") {
|
|
1531
1522
|
await status.clear();
|
|
1532
1523
|
const onAuthPause = runArgs.onAuthPause;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWebAuthorization,
|
|
3
3
|
deleteWebAuthorization
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SE3D225X.js";
|
|
5
5
|
import {
|
|
6
6
|
appendAndEnqueueInboundMessage
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6CINHXIL.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-GSBPZHLQ.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-TN4LVILT.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-CK2H7CFO.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-3L2PMOSR.js";
|
|
52
52
|
import {
|
|
53
53
|
normalizeSlackConversationId
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-NTNU6T2D.js";
|
|
55
55
|
import {
|
|
56
56
|
getConversationEventStore,
|
|
57
57
|
getConversationStore
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-IIO5PFZX.js";
|
|
59
59
|
import {
|
|
60
60
|
getSlackBotToken
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-GKC43TLS.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-X7W45B5G.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,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
persistConversationMessages
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3L2PMOSR.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-IIO5PFZX.js";
|
|
10
10
|
import {
|
|
11
11
|
juniorLocationConfigurations
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-AIJRG227.js";
|
|
13
13
|
import {
|
|
14
14
|
getStateAdapter
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-MC57E5U5.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-X7W45B5G.js";
|
|
24
24
|
|
|
25
25
|
// src/chat/conversations/turn-lifecycle.ts
|
|
26
26
|
var ConversationTurnLifecycleService = class {
|
|
@@ -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,
|
|
@@ -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-X7W45B5G.js";
|
|
9
9
|
import {
|
|
10
10
|
discoverInstalledPluginPackageContent,
|
|
11
11
|
normalizePluginPackageNames
|
|
@@ -174,13 +174,15 @@ var conversationSummaryReportSchema = z2.object({
|
|
|
174
174
|
locationId: z2.string().optional(),
|
|
175
175
|
sentryTraceUrl: z2.string().optional(),
|
|
176
176
|
sourceUrl: z2.string().url().optional(),
|
|
177
|
-
traceId: z2.string().optional()
|
|
177
|
+
traceId: z2.string().optional(),
|
|
178
|
+
assignedWork: z2.boolean().optional(),
|
|
179
|
+
unfinishedWork: z2.boolean().optional()
|
|
178
180
|
}).strict();
|
|
179
181
|
var conversationReportMessageEventDataSchema = z2.object({
|
|
180
182
|
type: z2.literal("message"),
|
|
181
183
|
messageId: z2.string().min(1),
|
|
182
184
|
role: z2.enum(["assistant", "system", "user"]),
|
|
183
|
-
source: z2.
|
|
185
|
+
source: z2.enum(["slack", "web"]).optional(),
|
|
184
186
|
actorIdentity: actorIdentitySchema.optional(),
|
|
185
187
|
eventType: z2.string().min(1).optional(),
|
|
186
188
|
explicitMention: z2.boolean().optional(),
|
|
@@ -4,27 +4,27 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
formatProviderLabel,
|
|
6
6
|
startOAuthFlow
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7RAETIYO.js";
|
|
8
8
|
import {
|
|
9
9
|
parseSandboxEgressAuthRequiredSignal
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-7MA4HV4W.js";
|
|
11
11
|
import {
|
|
12
12
|
abandonReplacedPendingAuth,
|
|
13
13
|
canReusePendingAuthLink,
|
|
14
14
|
recordAuthorizationRequested
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3L2PMOSR.js";
|
|
16
16
|
import {
|
|
17
17
|
AGENT_INVOCATION_MAILBOX_STATUSES
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-AIJRG227.js";
|
|
19
19
|
import {
|
|
20
20
|
TURN_REASONING_LEVELS
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-GKC43TLS.js";
|
|
22
22
|
import {
|
|
23
23
|
pluginCatalogRuntime
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-EDJ64P2P.js";
|
|
25
25
|
import {
|
|
26
26
|
credentialContextSchema
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-BDUENQD3.js";
|
|
28
28
|
|
|
29
29
|
// src/chat/services/auth-pause.ts
|
|
30
30
|
var AuthorizationPauseError = class extends Error {
|