@sentry/junior 0.161.0 → 0.163.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 (96) hide show
  1. package/README.md +2 -0
  2. package/dist/{agent-hooks-O75UJNC6.js → agent-hooks-6IX5CV7G.js} +10 -10
  3. package/dist/api/acp/route.d.ts +13 -0
  4. package/dist/api/locations/detail.d.ts +1 -1
  5. package/dist/api/schema/conversation.d.ts +3 -0
  6. package/dist/api/schema/location.d.ts +1 -0
  7. package/dist/api/schema/person.d.ts +1 -0
  8. package/dist/api.js +204 -403
  9. package/dist/app.d.ts +2 -2
  10. package/dist/app.js +480 -38
  11. package/dist/{catalog-runtime-Z3FHU4ZY.js → catalog-runtime-NEPZNTOM.js} +5 -5
  12. package/dist/chat/agent/sandbox.d.ts +4 -0
  13. package/dist/chat/api-turns/cancellation.d.ts +27 -0
  14. package/dist/chat/api-turns/routing.d.ts +31 -0
  15. package/dist/chat/api-turns/work.d.ts +12 -29
  16. package/dist/chat/app/conversation-work.d.ts +6 -1
  17. package/dist/chat/app/production.d.ts +2 -2
  18. package/dist/chat/conversations/history.d.ts +3 -0
  19. package/dist/chat/conversations/message-search.d.ts +6 -0
  20. package/dist/chat/conversations/turn-lifecycle.d.ts +1 -1
  21. package/dist/chat/experimental.d.ts +1 -1
  22. package/dist/chat/plugins/agent-hooks.d.ts +4 -0
  23. package/dist/chat/repository-instructions.d.ts +1 -1
  24. package/dist/chat/sandbox/paths.d.ts +1 -0
  25. package/dist/chat/sandbox/prepare-workspace.d.ts +11 -0
  26. package/dist/chat/sandbox/ref.d.ts +1 -0
  27. package/dist/chat/sandbox/sandbox.d.ts +4 -0
  28. package/dist/chat/sandbox/session.d.ts +4 -0
  29. package/dist/chat/sandbox/snapshot/profile.d.ts +4 -3
  30. package/dist/chat/sandbox/snapshot/resolve.d.ts +4 -0
  31. package/dist/chat/sandbox/workspace.d.ts +4 -0
  32. package/dist/chat/slack/tools/conversation-message-search.d.ts +9 -0
  33. package/dist/chat/tools/types.d.ts +5 -0
  34. package/dist/chat/workspaces/checkout-path.d.ts +4 -0
  35. package/dist/chat/workspaces/store.d.ts +8 -0
  36. package/dist/chat/workspaces/tools.d.ts +4 -0
  37. package/dist/chat/workspaces/types.d.ts +13 -0
  38. package/dist/{chunk-WKN4ZQTZ.js → chunk-2FBPN2Y4.js} +4 -1
  39. package/dist/{chunk-QHXT7LLF.js → chunk-2HBJQEBE.js} +1 -1
  40. package/dist/{chunk-VXFDVY4C.js → chunk-3OZNFCPR.js} +6 -6
  41. package/dist/{chunk-EAIQBR66.js → chunk-3T7RJVDJ.js} +1 -1
  42. package/dist/{chunk-DGKLYDX7.js → chunk-4P2XNVTO.js} +2 -2
  43. package/dist/{chunk-FLMD25Y5.js → chunk-ATWHPSMF.js} +40 -2
  44. package/dist/{chunk-IRHX2S46.js → chunk-BLZUFHM7.js} +1 -1
  45. package/dist/chunk-BVREIWBD.js +131 -0
  46. package/dist/{chunk-QQ7SY5IZ.js → chunk-EKGJVUVS.js} +9 -6
  47. package/dist/{chunk-ZBCLWBMV.js → chunk-FEIHINKR.js} +5 -5
  48. package/dist/{chunk-MVG5UPLM.js → chunk-GCLHNRMU.js} +1 -1
  49. package/dist/{chunk-YSWHAOPQ.js → chunk-ICJ3KCA2.js} +1 -1
  50. package/dist/{chunk-G35DUPNB.js → chunk-IIT23D3M.js} +4 -4
  51. package/dist/{chunk-OYQEO72I.js → chunk-IX4XI42N.js} +417 -136
  52. package/dist/{chunk-U2XOBFDK.js → chunk-JI5EPI3O.js} +50 -5
  53. package/dist/{chunk-IW7C5C7E.js → chunk-KD3ROG6P.js} +17 -17
  54. package/dist/{chunk-4WAZ6DGX.js → chunk-MWVQ35U6.js} +543 -164
  55. package/dist/{chunk-STZVUVMS.js → chunk-MXFL7LNZ.js} +12 -7
  56. package/dist/{chunk-HSFYTIS2.js → chunk-NL53P7PS.js} +1 -1
  57. package/dist/{chunk-6WTDZKFR.js → chunk-O4IK4O7C.js} +1 -1
  58. package/dist/{chunk-OPIJ6HY3.js → chunk-O5ZZL7IR.js} +9 -9
  59. package/dist/{chunk-CGAIDDLD.js → chunk-RK7KPI6G.js} +1 -1
  60. package/dist/{chunk-V67ORYKQ.js → chunk-RTPJRLOP.js} +9 -9
  61. package/dist/{chunk-6ILVZOF6.js → chunk-SR6WRBJW.js} +4 -4
  62. package/dist/{chunk-RULQD7OX.js → chunk-THS4CKN4.js} +46 -87
  63. package/dist/{chunk-IYFKONIL.js → chunk-TPDNZCZU.js} +1 -1
  64. package/dist/{chunk-DNSIU27S.js → chunk-TPT6EF7K.js} +1 -1
  65. package/dist/{chunk-5IDFPCON.js → chunk-VRS6WDK5.js} +1 -1
  66. package/dist/{chunk-O7JTSJPU.js → chunk-WPGYWDJR.js} +6 -6
  67. package/dist/{chunk-OY2DBUV4.js → chunk-XY2IVIAY.js} +5 -5
  68. package/dist/{chunk-RVENVPNO.js → chunk-YAUQXZVT.js} +2 -2
  69. package/dist/{chunk-WVSQ2SCS.js → chunk-ZDKTZG3G.js} +1 -1
  70. package/dist/{chunk-MNY5M7RB.js → chunk-ZF6IC27P.js} +87 -10
  71. package/dist/cli/chat.js +32 -32
  72. package/dist/cli/check.js +6 -6
  73. package/dist/cli/plugins.js +13 -13
  74. package/dist/cli/snapshot-create.js +10 -10
  75. package/dist/cli/upgrade.js +7 -7
  76. package/dist/db/schema/workspaces.d.ts +169 -0
  77. package/dist/db/schema.d.ts +169 -1
  78. package/dist/{db-KKOZRE62.js → db-6VBMHVW2.js} +7 -7
  79. package/dist/{experimental-HH6OM6UH.js → experimental-XVDOSRBS.js} +1 -1
  80. package/dist/instrumentation.js +4 -4
  81. package/dist/nitro.js +2 -2
  82. package/dist/{oauth-callback-server-5AUZDWXA.js → oauth-callback-server-5NCCUIM2.js} +24 -24
  83. package/dist/{runner-K5H5NDEC.js → runner-6ONEB6TQ.js} +13 -13
  84. package/dist/{skills-OZGPB6G4.js → skills-Y5R36UH4.js} +6 -6
  85. package/dist/spawn-RFMBQ6B3.js +37 -0
  86. package/dist/{validation-TVHCNCYL.js → validation-HLHEQDEK.js} +6 -6
  87. package/dist/version.js +1 -1
  88. package/dist/{work-DXCQMJ5U.js → work-VIEFYTFG.js} +18 -18
  89. package/dist/worker-MRSKPKQZ.js +24 -0
  90. package/migrations/0029_dizzy_barracuda.sql +19 -0
  91. package/migrations/meta/0029_snapshot.json +2709 -0
  92. package/migrations/meta/_journal.json +8 -1
  93. package/package.json +8 -5
  94. package/dist/chunk-EM225ITJ.js +0 -56
  95. package/dist/spawn-RCQSC2L5.js +0 -37
  96. package/dist/worker-24HZ5HRI.js +0 -24
