@mrciphersmith/keryx 0.2.45 → 0.2.46

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.js +129 -57
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -48746,7 +48746,7 @@ import { spawnSync as spawnSync2 } from "child_process";
48746
48746
  // package.json
48747
48747
  var package_default = {
48748
48748
  name: "@mrciphersmith/keryx",
48749
- version: "0.2.45",
48749
+ version: "0.2.46",
48750
48750
  description: "Version-controlled project context for AI coding agents: code graph, architecture wiki, project memory, relevant tests, quality signals, and task flows.",
48751
48751
  private: false,
48752
48752
  publishConfig: {
@@ -50601,6 +50601,37 @@ function openFlows(otui, chrome, options) {
50601
50601
  return presentFlows((hostOtui, hostChrome, input2) => openModal(hostOtui, hostChrome, input2), otui, chrome, options);
50602
50602
  }
50603
50603
 
50604
+ // src/tui/busy-dispatch.ts
50605
+ function classifyBusyDispatch(params) {
50606
+ const { line, commandName, isSessionInfo, isFlows, isWorkspace, isReview } = params;
50607
+ if (commandName === "/exit")
50608
+ return "exit";
50609
+ if (commandName === "/help")
50610
+ return "help";
50611
+ if (commandName === "/interrupt")
50612
+ return "interrupt";
50613
+ if (commandName === "/queue")
50614
+ return "queue";
50615
+ if (commandName === "/think")
50616
+ return "think";
50617
+ if (commandName === "/expand")
50618
+ return "expand";
50619
+ if (commandName === "/copy")
50620
+ return "copy";
50621
+ const isBusyReadonlyCommand = isSessionInfo || isFlows || isWorkspace || isReview;
50622
+ if (isBusyReadonlyCommand && isSessionInfo)
50623
+ return "session-info";
50624
+ if (isBusyReadonlyCommand && isFlows)
50625
+ return "flows";
50626
+ if (isBusyReadonlyCommand && isWorkspace)
50627
+ return "workspace";
50628
+ if (isBusyReadonlyCommand && isReview)
50629
+ return "review";
50630
+ if (commandName !== undefined || line.startsWith("/"))
50631
+ return "deferred";
50632
+ return "not-a-command";
50633
+ }
50634
+
50604
50635
  // src/tui/workspace-inspector.ts
50605
50636
  var WORKSPACE_COMMAND = "/workspace";
50606
50637
  var WORKSPACE_FOOTER = [
@@ -55664,81 +55695,122 @@ Staying in the current session.
55664
55695
  return;
55665
55696
  }
55666
55697
  const displayLine = summarizeSubmittedLine(line);
55667
- const isBusyReadonlyCommand = isSessionInfoCommand(line) || isFlowsCommand(line);
55668
55698
  if (chrome.isBusy()) {
55669
55699
  const command2 = findAgentCommand(line, "agent");
55670
- if (command2?.name === "/exit") {
55671
- (async () => {
55672
- await closeSlateSession(slateSession, mintTimestampAttemptId);
55673
- r.off("theme_mode", onThemeMode);
55674
- r.destroy();
55675
- })();
55676
- return;
55677
- }
55678
- if (command2?.name === "/help") {
55679
- transcript.add(new otui.TextRenderable(r, {
55680
- id: `c${uid++}`,
55681
- content: otui.t`${otui.cyan(`\u276F ${line}`)}`,
55682
- marginTop: 1
55683
- }));
55684
- io.onSystem?.("Main agent is busy. Type a normal question to spawn a side worker " + `(sees main status + recent context; read-only). /status \u0438 /flows still open info panels. /exit still works.
55700
+ const decision = classifyBusyDispatch({
55701
+ line,
55702
+ commandName: command2?.name,
55703
+ isSessionInfo: isSessionInfoCommand(line),
55704
+ isFlows: isFlowsCommand(line),
55705
+ isWorkspace: isWorkspaceCommand(line),
55706
+ isReview: isReviewCommand(line)
55707
+ });
55708
+ switch (decision) {
55709
+ case "exit": {
55710
+ (async () => {
55711
+ await closeSlateSession(slateSession, mintTimestampAttemptId);
55712
+ r.off("theme_mode", onThemeMode);
55713
+ r.destroy();
55714
+ })();
55715
+ return;
55716
+ }
55717
+ case "help": {
55718
+ transcript.add(new otui.TextRenderable(r, {
55719
+ id: `c${uid++}`,
55720
+ content: otui.t`${otui.cyan(`\u276F ${line}`)}`,
55721
+ marginTop: 1
55722
+ }));
55723
+ io.onSystem?.("Main agent is busy. Type a normal question to spawn a side worker " + `(sees main status + recent context; read-only). /status \u0438 /flows still open info panels. /exit still works.
55685
55724
  `);
55686
- return;
55687
- }
55688
- if (command2?.name === "/interrupt") {
55689
- if (mainTurnAbortController !== undefined && !mainTurnAbortController.signal.aborted) {
55690
- mainTurnAbortController.abort();
55691
- io.onSystem?.(`\u25C7 main turn interrupted.
55725
+ return;
55726
+ }
55727
+ case "interrupt": {
55728
+ if (mainTurnAbortController !== undefined && !mainTurnAbortController.signal.aborted) {
55729
+ mainTurnAbortController.abort();
55730
+ io.onSystem?.(`\u25C7 main turn interrupted.
55731
+ `);
55732
+ return;
55733
+ }
55734
+ io.onSystem?.(`\u25C7 no active main turn to interrupt.
55692
55735
  `);
55693
55736
  return;
55694
55737
  }
55695
- io.onSystem?.(`\u25C7 no active main turn to interrupt.
55738
+ case "queue": {
55739
+ const parsed = parseQueueCommand(line.trim().split(/\s+/).slice(1).join(" "));
55740
+ if (parsed === undefined) {
55741
+ io.onSystem?.(`\u25C7 usage: /queue <remove|edit|force> [N] (N = qN position, default 1)
55696
55742
  `);
55697
- return;
55698
- }
55699
- if (command2?.name === "/queue") {
55700
- const parsed = parseQueueCommand(line.trim().split(/\s+/).slice(1).join(" "));
55701
- if (parsed === undefined) {
55702
- io.onSystem?.(`\u25C7 usage: /queue <remove|edit|force> [N] (N = qN position, default 1)
55743
+ return;
55744
+ }
55745
+ const index = parsed.position - 1;
55746
+ if (index < 0 || index >= mainQueue.length) {
55747
+ io.onSystem?.(`\u25C7 queue: no item q${parsed.position}.
55703
55748
  `);
55749
+ return;
55750
+ }
55751
+ if (parsed.action === "remove") {
55752
+ removeMainQueue(index);
55753
+ io.onSystem?.(`\u25C7 removed q${parsed.position} from the main queue.
55754
+ `);
55755
+ return;
55756
+ }
55757
+ if (parsed.action === "edit") {
55758
+ editMainQueue(index);
55759
+ io.onSystem?.(`\u25C7 q${parsed.position} moved to the composer \u2014 edit and submit to re-queue at the same position.
55760
+ `);
55761
+ return;
55762
+ }
55763
+ forceMainQueue(index);
55704
55764
  return;
55705
55765
  }
55706
- const index = parsed.position - 1;
55707
- if (index < 0 || index >= mainQueue.length) {
55708
- io.onSystem?.(`\u25C7 queue: no item q${parsed.position}.
55766
+ case "think": {
55767
+ if (toggleNewestBlock("thought") === undefined) {
55768
+ io.onSystem?.(`No reasoning yet.
55709
55769
  `);
55770
+ }
55710
55771
  return;
55711
55772
  }
55712
- if (parsed.action === "remove") {
55713
- removeMainQueue(index);
55714
- io.onSystem?.(`\u25C7 removed q${parsed.position} from the main queue.
55773
+ case "expand": {
55774
+ if (toggleNewestBlock("output") === undefined && toggleNewestBlock() === undefined) {
55775
+ io.onSystem?.(`Nothing to expand \u2014 no tool output yet.
55715
55776
  `);
55777
+ }
55716
55778
  return;
55717
55779
  }
55718
- if (parsed.action === "edit") {
55719
- editMainQueue(index);
55720
- io.onSystem?.(`\u25C7 q${parsed.position} moved to the composer \u2014 edit and submit to re-queue at the same position.
55780
+ case "copy": {
55781
+ const target = newestBlock();
55782
+ if (target === undefined || !copyBlock(target.id)) {
55783
+ io.onSystem?.(`Nothing to copy yet.
55721
55784
  `);
55785
+ }
55722
55786
  return;
55723
55787
  }
55724
- forceMainQueue(index);
55725
- return;
55726
- }
55727
- if (isBusyReadonlyCommand && isSessionInfoCommand(line)) {
55728
- showSessionInfo();
55729
- return;
55730
- }
55731
- if (isBusyReadonlyCommand && isFlowsCommand(line)) {
55732
- showFlows();
55733
- return;
55734
- }
55735
- if (command2 !== undefined || line.startsWith("/")) {
55736
- transcript.add(new otui.TextRenderable(r, {
55737
- id: `c${uid++}`,
55738
- content: otui.t`${otui.yellow(`\u25C7 main is busy \u2014 command deferred. Ask a normal question for a side worker, or wait.`)}`,
55739
- marginTop: 1
55740
- }));
55741
- return;
55788
+ case "session-info": {
55789
+ showSessionInfo();
55790
+ return;
55791
+ }
55792
+ case "flows": {
55793
+ showFlows();
55794
+ return;
55795
+ }
55796
+ case "workspace": {
55797
+ showWorkspace();
55798
+ return;
55799
+ }
55800
+ case "review": {
55801
+ showReview();
55802
+ return;
55803
+ }
55804
+ case "deferred": {
55805
+ transcript.add(new otui.TextRenderable(r, {
55806
+ id: `c${uid++}`,
55807
+ content: otui.t`${otui.yellow(`\u25C7 main is busy \u2014 command deferred. Ask a normal question for a side worker, or wait.`)}`,
55808
+ marginTop: 1
55809
+ }));
55810
+ return;
55811
+ }
55812
+ case "not-a-command":
55813
+ break;
55742
55814
  }
55743
55815
  if (pendingQueueEdit !== undefined) {
55744
55816
  const edit = pendingQueueEdit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrciphersmith/keryx",
3
- "version": "0.2.45",
3
+ "version": "0.2.46",
4
4
  "description": "Version-controlled project context for AI coding agents: code graph, architecture wiki, project memory, relevant tests, quality signals, and task flows.",
5
5
  "private": false,
6
6
  "publishConfig": {