@sentry/junior 0.170.0 → 0.171.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/{agent-hooks-IPUNCZPZ.js → agent-hooks-UXIRPATC.js} +15 -10
  2. package/dist/api.js +31 -30
  3. package/dist/app.js +32 -32
  4. package/dist/{catalog-runtime-E6XHWRPG.js → catalog-runtime-PQCGQUXA.js} +5 -5
  5. package/dist/chat/sandbox/snapshot/store.d.ts +28 -0
  6. package/dist/chat/workspaces/store.d.ts +1 -10
  7. package/dist/chat/workspaces/types.d.ts +14 -1
  8. package/dist/{chunk-B53NR3XY.js → chunk-2AYWP7PZ.js} +6 -270
  9. package/dist/{chunk-3SFZJVX5.js → chunk-3AX2WCFV.js} +2 -2
  10. package/dist/{chunk-T4SEUU7A.js → chunk-4TKPTFSO.js} +1 -1
  11. package/dist/{chunk-6W2UIZSA.js → chunk-5GF7HQOP.js} +70 -11
  12. package/dist/{chunk-KQCHIOME.js → chunk-5ML752HJ.js} +8 -8
  13. package/dist/{chunk-UD4BNNM2.js → chunk-5TZ2DKVU.js} +1 -1
  14. package/dist/{chunk-F3I6YFB4.js → chunk-62WK6FLT.js} +182 -68
  15. package/dist/{chunk-5EPG7PYS.js → chunk-6RRTVWAD.js} +1 -1
  16. package/dist/{chunk-YWX7D7BJ.js → chunk-AOAOBZJQ.js} +17 -17
  17. package/dist/chunk-CVHKLS7B.js +399 -0
  18. package/dist/{chunk-6GOKKLWF.js → chunk-CWTWZKWH.js} +6 -6
  19. package/dist/{chunk-NGL4XFT2.js → chunk-FI5A2RF6.js} +1 -1
  20. package/dist/{chunk-IX7VHMIJ.js → chunk-HKWEMKK4.js} +3 -3
  21. package/dist/{chunk-UHW5RAIB.js → chunk-HWXXFINO.js} +12 -12
  22. package/dist/{chunk-2XI6OLXA.js → chunk-IZSMYLCS.js} +9 -9
  23. package/dist/{chunk-47GJ7QRO.js → chunk-JNYIJHFF.js} +1 -1
  24. package/dist/{chunk-A22DGDXT.js → chunk-KUYIW4BD.js} +1 -1
  25. package/dist/{chunk-NFERKIUX.js → chunk-M5QJJMFK.js} +4 -4
  26. package/dist/{chunk-NESGW5HV.js → chunk-MFFU45QO.js} +1 -1
  27. package/dist/{chunk-TX553KXA.js → chunk-O2SUZKWU.js} +5 -5
  28. package/dist/{chunk-IF3OK4XO.js → chunk-POF7HORW.js} +6 -6
  29. package/dist/{chunk-FKOLWEMX.js → chunk-QHBHUCDS.js} +5 -5
  30. package/dist/{chunk-6E4WQV75.js → chunk-SIOO3CCL.js} +1 -1
  31. package/dist/{chunk-E7HKIHI5.js → chunk-UC35XHGT.js} +2 -2
  32. package/dist/{chunk-CA6JIB7S.js → chunk-UTG3IY2C.js} +21 -21
  33. package/dist/{chunk-IJTFG6AK.js → chunk-VGWC4KG2.js} +5 -9
  34. package/dist/{chunk-BW644E3V.js → chunk-WCWPRFHZ.js} +1 -1
  35. package/dist/{chunk-HZALSYOW.js → chunk-WIUGVE66.js} +5 -5
  36. package/dist/{chunk-4PSUCN4P.js → chunk-XHBYNJNZ.js} +1 -1
  37. package/dist/{chunk-7TVGQZOH.js → chunk-Y5RRKS67.js} +4 -4
  38. package/dist/{chunk-F4UM52UH.js → chunk-Y6DW6AVG.js} +1 -1
  39. package/dist/{chunk-74XMBKRI.js → chunk-YURMXTZF.js} +1 -1
  40. package/dist/cli/chat.js +30 -30
  41. package/dist/cli/check.js +6 -6
  42. package/dist/cli/plugins.js +13 -13
  43. package/dist/cli/snapshot-create.js +12 -11
  44. package/dist/cli/upgrade.js +7 -7
  45. package/dist/db/schema/snapshots.d.ts +254 -0
  46. package/dist/db/schema/workspaces.d.ts +0 -68
  47. package/dist/db/schema.d.ts +251 -69
  48. package/dist/{db-WMSEGSFM.js → db-EHCO5WGL.js} +7 -7
  49. package/dist/instrumentation.js +4 -4
  50. package/dist/nitro.js +2 -2
  51. package/dist/{oauth-callback-server-GBS47NTO.js → oauth-callback-server-O7CH6FOJ.js} +23 -23
  52. package/dist/{runner-V2A2Z7K3.js → runner-3D5AGGUD.js} +17 -13
  53. package/dist/{skills-Z35YXLUG.js → skills-6IW3DDW2.js} +6 -6
  54. package/dist/spawn-5LKOLABU.js +37 -0
  55. package/dist/{validation-EQCK4DA5.js → validation-RCLP4EU4.js} +6 -6
  56. package/dist/version.js +1 -1
  57. package/dist/{work-XIANCABO.js → work-L54N7O65.js} +18 -18
  58. package/dist/worker-VJCSXI5L.js +24 -0
  59. package/migrations/0032_workspace_snapshots_table.sql +69 -0
  60. package/migrations/meta/0032_snapshot.json +2892 -0
  61. package/migrations/meta/_journal.json +8 -1
  62. package/package.json +5 -5
  63. package/dist/chunk-BVREIWBD.js +0 -131
  64. package/dist/spawn-AKPJBUS2.js +0 -37
  65. package/dist/worker-YALLEN2Z.js +0 -24
