bugcap 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Game.js +23 -9
- package/dist/watcher.js +13 -5
- package/package.json +1 -1
package/dist/components/Game.js
CHANGED
|
@@ -30,14 +30,28 @@ function timeAgo(timestamp) {
|
|
|
30
30
|
return `${hours}h`;
|
|
31
31
|
}
|
|
32
32
|
// ── ASCII Art ────────────────────────────────────────────
|
|
33
|
-
const
|
|
34
|
-
" ____ _ _ ____
|
|
35
|
-
"| __ )| | | |/ ___|
|
|
36
|
-
"| _ \\| | | | | _
|
|
37
|
-
"| |_) | |_| | |_| |
|
|
38
|
-
"|____/ \\___/ \\____|
|
|
33
|
+
const LOGO_BUG = [
|
|
34
|
+
" ____ _ _ ____ ",
|
|
35
|
+
"| __ )| | | |/ ___|",
|
|
36
|
+
"| _ \\| | | | | _ ",
|
|
37
|
+
"| |_) | |_| | |_| |",
|
|
38
|
+
"|____/ \\___/ \\____|",
|
|
39
39
|
];
|
|
40
|
-
const
|
|
40
|
+
const LOGO_CAPITALIST = [
|
|
41
|
+
" ____ _ ____ ___ _____ _ _ ___ ____ _____ ",
|
|
42
|
+
" / ___| / \\ | _ \\_ _|_ _|/ \\ | | |_ _/ ___|_ _|",
|
|
43
|
+
"| | / _ \\ | |_) | | | | / _ \\ | | | |\\___ \\ | | ",
|
|
44
|
+
"| |___ / ___ \\| __/| | | |/ ___ \\| |___ | | ___) || | ",
|
|
45
|
+
" \\____/_/ \\_\\_| |___| |_/_/ \\_\\_____|___|____/ |_| ",
|
|
46
|
+
];
|
|
47
|
+
const LOGO_BUG_COLORS = [
|
|
48
|
+
"green",
|
|
49
|
+
"green",
|
|
50
|
+
"cyan",
|
|
51
|
+
"cyan",
|
|
52
|
+
"yellow",
|
|
53
|
+
];
|
|
54
|
+
const LOGO_CAPITALIST_COLORS = [
|
|
41
55
|
"green",
|
|
42
56
|
"green",
|
|
43
57
|
"cyan",
|
|
@@ -99,7 +113,7 @@ function EventLine({ event, showTime = false, }) {
|
|
|
99
113
|
function WelcomeScreen() {
|
|
100
114
|
const frame = useAnimationFrame(2);
|
|
101
115
|
const bugFrame = frame % 2 === 0 ? MINI_BUG : "~(O.O)~";
|
|
102
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [
|
|
116
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [LOGO_BUG.map((line, i) => (_jsx(Text, { color: LOGO_BUG_COLORS[i], children: line }, `b${i}`))), LOGO_CAPITALIST.map((line, i) => (_jsx(Text, { color: LOGO_CAPITALIST_COLORS[i], children: line }, `c${i}`)))] }), _jsxs(Box, { borderStyle: "round", borderColor: "cyan", flexDirection: "column", paddingX: 2, paddingY: 1, children: [_jsxs(Text, { children: [_jsx(Text, { color: "yellow", children: bugFrame }), _jsx(Text, { children: " Watching for changes... Start coding!" })] }), _jsx(Text, { children: " " }), _jsx(Text, { dimColor: true, children: "Your AI coding activity will appear here." }), _jsx(Text, { dimColor: true, children: "Watch extra projects: npx bugcap watch ~/other-project" })] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, italic: true, children: "Turn your AI coding into a terminal idle game" }) })] }));
|
|
103
117
|
}
|
|
104
118
|
// ── Compact View ─────────────────────────────────────────
|
|
105
119
|
function CompactView({ state, isOnline, }) {
|
|
@@ -123,7 +137,7 @@ function NormalView({ state, events, isOnline, }) {
|
|
|
123
137
|
const moneyFlash = recentMoney && frame % 2 === 0;
|
|
124
138
|
// Activity dots
|
|
125
139
|
const dots = isOnline ? SPINNER_FRAMES[frame % SPINNER_FRAMES.length] : "";
|
|
126
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [
|
|
140
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsxs(Box, { flexDirection: "column", children: [LOGO_BUG.map((line, i) => (_jsx(Text, { color: LOGO_BUG_COLORS[i], children: line }, `b${i}`))), LOGO_CAPITALIST.map((line, i) => (_jsx(Text, { color: LOGO_CAPITALIST_COLORS[i], children: line }, `c${i}`)))] }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { children: [_jsxs(Text, { color: pulseColor, bold: true, children: ["[", pulse, "]"] }), _jsxs(Text, { color: pulseColor, bold: true, children: [" ", statusText] }), _jsx(Text, { dimColor: true, children: dots })] }) }), _jsx(Box, { borderStyle: "round", borderColor: moneyFlash ? "green" : "yellow", paddingX: 2, marginTop: 1, children: _jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { dimColor: true, children: "Bug Bounty" }), _jsxs(Text, { bold: true, color: moneyFlash ? "green" : "yellow", children: [" ", "$", formatNumber(state.money)] })] }) }), _jsxs(Box, { marginTop: 1, flexDirection: "row", children: [_jsx(StatBox, { label: "Level", value: `${state.level} (${multiplier.toFixed(2)}x)`, color: "cyan" }), _jsx(StatBox, { label: "Bugs Sold", value: formatNumber(state.bugsSold), color: "red" }), _jsx(StatBox, { label: "Tokens", value: formatNumber(state.tokens), color: "green" })] }), _jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsxs(Text, { children: [_jsx(Text, { dimColor: true, children: "XP " }), _jsxs(Text, { children: [formatNumber(xpProgress), "/", formatNumber(xpNeeded)] })] }), _jsx(ProgressBar, { current: xpProgress, max: xpNeeded, width: 30, filledColor: "cyan" })] }), events.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, borderStyle: "single", borderColor: "gray", paddingX: 1, children: [_jsxs(Text, { bold: true, dimColor: true, children: [" ", "Recent Activity", " "] }), events.map((event, i) => (_jsx(EventLine, { event: event, showTime: i === events.length - 1 }, i)))] })), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { dimColor: true, italic: true, children: [MINI_BUG, " Keep coding to earn more!"] }) })] }));
|
|
127
141
|
}
|
|
128
142
|
// ── Main Component ───────────────────────────────────────
|
|
129
143
|
export default function Game() {
|
package/dist/watcher.js
CHANGED
|
@@ -54,12 +54,20 @@ function createWatcher(targetDir) {
|
|
|
54
54
|
saveState(state);
|
|
55
55
|
// Build ignore patterns
|
|
56
56
|
const gitignorePatterns = loadGitignorePatterns(resolvedDir);
|
|
57
|
-
const
|
|
58
|
-
...IGNORED_DIRS.map((d) => `**/${d}/**`),
|
|
59
|
-
...gitignorePatterns,
|
|
60
|
-
];
|
|
57
|
+
const ignoredSet = new Set(IGNORED_DIRS);
|
|
61
58
|
const watcher = watch(resolvedDir, {
|
|
62
|
-
ignored
|
|
59
|
+
ignored: (filePath) => {
|
|
60
|
+
const segments = filePath.split(path.sep);
|
|
61
|
+
if (segments.some((seg) => ignoredSet.has(seg)))
|
|
62
|
+
return true;
|
|
63
|
+
const rel = path.relative(resolvedDir, filePath);
|
|
64
|
+
return gitignorePatterns.some((pattern) => {
|
|
65
|
+
if (pattern.endsWith("/")) {
|
|
66
|
+
return rel.startsWith(pattern) || segments.includes(pattern.slice(0, -1));
|
|
67
|
+
}
|
|
68
|
+
return rel === pattern || segments.includes(pattern);
|
|
69
|
+
});
|
|
70
|
+
},
|
|
63
71
|
persistent: true,
|
|
64
72
|
ignoreInitial: true,
|
|
65
73
|
awaitWriteFinish: {
|