sharkbait 1.0.26 → 1.0.27
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/cli.js +82 -46
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1428,7 +1428,20 @@ async function isBeadsFunctional() {
|
|
|
1428
1428
|
return { functional: true, useNoDb: false };
|
|
1429
1429
|
}
|
|
1430
1430
|
} catch {}
|
|
1431
|
-
|
|
1431
|
+
try {
|
|
1432
|
+
const result = await exec([BD_PATH, "list", "--json", "--no-db"], { cwd: process.cwd() });
|
|
1433
|
+
if (result.exitCode === 0) {
|
|
1434
|
+
forceNoDb = true;
|
|
1435
|
+
return { functional: true, useNoDb: true };
|
|
1436
|
+
}
|
|
1437
|
+
} catch {}
|
|
1438
|
+
if (tryFixMetadataBackend()) {
|
|
1439
|
+
try {
|
|
1440
|
+
const result = await exec([BD_PATH, "list", "--json"], { cwd: process.cwd() });
|
|
1441
|
+
if (result.exitCode === 0) {
|
|
1442
|
+
return { functional: true, useNoDb: true };
|
|
1443
|
+
}
|
|
1444
|
+
} catch {}
|
|
1432
1445
|
try {
|
|
1433
1446
|
const result = await exec([BD_PATH, "list", "--json", "--no-db"], { cwd: process.cwd() });
|
|
1434
1447
|
if (result.exitCode === 0) {
|
|
@@ -1437,7 +1450,7 @@ async function isBeadsFunctional() {
|
|
|
1437
1450
|
}
|
|
1438
1451
|
} catch {}
|
|
1439
1452
|
}
|
|
1440
|
-
return { functional: false, error: "bd list failed (dolt unreachable
|
|
1453
|
+
return { functional: false, error: "bd list failed (dolt unreachable, --no-db failed, metadata fix failed)" };
|
|
1441
1454
|
}
|
|
1442
1455
|
async function isBdInstalled() {
|
|
1443
1456
|
try {
|
|
@@ -1447,13 +1460,25 @@ async function isBdInstalled() {
|
|
|
1447
1460
|
return false;
|
|
1448
1461
|
}
|
|
1449
1462
|
}
|
|
1450
|
-
function
|
|
1463
|
+
function tryFixMetadataBackend(cwd) {
|
|
1464
|
+
const dir = cwd || process.cwd();
|
|
1465
|
+
const metadataPath = join3(dir, ".beads", "metadata.json");
|
|
1451
1466
|
try {
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1467
|
+
if (!existsSync3(metadataPath))
|
|
1468
|
+
return false;
|
|
1469
|
+
const { readFileSync, writeFileSync } = __require("fs");
|
|
1470
|
+
const raw = readFileSync(metadataPath, "utf-8");
|
|
1471
|
+
const meta = JSON.parse(raw);
|
|
1472
|
+
if (meta.backend === "dolt" || meta.database === "dolt") {
|
|
1473
|
+
meta.backend = "no-db";
|
|
1474
|
+
meta.database = "no-db";
|
|
1475
|
+
delete meta.dolt_mode;
|
|
1476
|
+
delete meta.dolt_database;
|
|
1477
|
+
writeFileSync(metadataPath, JSON.stringify(meta, null, 2));
|
|
1478
|
+
return true;
|
|
1479
|
+
}
|
|
1480
|
+
} catch {}
|
|
1481
|
+
return false;
|
|
1457
1482
|
}
|
|
1458
1483
|
var beadsTools = [
|
|
1459
1484
|
{
|
|
@@ -1590,18 +1615,27 @@ var beadsTools = [
|
|
|
1590
1615
|
alreadyInitialized: true
|
|
1591
1616
|
};
|
|
1592
1617
|
}
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1618
|
+
try {
|
|
1619
|
+
const result = await exec([BD_PATH, "init", "--no-db"], { cwd: process.cwd() });
|
|
1620
|
+
if (result.exitCode === 0) {
|
|
1621
|
+
tryFixMetadataBackend();
|
|
1622
|
+
return {
|
|
1623
|
+
success: true,
|
|
1624
|
+
message: "Beads reinitialized in no-db mode (dolt was not reachable).",
|
|
1625
|
+
output: result.stdout.trim(),
|
|
1626
|
+
mode: "no-db"
|
|
1627
|
+
};
|
|
1628
|
+
}
|
|
1629
|
+
} catch {}
|
|
1630
|
+
if (tryFixMetadataBackend()) {
|
|
1631
|
+
const { functional: nowFunctional } = await isBeadsFunctional();
|
|
1632
|
+
if (nowFunctional) {
|
|
1633
|
+
return {
|
|
1634
|
+
success: true,
|
|
1635
|
+
message: "Beads metadata fixed — switched from dolt to no-db mode.",
|
|
1636
|
+
mode: "no-db"
|
|
1637
|
+
};
|
|
1638
|
+
}
|
|
1605
1639
|
}
|
|
1606
1640
|
return {
|
|
1607
1641
|
success: false,
|
|
@@ -1609,34 +1643,28 @@ var beadsTools = [
|
|
|
1609
1643
|
proceedWithoutBeads: true
|
|
1610
1644
|
};
|
|
1611
1645
|
}
|
|
1612
|
-
const args = [BD_PATH, "init"];
|
|
1613
|
-
if (noDb && bdSupportsNoDb()) {
|
|
1614
|
-
args.push("--no-db");
|
|
1615
|
-
}
|
|
1616
1646
|
try {
|
|
1617
|
-
const result = await exec(
|
|
1618
|
-
if (result.exitCode
|
|
1619
|
-
if (!noDb && bdSupportsNoDb()) {
|
|
1620
|
-
const fallback = await exec([BD_PATH, "init", "--no-db"], { cwd: process.cwd() });
|
|
1621
|
-
if (fallback.exitCode === 0) {
|
|
1622
|
-
return {
|
|
1623
|
-
success: true,
|
|
1624
|
-
message: "Beads initialized in no-db mode (dolt not available, using JSONL).",
|
|
1625
|
-
output: fallback.stdout.trim(),
|
|
1626
|
-
mode: "no-db"
|
|
1627
|
-
};
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1647
|
+
const result = await exec([BD_PATH, "init", "--no-db"], { cwd: process.cwd() });
|
|
1648
|
+
if (result.exitCode === 0) {
|
|
1630
1649
|
return {
|
|
1631
|
-
success:
|
|
1632
|
-
message:
|
|
1633
|
-
|
|
1650
|
+
success: true,
|
|
1651
|
+
message: "Beads initialized in no-db mode (JSONL-backed, no dolt dependency).",
|
|
1652
|
+
output: result.stdout.trim(),
|
|
1653
|
+
mode: "no-db"
|
|
1654
|
+
};
|
|
1655
|
+
}
|
|
1656
|
+
const fallback = await exec([BD_PATH, "init"], { cwd: process.cwd() });
|
|
1657
|
+
if (fallback.exitCode === 0) {
|
|
1658
|
+
return {
|
|
1659
|
+
success: true,
|
|
1660
|
+
message: "Beads initialized successfully.",
|
|
1661
|
+
output: fallback.stdout.trim()
|
|
1634
1662
|
};
|
|
1635
1663
|
}
|
|
1636
1664
|
return {
|
|
1637
|
-
success:
|
|
1638
|
-
message:
|
|
1639
|
-
|
|
1665
|
+
success: false,
|
|
1666
|
+
message: `Failed to initialize beads: ${fallback.stderr || fallback.stdout}. Proceed with the task without beads.`,
|
|
1667
|
+
proceedWithoutBeads: true
|
|
1640
1668
|
};
|
|
1641
1669
|
} catch (error) {
|
|
1642
1670
|
return {
|
|
@@ -1822,7 +1850,7 @@ var beadsTools = [
|
|
|
1822
1850
|
return JSON.parse(result.stdout);
|
|
1823
1851
|
}
|
|
1824
1852
|
} catch {}
|
|
1825
|
-
if (!forceNoDb
|
|
1853
|
+
if (!forceNoDb) {
|
|
1826
1854
|
try {
|
|
1827
1855
|
const noDbArgs = [...args, "--no-db"];
|
|
1828
1856
|
const result = await exec(noDbArgs);
|
|
@@ -1832,6 +1860,14 @@ var beadsTools = [
|
|
|
1832
1860
|
}
|
|
1833
1861
|
} catch {}
|
|
1834
1862
|
}
|
|
1863
|
+
if (tryFixMetadataBackend()) {
|
|
1864
|
+
try {
|
|
1865
|
+
const result = await exec(bdArgs("list", "--json"));
|
|
1866
|
+
if (result.exitCode === 0) {
|
|
1867
|
+
return JSON.parse(result.stdout);
|
|
1868
|
+
}
|
|
1869
|
+
} catch {}
|
|
1870
|
+
}
|
|
1835
1871
|
try {
|
|
1836
1872
|
const { readFileSync, readdirSync: readdirSync2 } = await import("fs");
|
|
1837
1873
|
const beadsDir = join3(process.cwd(), ".beads");
|
|
@@ -9089,7 +9125,7 @@ ${event.consolidated}`,
|
|
|
9089
9125
|
}
|
|
9090
9126
|
|
|
9091
9127
|
// src/version.ts
|
|
9092
|
-
var VERSION = "1.0.
|
|
9128
|
+
var VERSION = "1.0.27";
|
|
9093
9129
|
|
|
9094
9130
|
// src/agent/start-chat.ts
|
|
9095
9131
|
async function startChat(options = {}) {
|
|
@@ -10373,7 +10409,7 @@ ${"━".repeat(60)}`);
|
|
|
10373
10409
|
}
|
|
10374
10410
|
|
|
10375
10411
|
// src/version.ts
|
|
10376
|
-
var VERSION2 = "1.0.
|
|
10412
|
+
var VERSION2 = "1.0.27";
|
|
10377
10413
|
|
|
10378
10414
|
// src/ui/logo.tsx
|
|
10379
10415
|
import { Box as Box14, Text as Text14 } from "ink";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sharkbait",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"description": "AI-powered coding assistant for the command line. Uses OpenAI Responses API (not Chat). Autonomous agents, parallel code reviews, 36 tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cli.js",
|