@bobsworkshop/cli 0.5.4 → 0.6.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/README.md +145 -20
- package/dist/analyse-auto-3JL5TO3G.js +529 -0
- package/dist/analyse-results-NXVQJCO6.js +8 -0
- package/dist/bin/analyse-auto-3JL5TO3G.js +529 -0
- package/dist/bin/analyse-results-NXVQJCO6.js +8 -0
- package/dist/bin/bob.js +333 -35
- package/dist/bin/chunk-SADPOL7M.js +1061 -0
- package/dist/bob.js +1130 -35
- package/dist/chunk-SADPOL7M.js +1061 -0
- package/package.json +1 -1
package/dist/bin/bob.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildLocalContext,
|
|
3
3
|
callCloudFunction,
|
|
4
|
+
callHTTPFunction,
|
|
4
5
|
callLocalModel,
|
|
5
6
|
extractAllProposedFiles,
|
|
6
7
|
extractProposedFile,
|
|
@@ -15,12 +16,12 @@ import {
|
|
|
15
16
|
registerLoginCommand,
|
|
16
17
|
setConfigValue,
|
|
17
18
|
stripCodeBlockFromResponse
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-SADPOL7M.js";
|
|
19
20
|
|
|
20
21
|
// bin/bob.ts
|
|
21
22
|
import { Command } from "commander";
|
|
22
|
-
import
|
|
23
|
-
import * as
|
|
23
|
+
import chalk25 from "chalk";
|
|
24
|
+
import * as path14 from "path";
|
|
24
25
|
|
|
25
26
|
// src/commands/config.ts
|
|
26
27
|
import chalk from "chalk";
|
|
@@ -291,6 +292,29 @@ async function getTodayMessages(projectName) {
|
|
|
291
292
|
return msg.timestamp >= twentyFourHoursAgo;
|
|
292
293
|
});
|
|
293
294
|
}
|
|
295
|
+
function buildDNAString() {
|
|
296
|
+
const dna = loadCurrentDNA();
|
|
297
|
+
if (!dna) return null;
|
|
298
|
+
const weekly = loadWeeklyProfiles(1)[0] || null;
|
|
299
|
+
const lines = [
|
|
300
|
+
"### USER BEHAVIORAL DNA ###",
|
|
301
|
+
`Archetype: ${dna.archetype || "Unknown"}`,
|
|
302
|
+
`Communication Style: ${dna.communicationStyle || "Unknown"}`,
|
|
303
|
+
`Work Rhythm: ${dna.workRhythm || "Unknown"}`,
|
|
304
|
+
`Decision Making: ${dna.decisionMaking || "Unknown"}`,
|
|
305
|
+
`Emotional State: ${dna.emotionalState || "Unknown"}`
|
|
306
|
+
];
|
|
307
|
+
if (dna.growth) lines.push(`Growth Focus: ${dna.growth}`);
|
|
308
|
+
if (dna.source) lines.push(`Profile Source: ${dna.source} (${dna.lastUpdated || "unknown date"})`);
|
|
309
|
+
if (weekly) {
|
|
310
|
+
lines.push("");
|
|
311
|
+
lines.push("--- WEEKLY TRAJECTORY ---");
|
|
312
|
+
if (weekly.trajectory) lines.push(`Weekly Arc: ${weekly.trajectory}`);
|
|
313
|
+
if (weekly.moodShift) lines.push(`Mood Shift: ${weekly.moodShift}`);
|
|
314
|
+
if (weekly.focusEvolution) lines.push(`Focus Evolution: ${weekly.focusEvolution}`);
|
|
315
|
+
}
|
|
316
|
+
return lines.join("\n");
|
|
317
|
+
}
|
|
294
318
|
|
|
295
319
|
// src/ai/persona.ts
|
|
296
320
|
var STANDARD_STYLE_PROMPT = `You are Bob: friendly, direct, senior-level engineering partner.
|
|
@@ -3102,7 +3126,7 @@ function registerAnalyseCommand(program2) {
|
|
|
3102
3126
|
program2.command("analyse").description("Analyse the current project for bugs, features, improvements, and upgrades").option("--results", "Show analysis dashboard or filtered list").option("--bugs", "Show bugs list (interactive)").option("--features", "Show features list (interactive)").option("--improvements", "Show improvements list (interactive)").option("--upgrades", "Show upgrades list (interactive)").option("--sort <method>", "Sort by: priority (default) or file").option("--search <query>", "Filter results by keyword").option("--status", "Show current analysis job status").option("--auto", "Auto-fix mode: Bob triages and MiniBob implements").option("--confidence <number>", "Confidence gate for auto-fix (default: 90)", "90").option("--priority <level>", "Priority gate for auto-fix: critical, high, medium, low (default: critical)", "critical").action(async (options) => {
|
|
3103
3127
|
const config = getConfig();
|
|
3104
3128
|
if (options.auto) {
|
|
3105
|
-
const { runAutoFix } = await import("./analyse-auto-
|
|
3129
|
+
const { runAutoFix } = await import("./analyse-auto-3JL5TO3G.js");
|
|
3106
3130
|
const category = options.bugs ? "bugs" : options.features ? "features" : options.improvements ? "improvements" : options.upgrades ? "upgrades" : void 0;
|
|
3107
3131
|
await runAutoFix({
|
|
3108
3132
|
category,
|
|
@@ -3112,7 +3136,7 @@ function registerAnalyseCommand(program2) {
|
|
|
3112
3136
|
return;
|
|
3113
3137
|
}
|
|
3114
3138
|
if (options.bugs || options.features || options.improvements || options.upgrades) {
|
|
3115
|
-
const { showInteractiveResults } = await import("./analyse-results-
|
|
3139
|
+
const { showInteractiveResults } = await import("./analyse-results-NXVQJCO6.js");
|
|
3116
3140
|
const category = options.bugs ? "bugs" : options.features ? "features" : options.improvements ? "improvements" : "upgrades";
|
|
3117
3141
|
await showInteractiveResults(config, category, options.sort, options.search);
|
|
3118
3142
|
return;
|
|
@@ -5720,13 +5744,285 @@ function getWeekNumber(date) {
|
|
|
5720
5744
|
return Math.ceil(((d.getTime() - yearStart.getTime()) / 864e5 + 1) / 7);
|
|
5721
5745
|
}
|
|
5722
5746
|
|
|
5747
|
+
// src/commands/userbob.ts
|
|
5748
|
+
import chalk24 from "chalk";
|
|
5749
|
+
import * as readline8 from "readline";
|
|
5750
|
+
import * as fs10 from "fs";
|
|
5751
|
+
import * as path13 from "path";
|
|
5752
|
+
import * as os4 from "os";
|
|
5753
|
+
var PURPLE = chalk24.hex("#AB47BC");
|
|
5754
|
+
var GREEN5 = chalk24.hex("#66BB6A");
|
|
5755
|
+
var AMBER6 = chalk24.hex("#FFAB00");
|
|
5756
|
+
var CYAN5 = chalk24.cyan;
|
|
5757
|
+
var GRAY5 = chalk24.gray;
|
|
5758
|
+
var RED5 = chalk24.hex("#EF5350");
|
|
5759
|
+
var BORDER10 = chalk24.hex("#455A64");
|
|
5760
|
+
var BOB_DIR3 = path13.join(os4.homedir(), ".bob");
|
|
5761
|
+
function getSessionFilePath(projectName) {
|
|
5762
|
+
return path13.join(BOB_DIR3, "projects", projectName, "userbob-session.json");
|
|
5763
|
+
}
|
|
5764
|
+
function writeSessionFile(projectName, data) {
|
|
5765
|
+
const sessionPath = getSessionFilePath(projectName);
|
|
5766
|
+
fs10.mkdirSync(path13.dirname(sessionPath), { recursive: true });
|
|
5767
|
+
fs10.writeFileSync(sessionPath, JSON.stringify(data, null, 2));
|
|
5768
|
+
}
|
|
5769
|
+
function readSessionFile(projectName) {
|
|
5770
|
+
const sessionPath = getSessionFilePath(projectName);
|
|
5771
|
+
if (!fs10.existsSync(sessionPath)) return null;
|
|
5772
|
+
try {
|
|
5773
|
+
return JSON.parse(fs10.readFileSync(sessionPath, "utf-8"));
|
|
5774
|
+
} catch {
|
|
5775
|
+
return null;
|
|
5776
|
+
}
|
|
5777
|
+
}
|
|
5778
|
+
function clearSessionFile(projectName) {
|
|
5779
|
+
const sessionPath = getSessionFilePath(projectName);
|
|
5780
|
+
if (fs10.existsSync(sessionPath)) fs10.unlinkSync(sessionPath);
|
|
5781
|
+
}
|
|
5782
|
+
async function askYesNo(question) {
|
|
5783
|
+
const rl = readline8.createInterface({ input: process.stdin, output: process.stdout });
|
|
5784
|
+
return new Promise((resolve2) => {
|
|
5785
|
+
rl.question(question, (answer) => {
|
|
5786
|
+
rl.close();
|
|
5787
|
+
resolve2(answer.trim().toLowerCase() === "y");
|
|
5788
|
+
});
|
|
5789
|
+
});
|
|
5790
|
+
}
|
|
5791
|
+
function registerUserBobCommand(program2) {
|
|
5792
|
+
program2.command("userbob").description("Launch your UserBob digital twin simulation").option("--local", "Force local Ollama mode (Tier 1)").option("--target <number>", "Satisfaction target (default: 85)", "85").action(async (options) => {
|
|
5793
|
+
const config = getConfig();
|
|
5794
|
+
const projectName = path13.basename(process.cwd());
|
|
5795
|
+
const isTier3 = isAuthenticated() && !options.local;
|
|
5796
|
+
console.log("");
|
|
5797
|
+
console.log(BORDER10(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"));
|
|
5798
|
+
console.log(BORDER10(" \u2551") + PURPLE(" \u{1F916} UserBob \u2014 Digital Twin Simulation"));
|
|
5799
|
+
console.log(BORDER10(" \u2551") + GRAY5(` Mode: ${isTier3 ? "Platform (Tier 3)" : "Local (Tier 1)"}`));
|
|
5800
|
+
console.log(BORDER10(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"));
|
|
5801
|
+
console.log("");
|
|
5802
|
+
const dnaString = buildDNAString();
|
|
5803
|
+
if (!dnaString) {
|
|
5804
|
+
console.log(AMBER6(" \u26A0\uFE0F No behavioral profile found."));
|
|
5805
|
+
console.log(GRAY5(" UserBob performs significantly better with your DNA loaded."));
|
|
5806
|
+
console.log("");
|
|
5807
|
+
const runProfile = await askYesNo(AMBER6(" Run `bob profile --today` now to build your profile? (y/n): "));
|
|
5808
|
+
if (runProfile) {
|
|
5809
|
+
console.log("");
|
|
5810
|
+
console.log(GRAY5(" Run: bob profile --today"));
|
|
5811
|
+
console.log(GRAY5(" Then run `bob userbob` again."));
|
|
5812
|
+
console.log("");
|
|
5813
|
+
process.exit(0);
|
|
5814
|
+
} else {
|
|
5815
|
+
console.log("");
|
|
5816
|
+
console.log(RED5(" \u26A0\uFE0F Running in Generic Mode \u2014 no behavioral profile loaded."));
|
|
5817
|
+
console.log(RED5(" UserBob will respond using project context only."));
|
|
5818
|
+
console.log(RED5(" Responses won't reflect your personal communication style,"));
|
|
5819
|
+
console.log(RED5(" decision patterns, or engineering philosophy."));
|
|
5820
|
+
console.log(GRAY5(" Run `bob profile --today` anytime to unlock full personalization."));
|
|
5821
|
+
console.log("");
|
|
5822
|
+
}
|
|
5823
|
+
} else {
|
|
5824
|
+
console.log(GREEN5(" \u2705 Behavioral DNA loaded."));
|
|
5825
|
+
console.log("");
|
|
5826
|
+
}
|
|
5827
|
+
if (isTier3) {
|
|
5828
|
+
await runTier3Session(config, projectName, parseInt(options.target), dnaString);
|
|
5829
|
+
} else {
|
|
5830
|
+
await runTier1Session(config, projectName, parseInt(options.target), dnaString);
|
|
5831
|
+
}
|
|
5832
|
+
});
|
|
5833
|
+
}
|
|
5834
|
+
async function runTier3Session(config, projectName, target, dnaString) {
|
|
5835
|
+
if (!config.conversationId) {
|
|
5836
|
+
console.log(RED5(" \u274C No active conversation. Run `bob chat` first to start one."));
|
|
5837
|
+
console.log("");
|
|
5838
|
+
return;
|
|
5839
|
+
}
|
|
5840
|
+
console.log(CYAN5(" \u{1F680} Starting simulation on platform..."));
|
|
5841
|
+
console.log(GRAY5(" Type `abort` + Enter or Ctrl+C to stop."));
|
|
5842
|
+
console.log("");
|
|
5843
|
+
try {
|
|
5844
|
+
await callHTTPFunction("userSimManagerService", {
|
|
5845
|
+
action: "resumeMission",
|
|
5846
|
+
conversationId: config.conversationId,
|
|
5847
|
+
uid: config.uid,
|
|
5848
|
+
email: config.email
|
|
5849
|
+
});
|
|
5850
|
+
console.log(GREEN5(" \u2705 Simulation ignited. Watching conversation..."));
|
|
5851
|
+
console.log("");
|
|
5852
|
+
} catch (err) {
|
|
5853
|
+
console.log(RED5(` \u274C Failed to start simulation: ${err.message}`));
|
|
5854
|
+
return;
|
|
5855
|
+
}
|
|
5856
|
+
let running = true;
|
|
5857
|
+
const renderedIds = /* @__PURE__ */ new Set();
|
|
5858
|
+
const rl = readline8.createInterface({ input: process.stdin, output: process.stdout });
|
|
5859
|
+
rl.on("line", async (input) => {
|
|
5860
|
+
if (input.trim().toLowerCase() === "abort") {
|
|
5861
|
+
running = false;
|
|
5862
|
+
rl.close();
|
|
5863
|
+
console.log("");
|
|
5864
|
+
console.log(AMBER6(" \u23F9 Aborting simulation..."));
|
|
5865
|
+
try {
|
|
5866
|
+
await callHTTPFunction("userSimManagerService", {
|
|
5867
|
+
action: "abortMission",
|
|
5868
|
+
conversationId: config.conversationId,
|
|
5869
|
+
uid: config.uid,
|
|
5870
|
+
email: config.email
|
|
5871
|
+
});
|
|
5872
|
+
console.log(GREEN5(" \u2705 Simulation aborted."));
|
|
5873
|
+
} catch (e) {
|
|
5874
|
+
console.log(RED5(` \u274C Abort call failed: ${e.message}`));
|
|
5875
|
+
}
|
|
5876
|
+
console.log("");
|
|
5877
|
+
process.exit(0);
|
|
5878
|
+
}
|
|
5879
|
+
});
|
|
5880
|
+
process.on("SIGINT", async () => {
|
|
5881
|
+
running = false;
|
|
5882
|
+
rl.close();
|
|
5883
|
+
console.log("");
|
|
5884
|
+
console.log(AMBER6(" \u23F9 Aborting simulation..."));
|
|
5885
|
+
try {
|
|
5886
|
+
await callHTTPFunction("userSimManagerService", {
|
|
5887
|
+
action: "abortMission",
|
|
5888
|
+
conversationId: config.conversationId,
|
|
5889
|
+
uid: config.uid,
|
|
5890
|
+
email: config.email
|
|
5891
|
+
});
|
|
5892
|
+
} catch {
|
|
5893
|
+
}
|
|
5894
|
+
process.exit(0);
|
|
5895
|
+
});
|
|
5896
|
+
while (running) {
|
|
5897
|
+
try {
|
|
5898
|
+
const response = await callCloudFunction("getCLITodayMessages", {});
|
|
5899
|
+
const messages = (response?.messages || []).filter((m) => m.conversationId === config.conversationId).sort((a, b) => (a.timestamp || 0) - (b.timestamp || 0));
|
|
5900
|
+
for (const msg of messages) {
|
|
5901
|
+
const msgKey = `${msg.timestamp}-${msg.sender}-${(msg.message || "").slice(0, 30)}`;
|
|
5902
|
+
if (renderedIds.has(msgKey)) continue;
|
|
5903
|
+
renderedIds.add(msgKey);
|
|
5904
|
+
if (msg.sender === "bob") {
|
|
5905
|
+
console.log(GREEN5(` bob > `) + chalk24.white(msg.message));
|
|
5906
|
+
} else if (msg.sender === "userBob") {
|
|
5907
|
+
console.log(PURPLE(` UserBob > `) + chalk24.white(msg.message));
|
|
5908
|
+
} else if (msg.sender === "system") {
|
|
5909
|
+
console.log(CYAN5(` system > `) + GRAY5(msg.message));
|
|
5910
|
+
if (/INACTIVE|STOPPED|SUCCESS|STALEMATE|DIVERGENCE|failed/i.test(msg.message)) {
|
|
5911
|
+
console.log("");
|
|
5912
|
+
console.log(AMBER6(" \u2705 Simulation ended."));
|
|
5913
|
+
running = false;
|
|
5914
|
+
rl.close();
|
|
5915
|
+
break;
|
|
5916
|
+
}
|
|
5917
|
+
}
|
|
5918
|
+
console.log("");
|
|
5919
|
+
}
|
|
5920
|
+
} catch (err) {
|
|
5921
|
+
console.log(GRAY5(` [poll error: ${err.message}]`));
|
|
5922
|
+
}
|
|
5923
|
+
if (running) await sleep6(3e3);
|
|
5924
|
+
}
|
|
5925
|
+
}
|
|
5926
|
+
async function runTier1Session(config, projectName, target, dnaString) {
|
|
5927
|
+
if (!config.localEndpoint) {
|
|
5928
|
+
console.log(RED5(" \u274C No local endpoint configured."));
|
|
5929
|
+
console.log(GRAY5(" Run: bob config set localEndpoint http://127.0.0.1:11434/api/chat"));
|
|
5930
|
+
console.log("");
|
|
5931
|
+
return;
|
|
5932
|
+
}
|
|
5933
|
+
console.log(CYAN5(" \u{1F680} Starting local simulation (Ollama)..."));
|
|
5934
|
+
console.log(GRAY5(" Type `abort` + Enter or Ctrl+C to stop."));
|
|
5935
|
+
console.log("");
|
|
5936
|
+
const constitutionBlock = dnaString ? `YOUR DNA CONSTITUTION:
|
|
5937
|
+
${dnaString}` : "No behavioral profile loaded. Respond using project context and general software engineering knowledge only.";
|
|
5938
|
+
const userBobSystemPrompt = `You are a digital twin of a software engineer. You are NOT an assistant. You ARE the developer.
|
|
5939
|
+
|
|
5940
|
+
${constitutionBlock}
|
|
5941
|
+
|
|
5942
|
+
Your job: respond to Bob's messages exactly as this developer would \u2014 with their personality, communication style, technical depth, and opinions. Ask questions when confused. Push back when you disagree. Express satisfaction when Bob delivers real value.
|
|
5943
|
+
|
|
5944
|
+
At the end of every response, include a JSON block on a new line:
|
|
5945
|
+
{"satisfactionScore": <0-100>, "status": "<CONVERGING|STAGNATING|DIVERGING>"}`;
|
|
5946
|
+
const bobSystemPrompt = `You are Bob, a senior software engineering consultant. You are responding to a developer who is asking for your help. Be concrete, direct, and solution-oriented. Lead with code when appropriate.`;
|
|
5947
|
+
writeSessionFile(projectName, { active: true, turns: 0, startedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
5948
|
+
const conversationHistory = [];
|
|
5949
|
+
let running = true;
|
|
5950
|
+
let turns = 0;
|
|
5951
|
+
const rl = readline8.createInterface({ input: process.stdin, output: process.stdout });
|
|
5952
|
+
rl.on("line", (input) => {
|
|
5953
|
+
if (input.trim().toLowerCase() === "abort") {
|
|
5954
|
+
running = false;
|
|
5955
|
+
rl.close();
|
|
5956
|
+
console.log("");
|
|
5957
|
+
console.log(AMBER6(" \u23F9 Simulation aborted."));
|
|
5958
|
+
clearSessionFile(projectName);
|
|
5959
|
+
console.log("");
|
|
5960
|
+
process.exit(0);
|
|
5961
|
+
}
|
|
5962
|
+
});
|
|
5963
|
+
process.on("SIGINT", () => {
|
|
5964
|
+
running = false;
|
|
5965
|
+
rl.close();
|
|
5966
|
+
console.log("");
|
|
5967
|
+
console.log(AMBER6(" \u23F9 Simulation aborted."));
|
|
5968
|
+
clearSessionFile(projectName);
|
|
5969
|
+
process.exit(0);
|
|
5970
|
+
});
|
|
5971
|
+
const kickstart = `Hey Bob, I'm ready to get started. What should we focus on first?`;
|
|
5972
|
+
console.log(PURPLE(` UserBob > `) + chalk24.white(kickstart));
|
|
5973
|
+
console.log("");
|
|
5974
|
+
conversationHistory.push({ role: "user", content: kickstart });
|
|
5975
|
+
while (running) {
|
|
5976
|
+
const session = readSessionFile(projectName);
|
|
5977
|
+
if (!session?.active) break;
|
|
5978
|
+
turns++;
|
|
5979
|
+
try {
|
|
5980
|
+
const bobMessages = [
|
|
5981
|
+
{ role: "system", content: bobSystemPrompt },
|
|
5982
|
+
...conversationHistory
|
|
5983
|
+
];
|
|
5984
|
+
const bobResponse = await callLocalModel(config.localEndpoint, bobMessages);
|
|
5985
|
+
console.log(GREEN5(` bob > `) + chalk24.white(bobResponse));
|
|
5986
|
+
console.log("");
|
|
5987
|
+
conversationHistory.push({ role: "assistant", content: bobResponse });
|
|
5988
|
+
const userBobMessages = [
|
|
5989
|
+
{ role: "system", content: userBobSystemPrompt },
|
|
5990
|
+
...conversationHistory
|
|
5991
|
+
];
|
|
5992
|
+
const userBobResponse = await callLocalModel(config.localEndpoint, userBobMessages);
|
|
5993
|
+
const jsonMatch = userBobResponse.match(/\{"satisfactionScore":\s*(\d+).*?\}/);
|
|
5994
|
+
const satisfactionScore = jsonMatch ? parseInt(jsonMatch[1]) : 0;
|
|
5995
|
+
const cleanResponse = userBobResponse.replace(/\{[\s\S]*?"status".*?\}/, "").trim();
|
|
5996
|
+
console.log(PURPLE(` UserBob > `) + chalk24.white(cleanResponse));
|
|
5997
|
+
console.log(GRAY5(` [Satisfaction: ${satisfactionScore}/${target}]`));
|
|
5998
|
+
console.log("");
|
|
5999
|
+
conversationHistory.push({ role: "user", content: cleanResponse });
|
|
6000
|
+
if (satisfactionScore >= target) {
|
|
6001
|
+
console.log(AMBER6(` \u2705 Target satisfaction reached (${satisfactionScore}/${target}). Simulation complete.`));
|
|
6002
|
+
running = false;
|
|
6003
|
+
}
|
|
6004
|
+
writeSessionFile(projectName, { active: true, turns, startedAt: session.startedAt });
|
|
6005
|
+
} catch (err) {
|
|
6006
|
+
console.log(RED5(` \u274C Error: ${err.message}`));
|
|
6007
|
+
running = false;
|
|
6008
|
+
}
|
|
6009
|
+
if (running) await sleep6(1500);
|
|
6010
|
+
}
|
|
6011
|
+
clearSessionFile(projectName);
|
|
6012
|
+
rl.close();
|
|
6013
|
+
console.log("");
|
|
6014
|
+
}
|
|
6015
|
+
function sleep6(ms) {
|
|
6016
|
+
return new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
6017
|
+
}
|
|
6018
|
+
|
|
5723
6019
|
// bin/bob.ts
|
|
5724
|
-
var BRAND_PRIMARY11 =
|
|
5725
|
-
var BRAND_SECONDARY15 =
|
|
5726
|
-
var SUCCESS16 =
|
|
5727
|
-
var INFO16 =
|
|
5728
|
-
var MUTED16 =
|
|
5729
|
-
var MODE_CONSULTANT9 =
|
|
6020
|
+
var BRAND_PRIMARY11 = chalk25.hex("#E66F24");
|
|
6021
|
+
var BRAND_SECONDARY15 = chalk25.hex("#FFAB00");
|
|
6022
|
+
var SUCCESS16 = chalk25.hex("#66BB6A");
|
|
6023
|
+
var INFO16 = chalk25.hex("#26C6DA");
|
|
6024
|
+
var MUTED16 = chalk25.hex("#78909C");
|
|
6025
|
+
var MODE_CONSULTANT9 = chalk25.hex("#AB47BC");
|
|
5730
6026
|
var program = new Command();
|
|
5731
6027
|
program.name("bob").description("Bob's CLI \u2014 AI coding assistant and Forge orchestrator").version("0.2.0").helpOption(false).addHelpCommand(false);
|
|
5732
6028
|
program.option("-h, --help", "Print this usage information").on("option:help", () => {
|
|
@@ -5740,7 +6036,7 @@ function printCustomHelp() {
|
|
|
5740
6036
|
console.log("");
|
|
5741
6037
|
console.log(BRAND_PRIMARY11(" \u25C9 Bob's CLI") + MUTED16(" \u2014 Your AI Engineering Partner, In Your Terminal."));
|
|
5742
6038
|
console.log("");
|
|
5743
|
-
console.log(
|
|
6039
|
+
console.log(chalk25.white(" Common commands:"));
|
|
5744
6040
|
console.log("");
|
|
5745
6041
|
console.log(BRAND_SECONDARY15(' bob chat "message"'));
|
|
5746
6042
|
console.log(MUTED16(" Chat with Bob \u2014 code-friendly engineering partner with file awareness."));
|
|
@@ -5751,13 +6047,13 @@ function printCustomHelp() {
|
|
|
5751
6047
|
console.log(BRAND_SECONDARY15(" bob index"));
|
|
5752
6048
|
console.log(MUTED16(" Index your project \u2014 generates summaries and dependency map for context."));
|
|
5753
6049
|
console.log("");
|
|
5754
|
-
console.log(
|
|
6050
|
+
console.log(chalk25.white(" Usage: ") + INFO16("bob <command> [arguments]"));
|
|
5755
6051
|
console.log("");
|
|
5756
|
-
console.log(
|
|
6052
|
+
console.log(chalk25.white(" Global options:"));
|
|
5757
6053
|
console.log(MUTED16(" -h, --help Print this usage information."));
|
|
5758
6054
|
console.log(MUTED16(" -V, --version Output the version number."));
|
|
5759
6055
|
console.log("");
|
|
5760
|
-
console.log(
|
|
6056
|
+
console.log(chalk25.white(" Available commands:"));
|
|
5761
6057
|
console.log("");
|
|
5762
6058
|
console.log(INFO16(" Conversation"));
|
|
5763
6059
|
printCmd("chat [message]", "Chat with Bob \u2014 code-friendly engineering partner");
|
|
@@ -5783,6 +6079,7 @@ function printCustomHelp() {
|
|
|
5783
6079
|
console.log(MODE_CONSULTANT9(" Profile & Identity"));
|
|
5784
6080
|
printCmd("profile", "View your behavioral DNA dashboard");
|
|
5785
6081
|
printCmd("profile --cloud", "Generate cloud-powered daily profile");
|
|
6082
|
+
printCmd("userbob", "Launch your UserBob digital twin");
|
|
5786
6083
|
printCmd("byok", "Manage Bring Your Own Key configuration");
|
|
5787
6084
|
console.log("");
|
|
5788
6085
|
console.log(MUTED16(" Configuration"));
|
|
@@ -5792,7 +6089,7 @@ function printCustomHelp() {
|
|
|
5792
6089
|
printCmd("logout", "Sign out and clear stored credentials");
|
|
5793
6090
|
printCmd("whoami", "Show current auth status and project info");
|
|
5794
6091
|
console.log("");
|
|
5795
|
-
console.log(
|
|
6092
|
+
console.log(chalk25.white(" Interactive slash commands ") + MUTED16("(inside a chat/consult session):"));
|
|
5796
6093
|
console.log("");
|
|
5797
6094
|
printCmd("/exit", "End the session");
|
|
5798
6095
|
printCmd("/new", "Start a fresh conversation");
|
|
@@ -5818,20 +6115,20 @@ function printCmd(cmd, desc) {
|
|
|
5818
6115
|
}
|
|
5819
6116
|
program.command("whoami").description("Show current authentication status and configuration").action(() => {
|
|
5820
6117
|
const config = getConfig();
|
|
5821
|
-
const projectName =
|
|
6118
|
+
const projectName = path14.basename(process.cwd());
|
|
5822
6119
|
console.log("");
|
|
5823
|
-
console.log(
|
|
5824
|
-
console.log(
|
|
5825
|
-
console.log(` ${
|
|
5826
|
-
console.log(` ${
|
|
5827
|
-
console.log(` ${
|
|
5828
|
-
console.log(` ${
|
|
5829
|
-
console.log(` ${
|
|
5830
|
-
console.log(` ${
|
|
5831
|
-
console.log(` ${
|
|
6120
|
+
console.log(chalk25.bold(" \u{1F916} Bob's CLI"));
|
|
6121
|
+
console.log(chalk25.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
6122
|
+
console.log(` ${chalk25.cyan("Status:")} ${config.loggedIn ? chalk25.green("Logged in as " + config.email) : "Not logged in"}`);
|
|
6123
|
+
console.log(` ${chalk25.cyan("Tier:")} ${config.tier === "platform" ? "Platform (Tier 3)" : "Local-first (Tier 1)"}`);
|
|
6124
|
+
console.log(` ${chalk25.cyan("Provider:")} ${config.provider || "Not configured"}`);
|
|
6125
|
+
console.log(` ${chalk25.cyan("Mode:")} ${config.personalizationMode ? "Personalized" : config.consultantMode ? "Consultant" : "Standard"}`);
|
|
6126
|
+
console.log(` ${chalk25.cyan("IDRP:")} ${config.idrp ? "Enabled" : "Disabled"}`);
|
|
6127
|
+
console.log(` ${chalk25.cyan("Project:")} ${projectName} (${process.cwd()})`);
|
|
6128
|
+
console.log(` ${chalk25.cyan("Session:")} ${config.conversationId ? config.conversationId.slice(0, 20) + "..." : "None"}`);
|
|
5832
6129
|
console.log("");
|
|
5833
6130
|
if (!config.loggedIn) {
|
|
5834
|
-
console.log(
|
|
6131
|
+
console.log(chalk25.gray(" Run `bob login` to authenticate."));
|
|
5835
6132
|
console.log("");
|
|
5836
6133
|
}
|
|
5837
6134
|
});
|
|
@@ -5850,23 +6147,24 @@ registerAutonomyCommand(program);
|
|
|
5850
6147
|
registerServeCommand(program);
|
|
5851
6148
|
registerRemoteCommand(program);
|
|
5852
6149
|
registerProfileCommand(program);
|
|
6150
|
+
registerUserBobCommand(program);
|
|
5853
6151
|
process.on("uncaughtException", (error) => {
|
|
5854
6152
|
console.error("");
|
|
5855
|
-
console.error(
|
|
5856
|
-
console.error(
|
|
6153
|
+
console.error(chalk25.hex("#EF5350")(" \u274C An unexpected error occurred."));
|
|
6154
|
+
console.error(chalk25.hex("#78909C")(` ${error.message || "Unknown error"}`));
|
|
5857
6155
|
console.error("");
|
|
5858
|
-
console.error(
|
|
5859
|
-
console.error(
|
|
6156
|
+
console.error(chalk25.hex("#78909C")(" If this persists, please report it:"));
|
|
6157
|
+
console.error(chalk25.hex("#26C6DA")(" https://github.com/bobsworkshop/bob-cli/issues"));
|
|
5860
6158
|
console.error("");
|
|
5861
6159
|
process.exit(1);
|
|
5862
6160
|
});
|
|
5863
6161
|
process.on("unhandledRejection", (reason) => {
|
|
5864
6162
|
console.error("");
|
|
5865
|
-
console.error(
|
|
5866
|
-
console.error(
|
|
6163
|
+
console.error(chalk25.hex("#EF5350")(" \u274C An unexpected error occurred."));
|
|
6164
|
+
console.error(chalk25.hex("#78909C")(` ${reason?.message || reason || "Unknown error"}`));
|
|
5867
6165
|
console.error("");
|
|
5868
|
-
console.error(
|
|
5869
|
-
console.error(
|
|
6166
|
+
console.error(chalk25.hex("#78909C")(" If this persists, please report it:"));
|
|
6167
|
+
console.error(chalk25.hex("#26C6DA")(" https://github.com/bobsworkshop/bob-cli/issues"));
|
|
5870
6168
|
console.error("");
|
|
5871
6169
|
process.exit(1);
|
|
5872
6170
|
});
|