@@ -1,22 +1,21 @@
1
1
  import {
2
2
  SANDBOX_WORKSPACE_ROOT,
3
+ create,
4
+ isStale,
3
5
  runNonInteractiveCommand,
4
6
  sleep
5
- } from "./chunk-BVREIWBD.js";
7
+ } from "./chunk-CVHKLS7B.js";
6
8
  import {
7
9
  getStateAdapter
8
- } from "./chunk-74XMBKRI.js";
10
+ } from "./chunk-YURMXTZF.js";
9
11
  import {
10
12
  toOptionalTrimmed
11
- } from "./chunk-E7HKIHI5.js";
12
- import {
13
- pluginCatalogRuntime
14
- } from "./chunk-6E4WQV75.js";
13
+ } from "./chunk-UC35XHGT.js";
15
14
  import {
16
15
  setSpanAttributes,
17
16
  setSpanStatus,
18
17
  withSpan
19
- } from "./chunk-5EPG7PYS.js";
18
+ } from "./chunk-6RRTVWAD.js";
20
19
 
21
20
  // src/chat/sandbox/resources.ts
22
21
  var configuredResources;
@@ -50,266 +49,6 @@ function getSandboxResources() {
50
49
  return configuredResources ?? resourcesFromEnv();
51
50
  }
52
51
 
