@sentry/junior 0.101.0 → 0.102.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/{agent-hooks-V6KU7PQN.js → agent-hooks-I4I2DHSW.js} +7 -7
  2. package/dist/api/conversations/stats.query.d.ts +1 -1
  3. package/dist/api/locations/list.d.ts +7 -0
  4. package/dist/api/locations/schema.d.ts +13 -0
  5. package/dist/api/people/schema.d.ts +13 -0
  6. package/dist/api/people/shared.d.ts +1 -1
  7. package/dist/api/schema.d.ts +3 -3
  8. package/dist/api/schema.js +4 -2
  9. package/dist/api.js +15 -15
  10. package/dist/app.js +65 -53
  11. package/dist/{catalog-runtime-PFHVMHDR.js → catalog-runtime-5CVM2DOF.js} +2 -2
  12. package/dist/chat/agent/prompt.d.ts +1 -1
  13. package/dist/chat/agent-dispatch/validation.d.ts +1 -1
  14. package/dist/chat/conversation-privacy.d.ts +2 -6
  15. package/dist/chat/credentials/context.d.ts +33 -6
  16. package/dist/chat/credentials/subject.d.ts +15 -1
  17. package/dist/chat/logging.d.ts +4 -2
  18. package/dist/chat/mcp/tool-manager.d.ts +1 -1
  19. package/dist/chat/sandbox/egress/schemas.d.ts +13 -2
  20. package/dist/chat/services/context-compaction-marker.d.ts +8 -0
  21. package/dist/{chunk-XJA7BPHS.js → chunk-3OABPOHR.js} +3 -3
  22. package/dist/{chunk-EBFJOOUE.js → chunk-3UK5DFKW.js} +2 -2
  23. package/dist/{chunk-VFBFK6EY.js → chunk-4XNQSJAX.js} +62 -6
  24. package/dist/{chunk-DBPLXSBK.js → chunk-4YN2ZXKB.js} +9 -1
  25. package/dist/{chunk-XVR4O24H.js → chunk-5K4N73TP.js} +4 -4
  26. package/dist/{chunk-LMJPRYHP.js → chunk-77LHNQK4.js} +32 -8
  27. package/dist/{chunk-I35CTGPO.js → chunk-AEWZ7F65.js} +41 -17
  28. package/dist/{chunk-IQIBZXGB.js → chunk-B5QS4AVO.js} +2 -2
  29. package/dist/{chunk-L2JIOAA2.js → chunk-DTUSCR2Y.js} +8 -11
  30. package/dist/{chunk-VVIXK2BX.js → chunk-EMUZSROX.js} +2 -2
  31. package/dist/{chunk-IVXL57YF.js → chunk-EOB77KME.js} +4 -4
  32. package/dist/{chunk-PGGEOCQY.js → chunk-F4CQEUTP.js} +1 -1
  33. package/dist/{chunk-FP5N5OWZ.js → chunk-IQ36I3DF.js} +2 -2
  34. package/dist/{chunk-GEUUJRQF.js → chunk-KFP3TZOS.js} +2 -2
  35. package/dist/{chunk-JSAANELJ.js → chunk-LJB2TLVT.js} +3 -3
  36. package/dist/{chunk-D5KZYS4T.js → chunk-MJSJAHBW.js} +1 -1
  37. package/dist/{chunk-5VGJJSSV.js → chunk-NSP6OGL2.js} +5 -5
  38. package/dist/{chunk-VHRM6GNH.js → chunk-QZGVPPIJ.js} +27 -3
  39. package/dist/{chunk-LVA4I4H7.js → chunk-RT5BUHR5.js} +15 -44
  40. package/dist/{chunk-A7X2FDUO.js → chunk-SHBPSE7A.js} +88 -66
  41. package/dist/{chunk-CM5EZD5F.js → chunk-UIE3R5XU.js} +1 -1
  42. package/dist/{chunk-JPQISMMJ.js → chunk-VSAFV2GI.js} +7 -6
  43. package/dist/{chunk-HNIT4HXU.js → chunk-WPHCUGN7.js} +10 -1
  44. package/dist/{chunk-3ECW2K2O.js → chunk-WR7H7VLJ.js} +2 -2
  45. package/dist/{chunk-TPTJEHUE.js → chunk-X2IPNCB5.js} +61 -25
  46. package/dist/{chunk-UWGTSF5O.js → chunk-ZIX4PNBI.js} +129 -91
  47. package/dist/{chunk-PWC24W5F.js → chunk-ZSHL44IQ.js} +2 -2
  48. package/dist/cli/chat.js +21 -21
  49. package/dist/cli/check.js +3 -3
  50. package/dist/cli/plugins.js +9 -9
  51. package/dist/cli/snapshot-warmup.js +5 -5
  52. package/dist/cli/upgrade.js +85 -13
  53. package/dist/db/postgres-json.d.ts +5 -0
  54. package/dist/{db-RCZB7KNM.js → db-6QP6HY7U.js} +4 -4
  55. package/dist/{detail-4EPUMSDU.js → detail-OEIVZYXS.js} +11 -11
  56. package/dist/{detail-CD4SPJ4K.js → detail-V37NTVBN.js} +7 -7
  57. package/dist/instrumentation.js +2 -2
  58. package/dist/{legacy-import-VCYLWT2V.js → legacy-import-R3BMM2GH.js} +5 -5
  59. package/dist/{list-J6ROVH56.js → list-AJ6RWBOG.js} +7 -7
  60. package/dist/{list-7L5LY2WU.js → list-FWLIZHSW.js} +7 -7
  61. package/dist/list-NTUT6A5M.js +121 -0
  62. package/dist/{plugin-conversations-JANXC4GA.js → plugin-conversations-F3IBVNFX.js} +7 -7
  63. package/dist/{profile-6NRWEKMZ.js → profile-3FRQP4HP.js} +7 -7
  64. package/dist/{runner-CZIKSWGC.js → runner-C2ZTIOUD.js} +12 -12
  65. package/dist/{skills-MAZXZ2KE.js → skills-722AXRV5.js} +3 -3
  66. package/dist/{stats-Q5FRUXLY.js → stats-7UFY6FPE.js} +6 -6
  67. package/dist/{subagent-YIINCFAS.js → subagent-X3ZWJHR4.js} +10 -10
  68. package/dist/{validation-FMEAEKCY.js → validation-EUI2UFRM.js} +3 -3
  69. package/package.json +6 -6
  70. package/dist/list-DA2ATOM4.js +0 -80
