@sentry/junior 0.177.0 → 0.178.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 (91) hide show
  1. package/dist/{agent-hooks-IYHCN7CO.js → agent-hooks-PBT4NNBV.js} +12 -12
  2. package/dist/api/conversations/archive.d.ts +5 -2
  3. package/dist/api/conversations/list.d.ts +0 -1
  4. package/dist/api/conversations/membership.d.ts +14 -0
  5. package/dist/api/conversations/projection.d.ts +2 -1
  6. package/dist/api/locations/detail.d.ts +1 -1
  7. package/dist/api/people/shared.d.ts +2 -2
  8. package/dist/api/schema/conversation.d.ts +4 -4
  9. package/dist/api/schema/location.d.ts +1 -1
  10. package/dist/api/schema/person.d.ts +1 -1
  11. package/dist/api/schema.js +1 -1
  12. package/dist/api.js +245 -166
  13. package/dist/app.js +35 -35
  14. package/dist/{catalog-runtime-2TD4CXSB.js → catalog-runtime-M7QGKPFZ.js} +5 -5
  15. package/dist/chat/agent/sandbox.d.ts +2 -0
  16. package/dist/chat/conversations/sql/participants.d.ts +1 -0
  17. package/dist/chat/conversations/store.d.ts +0 -1
  18. package/dist/chat/sandbox/errors.d.ts +4 -0
  19. package/dist/chat/sandbox/noninteractive-command.d.ts +1 -0
  20. package/dist/chat/sandbox/prepare-workspace.d.ts +27 -3
  21. package/dist/chat/sandbox/sandbox.d.ts +2 -0
  22. package/dist/chat/sandbox/session.d.ts +2 -0
  23. package/dist/chat/sandbox/snapshot/builder-sandbox.d.ts +5 -0
  24. package/dist/chat/sandbox/snapshot/install.d.ts +2 -2
  25. package/dist/chat/sandbox/snapshot/span.d.ts +3 -0
  26. package/dist/chat/sandbox/snapshot/store.d.ts +20 -17
  27. package/dist/chat/sandbox/snapshot/waiting-error.d.ts +15 -0
  28. package/dist/chat/sandbox/snapshot/workspace.d.ts +17 -0
  29. package/dist/chat/services/workspace-snapshot-wait.d.ts +27 -0
  30. package/dist/chat/workspaces/types.d.ts +1 -0
  31. package/dist/{chunk-3FWXQZJJ.js → chunk-22T3HB44.js} +1 -1
  32. package/dist/{chunk-DLTP6TUJ.js → chunk-3ZZEPLLB.js} +2 -2
  33. package/dist/{chunk-7ZFESKJ2.js → chunk-4K6VNP3S.js} +9 -9
  34. package/dist/{chunk-N4YEVOEC.js → chunk-534BO42N.js} +45 -276
  35. package/dist/{chunk-6NZRKJWU.js → chunk-6OYVH66J.js} +1 -1
  36. package/dist/{chunk-J2EWL6GJ.js → chunk-ABLODWPO.js} +1 -1
  37. package/dist/{chunk-ORMJY4RG.js → chunk-AGJ4OQ2V.js} +1 -1
  38. package/dist/{chunk-Q362TECJ.js → chunk-AQHSXA3J.js} +331 -2
  39. package/dist/{chunk-4SVAFAI2.js → chunk-AVRWMQ4U.js} +1 -1
  40. package/dist/{chunk-I7PKGMKI.js → chunk-BFLMRTPD.js} +6 -6
  41. package/dist/{chunk-ZCYABD7N.js → chunk-BHHWCNXI.js} +5 -5
  42. package/dist/{chunk-LFZODSAY.js → chunk-BUGO42R6.js} +4 -4
  43. package/dist/{chunk-7B6NW4P7.js → chunk-D3UJTX4U.js} +1 -1
  44. package/dist/{chunk-2IMQLZHS.js → chunk-FQ6BMP5P.js} +767 -81
  45. package/dist/{chunk-4TWDRU64.js → chunk-G3CQEUHI.js} +5 -5
  46. package/dist/{chunk-VGDOEKO2.js → chunk-H6ZXBFGX.js} +1 -1
  47. package/dist/{chunk-SNPQGTHJ.js → chunk-IQRPDKPJ.js} +1 -1
  48. package/dist/{chunk-CAWBLVBY.js → chunk-JVXZ3WDH.js} +6 -6
  49. package/dist/{chunk-7PZDAXIK.js → chunk-KEQAA42D.js} +1 -1
  50. package/dist/{chunk-UB5YB2ED.js → chunk-LAOP4EPL.js} +6 -6
  51. package/dist/{chunk-WYO2HXY5.js → chunk-OGRD5PFM.js} +1 -1
  52. package/dist/{chunk-AFOFVEXP.js → chunk-PRDKO3QB.js} +124 -13
  53. package/dist/{chunk-QLLOX7JY.js → chunk-QCCLDJHB.js} +8 -8
  54. package/dist/{chunk-FVVYHML7.js → chunk-RE4XWXBV.js} +6 -6
  55. package/dist/{chunk-4TRHPYTL.js → chunk-RGV6KHDM.js} +4 -4
  56. package/dist/{chunk-DGGIKWYQ.js → chunk-RGXOLPWO.js} +1 -1
  57. package/dist/{chunk-ELEAIRTG.js → chunk-TKB25A3L.js} +2 -2
  58. package/dist/{chunk-6KGMMVHF.js → chunk-U3UDPGZG.js} +2 -2
  59. package/dist/{chunk-7CVYXUOJ.js → chunk-UGWBJAGN.js} +1 -1
  60. package/dist/{chunk-LVL5NG5G.js → chunk-UMG7M32G.js} +19 -19
  61. package/dist/{chunk-LPMLAJYR.js → chunk-XCNS3CXE.js} +11 -17
  62. package/dist/{chunk-PA7QDS7P.js → chunk-XWUJWHFD.js} +204 -100
  63. package/dist/{chunk-WCQUKX74.js → chunk-ZCHHVTMF.js} +14 -5
  64. package/dist/cli/chat.js +31 -30
  65. package/dist/cli/check.js +6 -6
  66. package/dist/cli/plugins.js +13 -13
  67. package/dist/cli/snapshot-create.js +10 -10
  68. package/dist/cli/upgrade.js +7 -7
  69. package/dist/db/schema/conversation-participants.d.ts +17 -0
  70. package/dist/db/schema/conversations.d.ts +629 -1
  71. package/dist/db/schema/snapshots.d.ts +1 -1
  72. package/dist/db/schema.d.ts +18 -1
  73. package/dist/{db-A3CB76US.js → db-QVYOWATH.js} +7 -7
  74. package/dist/instrumentation.js +4 -4
  75. package/dist/nitro.js +2 -2
  76. package/dist/{oauth-callback-server-64QMI3IB.js → oauth-callback-server-PLPAFXO6.js} +23 -23
  77. package/dist/{runner-EIAE2BGD.js → runner-AGNEIOZS.js} +15 -15
  78. package/dist/{skills-ZADWFKDG.js → skills-U5KQ66EM.js} +6 -6
  79. package/dist/spawn-ZRYYZP2B.js +37 -0
  80. package/dist/{validation-4I6AF4CV.js → validation-QE4U45KS.js} +6 -6
  81. package/dist/version.js +1 -1
  82. package/dist/{work-BS6BZ66U.js → work-ATAXAHJJ.js} +18 -18
  83. package/dist/worker-LIL5AOER.js +24 -0
  84. package/migrations/0033_workspace_snapshot_active_build.sql +1 -0
  85. package/migrations/0034_strong_randall.sql +31 -0
  86. package/migrations/meta/0033_snapshot.json +2914 -0
  87. package/migrations/meta/0034_snapshot.json +3038 -0
  88. package/migrations/meta/_journal.json +15 -1
  89. package/package.json +5 -5
  90. package/dist/spawn-DVUOUFFC.js +0 -37
  91. package/dist/worker-RS5PWTCE.js +0 -24