@@ -13,24 +13,25 @@ import {
13
13
  instructionProvenanceFor,
14
14
  sanitizePostgresJson,
15
15
  withConversationEventLock
16
- } from "./chunk-U2XOBFDK.js";
16
+ } from "./chunk-JI5EPI3O.js";
17
17
  import {
18
+ SANDBOX_REPOS_ROOT,
18
19
  SANDBOX_WORKSPACE_ROOT,
19
20
  sleep
20
- } from "./chunk-EM225ITJ.js";
21
+ } from "./chunk-BVREIWBD.js";
21
22
  import {
22
23
  MUTATION_LOCK_TTL_MS,
23
24
  fenceLock,
24
25
  getStateAdapter,
25
26
  withLock
26
- } from "./chunk-IYFKONIL.js";
27
+ } from "./chunk-TPDNZCZU.js";
27
28
  import {
28
29
  botConfig,
29
30
  completeText,
30
31
  escapeXml,
31
32
  resolveGatewayModel,
32
33
  unwrapCurrentInstruction
33
- } from "./chunk-RVENVPNO.js";
34
+ } from "./chunk-YAUQXZVT.js";
34
35
  import {
35
36
  parseSlackMessageTs,
36
37
  toStoredSlackActor
@@ -40,7 +41,7 @@ import {
40
41
  logException,
41
42
  logWarn,
42
43
  setSpanAttributes
43
- } from "./chunk-DNSIU27S.js";
44
+ } from "./chunk-TPT6EF7K.js";
44
45
 