@@ -3,14 +3,14 @@ import {
3
3
  isConversationScopedChannel,
4
4
  isDmChannel,
5
5
  normalizeSlackConversationId
6
- } from "./chunk-FP5N5OWZ.js";
6
+ } from "./chunk-IQ36I3DF.js";
7
7
  import {
8
8
  createPluginLogger,
9
9
  createPluginState
10
- } from "./chunk-PWC24W5F.js";
10
+ } from "./chunk-ZSHL44IQ.js";
11
11
  import {
12
12
  getDb
13
- } from "./chunk-VHRM6GNH.js";
13
+ } from "./chunk-QZGVPPIJ.js";
14
14
  import {
15
15
  SANDBOX_WORKSPACE_ROOT
16
16
  } from "./chunk-G3E7SCME.js";
@@ -18,13 +18,13 @@ import {
18
18
  botConfig,
19
19
  completeObject,
20
20
  embedTexts
21
- } from "./chunk-A7X2FDUO.js";
21
+ } from "./chunk-SHBPSE7A.js";
22
22
  import {
23
23
  isActorUserId,
24
24
  logInfo,
25
25
  logWarn,
26
26
  parseActorUserId
27
- } from "./chunk-I35CTGPO.js";
27
+ } from "./chunk-AEWZ7F65.js";
28
28
  import {
29
29
  parseSlackChannelReferenceId,
30
30
  parseSlackMessageTs,
@@ -108,14 +108,8 @@ var CREDENTIAL_SUBJECT_SIGNATURE_VERSION = "v1";
108
108
  function getCredentialSubjectSecret() {
109
109
  return process.env.JUNIOR_SECRET?.trim() || void 0;
110
110
  }
111
- function buildPayload(input) {
112
- return [
113
- CREDENTIAL_SUBJECT_HMAC_CONTEXT,
114
- input.allowedWhen,
115
- input.teamId,
116
- input.channelId,
117
- input.userId
118
- ].join("\0");
111
+ function buildPayload(parts) {
112
+ return [CREDENTIAL_SUBJECT_HMAC_CONTEXT, ...parts].join("\0");
119
113
  }
120
114
  function signPayload(secret, payload) {
121
115
  const digest = createHmac("sha256", secret).update(payload).digest("hex");
@@ -161,12 +155,7 @@ function bindSlackDirectCredentialSubject(input) {
161
155
  channelId,
162
156
  signature: signPayload(
163
157
  secret,
164
- buildPayload({
165
- allowedWhen: subject.allowedWhen,
166
- teamId,
167
- channelId,
168
- userId
169
- })
158
+ buildPayload([subject.allowedWhen, teamId, channelId, userId])
170
159
  )
171
160
  }
172
161
  };
@@ -184,12 +173,57 @@ function verifySlackDirectCredentialSubject(input) {
184
173
  }
185
174
  const expected = signPayload(
186
175
  secret,
187
- buildPayload({
188
- allowedWhen: subject.allowedWhen,
189
- teamId: binding.teamId,
190
- channelId: binding.channelId,
191
- userId: subject.userId
192
- })
176
+ buildPayload([
177
+ subject.allowedWhen,
178
+ binding.teamId,
179
+ binding.channelId,
180
+ subject.userId
181
+ ])
182
+ );
183
+ return timingSafeMatch(expected, binding.signature);
184
+ }
185
+ function bindScheduledTaskCredentialSubject(input) {
186
+ const secret = getCredentialSubjectSecret();
187
+ const plugin = input.plugin.trim();
188
+ const userId = parseActorUserId(input.subject.userId);
189
+ if (!secret || plugin !== "scheduler" || !userId || input.subject.allowedWhen !== "scheduled-task") {
190
+ return void 0;
191
+ }
192
+ const taskId = input.subject.taskId;
193
+ if (!taskId || taskId !== taskId.trim()) {
194
+ return void 0;
195
+ }
196
+ return {
197
+ type: "user",
198
+ userId,
199
+ allowedWhen: "scheduled-task",
200
+ taskId,
201
+ binding: {
202
+ type: "scheduled-task",
203
+ plugin,
204
+ taskId,
205
+ signature: signPayload(
206
+ secret,
207
+ buildPayload(["scheduled-task", plugin, taskId, userId])
208
+ )
209
+ }
210
+ };
211
+ }
212
+ function verifyScheduledTaskCredentialSubject(input) {
213
+ const secret = getCredentialSubjectSecret();
214
+ const { subject } = input;
215
+ const binding = subject.binding;
216
+ if (!secret || input.plugin !== "scheduler" || subject.type !== "user" || !isActorUserId(subject.userId) || subject.allowedWhen !== "scheduled-task" || !subject.taskId || binding.type !== "scheduled-task" || binding.plugin !== input.plugin || binding.taskId !== subject.taskId) {
217
+ return false;
218
+ }
219
+ const expected = signPayload(
220
+ secret,
221
+ buildPayload([
222
+ "scheduled-task",
223
+ binding.plugin,
224
+ binding.taskId,
225
+ subject.userId
226
+ ])
193
227
  );
194
228
  return timingSafeMatch(expected, binding.signature);
195
229
  }
@@ -1008,6 +1042,8 @@ export {
1008
1042
  getSlackToolContext,
1009
1043
  bindSlackDirectCredentialSubject,
1010
1044
  verifySlackDirectCredentialSubject,
1045
+ bindScheduledTaskCredentialSubject,
1046
+ verifyScheduledTaskCredentialSubject,
1011
1047
  resolveChannelCapabilities,
1012
1048
  PluginHookDeniedError,
1013
1049
  validatePlugins,