53
- // src/chat/sandbox/snapshot/profile.ts
54
- import { createHash } from "crypto";
55
-
56
- // src/chat/sandbox/docker.ts
57
- var DOCKER_DAEMON_JSON = `{
58
- "storage-driver": "overlay2",
59
- "live-restore": false
60
- }
61
- `;
62
- var DOCKER_ENSURE_SCRIPT = `#!/bin/sh
63
- set -eu
64
-
65
- if [ "$(id -u)" -ne 0 ]; then
66
- exec sudo -n "$0" "$@"
67
- fi
68
-
69
- SOCK=/var/run/docker.sock
70
- PIDFILE=/var/run/docker.pid
71
- LOG=/var/log/junior-dockerd.log
72
-
73
- is_ready() {
74
- [ -S "$SOCK" ] && /usr/bin/docker info >/dev/null 2>&1
75
- }
76
-
77
- if is_ready; then
78
- chmod 666 "$SOCK" 2>/dev/null || true
79
- exit 0
80
- fi
81
-
82
- mkdir -p /etc/docker /var/lib/docker /var/run /var/log
83
- if [ ! -f /etc/docker/daemon.json ]; then
84
- cat > /etc/docker/daemon.json <<'EOF'
85
- {
86
- "storage-driver": "overlay2",
87
- "live-restore": false
88
- }
89
- EOF
90
- fi
91
-
92
- if [ -f "$PIDFILE" ]; then
93
- oldpid="$(cat "$PIDFILE" 2>/dev/null || true)"
94
- if [ -n "\${oldpid:-}" ] && ! kill -0 "$oldpid" 2>/dev/null; then
95
- rm -f "$PIDFILE"
96
- fi
97
- fi
98
-
99
- if [ ! -f "$PIDFILE" ] || ! kill -0 "$(cat "$PIDFILE" 2>/dev/null)" 2>/dev/null; then
100
- # dockerd must outlive this helper; nohup + background is intentional.
101
- nohup dockerd --host="unix://$SOCK" --pidfile="$PIDFILE" >"$LOG" 2>&1 &
102
- fi
103
-
104
- i=0
105
- while [ "$i" -lt 50 ]; do
106
- if is_ready; then
107
- chmod 666 "$SOCK" 2>/dev/null || true
108
- exit 0
109
- fi
110
- i=$((i + 1))
111
- sleep 0.1
112
- done
113
-
114
- echo "junior-ensure-docker: dockerd failed to become ready" >&2
115
- if [ -f "$LOG" ]; then
116
- tail -n 50 "$LOG" >&2 || true
117
- fi
118
- exit 1
119
- `;
120
- var DOCKER_CLI_WRAPPER_SCRIPT = `#!/bin/sh
121
- set -eu
122
- if command -v junior-ensure-docker >/dev/null 2>&1; then
123
- junior-ensure-docker
124
- fi
125
- exec /usr/bin/docker "$@"
126
- `;
127
- var DOCKER_COMPOSE_CLI_WRAPPER_SCRIPT = `#!/bin/sh
128
- set -eu
129
- if command -v junior-ensure-docker >/dev/null 2>&1; then
130
- junior-ensure-docker
131
- fi
132
- exec /usr/local/libexec/junior-docker-compose "$@"
133
- `;
134
- async function ensureDockerDaemon(sandbox, signal) {
135
- await runNonInteractiveCommand(sandbox, {
136
- cmd: "sh",
137
- args: [
138
- "-c",
139
- "command -v junior-ensure-docker >/dev/null 2>&1 && junior-ensure-docker || true"
140
- ],
141
- signal
142
- });
143
- }
144
-
145
- // src/chat/sandbox/runtime-dependencies.ts
146
- var GLOBAL_RUNTIME_DEPENDENCIES = [
147
- { type: "system", package: "docker" },
148
- { type: "system", package: "spal-release" },
149
- { type: "system", package: "ripgrep" }
150
- ];
151
- function writeFileCommand(path, contents, mode = "0644") {
152
- const payload = Buffer.from(contents, "utf8").toString("base64");
153
- return [
154
- `printf '%s' '${payload}' | base64 -d > ${path}`,
155
- `chmod ${mode} ${path}`
156
- ].join("\n");
157
- }
158
- function writeExecutableCommand(path, contents) {
159
- return writeFileCommand(path, contents, "0755");
160
- }
161
- var GLOBAL_RUNTIME_POSTINSTALL = [
162
- {
163
- cmd: "sh",
164
- args: [
165
- "-c",
166
- [
167
- "set -eu",
168
- 'case "$(uname -m)" in',
169
- ' x86_64) asset="x86_64"; sha256="7af95166a730b87e172d4fc9aefea8725d3c6c7327d59149267b452114ddb7d4" ;;',
170
- ' aarch64) asset="aarch64"; sha256="49082844b87f03cdcd5f5bbef1ba8c9c897b7a2dfb80cea18d61ec8ca6117e0c" ;;',
171
- ' *) echo "unsupported Docker Compose architecture: $(uname -m)" >&2; exit 1 ;;',
172
- "esac",
173
- 'tmp="$(mktemp)"',
174
- `trap 'rm -f "$tmp"' EXIT`,
175
- 'curl --fail --location --silent --show-error "https://github.com/docker/compose/releases/download/v2.39.4/docker-compose-linux-${asset}" --output "$tmp"',
176
- 'echo "${sha256} ${tmp}" | sha256sum --check --status',
177
- // Keep the real Compose binary off PATH; the wrapper below starts dockerd.
178
- 'install -D -m 0755 "$tmp" /usr/local/libexec/junior-docker-compose',
179
- "mkdir -p /usr/local/lib/docker/cli-plugins /usr/local/libexec /etc/docker /usr/local/bin",
180
- `mkdir -p ${SANDBOX_WORKSPACE_ROOT}/.junior/bin`,
181
- writeFileCommand("/etc/docker/daemon.json", DOCKER_DAEMON_JSON),
182
- writeExecutableCommand(
183
- "/usr/local/bin/junior-ensure-docker",
184
- DOCKER_ENSURE_SCRIPT
185
- ),
186
- // docker compose plugin delegates to the real Compose binary.
187
- "ln -sfn /usr/local/libexec/junior-docker-compose /usr/local/lib/docker/cli-plugins/docker-compose",
188
- // PATH wrappers auto-start dockerd for both CLI entrypoints.
189
- writeExecutableCommand(
190
- "/usr/local/bin/docker-compose",
191
- DOCKER_COMPOSE_CLI_WRAPPER_SCRIPT
192
- ),
193
- writeExecutableCommand(
194
- `${SANDBOX_WORKSPACE_ROOT}/.junior/bin/docker`,
195
- DOCKER_CLI_WRAPPER_SCRIPT
196
- ),
197
- writeExecutableCommand(
198
- `${SANDBOX_WORKSPACE_ROOT}/.junior/bin/docker-compose`,
199
- DOCKER_COMPOSE_CLI_WRAPPER_SCRIPT
200
- ),
201
- // Prefer the wrapper over /usr/bin/docker for non-login shells too.
202
- writeExecutableCommand(
203
- "/usr/local/bin/docker",
204
- DOCKER_CLI_WRAPPER_SCRIPT
205
- )
206
- ].join("\n")
207
- ],
208
- sudo: true
209
- }
210
- ];
211
-
212
- // src/chat/sandbox/snapshot/profile.ts
213
- var VERSION = 1;
214
- var DEFAULT_FLOATING_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1e3;
215
- function isExactNpmVersion(version) {
216
- return /^\d+\.\d+\.\d+(?:[-+][a-z0-9.]+)?$/i.test(version.trim());
217
- }
218
- function isFloating(dep) {
219
- return dep.type === "npm" && !isExactNpmVersion(dep.version);
220
- }
221
- function mergeDependencies(dependencies2) {
222
- const seen = /* @__PURE__ */ new Set();
223
- const npmVersions = /* @__PURE__ */ new Map();
224
- const merged = [];
225
- for (const dependency of dependencies2) {
226
- const key = dependency.type === "npm" ? `${dependency.type}:${dependency.package}:${dependency.version}` : "package" in dependency ? `${dependency.type}:package:${dependency.package}` : `${dependency.type}:url:${dependency.url}:${dependency.sha256}`;
227
- if (seen.has(key)) {
228
- continue;
229
- }
230
- seen.add(key);
231
- if (dependency.type === "npm") {
232
- const version = npmVersions.get(dependency.package);
233
- if (version !== void 0 && version !== dependency.version) {
234
- throw new Error(
235
- `Conflicting runtime dependency versions for ${dependency.package}: ${version} and ${dependency.version}`
236
- );
237
- }
238
- npmVersions.set(dependency.package, dependency.version);
239
- }
240
- merged.push(dependency);
241
- }
242
- return merged;
243
- }
244
- function floatingMaxAgeMs() {
245
- const raw = process.env.SANDBOX_SNAPSHOT_FLOATING_MAX_AGE_MS;
246
- if (!raw?.trim()) {
247
- return DEFAULT_FLOATING_MAX_AGE_MS;
248
- }
249
- const parsed = Number.parseInt(raw, 10);
250
- return Number.isFinite(parsed) && parsed >= 0 ? parsed : DEFAULT_FLOATING_MAX_AGE_MS;
251
- }
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) {
273
- const dependencies2 = mergeDependencies([
274
- ...GLOBAL_RUNTIME_DEPENDENCIES,
275
- ...pluginCatalogRuntime.getRuntimeDependencies()
276
- ]);
277
- const pluginPostinstall = pluginCatalogRuntime.getRuntimePostinstall();
278
- const postinstall2 = [...GLOBAL_RUNTIME_POSTINSTALL, ...pluginPostinstall];
279
- if (dependencies2.length === 0 && postinstall2.length === 0 && !workspace) {
280
- return null;
281
- }
282
- const rebuildEpoch = process.env.SANDBOX_SNAPSHOT_REBUILD_EPOCH?.trim() ?? "";
283
- const floating = dependencies2.some((dependency) => isFloating(dependency)) || pluginPostinstall.length > 0 || Boolean(workspace);
284
- const hash2 = createHash("sha256").update(
285
- JSON.stringify({
286
- version: VERSION,
287
- runtime,
288
- rebuildEpoch,
289
- dependencies: dependencies2,
290
- postinstall: postinstall2,
291
- ...workspace ? { workspace: workspaceRecipe(workspace) } : {}
292
- })
293
- ).digest("hex");
294
- return {
295
- hash: hash2,
296
- dependencyCount: dependencies2.length,
297
- floating,
298
- dependencies: dependencies2,
299
- postinstall: postinstall2
300
- };
301
- }
302
- function hash(runtime, workspace) {
303
- return create(runtime, workspace)?.hash;
304
- }
305
- function isStale(profile, createdAtMs) {
306
- if (!profile.floating) {
307
- return false;
308
- }
309
- const maxAgeMs = floatingMaxAgeMs();
310
- return maxAgeMs === 0 || Date.now() - createdAtMs > maxAgeMs;
311
- }
312
-
313
52
  // src/chat/sandbox/snapshot/resolve.ts
