konoha-mcp 2.1.15 → 2.1.17

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 (259) hide show
  1. package/.agents/SOUL.md +165 -0
  2. package/.agents/skills/konoha/SKILL.md +32 -3
  3. package/.agents/skills.fingerprint +1 -1
  4. package/README.md +188 -221
  5. package/apps/web/build/adapter-node.js +1 -1
  6. package/apps/web/build/client/_app/immutable/assets/0.BGEsEaMd.css +2 -0
  7. package/apps/web/build/client/_app/immutable/assets/0.BGEsEaMd.css.br +0 -0
  8. package/apps/web/build/client/_app/immutable/assets/0.BGEsEaMd.css.gz +0 -0
  9. package/apps/web/build/client/_app/immutable/chunks/{D-Kujhko.js → 2WlqNq2Q.js} +1 -1
  10. package/apps/web/build/client/_app/immutable/chunks/2WlqNq2Q.js.br +0 -0
  11. package/apps/web/build/client/_app/immutable/chunks/2WlqNq2Q.js.gz +0 -0
  12. package/apps/web/build/client/_app/immutable/chunks/B9vY64pH.js +1 -0
  13. package/apps/web/build/client/_app/immutable/chunks/B9vY64pH.js.br +0 -0
  14. package/apps/web/build/client/_app/immutable/chunks/B9vY64pH.js.gz +0 -0
  15. package/apps/web/build/client/_app/immutable/chunks/{Dzm74gVd.js → BPX4jQ9l.js} +1 -1
  16. package/apps/web/build/client/_app/immutable/chunks/BPX4jQ9l.js.br +2 -0
  17. package/apps/web/build/client/_app/immutable/chunks/BPX4jQ9l.js.gz +0 -0
  18. package/apps/web/build/client/_app/immutable/chunks/{fbrtLByB.js → BXssplIZ.js} +1 -1
  19. package/apps/web/build/client/_app/immutable/chunks/BXssplIZ.js.br +0 -0
  20. package/apps/web/build/client/_app/immutable/chunks/BXssplIZ.js.gz +0 -0
  21. package/apps/web/build/client/_app/immutable/chunks/C-3vSv0T.js +1 -0
  22. package/apps/web/build/client/_app/immutable/chunks/C-3vSv0T.js.br +2 -0
  23. package/apps/web/build/client/_app/immutable/chunks/C-3vSv0T.js.gz +0 -0
  24. package/apps/web/build/client/_app/immutable/chunks/{PrdhfbrQ.js → C7jhkUmC.js} +1 -1
  25. package/apps/web/build/client/_app/immutable/chunks/C7jhkUmC.js.br +0 -0
  26. package/apps/web/build/client/_app/immutable/chunks/{PrdhfbrQ.js.gz → C7jhkUmC.js.gz} +0 -0
  27. package/apps/web/build/client/_app/immutable/chunks/{7LmsTWIo.js → CfrhQlXt.js} +1 -1
  28. package/apps/web/build/client/_app/immutable/chunks/CfrhQlXt.js.br +0 -0
  29. package/apps/web/build/client/_app/immutable/chunks/CfrhQlXt.js.gz +0 -0
  30. package/apps/web/build/client/_app/immutable/chunks/CgzsRqh3.js +1 -0
  31. package/apps/web/build/client/_app/immutable/chunks/CgzsRqh3.js.br +1 -0
  32. package/apps/web/build/client/_app/immutable/chunks/CgzsRqh3.js.gz +0 -0
  33. package/apps/web/build/client/_app/immutable/chunks/ChmznE4L.js +2 -0
  34. package/apps/web/build/client/_app/immutable/chunks/ChmznE4L.js.br +0 -0
  35. package/apps/web/build/client/_app/immutable/chunks/ChmznE4L.js.gz +0 -0
  36. package/apps/web/build/client/_app/immutable/entry/app.cdLMQHsN.js +2 -0
  37. package/apps/web/build/client/_app/immutable/entry/app.cdLMQHsN.js.br +0 -0
  38. package/apps/web/build/client/_app/immutable/entry/app.cdLMQHsN.js.gz +0 -0
  39. package/apps/web/build/client/_app/immutable/entry/{start.CNV5BTCO.js → start.CJ1ccVCA.js} +2 -2
  40. package/apps/web/build/client/_app/immutable/entry/start.CJ1ccVCA.js.br +0 -0
  41. package/apps/web/build/client/_app/immutable/entry/start.CJ1ccVCA.js.gz +0 -0
  42. package/apps/web/build/client/_app/immutable/nodes/0.ijG9ltjt.js +2 -0
  43. package/apps/web/build/client/_app/immutable/nodes/0.ijG9ltjt.js.br +0 -0
  44. package/apps/web/build/client/_app/immutable/nodes/0.ijG9ltjt.js.gz +0 -0
  45. package/apps/web/build/client/_app/immutable/nodes/1.i6MXc2Yb.js +1 -0
  46. package/apps/web/build/client/_app/immutable/nodes/1.i6MXc2Yb.js.br +2 -0
  47. package/apps/web/build/client/_app/immutable/nodes/1.i6MXc2Yb.js.gz +0 -0
  48. package/apps/web/build/client/_app/immutable/nodes/10.B0F7UoZ4.js +1 -0
  49. package/apps/web/build/client/_app/immutable/nodes/10.B0F7UoZ4.js.br +0 -0
  50. package/apps/web/build/client/_app/immutable/nodes/10.B0F7UoZ4.js.gz +0 -0
  51. package/apps/web/build/client/_app/immutable/nodes/11.BuH1S-Sa.js +2 -0
  52. package/apps/web/build/client/_app/immutable/nodes/11.BuH1S-Sa.js.br +0 -0
  53. package/apps/web/build/client/_app/immutable/nodes/11.BuH1S-Sa.js.gz +0 -0
  54. package/apps/web/build/client/_app/immutable/nodes/12.DVFmb_G-.js +1 -0
  55. package/apps/web/build/client/_app/immutable/nodes/12.DVFmb_G-.js.br +0 -0
  56. package/apps/web/build/client/_app/immutable/nodes/12.DVFmb_G-.js.gz +0 -0
  57. package/apps/web/build/client/_app/immutable/nodes/13.0PJQyjqs.js +1 -0
  58. package/apps/web/build/client/_app/immutable/nodes/13.0PJQyjqs.js.br +0 -0
  59. package/apps/web/build/client/_app/immutable/nodes/13.0PJQyjqs.js.gz +0 -0
  60. package/apps/web/build/client/_app/immutable/nodes/14.ljEGDzwO.js +3 -0
  61. package/apps/web/build/client/_app/immutable/nodes/14.ljEGDzwO.js.br +0 -0
  62. package/apps/web/build/client/_app/immutable/nodes/14.ljEGDzwO.js.gz +0 -0
  63. package/apps/web/build/client/_app/immutable/nodes/15.DpXDNTPX.js +1 -0
  64. package/apps/web/build/client/_app/immutable/nodes/15.DpXDNTPX.js.br +0 -0
  65. package/apps/web/build/client/_app/immutable/nodes/15.DpXDNTPX.js.gz +0 -0
  66. package/apps/web/build/client/_app/immutable/nodes/16.qIEBxyps.js +17 -0
  67. package/apps/web/build/client/_app/immutable/nodes/16.qIEBxyps.js.br +0 -0
  68. package/apps/web/build/client/_app/immutable/nodes/16.qIEBxyps.js.gz +0 -0
  69. package/apps/web/build/client/_app/immutable/nodes/17.CmVvQa7x.js +1 -0
  70. package/apps/web/build/client/_app/immutable/nodes/17.CmVvQa7x.js.br +0 -0
  71. package/apps/web/build/client/_app/immutable/nodes/17.CmVvQa7x.js.gz +0 -0
  72. package/apps/web/build/client/_app/immutable/nodes/{2.Dr646Vs5.js → 2.lx602Ou_.js} +1 -1
  73. package/apps/web/build/client/_app/immutable/nodes/2.lx602Ou_.js.br +0 -0
  74. package/apps/web/build/client/_app/immutable/nodes/2.lx602Ou_.js.gz +0 -0
  75. package/apps/web/build/client/_app/immutable/nodes/3.B-axtlUy.js +1 -0
  76. package/apps/web/build/client/_app/immutable/nodes/3.B-axtlUy.js.br +0 -0
  77. package/apps/web/build/client/_app/immutable/nodes/3.B-axtlUy.js.gz +0 -0
  78. package/apps/web/build/client/_app/immutable/nodes/4.Cp9WmMgk.js +1 -0
  79. package/apps/web/build/client/_app/immutable/nodes/4.Cp9WmMgk.js.br +0 -0
  80. package/apps/web/build/client/_app/immutable/nodes/4.Cp9WmMgk.js.gz +0 -0
  81. package/apps/web/build/client/_app/immutable/nodes/5.CQxJe2vk.js +1 -0
  82. package/apps/web/build/client/_app/immutable/nodes/5.CQxJe2vk.js.br +0 -0
  83. package/apps/web/build/client/_app/immutable/nodes/5.CQxJe2vk.js.gz +0 -0
  84. package/apps/web/build/client/_app/immutable/nodes/6.5S6pozqG.js +1 -0
  85. package/apps/web/build/client/_app/immutable/nodes/6.5S6pozqG.js.br +0 -0
  86. package/apps/web/build/client/_app/immutable/nodes/6.5S6pozqG.js.gz +0 -0
  87. package/apps/web/build/client/_app/immutable/nodes/{7.CmbiPMU3.js → 7.B5ZeCLvS.js} +1 -1
  88. package/apps/web/build/client/_app/immutable/nodes/7.B5ZeCLvS.js.br +0 -0
  89. package/apps/web/build/client/_app/immutable/nodes/7.B5ZeCLvS.js.gz +0 -0
  90. package/apps/web/build/client/_app/immutable/nodes/8.M3fxLxa9.js +1 -0
  91. package/apps/web/build/client/_app/immutable/nodes/8.M3fxLxa9.js.br +0 -0
  92. package/apps/web/build/client/_app/immutable/nodes/8.M3fxLxa9.js.gz +0 -0
  93. package/apps/web/build/client/_app/immutable/nodes/9.CYkQmFMJ.js +21 -0
  94. package/apps/web/build/client/_app/immutable/nodes/9.CYkQmFMJ.js.br +0 -0
  95. package/apps/web/build/client/_app/immutable/nodes/9.CYkQmFMJ.js.gz +0 -0
  96. package/apps/web/build/client/_app/version.json +1 -1
  97. package/apps/web/build/client/_app/version.json.br +0 -0
  98. package/apps/web/build/client/_app/version.json.gz +0 -0
  99. package/apps/web/build/server/.vite/manifest.json +15 -1
  100. package/apps/web/build/server/_app/immutable/assets/_layout.BGEsEaMd.css +2 -0
  101. package/apps/web/build/server/chunks/api.js +4 -0
  102. package/apps/web/build/server/chunks/api.js.map +1 -1
  103. package/apps/web/build/server/chunks/instance.js +3 -3
  104. package/apps/web/build/server/chunks/internal.js +1 -1
  105. package/apps/web/build/server/entries/pages/_layout.svelte.js +7 -0
  106. package/apps/web/build/server/entries/pages/_layout.svelte.js.map +1 -1
  107. package/apps/web/build/server/entries/pages/agents/_page.svelte.js +6 -2
  108. package/apps/web/build/server/entries/pages/agents/_page.svelte.js.map +1 -1
  109. package/apps/web/build/server/entries/pages/docs/_page.svelte.js +86 -2
  110. package/apps/web/build/server/entries/pages/docs/_page.svelte.js.map +1 -1
  111. package/apps/web/build/server/entries/pages/persona/_page.svelte.js +16 -9
  112. package/apps/web/build/server/entries/pages/persona/_page.svelte.js.map +1 -1
  113. package/apps/web/build/server/entries/pages/remote/_page.svelte.js +73 -0
  114. package/apps/web/build/server/entries/pages/remote/_page.svelte.js.map +1 -0
  115. package/apps/web/build/server/manifest-full.js +15 -7
  116. package/apps/web/build/server/manifest.js +15 -7
  117. package/apps/web/build/server/nodes/0.js +2 -2
  118. package/apps/web/build/server/nodes/1.js +1 -1
  119. package/apps/web/build/server/nodes/10.js +1 -1
  120. package/apps/web/build/server/nodes/11.js +1 -1
  121. package/apps/web/build/server/nodes/12.js +2 -2
  122. package/apps/web/build/server/nodes/13.js +2 -2
  123. package/apps/web/build/server/nodes/14.js +2 -2
  124. package/apps/web/build/server/nodes/15.js +2 -2
  125. package/apps/web/build/server/nodes/16.js +2 -2
  126. package/apps/web/build/server/nodes/17.js +8 -0
  127. package/apps/web/build/server/nodes/2.js +1 -1
  128. package/apps/web/build/server/nodes/3.js +1 -1
  129. package/apps/web/build/server/nodes/4.js +1 -1
  130. package/apps/web/build/server/nodes/5.js +1 -1
  131. package/apps/web/build/server/nodes/6.js +1 -1
  132. package/apps/web/build/server/nodes/7.js +1 -1
  133. package/apps/web/build/server/nodes/8.js +1 -1
  134. package/apps/web/build/server/nodes/9.js +1 -1
  135. package/apps/web/build/server/server.js +15 -7
  136. package/apps/web/package.json +1 -1
  137. package/bin/cli.js +465 -32
  138. package/docs/ALL-WORKFLOW-DIAGRAMS.md +135 -0
  139. package/docs/ARCHITECTURE.md +28 -6
  140. package/docs/BENCHMARK.md +55 -26
  141. package/docs/CLOUDFLARE_TUNNEL_GUIDE.md +119 -0
  142. package/docs/SecurityCompliance/security_compliance_report_google_policy_2.1.16_2026-10-08.md +69 -0
  143. package/docs/SecurityCompliance/security_compliance_report_google_policy_2.1.17_2026-10-08.md +87 -0
  144. package/docs/TELEGRAM_INTEGRATION_GUIDE.md +146 -0
  145. package/docs/TROUBLESHOOTING.md +2 -2
  146. package/docs/architecture/CANONICAL-API.md +4 -1
  147. package/docs/architecture/TOKEN-BASELINE.md +6 -6
  148. package/docs/diagrams/README.md +6 -2
  149. package/docs/diagrams/konoha-architecture.drawio +121 -0
  150. package/docs/diagrams/konoha-enterprise-architecture.drawio +121 -0
  151. package/package.json +1 -1
  152. package/src/agent_manager.js +75 -8
  153. package/src/canonical_skills.js +2 -0
  154. package/src/crypto_vault.js +157 -0
  155. package/src/db.js +186 -65
  156. package/src/db_agents.js +1 -1
  157. package/src/deploy_utils.js +4 -3
  158. package/src/file_tools_router.js +2 -1
  159. package/src/mcp/memory_reporting.js +19 -0
  160. package/src/mcp/skills.js +17 -15
  161. package/src/mcp/tool_dispatch.js +11 -0
  162. package/src/mcp/workflow.js +38 -0
  163. package/src/mcp_tool_manifest.json +22 -0
  164. package/src/migrate.js +74 -6
  165. package/src/persona_memory.js +133 -1
  166. package/src/pi_manager.js +1 -1
  167. package/src/prompt_hook.js +40 -1
  168. package/src/queue/inbox.js +243 -0
  169. package/src/queue/worker.js +413 -0
  170. package/src/telegram/config.js +101 -0
  171. package/src/telegram/notifier.js +359 -0
  172. package/src/telegram/poller.js +548 -0
  173. package/src/telegram/session_manager.js +583 -0
  174. package/src/templates/SOUL.md +165 -0
  175. package/src/templates/skills/konoha/SKILL.md +32 -3
  176. package/src/tunnel/config.js +89 -0
  177. package/src/tunnel/manager.js +216 -0
  178. package/src/tunnel/security.js +225 -0
  179. package/src/vector_search.js +21 -11
  180. package/src/web_server.js +377 -10
  181. package/apps/web/build/client/_app/immutable/assets/0.CASgEURp.css +0 -2
  182. package/apps/web/build/client/_app/immutable/assets/0.CASgEURp.css.br +0 -0
  183. package/apps/web/build/client/_app/immutable/assets/0.CASgEURp.css.gz +0 -0
  184. package/apps/web/build/client/_app/immutable/chunks/7LmsTWIo.js.br +0 -0
  185. package/apps/web/build/client/_app/immutable/chunks/7LmsTWIo.js.gz +0 -0
  186. package/apps/web/build/client/_app/immutable/chunks/BH86Md_X.js +0 -1
  187. package/apps/web/build/client/_app/immutable/chunks/BH86Md_X.js.br +0 -2
  188. package/apps/web/build/client/_app/immutable/chunks/BH86Md_X.js.gz +0 -0
  189. package/apps/web/build/client/_app/immutable/chunks/C3-t9btS.js +0 -1
  190. package/apps/web/build/client/_app/immutable/chunks/C3-t9btS.js.br +0 -1
  191. package/apps/web/build/client/_app/immutable/chunks/C3-t9btS.js.gz +0 -0
  192. package/apps/web/build/client/_app/immutable/chunks/CBY268r4.js +0 -1
  193. package/apps/web/build/client/_app/immutable/chunks/CBY268r4.js.br +0 -3
  194. package/apps/web/build/client/_app/immutable/chunks/CBY268r4.js.gz +0 -0
  195. package/apps/web/build/client/_app/immutable/chunks/D-Kujhko.js.br +0 -0
  196. package/apps/web/build/client/_app/immutable/chunks/D-Kujhko.js.gz +0 -0
  197. package/apps/web/build/client/_app/immutable/chunks/Dzm74gVd.js.br +0 -0
  198. package/apps/web/build/client/_app/immutable/chunks/Dzm74gVd.js.gz +0 -0
  199. package/apps/web/build/client/_app/immutable/chunks/Lb3VuXoN.js +0 -2
  200. package/apps/web/build/client/_app/immutable/chunks/Lb3VuXoN.js.br +0 -0
  201. package/apps/web/build/client/_app/immutable/chunks/Lb3VuXoN.js.gz +0 -0
  202. package/apps/web/build/client/_app/immutable/chunks/PrdhfbrQ.js.br +0 -0
  203. package/apps/web/build/client/_app/immutable/chunks/fbrtLByB.js.br +0 -0
  204. package/apps/web/build/client/_app/immutable/chunks/fbrtLByB.js.gz +0 -0
  205. package/apps/web/build/client/_app/immutable/entry/app.BDzkoHRK.js +0 -2
  206. package/apps/web/build/client/_app/immutable/entry/app.BDzkoHRK.js.br +0 -0
  207. package/apps/web/build/client/_app/immutable/entry/app.BDzkoHRK.js.gz +0 -0
  208. package/apps/web/build/client/_app/immutable/entry/start.CNV5BTCO.js.br +0 -0
  209. package/apps/web/build/client/_app/immutable/entry/start.CNV5BTCO.js.gz +0 -0
  210. package/apps/web/build/client/_app/immutable/nodes/0.u4hg-Zwy.js +0 -2
  211. package/apps/web/build/client/_app/immutable/nodes/0.u4hg-Zwy.js.br +0 -0
  212. package/apps/web/build/client/_app/immutable/nodes/0.u4hg-Zwy.js.gz +0 -0
  213. package/apps/web/build/client/_app/immutable/nodes/1.BZu6jsAH.js +0 -1
  214. package/apps/web/build/client/_app/immutable/nodes/1.BZu6jsAH.js.br +0 -0
  215. package/apps/web/build/client/_app/immutable/nodes/1.BZu6jsAH.js.gz +0 -0
  216. package/apps/web/build/client/_app/immutable/nodes/10.CZKScTFN.js +0 -1
  217. package/apps/web/build/client/_app/immutable/nodes/10.CZKScTFN.js.br +0 -0
  218. package/apps/web/build/client/_app/immutable/nodes/10.CZKScTFN.js.gz +0 -0
  219. package/apps/web/build/client/_app/immutable/nodes/11.DFglFW_i.js +0 -1
  220. package/apps/web/build/client/_app/immutable/nodes/11.DFglFW_i.js.br +0 -0
  221. package/apps/web/build/client/_app/immutable/nodes/11.DFglFW_i.js.gz +0 -0
  222. package/apps/web/build/client/_app/immutable/nodes/12.CSShcv5z.js +0 -1
  223. package/apps/web/build/client/_app/immutable/nodes/12.CSShcv5z.js.br +0 -0
  224. package/apps/web/build/client/_app/immutable/nodes/12.CSShcv5z.js.gz +0 -0
  225. package/apps/web/build/client/_app/immutable/nodes/13.jWUWoBcs.js +0 -3
  226. package/apps/web/build/client/_app/immutable/nodes/13.jWUWoBcs.js.br +0 -0
  227. package/apps/web/build/client/_app/immutable/nodes/13.jWUWoBcs.js.gz +0 -0
  228. package/apps/web/build/client/_app/immutable/nodes/14.H-jSqqen.js +0 -1
  229. package/apps/web/build/client/_app/immutable/nodes/14.H-jSqqen.js.br +0 -0
  230. package/apps/web/build/client/_app/immutable/nodes/14.H-jSqqen.js.gz +0 -0
  231. package/apps/web/build/client/_app/immutable/nodes/15.CpAoyhzV.js +0 -17
  232. package/apps/web/build/client/_app/immutable/nodes/15.CpAoyhzV.js.br +0 -0
  233. package/apps/web/build/client/_app/immutable/nodes/15.CpAoyhzV.js.gz +0 -0
  234. package/apps/web/build/client/_app/immutable/nodes/16.DT_-MxCT.js +0 -1
  235. package/apps/web/build/client/_app/immutable/nodes/16.DT_-MxCT.js.br +0 -0
  236. package/apps/web/build/client/_app/immutable/nodes/16.DT_-MxCT.js.gz +0 -0
  237. package/apps/web/build/client/_app/immutable/nodes/2.Dr646Vs5.js.br +0 -0
  238. package/apps/web/build/client/_app/immutable/nodes/2.Dr646Vs5.js.gz +0 -0
  239. package/apps/web/build/client/_app/immutable/nodes/3.Cgc-xN3x.js +0 -1
  240. package/apps/web/build/client/_app/immutable/nodes/3.Cgc-xN3x.js.br +0 -0
  241. package/apps/web/build/client/_app/immutable/nodes/3.Cgc-xN3x.js.gz +0 -0
  242. package/apps/web/build/client/_app/immutable/nodes/4.CYJQ4bWz.js +0 -1
  243. package/apps/web/build/client/_app/immutable/nodes/4.CYJQ4bWz.js.br +0 -0
  244. package/apps/web/build/client/_app/immutable/nodes/4.CYJQ4bWz.js.gz +0 -0
  245. package/apps/web/build/client/_app/immutable/nodes/5.DbHL-3Es.js +0 -1
  246. package/apps/web/build/client/_app/immutable/nodes/5.DbHL-3Es.js.br +0 -0
  247. package/apps/web/build/client/_app/immutable/nodes/5.DbHL-3Es.js.gz +0 -0
  248. package/apps/web/build/client/_app/immutable/nodes/6.BvWH2qas.js +0 -1
  249. package/apps/web/build/client/_app/immutable/nodes/6.BvWH2qas.js.br +0 -0
  250. package/apps/web/build/client/_app/immutable/nodes/6.BvWH2qas.js.gz +0 -0
  251. package/apps/web/build/client/_app/immutable/nodes/7.CmbiPMU3.js.br +0 -0
  252. package/apps/web/build/client/_app/immutable/nodes/7.CmbiPMU3.js.gz +0 -0
  253. package/apps/web/build/client/_app/immutable/nodes/8.B9897Zm9.js +0 -1
  254. package/apps/web/build/client/_app/immutable/nodes/8.B9897Zm9.js.br +0 -0
  255. package/apps/web/build/client/_app/immutable/nodes/8.B9897Zm9.js.gz +0 -0
  256. package/apps/web/build/client/_app/immutable/nodes/9.CGMmeMVC.js +0 -14
  257. package/apps/web/build/client/_app/immutable/nodes/9.CGMmeMVC.js.br +0 -0
  258. package/apps/web/build/client/_app/immutable/nodes/9.CGMmeMVC.js.gz +0 -0
  259. package/apps/web/build/server/_app/immutable/assets/_layout.CASgEURp.css +0 -2
