@sentry/junior 0.237.0 → 0.238.1

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 (70) hide show
  1. package/dist/{context-0Et9iVSB.js → actor-BTtLaeWy.js} +1 -96
  2. package/dist/admin-leAJ2k0P.js +33 -0
  3. package/dist/{agent-hooks-otHGbhBx.js → agent-hooks-p3UA9FI1.js} +1423 -2973
  4. package/dist/{agent-runner-DMAsnPb9.js → agent-runner-DjQSEVuD.js} +171 -139
  5. package/dist/api/schema.d.ts +4 -0
  6. package/dist/api/schema.js +3 -2
  7. package/dist/api.d.ts +1 -1
  8. package/dist/api.js +31 -24
  9. package/dist/{app-MEd7wbF0.d.ts → app-FB2hmHpZ.d.ts} +1 -1
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +26 -22
  12. package/dist/{briefs-DDA1ugXk.js → briefs-mzUaJkBX.js} +4 -4
  13. package/dist/{catalog-runtime-DlXuhrmk.js → catalog-runtime-xq-njrMs.js} +1 -1
  14. package/dist/{checkpoint-BlIIiHG5.js → checkpoint-C37Xgtj-.js} +19 -10
  15. package/dist/cli/chat.js +13 -13
  16. package/dist/cli/check.js +3 -3
  17. package/dist/cli/main.js +6 -2
  18. package/dist/cli/plugins.js +5 -3
  19. package/dist/cli/run.d.ts +2 -1
  20. package/dist/cli/run.js +2 -1
  21. package/dist/cli/snapshot-create.js +3 -3
  22. package/dist/cli/upgrade.d.ts +1 -1
  23. package/dist/cli/upgrade.js +3 -3
  24. package/dist/{client-CPMbTmJU.js → client-BZdqKg6S.js} +2 -2
  25. package/dist/{config-CxpPG6nR.js → config-CGK_VplU.js} +2 -2
  26. package/dist/{conversation-9Fxa1Zbq.js → conversation-DwD-vquD.js} +3 -517
  27. package/dist/{conversation-privacy-Dbkdvozu.js → conversation-privacy-Ci3QLNOb.js} +1 -1
  28. package/dist/{credential-sync-D9yGg3q5.js → credential-sync-BBeYpK4k.js} +15 -14
  29. package/dist/{db-Ca9Nt5ci.d.ts → db-CWZP77Ex.d.ts} +1 -1
  30. package/dist/{executor-BNxfDS1V.js → executor-DmIad4GI.js} +4 -2
  31. package/dist/experimental-Qn9rKLgx.js +50 -0
  32. package/dist/history-BLTUgFYO.js +518 -0
  33. package/dist/{images-D6Y3FJDQ.js → images-1xUjTHGf.js} +3 -3
  34. package/dist/instrumentation.js +2 -2
  35. package/dist/{job-queue-Dq5_zt_l.js → job-queue-CXpx6KfD.js} +1 -1
  36. package/dist/{logging-rB_ngE_R.js → logging-Bne7JUXI.js} +1 -1
  37. package/dist/nitro.d.ts +1 -1
  38. package/dist/nitro.js +3 -3
  39. package/dist/{oauth-authorization-5T1S1v_1.js → oauth-authorization-O8N3knp9.js} +1 -1
  40. package/dist/{oauth-callback-server-Csw7RssK.js → oauth-callback-server-Cb-HPZPS.js} +2 -2
  41. package/dist/pending-auth-C6w4Gwve.js +433 -0
  42. package/dist/{profile-D6apIG2N.js → profile-DIcHBAxe.js} +5 -7
  43. package/dist/{prompt-Ctwy6hSI.js → prompt-CMU-B4FA.js} +1 -1
  44. package/dist/{registry-zfTzTHe6.js → registry-VSrEYeaD.js} +111 -3
  45. package/dist/{resolve-sJtTzuBO.js → resolve-BkpWmZgN.js} +2 -2
  46. package/dist/{runner-DkCk8cbc.js → runner-52ezCnZF.js} +10 -10
  47. package/dist/{sandbox-egress-signals-tSQ8OEcw.js → sandbox-egress-signals-Cmhf3P6Y.js} +1 -1
  48. package/dist/{schema-C5bgOpRg.js → schema-CxWAN2zq.js} +1 -1
  49. package/dist/{skills-BVpr_Gnv.js → skills-PHvy-ZgH.js} +2 -2
  50. package/dist/{spawn-CJhmyE4E.js → spawn-CY34_HCm.js} +2 -2
  51. package/dist/{store-DoewL5mG.d.ts → store-BxxbxBlm.d.ts} +7 -0
  52. package/dist/{task-queue-BAiZ7_CF.js → task-queue-B9uJqkal.js} +3 -3
  53. package/dist/{task-runner-Bh8XONXT.js → task-runner-BZUoctJ1.js} +20 -10
  54. package/dist/{thread-state-BnQln4jO.js → thread-state-SnFcB9Rk.js} +6 -5
  55. package/dist/{turn-failure-response-Ba7_kItn.js → turn-failure-response-CrSc1Vtn.js} +10 -9
  56. package/dist/{turn-lifecycle-D6CTbkb9.js → turn-lifecycle-D49hJbjm.js} +1 -1
  57. package/dist/{turn-session-routing-DNevs9H7.js → turn-session-routing-cMvumCLK.js} +1 -1
  58. package/dist/{validation-BNPhuAvt.js → validation-DsLyiOfn.js} +1 -1
  59. package/dist/{version-EQ4MWuUJ.js → version-Dayi_ng2.js} +1 -1
  60. package/dist/version.js +1 -1
  61. package/dist/viewer-DF3HTfW5.js +1636 -0
  62. package/dist/{web-authorization-DDt4FZld.js → web-authorization-Dg_R1tMc.js} +6 -6
  63. package/dist/{web-input-C56ivZuH.js → web-input-qVi8134S.js} +63 -433
  64. package/dist/{work-DJ7hb9Ul.js → work-BbcghZZp.js} +9 -10
  65. package/dist/{worker-DiiV8Lba.js → worker-B-uRQzKw.js} +5 -5
  66. package/migrations/0048_user_admin.sql +1 -0
  67. package/migrations/meta/0048_snapshot.json +3720 -0
  68. package/migrations/meta/_journal.json +7 -0
  69. package/package.json +5 -5
  70. package/dist/pending-auth-moCA2mTc.js +0 -59