314
53
  import { Sandbox } from "@vercel/sandbox";
315
54
  import { z } from "zod";
@@ -1186,12 +925,9 @@ export {
1186
925
  wrapSandboxSetupError,
1187
926
  throwSandboxOperationError,
1188
927
  getVercelSandboxCredentials,
1189
- ensureDockerDaemon,
1190
928
  getSandboxResourceConfig,
1191
929
  setSandboxResourceConfig,
1192
930
  getSandboxResources,
1193
- create,
1194
- hash,
1195
931
  bindSandboxFileSystem,
1196
932
  createSandboxSession,
1197
933
  stopSession,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-6E4WQV75.js";
3
+ } from "./chunk-SIOO3CCL.js";
4
4
  import {
5
5
  logWarn
6
- } from "./chunk-5EPG7PYS.js";
6
+ } from "./chunk-6RRTVWAD.js";
7
7
  import {
8
8
  skillRoots
9
9
  } from "./chunk-H4HBKISO.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  FUNCTION_TIMEOUT_BUFFER_SECONDS,
3
3
  getChatConfig
4
- } from "./chunk-E7HKIHI5.js";
4
+ } from "./chunk-UC35XHGT.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
  DEFAULT_SQL_STATEMENT_TIMEOUT_MS
3
- } from "./chunk-E7HKIHI5.js";
3
+ } from "./chunk-UC35XHGT.js";
4
4
  import {
5
5
  juniorDestinations,
6
6
  timestamptz
@@ -645,25 +645,25 @@ var juniorSchedulerRuns = pgTable16(
645
645
  ]
646
646
  );
