chiefwiggum 1.3.30 → 1.3.33
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 +292 -186
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -6,6 +6,13 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __esm = (fn, res) => function __init() {
|
|
10
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
11
|
+
};
|
|
12
|
+
var __export = (target, all) => {
|
|
13
|
+
for (var name in all)
|
|
14
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
|
+
};
|
|
9
16
|
var __copyProps = (to, from, except, desc) => {
|
|
10
17
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
18
|
for (let key of __getOwnPropNames(from))
|
|
@@ -24,23 +31,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
31
|
));
|
|
25
32
|
|
|
26
33
|
// node_modules/tsup/assets/cjs_shims.js
|
|
27
|
-
var getImportMetaUrl
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var import_node_url2 = require("url");
|
|
36
|
-
|
|
37
|
-
// src/utils/banner.ts
|
|
38
|
-
var import_picocolors2 = __toESM(require("picocolors"), 1);
|
|
39
|
-
var import_node_child_process = require("child_process");
|
|
34
|
+
var getImportMetaUrl, importMetaUrl;
|
|
35
|
+
var init_cjs_shims = __esm({
|
|
36
|
+
"node_modules/tsup/assets/cjs_shims.js"() {
|
|
37
|
+
"use strict";
|
|
38
|
+
getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
39
|
+
importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
40
|
+
}
|
|
41
|
+
});
|
|
40
42
|
|
|
41
43
|
// src/prompts/index.ts
|
|
42
|
-
var p = __toESM(require("@clack/prompts"), 1);
|
|
43
|
-
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
44
44
|
function handleCancel(value) {
|
|
45
45
|
if (p.isCancel(value)) {
|
|
46
46
|
p.cancel("Operation cancelled.");
|
|
@@ -197,77 +197,17 @@ ${import_picocolors.default.dim("\u2191/\u2193 navigate \u2022 enter select \u20
|
|
|
197
197
|
process.stdin.on("data", onKeypress);
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u28B3\u2840\u2800\u2800\u2800\u2800\u2800\u28C4\u281C\u2801\u28C0\u28C1\u2809\u2808\u28B8\u2844\u28C4\u28A4\u28A0\u2884\u2884\u28C0\u2840\u2840\u2840\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2811\u28A6\u2880\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
208
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2818\u2826\u28C0\u2800\u2800\u2808\u28C6\u2800\u28B8\u2800\u2800\u28B9\u2800\u28B0\u28C1\u28C0\u28C0\u2880\u28C0\u28C0\u2880\u2808\u2808\u2818\u2818\u2814\u2824\u28C0\u2800\u2800\u2800\u2800\u2800\u2800\u2811\u2831\u2884\u2884\u2800\u2800\u2800\u2800\u2800
|
|
209
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2808\u2813\u2822\u284E\u284A\u28E3\u288C\u2812\u2814\u280A\u28E0\u280B\u2880\u2880\u2880\u2881\u2880\u2880\u2801\u2849\u2819\u28B2\u2812\u2832\u2884\u2800\u2809\u2832\u2884\u2800\u2800\u2800\u2800\u2800\u2880\u28A1\u283B\u2801\u2800\u2800\u2800
|
|
210
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28BB\u28C8\u28E4\u28EC\u28FF\u28FE\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FE\u287F\u281E\u2866\u2864\u282F\u2884\u28C0\u2800\u28A8\u2826\u2824\u2824\u2832\u2818\u2818\u2808\u2800\u2800\u2800\u2800\u2800
|
|
211
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2880\u28E4\u28F6\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u283F\u281F\u280B\u2801\u2800\u28B8\u2801\u2800\u2800\u2800\u2808\u2811\u2897\u2840\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
212
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2830\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28BF\u287F\u283F\u287F\u281B\u2809\u2801\u2808\u2809\u2813\u28C4\u2800\u2800\u2818\u28E2\u2800\u2800\u2800\u2800\u2800\u2800\u2819\u2864\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
213
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28E0\u280B\u2800\u2800\u2800\u2800\u2808\u285F\u2800\u2800\u2800\u2800\u2800\u28C0\u2800\u2800\u28B3\u2800\u2800\u2827\u2840\u2800\u2800\u2800\u2800\u2800\u2880\u2887\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
214
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2890\u280E\u2800\u2800\u28F4\u2844\u2800\u2800\u2847\u2800\u2800\u2800\u2800\u2800\u281B\u2803\u2800\u28B8\u2802\u2800\u2800\u2847\u2800\u2880\u2854\u280B\u2809\u281B\u2864\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
215
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28A7\u2800\u2880\u28E0\u2824\u2816\u2816\u283D\u2824\u28C0\u2800\u2800\u2800\u2800\u2800\u2880\u281E\u2800\u2800\u2800\u2827\u2824\u282E\u2800\u281A\u28AB\u2801\u28B8\u2802\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
216
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u285F\u2801\u2840\u2840\u2800\u2800\u28C0\u28C0\u2808\u28F3\u28A4\u28A4\u2824\u281E\u2809\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2820\u2826\u2874\u2803\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
217
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28C0\u2894\u282B\u2882\u2811\u2809\u2800\u2800\u2800\u2802\u2814\u2803\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2808\u2813\u28C4\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
218
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2854\u281C\u2808\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2840\u2880\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2838\u2844\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
219
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2818\u28C6\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2840\u2840\u28C0\u2884\u2884\u28A4\u2822\u2822\u289A\u28D8\u28CD\u28CC\u28E5\u28FF\u28C6\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2847\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
220
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2819\u280A\u283E\u2878\u2858\u28CA\u28DD\u289C\u288C\u28CC\u28C4\u28FE\u28F6\u28F6\u28FE\u28FE\u28FF\u287F\u287F\u28FF\u287F\u2803\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28E8\u2803\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
221
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2801\u2881\u2861\u280E\u2800\u2800\u28F8\u28FF\u28FF\u28FF\u28FF\u280F\u28C1\u28C9\u28A4\u2822\u280A\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2880\u2834\u2801\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
222
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2810\u28C7\u2801\u2800\u2801\u280B\u281B\u281B\u281B\u2819\u2819\u2809\u2802\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28C0\u2834\u2809\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
223
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2878\u280A\u2809\u2802\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2880\u2860\u2854\u281A\u2808\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
224
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2808\u2823\u28C4\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28C0\u28E0\u2860\u2826\u281A\u2801\u2801\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
225
|
-
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2809\u2813\u2812\u2832\u2822\u2832\u2812\u2812\u281A\u280A\u2809\u2801\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800`;
|
|
226
|
-
var TEXT_BANNER = `
|
|
227
|
-
${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")}
|
|
228
|
-
${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")}
|
|
229
|
-
${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")}`;
|
|
230
|
-
function createBanner() {
|
|
231
|
-
const artLines = WIGGUM_ART.split("\n").filter((line) => line.length > 0);
|
|
232
|
-
const textLines = TEXT_BANNER.split("\n").filter((line) => line.length > 0);
|
|
233
|
-
return import_picocolors2.default.yellow(artLines.join("\n")) + "\n\n" + textLines.join("\n");
|
|
234
|
-
}
|
|
235
|
-
var BANNER = createBanner();
|
|
236
|
-
async function checkForUpdates(currentVersion) {
|
|
237
|
-
try {
|
|
238
|
-
const result = (0, import_node_child_process.execSync)("npm view chiefwiggum version", {
|
|
239
|
-
timeout: 2e3,
|
|
240
|
-
encoding: "utf-8",
|
|
241
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
242
|
-
}).trim();
|
|
243
|
-
if (result && result !== currentVersion) {
|
|
244
|
-
console.log(import_picocolors2.default.cyan(` \u2728 Update available: v${currentVersion} \u2192 v${result}`));
|
|
245
|
-
console.log();
|
|
246
|
-
const shouldUpdate = await confirm2({
|
|
247
|
-
message: "Update now?",
|
|
248
|
-
initialValue: true
|
|
249
|
-
});
|
|
250
|
-
if (shouldUpdate) {
|
|
251
|
-
console.log(import_picocolors2.default.cyan("Updating..."));
|
|
252
|
-
(0, import_node_child_process.execSync)("npm install -g chiefwiggum@latest", { stdio: "inherit" });
|
|
253
|
-
console.log(import_picocolors2.default.green("\u2713 Updated! Please run your command again."));
|
|
254
|
-
process.exit(0);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
} catch {
|
|
200
|
+
var p, import_picocolors;
|
|
201
|
+
var init_prompts = __esm({
|
|
202
|
+
"src/prompts/index.ts"() {
|
|
203
|
+
"use strict";
|
|
204
|
+
init_cjs_shims();
|
|
205
|
+
p = __toESM(require("@clack/prompts"), 1);
|
|
206
|
+
import_picocolors = __toESM(require("picocolors"), 1);
|
|
258
207
|
}
|
|
259
|
-
}
|
|
260
|
-
async function showBanner(version2) {
|
|
261
|
-
console.log(BANNER);
|
|
262
|
-
console.log(import_picocolors2.default.yellow(` Autonomous Coding Agent v${version2}`));
|
|
263
|
-
console.log();
|
|
264
|
-
await checkForUpdates(version2);
|
|
265
|
-
}
|
|
208
|
+
});
|
|
266
209
|
|
|
267
210
|
// src/lib/process.ts
|
|
268
|
-
var import_picocolors3 = __toESM(require("picocolors"), 1);
|
|
269
|
-
var import_node_child_process2 = require("child_process");
|
|
270
|
-
var cleanupRan = false;
|
|
271
211
|
function cleanup() {
|
|
272
212
|
if (cleanupRan) return;
|
|
273
213
|
cleanupRan = true;
|
|
@@ -312,91 +252,46 @@ function cleanupStaleProcesses() {
|
|
|
312
252
|
function sleep(ms) {
|
|
313
253
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
314
254
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
255
|
+
var import_picocolors3, import_node_child_process2, cleanupRan;
|
|
256
|
+
var init_process = __esm({
|
|
257
|
+
"src/lib/process.ts"() {
|
|
258
|
+
"use strict";
|
|
259
|
+
init_cjs_shims();
|
|
260
|
+
import_picocolors3 = __toESM(require("picocolors"), 1);
|
|
261
|
+
import_node_child_process2 = require("child_process");
|
|
262
|
+
cleanupRan = false;
|
|
263
|
+
}
|
|
264
|
+
});
|
|
320
265
|
|
|
321
266
|
// src/lib/config.ts
|
|
322
|
-
var import_node_os
|
|
323
|
-
var
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
const hasTodo = (0, import_node_fs.existsSync)(config.todoFile);
|
|
347
|
-
const hasSpecs = (0, import_node_fs.existsSync)("specs");
|
|
348
|
-
const hasClaudeMd = (0, import_node_fs.existsSync)("CLAUDE.md");
|
|
349
|
-
const check = (exists) => exists ? import_picocolors4.default.green("\u2713") : import_picocolors4.default.red("\u2717");
|
|
350
|
-
console.log(` TODO.md: ${check(hasTodo)}`);
|
|
351
|
-
console.log(` specs/: ${check(hasSpecs)}`);
|
|
352
|
-
console.log(` CLAUDE.md: ${check(hasClaudeMd)}`);
|
|
353
|
-
console.log();
|
|
354
|
-
if (hasTodo) {
|
|
355
|
-
try {
|
|
356
|
-
const content = (0, import_node_fs.readFileSync)(config.todoFile, "utf-8");
|
|
357
|
-
const lines = content.split("\n");
|
|
358
|
-
let total = 0;
|
|
359
|
-
let done = 0;
|
|
360
|
-
for (const line of lines) {
|
|
361
|
-
if (/^\s*-\s*\[.\]/.test(line)) {
|
|
362
|
-
total++;
|
|
363
|
-
if (/^\s*-\s*\[x\]/i.test(line)) {
|
|
364
|
-
done++;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
const remaining = total - done;
|
|
369
|
-
console.log(import_picocolors4.default.bold("Tasks"));
|
|
370
|
-
console.log(` Total: ${total}`);
|
|
371
|
-
console.log(` Completed: ${import_picocolors4.default.green(String(done))}`);
|
|
372
|
-
console.log(` Remaining: ${import_picocolors4.default.yellow(String(remaining))}`);
|
|
373
|
-
console.log();
|
|
374
|
-
} catch {
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
try {
|
|
378
|
-
(0, import_node_child_process3.execSync)("git rev-parse --git-dir", { stdio: "pipe" });
|
|
379
|
-
const branch = (0, import_node_child_process3.execSync)("git branch --show-current", { encoding: "utf-8" }).trim() || "unknown";
|
|
380
|
-
const commits = (0, import_node_child_process3.execSync)("git rev-list --count HEAD", { encoding: "utf-8" }).trim() || "0";
|
|
381
|
-
console.log(import_picocolors4.default.bold("Git"));
|
|
382
|
-
console.log(` Branch: ${branch}`);
|
|
383
|
-
console.log(` Commits: ${commits}`);
|
|
384
|
-
} catch {
|
|
267
|
+
var import_node_os, import_node_path, config;
|
|
268
|
+
var init_config = __esm({
|
|
269
|
+
"src/lib/config.ts"() {
|
|
270
|
+
"use strict";
|
|
271
|
+
init_cjs_shims();
|
|
272
|
+
import_node_os = require("os");
|
|
273
|
+
import_node_path = require("path");
|
|
274
|
+
config = {
|
|
275
|
+
// Paths
|
|
276
|
+
chiefwiggumHome: process.env.CHIEFWIGGUM_HOME || (0, import_node_path.join)((0, import_node_os.homedir)(), ".chiefwiggum"),
|
|
277
|
+
get templatesDir() {
|
|
278
|
+
return (0, import_node_path.join)(this.chiefwiggumHome, "templates");
|
|
279
|
+
},
|
|
280
|
+
todoFile: process.env.TODO_FILE || "docs/chiefwiggum/TODO.md",
|
|
281
|
+
specsDir: "docs/chiefwiggum/specs",
|
|
282
|
+
// Timing
|
|
283
|
+
cooldownSeconds: parseInt(process.env.COOLDOWN_SECONDS || "5", 10),
|
|
284
|
+
iterationTimeoutMinutes: parseInt(process.env.ITERATION_TIMEOUT_MINUTES || "60", 10),
|
|
285
|
+
// Guardrails
|
|
286
|
+
maxConsecutiveFailures: parseInt(process.env.MAX_CONSECUTIVE_FAILURES || "3", 10),
|
|
287
|
+
maxNoCommitCycles: parseInt(process.env.MAX_NO_COMMIT_CYCLES || "5", 10),
|
|
288
|
+
maxClaudeAttempts: parseInt(process.env.MAX_CLAUDE_ATTEMPTS || "3", 10)
|
|
289
|
+
};
|
|
290
|
+
process.env.CLAUDE_CODE_EXIT_AFTER_STOP_DELAY = process.env.CLAUDE_CODE_EXIT_AFTER_STOP_DELAY || "30000";
|
|
385
291
|
}
|
|
386
|
-
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
// src/commands/new.ts
|
|
390
|
-
var import_node_fs3 = require("fs");
|
|
391
|
-
var import_node_child_process6 = require("child_process");
|
|
392
|
-
var import_node_path2 = require("path");
|
|
393
|
-
var import_node_url = require("url");
|
|
394
|
-
var import_picocolors7 = __toESM(require("picocolors"), 1);
|
|
292
|
+
});
|
|
395
293
|
|
|
396
294
|
// src/lib/claude.ts
|
|
397
|
-
var import_node_child_process4 = require("child_process");
|
|
398
|
-
var import_node_readline = require("readline");
|
|
399
|
-
var import_picocolors5 = __toESM(require("picocolors"), 1);
|
|
400
295
|
async function runClaude(options) {
|
|
401
296
|
const { prompt, streaming = false, onOutput } = options;
|
|
402
297
|
const timeoutMs = options.timeoutMs || config.iterationTimeoutMinutes * 60 * 1e3;
|
|
@@ -531,9 +426,32 @@ Then list open issues: gh issue list --state open
|
|
|
531
426
|
## Workflow
|
|
532
427
|
1. Pick the FIRST open issue (lowest number)
|
|
533
428
|
2. Read the issue: gh issue view <number>
|
|
534
|
-
3.
|
|
535
|
-
4.
|
|
536
|
-
5.
|
|
429
|
+
3. Update project board status to "In Progress" (see instructions below)
|
|
430
|
+
4. Implement the code
|
|
431
|
+
5. Close the issue: gh issue close <number> --comment "Completed"
|
|
432
|
+
6. Update project board status to "Done"
|
|
433
|
+
7. Commit: git commit -m "type(scope): description (closes #<number>)"
|
|
434
|
+
|
|
435
|
+
## Update Project Board Status
|
|
436
|
+
Use this to update issue status on the project board (replace <issue_number> and <status_name>):
|
|
437
|
+
|
|
438
|
+
\`\`\`bash
|
|
439
|
+
# Get repo owner and project number
|
|
440
|
+
OWNER=$(gh repo view --json owner -q .owner.login)
|
|
441
|
+
PROJECT_NUM=$(gh repo view --json projectsV2 -q '.projectsV2.nodes[0].number')
|
|
442
|
+
|
|
443
|
+
# Get the issue's item ID in the project
|
|
444
|
+
ITEM_ID=$(gh project item-list $PROJECT_NUM --owner $OWNER --format json | jq -r '.items[] | select(.content.number == <issue_number>) | .id')
|
|
445
|
+
|
|
446
|
+
# Get Status field ID and target status option ID
|
|
447
|
+
FIELD_ID=$(gh project field-list $PROJECT_NUM --owner $OWNER --format json | jq -r '.fields[] | select(.name == "Status") | .id')
|
|
448
|
+
STATUS_ID=$(gh project field-list $PROJECT_NUM --owner $OWNER --format json | jq -r '.fields[] | select(.name == "Status") | .options[] | select(.name == "<status_name>") | .id')
|
|
449
|
+
|
|
450
|
+
# Update status (use "In Progress" when starting, "Done" when complete)
|
|
451
|
+
gh project item-edit --project-id $PROJECT_NUM --id $ITEM_ID --field-id $FIELD_ID --single-select-option-id $STATUS_ID
|
|
452
|
+
\`\`\`
|
|
453
|
+
|
|
454
|
+
If any step fails (no project linked, field not found), skip and continue.
|
|
537
455
|
|
|
538
456
|
## Rules
|
|
539
457
|
- ONE issue per iteration
|
|
@@ -579,11 +497,20 @@ async function runTaskIteration(iteration, useGitHub = false) {
|
|
|
579
497
|
}
|
|
580
498
|
return lastResult;
|
|
581
499
|
}
|
|
500
|
+
var import_node_child_process4, import_node_readline, import_picocolors5;
|
|
501
|
+
var init_claude = __esm({
|
|
502
|
+
"src/lib/claude.ts"() {
|
|
503
|
+
"use strict";
|
|
504
|
+
init_cjs_shims();
|
|
505
|
+
import_node_child_process4 = require("child_process");
|
|
506
|
+
import_node_readline = require("readline");
|
|
507
|
+
import_picocolors5 = __toESM(require("picocolors"), 1);
|
|
508
|
+
init_config();
|
|
509
|
+
init_process();
|
|
510
|
+
}
|
|
511
|
+
});
|
|
582
512
|
|
|
583
513
|
// src/commands/loop.ts
|
|
584
|
-
var import_node_fs2 = require("fs");
|
|
585
|
-
var import_node_child_process5 = require("child_process");
|
|
586
|
-
var import_picocolors6 = __toESM(require("picocolors"), 1);
|
|
587
514
|
function countUncheckedTasks() {
|
|
588
515
|
if (!(0, import_node_fs2.existsSync)(config.todoFile)) return 0;
|
|
589
516
|
const content = (0, import_node_fs2.readFileSync)(config.todoFile, "utf-8");
|
|
@@ -722,11 +649,28 @@ async function cmdLoop() {
|
|
|
722
649
|
console.log(import_picocolors6.default.yellow(`Reached max iterations (${maxIterations})`));
|
|
723
650
|
pushToOrigin();
|
|
724
651
|
}
|
|
652
|
+
var import_node_fs2, import_node_child_process5, import_picocolors6;
|
|
653
|
+
var init_loop = __esm({
|
|
654
|
+
"src/commands/loop.ts"() {
|
|
655
|
+
"use strict";
|
|
656
|
+
init_cjs_shims();
|
|
657
|
+
import_node_fs2 = require("fs");
|
|
658
|
+
import_node_child_process5 = require("child_process");
|
|
659
|
+
import_picocolors6 = __toESM(require("picocolors"), 1);
|
|
660
|
+
init_config();
|
|
661
|
+
init_claude();
|
|
662
|
+
init_process();
|
|
663
|
+
init_new();
|
|
664
|
+
}
|
|
665
|
+
});
|
|
725
666
|
|
|
726
667
|
// src/commands/new.ts
|
|
727
|
-
var
|
|
728
|
-
|
|
729
|
-
|
|
668
|
+
var new_exports = {};
|
|
669
|
+
__export(new_exports, {
|
|
670
|
+
cmdNew: () => cmdNew,
|
|
671
|
+
getGithubProject: () => getGithubProject,
|
|
672
|
+
getProjectTracker: () => getProjectTracker
|
|
673
|
+
});
|
|
730
674
|
function stripTrailingCommas(json) {
|
|
731
675
|
return json.replace(/,(\s*[}\]])/g, "$1");
|
|
732
676
|
}
|
|
@@ -776,17 +720,6 @@ function countOpenGitHubIssues() {
|
|
|
776
720
|
return 0;
|
|
777
721
|
}
|
|
778
722
|
}
|
|
779
|
-
var BUNDLED_TEMPLATES_DIR = (0, import_node_path2.join)(__dirname, "..", "templates");
|
|
780
|
-
var SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
781
|
-
"node_modules",
|
|
782
|
-
".git",
|
|
783
|
-
".chiefwiggum",
|
|
784
|
-
"dist",
|
|
785
|
-
"build",
|
|
786
|
-
".next",
|
|
787
|
-
"vendor",
|
|
788
|
-
"coverage"
|
|
789
|
-
]);
|
|
790
723
|
function findMarkdownFiles(dir, basePath = "") {
|
|
791
724
|
const results = [];
|
|
792
725
|
try {
|
|
@@ -1471,10 +1404,179 @@ Write directly to ${todoFile}.`;
|
|
|
1471
1404
|
} catch {
|
|
1472
1405
|
}
|
|
1473
1406
|
}
|
|
1407
|
+
var import_node_fs3, import_node_child_process6, import_node_path2, import_node_url, import_picocolors7, __dirname, LOCAL_TEMPLATES_DIR, CONFIG_FILE, BUNDLED_TEMPLATES_DIR, SKIP_DIRS;
|
|
1408
|
+
var init_new = __esm({
|
|
1409
|
+
"src/commands/new.ts"() {
|
|
1410
|
+
"use strict";
|
|
1411
|
+
init_cjs_shims();
|
|
1412
|
+
import_node_fs3 = require("fs");
|
|
1413
|
+
import_node_child_process6 = require("child_process");
|
|
1414
|
+
import_node_path2 = require("path");
|
|
1415
|
+
import_node_url = require("url");
|
|
1416
|
+
import_picocolors7 = __toESM(require("picocolors"), 1);
|
|
1417
|
+
init_config();
|
|
1418
|
+
init_prompts();
|
|
1419
|
+
init_claude();
|
|
1420
|
+
init_loop();
|
|
1421
|
+
__dirname = (0, import_node_path2.dirname)((0, import_node_url.fileURLToPath)(importMetaUrl));
|
|
1422
|
+
LOCAL_TEMPLATES_DIR = ".chiefwiggum/templates";
|
|
1423
|
+
CONFIG_FILE = ".chiefwiggum/CLAUDE.md";
|
|
1424
|
+
BUNDLED_TEMPLATES_DIR = (0, import_node_path2.join)(__dirname, "..", "templates");
|
|
1425
|
+
SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
1426
|
+
"node_modules",
|
|
1427
|
+
".git",
|
|
1428
|
+
".chiefwiggum",
|
|
1429
|
+
"dist",
|
|
1430
|
+
"build",
|
|
1431
|
+
".next",
|
|
1432
|
+
"vendor",
|
|
1433
|
+
"coverage"
|
|
1434
|
+
]);
|
|
1435
|
+
}
|
|
1436
|
+
});
|
|
1437
|
+
|
|
1438
|
+
// src/cli.ts
|
|
1439
|
+
init_cjs_shims();
|
|
1440
|
+
var import_commander = require("commander");
|
|
1441
|
+
var import_picocolors10 = __toESM(require("picocolors"), 1);
|
|
1442
|
+
var import_node_fs6 = require("fs");
|
|
1443
|
+
var import_node_path3 = require("path");
|
|
1444
|
+
var import_node_url2 = require("url");
|
|
1445
|
+
|
|
1446
|
+
// src/utils/banner.ts
|
|
1447
|
+
init_cjs_shims();
|
|
1448
|
+
var import_picocolors2 = __toESM(require("picocolors"), 1);
|
|
1449
|
+
var import_node_child_process = require("child_process");
|
|
1450
|
+
init_prompts();
|
|
1451
|
+
var WIGGUM_ART = `
|
|
1452
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28C0\u2834\u281A\u28A2\u2840\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1453
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28A0\u280B\u2819\u2812\u2822\u2806\u2826\u2822\u2812\u2812\u2809\u2800\u2800\u2800\u2800\u2808\u2813\u2826\u28E0\u2880\u2800\u2800\u2800\u2800\u2800\u2800\u2840\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1454
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28E0\u2803\u2801\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2801\u2809\u2819\u2818\u2818\u280A\u2809\u2808\u28C7\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1455
|
+
\u2800\u2800\u2800\u2800\u2800\u2880\u2824\u2814\u280D\u2800\u2800\u2800\u2800\u2800\u2800\u28A4\u28A2\u2880\u2880\u2880\u2884\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2808\u28A6\u2840\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1456
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u28B3\u2840\u2800\u2800\u2800\u2800\u2800\u28C4\u281C\u2801\u28C0\u28C1\u2809\u2808\u28B8\u2844\u28C4\u28A4\u28A0\u2884\u2884\u28C0\u2840\u2840\u2840\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2811\u28A6\u2880\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1457
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2818\u2826\u28C0\u2800\u2800\u2808\u28C6\u2800\u28B8\u2800\u2800\u28B9\u2800\u28B0\u28C1\u28C0\u28C0\u2880\u28C0\u28C0\u2880\u2808\u2808\u2818\u2818\u2814\u2824\u28C0\u2800\u2800\u2800\u2800\u2800\u2800\u2811\u2831\u2884\u2884\u2800\u2800\u2800\u2800\u2800
|
|
1458
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2808\u2813\u2822\u284E\u284A\u28E3\u288C\u2812\u2814\u280A\u28E0\u280B\u2880\u2880\u2880\u2881\u2880\u2880\u2801\u2849\u2819\u28B2\u2812\u2832\u2884\u2800\u2809\u2832\u2884\u2800\u2800\u2800\u2800\u2800\u2880\u28A1\u283B\u2801\u2800\u2800\u2800
|
|
1459
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28BB\u28C8\u28E4\u28EC\u28FF\u28FE\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FE\u287F\u281E\u2866\u2864\u282F\u2884\u28C0\u2800\u28A8\u2826\u2824\u2824\u2832\u2818\u2818\u2808\u2800\u2800\u2800\u2800\u2800
|
|
1460
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2880\u28E4\u28F6\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u283F\u281F\u280B\u2801\u2800\u28B8\u2801\u2800\u2800\u2800\u2808\u2811\u2897\u2840\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1461
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2830\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28FF\u28BF\u287F\u283F\u287F\u281B\u2809\u2801\u2808\u2809\u2813\u28C4\u2800\u2800\u2818\u28E2\u2800\u2800\u2800\u2800\u2800\u2800\u2819\u2864\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1462
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28E0\u280B\u2800\u2800\u2800\u2800\u2808\u285F\u2800\u2800\u2800\u2800\u2800\u28C0\u2800\u2800\u28B3\u2800\u2800\u2827\u2840\u2800\u2800\u2800\u2800\u2800\u2880\u2887\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1463
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2890\u280E\u2800\u2800\u28F4\u2844\u2800\u2800\u2847\u2800\u2800\u2800\u2800\u2800\u281B\u2803\u2800\u28B8\u2802\u2800\u2800\u2847\u2800\u2880\u2854\u280B\u2809\u281B\u2864\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1464
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28A7\u2800\u2880\u28E0\u2824\u2816\u2816\u283D\u2824\u28C0\u2800\u2800\u2800\u2800\u2800\u2880\u281E\u2800\u2800\u2800\u2827\u2824\u282E\u2800\u281A\u28AB\u2801\u28B8\u2802\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1465
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u285F\u2801\u2840\u2840\u2800\u2800\u28C0\u28C0\u2808\u28F3\u28A4\u28A4\u2824\u281E\u2809\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2820\u2826\u2874\u2803\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1466
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28C0\u2894\u282B\u2882\u2811\u2809\u2800\u2800\u2800\u2802\u2814\u2803\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2808\u2813\u28C4\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1467
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2854\u281C\u2808\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2840\u2880\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2838\u2844\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1468
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2818\u28C6\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2840\u2840\u28C0\u2884\u2884\u28A4\u2822\u2822\u289A\u28D8\u28CD\u28CC\u28E5\u28FF\u28C6\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2847\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1469
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2819\u280A\u283E\u2878\u2858\u28CA\u28DD\u289C\u288C\u28CC\u28C4\u28FE\u28F6\u28F6\u28FE\u28FE\u28FF\u287F\u287F\u28FF\u287F\u2803\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28E8\u2803\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1470
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2801\u2881\u2861\u280E\u2800\u2800\u28F8\u28FF\u28FF\u28FF\u28FF\u280F\u28C1\u28C9\u28A4\u2822\u280A\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2880\u2834\u2801\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1471
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2810\u28C7\u2801\u2800\u2801\u280B\u281B\u281B\u281B\u2819\u2819\u2809\u2802\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28C0\u2834\u2809\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1472
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2878\u280A\u2809\u2802\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2880\u2860\u2854\u281A\u2808\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1473
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2808\u2823\u28C4\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u28C0\u28E0\u2860\u2826\u281A\u2801\u2801\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800
|
|
1474
|
+
\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2809\u2813\u2812\u2832\u2822\u2832\u2812\u2812\u281A\u280A\u2809\u2801\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800\u2800`;
|
|
1475
|
+
var TEXT_BANNER = `
|
|
1476
|
+
${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")}
|
|
1477
|
+
${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")}
|
|
1478
|
+
${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")}`;
|
|
1479
|
+
function createBanner() {
|
|
1480
|
+
const artLines = WIGGUM_ART.split("\n").filter((line) => line.length > 0);
|
|
1481
|
+
const textLines = TEXT_BANNER.split("\n").filter((line) => line.length > 0);
|
|
1482
|
+
return import_picocolors2.default.yellow(artLines.join("\n")) + "\n\n" + textLines.join("\n");
|
|
1483
|
+
}
|
|
1484
|
+
var BANNER = createBanner();
|
|
1485
|
+
async function checkForUpdates(currentVersion) {
|
|
1486
|
+
try {
|
|
1487
|
+
const result = (0, import_node_child_process.execSync)("npm view chiefwiggum version", {
|
|
1488
|
+
timeout: 2e3,
|
|
1489
|
+
encoding: "utf-8",
|
|
1490
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
1491
|
+
}).trim();
|
|
1492
|
+
if (result && result !== currentVersion) {
|
|
1493
|
+
console.log(import_picocolors2.default.cyan(` \u2728 Update available: v${currentVersion} \u2192 v${result}`));
|
|
1494
|
+
console.log();
|
|
1495
|
+
const shouldUpdate = await confirm2({
|
|
1496
|
+
message: "Update now?",
|
|
1497
|
+
initialValue: true
|
|
1498
|
+
});
|
|
1499
|
+
if (shouldUpdate) {
|
|
1500
|
+
console.log(import_picocolors2.default.cyan("Updating..."));
|
|
1501
|
+
(0, import_node_child_process.execSync)("npm install -g chiefwiggum@latest", { stdio: "inherit" });
|
|
1502
|
+
console.log(import_picocolors2.default.green("\u2713 Updated! Please run your command again."));
|
|
1503
|
+
process.exit(0);
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
} catch {
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
async function showBanner(version2) {
|
|
1510
|
+
console.log(BANNER);
|
|
1511
|
+
console.log(import_picocolors2.default.yellow(` Autonomous Coding Agent v${version2}`));
|
|
1512
|
+
console.log();
|
|
1513
|
+
await checkForUpdates(version2);
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
// src/cli.ts
|
|
1517
|
+
init_process();
|
|
1518
|
+
|
|
1519
|
+
// src/commands/status.ts
|
|
1520
|
+
init_cjs_shims();
|
|
1521
|
+
var import_node_fs = require("fs");
|
|
1522
|
+
var import_node_child_process3 = require("child_process");
|
|
1523
|
+
var import_picocolors4 = __toESM(require("picocolors"), 1);
|
|
1524
|
+
init_config();
|
|
1525
|
+
async function cmdStatus() {
|
|
1526
|
+
console.log(import_picocolors4.default.bold("Project Status"));
|
|
1527
|
+
console.log();
|
|
1528
|
+
const hasTodo = (0, import_node_fs.existsSync)(config.todoFile);
|
|
1529
|
+
const hasSpecs = (0, import_node_fs.existsSync)("specs");
|
|
1530
|
+
const hasClaudeMd = (0, import_node_fs.existsSync)("CLAUDE.md");
|
|
1531
|
+
const check = (exists) => exists ? import_picocolors4.default.green("\u2713") : import_picocolors4.default.red("\u2717");
|
|
1532
|
+
console.log(` TODO.md: ${check(hasTodo)}`);
|
|
1533
|
+
console.log(` specs/: ${check(hasSpecs)}`);
|
|
1534
|
+
console.log(` CLAUDE.md: ${check(hasClaudeMd)}`);
|
|
1535
|
+
console.log();
|
|
1536
|
+
if (hasTodo) {
|
|
1537
|
+
try {
|
|
1538
|
+
const content = (0, import_node_fs.readFileSync)(config.todoFile, "utf-8");
|
|
1539
|
+
const lines = content.split("\n");
|
|
1540
|
+
let total = 0;
|
|
1541
|
+
let done = 0;
|
|
1542
|
+
for (const line of lines) {
|
|
1543
|
+
if (/^\s*-\s*\[.\]/.test(line)) {
|
|
1544
|
+
total++;
|
|
1545
|
+
if (/^\s*-\s*\[x\]/i.test(line)) {
|
|
1546
|
+
done++;
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
const remaining = total - done;
|
|
1551
|
+
console.log(import_picocolors4.default.bold("Tasks"));
|
|
1552
|
+
console.log(` Total: ${total}`);
|
|
1553
|
+
console.log(` Completed: ${import_picocolors4.default.green(String(done))}`);
|
|
1554
|
+
console.log(` Remaining: ${import_picocolors4.default.yellow(String(remaining))}`);
|
|
1555
|
+
console.log();
|
|
1556
|
+
} catch {
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
try {
|
|
1560
|
+
(0, import_node_child_process3.execSync)("git rev-parse --git-dir", { stdio: "pipe" });
|
|
1561
|
+
const branch = (0, import_node_child_process3.execSync)("git branch --show-current", { encoding: "utf-8" }).trim() || "unknown";
|
|
1562
|
+
const commits = (0, import_node_child_process3.execSync)("git rev-list --count HEAD", { encoding: "utf-8" }).trim() || "0";
|
|
1563
|
+
console.log(import_picocolors4.default.bold("Git"));
|
|
1564
|
+
console.log(` Branch: ${branch}`);
|
|
1565
|
+
console.log(` Commits: ${commits}`);
|
|
1566
|
+
} catch {
|
|
1567
|
+
}
|
|
1568
|
+
console.log();
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
// src/cli.ts
|
|
1572
|
+
init_new();
|
|
1573
|
+
init_loop();
|
|
1474
1574
|
|
|
1475
1575
|
// src/commands/clean.ts
|
|
1576
|
+
init_cjs_shims();
|
|
1476
1577
|
var import_node_fs4 = require("fs");
|
|
1477
1578
|
var import_picocolors8 = __toESM(require("picocolors"), 1);
|
|
1579
|
+
init_prompts();
|
|
1478
1580
|
async function cmdClean() {
|
|
1479
1581
|
console.log(import_picocolors8.default.bold("Clean Project"));
|
|
1480
1582
|
console.log();
|
|
@@ -1509,9 +1611,11 @@ async function cmdClean() {
|
|
|
1509
1611
|
}
|
|
1510
1612
|
|
|
1511
1613
|
// src/commands/config.ts
|
|
1614
|
+
init_cjs_shims();
|
|
1512
1615
|
var import_node_fs5 = require("fs");
|
|
1513
1616
|
var import_node_child_process7 = require("child_process");
|
|
1514
1617
|
var import_picocolors9 = __toESM(require("picocolors"), 1);
|
|
1618
|
+
init_prompts();
|
|
1515
1619
|
var CONFIG_FILE2 = ".chiefwiggum/CLAUDE.md";
|
|
1516
1620
|
function stripTrailingCommas2(json) {
|
|
1517
1621
|
return json.replace(/,(\s*[}\]])/g, "$1");
|
|
@@ -1745,7 +1849,7 @@ async function main() {
|
|
|
1745
1849
|
await showBanner(version);
|
|
1746
1850
|
await cmdNew(plan);
|
|
1747
1851
|
});
|
|
1748
|
-
program.command("loop").description("Run the build loop
|
|
1852
|
+
program.command("loop").description("Run the build loop (TODO.md or GitHub Issues)").action(async () => {
|
|
1749
1853
|
await showBanner(version);
|
|
1750
1854
|
await cmdLoop();
|
|
1751
1855
|
});
|
|
@@ -1764,10 +1868,12 @@ async function main() {
|
|
|
1764
1868
|
program.action(async () => {
|
|
1765
1869
|
await showBanner(version);
|
|
1766
1870
|
const { existsSync: existsSync6 } = await import("fs");
|
|
1767
|
-
|
|
1871
|
+
const { getProjectTracker: getProjectTracker2 } = await Promise.resolve().then(() => (init_new(), new_exports));
|
|
1872
|
+
const tracker = getProjectTracker2();
|
|
1873
|
+
if (tracker === "github" || existsSync6("TODO.md") || existsSync6(".chiefwiggum/CLAUDE.md")) {
|
|
1768
1874
|
await cmdLoop();
|
|
1769
1875
|
} else {
|
|
1770
|
-
console.log(import_picocolors10.default.yellow("No
|
|
1876
|
+
console.log(import_picocolors10.default.yellow("No project configured. Run 'chiefwiggum new' to get started."));
|
|
1771
1877
|
process.exit(1);
|
|
1772
1878
|
}
|
|
1773
1879
|
});
|