shmakk 1.2.3 → 1.2.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shmakk",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "AI-supervised terminal wrapper — command correction, tool-driven tasks, safety controls",
5
5
  "license": "MIT",
6
6
  "keywords": [
package/src/correction.js CHANGED
@@ -115,6 +115,12 @@ function preserveCase(original, corrected) {
115
115
  }
116
116
 
117
117
  async function correct({ input, glossary, signal: _unused }) {
118
+ // Null/empty input: can happen at shell startup when precmd fires before
119
+ // any command is executed (especially in zsh). Nothing to correct.
120
+ if (!input || !input.trim()) {
121
+ return { category: 'not_a_correction', proposed: null, safety: 'uncertain', reason: 'empty input' };
122
+ }
123
+
118
124
  // /-prefixed and "shmakk ..." commands are shmakk self-commands.
119
125
  // They should never reach the correction engine — bail out immediately.
120
126
  if (/^\//.test(input) || /^shmakk\s/i.test(input)) {
package/src/session.js CHANGED
@@ -613,6 +613,14 @@ async function runOneSession(opts, registerSession) {
613
613
  lastCommand = null;
614
614
  if (flushTimer) { clearTimeout(flushTimer); flushTimer = null; }
615
615
 
616
+ // No command was tracked — precmd can fire at shell startup (especially
617
+ // in zsh) before any command executes. There's nothing to correct or
618
+ // route to the agent.
619
+ if (!lastCmd) {
620
+ discardPending();
621
+ return;
622
+ }
623
+
616
624
  // ── Self-command detection (FIRST — before ANY other processing) ──
617
625
  // Self-commands are pure local execution. They MUST bypass:
618
626
  // - the noAi early-return (they don't need an LLM)