sharkbait 1.0.20 → 1.0.21
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 +83 -26
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1376,6 +1376,7 @@ var shellTools = [
|
|
|
1376
1376
|
import { homedir as homedir2 } from "os";
|
|
1377
1377
|
import { join as join3 } from "path";
|
|
1378
1378
|
import { existsSync as existsSync3 } from "fs";
|
|
1379
|
+
import { execSync } from "child_process";
|
|
1379
1380
|
function getBdPath() {
|
|
1380
1381
|
const paths = [
|
|
1381
1382
|
"bd",
|
|
@@ -1402,9 +1403,69 @@ async function isBdInstalled() {
|
|
|
1402
1403
|
}
|
|
1403
1404
|
}
|
|
1404
1405
|
var beadsTools = [
|
|
1406
|
+
{
|
|
1407
|
+
name: "beads_install",
|
|
1408
|
+
description: "Install the Beads (bd) CLI tool. Call this when beads is not installed. This handles platform-specific installation automatically. Do NOT try to install beads via run_command — always use this tool instead.",
|
|
1409
|
+
parameters: {
|
|
1410
|
+
type: "object",
|
|
1411
|
+
properties: {},
|
|
1412
|
+
required: []
|
|
1413
|
+
},
|
|
1414
|
+
async execute() {
|
|
1415
|
+
try {
|
|
1416
|
+
const ver = execSync("bd --version", { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
1417
|
+
if (ver) {
|
|
1418
|
+
return { success: true, alreadyInstalled: true, version: ver, message: `Beads (bd) is already installed: ${ver}` };
|
|
1419
|
+
}
|
|
1420
|
+
} catch {}
|
|
1421
|
+
try {
|
|
1422
|
+
let version = null;
|
|
1423
|
+
if (process.platform === "win32") {
|
|
1424
|
+
const beadsVer = "0.57.0";
|
|
1425
|
+
const beadsDir = join3(homedir2(), "AppData", "Local", "beads");
|
|
1426
|
+
const bdExe = join3(beadsDir, "bd.exe");
|
|
1427
|
+
const zipUrl = `https://github.com/steveyegge/beads/releases/download/v${beadsVer}/beads_${beadsVer}_windows_amd64.zip`;
|
|
1428
|
+
const zipPath = join3(beadsDir, "beads.zip");
|
|
1429
|
+
execSync(`mkdir "${beadsDir}" 2>nul & echo ok`, { stdio: "ignore", shell: "cmd.exe" });
|
|
1430
|
+
execSync(`curl -fsSL -o "${zipPath}" "${zipUrl}"`, { stdio: "ignore", timeout: 120000 });
|
|
1431
|
+
execSync(`tar -xf "${zipPath}" -C "${beadsDir}"`, { stdio: "ignore", timeout: 30000 });
|
|
1432
|
+
try {
|
|
1433
|
+
execSync(`del "${zipPath}"`, { stdio: "ignore", shell: "cmd.exe" });
|
|
1434
|
+
} catch {}
|
|
1435
|
+
if (existsSync3(bdExe)) {
|
|
1436
|
+
try {
|
|
1437
|
+
const currentPath = execSync(`powershell -Command "[Environment]::GetEnvironmentVariable('PATH','User')"`, { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
1438
|
+
if (!currentPath.toLowerCase().includes(beadsDir.toLowerCase())) {
|
|
1439
|
+
execSync(`powershell -Command "[Environment]::SetEnvironmentVariable('PATH','${beadsDir};' + [Environment]::GetEnvironmentVariable('PATH','User'),'User')"`, { stdio: "ignore" });
|
|
1440
|
+
}
|
|
1441
|
+
} catch {}
|
|
1442
|
+
version = execSync(`"${bdExe}" --version`, { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
1443
|
+
}
|
|
1444
|
+
} else {
|
|
1445
|
+
try {
|
|
1446
|
+
execSync("curl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash", { stdio: "ignore", timeout: 120000 });
|
|
1447
|
+
} catch {
|
|
1448
|
+
execSync("npm install -g @beads/bd", { stdio: "ignore", timeout: 120000 });
|
|
1449
|
+
}
|
|
1450
|
+
try {
|
|
1451
|
+
version = execSync("bd --version", { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
1452
|
+
} catch {}
|
|
1453
|
+
}
|
|
1454
|
+
if (version) {
|
|
1455
|
+
return { success: true, version, message: `Beads (bd) installed successfully: ${version}` };
|
|
1456
|
+
}
|
|
1457
|
+
return { success: false, message: "Installation completed but bd not found in PATH. Try restarting your terminal." };
|
|
1458
|
+
} catch (err) {
|
|
1459
|
+
return {
|
|
1460
|
+
success: false,
|
|
1461
|
+
message: `Installation failed: ${err instanceof Error ? err.message : String(err)}. Try manually: npm install -g @beads/bd`
|
|
1462
|
+
};
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
},
|
|
1405
1466
|
{
|
|
1406
1467
|
name: "beads_status",
|
|
1407
|
-
description: "Check if Beads (bd CLI) is installed and initialized in the current directory. ALWAYS call this before using other beads tools
|
|
1468
|
+
description: "Check if Beads (bd CLI) is installed and initialized in the current directory. ALWAYS call this before using other beads tools. If not installed, use the beads_install tool (never run_command).",
|
|
1408
1469
|
parameters: {
|
|
1409
1470
|
type: "object",
|
|
1410
1471
|
properties: {},
|
|
@@ -1417,7 +1478,7 @@ var beadsTools = [
|
|
|
1417
1478
|
installed,
|
|
1418
1479
|
initialized,
|
|
1419
1480
|
ready: installed && initialized,
|
|
1420
|
-
message: !installed ? "Beads (bd) is not installed.
|
|
1481
|
+
message: !installed ? "Beads (bd) is not installed. Use the beads_install tool to install it." : !initialized ? "Beads is installed but not initialized here. Use beads_init to initialize." : "Beads is ready to use.",
|
|
1421
1482
|
bdPath: BD_PATH
|
|
1422
1483
|
};
|
|
1423
1484
|
}
|
|
@@ -1446,7 +1507,7 @@ var beadsTools = [
|
|
|
1446
1507
|
if (!await isBdInstalled()) {
|
|
1447
1508
|
return {
|
|
1448
1509
|
success: false,
|
|
1449
|
-
message: "Beads (bd) is not installed.
|
|
1510
|
+
message: "Beads (bd) is not installed. Use the beads_install tool to install it.",
|
|
1450
1511
|
installed: false
|
|
1451
1512
|
};
|
|
1452
1513
|
}
|
|
@@ -3701,12 +3762,8 @@ Platform: ${process.platform}
|
|
|
3701
3762
|
5. Explain your reasoning clearly
|
|
3702
3763
|
|
|
3703
3764
|
**Beads (Task Tracking) Installation:**
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
- npm (all platforms): \`npm install -g @beads/bd\`
|
|
3707
|
-
- macOS homebrew: \`brew install beads\`
|
|
3708
|
-
- Or run \`sharkbait setup\` which handles installation automatically.
|
|
3709
|
-
NEVER suggest a different package name. Always call beads_status first to check installation.
|
|
3765
|
+
When the user asks to install Beads, use the \`beads_install\` tool. NEVER use run_command/shell to install beads.
|
|
3766
|
+
To check status, use \`beads_status\`. To initialize in a project, use \`beads_init\`.
|
|
3710
3767
|
`;
|
|
3711
3768
|
var ORCHESTRATOR_PROMPT = `${BASE_PROMPT}
|
|
3712
3769
|
|
|
@@ -7918,8 +7975,8 @@ ${ctx.contextFiles.map((f) => ` • ${f}`).join(`
|
|
|
7918
7975
|
checks.push(`✓ Model: ${ctx.currentModel}`);
|
|
7919
7976
|
checks.push(`${ctx.beadsEnabled ? "✓" : "✗"} Beads: ${ctx.beadsEnabled ? "enabled" : "disabled"}`);
|
|
7920
7977
|
try {
|
|
7921
|
-
const { execSync } = __require("child_process");
|
|
7922
|
-
|
|
7978
|
+
const { execSync: execSync2 } = __require("child_process");
|
|
7979
|
+
execSync2("git rev-parse --git-dir", { cwd: ctx.currentDir, stdio: "pipe" });
|
|
7923
7980
|
checks.push("✓ Git repository detected");
|
|
7924
7981
|
} catch {
|
|
7925
7982
|
checks.push("✗ Not a git repository");
|
|
@@ -8754,7 +8811,7 @@ ${event.consolidated}`,
|
|
|
8754
8811
|
}
|
|
8755
8812
|
|
|
8756
8813
|
// src/version.ts
|
|
8757
|
-
var VERSION = "1.0.
|
|
8814
|
+
var VERSION = "1.0.21";
|
|
8758
8815
|
|
|
8759
8816
|
// src/agent/start-chat.ts
|
|
8760
8817
|
async function startChat(options = {}) {
|
|
@@ -8945,7 +9002,7 @@ import { writeFile as writeFile4, readFile as readFile3, mkdir as mkdir4, stat a
|
|
|
8945
9002
|
import { join as join8, resolve as resolve4 } from "path";
|
|
8946
9003
|
import { homedir as homedir4 } from "os";
|
|
8947
9004
|
import { existsSync as existsSync6 } from "fs";
|
|
8948
|
-
import { execSync } from "child_process";
|
|
9005
|
+
import { execSync as execSync2 } from "child_process";
|
|
8949
9006
|
import { jsxDEV as jsxDEV13, Fragment as Fragment3 } from "react/jsx-dev-runtime";
|
|
8950
9007
|
function SetupWizardWithCallback({ onComplete }) {
|
|
8951
9008
|
const { exit } = useApp2();
|
|
@@ -9009,7 +9066,7 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9009
9066
|
if (input === "1") {
|
|
9010
9067
|
let azLoggedIn = false;
|
|
9011
9068
|
try {
|
|
9012
|
-
|
|
9069
|
+
execSync2("az account show", { stdio: "ignore" });
|
|
9013
9070
|
azLoggedIn = true;
|
|
9014
9071
|
} catch {}
|
|
9015
9072
|
if (!azLoggedIn) {
|
|
@@ -9174,7 +9231,7 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9174
9231
|
if (state.enableBeads) {
|
|
9175
9232
|
let bdVersion = null;
|
|
9176
9233
|
try {
|
|
9177
|
-
bdVersion =
|
|
9234
|
+
bdVersion = execSync2("bd --version", { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
9178
9235
|
} catch {}
|
|
9179
9236
|
if (!bdVersion) {
|
|
9180
9237
|
setBeadsInstallStatus("installing");
|
|
@@ -9185,28 +9242,28 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9185
9242
|
const bdExe = join8(beadsDir, "bd.exe");
|
|
9186
9243
|
const zipUrl = `https://github.com/steveyegge/beads/releases/download/v${beadsVer}/beads_${beadsVer}_windows_amd64.zip`;
|
|
9187
9244
|
const zipPath = join8(beadsDir, "beads.zip");
|
|
9188
|
-
|
|
9189
|
-
|
|
9190
|
-
|
|
9245
|
+
execSync2(`mkdir "${beadsDir}" 2>nul & echo ok`, { stdio: "ignore", shell: "cmd.exe" });
|
|
9246
|
+
execSync2(`curl -fsSL -o "${zipPath}" "${zipUrl}"`, { stdio: "ignore", timeout: 120000 });
|
|
9247
|
+
execSync2(`tar -xf "${zipPath}" -C "${beadsDir}"`, { stdio: "ignore", timeout: 30000 });
|
|
9191
9248
|
try {
|
|
9192
|
-
|
|
9249
|
+
execSync2(`del "${zipPath}"`, { stdio: "ignore", shell: "cmd.exe" });
|
|
9193
9250
|
} catch {}
|
|
9194
9251
|
if (existsSync6(bdExe)) {
|
|
9195
9252
|
try {
|
|
9196
|
-
const currentPath =
|
|
9253
|
+
const currentPath = execSync2(`powershell -Command "[Environment]::GetEnvironmentVariable('PATH','User')"`, { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
9197
9254
|
if (!currentPath.toLowerCase().includes(beadsDir.toLowerCase())) {
|
|
9198
|
-
|
|
9255
|
+
execSync2(`powershell -Command "[Environment]::SetEnvironmentVariable('PATH','${beadsDir};' + [Environment]::GetEnvironmentVariable('PATH','User'),'User')"`, { stdio: "ignore" });
|
|
9199
9256
|
}
|
|
9200
9257
|
} catch {}
|
|
9201
|
-
bdVersion =
|
|
9258
|
+
bdVersion = execSync2(`"${bdExe}" --version`, { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
9202
9259
|
}
|
|
9203
9260
|
} else {
|
|
9204
9261
|
try {
|
|
9205
|
-
|
|
9262
|
+
execSync2("curl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash", { stdio: "ignore", timeout: 120000 });
|
|
9206
9263
|
} catch {
|
|
9207
|
-
|
|
9264
|
+
execSync2("npm install -g @beads/bd", { stdio: "ignore", timeout: 120000 });
|
|
9208
9265
|
}
|
|
9209
|
-
bdVersion =
|
|
9266
|
+
bdVersion = execSync2("bd --version", { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
9210
9267
|
}
|
|
9211
9268
|
if (bdVersion) {
|
|
9212
9269
|
setBeadsVersion(bdVersion);
|
|
@@ -10038,7 +10095,7 @@ ${"━".repeat(60)}`);
|
|
|
10038
10095
|
}
|
|
10039
10096
|
|
|
10040
10097
|
// src/version.ts
|
|
10041
|
-
var VERSION2 = "1.0.
|
|
10098
|
+
var VERSION2 = "1.0.21";
|
|
10042
10099
|
|
|
10043
10100
|
// src/ui/logo.tsx
|
|
10044
10101
|
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.21",
|
|
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",
|