@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.
Files changed (86) hide show
  1. package/dist/{agent-hooks-I4I2DHSW.js → agent-hooks-EOFSY2PD.js} +5 -5
  2. package/dist/api/conversations/archive.d.ts +7 -0
  3. package/dist/api/conversations/detail.d.ts +7 -0
  4. package/dist/api/conversations/list.d.ts +109 -0
  5. package/dist/api/conversations/routes.d.ts +3 -0
  6. package/dist/api/conversations/schema.d.ts +88 -69
  7. package/dist/api/conversations/stats.d.ts +7 -0
  8. package/dist/api/conversations/subagent.d.ts +7 -0
  9. package/dist/api/http.d.ts +5 -0
  10. package/dist/api/locations/detail.d.ts +10 -2
  11. package/dist/api/locations/list.d.ts +7 -0
  12. package/dist/api/locations/routes.d.ts +3 -0
  13. package/dist/api/locations/schema.d.ts +4 -3
  14. package/dist/api/people/list.d.ts +7 -0
  15. package/dist/api/people/profile.d.ts +7 -0
  16. package/dist/api/people/routes.d.ts +3 -0
  17. package/dist/api/people/schema.d.ts +35 -33
  18. package/dist/api/people/shared.d.ts +4 -4
  19. package/dist/api/route.d.ts +7 -0
  20. package/dist/api/schema.js +11 -17
  21. package/dist/api.js +2184 -88
  22. package/dist/app.js +120 -162
  23. package/dist/chat/conversations/history.d.ts +6 -6
  24. package/dist/chat/conversations/store.d.ts +1 -0
  25. package/dist/chat/pi/messages.d.ts +2 -2
  26. package/dist/chat/plugins/agent-hooks.d.ts +2 -2
  27. package/dist/chat/resource-events/store.d.ts +2 -2
  28. package/dist/chat/sandbox/runtime-dependencies.d.ts +2 -0
  29. package/dist/chat/sandbox/sandbox.d.ts +1 -0
  30. package/dist/chat/services/provider-retry.d.ts +1 -2
  31. package/dist/chat/slack/tools/conversation-search.d.ts +2 -2
  32. package/dist/chat/state/session-log.d.ts +2 -2
  33. package/dist/chat/task-execution/store.d.ts +2 -2
  34. package/dist/chat/tools/search-tools.d.ts +2 -2
  35. package/dist/{chunk-ZSHL44IQ.js → chunk-4PDVOHXP.js} +1 -1
  36. package/dist/{chunk-3OABPOHR.js → chunk-7G4J3CR7.js} +11 -2
  37. package/dist/chunk-AIRE7Q2W.js +362 -0
  38. package/dist/{chunk-QZGVPPIJ.js → chunk-BCULHGZK.js} +24 -4
  39. package/dist/{chunk-IQ36I3DF.js → chunk-CCTCIISK.js} +1 -1
  40. package/dist/{chunk-SHBPSE7A.js → chunk-M3UAVLEN.js} +2 -3
  41. package/dist/{chunk-EMUZSROX.js → chunk-O7ILGCMJ.js} +78 -1
  42. package/dist/{chunk-EOB77KME.js → chunk-QDKRE3LS.js} +340 -9
  43. package/dist/{chunk-DTUSCR2Y.js → chunk-QVTVCJR4.js} +7 -7
  44. package/dist/{chunk-5K4N73TP.js → chunk-RMZ65YAA.js} +3 -3
  45. package/dist/{chunk-VSAFV2GI.js → chunk-RYDF4GOX.js} +3 -3
  46. package/dist/{chunk-ZIX4PNBI.js → chunk-TMWUGGSA.js} +37 -35
  47. package/dist/{chunk-3UK5DFKW.js → chunk-U26ZWZCN.js} +1 -1
  48. package/dist/{chunk-X2IPNCB5.js → chunk-VDHMFCDY.js} +65 -12
  49. package/dist/cli/chat.js +13 -14
  50. package/dist/cli/plugins.js +6 -6
  51. package/dist/cli/snapshot-warmup.js +7 -3
  52. package/dist/cli/upgrade.js +6 -7
  53. package/dist/db/schema/conversations.d.ts +17 -0
  54. package/dist/db/schema.d.ts +17 -0
  55. package/dist/{db-6QP6HY7U.js → db-PDMC67T3.js} +2 -2
  56. package/dist/{legacy-import-R3BMM2GH.js → legacy-import-G333RHJZ.js} +3 -3
  57. package/dist/reporting-schema.d.ts +4 -4
  58. package/dist/{runner-C2ZTIOUD.js → runner-6A7MQRUE.js} +9 -10
  59. package/migrations/0004_useful_magus.sql +1 -0
  60. package/migrations/meta/0004_snapshot.json +1041 -0
  61. package/migrations/meta/_journal.json +7 -0
  62. package/package.json +6 -6
  63. package/dist/api/conversations/list.query.d.ts +0 -103
  64. package/dist/chunk-2RNOB32R.js +0 -17
  65. package/dist/chunk-4XNQSJAX.js +0 -331
  66. package/dist/chunk-4YN2ZXKB.js +0 -66
  67. package/dist/chunk-B5QS4AVO.js +0 -319
  68. package/dist/chunk-F4CQEUTP.js +0 -77
  69. package/dist/chunk-HYDQULR2.js +0 -214
  70. package/dist/chunk-KFP3TZOS.js +0 -102
  71. package/dist/chunk-LJB2TLVT.js +0 -273
  72. package/dist/chunk-LVUKF5CE.js +0 -63
  73. package/dist/chunk-NSP6OGL2.js +0 -671
  74. package/dist/chunk-QNVHH5PU.js +0 -20
  75. package/dist/chunk-QOZOJNSE.js +0 -96
  76. package/dist/chunk-WPHCUGN7.js +0 -84
  77. package/dist/detail-OEIVZYXS.js +0 -68
  78. package/dist/detail-V37NTVBN.js +0 -29
  79. package/dist/list-AJ6RWBOG.js +0 -30
  80. package/dist/list-FWLIZHSW.js +0 -30
  81. package/dist/list-NTUT6A5M.js +0 -121
  82. package/dist/plugin-conversations-F3IBVNFX.js +0 -37
  83. package/dist/profile-3FRQP4HP.js +0 -212
  84. package/dist/reporting/plugin-conversations.d.ts +0 -3
  85. package/dist/stats-7UFY6FPE.js +0 -174
  86. 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-DTUSCR2Y.js";
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-3UK5DFKW.js";
32
+ } from "./chunk-U26ZWZCN.js";
41
33
  import {
42
- GET
43
- } from "./chunk-QNVHH5PU.js";
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-ZIX4PNBI.js";
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-5K4N73TP.js";
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-B5QS4AVO.js";
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-VSAFV2GI.js";
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-X2IPNCB5.js";
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-IQ36I3DF.js";
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-QZGVPPIJ.js";
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-SHBPSE7A.js";
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 z2 } from "zod";
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 payload = await response.json();
1715
- if (!payload.ok || !payload.user) {
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?.display_name?.trim() || payload.user.profile?.real_name?.trim() || payload.user.real_name?.trim() || void 0;
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 = z2.object({
2184
- eventKey: z2.string().min(1),
2185
- eventType: z2.string().min(1),
2186
- occurredAtMs: z2.number().finite(),
2187
- provider: z2.string().min(1),
2188
- resourceRef: z2.string().min(1),
2189
- terminal: z2.boolean().optional(),
2190
- trustedSummary: z2.string().min(1),
2191
- untrustedText: z2.string().optional()
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 z3 } from "zod";
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 = z3.object({
2262
- action: z3.string(),
2263
- check_suite: z3.object({
2264
- conclusion: z3.string().optional().nullable(),
2265
- head_sha: z3.string().optional(),
2266
- pull_requests: z3.array(
2267
- z3.object({
2268
- number: z3.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: z3.object({
2273
- full_name: z3.string().min(1)
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 z4 } from "zod";
2308
- var issueCommentWebhookSchema = z4.object({
2309
- action: z4.string(),
2310
- comment: z4.object({
2311
- body: z4.string(),
2312
- user: z4.object({
2313
- login: z4.string().optional()
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: z4.object({
2317
- number: z4.number(),
2318
- pull_request: z4.object({
2319
- url: z4.string().min(1)
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: z4.object({
2323
- full_name: z4.string().min(1)
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 z5 } from "zod";
2350
- var pullRequestWebhookSchema = z5.object({
2351
- action: z5.string(),
2352
- pull_request: z5.object({
2353
- merged: z5.boolean().optional(),
2354
- number: z5.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: z5.object({
2357
- full_name: z5.string().min(1)
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 z6 } from "zod";
2383
- var pullRequestReviewCommentWebhookSchema = z6.object({
2384
- action: z6.string(),
2385
- comment: z6.object({
2386
- body: z6.string(),
2387
- user: z6.object({
2388
- login: z6.string().optional()
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: z6.object({
2392
- number: z6.number()
2349
+ pull_request: z7.object({
2350
+ number: z7.number()
2393
2351
  }).strip(),
2394
- repository: z6.object({
2395
- full_name: z6.string().min(1)
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 z7 } from "zod";
2422
- var pullRequestReviewWebhookSchema = z7.object({
2423
- action: z7.string(),
2424
- pull_request: z7.object({
2425
- number: z7.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: z7.object({
2428
- full_name: z7.string().min(1)
2385
+ repository: z8.object({
2386
+ full_name: z8.string().min(1)
2429
2387
  }),
2430
- review: z7.object({
2431
- body: z7.string().optional().nullable(),
2432
- state: z7.string(),
2433
- user: z7.object({
2434
- login: z7.string().optional()
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 z8 } from "zod";
7515
- var replyDecisionSchema = z8.object({
7516
- should_reply: z8.boolean().describe("Whether Junior should respond to this thread message."),
7517
- should_unsubscribe: z8.boolean().describe(
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: z8.number().min(0).max(1).describe("Classifier confidence from 0 to 1."),
7521
- reason: z8.string().optional().describe("Short reason for the decision.")
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 stripTrailingSlashes2(value) {
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 normalizeDashboardPath2(path2, fallback) {
11683
+ function normalizeDashboardPath(path2, fallback) {
11726
11684
  const value = path2?.trim() || fallback;
11727
11685
  const withSlash = value.startsWith("/") ? value : `/${value}`;
11728
- return stripTrailingSlashes2(withSlash);
11686
+ return stripTrailingSlashes(withSlash);
11729
11687
  }
11730
11688
  function dashboardHostRoutePaths(dashboard) {
11731
- const basePath = normalizeDashboardPath2(dashboard.basePath, "/");
11732
- const authPath = normalizeDashboardPath2(dashboard.authPath, "/api/auth");
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 normalizeDashboardPath2(path2, "/").split("/").filter(Boolean);
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 = normalizeDashboardPath2(routePath, "/");
11754
+ const normalized = normalizeDashboardPath(routePath, "/");
11797
11755
  if (!normalized.endsWith("/*") && !normalized.endsWith("/**")) {
11798
11756
  return [normalized];
11799
11757
  }
11800
- const prefix = normalizeDashboardPath2(
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").CustomMessage<unknown> | import("@earendil-works/pi-agent-core").BashExecutionMessage | import("@earendil-works/pi-agent-core").BranchSummaryMessage | import("@earendil-works/pi-agent-core").CompactionSummaryMessage, {
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").CustomMessage<unknown> | import("@earendil-works/pi-agent-core").BashExecutionMessage | import("@earendil-works/pi-agent-core").BranchSummaryMessage | import("@earendil-works/pi-agent-core").CompactionSummaryMessage, {
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").CustomMessage<unknown> | import("@earendil-works/pi-agent-core").BashExecutionMessage | import("@earendil-works/pi-agent-core").BranchSummaryMessage | import("@earendil-works/pi-agent-core").CompactionSummaryMessage, {
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").CustomMessage<unknown> | import("@earendil-works/pi-agent-core").BashExecutionMessage | import("@earendil-works/pi-agent-core").BranchSummaryMessage | import("@earendil-works/pi-agent-core").CompactionSummaryMessage, {
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").CustomMessage<unknown> | import("@earendil-works/pi-agent-core").BashExecutionMessage | import("@earendil-works/pi-agent-core").BranchSummaryMessage | import("@earendil-works/pi-agent-core").CompactionSummaryMessage, {
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").CustomMessage<unknown> | import("@earendil-works/pi-agent-core").BashExecutionMessage | import("@earendil-works/pi-agent-core").BranchSummaryMessage | import("@earendil-works/pi-agent-core").CompactionSummaryMessage, {
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
  }>>;
@@ -12,6 +12,7 @@ export interface ConversationExecution {
12
12
  updatedAtMs?: number;
13
13
  }
14
14
  export interface Conversation {
15
+ archivedAtMs?: number;
15
16
  channelName?: string;
16
17
  conversationId: string;
17
18
  createdAtMs: number;
@@ -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").CustomMessage<unknown> | import("@earendil-works/pi-agent-core").BashExecutionMessage | import("@earendil-works/pi-agent-core").BranchSummaryMessage | import("@earendil-works/pi-agent-core").CompactionSummaryMessage, {
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").CustomMessage<unknown> | import("@earendil-works/pi-agent-core").BashExecutionMessage | import("@earendil-works/pi-agent-core").BranchSummaryMessage | import("@earendil-works/pi-agent-core").CompactionSummaryMessage, {
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 { PluginConversations, PluginRoute, PluginOperationalReport, PluginRouteApp, SlackConversationLink, PluginRegistration } from "@sentry/junior-plugin-api";
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, conversations: PluginConversations): Promise<PluginOperationalReport[]>;
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>;
@@ -0,0 +1,2 @@
1
+ import type { PluginRuntimeDependency } from "@/chat/plugins/types";
2
+ export declare const GLOBAL_RUNTIME_DEPENDENCIES: PluginRuntimeDependency[];
@@ -20,6 +20,7 @@ export interface BashCustomCommandResult {
20
20
  exit_code: number;
21
21
  signal: null;
22
22
  timed_out: boolean;
23
+ aborted?: boolean;
23
24
  stdout: string;
24
25
  stderr: string;
25
26
  stdout_truncated: boolean;
@@ -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: "assistant" | "user";
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: "assistant" | "user";
52
+ message_role: "user" | "assistant";
53
53
  message_timestamp: string;
54
54
  excerpt: string;
55
55
  permalink?: string | undefined;