45
46
  // src/chat/turn-context-tag.ts
46
47
  var TURN_CONTEXT_TAG = "runtime-turn-context";
@@ -2054,10 +2055,13 @@ async function findGitRoot(fs, cwd) {
2054
2055
  }
2055
2056
  }
2056
2057
  async function findSingleRepositoryDirectory(fs) {
2057
- const entries = await fs.readdir(SANDBOX_WORKSPACE_ROOT);
2058
+ if (!await directoryExists(fs, SANDBOX_REPOS_ROOT)) {
2059
+ return void 0;
2060
+ }
2061
+ const entries = await fs.readdir(SANDBOX_REPOS_ROOT);
2058
2062
  const repositories = [];
2059
2063
  for (const entry of entries) {
2060
- const candidate = path2.posix.join(SANDBOX_WORKSPACE_ROOT, entry);
2064
+ const candidate = path2.posix.join(SANDBOX_REPOS_ROOT, entry);
2061
2065
  if (await directoryExists(fs, candidate) && await pathExists(fs, path2.posix.join(candidate, ".git"))) {
2062
2066
  repositories.push(candidate);
2063
2067
  if (repositories.length > 1) {
@@ -3193,6 +3197,7 @@ export {
3193
3197
  resolveTaskTitle,
3194
3198
  resolveConversationTitle,
3195
3199
  persistConversationMessageSummaries,
3200
+ projectConversationMessages,
3196
3201
  hydrateConversationMessages,
3197
3202
  persistConversationMessages,
3198
3203
  loadProjection,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getStateAdapter
3
- } from "./chunk-IYFKONIL.js";
3
+ } from "./chunk-TPDNZCZU.js";
4
4
  import {
5
5
  getClient
6
6
  } from "./chunk-6GWA276C.js";
@@ -5,7 +5,7 @@ import {
5
5
  logInfo,
6
6
  logWarn,
7
7
  setSpanAttributes
8
- } from "./chunk-DNSIU27S.js";
8
+ } from "./chunk-TPT6EF7K.js";
9
9
  import {
10
10
  discoverInstalledPluginPackageContent,
11
11
  normalizePluginPackageNames
@@ -2,7 +2,7 @@ import {
2
2
  coerceThreadConversationState,
3
3
  getPersistedThreadState,
4
4
  persistThreadStateById
5
- } from "./chunk-QQ7SY5IZ.js";
5
+ } from "./chunk-EKGJVUVS.js";
6
6
  import {
7
7
  pluginTaskId,
8
8
  pluginTaskParamsSchema,
@@ -22,7 +22,7 @@ import {
22
22
  markTurnCompleted,
23
23
  normalizeToolNameFromResult,
24
24
  stripRuntimeTurnContext
25
- } from "./chunk-STZVUVMS.js";
25
+ } from "./chunk-MXFL7LNZ.js";
26
26
  import {
27
27
  JUNIOR_THREAD_STATE_TTL_MS
28
28
  } from "./chunk-3Y47VMHV.js";
@@ -33,25 +33,25 @@ import {
33
33
  createPluginModel,
34
34
  createPluginState,
35
35
  getPlugins
36
- } from "./chunk-MNY5M7RB.js";
36
+ } from "./chunk-ZF6IC27P.js";
37
37
  import {
38
38
  getConversationStore,
39
39
  getDb,
40
40
  sameActorIdentity
41
- } from "./chunk-U2XOBFDK.js";
41
+ } from "./chunk-JI5EPI3O.js";
42
42
  import {
43
43
  juniorConversations,
44
44
  juniorTaskExecutions
45
- } from "./chunk-FLMD25Y5.js";
45
+ } from "./chunk-ATWHPSMF.js";
46
46
  import {
47
47
  getStateAdapter
48
- } from "./chunk-IYFKONIL.js";
48
+ } from "./chunk-TPDNZCZU.js";
49
49
  import {
50
50
  ProviderError,
51
51
  findProviderError,
52
52
  getProviderErrorAttributes,
53
53
  getProviderErrorUserMessage
54
- } from "./chunk-RVENVPNO.js";
54
+ } from "./chunk-YAUQXZVT.js";
55
55
  import {
56
56
  credentialSubjectSchema
57
57
  } from "./chunk-BDUENQD3.js";
