@sentry/junior 0.86.0 → 0.88.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-NWOUB3UR.js → agent-hooks-RIJ5TSWP.js} +8 -8
- package/dist/api/people/list.d.ts +4 -0
- package/dist/api/people/list.js +83 -0
- package/dist/api/people/list.query.d.ts +4 -0
- package/dist/api/people/profile.d.ts +4 -0
- package/dist/api/people/profile.js +131 -0
- package/dist/api/people/profile.query.d.ts +4 -0
- package/dist/api/people/shared.d.ts +76 -0
- package/dist/api/people/types.d.ts +85 -0
- package/dist/app.js +45 -74
- package/dist/{catalog-runtime-XOD7YPRS.js → catalog-runtime-MW7XERSU.js} +3 -3
- package/dist/chat/conversations/sql/migrations.d.ts +1 -1
- package/dist/chat/conversations/sql/schema/identities.d.ts +54 -3
- package/dist/chat/conversations/sql/schema/users.d.ts +109 -0
- package/dist/chat/conversations/sql/schema.d.ts +164 -3
- package/dist/chat/conversations/sql/store.d.ts +0 -1
- package/dist/chat/identities/identity.d.ts +18 -0
- package/dist/chat/identities/sql.d.ts +4 -0
- package/dist/chat/no-reply.d.ts +7 -0
- package/dist/chat/runtime/processing-reaction.d.ts +2 -1
- package/dist/chat/runtime/slack-resume.d.ts +3 -2
- package/dist/chat/runtime/thread-context.d.ts +3 -1
- package/dist/chat/runtime/turn-user-message.d.ts +2 -1
- package/dist/chat/services/conversation-memory.d.ts +3 -1
- package/dist/chat/services/reply-delivery-plan.d.ts +0 -4
- package/dist/chat/slack/message.d.ts +2 -1
- package/dist/chat/slack/outbound.d.ts +5 -4
- package/dist/chat/slack/timestamp.d.ts +6 -0
- package/dist/chat/sql/schema.d.ts +163 -3
- package/dist/chat/tools/slack/context.d.ts +2 -1
- package/dist/{chunk-ENPSU7L7.js → chunk-2DPZRS3B.js} +4 -4
- package/dist/{chunk-6I6HBOQM.js → chunk-4IXHIV37.js} +413 -157
- package/dist/{chunk-JRXCSSSU.js → chunk-6UPQ5GTJ.js} +3 -3
- package/dist/{chunk-64ACM6AP.js → chunk-7ES37H6U.js} +2 -2
- package/dist/{chunk-GGD6WK6V.js → chunk-AHLSXMOU.js} +2 -2
- package/dist/{chunk-2TAIGJPQ.js → chunk-C5NCV3OB.js} +1 -1
- package/dist/{chunk-6O5UI3RG.js → chunk-F22AM3OW.js} +1 -1
- package/dist/{chunk-BRSQQRG6.js → chunk-IATAYWFU.js} +2 -2
- package/dist/{chunk-BQ3ITJA6.js → chunk-KBFQXJL4.js} +2 -2
- package/dist/{chunk-37B2R2QJ.js → chunk-KBSLCOGE.js} +28 -15
- package/dist/{chunk-IXTBFABZ.js → chunk-KQKIA4CU.js} +1 -1
- package/dist/{chunk-FPHA6GCQ.js → chunk-NYJLQI42.js} +95 -92
- package/dist/chunk-PBV4ZIVM.js +261 -0
- package/dist/{chunk-ZU2ALUVQ.js → chunk-S35CPNPT.js} +1 -1
- package/dist/{chunk-RIB3M6YA.js → chunk-V6XDCS3X.js} +4 -4
- package/dist/{chunk-KF7522P3.js → chunk-VMBZFPZM.js} +11 -1
- package/dist/{chunk-2NFV5FMB.js → chunk-XS6NLQPA.js} +21 -12
- package/dist/{chunk-GB5DFM4D.js → chunk-YPAE5RH3.js} +1 -1
- package/dist/cli/chat.js +6 -6
- package/dist/cli/check.js +4 -4
- package/dist/cli/plugins.js +11 -11
- package/dist/cli/snapshot-warmup.js +6 -6
- package/dist/cli/upgrade.js +12 -12
- package/dist/{db-SZVUU7RB.js → db-37HOGLI7.js} +5 -5
- package/dist/nitro.js +4 -4
- package/dist/reporting/conversations.d.ts +0 -56
- package/dist/reporting.d.ts +2 -8
- package/dist/reporting.js +14 -290
- package/dist/{runner-HEBRPNN2.js → runner-BCRF2FCI.js} +13 -13
- package/dist/{validation-MBNJKWPQ.js → validation-FMJO3L5P.js} +4 -4
- package/package.json +14 -6
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getDb,
|
|
3
|
+
juniorConversations,
|
|
4
|
+
juniorDestinations,
|
|
5
|
+
juniorIdentities,
|
|
6
|
+
juniorUsers
|
|
7
|
+
} from "./chunk-4IXHIV37.js";
|
|
8
|
+
|
|
9
|
+
// src/api/people/shared.ts
|
|
10
|
+
import { and, asc, desc, eq, sql } from "drizzle-orm";
|
|
11
|
+
var PRIVATE_CONVERSATION_LABEL = "Private Conversation";
|
|
12
|
+
var SAMPLE_LIMIT = 5e3;
|
|
13
|
+
var RECENT_LIMIT = 25;
|
|
14
|
+
var ACTIVITY_DAYS = 366;
|
|
15
|
+
var HUNG_PROGRESS_MS = 5 * 60 * 1e3;
|
|
16
|
+
function normalizeEmail(email) {
|
|
17
|
+
const normalized = email?.trim().toLowerCase();
|
|
18
|
+
return normalized || void 0;
|
|
19
|
+
}
|
|
20
|
+
function reportTime(value) {
|
|
21
|
+
const time = Date.parse(value);
|
|
22
|
+
return Number.isFinite(time) ? time : void 0;
|
|
23
|
+
}
|
|
24
|
+
function reportDate(value) {
|
|
25
|
+
const time = reportTime(value);
|
|
26
|
+
return time === void 0 ? void 0 : new Date(time).toISOString().slice(0, 10);
|
|
27
|
+
}
|
|
28
|
+
function channelFromConversationId(conversationId) {
|
|
29
|
+
const [provider, channel] = conversationId.split(":");
|
|
30
|
+
return provider === "slack" && channel ? channel : void 0;
|
|
31
|
+
}
|
|
32
|
+
function surfaceFromRow(row) {
|
|
33
|
+
const source = row.source;
|
|
34
|
+
if (source === "api" || source === "scheduler" || source === "slack") {
|
|
35
|
+
return source;
|
|
36
|
+
}
|
|
37
|
+
if (row.conversationId.startsWith("slack:")) return "slack";
|
|
38
|
+
if (row.conversationId.startsWith("scheduler:")) return "scheduler";
|
|
39
|
+
if (row.conversationId.startsWith("api:")) return "api";
|
|
40
|
+
return "internal";
|
|
41
|
+
}
|
|
42
|
+
function statusFromRow(row, nowMs) {
|
|
43
|
+
if (row.executionStatus === "failed") {
|
|
44
|
+
return "failed";
|
|
45
|
+
}
|
|
46
|
+
if (row.executionStatus === "idle") {
|
|
47
|
+
return "completed";
|
|
48
|
+
}
|
|
49
|
+
const updatedAtMs = (row.executionUpdatedAt ?? row.updatedAt).getTime();
|
|
50
|
+
if (row.executionStatus === "running" && nowMs - updatedAtMs > HUNG_PROGRESS_MS) {
|
|
51
|
+
return "hung";
|
|
52
|
+
}
|
|
53
|
+
return "active";
|
|
54
|
+
}
|
|
55
|
+
function surfaceLabel(surface) {
|
|
56
|
+
if (surface === "scheduler") return "Scheduler";
|
|
57
|
+
if (surface === "api") return "API";
|
|
58
|
+
if (surface === "internal") return "Internal";
|
|
59
|
+
return "Conversation";
|
|
60
|
+
}
|
|
61
|
+
function slackLocationLabel(args) {
|
|
62
|
+
const channelId = args.channel;
|
|
63
|
+
if (!channelId) return void 0;
|
|
64
|
+
if (args.channelNameRedacted && args.channelName) {
|
|
65
|
+
return args.channelName;
|
|
66
|
+
}
|
|
67
|
+
const name = args.channelName?.replace(/^#/, "");
|
|
68
|
+
if (channelId.startsWith("D")) return "Direct Message";
|
|
69
|
+
if (channelId.startsWith("C")) return name ? `#${name}` : "Public Channel";
|
|
70
|
+
if (channelId.startsWith("G")) {
|
|
71
|
+
if (name?.startsWith("mpdm-")) return "Group DM";
|
|
72
|
+
return "Private Channel";
|
|
73
|
+
}
|
|
74
|
+
return name || channelId;
|
|
75
|
+
}
|
|
76
|
+
function channelNameFromRow(row) {
|
|
77
|
+
if (row.destinationVisibility && row.destinationVisibility !== "public") {
|
|
78
|
+
return PRIVATE_CONVERSATION_LABEL;
|
|
79
|
+
}
|
|
80
|
+
return row.channelName ?? void 0;
|
|
81
|
+
}
|
|
82
|
+
function titleFromRow(row, surface) {
|
|
83
|
+
if (row.destinationVisibility && row.destinationVisibility !== "public") {
|
|
84
|
+
return PRIVATE_CONVERSATION_LABEL;
|
|
85
|
+
}
|
|
86
|
+
const channel = channelFromConversationId(row.conversationId);
|
|
87
|
+
return row.title ?? slackLocationLabel({
|
|
88
|
+
channel,
|
|
89
|
+
channelName: row.channelName ?? void 0
|
|
90
|
+
}) ?? surfaceLabel(surface);
|
|
91
|
+
}
|
|
92
|
+
function summaryFromRow(row, nowMs) {
|
|
93
|
+
const surface = surfaceFromRow(row);
|
|
94
|
+
const channel = channelFromConversationId(row.conversationId);
|
|
95
|
+
const channelName = channelNameFromRow(row);
|
|
96
|
+
const channelNameRedacted = Boolean(row.destinationVisibility) && row.destinationVisibility !== "public";
|
|
97
|
+
return {
|
|
98
|
+
conversationId: row.conversationId,
|
|
99
|
+
cumulativeDurationMs: 0,
|
|
100
|
+
displayTitle: titleFromRow(row, surface),
|
|
101
|
+
id: row.runId ?? row.conversationId,
|
|
102
|
+
lastProgressAt: new Date(
|
|
103
|
+
row.executionUpdatedAt ?? row.updatedAt
|
|
104
|
+
).toISOString(),
|
|
105
|
+
lastSeenAt: row.lastActivityAt.toISOString(),
|
|
106
|
+
startedAt: row.createdAt.toISOString(),
|
|
107
|
+
status: statusFromRow(row, nowMs),
|
|
108
|
+
surface,
|
|
109
|
+
requesterIdentity: {
|
|
110
|
+
email: row.email,
|
|
111
|
+
...row.fullName ? { fullName: row.fullName } : {},
|
|
112
|
+
slackUserId: row.providerSubjectId,
|
|
113
|
+
...row.handle ? { slackUserName: row.handle } : {}
|
|
114
|
+
},
|
|
115
|
+
...channel ? { channel } : {},
|
|
116
|
+
...channelName ? { channelName } : {},
|
|
117
|
+
...channelNameRedacted ? { channelNameRedacted: true } : {}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function emptyTotals() {
|
|
121
|
+
return {
|
|
122
|
+
active: 0,
|
|
123
|
+
activeDays: 0,
|
|
124
|
+
conversations: 0,
|
|
125
|
+
durationMs: 0,
|
|
126
|
+
failed: 0,
|
|
127
|
+
hung: 0,
|
|
128
|
+
runs: 0
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function emptyStatsItem(label) {
|
|
132
|
+
return {
|
|
133
|
+
active: 0,
|
|
134
|
+
conversations: 0,
|
|
135
|
+
durationMs: 0,
|
|
136
|
+
failed: 0,
|
|
137
|
+
hung: 0,
|
|
138
|
+
label,
|
|
139
|
+
runs: 0
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
function emptyActivityDay(date) {
|
|
143
|
+
return {
|
|
144
|
+
active: 0,
|
|
145
|
+
conversations: 0,
|
|
146
|
+
date,
|
|
147
|
+
durationMs: 0,
|
|
148
|
+
failed: 0,
|
|
149
|
+
hung: 0,
|
|
150
|
+
runs: 0
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function signals(summary) {
|
|
154
|
+
return {
|
|
155
|
+
active: summary.status === "active",
|
|
156
|
+
failed: summary.status === "failed",
|
|
157
|
+
hung: summary.status === "hung"
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function addSignals(target, value) {
|
|
161
|
+
target.active += value.active ? 1 : 0;
|
|
162
|
+
target.failed += value.failed ? 1 : 0;
|
|
163
|
+
target.hung += value.hung ? 1 : 0;
|
|
164
|
+
}
|
|
165
|
+
function identityWithEmail(requester) {
|
|
166
|
+
const email = normalizeEmail(requester?.email);
|
|
167
|
+
if (!email) return void 0;
|
|
168
|
+
return {
|
|
169
|
+
email,
|
|
170
|
+
...requester?.fullName ? { fullName: requester.fullName } : {},
|
|
171
|
+
...requester?.slackUserId ? { slackUserId: requester.slackUserId } : {},
|
|
172
|
+
...requester?.slackUserName ? { slackUserName: requester.slackUserName } : {}
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
function mergeIdentity(current, next) {
|
|
176
|
+
return {
|
|
177
|
+
email: current.email,
|
|
178
|
+
...current.fullName ?? next.fullName ? { fullName: current.fullName ?? next.fullName } : {},
|
|
179
|
+
...current.slackUserId ?? next.slackUserId ? { slackUserId: current.slackUserId ?? next.slackUserId } : {},
|
|
180
|
+
...current.slackUserName ?? next.slackUserName ? { slackUserName: current.slackUserName ?? next.slackUserName } : {}
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
function activityDays(days, nowMs) {
|
|
184
|
+
const items = [];
|
|
185
|
+
const end = new Date(nowMs);
|
|
186
|
+
end.setUTCHours(0, 0, 0, 0);
|
|
187
|
+
const start = new Date(end);
|
|
188
|
+
start.setUTCDate(start.getUTCDate() - (ACTIVITY_DAYS - 1));
|
|
189
|
+
for (const cursor = new Date(start); cursor.getTime() <= end.getTime(); cursor.setUTCDate(cursor.getUTCDate() + 1)) {
|
|
190
|
+
const date = cursor.toISOString().slice(0, 10);
|
|
191
|
+
items.push(days.get(date) ?? emptyActivityDay(date));
|
|
192
|
+
}
|
|
193
|
+
return items;
|
|
194
|
+
}
|
|
195
|
+
function statsItems(map) {
|
|
196
|
+
return [...map.values()].sort(
|
|
197
|
+
(left, right) => right.conversations - left.conversations || right.runs - left.runs || right.durationMs - left.durationMs || left.label.localeCompare(right.label)
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
async function requesterRows(options = {}, email) {
|
|
201
|
+
const normalizedEmail = normalizeEmail(email);
|
|
202
|
+
const rows = await (options.db ?? getDb()).select({
|
|
203
|
+
channelName: juniorConversations.channelName,
|
|
204
|
+
conversationId: juniorConversations.conversationId,
|
|
205
|
+
createdAt: juniorConversations.createdAt,
|
|
206
|
+
destinationVisibility: juniorDestinations.visibility,
|
|
207
|
+
email: juniorUsers.primaryEmailNormalized,
|
|
208
|
+
executionStatus: juniorConversations.executionStatus,
|
|
209
|
+
executionUpdatedAt: juniorConversations.executionUpdatedAt,
|
|
210
|
+
fullName: juniorUsers.displayName,
|
|
211
|
+
handle: juniorIdentities.handle,
|
|
212
|
+
lastActivityAt: juniorConversations.lastActivityAt,
|
|
213
|
+
providerSubjectId: juniorIdentities.providerSubjectId,
|
|
214
|
+
runId: juniorConversations.runId,
|
|
215
|
+
source: juniorConversations.source,
|
|
216
|
+
title: juniorConversations.title,
|
|
217
|
+
updatedAt: juniorConversations.updatedAt
|
|
218
|
+
}).from(juniorConversations).innerJoin(
|
|
219
|
+
juniorIdentities,
|
|
220
|
+
eq(juniorIdentities.id, juniorConversations.requesterIdentityId)
|
|
221
|
+
).innerJoin(juniorUsers, eq(juniorUsers.id, juniorIdentities.userId)).leftJoin(
|
|
222
|
+
juniorDestinations,
|
|
223
|
+
eq(juniorDestinations.id, juniorConversations.destinationId)
|
|
224
|
+
).where(
|
|
225
|
+
and(
|
|
226
|
+
eq(juniorIdentities.provider, "slack"),
|
|
227
|
+
eq(juniorIdentities.emailVerified, true),
|
|
228
|
+
sql`${juniorUsers.primaryEmailNormalized} IS NOT NULL`,
|
|
229
|
+
normalizedEmail ? eq(juniorUsers.primaryEmailNormalized, normalizedEmail) : void 0
|
|
230
|
+
)
|
|
231
|
+
).orderBy(
|
|
232
|
+
desc(juniorConversations.lastActivityAt),
|
|
233
|
+
asc(juniorConversations.conversationId)
|
|
234
|
+
).limit(SAMPLE_LIMIT + 1);
|
|
235
|
+
return {
|
|
236
|
+
rows: rows.slice(0, SAMPLE_LIMIT),
|
|
237
|
+
truncated: rows.length > SAMPLE_LIMIT
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export {
|
|
242
|
+
SAMPLE_LIMIT,
|
|
243
|
+
RECENT_LIMIT,
|
|
244
|
+
ACTIVITY_DAYS,
|
|
245
|
+
normalizeEmail,
|
|
246
|
+
reportTime,
|
|
247
|
+
reportDate,
|
|
248
|
+
surfaceLabel,
|
|
249
|
+
slackLocationLabel,
|
|
250
|
+
summaryFromRow,
|
|
251
|
+
emptyTotals,
|
|
252
|
+
emptyStatsItem,
|
|
253
|
+
emptyActivityDay,
|
|
254
|
+
signals,
|
|
255
|
+
addSignals,
|
|
256
|
+
identityWithEmail,
|
|
257
|
+
mergeIdentity,
|
|
258
|
+
activityDays,
|
|
259
|
+
statsItems,
|
|
260
|
+
requesterRows
|
|
261
|
+
};
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
} from "./chunk-G3E7SCME.js";
|
|
4
4
|
import {
|
|
5
5
|
getStateAdapter
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YPAE5RH3.js";
|
|
7
7
|
import {
|
|
8
8
|
toOptionalTrimmed
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-S35CPNPT.js";
|
|
10
10
|
import {
|
|
11
11
|
pluginCatalogRuntime
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KBFQXJL4.js";
|
|
13
13
|
import {
|
|
14
14
|
withSpan
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-VMBZFPZM.js";
|
|
16
16
|
|
|
17
17
|
// src/chat/sandbox/runtime-dependency-snapshots.ts
|
|
18
18
|
import { createHash } from "crypto";
|
|
@@ -22,6 +22,14 @@ import {
|
|
|
22
22
|
getConfig,
|
|
23
23
|
getLogger
|
|
24
24
|
} from "@logtape/logtape";
|
|
25
|
+
|
|
26
|
+
// src/chat/identities/identity.ts
|
|
27
|
+
function normalizeIdentityEmail(email) {
|
|
28
|
+
const normalized = email?.trim().toLowerCase();
|
|
29
|
+
return normalized || void 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// src/chat/logging.ts
|
|
25
33
|
var MAX_STRING_VALUE = 1200;
|
|
26
34
|
var SECRETS_RE = [
|
|
27
35
|
/\b(sk-[A-Za-z0-9_-]{20,})\b/g,
|
|
@@ -1034,10 +1042,11 @@ function setSentryTagsFromContext(context) {
|
|
|
1034
1042
|
}
|
|
1035
1043
|
function sentryUserIdentityFromContext(context) {
|
|
1036
1044
|
if (context.slackUserId) {
|
|
1045
|
+
const email = normalizeIdentityEmail(context.slackUserEmail);
|
|
1037
1046
|
return {
|
|
1038
1047
|
id: context.slackUserId,
|
|
1039
1048
|
...context.slackUserName ? { username: context.slackUserName } : {},
|
|
1040
|
-
...
|
|
1049
|
+
...email ? { email } : {}
|
|
1041
1050
|
};
|
|
1042
1051
|
}
|
|
1043
1052
|
return void 0;
|
|
@@ -1344,6 +1353,7 @@ function isSlackConversationId(value) {
|
|
|
1344
1353
|
}
|
|
1345
1354
|
|
|
1346
1355
|
export {
|
|
1356
|
+
normalizeIdentityEmail,
|
|
1347
1357
|
normalizeGenAiFinishReason,
|
|
1348
1358
|
createChatSdkLogger,
|
|
1349
1359
|
getLogContextAttributes,
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPluginLogger,
|
|
3
3
|
createPluginState
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
getDb
|
|
7
|
-
} from "./chunk-6I6HBOQM.js";
|
|
4
|
+
} from "./chunk-IATAYWFU.js";
|
|
8
5
|
import {
|
|
9
6
|
SANDBOX_WORKSPACE_ROOT
|
|
10
7
|
} from "./chunk-G3E7SCME.js";
|
|
8
|
+
import {
|
|
9
|
+
getDb
|
|
10
|
+
} from "./chunk-4IXHIV37.js";
|
|
11
11
|
import {
|
|
12
12
|
isConversationChannel,
|
|
13
13
|
isConversationScopedChannel,
|
|
14
14
|
isDmChannel,
|
|
15
15
|
normalizeSlackConversationId
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AHLSXMOU.js";
|
|
17
17
|
import {
|
|
18
18
|
botConfig,
|
|
19
19
|
completeObject,
|
|
20
20
|
embedTexts
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-S35CPNPT.js";
|
|
22
22
|
import {
|
|
23
23
|
isActorUserId,
|
|
24
24
|
parseActorUserId
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-KQKIA4CU.js";
|
|
26
26
|
import {
|
|
27
27
|
logInfo,
|
|
28
28
|
logWarn
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-VMBZFPZM.js";
|
|
30
30
|
|
|
31
31
|
// src/chat/plugins/agent-hooks.ts
|
|
32
32
|
import { promptMessageSchema } from "@sentry/junior-plugin-api";
|
|
@@ -68,6 +68,14 @@ function createPluginEmbedder(pluginName, runtime = {}) {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
// src/chat/slack/timestamp.ts
|
|
72
|
+
import { z } from "zod";
|
|
73
|
+
var slackMessageTsSchema = z.string().trim().regex(/^\d+(?:\.\d+)?$/).brand();
|
|
74
|
+
function parseSlackMessageTs(value) {
|
|
75
|
+
const parsed = slackMessageTsSchema.safeParse(value);
|
|
76
|
+
return parsed.success ? parsed.data : void 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
71
79
|
// src/chat/tools/slack/context.ts
|
|
72
80
|
function getSlackToolContext(context) {
|
|
73
81
|
if (context.source.platform !== "slack") {
|
|
@@ -81,7 +89,7 @@ function getSlackToolContext(context) {
|
|
|
81
89
|
source: context.source,
|
|
82
90
|
requester: context.requester?.platform === "slack" ? context.requester : void 0,
|
|
83
91
|
destinationChannelId: context.destination.channelId,
|
|
84
|
-
messageTs: context.source.messageTs,
|
|
92
|
+
messageTs: parseSlackMessageTs(context.source.messageTs),
|
|
85
93
|
sourceChannelId: context.source.channelId,
|
|
86
94
|
teamId: context.source.teamId,
|
|
87
95
|
threadTs: context.source.threadTs
|
|
@@ -191,7 +199,7 @@ function resolveChannelCapabilities(channelId) {
|
|
|
191
199
|
}
|
|
192
200
|
|
|
193
201
|
// src/chat/plugins/agent-hooks.ts
|
|
194
|
-
import { z } from "zod";
|
|
202
|
+
import { z as z2 } from "zod";
|
|
195
203
|
var PluginHookDeniedError = class extends Error {
|
|
196
204
|
constructor(message) {
|
|
197
205
|
super(message);
|
|
@@ -218,8 +226,8 @@ var PLUGIN_ROUTE_METHODS = /* @__PURE__ */ new Set([
|
|
|
218
226
|
"ALL"
|
|
219
227
|
]);
|
|
220
228
|
var PLUGIN_PROMPT_CONTRIBUTION_TOTAL_MAX_CHARS = 16e3;
|
|
221
|
-
var systemPromptMessageArraySchema =
|
|
222
|
-
var userPromptMessageArraySchema =
|
|
229
|
+
var systemPromptMessageArraySchema = z2.array(promptMessageSchema);
|
|
230
|
+
var userPromptMessageArraySchema = z2.array(promptMessageSchema);
|
|
223
231
|
function isRecord(value) {
|
|
224
232
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
225
233
|
}
|
|
@@ -984,6 +992,7 @@ function createPluginHookRunner(input = {}) {
|
|
|
984
992
|
export {
|
|
985
993
|
createPluginModel,
|
|
986
994
|
createPluginEmbedder,
|
|
995
|
+
parseSlackMessageTs,
|
|
987
996
|
getSlackToolContext,
|
|
988
997
|
bindSlackDirectCredentialSubject,
|
|
989
998
|
verifySlackDirectCredentialSubject,
|
package/dist/cli/chat.js
CHANGED
|
@@ -130,10 +130,10 @@ async function configureLocalChatPlugins(pluginSet) {
|
|
|
130
130
|
databaseModule
|
|
131
131
|
] = await Promise.all([
|
|
132
132
|
import("../plugins-PZMDS7AT.js"),
|
|
133
|
-
import("../agent-hooks-
|
|
134
|
-
import("../catalog-runtime-
|
|
135
|
-
import("../validation-
|
|
136
|
-
import("../db-
|
|
133
|
+
import("../agent-hooks-RIJ5TSWP.js"),
|
|
134
|
+
import("../catalog-runtime-MW7XERSU.js"),
|
|
135
|
+
import("../validation-FMJO3L5P.js"),
|
|
136
|
+
import("../db-37HOGLI7.js")
|
|
137
137
|
]);
|
|
138
138
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
139
139
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -195,7 +195,7 @@ async function runPrompt(options, io, pluginSet) {
|
|
|
195
195
|
defaultStateAdapterForLocalChat();
|
|
196
196
|
await configureLocalChatPlugins(pluginSet);
|
|
197
197
|
const conversationId = newRunConversationId();
|
|
198
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
198
|
+
const { runLocalAgentTurn } = await import("../runner-BCRF2FCI.js");
|
|
199
199
|
const result = await runLocalAgentTurn(
|
|
200
200
|
{
|
|
201
201
|
conversationId,
|
|
@@ -219,7 +219,7 @@ async function runInteractive(io, pluginSet) {
|
|
|
219
219
|
defaultStateAdapterForLocalChat();
|
|
220
220
|
await configureLocalChatPlugins(pluginSet);
|
|
221
221
|
const conversationId = newRunConversationId();
|
|
222
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
222
|
+
const { runLocalAgentTurn } = await import("../runner-BCRF2FCI.js");
|
|
223
223
|
const rl = readline.createInterface({
|
|
224
224
|
input: io.input,
|
|
225
225
|
output: io.output,
|
package/dist/cli/check.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseSkillFile
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-7ES37H6U.js";
|
|
4
4
|
import {
|
|
5
5
|
parseInlinePluginManifest,
|
|
6
6
|
parsePluginManifest
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-KBFQXJL4.js";
|
|
8
|
+
import "../chunk-KQKIA4CU.js";
|
|
9
9
|
import "../chunk-6APU57E6.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-VMBZFPZM.js";
|
|
11
11
|
import {
|
|
12
12
|
JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE,
|
|
13
13
|
JUNIOR_HEARTBEAT_ROUTE,
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
validatePluginEgressCredentialHooks,
|
|
3
3
|
validatePluginRegistrations
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-C5NCV3OB.js";
|
|
5
5
|
import {
|
|
6
6
|
pluginCatalogConfigFromPluginSet,
|
|
7
7
|
pluginCliRegistrationsFromPluginSet,
|
|
@@ -10,27 +10,27 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
setPlugins,
|
|
12
12
|
validatePlugins
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-XS6NLQPA.js";
|
|
14
14
|
import {
|
|
15
15
|
createPluginLogger
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-IATAYWFU.js";
|
|
17
|
+
import "../chunk-G3E7SCME.js";
|
|
18
|
+
import "../chunk-YPAE5RH3.js";
|
|
17
19
|
import {
|
|
18
20
|
getDb
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-GGD6WK6V.js";
|
|
23
|
-
import "../chunk-ZU2ALUVQ.js";
|
|
21
|
+
} from "../chunk-4IXHIV37.js";
|
|
22
|
+
import "../chunk-AHLSXMOU.js";
|
|
23
|
+
import "../chunk-S35CPNPT.js";
|
|
24
24
|
import "../chunk-L7OHKDOX.js";
|
|
25
25
|
import {
|
|
26
26
|
loadAppPluginSet
|
|
27
27
|
} from "../chunk-Y2CM7HXH.js";
|
|
28
28
|
import {
|
|
29
29
|
pluginCatalogRuntime
|
|
30
|
-
} from "../chunk-
|
|
31
|
-
import "../chunk-
|
|
30
|
+
} from "../chunk-KBFQXJL4.js";
|
|
31
|
+
import "../chunk-KQKIA4CU.js";
|
|
32
32
|
import "../chunk-6APU57E6.js";
|
|
33
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-VMBZFPZM.js";
|
|
34
34
|
import "../chunk-FTMXFBDC.js";
|
|
35
35
|
import "../chunk-3DA7X2U3.js";
|
|
36
36
|
import "../chunk-MLKGABMK.js";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveRuntimeDependencySnapshot
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-V6XDCS3X.js";
|
|
4
4
|
import "../chunk-G3E7SCME.js";
|
|
5
5
|
import {
|
|
6
6
|
disconnectStateAdapter
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-YPAE5RH3.js";
|
|
8
|
+
import "../chunk-S35CPNPT.js";
|
|
9
9
|
import "../chunk-L7OHKDOX.js";
|
|
10
10
|
import {
|
|
11
11
|
pluginCatalogRuntime
|
|
12
|
-
} from "../chunk-
|
|
13
|
-
import "../chunk-
|
|
12
|
+
} from "../chunk-KBFQXJL4.js";
|
|
13
|
+
import "../chunk-KQKIA4CU.js";
|
|
14
14
|
import "../chunk-6APU57E6.js";
|
|
15
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-VMBZFPZM.js";
|
|
16
16
|
import "../chunk-FTMXFBDC.js";
|
|
17
17
|
import "../chunk-3DA7X2U3.js";
|
|
18
18
|
import "../chunk-MLKGABMK.js";
|
package/dist/cli/upgrade.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
recordConversationActivity,
|
|
5
5
|
recordConversationExecution,
|
|
6
6
|
requestConversationWork
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-2DPZRS3B.js";
|
|
8
8
|
import {
|
|
9
9
|
JUNIOR_THREAD_STATE_TTL_MS,
|
|
10
10
|
coerceThreadConversationState
|
|
@@ -18,33 +18,33 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
createPluginLogger,
|
|
20
20
|
createPluginState
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-IATAYWFU.js";
|
|
22
|
+
import {
|
|
23
|
+
disconnectStateAdapter,
|
|
24
|
+
getConnectedStateContext
|
|
25
|
+
} from "../chunk-YPAE5RH3.js";
|
|
22
26
|
import {
|
|
23
27
|
createJuniorSqlExecutor,
|
|
24
28
|
createSqlStore,
|
|
25
29
|
getDb
|
|
26
|
-
} from "../chunk-
|
|
27
|
-
import {
|
|
28
|
-
disconnectStateAdapter,
|
|
29
|
-
getConnectedStateContext
|
|
30
|
-
} from "../chunk-GB5DFM4D.js";
|
|
30
|
+
} from "../chunk-4IXHIV37.js";
|
|
31
31
|
import {
|
|
32
32
|
parseDestination,
|
|
33
33
|
sameDestination
|
|
34
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-AHLSXMOU.js";
|
|
35
35
|
import {
|
|
36
36
|
getChatConfig
|
|
37
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-S35CPNPT.js";
|
|
38
38
|
import "../chunk-L7OHKDOX.js";
|
|
39
39
|
import {
|
|
40
40
|
loadAppPluginSet
|
|
41
41
|
} from "../chunk-Y2CM7HXH.js";
|
|
42
42
|
import {
|
|
43
43
|
pluginCatalogRuntime
|
|
44
|
-
} from "../chunk-
|
|
45
|
-
import "../chunk-
|
|
44
|
+
} from "../chunk-KBFQXJL4.js";
|
|
45
|
+
import "../chunk-KQKIA4CU.js";
|
|
46
46
|
import "../chunk-6APU57E6.js";
|
|
47
|
-
import "../chunk-
|
|
47
|
+
import "../chunk-VMBZFPZM.js";
|
|
48
48
|
import {
|
|
49
49
|
isRecord,
|
|
50
50
|
toOptionalNumber,
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
closeDb,
|
|
3
3
|
getConversationStore,
|
|
4
4
|
getDb
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-4IXHIV37.js";
|
|
6
|
+
import "./chunk-AHLSXMOU.js";
|
|
7
|
+
import "./chunk-S35CPNPT.js";
|
|
8
8
|
import "./chunk-L7OHKDOX.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-KQKIA4CU.js";
|
|
10
|
+
import "./chunk-VMBZFPZM.js";
|
|
11
11
|
import "./chunk-FTMXFBDC.js";
|
|
12
12
|
import "./chunk-3DA7X2U3.js";
|
|
13
13
|
import "./chunk-MLKGABMK.js";
|
package/dist/nitro.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveConversationWorkQueueTopic
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-F22AM3OW.js";
|
|
4
4
|
import {
|
|
5
5
|
PLUGIN_TASK_QUEUE_TOPIC
|
|
6
6
|
} from "./chunk-KNFROR7R.js";
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
pluginCatalogConfigFromPluginSet,
|
|
9
9
|
pluginRuntimeRegistrationsFromPluginSet
|
|
10
10
|
} from "./chunk-SG5WAA7H.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-AHLSXMOU.js";
|
|
12
|
+
import "./chunk-S35CPNPT.js";
|
|
13
13
|
import "./chunk-L7OHKDOX.js";
|
|
14
14
|
import {
|
|
15
15
|
loadPluginSetFromModule,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
isValidPackageName,
|
|
21
21
|
resolvePackageDir
|
|
22
22
|
} from "./chunk-6APU57E6.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-VMBZFPZM.js";
|
|
24
24
|
import {
|
|
25
25
|
JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE,
|
|
26
26
|
JUNIOR_HEARTBEAT_CRON_SCHEDULE,
|