chiefwiggum 1.3.2 → 1.3.3

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.
Files changed (2) hide show
  1. package/dist/cli.cjs +87 -76
  2. 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 import_picocolors = __toESM(require("picocolors"), 1);
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
- ${import_picocolors.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")}
42
- ${import_picocolors.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")}
43
- ${import_picocolors.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")}`;
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(import_picocolors.default.cyan(` \u2728 Update available: v${currentVersion} \u2192 v${result}`));
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(import_picocolors.default.yellow(` Autonomous Coding Agent v${version2}`));
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 import_picocolors2 = __toESM(require("picocolors"), 1);
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(import_picocolors2.default.yellow("Interrupted."));
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(import_picocolors2.default.red("Uncaught exception:"), err.message);
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(import_picocolors2.default.red("Unhandled rejection:"), reason);
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 import_picocolors3 = __toESM(require("picocolors"), 1);
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(import_picocolors3.default.bold("Project Status"));
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 ? import_picocolors3.default.green("\u2713") : import_picocolors3.default.red("\u2717");
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(import_picocolors3.default.bold("Tasks"));
236
+ console.log(import_picocolors4.default.bold("Tasks"));
168
237
  console.log(` Total: ${total}`);
169
- console.log(` Completed: ${import_picocolors3.default.green(String(done))}`);
170
- console.log(` Remaining: ${import_picocolors3.default.yellow(String(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(import_picocolors3.default.bold("Git"));
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");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chiefwiggum",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Autonomous coding agent CLI. Point it at a plan, watch it build.",
5
5
  "type": "module",
6
6
  "bin": {