@@ -61,7 +61,7 @@ import {
61
61
  import {
62
62
  buildTurnFailureResponse,
63
63
  logWarn
64
- } from "./chunk-DNSIU27S.js";
64
+ } from "./chunk-TPT6EF7K.js";
65
65
 
66
66
  // src/chat/runtime/delivered-turn-state.ts
67
67
  function buildDeliveredTurnStatePatch(args) {
@@ -87,7 +87,7 @@ import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
87
87
 
88
88
  // src/chat/services/turn-session-routing.ts
89
89
  async function resolveTurnSessionRouting(args) {
90
- const conversationStore = args.conversationStore ?? (await import("./db-KKOZRE62.js")).getConversationStore();
90
+ const conversationStore = args.conversationStore ?? (await import("./db-6VBMHVW2.js")).getConversationStore();
91
91
  const conversation = await conversationStore.get({
92
92
  conversationId: args.conversationId
93
93
  });
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createPluginCatalogRuntime
3
- } from "./chunk-6WTDZKFR.js";
3
+ } from "./chunk-O4IK4O7C.js";
4
4
 
5
5
  // src/chat/plugins/catalog-runtime.ts
6
6
  var pluginCatalogRuntime = createPluginCatalogRuntime();
@@ -3,36 +3,36 @@ import {
3
3
  } from "./chunk-RF6J3DIO.js";
4
4
  import {
5
5
  resolveBaseUrl
6
- } from "./chunk-VXFDVY4C.js";
6
+ } from "./chunk-3OZNFCPR.js";
7
7
  import {
8
8
  isExperimentalFeatureEnabled
9
- } from "./chunk-5IDFPCON.js";
9
+ } from "./chunk-VRS6WDK5.js";
10
10
  import {
11
11
  createPluginLogger,
12
12
  getPlugins,
13
13
  getSlackClient,
14
14
  withSlackRetries
15
- } from "./chunk-MNY5M7RB.js";
15
+ } from "./chunk-ZF6IC27P.js";
16
16
  import {
17
17
  getDb,
18
18
  parseDestination
19
- } from "./chunk-U2XOBFDK.js";
19
+ } from "./chunk-JI5EPI3O.js";
20
20
  import {
21
21
  sleep
22
- } from "./chunk-EM225ITJ.js";
22
+ } from "./chunk-BVREIWBD.js";
23
23
  import {
24
24
  acquireActiveLock,
25
25
  getStateAdapter
26
- } from "./chunk-IYFKONIL.js";
26
+ } from "./chunk-TPDNZCZU.js";
27
27
  import {
28
28
  pluginCatalogRuntime
29
- } from "./chunk-CGAIDDLD.js";
29
+ } from "./chunk-RK7KPI6G.js";
30
30
  import {
31
31
  fetchWithBoundedOAuthErrorBodies
32
- } from "./chunk-6WTDZKFR.js";
32
+ } from "./chunk-O4IK4O7C.js";
33
33
  import {
34
34
  isRecord
35
- } from "./chunk-DNSIU27S.js";
35
+ } from "./chunk-TPT6EF7K.js";
36
36
 
