@bobsworkshop/cli 1.0.1 → 1.1.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 +111 -3
- package/dist/bob.js +440 -122
- package/package.json +1 -1
package/dist/bob.js
CHANGED
|
@@ -1502,6 +1502,82 @@ function sleep2(ms) {
|
|
|
1502
1502
|
return new Promise((resolve4) => setTimeout(resolve4, ms));
|
|
1503
1503
|
}
|
|
1504
1504
|
|
|
1505
|
+
// src/core/reference-resolver.ts
|
|
1506
|
+
var RESERVED_COMMANDS = [
|
|
1507
|
+
"help",
|
|
1508
|
+
"clear",
|
|
1509
|
+
"reset",
|
|
1510
|
+
"surface",
|
|
1511
|
+
"promote",
|
|
1512
|
+
"constraints",
|
|
1513
|
+
"personalized",
|
|
1514
|
+
"exit",
|
|
1515
|
+
"quit",
|
|
1516
|
+
"new",
|
|
1517
|
+
"ref",
|
|
1518
|
+
"pin",
|
|
1519
|
+
"unpin",
|
|
1520
|
+
"sticky"
|
|
1521
|
+
];
|
|
1522
|
+
function detectReference(input) {
|
|
1523
|
+
if (!input.startsWith("/")) return null;
|
|
1524
|
+
const match = input.match(
|
|
1525
|
+
/^\/([a-zA-Z0-9_-]+)(?:\s*-\s*(.+?))?(?:\s|$)/
|
|
1526
|
+
);
|
|
1527
|
+
if (!match) return null;
|
|
1528
|
+
const alias = match[1].toLowerCase().trim();
|
|
1529
|
+
if (RESERVED_COMMANDS.includes(alias)) return null;
|
|
1530
|
+
return {
|
|
1531
|
+
alias,
|
|
1532
|
+
filename: match[2]?.trim()
|
|
1533
|
+
};
|
|
1534
|
+
}
|
|
1535
|
+
async function fetchAvailableReferences(domain, uid) {
|
|
1536
|
+
try {
|
|
1537
|
+
const result = await callCloudFunction("getAvailableReferences", {
|
|
1538
|
+
domain,
|
|
1539
|
+
uid
|
|
1540
|
+
});
|
|
1541
|
+
return result?.references ?? [];
|
|
1542
|
+
} catch (e) {
|
|
1543
|
+
console.error("[REF] fetchAvailableReferences failed:", e);
|
|
1544
|
+
return [];
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
async function fetchProjectFiles(domain, projectId, query = "") {
|
|
1548
|
+
try {
|
|
1549
|
+
const result = await callCloudFunction("getProjectReferenceFiles", {
|
|
1550
|
+
domain,
|
|
1551
|
+
projectId,
|
|
1552
|
+
query
|
|
1553
|
+
});
|
|
1554
|
+
return result?.files ?? [];
|
|
1555
|
+
} catch (e) {
|
|
1556
|
+
console.error("[REF] fetchProjectFiles failed:", e);
|
|
1557
|
+
return [];
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
async function loadStickyReference(docPath) {
|
|
1561
|
+
try {
|
|
1562
|
+
const result = await callCloudFunction("getStickyReference", { docPath });
|
|
1563
|
+
if (!result?.active || !result?.alias) return null;
|
|
1564
|
+
return { alias: result.alias };
|
|
1565
|
+
} catch (e) {
|
|
1566
|
+
return null;
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
async function saveStickyReference(docPath, alias, active) {
|
|
1570
|
+
try {
|
|
1571
|
+
await callCloudFunction("setStickyReference", {
|
|
1572
|
+
docPath,
|
|
1573
|
+
alias,
|
|
1574
|
+
active
|
|
1575
|
+
});
|
|
1576
|
+
} catch (e) {
|
|
1577
|
+
console.error("[REF] saveStickyReference failed:", e);
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1505
1581
|
// src/commands/deepdive.ts
|
|
1506
1582
|
var BRAND_SECONDARY2 = chalk5.hex("#FFAB00");
|
|
1507
1583
|
var SUCCESS2 = chalk5.hex("#66BB6A");
|
|
@@ -1705,6 +1781,10 @@ async function enterDeepDive(config, conversationId, rl) {
|
|
|
1705
1781
|
async function runDeepDiveSession(config, conversationId, parentMessageId, initiatingPrompt, rl) {
|
|
1706
1782
|
const previewText = initiatingPrompt.slice(0, 50) + (initiatingPrompt.length > 50 ? "..." : "");
|
|
1707
1783
|
const isLocalProvider = config.provider === "local" && config.localEndpoint;
|
|
1784
|
+
const domain = config.email?.split("@").pop()?.toLowerCase() ?? "";
|
|
1785
|
+
const uid = config.uid ?? "";
|
|
1786
|
+
const threadDocPath = `Organizations/${domain}/OrgUsers/${uid}/BobGlobalChat/${conversationId}/Messages/${parentMessageId}/sandbox/thread`;
|
|
1787
|
+
let stickyRef = await loadStickyReference(threadDocPath);
|
|
1708
1788
|
console.log("");
|
|
1709
1789
|
console.log(MODE_DEEPDIVE2(" \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\u2557"));
|
|
1710
1790
|
console.log(MODE_DEEPDIVE2(" \u2551") + chalk5.bold(MODE_DEEPDIVE2(" \u{1F93F} DEEP DIVE ")) + MODE_DEEPDIVE2("\u2551"));
|
|
@@ -1712,15 +1792,20 @@ async function runDeepDiveSession(config, conversationId, parentMessageId, initi
|
|
|
1712
1792
|
if (isLocalProvider) {
|
|
1713
1793
|
console.log(MODE_DEEPDIVE2(" \u2551") + MUTED2(" Provider: Local model (sovereign handoff)"));
|
|
1714
1794
|
}
|
|
1795
|
+
if (stickyRef) {
|
|
1796
|
+
console.log(MODE_DEEPDIVE2(" \u2551") + AMBER(` \u{1F4CC} Sticky ref: /${stickyRef.alias}`));
|
|
1797
|
+
}
|
|
1715
1798
|
console.log(MODE_DEEPDIVE2(" \u2560\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\u2563"));
|
|
1716
|
-
console.log(MODE_DEEPDIVE2(" \u2551") + MUTED2("
|
|
1799
|
+
console.log(MODE_DEEPDIVE2(" \u2551") + MUTED2(" /surface /promote /clear /constraints ") + MODE_DEEPDIVE2("\u2551"));
|
|
1800
|
+
console.log(MODE_DEEPDIVE2(" \u2551") + MUTED2(" /ref /pin \u2014 manage reference projects ") + MODE_DEEPDIVE2("\u2551"));
|
|
1717
1801
|
console.log(MODE_DEEPDIVE2(" \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\u255D"));
|
|
1718
1802
|
console.log("");
|
|
1719
1803
|
let lastBobResponse = "";
|
|
1720
1804
|
let lastConstraints3 = [];
|
|
1721
1805
|
return new Promise((resolve4) => {
|
|
1722
1806
|
const deepDivePrompt = () => {
|
|
1723
|
-
|
|
1807
|
+
const promptText = stickyRef ? MODE_DEEPDIVE2(` \u{1F4CC} /${stickyRef.alias} \u{1F93F} \u203A `) : MODE_DEEPDIVE2(" \u{1F93F} You: ");
|
|
1808
|
+
rl.question(promptText, async (input) => {
|
|
1724
1809
|
const trimmed = input.trim();
|
|
1725
1810
|
if (!trimmed) {
|
|
1726
1811
|
deepDivePrompt();
|
|
@@ -1795,6 +1880,30 @@ async function runDeepDiveSession(config, conversationId, parentMessageId, initi
|
|
|
1795
1880
|
deepDivePrompt();
|
|
1796
1881
|
return;
|
|
1797
1882
|
}
|
|
1883
|
+
if (trimmed === "/ref") {
|
|
1884
|
+
stickyRef = await handleDeepDiveRefBrowser(domain, uid, threadDocPath, rl);
|
|
1885
|
+
deepDivePrompt();
|
|
1886
|
+
return;
|
|
1887
|
+
}
|
|
1888
|
+
if (trimmed === "/pin") {
|
|
1889
|
+
if (stickyRef) {
|
|
1890
|
+
await saveStickyReference(threadDocPath, null, false);
|
|
1891
|
+
stickyRef = null;
|
|
1892
|
+
console.log("");
|
|
1893
|
+
console.log(MUTED2(" \u{1F4CC} Sticky reference cleared."));
|
|
1894
|
+
console.log("");
|
|
1895
|
+
} else {
|
|
1896
|
+
stickyRef = await handleDeepDiveRefBrowser(domain, uid, threadDocPath, rl);
|
|
1897
|
+
}
|
|
1898
|
+
deepDivePrompt();
|
|
1899
|
+
return;
|
|
1900
|
+
}
|
|
1901
|
+
const inlineRef = detectReference(trimmed);
|
|
1902
|
+
const activeRef = inlineRef ?? stickyRef ?? null;
|
|
1903
|
+
if (activeRef) {
|
|
1904
|
+
console.log("");
|
|
1905
|
+
console.log(AMBER(` \u{1F4CE} Referencing /${activeRef.alias}${activeRef.filename ? ` \u2014 ${activeRef.filename}` : ""}...`));
|
|
1906
|
+
}
|
|
1798
1907
|
renderUserMessage(trimmed);
|
|
1799
1908
|
startElapsedTimer();
|
|
1800
1909
|
try {
|
|
@@ -1821,7 +1930,10 @@ Current request: ${trimmed}` : trimmed;
|
|
|
1821
1930
|
isLocalModel: true,
|
|
1822
1931
|
activePersonaId: null,
|
|
1823
1932
|
localContext,
|
|
1824
|
-
cliMode: true
|
|
1933
|
+
cliMode: true,
|
|
1934
|
+
// ─── REFERENCE PARAMS ───
|
|
1935
|
+
...activeRef && { referenceAlias: activeRef.alias },
|
|
1936
|
+
...activeRef?.filename && { referenceFilename: activeRef.filename }
|
|
1825
1937
|
});
|
|
1826
1938
|
if (!handoffResult?.isHandoff || !handoffResult?.masterPrompt) {
|
|
1827
1939
|
throw new Error("Handoff failed \u2014 no master prompt returned.");
|
|
@@ -1830,7 +1942,18 @@ Current request: ${trimmed}` : trimmed;
|
|
|
1830
1942
|
responseText = await callLocalModel(config.localEndpoint, localMessages);
|
|
1831
1943
|
await callCloudFunction("saveCLIDeepDiveMessage", { conversationId, parentMessageId, message: responseText, sender: "bob", origin: "local-sovereign" });
|
|
1832
1944
|
} else {
|
|
1833
|
-
await callCloudFunction("generateDeepDiveResponse", {
|
|
1945
|
+
await callCloudFunction("generateDeepDiveResponse", {
|
|
1946
|
+
conversationId,
|
|
1947
|
+
parentMessageId,
|
|
1948
|
+
userMessage: trimmed,
|
|
1949
|
+
isLocalModel: false,
|
|
1950
|
+
activePersonaId: null,
|
|
1951
|
+
localContext,
|
|
1952
|
+
cliMode: true,
|
|
1953
|
+
// ─── REFERENCE PARAMS ───
|
|
1954
|
+
...activeRef && { referenceAlias: activeRef.alias },
|
|
1955
|
+
...activeRef?.filename && { referenceFilename: activeRef.filename }
|
|
1956
|
+
});
|
|
1834
1957
|
const latestResult = await callCloudFunction("listCLIDeepDives", { conversationId, action: "getLatestSandboxMessage", parentMessageId });
|
|
1835
1958
|
responseText = latestResult?.message || "Deep dive response saved.";
|
|
1836
1959
|
}
|
|
@@ -1865,6 +1988,77 @@ Current request: ${trimmed}` : trimmed;
|
|
|
1865
1988
|
deepDivePrompt();
|
|
1866
1989
|
});
|
|
1867
1990
|
}
|
|
1991
|
+
async function handleDeepDiveRefBrowser(domain, uid, threadDocPath, rl) {
|
|
1992
|
+
const refs = await fetchAvailableReferences(domain, uid);
|
|
1993
|
+
if (refs.length === 0) {
|
|
1994
|
+
console.log("");
|
|
1995
|
+
console.log(MUTED2(" No shared references available for your account."));
|
|
1996
|
+
console.log("");
|
|
1997
|
+
return null;
|
|
1998
|
+
}
|
|
1999
|
+
console.log("");
|
|
2000
|
+
console.log(AMBER(" \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\u2557"));
|
|
2001
|
+
console.log(AMBER(" \u2551") + chalk5.bold(" \u{1F4CE} AVAILABLE REFERENCES ") + AMBER("\u2551"));
|
|
2002
|
+
console.log(AMBER(" \u2560\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\u2563"));
|
|
2003
|
+
refs.forEach((ref, i) => {
|
|
2004
|
+
const line = ` ${String(i + 1).padStart(2)}. /${ref.alias.padEnd(18)} ${MUTED2(ref.repoDisplayName)}`;
|
|
2005
|
+
console.log(AMBER(" \u2551") + line);
|
|
2006
|
+
});
|
|
2007
|
+
console.log(AMBER(" \u2560\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\u2563"));
|
|
2008
|
+
console.log(AMBER(" \u2551") + MUTED2(" Enter number to select, 0 to cancel ") + AMBER("\u2551"));
|
|
2009
|
+
console.log(AMBER(" \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\u255D"));
|
|
2010
|
+
console.log("");
|
|
2011
|
+
const answer = await new Promise((resolve4) => {
|
|
2012
|
+
rl.question(AMBER(" Select reference: "), resolve4);
|
|
2013
|
+
});
|
|
2014
|
+
const num = parseInt(answer.trim());
|
|
2015
|
+
if (isNaN(num) || num === 0 || num < 1 || num > refs.length) {
|
|
2016
|
+
console.log(MUTED2(" Cancelled."));
|
|
2017
|
+
console.log("");
|
|
2018
|
+
return null;
|
|
2019
|
+
}
|
|
2020
|
+
const selected = refs[num - 1];
|
|
2021
|
+
const modeAnswer = await new Promise((resolve4) => {
|
|
2022
|
+
rl.question(AMBER(` /${selected.alias} \u2014 whole project (p) or specific file (f)? `), resolve4);
|
|
2023
|
+
});
|
|
2024
|
+
if (modeAnswer.trim().toLowerCase() === "f") {
|
|
2025
|
+
const filterAnswer = await new Promise((resolve4) => {
|
|
2026
|
+
rl.question(AMBER(" Filter files (or Enter for all): "), resolve4);
|
|
2027
|
+
});
|
|
2028
|
+
const files = await fetchProjectFiles(domain, selected.projectId, filterAnswer.trim());
|
|
2029
|
+
if (files.length === 0) {
|
|
2030
|
+
console.log(MUTED2(" No files found. Referencing whole project."));
|
|
2031
|
+
console.log("");
|
|
2032
|
+
return { alias: selected.alias };
|
|
2033
|
+
}
|
|
2034
|
+
console.log("");
|
|
2035
|
+
files.slice(0, 20).forEach((fp, i) => {
|
|
2036
|
+
console.log(MUTED2(` ${String(i + 1).padStart(2)}. ${fp}`));
|
|
2037
|
+
});
|
|
2038
|
+
console.log("");
|
|
2039
|
+
const fileAnswer = await new Promise((resolve4) => {
|
|
2040
|
+
rl.question(AMBER(" Select file (or Enter for whole project): "), resolve4);
|
|
2041
|
+
});
|
|
2042
|
+
const fileNum = parseInt(fileAnswer.trim());
|
|
2043
|
+
if (isNaN(fileNum) || fileNum < 1 || fileNum > files.length) {
|
|
2044
|
+
await saveStickyReference(threadDocPath, selected.alias, true);
|
|
2045
|
+
console.log("");
|
|
2046
|
+
console.log(AMBER(` \u{1F4CC} Sticky reference set: /${selected.alias}`));
|
|
2047
|
+
console.log("");
|
|
2048
|
+
return { alias: selected.alias };
|
|
2049
|
+
}
|
|
2050
|
+
const filename = files[fileNum - 1];
|
|
2051
|
+
console.log("");
|
|
2052
|
+
console.log(AMBER(` \u{1F4CE} File reference: /${selected.alias} \u2014 ${filename}`));
|
|
2053
|
+
console.log("");
|
|
2054
|
+
return { alias: selected.alias, filename };
|
|
2055
|
+
}
|
|
2056
|
+
await saveStickyReference(threadDocPath, selected.alias, true);
|
|
2057
|
+
console.log("");
|
|
2058
|
+
console.log(AMBER(` \u{1F4CC} Sticky reference set: /${selected.alias}`));
|
|
2059
|
+
console.log("");
|
|
2060
|
+
return { alias: selected.alias };
|
|
2061
|
+
}
|
|
1868
2062
|
|
|
1869
2063
|
// src/ui/session-header.ts
|
|
1870
2064
|
import chalk6 from "chalk";
|
|
@@ -2063,6 +2257,7 @@ var WARNING5 = chalk9.hex("#FFC107");
|
|
|
2063
2257
|
var ERROR4 = chalk9.hex("#EF5350");
|
|
2064
2258
|
var MUTED6 = chalk9.hex("#78909C");
|
|
2065
2259
|
var MODE_CHAT3 = chalk9.hex("#26C6DA");
|
|
2260
|
+
var AMBER2 = chalk9.hex("#FFAB00");
|
|
2066
2261
|
var lastConstraints = [];
|
|
2067
2262
|
function registerChatCommand(program2) {
|
|
2068
2263
|
program2.command("chat [message]").description("Chat with Bob \u2014 code-friendly engineering partner").option("-f, --file <path>", "Include a specific file as context").option("--no-context", "Skip local directory context").option("--personalized", "Use personalization mode (Tier 3 only)").option("--new", "Start a fresh conversation").option("-i, --interactive", "Enter interactive conversation mode").action(async (message, options) => {
|
|
@@ -2100,7 +2295,7 @@ ${fileContent}
|
|
|
2100
2295
|
await sendMessage(message, config, conversationId, localContext, options.personalized || false, "standard", [], void 0);
|
|
2101
2296
|
});
|
|
2102
2297
|
}
|
|
2103
|
-
async function sendMessage(message, config, conversationId, localContext, personalized, mode, history, existingRl) {
|
|
2298
|
+
async function sendMessage(message, config, conversationId, localContext, personalized, mode, history, existingRl, activeRef) {
|
|
2104
2299
|
const providerReady = await ensureProvider();
|
|
2105
2300
|
if (!providerReady) return "";
|
|
2106
2301
|
config = getConfig();
|
|
@@ -2166,7 +2361,10 @@ ${fullContext}` : "") },
|
|
|
2166
2361
|
userMessage: message,
|
|
2167
2362
|
additionalContext: { localContext: fullContext || null },
|
|
2168
2363
|
isLocalModel: false,
|
|
2169
|
-
activePersonaId: null
|
|
2364
|
+
activePersonaId: null,
|
|
2365
|
+
// ─── REFERENCE PARAMS ───
|
|
2366
|
+
...activeRef && { referenceAlias: activeRef.alias },
|
|
2367
|
+
...activeRef?.filename && { referenceFilename: activeRef.filename }
|
|
2170
2368
|
});
|
|
2171
2369
|
response = result?.response || result?.data?.response || result?.text || result?.message || "No response received.";
|
|
2172
2370
|
hasProjectContext = result?.hasProjectContext ?? null;
|
|
@@ -2179,7 +2377,21 @@ ${fullContext}` : "") },
|
|
|
2179
2377
|
console.log(MUTED6(" Run `bob login` to authenticate, or set provider to local."));
|
|
2180
2378
|
return "";
|
|
2181
2379
|
}
|
|
2182
|
-
const result = await callCloudFunction("chatWithBobStream", {
|
|
2380
|
+
const result = await callCloudFunction("chatWithBobStream", {
|
|
2381
|
+
userEmail: config.email,
|
|
2382
|
+
userId: config.uid,
|
|
2383
|
+
conversationId,
|
|
2384
|
+
userMessage: message,
|
|
2385
|
+
useContext: true,
|
|
2386
|
+
consultantModelId: "gemini-2.5-flash",
|
|
2387
|
+
useOrgContext: false,
|
|
2388
|
+
isPassalongActive: false,
|
|
2389
|
+
linkedConvoId: null,
|
|
2390
|
+
localContext: fullContext || null,
|
|
2391
|
+
// ─── REFERENCE PARAMS ───
|
|
2392
|
+
...activeRef && { referenceAlias: activeRef.alias },
|
|
2393
|
+
...activeRef?.filename && { referenceFilename: activeRef.filename }
|
|
2394
|
+
});
|
|
2183
2395
|
response = result?.text || result?.response || result?.message || "No response received.";
|
|
2184
2396
|
hasProjectContext = result?.hasProjectContext ?? null;
|
|
2185
2397
|
constraints = result?.constraints || [];
|
|
@@ -2220,15 +2432,22 @@ async function runInteractiveSession(config, conversationId, localContext, perso
|
|
|
2220
2432
|
renderSessionHeader("chat");
|
|
2221
2433
|
const rl = readline2.createInterface({ input: process.stdin, output: process.stdout });
|
|
2222
2434
|
const history = [];
|
|
2435
|
+
const domain = config.email?.split("@").pop()?.toLowerCase() ?? "";
|
|
2436
|
+
const uid = config.uid ?? "";
|
|
2437
|
+
const convoDocPath = `Organizations/${domain}/OrgUsers/${uid}/BobGlobalChat/${conversationId}`;
|
|
2438
|
+
let stickyRef = await loadStickyReference(convoDocPath);
|
|
2223
2439
|
if (initialMessage) {
|
|
2224
|
-
const
|
|
2440
|
+
const inlineRef = detectReference(initialMessage);
|
|
2441
|
+
const activeRef = inlineRef ?? stickyRef ?? null;
|
|
2442
|
+
const response = await sendMessage(initialMessage, config, conversationId, localContext, personalized, mode, history, rl, activeRef);
|
|
2225
2443
|
if (response) {
|
|
2226
2444
|
history.push({ role: "user", content: initialMessage });
|
|
2227
2445
|
history.push({ role: "assistant", content: response });
|
|
2228
2446
|
}
|
|
2229
2447
|
}
|
|
2230
2448
|
const prompt = () => {
|
|
2231
|
-
|
|
2449
|
+
const promptText = stickyRef ? AMBER2(` \u{1F4CC} /${stickyRef.alias} \u203A `) : SUCCESS6(" You: ");
|
|
2450
|
+
rl.question(promptText, async (input) => {
|
|
2232
2451
|
const trimmed = input.trim();
|
|
2233
2452
|
if (!trimmed) {
|
|
2234
2453
|
prompt();
|
|
@@ -2267,6 +2486,24 @@ async function runInteractiveSession(config, conversationId, localContext, perso
|
|
|
2267
2486
|
prompt();
|
|
2268
2487
|
return;
|
|
2269
2488
|
}
|
|
2489
|
+
if (trimmed === "/ref") {
|
|
2490
|
+
stickyRef = await handleRefBrowser(domain, uid, convoDocPath, rl);
|
|
2491
|
+
prompt();
|
|
2492
|
+
return;
|
|
2493
|
+
}
|
|
2494
|
+
if (trimmed === "/pin") {
|
|
2495
|
+
if (stickyRef) {
|
|
2496
|
+
await saveStickyReference(convoDocPath, null, false);
|
|
2497
|
+
stickyRef = null;
|
|
2498
|
+
console.log("");
|
|
2499
|
+
console.log(MUTED6(" \u{1F4CC} Sticky reference cleared."));
|
|
2500
|
+
console.log("");
|
|
2501
|
+
} else {
|
|
2502
|
+
stickyRef = await handleRefBrowser(domain, uid, convoDocPath, rl);
|
|
2503
|
+
}
|
|
2504
|
+
prompt();
|
|
2505
|
+
return;
|
|
2506
|
+
}
|
|
2270
2507
|
if (trimmed.startsWith("/include ")) {
|
|
2271
2508
|
const filePath = trimmed.slice(9).trim();
|
|
2272
2509
|
const content = readFileContent(filePath);
|
|
@@ -2337,7 +2574,13 @@ ${content}
|
|
|
2337
2574
|
prompt();
|
|
2338
2575
|
return;
|
|
2339
2576
|
}
|
|
2340
|
-
const
|
|
2577
|
+
const inlineRef = detectReference(trimmed);
|
|
2578
|
+
const activeRef = inlineRef ?? stickyRef ?? null;
|
|
2579
|
+
if (activeRef) {
|
|
2580
|
+
console.log("");
|
|
2581
|
+
console.log(AMBER2(` \u{1F4CE} Referencing /${activeRef.alias}${activeRef.filename ? ` \u2014 ${activeRef.filename}` : ""}...`));
|
|
2582
|
+
}
|
|
2583
|
+
const response = await sendMessage(trimmed, config, conversationId, localContext, personalized, mode, history, rl, activeRef);
|
|
2341
2584
|
if (response) {
|
|
2342
2585
|
history.push({ role: "user", content: trimmed });
|
|
2343
2586
|
history.push({ role: "assistant", content: response });
|
|
@@ -2347,6 +2590,81 @@ ${content}
|
|
|
2347
2590
|
};
|
|
2348
2591
|
prompt();
|
|
2349
2592
|
}
|
|
2593
|
+
async function handleRefBrowser(domain, uid, docPath, rl) {
|
|
2594
|
+
const refs = await fetchAvailableReferences(domain, uid);
|
|
2595
|
+
if (refs.length === 0) {
|
|
2596
|
+
console.log("");
|
|
2597
|
+
console.log(MUTED6(" No shared references available for your account."));
|
|
2598
|
+
console.log("");
|
|
2599
|
+
return null;
|
|
2600
|
+
}
|
|
2601
|
+
console.log("");
|
|
2602
|
+
console.log(AMBER2(" \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\u2557"));
|
|
2603
|
+
console.log(AMBER2(" \u2551") + chalk9.bold(" \u{1F4CE} AVAILABLE REFERENCES ") + AMBER2("\u2551"));
|
|
2604
|
+
console.log(AMBER2(" \u2560\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\u2563"));
|
|
2605
|
+
refs.forEach((ref, i) => {
|
|
2606
|
+
const line = ` ${String(i + 1).padStart(2)}. /${ref.alias.padEnd(18)} ${MUTED6(ref.repoDisplayName)}`;
|
|
2607
|
+
console.log(AMBER2(" \u2551") + line);
|
|
2608
|
+
});
|
|
2609
|
+
console.log(AMBER2(" \u2560\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\u2563"));
|
|
2610
|
+
console.log(AMBER2(" \u2551") + MUTED6(" Enter number to select, 0 to cancel ") + AMBER2("\u2551"));
|
|
2611
|
+
console.log(AMBER2(" \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\u255D"));
|
|
2612
|
+
console.log("");
|
|
2613
|
+
const answer = await new Promise((resolve4) => {
|
|
2614
|
+
rl.question(AMBER2(" Select reference: "), resolve4);
|
|
2615
|
+
});
|
|
2616
|
+
const num = parseInt(answer.trim());
|
|
2617
|
+
if (isNaN(num) || num === 0 || num < 1 || num > refs.length) {
|
|
2618
|
+
console.log(MUTED6(" Cancelled."));
|
|
2619
|
+
console.log("");
|
|
2620
|
+
return null;
|
|
2621
|
+
}
|
|
2622
|
+
const selected = refs[num - 1];
|
|
2623
|
+
const modeAnswer = await new Promise((resolve4) => {
|
|
2624
|
+
rl.question(AMBER2(` /${selected.alias} \u2014 whole project (p) or specific file (f)? `), resolve4);
|
|
2625
|
+
});
|
|
2626
|
+
if (modeAnswer.trim().toLowerCase() === "f") {
|
|
2627
|
+
return await handleFileBrowser(domain, selected, rl, docPath);
|
|
2628
|
+
}
|
|
2629
|
+
await saveStickyReference(docPath, selected.alias, true);
|
|
2630
|
+
console.log("");
|
|
2631
|
+
console.log(AMBER2(` \u{1F4CC} Sticky reference set: /${selected.alias}`));
|
|
2632
|
+
console.log("");
|
|
2633
|
+
return { alias: selected.alias };
|
|
2634
|
+
}
|
|
2635
|
+
async function handleFileBrowser(domain, project, rl, docPath) {
|
|
2636
|
+
const filterAnswer = await new Promise((resolve4) => {
|
|
2637
|
+
rl.question(AMBER2(" Filter files (or Enter for all): "), resolve4);
|
|
2638
|
+
});
|
|
2639
|
+
const files = await fetchProjectFiles(domain, project.projectId, filterAnswer.trim());
|
|
2640
|
+
if (files.length === 0) {
|
|
2641
|
+
console.log(MUTED6(" No files found. Referencing whole project."));
|
|
2642
|
+
console.log("");
|
|
2643
|
+
return { alias: project.alias };
|
|
2644
|
+
}
|
|
2645
|
+
console.log("");
|
|
2646
|
+
console.log(AMBER2(` \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\u2557`));
|
|
2647
|
+
console.log(AMBER2(` \u2551`) + chalk9.bold(` \u{1F4C4} /${project.alias} \u2014 Files `) + AMBER2(`\u2551`));
|
|
2648
|
+
console.log(AMBER2(` \u2560\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\u2563`));
|
|
2649
|
+
files.slice(0, 20).forEach((fp, i) => {
|
|
2650
|
+
const line = ` ${String(i + 1).padStart(2)}. ${fp}`;
|
|
2651
|
+
console.log(AMBER2(" \u2551") + MUTED6(line.slice(0, 42).padEnd(42)) + AMBER2("\u2551"));
|
|
2652
|
+
});
|
|
2653
|
+
console.log(AMBER2(` \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\u255D`));
|
|
2654
|
+
console.log("");
|
|
2655
|
+
const fileAnswer = await new Promise((resolve4) => {
|
|
2656
|
+
rl.question(AMBER2(" Select file (or Enter for whole project): "), resolve4);
|
|
2657
|
+
});
|
|
2658
|
+
const fileNum = parseInt(fileAnswer.trim());
|
|
2659
|
+
if (isNaN(fileNum) || fileNum < 1 || fileNum > files.length) {
|
|
2660
|
+
return { alias: project.alias };
|
|
2661
|
+
}
|
|
2662
|
+
const filename = files[fileNum - 1];
|
|
2663
|
+
console.log("");
|
|
2664
|
+
console.log(AMBER2(` \u{1F4CE} File reference: /${project.alias} \u2014 ${filename}`));
|
|
2665
|
+
console.log("");
|
|
2666
|
+
return { alias: project.alias, filename };
|
|
2667
|
+
}
|
|
2350
2668
|
|
|
2351
2669
|
// src/commands/consult.ts
|
|
2352
2670
|
import chalk10 from "chalk";
|
|
@@ -3856,7 +4174,7 @@ import * as fs8 from "fs";
|
|
|
3856
4174
|
import * as path9 from "path";
|
|
3857
4175
|
var RED = chalk18.hex("#EF5350");
|
|
3858
4176
|
var GREEN = chalk18.hex("#66BB6A");
|
|
3859
|
-
var
|
|
4177
|
+
var AMBER3 = chalk18.hex("#FFAB00");
|
|
3860
4178
|
var BLUE = chalk18.hex("#42A5F5");
|
|
3861
4179
|
var GRAY = chalk18.gray;
|
|
3862
4180
|
var BORDER4 = chalk18.hex("#455A64");
|
|
@@ -3950,7 +4268,7 @@ async function runTier3Autonomy(config, conversationId) {
|
|
|
3950
4268
|
if (text.includes("[ACTION:GITHUB_PUSH_REQUEST:")) {
|
|
3951
4269
|
console.log("");
|
|
3952
4270
|
console.log(GREEN(" \u2705 All tasks complete!"));
|
|
3953
|
-
console.log(
|
|
4271
|
+
console.log(AMBER3(" \u{1F4E4} MiniBob wants to push to GitHub."));
|
|
3954
4272
|
const rl = readline6.createInterface({ input: process.stdin, output: process.stdout });
|
|
3955
4273
|
const answer = await new Promise((resolve4) => {
|
|
3956
4274
|
rl.question(CYAN(" Approve push? (y/n): "), resolve4);
|
|
@@ -3988,7 +4306,7 @@ async function runTier3Autonomy(config, conversationId) {
|
|
|
3988
4306
|
}
|
|
3989
4307
|
console.log("");
|
|
3990
4308
|
console.log(BORDER4(" \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"));
|
|
3991
|
-
console.log(BORDER4(" \u2551") +
|
|
4309
|
+
console.log(BORDER4(" \u2551") + AMBER3(" \u25C6 AUTONOMY SESSION COMPLETE"));
|
|
3992
4310
|
console.log(BORDER4(" \u2560\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\u2563"));
|
|
3993
4311
|
console.log(BORDER4(" \u2551") + GREEN(` \u2705 Tasks completed: ${tasksDone}/${totalTasks}`));
|
|
3994
4312
|
console.log(BORDER4(" \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"));
|
|
@@ -4062,7 +4380,7 @@ async function runTier1Autonomy(config, options) {
|
|
|
4062
4380
|
console.log("");
|
|
4063
4381
|
console.log("");
|
|
4064
4382
|
console.log(BORDER4(" \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"));
|
|
4065
|
-
console.log(BORDER4(" \u2551") +
|
|
4383
|
+
console.log(BORDER4(" \u2551") + AMBER3(" \u25C6 MINIBOB AUTONOMY REPORT"));
|
|
4066
4384
|
console.log(BORDER4(" \u2560\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\u2563"));
|
|
4067
4385
|
console.log(BORDER4(" \u2551") + GREEN(` \u2705 Fixed: ${fixed} files`));
|
|
4068
4386
|
if (failed > 0) {
|
|
@@ -4123,7 +4441,7 @@ async function showAutonomyStatus(config, conversationId) {
|
|
|
4123
4441
|
spinner.stop();
|
|
4124
4442
|
if (result?.lines && result.lines.length > 0) {
|
|
4125
4443
|
console.log("");
|
|
4126
|
-
console.log(
|
|
4444
|
+
console.log(AMBER3(" \u25C6 Recent Autonomy Activity:"));
|
|
4127
4445
|
console.log(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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
4128
4446
|
for (const line of result.lines) {
|
|
4129
4447
|
console.log(GRAY(` ${line.text}`));
|
|
@@ -4241,7 +4559,7 @@ var lastLocalTodoLines = 0;
|
|
|
4241
4559
|
function renderLocalTodoList(queue) {
|
|
4242
4560
|
const lines = [];
|
|
4243
4561
|
lines.push("");
|
|
4244
|
-
lines.push(
|
|
4562
|
+
lines.push(AMBER3(" \u{1F4CB} MiniBob Autonomy Queue"));
|
|
4245
4563
|
lines.push(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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
4246
4564
|
for (let i = 0; i < queue.length; i++) {
|
|
4247
4565
|
const task = queue[i];
|
|
@@ -4255,7 +4573,7 @@ function renderLocalTodoList(queue) {
|
|
|
4255
4573
|
break;
|
|
4256
4574
|
case "working":
|
|
4257
4575
|
icon = "\u23F3";
|
|
4258
|
-
color =
|
|
4576
|
+
color = AMBER3;
|
|
4259
4577
|
break;
|
|
4260
4578
|
case "failed":
|
|
4261
4579
|
icon = "\u2717";
|
|
@@ -4306,7 +4624,7 @@ import * as path10 from "path";
|
|
|
4306
4624
|
import * as crypto2 from "crypto";
|
|
4307
4625
|
import axios from "axios";
|
|
4308
4626
|
var GREEN2 = chalk19.hex("#66BB6A");
|
|
4309
|
-
var
|
|
4627
|
+
var AMBER4 = chalk19.hex("#FFAB00");
|
|
4310
4628
|
var RED2 = chalk19.hex("#EF5350");
|
|
4311
4629
|
var GRAY2 = chalk19.gray;
|
|
4312
4630
|
var CYAN2 = chalk19.cyan;
|
|
@@ -4436,11 +4754,11 @@ function registerServeCommand(program2) {
|
|
|
4436
4754
|
console.log(GRAY2(` Your current tier: ${userTier}`));
|
|
4437
4755
|
console.log("");
|
|
4438
4756
|
if (isOrgUser) {
|
|
4439
|
-
console.log(
|
|
4757
|
+
console.log(AMBER4(" \u{1F3E2} Contact your organization administrator to upgrade your tier."));
|
|
4440
4758
|
console.log(GRAY2(` Organization: ${domain}`));
|
|
4441
4759
|
console.log(GRAY2(" Admin Dashboard: https://bobs-workshop.web.app/#/bobsadmindashboard"));
|
|
4442
4760
|
} else {
|
|
4443
|
-
console.log(
|
|
4761
|
+
console.log(AMBER4(" \u{1F680} Upgrade to unlock remote execution:"));
|
|
4444
4762
|
console.log("");
|
|
4445
4763
|
console.log(GRAY2(" Starter \u2014 15s polling, 15 min idle timeout"));
|
|
4446
4764
|
console.log(GRAY2(" Pro \u2014 10s polling, sleep mode, 1 hour idle timeout"));
|
|
@@ -4468,7 +4786,7 @@ async function startActiveBob(config, sessionId, machineId, projectName, tierCon
|
|
|
4468
4786
|
console.log(BORDER5(" \u2551") + GRAY2(` Project: ${projectName} (${process.cwd()})`));
|
|
4469
4787
|
console.log(BORDER5(" \u2551") + GRAY2(` Session: ${sessionId.slice(0, 30)}...`));
|
|
4470
4788
|
console.log(BORDER5(" \u2551") + GRAY2(` Convo: ${config.conversationId?.slice(0, 24)}...`));
|
|
4471
|
-
console.log(BORDER5(" \u2551") +
|
|
4789
|
+
console.log(BORDER5(" \u2551") + AMBER4(` Tier: ${userTier}`));
|
|
4472
4790
|
console.log(BORDER5(" \u2551") + GRAY2(` Polling: every ${tierConfig.activeInterval / 1e3}s`));
|
|
4473
4791
|
if (tierConfig.sleepInterval) {
|
|
4474
4792
|
console.log(BORDER5(" \u2551") + GRAY2(` Sleep: every ${tierConfig.sleepInterval / 1e3}s after ${tierConfig.idleThreshold / 6e4} min idle`));
|
|
@@ -4530,7 +4848,7 @@ async function startActiveBob(config, sessionId, machineId, projectName, tierCon
|
|
|
4530
4848
|
const timeSinceLastCommand = Date.now() - lastCommandTime;
|
|
4531
4849
|
if (tierConfig.extendedIdleTimeout && timeSinceLastCommand > tierConfig.extendedIdleTimeout) {
|
|
4532
4850
|
console.log("");
|
|
4533
|
-
console.log(
|
|
4851
|
+
console.log(AMBER4(` \u23F8\uFE0F No commands received in ${Math.round(tierConfig.extendedIdleTimeout / 6e4)} minutes.`));
|
|
4534
4852
|
console.log(GRAY2(" Active Bob is going offline. Run `bob serve` to restart."));
|
|
4535
4853
|
console.log("");
|
|
4536
4854
|
try {
|
|
@@ -4566,7 +4884,7 @@ async function startActiveBob(config, sessionId, machineId, projectName, tierCon
|
|
|
4566
4884
|
}
|
|
4567
4885
|
lastCommandTime = Date.now();
|
|
4568
4886
|
const timestamp = (/* @__PURE__ */ new Date()).toLocaleTimeString();
|
|
4569
|
-
console.log(
|
|
4887
|
+
console.log(AMBER4(` [${timestamp}] \u23F3 Received: ${type}${payload.message ? ` "${payload.message.slice(0, 40)}${payload.message.length > 40 ? "..." : ""}"` : ""}`));
|
|
4570
4888
|
const commandResult = await executeRemoteCommand(type, payload, config);
|
|
4571
4889
|
await callCloudFunction("completeRemoteCommand", {
|
|
4572
4890
|
conversationId: config.conversationId,
|
|
@@ -5437,7 +5755,7 @@ import ora10 from "ora";
|
|
|
5437
5755
|
// src/core/cloud-profiler.ts
|
|
5438
5756
|
import chalk21 from "chalk";
|
|
5439
5757
|
import ora8 from "ora";
|
|
5440
|
-
var
|
|
5758
|
+
var AMBER5 = chalk21.hex("#FFAB00");
|
|
5441
5759
|
var ORANGE = chalk21.hex("#E66F24");
|
|
5442
5760
|
var GREEN3 = chalk21.hex("#66BB6A");
|
|
5443
5761
|
var CYAN3 = chalk21.cyan;
|
|
@@ -5461,7 +5779,7 @@ function renderProgressBar(score, width = 30) {
|
|
|
5461
5779
|
function renderChunkBar(current, total, width = 30) {
|
|
5462
5780
|
const filled = Math.round(current / total * width);
|
|
5463
5781
|
const empty = width - filled;
|
|
5464
|
-
return
|
|
5782
|
+
return AMBER5("\u2588".repeat(filled)) + chalk21.hex("#333333")("\u2591".repeat(empty)) + GRAY3(` ${current}/${total}`);
|
|
5465
5783
|
}
|
|
5466
5784
|
function truncate2(text, max) {
|
|
5467
5785
|
if (!text) return "";
|
|
@@ -5508,7 +5826,7 @@ async function runCloudProfiler(options) {
|
|
|
5508
5826
|
throw new Error("Cloud profiling requires authentication. Run `bob login` first.");
|
|
5509
5827
|
}
|
|
5510
5828
|
console.log("");
|
|
5511
|
-
console.log(
|
|
5829
|
+
console.log(AMBER5(` \u{1F9EC} Running cloud ${scope} profiling (Power tier)...`));
|
|
5512
5830
|
console.log("");
|
|
5513
5831
|
const spinner = ora8({ text: CYAN3(" Initiating profiling job..."), spinner: "dots" }).start();
|
|
5514
5832
|
const startResult = await callCloudFunction("startCloudProfiling", {
|
|
@@ -5669,7 +5987,7 @@ async function runCloudProfiler(options) {
|
|
|
5669
5987
|
const archetype = archMatch ? archMatch[1].trim() : "profiled";
|
|
5670
5988
|
const description = descMatch ? truncate2(descMatch[1].trim(), 50) : "";
|
|
5671
5989
|
renderBox("\u{1F3AF}", "Stage 4: Decision Profile", [
|
|
5672
|
-
`${GRAY3("Archetype:")} ${
|
|
5990
|
+
`${GRAY3("Archetype:")} ${AMBER5(archetype)}`,
|
|
5673
5991
|
description ? `${GRAY3('"' + description + '"')}` : ""
|
|
5674
5992
|
].filter(Boolean));
|
|
5675
5993
|
stage4Rendered = true;
|
|
@@ -5720,7 +6038,7 @@ async function runCloudProfiler(options) {
|
|
|
5720
6038
|
const archetype = archMatch ? archMatch[1].trim() : "profiled";
|
|
5721
6039
|
const edge = edgeMatch ? parseInt(edgeMatch[1]) : 0;
|
|
5722
6040
|
renderBox("\u{1F3AF}", "Weekly Decision Profile", [
|
|
5723
|
-
`${GRAY3("Archetype:")} ${
|
|
6041
|
+
`${GRAY3("Archetype:")} ${AMBER5(archetype)}`,
|
|
5724
6042
|
`${GRAY3("Edge Score:")} ${renderProgressBar(edge)}`
|
|
5725
6043
|
]);
|
|
5726
6044
|
weeklyDecisionRendered = true;
|
|
@@ -5738,7 +6056,7 @@ async function runCloudProfiler(options) {
|
|
|
5738
6056
|
const synthMatch = msg.match(/Weekly synthesis complete: (.+)/);
|
|
5739
6057
|
const synthesis = synthMatch ? truncate2(synthMatch[1].trim(), 50) : "synthesized";
|
|
5740
6058
|
renderBox("\u{1F9EC}", "Weekly DNA Synthesis", [
|
|
5741
|
-
`${GRAY3("Archetype:")} ${
|
|
6059
|
+
`${GRAY3("Archetype:")} ${AMBER5(synthesis)}`,
|
|
5742
6060
|
`${GRAY3("Your weekly personality profile has been updated.")}`
|
|
5743
6061
|
]);
|
|
5744
6062
|
weeklySynthesisRendered = true;
|
|
@@ -5770,7 +6088,7 @@ async function runCloudProfiler(options) {
|
|
|
5770
6088
|
const archMatch = msg.match(/Monthly synthesis complete: (.+)/);
|
|
5771
6089
|
const archetype = archMatch ? truncate2(archMatch[1].trim(), 50) : "synthesized";
|
|
5772
6090
|
renderBox("\u{1F9EC}", "Monthly DNA Synthesis", [
|
|
5773
|
-
`${GRAY3("Monthly Archetype:")} ${
|
|
6091
|
+
`${GRAY3("Monthly Archetype:")} ${AMBER5(archetype)}`,
|
|
5774
6092
|
`${GRAY3("Your complete monthly personality profile is now active.")}`,
|
|
5775
6093
|
`${GRAY3("Bob will adapt to match your patterns going forward.")}`
|
|
5776
6094
|
]);
|
|
@@ -6098,7 +6416,7 @@ async function renderProfileDashboard() {
|
|
|
6098
6416
|
|
|
6099
6417
|
// src/commands/profile.ts
|
|
6100
6418
|
import * as path11 from "path";
|
|
6101
|
-
var
|
|
6419
|
+
var AMBER6 = chalk23.hex("#FFAB00");
|
|
6102
6420
|
var GREEN4 = chalk23.hex("#66BB6A");
|
|
6103
6421
|
var BLUE2 = chalk23.hex("#42A5F5");
|
|
6104
6422
|
var GRAY4 = chalk23.gray;
|
|
@@ -6156,7 +6474,7 @@ async function handleCloudProfile(scope) {
|
|
|
6156
6474
|
return;
|
|
6157
6475
|
}
|
|
6158
6476
|
console.log("");
|
|
6159
|
-
console.log(
|
|
6477
|
+
console.log(AMBER6(` \u{1F9EC} Running cloud ${scope} profiling (Power tier)...`));
|
|
6160
6478
|
console.log("");
|
|
6161
6479
|
try {
|
|
6162
6480
|
await runCloudProfiler({
|
|
@@ -6193,14 +6511,14 @@ function showCurrentProfile() {
|
|
|
6193
6511
|
const dna = loadCurrentDNA();
|
|
6194
6512
|
if (!dna) {
|
|
6195
6513
|
console.log("");
|
|
6196
|
-
console.log(
|
|
6514
|
+
console.log(AMBER6(" \u26A0\uFE0F No profile generated yet."));
|
|
6197
6515
|
console.log(GRAY4(" Run `bob profile --today` to generate your first profile."));
|
|
6198
6516
|
console.log("");
|
|
6199
6517
|
return;
|
|
6200
6518
|
}
|
|
6201
6519
|
console.log("");
|
|
6202
6520
|
console.log(BORDER9(" \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"));
|
|
6203
|
-
console.log(BORDER9(" \u2551") +
|
|
6521
|
+
console.log(BORDER9(" \u2551") + AMBER6(" \u{1F9EC} Your Current DNA Profile"));
|
|
6204
6522
|
console.log(BORDER9(" \u2560\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\u2563"));
|
|
6205
6523
|
console.log(BORDER9(" \u2551") + CYAN4(` Archetype: ${dna.archetype || "Unknown"}`));
|
|
6206
6524
|
console.log(BORDER9(" \u2551") + GRAY4(` Communication: ${dna.communicationStyle || "Unknown"}`));
|
|
@@ -6227,7 +6545,7 @@ async function generateDailyProfile(config) {
|
|
|
6227
6545
|
const messages = await getTodayMessages();
|
|
6228
6546
|
if (messages.length === 0) {
|
|
6229
6547
|
console.log("");
|
|
6230
|
-
console.log(
|
|
6548
|
+
console.log(AMBER6(" \u26A0\uFE0F No conversations found for today."));
|
|
6231
6549
|
console.log(GRAY4(" Chat with Bob first, then run this command."));
|
|
6232
6550
|
console.log("");
|
|
6233
6551
|
return;
|
|
@@ -6322,7 +6640,7 @@ IMPORTANT: Only include assessments you have EVIDENCE for. Use exact quotes from
|
|
|
6322
6640
|
saveDailyProfile(profile);
|
|
6323
6641
|
console.log("");
|
|
6324
6642
|
console.log(BORDER9(" \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"));
|
|
6325
|
-
console.log(BORDER9(" \u2551") +
|
|
6643
|
+
console.log(BORDER9(" \u2551") + AMBER6(` \u{1F9EC} Daily Profile \u2014 ${today}`));
|
|
6326
6644
|
console.log(BORDER9(" \u2560\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\u2563"));
|
|
6327
6645
|
console.log(BORDER9(" \u2551") + CYAN4(` Communication: ${parsed.communicationStyle?.tone || "Unknown"} (${parsed.communicationStyle?.confidence || 0}%)`));
|
|
6328
6646
|
console.log(BORDER9(" \u2551") + CYAN4(` Mentality: ${parsed.mentality?.approach || "Unknown"}, ${parsed.mentality?.optimism || ""} (${parsed.mentality?.confidence || 0}%)`));
|
|
@@ -6349,7 +6667,7 @@ async function generateWeeklyProfile(config) {
|
|
|
6349
6667
|
const dailies = loadDailyProfiles(7);
|
|
6350
6668
|
if (dailies.length === 0) {
|
|
6351
6669
|
console.log("");
|
|
6352
|
-
console.log(
|
|
6670
|
+
console.log(AMBER6(" \u26A0\uFE0F No daily profiles found."));
|
|
6353
6671
|
console.log(GRAY4(" Run `bob profile --today` for at least a few days first."));
|
|
6354
6672
|
console.log("");
|
|
6355
6673
|
return;
|
|
@@ -6411,7 +6729,7 @@ Use REAL quotes from the daily profiles as evidence. Show how the person CHANGED
|
|
|
6411
6729
|
saveWeeklyProfile(profile);
|
|
6412
6730
|
console.log("");
|
|
6413
6731
|
console.log(BORDER9(" \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"));
|
|
6414
|
-
console.log(BORDER9(" \u2551") +
|
|
6732
|
+
console.log(BORDER9(" \u2551") + AMBER6(` \u{1F9EC} Weekly Profile \u2014 ${weekId}`));
|
|
6415
6733
|
console.log(BORDER9(" \u2560\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\u2563"));
|
|
6416
6734
|
console.log(BORDER9(" \u2551") + CYAN4(` Trajectory: ${parsed.trajectory || "Unknown"}`));
|
|
6417
6735
|
console.log(BORDER9(" \u2551") + GRAY4(` Energy: ${parsed.energyPattern || "Unknown"}`));
|
|
@@ -6440,7 +6758,7 @@ async function generateMonthlyProfile(config) {
|
|
|
6440
6758
|
const weeklies = loadWeeklyProfiles(5);
|
|
6441
6759
|
if (dailies.length === 0 && weeklies.length === 0) {
|
|
6442
6760
|
console.log("");
|
|
6443
|
-
console.log(
|
|
6761
|
+
console.log(AMBER6(" \u26A0\uFE0F No profiles found for this month."));
|
|
6444
6762
|
console.log(GRAY4(" Run `bob profile --today` daily and `bob profile --week` weekly first."));
|
|
6445
6763
|
console.log("");
|
|
6446
6764
|
return;
|
|
@@ -6510,7 +6828,7 @@ Show the JOURNEY, not just the destination. Use real quotes as evidence for ever
|
|
|
6510
6828
|
saveMonthlyProfile(profile);
|
|
6511
6829
|
console.log("");
|
|
6512
6830
|
console.log(BORDER9(" \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"));
|
|
6513
|
-
console.log(BORDER9(" \u2551") +
|
|
6831
|
+
console.log(BORDER9(" \u2551") + AMBER6(` \u{1F9EC} Monthly Profile \u2014 ${monthId}`));
|
|
6514
6832
|
console.log(BORDER9(" \u2560\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\u2563"));
|
|
6515
6833
|
console.log(BORDER9(" \u2551") + CYAN4(` Archetype: ${parsed.personalitySnapshot?.archetype || "Unknown"}`));
|
|
6516
6834
|
console.log(BORDER9(" \u2551"));
|
|
@@ -6564,7 +6882,7 @@ var BRAND = chalk24.hex("#E66F24");
|
|
|
6564
6882
|
var CYAN5 = chalk24.cyan;
|
|
6565
6883
|
var GREEN5 = chalk24.hex("#66BB6A");
|
|
6566
6884
|
var RED5 = chalk24.hex("#EF5350");
|
|
6567
|
-
var
|
|
6885
|
+
var AMBER7 = chalk24.hex("#FFAB00");
|
|
6568
6886
|
var GRAY5 = chalk24.gray;
|
|
6569
6887
|
var BORDER10 = chalk24.hex("#455A64");
|
|
6570
6888
|
var BOB_DIR3 = path12.join(os3.homedir(), ".bob");
|
|
@@ -6632,19 +6950,19 @@ function normalizeFilePath(filePath) {
|
|
|
6632
6950
|
function handleBackupError(error) {
|
|
6633
6951
|
if (error.message?.includes("BOB_BACKUP_LICENSE_REQUIRED")) {
|
|
6634
6952
|
console.log("");
|
|
6635
|
-
console.log(
|
|
6953
|
+
console.log(AMBER7(" \u26A0\uFE0F No active backup license found."));
|
|
6636
6954
|
console.log(GRAY5(" Purchase one at: app.bobsworkshop.com/iap \u2192 Bob Backup"));
|
|
6637
6955
|
} else if (error.message?.includes("STORAGE_QUOTA_EXCEEDED")) {
|
|
6638
6956
|
console.log("");
|
|
6639
|
-
console.log(
|
|
6957
|
+
console.log(AMBER7(" \u26A0\uFE0F Storage quota exceeded."));
|
|
6640
6958
|
console.log(GRAY5(" Purchase a storage pack: app.bobsworkshop.com/iap \u2192 Storage Packs"));
|
|
6641
6959
|
} else if (error.message?.includes("ARCHIVE_SLOTS_EXHAUSTED")) {
|
|
6642
6960
|
console.log("");
|
|
6643
|
-
console.log(
|
|
6961
|
+
console.log(AMBER7(" \u26A0\uFE0F All archive slots are used."));
|
|
6644
6962
|
console.log(GRAY5(" Upgrade your Workshop SKU for more archive slots."));
|
|
6645
6963
|
} else if (error.message?.includes("GRID_REQUIRED")) {
|
|
6646
6964
|
console.log("");
|
|
6647
|
-
console.log(
|
|
6965
|
+
console.log(AMBER7(" \u26A0\uFE0F Global backup requires the Grid Workshop plan."));
|
|
6648
6966
|
console.log(GRAY5(" Upgrade at: app.bobsworkshop.com/iap \u2192 Workshop"));
|
|
6649
6967
|
} else {
|
|
6650
6968
|
console.log("");
|
|
@@ -6782,7 +7100,7 @@ async function runBackup(options) {
|
|
|
6782
7100
|
}
|
|
6783
7101
|
recordSpinner.succeed(GREEN5(" Recording usage ..."));
|
|
6784
7102
|
} catch {
|
|
6785
|
-
recordSpinner.warn(
|
|
7103
|
+
recordSpinner.warn(AMBER7(" Usage recording failed (non-fatal). Backup was saved."));
|
|
6786
7104
|
}
|
|
6787
7105
|
const now = (/* @__PURE__ */ new Date()).toLocaleString();
|
|
6788
7106
|
console.log(BORDER10(" \u2560\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\u2563"));
|
|
@@ -6907,7 +7225,7 @@ async function runSourceBackup(options) {
|
|
|
6907
7225
|
await callCloudFunction("cliBackupLicense", recordPayload);
|
|
6908
7226
|
recordSpinner.succeed(GREEN5(" Recording usage ..."));
|
|
6909
7227
|
} catch {
|
|
6910
|
-
recordSpinner.warn(
|
|
7228
|
+
recordSpinner.warn(AMBER7(" Usage recording failed (non-fatal). Backup was saved."));
|
|
6911
7229
|
}
|
|
6912
7230
|
const now = (/* @__PURE__ */ new Date()).toLocaleString();
|
|
6913
7231
|
console.log(BORDER10(" \u2560\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\u2563"));
|
|
@@ -7007,12 +7325,12 @@ function registerBackupCommand(program2) {
|
|
|
7007
7325
|
}
|
|
7008
7326
|
if (archives.length > 0) {
|
|
7009
7327
|
console.log(BORDER10(" \u2560\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\u2563"));
|
|
7010
|
-
console.log(BORDER10(" \u2551") +
|
|
7328
|
+
console.log(BORDER10(" \u2551") + AMBER7(" Named Archives"));
|
|
7011
7329
|
console.log(BORDER10(" \u2551") + GRAY5(" \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\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\u2500\u2500\u2500"));
|
|
7012
7330
|
for (const a of archives) {
|
|
7013
7331
|
const date = new Date(a.createdAt).toLocaleString();
|
|
7014
7332
|
const expires = new Date(a.expiresAt).toLocaleString();
|
|
7015
|
-
console.log(BORDER10(" \u2551") + ` \u{1F4CC} ${
|
|
7333
|
+
console.log(BORDER10(" \u2551") + ` \u{1F4CC} ${AMBER7(a.name.padEnd(24))} ${GRAY5(formatBytes(a.sizeGB * 1024 * 1024 * 1024))}`);
|
|
7016
7334
|
console.log(BORDER10(" \u2551") + GRAY5(` Created: ${date} | Expires: ${expires}`));
|
|
7017
7335
|
}
|
|
7018
7336
|
}
|
|
@@ -7059,7 +7377,7 @@ function registerBackupCommand(program2) {
|
|
|
7059
7377
|
if (versions.length === 0 && archives.length === 0) {
|
|
7060
7378
|
console.log("");
|
|
7061
7379
|
const scopeMsg = isSource ? filePath ? `file "${filePath}"` : `source of ${projectName}` : isGlobal ? "global" : projectName;
|
|
7062
|
-
console.log(
|
|
7380
|
+
console.log(AMBER7(` \u26A0\uFE0F No backups found for ${scopeMsg}.`));
|
|
7063
7381
|
console.log("");
|
|
7064
7382
|
return;
|
|
7065
7383
|
}
|
|
@@ -7075,11 +7393,11 @@ function registerBackupCommand(program2) {
|
|
|
7075
7393
|
}
|
|
7076
7394
|
}
|
|
7077
7395
|
if (archives.length > 0) {
|
|
7078
|
-
choices.push(new inquirer.Separator(
|
|
7396
|
+
choices.push(new inquirer.Separator(AMBER7(" \u2500\u2500 Named Archives \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\u2500\u2500\u2500")));
|
|
7079
7397
|
for (const a of archives) {
|
|
7080
7398
|
const date = new Date(a.createdAt).toLocaleString();
|
|
7081
7399
|
choices.push({
|
|
7082
|
-
name: ` \u{1F4CC} ${
|
|
7400
|
+
name: ` \u{1F4CC} ${AMBER7(a.name.padEnd(24))} ${GRAY5(date)}`,
|
|
7083
7401
|
value: { type: "archive", archiveId: a.archiveId, name: a.name }
|
|
7084
7402
|
});
|
|
7085
7403
|
}
|
|
@@ -7103,20 +7421,20 @@ function registerBackupCommand(program2) {
|
|
|
7103
7421
|
const label = selected.type === "archive" ? `archive "${selected.name}"` : selected.label;
|
|
7104
7422
|
console.log("");
|
|
7105
7423
|
if (isSource && filePath) {
|
|
7106
|
-
console.log(
|
|
7424
|
+
console.log(AMBER7(` \u26A0\uFE0F This will restore ${filePath} from ${label}.`));
|
|
7107
7425
|
console.log(GRAY5(" Current file will be backed up to .bob-backups/ first."));
|
|
7108
7426
|
} else if (isSource) {
|
|
7109
|
-
console.log(
|
|
7427
|
+
console.log(AMBER7(` \u26A0\uFE0F This will restore source code of ${projectName} from ${label}.`));
|
|
7110
7428
|
console.log(GRAY5(" Current project will be backed up locally first."));
|
|
7111
7429
|
} else {
|
|
7112
|
-
console.log(
|
|
7430
|
+
console.log(AMBER7(` \u26A0\uFE0F This will restore ${isGlobal ? "~/.bob/" : `~/.bob/projects/${projectName}/`} from ${label}.`));
|
|
7113
7431
|
console.log(GRAY5(" Your current data will be backed up locally first."));
|
|
7114
7432
|
}
|
|
7115
7433
|
console.log("");
|
|
7116
7434
|
const { confirmed } = await inquirer.prompt([{
|
|
7117
7435
|
type: "confirm",
|
|
7118
7436
|
name: "confirmed",
|
|
7119
|
-
message:
|
|
7437
|
+
message: AMBER7(" Continue with restore?"),
|
|
7120
7438
|
default: false
|
|
7121
7439
|
}]);
|
|
7122
7440
|
if (!confirmed) {
|
|
@@ -7515,7 +7833,7 @@ ${userMessage}`,
|
|
|
7515
7833
|
// src/ui/agent-renderer.ts
|
|
7516
7834
|
import chalk25 from "chalk";
|
|
7517
7835
|
var PURPLE = chalk25.hex("#AB47BC");
|
|
7518
|
-
var
|
|
7836
|
+
var AMBER8 = chalk25.hex("#FFAB00");
|
|
7519
7837
|
var GREEN6 = chalk25.hex("#66BB6A");
|
|
7520
7838
|
var RED6 = chalk25.hex("#EF5350");
|
|
7521
7839
|
var CYAN6 = chalk25.cyan;
|
|
@@ -7713,7 +8031,7 @@ function renderUnifiedMessages(messages, allAgentNames, options = {}) {
|
|
|
7713
8031
|
console.log("");
|
|
7714
8032
|
console.log(BORDER11(" \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"));
|
|
7715
8033
|
console.log(
|
|
7716
|
-
BORDER11(" \u2551") +
|
|
8034
|
+
BORDER11(" \u2551") + AMBER8(" \u{1F4CB} Messages") + GRAY6(
|
|
7717
8035
|
` ${totalMessages} total` + (options.filterAgent ? ` filter: @${options.filterAgent}` : "") + (options.search ? ` search: "${options.search}"` : "")
|
|
7718
8036
|
)
|
|
7719
8037
|
);
|
|
@@ -7813,7 +8131,7 @@ async function runMessagesView(agentNames, cwd, rl, initialFilter, initialSearch
|
|
|
7813
8131
|
render();
|
|
7814
8132
|
return new Promise((resolve4) => {
|
|
7815
8133
|
const messagesPrompt = () => {
|
|
7816
|
-
rl.question(
|
|
8134
|
+
rl.question(AMBER8(" Messages > "), async (input) => {
|
|
7817
8135
|
const trimmed = input.trim();
|
|
7818
8136
|
if (!trimmed) {
|
|
7819
8137
|
messagesPrompt();
|
|
@@ -7894,7 +8212,7 @@ async function runAgentHub(cwd) {
|
|
|
7894
8212
|
const registry = loadRegistry(cwd);
|
|
7895
8213
|
if (registry.agents.length === 0) {
|
|
7896
8214
|
console.log("");
|
|
7897
|
-
console.log(
|
|
8215
|
+
console.log(AMBER8(" \u26A0\uFE0F No agents found."));
|
|
7898
8216
|
console.log(GRAY6(' Spawn one first: bob agent spawn <name> "<task>"'));
|
|
7899
8217
|
console.log("");
|
|
7900
8218
|
return;
|
|
@@ -7951,7 +8269,7 @@ async function runAgentHub(cwd) {
|
|
|
7951
8269
|
}
|
|
7952
8270
|
if (parsed.type === "unknown") {
|
|
7953
8271
|
console.log("");
|
|
7954
|
-
console.log(
|
|
8272
|
+
console.log(AMBER8(" \u26A0\uFE0F Use @name to talk to an agent."));
|
|
7955
8273
|
console.log(GRAY6(` Available: ${agentNames.map((n) => `@${n}`).join(", ")}`));
|
|
7956
8274
|
console.log(GRAY6(" Or use @all to broadcast to everyone."));
|
|
7957
8275
|
console.log("");
|
|
@@ -7959,7 +8277,7 @@ async function runAgentHub(cwd) {
|
|
|
7959
8277
|
return;
|
|
7960
8278
|
}
|
|
7961
8279
|
if (!parsed.message) {
|
|
7962
|
-
console.log(
|
|
8280
|
+
console.log(AMBER8(" \u26A0\uFE0F Message cannot be empty."));
|
|
7963
8281
|
prompt();
|
|
7964
8282
|
return;
|
|
7965
8283
|
}
|
|
@@ -7982,7 +8300,7 @@ async function runAgentHub(cwd) {
|
|
|
7982
8300
|
renderAgentResponse(targetName, result.response, agentColor);
|
|
7983
8301
|
if (result.summaryGenerated && result.summary) {
|
|
7984
8302
|
console.log("");
|
|
7985
|
-
console.log(
|
|
8303
|
+
console.log(AMBER8(` \u{1F9EC} @${targetName} session summarized (${result.messageCount} messages)`));
|
|
7986
8304
|
console.log(GRAY6(" Summary saved. Other agents will see this context."));
|
|
7987
8305
|
console.log(GRAY6(" View with: /summary"));
|
|
7988
8306
|
}
|
|
@@ -8172,7 +8490,7 @@ async function runAgentChat(agentName, cwd, initialSearch) {
|
|
|
8172
8490
|
const summary = loadAgentSummary2(agentName, cwd);
|
|
8173
8491
|
console.log("");
|
|
8174
8492
|
if (summary) {
|
|
8175
|
-
console.log(
|
|
8493
|
+
console.log(AMBER8(` \u{1F9EC} @${agentName} Summary`));
|
|
8176
8494
|
console.log(GRAY6(" \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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
8177
8495
|
const lines = summary.split("\n").filter((l) => l.trim());
|
|
8178
8496
|
for (const line of lines) {
|
|
@@ -8240,7 +8558,7 @@ async function runAgentChat(agentName, cwd, initialSearch) {
|
|
|
8240
8558
|
renderAgentResponse(agentName, result.response, agentColor);
|
|
8241
8559
|
if (result.summaryGenerated && result.summary) {
|
|
8242
8560
|
console.log("");
|
|
8243
|
-
console.log(
|
|
8561
|
+
console.log(AMBER8(` \u{1F9EC} Session summarized (${result.messageCount} messages)`));
|
|
8244
8562
|
const lines = result.summary.split("\n").filter((l) => l.trim()).slice(0, 5);
|
|
8245
8563
|
for (const line of lines) {
|
|
8246
8564
|
console.log(GRAY6(` ${line.slice(0, 62)}`));
|
|
@@ -8263,7 +8581,7 @@ async function runAgentChat(agentName, cwd, initialSearch) {
|
|
|
8263
8581
|
|
|
8264
8582
|
// src/commands/agent.ts
|
|
8265
8583
|
var PURPLE3 = chalk28.hex("#AB47BC");
|
|
8266
|
-
var
|
|
8584
|
+
var AMBER9 = chalk28.hex("#FFAB00");
|
|
8267
8585
|
var GREEN8 = chalk28.hex("#66BB6A");
|
|
8268
8586
|
var RED7 = chalk28.hex("#EF5350");
|
|
8269
8587
|
var CYAN8 = chalk28.cyan;
|
|
@@ -8295,7 +8613,7 @@ function statusIcon(status) {
|
|
|
8295
8613
|
case "active":
|
|
8296
8614
|
return GREEN8("\u25CF");
|
|
8297
8615
|
case "idle":
|
|
8298
|
-
return
|
|
8616
|
+
return AMBER9("\u25CF");
|
|
8299
8617
|
case "stopped":
|
|
8300
8618
|
return GRAY7("\u25CB");
|
|
8301
8619
|
default:
|
|
@@ -8307,7 +8625,7 @@ function statusLabel(status) {
|
|
|
8307
8625
|
case "active":
|
|
8308
8626
|
return GREEN8("ACTIVE");
|
|
8309
8627
|
case "idle":
|
|
8310
|
-
return
|
|
8628
|
+
return AMBER9("IDLE");
|
|
8311
8629
|
case "stopped":
|
|
8312
8630
|
return GRAY7("STOPPED");
|
|
8313
8631
|
default:
|
|
@@ -8503,7 +8821,7 @@ function registerAgentCommand(program2) {
|
|
|
8503
8821
|
}
|
|
8504
8822
|
if (summary) {
|
|
8505
8823
|
console.log(BORDER12(" \u2502"));
|
|
8506
|
-
console.log(BORDER12(" \u2502") +
|
|
8824
|
+
console.log(BORDER12(" \u2502") + AMBER9(" Last Summary:"));
|
|
8507
8825
|
const summaryLines = summary.split("\n").filter((l) => l.trim()).slice(0, 4);
|
|
8508
8826
|
for (const line of summaryLines) {
|
|
8509
8827
|
console.log(
|
|
@@ -8540,7 +8858,7 @@ function registerAgentCommand(program2) {
|
|
|
8540
8858
|
const session = loadSession(name, cwd);
|
|
8541
8859
|
console.log("");
|
|
8542
8860
|
console.log(BORDER12(" \u250C\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\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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"));
|
|
8543
|
-
console.log(BORDER12(" \u2502") +
|
|
8861
|
+
console.log(BORDER12(" \u2502") + AMBER9(` \u26A0\uFE0F WARNING: Reset @${name}`));
|
|
8544
8862
|
console.log(BORDER12(" \u2502"));
|
|
8545
8863
|
console.log(BORDER12(" \u2502") + RED7(" This will permanently delete:"));
|
|
8546
8864
|
console.log(BORDER12(" \u2502") + GRAY7(` \u2022 ${session?.messageCount || 0} messages of conversation history`));
|
|
@@ -8555,7 +8873,7 @@ function registerAgentCommand(program2) {
|
|
|
8555
8873
|
const { confirmed } = await inquirer2.prompt([{
|
|
8556
8874
|
type: "input",
|
|
8557
8875
|
name: "confirmed",
|
|
8558
|
-
message:
|
|
8876
|
+
message: AMBER9(` Type "@${name}" to confirm reset:`),
|
|
8559
8877
|
validate: (v) => v.trim() === `@${name}` || v.trim() === name ? true : `Type @${name} to confirm.`
|
|
8560
8878
|
}]);
|
|
8561
8879
|
if (confirmed.trim() !== `@${name}` && confirmed.trim() !== name) {
|
|
@@ -8583,7 +8901,7 @@ function registerAgentCommand(program2) {
|
|
|
8583
8901
|
}, 0);
|
|
8584
8902
|
console.log("");
|
|
8585
8903
|
console.log(BORDER12(" \u250C\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\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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"));
|
|
8586
|
-
console.log(BORDER12(" \u2502") +
|
|
8904
|
+
console.log(BORDER12(" \u2502") + AMBER9(" \u26A0\uFE0F WARNING: Reset ALL Agents"));
|
|
8587
8905
|
console.log(BORDER12(" \u2502"));
|
|
8588
8906
|
console.log(BORDER12(" \u2502") + RED7(" This will permanently delete:"));
|
|
8589
8907
|
console.log(BORDER12(" \u2502") + GRAY7(` \u2022 ${registry.agents.length} agents`));
|
|
@@ -8597,7 +8915,7 @@ function registerAgentCommand(program2) {
|
|
|
8597
8915
|
const { confirmed } = await inquirer2.prompt([{
|
|
8598
8916
|
type: "confirm",
|
|
8599
8917
|
name: "confirmed",
|
|
8600
|
-
message:
|
|
8918
|
+
message: AMBER9(" Reset ALL agents?"),
|
|
8601
8919
|
default: false
|
|
8602
8920
|
}]);
|
|
8603
8921
|
if (!confirmed) {
|
|
@@ -8640,7 +8958,7 @@ function registerAgentCommand(program2) {
|
|
|
8640
8958
|
}
|
|
8641
8959
|
console.log("");
|
|
8642
8960
|
console.log(BORDER12(" \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"));
|
|
8643
|
-
console.log(BORDER12(" \u2551") +
|
|
8961
|
+
console.log(BORDER12(" \u2551") + AMBER9(" \u{1F4CB} Agent Summary"));
|
|
8644
8962
|
console.log(BORDER12(" \u2560\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\u2563"));
|
|
8645
8963
|
for (const agent of registry.agents) {
|
|
8646
8964
|
const summary = loadAgentSummary(agent.name, cwd);
|
|
@@ -10525,7 +10843,7 @@ import * as fs17 from "fs";
|
|
|
10525
10843
|
import * as path21 from "path";
|
|
10526
10844
|
import { diffLines as diffLines2 } from "diff";
|
|
10527
10845
|
var PURPLE4 = chalk29.hex("#AB47BC");
|
|
10528
|
-
var
|
|
10846
|
+
var AMBER10 = chalk29.hex("#FFAB00");
|
|
10529
10847
|
var GREEN9 = chalk29.hex("#66BB6A");
|
|
10530
10848
|
var RED8 = chalk29.hex("#EF5350");
|
|
10531
10849
|
var CYAN9 = chalk29.cyan;
|
|
@@ -10568,7 +10886,7 @@ function renderMissionHeader(mission, agentNames) {
|
|
|
10568
10886
|
console.log(BORDER13(" \u2551"));
|
|
10569
10887
|
console.log(BORDER13(" \u2551") + ` ${chips}`);
|
|
10570
10888
|
console.log(BORDER13(" \u2560\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\u2563"));
|
|
10571
|
-
console.log(BORDER13(" \u2551") +
|
|
10889
|
+
console.log(BORDER13(" \u2551") + AMBER10(" Live Commands:"));
|
|
10572
10890
|
console.log(BORDER13(" \u2551") + CYAN9(" /pause") + GRAY8(" \u2014 pause after active tasks"));
|
|
10573
10891
|
console.log(BORDER13(" \u2551") + CYAN9(" /resume") + GRAY8(" \u2014 resume from pause"));
|
|
10574
10892
|
console.log(BORDER13(" \u2551") + CYAN9(" /status") + GRAY8(" \u2014 full task map"));
|
|
@@ -10586,7 +10904,7 @@ function renderTaskMap(mission, agentNames) {
|
|
|
10586
10904
|
const summary = getMissionSummary(mission);
|
|
10587
10905
|
console.log("");
|
|
10588
10906
|
console.log(DIRECTOR_COLOR(" \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"));
|
|
10589
|
-
console.log(DIRECTOR_COLOR(" \u2551") +
|
|
10907
|
+
console.log(DIRECTOR_COLOR(" \u2551") + AMBER10(" \u{1F4CB} Task Map") + GRAY8(` \u2014 ${summary.total} tasks`));
|
|
10590
10908
|
console.log(DIRECTOR_COLOR(" \u2560\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\u2563"));
|
|
10591
10909
|
const running = mission.tasks.filter((t) => t.status === "running");
|
|
10592
10910
|
const pending = mission.tasks.filter((t) => t.status === "pending");
|
|
@@ -10702,7 +11020,7 @@ function renderExecutionEvent(event, agentNames) {
|
|
|
10702
11020
|
const toolName = event.data?.tool || "unknown";
|
|
10703
11021
|
const toolColors = {
|
|
10704
11022
|
createFile: GREEN9,
|
|
10705
|
-
modifyFile:
|
|
11023
|
+
modifyFile: AMBER10,
|
|
10706
11024
|
readFile: CYAN9,
|
|
10707
11025
|
writeOutput: BLUE4,
|
|
10708
11026
|
readAgentOutput: BLUE4,
|
|
@@ -10757,7 +11075,7 @@ async function renderPostMissionFeedback(mission, cwd) {
|
|
|
10757
11075
|
const os9 = await import("os");
|
|
10758
11076
|
console.log("");
|
|
10759
11077
|
console.log(DIRECTOR_COLOR(" \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"));
|
|
10760
|
-
console.log(DIRECTOR_COLOR(" \u2551") +
|
|
11078
|
+
console.log(DIRECTOR_COLOR(" \u2551") + AMBER10(" \u{1F4DD} Mission Feedback \u2014 Help train the agents"));
|
|
10761
11079
|
console.log(DIRECTOR_COLOR(" \u2560\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\u2563"));
|
|
10762
11080
|
console.log(DIRECTOR_COLOR(" \u2551") + GRAY8(" Your feedback improves future missions."));
|
|
10763
11081
|
console.log(DIRECTOR_COLOR(" \u2551") + GRAY8(" Press Enter to skip any task."));
|
|
@@ -10770,7 +11088,7 @@ async function renderPostMissionFeedback(mission, cwd) {
|
|
|
10770
11088
|
const chip = renderAgentChip(task.assignedTo, mission.tasks.map((t) => t.assignedTo), true);
|
|
10771
11089
|
console.log(` ${chip} ${GRAY8(task.instruction.slice(0, 60))}`);
|
|
10772
11090
|
const rating = await new Promise((resolve4) => {
|
|
10773
|
-
rl.question(
|
|
11091
|
+
rl.question(AMBER10(" Rate (\u{1F44D} good / \u{1F44E} bad / skip): "), resolve4);
|
|
10774
11092
|
});
|
|
10775
11093
|
const trimmed = rating.trim().toLowerCase();
|
|
10776
11094
|
if (trimmed === "" || trimmed === "skip") {
|
|
@@ -10862,7 +11180,7 @@ async function renderPostMissionCommitPrompt(mission, cwd) {
|
|
|
10862
11180
|
if (totalFiles === 0) return;
|
|
10863
11181
|
console.log("");
|
|
10864
11182
|
console.log(BORDER13(" \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"));
|
|
10865
|
-
console.log(BORDER13(" \u2551") +
|
|
11183
|
+
console.log(BORDER13(" \u2551") + AMBER10(" \u{1F4E6} Mission Changes \u2014 Ready to Commit"));
|
|
10866
11184
|
console.log(BORDER13(" \u2560\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\u2563"));
|
|
10867
11185
|
console.log("");
|
|
10868
11186
|
for (const filePath of allCreated) {
|
|
@@ -10927,7 +11245,7 @@ async function renderPostMissionCommitPrompt(mission, cwd) {
|
|
|
10927
11245
|
output: process.stdout
|
|
10928
11246
|
});
|
|
10929
11247
|
const answer = await new Promise((resolve4) => {
|
|
10930
|
-
rl.question(
|
|
11248
|
+
rl.question(AMBER10(" Commit these changes? (y/n): "), resolve4);
|
|
10931
11249
|
});
|
|
10932
11250
|
if (answer.trim().toLowerCase() !== "y" && answer.trim().toLowerCase() !== "yes") {
|
|
10933
11251
|
rl.close();
|
|
@@ -10937,7 +11255,7 @@ async function renderPostMissionCommitPrompt(mission, cwd) {
|
|
|
10937
11255
|
}
|
|
10938
11256
|
const defaultMessage = `feat(agents): ${mission.description.slice(0, 60)}`;
|
|
10939
11257
|
const messageAnswer = await new Promise((resolve4) => {
|
|
10940
|
-
rl.question(
|
|
11258
|
+
rl.question(AMBER10(` Commit message (Enter for default: "${defaultMessage.slice(0, 40)}..."): `), resolve4);
|
|
10941
11259
|
});
|
|
10942
11260
|
rl.close();
|
|
10943
11261
|
const commitMessage = messageAnswer.trim() || defaultMessage;
|
|
@@ -10965,7 +11283,7 @@ function handleRunCommand(input, state, mission, cwd) {
|
|
|
10965
11283
|
const trimmed = input.trim();
|
|
10966
11284
|
if (trimmed === "/pause") {
|
|
10967
11285
|
state.paused = true;
|
|
10968
|
-
return { handled: true, message:
|
|
11286
|
+
return { handled: true, message: AMBER10(" \u23F8\uFE0F Pausing after active tasks complete...") };
|
|
10969
11287
|
}
|
|
10970
11288
|
if (trimmed === "/resume") {
|
|
10971
11289
|
state.paused = false;
|
|
@@ -10989,7 +11307,7 @@ function handleRunCommand(input, state, mission, cwd) {
|
|
|
10989
11307
|
}
|
|
10990
11308
|
if (trimmed === "/view-targets") {
|
|
10991
11309
|
const lines = [""];
|
|
10992
|
-
lines.push(
|
|
11310
|
+
lines.push(AMBER10(" Satisfaction Targets:"));
|
|
10993
11311
|
lines.push(GRAY8(" \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\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\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
10994
11312
|
for (const task of mission.tasks) {
|
|
10995
11313
|
const statusIcon2 = getTaskStatusIcon(task.status);
|
|
@@ -11046,7 +11364,7 @@ function getTaskStatusIcon(status) {
|
|
|
11046
11364
|
|
|
11047
11365
|
// src/commands/agent-run.ts
|
|
11048
11366
|
init_agent_tools();
|
|
11049
|
-
var
|
|
11367
|
+
var AMBER11 = chalk30.hex("#FFAB00");
|
|
11050
11368
|
var GREEN10 = chalk30.hex("#66BB6A");
|
|
11051
11369
|
var RED9 = chalk30.hex("#EF5350");
|
|
11052
11370
|
var CYAN10 = chalk30.cyan;
|
|
@@ -11065,7 +11383,7 @@ function registerAgentRunCommand(program2) {
|
|
|
11065
11383
|
const registry = loadRegistry(cwd);
|
|
11066
11384
|
if (registry.agents.length === 0) {
|
|
11067
11385
|
console.log("");
|
|
11068
|
-
console.log(
|
|
11386
|
+
console.log(AMBER11(" \u26A0\uFE0F No agents found."));
|
|
11069
11387
|
console.log(GRAY9(' Spawn agents first: bob agent spawn <name> "<task>"'));
|
|
11070
11388
|
console.log("");
|
|
11071
11389
|
return;
|
|
@@ -11075,7 +11393,7 @@ function registerAgentRunCommand(program2) {
|
|
|
11075
11393
|
);
|
|
11076
11394
|
if (agents.length === 0) {
|
|
11077
11395
|
console.log("");
|
|
11078
|
-
console.log(
|
|
11396
|
+
console.log(AMBER11(" \u26A0\uFE0F No active agents found."));
|
|
11079
11397
|
console.log("");
|
|
11080
11398
|
return;
|
|
11081
11399
|
}
|
|
@@ -11083,7 +11401,7 @@ function registerAgentRunCommand(program2) {
|
|
|
11083
11401
|
const activeMissionId = getActiveMissionId(cwd);
|
|
11084
11402
|
if (!activeMissionId) {
|
|
11085
11403
|
console.log("");
|
|
11086
|
-
console.log(
|
|
11404
|
+
console.log(AMBER11(" \u26A0\uFE0F No active mission to resume."));
|
|
11087
11405
|
console.log("");
|
|
11088
11406
|
return;
|
|
11089
11407
|
}
|
|
@@ -11095,7 +11413,7 @@ function registerAgentRunCommand(program2) {
|
|
|
11095
11413
|
return;
|
|
11096
11414
|
}
|
|
11097
11415
|
console.log("");
|
|
11098
|
-
console.log(
|
|
11416
|
+
console.log(AMBER11(` \u{1F504} Resuming mission: ${existingMission.description.slice(0, 50)}...`));
|
|
11099
11417
|
await executeMission(existingMission, agents, cwd, config.localEndpoint, options);
|
|
11100
11418
|
return;
|
|
11101
11419
|
}
|
|
@@ -11106,7 +11424,7 @@ function registerAgentRunCommand(program2) {
|
|
|
11106
11424
|
output: process.stdout
|
|
11107
11425
|
});
|
|
11108
11426
|
missionDescription = await new Promise((resolve4) => {
|
|
11109
|
-
rl.question(
|
|
11427
|
+
rl.question(AMBER11(" \u{1F3AC} What is the mission? > "), resolve4);
|
|
11110
11428
|
});
|
|
11111
11429
|
rl.close();
|
|
11112
11430
|
if (!missionDescription.trim()) {
|
|
@@ -11118,7 +11436,7 @@ function registerAgentRunCommand(program2) {
|
|
|
11118
11436
|
clearAllPendingCommits(cwd);
|
|
11119
11437
|
console.log("");
|
|
11120
11438
|
const planSpinner = ora13({
|
|
11121
|
-
text:
|
|
11439
|
+
text: AMBER11(" \u{1F3AC} DirectorBob is analyzing your team and building the task map..."),
|
|
11122
11440
|
spinner: "dots"
|
|
11123
11441
|
}).start();
|
|
11124
11442
|
let taskDefs;
|
|
@@ -11175,7 +11493,7 @@ function registerAgentRunCommand(program2) {
|
|
|
11175
11493
|
console.log("");
|
|
11176
11494
|
return;
|
|
11177
11495
|
}
|
|
11178
|
-
console.log(
|
|
11496
|
+
console.log(AMBER11(" Starting in 3 seconds... (Ctrl+C to abort)"));
|
|
11179
11497
|
await new Promise((r) => setTimeout(r, 3e3));
|
|
11180
11498
|
await executeMission(mission, agents, cwd, config.localEndpoint, options);
|
|
11181
11499
|
});
|
|
@@ -11254,7 +11572,7 @@ async function executeMission(mission, agents, cwd, localEndpoint, options) {
|
|
|
11254
11572
|
console.log("");
|
|
11255
11573
|
} else if (result.surfacedToUser) {
|
|
11256
11574
|
console.log("");
|
|
11257
|
-
console.log(
|
|
11575
|
+
console.log(AMBER11(" \u26A0\uFE0F Mission needs your attention."));
|
|
11258
11576
|
console.log(RED9(` Reason: ${result.surfaceReason}`));
|
|
11259
11577
|
console.log("");
|
|
11260
11578
|
console.log(GRAY9(" Options:"));
|
|
@@ -11278,7 +11596,7 @@ import * as fs18 from "fs";
|
|
|
11278
11596
|
import * as path22 from "path";
|
|
11279
11597
|
import * as os8 from "os";
|
|
11280
11598
|
var PURPLE5 = chalk31.hex("#AB47BC");
|
|
11281
|
-
var
|
|
11599
|
+
var AMBER12 = chalk31.hex("#FFAB00");
|
|
11282
11600
|
var GREEN11 = chalk31.hex("#66BB6A");
|
|
11283
11601
|
var CYAN11 = chalk31.hex("#26C6DA");
|
|
11284
11602
|
var RED10 = chalk31.hex("#EF5350");
|
|
@@ -11312,7 +11630,7 @@ function clearSessionFile() {
|
|
|
11312
11630
|
if (fs18.existsSync(filePath)) fs18.unlinkSync(filePath);
|
|
11313
11631
|
}
|
|
11314
11632
|
function renderHUD(sat, target, stag, stagTarget, div, divTarget, grading) {
|
|
11315
|
-
const satBar = sat >= target ? GREEN11(`${sat}%`) : sat >= target * 0.7 ?
|
|
11633
|
+
const satBar = sat >= target ? GREEN11(`${sat}%`) : sat >= target * 0.7 ? AMBER12(`${sat}%`) : RED10(`${sat}%`);
|
|
11316
11634
|
console.log("");
|
|
11317
11635
|
console.log(BORDER14(" \u2500\u2500\u2500 MISSION CONTROL \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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
11318
11636
|
console.log(
|
|
@@ -11395,7 +11713,7 @@ async function handleSlashCommand(input, config, conversationId) {
|
|
|
11395
11713
|
const response = await callCloudFunction("getCLIConversationMessages", { conversationId, since: null });
|
|
11396
11714
|
const state = response?.state || {};
|
|
11397
11715
|
console.log("");
|
|
11398
|
-
console.log(
|
|
11716
|
+
console.log(AMBER12(" \u2500\u2500\u2500 Current Parameters \u2500\u2500\u2500"));
|
|
11399
11717
|
console.log(GRAY10(` Target Satisfaction : ${state.targetSatisfaction ?? "N/A"}`));
|
|
11400
11718
|
console.log(GRAY10(` Grading Standard : ${state.gradingStandard ?? "N/A"}`));
|
|
11401
11719
|
console.log(GRAY10(` Current Satisfaction: ${state.currentSatisfaction ?? "N/A"}`));
|
|
@@ -11478,13 +11796,13 @@ async function runPlatformSimulation(config, conversationId, mission, params) {
|
|
|
11478
11796
|
console.log(GRAY10(" Messages will stream below as Bob and UserBob interact."));
|
|
11479
11797
|
console.log(GRAY10(" You can type commands at any time:"));
|
|
11480
11798
|
console.log("");
|
|
11481
|
-
console.log(
|
|
11482
|
-
console.log(
|
|
11483
|
-
console.log(
|
|
11484
|
-
console.log(
|
|
11485
|
-
console.log(
|
|
11486
|
-
console.log(
|
|
11487
|
-
console.log(
|
|
11799
|
+
console.log(AMBER12(" /abort") + GRAY10(" \u2014 Stop the simulation immediately"));
|
|
11800
|
+
console.log(AMBER12(" /set target 90") + GRAY10(" \u2014 Update satisfaction target"));
|
|
11801
|
+
console.log(AMBER12(" /set grading 70") + GRAY10(" \u2014 Update Teacher's Curve"));
|
|
11802
|
+
console.log(AMBER12(" /set stag 5") + GRAY10(" \u2014 Update stalemate threshold"));
|
|
11803
|
+
console.log(AMBER12(" /set div 3") + GRAY10(" \u2014 Update divergence threshold"));
|
|
11804
|
+
console.log(AMBER12(' /inject "note"') + GRAY10(" \u2014 Inject a director's note mid-session"));
|
|
11805
|
+
console.log(AMBER12(" /status") + GRAY10(" \u2014 Show current simulation parameters"));
|
|
11488
11806
|
console.log("");
|
|
11489
11807
|
console.log(BORDER14(" \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\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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
11490
11808
|
console.log("");
|
|
@@ -11495,7 +11813,7 @@ async function runPlatformSimulation(config, conversationId, mission, params) {
|
|
|
11495
11813
|
if (!running) return;
|
|
11496
11814
|
running = false;
|
|
11497
11815
|
console.log("\n");
|
|
11498
|
-
console.log(
|
|
11816
|
+
console.log(AMBER12(" \u{1F6D1} Aborting simulation..."));
|
|
11499
11817
|
try {
|
|
11500
11818
|
await callHTTPFunction("userSimManagerService", {
|
|
11501
11819
|
action: "abortMission",
|
|
@@ -11516,7 +11834,7 @@ async function runPlatformSimulation(config, conversationId, mission, params) {
|
|
|
11516
11834
|
if (!trimmed) return;
|
|
11517
11835
|
if (trimmed === "/abort" || trimmed === "abort") {
|
|
11518
11836
|
running = false;
|
|
11519
|
-
console.log(
|
|
11837
|
+
console.log(AMBER12(" \u{1F6D1} Aborting simulation..."));
|
|
11520
11838
|
try {
|
|
11521
11839
|
await callHTTPFunction("userSimManagerService", {
|
|
11522
11840
|
action: "abortMission",
|
|
@@ -11563,7 +11881,7 @@ async function runPlatformSimulation(config, conversationId, mission, params) {
|
|
|
11563
11881
|
renderHUD(hudState.sat, hudState.target, hudState.stag, hudState.stagTarget, hudState.div, hudState.divTarget, hudState.grading);
|
|
11564
11882
|
}
|
|
11565
11883
|
console.log("");
|
|
11566
|
-
console.log(
|
|
11884
|
+
console.log(AMBER12(` \u{1F3C1} Simulation ended: ${state.simulationStatus || "INACTIVE"}`));
|
|
11567
11885
|
console.log("");
|
|
11568
11886
|
running = false;
|
|
11569
11887
|
break;
|
|
@@ -11591,7 +11909,7 @@ async function runLocalSimulation(config, dnaString, mission, params) {
|
|
|
11591
11909
|
running = false;
|
|
11592
11910
|
writeSessionFile({ active: false });
|
|
11593
11911
|
clearSessionFile();
|
|
11594
|
-
console.log("\n" +
|
|
11912
|
+
console.log("\n" + AMBER12(" \u{1F6D1} Simulation stopped."));
|
|
11595
11913
|
process.exit(0);
|
|
11596
11914
|
};
|
|
11597
11915
|
process.on("SIGINT", sigintHandler);
|
|
@@ -11603,7 +11921,7 @@ async function runLocalSimulation(config, dnaString, mission, params) {
|
|
|
11603
11921
|
running = false;
|
|
11604
11922
|
writeSessionFile({ active: false });
|
|
11605
11923
|
clearSessionFile();
|
|
11606
|
-
console.log(
|
|
11924
|
+
console.log(AMBER12(" \u{1F6D1} Simulation stopped."));
|
|
11607
11925
|
rl.close();
|
|
11608
11926
|
process.exit(0);
|
|
11609
11927
|
}
|
|
@@ -11620,7 +11938,7 @@ async function runLocalSimulation(config, dnaString, mission, params) {
|
|
|
11620
11938
|
}
|
|
11621
11939
|
if (t === "/status") {
|
|
11622
11940
|
console.log("");
|
|
11623
|
-
console.log(
|
|
11941
|
+
console.log(AMBER12(" \u2500\u2500\u2500 Local Sim Parameters \u2500\u2500\u2500"));
|
|
11624
11942
|
console.log(GRAY10(` Target: ${params.target} \u2502 Grading: ${params.grading} \u2502 Stag Limit: ${params.stag} \u2502 Div Limit: ${params.div}`));
|
|
11625
11943
|
console.log(GRAY10(` Current SAT: ${sat} \u2502 Turns: ${turns} \u2502 Stag: ${stalemateCurrent} \u2502 Div: ${divergenceCurrent}`));
|
|
11626
11944
|
console.log("");
|
|
@@ -11643,12 +11961,12 @@ After each Bob response, evaluate it 0-100 on mission alignment. Reply with your
|
|
|
11643
11961
|
console.log(BORDER14(" \u2500\u2500\u2500 LIVE LOCAL SIMULATION \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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
11644
11962
|
console.log(GRAY10(" Bob and UserBob will converse autonomously below."));
|
|
11645
11963
|
console.log(GRAY10(" Commands:"));
|
|
11646
|
-
console.log(
|
|
11647
|
-
console.log(
|
|
11648
|
-
console.log(
|
|
11649
|
-
console.log(
|
|
11650
|
-
console.log(
|
|
11651
|
-
console.log(
|
|
11964
|
+
console.log(AMBER12(" /abort") + GRAY10(" \u2014 Stop the simulation"));
|
|
11965
|
+
console.log(AMBER12(" /set target 90") + GRAY10(" \u2014 Update satisfaction target"));
|
|
11966
|
+
console.log(AMBER12(" /set grading 70") + GRAY10(" \u2014 Update Teacher's Curve"));
|
|
11967
|
+
console.log(AMBER12(" /set stag 5") + GRAY10(" \u2014 Update stalemate threshold"));
|
|
11968
|
+
console.log(AMBER12(" /set div 3") + GRAY10(" \u2014 Update divergence threshold"));
|
|
11969
|
+
console.log(AMBER12(" /status") + GRAY10(" \u2014 Show current parameters"));
|
|
11652
11970
|
console.log(BORDER14(" \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\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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
11653
11971
|
console.log("");
|
|
11654
11972
|
const kickstart = `Mission received: "${mission}". Bob, what's your first move?`;
|
|
@@ -11690,7 +12008,7 @@ After each Bob response, evaluate it 0-100 on mission alignment. Reply with your
|
|
|
11690
12008
|
if (params.stag > 0 && stalemateCurrent >= params.stag) {
|
|
11691
12009
|
console.log(" " + auditChips.join(" "));
|
|
11692
12010
|
renderHUD(sat, params.target, stalemateCurrent, params.stag, divergenceCurrent, params.div, params.grading);
|
|
11693
|
-
console.log(
|
|
12011
|
+
console.log(AMBER12(` \u{1F3C1} Stalemate threshold reached (${stalemateCurrent}/${params.stag}). Simulation ended.`));
|
|
11694
12012
|
running = false;
|
|
11695
12013
|
break;
|
|
11696
12014
|
}
|
|
@@ -11700,7 +12018,7 @@ After each Bob response, evaluate it 0-100 on mission alignment. Reply with your
|
|
|
11700
12018
|
if (params.div > 0 && divergenceCurrent >= params.div) {
|
|
11701
12019
|
console.log(" " + auditChips.join(" "));
|
|
11702
12020
|
renderHUD(sat, params.target, stalemateCurrent, params.stag, divergenceCurrent, params.div, params.grading);
|
|
11703
|
-
console.log(
|
|
12021
|
+
console.log(AMBER12(` \u{1F3C1} Divergence threshold reached (${divergenceCurrent}/${params.div}). Simulation ended.`));
|
|
11704
12022
|
running = false;
|
|
11705
12023
|
break;
|
|
11706
12024
|
}
|
|
@@ -11754,11 +12072,11 @@ function registerUserBobCommand(program2) {
|
|
|
11754
12072
|
if (dna) {
|
|
11755
12073
|
console.log(GREEN11(" \u2705 Behavioral DNA loaded."));
|
|
11756
12074
|
} else {
|
|
11757
|
-
console.log(
|
|
12075
|
+
console.log(AMBER12(" \u26A0\uFE0F No behavioral profile found."));
|
|
11758
12076
|
console.log(GRAY10(" UserBob performs significantly better with your DNA loaded."));
|
|
11759
12077
|
console.log("");
|
|
11760
12078
|
const rl = readline11.createInterface({ input: process.stdin, output: process.stdout, terminal: true });
|
|
11761
|
-
const answer = await new Promise((resolve4) => rl.question(
|
|
12079
|
+
const answer = await new Promise((resolve4) => rl.question(AMBER12(" Run `bob profile --today` now? (y/n): "), resolve4));
|
|
11762
12080
|
rl.close();
|
|
11763
12081
|
if (answer.trim().toLowerCase() === "y") {
|
|
11764
12082
|
console.log("");
|
|
@@ -11777,7 +12095,7 @@ function registerUserBobCommand(program2) {
|
|
|
11777
12095
|
let mission = missionArgs.length > 0 ? missionArgs.join(" ") : "";
|
|
11778
12096
|
if (!mission && !options.resume) {
|
|
11779
12097
|
const mrl = readline11.createInterface({ input: process.stdin, output: process.stdout, terminal: true });
|
|
11780
|
-
mission = await new Promise((resolve4) => mrl.question(
|
|
12098
|
+
mission = await new Promise((resolve4) => mrl.question(AMBER12(" What's the mission? > "), resolve4));
|
|
11781
12099
|
mrl.close();
|
|
11782
12100
|
if (!mission.trim()) {
|
|
11783
12101
|
console.log(RED10(" \u274C Mission cannot be empty. Exiting."));
|
|
@@ -11795,7 +12113,7 @@ function registerUserBobCommand(program2) {
|
|
|
11795
12113
|
process.exit(1);
|
|
11796
12114
|
}
|
|
11797
12115
|
if (options.resume) {
|
|
11798
|
-
console.log(
|
|
12116
|
+
console.log(AMBER12(" \u{1F504} Resuming simulation (no new mission note)..."));
|
|
11799
12117
|
await callHTTPFunction("userSimManagerService", {
|
|
11800
12118
|
action: "resumeMission",
|
|
11801
12119
|
conversationId,
|