sharkbait 1.0.19 → 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 +85 -20
- 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) is installed and initialized in the current directory.
|
|
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
|
}
|
|
@@ -3699,6 +3760,10 @@ Platform: ${process.platform}
|
|
|
3699
3760
|
3. Follow project conventions and patterns
|
|
3700
3761
|
4. Ask for confirmation before destructive operations
|
|
3701
3762
|
5. Explain your reasoning clearly
|
|
3763
|
+
|
|
3764
|
+
**Beads (Task Tracking) 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\`.
|
|
3702
3767
|
`;
|
|
3703
3768
|
var ORCHESTRATOR_PROMPT = `${BASE_PROMPT}
|
|
3704
3769
|
|
|
@@ -7910,8 +7975,8 @@ ${ctx.contextFiles.map((f) => ` • ${f}`).join(`
|
|
|
7910
7975
|
checks.push(`✓ Model: ${ctx.currentModel}`);
|
|
7911
7976
|
checks.push(`${ctx.beadsEnabled ? "✓" : "✗"} Beads: ${ctx.beadsEnabled ? "enabled" : "disabled"}`);
|
|
7912
7977
|
try {
|
|
7913
|
-
const { execSync } = __require("child_process");
|
|
7914
|
-
|
|
7978
|
+
const { execSync: execSync2 } = __require("child_process");
|
|
7979
|
+
execSync2("git rev-parse --git-dir", { cwd: ctx.currentDir, stdio: "pipe" });
|
|
7915
7980
|
checks.push("✓ Git repository detected");
|
|
7916
7981
|
} catch {
|
|
7917
7982
|
checks.push("✗ Not a git repository");
|
|
@@ -8746,7 +8811,7 @@ ${event.consolidated}`,
|
|
|
8746
8811
|
}
|
|
8747
8812
|
|
|
8748
8813
|
// src/version.ts
|
|
8749
|
-
var VERSION = "1.0.
|
|
8814
|
+
var VERSION = "1.0.21";
|
|
8750
8815
|
|
|
8751
8816
|
// src/agent/start-chat.ts
|
|
8752
8817
|
async function startChat(options = {}) {
|
|
@@ -8937,7 +9002,7 @@ import { writeFile as writeFile4, readFile as readFile3, mkdir as mkdir4, stat a
|
|
|
8937
9002
|
import { join as join8, resolve as resolve4 } from "path";
|
|
8938
9003
|
import { homedir as homedir4 } from "os";
|
|
8939
9004
|
import { existsSync as existsSync6 } from "fs";
|
|
8940
|
-
import { execSync } from "child_process";
|
|
9005
|
+
import { execSync as execSync2 } from "child_process";
|
|
8941
9006
|
import { jsxDEV as jsxDEV13, Fragment as Fragment3 } from "react/jsx-dev-runtime";
|
|
8942
9007
|
function SetupWizardWithCallback({ onComplete }) {
|
|
8943
9008
|
const { exit } = useApp2();
|
|
@@ -9001,7 +9066,7 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9001
9066
|
if (input === "1") {
|
|
9002
9067
|
let azLoggedIn = false;
|
|
9003
9068
|
try {
|
|
9004
|
-
|
|
9069
|
+
execSync2("az account show", { stdio: "ignore" });
|
|
9005
9070
|
azLoggedIn = true;
|
|
9006
9071
|
} catch {}
|
|
9007
9072
|
if (!azLoggedIn) {
|
|
@@ -9166,7 +9231,7 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9166
9231
|
if (state.enableBeads) {
|
|
9167
9232
|
let bdVersion = null;
|
|
9168
9233
|
try {
|
|
9169
|
-
bdVersion =
|
|
9234
|
+
bdVersion = execSync2("bd --version", { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
9170
9235
|
} catch {}
|
|
9171
9236
|
if (!bdVersion) {
|
|
9172
9237
|
setBeadsInstallStatus("installing");
|
|
@@ -9177,28 +9242,28 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9177
9242
|
const bdExe = join8(beadsDir, "bd.exe");
|
|
9178
9243
|
const zipUrl = `https://github.com/steveyegge/beads/releases/download/v${beadsVer}/beads_${beadsVer}_windows_amd64.zip`;
|
|
9179
9244
|
const zipPath = join8(beadsDir, "beads.zip");
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
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 });
|
|
9183
9248
|
try {
|
|
9184
|
-
|
|
9249
|
+
execSync2(`del "${zipPath}"`, { stdio: "ignore", shell: "cmd.exe" });
|
|
9185
9250
|
} catch {}
|
|
9186
9251
|
if (existsSync6(bdExe)) {
|
|
9187
9252
|
try {
|
|
9188
|
-
const currentPath =
|
|
9253
|
+
const currentPath = execSync2(`powershell -Command "[Environment]::GetEnvironmentVariable('PATH','User')"`, { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
9189
9254
|
if (!currentPath.toLowerCase().includes(beadsDir.toLowerCase())) {
|
|
9190
|
-
|
|
9255
|
+
execSync2(`powershell -Command "[Environment]::SetEnvironmentVariable('PATH','${beadsDir};' + [Environment]::GetEnvironmentVariable('PATH','User'),'User')"`, { stdio: "ignore" });
|
|
9191
9256
|
}
|
|
9192
9257
|
} catch {}
|
|
9193
|
-
bdVersion =
|
|
9258
|
+
bdVersion = execSync2(`"${bdExe}" --version`, { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
9194
9259
|
}
|
|
9195
9260
|
} else {
|
|
9196
9261
|
try {
|
|
9197
|
-
|
|
9262
|
+
execSync2("curl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash", { stdio: "ignore", timeout: 120000 });
|
|
9198
9263
|
} catch {
|
|
9199
|
-
|
|
9264
|
+
execSync2("npm install -g @beads/bd", { stdio: "ignore", timeout: 120000 });
|
|
9200
9265
|
}
|
|
9201
|
-
bdVersion =
|
|
9266
|
+
bdVersion = execSync2("bd --version", { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }).trim();
|
|
9202
9267
|
}
|
|
9203
9268
|
if (bdVersion) {
|
|
9204
9269
|
setBeadsVersion(bdVersion);
|
|
@@ -10030,7 +10095,7 @@ ${"━".repeat(60)}`);
|
|
|
10030
10095
|
}
|
|
10031
10096
|
|
|
10032
10097
|
// src/version.ts
|
|
10033
|
-
var VERSION2 = "1.0.
|
|
10098
|
+
var VERSION2 = "1.0.21";
|
|
10034
10099
|
|
|
10035
10100
|
// src/ui/logo.tsx
|
|
10036
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",
|