chiefwiggum 1.3.32 → 1.3.35
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 +389 -184
- 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;
|
|
@@ -602,11 +497,20 @@ async function runTaskIteration(iteration, useGitHub = false) {
|
|
|
602
497
|
}
|
|
603
498
|
return lastResult;
|
|
604
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
|
+
});
|
|
605
512
|
|
|
606
513
|
// src/commands/loop.ts
|
|
607
|
-
var import_node_fs2 = require("fs");
|
|
608
|
-
var import_node_child_process5 = require("child_process");
|
|
609
|
-
var import_picocolors6 = __toESM(require("picocolors"), 1);
|
|
610
514
|
function countUncheckedTasks() {
|
|
611
515
|
if (!(0, import_node_fs2.existsSync)(config.todoFile)) return 0;
|
|
612
516
|
const content = (0, import_node_fs2.readFileSync)(config.todoFile, "utf-8");
|
|
@@ -646,6 +550,17 @@ function hasOpenIssues() {
|
|
|
646
550
|
return false;
|
|
647
551
|
}
|
|
648
552
|
}
|
|
553
|
+
function countClosedIssues() {
|
|
554
|
+
try {
|
|
555
|
+
const output = (0, import_node_child_process5.execSync)(
|
|
556
|
+
"gh issue list --state closed --json number --jq 'length'",
|
|
557
|
+
{ encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 3e4 }
|
|
558
|
+
);
|
|
559
|
+
return parseInt(output.trim(), 10) || 0;
|
|
560
|
+
} catch {
|
|
561
|
+
return 0;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
649
564
|
function getCurrentCommit() {
|
|
650
565
|
try {
|
|
651
566
|
return (0, import_node_child_process5.execSync)("git rev-parse HEAD", { encoding: "utf-8" }).trim();
|
|
@@ -653,6 +568,106 @@ function getCurrentCommit() {
|
|
|
653
568
|
return "none";
|
|
654
569
|
}
|
|
655
570
|
}
|
|
571
|
+
function getLinkedProjectNumber() {
|
|
572
|
+
try {
|
|
573
|
+
const output = (0, import_node_child_process5.execSync)(
|
|
574
|
+
"gh repo view --json projectsV2 -q '.projectsV2.nodes[0].number'",
|
|
575
|
+
{ encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 3e4 }
|
|
576
|
+
);
|
|
577
|
+
const num = output.trim();
|
|
578
|
+
return num && num !== "null" ? num : null;
|
|
579
|
+
} catch {
|
|
580
|
+
return null;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
async function ensureProjectLinked() {
|
|
584
|
+
if (getLinkedProjectNumber()) {
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
const configuredProject = getGithubProject();
|
|
588
|
+
console.log();
|
|
589
|
+
console.log(import_picocolors6.default.yellow("\u26A0 No project board is linked to this repo."));
|
|
590
|
+
console.log(import_picocolors6.default.dim(" This is required for automatic status updates."));
|
|
591
|
+
console.log();
|
|
592
|
+
let repoName = "";
|
|
593
|
+
let owner = "";
|
|
594
|
+
try {
|
|
595
|
+
repoName = (0, import_node_child_process5.execSync)("gh repo view --json nameWithOwner -q .nameWithOwner", {
|
|
596
|
+
encoding: "utf-8",
|
|
597
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
598
|
+
}).trim();
|
|
599
|
+
owner = repoName.split("/")[0];
|
|
600
|
+
} catch {
|
|
601
|
+
console.log(import_picocolors6.default.red("Could not detect GitHub repo."));
|
|
602
|
+
console.log(import_picocolors6.default.dim("Continuing without project board integration..."));
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
let existingProjects = [];
|
|
606
|
+
try {
|
|
607
|
+
const projectsOutput = (0, import_node_child_process5.execSync)(`gh project list --owner ${owner} --format json`, {
|
|
608
|
+
encoding: "utf-8",
|
|
609
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
610
|
+
});
|
|
611
|
+
const projects = JSON.parse(projectsOutput);
|
|
612
|
+
existingProjects = projects.projects?.map((p2) => ({
|
|
613
|
+
title: p2.title,
|
|
614
|
+
number: p2.number
|
|
615
|
+
})) || [];
|
|
616
|
+
} catch {
|
|
617
|
+
}
|
|
618
|
+
const options = [
|
|
619
|
+
...existingProjects.map((p2) => ({
|
|
620
|
+
value: String(p2.number),
|
|
621
|
+
label: p2.title,
|
|
622
|
+
hint: configuredProject === p2.title ? "configured" : void 0
|
|
623
|
+
})),
|
|
624
|
+
{ value: "__new__", label: "Create new board..." },
|
|
625
|
+
{ value: "__skip__", label: "Skip (automation will be limited)" }
|
|
626
|
+
];
|
|
627
|
+
const selected = await select2({
|
|
628
|
+
message: "Link a project board to this repo?",
|
|
629
|
+
options
|
|
630
|
+
});
|
|
631
|
+
if (selected === "__skip__") {
|
|
632
|
+
console.log(import_picocolors6.default.dim("Continuing without project board integration..."));
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
if (selected === "__new__") {
|
|
636
|
+
const projectName = await text2({
|
|
637
|
+
message: "Board name",
|
|
638
|
+
placeholder: "e.g., My Project Kanban"
|
|
639
|
+
});
|
|
640
|
+
console.log(import_picocolors6.default.cyan(`Creating board "${projectName}"...`));
|
|
641
|
+
try {
|
|
642
|
+
const createOutput = (0, import_node_child_process5.execSync)(
|
|
643
|
+
`gh project create --owner ${owner} --title "${projectName}"`,
|
|
644
|
+
{ encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }
|
|
645
|
+
);
|
|
646
|
+
const projectNumberMatch = createOutput.match(/projects\/(\d+)/);
|
|
647
|
+
const projectNumber = projectNumberMatch ? projectNumberMatch[1] : null;
|
|
648
|
+
if (projectNumber) {
|
|
649
|
+
(0, import_node_child_process5.execSync)(`gh project link ${projectNumber} --owner ${owner} --repo ${repoName}`, {
|
|
650
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
651
|
+
});
|
|
652
|
+
console.log(import_picocolors6.default.green(`\u2713 Board "${projectName}" created and linked`));
|
|
653
|
+
}
|
|
654
|
+
} catch (err) {
|
|
655
|
+
console.log(import_picocolors6.default.yellow("Could not create board. Continuing without project integration..."));
|
|
656
|
+
}
|
|
657
|
+
} else {
|
|
658
|
+
const projectNumber = selected;
|
|
659
|
+
const projectTitle = existingProjects.find((p2) => String(p2.number) === projectNumber)?.title || projectNumber;
|
|
660
|
+
try {
|
|
661
|
+
(0, import_node_child_process5.execSync)(`gh project link ${projectNumber} --owner ${owner} --repo ${repoName}`, {
|
|
662
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
663
|
+
});
|
|
664
|
+
console.log(import_picocolors6.default.green(`\u2713 Linked "${projectTitle}" to ${repoName}`));
|
|
665
|
+
} catch {
|
|
666
|
+
console.log(import_picocolors6.default.yellow("Could not link project. It may already be linked."));
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
console.log();
|
|
670
|
+
}
|
|
656
671
|
function pushToOrigin() {
|
|
657
672
|
try {
|
|
658
673
|
(0, import_node_child_process5.execSync)("git push origin HEAD", { stdio: "pipe" });
|
|
@@ -663,11 +678,16 @@ function pushToOrigin() {
|
|
|
663
678
|
async function cmdLoop() {
|
|
664
679
|
const tracker = getProjectTracker();
|
|
665
680
|
const isGitHub = tracker === "github";
|
|
681
|
+
if (isGitHub) {
|
|
682
|
+
await ensureProjectLinked();
|
|
683
|
+
}
|
|
666
684
|
let maxIterations;
|
|
667
685
|
let hasRemainingTasks;
|
|
668
686
|
let trackerLabel;
|
|
687
|
+
let completedCount = 0;
|
|
669
688
|
if (isGitHub) {
|
|
670
689
|
maxIterations = countOpenIssues();
|
|
690
|
+
completedCount = countClosedIssues();
|
|
671
691
|
hasRemainingTasks = hasOpenIssues;
|
|
672
692
|
trackerLabel = "Issues";
|
|
673
693
|
if (maxIterations === 0) {
|
|
@@ -690,7 +710,12 @@ async function cmdLoop() {
|
|
|
690
710
|
console.log();
|
|
691
711
|
console.log(import_picocolors6.default.green("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550"));
|
|
692
712
|
console.log(import_picocolors6.default.green(" Starting Build Loop"));
|
|
693
|
-
|
|
713
|
+
if (isGitHub && completedCount > 0) {
|
|
714
|
+
const total = maxIterations + completedCount;
|
|
715
|
+
console.log(import_picocolors6.default.green(` ${trackerLabel}: ${maxIterations} remaining, ${completedCount} done (${total} total)`));
|
|
716
|
+
} else {
|
|
717
|
+
console.log(import_picocolors6.default.green(` ${trackerLabel} remaining: ${maxIterations}`));
|
|
718
|
+
}
|
|
694
719
|
console.log(import_picocolors6.default.green(` Timeout: ${config.iterationTimeoutMinutes}m per task`));
|
|
695
720
|
console.log(import_picocolors6.default.green("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550"));
|
|
696
721
|
let consecutiveFailures = 0;
|
|
@@ -745,11 +770,29 @@ async function cmdLoop() {
|
|
|
745
770
|
console.log(import_picocolors6.default.yellow(`Reached max iterations (${maxIterations})`));
|
|
746
771
|
pushToOrigin();
|
|
747
772
|
}
|
|
773
|
+
var import_node_fs2, import_node_child_process5, import_picocolors6;
|
|
774
|
+
var init_loop = __esm({
|
|
775
|
+
"src/commands/loop.ts"() {
|
|
776
|
+
"use strict";
|
|
777
|
+
init_cjs_shims();
|
|
778
|
+
import_node_fs2 = require("fs");
|
|
779
|
+
import_node_child_process5 = require("child_process");
|
|
780
|
+
import_picocolors6 = __toESM(require("picocolors"), 1);
|
|
781
|
+
init_config();
|
|
782
|
+
init_claude();
|
|
783
|
+
init_process();
|
|
784
|
+
init_new();
|
|
785
|
+
init_prompts();
|
|
786
|
+
}
|
|
787
|
+
});
|
|
748
788
|
|
|
749
789
|
// src/commands/new.ts
|
|
750
|
-
var
|
|
751
|
-
|
|
752
|
-
|
|
790
|
+
var new_exports = {};
|
|
791
|
+
__export(new_exports, {
|
|
792
|
+
cmdNew: () => cmdNew,
|
|
793
|
+
getGithubProject: () => getGithubProject,
|
|
794
|
+
getProjectTracker: () => getProjectTracker
|
|
795
|
+
});
|
|
753
796
|
function stripTrailingCommas(json) {
|
|
754
797
|
return json.replace(/,(\s*[}\]])/g, "$1");
|
|
755
798
|
}
|
|
@@ -799,17 +842,6 @@ function countOpenGitHubIssues() {
|
|
|
799
842
|
return 0;
|
|
800
843
|
}
|
|
801
844
|
}
|
|
802
|
-
var BUNDLED_TEMPLATES_DIR = (0, import_node_path2.join)(__dirname, "..", "templates");
|
|
803
|
-
var SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
804
|
-
"node_modules",
|
|
805
|
-
".git",
|
|
806
|
-
".chiefwiggum",
|
|
807
|
-
"dist",
|
|
808
|
-
"build",
|
|
809
|
-
".next",
|
|
810
|
-
"vendor",
|
|
811
|
-
"coverage"
|
|
812
|
-
]);
|
|
813
845
|
function findMarkdownFiles(dir, basePath = "") {
|
|
814
846
|
const results = [];
|
|
815
847
|
try {
|
|
@@ -1494,10 +1526,179 @@ Write directly to ${todoFile}.`;
|
|
|
1494
1526
|
} catch {
|
|
1495
1527
|
}
|
|
1496
1528
|
}
|
|
1529
|
+
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;
|
|
1530
|
+
var init_new = __esm({
|
|
1531
|
+
"src/commands/new.ts"() {
|
|
1532
|
+
"use strict";
|
|
1533
|
+
init_cjs_shims();
|
|
1534
|
+
import_node_fs3 = require("fs");
|
|
1535
|
+
import_node_child_process6 = require("child_process");
|
|
1536
|
+
import_node_path2 = require("path");
|
|
1537
|
+
import_node_url = require("url");
|
|
1538
|
+
import_picocolors7 = __toESM(require("picocolors"), 1);
|
|
1539
|
+
init_config();
|
|
1540
|
+
init_prompts();
|
|
1541
|
+
init_claude();
|
|
1542
|
+
init_loop();
|
|
1543
|
+
__dirname = (0, import_node_path2.dirname)((0, import_node_url.fileURLToPath)(importMetaUrl));
|
|
1544
|
+
LOCAL_TEMPLATES_DIR = ".chiefwiggum/templates";
|
|
1545
|
+
CONFIG_FILE = ".chiefwiggum/CLAUDE.md";
|
|
1546
|
+
BUNDLED_TEMPLATES_DIR = (0, import_node_path2.join)(__dirname, "..", "templates");
|
|
1547
|
+
SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
1548
|
+
"node_modules",
|
|
1549
|
+
".git",
|
|
1550
|
+
".chiefwiggum",
|
|
1551
|
+
"dist",
|
|
1552
|
+
"build",
|
|
1553
|
+
".next",
|
|
1554
|
+
"vendor",
|
|
1555
|
+
"coverage"
|
|
1556
|
+
]);
|
|
1557
|
+
}
|
|
1558
|
+
});
|
|
1559
|
+
|
|
1560
|
+
// src/cli.ts
|
|
1561
|
+
init_cjs_shims();
|
|
1562
|
+
var import_commander = require("commander");
|
|
1563
|
+
var import_picocolors10 = __toESM(require("picocolors"), 1);
|
|
1564
|
+
var import_node_fs6 = require("fs");
|
|
1565
|
+
var import_node_path3 = require("path");
|
|
1566
|
+
var import_node_url2 = require("url");
|
|
1567
|
+
|
|
1568
|
+
// src/utils/banner.ts
|
|
1569
|
+
init_cjs_shims();
|
|
1570
|
+
var import_picocolors2 = __toESM(require("picocolors"), 1);
|
|
1571
|
+
var import_node_child_process = require("child_process");
|
|
1572
|
+
init_prompts();
|
|
1573
|
+
var WIGGUM_ART = `
|
|
1574
|
+
\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
|
|
1575
|
+
\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
|
|
1576
|
+
\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
|
|
1577
|
+
\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
|
|
1578
|
+
\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
|
|
1579
|
+
\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
|
|
1580
|
+
\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
|
|
1581
|
+
\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
|
|
1582
|
+
\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
|
|
1583
|
+
\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
|
|
1584
|
+
\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
|
|
1585
|
+
\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
|
|
1586
|
+
\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
|
|
1587
|
+
\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
|
|
1588
|
+
\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
|
|
1589
|
+
\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
|
|
1590
|
+
\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
|
|
1591
|
+
\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
|
|
1592
|
+
\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
|
|
1593
|
+
\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
|
|
1594
|
+
\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
|
|
1595
|
+
\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
|
|
1596
|
+
\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`;
|
|
1597
|
+
var TEXT_BANNER = `
|
|
1598
|
+
${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")}
|
|
1599
|
+
${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")}
|
|
1600
|
+
${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")}`;
|
|
1601
|
+
function createBanner() {
|
|
1602
|
+
const artLines = WIGGUM_ART.split("\n").filter((line) => line.length > 0);
|
|
1603
|
+
const textLines = TEXT_BANNER.split("\n").filter((line) => line.length > 0);
|
|
1604
|
+
return import_picocolors2.default.yellow(artLines.join("\n")) + "\n\n" + textLines.join("\n");
|
|
1605
|
+
}
|
|
1606
|
+
var BANNER = createBanner();
|
|
1607
|
+
async function checkForUpdates(currentVersion) {
|
|
1608
|
+
try {
|
|
1609
|
+
const result = (0, import_node_child_process.execSync)("npm view chiefwiggum version", {
|
|
1610
|
+
timeout: 2e3,
|
|
1611
|
+
encoding: "utf-8",
|
|
1612
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
1613
|
+
}).trim();
|
|
1614
|
+
if (result && result !== currentVersion) {
|
|
1615
|
+
console.log(import_picocolors2.default.cyan(` \u2728 Update available: v${currentVersion} \u2192 v${result}`));
|
|
1616
|
+
console.log();
|
|
1617
|
+
const shouldUpdate = await confirm2({
|
|
1618
|
+
message: "Update now?",
|
|
1619
|
+
initialValue: true
|
|
1620
|
+
});
|
|
1621
|
+
if (shouldUpdate) {
|
|
1622
|
+
console.log(import_picocolors2.default.cyan("Updating..."));
|
|
1623
|
+
(0, import_node_child_process.execSync)("npm install -g chiefwiggum@latest", { stdio: "inherit" });
|
|
1624
|
+
console.log(import_picocolors2.default.green("\u2713 Updated! Please run your command again."));
|
|
1625
|
+
process.exit(0);
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
} catch {
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
async function showBanner(version2) {
|
|
1632
|
+
console.log(BANNER);
|
|
1633
|
+
console.log(import_picocolors2.default.yellow(` Autonomous Coding Agent v${version2}`));
|
|
1634
|
+
console.log();
|
|
1635
|
+
await checkForUpdates(version2);
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
// src/cli.ts
|
|
1639
|
+
init_process();
|
|
1640
|
+
|
|
1641
|
+
// src/commands/status.ts
|
|
1642
|
+
init_cjs_shims();
|
|
1643
|
+
var import_node_fs = require("fs");
|
|
1644
|
+
var import_node_child_process3 = require("child_process");
|
|
1645
|
+
var import_picocolors4 = __toESM(require("picocolors"), 1);
|
|
1646
|
+
init_config();
|
|
1647
|
+
async function cmdStatus() {
|
|
1648
|
+
console.log(import_picocolors4.default.bold("Project Status"));
|
|
1649
|
+
console.log();
|
|
1650
|
+
const hasTodo = (0, import_node_fs.existsSync)(config.todoFile);
|
|
1651
|
+
const hasSpecs = (0, import_node_fs.existsSync)("specs");
|
|
1652
|
+
const hasClaudeMd = (0, import_node_fs.existsSync)("CLAUDE.md");
|
|
1653
|
+
const check = (exists) => exists ? import_picocolors4.default.green("\u2713") : import_picocolors4.default.red("\u2717");
|
|
1654
|
+
console.log(` TODO.md: ${check(hasTodo)}`);
|
|
1655
|
+
console.log(` specs/: ${check(hasSpecs)}`);
|
|
1656
|
+
console.log(` CLAUDE.md: ${check(hasClaudeMd)}`);
|
|
1657
|
+
console.log();
|
|
1658
|
+
if (hasTodo) {
|
|
1659
|
+
try {
|
|
1660
|
+
const content = (0, import_node_fs.readFileSync)(config.todoFile, "utf-8");
|
|
1661
|
+
const lines = content.split("\n");
|
|
1662
|
+
let total = 0;
|
|
1663
|
+
let done = 0;
|
|
1664
|
+
for (const line of lines) {
|
|
1665
|
+
if (/^\s*-\s*\[.\]/.test(line)) {
|
|
1666
|
+
total++;
|
|
1667
|
+
if (/^\s*-\s*\[x\]/i.test(line)) {
|
|
1668
|
+
done++;
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
const remaining = total - done;
|
|
1673
|
+
console.log(import_picocolors4.default.bold("Tasks"));
|
|
1674
|
+
console.log(` Total: ${total}`);
|
|
1675
|
+
console.log(` Completed: ${import_picocolors4.default.green(String(done))}`);
|
|
1676
|
+
console.log(` Remaining: ${import_picocolors4.default.yellow(String(remaining))}`);
|
|
1677
|
+
console.log();
|
|
1678
|
+
} catch {
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
try {
|
|
1682
|
+
(0, import_node_child_process3.execSync)("git rev-parse --git-dir", { stdio: "pipe" });
|
|
1683
|
+
const branch = (0, import_node_child_process3.execSync)("git branch --show-current", { encoding: "utf-8" }).trim() || "unknown";
|
|
1684
|
+
const commits = (0, import_node_child_process3.execSync)("git rev-list --count HEAD", { encoding: "utf-8" }).trim() || "0";
|
|
1685
|
+
console.log(import_picocolors4.default.bold("Git"));
|
|
1686
|
+
console.log(` Branch: ${branch}`);
|
|
1687
|
+
console.log(` Commits: ${commits}`);
|
|
1688
|
+
} catch {
|
|
1689
|
+
}
|
|
1690
|
+
console.log();
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1693
|
+
// src/cli.ts
|
|
1694
|
+
init_new();
|
|
1695
|
+
init_loop();
|
|
1497
1696
|
|
|
1498
1697
|
// src/commands/clean.ts
|
|
1698
|
+
init_cjs_shims();
|
|
1499
1699
|
var import_node_fs4 = require("fs");
|
|
1500
1700
|
var import_picocolors8 = __toESM(require("picocolors"), 1);
|
|
1701
|
+
init_prompts();
|
|
1501
1702
|
async function cmdClean() {
|
|
1502
1703
|
console.log(import_picocolors8.default.bold("Clean Project"));
|
|
1503
1704
|
console.log();
|
|
@@ -1532,9 +1733,11 @@ async function cmdClean() {
|
|
|
1532
1733
|
}
|
|
1533
1734
|
|
|
1534
1735
|
// src/commands/config.ts
|
|
1736
|
+
init_cjs_shims();
|
|
1535
1737
|
var import_node_fs5 = require("fs");
|
|
1536
1738
|
var import_node_child_process7 = require("child_process");
|
|
1537
1739
|
var import_picocolors9 = __toESM(require("picocolors"), 1);
|
|
1740
|
+
init_prompts();
|
|
1538
1741
|
var CONFIG_FILE2 = ".chiefwiggum/CLAUDE.md";
|
|
1539
1742
|
function stripTrailingCommas2(json) {
|
|
1540
1743
|
return json.replace(/,(\s*[}\]])/g, "$1");
|
|
@@ -1768,7 +1971,7 @@ async function main() {
|
|
|
1768
1971
|
await showBanner(version);
|
|
1769
1972
|
await cmdNew(plan);
|
|
1770
1973
|
});
|
|
1771
|
-
program.command("loop").description("Run the build loop
|
|
1974
|
+
program.command("loop").description("Run the build loop (TODO.md or GitHub Issues)").action(async () => {
|
|
1772
1975
|
await showBanner(version);
|
|
1773
1976
|
await cmdLoop();
|
|
1774
1977
|
});
|
|
@@ -1787,10 +1990,12 @@ async function main() {
|
|
|
1787
1990
|
program.action(async () => {
|
|
1788
1991
|
await showBanner(version);
|
|
1789
1992
|
const { existsSync: existsSync6 } = await import("fs");
|
|
1790
|
-
|
|
1993
|
+
const { getProjectTracker: getProjectTracker2 } = await Promise.resolve().then(() => (init_new(), new_exports));
|
|
1994
|
+
const tracker = getProjectTracker2();
|
|
1995
|
+
if (tracker === "github" || existsSync6("TODO.md") || existsSync6(".chiefwiggum/CLAUDE.md")) {
|
|
1791
1996
|
await cmdLoop();
|
|
1792
1997
|
} else {
|
|
1793
|
-
console.log(import_picocolors10.default.yellow("No
|
|
1998
|
+
console.log(import_picocolors10.default.yellow("No project configured. Run 'chiefwiggum new' to get started."));
|
|
1794
1999
|
process.exit(1);
|
|
1795
2000
|
}
|
|
1796
2001
|
});
|