37
37
  // src/chat/capabilities/router.ts
38
38
  var ProviderCredentialRouter = class {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getTurnRequestDeadline
3
- } from "./chunk-IRHX2S46.js";
3
+ } from "./chunk-BLZUFHM7.js";
4
4
  import {
5
5
  CONVERSATION_WORK_CHECK_IN_INTERVAL_MS,
6
6
  CONVERSATION_WORK_MAX_RETRIES,
@@ -21,20 +21,20 @@ import {
21
21
  releaseConversationWork,
22
22
  requestAnotherSlice,
23
23
  startConversationWork
24
- } from "./chunk-G35DUPNB.js";
24
+ } from "./chunk-IIT23D3M.js";
25
25
  import {
26
26
  ConversationQueueMessageRejectedError
27
27
  } from "./chunk-JAL3CH4G.js";
28
28
  import {
29
29
  getChatConfig,
30
30
  isProviderRetryError
31
- } from "./chunk-RVENVPNO.js";
31
+ } from "./chunk-YAUQXZVT.js";
32
32
  import {
33
33
  logException,
34
34
  logInfo,
35
35
  logWarn,
36
36
  withLogContext
37
- } from "./chunk-DNSIU27S.js";
37
+ } from "./chunk-TPT6EF7K.js";
38
38
 
39
39
  // src/chat/task-execution/worker.ts
40
40
  var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
@@ -1,21 +1,22 @@
1
1
  import {
2
2
  SANDBOX_WORKSPACE_ROOT,
3
+ runNonInteractiveCommand,
3
4
  sleep
4
- } from "./chunk-EM225ITJ.js";
5
+ } from "./chunk-BVREIWBD.js";
5
6
  import {
6
7
  getStateAdapter
7
- } from "./chunk-IYFKONIL.js";
8
+ } from "./chunk-TPDNZCZU.js";
8
9
  import {
9
10
  toOptionalTrimmed
10
- } from "./chunk-RVENVPNO.js";
11
+ } from "./chunk-YAUQXZVT.js";
11
12
  import {
12
13
  pluginCatalogRuntime
13
- } from "./chunk-CGAIDDLD.js";
14
+ } from "./chunk-RK7KPI6G.js";
14
15
  import {
15
16
  setSpanAttributes,
16
17
  setSpanStatus,
17
18
  withSpan
18
- } from "./chunk-DNSIU27S.js";
19
+ } from "./chunk-TPT6EF7K.js";
19
20
 
20
21
  // src/chat/sandbox/resources.ts
21
22
  var configuredResources;