647
647
 
648
- // src/db/schema/workspaces.ts
648
+ // src/db/schema/snapshots.ts
649
+ import { sql as sql6 } from "drizzle-orm";
649
650
  import {
651
+ check as check2,
652
+ index as index13,
650
653
  integer as integer6,
651
- pgTable as pgTable17,
652
- primaryKey as primaryKey9,
653
- text as text17,
654
- uniqueIndex as uniqueIndex7
654
+ pgTable as pgTable18,
655
+ text as text18,
656
+ uniqueIndex as uniqueIndex8
655
657
  } from "drizzle-orm/pg-core";
658
+
659
+ // src/db/schema/workspaces.ts
660
+ import { pgTable as pgTable17, primaryKey as primaryKey9, text as text17, uniqueIndex as uniqueIndex7 } from "drizzle-orm/pg-core";
656
661
  var juniorWorkspaces = pgTable17(
657
662
  "junior_workspaces",
658
663
  {
659
664
  id: text17("id").primaryKey(),
660
665
  name: text17("name").notNull(),
661
666
  setupScript: text17("setup_script").notNull().default(""),
662
- // Last successful Workspace snapshot for the dashboard. Resolve still uses Redis.
663
- snapshotId: text17("snapshot_id"),
664
- snapshotGeneratedAt: timestamptz("snapshot_generated_at"),
665
- snapshotBuildDurationMs: integer6("snapshot_build_duration_ms"),
666
- snapshotProfileHash: text17("snapshot_profile_hash"),
667
667
  createdAt: timestamptz("created_at").notNull(),
668
668
  updatedAt: timestamptz("updated_at").notNull()
669
669
  },
@@ -681,6 +681,63 @@ var juniorWorkspaceRepos = pgTable17(
681
681
  ]
682
682
  );
