@sentry/junior 0.321.0 → 0.322.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 (65) hide show
  1. package/dist/{adapter-BkDQYdg6.js → adapter-CKtEUuWD.js} +23 -2
  2. package/dist/{admin-XS3G9BOj.js → admin-BGOiUGwR.js} +1 -1
  3. package/dist/{agent-CL9ZkOgx.js → agent-OUkEw6Bv.js} +272 -1647
  4. package/dist/{agent-status-Bq_AIpyp.js → agent-status-C_HHxO_d.js} +1 -10
  5. package/dist/{agent-update-delivery-t0bXEgPs.js → agent-update-delivery-H6mnPI4q.js} +4 -4
  6. package/dist/api/schema.d.ts +98 -6
  7. package/dist/api/schema.js +6 -6
  8. package/dist/api.js +81 -36
  9. package/dist/{app-CwFRvmEH.d.ts → app-BK_vhZIq.d.ts} +1 -1
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +85 -48
  12. package/dist/{change-record-CRuG9Mu3.d.ts → change-record-DdrJxahk.d.ts} +26 -10
  13. package/dist/{channel-access-BUHB0saC.js → channel-access-DRhVJIuQ.js} +1 -1
  14. package/dist/{chat-core-engine-DuBaPbqK.js → chat-core-engine-El308gYr.js} +5 -10
  15. package/dist/cli/chat.js +16 -16
  16. package/dist/cli/check.js +4 -4
  17. package/dist/cli/main.js +2 -2
  18. package/dist/cli/plugins.js +3 -3
  19. package/dist/cli/snapshot-create.js +4 -4
  20. package/dist/cli/upgrade.js +2 -2
  21. package/dist/{continue-in-slack-D9naZmqM.js → continue-in-slack-DYl631oM.js} +3 -3
  22. package/dist/{conversation-feed-B1_1NJc8.js → conversation-feed-BUaMmSLi.js} +1 -1
  23. package/dist/{conversation-privacy-C0mixZKx.js → conversation-privacy-DR_j5Tqf.js} +1 -1
  24. package/dist/{create-CLV0M1vw.js → create-ZkI-_JAs.js} +2 -2
  25. package/dist/{credential-sync-DL9r-ry5.js → credential-sync-Bo6_FtCI.js} +12 -12
  26. package/dist/{db-CbURDbaB.js → db-RDpWIeRK.js} +1733 -213
  27. package/dist/{deployment-D9uPRDMD.js → deployment-CeKaP0ZJ.js} +1 -1
  28. package/dist/{html-l4hKICAL.js → html-BMv4fAPu.js} +5 -5
  29. package/dist/instrumentation.js +2 -2
  30. package/dist/{list-cGaO9_Hf.js → list-CuLf7Ob2.js} +38 -35
  31. package/dist/{logging-CqgOoICc.js → logging-BQsfrLHl.js} +1 -1
  32. package/dist/{markers-BtUv4-oc.js → markers-Bh0vqJ5k.js} +3178 -1748
  33. package/dist/nitro.d.ts +1 -1
  34. package/dist/nitro.js +3 -4
  35. package/dist/{oauth-callback-server-C3GxhsuB.js → oauth-callback-server-BxuN0Jqz.js} +2 -2
  36. package/dist/{oauth-relay-BGm6sLCB.js → oauth-relay-vyG2gOwY.js} +1 -1
  37. package/dist/{profile-bLo0h7Le.js → profile-DiAB4QfT.js} +31 -6
  38. package/dist/{prompt-CX29OGO9.js → prompt-5PDkRQ1K.js} +2 -1
  39. package/dist/{reports-DeDCCu_H.js → reports-CbqB7unq.js} +2 -2
  40. package/dist/{resolve-D9RKNH3v.js → resolve-C7e0pwuP.js} +5 -5
  41. package/dist/{result-BFBwK1M2.js → result-D_D-2Adp.js} +5 -5
  42. package/dist/{runner-DNdoVQg8.js → runner-CCVTdp0x.js} +7 -7
  43. package/dist/{sandbox-egress-signals-BBcCiEhm.js → sandbox-egress-signals-D4OKOFgy.js} +1 -1
  44. package/dist/{schema-RzsplzdI.js → schema-CmPO8BfI.js} +50 -12
  45. package/dist/{service-account-B7E7OIFP.js → service-account-CeWsFrBi.js} +2 -2
  46. package/dist/{skills-DMJsS5e4.js → skills-DfbOjWxl.js} +5 -5
  47. package/dist/{slack-conversation-unfurl-EWYTnBZI.js → slack-conversation-unfurl-BxF0Yb3-.js} +10 -9
  48. package/dist/{system-prompt-table-C886lsT9.js → system-prompt-table-DySHMtu0.js} +15 -15
  49. package/dist/{topics-DxuKurCX.js → topic-ChZe9WPj.js} +6 -1
  50. package/dist/{engine-context-BP0h6u4m.js → turn-ended-DQ10G3in.js} +11 -845
  51. package/dist/{types-CGgQ3-Bb.js → types-BWAgOJtR.js} +95 -70
  52. package/dist/{user-customization-CvfuY9Eo.js → user-customization-DNzu_r1x.js} +10 -1
  53. package/dist/{users-DBrcQl47.js → users-BmZlg_ci.js} +13 -7
  54. package/dist/{validation-CofUHWqz.js → validation-BU4tXvH3.js} +1 -1
  55. package/dist/{version-D_vbXyNw.js → version-D9yLYOBu.js} +1 -1
  56. package/dist/version.js +1 -1
  57. package/dist/{worker-buhFcpl9.js → worker-C7EDSL3d.js} +4 -4
  58. package/migrations/20261127184420_question_answerer/migration.sql +36 -0
  59. package/migrations/20261127184420_question_answerer/snapshot.json +108 -0
  60. package/migrations/20261127224730_inbox_item_close_action/migration.sql +1 -0
  61. package/migrations/20261127224730_inbox_item_close_action/snapshot.json +42 -0
  62. package/package.json +6 -6
  63. package/skills/design-automation-skill/SKILL.md +1 -1
  64. package/dist/storage-XD0lB4Gk.js +0 -273
  65. package/dist/topic-B2EWKKBT.js +0 -6
