kushi-agents 5.4.0 → 5.4.1
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 +17 -2
- package/package.json +2 -2
- package/src/cli-no-args-tty.test.mjs +59 -0
package/bin/cli.mjs
CHANGED
|
@@ -5,8 +5,20 @@ 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
|
-
|
|
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.
|
|
13
|
+
if (args.length === 0) {
|
|
14
|
+
const forceWelcome = process.env.KUSHI_SKIP_WELCOME === '1';
|
|
15
|
+
const forceWizard = process.env.KUSHI_FORCE_WIZARD === '1';
|
|
16
|
+
const interactive = forceWizard || (process.stdin.isTTY && !forceWelcome);
|
|
17
|
+
if (interactive) {
|
|
18
|
+
const { runSetupWizard } = await import('../src/setup-wizard.mjs');
|
|
19
|
+
await runSetupWizard({ args: [] });
|
|
20
|
+
process.exit(0);
|
|
21
|
+
}
|
|
10
22
|
await printWelcome();
|
|
11
23
|
process.exit(0);
|
|
12
24
|
}
|
|
@@ -50,10 +62,13 @@ async function printWelcome() {
|
|
|
50
62
|
console.log(`
|
|
51
63
|
kushi v${version} — multi-source M365 project evidence agent
|
|
52
64
|
|
|
65
|
+
(non-interactive shell — nothing was installed)
|
|
66
|
+
|
|
53
67
|
First time? kushi doctor
|
|
54
68
|
Bootstrap a project: kushi setup <project>
|
|
55
69
|
Ask a question: kushi ask <project> "..."
|
|
56
70
|
Wizard install: npx kushi-agents --setup-wizard
|
|
71
|
+
Host install: npx kushi-agents --clawpilot | --vscode | --all-hosts
|
|
57
72
|
|
|
58
73
|
Docs: https://gim-home.github.io/kushi/
|
|
59
74
|
Skills: ${skillCount} installed in plugin/skills/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kushi-agents",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.1",
|
|
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": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"scripts": {
|
|
44
|
-
"test": "node --test src/check-workiq.test.mjs src/seed-config.test.mjs src/sanitize-workiq-input.test.mjs src/detect-vertex-repo.test.mjs src/vertex-validate.test.mjs src/emit-vertex.e2e.test.mjs src/config-root-resolve.test.mjs src/forbidden-workiq-phrasings.test.mjs src/multi-host-install.test.mjs src/eval-aggregator.test.mjs src/eval-runner.test.mjs src/skill-creator.test.mjs src/skill-checker.test.mjs src/hooks-dispatcher.test.mjs src/parallel-refresh.test.mjs src/otel-emit.test.mjs src/teach.test.mjs src/schema-evolve.test.mjs src/global-wiki.test.mjs src/promote.test.mjs src/doctor.test.mjs src/setup-wizard.test.mjs src/cli-no-args.test.mjs",
|
|
44
|
+
"test": "node --test src/check-workiq.test.mjs src/seed-config.test.mjs src/sanitize-workiq-input.test.mjs src/detect-vertex-repo.test.mjs src/vertex-validate.test.mjs src/emit-vertex.e2e.test.mjs src/config-root-resolve.test.mjs src/forbidden-workiq-phrasings.test.mjs src/multi-host-install.test.mjs src/eval-aggregator.test.mjs src/eval-runner.test.mjs src/skill-creator.test.mjs src/skill-checker.test.mjs src/hooks-dispatcher.test.mjs src/parallel-refresh.test.mjs src/otel-emit.test.mjs src/teach.test.mjs src/schema-evolve.test.mjs src/global-wiki.test.mjs src/promote.test.mjs src/doctor.test.mjs src/setup-wizard.test.mjs src/cli-no-args.test.mjs src/cli-no-args-tty.test.mjs",
|
|
45
45
|
"test:integration:bootstrap": "node src/bootstrap-dryrun.integration.test.mjs",
|
|
46
46
|
"smoke": "node scripts/smoke.mjs",
|
|
47
47
|
"eval": "pwsh plugin/skills/eval/run-evals.ps1 -Skill",
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// kushi v5.4.1 — bare `kushi` on an interactive TTY auto-runs the setup
|
|
2
|
+
// wizard. Non-TTY (covered by cli-no-args.test.mjs) still prints the welcome
|
|
3
|
+
// card and never installs anything. We can't easily fake a real PTY inside
|
|
4
|
+
// node:test, so this test uses KUSHI_FORCE_WIZARD=1 as the documented escape
|
|
5
|
+
// hatch that mirrors the TTY branch.
|
|
6
|
+
|
|
7
|
+
import test from 'node:test';
|
|
8
|
+
import assert from 'node:assert/strict';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
import os from 'node:os';
|
|
11
|
+
import fs from 'node:fs';
|
|
12
|
+
import { spawnSync } from 'node:child_process';
|
|
13
|
+
import { fileURLToPath } from 'node:url';
|
|
14
|
+
|
|
15
|
+
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
16
|
+
const cli = path.join(repoRoot, 'bin', 'cli.mjs');
|
|
17
|
+
|
|
18
|
+
function mkTmp() {
|
|
19
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'kushi-cli-tty-'));
|
|
20
|
+
return dir;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
test('cli no-args + KUSHI_FORCE_WIZARD=1: routes through setup-wizard, not welcome card', () => {
|
|
24
|
+
const installRoot = mkTmp();
|
|
25
|
+
const wizardRoot = mkTmp();
|
|
26
|
+
try {
|
|
27
|
+
const r = spawnSync(process.execPath, [cli], {
|
|
28
|
+
encoding: 'utf-8',
|
|
29
|
+
timeout: 30_000,
|
|
30
|
+
env: {
|
|
31
|
+
...process.env,
|
|
32
|
+
KUSHI_FORCE_WIZARD: '1',
|
|
33
|
+
KUSHI_SKIP_INSTALL: '1',
|
|
34
|
+
KUSHI_INSTALL_ROOT: installRoot,
|
|
35
|
+
KUSHI_WIZARD_ROOT: wizardRoot,
|
|
36
|
+
KUSHI_WIZARD_HOSTS: 'clawpilot',
|
|
37
|
+
KUSHI_WIZARD_GLOBAL: 'n',
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
const out = (r.stdout || '') + (r.stderr || '');
|
|
41
|
+
assert.equal(r.status, 0, `wizard exits 0\nout=${out}`);
|
|
42
|
+
assert.ok(!/non-interactive shell/.test(out), 'should not print welcome banner when wizard branch is taken');
|
|
43
|
+
assert.ok(/KUSHI_SKIP_INSTALL=1/.test(out) || /wizard complete/i.test(out) || /engagement root/i.test(out),
|
|
44
|
+
`expected wizard output, got:\n${out}`);
|
|
45
|
+
} finally {
|
|
46
|
+
fs.rmSync(installRoot, { recursive: true, force: true });
|
|
47
|
+
fs.rmSync(wizardRoot, { recursive: true, force: true });
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test('cli no-args + KUSHI_SKIP_WELCOME=1: still prints welcome even on TTY override', () => {
|
|
52
|
+
const r = spawnSync(process.execPath, [cli], {
|
|
53
|
+
encoding: 'utf-8',
|
|
54
|
+
timeout: 30_000,
|
|
55
|
+
env: { ...process.env, KUSHI_SKIP_WELCOME: '1', KUSHI_FORCE_WIZARD: '' },
|
|
56
|
+
});
|
|
57
|
+
assert.equal(r.status, 0);
|
|
58
|
+
assert.match(r.stdout, /kushi v\d+\.\d+\.\d+/);
|
|
59
|
+
});
|