@@ -52,76 +53,6 @@ function getSandboxResources() {
52
53
  // src/chat/sandbox/snapshot/profile.ts
53
54
  import { createHash } from "crypto";
54
55
 
55
- // src/chat/sandbox/noninteractive-command.ts
56
- var NON_INTERACTIVE_ENV = {
57
- CI: "1",
58
- TERM: "dumb",
59
- NO_COLOR: "1",
60
- PAGER: "cat",
61
- GIT_PAGER: "cat",
62
- GH_PROMPT_DISABLED: "1",
63
- GH_NO_UPDATE_NOTIFIER: "1",
64
- GH_NO_EXTENSION_UPDATE_NOTIFIER: "1",
65
- GH_SPINNER_DISABLED: "1",
66
- GIT_TERMINAL_PROMPT: "0",
67
- GCM_INTERACTIVE: "never",
68
- DEBIAN_FRONTEND: "noninteractive",
69
- // Git credential isolation: prevent git from sending its own auth so the
70
- // sandbox egress proxy's header transforms are the sole credential source.
71
- GIT_ASKPASS: "/bin/true",
72
- GIT_CONFIG_NOSYSTEM: "1",
73
- GIT_CONFIG_COUNT: "2",
74
- GIT_CONFIG_KEY_0: "credential.helper",
75
- GIT_CONFIG_VALUE_0: "",
76
- GIT_CONFIG_KEY_1: "http.emptyAuth",
77
- GIT_CONFIG_VALUE_1: "true"
78
- };
79
- function shellQuote(value) {
80
- return `'${value.replace(/'/g, "'\\''")}'`;
81
- }
82
- function buildEnvExports(options) {
83
- const lines = [];
84
- if (options.pathPrefix) {
85
- lines.push(`export PATH="${options.pathPrefix}"`);
86
- }
87
- for (const [key, value] of Object.entries(NON_INTERACTIVE_ENV)) {
88
- lines.push(`export ${key}=${shellQuote(value)}`);
89
- }
90
- for (const [key, value] of Object.entries(options.env ?? {})) {
91
- lines.push(`export ${key}=${shellQuote(value)}`);
92
- }
93
- return lines;
94
- }
95
- function buildCommandScript(input) {
96
- return [shellQuote(input.cmd), ...(input.args ?? []).map(shellQuote)].join(
97
- " "
98
- );
99
- }
100
- function buildNonInteractiveShellScript(script, options = {}) {
101
- return [...buildEnvExports(options), "exec </dev/null", script].join(" && ");
102
- }
103
- function buildNonInteractiveCommand(input) {
104
- return {
105
- cmd: "bash",
106
- args: [
107
- input.login ? "-lc" : "-c",
108
- buildNonInteractiveShellScript(buildCommandScript(input), {
109
- env: input.env,
110
- pathPrefix: input.pathPrefix
111
- })
112
- ]
113
- };
114
- }
115
- async function runNonInteractiveCommand(sandbox, input) {
116
- const command = {
117
- ...buildNonInteractiveCommand(input),
118
- ...input.cwd ? { cwd: input.cwd } : {},
119
- ...input.signal ? { signal: input.signal } : {},
120
- ...input.sudo !== void 0 ? { sudo: input.sudo } : {}
121
- };
122
- return await sandbox.runCommand(command);
123
- }
124
-
125
56
  // src/chat/sandbox/docker.ts
126
57
  var DOCKER_DAEMON_JSON = `{
127
58
  "storage-driver": "overlay2",
@@ -318,25 +249,46 @@ function floatingMaxAgeMs() {
318
249
  const parsed = Number.parseInt(raw, 10);
319
250
  return Number.isFinite(parsed) && parsed >= 0 ? parsed : DEFAULT_FLOATING_MAX_AGE_MS;
320
251
  }
321
- function create(runtime) {
252
+ function compareCodePoints(left, right) {
253
+ if (left < right) return -1;
254
+ if (left > right) return 1;
255
+ return 0;
256
+ }
257
+ function workspaceRecipe(workspace) {
258
+ const repos = [...workspace.repos].map(({ provider, repo }) => ({
259
+ provider,
260
+ repo
261
+ })).sort((left, right) => {
262
+ const provider = compareCodePoints(left.provider, right.provider);
263
+ if (provider !== 0) return provider;
264
+ return compareCodePoints(left.repo, right.repo);
265
+ });
266
+ return {
267
+ id: workspace.id,
268
+ repos,
269
+ setupScript: workspace.setupScript
270
+ };
271
+ }
272
+ function create(runtime, workspace) {
322
273
  const dependencies2 = mergeDependencies([
323
274
  ...GLOBAL_RUNTIME_DEPENDENCIES,
324
275
  ...pluginCatalogRuntime.getRuntimeDependencies()
325
276
  ]);
326
277
  const pluginPostinstall = pluginCatalogRuntime.getRuntimePostinstall();
327
278
  const postinstall2 = [...GLOBAL_RUNTIME_POSTINSTALL, ...pluginPostinstall];
328
- if (dependencies2.length === 0 && postinstall2.length === 0) {
279
+ if (dependencies2.length === 0 && postinstall2.length === 0 && !workspace) {
329
280
  return null;
330
281
  }
331
282
  const rebuildEpoch = process.env.SANDBOX_SNAPSHOT_REBUILD_EPOCH?.trim() ?? "";
332
- const floating = dependencies2.some((dependency) => isFloating(dependency)) || pluginPostinstall.length > 0;
283
+ const floating = dependencies2.some((dependency) => isFloating(dependency)) || pluginPostinstall.length > 0 || Boolean(workspace);
333
284
  const hash2 = createHash("sha256").update(
334
285
  JSON.stringify({
335
286
  version: VERSION,
336
287
  runtime,
337
288
  rebuildEpoch,
338
289
  dependencies: dependencies2,
339
- postinstall: postinstall2
290
+ postinstall: postinstall2,
291
+ ...workspace ? { workspace: workspaceRecipe(workspace) } : {}
340
292
  })
341
293
  ).digest("hex");
342
294
  return {
@@ -347,8 +299,8 @@ function create(runtime) {
347
299
  postinstall: postinstall2
348
300
  };
349
301
  }
350
- function hash(runtime) {
351
- return create(runtime)?.hash;
302
+ function hash(runtime, workspace) {
303
+ return create(runtime, workspace)?.hash;
352
304
  }
353
305
  function isStale(profile, createdAtMs) {
354
306
  if (!profile.floating) {
@@ -921,6 +873,13 @@ function createSandboxSession(sandbox, options) {
921
873
  }
922
874
  };
923
875
  }
876
+ async function stopSession(session) {
877
+ if (!session) return;
878
+ try {
879
+ await session.stop();
880
+ } catch {
881
+ }
882
+ }
924
883
 
925
884
  // src/chat/sandbox/snapshot/resolve.ts
926
885
  var SNAPSHOT_CACHE_PREFIX = "junior:sandbox_snapshot_profile";
@@ -969,7 +928,7 @@ async function setCachedSnapshot(entry) {
969
928
  SNAPSHOT_CACHE_TTL_MS
970
929
  );
971
930
  }
972
- async function build(value, runtime, timeoutMs, signal) {
931
+ async function build(value, runtime, timeoutMs, signal, prepare) {
973
932
  return await trace(
974
933
  "sandbox.snapshot.build",
975
934
  "sandbox.snapshot.build",
@@ -992,6 +951,7 @@ async function build(value, runtime, timeoutMs, signal) {
992
951
  try {
993
952
  await dependencies(sandbox, value.dependencies, signal);
994
953
  await postinstall(sandbox, value.postinstall, signal);
954
+ await prepare?.(sandbox);
995
955
  return await trace(
996
956
  "sandbox.snapshot.capture",
997
957
  "sandbox.snapshot.capture",
@@ -1100,7 +1060,7 @@ async function resolve(params) {
1100
1060
  async () => {
1101
1061
  params.signal?.throwIfAborted();
1102
1062
  await params.onProgress?.("resolve_start");
1103
- const currentProfile = create(params.runtime);
1063
+ const currentProfile = create(params.runtime, params.workspace);
1104
1064
  if (!currentProfile) {
1105
1065
  return {
1106
1066
  dependencyCount: 0,
@@ -1154,7 +1114,8 @@ async function resolve(params) {
1154
1114
  currentProfile,
1155
1115
  params.runtime,
1156
1116
  params.timeoutMs,
1157
- params.signal
1117
+ params.signal,
1118
+ params.prepareWorkspace
1158
1119
  );
1159
1120
  await setCachedSnapshot({
1160
1121
  profileHash: currentProfile.hash,
@@ -1192,9 +1153,6 @@ function isMissingError(error) {
1192
1153
  }
1193
1154
 
1194
1155
  export {
1195
- buildCommandScript,
1196
- buildNonInteractiveShellScript,
1197
- runNonInteractiveCommand,
1198
1156
  isAlreadyExistsError,
1199
1157
  isSandboxUnavailableError,
1200
1158
  isSandboxMissingError,
@@ -1211,6 +1169,7 @@ export {
1211
1169
  hash,
1212
1170
  bindSandboxFileSystem,
1213
1171
  createSandboxSession,
1172
+ stopSession,
1214
1173
  resolve,
1215
1174
  isMissingError
1216
1175
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getChatConfig
3
- } from "./chunk-RVENVPNO.js";
3
+ } from "./chunk-YAUQXZVT.js";
4
4
 
5
5
  // src/chat/state/adapter.ts
6
6
  import { createMemoryState } from "@chat-adapter/state-memory";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-6GWA276C.js";
10
10
  import {
11
11
  getDeploymentTelemetryAttributes
12
- } from "./chunk-WVSQ2SCS.js";
12
+ } from "./chunk-ZDKTZG3G.js";
13
13
 
14
14
  // src/chat/logging.ts
15
15
  import path from "path";
@@ -1,5 +1,5 @@
1
1
  // src/chat/experimental.ts
2
- var EXPERIMENTAL_FEATURES = ["subagents"];
2
+ var EXPERIMENTAL_FEATURES = ["acp", "subagents"];
3
3
  var EXPERIMENTAL_FEATURE_SET = new Set(EXPERIMENTAL_FEATURES);
4
4
  var configuredExperimental = {};
5
5
  function isExperimentalFeature(value) {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  appendAndEnqueueInboundMessage
3
- } from "./chunk-G35DUPNB.js";
3
+ } from "./chunk-IIT23D3M.js";
4
4
  import {
5
5
  ConversationTurnLifecycleService,
6
6
  getPersistedSandboxState,
7
7
  getPersistedThreadState,
8
8
  persistThreadStateById
9
- } from "./chunk-QQ7SY5IZ.js";
9
+ } from "./chunk-EKGJVUVS.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-OY2DBUV4.js";
18
+ } from "./chunk-XY2IVIAY.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-STZVUVMS.js";
29
+ } from "./chunk-MXFL7LNZ.js";
30
30
  import {
31
31
  getConversationEventStore,
32
32
  getConversationStore,
33
33
  getSqlExecutor
34
- } from "./chunk-U2XOBFDK.js";
34
+ } from "./chunk-JI5EPI3O.js";
35
35
  import {
36
36
  juniorAgentBindings,
37
37
  juniorAgentInvocations
38
- } from "./chunk-FLMD25Y5.js";
38
+ } from "./chunk-ATWHPSMF.js";
39
39
 
40
40
  // src/chat/agent-invocations/work.ts
41
41
  import { z } from "zod";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  formatProviderLabel,
6
6
  startOAuthFlow
7
- } from "./chunk-VXFDVY4C.js";
7
+ } from "./chunk-3OZNFCPR.js";
8
8
  import {
9
9
  parseSandboxEgressAuthRequiredSignal
10
10
  } from "./chunk-7MA4HV4W.js";
@@ -12,16 +12,16 @@ import {
12
12
  abandonReplacedPendingAuth,
13
13
  canReusePendingAuthLink,
14
14
  recordAuthorizationRequested
15
- } from "./chunk-STZVUVMS.js";
15
+ } from "./chunk-MXFL7LNZ.js";
16
16
  import {
17
17
  AGENT_INVOCATION_MAILBOX_STATUSES
18
- } from "./chunk-FLMD25Y5.js";
18
+ } from "./chunk-ATWHPSMF.js";
19
19
  import {
20
20
  TURN_REASONING_LEVELS
21
- } from "./chunk-RVENVPNO.js";
21
+ } from "./chunk-YAUQXZVT.js";
22
22
  import {
23
23
  pluginCatalogRuntime
24
- } from "./chunk-CGAIDDLD.js";
24
+ } from "./chunk-RK7KPI6G.js";
25
25
  import {
26
26
  credentialContextSchema
27
27
  } from "./chunk-BDUENQD3.js";
@@ -3,7 +3,7 @@ import {
3
3
  toCanonicalInputMessage,
4
4
  toCanonicalOutputMessage,
5
5
  toGenAiMessagesTraceAttributes
6
- } from "./chunk-EAIQBR66.js";
6
+ } from "./chunk-3T7RJVDJ.js";
7
7
  import {
8
8
  extractGenAiUsageAttributes,
9
9
  logException,
@@ -11,7 +11,7 @@ import {
11
11
  normalizeGenAiFinishReason,
12
12
  serializeGenAiAttribute,
13
13
  withSpan
14
- } from "./chunk-DNSIU27S.js";
14
+ } from "./chunk-TPT6EF7K.js";
15
15
 
16
16
  // src/chat/services/provider-error.ts
17
17
  var ProviderError = class extends Error {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  JUNIOR_VERSION
3
- } from "./chunk-WKN4ZQTZ.js";
3
+ } from "./chunk-2FBPN2Y4.js";
4
4
 
5
5
  // src/deployment.ts
6
6
  var JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";