@srobroek/pi-speckit-beads 3.2.0 → 3.2.2
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/CHANGELOG.md +4 -0
- package/extensions/speckit-beads.js +341 -149
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## speckit-beads [3.2.2](https://github.com/srobroek/harness-plugins/compare/speckit-beads--v3.2.1...speckit-beads--v3.2.2) (2026-12-05)
|
|
2
|
+
|
|
3
|
+
## speckit-beads [3.2.1](https://github.com/srobroek/harness-plugins/compare/speckit-beads--v3.2.0...speckit-beads--v3.2.1) (2026-12-05)
|
|
4
|
+
|
|
1
5
|
## speckit-beads [3.2.0](https://github.com/srobroek/harness-plugins/compare/speckit-beads--v3.1.0...speckit-beads--v3.2.0) (2026-12-05)
|
|
2
6
|
|
|
3
7
|
### Features
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Generated by scripts/build.ts. Do not edit.
|
|
3
3
|
// plugins/speckit-beads/pi-src/speckit-beads.ts
|
|
4
4
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
5
|
-
import { join as
|
|
5
|
+
import { join as join10 } from "path";
|
|
6
6
|
import { getAgentDir } from "@earendil-works/pi-coding-agent";
|
|
7
7
|
|
|
8
8
|
// lib/src/external-directories.ts
|
|
@@ -1214,9 +1214,197 @@ The index was not synced for these paths: ${synced.reason}`}`,
|
|
|
1214
1214
|
}
|
|
1215
1215
|
|
|
1216
1216
|
// plugins/speckit-beads/opencode/src/setup.ts
|
|
1217
|
-
import { appendFileSync,
|
|
1218
|
-
import { dirname as dirname3, isAbsolute as
|
|
1217
|
+
import { appendFileSync, existsSync as existsSync3, lstatSync as lstatSync3, readFileSync as readFileSync4, writeFileSync } from "fs";
|
|
1218
|
+
import { dirname as dirname3, isAbsolute as isAbsolute3, join as join5, relative as relative2, resolve as resolve4, sep } from "path";
|
|
1219
1219
|
import { fileURLToPath } from "url";
|
|
1220
|
+
|
|
1221
|
+
// lib/src/formulas.ts
|
|
1222
|
+
import { accessSync, constants as constants2, copyFileSync, lstatSync as lstatSync2, mkdirSync as mkdirSync2, readFileSync as readFileSync3, statSync as statSync2 } from "fs";
|
|
1223
|
+
import { isAbsolute as isAbsolute2, join as join4, resolve as resolve3 } from "path";
|
|
1224
|
+
function describeFormulaFailure(failure) {
|
|
1225
|
+
const paths = failure.paths.join(", ");
|
|
1226
|
+
switch (failure.kind) {
|
|
1227
|
+
case "symlinked-directory":
|
|
1228
|
+
return `refusing symlinked path: ${paths}`;
|
|
1229
|
+
case "no-workspace":
|
|
1230
|
+
return `not a beads workspace: ${paths} has no .beads/ (run bd init there first)`;
|
|
1231
|
+
case "destination-not-directory":
|
|
1232
|
+
return `formula destination is not a directory: ${paths}`;
|
|
1233
|
+
case "source-symlink":
|
|
1234
|
+
case "source-missing":
|
|
1235
|
+
return `shipped formula missing or unsafe: ${paths}`;
|
|
1236
|
+
case "source-unreadable":
|
|
1237
|
+
return `shipped formula unreadable (${failure.code}): ${paths}`;
|
|
1238
|
+
case "destination-symlink":
|
|
1239
|
+
case "destination-not-file":
|
|
1240
|
+
case "destinations-unsafe":
|
|
1241
|
+
return `refusing non-file formula destination: ${paths}`;
|
|
1242
|
+
case "divergent":
|
|
1243
|
+
return `refusing to overwrite divergent formulas (pass force=true to replace them): ${paths}`;
|
|
1244
|
+
case "destination-unreadable":
|
|
1245
|
+
return `cannot read formula destination (${failure.code}): ${paths}`;
|
|
1246
|
+
case "destination-unwritable":
|
|
1247
|
+
return `cannot write formula destination (${failure.code}): ${paths}${failure.copied.length > 0 ? `; already copied: ${failure.copied.join(", ")}` : ""}`;
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
function errorCode(error) {
|
|
1251
|
+
return error instanceof Error && "code" in error && typeof error.code === "string" ? error.code : "UNKNOWN";
|
|
1252
|
+
}
|
|
1253
|
+
function probe(path) {
|
|
1254
|
+
try {
|
|
1255
|
+
return { stat: lstatSync2(path, { throwIfNoEntry: false }) };
|
|
1256
|
+
} catch (error) {
|
|
1257
|
+
return { code: errorCode(error) };
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
function isNonDirectory(path) {
|
|
1261
|
+
try {
|
|
1262
|
+
return !statSync2(path).isDirectory();
|
|
1263
|
+
} catch {
|
|
1264
|
+
return false;
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
function installFormulas(options) {
|
|
1268
|
+
const { workspace, cwd, sourceDir, force = false, requireWorkspace = true, sourcePreflight = [], refusals = "unsafe-first" } = options;
|
|
1269
|
+
const repo = isAbsolute2(workspace) ? workspace : resolve3(cwd, workspace);
|
|
1270
|
+
const beads = join4(repo, ".beads");
|
|
1271
|
+
const destination = join4(beads, "formulas");
|
|
1272
|
+
const fail = (failure) => ({
|
|
1273
|
+
ok: false,
|
|
1274
|
+
text: describeFormulaFailure(failure),
|
|
1275
|
+
copied: failure.kind === "destination-unwritable" ? failure.copied : [],
|
|
1276
|
+
unchanged: [],
|
|
1277
|
+
destination,
|
|
1278
|
+
failure
|
|
1279
|
+
});
|
|
1280
|
+
const beadsProbe = probe(beads);
|
|
1281
|
+
const rootIsFile = "code" in beadsProbe && beadsProbe.code === "ENOTDIR" && isNonDirectory(repo);
|
|
1282
|
+
if ("code" in beadsProbe && !rootIsFile)
|
|
1283
|
+
return fail({ kind: "destination-unreadable", paths: [beads], code: beadsProbe.code });
|
|
1284
|
+
const beadsStat = "stat" in beadsProbe ? beadsProbe.stat : undefined;
|
|
1285
|
+
if (beadsStat?.isSymbolicLink())
|
|
1286
|
+
return fail({ kind: "symlinked-directory", paths: [beads] });
|
|
1287
|
+
const formulasProbe = beadsStat?.isDirectory() ? probe(destination) : { stat: undefined };
|
|
1288
|
+
if ("code" in formulasProbe)
|
|
1289
|
+
return fail({ kind: "destination-unreadable", paths: [destination], code: formulasProbe.code });
|
|
1290
|
+
const destStat = formulasProbe.stat;
|
|
1291
|
+
if (destStat?.isSymbolicLink())
|
|
1292
|
+
return fail({ kind: "symlinked-directory", paths: [destination] });
|
|
1293
|
+
if (requireWorkspace && !beadsStat?.isDirectory())
|
|
1294
|
+
return fail({ kind: "no-workspace", paths: [repo] });
|
|
1295
|
+
if (rootIsFile)
|
|
1296
|
+
return fail({ kind: "destination-not-directory", paths: [destination] });
|
|
1297
|
+
if (beadsStat && !beadsStat.isDirectory())
|
|
1298
|
+
return fail({ kind: "destination-not-directory", paths: [destination] });
|
|
1299
|
+
if (destStat && !destStat.isDirectory() && refusals !== "first")
|
|
1300
|
+
return fail({ kind: "destination-not-directory", paths: [destination] });
|
|
1301
|
+
const sourceOf = (name) => join4(sourceDir, `${name}.formula.toml`);
|
|
1302
|
+
const sourceRefusal = (name) => {
|
|
1303
|
+
const src = sourceOf(name);
|
|
1304
|
+
const found = probe(src);
|
|
1305
|
+
if ("code" in found)
|
|
1306
|
+
return { kind: "source-unreadable", paths: [src], code: found.code };
|
|
1307
|
+
if (!found.stat)
|
|
1308
|
+
return { kind: "source-missing", paths: [src] };
|
|
1309
|
+
if (found.stat.isSymbolicLink())
|
|
1310
|
+
return { kind: "source-symlink", paths: [src] };
|
|
1311
|
+
return found.stat.isFile() ? undefined : { kind: "source-missing", paths: [src] };
|
|
1312
|
+
};
|
|
1313
|
+
for (const name of sourcePreflight) {
|
|
1314
|
+
const refusal = sourceRefusal(name);
|
|
1315
|
+
if (refusal)
|
|
1316
|
+
return fail(refusal);
|
|
1317
|
+
}
|
|
1318
|
+
let names;
|
|
1319
|
+
try {
|
|
1320
|
+
names = typeof options.names === "function" ? options.names() : options.names;
|
|
1321
|
+
} catch (error) {
|
|
1322
|
+
return fail({ kind: "source-unreadable", paths: [sourceDir], code: errorCode(error) });
|
|
1323
|
+
}
|
|
1324
|
+
const copies = [];
|
|
1325
|
+
const unchanged = [];
|
|
1326
|
+
const divergent = [];
|
|
1327
|
+
const unsafe = [];
|
|
1328
|
+
for (const name of names) {
|
|
1329
|
+
const src = sourceOf(name);
|
|
1330
|
+
const dest = join4(destination, `${name}.formula.toml`);
|
|
1331
|
+
if (refusals === "first") {
|
|
1332
|
+
const sourceProbe = probe(src);
|
|
1333
|
+
if ("code" in sourceProbe)
|
|
1334
|
+
return fail({ kind: "source-unreadable", paths: [src], code: sourceProbe.code });
|
|
1335
|
+
if (sourceProbe.stat?.isSymbolicLink())
|
|
1336
|
+
return fail({ kind: "source-symlink", paths: [src] });
|
|
1337
|
+
const destProbe = probe(dest);
|
|
1338
|
+
if ("code" in destProbe)
|
|
1339
|
+
return fail({ kind: "destination-unreadable", paths: [dest], code: destProbe.code });
|
|
1340
|
+
if (destProbe.stat?.isSymbolicLink())
|
|
1341
|
+
return fail({ kind: "destination-symlink", paths: [dest] });
|
|
1342
|
+
}
|
|
1343
|
+
const refusal = sourceRefusal(name);
|
|
1344
|
+
if (refusal)
|
|
1345
|
+
return fail(refusal);
|
|
1346
|
+
const found = probe(dest);
|
|
1347
|
+
if ("code" in found)
|
|
1348
|
+
return fail({ kind: "destination-unreadable", paths: [dest], code: found.code });
|
|
1349
|
+
const st = found.stat;
|
|
1350
|
+
const reason = st?.isSymbolicLink() ? "destination-symlink" : st && !st.isFile() ? "destination-not-file" : undefined;
|
|
1351
|
+
if (reason !== undefined) {
|
|
1352
|
+
if (refusals !== "collect")
|
|
1353
|
+
return fail({ kind: reason, paths: [dest] });
|
|
1354
|
+
unsafe.push({ reason, path: dest });
|
|
1355
|
+
continue;
|
|
1356
|
+
}
|
|
1357
|
+
if (st) {
|
|
1358
|
+
let shipped;
|
|
1359
|
+
try {
|
|
1360
|
+
shipped = readFileSync3(src);
|
|
1361
|
+
} catch (error) {
|
|
1362
|
+
return fail({ kind: "source-unreadable", paths: [src], code: errorCode(error) });
|
|
1363
|
+
}
|
|
1364
|
+
let installed;
|
|
1365
|
+
try {
|
|
1366
|
+
installed = readFileSync3(dest);
|
|
1367
|
+
} catch (error) {
|
|
1368
|
+
return fail({ kind: "destination-unreadable", paths: [dest], code: errorCode(error) });
|
|
1369
|
+
}
|
|
1370
|
+
if (shipped.equals(installed)) {
|
|
1371
|
+
unchanged.push(name);
|
|
1372
|
+
continue;
|
|
1373
|
+
}
|
|
1374
|
+
if (refusals === "first" && !force)
|
|
1375
|
+
return fail({ kind: "divergent", paths: [dest] });
|
|
1376
|
+
divergent.push(dest);
|
|
1377
|
+
}
|
|
1378
|
+
copies.push({ src, dest, name });
|
|
1379
|
+
}
|
|
1380
|
+
if (unsafe.length > 0)
|
|
1381
|
+
return fail({ kind: "destinations-unsafe", paths: unsafe.map(({ path }) => path), reasons: unsafe.map(({ reason }) => reason) });
|
|
1382
|
+
if (divergent.length > 0 && !force)
|
|
1383
|
+
return fail({ kind: "divergent", paths: divergent });
|
|
1384
|
+
for (const { src } of copies) {
|
|
1385
|
+
try {
|
|
1386
|
+
accessSync(src, constants2.R_OK);
|
|
1387
|
+
} catch (error) {
|
|
1388
|
+
return fail({ kind: "source-unreadable", paths: [src], code: errorCode(error) });
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
const copied = [];
|
|
1392
|
+
let writing = destination;
|
|
1393
|
+
try {
|
|
1394
|
+
mkdirSync2(destination, { recursive: true });
|
|
1395
|
+
for (const { src, dest, name } of copies) {
|
|
1396
|
+
writing = dest;
|
|
1397
|
+
copyFileSync(src, dest);
|
|
1398
|
+
copied.push(name);
|
|
1399
|
+
}
|
|
1400
|
+
} catch (error) {
|
|
1401
|
+
return fail({ kind: "destination-unwritable", paths: [writing], code: errorCode(error), copied });
|
|
1402
|
+
}
|
|
1403
|
+
const text = copied.length > 0 ? `copied ${copied.join(", ")} into ${destination}` : `every formula already in ${destination}`;
|
|
1404
|
+
return { ok: true, text, copied, unchanged, destination };
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
// plugins/speckit-beads/opencode/src/setup.ts
|
|
1220
1408
|
var PHASE_TIMEOUT_MS = 60000;
|
|
1221
1409
|
var STOPPED = "stopped by the tool call; rerun to resume, finished phases are skipped";
|
|
1222
1410
|
var isStopped = (signal) => signal?.aborted === true;
|
|
@@ -1290,7 +1478,7 @@ var testPluginRoot = null;
|
|
|
1290
1478
|
function pluginRoot() {
|
|
1291
1479
|
if (testPluginRoot)
|
|
1292
1480
|
return testPluginRoot;
|
|
1293
|
-
return
|
|
1481
|
+
return join5(dirname3(fileURLToPath(import.meta.url)), "..");
|
|
1294
1482
|
}
|
|
1295
1483
|
function parseSpecifyMajorMinor(versionOut) {
|
|
1296
1484
|
const m = versionOut.match(/(\d+)\.(\d+)/);
|
|
@@ -1305,9 +1493,9 @@ function specifyVersionOk(versionOut) {
|
|
|
1305
1493
|
return v.major > 0 || v.major === 0 && v.minor >= 12;
|
|
1306
1494
|
}
|
|
1307
1495
|
function ensureGitignore(repo) {
|
|
1308
|
-
safePath(
|
|
1309
|
-
const gi =
|
|
1310
|
-
const existing = existsSync3(gi) ?
|
|
1496
|
+
safePath(join5(repo, ".gitignore"), repo);
|
|
1497
|
+
const gi = join5(repo, ".gitignore");
|
|
1498
|
+
const existing = existsSync3(gi) ? readFileSync4(gi, "utf8") : "";
|
|
1311
1499
|
if (existing.split(`
|
|
1312
1500
|
`).some((l) => l.trim() === GITIGNORE_ENTRY)) {
|
|
1313
1501
|
return "gitignore already has spec-status.md";
|
|
@@ -1324,54 +1512,60 @@ function ensureGitignore(repo) {
|
|
|
1324
1512
|
return "appended specs/**/spec-status.md to .gitignore";
|
|
1325
1513
|
}
|
|
1326
1514
|
function safePath(path, base) {
|
|
1327
|
-
const root =
|
|
1328
|
-
const rel = relative2(root,
|
|
1329
|
-
if (rel.startsWith("..") ||
|
|
1515
|
+
const root = resolve4(base);
|
|
1516
|
+
const rel = relative2(root, resolve4(path));
|
|
1517
|
+
if (rel.startsWith("..") || isAbsolute3(rel))
|
|
1330
1518
|
throw new Error(`path escapes ${root}: ${path}`);
|
|
1331
1519
|
let current = root;
|
|
1332
1520
|
for (const part of rel.split(sep === "\\" ? /[\\/]/ : "/").filter(Boolean)) {
|
|
1333
|
-
current =
|
|
1334
|
-
const st =
|
|
1521
|
+
current = join5(current, part);
|
|
1522
|
+
const st = lstatSync3(current, { throwIfNoEntry: false });
|
|
1335
1523
|
if (st?.isSymbolicLink())
|
|
1336
1524
|
throw new Error(`unsafe symlink: ${current}`);
|
|
1337
1525
|
}
|
|
1338
1526
|
}
|
|
1339
|
-
function
|
|
1340
|
-
const
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1527
|
+
function installRefusal(failure) {
|
|
1528
|
+
const paths = failure.paths.join(", ");
|
|
1529
|
+
switch (failure.kind) {
|
|
1530
|
+
case "symlinked-directory":
|
|
1531
|
+
case "source-symlink":
|
|
1532
|
+
case "destination-symlink":
|
|
1533
|
+
return `unsafe symlink: ${paths}`;
|
|
1534
|
+
case "source-missing":
|
|
1535
|
+
return `required formula missing or unsafe: ${paths}`;
|
|
1536
|
+
case "source-unreadable":
|
|
1537
|
+
return `required formula missing or unsafe: ${paths} (${failure.code})`;
|
|
1538
|
+
case "destination-not-directory":
|
|
1539
|
+
return `formula destination is not a directory: ${paths}`;
|
|
1540
|
+
case "destination-unreadable":
|
|
1541
|
+
return `cannot read formula destination (${failure.code}): ${paths}`;
|
|
1542
|
+
case "destination-unwritable":
|
|
1543
|
+
return `cannot write formula destination (${failure.code}): ${paths}${failure.copied.length > 0 ? `; already copied: ${failure.copied.join(", ")}` : ""}`;
|
|
1544
|
+
case "no-workspace":
|
|
1545
|
+
case "destination-not-file":
|
|
1546
|
+
case "destinations-unsafe":
|
|
1547
|
+
case "divergent":
|
|
1548
|
+
return `refusing divergent formula destination: ${paths}`;
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
function installFormulas2(repo, srcDir) {
|
|
1552
|
+
const result = installFormulas({ workspace: repo, cwd: process.cwd(), names: FORMULAS, sourceDir: srcDir, requireWorkspace: false, refusals: "first" });
|
|
1553
|
+
if (result.failure !== undefined)
|
|
1554
|
+
throw new Error(installRefusal(result.failure));
|
|
1555
|
+
return result.copied.map((name) => `copied ${name}`);
|
|
1362
1556
|
}
|
|
1363
1557
|
function storyFormulaNote(repo) {
|
|
1364
|
-
if (
|
|
1558
|
+
if (lstatSync3(join5(repo, ".beads", "formulas", "beads-feature.formula.toml"), { throwIfNoEntry: false })?.isFile())
|
|
1365
1559
|
return;
|
|
1366
1560
|
return "beads-feature is not installed; run the beads plugin's beads_formulas tool to split user stories into features";
|
|
1367
1561
|
}
|
|
1368
1562
|
function installedExtensions(repo) {
|
|
1369
|
-
const registry =
|
|
1563
|
+
const registry = join5(repo, ".specify", "extensions", ".registry");
|
|
1370
1564
|
safePath(registry, repo);
|
|
1371
1565
|
if (!existsSync3(registry))
|
|
1372
1566
|
return new Set;
|
|
1373
1567
|
try {
|
|
1374
|
-
const data = JSON.parse(
|
|
1568
|
+
const data = JSON.parse(readFileSync4(registry, "utf8"));
|
|
1375
1569
|
const extensions = data !== null && typeof data === "object" && "extensions" in data ? data.extensions : undefined;
|
|
1376
1570
|
if (extensions === null || typeof extensions !== "object" || Array.isArray(extensions))
|
|
1377
1571
|
return new Set;
|
|
@@ -1381,11 +1575,11 @@ function installedExtensions(repo) {
|
|
|
1381
1575
|
}
|
|
1382
1576
|
}
|
|
1383
1577
|
function communityCatalogState(repo) {
|
|
1384
|
-
const config =
|
|
1578
|
+
const config = join5(repo, ".specify", "extension-catalogs.yml");
|
|
1385
1579
|
safePath(config, repo);
|
|
1386
1580
|
if (!existsSync3(config))
|
|
1387
1581
|
return "absent";
|
|
1388
|
-
const parsed = Bun.YAML.parse(
|
|
1582
|
+
const parsed = Bun.YAML.parse(readFileSync4(config, "utf8"));
|
|
1389
1583
|
const catalogs = parsed !== null && typeof parsed === "object" && "catalogs" in parsed && Array.isArray(parsed.catalogs) ? parsed.catalogs : [];
|
|
1390
1584
|
let conflict = false;
|
|
1391
1585
|
for (const entry of catalogs) {
|
|
@@ -1406,7 +1600,7 @@ function output(result) {
|
|
|
1406
1600
|
`) || `exit ${result.exitCode}`;
|
|
1407
1601
|
}
|
|
1408
1602
|
async function runSetup(params, cwd, signal) {
|
|
1409
|
-
const repo =
|
|
1603
|
+
const repo = resolve4(cwd, params.workspace ?? ".");
|
|
1410
1604
|
const phases = [];
|
|
1411
1605
|
const record = (phase, status, detail) => phases.push({ phase, status, detail });
|
|
1412
1606
|
const finish = () => ({
|
|
@@ -1424,9 +1618,9 @@ async function runSetup(params, cwd, signal) {
|
|
|
1424
1618
|
return finish();
|
|
1425
1619
|
};
|
|
1426
1620
|
try {
|
|
1427
|
-
safePath(
|
|
1428
|
-
safePath(
|
|
1429
|
-
safePath(
|
|
1621
|
+
safePath(join5(repo, ".specify"), repo);
|
|
1622
|
+
safePath(join5(repo, ".beads"), repo);
|
|
1623
|
+
safePath(join5(repo, ".gitignore"), repo);
|
|
1430
1624
|
if (params.skipSpecify)
|
|
1431
1625
|
record("specify", "skipped", "skipSpecify: specify CLI steps omitted");
|
|
1432
1626
|
else {
|
|
@@ -1441,7 +1635,7 @@ ${ver.stderr}`))
|
|
|
1441
1635
|
return fail(`specify-cli >= 0.12.0 required. Got: ${ver.stdout || ver.stderr}`);
|
|
1442
1636
|
record(current, "done", ver.stdout.trim());
|
|
1443
1637
|
current = "specify init";
|
|
1444
|
-
if (existsSync3(
|
|
1638
|
+
if (existsSync3(join5(repo, ".specify")) && !params.force)
|
|
1445
1639
|
record(current, "skipped", ".specify already present (pass force=true to re-scaffold)");
|
|
1446
1640
|
else {
|
|
1447
1641
|
const init = await run([
|
|
@@ -1511,7 +1705,7 @@ ${ver.stderr}`))
|
|
|
1511
1705
|
record(current, "done", "bd init --skip-hooks");
|
|
1512
1706
|
}
|
|
1513
1707
|
current = "formulas";
|
|
1514
|
-
const copied =
|
|
1708
|
+
const copied = installFormulas2(repo, join5(pluginRoot(), "formulas"));
|
|
1515
1709
|
const story = storyFormulaNote(repo);
|
|
1516
1710
|
const formulas = copied.length ? copied.join(", ") : "every formula already present";
|
|
1517
1711
|
record(current, copied.length ? "done" : "skipped", story ? `${formulas}; ${story}` : formulas);
|
|
@@ -1542,9 +1736,9 @@ function defineMode(spec) {
|
|
|
1542
1736
|
|
|
1543
1737
|
// plugins/speckit-beads/opencode/src/workflow.ts
|
|
1544
1738
|
import { existsSync as existsSync4 } from "fs";
|
|
1545
|
-
import { isAbsolute as
|
|
1739
|
+
import { isAbsolute as isAbsolute4, join as join6, relative as relative3, sep as sep2 } from "path";
|
|
1546
1740
|
function usesSpeckit(directory) {
|
|
1547
|
-
return existsSync4(
|
|
1741
|
+
return existsSync4(join6(directory, ".specify"));
|
|
1548
1742
|
}
|
|
1549
1743
|
function speckitWorkspace(directory, projectRoot, detect = usesSpeckit) {
|
|
1550
1744
|
if (detect(directory))
|
|
@@ -1552,7 +1746,7 @@ function speckitWorkspace(directory, projectRoot, detect = usesSpeckit) {
|
|
|
1552
1746
|
if (projectRoot === undefined || projectRoot === directory)
|
|
1553
1747
|
return;
|
|
1554
1748
|
const path = relative3(projectRoot, directory);
|
|
1555
|
-
const inside = path !== "" && path !== ".." && !path.startsWith(`..${sep2}`) && !
|
|
1749
|
+
const inside = path !== "" && path !== ".." && !path.startsWith(`..${sep2}`) && !isAbsolute4(path);
|
|
1556
1750
|
return inside && detect(projectRoot) ? projectRoot : undefined;
|
|
1557
1751
|
}
|
|
1558
1752
|
|
|
@@ -1692,7 +1886,7 @@ ${refusal}
|
|
|
1692
1886
|
}
|
|
1693
1887
|
|
|
1694
1888
|
// plugins/speckit-beads/opencode/src/tasks-guard.ts
|
|
1695
|
-
import { dirname as dirname4, isAbsolute as
|
|
1889
|
+
import { dirname as dirname4, isAbsolute as isAbsolute5, resolve as resolve5 } from "path";
|
|
1696
1890
|
|
|
1697
1891
|
// lib/src/tool-targets.ts
|
|
1698
1892
|
var WRITE_TOOLS = new Set(["edit", "write", "patch"]);
|
|
@@ -1859,7 +2053,7 @@ function repoOf(path) {
|
|
|
1859
2053
|
}
|
|
1860
2054
|
function tasksTargets(tool, input, directory) {
|
|
1861
2055
|
if (WRITE_TOOLS.has(tool)) {
|
|
1862
|
-
const hits = writeTargets(tool, input).filter(isTasksMd).map((path) =>
|
|
2056
|
+
const hits = writeTargets(tool, input).filter(isTasksMd).map((path) => isAbsolute5(path) ? path : resolve5(directory, path));
|
|
1863
2057
|
return hits.length > 0 ? [...new Set(hits.map(repoOf))] : undefined;
|
|
1864
2058
|
}
|
|
1865
2059
|
if (!isShellTool(tool))
|
|
@@ -1884,7 +2078,7 @@ async function decideToolCall(tool, input, directory, probe, reason = DENY_REASO
|
|
|
1884
2078
|
}
|
|
1885
2079
|
|
|
1886
2080
|
// plugins/speckit-beads/opencode/src/tools.ts
|
|
1887
|
-
import { isAbsolute as
|
|
2081
|
+
import { isAbsolute as isAbsolute9, resolve as resolve9 } from "path";
|
|
1888
2082
|
|
|
1889
2083
|
// plugins/speckit-beads/opencode/src/spec-start.ts
|
|
1890
2084
|
var APPROVAL_QUESTION = "Require routine human approval checkpoints for this spec/run? Yes or no.";
|
|
@@ -2235,7 +2429,7 @@ async function startSpec(input, command) {
|
|
|
2235
2429
|
import { spawn } from "child_process";
|
|
2236
2430
|
import { randomUUID } from "crypto";
|
|
2237
2431
|
import { realpathSync as realpathSync4 } from "fs";
|
|
2238
|
-
import { join as
|
|
2432
|
+
import { join as join9 } from "path";
|
|
2239
2433
|
|
|
2240
2434
|
// lib/src/bd-embedded-write-lock.ts
|
|
2241
2435
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
@@ -2243,14 +2437,13 @@ import {
|
|
|
2243
2437
|
closeSync as closeSync3,
|
|
2244
2438
|
existsSync as existsSync5,
|
|
2245
2439
|
openSync as openSync3,
|
|
2246
|
-
readFileSync as
|
|
2247
|
-
|
|
2248
|
-
statSync as statSync3,
|
|
2440
|
+
readFileSync as readFileSync5,
|
|
2441
|
+
statSync as statSync5,
|
|
2249
2442
|
unlinkSync,
|
|
2250
2443
|
writeSync
|
|
2251
2444
|
} from "fs";
|
|
2252
2445
|
import { hostname } from "os";
|
|
2253
|
-
import { basename as basename4, dirname as dirname6, isAbsolute as
|
|
2446
|
+
import { basename as basename4, dirname as dirname6, isAbsolute as isAbsolute8, join as join8, resolve as resolve8 } from "path";
|
|
2254
2447
|
|
|
2255
2448
|
// lib/src/backoff.ts
|
|
2256
2449
|
var POLL_MS = 20;
|
|
@@ -2303,10 +2496,70 @@ function flagEnabled(tokens, names) {
|
|
|
2303
2496
|
}
|
|
2304
2497
|
var TRUTHY = { "": true, "1": true, t: true, T: true, TRUE: true, true: true, True: true };
|
|
2305
2498
|
|
|
2499
|
+
// lib/src/beads-ledger.ts
|
|
2500
|
+
import { realpathSync as realpathSync2, statSync as statSync3 } from "fs";
|
|
2501
|
+
import { isAbsolute as isAbsolute6, join as join7, resolve as resolve6 } from "path";
|
|
2502
|
+
|
|
2503
|
+
// lib/src/bounded-read.ts
|
|
2504
|
+
import { closeSync as closeSync2, constants as constants3, fstatSync as fstatSync2, lstatSync as lstatSync4, openSync as openSync2, readSync } from "fs";
|
|
2505
|
+
var MAX_LEDGER_FILE_BYTES = 64 * 1024;
|
|
2506
|
+
function readBoundedBytes(path, maxBytes) {
|
|
2507
|
+
let fd;
|
|
2508
|
+
try {
|
|
2509
|
+
if (!lstatSync4(path).isFile())
|
|
2510
|
+
return { kind: "unreadable", reason: "not-regular" };
|
|
2511
|
+
fd = openSync2(path, constants3.O_RDONLY | constants3.O_NOFOLLOW | constants3.O_NONBLOCK);
|
|
2512
|
+
const info = fstatSync2(fd);
|
|
2513
|
+
if (!info.isFile())
|
|
2514
|
+
return { kind: "unreadable", reason: "not-regular" };
|
|
2515
|
+
if (info.size > maxBytes)
|
|
2516
|
+
return { kind: "unreadable", reason: "too-large" };
|
|
2517
|
+
const buffer = Buffer.alloc(info.size);
|
|
2518
|
+
let offset = 0;
|
|
2519
|
+
while (offset < buffer.length) {
|
|
2520
|
+
const read = readSync(fd, buffer, offset, buffer.length - offset, offset);
|
|
2521
|
+
if (read === 0)
|
|
2522
|
+
break;
|
|
2523
|
+
offset += read;
|
|
2524
|
+
}
|
|
2525
|
+
return { kind: "bytes", bytes: offset === buffer.length ? buffer : buffer.subarray(0, offset) };
|
|
2526
|
+
} catch (error) {
|
|
2527
|
+
const code = error.code;
|
|
2528
|
+
if (code === "ENOENT")
|
|
2529
|
+
return { kind: "absent" };
|
|
2530
|
+
return code === "ELOOP" ? { kind: "unreadable", reason: "not-regular" } : { kind: "unreadable", reason: "io", code };
|
|
2531
|
+
} finally {
|
|
2532
|
+
if (fd !== undefined)
|
|
2533
|
+
closeSync2(fd);
|
|
2534
|
+
}
|
|
2535
|
+
}
|
|
2536
|
+
function readBounded(path, maxBytes = MAX_LEDGER_FILE_BYTES) {
|
|
2537
|
+
const read = readBoundedBytes(path, maxBytes);
|
|
2538
|
+
if (read.kind === "absent")
|
|
2539
|
+
return { kind: "absent" };
|
|
2540
|
+
return read.kind === "bytes" ? { kind: "text", text: read.bytes.toString("utf8") } : { kind: "unreadable" };
|
|
2541
|
+
}
|
|
2542
|
+
|
|
2543
|
+
// lib/src/beads-ledger.ts
|
|
2544
|
+
function isDirectory2(path) {
|
|
2545
|
+
try {
|
|
2546
|
+
return statSync3(path).isDirectory();
|
|
2547
|
+
} catch {
|
|
2548
|
+
return false;
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
function canonicalPath(path) {
|
|
2552
|
+
try {
|
|
2553
|
+
return realpathSync2(path);
|
|
2554
|
+
} catch {
|
|
2555
|
+
return resolve6(path);
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
|
|
2306
2559
|
// lib/src/beads-store.ts
|
|
2307
2560
|
import { spawnSync } from "child_process";
|
|
2308
|
-
import { lstatSync as
|
|
2309
|
-
import { basename as basename3, dirname as dirname5, isAbsolute as
|
|
2561
|
+
import { lstatSync as lstatSync5, realpathSync as realpathSync3, statSync as statSync4 } from "fs";
|
|
2562
|
+
import { basename as basename3, dirname as dirname5, isAbsolute as isAbsolute7, resolve as resolve7 } from "path";
|
|
2310
2563
|
function repoIdentity(cwd) {
|
|
2311
2564
|
if (cwd.includes("\x00"))
|
|
2312
2565
|
return;
|
|
@@ -2325,7 +2578,7 @@ function repoIdentity(cwd) {
|
|
|
2325
2578
|
}
|
|
2326
2579
|
const out = String(result.stdout ?? "").trim();
|
|
2327
2580
|
try {
|
|
2328
|
-
return
|
|
2581
|
+
return realpathSync3(isAbsolute7(out) ? out : resolve7(cwd, out));
|
|
2329
2582
|
} catch {
|
|
2330
2583
|
return;
|
|
2331
2584
|
}
|
|
@@ -2333,13 +2586,13 @@ function repoIdentity(cwd) {
|
|
|
2333
2586
|
function repositoryState(cwd) {
|
|
2334
2587
|
let current;
|
|
2335
2588
|
try {
|
|
2336
|
-
current =
|
|
2589
|
+
current = realpathSync3(cwd);
|
|
2337
2590
|
} catch {
|
|
2338
2591
|
return "unknown";
|
|
2339
2592
|
}
|
|
2340
2593
|
for (;; ) {
|
|
2341
2594
|
try {
|
|
2342
|
-
|
|
2595
|
+
lstatSync5(resolve7(current, ".git"));
|
|
2343
2596
|
return "present";
|
|
2344
2597
|
} catch (error) {
|
|
2345
2598
|
if (!(error instanceof Error) || !("code" in error) || error.code !== "ENOENT")
|
|
@@ -2352,89 +2605,42 @@ function repositoryState(cwd) {
|
|
|
2352
2605
|
}
|
|
2353
2606
|
}
|
|
2354
2607
|
function sessionPinCandidates(cwd) {
|
|
2355
|
-
const local =
|
|
2608
|
+
const local = resolve7(cwd, ".beads");
|
|
2356
2609
|
const common = repoIdentity(cwd);
|
|
2357
2610
|
if (common === undefined)
|
|
2358
2611
|
return [];
|
|
2359
2612
|
if (common !== cwd && common.endsWith("/.git")) {
|
|
2360
|
-
const primaryRoot =
|
|
2613
|
+
const primaryRoot = resolve7(common, "..");
|
|
2361
2614
|
try {
|
|
2362
|
-
if (
|
|
2615
|
+
if (realpathSync3(cwd) === primaryRoot)
|
|
2363
2616
|
return [local];
|
|
2364
2617
|
} catch {
|
|
2365
2618
|
return [];
|
|
2366
2619
|
}
|
|
2367
|
-
return [
|
|
2620
|
+
return [resolve7(primaryRoot, ".beads"), local];
|
|
2368
2621
|
}
|
|
2369
2622
|
return [local];
|
|
2370
2623
|
}
|
|
2371
2624
|
function existingStore(candidates) {
|
|
2372
|
-
return candidates.find(
|
|
2625
|
+
return candidates.find(isDirectory2);
|
|
2373
2626
|
}
|
|
2374
2627
|
function sessionPinFor(cwd) {
|
|
2375
2628
|
return existingStore(sessionPinCandidates(cwd));
|
|
2376
2629
|
}
|
|
2377
2630
|
function storeFromBeadsDb(value, cwd) {
|
|
2378
|
-
const path =
|
|
2631
|
+
const path = resolve7(cwd, value);
|
|
2379
2632
|
return basename3(path) === ".beads" ? path : dirname5(path);
|
|
2380
2633
|
}
|
|
2381
2634
|
function ambientStore(cwd, env, walkUp = sessionPinFor) {
|
|
2382
2635
|
const dir = env.BEADS_DIR;
|
|
2383
2636
|
if (dir !== undefined && dir !== "")
|
|
2384
|
-
return
|
|
2637
|
+
return resolve7(cwd, dir);
|
|
2385
2638
|
const found = walkUp(cwd);
|
|
2386
2639
|
if (found !== undefined)
|
|
2387
2640
|
return found;
|
|
2388
2641
|
const db = env.BEADS_DB;
|
|
2389
2642
|
return db !== undefined && db !== "" ? storeFromBeadsDb(db, cwd) : undefined;
|
|
2390
2643
|
}
|
|
2391
|
-
function isDir(path) {
|
|
2392
|
-
try {
|
|
2393
|
-
return statSync2(path).isDirectory();
|
|
2394
|
-
} catch {
|
|
2395
|
-
return false;
|
|
2396
|
-
}
|
|
2397
|
-
}
|
|
2398
|
-
|
|
2399
|
-
// lib/src/bounded-read.ts
|
|
2400
|
-
import { closeSync as closeSync2, constants as constants2, fstatSync as fstatSync2, lstatSync as lstatSync4, openSync as openSync2, readSync } from "fs";
|
|
2401
|
-
var MAX_LEDGER_FILE_BYTES = 64 * 1024;
|
|
2402
|
-
function readBoundedBytes(path, maxBytes) {
|
|
2403
|
-
let fd;
|
|
2404
|
-
try {
|
|
2405
|
-
if (!lstatSync4(path).isFile())
|
|
2406
|
-
return { kind: "unreadable", reason: "not-regular" };
|
|
2407
|
-
fd = openSync2(path, constants2.O_RDONLY | constants2.O_NOFOLLOW | constants2.O_NONBLOCK);
|
|
2408
|
-
const info = fstatSync2(fd);
|
|
2409
|
-
if (!info.isFile())
|
|
2410
|
-
return { kind: "unreadable", reason: "not-regular" };
|
|
2411
|
-
if (info.size > maxBytes)
|
|
2412
|
-
return { kind: "unreadable", reason: "too-large" };
|
|
2413
|
-
const buffer = Buffer.alloc(info.size);
|
|
2414
|
-
let offset = 0;
|
|
2415
|
-
while (offset < buffer.length) {
|
|
2416
|
-
const read = readSync(fd, buffer, offset, buffer.length - offset, offset);
|
|
2417
|
-
if (read === 0)
|
|
2418
|
-
break;
|
|
2419
|
-
offset += read;
|
|
2420
|
-
}
|
|
2421
|
-
return { kind: "bytes", bytes: offset === buffer.length ? buffer : buffer.subarray(0, offset) };
|
|
2422
|
-
} catch (error) {
|
|
2423
|
-
const code = error.code;
|
|
2424
|
-
if (code === "ENOENT")
|
|
2425
|
-
return { kind: "absent" };
|
|
2426
|
-
return code === "ELOOP" ? { kind: "unreadable", reason: "not-regular" } : { kind: "unreadable", reason: "io", code };
|
|
2427
|
-
} finally {
|
|
2428
|
-
if (fd !== undefined)
|
|
2429
|
-
closeSync2(fd);
|
|
2430
|
-
}
|
|
2431
|
-
}
|
|
2432
|
-
function readBounded(path, maxBytes = MAX_LEDGER_FILE_BYTES) {
|
|
2433
|
-
const read = readBoundedBytes(path, maxBytes);
|
|
2434
|
-
if (read.kind === "absent")
|
|
2435
|
-
return { kind: "absent" };
|
|
2436
|
-
return read.kind === "bytes" ? { kind: "text", text: read.bytes.toString("utf8") } : { kind: "unreadable" };
|
|
2437
|
-
}
|
|
2438
2644
|
|
|
2439
2645
|
// lib/src/bd-embedded-write-lock.ts
|
|
2440
2646
|
var LOCK_NAME = "omp-embedded-write.lock";
|
|
@@ -2469,7 +2675,7 @@ function processStartIdentity(pid) {
|
|
|
2469
2675
|
return identityForTests(pid);
|
|
2470
2676
|
try {
|
|
2471
2677
|
if (process.platform === "linux") {
|
|
2472
|
-
const stat =
|
|
2678
|
+
const stat = readFileSync5(`/proc/${pid}/stat`, "utf8");
|
|
2473
2679
|
const identity = parseLinuxStatStartIdentity(stat);
|
|
2474
2680
|
if (identity !== undefined)
|
|
2475
2681
|
return identity;
|
|
@@ -2527,39 +2733,25 @@ function selectedStoreFor(globals, cwd, env) {
|
|
|
2527
2733
|
const target = absolute(db, base);
|
|
2528
2734
|
if (!existsSync5(target))
|
|
2529
2735
|
return;
|
|
2530
|
-
return isDirectory2(target) ? target :
|
|
2736
|
+
return isDirectory2(target) ? target : join8(target, "..");
|
|
2531
2737
|
}
|
|
2532
2738
|
if (directory !== undefined)
|
|
2533
2739
|
return sessionPinFor(base);
|
|
2534
2740
|
return ambientStore(cwd, env);
|
|
2535
2741
|
}
|
|
2536
2742
|
function absolute(path, cwd) {
|
|
2537
|
-
return
|
|
2538
|
-
}
|
|
2539
|
-
function isDirectory2(path) {
|
|
2540
|
-
try {
|
|
2541
|
-
return statSync3(path).isDirectory();
|
|
2542
|
-
} catch {
|
|
2543
|
-
return false;
|
|
2544
|
-
}
|
|
2545
|
-
}
|
|
2546
|
-
function canonical(path) {
|
|
2547
|
-
try {
|
|
2548
|
-
return realpathSync3(path);
|
|
2549
|
-
} catch {
|
|
2550
|
-
return resolve6(path);
|
|
2551
|
-
}
|
|
2743
|
+
return isAbsolute8(path) ? path : resolve8(cwd, path);
|
|
2552
2744
|
}
|
|
2553
2745
|
function canonicalStore(store) {
|
|
2554
|
-
return store === undefined ? undefined :
|
|
2746
|
+
return store === undefined ? undefined : canonicalPath(store);
|
|
2555
2747
|
}
|
|
2556
2748
|
function embedded(store) {
|
|
2557
2749
|
for (const file of ["metadata.json", "config.yaml"]) {
|
|
2558
|
-
const read = readBounded(
|
|
2750
|
+
const read = readBounded(join8(store, file));
|
|
2559
2751
|
if (read.kind === "unreadable" || read.kind === "text" && read.text !== "")
|
|
2560
2752
|
return true;
|
|
2561
2753
|
}
|
|
2562
|
-
return isDirectory2(
|
|
2754
|
+
return isDirectory2(join8(store, "embeddeddolt"));
|
|
2563
2755
|
}
|
|
2564
2756
|
function embeddedStoreFor(cwd, env = process.env) {
|
|
2565
2757
|
const store = storeFor([], cwd, env);
|
|
@@ -2609,7 +2801,7 @@ var MIGRATE_SKIPS_STORE_INIT = new Set([
|
|
|
2609
2801
|
var LIST_PREFIXES = new Set(["then", "else", "do"]);
|
|
2610
2802
|
function ageOf(path) {
|
|
2611
2803
|
try {
|
|
2612
|
-
return Date.now() -
|
|
2804
|
+
return Date.now() - statSync5(path).mtimeMs;
|
|
2613
2805
|
} catch {
|
|
2614
2806
|
return 0;
|
|
2615
2807
|
}
|
|
@@ -2728,7 +2920,7 @@ function wakeHead(lock) {
|
|
|
2728
2920
|
registry().queues.get(lock)?.[0]?.wake?.();
|
|
2729
2921
|
}
|
|
2730
2922
|
async function hold(store, owner, waitMs = WAIT_MS, signal) {
|
|
2731
|
-
const lock =
|
|
2923
|
+
const lock = join8(store, LOCK_NAME);
|
|
2732
2924
|
const { owned, queues } = registry();
|
|
2733
2925
|
const deadline = Date.now() + waitMs;
|
|
2734
2926
|
let attempt = 0;
|
|
@@ -2774,7 +2966,7 @@ async function hold(store, owner, waitMs = WAIT_MS, signal) {
|
|
|
2774
2966
|
reason: `Beads embedded write lock could not be taken at ${lock} (${code ?? "unknown error"}). The write was refused rather than risk a second writer on the embedded Dolt journal.`
|
|
2775
2967
|
};
|
|
2776
2968
|
}
|
|
2777
|
-
const steal =
|
|
2969
|
+
const steal = join8(store, STEAL_NAME);
|
|
2778
2970
|
const unsafe = unsafeRecord(lock) ? lock : unsafeRecord(steal) ? steal : undefined;
|
|
2779
2971
|
if (unsafe !== undefined) {
|
|
2780
2972
|
return {
|
|
@@ -2819,7 +3011,7 @@ async function hold(store, owner, waitMs = WAIT_MS, signal) {
|
|
|
2819
3011
|
}
|
|
2820
3012
|
}
|
|
2821
3013
|
function withOwnership(storeLock, token, change) {
|
|
2822
|
-
const steal =
|
|
3014
|
+
const steal = join8(dirname6(storeLock), STEAL_NAME);
|
|
2823
3015
|
let fd;
|
|
2824
3016
|
try {
|
|
2825
3017
|
fd = openSync3(steal, "wx");
|
|
@@ -2841,7 +3033,7 @@ function withOwnership(storeLock, token, change) {
|
|
|
2841
3033
|
}
|
|
2842
3034
|
}
|
|
2843
3035
|
function release(store, owner) {
|
|
2844
|
-
const lock =
|
|
3036
|
+
const lock = join8(store, LOCK_NAME);
|
|
2845
3037
|
const owned = registry().owned;
|
|
2846
3038
|
const held = owned.get(lock);
|
|
2847
3039
|
if (held === undefined)
|
|
@@ -2935,7 +3127,7 @@ async function runSpecStart(options, signal, commandMs = COMMAND_MS, module = BE
|
|
|
2935
3127
|
const cwd = realpathSync4(options.workspace);
|
|
2936
3128
|
const env = {
|
|
2937
3129
|
...process.env,
|
|
2938
|
-
BEADS_DIR: realpathSync4(
|
|
3130
|
+
BEADS_DIR: realpathSync4(join9(cwd, ".beads")),
|
|
2939
3131
|
GIT_TERMINAL_PROMPT: "0",
|
|
2940
3132
|
SSH_ASKPASS: "/usr/bin/false",
|
|
2941
3133
|
SSH_ASKPASS_REQUIRE: "force",
|
|
@@ -3104,14 +3296,14 @@ var START_INPUT = {
|
|
|
3104
3296
|
};
|
|
3105
3297
|
var START_DESCRIPTION = `Start or resume a spec workflow, with an explicit routine approval choice from the user before pouring.
|
|
3106
3298
|
` + "Persists and reads back the answer, reuses it on resume, and requires separate consent to migrate an existing gated run. Nests a new run under the spec's feature epic and titles it <spec> (<profile>); moving an existing unparented run needs the user's yes to REPARENT_REQUIRED. Refuses an epic that blocks on a step of the run, and warns when the epic's open blocks edges would hide the run from bd ready. Holds the Beads store's write lock for the whole start. Returns CHOICE_REQUIRED, MIGRATION_REQUIRED or REPARENT_REQUIRED with a question to ask the user, READY when the run can advance, or INCOMPLETE (store-lock wait ran out, a bd command passed its bound, or cancellation) with the step reached and whether a pour was issued; inspect the run before retrying. Reviews, tests and safety confirmations remain required.";
|
|
3107
|
-
var within = (base, path) => path === undefined ? base :
|
|
3299
|
+
var within = (base, path) => path === undefined ? base : isAbsolute9(path) ? path : resolve9(base, path);
|
|
3108
3300
|
var record = (input) => input !== null && typeof input === "object" && !Array.isArray(input) ? input : {};
|
|
3109
3301
|
function toolDirectory(input, session, speckitWorkspace) {
|
|
3110
3302
|
return record(input).workspace === undefined ? speckitWorkspace(session) ?? session : session;
|
|
3111
3303
|
}
|
|
3112
3304
|
function setupTarget(input, directory) {
|
|
3113
3305
|
const workspace = record(input).workspace;
|
|
3114
|
-
return typeof workspace === "string" && workspace !== "" ?
|
|
3306
|
+
return typeof workspace === "string" && workspace !== "" ? resolve9(directory, workspace) : directory;
|
|
3115
3307
|
}
|
|
3116
3308
|
var SETUP_KEYS = new Set(Object.keys(setupInput("").properties));
|
|
3117
3309
|
function readSetupParams(input) {
|
|
@@ -3214,7 +3406,7 @@ async function executeStart(input, directory, signal, lock = BEADS_LOCK) {
|
|
|
3214
3406
|
|
|
3215
3407
|
// plugins/speckit-beads/pi-src/ready-watch.ts
|
|
3216
3408
|
import { execFile } from "child_process";
|
|
3217
|
-
import { resolve as
|
|
3409
|
+
import { resolve as resolve10 } from "path";
|
|
3218
3410
|
import { promisify } from "util";
|
|
3219
3411
|
|
|
3220
3412
|
// lib/src/beads-pin.ts
|
|
@@ -3296,7 +3488,7 @@ async function watchLedger(cwd, env = process.env) {
|
|
|
3296
3488
|
const store = pinnedEnvironment(cwd, env).BEADS_DIR;
|
|
3297
3489
|
if (store === undefined || store === "")
|
|
3298
3490
|
throw new Error("No Beads ledger resolves for this checkout");
|
|
3299
|
-
return
|
|
3491
|
+
return resolve10(cwd, store);
|
|
3300
3492
|
}
|
|
3301
3493
|
function watchEnv(ledger, base = process.env) {
|
|
3302
3494
|
const env = {
|
|
@@ -3401,7 +3593,7 @@ function createReadyWatch(scope, options) {
|
|
|
3401
3593
|
|
|
3402
3594
|
// plugins/speckit-beads/pi-src/routes.ts
|
|
3403
3595
|
import { homedir as homedir2 } from "os";
|
|
3404
|
-
import { isAbsolute as
|
|
3596
|
+
import { isAbsolute as isAbsolute10, resolve as resolve11 } from "path";
|
|
3405
3597
|
var WORKFLOW_SECTION = "speckit_workflow";
|
|
3406
3598
|
var MESSAGE_TYPE = "speckit-beads";
|
|
3407
3599
|
function guardReason(settingsPath) {
|
|
@@ -3433,7 +3625,7 @@ User input: ${command.args}` };
|
|
|
3433
3625
|
function toolPath(path, cwd) {
|
|
3434
3626
|
const plain = path.startsWith("@") ? path.slice(1) : path;
|
|
3435
3627
|
const expanded = plain === "~" ? homedir2() : plain.startsWith("~/") ? `${homedir2()}${plain.slice(1)}` : plain;
|
|
3436
|
-
return
|
|
3628
|
+
return isAbsolute10(expanded) ? expanded : resolve11(cwd, expanded);
|
|
3437
3629
|
}
|
|
3438
3630
|
function readCommand(path) {
|
|
3439
3631
|
const normal = path.replaceAll("\\", "/");
|
|
@@ -3469,7 +3661,7 @@ function notify(ctx, message) {
|
|
|
3469
3661
|
`);
|
|
3470
3662
|
}
|
|
3471
3663
|
function setupSpeckitPi(pi, deps = {}) {
|
|
3472
|
-
const settingsPath = deps.settingsPath ??
|
|
3664
|
+
const settingsPath = deps.settingsPath ?? join10(getAgentDir(), PI_SETTINGS_FILE);
|
|
3473
3665
|
const loaded = loadPiPluginSettings(settingsPath, "speckit-beads", "the defaults apply");
|
|
3474
3666
|
const options = parseOptions(loaded.options, PI_INTEGRATION);
|
|
3475
3667
|
const probe = deps.probe ?? ((directory) => beadsActive(directory));
|
package/package.json
CHANGED