@sentry/junior 0.164.0 → 0.165.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 (69) hide show
  1. package/dist/{agent-hooks-WTBPNRTC.js → agent-hooks-GSNL33UA.js} +9 -9
  2. package/dist/api/schema/workspace.d.ts +8 -4
  3. package/dist/api/schema.js +1 -1
  4. package/dist/api.js +59 -27
  5. package/dist/app.js +34 -34
  6. package/dist/{catalog-runtime-CZ2SQINY.js → catalog-runtime-4ERDVI7V.js} +5 -5
  7. package/dist/chat/repository-instructions.d.ts +12 -1
  8. package/dist/chat/sandbox/sandbox.d.ts +1 -1
  9. package/dist/chat/sandbox/snapshot/resolve.d.ts +12 -0
  10. package/dist/chat/sandbox/snapshot/runtime.d.ts +2 -0
  11. package/dist/chat/workspaces/store.d.ts +0 -2
  12. package/dist/chat/workspaces/types.d.ts +0 -1
  13. package/dist/chat/workspaces/validation.d.ts +0 -1
  14. package/dist/{chunk-VHSEMJTS.js → chunk-32CCG4WP.js} +1 -1
  15. package/dist/{chunk-WJUKESU2.js → chunk-3V2EIQLT.js} +1 -1
  16. package/dist/{chunk-26JYGL2L.js → chunk-5T6WPPEI.js} +1 -1
  17. package/dist/{chunk-YHCTPDXS.js → chunk-5WDDWMQ7.js} +8 -22
  18. package/dist/{chunk-BXBZDV3C.js → chunk-65B3PDY7.js} +1 -1
  19. package/dist/{chunk-5GLGQHO3.js → chunk-6OWVPXNO.js} +2 -1
  20. package/dist/{chunk-XAIRI54J.js → chunk-6RZ6MMEK.js} +1 -1
  21. package/dist/{chunk-NAGI2XH3.js → chunk-6YXCG2XL.js} +4 -4
  22. package/dist/{chunk-6BXV63YX.js → chunk-7J26TW64.js} +5 -5
  23. package/dist/{chunk-RULIISEI.js → chunk-7S2JVUWS.js} +1 -1
  24. package/dist/{chunk-5FWQ73UZ.js → chunk-AEBF6AO2.js} +1 -1
  25. package/dist/{chunk-ZUTAGCPH.js → chunk-AQEBOQUC.js} +9 -9
  26. package/dist/{chunk-PU45BSBS.js → chunk-BEC542E6.js} +8 -5
  27. package/dist/{chunk-RJHZNPDH.js → chunk-BEHPIDVZ.js} +5 -4
  28. package/dist/{chunk-RYYEHWIL.js → chunk-DKO4RRGJ.js} +1 -1
  29. package/dist/{chunk-HHW6ZVIZ.js → chunk-EA4UL5H2.js} +73 -14
  30. package/dist/{chunk-FX4PX3SA.js → chunk-FMOFCEAA.js} +2 -2
  31. package/dist/{chunk-CGCNFEAU.js → chunk-FNNQCHOL.js} +4 -4
  32. package/dist/{chunk-JW23XD4I.js → chunk-FXX4NHOM.js} +6 -6
  33. package/dist/{chunk-4GTOFUQF.js → chunk-G72LBEMZ.js} +1 -1
  34. package/dist/{chunk-7WKWMMYQ.js → chunk-HPWZ4BJJ.js} +68 -64
  35. package/dist/{chunk-6ENAACWN.js → chunk-HZDLOFO4.js} +9 -5
  36. package/dist/{chunk-ZSNABC2E.js → chunk-IZHR2OES.js} +4 -13
  37. package/dist/{chunk-VV2DN24T.js → chunk-N2BRRIQZ.js} +1 -1
  38. package/dist/{chunk-FKDY7NTC.js → chunk-NPW6LM2X.js} +12 -12
  39. package/dist/{chunk-LPLVNMVN.js → chunk-RQQTOF3H.js} +3 -3
  40. package/dist/{chunk-Y2B6AXZQ.js → chunk-SA5FVUWJ.js} +6 -6
  41. package/dist/{chunk-3L23VTY7.js → chunk-T6BAHCT6.js} +17 -17
  42. package/dist/{chunk-NLTQRYNP.js → chunk-TCWPG5VL.js} +2 -2
  43. package/dist/{chunk-2K25MRZK.js → chunk-VDNNVTX2.js} +5 -5
  44. package/dist/{chunk-H36GJVJV.js → chunk-XOINKFDJ.js} +7 -7
  45. package/dist/{chunk-RBV4JHCP.js → chunk-ZUKU2Y3J.js} +1 -1
  46. package/dist/cli/chat.js +29 -29
  47. package/dist/cli/check.js +6 -6
  48. package/dist/cli/plugins.js +12 -12
  49. package/dist/cli/snapshot-create.js +9 -9
  50. package/dist/cli/upgrade.js +7 -7
  51. package/dist/db/schema/workspaces.d.ts +0 -17
  52. package/dist/db/schema.d.ts +0 -17
  53. package/dist/{db-32KRFS6L.js → db-5TTEPMTY.js} +7 -7
  54. package/dist/instrumentation.js +4 -4
  55. package/dist/nitro.js +2 -2
  56. package/dist/{oauth-callback-server-CGZP2Z6U.js → oauth-callback-server-IVFC5YHY.js} +22 -22
  57. package/dist/{runner-S5N4Q2XL.js → runner-G76TSHWO.js} +12 -12
  58. package/dist/{skills-KYPSHSQR.js → skills-F6PSLVSG.js} +6 -6
  59. package/dist/spawn-WMJPIAZL.js +37 -0
  60. package/dist/{validation-SZBE7JNF.js → validation-56EJI6UQ.js} +6 -6
  61. package/dist/version.js +1 -1
  62. package/dist/{work-GCZKHEZX.js → work-RNRQCP3Y.js} +17 -17
  63. package/dist/worker-FBR2WUI4.js +24 -0
  64. package/migrations/0030_drop_workspace_repo_primary.sql +2 -0
  65. package/migrations/meta/0030_snapshot.json +2799 -0
  66. package/migrations/meta/_journal.json +8 -1
  67. package/package.json +5 -4
  68. package/dist/spawn-EGOB3CLV.js +0 -37
  69. package/dist/worker-6MY5Q4A2.js +0 -24