@@ -1,21 +1,19 @@
1
1
  import {
2
2
  SANDBOX_WORKSPACE_ROOT,
3
3
  create,
4
+ getVercelSandboxCredentials,
5
+ isSandboxUnavailableError,
4
6
  isStale,
5
7
  runNonInteractiveCommand,
6
8
  sleep
7
- } from "./chunk-Q362TECJ.js";
9
+ } from "./chunk-AQHSXA3J.js";
8
10
  import {
9
11
  getStateAdapter
10
- } from "./chunk-VGDOEKO2.js";
11
- import {
12
- toOptionalTrimmed
13
- } from "./chunk-DLTP6TUJ.js";
12
+ } from "./chunk-H6ZXBFGX.js";
14
13
  import {
15
14
  setSpanAttributes,
16
- setSpanStatus,
17
15
  withSpan
18
- } from "./chunk-7CVYXUOJ.js";
16
+ } from "./chunk-UGWBJAGN.js";
19
17
 
20
18
  // src/chat/sandbox/resources.ts
21
19
  var configuredResources;
@@ -53,18 +51,17 @@ function getSandboxResources() {
53
51
  import { Sandbox } from "@vercel/sandbox";
54
52
  import { z } from "zod";
55
53
 
56
- // src/chat/sandbox/credentials.ts
57
- function getVercelSandboxCredentials() {
58
- const token = toOptionalTrimmed(process.env.VERCEL_TOKEN);
59
- const teamId = toOptionalTrimmed(process.env.VERCEL_TEAM_ID);
60
- const projectId = toOptionalTrimmed(process.env.VERCEL_PROJECT_ID);
61
- if (token && teamId && projectId) {
62
- return { token, teamId, projectId };
63
- }
64
- return void 0;
65
- }
66
-
67
54
  // src/chat/sandbox/snapshot/span.ts
55
+ function setSnapshotSpanAttributes(snapshot) {
56
+ setSpanAttributes({
57
+ "app.sandbox.source": snapshot.snapshotId ? "snapshot" : "created",
58
+ "app.sandbox.snapshot.cache_hit": snapshot.cacheHit,
59
+ "app.sandbox.snapshot.resolve_outcome": snapshot.resolveOutcome,
60
+ ...snapshot.profileHash ? { "app.sandbox.snapshot.profile_hash": snapshot.profileHash } : {},
61
+ "app.sandbox.snapshot.dependency_count": snapshot.dependencyCount,
62
+ ...snapshot.rebuildReason ? { "app.sandbox.snapshot.rebuild_reason": snapshot.rebuildReason } : {}
63
+ });
64
+ }
68
65
  async function trace(name, op, attributes, callback) {
69
66
  return await withSpan(name, op, {}, callback, attributes);
70
67
  }
@@ -82,12 +79,13 @@ async function tryRun(sandbox, params) {
82
79
  const result = await runNonInteractiveCommand(sandbox, params);
83
80
  return result.exitCode === 0;
84
81
  }
85
- async function installGh(sandbox, signal) {
82
+ async function installGh(sandbox, signal, timeoutMs) {
86
83
  const installed = await tryRun(sandbox, {
87
84
  cmd: "dnf",
88
85
  args: ["install", "-y", "gh"],
89
86
  signal,
90
- sudo: true
87
+ sudo: true,
88
+ timeoutMs
91
89
  });
92
90
  if (installed) {
93
91
  return;
@@ -100,7 +98,8 @@ async function installGh(sandbox, signal) {
100
98
  "--from-repofile=https://cli.github.com/packages/rpm/gh-cli.repo"
101
99
  ],
102
100
  signal,
103
- sudo: true
101
+ sudo: true,
102
+ timeoutMs
104
103
  });
105
104
  if (!repoAdded) {
106
105
  await runOrThrow(
@@ -109,7 +108,8 @@ async function installGh(sandbox, signal) {
109
108
  cmd: "dnf",
110
109
  args: ["install", "-y", "dnf-command(config-manager)"],
111
110
  signal,
112
- sudo: true
111
+ sudo: true,
112
+ timeoutMs
113
113
  },
114
114
  "dnf install dnf-command(config-manager)"
115
115
  );
@@ -123,7 +123,8 @@ async function installGh(sandbox, signal) {
123
123
  "https://cli.github.com/packages/rpm/gh-cli.repo"
124
124
  ],
125
125
  signal,
126
- sudo: true
126
+ sudo: true,
127
+ timeoutMs
127
128
  },
128
129
  "dnf config-manager --add-repo gh-cli.repo"
129
130
  );
@@ -134,7 +135,8 @@ async function installGh(sandbox, signal) {
134
135
  cmd: "dnf",
135
136
  args: ["install", "-y", "gh", "--repo", "gh-cli"],
136
137
  signal,
137
- sudo: true
138
+ sudo: true,
139
+ timeoutMs
138
140
  },
139
141
  "dnf install gh --repo gh-cli"
140
142
  );
