konoha-mcp 2.1.14 → 2.1.16

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 (68) hide show
  1. package/.agents/SOUL.md +165 -0
  2. package/.agents/skills/konoha/SKILL.md +5 -2
  3. package/.agents/skills.fingerprint +1 -1
  4. package/README.md +5 -5
  5. package/apps/web/build/adapter-node.js +1 -1
  6. package/apps/web/build/client/_app/immutable/assets/0.Ch0v37a-.css +2 -0
  7. package/apps/web/build/client/_app/immutable/assets/0.Ch0v37a-.css.br +0 -0
  8. package/apps/web/build/client/_app/immutable/assets/0.Ch0v37a-.css.gz +0 -0
  9. package/apps/web/build/client/_app/immutable/entry/{app.BDzkoHRK.js → app.BeU4olDP.js} +2 -2
  10. package/apps/web/build/client/_app/immutable/entry/app.BeU4olDP.js.br +0 -0
  11. package/apps/web/build/client/_app/immutable/entry/app.BeU4olDP.js.gz +0 -0
  12. package/apps/web/build/client/_app/immutable/nodes/11.4dBWH00t.js +2 -0
  13. package/apps/web/build/client/_app/immutable/nodes/11.4dBWH00t.js.br +0 -0
  14. package/apps/web/build/client/_app/immutable/nodes/11.4dBWH00t.js.gz +0 -0
  15. package/apps/web/build/client/_app/version.json +1 -1
  16. package/apps/web/build/client/_app/version.json.br +0 -0
  17. package/apps/web/build/client/_app/version.json.gz +0 -0
  18. package/apps/web/build/server/.vite/manifest.json +1 -1
  19. package/apps/web/build/server/_app/immutable/assets/_layout.Ch0v37a-.css +2 -0
  20. package/apps/web/build/server/chunks/instance.js +3 -3
  21. package/apps/web/build/server/chunks/internal.js +1 -1
  22. package/apps/web/build/server/entries/pages/persona/_page.svelte.js +16 -9
  23. package/apps/web/build/server/entries/pages/persona/_page.svelte.js.map +1 -1
  24. package/apps/web/build/server/manifest-full.js +1 -1
  25. package/apps/web/build/server/manifest.js +1 -1
  26. package/apps/web/build/server/nodes/0.js +2 -2
  27. package/apps/web/build/server/nodes/11.js +1 -1
  28. package/apps/web/build/server/server.js +1 -1
  29. package/apps/web/package.json +1 -1
  30. package/bin/cli.js +79 -10
  31. package/bin/lib/ui_commands.js +4 -4
  32. package/docs/ARCHITECTURE.md +9 -5
  33. package/docs/BENCHMARK.md +34 -25
  34. package/docs/SETUP-CLI.md +1 -1
  35. package/docs/SecurityCompliance/security_compliance_report_google_policy_2.1.15_2026-10-08.md +74 -0
  36. package/docs/SecurityCompliance/security_compliance_report_google_policy_2.1.16_2026-10-08.md +69 -0
  37. package/docs/TROUBLESHOOTING.md +2 -2
  38. package/docs/architecture/CANONICAL-API.md +4 -1
  39. package/docs/architecture/TOKEN-BASELINE.md +6 -6
  40. package/package.json +1 -1
  41. package/src/antigravity_manager.js +8 -6
  42. package/src/canonical_skills.js +2 -0
  43. package/src/codex_manager.js +3 -3
  44. package/src/cursor_bootstrap.js +3 -3
  45. package/src/cursor_manager.js +4 -3
  46. package/src/deploy_utils.js +39 -15
  47. package/src/docs_ai_detector.js +9 -6
  48. package/src/file_tools_router.js +2 -1
  49. package/src/mcp/tool_dispatch.js +11 -0
  50. package/src/mcp_tool_manifest.json +22 -0
  51. package/src/persona_memory.js +132 -0
  52. package/src/pi_manager.js +1 -1
  53. package/src/platform_utils.js +11 -9
  54. package/src/templates/SOUL.md +165 -0
  55. package/src/templates/skills/konoha/SKILL.md +5 -2
  56. package/src/web_server.js +35 -4
  57. package/apps/web/build/client/_app/immutable/assets/0.CASgEURp.css +0 -2
  58. package/apps/web/build/client/_app/immutable/assets/0.CASgEURp.css.br +0 -0
  59. package/apps/web/build/client/_app/immutable/assets/0.CASgEURp.css.gz +0 -0
  60. package/apps/web/build/client/_app/immutable/entry/app.BDzkoHRK.js.br +0 -0
  61. package/apps/web/build/client/_app/immutable/entry/app.BDzkoHRK.js.gz +0 -0
  62. package/apps/web/build/client/_app/immutable/nodes/11.DFglFW_i.js +0 -1
  63. package/apps/web/build/client/_app/immutable/nodes/11.DFglFW_i.js.br +0 -0
  64. package/apps/web/build/client/_app/immutable/nodes/11.DFglFW_i.js.gz +0 -0
  65. package/apps/web/build/server/_app/immutable/assets/_layout.CASgEURp.css +0 -2
  66. /package/apps/web/build/client/_app/immutable/nodes/{0.u4hg-Zwy.js → 0.CdOP7y9P.js} +0 -0
  67. /package/apps/web/build/client/_app/immutable/nodes/{0.u4hg-Zwy.js.br → 0.CdOP7y9P.js.br} +0 -0
  68. /package/apps/web/build/client/_app/immutable/nodes/{0.u4hg-Zwy.js.gz → 0.CdOP7y9P.js.gz} +0 -0