package/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
  <img src="assets/konoha_logo_kyubi.png" alt="Konoha Logo" width="320">
3
3
  </p>
4
4
 
5
+ [![Release](https://img.shields.io/badge/Release-v2.1.17-blue.svg)](CHANGELOG.md)
5
6
  [![Antigravity](https://img.shields.io/badge/Antigravity-IDE%20%7C%20CLI-7c3aed?logo=rocket&logoColor=white)](README.md)
6
7
  [![Cursor](https://img.shields.io/badge/Cursor-IDE%20%7C%20CLI-000000?logo=cursor&logoColor=white)](README.md)
7
8
  [![Claude Code](https://img.shields.io/badge/Claude%20Code-CLI-d97757?logo=anthropic&logoColor=white)](README.md)
@@ -9,13 +10,21 @@
9
10
  [![Command Code](https://img.shields.io/badge/Command%20Code-CLI-blue)](README.md)
10
11
  [![Codex](https://img.shields.io/badge/Codex-CLI-purple)](README.md)
11
12
  [![Pi (pi.dev)](https://img.shields.io/badge/Pi%20(pi.dev)-CLI-orange)](README.md)
12
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
13
13
  [![Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20macOS%20%7C%20Windows-informational)](README.md)
14
14
  [![Node.js](https://img.shields.io/badge/Node.js-%E2%89%A5%2022.16.0%20%7C%20Pure%20JS-339933?logo=node.js&logoColor=white)](README.md)
15
- [![MCP Tools](https://img.shields.io/badge/MCP%20Tools-37%20Canonical-10b981)](README.md)
16
- [![SearXNG](https://img.shields.io/badge/SearXNG-Zero%20API--Key%20Search-blue)](docs/SETUP-SEARXNG.md)
17
- [![RTK](https://img.shields.io/badge/RTK-Rust%20Token%20Killer-ff6b35?logo=rust&logoColor=white)](README.md)
15
+ [![MCP Tools](https://img.shields.io/badge/MCP%20Tools-40%20Canonical-10b981)](README.md)
16
+ [![Skills Indexed](https://img.shields.io/badge/Skills-1%2C027%20Indexed-8b5cf6)](README.md)
18
17
  [![Observed Token Savings](https://img.shields.io/badge/Observed%20Token%20Savings-83--98%25-9ece6a)](docs/BENCHMARK.md)
18
+ [![RTK](https://img.shields.io/badge/RTK-Rust%20Token%20Killer-ff6b35?logo=rust&logoColor=white)](README.md)
19
+ [![SearXNG](https://img.shields.io/badge/SearXNG-Zero%20API--Key%20Search-blue)](docs/SETUP-SEARXNG.md)
20
+ [![Telegram Bot](https://img.shields.io/badge/Telegram-Dual--Mode%20Remote-26A5E4?logo=telegram&logoColor=white)](docs/TELEGRAM_INTEGRATION_GUIDE.md)
21
+ [![Cloudflare Tunnel](https://img.shields.io/badge/Cloudflare-Zero%20Trust%20Tunnel-F38020?logo=cloudflare&logoColor=white)](docs/CLOUDFLARE_TUNNEL_GUIDE.md)
22
+ [![Crypto Vault](https://img.shields.io/badge/Crypto%20Vault-AES--256--GCM-success)](docs/SecurityCompliance/security_compliance_report_google_policy_2.1.17_2026-10-08.md)
23
+ [![Cybersecurity](https://img.shields.io/badge/Cybersecurity-817%20Skills%20(MITRE)-red)](README.md)
24
+ [![Zero AI Slop](https://img.shields.io/badge/Zero--AI--Slop-100%2F100%20Gate-10b981)](README.md)
25
+ [![Security Policy](https://img.shields.io/badge/Compliance-Google%20Policy%20v2.1.17-blue)](docs/SecurityCompliance/security_compliance_report_google_policy_2.1.17_2026-10-08.md)
26
+ [![Tests](https://img.shields.io/badge/Tests-115%20Passing-brightgreen)](README.md)
27
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
19
28
  [![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-Saweria-orange?logo=buy-me-a-coffee&logoColor=white)](https://saweria.co/andycungkrinx)
20
29
 
21
30
  ---
@@ -38,11 +47,11 @@ If you find Konoha helpful and want to support ongoing development, maintenance,
38
47
 
39
48
  ## 📸 Preview
40
49
 
41
- * **Latest Release:** [v2.1.15 (2026-10-08)](CHANGELOG.md) — Elimination of Windows Web UI terminal flashing via background directory resolution caching and process-wide `windowsHide` enforcement, plus full documentation synchronization.
42
- * **Latest Security Compliance:** [Google Policy Compliance v2.1.15 — Konoha v2.1.15 (2026-10-08)](docs/SecurityCompliance/security_compliance_report_google_policy_2.1.15_2026-10-08.md)
50
+ * **Latest Release:** [v2.1.17 (2026-10-08)](CHANGELOG.md) — Dual-mode Telegram Bot integration, Cloudflare Zero Trust public ingress tunnel, unified prompt queue, and remote Web UI dashboard.
51
+ * **Latest Security Compliance:** [Google Policy Compliance v2.1.17 — Konoha v2.1.17 (2026-10-08)](docs/SecurityCompliance/security_compliance_report_google_policy_2.1.17_2026-10-08.md)
43
52
 
44
53
  <details open>
45
- <summary><b>🎬 Flagship TUI Demo: All Commands in Action (<code>demo.gif</code>)</b></summary>
54
+ <summary><b style="display:inline">🎬 Flagship TUI Demo: All Commands in Action (<code>demo.gif</code>)</b></summary>
46
55
  <br>
47
56
 
48
57
  <p align="center">
@@ -58,198 +67,95 @@ If you find Konoha helpful and want to support ongoing development, maintenance,
58
67
  <img src="assets/demo-web.gif" alt="Konoha SvelteKit 3 Web UI & Dashboard Demo" width="100%">
59
68
  </p>
60
69
  </details>
61
-
62
- <details open>
63
- <summary><b>📦 Skill Creation & Subagent Embedding Flow (<code>demo-skill-embed.gif</code>)</b></summary>
64
- <br>
65
-
66
- <p align="center">
67
- <img src="assets/demo-skill-embed.gif" alt="Konoha Skill Creation & Agent Embedding Demo" width="100%">
68
- </p>
69
- </details>
70
-
71
- <details>
72
- <summary><b>🧪 Full QA & Verification Suite (<code>testing.gif</code>)</b></summary>
73
- <br>
74
-
75
- <p align="center">
76
- <img src="assets/testing.gif" alt="Konoha Test Suite QA Demo" width="100%">
77
- </p>
78
- </details>
79
-
80
- <details>
81
- <summary><b>🥷 Real Coding Agent Client Demos (7 Clients)</b></summary>
82
- <br>
83
-
84
- <details>
85
- <summary><b>🟣 Antigravity CLI Prompting & Delegation (<code>demo-agy.gif</code>)</b></summary>
86
- <br>
87
- <img src="assets/demo-agy.gif" alt="Antigravity CLI Demo" width="100%">
88
- </details>
89
-
90
- <details>
91
- <summary><b>💻 Command Code Prompting & Delegation (<code>demo-commandcode.gif</code>)</b></summary>
92
- <br>
93
- <img src="assets/demo-commandcode.gif" alt="Command Code Demo" width="100%">
94
- </details>
95
-
96
- <details>
97
- <summary><b>🤖 OpenAI Codex CLI Prompting & Delegation (<code>demo-codex.gif</code>)</b></summary>
98
- <br>
99
- <img src="assets/demo-codex.gif" alt="Codex CLI Demo" width="100%">
100
- </details>
101
-
102
- <details>
103
- <summary><b>🟩 OpenCode IDE Prompting & Delegation (<code>demo-opencode.gif</code>)</b></summary>
104
- <br>
105
- <img src="assets/demo-opencode.gif" alt="OpenCode IDE Demo" width="100%">
106
- </details>
107
-
108
- <details>
109
- <summary><b>🟠 Claude Code Prompting & Delegation (<code>demo-claude.gif</code>)</b></summary>
110
- <br>
111
- <img src="assets/demo-claude.gif" alt="Claude Code Demo" width="100%">
112
- </details>
113
-
114
- <details>
115
- <summary><b>⚡ Cursor Agent Prompting & Delegation (<code>demo-cursor.gif</code>)</b></summary>
116
- <br>
117
- <img src="assets/demo-cursor.gif" alt="Cursor Agent Demo" width="100%">
118
- </details>
119
-
120
- <details>
121
- <summary><b>🥧 Pi Coding Agent (pi.dev) Prompting & Delegation (<code>demo-pi.gif</code>)</b></summary>
122
- <br>
123
- <img src="assets/demo-pi.gif" alt="Pi Coding Agent Demo" width="100%">
124
- </details>
125
-
126
- </details>
127
-
128
- <details>
129
- <summary><b>📸 CLI Command Screenshots & Dashboards (15 Images)</b></summary>
130
70
  <br>
131
71
 
132
72
  <details>
133
- <summary><b>📊 Database & Village Status (<code>konoha status</code>)</b></summary>
73
+ <summary><h2 style="display:inline">🔄 Konoha Workflow Preview</h2></summary>
134
74
  <br>
135
- <img src="assets/konoha-status.png" alt="konoha status" width="100%">
136
- </details>
137
75
 
138
76
  <details>
139
- <summary><b>🥷 Subagent Team Telemetry (<code>konoha agent status</code>)</b></summary>
77
+ <summary><b>✧ Sannin Multi-Agent Orchestration & Task Routing Flow (<code>konoha-orchestration-flow.gif</code>)</b></summary>
140
78
  <br>
141
- <img src="assets/konoha-agent-status.png" alt="konoha agent status" width="100%">
142
- </details>
143
79
 
144
- <details>
145
- <summary><b>📜 Installed Skills Registry (<code>konoha skill list</code>)</b></summary>
146
- <br>
147
- <img src="assets/konoha-skill-list.png" alt="konoha skill list" width="100%">
148
- </details>
149
-
150
- <details>
151
- <summary><b>📈 Token Savings Dashboard (<code>konoha savings</code>)</b></summary>
152
- <br>
153
- <img src="assets/konoha-savings.png" alt="konoha savings" width="100%">
154
- </details>
155
-
156
- <details>
157
- <summary><b>❓ CLI Educational Help Menu (<code>konoha help</code>)</b></summary>
158
- <br>
159
- <img src="assets/konoha-help.png" alt="konoha help" width="100%">
160
- </details>
161
-
162
- <details>
163
- <summary><b>🚀 First-Time Interactive Init (<code>konoha init</code>)</b></summary>
164
- <br>
165
- <img src="assets/konoha-init.png" alt="konoha init" width="100%">
166
- </details>
167
-
168
- <details>
169
- <summary><b>🔄 Skills Database Migration & FTS5 Re-index (<code>konoha migrate</code>)</b></summary>
170
- <br>
171
- <img src="assets/konoha-migrate.png" alt="konoha migrate" width="100%">
80
+ <p align="center">
81
+ <img src="assets/konoha-orchestration-flow.gif" alt="Konoha Multi-Agent Orchestration Flow" width="100%">
82
+ </p>
172
83
  </details>
173
84
 
174
85
  <details>
175
- <summary><b>🧪 Verification Tests & Feature Suite (<code>konoha test</code>)</b></summary>
86
+ <summary><b>♦ Jonin + Taste-Skill Anti-Slop Frontend Engineering Flow (<code>konoha-jonin-flow.gif</code>)</b></summary>
176
87
  <br>
177
- <img src="assets/konoha-test.png" alt="konoha test" width="100%">
178
- </details>
179
88
 
180
- <details>
181
- <summary><b>✨ Version & GitHub Release Sync (<code>konoha version</code>)</b></summary>
182
- <br>
183
- <img src="assets/konoha-version.png" alt="konoha version" width="100%">
89
+ <p align="center">
90
+ <img src="assets/konoha-jonin-flow.gif" alt="Jonin Frontend Engineering Flow" width="100%">
91
+ </p>
184
92
  </details>
185
93
 
186
94
  <details>
187
- <summary><b>🔄 CLI Auto-Upgrade (<code>konoha upgrade</code>)</b></summary>
95
+ <summary><b>◎ Kage Reviewer 98% Minimum Confidence & Zero-AI-Slop Delivery Gate (<code>konoha-kage-gate.gif</code>)</b></summary>
188
96
  <br>
189
97
 
190
- Konoha features an interactive, real-time terminal Progress Bar (`KonohaProgressBar`) providing live visual progress through a 7-stage upgrade pipeline with active elapsed timers and milestone verification:
191
-
192
- ```text
193
- 🔄 Upgrading Konoha
194
- ════════════════════════════════════════════════════════════
195
- Preparing to upgrade Konoha to the latest version...
196
-
197
- ✓ Package manager ready: pnpm
198
- ✓ Latest Konoha release installed from npm registry (konoha-mcp) via pnpm
199
- [████████████████░░░░░░░░░░░░] 57% [Stage 5/7] Skills Index: Seeding subagent skills into SQLite FTS5 database
200
- ✓ Subagent skills and references seeded to SQLite FTS5
201
- [████████████████████░░░░░░░░] 71% [Stage 6/7] MCP Clients: Configuring Cursor, Claude Code, OpenCode, Command Code, Codex, Pi
202
- ✓ All 7 agentic IDE/CLI client configurations synchronized
203
- [████████████████████████░░░░] 86% [Stage 7/7] Verifying Konoha Bridge extension and browser CLI...
204
- ✓ Konoha Bridge extension & browser tools verified
205
- [████████████████████████████] 100% Konoha has been successfully upgraded to the latest version!
206
- ✓ Konoha has been successfully upgraded to the latest version!
207
- ```
208
-
209
- <img src="assets/konoha-upgrade.png" alt="konoha upgrade" width="100%">
210
-
211
- Stage 5 (skills indexing) is timeout-proof: it escalates through a progressive fallback chain — full migration → retry with `--skip-embeddings` → `--skills-only` (seeding `SKILL.md` entries only) — and the migration loop itself honors a `KONOHA_MIGRATE_TIME_BUDGET` (default 150s) that defers non-required skills gracefully. Upgrades and fresh installs never fail from a slow migration; deferred references complete on the next `konoha migrate` or via on-demand indexing.
212
-
213
- > **🛡️ Strict Non-Destructive Preservation Invariant (v2.0.2)**: Upgrades (`konoha upgrade`) and fresh installations (`konoha init`) are strictly non-destructive. Pre-existing user skills in all 7 client skill directories are never pruned or removed (`copySkillsDirFast` additive sync only). `konoha.db` retains all existing skills via additive upserts (`INSERT OR REPLACE`), instruction configurations (`GEMINI.md`, `AGENTS.md`, `CODEX.md`, `instructions.md`) inject Konoha directives within managed boundary tags (`<!-- KONOHA-START -->...<!-- KONOHA-END -->`) preserving 100% of user custom rules and prompts, and `agents.yaml` merges default ninja personas while keeping custom user agents completely intact.
98
+ <p align="center">
99
+ <img src="assets/konoha-kage-gate.gif" alt="Kage Reviewer Confidence Gate Flow" width="100%">
100
+ </p>
214
101
  </details>
215
102
 
216
103
  <details>
217
- <summary><b>📁 Persistent Workspaces & Invariants (<code>konoha project</code>)</b></summary>
104
+ <summary><b>🧪 Token-Efficient QA Automation & Playwright E2E Self-Healing (<code>konoha-qa-flow.gif</code>)</b></summary>
218
105
  <br>
219
- <img src="assets/konoha-project.png" alt="konoha project" width="100%">
220
- </details>
221
106
 
222
- <details>
223
- <summary><b>🧠 SQLite Sessions & Memory Storage (<code>konoha data</code>)</b></summary>
224
- <br>
225
- <img src="assets/konoha-data.png" alt="konoha data" width="100%">
107
+ <p align="center">
108
+ <img src="assets/konoha-qa-flow.gif" alt="QA Automation E2E Verification Flow" width="100%">
109
+ </p>
226
110
  </details>
227
111
 
228
112
  <details>
229
- <summary><b>🩺 Cross-Client Diagnostics & Self-Healing (<code>konoha doctor</code>)</b></summary>
113
+ <summary><b>📱 Dual-Mode Telegram Bot & Cloudflare Tunnel Remote Ingress Flow (<code>konoha-telegram-flow.gif</code>)</b></summary>
230
114
  <br>
231
- <img src="assets/konoha-doctor.png" alt="konoha doctor" width="100%">
232
- </details>
233
115
 
234
- <details>
235
- <summary><b>🌉 Local LLM Bridge Router Gateway (<code>konoha bridge</code>)</b></summary>
236
- <br>
237
- <img src="assets/konoha-bridge.png" alt="konoha bridge" width="100%">
116
+ <p align="center">
117
+ <img src="assets/konoha-telegram-flow.gif" alt="Telegram Bot & Cloudflare Tunnel Ingress Flow" width="100%">
118
+ </p>
238
119
  </details>
239
-
240
- <details>
241
- <summary><b>🌉 Bridge-Served Models (<code>konoha bridge models</code>) & Subagent Model Config (<code>konoha agent models config</code>)</b></summary>
242
- <br>
243
- <img src="assets/konoha-models.png" alt="konoha bridge models" width="100%">
244
120
  </details>
245
121
 
246
- <details>
247
- <summary><b>🗑️ Safe Uninstaller (<code>konoha uninstall</code>)</b></summary>
248
- <br>
249
- <img src="assets/konoha-uninstall.png" alt="konoha uninstall" width="100%">
250
- </details>
122
+ ---
251
123
 
252
- </details>
124
+ ## 🌟 Master Architectural Feature Matrix
125
+
126
+ | Category | Capability / Feature | Subsystem / Engine | Key Invariant & Contract | Status |
127
+ |:---|:---|:---|:---|:---:|
128
+ | **Orchestration & Personas** | **✧ Sannin Router** | `src/mcp/tool_dispatch.js` | Top-level triage, domain routing, zero inline implementation | ✅ `ACTIVE` |
129
+ | | **⚑ Genin Scout** | `genin-skill` | Read-only symbol search, codepath tracing, zero file mutations | ✅ `ACTIVE` |
130
+ | | **◎ Kage Governor** | `kage-skill` | Architecture decisions, security auditing, 98% Confidence Gate | ✅ `ACTIVE` |
131
+ | | **♦ Jonin Builder** | `jonin-skill` | Taste-Skill UI across Next.js, Nuxt, SvelteKit, Angular | ✅ `ACTIVE` |
132
+ | | **♠ Anbu Black Ops** | `anbu-skill` | Backend dev, bug fixes, DevOps, 817 offensive security skills | ✅ `ACTIVE` |
133
+ | | **▫ Chunin Intel** | `chunin-skill` | Zero-API-key web research (SearXNG + Wikipedia OpenSearch) | ✅ `ACTIVE` |
134
+ | | **⬡ Tokubetsu-Jonin** | `tokubetsu-jonin-skill` | Technical documentation, API specs, runbooks, README sync | ✅ `ACTIVE` |
135
+ | **Token & Context Optimization** | **Bounded File I/O** | `src/file_tools_router.js` | `read_file_range`, `read_file_head` (50–100 line caps, 83–98% savings) | ✅ `ACTIVE` |
136
+ | | **Semantic Code Search** | `semble` MCP | Vector embeddings & line spans replace full repository dumps | ✅ `ACTIVE` |
137
+ | | **Shell Output Compaction** | `rtk` (Rust Token Killer) | Global CLI proxy compresses noisy command outputs (60–95% savings) | ✅ `ACTIVE` |
138
+ | | **Auto-Compaction** | `src/mcp/runtime_state.js` | Automatic badge compaction on turn ≥ 2 (preserves tech stack) | ✅ `ACTIVE` |
139
+ | | **Hybrid Vector RAG** | `src/vector_search.js` | IBM Granite multilingual + MS MARCO MiniLM neural reranker | ✅ `ACTIVE` |
140
+ | **SDLC Quality Gates** | **Definition-of-Readiness (DoR)** | `src/sdlc_dor.js` | Enforced/advisory check blocks unready, ambiguous prompts | ✅ `ACTIVE` |
141
+ | | **Two-Step Zero-AI-Slop Gate** | `aislop_scan` + `anti_slop` | Mechanically requires 100/100 scan & 0 findings before synthesis | ✅ `ACTIVE` |
142
+ | | **Kage Confidence Gate** | `src/workflow_gates.js` | Strict ≥ 98% verification score required across all categories | ✅ `ACTIVE` |
143
+ | | **Supply-Chain Security Gate** | Socket CLI (`socket ci`) | Mechanical blocker on High/Medium dependency vulnerabilities | ✅ `ACTIVE` |
144
+ | | **Autonomous Remediation Loop**| `src/sdlc_remediation.js` | Bounded circuit breaker (7 cycles) for auto-fixing slop findings | ✅ `ACTIVE` |
145
+ | **Frontend & UI Engine** | **Taste-Skill v2 Dials** | `Leonxlnx/taste-skill` | `DESIGN_VARIANCE`, `MOTION_INTENSITY`, `VISUAL_DENSITY` | ✅ `ACTIVE` |
146
+ | | **4 Supported Frameworks** | `src/mcp/build_spec.js` | Official CLI scaffolding: Next.js 16, SvelteKit 2, Nuxt 3, Angular 19+ | ✅ `ACTIVE` |
147
+ | | **10 Light-Mode Themes** | `apps/web/src/` | Pure light-mode first class; floating bottom-left theme popup | ✅ `ACTIVE` |
148
+ | | **Image Mockup Replication** | `build_from_source` | 100% exact layout, spacing, typography, and asset replication | ✅ `ACTIVE` |
149
+ | | **AI-Website Fingerprint Detector**| `src/ai_detector.js` | Heuristic engine detecting AI generators (0–20 = Human-Built band) | ✅ `ACTIVE` |
150
+ | **Remote Operations & Mobile** | **Cloudflare Zero Trust Ingress**| `src/tunnel/` | Out-of-band tunnel (`/remote`) with Edge PIN & Cloudflare Access | ✅ `ACTIVE` |
151
+ | | **1-Way Gate Telegram Alerts** | `src/telegram/` | Real-time task deliverable & audit dispatch upon Kage pass | ✅ `ACTIVE` |
152
+ | | **2-Way Remote Prompting Bot** | `src/telegram/` | Inbound mobile commands (`/run`, `/sh`, `/session`, `/status`) | ✅ `ACTIVE` |
153
+ | | **Persistent Prompt Queue** | `src/queue/` | SQLite atomic state machine (`pending` -> `processing` -> `completed`) | ✅ `ACTIVE` |
154
+ | **Security & Cryptography** | **AES-256-GCM Crypto Vault** | `src/crypto_vault.js` | AEAD authenticated encryption at rest for tokens & credentials | ✅ `ACTIVE` |
155
+ | | **PBKDF2 Key Derivation** | `src/crypto_vault.js` | 100,000 SHA-256 iterations with host-fingerprint salt | ✅ `ACTIVE` |
156
+ | | **Zero Plaintext Secrets Invariant**| Whole repo | Automatic masking (`12345***:***abcd`) across APIs, logs, and TUI | ✅ `ACTIVE` |
157
+ | | **Offensive Red-Teaming Skills** | `anbu-skill` | 817 Anthropic cybersecurity skills & MITRE ATT&CK techniques | ✅ `ACTIVE` |
158
+ | **Cross-Client Ecosystem** | **7 Supported Coding Clients** | `src/client_detection.js` | Antigravity, Cursor, Claude Code, OpenCode, Command Code, Codex, Pi | ✅ `ACTIVE` |
253
159
 
254
160
  ---
255
161
 
@@ -267,26 +173,22 @@ Stage 5 (skills indexing) is timeout-proof: it escalates through a progressive f
267
173
  * [Troubleshooting Guide](docs/TROUBLESHOOTING.md)
268
174
  * [System Architecture](docs/ARCHITECTURE.md)
269
175
 
270
- ## ⚠️ The Problem
271
-
272
-
273
- | Component | Size | Context Overhead |
274
- |:---|:---:|:---|
275
- | `SKILL.md` Files (×5) | ~72 KB | Core agent instructions |
276
- | Reference Guides (×88) | ~478 KB | API documentation, guides |
277
- | Helper Scripts (×23) | ~547 KB | Utility code, automation |
278
- | **Total Startup Payload** | **~1.1 MB** | **~800,000+ API tokens** |
176
+ ## ⚠️ The Problem & 💡 The Solution
279
177
 
280
- > [!WARNING]
281
- > This "disk-dump" approach wastes tokens on content that is irrelevant to the current task, inflates API usage bills, increases latency, and risks hitting LLM context window limits.
178
+ ### Architectural Comparison: The Vibe Coding Dilemma vs. Autonomous Agentic Rigor
282
179
 
283
- ## 💡 The Solution
284
-
285
- **Konoha** establishes a high-performance local SQLite FTS5 Model Context Protocol (MCP) server that:
286
-
287
- 1. **Indexes** all skill content (`SKILL.md` + references + scripts) into a full-text search database.
288
- 2. **Serves on-demand** — agents invoke `find_skill("keyword")` to retrieve only the matching ~4 KB content block.
289
- 3. **Optimizes context** — replaces the redundant "load SKILL.md → parse router → load reference" chain.
180
+ | Developer Challenge & Problem | Traditional / Naive Approach | Konoha Enterprise Solution | Key Impact & Metric |
181
+ |:---|:---|:---|:---|
182
+ | **Vibe Coder Career Dilemma**<br>*(Newbi Vibe Coder is confused about how to reach the higher level in this AI era so konoha appear as solution for one shot setup)* | Casual single-file prompting, copy-pasting code snippets without structure, fragile prototypes, lack of SDLC governance, and inability to architect scalable enterprise systems. | **One-Shot Setup (`konoha init --force`)**: Turnkey initialization instantly provisioning 7 specialized ninja subagents, 1,027 domain skills, and 40 canonical MCP tools across 7 major IDEs/clients with zero manual glue code. | Elevates casual vibe coding into structured senior engineering rigor with full team delegation from Day 1. |
183
+ | **Context Window Flooding & High API Costs** | Dumping entire skill trees, unindexed files, and massive prompt boilerplates at startup (~1.1 MB payload / 800,000+ tokens). | **On-Demand SQLite FTS5 Indexing & Bounded File I/O**: `find_skill` and bounded file operations slice context to exact 50–100 line spans. | **83%–98% token reduction**; sub-millisecond retrieval (0.61 ms); eliminates context bloat and LLM amnesia. |
184
+ | **Terminal Output Noise & Shell Explosion** | Build tools, test runners, and linters dump hundreds of noisy progress bars and logs directly into model context. | **RTK (Rust Token Killer) Global CLI Proxy**: Transparently intercepts terminal commands, compresses noisy outputs, and preserves critical error signals. | **60%–95% terminal output compression**; saves thousands of tokens per command execution. |
185
+ | **Generic AI Slop & Aesthetic Clichés** | Generating purple gradients, generic Inter typography, center-aligned hero clutter, broken mobile layouts, and excessive emoji decor. | **Jonin + Taste-Skill v2 Anti-Slop Frontend Engine**: Strict typography standards (Geist, Cabinet Grotesk), bento CSS grids, 10 light-mode gradient themes, bottom mobile dock, and zero emoji policy. | **100/100 `aislop` scan compliance**; production-grade, human-crafted aesthetic fidelity. |
186
+ | **Hallucinated Passes & Broken Builds** | Agents claiming tasks are complete without running tests, silently introducing type regressions and breaking dependencies. | **Kage Reviewer 98% Minimum Confidence Gate & Playwright QA**: Two-step Zero-AI-Slop gate (`aislop_scan` + anti-slop rules), automated E2E test generation (`qa_codify` / `qa_e2e_run`), and strict rejection below 98% confidence. | Mechanical delivery gate; **≥ 98% confidence invariant** across architecture, tests, and security. |
187
+ | **Mobile & Remote Workflow Disconnection** | Developers chained to their desks; inability to monitor, review, or trigger agent runs remotely; local servers trapped behind NATs. | **Dual-Mode Telegram Bot & Cloudflare Tunnel**: Full remote control over mobile with two-way conversational prompting and one-way post-Kage completion notifications, secured by Cloudflare Zero Trust public ingress. | Anywhere, anytime autonomous agent interaction with real-time push alerts. |
188
+ | **Plaintext Credential Leaks & Secret Vulnerabilities** | Storing sensitive API tokens, bot tokens, and tunnel credentials in plaintext `.env` files vulnerable to accidental Git commits and logs. | **AES-256-GCM AEAD Hardware-Grade Crypto Vault**: Machine-bound PBKDF2 (100,000 iterations) key derivation, OS-keyed encryption, automatic redaction in logs, and zero plaintext secret storage. | Zero-knowledge secret management; automated encryption for bot tokens & Cloudflare secrets. |
189
+ | **DevOps & Offensive Security Blindspots** | AI models unaware of OWASP vulnerabilities, unable to perform security assessments, and producing insecure cloud deployments. | **817 Anthropic Cybersecurity Skills & Anbu Black Ops**: Integrated MITRE ATT&CK techniques, penetration testing, exploit analysis, container hardening, and enterprise defense capabilities in dev/local environments. | End-to-end security hardening; comprehensive vulnerability identification and red teaming. |
190
+ | **Multi-Agent Disk Thrashing & Context Fragmentation** | Subagents exchanging files via disk files (`delegate.md`/`result.md`), causing I/O lag, disk bloat, and context fragmentation. | **Direct Structured MCP Delegation & Zero-Loop Reporting**: In-memory argument passing (`task`, `context`, `constraints`, `skills`, `taste_dials`) and automatic episodic project memory checkpointing (`report_from_agent`). | Zero disk file loops; instant subagent dispatch with permanent project memory continuity. |
191
+ | **Fragmented IDE Configuration & Ecosystem Lock-in** | Manually configuring skills, MCP servers, and agent prompts across Antigravity, Cursor, Claude Code, OpenCode, Command Code, Codex, and Pi. | **Single Universal Hub & Cross-Client Compatibility**: One command (`konoha init --force`) universally provisions `.gemini`, `.cursor`, `.claude`, `.agents`, and project configs simultaneously with automatic skill synchronization. | Write once, run anywhere across all 7 premier AI coding environments. |
290
192
 
291
193
  > [!TIP]
292
194
  > **Optimization Result**: Konoha and Semble retrieve bounded, task-relevant context instead of full skill trees. See [BENCHMARK.md](docs/BENCHMARK.md) for historical snapshots and reproducible `konoha savings` output; latency and cost reductions are environment-dependent and are not guaranteed.
@@ -297,12 +199,20 @@ Stage 5 (skills indexing) is timeout-proof: it escalates through a progressive f
297
199
  For a detailed breakdown of Konoha's internal mechanics, including system layers, data flows, and query lifecycle sequence diagrams, please see the [System Architecture Guide](docs/ARCHITECTURE.md).
298
200
 
299
201
 
300
- ### 🚀 Direct Structured MCP Delegation & Zero-Loop Reporting
202
+ <details>
203
+ <summary><b>🚀 Direct Structured MCP Delegation & Zero-Loop Reporting</b></summary>
204
+ <br>
205
+
301
206
  Konoha subagents execute inline via direct structured MCP tool arguments (`task`, `context`, `constraints`, `skills`, `taste_dials`) or specialized aliases (`delegate_to_jonin`, `delegate_to_anbu`, `delegate_to_kage`, etc.):
302
207
  - **Eliminates Scratch Loops**: Replaces multi-step disk file reading (`delegate.md` and `result.md`) with direct in-memory structured context passing.
303
208
  - **Auto-Checkpointing (`report_from_agent`)**: Automatically distills key architectural learnings and records them into persistent project memory upon task completion.
304
209
 
305
- ### 🎨 Jonin + Taste-Skill Anti-Slop Frontend Engine (tasteskill.dev)
210
+ </details>
211
+
212
+ <details>
213
+ <summary><b>🎨 Jonin + Taste-Skill Anti-Slop Frontend Engine (tasteskill.dev)</b></summary>
214
+ <br>
215
+
306
216
  Jonin combines Konoha's 3D component architecture with **Taste-Skill v2** (`Leonxlnx/taste-skill`) design directives:
307
217
  - **Deterministic High-End Typography**: Enforces Geist, Cabinet Grotesk, Outfit, Satoshi, and Clash Display. Generic Inter defaults are forbidden.
308
218
  - **Cinematic Chapter Pacing**: Enforces generous vertical section rhythm (`py-24`, `py-32`, or `py-48`).
@@ -315,24 +225,38 @@ Jonin combines Konoha's 3D component architecture with **Taste-Skill v2** (`Leon
315
225
  <img src="assets/konoha-jonin-flow.gif" alt="Jonin Premium UI Build Pipeline" width="100%" />
316
226
  </p>
317
227
 
318
- ### 🏢 Persistent Project-Level Context & Memory (Zero Hallucination)
228
+ </details>
229
+
230
+ <details>
231
+ <summary><b>🏢 Persistent Project-Level Context & Memory (Zero Hallucination)</b></summary>
232
+ <br>
233
+
319
234
  - **Workspace Stack Profiler**: Automatically detects frameworks (Next.js, SvelteKit, Nuxt 3, Angular), styling engines (Tailwind v4, CSS Modules), and package managers (`pnpm`).
320
235
  - **Project-Scoped Memory**: Persists architectural invariants, rules, and episodic learnings per repository workspace in SQLite (`~/.konoha/konoha.db`).
321
236
  - **Zero Session Amnesia**: Context and invariants are preserved and automatically injected across consecutive sessions.
322
237
  - **CLI Commands**: `konoha project context`, `konoha project list`, `konoha project add`, `konoha project memory`.
323
238
 
324
- ### 🧠 Hybrid Vector Search & Multilingual Retrieval (IBM Granite + MS MARCO MiniLM Neural Reranker)
239
+ </details>
240
+
241
+ <details>
242
+ <summary><b>🧠 Hybrid Vector Search & Multilingual Retrieval (IBM Granite + MS MARCO MiniLM Neural Reranker)</b></summary>
243
+ <br>
244
+
325
245
  Konoha integrates hybrid semantic retrieval combining **SQLite FTS5 BM25**, **IBM Granite 97M Multilingual Embeddings (ONNX)**, and **MS MARCO MiniLM Neural Cross-Encoder Reranker**:
326
246
  - **Offline Bundled Models**: Both embedding and neural reranker models are pre-bundled directly in `assets/models/` (<100 MB each), enabling 100% offline installs and zero-download instant execution.
327
247
  - **Dual-Stage Reranking & RAG Retrieval**: Combines sub-millisecond Reciprocal Rank Fusion (RRF, k=60) for candidate ranking with neural cross-encoder passage reranking (`searchChunksRAG()`) for high-precision RAG context retrieval.
328
248
  - **Cross-Lingual Recall**: Queries in multilingual text retrieve the relevant skill documentation with **97.5% Recall@5** and **0.885 MRR@5**.
329
249
  - **Zero-Config Default & Opt-in Semantic Search**: By default, Konoha runs zero-config with ultra-fast SQLite FTS5. Semantic search and neural reranking are optionally enabled via `KONOHA_SEMANTIC_SEARCH=1`.
330
- - **Graceful Fallback**: If models are unavailable or semantic search is toggled off, retrieval falls back to FTS5 / LIKE search without crashing.
250
+ - **Graceful Fallback**: If models are unavailable, semantic search is toggled off, or the host SQLite binary lacks compiled FTS5 (e.g. Windows), retrieval seamlessly falls back to FTS5 / LIKE search without crashing.
331
251
  - **4-Tier Embedding Feature Deduplication**: Markdown heading-aware chunk hashing, in-memory `_EMBED_CACHE` (512 entries), database-level binary blob reuse across skills, and candidate nearest-chunk deduplication.
332
252
  - **Persistent Persona & Project Memory**: Idempotent memory storage preventing duplicate SQLite rows, zero-hallucination factual extraction, and auto-compact turn-based prompt badges (< 120 tokens on turn >= 2).
333
253
  - **Cross-Platform `agent-browser` Lifecycle**: Automated multi-package-manager detection and self-healing doctor auto-repair across Windows (`agent-browser.cmd`), Linux, and macOS.
334
254
 
335
- ### Workflow: Forced MCP Delegation
255
+ </details>
256
+
257
+ <details>
258
+ <summary><b>🔄 Workflow: Forced MCP Delegation & Subagent Routing</b></summary>
259
+ <br>
336
260
 
337
261
  All non-trivial work on a Konoha-configured host **MUST** flow through the Konoha MCP and Semble MCP tools and be delegated to a konoha subagent — never executed solo by the main orchestrator.
338
262
 
@@ -352,6 +276,8 @@ All non-trivial work on a Konoha-configured host **MUST** flow through the Konoh
352
276
 
353
277
  **The main orchestrator MUST NOT execute implementation tasks itself — it only coordinates and delegates.** Trivial edits on a known file may run inline; everything else routes through a subagent.
354
278
 
279
+ </details>
280
+
355
281
  ---
356
282
 
357
283
  ## 🏗️ Multi-Agent Architecture: MCP Tools Orchestrator
@@ -428,8 +354,35 @@ flowchart TB
428
354
  ### Why Konoha Uses the MCP Tools Orchestrator Model
429
355
 
430
356
  1. 🚀 **Zero Process Cold-Start**: Subagents execute in-flight as standard MCP tools without waiting for multi-second process initialization.
357
+ 2. 💡 **Direct Structured Context**: Passes tasks, constraints, skills, and taste dials in-memory via MCP tool arguments without filesystem disk-thrashing loops.
431
358
  3. 🛡️ **Seamless Conversation Resumption**: Re-evaluates state and enforces subagent delegation workflow on every resume or multi-turn request.
432
359
 
360
+ ### 🔄 Structured Delegation and Legacy Task Fallback
361
+
362
+ Konoha passes `task`, `context`, `constraints`, `skills`, `taste_dials`, and `project_path` directly to subagent MCP tools. Hosts that cannot send structured arguments may use isolated legacy artifacts:
363
+
364
+ | Path | Purpose |
365
+ |------|---------|
366
+ | `~/.konoha/tmp/<client>/<session>/scratch/tasks/<task_id>/delegate.md` | Legacy task instructions only |
367
+ | `~/.konoha/tmp/<client>/<session>/scratch/tasks/<task_id>/result.md` | Legacy result exchange only |
368
+
369
+ Structured reports use `report_from_agent` to return summaries, changed files, and project-scoped learnings. Legacy task directories remain outside the project workspace and are cleaned after use.
370
+
371
+ ### Skill Resolution
372
+
373
+ When a subagent runs, `run_mcp_agent` resolves skills in three layers:
374
+
375
+ 1. **Exact match** — `agents.skills` (per-agent YAML) is queried against `skills.skill_name` and `references.name`.
376
+ 2. **Fuzzy match** — if a skill name has no exact hit, Levenshtein distance ≤ 3 finds close names. Example: `devsecops-enginer` → `devsecops-engineer`.
377
+ 3. **Prompt-driven autoload** — when the agent's `skills` list is empty, the prompt is tokenized and matched against `skill_name` + the first 200 chars of each skill's content. The top 3 token-coverage matches are auto-loaded and embedded into the agent instructions.
378
+
379
+ The mismatch is reported on stderr (`fuzzy-resolved skill 'x' -> 'y'`) so the orchestrator can spot recurring typos and update the YAML.
380
+
381
+ ### Workspace Hygiene
382
+
383
+ Transient subagent scratch directories (`delegate.md`, `plan.md`, `result.md`, etc.) are written **outside** the project tree at `~/.konoha/tmp/<client>/<session>/scratch/tasks/<task_id>/`. If `~/.konoha` is not writable, the resolver falls back to `/tmp/konoha-<pid>-<ts>/`. The path is **never** rooted under `WORKSPACE_ROOT`, so `git add .` cannot accidentally commit agent scratch files. This is enforced by `src/mcp/runtime_state.js` and covered by `tests/test_scratch_path.js`.
384
+
385
+
433
386
  ---
434
387
 
435
388
  ## 🚀 Quick Start
@@ -509,6 +462,9 @@ konoha status
509
462
  - **Node.js** ≥ 22.16.0 (via nvm, Homebrew, or system package; pure Node.js runtime with built-in `node:sqlite` + FTS5, zero Python dependency)
510
463
  - **Agent skills** in `~/.agents/skills/` (with `SKILL.md` files); Konoha indexes and serves skill content through SQLite FTS5 without filesystem mirrors
511
464
  - **Cross-platform**: Linux, macOS, Windows (native and WSL)
465
+ <details>
466
+ <summary><h2 style="display:inline">🛠️ CLI Commands & Hard Guardrail Enforcement (v2.0.0) Reference</h2></summary>
467
+ <br>
512
468
 
513
469
  ## 🛠️ CLI Commands
514
470
 
@@ -528,7 +484,7 @@ Once installed, the following CLI commands are available:
528
484
  | `konoha embed` | Rebuild neural vector embeddings for all skill chunks (IBM Granite Multilingual + MS MARCO MiniLM Reranker) |
529
485
  | `konoha test` | Test MCP server with sample searches |
530
486
  | `konoha status` | Show installation status and DB stats |
531
- | `konoha version` | Display current local version (2.1.15) and check for updates from npm registry |
487
+ | `konoha version` | Display current local version (2.1.17) and check for updates from npm registry |
532
488
  | `konoha upgrade` | Upgrade Konoha CLI to latest release with interactive real-time Progress Bar (`--yes` for headless); also re-reconciles the global `konoha` command shim |
533
489
  | `konoha bridge status` | Show bridge router status and Antigravity session liveness (sidecar-gated bridges show `AWAITING SIDECAR` when IDE is closed) |
534
490
  | `konoha bridge list` | List all configured bridges with port/provider/enabled state |
@@ -545,6 +501,9 @@ Once installed, the following CLI commands are available:
545
501
  | `konoha project set dor-mode <advisory\|enforced>` | Configure project Definition-of-Readiness gate mode |
546
502
  | `konoha project set review-mode <self\|cross-provider>` | Configure project review independence mode |
547
503
  | `konoha bridge <subcommand>` | Manage Konoha Bridge Router (`status`, `list`, `models`, `create`, `delete`, `enable`, `disable`) |
504
+ | `konoha telegram <subcommand>` | Dual-mode Telegram Bot manager (`status`, `config`, `test`, `enable`, `disable`, `start-poller`, `stop-poller`, `notify-kage`, `test-gate`) |
505
+ | `konoha tunnel <subcommand>` | Cloudflare Zero Trust Ingress tunnel manager (`status`, `start`, `stop`, `config`) |
506
+ | `konoha queue <subcommand>` | Unified Inbound Prompt Queue manager (`list`, `enqueue`, `cancel`, `complete`, `status`) |
548
507
  | `konoha help` | Show help |
549
508
 
550
509
  ## 🔄 8-Phase Multi-Agent Workflow Engine
@@ -647,6 +606,39 @@ flowchart TD
647
606
 
648
607
  </details>
649
608
 
609
+ ## 📱 Remote Access & Dual-Mode Telegram Automation
610
+
611
+ > **Canonical editable diagrams:** [14 Remote Access & Telegram Inbound/Outbound](docs/diagrams/konoha-architecture.drawio) · [15 Cloudflare Zero Trust Ingress & Prompt Queue](docs/diagrams/konoha-architecture.drawio)
612
+ > **Dedicated Guides:** [Telegram Integration Guide](docs/TELEGRAM_INTEGRATION_GUIDE.md) · [Cloudflare Tunnel Guide](docs/CLOUDFLARE_TUNNEL_GUIDE.md)
613
+
614
+ Konoha features an autonomous **Remote Access & Telegram Automation Engine** that enables remote interaction, task dispatch, and real-time execution reporting directly from your mobile device or chat client without opening inbound firewall ports:
615
+
616
+ <p align="center">
617
+ <img src="assets/konoha-telegram-flow.gif" alt="Telegram Remote Workflow & Kage Gate Notifier" width="100%" />
618
+ </p>
619
+
620
+ ### 1. Dual-Mode Telegram Bot Engine (`src/telegram/`)
621
+ - **One-Way Notification Mode**: Automatically delivers structured task completion reports, execution duration, token reduction telemetry (83%-98%), and Kage Reviewer confidence scores over outbound HTTPS (`getUpdates` & `sendMessage`). When prompting locally on a workstation (laptop, terminal, IDE), any session passing Kage Final Gate Review (`APPROVED` with 100/100 score and ≥98% confidence) immediately dispatches an outbound Telegram notification to keep the developer updated remotely.
622
+ - **Two-Way Remote Prompting Mode**: Accepts commands directly from Telegram:
623
+ - `/session [number]` — View and switch active target client sessions across Antigravity, Claude Code, Codex, Pi, OpenCode, and Command Code.
624
+ - `/session create <client> <path>` — Register and immediately target a remote project directory.
625
+ - `/sh <cmd>` — Execute shell commands directly in the active target workspace via interactive shell (`bash -i -c`) with full support for `~/.bashrc` aliases (`kubectl`, `kc*`, `helm`, etc.) and security guardrails (`isDangerousCommand` blocking destructive patterns).
626
+ - `/kage`, `/anbu`, `/jonin`, `/genin`, `/chunin`, `/tokubetsu-jonin`, `/sannin` — Direct subagent dispatch bypassing general triage.
627
+ - `/run <prompt>` or plain text — Enqueue coding tasks into the unified prompt inbox.
628
+ - `/status`, `/savings`, `/cancel`, `/help` — Live daemon telemetry, token savings metrics, and queue cancellation.
629
+ - **Strict Security Invariant**: Enforces a strict numeric `chat_id` whitelist (`telegram_config.chat_id`) dropping unauthorized messages immediately.
630
+ - **Zero Emojis Standard**: All notifications use clean bracketed tags (`[KONOHA TASK REPORT]`, `[SUCCESS]`, `[QUEUED]`, `[KAGE REVIEW GATE PASSED]`).
631
+
632
+ ### 2. Cloudflare Zero Trust Ingress Tunnel (`src/tunnel/`)
633
+ - **Zero Inbound Ports**: Background supervisor managing `cloudflared` (or `ngrok`) targeting Web UI port `1404` with automated binary provisioning and live URL detection (`trycloudflare.com` or custom domains).
634
+ - **Mode A: Cloudflare Zero Trust Edge Authentication**: Validates Cloudflare Access identity headers (`Cf-Access-Authenticated-User-Email`) with zero in-app PIN friction while maintaining unauthenticated local access on `localhost:1404`.
635
+
636
+ ### 3. Unified Inbound Prompt Queue & Autonomous Worker (`src/queue/`)
637
+ - **Atomic SQLite State Machine**: Table `prompt_queue` tracks atomic prompt states (`pending` -> `processing` -> `completed` / `failed` / `cancelled`) with filesystem session mirroring (`~/.konoha/inbox/<session>.json`).
638
+ - **Autonomous Queue Worker (`src/queue/worker.js`)**:
639
+ - **Operational Branch (0 LLM Tokens)**: Deterministic shell commands (`kubectl`, `helm`, `docker`, `git`, `ssh`, `/sh`, etc.) execute via interactive shell (`bash -i -c`) with 100% token elimination.
640
+ - **Autonomous AI Coding Branch**: Natural language and complex coding tasks execute via headless `agy -p ...` with structured task telemetry and Kage Reviewer confidence reporting.
641
+
650
642
  ## 🛰️ Cross-Platform Install
651
643
 
652
644
  Konoha runs on Linux, macOS, and Windows (native and WSL). Install commands are the same across all platforms:
@@ -795,7 +787,7 @@ After installation, Konoha registers **2 MCP servers** that work together:
795
787
 
796
788
  ### konoha — Skill Knowledge Search & Token-Efficient File Operations
797
789
 
798
- The unified `konoha` server exposes 37 canonical tools for skill retrieval, bounded file operations, validated build specifications, project context, memory, search, migration, AI-website detection, QA automation, and subagent delegation workflows:
790
+ The unified `konoha` server exposes 40 canonical tools for skill retrieval, bounded file operations, validated build specifications, project context, memory, search, migration, AI-website detection, QA automation, and subagent delegation workflows:
799
791
 
800
792
  #### `sannin(task?, context?, constraints?, skills?, taste_dials?, project_path?, task_dir?)`
801
793
  The Sannin routing workflow tool. Structured arguments are the primary path; `task_dir` remains a legacy fallback for hosts that require Markdown task artifacts.
@@ -1005,11 +997,11 @@ The destructive-command, git-safety, secret-protection, and MCP read-bypass guar
1005
997
 
1006
998
  Blocked command categories: **destructive** (`rm -rf /`, `mkfs`, `dd of=/dev/…`, `DROP DATABASE`, `chmod 777`, recursive `chown`, `curl | sh`), **destructive-git** (`git reset --hard`, `git push --force`, `git clean -f`, `git checkout -- .`, `git rebase -i`), **secrets** (`.env*`, `secrets.yaml`, `*.tfvars`, `*.pem`, `*.key`, `id_rsa`, `credentials` — never `rtk`-exempt), and **read-bypass** (bare `cat`/`grep`/`find`/`rg`/… — retry with `rtk <command>` or use the konoha/semble MCP tools).
1007
999
 
1008
- ---
1000
+ </details>
1009
1001
 
1010
- ##
1002
+ ---
1011
1003
 
1012
- ### 📊 Benchmark: Token Footprint & Optimization
1004
+ ## 📊 Benchmark: Token Footprint & Optimization
1013
1005
 
1014
1006
  The following charts demonstrate the context footprint savings per conversation session achieved by moving from full-disk loading to SQLite FTS5 on-demand retrieval:
1015
1007
 
@@ -1093,31 +1085,6 @@ flowchart TB
1093
1085
  > [!TIP]
1094
1086
  > Read the complete auto-generated [Token Savings & Optimization Benchmark Report](docs/BENCHMARK.md) for full metrics breakdown and analysis.
1095
1087
 
1096
- ### 🔄 Structured Delegation and Legacy Task Fallback
1097
-
1098
- Konoha passes `task`, `context`, `constraints`, `skills`, `taste_dials`, and `project_path` directly to subagent MCP tools. Hosts that cannot send structured arguments may use isolated legacy artifacts:
1099
-
1100
- | Path | Purpose |
1101
- |------|---------|
1102
- | `~/.konoha/tmp/<client>/<session>/scratch/tasks/<task_id>/delegate.md` | Legacy task instructions only |
1103
- | `~/.konoha/tmp/<client>/<session>/scratch/tasks/<task_id>/result.md` | Legacy result exchange only |
1104
-
1105
- Structured reports use `report_from_agent` to return summaries, changed files, and project-scoped learnings. Legacy task directories remain outside the project workspace and are cleaned after use.
1106
-
1107
- ### Skill Resolution
1108
-
1109
- When a subagent runs, `run_mcp_agent` resolves skills in three layers:
1110
-
1111
- 1. **Exact match** — `agents.skills` (per-agent YAML) is queried against `skills.skill_name` and `references.name`.
1112
- 2. **Fuzzy match** — if a skill name has no exact hit, Levenshtein distance ≤ 3 finds close names. Example: `devsecops-enginer` → `devsecops-engineer`.
1113
- 3. **Prompt-driven autoload** — when the agent's `skills` list is empty, the prompt is tokenized and matched against `skill_name` + the first 200 chars of each skill's content. The top 3 token-coverage matches are auto-loaded and embedded into the agent instructions.
1114
-
1115
- The mismatch is reported on stderr (`fuzzy-resolved skill 'x' -> 'y'`) so the orchestrator can spot recurring typos and update the YAML.
1116
-
1117
- ### Workspace Hygiene
1118
-
1119
- Transient subagent scratch directories (`delegate.md`, `plan.md`, `result.md`, etc.) are written **outside** the project tree at `~/.konoha/tmp/<client>/<session>/scratch/tasks/<task_id>/`. If `~/.konoha` is not writable, the resolver falls back to `/tmp/konoha-<pid>-<ts>/`. The path is **never** rooted under `WORKSPACE_ROOT`, so `git add .` cannot accidentally commit agent scratch files. This is enforced by `src/mcp/runtime_state.js` and covered by `tests/test_scratch_path.js`.
1120
-
1121
1088
  ### Detailed Before vs After Comparison
1122
1089
 
1123
1090
  For an in-depth breakdown of system behavior, token consumption, configuration fragmentation, and architectural overhead, please read the [Detailed Before vs After Comparison](docs/BENCHMARK.md#-detailed-before-vs-after-comparison) section in the Benchmark Report.