@@ -151,21 +153,23 @@ function filePath(url, sha256) {
151
153
  const sanitized = basename.replace(/[^a-zA-Z0-9._-]/g, "_");
152
154
  return `/tmp/junior-runtime-${sha256.slice(0, 12)}-${sanitized}`;
153
155
  }
154
- async function installUrl(sandbox, dependency, signal) {
156
+ async function installUrl(sandbox, dependency, signal, timeoutMs) {
155
157
  const rpmPath = filePath(dependency.url, dependency.sha256);
156
158
  await runOrThrow(
157
159
  sandbox,
158
160
  {
159
161
  cmd: "curl",
160
162
  args: ["-fsSL", dependency.url, "-o", rpmPath],
161
- signal
163
+ signal,
164
+ timeoutMs
162
165
  },
163
166
  `curl download ${dependency.url}`
164
167
  );
165
168
  const checksum = await runNonInteractiveCommand(sandbox, {
166
169
  cmd: "sha256sum",
167
170
  args: [rpmPath],
168
- signal
171
+ signal,
172
+ timeoutMs
169
173
  });
170
174
  const expected = dependency.sha256;
171
175
  const actual = checksum.stdout.trim().split(/\s+/)[0]?.toLowerCase();
@@ -187,12 +191,13 @@ async function installUrl(sandbox, dependency, signal) {
187
191
  cmd: "dnf",
188
192
  args: ["install", "-y", rpmPath],
189
193
  signal,
190
- sudo: true
194
+ sudo: true,
195
+ timeoutMs
191
196
  },
192
197
  `dnf install ${dependency.url}`
193
198
  );
194
199
  }