683
683
 
684
+ // src/db/schema/snapshots.ts
685
+ var juniorSnapshots = pgTable18(
686
+ "junior_snapshots",
687
+ {
688
+ id: text18("id").primaryKey(),
689
+ workspaceId: text18("workspace_id").notNull().references(() => juniorWorkspaces.id, { onDelete: "cascade" }),
690
+ profileHash: text18("profile_hash").notNull(),
691
+ status: text18("status").$type().notNull(),
692
+ // Ready artifact facts.
693
+ snapshotId: text18("snapshot_id"),
694
+ buildDurationMs: integer6("build_duration_ms"),
695
+ generatedAt: timestamptz("generated_at"),
696
+ // In-flight builder references for check-in across execution slices.
697
+ buildStartedAt: timestamptz("build_started_at"),
698
+ buildPhase: text18("build_phase").$type(),
699
+ buildSandboxName: text18("build_sandbox_name"),
700
+ buildCommandId: text18("build_command_id"),
701
+ buildError: text18("build_error"),
702
+ createdAt: timestamptz("created_at").notNull(),
703
+ updatedAt: timestamptz("updated_at").notNull()
704
+ },
705
+ (table) => [
706
+ check2(
707
+ "junior_snapshots_status_check",
708
+ sql6`${table.status} in ('building', 'failed', 'ready')`
709
+ ),
710
+ check2(
711
+ "junior_snapshots_build_phase_check",
712
+ sql6`${table.buildPhase} is null or ${table.buildPhase} in ('created', 'dependencies_installed', 'repositories_prepared')`
713
+ ),
714
+ check2(
715
+ "junior_snapshots_ready_fields_check",
716
+ sql6`${table.status} <> 'ready' or (${table.snapshotId} is not null and ${table.buildDurationMs} is not null and ${table.generatedAt} is not null)`
717
+ ),
718
+ check2(
719
+ "junior_snapshots_build_fields_check",
720
+ sql6`${table.status} = 'ready' or (${table.buildStartedAt} is not null and ${table.buildPhase} is not null)`
721
+ ),
722
+ check2(
723
+ "junior_snapshots_build_duration_check",
724
+ sql6`${table.buildDurationMs} is null or ${table.buildDurationMs} >= 0`
725
+ ),
726
+ // Provider snapshot ids are unique. Nulls stay allowed for in-flight rows.
727
+ uniqueIndex8("junior_snapshots_snapshot_id_uidx").on(table.snapshotId),
728
+ index13("junior_snapshots_workspace_idx").on(table.workspaceId),
729
+ index13("junior_snapshots_workspace_profile_status_idx").on(
730
+ table.workspaceId,
731
+ table.profileHash,
732
+ table.status
733
+ ),
734
+ index13("junior_snapshots_workspace_status_idx").on(
735
+ table.workspaceId,
736
+ table.status
737
+ )
738
+ ]
739
+ );
740
+
684
741
  // src/db/schema.ts
