@sentry/junior 0.170.0 → 0.172.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.
- package/dist/{agent-hooks-IPUNCZPZ.js → agent-hooks-IZMIMXUX.js} +15 -10
- package/dist/api.js +31 -30
- package/dist/app.js +32 -32
- package/dist/{catalog-runtime-E6XHWRPG.js → catalog-runtime-PDNXCNCJ.js} +5 -5
- package/dist/chat/sandbox/snapshot/store.d.ts +28 -0
- package/dist/chat/workspaces/store.d.ts +1 -10
- package/dist/chat/workspaces/types.d.ts +14 -1
- package/dist/{chunk-NESGW5HV.js → chunk-27T2WQJV.js} +1 -1
- package/dist/{chunk-47GJ7QRO.js → chunk-6RWQHBTV.js} +1 -1
- package/dist/{chunk-TX553KXA.js → chunk-A6AJ354O.js} +5 -5
- package/dist/{chunk-IJTFG6AK.js → chunk-AHWLGR5T.js} +5 -9
- package/dist/{chunk-CA6JIB7S.js → chunk-AQ4GXXRD.js} +21 -21
- package/dist/{chunk-3SFZJVX5.js → chunk-BTD6ZYFL.js} +2 -2
- package/dist/{chunk-E7HKIHI5.js → chunk-CBPREIWS.js} +2 -2
- package/dist/{chunk-7TVGQZOH.js → chunk-CO47EWFW.js} +4 -4
- package/dist/{chunk-2XI6OLXA.js → chunk-CUJ2T7FO.js} +9 -9
- package/dist/{chunk-F4UM52UH.js → chunk-ELAP5LB5.js} +1 -1
- package/dist/{chunk-BW644E3V.js → chunk-EXEO2R4S.js} +1 -1
- package/dist/{chunk-4PSUCN4P.js → chunk-FESC2EW7.js} +1 -1
- package/dist/{chunk-74XMBKRI.js → chunk-FUYKKSDV.js} +1 -1
- package/dist/{chunk-6GOKKLWF.js → chunk-G2DJ7LUE.js} +6 -6
- package/dist/{chunk-HZALSYOW.js → chunk-G4GNP4Q2.js} +5 -5
- package/dist/{chunk-6E4WQV75.js → chunk-HEOOUGVL.js} +1 -1
- package/dist/{chunk-5EPG7PYS.js → chunk-IAOQPDO6.js} +1 -1
- package/dist/chunk-IFSKN5VH.js +399 -0
- package/dist/{chunk-YWX7D7BJ.js → chunk-JOSDA5SZ.js} +17 -17
- package/dist/{chunk-6W2UIZSA.js → chunk-LVNMMESU.js} +70 -11
- package/dist/{chunk-UD4BNNM2.js → chunk-MNYAYK5I.js} +1 -1
- package/dist/{chunk-A22DGDXT.js → chunk-NB7WS4SP.js} +1 -1
- package/dist/{chunk-T4SEUU7A.js → chunk-Q36YWAJT.js} +1 -1
- package/dist/{chunk-NGL4XFT2.js → chunk-QAEKVEZY.js} +1 -1
- package/dist/{chunk-B53NR3XY.js → chunk-QBHPQCEQ.js} +6 -270
- package/dist/{chunk-NFERKIUX.js → chunk-QCGDWFYC.js} +4 -4
- package/dist/{chunk-KQCHIOME.js → chunk-SU7QH274.js} +8 -8
- package/dist/{chunk-IF3OK4XO.js → chunk-TWIRPYVB.js} +6 -6
- package/dist/{chunk-FKOLWEMX.js → chunk-W6THM2TX.js} +5 -5
- package/dist/{chunk-UHW5RAIB.js → chunk-XSO5JEHI.js} +12 -12
- package/dist/{chunk-IX7VHMIJ.js → chunk-Y4AEFUEV.js} +3 -3
- package/dist/{chunk-F3I6YFB4.js → chunk-YRBLN5PJ.js} +182 -68
- package/dist/cli/chat.js +30 -30
- package/dist/cli/check.js +6 -6
- package/dist/cli/plugins.js +13 -13
- package/dist/cli/snapshot-create.js +12 -11
- package/dist/cli/upgrade.js +7 -7
- package/dist/db/schema/snapshots.d.ts +254 -0
- package/dist/db/schema/workspaces.d.ts +0 -68
- package/dist/db/schema.d.ts +251 -69
- package/dist/{db-WMSEGSFM.js → db-32P3ZO4Z.js} +7 -7
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-GBS47NTO.js → oauth-callback-server-ZOHC35HH.js} +23 -23
- package/dist/{runner-V2A2Z7K3.js → runner-QWGQH425.js} +17 -13
- package/dist/{skills-Z35YXLUG.js → skills-2T6JZT2K.js} +6 -6
- package/dist/spawn-55U4TVHQ.js +37 -0
- package/dist/{validation-EQCK4DA5.js → validation-LMGCYHRK.js} +6 -6
- package/dist/version.js +1 -1
- package/dist/{work-XIANCABO.js → work-CVXCACZK.js} +18 -18
- package/dist/worker-SWMVAAN6.js +24 -0
- package/migrations/0032_workspace_snapshots_table.sql +69 -0
- package/migrations/meta/0032_snapshot.json +2892 -0
- package/migrations/meta/_journal.json +8 -1
- package/package.json +4 -4
- package/dist/chunk-BVREIWBD.js +0 -131
- package/dist/spawn-AKPJBUS2.js +0 -37
- package/dist/worker-YALLEN2Z.js +0 -24
|
@@ -2,30 +2,32 @@ import {
|
|
|
2
2
|
getConversationEventStore,
|
|
3
3
|
getDb,
|
|
4
4
|
getSqlExecutor
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Y4AEFUEV.js";
|
|
6
6
|
import {
|
|
7
7
|
juniorConversationAnnotations,
|
|
8
8
|
juniorConversationEvents,
|
|
9
9
|
juniorIdentities,
|
|
10
|
+
juniorSnapshots,
|
|
10
11
|
juniorUsers,
|
|
11
12
|
juniorWorkspaceRepos,
|
|
12
13
|
juniorWorkspaces
|
|
13
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LVNMMESU.js";
|
|
14
15
|
import {
|
|
15
16
|
SANDBOX_WORKSPACE_ROOT,
|
|
17
|
+
hash,
|
|
16
18
|
runNonInteractiveCommand,
|
|
17
19
|
sleep
|
|
18
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-IFSKN5VH.js";
|
|
19
21
|
import {
|
|
20
22
|
getStateAdapter
|
|
21
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-FUYKKSDV.js";
|
|
22
24
|
import {
|
|
23
25
|
botConfig,
|
|
24
26
|
completeObject,
|
|
25
27
|
embedTexts,
|
|
26
28
|
getSlackBotToken,
|
|
27
29
|
standardModelId
|
|
28
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-CBPREIWS.js";
|
|
29
31
|
import {
|
|
30
32
|
isActorUserId,
|
|
31
33
|
parseActorUserId,
|
|
@@ -41,7 +43,7 @@ import {
|
|
|
41
43
|
setSpanAttributes,
|
|
42
44
|
setSpanStatus,
|
|
43
45
|
withSpan
|
|
44
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-IAOQPDO6.js";
|
|
45
47
|
|
|
46
48
|
// src/chat/plugins/agent-hooks.ts
|
|
47
49
|
import {
|
|
@@ -1218,8 +1220,146 @@ function workspaceRepoCheckoutPath(repo) {
|
|
|
1218
1220
|
}
|
|
1219
1221
|
|
|
1220
1222
|
// src/chat/workspaces/store.ts
|
|
1223
|
+
import { randomUUID as randomUUID3 } from "crypto";
|
|
1224
|
+
import { and as and5, asc as asc2, eq as eq5, sql as sql2 } from "drizzle-orm";
|
|
1225
|
+
|
|
1226
|
+
// src/chat/sandbox/snapshot/runtime.ts
|
|
1227
|
+
var SANDBOX_RUNTIME = "node22";
|
|
1228
|
+
|
|
1229
|
+
// src/chat/sandbox/snapshot/store.ts
|
|
1221
1230
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
1222
|
-
import { and as and4,
|
|
1231
|
+
import { and as and4, desc as desc2, eq as eq4, ne } from "drizzle-orm";
|
|
1232
|
+
function snapshotFromRow(row) {
|
|
1233
|
+
if (row.status !== "ready" || !row.snapshotId || !row.generatedAt || row.buildDurationMs == null) {
|
|
1234
|
+
throw new Error(`Invalid ready Workspace snapshot row: ${row.id}`);
|
|
1235
|
+
}
|
|
1236
|
+
return {
|
|
1237
|
+
id: row.snapshotId,
|
|
1238
|
+
generatedAt: row.generatedAt,
|
|
1239
|
+
buildDurationMs: row.buildDurationMs,
|
|
1240
|
+
profileHash: row.profileHash
|
|
1241
|
+
};
|
|
1242
|
+
}
|
|
1243
|
+
function snapshotBuildFromRow(row) {
|
|
1244
|
+
if (row.status === "ready" || !row.buildStartedAt || !row.buildPhase) {
|
|
1245
|
+
throw new Error(`Invalid Workspace snapshot build row: ${row.id}`);
|
|
1246
|
+
}
|
|
1247
|
+
return {
|
|
1248
|
+
status: row.status,
|
|
1249
|
+
phase: row.buildPhase,
|
|
1250
|
+
profileHash: row.profileHash,
|
|
1251
|
+
startedAt: row.buildStartedAt,
|
|
1252
|
+
sandboxName: row.buildSandboxName,
|
|
1253
|
+
commandId: row.buildCommandId,
|
|
1254
|
+
error: row.buildError
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
async function loadSnapshotsForProfile(db, workspaceId, profileHash) {
|
|
1258
|
+
const profile = and4(
|
|
1259
|
+
eq4(juniorSnapshots.workspaceId, workspaceId),
|
|
1260
|
+
eq4(juniorSnapshots.profileHash, profileHash)
|
|
1261
|
+
);
|
|
1262
|
+
const order = [
|
|
1263
|
+
desc2(juniorSnapshots.updatedAt),
|
|
1264
|
+
desc2(juniorSnapshots.createdAt),
|
|
1265
|
+
desc2(juniorSnapshots.id)
|
|
1266
|
+
];
|
|
1267
|
+
const [readyRows, buildRows] = await Promise.all([
|
|
1268
|
+
db.select().from(juniorSnapshots).where(and4(profile, eq4(juniorSnapshots.status, "ready"))).orderBy(...order).limit(1),
|
|
1269
|
+
db.select().from(juniorSnapshots).where(and4(profile, ne(juniorSnapshots.status, "ready"))).orderBy(...order).limit(1)
|
|
1270
|
+
]);
|
|
1271
|
+
return {
|
|
1272
|
+
ready: readyRows[0] ? snapshotFromRow(readyRows[0]) : null,
|
|
1273
|
+
build: buildRows[0] ? snapshotBuildFromRow(buildRows[0]) : null
|
|
1274
|
+
};
|
|
1275
|
+
}
|
|
1276
|
+
async function clearNonReadySnapshots(db, workspaceId) {
|
|
1277
|
+
const deleted = await db.delete(juniorSnapshots).where(
|
|
1278
|
+
and4(
|
|
1279
|
+
eq4(juniorSnapshots.workspaceId, workspaceId),
|
|
1280
|
+
ne(juniorSnapshots.status, "ready")
|
|
1281
|
+
)
|
|
1282
|
+
).returning({
|
|
1283
|
+
sandboxName: juniorSnapshots.buildSandboxName
|
|
1284
|
+
});
|
|
1285
|
+
return deleted.map((row) => row.sandboxName).filter((name) => Boolean(name));
|
|
1286
|
+
}
|
|
1287
|
+
async function setWorkspaceSnapshot(workspaceId, snapshot) {
|
|
1288
|
+
const executor = getSqlExecutor();
|
|
1289
|
+
await executor.transaction(async () => {
|
|
1290
|
+
const db = executor.db();
|
|
1291
|
+
const workspaceRows = await db.select({ id: juniorWorkspaces.id }).from(juniorWorkspaces).where(eq4(juniorWorkspaces.id, workspaceId)).limit(1);
|
|
1292
|
+
if (!workspaceRows[0]) return;
|
|
1293
|
+
const now = /* @__PURE__ */ new Date();
|
|
1294
|
+
const existing = await db.select().from(juniorSnapshots).where(
|
|
1295
|
+
and4(
|
|
1296
|
+
eq4(juniorSnapshots.workspaceId, workspaceId),
|
|
1297
|
+
eq4(juniorSnapshots.profileHash, snapshot.profileHash)
|
|
1298
|
+
)
|
|
1299
|
+
).orderBy(desc2(juniorSnapshots.updatedAt), desc2(juniorSnapshots.createdAt)).limit(1);
|
|
1300
|
+
const current = existing[0];
|
|
1301
|
+
if (current && current.status !== "ready") {
|
|
1302
|
+
await db.update(juniorSnapshots).set({
|
|
1303
|
+
status: "ready",
|
|
1304
|
+
snapshotId: snapshot.id,
|
|
1305
|
+
buildDurationMs: snapshot.buildDurationMs,
|
|
1306
|
+
generatedAt: snapshot.generatedAt,
|
|
1307
|
+
buildStartedAt: null,
|
|
1308
|
+
buildPhase: null,
|
|
1309
|
+
buildSandboxName: null,
|
|
1310
|
+
buildCommandId: null,
|
|
1311
|
+
buildError: null,
|
|
1312
|
+
updatedAt: now
|
|
1313
|
+
}).where(eq4(juniorSnapshots.id, current.id));
|
|
1314
|
+
return;
|
|
1315
|
+
}
|
|
1316
|
+
if (current && current.status === "ready" && current.snapshotId === snapshot.id) {
|
|
1317
|
+
await db.update(juniorSnapshots).set({
|
|
1318
|
+
buildDurationMs: snapshot.buildDurationMs,
|
|
1319
|
+
generatedAt: snapshot.generatedAt,
|
|
1320
|
+
buildStartedAt: null,
|
|
1321
|
+
buildPhase: null,
|
|
1322
|
+
buildSandboxName: null,
|
|
1323
|
+
buildCommandId: null,
|
|
1324
|
+
buildError: null,
|
|
1325
|
+
updatedAt: now
|
|
1326
|
+
}).where(eq4(juniorSnapshots.id, current.id));
|
|
1327
|
+
return;
|
|
1328
|
+
}
|
|
1329
|
+
await db.insert(juniorSnapshots).values({
|
|
1330
|
+
id: randomUUID2(),
|
|
1331
|
+
workspaceId,
|
|
1332
|
+
profileHash: snapshot.profileHash,
|
|
1333
|
+
status: "ready",
|
|
1334
|
+
snapshotId: snapshot.id,
|
|
1335
|
+
buildDurationMs: snapshot.buildDurationMs,
|
|
1336
|
+
generatedAt: snapshot.generatedAt,
|
|
1337
|
+
buildStartedAt: null,
|
|
1338
|
+
buildSandboxName: null,
|
|
1339
|
+
buildCommandId: null,
|
|
1340
|
+
buildError: null,
|
|
1341
|
+
createdAt: now,
|
|
1342
|
+
updatedAt: now
|
|
1343
|
+
});
|
|
1344
|
+
});
|
|
1345
|
+
}
|
|
1346
|
+
async function recordResolvedWorkspaceSnapshot(workspaceId, snapshot) {
|
|
1347
|
+
if (!snapshot.snapshotId || !snapshot.profileHash || snapshot.createdAtMs == null || snapshot.buildDurationMs == null) {
|
|
1348
|
+
return;
|
|
1349
|
+
}
|
|
1350
|
+
try {
|
|
1351
|
+
await setWorkspaceSnapshot(workspaceId, {
|
|
1352
|
+
id: snapshot.snapshotId,
|
|
1353
|
+
generatedAt: new Date(snapshot.createdAtMs),
|
|
1354
|
+
buildDurationMs: snapshot.buildDurationMs,
|
|
1355
|
+
profileHash: snapshot.profileHash
|
|
1356
|
+
});
|
|
1357
|
+
} catch (error) {
|
|
1358
|
+
logException(error, "sandbox.workspace_snapshot.persist.failed", {
|
|
1359
|
+
"app.workspace.id": workspaceId
|
|
1360
|
+
});
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1223
1363
|
|
|
1224
1364
|
// src/chat/workspaces/validation.ts
|
|
1225
1365
|
var WORKSPACE_NAME_PATTERN = /^[a-z][a-z0-9_-]{0,63}$/;
|
|
@@ -1305,18 +1445,7 @@ function normalizeWorkspaceRecipe(input) {
|
|
|
1305
1445
|
}
|
|
1306
1446
|
|
|
1307
1447
|
// src/chat/workspaces/store.ts
|
|
1308
|
-
function
|
|
1309
|
-
if (!row.snapshotId || !row.snapshotGeneratedAt || row.snapshotBuildDurationMs == null || !row.snapshotProfileHash) {
|
|
1310
|
-
return null;
|
|
1311
|
-
}
|
|
1312
|
-
return {
|
|
1313
|
-
id: row.snapshotId,
|
|
1314
|
-
generatedAt: row.snapshotGeneratedAt,
|
|
1315
|
-
buildDurationMs: row.snapshotBuildDurationMs,
|
|
1316
|
-
profileHash: row.snapshotProfileHash
|
|
1317
|
-
};
|
|
1318
|
-
}
|
|
1319
|
-
function workspaceFromRows(row, repos) {
|
|
1448
|
+
function workspaceFromRows(row, repos, snapshot) {
|
|
1320
1449
|
return {
|
|
1321
1450
|
id: row.id,
|
|
1322
1451
|
name: row.name,
|
|
@@ -1325,17 +1454,28 @@ function workspaceFromRows(row, repos) {
|
|
|
1325
1454
|
provider: repo.provider,
|
|
1326
1455
|
repo: repo.repo
|
|
1327
1456
|
})),
|
|
1328
|
-
snapshot
|
|
1457
|
+
snapshot
|
|
1329
1458
|
};
|
|
1330
1459
|
}
|
|
1460
|
+
async function workspaceWithSnapshot(db, row, repos) {
|
|
1461
|
+
const workspace = workspaceFromRows(row, repos, null);
|
|
1462
|
+
const profileHash = hash(SANDBOX_RUNTIME, workspace);
|
|
1463
|
+
if (!profileHash) return workspace;
|
|
1464
|
+
const snapshots = await loadSnapshotsForProfile(
|
|
1465
|
+
db,
|
|
1466
|
+
workspace.id,
|
|
1467
|
+
profileHash
|
|
1468
|
+
);
|
|
1469
|
+
return { ...workspace, snapshot: snapshots.ready };
|
|
1470
|
+
}
|
|
1331
1471
|
async function loadWorkspaceRepos(db, workspaceId) {
|
|
1332
|
-
return await db.select().from(juniorWorkspaceRepos).where(
|
|
1472
|
+
return await db.select().from(juniorWorkspaceRepos).where(eq5(juniorWorkspaceRepos.workspaceId, workspaceId)).orderBy(
|
|
1333
1473
|
asc2(juniorWorkspaceRepos.provider),
|
|
1334
1474
|
asc2(juniorWorkspaceRepos.repo)
|
|
1335
1475
|
);
|
|
1336
1476
|
}
|
|
1337
1477
|
async function replaceWorkspaceRepos(db, workspaceId, repos) {
|
|
1338
|
-
await db.delete(juniorWorkspaceRepos).where(
|
|
1478
|
+
await db.delete(juniorWorkspaceRepos).where(eq5(juniorWorkspaceRepos.workspaceId, workspaceId));
|
|
1339
1479
|
if (repos.length === 0) return;
|
|
1340
1480
|
await db.insert(juniorWorkspaceRepos).values(
|
|
1341
1481
|
repos.map((repo) => ({
|
|
@@ -1374,7 +1514,8 @@ async function listWorkspaces(db) {
|
|
|
1374
1514
|
return workspaces.map(
|
|
1375
1515
|
(workspace) => workspaceFromRows(
|
|
1376
1516
|
workspace,
|
|
1377
|
-
repos.filter((repo) => repo.workspaceId === workspace.id)
|
|
1517
|
+
repos.filter((repo) => repo.workspaceId === workspace.id),
|
|
1518
|
+
null
|
|
1378
1519
|
)
|
|
1379
1520
|
);
|
|
1380
1521
|
}
|
|
@@ -1383,10 +1524,10 @@ async function listWorkspaceNamesByRepository(db, input) {
|
|
|
1383
1524
|
const repo = input.repo.trim();
|
|
1384
1525
|
const rows = await db.select({ name: juniorWorkspaces.name }).from(juniorWorkspaceRepos).innerJoin(
|
|
1385
1526
|
juniorWorkspaces,
|
|
1386
|
-
|
|
1527
|
+
eq5(juniorWorkspaces.id, juniorWorkspaceRepos.workspaceId)
|
|
1387
1528
|
).where(
|
|
1388
|
-
|
|
1389
|
-
|
|
1529
|
+
and5(
|
|
1530
|
+
eq5(juniorWorkspaceRepos.provider, provider),
|
|
1390
1531
|
// Recipes store the provided repo casing; identity is case-insensitive.
|
|
1391
1532
|
sql2`lower(${juniorWorkspaceRepos.repo}) = lower(${repo})`
|
|
1392
1533
|
)
|
|
@@ -1394,19 +1535,21 @@ async function listWorkspaceNamesByRepository(db, input) {
|
|
|
1394
1535
|
return rows.map((row) => row.name);
|
|
1395
1536
|
}
|
|
1396
1537
|
async function getWorkspaceByName(db, name) {
|
|
1397
|
-
const rows = await db.select().from(juniorWorkspaces).where(
|
|
1538
|
+
const rows = await db.select().from(juniorWorkspaces).where(eq5(juniorWorkspaces.name, name)).limit(1);
|
|
1398
1539
|
const workspace = rows[0];
|
|
1399
1540
|
if (!workspace) return void 0;
|
|
1400
|
-
return
|
|
1541
|
+
return await workspaceWithSnapshot(
|
|
1542
|
+
db,
|
|
1401
1543
|
workspace,
|
|
1402
1544
|
await loadWorkspaceRepos(db, workspace.id)
|
|
1403
1545
|
);
|
|
1404
1546
|
}
|
|
1405
1547
|
async function getWorkspace(db, id) {
|
|
1406
|
-
const rows = await db.select().from(juniorWorkspaces).where(
|
|
1548
|
+
const rows = await db.select().from(juniorWorkspaces).where(eq5(juniorWorkspaces.id, id)).limit(1);
|
|
1407
1549
|
const workspace = rows[0];
|
|
1408
1550
|
if (!workspace) return void 0;
|
|
1409
|
-
return
|
|
1551
|
+
return await workspaceWithSnapshot(
|
|
1552
|
+
db,
|
|
1410
1553
|
workspace,
|
|
1411
1554
|
await loadWorkspaceRepos(db, workspace.id)
|
|
1412
1555
|
);
|
|
@@ -1415,7 +1558,7 @@ async function createWorkspace(input) {
|
|
|
1415
1558
|
const recipe = normalizeWorkspaceRecipe(input);
|
|
1416
1559
|
const executor = getSqlExecutor();
|
|
1417
1560
|
const now = /* @__PURE__ */ new Date();
|
|
1418
|
-
const id =
|
|
1561
|
+
const id = randomUUID3();
|
|
1419
1562
|
try {
|
|
1420
1563
|
await executor.transaction(async () => {
|
|
1421
1564
|
const db = executor.db();
|
|
@@ -1445,7 +1588,7 @@ async function updateWorkspace(id, input) {
|
|
|
1445
1588
|
try {
|
|
1446
1589
|
const updated = await executor.transaction(async () => {
|
|
1447
1590
|
const db = executor.db();
|
|
1448
|
-
const existingRows = await db.select().from(juniorWorkspaces).where(
|
|
1591
|
+
const existingRows = await db.select().from(juniorWorkspaces).where(eq5(juniorWorkspaces.id, id)).limit(1);
|
|
1449
1592
|
const existing = existingRows[0];
|
|
1450
1593
|
if (!existing) return void 0;
|
|
1451
1594
|
const existingRepos = await loadWorkspaceRepos(db, id);
|
|
@@ -1453,15 +1596,12 @@ async function updateWorkspace(id, input) {
|
|
|
1453
1596
|
const rows = await db.update(juniorWorkspaces).set({
|
|
1454
1597
|
name: recipe.name,
|
|
1455
1598
|
setupScript: recipe.setupScript,
|
|
1456
|
-
...snapshotChanged ? {
|
|
1457
|
-
snapshotId: null,
|
|
1458
|
-
snapshotGeneratedAt: null,
|
|
1459
|
-
snapshotBuildDurationMs: null,
|
|
1460
|
-
snapshotProfileHash: null
|
|
1461
|
-
} : {},
|
|
1462
1599
|
updatedAt: now
|
|
1463
|
-
}).where(
|
|
1600
|
+
}).where(eq5(juniorWorkspaces.id, id)).returning();
|
|
1464
1601
|
await replaceWorkspaceRepos(db, id, recipe.repos);
|
|
1602
|
+
if (snapshotChanged) {
|
|
1603
|
+
await clearNonReadySnapshots(db, id);
|
|
1604
|
+
}
|
|
1465
1605
|
return rows[0];
|
|
1466
1606
|
});
|
|
1467
1607
|
if (!updated) return void 0;
|
|
@@ -1478,37 +1618,10 @@ async function updateWorkspace(id, input) {
|
|
|
1478
1618
|
async function deleteWorkspace(id) {
|
|
1479
1619
|
const executor = getSqlExecutor();
|
|
1480
1620
|
return await executor.transaction(async () => {
|
|
1481
|
-
const rows = await executor.db().delete(juniorWorkspaces).where(
|
|
1621
|
+
const rows = await executor.db().delete(juniorWorkspaces).where(eq5(juniorWorkspaces.id, id)).returning({ id: juniorWorkspaces.id });
|
|
1482
1622
|
return rows.length > 0;
|
|
1483
1623
|
});
|
|
1484
1624
|
}
|
|
1485
|
-
async function setWorkspaceSnapshot(workspaceId, snapshot) {
|
|
1486
|
-
const executor = getSqlExecutor();
|
|
1487
|
-
await executor.db().update(juniorWorkspaces).set({
|
|
1488
|
-
snapshotId: snapshot.id,
|
|
1489
|
-
snapshotGeneratedAt: snapshot.generatedAt,
|
|
1490
|
-
snapshotBuildDurationMs: snapshot.buildDurationMs,
|
|
1491
|
-
snapshotProfileHash: snapshot.profileHash,
|
|
1492
|
-
updatedAt: /* @__PURE__ */ new Date()
|
|
1493
|
-
}).where(eq4(juniorWorkspaces.id, workspaceId));
|
|
1494
|
-
}
|
|
1495
|
-
async function recordResolvedWorkspaceSnapshot(workspaceId, snapshot) {
|
|
1496
|
-
if (!snapshot.snapshotId || !snapshot.profileHash || snapshot.createdAtMs == null || snapshot.buildDurationMs == null) {
|
|
1497
|
-
return;
|
|
1498
|
-
}
|
|
1499
|
-
try {
|
|
1500
|
-
await setWorkspaceSnapshot(workspaceId, {
|
|
1501
|
-
id: snapshot.snapshotId,
|
|
1502
|
-
generatedAt: new Date(snapshot.createdAtMs),
|
|
1503
|
-
buildDurationMs: snapshot.buildDurationMs,
|
|
1504
|
-
profileHash: snapshot.profileHash
|
|
1505
|
-
});
|
|
1506
|
-
} catch (error) {
|
|
1507
|
-
logException(error, "sandbox.workspace_snapshot.persist.failed", {
|
|
1508
|
-
"app.workspace.id": workspaceId
|
|
1509
|
-
});
|
|
1510
|
-
}
|
|
1511
|
-
}
|
|
1512
1625
|
|
|
1513
1626
|
// src/chat/plugins/agent-hooks.ts
|
|
1514
1627
|
var PluginHookDeniedError = class extends Error {
|
|
@@ -2734,6 +2847,8 @@ export {
|
|
|
2734
2847
|
resolveChannelCapabilities,
|
|
2735
2848
|
tryWorkspaceRepoCheckoutPath,
|
|
2736
2849
|
workspaceRepoCheckoutPath,
|
|
2850
|
+
SANDBOX_RUNTIME,
|
|
2851
|
+
recordResolvedWorkspaceSnapshot,
|
|
2737
2852
|
WorkspaceValidationError,
|
|
2738
2853
|
listWorkspaces,
|
|
2739
2854
|
getWorkspaceByName,
|
|
@@ -2741,7 +2856,6 @@ export {
|
|
|
2741
2856
|
createWorkspace,
|
|
2742
2857
|
updateWorkspace,
|
|
2743
2858
|
deleteWorkspace,
|
|
2744
|
-
recordResolvedWorkspaceSnapshot,
|
|
2745
2859
|
PluginHookDeniedError,
|
|
2746
2860
|
validatePlugins,
|
|
2747
2861
|
setPlugins,
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeAgentRun
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-AQ4GXXRD.js";
|
|
4
|
+
import "../chunk-W6THM2TX.js";
|
|
5
5
|
import "../chunk-DIB4GX3G.js";
|
|
6
6
|
import {
|
|
7
7
|
createAgentRunner
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-SU7QH274.js";
|
|
9
9
|
import "../chunk-RF6J3DIO.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-G2DJ7LUE.js";
|
|
11
11
|
import "../chunk-6ZWRNC4D.js";
|
|
12
12
|
import "../chunk-VRS6WDK5.js";
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-AHWLGR5T.js";
|
|
14
|
+
import "../chunk-FESC2EW7.js";
|
|
15
|
+
import "../chunk-G4GNP4Q2.js";
|
|
16
16
|
import "../chunk-3Y47VMHV.js";
|
|
17
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-QBHPQCEQ.js";
|
|
18
18
|
import "../chunk-PDO5BLNM.js";
|
|
19
19
|
import "../chunk-UIE3R5XU.js";
|
|
20
20
|
import {
|
|
21
21
|
loadAppPluginSet
|
|
22
22
|
} from "../chunk-Y2CM7HXH.js";
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
28
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-YRBLN5PJ.js";
|
|
24
|
+
import "../chunk-Y4AEFUEV.js";
|
|
25
|
+
import "../chunk-LVNMMESU.js";
|
|
26
|
+
import "../chunk-IFSKN5VH.js";
|
|
27
|
+
import "../chunk-FUYKKSDV.js";
|
|
28
|
+
import "../chunk-CBPREIWS.js";
|
|
29
29
|
import "../chunk-VFUK3X5B.js";
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
30
|
+
import "../chunk-QAEKVEZY.js";
|
|
31
|
+
import "../chunk-BTD6ZYFL.js";
|
|
32
|
+
import "../chunk-HEOOUGVL.js";
|
|
33
|
+
import "../chunk-NB7WS4SP.js";
|
|
34
34
|
import "../chunk-CGA4ERJ5.js";
|
|
35
35
|
import "../chunk-M63DETLL.js";
|
|
36
|
-
import "../chunk-
|
|
36
|
+
import "../chunk-IAOQPDO6.js";
|
|
37
37
|
import "../chunk-6GWA276C.js";
|
|
38
38
|
import "../chunk-OOUNJNMR.js";
|
|
39
39
|
import "../chunk-H4HBKISO.js";
|
|
40
|
-
import "../chunk-
|
|
41
|
-
import "../chunk-
|
|
40
|
+
import "../chunk-EXEO2R4S.js";
|
|
41
|
+
import "../chunk-ELAP5LB5.js";
|
|
42
42
|
import "../chunk-MLKGABMK.js";
|
|
43
43
|
|
|
44
44
|
// src/cli/chat.ts
|
|
@@ -161,10 +161,10 @@ async function configureLocalChatPlugins(pluginSet) {
|
|
|
161
161
|
databaseModule
|
|
162
162
|
] = await Promise.all([
|
|
163
163
|
import("../plugins-HW4VWW6G.js"),
|
|
164
|
-
import("../agent-hooks-
|
|
165
|
-
import("../catalog-runtime-
|
|
166
|
-
import("../validation-
|
|
167
|
-
import("../db-
|
|
164
|
+
import("../agent-hooks-IZMIMXUX.js"),
|
|
165
|
+
import("../catalog-runtime-PDNXCNCJ.js"),
|
|
166
|
+
import("../validation-LMGCYHRK.js"),
|
|
167
|
+
import("../db-32P3ZO4Z.js")
|
|
168
168
|
]);
|
|
169
169
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
170
170
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -230,14 +230,14 @@ async function prepareLocalChatRun(io, pluginSet) {
|
|
|
230
230
|
await configureLocalChatPlugins(pluginSet);
|
|
231
231
|
const { setExperimentalFeatures } = await import("../experimental-XVDOSRBS.js");
|
|
232
232
|
setExperimentalFeatures({ subagents: true });
|
|
233
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
234
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
233
|
+
const { runLocalAgentTurn } = await import("../runner-QWGQH425.js");
|
|
234
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-ZOHC35HH.js");
|
|
235
235
|
const { createLocalOAuthState } = await import("../oauth-relay-3ZU72UGL.js");
|
|
236
236
|
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-DXOOBSBI.js");
|
|
237
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
238
|
-
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-
|
|
237
|
+
const { bindSpawnAgent } = await import("../spawn-55U4TVHQ.js");
|
|
238
|
+
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-CVXCACZK.js");
|
|
239
239
|
const { createLocalConversationWork } = await import("../conversation-work-KATFHLG3.js");
|
|
240
|
-
const { processConversationWork } = await import("../worker-
|
|
240
|
+
const { processConversationWork } = await import("../worker-SWMVAAN6.js");
|
|
241
241
|
let agentRunner;
|
|
242
242
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
243
243
|
if (!agentRunner) {
|
package/dist/cli/check.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseSkillFile
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-BTD6ZYFL.js";
|
|
4
|
+
import "../chunk-HEOOUGVL.js";
|
|
5
5
|
import {
|
|
6
6
|
parseInlinePluginManifest,
|
|
7
7
|
parsePluginManifest
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-NB7WS4SP.js";
|
|
9
9
|
import "../chunk-CGA4ERJ5.js";
|
|
10
10
|
import "../chunk-M63DETLL.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-IAOQPDO6.js";
|
|
12
12
|
import "../chunk-6GWA276C.js";
|
|
13
13
|
import "../chunk-OOUNJNMR.js";
|
|
14
14
|
import "../chunk-H4HBKISO.js";
|
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE,
|
|
17
17
|
JUNIOR_HEARTBEAT_ROUTE,
|
|
18
18
|
LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
19
|
+
} from "../chunk-EXEO2R4S.js";
|
|
20
|
+
import "../chunk-ELAP5LB5.js";
|
|
21
21
|
import "../chunk-MLKGABMK.js";
|
|
22
22
|
|
|
23
23
|
// src/cli/check.ts
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
validatePluginEgressCredentialHooks,
|
|
3
3
|
validatePluginRegistrations
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-6RWQHBTV.js";
|
|
5
5
|
import {
|
|
6
6
|
pluginCatalogConfigFromPluginSet,
|
|
7
7
|
pluginCliRegistrationsFromPluginSet,
|
|
@@ -14,28 +14,28 @@ import {
|
|
|
14
14
|
createPluginLogger,
|
|
15
15
|
setPlugins,
|
|
16
16
|
validatePlugins
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-YRBLN5PJ.js";
|
|
18
18
|
import {
|
|
19
19
|
getDb
|
|
20
|
-
} from "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
20
|
+
} from "../chunk-Y4AEFUEV.js";
|
|
21
|
+
import "../chunk-LVNMMESU.js";
|
|
22
|
+
import "../chunk-IFSKN5VH.js";
|
|
23
|
+
import "../chunk-FUYKKSDV.js";
|
|
24
|
+
import "../chunk-CBPREIWS.js";
|
|
25
25
|
import "../chunk-VFUK3X5B.js";
|
|
26
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-QAEKVEZY.js";
|
|
27
27
|
import {
|
|
28
28
|
pluginCatalogRuntime
|
|
29
|
-
} from "../chunk-
|
|
30
|
-
import "../chunk-
|
|
29
|
+
} from "../chunk-HEOOUGVL.js";
|
|
30
|
+
import "../chunk-NB7WS4SP.js";
|
|
31
31
|
import "../chunk-CGA4ERJ5.js";
|
|
32
32
|
import "../chunk-M63DETLL.js";
|
|
33
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-IAOQPDO6.js";
|
|
34
34
|
import "../chunk-6GWA276C.js";
|
|
35
35
|
import "../chunk-OOUNJNMR.js";
|
|
36
36
|
import "../chunk-H4HBKISO.js";
|
|
37
|
-
import "../chunk-
|
|
38
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-EXEO2R4S.js";
|
|
38
|
+
import "../chunk-ELAP5LB5.js";
|
|
39
39
|
import "../chunk-MLKGABMK.js";
|
|
40
40
|
|
|
41
41
|
// src/cli/plugins.ts
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
|
-
create,
|
|
3
2
|
resolve
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import
|
|
3
|
+
} from "../chunk-QBHPQCEQ.js";
|
|
4
|
+
import {
|
|
5
|
+
create
|
|
6
|
+
} from "../chunk-IFSKN5VH.js";
|
|
6
7
|
import {
|
|
7
8
|
disconnectStateAdapter
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-FUYKKSDV.js";
|
|
10
|
+
import "../chunk-CBPREIWS.js";
|
|
11
|
+
import "../chunk-QAEKVEZY.js";
|
|
11
12
|
import {
|
|
12
13
|
pluginCatalogRuntime
|
|
13
|
-
} from "../chunk-
|
|
14
|
-
import "../chunk-
|
|
14
|
+
} from "../chunk-HEOOUGVL.js";
|
|
15
|
+
import "../chunk-NB7WS4SP.js";
|
|
15
16
|
import "../chunk-CGA4ERJ5.js";
|
|
16
17
|
import "../chunk-M63DETLL.js";
|
|
17
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-IAOQPDO6.js";
|
|
18
19
|
import "../chunk-6GWA276C.js";
|
|
19
20
|
import "../chunk-OOUNJNMR.js";
|
|
20
21
|
import "../chunk-H4HBKISO.js";
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-EXEO2R4S.js";
|
|
23
|
+
import "../chunk-ELAP5LB5.js";
|
|
23
24
|
import "../chunk-MLKGABMK.js";
|
|
24
25
|
|
|
25
26
|
// src/cli/snapshot-create.ts
|
package/dist/cli/upgrade.js
CHANGED
|
@@ -8,23 +8,23 @@ import {
|
|
|
8
8
|
} from "../chunk-Y2CM7HXH.js";
|
|
9
9
|
import {
|
|
10
10
|
createJuniorSqlExecutor
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-LVNMMESU.js";
|
|
12
12
|
import {
|
|
13
13
|
getChatConfig
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-CBPREIWS.js";
|
|
15
15
|
import "../chunk-VFUK3X5B.js";
|
|
16
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-QAEKVEZY.js";
|
|
17
17
|
import {
|
|
18
18
|
createPluginCatalogRuntime
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-NB7WS4SP.js";
|
|
20
20
|
import "../chunk-CGA4ERJ5.js";
|
|
21
21
|
import "../chunk-M63DETLL.js";
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-IAOQPDO6.js";
|
|
23
23
|
import "../chunk-6GWA276C.js";
|
|
24
24
|
import "../chunk-OOUNJNMR.js";
|
|
25
25
|
import "../chunk-H4HBKISO.js";
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-EXEO2R4S.js";
|
|
27
|
+
import "../chunk-ELAP5LB5.js";
|
|
28
28
|
import "../chunk-MLKGABMK.js";
|
|
29
29
|
|
|
30
30
|
// src/chat/conversations/sql/migrations.ts
|