@@ -7,7 +7,7 @@ import {
7
7
  PluginCredentialFailureError,
8
8
  agentNameSchema,
9
9
  createPluginAuthOrchestration
10
- } from "./chunk-6BXV63YX.js";
10
+ } from "./chunk-7J26TW64.js";
11
11
  import {
12
12
  authorizationId
13
13
  } from "./chunk-DIB4GX3G.js";
@@ -32,7 +32,7 @@ import {
32
32
  searchSlackUsers,
33
33
  selectPluginGrant,
34
34
  toMcpProviderError
35
- } from "./chunk-H36GJVJV.js";
35
+ } from "./chunk-XOINKFDJ.js";
36
36
  import {
37
37
  RetryableDeliveryError,
38
38
  actorFromRun,
@@ -48,7 +48,7 @@ import {
48
48
  getSlackMessagePermalink,
49
49
  resolveBaseUrl,
50
50
  uploadFilesToConversation
51
- } from "./chunk-JW23XD4I.js";
51
+ } from "./chunk-FXX4NHOM.js";
52
52
  import {
53
53
  parseSandboxEgressAuthRequiredSignal,
54
54
  parseSandboxEgressPermissionDeniedSignal,
@@ -56,24 +56,7 @@ import {
56
56
  sandboxEgressCredentialLeaseSchema
57
57
  } from "./chunk-7MA4HV4W.js";
58
58
  import {
59
- bindSandboxFileSystem,
60
- createSandboxSession,
61
- ensureDockerDaemon,
62
- getSandboxResources,
63
- getVercelSandboxCredentials,
64
- hash,
65
- isAlreadyExistsError,
66
- isMissingError,
67
- isSandboxCommandStreamInterruptedError,
68
- isSandboxMissingError,
69
- isSandboxUnavailableError,
70
- isSnapshottingError,
71
- resolve,
72
- stopSession,
73
- throwSandboxOperationError,
74
- wrapSandboxSetupError
75
- } from "./chunk-RJHZNPDH.js";
76
- import {
59
+ SANDBOX_RUNTIME,
77
60
  SCHEDULED_TASK_SYSTEM_ACTOR,
78
61
  compactEventTask,
79
62
  createEventTask,
@@ -105,10 +88,10 @@ import {
105
88
  scheduledTaskAttributes,
106
89
  storeAttachments,
107
90
  writableEventTask
108
- } from "./chunk-6ENAACWN.js";
91
+ } from "./chunk-HZDLOFO4.js";
109
92
  import {
110
93
  parseSlackThreadId
111
- } from "./chunk-WJUKESU2.js";
94
+ } from "./chunk-3V2EIQLT.js";
112
95
  import {
113
96
  AGENTS_REMOVAL_NOTICE,
114
97
  AGENTS_REPLACEMENT_NOTICE,
@@ -132,7 +115,6 @@ import {
132
115
  decideReply,
133
116
  estimateTextTokens,
134
117
  extractAssistantText,
135
- findSingleRepositoryDirectory,
136
118
  findVisibleAgentsInstructions,
137
119
  generateShortTitle,
138
120
  getAgentContextCompactionTriggerTokens,
@@ -152,6 +134,7 @@ import {
152
134
  isToolResultError,
153
135
  isToolResultMessage,
154
136
  isTurnInputCommitLostError,
137
+ listRepositoryDirectories,
155
138
  loadConnectedMcpProviders,
156
139
  loadConversationProjection,
157
140
  loadTurnCheckpoint,
@@ -170,7 +153,7 @@ import {
170
153
  recordToolExecutionStarted,
171
154
  recordTurnRoute,
172
155
  renderAgentsInstructions,
173
- resolveRepositoryInstructions,
156
+ resolveRepositoryInstructionsForDirectories,
174
157
  resolveTaskTitle,
175
158
  resolveWorkspacePath,
176
159
  retainRuntimeTurnContext,
@@ -179,10 +162,28 @@ import {
179
162
  stripRuntimeTurnContext,
180
163
  trimTrailingAssistantMessages,
181
164
  truncateText
182
- } from "./chunk-HHW6ZVIZ.js";
165
+ } from "./chunk-EA4UL5H2.js";
183
166
  import {
184
167
  JUNIOR_THREAD_STATE_TTL_MS
185
168
  } from "./chunk-3Y47VMHV.js";
169
+ import {
170
+ bindSandboxFileSystem,
171
+ createSandboxSession,
172
+ ensureDockerDaemon,
173
+ getSandboxResources,
174
+ getVercelSandboxCredentials,
175
+ hash,
176
+ isAlreadyExistsError,
177
+ isMissingError,
178
+ isSandboxCommandStreamInterruptedError,
179
+ isSandboxMissingError,
180
+ isSandboxUnavailableError,
181
+ isSnapshottingError,
182
+ resolve,
183
+ stopSession,
184
+ throwSandboxOperationError,
185
+ wrapSandboxSetupError
186
+ } from "./chunk-BEHPIDVZ.js";
186
187
  import {
187
188
  privateTraceResultAttributes
188
189
  } from "./chunk-UIE3R5XU.js";
@@ -207,7 +208,7 @@ import {
207
208
  tryWorkspaceRepoCheckoutPath,
208
209
  withSlackRetries,
209
210
  workspaceRepoCheckoutPath
210
- } from "./chunk-YHCTPDXS.js";
211
+ } from "./chunk-5WDDWMQ7.js";
211
212
  import {
212
213
  KNOWN_CONVERSATION_EVENT_TYPES,
213
214
  contextProvenance,
@@ -219,11 +220,11 @@ import {
219
220
  instructionActors,
220
221
  instructionProvenanceFor,
221
222
  sameActorIdentity
222
- } from "./chunk-LPLVNMVN.js";
223
+ } from "./chunk-RQQTOF3H.js";
223
224
  import {
224
225
  juniorArtifacts,
225
226
  juniorIdentities
226
- } from "./chunk-ZSNABC2E.js";
227
+ } from "./chunk-IZHR2OES.js";
227
228
  import {
228
229
  SANDBOX_DATA_ROOT,
229
230
  SANDBOX_REPOS_ROOT,
@@ -239,7 +240,7 @@ import {
239
240
  } from "./chunk-BVREIWBD.js";
240
241
  import {
241
242
  getStateAdapter
242
- } from "./chunk-BXBZDV3C.js";
243
+ } from "./chunk-65B3PDY7.js";
243
244
  import {
244
245
  ACTIVE_TURN_COMPACTION_SUMMARY_PREFIX,
245
246
  COMPACTION_SUMMARY_PREFIX,
@@ -272,7 +273,7 @@ import {
272
273
  resolveGatewayCredential,
273
274
  resolveGatewayModel,
274
275
  unwrapCurrentInstruction
275
- } from "./chunk-FX4PX3SA.js";
276
+ } from "./chunk-FMOFCEAA.js";
276
277
  import {
277
278
  canExposeConversationPayload,
278
279
  resolveConversationPrivacy,
@@ -282,16 +283,16 @@ import {
282
283
  toGenAiMessagesTraceAttributes,
283
284
  toGenAiPayloadMetadata,
284
285
  toGenAiPayloadTraceAttributes
285
- } from "./chunk-RBV4JHCP.js";
286
+ } from "./chunk-ZUKU2Y3J.js";
286
287
  import {
287
288
  discoverSkills,
288
289
  findSkillByName,
289
290
  loadSkillsByName,
290
291
  parseSkillInvocation
291
- } from "./chunk-NLTQRYNP.js";
292
+ } from "./chunk-TCWPG5VL.js";
292
293
  import {
293
294
  pluginCatalogRuntime
294
- } from "./chunk-RULIISEI.js";
295
+ } from "./chunk-7S2JVUWS.js";
295
296
  import {
296
297
  CredentialUnavailableError,
297
298
  OAuthProviderError,
@@ -299,7 +300,7 @@ import {
299
300
  getOAuthProviderErrorAttributes,
300
301
  resolveAuthTokenPlaceholder,
301
302
  resolvePluginCommandEnv
302
- } from "./chunk-VV2DN24T.js";
303
+ } from "./chunk-N2BRRIQZ.js";
303
304
  import {
304
305
  credentialUserSubjectId
305
306
  } from "./chunk-BDUENQD3.js";