@@ -200,99 +200,4 @@ function createSlackResumeActor(args) {
200
200
  return actor;
201
201
  }
202
202
  //#endregion
203
- //#region src/chat/credentials/context.ts
204
- const exactActorIdSchema = z.string().refine((value) => parseActorUserId(value) === value);
205
- const exactNonBlankStringSchema = z.string().min(1).refine((value) => value === value.trim());
206
- const slackDirectCredentialSubjectBindingSchema = z.object({
207
- type: z.literal("slack-direct-conversation"),
208
- teamId: z.string().min(1),
209
- channelId: z.string().min(1),
210
- signature: z.string().min(1)
211
- }).strict();
212
- const scheduledAutomationCredentialSubjectBindingSchema = z.object({
213
- type: z.literal("scheduled-automation"),
214
- plugin: z.string().min(1),
215
- taskId: exactNonBlankStringSchema,
216
- signature: z.string().min(1)
217
- }).strict();
218
- const eventAutomationCredentialSubjectBindingSchema = z.object({
219
- type: z.literal("event-automation"),
220
- plugin: z.string().min(1),
221
- taskId: exactNonBlankStringSchema,
222
- signature: z.string().min(1)
223
- }).strict();
224
- z.discriminatedUnion("type", [
225
- slackDirectCredentialSubjectBindingSchema,
226
- scheduledAutomationCredentialSubjectBindingSchema,
227
- eventAutomationCredentialSubjectBindingSchema
228
- ]);
229
- const credentialUserActorSchema = z.object({
230
- type: z.literal("user"),
231
- userId: exactActorIdSchema
232
- }).strict();
233
- const credentialSystemActorSchema = z.object({
234
- platform: z.literal("system"),
235
- name: exactActorIdSchema
236
- }).strict();
237
- const credentialSubjectSchema = z.discriminatedUnion("allowedWhen", [
238
- z.object({
239
- type: z.literal("user"),
240
- userId: exactActorIdSchema,
241
- allowedWhen: z.literal("private-direct-conversation"),
242
- binding: slackDirectCredentialSubjectBindingSchema
243
- }).strict(),
244
- z.object({
245
- type: z.literal("user"),
246
- userId: exactActorIdSchema,
247
- allowedWhen: z.literal("scheduled-automation"),
248
- taskId: exactNonBlankStringSchema,
249
- binding: scheduledAutomationCredentialSubjectBindingSchema
250
- }).strict().refine((subject) => subject.binding.taskId === subject.taskId, {
251
- message: "Scheduled automation credential subject requires task binding",
252
- path: ["binding"]
253
- }),
254
- z.object({
255
- type: z.literal("user"),
256
- userId: exactActorIdSchema,
257
- allowedWhen: z.literal("event-automation"),
258
- taskId: exactNonBlankStringSchema,
259
- binding: eventAutomationCredentialSubjectBindingSchema
260
- }).strict().refine((subject) => subject.binding.taskId === subject.taskId, {
261
- message: "Event automation credential subject requires task binding",
262
- path: ["binding"]
263
- })
264
- ]);
265
- const credentialContextSchema = z.union([z.object({ actor: credentialUserActorSchema }).strict(), z.object({
266
- actor: credentialSystemActorSchema,
267
- subject: credentialSubjectSchema.optional()
268
- }).strict()]);
269
- /**
270
- * Build credential authority from the run actor.
271
- *
272
- * `actor` is the rich execution principal. This projects the credential stub
273
- * tools/auth need from it:
274
- * - user actor → `{ actor: { type: "user", userId } }`
275
- * - system actor → `{ actor: systemActor, subject? }`
276
- *
277
- * They only diverge when a system run carries an explicit delegated `subject`
278
- * (scheduled/event-automation creator credentials). Callers should set `actor` first,
279
- * then derive this — do not hand-build parallel shapes.
280
- */
281
- function credentialContextForActor(actor, subject) {
282
- if (actor.platform === "system") return subject ? {
283
- actor,
284
- subject
285
- } : { actor };
286
- if (subject) throw new TypeError("Delegated credential subjects require a system actor");
287
- return { actor: {
288
- type: "user",
289
- userId: actor.userId
290
- } };
291
- }
292
- /** Return the user whose OAuth token may satisfy this credential request. */
293
- function credentialUserSubjectId(context) {
294
- if ("type" in context.actor) return context.actor.userId;
295
- return "subject" in context ? context.subject?.userId : void 0;
296
- }
297
- //#endregion
298
- export { slackChannelIdSchema as _, createActor as a, parseSlackMessageTs as b, isActorUserId as c, parseStoredSlackActor as d, toStoredSlackActor as f, parseSlackUserId as g, parseSlackTeamId as h, credentialUserSubjectId as i, isUserActor as l, parseSlackChannelReferenceId as m, credentialContextSchema as n, createSlackActor as o, parseSlackChannelId as p, credentialSubjectSchema as r, createSlackResumeActor as s, credentialContextForActor as t, parseActorUserId as u, slackTeamIdSchema as v, slackMessageTsSchema as x, slackUserIdSchema as y };
203
+ export { slackMessageTsSchema as _, isUserActor as a, toStoredSlackActor as c, parseSlackTeamId as d, parseSlackUserId as f, parseSlackMessageTs as g, slackUserIdSchema as h, isActorUserId as i, parseSlackChannelId as l, slackTeamIdSchema as m, createSlackActor as n, parseActorUserId as o, slackChannelIdSchema as p, createSlackResumeActor as r, parseStoredSlackActor as s, createActor as t, parseSlackChannelReferenceId as u };
@@ -0,0 +1,33 @@
1
+ import { a as setUserAdminFromSql, d as getDb, n as listAdminUsersFromSql } from "./viewer-DF3HTfW5.js";
2
+ import { CLI_USAGE } from "./cli/run.js";
3
+ //#region src/cli/admin.ts
4
+ /**
5
+ * Operator CLI for the Junior-wide admin role.
6
+ *
7
+ * Admin changes happen only here, out of band. The dashboard and Slack can
8
+ * read the role but cannot change it, so no one can make themselves admin.
9
+ */
10
+ /** Run `junior admin list`, `grant <email>`, or `revoke <email>`. */
11
+ async function runAdmin(argv) {
12
+ const [subcommand, email, ...rest] = argv;
13
+ if (subcommand === "list" && email === void 0) {
14
+ const admins = await listAdminUsersFromSql(getDb());
15
+ if (admins.length === 0) console.log("No Junior admins.");
16
+ for (const admin of admins) console.log(admin.email);
17
+ return 0;
18
+ }
19
+ if ((subcommand === "grant" || subcommand === "revoke") && email?.trim() && rest.length === 0) {
20
+ const isAdmin = subcommand === "grant";
21
+ const user = await setUserAdminFromSql(getDb(), email, isAdmin);
22
+ if (!user) {
23
+ console.error(isAdmin ? `Could not grant admin: "${email}" is not a valid email.` : `No Junior user has the email "${email}".`);
24
+ return 1;
25
+ }
26
+ console.log(isAdmin ? `${user.email} is now a Junior admin.` : `${user.email} is no longer a Junior admin.`);
27
+ return 0;
28
+ }
29
+ console.error(CLI_USAGE);
30
+ return 1;
31
+ }
32
+ //#endregion
33
+ export { runAdmin };