195
- async function dependencies(sandbox, values, signal) {
200
+ async function dependencies(sandbox, values, signal, timeoutMs) {
196
201
  const system = values.filter(
197
202
  (dependency) => dependency.type === "system"
198
203
  );
@@ -210,9 +215,9 @@ async function dependencies(sandbox, values, signal) {
210
215
  for (const dependency of system) {
211
216
  signal?.throwIfAborted();
212
217
  if ("url" in dependency) {
213
- await installUrl(sandbox, dependency, signal);
218
+ await installUrl(sandbox, dependency, signal, timeoutMs);
214
219
  } else if (dependency.package === "gh") {
215
- await installGh(sandbox, signal);
220
+ await installGh(sandbox, signal, timeoutMs);
216
221
  } else {
217
222
  await runOrThrow(
218
223
  sandbox,
@@ -220,7 +225,8 @@ async function dependencies(sandbox, values, signal) {
220
225
  cmd: "dnf",
221
226
  args: ["install", "-y", dependency.package],
222
227
  signal,
223
- sudo: true
228
+ sudo: true,
229
+ timeoutMs
224
230
  },
225
231
  `dnf install ${dependency.package}`
226
232
  );
@@ -248,7 +254,8 @@ async function dependencies(sandbox, values, signal) {
248
254
  `${SANDBOX_WORKSPACE_ROOT}/.junior`,
249
255
  ...npm
250
256
  ],
251
- signal
257
+ signal,
258
+ timeoutMs
252
259
  },
253
260
  "npm install"
254
261
  );
@@ -256,7 +263,7 @@ async function dependencies(sandbox, values, signal) {
256
263
  );
257
264
  }
258
265
  }
259
- async function postinstall(sandbox, commands, signal) {
266
+ async function postinstall(sandbox, commands, signal, timeoutMs) {
260
267
  if (commands.length === 0) {
261
268
  return;
262
269
  }
@@ -275,6 +282,7 @@ async function postinstall(sandbox, commands, signal) {
275
282
  login: true,
276
283
  pathPrefix: `${SANDBOX_WORKSPACE_ROOT}/.junior/bin:$PATH`,
277
284
  signal,
285
+ timeoutMs,
278
286
  ...command.sudo !== void 0 ? { sudo: command.sudo } : {}
279
287
  });
280
288
  if (result.exitCode !== 0) {
@@ -292,240 +300,6 @@ async function postinstall(sandbox, commands, signal) {
292
300
  import {
293
301
  FileSystem
294
302
  } from "@vercel/sandbox";
295
-
296
- // src/chat/sandbox/http-error-details.ts
297
- var DEFAULT_PREVIEW_LIMIT = 512;
298
- function toTrimmedString(value, maxChars) {
299
- if (typeof value !== "string") {
300
- return void 0;
301
- }
302
- const normalized = value.trim();
303
- if (!normalized) {
304
- return void 0;
305
- }
306
- return normalized.length > maxChars ? `${normalized.slice(0, maxChars)}\u2026` : normalized;
307
- }
308
- function extractHttpErrorDetails(error, options = {}) {
309
- const prefix = options.attributePrefix ?? "app.http_error";
310
- const previewLimit = options.previewLimit ?? DEFAULT_PREVIEW_LIMIT;
311
- const normalizedError = error instanceof Error ? error : new Error(String(error));
312
- const err = error ?? {};
313
- const attributes = {
314
- "error.type": normalizedError.name || "Error",
315
- "exception.message": toTrimmedString(normalizedError.message, previewLimit) ?? "HTTP error"
316
- };
317
- const response = err.response;
318
- const statusCode = typeof response?.status === "number" ? response.status : void 0;
319
- const statusText = toTrimmedString(response?.statusText, previewLimit);
320
- const responseUrl = toTrimmedString(response?.url, previewLimit);
321
- const responseText = toTrimmedString(err.text, previewLimit);
322
- const responseJson = toTrimmedString(
323
- err.json && typeof err.json === "object" ? JSON.stringify(err.json) : void 0,
324
- previewLimit
325
- );
326
- const contentType = toTrimmedString(
327
- response?.headers?.get?.("content-type"),
328
- previewLimit
329
- );
330
- const requestIdHeader = toTrimmedString(
331
- response?.headers?.get?.("x-request-id"),
332
- previewLimit
333
- );
334
- const vercelIdHeader = toTrimmedString(
335
- response?.headers?.get?.("x-vercel-id"),
336
- previewLimit
337
- );
338
- const requestId = requestIdHeader ?? vercelIdHeader;
339
- if (statusCode !== void 0) {
340
- attributes["http.response.status_code"] = statusCode;
341
- }
342
- if (statusText) {
343
- attributes[`${prefix}.status_text`] = statusText;
344
- }
345
- if (responseUrl) {
346
- attributes["url.full"] = responseUrl;
347
- }
348
- if (contentType) {
349
- attributes["http.response.header.content-type"] = [contentType];
350
- }
351
- if (requestIdHeader) {
352
- attributes["http.response.header.x-request-id"] = [requestIdHeader];
353
- }
354
- if (vercelIdHeader) {
355
- attributes["http.response.header.x-vercel-id"] = [vercelIdHeader];
356
- }
357
- if (responseText) {
358
- attributes[`${prefix}.response_text_preview`] = responseText;
359
- attributes[`${prefix}.response_text_length`] = responseText.length;
360
- }
361
- if (responseJson) {
362
- attributes[`${prefix}.response_json_preview`] = responseJson;
363
- }
364
- const summaryParts = [];
365
- if (statusCode !== void 0) {
366
- summaryParts.push(`status=${statusCode}`);
367
- }
368
- if (statusText) {
369
- summaryParts.push(`statusText=${statusText}`);
370
- }
371
- if (responseUrl) {
372
- summaryParts.push(`url=${responseUrl}`);
373
- }
374
- if (requestId) {
375
- summaryParts.push(`requestId=${requestId}`);
376
- }
377
- for (const field of options.extraFields ?? []) {
378
- const value = toTrimmedString(err[field.sourceKey], previewLimit);
379
- if (!value) {
380
- continue;
381
- }
382
- attributes[`${prefix}.${field.attributeKey}`] = value;
383
- summaryParts.push(`${field.summaryKey ?? field.attributeKey}=${value}`);
384
- }
385
- if (responseJson) {
386
- summaryParts.push(`json=${responseJson}`);
387
- } else if (responseText) {
388
- summaryParts.push(`text=${responseText}`);
389
- }
390
- const searchableText = `${normalizedError.message} ${responseText ?? ""} ${responseJson ?? ""}`.toLowerCase();
391
- return {
392
- attributes,
393
- summary: summaryParts.join(", "),
394
- searchableText
395
- };
396
- }
397
-
398
- // src/chat/sandbox/errors.ts
399
- var SANDBOX_ERROR_FIELDS = [
400
- {
401
- sourceKey: "sandboxId",
402
- attributeKey: "sandbox_id",
403
- summaryKey: "sandboxId"
404
- }
405
- ];
406
- function getSandboxErrorDetails(error) {
407
- return extractHttpErrorDetails(error, {
408
- attributePrefix: "app.sandbox.api_error",
409
- extraFields: [...SANDBOX_ERROR_FIELDS]
410
- });
411
- }
412
- function findInErrorChain(error, predicate) {
413
- const seen = /* @__PURE__ */ new Set();
414
- let current = error;
415
- while (current && !seen.has(current)) {
416
- if (predicate(current)) {
417
- return true;
418
- }
419
- seen.add(current);
420
- current = typeof current === "object" ? current.cause : void 0;
421
- }
422
- return false;
423
- }
424
- function isRecord(value) {
425
- return typeof value === "object" && value !== null;
426
- }
427
- function isInvalidSandboxSessionError(error) {
428
- if (!isRecord(error)) {
429
- return false;
430
- }
431
- if (isRecord(error.json) && error.json.invalidToken === true) {
432
- return true;
433
- }
434
- const response = error.response;
435
- return isRecord(response) && response.status === 403 && typeof response.url === "string" && response.url.includes("/sandboxes/sessions");
436
- }
437
- function getFirstErrorMessage(error) {
438
- const seen = /* @__PURE__ */ new Set();
439
- let current = error;
440
- while (current && !seen.has(current)) {
441
- if (current instanceof Error) {
442
- const message = current.message.trim();
443
- if (message) {
444
- return message;
445
- }
446
- }
447
- seen.add(current);
448
- current = typeof current === "object" ? current.cause : void 0;
449
- }
450
- return void 0;
451
- }
452
- function isAlreadyExistsError(error) {
453
- const details = getSandboxErrorDetails(error);
454
- return details.searchableText.includes("already exists") || details.searchableText.includes("file exists") || details.searchableText.includes("eexist");
455
- }
456
- function isSandboxUnavailableError(error) {
457
- return findInErrorChain(error, (candidate) => {
458
- if (isInvalidSandboxSessionError(candidate)) {
459
- return true;
460
- }
461
- const details = getSandboxErrorDetails(candidate);
462
- const searchable = `${details.searchableText} ${details.summary}`.toLowerCase();
463
- return searchable.includes("sandbox_stopped") || searchable.includes("status=410") || searchable.includes("status code 410") || searchable.includes("no longer available") || searchable.includes("stream was closed and is not accepting commands");
464
- });
465
- }
466
- function isSandboxMissingError(error) {
467
- return findInErrorChain(error, (candidate) => {
468
- const details = getSandboxErrorDetails(candidate);
469
- const searchable = `${details.searchableText} ${details.summary}`.toLowerCase();
470
- return searchable.includes("status=404") || searchable.includes("status code 404") || searchable.includes("snapshot_not_found");
471
- });
472
- }
473
- function isSnapshottingError(error) {
474
- return findInErrorChain(error, (candidate) => {
475
- const details = getSandboxErrorDetails(candidate);
476
- const searchable = `${details.searchableText} ${details.summary}`.toLowerCase();
477
- return searchable.includes("sandbox_snapshotting") || searchable.includes("creating a snapshot") || searchable.includes("stopped shortly");
478
- });
479
- }
480
- function isSandboxCommandStreamInterruptedError(error) {
481
- return findInErrorChain(error, (candidate) => {
482
- if (!(candidate instanceof Error)) {
483
- return false;
484
- }
485
- return candidate.name === "StreamError" && candidate.message.toLowerCase().includes("stream ended before command finished");
486
- });
487
- }
488
- function wrapSandboxSetupError(error) {
489
- try {
490
- const details = getSandboxErrorDetails(error);
491
- if (details.summary) {
492
- return new Error(`sandbox setup failed (${details.summary})`, {
493
- cause: error
494
- });
495
- }
496
- } catch {
497
- }
498
- let causeMessage;
499
- try {
500
- causeMessage = getFirstErrorMessage(error);
501
- } catch (cause) {
502
- causeMessage = cause instanceof Error ? cause.message : void 0;
503
- }
504
- if (causeMessage && causeMessage.trim() && causeMessage !== "sandbox setup failed") {
505
- const oneLine = causeMessage.replace(/\s+/g, " ").trim();
506
- return new Error(`sandbox setup failed (${oneLine})`, { cause: error });
507
- }
508
- return new Error("sandbox setup failed", { cause: error });
509
- }
510
- function throwSandboxOperationError(action, error, includeMissingPath = false) {
511
- const details = getSandboxErrorDetails(error);
512
- setSpanAttributes({
513
- ...details.attributes,
514
- ...includeMissingPath ? {
515
- "app.sandbox.api_error.missing_path": details.searchableText.includes("no such file") || details.searchableText.includes("enoent")
516
- } : {},
517
- "app.sandbox.success": false
518
- });
519
- setSpanStatus("error");
520
- throw new Error(
521
- details.summary ? `${action} failed (${details.summary})` : `${action} failed`,
522
- {
523
- cause: error
524
- }
525
- );
526
- }
527
-
528
- // src/chat/sandbox/workspace.ts
529
303
  function bindSandboxFileSystem(fs, signal) {
530
304
  if (!signal) {
531
305
  return fs;
@@ -917,17 +691,12 @@ function isMissingError(error) {
917
691
  }
918
692
 
919
693
  export {
920
- isAlreadyExistsError,
921
- isSandboxUnavailableError,
922
- isSandboxMissingError,
923
- isSnapshottingError,
924
- isSandboxCommandStreamInterruptedError,
925
- wrapSandboxSetupError,
926
- throwSandboxOperationError,
927
- getVercelSandboxCredentials,
928
694
  getSandboxResourceConfig,
929
695
  setSandboxResourceConfig,
930
696
  getSandboxResources,
697
+ setSnapshotSpanAttributes,
698
+ dependencies,
699
+ postinstall,
931
700
  bindSandboxFileSystem,
932
701
  createSandboxSession,
933
702
  stopSession,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  FUNCTION_TIMEOUT_BUFFER_SECONDS,
3
3
  getChatConfig
4
- } from "./chunk-DLTP6TUJ.js";
4
+ } from "./chunk-3ZZEPLLB.js";
5
5
 
6
6
  // src/chat/runtime/request-deadline.ts
7
7
  import { AsyncLocalStorage } from "async_hooks";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createPluginCatalogRuntime
3
- } from "./chunk-7B6NW4P7.js";
3
+ } from "./chunk-D3UJTX4U.js";
4
4
 
5
5
  // src/chat/plugins/catalog-runtime.ts
6
6
  var pluginCatalogRuntime = createPluginCatalogRuntime();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  JUNIOR_VERSION
3
- } from "./chunk-SNPQGTHJ.js";
3
+ } from "./chunk-IQRPDKPJ.js";
4
4
 
5
5
  // src/deployment.ts
6
6
  var JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";