kushi-agents 5.9.2 → 5.9.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/bin/cli.mjs CHANGED
@@ -5,20 +5,30 @@ import { runMultiHost } from '../src/multi-host.mjs';
5
5
 
6
6
  const args = process.argv.slice(2);
7
7
 
8
- // ── bare invocation (v5.4.0+) ────────────────────────────────────────────────
9
- // v5.4.1: on an interactive TTY, auto-launch the setup wizard (matches the
10
- // ergonomics of `npx create-*`). Non-TTY (CI, scripts, piped stdin) and the
11
- // explicit KUSHI_SKIP_WELCOME=1 still print the welcome card and exit 0, so
12
- // nothing is installed by side-effect.
8
+ // ── bare invocation ──────────────────────────────────────────────────────────
9
+ // Two bins share this cli (via thin wrappers in bin/kushi.mjs and
10
+ // bin/kushi-agents.mjs that set KUSHI_BIN_NAME). Behavior diverges on no-args:
11
+ // - `kushi-agents` (no args) on a TTY → setup wizard (first-install ergonomics)
12
+ // - `kushi` (no args) on a TTY → Docker-style help (post-install verb)
13
+ // - Either, non-TTY → welcome card (no side effects)
14
+ // Override env vars: KUSHI_FORCE_WIZARD=1 forces wizard; KUSHI_SKIP_WELCOME=1
15
+ // forces the welcome card.
13
16
  if (args.length === 0) {
17
+ const isInstallerBin = process.env.KUSHI_BIN_NAME === 'kushi-agents';
14
18
  const forceWelcome = process.env.KUSHI_SKIP_WELCOME === '1';
15
19
  const forceWizard = process.env.KUSHI_FORCE_WIZARD === '1';
16
- const interactive = forceWizard || (process.stdin.isTTY && !forceWelcome);
17
- if (interactive) {
20
+ const tty = process.stdin.isTTY && !forceWelcome;
21
+
22
+ if (forceWizard || (tty && isInstallerBin)) {
18
23
  const { runSetupWizard } = await import('../src/setup-wizard.mjs');
19
24
  await runSetupWizard({ args: [] });
20
25
  process.exit(0);
21
26
  }
27
+ if (tty) {
28
+ // Bare `kushi` on a TTY — Docker-style help (no side effects).
29
+ await printHelp();
30
+ process.exit(0);
31
+ }
22
32
  await printWelcome();
23
33
  process.exit(0);
24
34
  }
@@ -347,6 +357,36 @@ if (args.length > 0 && args[0] === 'upgrade') {
347
357
  }
348
358
  }
349
359
 
360
+ // ── chat-verb guard (v5.9.4+) ───────────────────────────────────────────────
361
+ // These verbs are dispatched by Copilot Chat (`@Kushi <verb>`), not the CLI.
362
+ // If a user types e.g. `kushi ask HCA "..."` in PowerShell, fall through to
363
+ // installer used to silently run. Now we print a friendly redirect.
364
+ const CHAT_ONLY_VERBS = new Set([
365
+ 'ask', 'bootstrap', 'refresh', 'status', 'consolidate', 'tour', 'dashboard',
366
+ 'aggregate', 'fde-intake', 'fde-report', 'fde-triage', 'link-entities',
367
+ 'migrate-files', 'pull', 'schema-evolve', 'teach', 'vertex-link',
368
+ 'emit-vertex',
369
+ ]);
370
+ if (args.length > 0 && CHAT_ONLY_VERBS.has(args[0])) {
371
+ const verb = args[0];
372
+ const rest = args.slice(1).map(a => a.includes(' ') ? `"${a}"` : a).join(' ');
373
+ console.log(`
374
+ '${verb}' is a chat verb — run it from Copilot Chat, not PowerShell.
375
+
376
+ In VS Code Copilot Chat:
377
+ @Kushi ${verb}${rest ? ' ' + rest : ' <project> [args]'}
378
+
379
+ In Clawpilot:
380
+ kushi ${verb}${rest ? ' ' + rest : ' <project> [args]'}
381
+
382
+ CLI verbs (run from PowerShell): kushi help, kushi wiki, kushi doctor,
383
+ kushi upgrade, kushi uninstall, kushi setup,
384
+ kushi state, kushi promote, kushi global, kushi lint
385
+ See: kushi help
386
+ `);
387
+ process.exit(2);
388
+ }
389
+
350
390
  // ── multi-host mode (v5.0.2+) ───────────────────────────────────────────────
351
391
  // Trigger when the user passes any of: --vscode, --all-hosts, --uninstall.
352
392
  // --clawpilot ALONE continues to route through the legacy main.mjs path so
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ // Installer entry point — `npx kushi-agents` lands here. Bare invocation on a
3
+ // TTY launches the setup wizard for first-install ergonomics.
4
+ process.env.KUSHI_BIN_NAME = 'kushi-agents';
5
+ await import('./cli.mjs');
package/bin/kushi.mjs ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ // Post-install user verb. Bare `kushi` → grouped help. Unknown verbs → friendly redirect.
3
+ process.env.KUSHI_BIN_NAME = 'kushi';
4
+ await import('./cli.mjs');
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "kushi-agents",
3
- "version": "5.9.2",
3
+ "version": "5.9.4",
4
4
  "description": "Install Kushi — multi-source project evidence agent with Comprehensive Structured Capture (CSC) into weekly-only files across Email, Teams, OneNote, Loop, SharePoint, Meetings, CRM, ADO. Meetings retain a sibling verbatim/ audit folder. WorkIQ-only for M365 sources (Graph / m365_* FORBIDDEN as fallbacks; user-paste is first-class). Host-agnostic.",
5
5
  "type": "module",
6
6
  "bin": {
7
- "kushi": "./bin/cli.mjs",
8
- "kushi-agents": "./bin/cli.mjs"
7
+ "kushi": "./bin/kushi.mjs",
8
+ "kushi-agents": "./bin/kushi-agents.mjs"
9
9
  },
10
10
  "files": [
11
11
  "bin/",