@@ -1,273 +0,0 @@
1
- import { R as getChatConfig } from "./adapter-BkDQYdg6.js";
2
- import { G as mapBounded } from "./prompt-CX29OGO9.js";
3
- import * as z from "zod";
4
- import { AwsClient } from "aws4fetch";
5
- import { del, get, issueSignedToken, presignUrl, put } from "@vercel/blob";
6
- // src/chat/attachments/memory.ts
7
- /**
8
- * Store attachments in process memory, for tests.
9
- *
10
- * Objects are lost when the process stops, and each process has its own
11
- * copy. Do not use this provider for deployed apps.
12
- */
13
- function createMemoryAttachmentStorage() {
14
- const objects = /* @__PURE__ */ new Map();
15
- return {
16
- objects,
17
- provider: "memory",
18
- async put(input) {
19
- objects.set(input.key, Buffer.from(await new Response(input.body).arrayBuffer()));
20
- },
21
- async get(key, range) {
22
- const body = objects.get(key);
23
- if (!body) return null;
24
- const bytes = range ? body.subarray(range.start, range.end + 1) : body;
25
- return new ReadableStream({ start(controller) {
26
- controller.enqueue(new Uint8Array(bytes));
27
- controller.close();
28
- } });
29
- },
30
- async delete(keys) {
31
- for (const key of keys) objects.delete(key);
32
- }
33
- };
34
- }
35
- // src/chat/attachments/s3.ts
36
- const S3_DELETE_CONCURRENCY = 8;
37
- /**
38
- * Path-style object URL. Local S3 servers and AWS S3 both accept it.
39
- *
40
- * URL parsing removes `.` and `..` segments, also in `%2e` form. A key with
41
- * such a segment would address a different object, so reject it.
42
- */
43
- function objectUrl(config, key) {
44
- const endpoint = config.endpoint.replace(/\/+$/, "");
45
- const segments = key.split("/");
46
- if (segments.some((segment) => segment === "." || segment === "..")) throw new Error("S3 object keys cannot contain . or .. path segments");
47
- const path = segments.map(encodeURIComponent).join("/");
48
- return `${endpoint}/${encodeURIComponent(config.bucket)}/${path}`;
49
- }
50
- /**
51
- * Read a small S3 response body to the end so the connection is released.
52
- *
53
- * Error and empty bodies are small. `body.cancel()` can hang under the test
54
- * HTTP interceptor, so read the body instead.
55
- */
56
- async function drain(response) {
57
- await response.arrayBuffer();
58
- }
59
- /** Throw on a failed S3 response, and release the response body. */
60
- async function expectOk(response, operation) {
61
- await drain(response);
62
- if (!response.ok) throw new Error(`S3 ${operation} failed with status ${response.status}`);
63
- }
64
- /** Presigned URL lifetime in whole seconds, at least one. */
65
- function expiresInSeconds(expiresAtMs) {
66
- return String(Math.max(1, Math.ceil((expiresAtMs - Date.now()) / 1e3)));
67
- }
68
- /** Store private conversation attachments in an S3-compatible bucket. */
69
- function createS3AttachmentStorage(config) {
70
- const client = new AwsClient({
71
- accessKeyId: config.accessKeyId,
72
- region: config.region,
73
- secretAccessKey: config.secretAccessKey,
74
- service: "s3"
75
- });
76
- const writeClient = new AwsClient({
77
- accessKeyId: config.accessKeyId,
78
- region: config.region,
79
- retries: 0,
80
- secretAccessKey: config.secretAccessKey,
81
- service: "s3"
82
- });
83
- return {
84
- provider: "s3",
85
- async put(input) {
86
- await expectOk(await writeClient.fetch(objectUrl(config, input.key), {
87
- body: input.body,
88
- headers: {
89
- "content-length": String(input.bytes),
90
- "content-type": input.contentType,
91
- "x-amz-content-sha256": "UNSIGNED-PAYLOAD"
92
- },
93
- method: "PUT"
94
- }), "put");
95
- },
96
- async createUploadTarget(input) {
97
- const url = new URL(objectUrl(config, input.key));
98
- url.searchParams.set("X-Amz-Expires", expiresInSeconds(input.expiresAtMs));
99
- const browserHeaders = {
100
- "content-type": input.contentType,
101
- "if-none-match": "*"
102
- };
103
- return {
104
- headers: browserHeaders,
105
- method: "PUT",
106
- url: (await client.sign(url.toString(), {
107
- aws: {
108
- allHeaders: true,
109
- signQuery: true
110
- },
111
- headers: {
112
- ...browserHeaders,
113
- "content-length": String(input.bytes)
114
- },
115
- method: "PUT"
116
- })).url
117
- };
118
- },
119
- async createDownloadUrl(input) {
120
- const url = new URL(objectUrl(config, input.key));
121
- url.searchParams.set("X-Amz-Expires", expiresInSeconds(input.expiresAtMs));
122
- return (await client.sign(url.toString(), {
123
- aws: { signQuery: true },
124
- method: "GET"
125
- })).url;
126
- },
127
- async get(key, range) {
128
- const response = await client.fetch(objectUrl(config, key), range ? { headers: { range: rangeHeader(range) } } : void 0);
129
- if (response.status === 404) {
130
- await drain(response);
131
- return null;
132
- }
133
- if (!response.ok) await expectOk(response, "get");
134
- if (range && response.status !== 206) {
135
- await drain(response);
136
- throw new Error(`S3 get ignored the byte range with status ${response.status}`);
137
- }
138
- return response.body;
139
- },
140
- async delete(keys) {
141
- await mapBounded(keys, async (key) => {
142
- const response = await client.fetch(objectUrl(config, key), { method: "DELETE" });
143
- if (response.status === 404) {
144
- await drain(response);
145
- return;
146
- }
147
- await expectOk(response, "delete");
148
- }, S3_DELETE_CONCURRENCY);
149
- }
150
- };
151
- }
152
- // src/chat/attachments/vercel.ts
153
- const BLOB_API_VERSION = "12";
154
- const delegationPayloadSchema = z.object({ storeId: z.string().min(1) });
155
- /**
156
- * Read the store id from a delegation token, as the SDK does for its own
157
- * presigned requests. The token payload is base64url JSON before the dot.
158
- */
159
- function delegationStoreId(delegationToken) {
160
- const { storeId } = delegationPayloadSchema.parse(JSON.parse(Buffer.from(delegationToken.split(".")[0] ?? "", "base64url").toString()));
161
- return storeId.replace(/^store_/, "");
162
- }
163
- /** Store private conversation attachments in Vercel Blob. */
164
- function createVercelAttachmentStorage() {
165
- return {
166
- provider: "vercel-blob",
167
- async put(input) {
168
- await put(input.key, input.body, {
169
- access: "private",
170
- addRandomSuffix: false,
171
- allowOverwrite: true,
172
- contentType: input.contentType
173
- });
174
- },
175
- async createUploadTarget(input) {
176
- const limits = {
177
- allowedContentTypes: [input.contentType],
178
- maximumSizeInBytes: input.bytes,
179
- validUntil: input.expiresAtMs
180
- };
181
- const token = await issueSignedToken({
182
- ...limits,
183
- operations: ["put"],
184
- pathname: input.key
185
- });
186
- const { presignedUrl } = await presignUrl(token, {
187
- ...limits,
188
- access: "private",
189
- addRandomSuffix: false,
190
- allowOverwrite: false,
191
- operation: "put",
192
- pathname: input.key
193
- });
194
- return {
195
- headers: {
196
- "x-api-version": BLOB_API_VERSION,
197
- "x-content-type": input.contentType,
198
- "x-vercel-blob-access": "private",
199
- "x-vercel-blob-store-id": delegationStoreId(token.delegationToken)
200
- },
201
- method: "PUT",
202
- url: presignedUrl
203
- };
204
- },
205
- async createDownloadUrl(input) {
206
- const token = await issueSignedToken({
207
- operations: ["get"],
208
- pathname: input.key,
209
- validUntil: input.expiresAtMs
210
- });
211
- const { presignedUrl } = await presignUrl(token, {
212
- access: "private",
213
- operation: "get",
214
- pathname: input.key,
215
- useCache: false,
216
- validUntil: input.expiresAtMs
217
- });
218
- return presignedUrl;
219
- },
220
- async get(key, range) {
221
- const result = await get(key, {
222
- access: "private",
223
- useCache: false,
224
- ...range ? { headers: { range: rangeHeader(range) } } : void 0
225
- });
226
- if (result?.statusCode !== 200) return null;
227
- if (range && !result.headers.get("content-range")) {
228
- await result.stream.cancel();
229
- throw new Error("Vercel Blob get ignored the byte range");
230
- }
231
- return result.stream;
232
- },
233
- async delete(keys) {
234
- if (keys.length === 0) return;
235
- await del(keys);
236
- }
237
- };
238
- }
239
- // src/chat/attachments/storage.ts
240
- /** Stream bytes that are already in memory to `AttachmentStorage.put`. */
241
- function bufferBody(data) {
242
- return new ReadableStream({ start(controller) {
243
- controller.enqueue(data);
244
- controller.close();
245
- } });
246
- }
247
- /** Build the HTTP `Range` request header value for one byte range. */
248
- function rangeHeader(range) {
249
- return `bytes=${range.start}-${range.end}`;
250
- }
251
- /**
252
- * Return attachment storage for the configured provider.
253
- *
254
- * Callers do not choose a provider. Chat config decides it.
255
- */
256
- function getAttachmentStorage() {
257
- return createAttachmentStorage(getChatConfig().attachmentStorage);
258
- }
259
- /**
260
- * Create attachment storage for one provider config.
261
- *
262
- * Runtime code uses `getAttachmentStorage()`. Call this only to test a
263
- * provider adapter with its own config.
264
- */
265
- function createAttachmentStorage(config) {
266
- switch (config.provider) {
267
- case "vercel-blob": return createVercelAttachmentStorage();
268
- case "s3": return createS3AttachmentStorage(config.s3);
269
- case "memory": return createMemoryAttachmentStorage();
270
- default: throw new Error(`Unsupported attachment storage provider: ${String(config.provider)}`);
271
- }
272
- }
273
- export { getAttachmentStorage as n, bufferBody as t };
@@ -1,6 +0,0 @@
1
- // src/core/turn/topic.ts
2
- /** Queue topic of Turn step messages. */
3
- const TURN_STEP_TOPIC = "junior_turn_step";
4
- /** Queue topic of the messages that say a Turn ended. */
5
- const TURN_ENDED_TOPIC = "junior_turn_ended";
6
- export { TURN_STEP_TOPIC as n, TURN_ENDED_TOPIC as t };