@sentry/junior 0.102.3 → 0.104.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-I4I2DHSW.js → agent-hooks-EOFSY2PD.js} +5 -5
- package/dist/api/conversations/archive.d.ts +7 -0
- package/dist/api/conversations/detail.d.ts +7 -0
- package/dist/api/conversations/list.d.ts +109 -0
- package/dist/api/conversations/routes.d.ts +3 -0
- package/dist/api/conversations/schema.d.ts +88 -69
- package/dist/api/conversations/stats.d.ts +7 -0
- package/dist/api/conversations/subagent.d.ts +7 -0
- package/dist/api/http.d.ts +5 -0
- package/dist/api/locations/detail.d.ts +10 -2
- package/dist/api/locations/list.d.ts +7 -0
- package/dist/api/locations/routes.d.ts +3 -0
- package/dist/api/locations/schema.d.ts +4 -3
- package/dist/api/people/list.d.ts +7 -0
- package/dist/api/people/profile.d.ts +7 -0
- package/dist/api/people/routes.d.ts +3 -0
- package/dist/api/people/schema.d.ts +35 -33
- package/dist/api/people/shared.d.ts +4 -4
- package/dist/api/route.d.ts +7 -0
- package/dist/api/schema.js +11 -17
- package/dist/api.js +2184 -88
- package/dist/app.js +120 -162
- package/dist/chat/conversations/history.d.ts +6 -6
- package/dist/chat/conversations/store.d.ts +1 -0
- package/dist/chat/pi/messages.d.ts +2 -2
- package/dist/chat/plugins/agent-hooks.d.ts +2 -2
- package/dist/chat/resource-events/store.d.ts +2 -2
- package/dist/chat/sandbox/runtime-dependencies.d.ts +2 -0
- package/dist/chat/sandbox/sandbox.d.ts +1 -0
- package/dist/chat/services/provider-retry.d.ts +1 -2
- package/dist/chat/slack/tools/conversation-search.d.ts +2 -2
- package/dist/chat/state/session-log.d.ts +2 -2
- package/dist/chat/task-execution/store.d.ts +2 -2
- package/dist/chat/tools/search-tools.d.ts +2 -2
- package/dist/{chunk-ZSHL44IQ.js → chunk-4PDVOHXP.js} +1 -1
- package/dist/{chunk-3OABPOHR.js → chunk-7G4J3CR7.js} +11 -2
- package/dist/chunk-AIRE7Q2W.js +362 -0
- package/dist/{chunk-QZGVPPIJ.js → chunk-BCULHGZK.js} +24 -4
- package/dist/{chunk-IQ36I3DF.js → chunk-CCTCIISK.js} +1 -1
- package/dist/{chunk-SHBPSE7A.js → chunk-M3UAVLEN.js} +2 -3
- package/dist/{chunk-EMUZSROX.js → chunk-O7ILGCMJ.js} +78 -1
- package/dist/{chunk-EOB77KME.js → chunk-QDKRE3LS.js} +340 -9
- package/dist/{chunk-DTUSCR2Y.js → chunk-QVTVCJR4.js} +7 -7
- package/dist/{chunk-5K4N73TP.js → chunk-RMZ65YAA.js} +3 -3
- package/dist/{chunk-VSAFV2GI.js → chunk-RYDF4GOX.js} +3 -3
- package/dist/{chunk-ZIX4PNBI.js → chunk-TMWUGGSA.js} +37 -35
- package/dist/{chunk-3UK5DFKW.js → chunk-U26ZWZCN.js} +1 -1
- package/dist/{chunk-X2IPNCB5.js → chunk-VDHMFCDY.js} +65 -12
- package/dist/cli/chat.js +13 -14
- package/dist/cli/plugins.js +6 -6
- package/dist/cli/snapshot-warmup.js +7 -3
- package/dist/cli/upgrade.js +6 -7
- package/dist/db/schema/conversations.d.ts +17 -0
- package/dist/db/schema.d.ts +17 -0
- package/dist/{db-6QP6HY7U.js → db-PDMC67T3.js} +2 -2
- package/dist/{legacy-import-R3BMM2GH.js → legacy-import-G333RHJZ.js} +3 -3
- package/dist/reporting-schema.d.ts +4 -4
- package/dist/{runner-C2ZTIOUD.js → runner-6A7MQRUE.js} +9 -10
- package/migrations/0004_useful_magus.sql +1 -0
- package/migrations/meta/0004_snapshot.json +1041 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +6 -6
- package/dist/api/conversations/list.query.d.ts +0 -103
- package/dist/chunk-2RNOB32R.js +0 -17
- package/dist/chunk-4XNQSJAX.js +0 -331
- package/dist/chunk-4YN2ZXKB.js +0 -66
- package/dist/chunk-B5QS4AVO.js +0 -319
- package/dist/chunk-F4CQEUTP.js +0 -77
- package/dist/chunk-HYDQULR2.js +0 -214
- package/dist/chunk-KFP3TZOS.js +0 -102
- package/dist/chunk-LJB2TLVT.js +0 -273
- package/dist/chunk-LVUKF5CE.js +0 -63
- package/dist/chunk-NSP6OGL2.js +0 -671
- package/dist/chunk-QNVHH5PU.js +0 -20
- package/dist/chunk-QOZOJNSE.js +0 -96
- package/dist/chunk-WPHCUGN7.js +0 -84
- package/dist/detail-OEIVZYXS.js +0 -68
- package/dist/detail-V37NTVBN.js +0 -29
- package/dist/list-AJ6RWBOG.js +0 -30
- package/dist/list-FWLIZHSW.js +0 -30
- package/dist/list-NTUT6A5M.js +0 -121
- package/dist/plugin-conversations-F3IBVNFX.js +0 -37
- package/dist/profile-3FRQP4HP.js +0 -212
- package/dist/reporting/plugin-conversations.d.ts +0 -3
- package/dist/stats-7UFY6FPE.js +0 -174
- package/dist/subagent-X3ZWJHR4.js +0 -49
package/dist/app.js
CHANGED
|
@@ -5,15 +5,7 @@ import {
|
|
|
5
5
|
processPluginTask,
|
|
6
6
|
requireTurnFailureEventId,
|
|
7
7
|
scheduleSessionCompletedPluginTasks
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
buildSentryConversationUrl
|
|
11
|
-
} from "./chunk-LVUKF5CE.js";
|
|
12
|
-
import {
|
|
13
|
-
conversationVisibilityFromSlackChannelType,
|
|
14
|
-
resolveSlackChannelTypeFromMessage,
|
|
15
|
-
resolveSlackConversationContext
|
|
16
|
-
} from "./chunk-EMUZSROX.js";
|
|
8
|
+
} from "./chunk-QVTVCJR4.js";
|
|
17
9
|
import {
|
|
18
10
|
CONVERSATION_WORK_CHECK_IN_INTERVAL_MS,
|
|
19
11
|
CONVERSATION_WORK_STALE_ENQUEUE_MS,
|
|
@@ -37,10 +29,14 @@ import {
|
|
|
37
29
|
requestConversationContinuation,
|
|
38
30
|
requestConversationWork,
|
|
39
31
|
startConversationWork
|
|
40
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-U26ZWZCN.js";
|
|
41
33
|
import {
|
|
42
|
-
GET
|
|
43
|
-
|
|
34
|
+
GET,
|
|
35
|
+
buildSentryConversationUrl,
|
|
36
|
+
conversationVisibilityFromSlackChannelType,
|
|
37
|
+
resolveSlackChannelTypeFromMessage,
|
|
38
|
+
resolveSlackConversationContext
|
|
39
|
+
} from "./chunk-O7ILGCMJ.js";
|
|
44
40
|
import "./chunk-CEA3A3UA.js";
|
|
45
41
|
import {
|
|
46
42
|
getVercelConversationWorkQueue,
|
|
@@ -106,7 +102,7 @@ import {
|
|
|
106
102
|
splitSlackReplyText,
|
|
107
103
|
startOAuthFlow,
|
|
108
104
|
truncateStatusText
|
|
109
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-TMWUGGSA.js";
|
|
110
106
|
import {
|
|
111
107
|
CooperativeTurnYieldError,
|
|
112
108
|
TurnInputCommitLostError,
|
|
@@ -134,24 +130,23 @@ import {
|
|
|
134
130
|
persistWithRetry,
|
|
135
131
|
persistYieldSessionRecord,
|
|
136
132
|
startActiveTurn
|
|
137
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-RMZ65YAA.js";
|
|
138
134
|
import {
|
|
139
135
|
JUNIOR_THREAD_STATE_TTL_MS,
|
|
140
136
|
coerceThreadConversationState
|
|
141
137
|
} from "./chunk-XIMUQ4IU.js";
|
|
138
|
+
import "./chunk-7G4J3CR7.js";
|
|
142
139
|
import {
|
|
143
140
|
abandonAgentTurnSessionRecord,
|
|
141
|
+
commitMessages,
|
|
144
142
|
failAgentTurnSessionRecord,
|
|
145
143
|
getAgentTurnSessionRecord,
|
|
146
144
|
listAgentTurnSessionSummariesForConversation,
|
|
147
|
-
recordAgentTurnSessionSummary
|
|
148
|
-
} from "./chunk-EOB77KME.js";
|
|
149
|
-
import {
|
|
150
|
-
commitMessages,
|
|
151
145
|
loadConversationProjection,
|
|
152
146
|
loadProjection,
|
|
147
|
+
recordAgentTurnSessionSummary,
|
|
153
148
|
recordAuthorizationCompleted
|
|
154
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-QDKRE3LS.js";
|
|
155
150
|
import {
|
|
156
151
|
buildConversationContext,
|
|
157
152
|
createConversationMemoryService,
|
|
@@ -166,22 +161,28 @@ import {
|
|
|
166
161
|
persistConversationMessages,
|
|
167
162
|
updateConversationStats,
|
|
168
163
|
upsertConversationMessage
|
|
169
|
-
} from "./chunk-
|
|
170
|
-
import "./chunk-3OABPOHR.js";
|
|
164
|
+
} from "./chunk-RYDF4GOX.js";
|
|
171
165
|
import "./chunk-PDO5BLNM.js";
|
|
172
166
|
import "./chunk-UIE3R5XU.js";
|
|
173
167
|
import {
|
|
174
168
|
bindScheduledTaskCredentialSubject,
|
|
175
169
|
bindSlackDirectCredentialSubject,
|
|
170
|
+
getDashboardConversationLink,
|
|
176
171
|
getPluginApiRoutes,
|
|
177
172
|
getPluginRoutes,
|
|
178
173
|
getPluginSlackConversationLink,
|
|
179
174
|
getPlugins,
|
|
175
|
+
setDashboardConversationLinkOptions,
|
|
180
176
|
setPlugins,
|
|
181
177
|
validatePlugins,
|
|
182
178
|
verifyScheduledTaskCredentialSubject,
|
|
183
179
|
verifySlackDirectCredentialSubject
|
|
184
|
-
} from "./chunk-
|
|
180
|
+
} from "./chunk-VDHMFCDY.js";
|
|
181
|
+
import {
|
|
182
|
+
createPluginLogger,
|
|
183
|
+
createPluginState
|
|
184
|
+
} from "./chunk-4PDVOHXP.js";
|
|
185
|
+
import "./chunk-G3E7SCME.js";
|
|
185
186
|
import {
|
|
186
187
|
SlackActionError,
|
|
187
188
|
downloadPrivateSlackFile,
|
|
@@ -192,11 +193,7 @@ import {
|
|
|
192
193
|
normalizeSlackConversationId,
|
|
193
194
|
runWithSlackInstallationToken,
|
|
194
195
|
runWithWorkspaceTeamId
|
|
195
|
-
} from "./chunk-
|
|
196
|
-
import {
|
|
197
|
-
createPluginLogger,
|
|
198
|
-
createPluginState
|
|
199
|
-
} from "./chunk-ZSHL44IQ.js";
|
|
196
|
+
} from "./chunk-CCTCIISK.js";
|
|
200
197
|
import {
|
|
201
198
|
contextProvenance,
|
|
202
199
|
getConversationStore,
|
|
@@ -206,8 +203,7 @@ import {
|
|
|
206
203
|
juniorAgentSteps,
|
|
207
204
|
juniorConversationMessages,
|
|
208
205
|
juniorConversations
|
|
209
|
-
} from "./chunk-
|
|
210
|
-
import "./chunk-G3E7SCME.js";
|
|
206
|
+
} from "./chunk-BCULHGZK.js";
|
|
211
207
|
import {
|
|
212
208
|
sleep
|
|
213
209
|
} from "./chunk-4ZNGQH7C.js";
|
|
@@ -234,7 +230,7 @@ import {
|
|
|
234
230
|
setSlackReactionConfig,
|
|
235
231
|
stripRuntimeTurnContext,
|
|
236
232
|
trimTrailingAssistantMessages
|
|
237
|
-
} from "./chunk-
|
|
233
|
+
} from "./chunk-M3UAVLEN.js";
|
|
238
234
|
import {
|
|
239
235
|
juniorDestinations
|
|
240
236
|
} from "./chunk-FXFQNHRU.js";
|
|
@@ -305,56 +301,6 @@ import { createRequire } from "module";
|
|
|
305
301
|
import { pathToFileURL } from "url";
|
|
306
302
|
import { Hono } from "hono";
|
|
307
303
|
|
|
308
|
-
// src/chat/slack/dashboard-link.ts
|
|
309
|
-
var dashboardConversationLinkOptions;
|
|
310
|
-
function withHttps(host) {
|
|
311
|
-
return /^https?:\/\//.test(host) ? host : `https://${host}`;
|
|
312
|
-
}
|
|
313
|
-
function stripTrailingSlashes(value) {
|
|
314
|
-
let end = value.length;
|
|
315
|
-
while (end > 1 && value.charCodeAt(end - 1) === 47) {
|
|
316
|
-
end -= 1;
|
|
317
|
-
}
|
|
318
|
-
return end === value.length ? value : value.slice(0, end);
|
|
319
|
-
}
|
|
320
|
-
function normalizeDashboardPath(path2, fallback) {
|
|
321
|
-
const value = path2?.trim() || fallback;
|
|
322
|
-
const withSlash = value.startsWith("/") ? value : `/${value}`;
|
|
323
|
-
return stripTrailingSlashes(withSlash);
|
|
324
|
-
}
|
|
325
|
-
function resolveDashboardBaseURL(config) {
|
|
326
|
-
const explicit = config.baseURL ?? process.env.JUNIOR_BASE_URL;
|
|
327
|
-
if (explicit?.trim()) {
|
|
328
|
-
return stripTrailingSlashes(withHttps(explicit.trim()));
|
|
329
|
-
}
|
|
330
|
-
const vercelProd = process.env.VERCEL_PROJECT_PRODUCTION_URL?.trim();
|
|
331
|
-
if (vercelProd) {
|
|
332
|
-
return stripTrailingSlashes(withHttps(vercelProd));
|
|
333
|
-
}
|
|
334
|
-
const vercelUrl = process.env.VERCEL_URL?.trim();
|
|
335
|
-
if (vercelUrl) {
|
|
336
|
-
return stripTrailingSlashes(withHttps(vercelUrl));
|
|
337
|
-
}
|
|
338
|
-
return "http://localhost:3000";
|
|
339
|
-
}
|
|
340
|
-
function setDashboardConversationLinkOptions(options) {
|
|
341
|
-
const previous = dashboardConversationLinkOptions;
|
|
342
|
-
dashboardConversationLinkOptions = options?.disabled ? void 0 : options;
|
|
343
|
-
return previous;
|
|
344
|
-
}
|
|
345
|
-
function getDashboardConversationLink(conversationId) {
|
|
346
|
-
if (!dashboardConversationLinkOptions) {
|
|
347
|
-
return void 0;
|
|
348
|
-
}
|
|
349
|
-
const baseURL = resolveDashboardBaseURL(dashboardConversationLinkOptions);
|
|
350
|
-
const basePath = normalizeDashboardPath(
|
|
351
|
-
dashboardConversationLinkOptions.basePath,
|
|
352
|
-
"/"
|
|
353
|
-
);
|
|
354
|
-
const path2 = basePath === "/" ? `/conversations/${encodeURIComponent(conversationId)}` : `${basePath}/conversations/${encodeURIComponent(conversationId)}`;
|
|
355
|
-
return `${baseURL}${path2}`;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
304
|
// src/chat/slack/footer.ts
|
|
359
305
|
function buildSlackReplyFooter(args) {
|
|
360
306
|
const items = [];
|
|
@@ -1256,7 +1202,7 @@ async function POST(request, waitUntil, options) {
|
|
|
1256
1202
|
import { createHmac as createHmac2, timingSafeEqual as timingSafeEqual2 } from "crypto";
|
|
1257
1203
|
|
|
1258
1204
|
// src/chat/resource-events/ingest.ts
|
|
1259
|
-
import { z as
|
|
1205
|
+
import { z as z3 } from "zod";
|
|
1260
1206
|
|
|
1261
1207
|
// src/chat/task-execution/store.ts
|
|
1262
1208
|
function metadataStore(options) {
|
|
@@ -1657,6 +1603,17 @@ async function ensureSlackMessageActorIdentity(message, teamId, lookupSlackUser2
|
|
|
1657
1603
|
}
|
|
1658
1604
|
|
|
1659
1605
|
// src/chat/slack/user.ts
|
|
1606
|
+
import { z as z2 } from "zod";
|
|
1607
|
+
var slackUserInfoSchema = z2.object({
|
|
1608
|
+
ok: z2.literal(true),
|
|
1609
|
+
user: z2.object({
|
|
1610
|
+
name: z2.string().nullish(),
|
|
1611
|
+
profile: z2.object({
|
|
1612
|
+
email: z2.string().nullish(),
|
|
1613
|
+
real_name: z2.string().nullish()
|
|
1614
|
+
}).optional()
|
|
1615
|
+
})
|
|
1616
|
+
});
|
|
1660
1617
|
var USER_CACHE_TTL_MS = 5 * 60 * 1e3;
|
|
1661
1618
|
var userCache = /* @__PURE__ */ new Map();
|
|
1662
1619
|
function userCacheKey(teamId, userId) {
|
|
@@ -1711,12 +1668,13 @@ async function lookupSlackUser(teamId, userId) {
|
|
|
1711
1668
|
);
|
|
1712
1669
|
return null;
|
|
1713
1670
|
}
|
|
1714
|
-
const
|
|
1715
|
-
if (!
|
|
1671
|
+
const parsed = slackUserInfoSchema.safeParse(await response.json());
|
|
1672
|
+
if (!parsed.success) {
|
|
1716
1673
|
return null;
|
|
1717
1674
|
}
|
|
1675
|
+
const payload = parsed.data;
|
|
1718
1676
|
const userName = payload.user.name?.trim() || void 0;
|
|
1719
|
-
const fullName = payload.user.profile?.
|
|
1677
|
+
const fullName = payload.user.profile?.real_name?.trim() || void 0;
|
|
1720
1678
|
const result = {
|
|
1721
1679
|
userName,
|
|
1722
1680
|
fullName,
|
|
@@ -2180,15 +2138,15 @@ async function enqueueResourceEventNotification(args) {
|
|
|
2180
2138
|
}
|
|
2181
2139
|
|
|
2182
2140
|
// src/chat/resource-events/ingest.ts
|
|
2183
|
-
var ingestResourceEventInputSchema =
|
|
2184
|
-
eventKey:
|
|
2185
|
-
eventType:
|
|
2186
|
-
occurredAtMs:
|
|
2187
|
-
provider:
|
|
2188
|
-
resourceRef:
|
|
2189
|
-
terminal:
|
|
2190
|
-
trustedSummary:
|
|
2191
|
-
untrustedText:
|
|
2141
|
+
var ingestResourceEventInputSchema = z3.object({
|
|
2142
|
+
eventKey: z3.string().min(1),
|
|
2143
|
+
eventType: z3.string().min(1),
|
|
2144
|
+
occurredAtMs: z3.number().finite(),
|
|
2145
|
+
provider: z3.string().min(1),
|
|
2146
|
+
resourceRef: z3.string().min(1),
|
|
2147
|
+
terminal: z3.boolean().optional(),
|
|
2148
|
+
trustedSummary: z3.string().min(1),
|
|
2149
|
+
untrustedText: z3.string().optional()
|
|
2192
2150
|
}).strict();
|
|
2193
2151
|
async function ingestResourceEvent(input, options) {
|
|
2194
2152
|
const event = ingestResourceEventInputSchema.parse(input);
|
|
@@ -2241,7 +2199,7 @@ async function ingestResourceEvent(input, options) {
|
|
|
2241
2199
|
}
|
|
2242
2200
|
|
|
2243
2201
|
// src/handlers/github-webhook/check-suite.ts
|
|
2244
|
-
import { z as
|
|
2202
|
+
import { z as z4 } from "zod";
|
|
2245
2203
|
|
|
2246
2204
|
// src/handlers/github-webhook/resource.ts
|
|
2247
2205
|
function resourceRef(repositoryFullName, pullRequestNumber) {
|
|
@@ -2258,19 +2216,19 @@ function gitHubEventKey(deliveryId, eventType) {
|
|
|
2258
2216
|
}
|
|
2259
2217
|
|
|
2260
2218
|
// src/handlers/github-webhook/check-suite.ts
|
|
2261
|
-
var checkSuiteWebhookSchema =
|
|
2262
|
-
action:
|
|
2263
|
-
check_suite:
|
|
2264
|
-
conclusion:
|
|
2265
|
-
head_sha:
|
|
2266
|
-
pull_requests:
|
|
2267
|
-
|
|
2268
|
-
number:
|
|
2219
|
+
var checkSuiteWebhookSchema = z4.object({
|
|
2220
|
+
action: z4.string(),
|
|
2221
|
+
check_suite: z4.object({
|
|
2222
|
+
conclusion: z4.string().optional().nullable(),
|
|
2223
|
+
head_sha: z4.string().optional(),
|
|
2224
|
+
pull_requests: z4.array(
|
|
2225
|
+
z4.object({
|
|
2226
|
+
number: z4.number()
|
|
2269
2227
|
})
|
|
2270
2228
|
)
|
|
2271
2229
|
}),
|
|
2272
|
-
repository:
|
|
2273
|
-
full_name:
|
|
2230
|
+
repository: z4.object({
|
|
2231
|
+
full_name: z4.string().min(1)
|
|
2274
2232
|
})
|
|
2275
2233
|
});
|
|
2276
2234
|
function normalizeGitHubCheckSuiteEvents(deliveryId, body) {
|
|
@@ -2304,23 +2262,23 @@ function normalizeGitHubCheckSuiteEvents(deliveryId, body) {
|
|
|
2304
2262
|
}
|
|
2305
2263
|
|
|
2306
2264
|
// src/handlers/github-webhook/issue-comment.ts
|
|
2307
|
-
import { z as
|
|
2308
|
-
var issueCommentWebhookSchema =
|
|
2309
|
-
action:
|
|
2310
|
-
comment:
|
|
2311
|
-
body:
|
|
2312
|
-
user:
|
|
2313
|
-
login:
|
|
2265
|
+
import { z as z5 } from "zod";
|
|
2266
|
+
var issueCommentWebhookSchema = z5.object({
|
|
2267
|
+
action: z5.string(),
|
|
2268
|
+
comment: z5.object({
|
|
2269
|
+
body: z5.string(),
|
|
2270
|
+
user: z5.object({
|
|
2271
|
+
login: z5.string().optional()
|
|
2314
2272
|
}).strip().optional()
|
|
2315
2273
|
}).strip(),
|
|
2316
|
-
issue:
|
|
2317
|
-
number:
|
|
2318
|
-
pull_request:
|
|
2319
|
-
url:
|
|
2274
|
+
issue: z5.object({
|
|
2275
|
+
number: z5.number(),
|
|
2276
|
+
pull_request: z5.object({
|
|
2277
|
+
url: z5.string().min(1)
|
|
2320
2278
|
}).strip().optional()
|
|
2321
2279
|
}).strip(),
|
|
2322
|
-
repository:
|
|
2323
|
-
full_name:
|
|
2280
|
+
repository: z5.object({
|
|
2281
|
+
full_name: z5.string().min(1)
|
|
2324
2282
|
}).strip()
|
|
2325
2283
|
}).strip();
|
|
2326
2284
|
function normalizeGitHubIssueCommentEvent(deliveryId, body) {
|
|
@@ -2346,15 +2304,15 @@ function normalizeGitHubIssueCommentEvent(deliveryId, body) {
|
|
|
2346
2304
|
}
|
|
2347
2305
|
|
|
2348
2306
|
// src/handlers/github-webhook/pull-request.ts
|
|
2349
|
-
import { z as
|
|
2350
|
-
var pullRequestWebhookSchema =
|
|
2351
|
-
action:
|
|
2352
|
-
pull_request:
|
|
2353
|
-
merged:
|
|
2354
|
-
number:
|
|
2307
|
+
import { z as z6 } from "zod";
|
|
2308
|
+
var pullRequestWebhookSchema = z6.object({
|
|
2309
|
+
action: z6.string(),
|
|
2310
|
+
pull_request: z6.object({
|
|
2311
|
+
merged: z6.boolean().optional(),
|
|
2312
|
+
number: z6.number()
|
|
2355
2313
|
}),
|
|
2356
|
-
repository:
|
|
2357
|
-
full_name:
|
|
2314
|
+
repository: z6.object({
|
|
2315
|
+
full_name: z6.string().min(1)
|
|
2358
2316
|
})
|
|
2359
2317
|
});
|
|
2360
2318
|
function normalizeGitHubPullRequestEvent(deliveryId, body) {
|
|
@@ -2379,20 +2337,20 @@ function normalizeGitHubPullRequestEvent(deliveryId, body) {
|
|
|
2379
2337
|
}
|
|
2380
2338
|
|
|
2381
2339
|
// src/handlers/github-webhook/pull-request-review-comment.ts
|
|
2382
|
-
import { z as
|
|
2383
|
-
var pullRequestReviewCommentWebhookSchema =
|
|
2384
|
-
action:
|
|
2385
|
-
comment:
|
|
2386
|
-
body:
|
|
2387
|
-
user:
|
|
2388
|
-
login:
|
|
2340
|
+
import { z as z7 } from "zod";
|
|
2341
|
+
var pullRequestReviewCommentWebhookSchema = z7.object({
|
|
2342
|
+
action: z7.string(),
|
|
2343
|
+
comment: z7.object({
|
|
2344
|
+
body: z7.string(),
|
|
2345
|
+
user: z7.object({
|
|
2346
|
+
login: z7.string().optional()
|
|
2389
2347
|
}).strip().optional()
|
|
2390
2348
|
}).strip(),
|
|
2391
|
-
pull_request:
|
|
2392
|
-
number:
|
|
2349
|
+
pull_request: z7.object({
|
|
2350
|
+
number: z7.number()
|
|
2393
2351
|
}).strip(),
|
|
2394
|
-
repository:
|
|
2395
|
-
full_name:
|
|
2352
|
+
repository: z7.object({
|
|
2353
|
+
full_name: z7.string().min(1)
|
|
2396
2354
|
}).strip()
|
|
2397
2355
|
}).strip();
|
|
2398
2356
|
function normalizeGitHubPullRequestReviewCommentEvent(deliveryId, body) {
|
|
@@ -2418,20 +2376,20 @@ function normalizeGitHubPullRequestReviewCommentEvent(deliveryId, body) {
|
|
|
2418
2376
|
}
|
|
2419
2377
|
|
|
2420
2378
|
// src/handlers/github-webhook/pull-request-review.ts
|
|
2421
|
-
import { z as
|
|
2422
|
-
var pullRequestReviewWebhookSchema =
|
|
2423
|
-
action:
|
|
2424
|
-
pull_request:
|
|
2425
|
-
number:
|
|
2379
|
+
import { z as z8 } from "zod";
|
|
2380
|
+
var pullRequestReviewWebhookSchema = z8.object({
|
|
2381
|
+
action: z8.string(),
|
|
2382
|
+
pull_request: z8.object({
|
|
2383
|
+
number: z8.number()
|
|
2426
2384
|
}),
|
|
2427
|
-
repository:
|
|
2428
|
-
full_name:
|
|
2385
|
+
repository: z8.object({
|
|
2386
|
+
full_name: z8.string().min(1)
|
|
2429
2387
|
}),
|
|
2430
|
-
review:
|
|
2431
|
-
body:
|
|
2432
|
-
state:
|
|
2433
|
-
user:
|
|
2434
|
-
login:
|
|
2388
|
+
review: z8.object({
|
|
2389
|
+
body: z8.string().optional().nullable(),
|
|
2390
|
+
state: z8.string(),
|
|
2391
|
+
user: z8.object({
|
|
2392
|
+
login: z8.string().optional()
|
|
2435
2393
|
}).optional()
|
|
2436
2394
|
})
|
|
2437
2395
|
});
|
|
@@ -7511,14 +7469,14 @@ function registerVercelPluginTaskDevConsumer() {
|
|
|
7511
7469
|
}
|
|
7512
7470
|
|
|
7513
7471
|
// src/chat/services/subscribed-decision.ts
|
|
7514
|
-
import { z as
|
|
7515
|
-
var replyDecisionSchema =
|
|
7516
|
-
should_reply:
|
|
7517
|
-
should_unsubscribe:
|
|
7472
|
+
import { z as z9 } from "zod";
|
|
7473
|
+
var replyDecisionSchema = z9.object({
|
|
7474
|
+
should_reply: z9.boolean().describe("Whether Junior should respond to this thread message."),
|
|
7475
|
+
should_unsubscribe: z9.boolean().describe(
|
|
7518
7476
|
"Whether Junior should unsubscribe from this thread because the user clearly asked it to stop participating."
|
|
7519
7477
|
),
|
|
7520
|
-
confidence:
|
|
7521
|
-
reason:
|
|
7478
|
+
confidence: z9.number().min(0).max(1).describe("Classifier confidence from 0 to 1."),
|
|
7479
|
+
reason: z9.string().optional().describe("Short reason for the decision.")
|
|
7522
7480
|
}).strict();
|
|
7523
7481
|
var ROUTER_CONFIDENCE_THRESHOLD = 0.8;
|
|
7524
7482
|
var ROUTER_CLASSIFIER_MAX_TOKENS = 240;
|
|
@@ -11715,21 +11673,21 @@ function isMissingDashboardPackage(error) {
|
|
|
11715
11673
|
const code = error.code;
|
|
11716
11674
|
return (code === "ERR_MODULE_NOT_FOUND" || code === "MODULE_NOT_FOUND") && error.message.includes("@sentry/junior-dashboard");
|
|
11717
11675
|
}
|
|
11718
|
-
function
|
|
11676
|
+
function stripTrailingSlashes(value) {
|
|
11719
11677
|
let end = value.length;
|
|
11720
11678
|
while (end > 1 && value.charCodeAt(end - 1) === 47) {
|
|
11721
11679
|
end -= 1;
|
|
11722
11680
|
}
|
|
11723
11681
|
return end === value.length ? value : value.slice(0, end);
|
|
11724
11682
|
}
|
|
11725
|
-
function
|
|
11683
|
+
function normalizeDashboardPath(path2, fallback) {
|
|
11726
11684
|
const value = path2?.trim() || fallback;
|
|
11727
11685
|
const withSlash = value.startsWith("/") ? value : `/${value}`;
|
|
11728
|
-
return
|
|
11686
|
+
return stripTrailingSlashes(withSlash);
|
|
11729
11687
|
}
|
|
11730
11688
|
function dashboardHostRoutePaths(dashboard) {
|
|
11731
|
-
const basePath =
|
|
11732
|
-
const authPath =
|
|
11689
|
+
const basePath = normalizeDashboardPath(dashboard.basePath, "/");
|
|
11690
|
+
const authPath = normalizeDashboardPath(dashboard.authPath, "/api/auth");
|
|
11733
11691
|
const pagePath = (suffix) => basePath === "/" ? `/${suffix}` : `${basePath}/${suffix}`;
|
|
11734
11692
|
const conversationsPath = pagePath("conversations");
|
|
11735
11693
|
const peoplePath = pagePath("people");
|
|
@@ -11772,7 +11730,7 @@ function routePrefixCoversPath(routePrefix, path2) {
|
|
|
11772
11730
|
return routePrefix === "/" || path2 === routePrefix || path2.startsWith(`${routePrefix}/`);
|
|
11773
11731
|
}
|
|
11774
11732
|
function routeSegments(path2) {
|
|
11775
|
-
return
|
|
11733
|
+
return normalizeDashboardPath(path2, "/").split("/").filter(Boolean);
|
|
11776
11734
|
}
|
|
11777
11735
|
function routeSegmentMatches(pattern, value) {
|
|
11778
11736
|
return pattern === value || pattern === "*" || pattern.startsWith(":");
|
|
@@ -11793,11 +11751,11 @@ function routePatternMatchesConcretePath(pattern, concretePath) {
|
|
|
11793
11751
|
return patternSegments.length === pathSegments.length;
|
|
11794
11752
|
}
|
|
11795
11753
|
function routePatternExamples(routePath) {
|
|
11796
|
-
const normalized =
|
|
11754
|
+
const normalized = normalizeDashboardPath(routePath, "/");
|
|
11797
11755
|
if (!normalized.endsWith("/*") && !normalized.endsWith("/**")) {
|
|
11798
11756
|
return [normalized];
|
|
11799
11757
|
}
|
|
11800
|
-
const prefix =
|
|
11758
|
+
const prefix = normalizeDashboardPath(
|
|
11801
11759
|
normalized.endsWith("/*") ? normalized.slice(0, -2) : normalized.slice(0, -3),
|
|
11802
11760
|
"/"
|
|
11803
11761
|
);
|
|
@@ -13,7 +13,7 @@ import { z } from "zod";
|
|
|
13
13
|
declare const piMessageStepSchema: z.ZodObject<{
|
|
14
14
|
message: z.ZodPipe<z.ZodObject<{
|
|
15
15
|
role: z.ZodString;
|
|
16
|
-
}, z.core.$loose>, z.ZodTransform<import("@earendil-works/pi-ai").AssistantMessage | import("@earendil-works/pi-ai").UserMessage | import("@earendil-works/pi-ai").ToolResultMessage<any> | import("@earendil-works/pi-agent-core").
|
|
16
|
+
}, z.core.$loose>, z.ZodTransform<import("@earendil-works/pi-ai").AssistantMessage | import("@earendil-works/pi-ai").UserMessage | import("@earendil-works/pi-ai").ToolResultMessage<any> | import("@earendil-works/pi-agent-core").BashExecutionMessage | import("@earendil-works/pi-agent-core").CustomMessage<unknown> | import("@earendil-works/pi-agent-core").BranchSummaryMessage | import("@earendil-works/pi-agent-core").CompactionSummaryMessage, {
|
|
17
17
|
[x: string]: unknown;
|
|
18
18
|
role: string;
|
|
19
19
|
}>>;
|
|
@@ -47,7 +47,7 @@ export declare const contextEpochStartSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
47
47
|
messages: z.ZodArray<z.ZodObject<{
|
|
48
48
|
message: z.ZodPipe<z.ZodObject<{
|
|
49
49
|
role: z.ZodString;
|
|
50
|
-
}, z.core.$loose>, z.ZodTransform<import("@earendil-works/pi-ai").AssistantMessage | import("@earendil-works/pi-ai").UserMessage | import("@earendil-works/pi-ai").ToolResultMessage<any> | import("@earendil-works/pi-agent-core").
|
|
50
|
+
}, z.core.$loose>, z.ZodTransform<import("@earendil-works/pi-ai").AssistantMessage | import("@earendil-works/pi-ai").UserMessage | import("@earendil-works/pi-ai").ToolResultMessage<any> | import("@earendil-works/pi-agent-core").BashExecutionMessage | import("@earendil-works/pi-agent-core").CustomMessage<unknown> | import("@earendil-works/pi-agent-core").BranchSummaryMessage | import("@earendil-works/pi-agent-core").CompactionSummaryMessage, {
|
|
51
51
|
[x: string]: unknown;
|
|
52
52
|
role: string;
|
|
53
53
|
}>>;
|
|
@@ -80,7 +80,7 @@ export declare const contextEpochStartSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
80
80
|
messages: z.ZodArray<z.ZodObject<{
|
|
81
81
|
message: z.ZodPipe<z.ZodObject<{
|
|
82
82
|
role: z.ZodString;
|
|
83
|
-
}, z.core.$loose>, z.ZodTransform<import("@earendil-works/pi-ai").AssistantMessage | import("@earendil-works/pi-ai").UserMessage | import("@earendil-works/pi-ai").ToolResultMessage<any> | import("@earendil-works/pi-agent-core").
|
|
83
|
+
}, z.core.$loose>, z.ZodTransform<import("@earendil-works/pi-ai").AssistantMessage | import("@earendil-works/pi-ai").UserMessage | import("@earendil-works/pi-ai").ToolResultMessage<any> | import("@earendil-works/pi-agent-core").BashExecutionMessage | import("@earendil-works/pi-agent-core").CustomMessage<unknown> | import("@earendil-works/pi-agent-core").BranchSummaryMessage | import("@earendil-works/pi-agent-core").CompactionSummaryMessage, {
|
|
84
84
|
[x: string]: unknown;
|
|
85
85
|
role: string;
|
|
86
86
|
}>>;
|
|
@@ -113,7 +113,7 @@ export declare const contextEpochStartSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
113
113
|
messages: z.ZodArray<z.ZodObject<{
|
|
114
114
|
message: z.ZodPipe<z.ZodObject<{
|
|
115
115
|
role: z.ZodString;
|
|
116
|
-
}, z.core.$loose>, z.ZodTransform<import("@earendil-works/pi-ai").AssistantMessage | import("@earendil-works/pi-ai").UserMessage | import("@earendil-works/pi-ai").ToolResultMessage<any> | import("@earendil-works/pi-agent-core").
|
|
116
|
+
}, z.core.$loose>, z.ZodTransform<import("@earendil-works/pi-ai").AssistantMessage | import("@earendil-works/pi-ai").UserMessage | import("@earendil-works/pi-ai").ToolResultMessage<any> | import("@earendil-works/pi-agent-core").BashExecutionMessage | import("@earendil-works/pi-agent-core").CustomMessage<unknown> | import("@earendil-works/pi-agent-core").BranchSummaryMessage | import("@earendil-works/pi-agent-core").CompactionSummaryMessage, {
|
|
117
117
|
[x: string]: unknown;
|
|
118
118
|
role: string;
|
|
119
119
|
}>>;
|
|
@@ -148,7 +148,7 @@ export declare const agentStepEntrySchema: z.ZodUnion<readonly [z.ZodUnion<reado
|
|
|
148
148
|
schemaVersion: z.ZodOptional<z.ZodNumber>;
|
|
149
149
|
message: z.ZodPipe<z.ZodObject<{
|
|
150
150
|
role: z.ZodString;
|
|
151
|
-
}, z.core.$loose>, z.ZodTransform<import("@earendil-works/pi-ai").AssistantMessage | import("@earendil-works/pi-ai").UserMessage | import("@earendil-works/pi-ai").ToolResultMessage<any> | import("@earendil-works/pi-agent-core").
|
|
151
|
+
}, z.core.$loose>, z.ZodTransform<import("@earendil-works/pi-ai").AssistantMessage | import("@earendil-works/pi-ai").UserMessage | import("@earendil-works/pi-ai").ToolResultMessage<any> | import("@earendil-works/pi-agent-core").BashExecutionMessage | import("@earendil-works/pi-agent-core").CustomMessage<unknown> | import("@earendil-works/pi-agent-core").BranchSummaryMessage | import("@earendil-works/pi-agent-core").CompactionSummaryMessage, {
|
|
152
152
|
[x: string]: unknown;
|
|
153
153
|
role: string;
|
|
154
154
|
}>>;
|
|
@@ -252,7 +252,7 @@ export declare const newAgentStepSchema: z.ZodObject<{
|
|
|
252
252
|
schemaVersion: z.ZodOptional<z.ZodNumber>;
|
|
253
253
|
message: z.ZodPipe<z.ZodObject<{
|
|
254
254
|
role: z.ZodString;
|
|
255
|
-
}, z.core.$loose>, z.ZodTransform<import("@earendil-works/pi-ai").AssistantMessage | import("@earendil-works/pi-ai").UserMessage | import("@earendil-works/pi-ai").ToolResultMessage<any> | import("@earendil-works/pi-agent-core").
|
|
255
|
+
}, z.core.$loose>, z.ZodTransform<import("@earendil-works/pi-ai").AssistantMessage | import("@earendil-works/pi-ai").UserMessage | import("@earendil-works/pi-ai").ToolResultMessage<any> | import("@earendil-works/pi-agent-core").BashExecutionMessage | import("@earendil-works/pi-agent-core").CustomMessage<unknown> | import("@earendil-works/pi-agent-core").BranchSummaryMessage | import("@earendil-works/pi-agent-core").CompactionSummaryMessage, {
|
|
256
256
|
[x: string]: unknown;
|
|
257
257
|
role: string;
|
|
258
258
|
}>>;
|
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
/** Permissive schema for durable Pi SDK messages whose content shape may evolve. */
|
|
3
3
|
export declare const piMessageSchema: z.ZodPipe<z.ZodObject<{
|
|
4
4
|
role: z.ZodString;
|
|
5
|
-
}, z.core.$loose>, z.ZodTransform<import("@earendil-works/pi-ai").AssistantMessage | import("@earendil-works/pi-ai").UserMessage | import("@earendil-works/pi-ai").ToolResultMessage<any> | import("@earendil-works/pi-agent-core").
|
|
5
|
+
}, z.core.$loose>, z.ZodTransform<import("@earendil-works/pi-ai").AssistantMessage | import("@earendil-works/pi-ai").UserMessage | import("@earendil-works/pi-ai").ToolResultMessage<any> | import("@earendil-works/pi-agent-core").BashExecutionMessage | import("@earendil-works/pi-agent-core").CustomMessage<unknown> | import("@earendil-works/pi-agent-core").BranchSummaryMessage | import("@earendil-works/pi-agent-core").CompactionSummaryMessage, {
|
|
6
6
|
[x: string]: unknown;
|
|
7
7
|
role: string;
|
|
8
8
|
}>>;
|
|
@@ -12,7 +12,7 @@ export type PiMessage = z.output<typeof piMessageSchema>;
|
|
|
12
12
|
export declare const piContentMessageSchema: z.ZodPipe<z.ZodObject<{
|
|
13
13
|
content: z.ZodArray<z.ZodUnknown>;
|
|
14
14
|
role: z.ZodString;
|
|
15
|
-
}, z.core.$loose>, z.ZodTransform<import("@earendil-works/pi-ai").AssistantMessage | import("@earendil-works/pi-ai").UserMessage | import("@earendil-works/pi-ai").ToolResultMessage<any> | import("@earendil-works/pi-agent-core").
|
|
15
|
+
}, z.core.$loose>, z.ZodTransform<import("@earendil-works/pi-ai").AssistantMessage | import("@earendil-works/pi-ai").UserMessage | import("@earendil-works/pi-ai").ToolResultMessage<any> | import("@earendil-works/pi-agent-core").BashExecutionMessage | import("@earendil-works/pi-agent-core").CustomMessage<unknown> | import("@earendil-works/pi-agent-core").BranchSummaryMessage | import("@earendil-works/pi-agent-core").CompactionSummaryMessage, {
|
|
16
16
|
[x: string]: unknown;
|
|
17
17
|
content: unknown[];
|
|
18
18
|
role: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PluginRoute, PluginOperationalReport, PluginRouteApp, SlackConversationLink, PluginRegistration } from "@sentry/junior-plugin-api";
|
|
2
2
|
import type { PluginPromptContributionContext } from "@/chat/plugins/prompt";
|
|
3
3
|
import type { AnyToolDefinition } from "@/chat/tools/definition";
|
|
4
4
|
import type { ToolRuntimeContext } from "@/chat/tools/types";
|
|
@@ -48,7 +48,7 @@ export declare function getPluginApiRoutes(): PluginApiRouteRegistration[];
|
|
|
48
48
|
/** Resolve the first plugin conversation URL for finalized Slack footers. */
|
|
49
49
|
export declare function getPluginSlackConversationLink(conversationId: string): SlackConversationLink | undefined;
|
|
50
50
|
/** Collect read-only operational summaries exposed by plugins. */
|
|
51
|
-
export declare function getPluginOperationalReports(nowMs: number
|
|
51
|
+
export declare function getPluginOperationalReports(nowMs: number): Promise<PluginOperationalReport[]>;
|
|
52
52
|
/** Create one runner over runtime hook plugins registered by the app. */
|
|
53
53
|
export declare function createPluginHookRunner(input?: {
|
|
54
54
|
actor?: Actor;
|
|
@@ -21,9 +21,9 @@ declare const subscriptionSchema: z.ZodObject<{
|
|
|
21
21
|
resourceRef: z.ZodString;
|
|
22
22
|
resourceType: z.ZodString;
|
|
23
23
|
status: z.ZodEnum<{
|
|
24
|
-
active: "active";
|
|
25
|
-
completed: "completed";
|
|
26
24
|
cancelled: "cancelled";
|
|
25
|
+
completed: "completed";
|
|
26
|
+
active: "active";
|
|
27
27
|
}>;
|
|
28
28
|
updatedAtMs: z.ZodNumber;
|
|
29
29
|
}, z.core.$strict>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { AssistantMessage } from "@earendil-works/pi-ai";
|
|
2
1
|
import type { PiMessage } from "@/chat/pi/messages";
|
|
3
2
|
/** Mark failures that cross the AI provider boundary for shared retry handling. */
|
|
4
3
|
export declare function createProviderError(error: unknown): Error;
|
|
@@ -7,8 +6,8 @@ export declare function isProviderRetryError(error: unknown): boolean;
|
|
|
7
6
|
/** Build the next provider retry step from Pi history, if the turn can resume. */
|
|
8
7
|
export declare function nextProviderRetry(args: {
|
|
9
8
|
attempt: number;
|
|
10
|
-
lastAssistant: Pick<AssistantMessage, "stopReason" | "errorMessage"> | undefined;
|
|
11
9
|
messages: PiMessage[];
|
|
10
|
+
retryableFailure: boolean;
|
|
12
11
|
}): {
|
|
13
12
|
delayMs: number;
|
|
14
13
|
messages: PiMessage[];
|
|
@@ -22,7 +22,7 @@ export declare function createSlackConversationSearchTool(scope: ConversationSea
|
|
|
22
22
|
conversation_id: string;
|
|
23
23
|
thread_ts: string;
|
|
24
24
|
message_id: string;
|
|
25
|
-
message_role: "
|
|
25
|
+
message_role: "user" | "assistant";
|
|
26
26
|
message_timestamp: string;
|
|
27
27
|
excerpt: string;
|
|
28
28
|
permalink?: string | undefined;
|
|
@@ -49,7 +49,7 @@ export declare function createSlackConversationSearchTool(scope: ConversationSea
|
|
|
49
49
|
conversation_id: string;
|
|
50
50
|
thread_ts: string;
|
|
51
51
|
message_id: string;
|
|
52
|
-
message_role: "
|
|
52
|
+
message_role: "user" | "assistant";
|
|
53
53
|
message_timestamp: string;
|
|
54
54
|
excerpt: string;
|
|
55
55
|
permalink?: string | undefined;
|