685
742
  var juniorSqlSchema = {
686
743
  juniorArtifacts,
@@ -697,6 +754,7 @@ var juniorSqlSchema = {
697
754
  juniorDestinations,
698
755
  juniorEventTasks,
699
756
  juniorIdentities,
757
+ juniorSnapshots,
700
758
  juniorStats,
701
759
  juniorTaskExecutions,
702
760
  juniorSchedulerRuns,
@@ -977,5 +1035,6 @@ export {
977
1035
  juniorSchedulerRuns,
978
1036
  juniorWorkspaces,
979
1037
  juniorWorkspaceRepos,
1038
+ juniorSnapshots,
980
1039
  createJuniorSqlExecutor
981
1040
  };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-RF6J3DIO.js";
4
4
  import {
5
5
  resolveBaseUrl
6
- } from "./chunk-6GOKKLWF.js";
6
+ } from "./chunk-CWTWZKWH.js";
7
7
  import {
8
8
  isExperimentalFeatureEnabled
9
9
  } from "./chunk-VRS6WDK5.js";
@@ -12,27 +12,27 @@ import {
12
12
  getPlugins,
13
13
  getSlackClient,
14
14
  withSlackRetries
15
- } from "./chunk-F3I6YFB4.js";
15
+ } from "./chunk-62WK6FLT.js";
16
16
  import {
17
17
  getDb,
18
18
  parseDestination
19
- } from "./chunk-IX7VHMIJ.js";
19
+ } from "./chunk-HKWEMKK4.js";
20
20
  import {
21
21
  sleep
22
- } from "./chunk-BVREIWBD.js";
22
+ } from "./chunk-CVHKLS7B.js";
23
23
  import {
24
24
  acquireActiveLock,
25
25
  getStateAdapter
26
- } from "./chunk-74XMBKRI.js";
26
+ } from "./chunk-YURMXTZF.js";
27
27
  import {
28
28
  pluginCatalogRuntime
29
- } from "./chunk-6E4WQV75.js";
29
+ } from "./chunk-SIOO3CCL.js";
30
30
  import {
31
31
  fetchWithBoundedOAuthErrorBodies
32
- } from "./chunk-A22DGDXT.js";
32
+ } from "./chunk-KUYIW4BD.js";
33
33
  import {
34
34
  isRecord
35
- } from "./chunk-5EPG7PYS.js";
35
+ } from "./chunk-6RRTVWAD.js";
36
36
 
37
37
  // src/chat/capabilities/router.ts
38
38
  var ProviderCredentialRouter = class {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createAndEnqueueAgentInvocation
3
- } from "./chunk-IF3OK4XO.js";
3
+ } from "./chunk-POF7HORW.js";
4
4
  import {
5
5
  actorFromRun,
6
6
  toolInvocationDestination