@@ -20,7 +20,7 @@ function detectAntigravityIde(options = {}) {
20
20
  const commandAvailable = options.commandAvailable || ((command) => {
21
21
  const probe = process.platform === 'win32' ? 'where' : 'which';
22
22
  try {
23
- return spawnSync(probe, [command], { encoding: 'utf8', shell: process.platform === 'win32' }).status === 0;
23
+ return spawnSync(probe, [command], { encoding: 'utf8', shell: process.platform === 'win32', windowsHide: true }).status === 0;
24
24
  } catch {
25
25
  return false;
26
26
  }
@@ -333,7 +333,8 @@ function deployAntigravityRtkRule(silent = true) {
333
333
  spawnSync(rtkCmd, ['init', '--agent', 'antigravity', '--auto-patch', '--trust-filters'], {
334
334
  encoding: 'utf-8',
335
335
  timeout: 10000,
336
- stdio: silent ? 'ignore' : 'inherit'
336
+ stdio: silent ? 'ignore' : 'inherit',
337
+ windowsHide: true
337
338
  });
338
339
  } catch { /* intentional best-effort fallback: failure here must never crash the CLI/MCP runtime */ }
339
340
  const src = path.join(__dirname, '..', '.agents', 'rules', 'rtk-rules.md');
@@ -522,12 +523,12 @@ function ensureAntigravityMcpSchemas() {
522
523
  function refreshRtk(silent = true) {
523
524
  const cargo = process.platform === 'win32' ? 'cargo.exe' : 'cargo';
524
525
  try {
525
- const available = spawnSync(cargo, ['--version'], { encoding: 'utf-8', timeout: 5000 });
526
+ const available = spawnSync(cargo, ['--version'], { encoding: 'utf-8', timeout: 5000, windowsHide: true });
526
527
  if (available.status !== 0) return { ok: false, reason: 'cargo-not-installed' };
527
528
  // Install from the official rtk-ai/rtk repo — the plain `cargo install rtk`
528
529
  // crate on crates.io is an unrelated project (Rust Type Kit name collision)
529
530
  const result = spawnSync(cargo, ['install', '--git', 'https://github.com/rtk-ai/rtk', '--tag', 'v0.51.0', '--locked', '--force'], {
530
- encoding: 'utf-8', timeout: 600000, stdio: silent ? 'ignore' : 'inherit'
531
+ encoding: 'utf-8', timeout: 600000, stdio: silent ? 'ignore' : 'inherit', windowsHide: true
531
532
  });
532
533
  if (result.status !== 0) return { ok: false, reason: 'rtk-refresh-failed' };
533
534
  const cargoBin = path.join(HOME, '.cargo', 'bin');
@@ -553,12 +554,13 @@ function ensureRtkInstalled(silent = true) {
553
554
  // 1. Preferred: cargo from official repo with locked dependencies
554
555
  const cargo = process.platform === 'win32' ? 'cargo.exe' : 'cargo';
555
556
  try {
556
- const available = spawnSync(cargo, ['--version'], { encoding: 'utf-8', timeout: 5000 });
557
+ const available = spawnSync(cargo, ['--version'], { encoding: 'utf-8', timeout: 5000, windowsHide: true });
557
558
  if (available.status === 0) {
558
559
  const result = spawnSync(cargo, ['install', '--git', 'https://github.com/rtk-ai/rtk', '--tag', 'v0.51.0', '--locked'], {
559
560
  encoding: 'utf-8',
560
561
  timeout: 600000,
561
- stdio: silent ? 'ignore' : 'inherit'
562
+ stdio: silent ? 'ignore' : 'inherit',
563
+ windowsHide: true
562
564
  });
563
565
  if (result.status === 0) {
564
566
  addToPath();
@@ -33,6 +33,7 @@ const CANONICAL_SKILL_NAMES = new Set([
33
33
  // Explicit registry of skills that were consolidated into references inside ninja skills.
34
34
  // These must NEVER appear as standalone top-level skill folders in .agents/skills or any client.
35
35
  const KNOWN_EMBEDDED_REFERENCE_SKILLS = new Set([
36
+ 'accidental-data-loss-prevention',
36
37
  'accessibility-testing-expert',
37
38
  'adaptive-model-cascade',
38
39
  'affective-computing-emotion-ai',
@@ -49,6 +50,7 @@ const KNOWN_EMBEDDED_REFERENCE_SKILLS = new Set([
49
50
  'angular-expert',
50
51
  'angular-ui-expert',
51
52
  'anthropic-cybersecurity-skills',
53
+ 'anti-slop',
52
54
  'api-design-expert',
53
55
  'api-gateway-proxy-expert',
54
56
  'app-analyzer-optimizer',
@@ -248,7 +248,7 @@ function updateCodexTomlMcp(existingToml, pythonCmd, serverPath, uvxCmd) {
248
248
  let resolvedAislopCmd = npxExecutable;
249
249
  let resolvedAislopArgs = ['-y', '-p', 'aislop@0.18.1', 'aislop-mcp'];
250
250
  try {
251
- const whichAislop = spawnSync(process.platform === 'win32' ? 'where' : 'which', ['aislop-mcp'], { encoding: 'utf-8', shell: process.platform === 'win32' });
251
+ const whichAislop = spawnSync(process.platform === 'win32' ? 'where' : 'which', ['aislop-mcp'], { encoding: 'utf-8', shell: process.platform === 'win32', windowsHide: true });
252
252
  if (whichAislop.status === 0 && whichAislop.stdout.trim()) {
253
253
  resolvedAislopCmd = whichAislop.stdout.trim().split('\n')[0].trim();
254
254
  resolvedAislopArgs = [];
@@ -305,7 +305,7 @@ function updateCodexTomlMcp(existingToml, pythonCmd, serverPath, uvxCmd) {
305
305
  // Only include semble when uvx is actually usable
306
306
  const uvxAvailable = (() => {
307
307
  try {
308
- const res = spawnSync(resolvedUvx, ['--version'], { encoding: 'utf-8', timeout: 5000, shell: process.platform === 'win32' });
308
+ const res = spawnSync(resolvedUvx, ['--version'], { encoding: 'utf-8', timeout: 5000, shell: process.platform === 'win32', windowsHide: true });
309
309
  return res.status === 0;
310
310
  } catch { return false; }
311
311
  })();
@@ -374,7 +374,7 @@ function registerCodexMcp(pythonCmd, serverPath, uvxCmd, silent = true) {
374
374
  const existing = readCodexConfig();
375
375
  let resolvedUvx = uvxCmd || 'uvx';
376
376
  try {
377
- const whichUvx = spawnSync(process.platform === 'win32' ? 'where' : 'which', [resolvedUvx], { encoding: 'utf-8', shell: process.platform === 'win32' });
377
+ const whichUvx = spawnSync(process.platform === 'win32' ? 'where' : 'which', [resolvedUvx], { encoding: 'utf-8', shell: process.platform === 'win32', windowsHide: true });
378
378
  if (whichUvx.status === 0 && whichUvx.stdout.trim()) {
379
379
  resolvedUvx = whichUvx.stdout.trim().split('\n')[0].trim();
380
380
  }
@@ -32,7 +32,7 @@ function ensureDir(d) {
32
32
  function checkPython() {
33
33
  for (const cmd of ['python3', 'python']) {
34
34
  try {
35
- const r = spawnSync(cmd, ['--version'], { encoding: 'utf-8', timeout: 5000 });
35
+ const r = spawnSync(cmd, ['--version'], { encoding: 'utf-8', timeout: 5000, windowsHide: true });
36
36
  if (r.status === 0) return cmd;
37
37
  } catch { /* intentional best-effort fallback: failure here must never crash the runtime */ }
38
38
  }
@@ -42,7 +42,7 @@ function checkPython() {
42
42
  function getUvx() {
43
43
  const isWin = process.platform === 'win32';
44
44
  try {
45
- spawnSync('uvx', ['--version'], { stdio: 'ignore', timeout: 5000, shell: isWin });
45
+ spawnSync('uvx', ['--version'], { stdio: 'ignore', timeout: 5000, shell: isWin, windowsHide: true });
46
46
  return 'uvx';
47
47
  } catch { /* intentional best-effort fallback: failure here must never crash the runtime */ }
48
48
  // Windows installs put uvx.exe in %USERPROFILE%\.local\bin
@@ -54,7 +54,7 @@ function getUvx() {
54
54
  function isUvxUsable() {
55
55
  try {
56
56
  const uvx = getUvx();
57
- const r = spawnSync(uvx, ['--version'], { stdio: 'ignore', timeout: 5000, shell: process.platform === 'win32' });
57
+ const r = spawnSync(uvx, ['--version'], { stdio: 'ignore', timeout: 5000, shell: process.platform === 'win32', windowsHide: true });
58
58
  return r.status === 0;
59
59
  } catch { /* intentional best-effort fallback: failure here must never crash the runtime */ }
60
60
  return false;
@@ -42,7 +42,8 @@ function deployCursorRtkRule(silent = true) {
42
42
  encoding: 'utf-8',
43
43
  timeout: 10000,
44
44
  stdio: silent ? 'ignore' : 'inherit',
45
- shell: process.platform === 'win32'
45
+ shell: process.platform === 'win32',
46
+ windowsHide: true
46
47
  });
47
48
  } catch { /* intentional best-effort fallback: failure here must never crash the CLI/MCP runtime */ }
48
49
  if (!fileExists(CURSOR_RTK_RULE_SRC)) {
@@ -270,7 +271,7 @@ function buildMcpServers(pythonCmd, serverPath, uvxCmd) {
270
271
  // Only register semble when uvx is actually usable
271
272
  const uvxAvailable = (() => {
272
273
  try {
273
- const res = spawnSync(uvxCmd, ['--version'], { encoding: 'utf-8', timeout: 5000, shell: process.platform === 'win32' });
274
+ const res = spawnSync(uvxCmd, ['--version'], { encoding: 'utf-8', timeout: 5000, shell: process.platform === 'win32', windowsHide: true });
274
275
  return res.status === 0;
275
276
  } catch { return false; }
276
277
  })();
@@ -290,7 +291,7 @@ function buildMcpServers(pythonCmd, serverPath, uvxCmd) {
290
291
  let args = ['-y', '--prefer-offline', '-p', 'aislop@0.18.1', 'aislop-mcp'];
291
292
  try {
292
293
  const whichCmd = isWin ? 'where' : 'which';
293
- const whichRes = spawnSync(whichCmd, ['aislop-mcp'], { encoding: 'utf-8', shell: isWin, timeout: 3000 });
294
+ const whichRes = spawnSync(whichCmd, ['aislop-mcp'], { encoding: 'utf-8', shell: isWin, timeout: 3000, windowsHide: true });
294
295
  if (whichRes.status === 0 && whichRes.stdout.trim()) {
295
296
  const binPath = whichRes.stdout.trim().split('\n')[0].trim();
296
297
  if (binPath && fileExists(binPath)) {
@@ -31,27 +31,50 @@ const FILE_TOOLS_LAUNCHER_JS = path.join(
31
31
  * over a build-only copy — used by `konoha ui build`.
32
32
  * Returns null when the UI is unavailable on this machine.
33
33
  */
34
+ let cachedNpmGlobalRoot = null;
35
+ let cachedResolvedWebUiDir = null;
36
+
34
37
  function resolveWebUiDir(opts = {}) {
38
+ if (!opts.preferSources && cachedResolvedWebUiDir && fs.existsSync(cachedResolvedWebUiDir)) {
39
+ return cachedResolvedWebUiDir;
40
+ }
41
+
35
42
  const candidates = [
36
43
  path.resolve(process.cwd(), "apps", "web"),
37
44
  path.resolve(process.cwd()),
38
45
  path.join(HOME, ".konoha", "apps", "web"),
39
46
  path.resolve(__dirname, "..", "apps", "web")
40
47
  ];
41
- try {
42
- const isWin = process.platform === "win32";
43
- const res = spawnSync(isWin ? "npm.cmd" : "npm", ["root", "-g"], {
44
- encoding: "utf-8",
45
- timeout: 8000,
46
- shell: isWin
47
- });
48
- const globalRoot = ((res.stdout || "") + "").trim().split(/\r?\n/).filter(Boolean).pop();
49
- if (globalRoot) {
50
- candidates.push(path.join(globalRoot, "konoha", "apps", "web"));
51
- candidates.push(path.join(globalRoot, "Konoha", "apps", "web"));
52
- candidates.push(path.join(globalRoot, "konohagakure", "apps", "web"));
48
+
49
+ // Only probe npm global root if none of the standard local candidates exist
50
+ const hasLocalCandidate = candidates.some((dir) => {
51
+ try {
52
+ return fs.existsSync(path.join(dir, "package.json")) || fs.existsSync(path.join(dir, "build", "handler.js"));
53
+ } catch (_) {
54
+ return false;
53
55
  }
54
- } catch (_) { /* intentional best-effort fallback: failure here must never crash the CLI/MCP runtime */ }
56
+ });
57
+
58
+ if (!hasLocalCandidate) {
59
+ try {
60
+ if (cachedNpmGlobalRoot === null) {
61
+ const isWin = process.platform === "win32";
62
+ const res = spawnSync(isWin ? "npm.cmd" : "npm", ["root", "-g"], {
63
+ encoding: "utf-8",
64
+ timeout: 8000,
65
+ shell: isWin,
66
+ windowsHide: true
67
+ });
68
+ cachedNpmGlobalRoot = ((res.stdout || "") + "").trim().split(/\r?\n/).filter(Boolean).pop() || "";
69
+ }
70
+ if (cachedNpmGlobalRoot) {
71
+ const globalRoot = cachedNpmGlobalRoot;
72
+ candidates.push(path.join(globalRoot, "konoha", "apps", "web"));
73
+ candidates.push(path.join(globalRoot, "Konoha", "apps", "web"));
74
+ candidates.push(path.join(globalRoot, "konohagakure", "apps", "web"));
75
+ }
76
+ } catch (_) { /* intentional best-effort fallback: failure here must never crash the CLI/MCP runtime */ }
77
+ }
55
78
 
56
79
  const qualifying = [];
57
80
  const seen = new Set();
@@ -85,8 +108,9 @@ function resolveWebUiDir(opts = {}) {
85
108
  return null;
86
109
  }
87
110
  const withBuild = qualifying.find((c) => c.hasBuild);
88
- if (withBuild) return withBuild.dir;
89
- return qualifying[0].dir;
111
+ const selected = withBuild ? withBuild.dir : qualifying[0].dir;
112
+ cachedResolvedWebUiDir = selected;
113
+ return selected;
90
114
  }
91
115
 
92
116
  function copyFile(src, dest) {
@@ -91,7 +91,8 @@ function readZipEntry(filePath, entryName) {
91
91
  try {
92
92
  const res = spawnSync('unzip', ['-p', filePath, entryName], {
93
93
  encoding: 'utf8',
94
- maxBuffer: 15 * 1024 * 1024
94
+ maxBuffer: 15 * 1024 * 1024,
95
+ windowsHide: true
95
96
  });
96
97
  if (res.status === 0 && res.stdout) return res.stdout;
97
98
  } catch (_) { /* fallback */ }
@@ -105,7 +106,8 @@ with zipfile.ZipFile(sys.argv[1], 'r') as z:
105
106
  break`;
106
107
  const res = spawnSync('python3', ['-c', pyScript, filePath, entryName], {
107
108
  encoding: 'utf8',
108
- maxBuffer: 15 * 1024 * 1024
109
+ maxBuffer: 15 * 1024 * 1024,
110
+ windowsHide: true
109
111
  });
110
112
  if (res.status === 0 && res.stdout) return res.stdout;
111
113
  } catch (_) { /* ignore */ }
@@ -118,7 +120,7 @@ with zipfile.ZipFile(sys.argv[1], 'r') as z:
118
120
  */
119
121
  function listZipEntries(filePath) {
120
122
  try {
121
- const res = spawnSync('unzip', ['-l', filePath], { encoding: 'utf8' });
123
+ const res = spawnSync('unzip', ['-l', filePath], { encoding: 'utf8', windowsHide: true });
122
124
  if (res.status === 0 && res.stdout) {
123
125
  return res.stdout
124
126
  .split('\n')
@@ -132,7 +134,7 @@ function listZipEntries(filePath) {
132
134
  with zipfile.ZipFile(sys.argv[1], 'r') as z:
133
135
  for n in z.namelist():
134
136
  print(n)`;
135
- const res = spawnSync('python3', ['-c', pyScript, filePath], { encoding: 'utf8' });
137
+ const res = spawnSync('python3', ['-c', pyScript, filePath], { encoding: 'utf8', windowsHide: true });
136
138
  if (res.status === 0 && res.stdout) {
137
139
  return res.stdout.split('\n').map((l) => l.trim()).filter(Boolean);
138
140
  }
@@ -212,7 +214,8 @@ function extractPdf(filePath) {
212
214
  try {
213
215
  const res = spawnSync('pdftotext', [filePath, '-'], {
214
216
  encoding: 'utf8',
215
- maxBuffer: 10 * 1024 * 1024
217
+ maxBuffer: 10 * 1024 * 1024,
218
+ windowsHide: true
216
219
  });
217
220
  if (res.status === 0 && res.stdout) {
218
221
  text = res.stdout;
@@ -220,7 +223,7 @@ function extractPdf(filePath) {
220
223
  } catch (_) { /* fallback */ }
221
224
 
222
225
  try {
223
- const res = spawnSync('pdfinfo', [filePath], { encoding: 'utf8' });
226
+ const res = spawnSync('pdfinfo', [filePath], { encoding: 'utf8', windowsHide: true });
224
227
  if (res.status === 0 && res.stdout) {
225
228
  metadata = res.stdout;
226
229
  }
@@ -405,7 +405,8 @@ const TOOL_HANDLERS = {
405
405
  qa_codify: (args) => require('./qa_tools').qaCodify(args),
406
406
  qa_e2e_run: (args) => require('./qa_tools').qaE2eRun(args),
407
407
  use_skills: (args) => runNodeSkillTool('use_skills', args),
408
- anti_slop: (args) => runNodeSkillTool('anti_slop', args)
408
+ anti_slop: (args) => runNodeSkillTool('anti_slop', args),
409
+ get_soul: (args) => runNodeSkillTool('get_soul', args)
409
410
  };
410
411
 
411
412
  function validateSchemaValue(value, schema, key) {
@@ -295,6 +295,17 @@ function boundPersonaMemories(mems) {
295
295
  return JSON.stringify({ error: `Failed to delete memory: ${e.message}` });
296
296
  }
297
297
  }
298
+ if (toolName === 'get_soul') {
299
+ const agentName = args.agent_name || args.agent || null;
300
+ const projectPath = args.project_path || getWorkspaceRoot();
301
+ const raw = Boolean(args.raw);
302
+ try {
303
+ const soul = personaMemory.getSoul({ agentName, projectPath, raw });
304
+ return raw ? (soul.raw_markdown || '') : JSON.stringify(soul);
305
+ } catch (e) {
306
+ return JSON.stringify({ error: `Failed to load soul: ${e.message}` });
307
+ }
308
+ }
298
309
  if (toolName === 'check_readiness') {
299
310
  const sdlcManager = require('../sdlc_manager');
300
311
  const taskInput = args.task || args.prompt || args.description || '';
@@ -1527,6 +1527,28 @@
1527
1527
  ],
1528
1528
  "additionalProperties": false
1529
1529
  }
1530
+ },
1531
+ {
1532
+ "name": "get_soul",
1533
+ "description": "Retrieve the Soul of Konoha (Will of Fire), universal shinobi tenets, and archetype persona voice for agents.",
1534
+ "inputSchema": {
1535
+ "type": "object",
1536
+ "properties": {
1537
+ "agent_name": {
1538
+ "type": "string",
1539
+ "description": "Specific agent archetype to load (e.g. 'sannin', 'kage', 'jonin', 'anbu', 'genin', 'chunin', 'tokubetsu-jonin')."
1540
+ },
1541
+ "project_path": {
1542
+ "type": "string",
1543
+ "description": "Optional project path to check for workspace-specific SOUL.md override."
1544
+ },
1545
+ "raw": {
1546
+ "type": "boolean",
1547
+ "description": "Return raw markdown content instead of structured JSON."
1548
+ }
1549
+ },
1550
+ "additionalProperties": false
1551
+ }
1530
1552
  }
1531
1553
  ]
1532
1554
  }
@@ -6,6 +6,7 @@
6
6
  const fs = require('fs');
7
7
  const path = require('path');
8
8
  const crypto = require('crypto');
9
+ const os = require('os');
9
10
  const db = require('./db');
10
11
 
11
12
  let DB_PATH = db.DB_PATH;
@@ -877,11 +878,142 @@ function formatProjectContextForPrompt(projectProfile, memories = null, maxMemor
877
878
  return lines.join("\n") + "\n\n";
878
879
  }
879
880
 
881
+ function resolveSoulPath(projectPath = null) {
882
+ const candidates = [];
883
+ if (projectPath) {
884
+ candidates.push(path.join(path.resolve(projectPath), '.agents', 'SOUL.md'));
885
+ candidates.push(path.join(path.resolve(projectPath), 'SOUL.md'));
886
+ }
887
+ candidates.push(path.join(__dirname, '..', '.agents', 'SOUL.md'));
888
+ candidates.push(path.join(__dirname, 'templates', 'SOUL.md'));
889
+ candidates.push(path.join(os.homedir(), '.agents', 'SOUL.md'));
890
+
891
+ for (const c of candidates) {
892
+ if (fs.existsSync(c)) return c;
893
+ }
894
+ return null;
895
+ }
896
+
897
+ function parseSoulMarkdown(rawMarkdown) {
898
+ const result = {
899
+ title: 'The Soul of Konoha: The Will of Fire',
900
+ will_of_fire: "Where tree leaves dance, one shall find flames. The fire's shadow will illuminate the village, and once again, tree leaves shall bud anew.",
901
+ universal_adhd_standard: 'i-have-adhd (Lead with next action, numbered tasks, end with one concrete step, cap visible lists to 5, matter-of-fact errors, zero filler)',
902
+ tenets: [
903
+ { name: 'Factual Rigor & Absolute Truth', summary: 'Never lie. Claim success only with verified terminal evidence.' },
904
+ { name: 'Silent Depth & Mandatory ADHD Shaping', summary: 'Zero monologue leaks. Enforce i-have-adhd across all turn responses: lead with action, numbered steps, cap lists to 5, zero filler.' },
905
+ { name: 'Sanctity of Existing Architecture', summary: 'Protect working code. Never modify unrequested logic.' },
906
+ { name: 'Anti-Slop as a Moral Duty', summary: 'Reject generic AI boilerplate, robotic pleasantries, and visual clichés.' },
907
+ { name: 'Tactical Token Hygiene', summary: 'Zero wasted movement. Bounded file reading and symbol search.' }
908
+ ],
909
+ archetypes: {
910
+ sannin: {
911
+ name: '✧ Sannin',
912
+ role: 'The Grand Tactician (Router)',
913
+ voice: 'The battlefield is clear. Task analyzed; dispatching the ideal specialist without a single wasted second.',
914
+ calling: 'Instant task classification, domain triage, subagent dispatch, and token-safe structured arguments.',
915
+ antislop_skills: ['antislop'],
916
+ adhd_shaping: 'Lead with routing verdict, numbered triage steps (max 3), cap delegation to 1 specialist, zero fluff.'
917
+ },
918
+ kage: {
919
+ name: '◎ Kage',
920
+ role: 'The Sovereign Guardian (Village Leader)',
921
+ voice: 'Zero defects permitted past the village gates. 100/100 anti-slop score and ≥ 98% confidence verified before delivery.',
922
+ calling: 'Architectural oversight, supply chain audit, Zero-AI-Slop gate enforcement, and final delivery approval.',
923
+ antislop_skills: ['antislop', 'antislop-code', 'antislop-human'],
924
+ adhd_shaping: 'Lead with pass/fail verdict and score, numbered verification categories, matter-of-fact confidence reporting.'
925
+ },
926
+ jonin: {
927
+ name: '♦ Jonin',
928
+ role: 'The Elite Artisan (Frontend Master)',
929
+ voice: 'Every pixel must breathe. Responsive, fluid, accessible, and vibrant—never cookie-cutter AI filler.',
930
+ calling: 'Next.js, SvelteKit, Nuxt, Angular, Tailwind CSS v4, WebGL/3D, and fluid motion.',
931
+ antislop_skills: ['antislop', 'antislop-code', 'antislop-human', 'antislop-ui', 'antislop-layoutmobile'],
932
+ adhd_shaping: 'Lead with UI action/file path, numbered component steps, cap visible options to 5, end with build check.'
933
+ },
934
+ anbu: {
935
+ name: '♠ Anbu',
936
+ role: 'The Covert Specialist (Backend & Black Ops)',
937
+ voice: 'The pipes are silent, the connections pooled, and the boundaries hardened. Systems don\'t break on my watch.',
938
+ calling: 'Node/Bun/Python/Go backends, databases, distributed caching, Docker/K8s/Terraform, and defensive security auditing.',
939
+ antislop_skills: ['antislop', 'antislop-code', 'antislop-human'],
940
+ adhd_shaping: 'Lead with exact command/patch, numbered backend steps, calm error reporting, make system wins visible.'
941
+ },
942
+ genin: {
943
+ name: '⚑ Genin',
944
+ role: 'The Non-Destructive Scout (Explorer)',
945
+ voice: 'Trail mapped. All dependencies, references, and symbol paths traced with zero side effects.',
946
+ calling: 'Read-only codebase exploration, AST symbol tracing, dependency graphing, and blast-radius analysis.',
947
+ antislop_skills: ['antislop', 'antislop-code', 'antislop-human'],
948
+ adhd_shaping: 'Lead with exploration entry point, numbered discovery trace, cap symbol lists to 5, zero side effects.'
949
+ },
950
+ chunin: {
951
+ name: '▫ Chunin',
952
+ role: 'The Empirical Scholar (Intel Ninja)',
953
+ voice: 'Every assertion backed by primary documentation. Citations verified against ground truth.',
954
+ calling: 'Autonomous technical research, library documentation synthesis, and competitive analysis with verifiable citations.',
955
+ antislop_skills: ['antislop', 'antislop-code', 'antislop-human'],
956
+ adhd_shaping: 'Lead with verified documentation answer, numbered evidence points, cap citations to 5, end with concrete recommendation.'
957
+ },
958
+ 'tokubetsu-jonin': {
959
+ name: '⬡ Tokubetsu-Jonin',
960
+ role: 'The Authentic Scribe (Humanist Writer)',
961
+ voice: 'Writing must be human, clear, and compelling. Documents that people actually enjoy reading.',
962
+ calling: 'Production-grade technical documentation, runbooks, and refined human-authentic office documents (Word, Excel, PPT, PDF).',
963
+ antislop_skills: ['antislop', 'antislop-code', 'antislop-human', 'antislop-copywriting'],
964
+ adhd_shaping: 'Lead with executive takeaway, numbered sections, zero robotic AI fluff, compact human prose.'
965
+ }
966
+ },
967
+ raw_markdown: rawMarkdown || ''
968
+ };
969
+
970
+ return result;
971
+ }
972
+
973
+ function getSoul(options = {}) {
974
+ const projectPath = options.projectPath || options.project_path || null;
975
+ const agentName = (options.agentName || options.agent_name || '').toLowerCase().trim();
976
+ const rawOnly = Boolean(options.raw || options.raw_markdown);
977
+
978
+ const soulPath = resolveSoulPath(projectPath);
979
+ let raw = '';
980
+ if (soulPath && fs.existsSync(soulPath)) {
981
+ try {
982
+ raw = fs.readFileSync(soulPath, 'utf8');
983
+ } catch (_) { /* fallback */ }
984
+ }
985
+
986
+ if (rawOnly) {
987
+ return { path: soulPath, raw_markdown: raw };
988
+ }
989
+
990
+ const parsed = parseSoulMarkdown(raw);
991
+ parsed.path = soulPath;
992
+ parsed.source_path = soulPath;
993
+
994
+ const normAgent = agentName ? agentName.replace(/_/g, '-') : '';
995
+ if (agentName && (parsed.archetypes[agentName] || parsed.archetypes[normAgent])) {
996
+ const arch = parsed.archetypes[agentName] || parsed.archetypes[normAgent];
997
+ return {
998
+ title: parsed.title,
999
+ will_of_fire: parsed.will_of_fire,
1000
+ tenets: parsed.tenets,
1001
+ archetype: arch,
1002
+ path: soulPath,
1003
+ source_path: soulPath
1004
+ };
1005
+ }
1006
+
1007
+ return parsed;
1008
+ }
1009
+
880
1010
  module.exports = {
881
1011
  get DB_PATH() { return DB_PATH || db.DB_PATH; },
882
1012
  set DB_PATH(val) { DB_PATH = val; db.DB_PATH = val; },
883
1013
  getDb,
884
1014
  get_db: getDb,
1015
+ getSoul,
1016
+ get_soul: getSoul,
885
1017
  computeProjectHash,
886
1018
  compute_project_hash: computeProjectHash,
887
1019
  detectProjectStack,
package/src/pi_manager.js CHANGED
@@ -515,7 +515,7 @@ function registerPiMcp(pythonCmd, serverPath, uvxCmd, silent = true) {
515
515
 
516
516
  config.mcpServers['konoha'] = {
517
517
  command: process.execPath || 'node',
518
- // Match the other clients: the konoha entry serves all 37 canonical tools through
518
+ // Match the other clients: the konoha entry serves all 40 canonical tools through
519
519
  // the file-tools launcher (which bootstraps node + workspace jail),
520
520
  // not the orchestrator-only server.js
521
521
  args: [fileExists(deployUtils.FILE_TOOLS_LAUNCHER_JS) ? deployUtils.FILE_TOOLS_LAUNCHER_JS : deployUtils.FILE_TOOLS_MCP_PATH],
@@ -114,7 +114,8 @@ function detectPython() {
114
114
  try {
115
115
  const res = spawnSync(candidate.command, [...candidate.args, '--version'], {
116
116
  encoding: 'utf-8',
117
- shell: false
117
+ shell: false,
118
+ windowsHide: true
118
119
  });
119
120
  const version = `${res.stdout || ''}${res.stderr || ''}`;
120
121
  if (res.status === 0 && version.includes('Python 3')) {
@@ -167,20 +168,20 @@ function normalizeCommand(command) {
167
168
  function spawnPythonSync(pythonCmd, args = [], options = {}) {
168
169
  const norm = normalizeCommand(pythonCmd || detectPythonOrDefault());
169
170
  const finalArgs = [...norm.prefixArgs, ...(Array.isArray(args) ? args : [])];
170
- return spawnSync(norm.executable, finalArgs, options);
171
+ return spawnSync(norm.executable, finalArgs, Object.assign({ windowsHide: true }, options));
171
172
  }
172
173
 
173
174
  function spawnPython(pythonCmd, args = [], options = {}) {
174
175
  const { spawn } = require('child_process');
175
176
  const norm = normalizeCommand(pythonCmd || detectPythonOrDefault());
176
177
  const finalArgs = [...norm.prefixArgs, ...(Array.isArray(args) ? args : [])];
177
- return spawn(norm.executable, finalArgs, options);
178
+ return spawn(norm.executable, finalArgs, Object.assign({ windowsHide: true }, options));
178
179
  }
179
180
 
180
181
 
181
182
  function getUvCommand() {
182
183
  try {
183
- const result = spawnSync('uv', ['--version'], { stdio: 'ignore' });
184
+ const result = spawnSync('uv', ['--version'], { stdio: 'ignore', windowsHide: true });
184
185
  if (result.status === 0) return 'uv';
185
186
  } catch { /* intentional best-effort fallback: failure here must never crash the CLI/MCP runtime */ }
186
187
 
@@ -200,7 +201,7 @@ function getUvCommand() {
200
201
  for (const p of localPaths) {
201
202
  if (p && fileExists(p)) {
202
203
  try {
203
- const result = spawnSync(p, ['--version'], { stdio: 'ignore' });
204
+ const result = spawnSync(p, ['--version'], { stdio: 'ignore', windowsHide: true });
204
205
  if (result.status !== 0) throw new Error('uv probe failed');
205
206
  return p;
206
207
  } catch { /* intentional best-effort fallback: failure here must never crash the CLI/MCP runtime */ }
@@ -228,7 +229,8 @@ function isCommandAvailable(cmd) {
228
229
  try {
229
230
  const run = spawnSync(probe, [cmd], {
230
231
  encoding: 'utf-8',
231
- shell: IS_WIN
232
+ shell: IS_WIN,
233
+ windowsHide: true
232
234
  });
233
235
  return run.status === 0 && Boolean((run.stdout || '').trim());
234
236
  } catch {
@@ -271,7 +273,7 @@ ensureUserBinInPath();
271
273
  function getRtkCommand() {
272
274
  ensureUserBinInPath();
273
275
  try {
274
- const result = spawnSync('rtk', ['--version'], { encoding: 'utf-8', timeout: 5000 });
276
+ const result = spawnSync('rtk', ['--version'], { encoding: 'utf-8', timeout: 5000, windowsHide: true });
275
277
  if (result.status === 0) return 'rtk';
276
278
  } catch { /* intentional best-effort fallback: failure here must never crash the CLI/MCP runtime */ }
277
279
 
@@ -285,7 +287,7 @@ function getRtkCommand() {
285
287
  : [
286
288
  path.join(home, '.local', 'bin', 'rtk'),
287
289
  path.join(home, '.cargo', 'bin', 'rtk'),
288
- '/usr/local/bin/rtk',
290
+ '/usr/local/bin',
289
291
  '/usr/bin/rtk',
290
292
  '/opt/homebrew/bin/rtk'
291
293
  ];
@@ -293,7 +295,7 @@ function getRtkCommand() {
293
295
  for (const p of localPaths) {
294
296
  if (p && fileExists(p)) {
295
297
  try {
296
- const result = spawnSync(p, ['--version'], { encoding: 'utf-8', timeout: 5000 });
298
+ const result = spawnSync(p, ['--version'], { encoding: 'utf-8', timeout: 5000, windowsHide: true });
297
299
  if (result.status === 0) return p;
298
300
  } catch { /* intentional best-effort fallback: failure here must never crash the CLI/MCP runtime */ }
299
301
  }