codemaxxing 0.2.0 → 0.3.0

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/index.js CHANGED
@@ -54,6 +54,10 @@ const SLASH_COMMANDS = [
54
54
  { cmd: "/skills search", desc: "search registry" },
55
55
  { cmd: "/skills on", desc: "enable skill for session" },
56
56
  { cmd: "/skills off", desc: "disable skill for session" },
57
+ { cmd: "/architect", desc: "toggle architect mode" },
58
+ { cmd: "/lint", desc: "show auto-lint status" },
59
+ { cmd: "/lint on", desc: "enable auto-lint" },
60
+ { cmd: "/lint off", desc: "disable auto-lint" },
57
61
  { cmd: "/quit", desc: "exit" },
58
62
  ];
59
63
  const SPINNER_FRAMES = ["⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"];
@@ -236,6 +240,12 @@ function App() {
236
240
  const savedStr = saved >= 1000 ? `${(saved / 1000).toFixed(1)}k` : String(saved);
237
241
  addMsg("info", `📦 Context compressed (~${savedStr} tokens freed)`);
238
242
  },
243
+ onArchitectPlan: (plan) => {
244
+ addMsg("info", `🏗️ Architect Plan:\n${plan}`);
245
+ },
246
+ onLintResult: (file, errors) => {
247
+ addMsg("info", `🔍 Lint errors in ${file}:\n${errors}`);
248
+ },
239
249
  contextCompressionThreshold: config.defaults.contextCompressionThreshold,
240
250
  onToolApproval: (name, args, diff) => {
241
251
  return new Promise((resolve) => {
@@ -246,6 +256,12 @@ function App() {
246
256
  });
247
257
  // Initialize async context (repo map)
248
258
  await a.init();
259
+ // Show project rules in banner
260
+ const rulesSource = a.getProjectRulesSource();
261
+ if (rulesSource) {
262
+ info.push(`📋 ${rulesSource} loaded`);
263
+ setConnectionInfo([...info]);
264
+ }
249
265
  setAgent(a);
250
266
  setModelName(provider.model);
251
267
  providerRef.current = { baseUrl: provider.baseUrl, apiKey: provider.apiKey };
@@ -287,7 +303,7 @@ function App() {
287
303
  // Commands that need args (like /commit, /model) — fill input instead of executing
288
304
  if (selected.cmd === "/commit" || selected.cmd === "/model" || selected.cmd === "/session delete" ||
289
305
  selected.cmd === "/skills install" || selected.cmd === "/skills remove" || selected.cmd === "/skills search" ||
290
- selected.cmd === "/skills on" || selected.cmd === "/skills off") {
306
+ selected.cmd === "/skills on" || selected.cmd === "/skills off" || selected.cmd === "/architect") {
291
307
  setInput(selected.cmd + " ");
292
308
  setCmdIndex(0);
293
309
  setInputKey((k) => k + 1);
@@ -347,6 +363,10 @@ function App() {
347
363
  " /git on — enable auto-commits",
348
364
  " /git off — disable auto-commits",
349
365
  " /skills — manage skill packs",
366
+ " /architect — toggle architect mode (plan then execute)",
367
+ " /lint — show auto-lint status & detected linter",
368
+ " /lint on — enable auto-lint",
369
+ " /lint off — disable auto-lint",
350
370
  " /quit — exit",
351
371
  ].join("\n"));
352
372
  return;
@@ -455,6 +475,65 @@ function App() {
455
475
  addMsg("info", `✅ Switched to theme: ${THEMES[themeName].name}`);
456
476
  return;
457
477
  }
478
+ // ── Architect commands (work without agent) ──
479
+ if (trimmed === "/architect") {
480
+ if (!agent) {
481
+ addMsg("info", "🏗️ Architect mode: no agent connected. Connect first with /login or /connect.");
482
+ return;
483
+ }
484
+ const current = agent.getArchitectModel();
485
+ if (current) {
486
+ agent.setArchitectModel(null);
487
+ addMsg("info", "🏗️ Architect mode OFF");
488
+ }
489
+ else {
490
+ // Use config default or a sensible default
491
+ const defaultModel = loadConfig().defaults.architectModel || agent.getModel();
492
+ agent.setArchitectModel(defaultModel);
493
+ addMsg("info", `🏗️ Architect mode ON (planner: ${defaultModel})`);
494
+ }
495
+ return;
496
+ }
497
+ if (trimmed.startsWith("/architect ")) {
498
+ const model = trimmed.replace("/architect ", "").trim();
499
+ if (!model) {
500
+ addMsg("info", "Usage: /architect <model> or /architect to toggle");
501
+ return;
502
+ }
503
+ if (agent) {
504
+ agent.setArchitectModel(model);
505
+ addMsg("info", `🏗️ Architect mode ON (planner: ${model})`);
506
+ }
507
+ else {
508
+ addMsg("info", "⚠ No agent connected. Connect first.");
509
+ }
510
+ return;
511
+ }
512
+ // ── Lint commands (work without agent) ──
513
+ if (trimmed === "/lint") {
514
+ const { detectLinter } = await import("./utils/lint.js");
515
+ const linter = detectLinter(process.cwd());
516
+ const enabled = agent ? agent.isAutoLintEnabled() : true;
517
+ if (linter) {
518
+ addMsg("info", `🔍 Auto-lint: ${enabled ? "ON" : "OFF"}\n Detected: ${linter.name}\n Command: ${linter.command} <file>`);
519
+ }
520
+ else {
521
+ addMsg("info", `🔍 Auto-lint: ${enabled ? "ON" : "OFF"}\n No linter detected in this project.`);
522
+ }
523
+ return;
524
+ }
525
+ if (trimmed === "/lint on") {
526
+ if (agent)
527
+ agent.setAutoLint(true);
528
+ addMsg("info", "🔍 Auto-lint ON");
529
+ return;
530
+ }
531
+ if (trimmed === "/lint off") {
532
+ if (agent)
533
+ agent.setAutoLint(false);
534
+ addMsg("info", "🔍 Auto-lint OFF");
535
+ return;
536
+ }
458
537
  // Commands below require an active LLM connection
459
538
  if (!agent) {
460
539
  addMsg("info", "⚠ No LLM connected. Use /login to authenticate with a provider, or start a local server.");
@@ -641,8 +720,8 @@ function App() {
641
720
  setSpinnerMsg(SPINNER_MESSAGES[Math.floor(Math.random() * SPINNER_MESSAGES.length)]);
642
721
  try {
643
722
  // Response is built incrementally via onToken callback
644
- // chat() returns the final text but we don't need to add it again
645
- await agent.chat(trimmed);
723
+ // send() routes through architect if enabled, otherwise direct chat
724
+ await agent.send(trimmed);
646
725
  }
647
726
  catch (err) {
648
727
  addMsg("error", `Error: ${err.message}`);
@@ -1192,7 +1271,7 @@ function App() {
1192
1271
  })(), modelName ? ` · 🤖 ${modelName}` : "", (() => {
1193
1272
  const count = getActiveSkillCount(process.cwd(), sessionDisabledSkills);
1194
1273
  return count > 0 ? ` · 🧠 ${count} skill${count !== 1 ? "s" : ""}` : "";
1195
- })()] }) }))] }));
1274
+ })(), agent.getArchitectModel() ? " · 🏗️ architect" : ""] }) }))] }));
1196
1275
  }
1197
1276
  // Clear screen before render
1198
1277
  process.stdout.write("\x1B[2J\x1B[3J\x1B[H");