@@ -327,7 +328,7 @@ import {
327
328
  summarizeMessageText,
328
329
  withLogContext,
329
330
  withSpan
330
- } from "./chunk-VHSEMJTS.js";
331
+ } from "./chunk-32CCG4WP.js";
331
332
  import {
332
333
  startInactiveSpan,
333
334
  withActiveSpan
@@ -3156,7 +3157,6 @@ async function syncSkillsToSandbox(params) {
3156
3157
  // src/chat/sandbox/session.ts
3157
3158
  var DEFAULT_MAX_OUTPUT_LENGTH = 3e4;
3158
3159
  var DEFAULT_BASH_COMMAND_TIMEOUT_MS = 5 * 60 * 1e3;
3159
- var SANDBOX_RUNTIME = "node22";
3160
3160
  var SANDBOX_RUNTIME_BIN_DIR = `${SANDBOX_WORKSPACE_ROOT}/.junior/bin`;
3161
3161
  var SNAPSHOT_BOOT_RETRY_COUNT = 3;
3162
3162
  var SNAPSHOT_BOOT_RETRY_DELAY_MS = 1e3;
@@ -4217,7 +4217,7 @@ import { z as z5 } from "zod";
4217
4217
  var DEFAULT_FIND_LIMIT = 100;
4218
4218
  async function findFiles(params) {
4219
4219
  if (!params.pattern.trim()) {
4220
- throw new Error("pattern is required");
4220
+ throw new ToolInputError("pattern is required");
4221
4221
  }
4222
4222
  const root = resolveWorkspacePath(params.path);
4223
4223
  const limit = positiveInteger(params.limit) ?? DEFAULT_FIND_LIMIT;
@@ -4433,7 +4433,7 @@ function lineMatches(params) {
4433
4433
  }
4434
4434
  async function grepFiles(params) {
4435
4435
  if (!params.pattern) {
4436
- throw new Error("pattern is required");
4436
+ throw new ToolInputError("pattern is required");
4437
4437
  }
4438
4438
  const root = resolveWorkspacePath(params.path);
4439
4439
  const limit = positiveInteger(params.limit) ?? DEFAULT_GREP_LIMIT;
@@ -5527,12 +5527,12 @@ function createSandbox(options) {
5527
5527
  return void 0;
5528
5528
  }
5529
5529
  const { fs: fs5 } = await runtime.tools();
5530
- const primary = activeWorkspace?.repos.find((repo) => repo.isPrimary);
5531
- const primaryPath = primary ? tryWorkspaceRepoCheckoutPath(primary.repo) : void 0;
5532
- const selected = primaryPath ? `${SANDBOX_WORKSPACE_ROOT}/${primaryPath}` : await findSingleRepositoryDirectory(fs5);
5533
- if (!selected) return void 0;
5534
- return await resolveRepositoryInstructions({
5535
- cwd: selected,
5530
+ const workspaceDirectories = activeWorkspace?.repos.map((repo) => tryWorkspaceRepoCheckoutPath(repo.repo)).filter((checkoutPath) => Boolean(checkoutPath)).map(
5531
+ (checkoutPath) => `${SANDBOX_WORKSPACE_ROOT}/${checkoutPath}`
5532
+ ) ?? [];
5533
+ const directories = workspaceDirectories.length > 0 ? workspaceDirectories : await listRepositoryDirectories(fs5);
5534
+ return await resolveRepositoryInstructionsForDirectories({
5535
+ directories,
5536
5536
  fs: fs5
5537
5537
  });
5538
5538
  },
@@ -5602,7 +5602,7 @@ var SandboxFileNotFoundError = class extends ToolInputError {
5602
5602
  function normalizeSandboxPath(inputPath) {
5603
5603
  const trimmed = inputPath.trim();
5604
5604
  if (!trimmed) {
5605
- throw new Error("path is required");
5605
+ throw new ToolInputError("path is required");
5606
5606
  }
5607
5607
  if (path7.posix.isAbsolute(trimmed)) {
5608
5608
  return trimmed;
@@ -12397,7 +12397,7 @@ function createSystemTimeTool() {
12397
12397
  const timezone = input.timezone?.trim() || null;
12398
12398
  if (timezone) {
12399
12399
  if (!isValidTimeZone2(timezone)) {
12400
- throw new Error("timezone must be a valid IANA time zone.");
12400
+ throw new ToolInputError("timezone must be a valid IANA time zone.");
12401
12401
  }
12402
12402
  const parts = getZonedDateTimeParts(now.getTime(), timezone);
12403
12403
  const isoLocal = [
@@ -13137,16 +13137,16 @@ function normalizeHostname(hostname) {
13137
13137
  async function resolvePublicHostname(hostname) {
13138
13138
  const records = await dns.lookup(hostname, { all: true, verbatim: true });
13139
13139
  if (records.length === 0) {
13140
- throw new Error("Could not resolve hostname");
13140
+ throw new ToolInputError("Could not resolve hostname");
13141
13141
  }
13142
13142
  const deduped = /* @__PURE__ */ new Map();
13143
13143
  for (const record2 of records) {
13144
13144
  const family = record2.family === 6 ? 6 : 4;
13145
13145
  if (family === 4 && isPrivateIpv4(record2.address)) {
13146
- throw new Error("Resolved to a private IPv4 address");
13146
+ throw new ToolInputError("Resolved to a private IPv4 address");
13147
13147
  }
13148
13148
  if (family === 6 && isPrivateIpv6(record2.address)) {
13149
- throw new Error("Resolved to a private IPv6 address");
13149
+ throw new ToolInputError("Resolved to a private IPv6 address");
13150
13150
  }
13151
13151
  deduped.set(`${family}:${record2.address}`, {
13152
13152
  address: record2.address,
@@ -13252,18 +13252,18 @@ async function fetchWithPinnedLookup(url, resolved, signal) {
13252
13252
  async function assertPublicUrl(rawUrl) {
13253
13253
  const parsed = new URL(rawUrl);
13254
13254
  if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
13255
- throw new Error("Only http(s) URLs are allowed");
13255
+ throw new ToolInputError("Only http(s) URLs are allowed");
13256
13256
  }
13257
13257
  const hostname = normalizeHostname(parsed.hostname);
13258
13258
  if (hostname === "localhost" || hostname === "0.0.0.0" || hostname.endsWith(".local") || hostname.endsWith(".internal")) {
13259
- throw new Error("Local/private hostnames are blocked");
13259
+ throw new ToolInputError("Local/private hostnames are blocked");
13260
13260
  }
13261
13261
  const hostIpType = net.isIP(hostname);
13262
13262
  if (hostIpType === 4 && isPrivateIpv4(hostname)) {
13263
- throw new Error("Private IPv4 addresses are blocked");
13263
+ throw new ToolInputError("Private IPv4 addresses are blocked");
13264
13264
  }
13265
13265
  if (hostIpType === 6 && isPrivateIpv6(hostname)) {
13266
- throw new Error("Private IPv6 addresses are blocked");
13266
+ throw new ToolInputError("Private IPv6 addresses are blocked");
13267
13267
  }
13268
13268
  if (hostIpType === 0) {
13269
13269
  await resolvePublicHostname(hostname);
@@ -13301,11 +13301,11 @@ async function fetchTextWithRedirects(url, redirectsLeft) {
13301
13301
  return response;
13302
13302
  }
13303
13303
  if (redirectsLeft <= 0) {
13304
- throw new Error("Too many redirects");
13304
+ throw new ToolInputError("Too many redirects");
13305
13305
  }
13306
13306
  const location = response.headers.get("location");
13307
13307
  if (!location) {
13308
- throw new Error("Redirect missing location");
13308
+ throw new ToolInputError("Redirect missing location");
13309
13309
  }
13310
13310
  const nextUrl = new URL(location, url);
13311
13311
  const safeUrl = await assertPublicUrl(nextUrl.toString());
@@ -13324,7 +13324,7 @@ async function readResponseBody(response, maxBytes) {
13324
13324
  if (!value) continue;
13325
13325
  total += value.byteLength;
13326
13326
  if (total > maxBytes) {
13327
- throw new Error("Response body too large");
13327
+ throw new ToolInputError("Response body too large");
13328
13328
  }
13329
13329
  chunks.push(value);
13330
13330
  }
@@ -13465,11 +13465,17 @@ function extractContentDetails(body, contentType, maxChars) {
13465
13465
  async function extractWebFetchResponse(url, response, maxChars = DEFAULT_MAX_CHARS) {
13466
13466
  const safeMaxChars = Math.max(500, Math.min(maxChars, MAX_FETCH_CHARS));
13467
13467
  if (!response.ok) {
13468
- throw new Error(`fetch failed: ${response.status}`);
13468
+ const message = `fetch failed: ${response.status}`;
13469
+ if (response.status >= 400 && response.status < 500) {
13470
+ throw new ToolInputError(message);
13471
+ }
13472
+ throw new Error(message);
13469
13473
  }
13470
13474
  const contentType = (response.headers.get("content-type") ?? "").toLowerCase();
13471
13475
  if (!contentType.includes("text/") && !contentType.includes("json") && !contentType.includes("xml")) {
13472
- throw new Error(`unsupported content type: ${contentType || "unknown"}`);
13476
+ throw new ToolInputError(
13477
+ `unsupported content type: ${contentType || "unknown"}`
13478
+ );
13473
13479
  }
13474
13480
  const body = await withTimeout(
13475
13481
  readResponseBody(response, MAX_FETCH_BYTES),
@@ -13530,7 +13536,7 @@ function createWebFetchTool(hooks, options = {}) {
13530
13536
  if (response.ok && contentType.startsWith("image/")) {
13531
13537
  const bytes = Buffer.from(await response.arrayBuffer());
13532
13538
  if (bytes.byteLength > MAX_FETCH_BYTES) {
13533
- throw new Error("image response body too large");
13539
+ throw new ToolInputError("image response body too large");
13534
13540
  }
13535
13541
  const filename = filenameForUrl(
13536
13542
  safeUrl,
@@ -13673,8 +13679,7 @@ import { z as z63 } from "zod";
13673
13679
  var repoSchema = z63.object({
13674
13680
  provider: z63.string(),
13675
13681
  repo: z63.string(),
13676
- checkout_path: z63.string(),
13677
- is_primary: z63.boolean()
13682
+ checkout_path: z63.string()
13678
13683
  });
13679
13684
  var workspaceSchema = z63.object({
13680
13685
  id: z63.string(),
@@ -13688,8 +13693,7 @@ function view(workspace) {
13688
13693
  repos: workspace.repos.map((repo) => ({
13689
13694
  provider: repo.provider,
13690
13695
  repo: repo.repo,
13691
- checkout_path: workspaceRepoCheckoutPath(repo.repo),
13692
- is_primary: repo.isPrimary
13696
+ checkout_path: workspaceRepoCheckoutPath(repo.repo)
13693
13697
  }))
13694
13698
  };
13695
13699
  }
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ToolInputError
3
- } from "./chunk-HHW6ZVIZ.js";
3
+ } from "./chunk-EA4UL5H2.js";
4
4
  import {
5
5
  canRouteResourceEvents,
6
6
  getPlugins
7
- } from "./chunk-YHCTPDXS.js";
7
+ } from "./chunk-5WDDWMQ7.js";
8
8
  import {
9
9
  getDb
10
- } from "./chunk-LPLVNMVN.js";
10
+ } from "./chunk-RQQTOF3H.js";
11
11
  import {
12
12
  juniorAttachments,
13
13
  juniorConversations,
@@ -15,13 +15,16 @@ import {
15
15
  juniorSchedulerRuns,
16
16
  juniorSchedulerTasks,
17
17
  juniorStats
18
- } from "./chunk-ZSNABC2E.js";
18
+ } from "./chunk-IZHR2OES.js";
19
19
  import {
20
20
  juniorDestinations
21
21
  } from "./chunk-VFUK3X5B.js";
22
22
  import {
23
23
  logInfo
24
- } from "./chunk-VHSEMJTS.js";
24
+ } from "./chunk-32CCG4WP.js";
25
+
26
+ // src/chat/sandbox/snapshot/runtime.ts
27
+ var SANDBOX_RUNTIME = "node22";
25
28
 
26
29
  // src/chat/event-tasks/store.ts
27
30
  import { and, asc, desc, eq, inArray, or, sql } from "drizzle-orm";
@@ -1899,6 +1902,7 @@ export {
1899
1902
  juniorToolOutputSchema,
1900
1903
  injectContinuationToolName,
1901
1904
  makeStructuredToolOutput,
1905
+ SANDBOX_RUNTIME,
1902
1906
  eventNamespaceSchema,
1903
1907
  registeredEventTypeSchema,
1904
1908
  registeredResourceTypeSchema,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULT_SQL_STATEMENT_TIMEOUT_MS
3
- } from "./chunk-FX4PX3SA.js";
3
+ } from "./chunk-FMOFCEAA.js";
4
4
  import {
5
5
  juniorDestinations,
6
6
  timestamptz
@@ -646,14 +646,7 @@ var juniorSchedulerRuns = pgTable16(
646
646
  );
647
647
 
648
648
  // src/db/schema/workspaces.ts
649
- import { sql as sql6 } from "drizzle-orm";
650
- import {
651
- boolean as boolean3,
652
- pgTable as pgTable17,
653
- primaryKey as primaryKey9,
654
- text as text17,
655
- uniqueIndex as uniqueIndex7
656
- } from "drizzle-orm/pg-core";
649
+ import { pgTable as pgTable17, primaryKey as primaryKey9, text as text17, uniqueIndex as uniqueIndex7 } from "drizzle-orm/pg-core";
657
650
  var juniorWorkspaces = pgTable17(
658
651
  "junior_workspaces",
659
652
  {
@@ -670,12 +663,10 @@ var juniorWorkspaceRepos = pgTable17(
670
663
  {
671
664
  workspaceId: text17("workspace_id").notNull().references(() => juniorWorkspaces.id, { onDelete: "cascade" }),
672
665
  provider: text17("provider").notNull(),
673
- repo: text17("repo").notNull(),
674
- isPrimary: boolean3("is_primary").notNull().default(false)
666
+ repo: text17("repo").notNull()
675
667
  },
676
668
  (table) => [
677
- primaryKey9({ columns: [table.workspaceId, table.provider, table.repo] }),
678
- uniqueIndex7("junior_workspace_repos_primary_idx").on(table.workspaceId).where(sql6`${table.isPrimary}`)
669
+ primaryKey9({ columns: [table.workspaceId, table.provider, table.repo] })
679
670
  ]
680
671
  );
681
672
 
@@ -5,7 +5,7 @@ import {
5
5
  logInfo,
6
6
  logWarn,
7
7
  setSpanAttributes
8
- } from "./chunk-VHSEMJTS.js";
8
+ } from "./chunk-32CCG4WP.js";
9
9
  import {
10
10
  discoverInstalledPluginPackageContent,
11
11
  normalizePluginPackageNames
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createWebAuthorization,
3
3
  deleteWebAuthorization
4
- } from "./chunk-5FWQ73UZ.js";
4
+ } from "./chunk-AEBF6AO2.js";
5
5
  import {
6
6
  appendAndEnqueueInboundMessage
7
- } from "./chunk-NAGI2XH3.js";
7
+ } from "./chunk-6YXCG2XL.js";
8
8
  import {
9
9
  buildDeliveredTurnStatePatch,
10
10
  completeAuthPauseTurn,
@@ -12,20 +12,20 @@ import {
12
12
  getTurnUserMessage,
13
13
  processPluginTask,
14
14
  scheduleSessionCompletedPluginTasks
15
- } from "./chunk-ZUTAGCPH.js";
15
+ } from "./chunk-AQEBOQUC.js";
16
16
  import {
17
17
  ConversationTurnLifecycleService,
18
18
  coerceThreadConversationState,
19
19
  getPersistedSandboxState,
20
20
  getPersistedThreadState,
21
21
  persistThreadStateById
22
- } from "./chunk-2K25MRZK.js";
22
+ } from "./chunk-VDNNVTX2.js";
23
23
  import {
24
24
  healthReportSchema
25
25
  } from "./chunk-UTL3MHPC.js";
26
26
  import {
27
27
  parseSlackThreadId
28
- } from "./chunk-WJUKESU2.js";
28
+ } from "./chunk-3V2EIQLT.js";
29
29
  import {
30
30
  TurnInputCommitLostError,
31
31
  abandonTurnRecord,
@@ -49,31 +49,31 @@ import {
49
49
  saveTurnCheckpoint,
50
50
  startActiveTurn,
51
51
  upsertConversationMessage
52
- } from "./chunk-HHW6ZVIZ.js";
52
+ } from "./chunk-EA4UL5H2.js";
53
53
  import {
54
54
  normalizeSlackConversationId
55
- } from "./chunk-YHCTPDXS.js";
55
+ } from "./chunk-5WDDWMQ7.js";
56
56
  import {
57
57
  getConversationEventStore,
58
58
  getConversationStore,
59
59
  getDb
60
- } from "./chunk-LPLVNMVN.js";
60
+ } from "./chunk-RQQTOF3H.js";
61
61
  import {
62
62
  juniorApiTokens,
63
63
  juniorConversationParticipants,
64
64
  juniorConversations,
65
65
  juniorIdentities,
66
66
  juniorUsers
67
- } from "./chunk-ZSNABC2E.js";
67
+ } from "./chunk-IZHR2OES.js";
68
68
  import {
69
69
  getSlackBotToken
70
- } from "./chunk-FX4PX3SA.js";
70
+ } from "./chunk-FMOFCEAA.js";
71
71
  import {
72
72
  juniorDestinations
73
73
  } from "./chunk-VFUK3X5B.js";
74
74
  import {
75
75
  canExposeConversationPayload
76
- } from "./chunk-RBV4JHCP.js";
76
+ } from "./chunk-ZUKU2Y3J.js";
77
77
  import {
78
78
  credentialContextForActor
79
79
  } from "./chunk-BDUENQD3.js";
@@ -82,7 +82,7 @@ import {
82
82
  logWarn,
83
83
  setTags,
84
84
  withLogContext
85
- } from "./chunk-VHSEMJTS.js";
85
+ } from "./chunk-32CCG4WP.js";
86
86
 
87
87
  // src/handlers/health.ts
88
88
  function readHealthReport() {
@@ -7,12 +7,12 @@ import {
7
7
  juniorConversations,
8
8
  juniorIdentities,
9
9
  juniorUsers
10
- } from "./chunk-ZSNABC2E.js";
10
+ } from "./chunk-IZHR2OES.js";
11
11
  import {
12
12
  TURN_REASONING_LEVELS,
13
13
  getChatConfig,
14
14
  modelProfileSchema
15
- } from "./chunk-FX4PX3SA.js";
15
+ } from "./chunk-FMOFCEAA.js";
16
16
  import {
17
17
  juniorDestinations
18
18
  } from "./chunk-VFUK3X5B.js";
@@ -23,7 +23,7 @@ import {
23
23
  } from "./chunk-V7YE4WCP.js";
24
24
  import {
25
25
  normalizeIdentityEmail
26
- } from "./chunk-VHSEMJTS.js";
26
+ } from "./chunk-32CCG4WP.js";
27
27
 
28
28
  // src/chat/conversations/sql/store.ts
29
29
  import { randomUUID as randomUUID2 } from "crypto";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  appendAndEnqueueInboundMessage
3
- } from "./chunk-NAGI2XH3.js";
3
+ } from "./chunk-6YXCG2XL.js";
4
4
  import {
5
5
  ConversationTurnLifecycleService,
6
6
  getPersistedSandboxState,
7
7
  getPersistedThreadState,
8
8
  persistThreadStateById
9
- } from "./chunk-2K25MRZK.js";
9
+ } from "./chunk-VDNNVTX2.js";
10
10
  import {
11
11
  AgentInvocationBusyError,
12
12
  AgentInvocationLimitError,
@@ -15,7 +15,7 @@ import {
15
15
  agentBindingSchema,
16
16
  agentInvocationSchema,
17
17
  createAgentInvocationSchema
18
- } from "./chunk-6BXV63YX.js";
18
+ } from "./chunk-7J26TW64.js";
19
19
  import {
20
20
  TurnInputCommitLostError,
21
21
  failTurnRecord,
@@ -26,16 +26,16 @@ import {
26
26
  isTurnInputCommitLostError,
27
27
  openConversationProjection,
28
28
  saveTurnCheckpoint
29
- } from "./chunk-HHW6ZVIZ.js";
29
+ } from "./chunk-EA4UL5H2.js";
30
30
  import {
31
31
  getConversationEventStore,
32
32
  getConversationStore,
33
33
  getSqlExecutor
34
- } from "./chunk-LPLVNMVN.js";
34
+ } from "./chunk-RQQTOF3H.js";
35
35
  import {
36
36
  juniorAgentBindings,
37
37
  juniorAgentInvocations
38
- } from "./chunk-ZSNABC2E.js";
38
+ } from "./chunk-IZHR2OES.js";
39
39
 
40
40
  // src/chat/agent-invocations/work.ts
41
41
  import { z } from "zod";