chiefwiggum 1.3.2 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +131 -76
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -35,12 +35,72 @@ var import_node_path3 = require("path");
|
|
|
35
35
|
var import_node_url2 = require("url");
|
|
36
36
|
|
|
37
37
|
// src/utils/banner.ts
|
|
38
|
-
var
|
|
38
|
+
var import_picocolors2 = __toESM(require("picocolors"), 1);
|
|
39
39
|
var import_node_child_process = require("child_process");
|
|
40
|
+
|
|
41
|
+
// src/prompts/index.ts
|
|
42
|
+
var p = __toESM(require("@clack/prompts"), 1);
|
|
43
|
+
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
44
|
+
function handleCancel(value) {
|
|
45
|
+
if (p.isCancel(value)) {
|
|
46
|
+
p.cancel("Operation cancelled.");
|
|
47
|
+
process.exit(0);
|
|
48
|
+
}
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
async function select2(options) {
|
|
52
|
+
const result = await p.select({
|
|
53
|
+
message: options.message,
|
|
54
|
+
options: options.options,
|
|
55
|
+
initialValue: options.initialValue
|
|
56
|
+
});
|
|
57
|
+
return handleCancel(result);
|
|
58
|
+
}
|
|
59
|
+
async function text2(options) {
|
|
60
|
+
const result = await p.text(options);
|
|
61
|
+
return handleCancel(result);
|
|
62
|
+
}
|
|
63
|
+
async function confirm2(options) {
|
|
64
|
+
const result = await p.confirm({
|
|
65
|
+
...options,
|
|
66
|
+
active: "Yes",
|
|
67
|
+
inactive: "No"
|
|
68
|
+
});
|
|
69
|
+
return handleCancel(result);
|
|
70
|
+
}
|
|
71
|
+
async function multilineText(options) {
|
|
72
|
+
console.log();
|
|
73
|
+
console.log(import_picocolors.default.bold(options.message));
|
|
74
|
+
if (options.placeholder) {
|
|
75
|
+
console.log(import_picocolors.default.dim(options.placeholder));
|
|
76
|
+
}
|
|
77
|
+
console.log();
|
|
78
|
+
const { createInterface: createInterface2 } = await import("readline");
|
|
79
|
+
const rl = createInterface2({
|
|
80
|
+
input: process.stdin,
|
|
81
|
+
output: process.stdout
|
|
82
|
+
});
|
|
83
|
+
const lines = [];
|
|
84
|
+
return new Promise((resolve) => {
|
|
85
|
+
rl.on("line", (line) => {
|
|
86
|
+
if (line === "") {
|
|
87
|
+
rl.close();
|
|
88
|
+
resolve(lines.join("\n"));
|
|
89
|
+
} else {
|
|
90
|
+
lines.push(line);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
rl.on("close", () => {
|
|
94
|
+
resolve(lines.join("\n"));
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// src/utils/banner.ts
|
|
40
100
|
var BANNER = `
|
|
41
|
-
${
|
|
42
|
-
${
|
|
43
|
-
${
|
|
101
|
+
${import_picocolors2.default.yellow("\u2591\u2588\u2580\u2580\u2591\u2588\u2591\u2588\u2591\u2580\u2588\u2580\u2591\u2588\u2580\u2580\u2591\u2588\u2580\u2580\u2591\u2591\u2591\u2588\u2591\u2588\u2591\u2580\u2588\u2580\u2591\u2588\u2580\u2580\u2591\u2588\u2580\u2580\u2591\u2588\u2591\u2588\u2591\u2588\u2584\u2588")}
|
|
102
|
+
${import_picocolors2.default.yellow("\u2591\u2588\u2591\u2591\u2591\u2588\u2580\u2588\u2591\u2591\u2588\u2591\u2591\u2588\u2580\u2580\u2591\u2588\u2580\u2580\u2591\u2591\u2591\u2588\u2584\u2588\u2591\u2591\u2588\u2591\u2591\u2588\u2591\u2588\u2591\u2588\u2591\u2588\u2591\u2588\u2591\u2588\u2591\u2588\u2591\u2588")}
|
|
103
|
+
${import_picocolors2.default.yellow("\u2591\u2580\u2580\u2580\u2591\u2580\u2591\u2580\u2591\u2580\u2580\u2580\u2591\u2580\u2580\u2580\u2591\u2580\u2591\u2591\u2591\u2591\u2591\u2580\u2591\u2580\u2591\u2580\u2580\u2580\u2591\u2580\u2580\u2580\u2591\u2580\u2580\u2580\u2591\u2580\u2580\u2580\u2591\u2580\u2591\u2580")}`;
|
|
44
104
|
async function checkForUpdates(currentVersion) {
|
|
45
105
|
try {
|
|
46
106
|
const result = (0, import_node_child_process.execSync)("npm view chiefwiggum version", {
|
|
@@ -49,22 +109,31 @@ async function checkForUpdates(currentVersion) {
|
|
|
49
109
|
stdio: ["pipe", "pipe", "pipe"]
|
|
50
110
|
}).trim();
|
|
51
111
|
if (result && result !== currentVersion) {
|
|
52
|
-
console.log(
|
|
53
|
-
console.log(import_picocolors.default.cyan(" Run: npm install -g chiefwiggum@latest"));
|
|
112
|
+
console.log(import_picocolors2.default.cyan(` \u2728 Update available: v${currentVersion} \u2192 v${result}`));
|
|
54
113
|
console.log();
|
|
114
|
+
const shouldUpdate = await confirm2({
|
|
115
|
+
message: "Update now?",
|
|
116
|
+
initialValue: true
|
|
117
|
+
});
|
|
118
|
+
if (shouldUpdate) {
|
|
119
|
+
console.log(import_picocolors2.default.cyan("Updating..."));
|
|
120
|
+
(0, import_node_child_process.execSync)("npm install -g chiefwiggum@latest", { stdio: "inherit" });
|
|
121
|
+
console.log(import_picocolors2.default.green("\u2713 Updated! Please run your command again."));
|
|
122
|
+
process.exit(0);
|
|
123
|
+
}
|
|
55
124
|
}
|
|
56
125
|
} catch {
|
|
57
126
|
}
|
|
58
127
|
}
|
|
59
128
|
async function showBanner(version2) {
|
|
60
129
|
console.log(BANNER);
|
|
61
|
-
console.log(
|
|
130
|
+
console.log(import_picocolors2.default.yellow(` Autonomous Coding Agent v${version2}`));
|
|
62
131
|
console.log();
|
|
63
132
|
await checkForUpdates(version2);
|
|
64
133
|
}
|
|
65
134
|
|
|
66
135
|
// src/lib/process.ts
|
|
67
|
-
var
|
|
136
|
+
var import_picocolors3 = __toESM(require("picocolors"), 1);
|
|
68
137
|
var import_node_child_process2 = require("child_process");
|
|
69
138
|
var cleanupRan = false;
|
|
70
139
|
function cleanup() {
|
|
@@ -75,7 +144,7 @@ function cleanup() {
|
|
|
75
144
|
function setupSignalHandlers() {
|
|
76
145
|
process.on("SIGINT", () => {
|
|
77
146
|
console.log();
|
|
78
|
-
console.log(
|
|
147
|
+
console.log(import_picocolors3.default.yellow("Interrupted."));
|
|
79
148
|
cleanup();
|
|
80
149
|
process.exit(130);
|
|
81
150
|
});
|
|
@@ -84,12 +153,12 @@ function setupSignalHandlers() {
|
|
|
84
153
|
process.exit(143);
|
|
85
154
|
});
|
|
86
155
|
process.on("uncaughtException", (err) => {
|
|
87
|
-
console.error(
|
|
156
|
+
console.error(import_picocolors3.default.red("Uncaught exception:"), err.message);
|
|
88
157
|
cleanup();
|
|
89
158
|
process.exit(1);
|
|
90
159
|
});
|
|
91
160
|
process.on("unhandledRejection", (reason) => {
|
|
92
|
-
console.error(
|
|
161
|
+
console.error(import_picocolors3.default.red("Unhandled rejection:"), reason);
|
|
93
162
|
cleanup();
|
|
94
163
|
process.exit(1);
|
|
95
164
|
});
|
|
@@ -115,7 +184,7 @@ function sleep(ms) {
|
|
|
115
184
|
// src/commands/status.ts
|
|
116
185
|
var import_node_fs = require("fs");
|
|
117
186
|
var import_node_child_process3 = require("child_process");
|
|
118
|
-
var
|
|
187
|
+
var import_picocolors4 = __toESM(require("picocolors"), 1);
|
|
119
188
|
|
|
120
189
|
// src/lib/config.ts
|
|
121
190
|
var import_node_os = require("os");
|
|
@@ -139,12 +208,12 @@ process.env.CLAUDE_CODE_EXIT_AFTER_STOP_DELAY = process.env.CLAUDE_CODE_EXIT_AFT
|
|
|
139
208
|
|
|
140
209
|
// src/commands/status.ts
|
|
141
210
|
async function cmdStatus() {
|
|
142
|
-
console.log(
|
|
211
|
+
console.log(import_picocolors4.default.bold("Project Status"));
|
|
143
212
|
console.log();
|
|
144
213
|
const hasTodo = (0, import_node_fs.existsSync)(config.todoFile);
|
|
145
214
|
const hasSpecs = (0, import_node_fs.existsSync)("specs");
|
|
146
215
|
const hasClaudeMd = (0, import_node_fs.existsSync)("CLAUDE.md");
|
|
147
|
-
const check = (exists) => exists ?
|
|
216
|
+
const check = (exists) => exists ? import_picocolors4.default.green("\u2713") : import_picocolors4.default.red("\u2717");
|
|
148
217
|
console.log(` TODO.md: ${check(hasTodo)}`);
|
|
149
218
|
console.log(` specs/: ${check(hasSpecs)}`);
|
|
150
219
|
console.log(` CLAUDE.md: ${check(hasClaudeMd)}`);
|
|
@@ -164,10 +233,10 @@ async function cmdStatus() {
|
|
|
164
233
|
}
|
|
165
234
|
}
|
|
166
235
|
const remaining = total - done;
|
|
167
|
-
console.log(
|
|
236
|
+
console.log(import_picocolors4.default.bold("Tasks"));
|
|
168
237
|
console.log(` Total: ${total}`);
|
|
169
|
-
console.log(` Completed: ${
|
|
170
|
-
console.log(` Remaining: ${
|
|
238
|
+
console.log(` Completed: ${import_picocolors4.default.green(String(done))}`);
|
|
239
|
+
console.log(` Remaining: ${import_picocolors4.default.yellow(String(remaining))}`);
|
|
171
240
|
console.log();
|
|
172
241
|
} catch {
|
|
173
242
|
}
|
|
@@ -176,7 +245,7 @@ async function cmdStatus() {
|
|
|
176
245
|
(0, import_node_child_process3.execSync)("git rev-parse --git-dir", { stdio: "pipe" });
|
|
177
246
|
const branch = (0, import_node_child_process3.execSync)("git branch --show-current", { encoding: "utf-8" }).trim() || "unknown";
|
|
178
247
|
const commits = (0, import_node_child_process3.execSync)("git rev-list --count HEAD", { encoding: "utf-8" }).trim() || "0";
|
|
179
|
-
console.log(
|
|
248
|
+
console.log(import_picocolors4.default.bold("Git"));
|
|
180
249
|
console.log(` Branch: ${branch}`);
|
|
181
250
|
console.log(` Commits: ${commits}`);
|
|
182
251
|
} catch {
|
|
@@ -191,64 +260,6 @@ var import_node_path2 = require("path");
|
|
|
191
260
|
var import_node_url = require("url");
|
|
192
261
|
var import_picocolors7 = __toESM(require("picocolors"), 1);
|
|
193
262
|
|
|
194
|
-
// src/prompts/index.ts
|
|
195
|
-
var p = __toESM(require("@clack/prompts"), 1);
|
|
196
|
-
var import_picocolors4 = __toESM(require("picocolors"), 1);
|
|
197
|
-
function handleCancel(value) {
|
|
198
|
-
if (p.isCancel(value)) {
|
|
199
|
-
p.cancel("Operation cancelled.");
|
|
200
|
-
process.exit(0);
|
|
201
|
-
}
|
|
202
|
-
return value;
|
|
203
|
-
}
|
|
204
|
-
async function select2(options) {
|
|
205
|
-
const result = await p.select({
|
|
206
|
-
message: options.message,
|
|
207
|
-
options: options.options,
|
|
208
|
-
initialValue: options.initialValue
|
|
209
|
-
});
|
|
210
|
-
return handleCancel(result);
|
|
211
|
-
}
|
|
212
|
-
async function text2(options) {
|
|
213
|
-
const result = await p.text(options);
|
|
214
|
-
return handleCancel(result);
|
|
215
|
-
}
|
|
216
|
-
async function confirm2(options) {
|
|
217
|
-
const result = await p.confirm({
|
|
218
|
-
...options,
|
|
219
|
-
active: "Yes",
|
|
220
|
-
inactive: "No"
|
|
221
|
-
});
|
|
222
|
-
return handleCancel(result);
|
|
223
|
-
}
|
|
224
|
-
async function multilineText(options) {
|
|
225
|
-
console.log();
|
|
226
|
-
console.log(import_picocolors4.default.bold(options.message));
|
|
227
|
-
if (options.placeholder) {
|
|
228
|
-
console.log(import_picocolors4.default.dim(options.placeholder));
|
|
229
|
-
}
|
|
230
|
-
console.log();
|
|
231
|
-
const { createInterface: createInterface2 } = await import("readline");
|
|
232
|
-
const rl = createInterface2({
|
|
233
|
-
input: process.stdin,
|
|
234
|
-
output: process.stdout
|
|
235
|
-
});
|
|
236
|
-
const lines = [];
|
|
237
|
-
return new Promise((resolve) => {
|
|
238
|
-
rl.on("line", (line) => {
|
|
239
|
-
if (line === "") {
|
|
240
|
-
rl.close();
|
|
241
|
-
resolve(lines.join("\n"));
|
|
242
|
-
} else {
|
|
243
|
-
lines.push(line);
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
rl.on("close", () => {
|
|
247
|
-
resolve(lines.join("\n"));
|
|
248
|
-
});
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
|
|
252
263
|
// src/lib/claude.ts
|
|
253
264
|
var import_node_child_process4 = require("child_process");
|
|
254
265
|
var import_node_readline = require("readline");
|
|
@@ -511,6 +522,7 @@ async function cmdLoop() {
|
|
|
511
522
|
// src/commands/new.ts
|
|
512
523
|
var __dirname = (0, import_node_path2.dirname)((0, import_node_url.fileURLToPath)(importMetaUrl));
|
|
513
524
|
var LOCAL_TEMPLATES_DIR = ".chiefwiggum/templates";
|
|
525
|
+
var CONFIG_FILE = ".chiefwiggum/CLAUDE.md";
|
|
514
526
|
var BUNDLED_TEMPLATES_DIR = (0, import_node_path2.join)(__dirname, "..", "templates");
|
|
515
527
|
async function cmdNew(planFile) {
|
|
516
528
|
console.log(import_picocolors7.default.bold("Project Setup"));
|
|
@@ -526,6 +538,7 @@ async function cmdNew(planFile) {
|
|
|
526
538
|
process.exit(0);
|
|
527
539
|
}
|
|
528
540
|
await setupTemplates();
|
|
541
|
+
await setupProjectConfig();
|
|
529
542
|
if (planFile) {
|
|
530
543
|
if (!(0, import_node_fs3.existsSync)(planFile)) {
|
|
531
544
|
console.log(import_picocolors7.default.red(`Plan file not found: ${planFile}`));
|
|
@@ -642,6 +655,48 @@ async function setupTemplates() {
|
|
|
642
655
|
console.log(import_picocolors7.default.dim(" You can customize these templates to change how specs are generated."));
|
|
643
656
|
console.log();
|
|
644
657
|
}
|
|
658
|
+
async function setupProjectConfig() {
|
|
659
|
+
if ((0, import_node_fs3.existsSync)(CONFIG_FILE)) {
|
|
660
|
+
console.log(import_picocolors7.default.dim(`Config already exists at ${CONFIG_FILE}`));
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
console.log();
|
|
664
|
+
const useGitHub = await confirm2({
|
|
665
|
+
message: "Use GitHub Issues to track tasks? (instead of TODO.md)",
|
|
666
|
+
initialValue: false
|
|
667
|
+
});
|
|
668
|
+
if (useGitHub) {
|
|
669
|
+
const configContent = `# Chief Wiggum Config
|
|
670
|
+
|
|
671
|
+
## Project Tracker
|
|
672
|
+
|
|
673
|
+
github
|
|
674
|
+
|
|
675
|
+
## Notes
|
|
676
|
+
|
|
677
|
+
When project_tracker is set to "github", Chief Wiggum will create GitHub Issues
|
|
678
|
+
instead of using TODO.md for task tracking.
|
|
679
|
+
`;
|
|
680
|
+
(0, import_node_fs3.writeFileSync)(CONFIG_FILE, configContent);
|
|
681
|
+
console.log(import_picocolors7.default.green(`\u2713 Config saved to ${CONFIG_FILE}`));
|
|
682
|
+
console.log(import_picocolors7.default.dim(" Tasks will be created as GitHub Issues."));
|
|
683
|
+
} else {
|
|
684
|
+
const configContent = `# Chief Wiggum Config
|
|
685
|
+
|
|
686
|
+
## Project Tracker
|
|
687
|
+
|
|
688
|
+
todo
|
|
689
|
+
|
|
690
|
+
## Notes
|
|
691
|
+
|
|
692
|
+
When project_tracker is set to "todo", Chief Wiggum uses TODO.md for task tracking.
|
|
693
|
+
Change to "github" to use GitHub Issues instead.
|
|
694
|
+
`;
|
|
695
|
+
(0, import_node_fs3.writeFileSync)(CONFIG_FILE, configContent);
|
|
696
|
+
console.log(import_picocolors7.default.green(`\u2713 Config saved to ${CONFIG_FILE}`));
|
|
697
|
+
}
|
|
698
|
+
console.log();
|
|
699
|
+
}
|
|
645
700
|
async function interactiveDescribe() {
|
|
646
701
|
console.log();
|
|
647
702
|
console.log(import_picocolors7.default.bold("Tell me about your project"));
|