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/src/index.tsx 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
 
@@ -277,6 +281,12 @@ function App() {
277
281
  const savedStr = saved >= 1000 ? `${(saved / 1000).toFixed(1)}k` : String(saved);
278
282
  addMsg("info", `๐Ÿ“ฆ Context compressed (~${savedStr} tokens freed)`);
279
283
  },
284
+ onArchitectPlan: (plan) => {
285
+ addMsg("info", `๐Ÿ—๏ธ Architect Plan:\n${plan}`);
286
+ },
287
+ onLintResult: (file, errors) => {
288
+ addMsg("info", `๐Ÿ” Lint errors in ${file}:\n${errors}`);
289
+ },
280
290
  contextCompressionThreshold: config.defaults.contextCompressionThreshold,
281
291
  onToolApproval: (name, args, diff) => {
282
292
  return new Promise((resolve) => {
@@ -289,6 +299,13 @@ function App() {
289
299
  // Initialize async context (repo map)
290
300
  await a.init();
291
301
 
302
+ // Show project rules in banner
303
+ const rulesSource = a.getProjectRulesSource();
304
+ if (rulesSource) {
305
+ info.push(`๐Ÿ“‹ ${rulesSource} loaded`);
306
+ setConnectionInfo([...info]);
307
+ }
308
+
292
309
  setAgent(a);
293
310
  setModelName(provider.model);
294
311
  providerRef.current = { baseUrl: provider.baseUrl, apiKey: provider.apiKey };
@@ -336,7 +353,7 @@ function App() {
336
353
  // Commands that need args (like /commit, /model) โ€” fill input instead of executing
337
354
  if (selected.cmd === "/commit" || selected.cmd === "/model" || selected.cmd === "/session delete" ||
338
355
  selected.cmd === "/skills install" || selected.cmd === "/skills remove" || selected.cmd === "/skills search" ||
339
- selected.cmd === "/skills on" || selected.cmd === "/skills off") {
356
+ selected.cmd === "/skills on" || selected.cmd === "/skills off" || selected.cmd === "/architect") {
340
357
  setInput(selected.cmd + " ");
341
358
  setCmdIndex(0);
342
359
  setInputKey((k) => k + 1);
@@ -398,6 +415,10 @@ function App() {
398
415
  " /git on โ€” enable auto-commits",
399
416
  " /git off โ€” disable auto-commits",
400
417
  " /skills โ€” manage skill packs",
418
+ " /architect โ€” toggle architect mode (plan then execute)",
419
+ " /lint โ€” show auto-lint status & detected linter",
420
+ " /lint on โ€” enable auto-lint",
421
+ " /lint off โ€” disable auto-lint",
401
422
  " /quit โ€” exit",
402
423
  ].join("\n"));
403
424
  return;
@@ -502,6 +523,62 @@ function App() {
502
523
  addMsg("info", `โœ… Switched to theme: ${THEMES[themeName].name}`);
503
524
  return;
504
525
  }
526
+ // โ”€โ”€ Architect commands (work without agent) โ”€โ”€
527
+ if (trimmed === "/architect") {
528
+ if (!agent) {
529
+ addMsg("info", "๐Ÿ—๏ธ Architect mode: no agent connected. Connect first with /login or /connect.");
530
+ return;
531
+ }
532
+ const current = agent.getArchitectModel();
533
+ if (current) {
534
+ agent.setArchitectModel(null);
535
+ addMsg("info", "๐Ÿ—๏ธ Architect mode OFF");
536
+ } else {
537
+ // Use config default or a sensible default
538
+ const defaultModel = loadConfig().defaults.architectModel || agent.getModel();
539
+ agent.setArchitectModel(defaultModel);
540
+ addMsg("info", `๐Ÿ—๏ธ Architect mode ON (planner: ${defaultModel})`);
541
+ }
542
+ return;
543
+ }
544
+ if (trimmed.startsWith("/architect ")) {
545
+ const model = trimmed.replace("/architect ", "").trim();
546
+ if (!model) {
547
+ addMsg("info", "Usage: /architect <model> or /architect to toggle");
548
+ return;
549
+ }
550
+ if (agent) {
551
+ agent.setArchitectModel(model);
552
+ addMsg("info", `๐Ÿ—๏ธ Architect mode ON (planner: ${model})`);
553
+ } else {
554
+ addMsg("info", "โš  No agent connected. Connect first.");
555
+ }
556
+ return;
557
+ }
558
+
559
+ // โ”€โ”€ Lint commands (work without agent) โ”€โ”€
560
+ if (trimmed === "/lint") {
561
+ const { detectLinter } = await import("./utils/lint.js");
562
+ const linter = detectLinter(process.cwd());
563
+ const enabled = agent ? agent.isAutoLintEnabled() : true;
564
+ if (linter) {
565
+ addMsg("info", `๐Ÿ” Auto-lint: ${enabled ? "ON" : "OFF"}\n Detected: ${linter.name}\n Command: ${linter.command} <file>`);
566
+ } else {
567
+ addMsg("info", `๐Ÿ” Auto-lint: ${enabled ? "ON" : "OFF"}\n No linter detected in this project.`);
568
+ }
569
+ return;
570
+ }
571
+ if (trimmed === "/lint on") {
572
+ if (agent) agent.setAutoLint(true);
573
+ addMsg("info", "๐Ÿ” Auto-lint ON");
574
+ return;
575
+ }
576
+ if (trimmed === "/lint off") {
577
+ if (agent) agent.setAutoLint(false);
578
+ addMsg("info", "๐Ÿ” Auto-lint OFF");
579
+ return;
580
+ }
581
+
505
582
  // Commands below require an active LLM connection
506
583
  if (!agent) {
507
584
  addMsg("info", "โš  No LLM connected. Use /login to authenticate with a provider, or start a local server.");
@@ -684,8 +761,8 @@ function App() {
684
761
 
685
762
  try {
686
763
  // Response is built incrementally via onToken callback
687
- // chat() returns the final text but we don't need to add it again
688
- await agent.chat(trimmed);
764
+ // send() routes through architect if enabled, otherwise direct chat
765
+ await agent.send(trimmed);
689
766
  } catch (err: any) {
690
767
  addMsg("error", `Error: ${err.message}`);
691
768
  }
@@ -1497,6 +1574,7 @@ function App() {
1497
1574
  const count = getActiveSkillCount(process.cwd(), sessionDisabledSkills);
1498
1575
  return count > 0 ? ` ยท ๐Ÿง  ${count} skill${count !== 1 ? "s" : ""}` : "";
1499
1576
  })()}
1577
+ {agent.getArchitectModel() ? " ยท ๐Ÿ—๏ธ architect" : ""}
1500
1578
  </Text>
1501
1579
  </Box>
1502
1580
  )}