@aidemd-mcp/aidemd 0.0.0-stage → 0.21.0

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 (977) hide show
  1. package/.aide/bin/aide-tree.mjs +8 -0
  2. package/.aide/config/brain.aide +1449 -0
  3. package/.aide/docs/.aide +130 -0
  4. package/.aide/docs/agent-readable-code.md +74 -0
  5. package/.aide/docs/aide-spec.md +290 -0
  6. package/.aide/docs/aide-template.md +141 -0
  7. package/.aide/docs/automated-qa.md +111 -0
  8. package/.aide/docs/brain-aide.md +242 -0
  9. package/.aide/docs/brief-aide.md +124 -0
  10. package/.aide/docs/cascading-alignment.md +107 -0
  11. package/.aide/docs/index.md +52 -0
  12. package/.aide/docs/plan-aide.md +132 -0
  13. package/.aide/docs/progressive-disclosure.md +74 -0
  14. package/.aide/docs/session-aide.md +210 -0
  15. package/.aide/docs/todo-aide.md +82 -0
  16. package/.aide/intent.aide +71 -0
  17. package/.aide/readme.aide +343 -0
  18. package/.aide/reference/hooks/PostToolUse.md +24 -0
  19. package/.aide/reference/hooks/SessionEnd.md +22 -0
  20. package/.aide/reference/hooks/SessionStart.md +18 -0
  21. package/.aide/reference/hooks/Stop.md +18 -0
  22. package/.aide/reference/hooks/UserPromptSubmit.md +18 -0
  23. package/.aide/reference/hooks/index.md +36 -0
  24. package/.aide/reference/tools/aide_brain.md +34 -0
  25. package/.aide/reference/tools/aide_cleanup.md +31 -0
  26. package/.aide/reference/tools/aide_discover.md +40 -0
  27. package/.aide/reference/tools/aide_frontmatter.md +36 -0
  28. package/.aide/reference/tools/aide_info.md +33 -0
  29. package/.aide/reference/tools/aide_init.md +39 -0
  30. package/.aide/reference/tools/aide_inspect.md +27 -0
  31. package/.aide/reference/tools/aide_observer_end_session.md +36 -0
  32. package/.aide/reference/tools/aide_observer_event.md +52 -0
  33. package/.aide/reference/tools/aide_observer_start.md +45 -0
  34. package/.aide/reference/tools/aide_read.md +29 -0
  35. package/.aide/reference/tools/aide_scaffold.md +35 -0
  36. package/.aide/reference/tools/aide_upgrade.md +45 -0
  37. package/.aide/reference/tools/aide_validate.md +36 -0
  38. package/.aide/reference/tools/index.md +25 -0
  39. package/.aide/session.aide +774 -0
  40. package/.claude/.aide +316 -0
  41. package/.claude/agents/aide/aide-aligner.md +129 -0
  42. package/.claude/agents/aide/aide-architect.md +151 -0
  43. package/.claude/agents/aide/aide-auditor.md +100 -0
  44. package/.claude/agents/aide/aide-domain-expert.md +84 -0
  45. package/.claude/agents/aide/aide-explorer.md +63 -0
  46. package/.claude/agents/aide/aide-implementor.md +121 -0
  47. package/.claude/agents/aide/aide-maintainer.md +115 -0
  48. package/.claude/agents/aide/aide-qa.md +95 -0
  49. package/.claude/agents/aide/aide-spec-writer.md +220 -0
  50. package/.claude/agents/aide/aide-strategist.md +104 -0
  51. package/.claude/agents/aide/aide-upgrader.md +71 -0
  52. package/.claude/agents/kanban/kanban-maintainer.md +113 -0
  53. package/.claude/commands/aide/align.md +24 -0
  54. package/.claude/commands/aide/brain.md +169 -0
  55. package/.claude/commands/aide/build.md +22 -0
  56. package/.claude/commands/aide/fix.md +23 -0
  57. package/.claude/commands/aide/handoff.md +15 -0
  58. package/.claude/commands/aide/plan.md +32 -0
  59. package/.claude/commands/aide/qa.md +27 -0
  60. package/.claude/commands/aide/refactor.md +106 -0
  61. package/.claude/commands/aide/research.md +21 -0
  62. package/.claude/commands/aide/spec.md +35 -0
  63. package/.claude/commands/aide/synthesize.md +24 -0
  64. package/.claude/commands/aide/update-playbook.md +3 -0
  65. package/.claude/commands/aide/upgrade.md +158 -0
  66. package/.claude/commands/aide.md +13 -0
  67. package/.claude/skills/aide/SKILL.md +611 -0
  68. package/.claude/skills/aide-brain-author/SKILL.md +122 -0
  69. package/.claude/skills/aide-handoff/SKILL.md +56 -0
  70. package/.claude/skills/aide-observer/SKILL.md +94 -0
  71. package/.claude/skills/brain/SKILL.md +69 -0
  72. package/.claude/skills/kanban/SKILL.md +24 -0
  73. package/.claude/skills/study-playbook/SKILL.md +11 -0
  74. package/CHANGELOG.md +428 -0
  75. package/LICENSE +21 -0
  76. package/README.md +219 -2
  77. package/dist/cli/hook/findLinkedSession/index.d.ts +8 -0
  78. package/dist/cli/hook/findLinkedSession/index.js +18 -0
  79. package/dist/cli/hook/index.d.ts +21 -0
  80. package/dist/cli/hook/index.js +64 -0
  81. package/dist/cli/hook/mapHookEvent/index.d.ts +9 -0
  82. package/dist/cli/hook/mapHookEvent/index.js +25 -0
  83. package/dist/cli/hook/parseHookInput/index.d.ts +9 -0
  84. package/dist/cli/hook/parseHookInput/index.js +43 -0
  85. package/dist/cli/hook/readStdin/index.d.ts +10 -0
  86. package/dist/cli/hook/readStdin/index.js +25 -0
  87. package/dist/cli/hook/resolveHookRoot/index.d.ts +10 -0
  88. package/dist/cli/hook/resolveHookRoot/index.js +14 -0
  89. package/dist/cli/hook/types/index.d.ts +24 -0
  90. package/dist/cli/hook/types/index.js +1 -0
  91. package/dist/cli/index.d.ts +24 -0
  92. package/dist/cli/index.js +62 -0
  93. package/dist/cli/init/ensureGlobalAide/index.d.ts +19 -0
  94. package/dist/cli/init/ensureGlobalAide/index.js +36 -0
  95. package/dist/cli/init/ensureGlobalAide/installGlobalPackage/index.d.ts +8 -0
  96. package/dist/cli/init/ensureGlobalAide/installGlobalPackage/index.js +15 -0
  97. package/dist/cli/init/index.d.ts +82 -0
  98. package/dist/cli/init/index.js +465 -0
  99. package/dist/cli/init/renderWarning/index.d.ts +41 -0
  100. package/dist/cli/init/renderWarning/index.js +66 -0
  101. package/dist/cli/init/reportHooks/index.d.ts +31 -0
  102. package/dist/cli/init/reportHooks/index.js +75 -0
  103. package/dist/cli/init/types/index.d.ts +46 -0
  104. package/dist/cli/init/types/index.js +1 -0
  105. package/dist/cli/init/writeMcpEntry/index.d.ts +30 -0
  106. package/dist/cli/init/writeMcpEntry/index.js +81 -0
  107. package/dist/cli/isMainModule/index.d.ts +11 -0
  108. package/dist/cli/isMainModule/index.js +27 -0
  109. package/dist/cli/launchSync/index.d.ts +9 -0
  110. package/dist/cli/launchSync/index.js +40 -0
  111. package/dist/cli/shared/writeMcpEntry/index.d.ts +49 -0
  112. package/dist/cli/shared/writeMcpEntry/index.js +107 -0
  113. package/dist/cli/sync/index.d.ts +27 -0
  114. package/dist/cli/sync/index.js +125 -0
  115. package/dist/cli/tree/App/index.d.ts +14 -0
  116. package/dist/cli/tree/App/index.js +291 -0
  117. package/dist/cli/tree/DetailPanel/index.d.ts +28 -0
  118. package/dist/cli/tree/DetailPanel/index.js +77 -0
  119. package/dist/cli/tree/DetailPanel/renderPlanDetail/index.d.ts +20 -0
  120. package/dist/cli/tree/DetailPanel/renderPlanDetail/index.js +30 -0
  121. package/dist/cli/tree/DetailPanel/renderPlanDetail/parsePlanItems/index.d.ts +32 -0
  122. package/dist/cli/tree/DetailPanel/renderPlanDetail/parsePlanItems/index.js +80 -0
  123. package/dist/cli/tree/DetailPanel/renderTodoDetail/index.d.ts +17 -0
  124. package/dist/cli/tree/DetailPanel/renderTodoDetail/index.js +19 -0
  125. package/dist/cli/tree/DetailPanel/renderTodoDetail/parseTodoItems/index.d.ts +26 -0
  126. package/dist/cli/tree/DetailPanel/renderTodoDetail/parseTodoItems/index.js +48 -0
  127. package/dist/cli/tree/TreePanel/index.d.ts +24 -0
  128. package/dist/cli/tree/TreePanel/index.js +96 -0
  129. package/dist/cli/tree/findPrimaryIntent/index.d.ts +12 -0
  130. package/dist/cli/tree/findPrimaryIntent/index.js +20 -0
  131. package/dist/cli/tree/flattenTree/index.d.ts +16 -0
  132. package/dist/cli/tree/flattenTree/index.js +20 -0
  133. package/dist/cli/tree/index.d.ts +2 -0
  134. package/dist/cli/tree/index.js +15 -0
  135. package/dist/cli/view/awaitShutdown/index.d.ts +12 -0
  136. package/dist/cli/view/awaitShutdown/index.js +32 -0
  137. package/dist/cli/view/buildLink/index.d.ts +13 -0
  138. package/dist/cli/view/buildLink/index.js +18 -0
  139. package/dist/cli/view/formatPortNote/index.d.ts +10 -0
  140. package/dist/cli/view/formatPortNote/index.js +11 -0
  141. package/dist/cli/view/formatUsage/index.d.ts +6 -0
  142. package/dist/cli/view/formatUsage/index.js +24 -0
  143. package/dist/cli/view/index.d.ts +21 -0
  144. package/dist/cli/view/index.js +102 -0
  145. package/dist/cli/view/parseViewArgs/index.d.ts +14 -0
  146. package/dist/cli/view/parseViewArgs/index.js +59 -0
  147. package/dist/cli/view/types/index.d.ts +20 -0
  148. package/dist/cli/view/types/index.js +1 -0
  149. package/dist/index.d.ts +10 -0
  150. package/dist/index.js +17 -0
  151. package/dist/observer/assets/Inter-OFL.txt +93 -0
  152. package/dist/observer/assets/JetBrainsMono-OFL.txt +93 -0
  153. package/dist/observer/assets/page.css +1 -0
  154. package/dist/observer/assets/page.js +158 -0
  155. package/dist/observer/assets/page.js.LEGAL.txt +56 -0
  156. package/dist/observer/bindServer/index.d.ts +17 -0
  157. package/dist/observer/bindServer/index.js +29 -0
  158. package/dist/observer/buildPageShell/index.d.ts +8 -0
  159. package/dist/observer/buildPageShell/index.js +30 -0
  160. package/dist/observer/buildProjectView/index.d.ts +12 -0
  161. package/dist/observer/buildProjectView/index.js +25 -0
  162. package/dist/observer/buildViewLink/index.d.ts +16 -0
  163. package/dist/observer/buildViewLink/index.js +15 -0
  164. package/dist/observer/createEventStore/index.d.ts +14 -0
  165. package/dist/observer/createEventStore/index.js +98 -0
  166. package/dist/observer/createStatusPusher/index.d.ts +16 -0
  167. package/dist/observer/createStatusPusher/index.js +40 -0
  168. package/dist/observer/createStop/index.d.ts +23 -0
  169. package/dist/observer/createStop/index.js +40 -0
  170. package/dist/observer/createStreamHub/frame/index.d.ts +6 -0
  171. package/dist/observer/createStreamHub/frame/index.js +4 -0
  172. package/dist/observer/createStreamHub/index.d.ts +13 -0
  173. package/dist/observer/createStreamHub/index.js +76 -0
  174. package/dist/observer/findRunningObserver/index.d.ts +12 -0
  175. package/dist/observer/findRunningObserver/index.js +33 -0
  176. package/dist/observer/findRunningObserver/probeIndex/index.d.ts +13 -0
  177. package/dist/observer/findRunningObserver/probeIndex/index.js +28 -0
  178. package/dist/observer/guardRequest/index.d.ts +20 -0
  179. package/dist/observer/guardRequest/index.js +38 -0
  180. package/dist/observer/guardRequest/matchesToken/index.d.ts +5 -0
  181. package/dist/observer/guardRequest/matchesToken/index.js +9 -0
  182. package/dist/observer/guardRequest/types/index.d.ts +8 -0
  183. package/dist/observer/guardRequest/types/index.js +1 -0
  184. package/dist/observer/handleRequest/index.d.ts +13 -0
  185. package/dist/observer/handleRequest/index.js +76 -0
  186. package/dist/observer/handleRequest/isTokenFree/index.d.ts +11 -0
  187. package/dist/observer/handleRequest/isTokenFree/index.js +12 -0
  188. package/dist/observer/handleRequest/matchRoute/index.d.ts +26 -0
  189. package/dist/observer/handleRequest/matchRoute/index.js +89 -0
  190. package/dist/observer/index.d.ts +23 -0
  191. package/dist/observer/index.js +112 -0
  192. package/dist/observer/listPorts/index.d.ts +9 -0
  193. package/dist/observer/listPorts/index.js +10 -0
  194. package/dist/observer/loadToken/index.d.ts +12 -0
  195. package/dist/observer/loadToken/index.js +46 -0
  196. package/dist/observer/loadToken/readStored/index.d.ts +4 -0
  197. package/dist/observer/loadToken/readStored/index.js +16 -0
  198. package/dist/observer/loadToken/writeTemp/index.d.ts +5 -0
  199. package/dist/observer/loadToken/writeTemp/index.js +8 -0
  200. package/dist/observer/locatePageAssets/index.d.ts +6 -0
  201. package/dist/observer/locatePageAssets/index.js +17 -0
  202. package/dist/observer/mintToken/index.d.ts +2 -0
  203. package/dist/observer/mintToken/index.js +6 -0
  204. package/dist/observer/rebuildStatus/index.d.ts +17 -0
  205. package/dist/observer/rebuildStatus/index.js +49 -0
  206. package/dist/observer/removeRecord/index.d.ts +10 -0
  207. package/dist/observer/removeRecord/index.js +22 -0
  208. package/dist/observer/replaySessions/index.d.ts +7 -0
  209. package/dist/observer/replaySessions/index.js +17 -0
  210. package/dist/observer/resolvePort/index.d.ts +12 -0
  211. package/dist/observer/resolvePort/index.js +21 -0
  212. package/dist/observer/routes/archiveSession/index.d.ts +11 -0
  213. package/dist/observer/routes/archiveSession/index.js +57 -0
  214. package/dist/observer/routes/deleteSession/index.d.ts +10 -0
  215. package/dist/observer/routes/deleteSession/index.js +33 -0
  216. package/dist/observer/routes/getAsset/index.d.ts +7 -0
  217. package/dist/observer/routes/getAsset/index.js +30 -0
  218. package/dist/observer/routes/getEvents/index.d.ts +3 -0
  219. package/dist/observer/routes/getEvents/index.js +13 -0
  220. package/dist/observer/routes/getFile/index.d.ts +7 -0
  221. package/dist/observer/routes/getFile/index.js +54 -0
  222. package/dist/observer/routes/getFile/resolveConfinedPath/index.d.ts +24 -0
  223. package/dist/observer/routes/getFile/resolveConfinedPath/index.js +65 -0
  224. package/dist/observer/routes/getIndex/index.d.ts +7 -0
  225. package/dist/observer/routes/getIndex/index.js +23 -0
  226. package/dist/observer/routes/getSessionPage/index.d.ts +8 -0
  227. package/dist/observer/routes/getSessionPage/index.js +10 -0
  228. package/dist/observer/routes/getStatus/index.d.ts +7 -0
  229. package/dist/observer/routes/getStatus/index.js +15 -0
  230. package/dist/observer/routes/getTask/index.d.ts +7 -0
  231. package/dist/observer/routes/getTask/index.js +47 -0
  232. package/dist/observer/routes/listArchived/index.d.ts +8 -0
  233. package/dist/observer/routes/listArchived/index.js +22 -0
  234. package/dist/observer/routes/listProjects/index.d.ts +3 -0
  235. package/dist/observer/routes/listProjects/index.js +9 -0
  236. package/dist/observer/routes/listSessions/index.d.ts +3 -0
  237. package/dist/observer/routes/listSessions/index.js +18 -0
  238. package/dist/observer/routes/postEvent/index.d.ts +12 -0
  239. package/dist/observer/routes/postEvent/index.js +76 -0
  240. package/dist/observer/routes/postEvent/readJsonBody/index.d.ts +18 -0
  241. package/dist/observer/routes/postEvent/readJsonBody/index.js +37 -0
  242. package/dist/observer/routes/postPresence/index.d.ts +12 -0
  243. package/dist/observer/routes/postPresence/index.js +63 -0
  244. package/dist/observer/routes/postShutdown/index.d.ts +13 -0
  245. package/dist/observer/routes/postShutdown/index.js +64 -0
  246. package/dist/observer/routes/restoreSession/index.d.ts +11 -0
  247. package/dist/observer/routes/restoreSession/index.js +46 -0
  248. package/dist/observer/routes/streamUpdates/index.d.ts +10 -0
  249. package/dist/observer/routes/streamUpdates/index.js +20 -0
  250. package/dist/observer/shared/announceSessions/index.d.ts +12 -0
  251. package/dist/observer/shared/announceSessions/index.js +20 -0
  252. package/dist/observer/shared/broadcastProjects/index.d.ts +10 -0
  253. package/dist/observer/shared/broadcastProjects/index.js +13 -0
  254. package/dist/observer/shared/buildObserverMessage/index.d.ts +8 -0
  255. package/dist/observer/shared/buildObserverMessage/index.js +20 -0
  256. package/dist/observer/shared/findProject/index.d.ts +12 -0
  257. package/dist/observer/shared/findProject/index.js +22 -0
  258. package/dist/observer/shared/pageAssets/index.d.ts +13 -0
  259. package/dist/observer/shared/pageAssets/index.js +16 -0
  260. package/dist/observer/shared/pageTitle/index.d.ts +7 -0
  261. package/dist/observer/shared/pageTitle/index.js +7 -0
  262. package/dist/observer/shared/parsePort/index.d.ts +12 -0
  263. package/dist/observer/shared/parsePort/index.js +15 -0
  264. package/dist/observer/shared/pickKanbanOverride/index.d.ts +10 -0
  265. package/dist/observer/shared/pickKanbanOverride/index.js +10 -0
  266. package/dist/observer/shared/pickReportedLocation/index.d.ts +13 -0
  267. package/dist/observer/shared/pickReportedLocation/index.js +18 -0
  268. package/dist/observer/shared/readHeldLiveness/index.d.ts +13 -0
  269. package/dist/observer/shared/readHeldLiveness/index.js +23 -0
  270. package/dist/observer/shared/routeTable/index.d.ts +131 -0
  271. package/dist/observer/shared/routeTable/index.js +31 -0
  272. package/dist/observer/shared/sendBody/index.d.ts +14 -0
  273. package/dist/observer/shared/sendBody/index.js +17 -0
  274. package/dist/observer/shared/sendJson/index.d.ts +12 -0
  275. package/dist/observer/shared/sendJson/index.js +15 -0
  276. package/dist/observer/shared/sendPage/index.d.ts +10 -0
  277. package/dist/observer/shared/sendPage/index.js +18 -0
  278. package/dist/observer/shared/shutdownRequest/index.d.ts +14 -0
  279. package/dist/observer/shared/shutdownRequest/index.js +7 -0
  280. package/dist/observer/shared/summarizeProjects/index.d.ts +14 -0
  281. package/dist/observer/shared/summarizeProjects/index.js +38 -0
  282. package/dist/observer/shared/summarizeSessions/index.d.ts +12 -0
  283. package/dist/observer/shared/summarizeSessions/index.js +30 -0
  284. package/dist/observer/shared/tokenFormat/index.d.ts +4 -0
  285. package/dist/observer/shared/tokenFormat/index.js +4 -0
  286. package/dist/observer/shared/wantsHtml/index.d.ts +8 -0
  287. package/dist/observer/shared/wantsHtml/index.js +10 -0
  288. package/dist/observer/takeOver/awaitExit/index.d.ts +10 -0
  289. package/dist/observer/takeOver/awaitExit/index.js +26 -0
  290. package/dist/observer/takeOver/index.d.ts +11 -0
  291. package/dist/observer/takeOver/index.js +27 -0
  292. package/dist/observer/takeOver/requestShutdown/index.d.ts +10 -0
  293. package/dist/observer/takeOver/requestShutdown/index.js +28 -0
  294. package/dist/observer/types/index.d.ts +214 -0
  295. package/dist/observer/types/index.js +1 -0
  296. package/dist/observer/writeRecord/index.d.ts +10 -0
  297. package/dist/observer/writeRecord/index.js +11 -0
  298. package/dist/service/brainContract/index.d.ts +113 -0
  299. package/dist/service/brainContract/index.js +107 -0
  300. package/dist/service/brainContract/launcherPurpose/index.d.ts +8 -0
  301. package/dist/service/brainContract/launcherPurpose/index.js +8 -0
  302. package/dist/service/brainContract/toMarkerPair/index.d.ts +11 -0
  303. package/dist/service/brainContract/toMarkerPair/index.js +12 -0
  304. package/dist/service/buildBrainState/classifyParseFailure/index.d.ts +17 -0
  305. package/dist/service/buildBrainState/classifyParseFailure/index.js +29 -0
  306. package/dist/service/buildBrainState/index.d.ts +84 -0
  307. package/dist/service/buildBrainState/index.js +177 -0
  308. package/dist/service/install/applySteps/index.d.ts +38 -0
  309. package/dist/service/install/applySteps/index.js +86 -0
  310. package/dist/service/install/configureIde/index.d.ts +25 -0
  311. package/dist/service/install/configureIde/index.js +143 -0
  312. package/dist/service/install/detectFramework/index.d.ts +11 -0
  313. package/dist/service/install/detectFramework/index.js +53 -0
  314. package/dist/service/install/index.d.ts +63 -0
  315. package/dist/service/install/index.js +138 -0
  316. package/dist/service/install/initContent/index.d.ts +158 -0
  317. package/dist/service/install/initContent/index.js +260 -0
  318. package/dist/service/install/installAgents/index.d.ts +16 -0
  319. package/dist/service/install/installAgents/index.js +55 -0
  320. package/dist/service/install/installAideTree/index.d.ts +15 -0
  321. package/dist/service/install/installAideTree/index.js +54 -0
  322. package/dist/service/install/installHooks/index.d.ts +24 -0
  323. package/dist/service/install/installHooks/index.js +68 -0
  324. package/dist/service/install/installMethodologyDocs/index.d.ts +16 -0
  325. package/dist/service/install/installMethodologyDocs/index.js +55 -0
  326. package/dist/service/install/installSkills/index.d.ts +16 -0
  327. package/dist/service/install/installSkills/index.js +55 -0
  328. package/dist/service/install/planSessionRecord/index.d.ts +16 -0
  329. package/dist/service/install/planSessionRecord/index.js +30 -0
  330. package/dist/service/install/provisionBrain/buildBrainAideStep/index.d.ts +25 -0
  331. package/dist/service/install/provisionBrain/buildBrainAideStep/index.js +60 -0
  332. package/dist/service/install/provisionBrain/buildBrainAideStep/summarizeBrainConfig/index.d.ts +14 -0
  333. package/dist/service/install/provisionBrain/buildBrainAideStep/summarizeBrainConfig/index.js +33 -0
  334. package/dist/service/install/provisionBrain/buildBrainAideStep/summarizeBrainConfig/listBrainSections/index.d.ts +10 -0
  335. package/dist/service/install/provisionBrain/buildBrainAideStep/summarizeBrainConfig/listBrainSections/index.js +19 -0
  336. package/dist/service/install/provisionBrain/detectBrainMigration/findLegacyLauncher/index.d.ts +17 -0
  337. package/dist/service/install/provisionBrain/detectBrainMigration/findLegacyLauncher/index.js +39 -0
  338. package/dist/service/install/provisionBrain/detectBrainMigration/findStaleSections/fingerprintSection/index.d.ts +11 -0
  339. package/dist/service/install/provisionBrain/detectBrainMigration/findStaleSections/fingerprintSection/index.js +20 -0
  340. package/dist/service/install/provisionBrain/detectBrainMigration/findStaleSections/index.d.ts +16 -0
  341. package/dist/service/install/provisionBrain/detectBrainMigration/findStaleSections/index.js +30 -0
  342. package/dist/service/install/provisionBrain/detectBrainMigration/index.d.ts +13 -0
  343. package/dist/service/install/provisionBrain/detectBrainMigration/index.js +32 -0
  344. package/dist/service/install/provisionBrain/index.d.ts +37 -0
  345. package/dist/service/install/provisionBrain/index.js +182 -0
  346. package/dist/service/install/provisionBrain/isTemplateIntegration/index.d.ts +14 -0
  347. package/dist/service/install/provisionBrain/isTemplateIntegration/index.js +24 -0
  348. package/dist/service/install/provisionBrain/obsidianBrainAideTemplate/index.d.ts +73 -0
  349. package/dist/service/install/provisionBrain/obsidianBrainAideTemplate/index.js +557 -0
  350. package/dist/service/install/provisionBrain/obsidianBrainAideTemplate/kanbanSeeds/guide/complete/index.d.ts +13 -0
  351. package/dist/service/install/provisionBrain/obsidianBrainAideTemplate/kanbanSeeds/guide/complete/index.js +51 -0
  352. package/dist/service/install/provisionBrain/obsidianBrainAideTemplate/kanbanSeeds/guide/create/index.d.ts +13 -0
  353. package/dist/service/install/provisionBrain/obsidianBrainAideTemplate/kanbanSeeds/guide/create/index.js +82 -0
  354. package/dist/service/install/provisionBrain/obsidianBrainAideTemplate/kanbanSeeds/guide/manage/index.d.ts +13 -0
  355. package/dist/service/install/provisionBrain/obsidianBrainAideTemplate/kanbanSeeds/guide/manage/index.js +86 -0
  356. package/dist/service/install/provisionBrain/obsidianBrainAideTemplate/kanbanSeeds/guide/move/index.d.ts +12 -0
  357. package/dist/service/install/provisionBrain/obsidianBrainAideTemplate/kanbanSeeds/guide/move/index.js +59 -0
  358. package/dist/service/install/provisionBrain/obsidianBrainAideTemplate/kanbanSeeds/guide/review/index.d.ts +15 -0
  359. package/dist/service/install/provisionBrain/obsidianBrainAideTemplate/kanbanSeeds/guide/review/index.js +274 -0
  360. package/dist/service/install/provisionBrain/obsidianBrainAideTemplate/kanbanSeeds/guide/stash/index.d.ts +14 -0
  361. package/dist/service/install/provisionBrain/obsidianBrainAideTemplate/kanbanSeeds/guide/stash/index.js +103 -0
  362. package/dist/service/install/provisionBrain/obsidianBrainAideTemplate/kanbanSeeds/guide/work/index.d.ts +14 -0
  363. package/dist/service/install/provisionBrain/obsidianBrainAideTemplate/kanbanSeeds/guide/work/index.js +332 -0
  364. package/dist/service/install/provisionBrain/obsidianBrainAideTemplate/kanbanSeeds/hub/index.d.ts +16 -0
  365. package/dist/service/install/provisionBrain/obsidianBrainAideTemplate/kanbanSeeds/hub/index.js +94 -0
  366. package/dist/service/install/provisionBrain/outdatedTemplateSections/index.d.ts +18 -0
  367. package/dist/service/install/provisionBrain/outdatedTemplateSections/index.js +164 -0
  368. package/dist/service/install/provisionBrain/parseBundledTemplate/index.d.ts +14 -0
  369. package/dist/service/install/provisionBrain/parseBundledTemplate/index.js +21 -0
  370. package/dist/service/install/provisionBrain/planBrainRepair/index.d.ts +26 -0
  371. package/dist/service/install/provisionBrain/planBrainRepair/index.js +47 -0
  372. package/dist/service/install/provisionBrain/readBrainMigrationNotice/index.d.ts +15 -0
  373. package/dist/service/install/provisionBrain/readBrainMigrationNotice/index.js +26 -0
  374. package/dist/service/install/reference/index.d.ts +24 -0
  375. package/dist/service/install/reference/index.js +51 -0
  376. package/dist/service/install/resolveBrainHints/index.d.ts +17 -0
  377. package/dist/service/install/resolveBrainHints/index.js +44 -0
  378. package/dist/service/install/scaffoldCommands/index.d.ts +42 -0
  379. package/dist/service/install/scaffoldCommands/index.js +90 -0
  380. package/dist/service/install/scaffoldReadme/deriveProjectName/index.d.ts +18 -0
  381. package/dist/service/install/scaffoldReadme/deriveProjectName/index.js +37 -0
  382. package/dist/service/install/scaffoldReadme/index.d.ts +20 -0
  383. package/dist/service/install/scaffoldReadme/index.js +57 -0
  384. package/dist/service/install/scaffoldReadme/insertBadge/index.d.ts +17 -0
  385. package/dist/service/install/scaffoldReadme/insertBadge/index.js +51 -0
  386. package/dist/service/install/shared/aidePackage/index.d.ts +18 -0
  387. package/dist/service/install/shared/aidePackage/index.js +17 -0
  388. package/dist/service/install/shared/checkGlobalPackage/index.d.ts +11 -0
  389. package/dist/service/install/shared/checkGlobalPackage/index.js +28 -0
  390. package/dist/service/install/shared/compareBytes/index.d.ts +12 -0
  391. package/dist/service/install/shared/compareBytes/index.js +24 -0
  392. package/dist/service/install/shared/describeAideCommand/index.d.ts +10 -0
  393. package/dist/service/install/shared/describeAideCommand/index.js +13 -0
  394. package/dist/service/install/shared/detectLaunchMode/index.d.ts +11 -0
  395. package/dist/service/install/shared/detectLaunchMode/index.js +10 -0
  396. package/dist/service/install/shared/isOlderVersion/index.d.ts +7 -0
  397. package/dist/service/install/shared/isOlderVersion/index.js +19 -0
  398. package/dist/service/install/shared/normalizeLaunchedCommand/index.d.ts +16 -0
  399. package/dist/service/install/shared/normalizeLaunchedCommand/index.js +36 -0
  400. package/dist/service/install/shared/planHooks/ignoreLocal/appendLine/index.d.ts +10 -0
  401. package/dist/service/install/shared/planHooks/ignoreLocal/appendLine/index.js +14 -0
  402. package/dist/service/install/shared/planHooks/ignoreLocal/index.d.ts +13 -0
  403. package/dist/service/install/shared/planHooks/ignoreLocal/index.js +30 -0
  404. package/dist/service/install/shared/planHooks/ignoreLocal/inspectGit/index.d.ts +17 -0
  405. package/dist/service/install/shared/planHooks/ignoreLocal/inspectGit/index.js +42 -0
  406. package/dist/service/install/shared/planHooks/index.d.ts +19 -0
  407. package/dist/service/install/shared/planHooks/index.js +65 -0
  408. package/dist/service/install/shared/planHooks/locateEntry/index.d.ts +15 -0
  409. package/dist/service/install/shared/planHooks/locateEntry/index.js +40 -0
  410. package/dist/service/install/shared/planHooks/mergeLocal/aideHookEntries/index.d.ts +11 -0
  411. package/dist/service/install/shared/planHooks/mergeLocal/aideHookEntries/index.js +21 -0
  412. package/dist/service/install/shared/planHooks/mergeLocal/buildCommand/index.d.ts +7 -0
  413. package/dist/service/install/shared/planHooks/mergeLocal/buildCommand/index.js +9 -0
  414. package/dist/service/install/shared/planHooks/mergeLocal/findWiredEvents/index.d.ts +16 -0
  415. package/dist/service/install/shared/planHooks/mergeLocal/findWiredEvents/index.js +35 -0
  416. package/dist/service/install/shared/planHooks/mergeLocal/index.d.ts +17 -0
  417. package/dist/service/install/shared/planHooks/mergeLocal/index.js +57 -0
  418. package/dist/service/install/shared/planHooks/shared/isAideHookCommand/index.d.ts +10 -0
  419. package/dist/service/install/shared/planHooks/shared/isAideHookCommand/index.js +86 -0
  420. package/dist/service/install/shared/planHooks/shared/parseSettings/index.d.ts +10 -0
  421. package/dist/service/install/shared/planHooks/shared/parseSettings/index.js +24 -0
  422. package/dist/service/install/shared/planHooks/shared/readOptional/index.d.ts +7 -0
  423. package/dist/service/install/shared/planHooks/shared/readOptional/index.js +17 -0
  424. package/dist/service/install/shared/planHooks/shared/removeAideHooks/index.d.ts +17 -0
  425. package/dist/service/install/shared/planHooks/shared/removeAideHooks/index.js +84 -0
  426. package/dist/service/install/shared/planHooks/stripProject/index.d.ts +14 -0
  427. package/dist/service/install/shared/planHooks/stripProject/index.js +26 -0
  428. package/dist/service/install/shared/planInstallInstruction/index.d.ts +3 -0
  429. package/dist/service/install/shared/planInstallInstruction/index.js +6 -0
  430. package/dist/service/install/shared/readNpxPackageSpec/index.d.ts +11 -0
  431. package/dist/service/install/shared/readNpxPackageSpec/index.js +35 -0
  432. package/dist/service/install/wireMcp/index.d.ts +28 -0
  433. package/dist/service/install/wireMcp/index.js +89 -0
  434. package/dist/service/install/writeMethodology/index.d.ts +22 -0
  435. package/dist/service/install/writeMethodology/index.js +131 -0
  436. package/dist/service/observer/event/archive/index.d.ts +14 -0
  437. package/dist/service/observer/event/archive/index.js +52 -0
  438. package/dist/service/observer/event/delete/index.d.ts +20 -0
  439. package/dist/service/observer/event/delete/index.js +60 -0
  440. package/dist/service/observer/event/endSession/index.d.ts +19 -0
  441. package/dist/service/observer/event/endSession/index.js +85 -0
  442. package/dist/service/observer/event/findConversation/index.d.ts +16 -0
  443. package/dist/service/observer/event/findConversation/index.js +46 -0
  444. package/dist/service/observer/event/markClosed/index.d.ts +15 -0
  445. package/dist/service/observer/event/markClosed/index.js +39 -0
  446. package/dist/service/observer/event/read/index.d.ts +11 -0
  447. package/dist/service/observer/event/read/index.js +18 -0
  448. package/dist/service/observer/event/read/readProject/index.d.ts +14 -0
  449. package/dist/service/observer/event/read/readProject/index.js +52 -0
  450. package/dist/service/observer/event/readArchive/index.d.ts +9 -0
  451. package/dist/service/observer/event/readArchive/index.js +46 -0
  452. package/dist/service/observer/event/readConversations/index.d.ts +10 -0
  453. package/dist/service/observer/event/readConversations/index.js +12 -0
  454. package/dist/service/observer/event/readLiveness/index.d.ts +24 -0
  455. package/dist/service/observer/event/readLiveness/index.js +40 -0
  456. package/dist/service/observer/event/record/appendLine/index.d.ts +17 -0
  457. package/dist/service/observer/event/record/appendLine/index.js +25 -0
  458. package/dist/service/observer/event/record/index.d.ts +19 -0
  459. package/dist/service/observer/event/record/index.js +62 -0
  460. package/dist/service/observer/event/record/postToObserver/index.d.ts +15 -0
  461. package/dist/service/observer/event/record/postToObserver/index.js +39 -0
  462. package/dist/service/observer/event/record/readPreviouslyEnded/index.d.ts +11 -0
  463. package/dist/service/observer/event/record/readPreviouslyEnded/index.js +25 -0
  464. package/dist/service/observer/event/record/session/createSession/index.d.ts +3 -0
  465. package/dist/service/observer/event/record/session/createSession/index.js +18 -0
  466. package/dist/service/observer/event/record/session/createSessionId/index.d.ts +9 -0
  467. package/dist/service/observer/event/record/session/createSessionId/index.js +11 -0
  468. package/dist/service/observer/event/record/session/index.d.ts +8 -0
  469. package/dist/service/observer/event/record/session/index.js +14 -0
  470. package/dist/service/observer/event/reopen/index.d.ts +13 -0
  471. package/dist/service/observer/event/reopen/index.js +34 -0
  472. package/dist/service/observer/event/restore/index.d.ts +12 -0
  473. package/dist/service/observer/event/restore/index.js +48 -0
  474. package/dist/service/observer/event/shared/attachLiveness/index.d.ts +14 -0
  475. package/dist/service/observer/event/shared/attachLiveness/index.js +18 -0
  476. package/dist/service/observer/event/shared/buildSessionPath/index.d.ts +11 -0
  477. package/dist/service/observer/event/shared/buildSessionPath/index.js +13 -0
  478. package/dist/service/observer/event/shared/endedMark/index.d.ts +30 -0
  479. package/dist/service/observer/event/shared/endedMark/index.js +48 -0
  480. package/dist/service/observer/event/shared/findNewestStart/index.d.ts +13 -0
  481. package/dist/service/observer/event/shared/findNewestStart/index.js +19 -0
  482. package/dist/service/observer/event/shared/formatSessionTag/index.d.ts +8 -0
  483. package/dist/service/observer/event/shared/formatSessionTag/index.js +11 -0
  484. package/dist/service/observer/event/shared/groupConversations/index.d.ts +14 -0
  485. package/dist/service/observer/event/shared/groupConversations/index.js +44 -0
  486. package/dist/service/observer/event/shared/isClosedRecord/index.d.ts +8 -0
  487. package/dist/service/observer/event/shared/isClosedRecord/index.js +13 -0
  488. package/dist/service/observer/event/shared/isIsoDateTime/index.d.ts +7 -0
  489. package/dist/service/observer/event/shared/isIsoDateTime/index.js +18 -0
  490. package/dist/service/observer/event/shared/judgeConversation/index.d.ts +18 -0
  491. package/dist/service/observer/event/shared/judgeConversation/index.js +26 -0
  492. package/dist/service/observer/event/shared/judgeConversation/pickNewestPresence/index.d.ts +10 -0
  493. package/dist/service/observer/event/shared/judgeConversation/pickNewestPresence/index.js +9 -0
  494. package/dist/service/observer/event/shared/judgeLiveness/index.d.ts +24 -0
  495. package/dist/service/observer/event/shared/judgeLiveness/index.js +41 -0
  496. package/dist/service/observer/event/shared/limits/index.d.ts +15 -0
  497. package/dist/service/observer/event/shared/limits/index.js +15 -0
  498. package/dist/service/observer/event/shared/listSessionIds/index.d.ts +9 -0
  499. package/dist/service/observer/event/shared/listSessionIds/index.js +33 -0
  500. package/dist/service/observer/event/shared/observerRecord/index.d.ts +23 -0
  501. package/dist/service/observer/event/shared/observerRecord/index.js +29 -0
  502. package/dist/service/observer/event/shared/parseSessionTag/index.d.ts +8 -0
  503. package/dist/service/observer/event/shared/parseSessionTag/index.js +18 -0
  504. package/dist/service/observer/event/shared/presencePing/index.d.ts +15 -0
  505. package/dist/service/observer/event/shared/presencePing/index.js +13 -0
  506. package/dist/service/observer/event/shared/presenceRecord/index.d.ts +36 -0
  507. package/dist/service/observer/event/shared/presenceRecord/index.js +70 -0
  508. package/dist/service/observer/event/shared/protocol/index.d.ts +31 -0
  509. package/dist/service/observer/event/shared/protocol/index.js +30 -0
  510. package/dist/service/observer/event/shared/readClosingRecord/index.d.ts +15 -0
  511. package/dist/service/observer/event/shared/readClosingRecord/index.js +50 -0
  512. package/dist/service/observer/event/shared/readConversationMark/index.d.ts +13 -0
  513. package/dist/service/observer/event/shared/readConversationMark/index.js +14 -0
  514. package/dist/service/observer/event/shared/readConversationMark/pickDecidingMark/index.d.ts +10 -0
  515. package/dist/service/observer/event/shared/readConversationMark/pickDecidingMark/index.js +10 -0
  516. package/dist/service/observer/event/shared/readEndedMark/index.d.ts +9 -0
  517. package/dist/service/observer/event/shared/readEndedMark/index.js +24 -0
  518. package/dist/service/observer/event/shared/readObserverRecord/index.d.ts +11 -0
  519. package/dist/service/observer/event/shared/readObserverRecord/index.js +26 -0
  520. package/dist/service/observer/event/shared/readObserverRecord/parseJson/index.d.ts +2 -0
  521. package/dist/service/observer/event/shared/readObserverRecord/parseJson/index.js +9 -0
  522. package/dist/service/observer/event/shared/readPresence/index.d.ts +11 -0
  523. package/dist/service/observer/event/shared/readPresence/index.js +46 -0
  524. package/dist/service/observer/event/shared/readSessionLog/index.d.ts +13 -0
  525. package/dist/service/observer/event/shared/readSessionLog/index.js +29 -0
  526. package/dist/service/observer/event/shared/readSessionLog/parseLines/index.d.ts +14 -0
  527. package/dist/service/observer/event/shared/readSessionLog/parseLines/index.js +32 -0
  528. package/dist/service/observer/event/shared/readSessionStart/index.d.ts +8 -0
  529. package/dist/service/observer/event/shared/readSessionStart/index.js +20 -0
  530. package/dist/service/observer/event/shared/readTranscriptActivity/index.d.ts +9 -0
  531. package/dist/service/observer/event/shared/readTranscriptActivity/index.js +18 -0
  532. package/dist/service/observer/event/shared/schema/index.d.ts +1398 -0
  533. package/dist/service/observer/event/shared/schema/index.js +218 -0
  534. package/dist/service/observer/event/shared/writeEndedMark/index.d.ts +12 -0
  535. package/dist/service/observer/event/shared/writeEndedMark/index.js +26 -0
  536. package/dist/service/observer/event/touchPresence/index.d.ts +15 -0
  537. package/dist/service/observer/event/touchPresence/index.js +77 -0
  538. package/dist/service/observer/event/touchPresence/mergePresence/index.d.ts +19 -0
  539. package/dist/service/observer/event/touchPresence/mergePresence/index.js +50 -0
  540. package/dist/service/observer/event/touchPresence/pingObserver/index.d.ts +15 -0
  541. package/dist/service/observer/event/touchPresence/pingObserver/index.js +63 -0
  542. package/dist/service/observer/event/touchPresence/shouldRefresh/index.d.ts +17 -0
  543. package/dist/service/observer/event/touchPresence/shouldRefresh/index.js +25 -0
  544. package/dist/service/observer/event/touchPresence/writePresence/index.d.ts +12 -0
  545. package/dist/service/observer/event/touchPresence/writePresence/index.js +20 -0
  546. package/dist/service/observer/event/types/index.d.ts +217 -0
  547. package/dist/service/observer/event/types/index.js +1 -0
  548. package/dist/service/observer/kanban/board/read/index.d.ts +13 -0
  549. package/dist/service/observer/kanban/board/read/index.js +27 -0
  550. package/dist/service/observer/kanban/board/read/readColumn/index.d.ts +11 -0
  551. package/dist/service/observer/kanban/board/read/readColumn/index.js +67 -0
  552. package/dist/service/observer/kanban/shared/boardHints/index.d.ts +17 -0
  553. package/dist/service/observer/kanban/shared/boardHints/index.js +17 -0
  554. package/dist/service/observer/kanban/shared/boardUnavailable/index.d.ts +6 -0
  555. package/dist/service/observer/kanban/shared/boardUnavailable/index.js +8 -0
  556. package/dist/service/observer/kanban/shared/columns/index.d.ts +18 -0
  557. package/dist/service/observer/kanban/shared/columns/index.js +9 -0
  558. package/dist/service/observer/kanban/shared/isInsideFolder/index.d.ts +8 -0
  559. package/dist/service/observer/kanban/shared/isInsideFolder/index.js +25 -0
  560. package/dist/service/observer/kanban/shared/locateBoard/index.d.ts +25 -0
  561. package/dist/service/observer/kanban/shared/locateBoard/index.js +76 -0
  562. package/dist/service/observer/kanban/shared/locateBoard/readKanbanFolder/index.d.ts +13 -0
  563. package/dist/service/observer/kanban/shared/locateBoard/readKanbanFolder/index.js +39 -0
  564. package/dist/service/observer/kanban/shared/namesSlug/index.d.ts +8 -0
  565. package/dist/service/observer/kanban/shared/namesSlug/index.js +13 -0
  566. package/dist/service/observer/kanban/shared/parseTaskNote/index.d.ts +11 -0
  567. package/dist/service/observer/kanban/shared/parseTaskNote/index.js +63 -0
  568. package/dist/service/observer/kanban/shared/readSessionKanban/index.d.ts +7 -0
  569. package/dist/service/observer/kanban/shared/readSessionKanban/index.js +22 -0
  570. package/dist/service/observer/kanban/task/read/findTaskFile/index.d.ts +22 -0
  571. package/dist/service/observer/kanban/task/read/findTaskFile/index.js +34 -0
  572. package/dist/service/observer/kanban/task/read/index.d.ts +13 -0
  573. package/dist/service/observer/kanban/task/read/index.js +42 -0
  574. package/dist/service/observer/kanban/types/index.d.ts +95 -0
  575. package/dist/service/observer/kanban/types/index.js +1 -0
  576. package/dist/service/observer/status/buildHistory/formatDuration/index.d.ts +6 -0
  577. package/dist/service/observer/status/buildHistory/formatDuration/index.js +15 -0
  578. package/dist/service/observer/status/buildHistory/index.d.ts +10 -0
  579. package/dist/service/observer/status/buildHistory/index.js +68 -0
  580. package/dist/service/observer/status/buildHistory/labelEvent/index.d.ts +12 -0
  581. package/dist/service/observer/status/buildHistory/labelEvent/index.js +78 -0
  582. package/dist/service/observer/status/buildModuleNodes/classifyTreeFile/index.d.ts +8 -0
  583. package/dist/service/observer/status/buildModuleNodes/classifyTreeFile/index.js +25 -0
  584. package/dist/service/observer/status/buildModuleNodes/findParentFolder/index.d.ts +9 -0
  585. package/dist/service/observer/status/buildModuleNodes/findParentFolder/index.js +20 -0
  586. package/dist/service/observer/status/buildModuleNodes/index.d.ts +9 -0
  587. package/dist/service/observer/status/buildModuleNodes/index.js +49 -0
  588. package/dist/service/observer/status/buildModuleNodes/readTreeFile/countPlanSteps/index.d.ts +10 -0
  589. package/dist/service/observer/status/buildModuleNodes/readTreeFile/countPlanSteps/index.js +38 -0
  590. package/dist/service/observer/status/buildModuleNodes/readTreeFile/index.d.ts +12 -0
  591. package/dist/service/observer/status/buildModuleNodes/readTreeFile/index.js +73 -0
  592. package/dist/service/observer/status/buildModuleNodes/readTreeFile/workStatuses/index.d.ts +11 -0
  593. package/dist/service/observer/status/buildModuleNodes/readTreeFile/workStatuses/index.js +7 -0
  594. package/dist/service/observer/status/buildRails/collectPipelineEvents/index.d.ts +15 -0
  595. package/dist/service/observer/status/buildRails/collectPipelineEvents/index.js +44 -0
  596. package/dist/service/observer/status/buildRails/index.d.ts +18 -0
  597. package/dist/service/observer/status/buildRails/index.js +62 -0
  598. package/dist/service/observer/status/buildRails/isOutside/index.d.ts +11 -0
  599. package/dist/service/observer/status/buildRails/isOutside/index.js +13 -0
  600. package/dist/service/observer/status/buildRails/judgeStage/index.d.ts +18 -0
  601. package/dist/service/observer/status/buildRails/judgeStage/index.js +40 -0
  602. package/dist/service/observer/status/findRunningWork/index.d.ts +18 -0
  603. package/dist/service/observer/status/findRunningWork/index.js +73 -0
  604. package/dist/service/observer/status/findWaitingFiles/index.d.ts +15 -0
  605. package/dist/service/observer/status/findWaitingFiles/index.js +80 -0
  606. package/dist/service/observer/status/foldSessions/index.d.ts +12 -0
  607. package/dist/service/observer/status/foldSessions/index.js +54 -0
  608. package/dist/service/observer/status/index.d.ts +14 -0
  609. package/dist/service/observer/status/index.js +84 -0
  610. package/dist/service/observer/status/listWorkFiles/index.d.ts +8 -0
  611. package/dist/service/observer/status/listWorkFiles/index.js +18 -0
  612. package/dist/service/observer/status/readSessionRecord/index.d.ts +9 -0
  613. package/dist/service/observer/status/readSessionRecord/index.js +58 -0
  614. package/dist/service/observer/status/shared/findCurrentPipeline/index.d.ts +18 -0
  615. package/dist/service/observer/status/shared/findCurrentPipeline/index.js +29 -0
  616. package/dist/service/observer/status/shared/findOpenPhase/index.d.ts +24 -0
  617. package/dist/service/observer/status/shared/findOpenPhase/index.js +47 -0
  618. package/dist/service/observer/status/shared/normalizeProjectPath/index.d.ts +10 -0
  619. package/dist/service/observer/status/shared/normalizeProjectPath/index.js +17 -0
  620. package/dist/service/observer/status/shared/phaseLabels/index.d.ts +19 -0
  621. package/dist/service/observer/status/shared/phaseLabels/index.js +19 -0
  622. package/dist/service/observer/status/shared/toNodeFolder/index.d.ts +6 -0
  623. package/dist/service/observer/status/shared/toNodeFolder/index.js +13 -0
  624. package/dist/service/observer/status/types/index.d.ts +240 -0
  625. package/dist/service/observer/status/types/index.js +1 -0
  626. package/dist/service/parseBrainAide/extractMarkerSections/findStructuralFault/index.d.ts +15 -0
  627. package/dist/service/parseBrainAide/extractMarkerSections/findStructuralFault/index.js +58 -0
  628. package/dist/service/parseBrainAide/extractMarkerSections/findUnknownMarker/index.d.ts +17 -0
  629. package/dist/service/parseBrainAide/extractMarkerSections/findUnknownMarker/index.js +52 -0
  630. package/dist/service/parseBrainAide/extractMarkerSections/index.d.ts +18 -0
  631. package/dist/service/parseBrainAide/extractMarkerSections/index.js +35 -0
  632. package/dist/service/parseBrainAide/extractMarkerSections/locateMarkers/index.d.ts +9 -0
  633. package/dist/service/parseBrainAide/extractMarkerSections/locateMarkers/index.js +30 -0
  634. package/dist/service/parseBrainAide/extractMarkerSections/slicePresentSections/index.d.ts +18 -0
  635. package/dist/service/parseBrainAide/extractMarkerSections/slicePresentSections/index.js +24 -0
  636. package/dist/service/parseBrainAide/extractMarkerSections/sliceSections/index.d.ts +12 -0
  637. package/dist/service/parseBrainAide/extractMarkerSections/sliceSections/index.js +19 -0
  638. package/dist/service/parseBrainAide/index.d.ts +113 -0
  639. package/dist/service/parseBrainAide/index.js +248 -0
  640. package/dist/service/parseBrainAide/parseKanbanField/index.d.ts +21 -0
  641. package/dist/service/parseBrainAide/parseKanbanField/index.js +56 -0
  642. package/dist/startServer/index.d.ts +7 -0
  643. package/dist/startServer/index.js +459 -0
  644. package/dist/tools/brain/composeOutdatedRemediation/index.d.ts +12 -0
  645. package/dist/tools/brain/composeOutdatedRemediation/index.js +24 -0
  646. package/dist/tools/brain/index.d.ts +94 -0
  647. package/dist/tools/brain/index.js +113 -0
  648. package/dist/tools/brain/listContract/index.d.ts +10 -0
  649. package/dist/tools/brain/listContract/index.js +14 -0
  650. package/dist/tools/brain/readTemplateSection/index.d.ts +17 -0
  651. package/dist/tools/brain/readTemplateSection/index.js +26 -0
  652. package/dist/tools/brain/readTemplateSection/readTemplateLauncher/index.d.ts +11 -0
  653. package/dist/tools/brain/readTemplateSection/readTemplateLauncher/index.js +22 -0
  654. package/dist/tools/brain/sectionPurpose/index.d.ts +10 -0
  655. package/dist/tools/brain/sectionPurpose/index.js +15 -0
  656. package/dist/tools/brain/selectSection/index.d.ts +14 -0
  657. package/dist/tools/brain/selectSection/index.js +19 -0
  658. package/dist/tools/brain/validateDraft/composeDraftVerdict/index.d.ts +11 -0
  659. package/dist/tools/brain/validateDraft/composeDraftVerdict/index.js +22 -0
  660. package/dist/tools/brain/validateDraft/index.d.ts +13 -0
  661. package/dist/tools/brain/validateDraft/index.js +43 -0
  662. package/dist/tools/brain/validateDraft/readDraft/index.d.ts +19 -0
  663. package/dist/tools/brain/validateDraft/readDraft/index.js +19 -0
  664. package/dist/tools/brain/validateDraft/resolveDraftPath/index.d.ts +21 -0
  665. package/dist/tools/brain/validateDraft/resolveDraftPath/index.js +34 -0
  666. package/dist/tools/cleanup/checkPreconditions/index.d.ts +20 -0
  667. package/dist/tools/cleanup/checkPreconditions/index.js +94 -0
  668. package/dist/tools/cleanup/formatReport/index.d.ts +12 -0
  669. package/dist/tools/cleanup/formatReport/index.js +94 -0
  670. package/dist/tools/cleanup/index.d.ts +25 -0
  671. package/dist/tools/cleanup/index.js +53 -0
  672. package/dist/tools/cleanup/judgeEphemeral/index.d.ts +37 -0
  673. package/dist/tools/cleanup/judgeEphemeral/index.js +47 -0
  674. package/dist/tools/cleanup/locateEphemerals/index.d.ts +16 -0
  675. package/dist/tools/cleanup/locateEphemerals/index.js +27 -0
  676. package/dist/tools/cleanup/removeEphemerals/index.d.ts +19 -0
  677. package/dist/tools/cleanup/removeEphemerals/index.js +27 -0
  678. package/dist/tools/cleanup/resolveModule/index.d.ts +20 -0
  679. package/dist/tools/cleanup/resolveModule/index.js +35 -0
  680. package/dist/tools/discover/buildAncestorChain/index.d.ts +22 -0
  681. package/dist/tools/discover/buildAncestorChain/index.js +108 -0
  682. package/dist/tools/discover/buildTree/index.d.ts +10 -0
  683. package/dist/tools/discover/buildTree/index.js +64 -0
  684. package/dist/tools/discover/index.d.ts +21 -0
  685. package/dist/tools/discover/index.js +50 -0
  686. package/dist/tools/frontmatter/checkCompletion/index.d.ts +13 -0
  687. package/dist/tools/frontmatter/checkCompletion/index.js +51 -0
  688. package/dist/tools/frontmatter/checkTransition/index.d.ts +21 -0
  689. package/dist/tools/frontmatter/checkTransition/index.js +34 -0
  690. package/dist/tools/frontmatter/classifyAideFile/index.d.ts +8 -0
  691. package/dist/tools/frontmatter/classifyAideFile/index.js +25 -0
  692. package/dist/tools/frontmatter/formatResult/index.d.ts +11 -0
  693. package/dist/tools/frontmatter/formatResult/index.js +104 -0
  694. package/dist/tools/frontmatter/governedFields/index.d.ts +31 -0
  695. package/dist/tools/frontmatter/governedFields/index.js +31 -0
  696. package/dist/tools/frontmatter/index.d.ts +27 -0
  697. package/dist/tools/frontmatter/index.js +163 -0
  698. package/dist/tools/frontmatter/readGovernedValue/index.d.ts +16 -0
  699. package/dist/tools/frontmatter/readGovernedValue/index.js +159 -0
  700. package/dist/tools/frontmatter/resolveTarget/index.d.ts +23 -0
  701. package/dist/tools/frontmatter/resolveTarget/index.js +30 -0
  702. package/dist/tools/frontmatter/rewriteFieldLine/index.d.ts +18 -0
  703. package/dist/tools/frontmatter/rewriteFieldLine/index.js +16 -0
  704. package/dist/tools/frontmatter/types/index.d.ts +134 -0
  705. package/dist/tools/frontmatter/types/index.js +1 -0
  706. package/dist/tools/info/index.d.ts +40 -0
  707. package/dist/tools/info/index.js +60 -0
  708. package/dist/tools/info/resolveBehind/fetchPublishedVersions/index.d.ts +10 -0
  709. package/dist/tools/info/resolveBehind/fetchPublishedVersions/index.js +34 -0
  710. package/dist/tools/info/resolveBehind/index.d.ts +12 -0
  711. package/dist/tools/info/resolveBehind/index.js +44 -0
  712. package/dist/tools/info/resolveBehind/listSkippedVersions/index.d.ts +7 -0
  713. package/dist/tools/info/resolveBehind/listSkippedVersions/index.js +21 -0
  714. package/dist/tools/info/resolveBehind/readAideLaunchMode/index.d.ts +8 -0
  715. package/dist/tools/info/resolveBehind/readAideLaunchMode/index.js +24 -0
  716. package/dist/tools/info/resolveBehind/resolveHighlights/fetchChangelog/index.d.ts +9 -0
  717. package/dist/tools/info/resolveBehind/resolveHighlights/fetchChangelog/index.js +23 -0
  718. package/dist/tools/info/resolveBehind/resolveHighlights/index.d.ts +7 -0
  719. package/dist/tools/info/resolveBehind/resolveHighlights/index.js +16 -0
  720. package/dist/tools/info/resolveBehind/resolveHighlights/pickHighlights/index.d.ts +7 -0
  721. package/dist/tools/info/resolveBehind/resolveHighlights/pickHighlights/index.js +21 -0
  722. package/dist/tools/info/resolveBehind/resolveHighlights/pickHighlights/readReleaseBullets/index.d.ts +9 -0
  723. package/dist/tools/info/resolveBehind/resolveHighlights/pickHighlights/readReleaseBullets/index.js +50 -0
  724. package/dist/tools/info/resolveBehind/resolveHighlights/pickHighlights/toOneLine/index.d.ts +6 -0
  725. package/dist/tools/info/resolveBehind/resolveHighlights/pickHighlights/toOneLine/index.js +24 -0
  726. package/dist/tools/info/resolveOutdated/detectStaleHooks/index.d.ts +17 -0
  727. package/dist/tools/info/resolveOutdated/detectStaleHooks/index.js +28 -0
  728. package/dist/tools/info/resolveOutdated/index.d.ts +13 -0
  729. package/dist/tools/info/resolveOutdated/index.js +18 -0
  730. package/dist/tools/info/resolveOutdated/listStaleFiles/index.d.ts +7 -0
  731. package/dist/tools/info/resolveOutdated/listStaleFiles/index.js +30 -0
  732. package/dist/tools/inspect/index.d.ts +24 -0
  733. package/dist/tools/inspect/index.js +47 -0
  734. package/dist/tools/inspect/parseSymbols/index.d.ts +21 -0
  735. package/dist/tools/inspect/parseSymbols/index.js +213 -0
  736. package/dist/tools/inspect/walk/index.d.ts +8 -0
  737. package/dist/tools/inspect/walk/index.js +31 -0
  738. package/dist/tools/observer/endSession/formatReply/index.d.ts +9 -0
  739. package/dist/tools/observer/endSession/formatReply/index.js +23 -0
  740. package/dist/tools/observer/endSession/index.d.ts +21 -0
  741. package/dist/tools/observer/endSession/index.js +31 -0
  742. package/dist/tools/observer/endSession/types/index.d.ts +10 -0
  743. package/dist/tools/observer/endSession/types/index.js +1 -0
  744. package/dist/tools/observer/event/formatReply/index.d.ts +10 -0
  745. package/dist/tools/observer/event/formatReply/index.js +28 -0
  746. package/dist/tools/observer/event/index.d.ts +9 -0
  747. package/dist/tools/observer/event/index.js +11 -0
  748. package/dist/tools/observer/shared/tryBind/index.d.ts +13 -0
  749. package/dist/tools/observer/shared/tryBind/index.js +31 -0
  750. package/dist/tools/observer/start/awaitObserver/index.d.ts +16 -0
  751. package/dist/tools/observer/start/awaitObserver/index.js +75 -0
  752. package/dist/tools/observer/start/awaitOwnLink/index.d.ts +12 -0
  753. package/dist/tools/observer/start/awaitOwnLink/index.js +24 -0
  754. package/dist/tools/observer/start/checkProject/index.d.ts +18 -0
  755. package/dist/tools/observer/start/checkProject/index.js +45 -0
  756. package/dist/tools/observer/start/findOpenSessions/index.d.ts +18 -0
  757. package/dist/tools/observer/start/findOpenSessions/index.js +53 -0
  758. package/dist/tools/observer/start/formatReply/describeOpenSession/index.d.ts +7 -0
  759. package/dist/tools/observer/start/formatReply/describeOpenSession/index.js +13 -0
  760. package/dist/tools/observer/start/formatReply/index.d.ts +6 -0
  761. package/dist/tools/observer/start/formatReply/index.js +43 -0
  762. package/dist/tools/observer/start/index.d.ts +27 -0
  763. package/dist/tools/observer/start/index.js +87 -0
  764. package/dist/tools/observer/start/launchObserver/index.d.ts +17 -0
  765. package/dist/tools/observer/start/launchObserver/index.js +23 -0
  766. package/dist/tools/observer/start/markClosedSessions/index.d.ts +16 -0
  767. package/dist/tools/observer/start/markClosedSessions/index.js +49 -0
  768. package/dist/tools/observer/start/moveLegacyHistory/index.d.ts +10 -0
  769. package/dist/tools/observer/start/moveLegacyHistory/index.js +26 -0
  770. package/dist/tools/observer/start/types/index.d.ts +82 -0
  771. package/dist/tools/observer/start/types/index.js +1 -0
  772. package/dist/tools/observer/start/walkPorts/index.d.ts +15 -0
  773. package/dist/tools/observer/start/walkPorts/index.js +17 -0
  774. package/dist/tools/read/index.d.ts +15 -0
  775. package/dist/tools/read/index.js +79 -0
  776. package/dist/tools/scaffold/hasIntentSpec/index.d.ts +7 -0
  777. package/dist/tools/scaffold/hasIntentSpec/index.js +9 -0
  778. package/dist/tools/scaffold/index.d.ts +33 -0
  779. package/dist/tools/scaffold/index.js +216 -0
  780. package/dist/tools/scaffold/placeRootIntent/index.d.ts +17 -0
  781. package/dist/tools/scaffold/placeRootIntent/index.js +24 -0
  782. package/dist/tools/scaffold/resolveSpecFolder/index.d.ts +17 -0
  783. package/dist/tools/scaffold/resolveSpecFolder/index.js +21 -0
  784. package/dist/tools/scaffold/sessionTemplate/index.d.ts +9 -0
  785. package/dist/tools/scaffold/sessionTemplate/index.js +40 -0
  786. package/dist/tools/scaffold/writeIfAbsent/index.d.ts +10 -0
  787. package/dist/tools/scaffold/writeIfAbsent/index.js +21 -0
  788. package/dist/tools/upgrade/applyFiles/index.d.ts +49 -0
  789. package/dist/tools/upgrade/applyFiles/index.js +91 -0
  790. package/dist/tools/upgrade/applyFiles/movePin/changesOnlyThePin/index.d.ts +11 -0
  791. package/dist/tools/upgrade/applyFiles/movePin/changesOnlyThePin/index.js +23 -0
  792. package/dist/tools/upgrade/applyFiles/movePin/index.d.ts +14 -0
  793. package/dist/tools/upgrade/applyFiles/movePin/index.js +56 -0
  794. package/dist/tools/upgrade/applyFiles/movePin/locatePinToken/index.d.ts +16 -0
  795. package/dist/tools/upgrade/applyFiles/movePin/locatePinToken/index.js +30 -0
  796. package/dist/tools/upgrade/applyFiles/switchToGlobal/changesOnlyTheLaunch/index.d.ts +12 -0
  797. package/dist/tools/upgrade/applyFiles/switchToGlobal/changesOnlyTheLaunch/index.js +27 -0
  798. package/dist/tools/upgrade/applyFiles/switchToGlobal/index.d.ts +16 -0
  799. package/dist/tools/upgrade/applyFiles/switchToGlobal/index.js +78 -0
  800. package/dist/tools/upgrade/applyFiles/switchToGlobal/locateLaunchTokens/index.d.ts +21 -0
  801. package/dist/tools/upgrade/applyFiles/switchToGlobal/locateLaunchTokens/index.js +36 -0
  802. package/dist/tools/upgrade/brainCategory/applyChange/index.d.ts +21 -0
  803. package/dist/tools/upgrade/brainCategory/applyChange/index.js +64 -0
  804. package/dist/tools/upgrade/brainCategory/applyChange/yieldsExpectedConfig/index.d.ts +12 -0
  805. package/dist/tools/upgrade/brainCategory/applyChange/yieldsExpectedConfig/index.js +25 -0
  806. package/dist/tools/upgrade/brainCategory/index.d.ts +19 -0
  807. package/dist/tools/upgrade/brainCategory/index.js +28 -0
  808. package/dist/tools/upgrade/brainCategory/insertMissingSections/index.d.ts +15 -0
  809. package/dist/tools/upgrade/brainCategory/insertMissingSections/index.js +62 -0
  810. package/dist/tools/upgrade/brainCategory/insertMissingSections/spliceRepairs/index.d.ts +25 -0
  811. package/dist/tools/upgrade/brainCategory/insertMissingSections/spliceRepairs/index.js +36 -0
  812. package/dist/tools/upgrade/brainCategory/previewChange/index.d.ts +16 -0
  813. package/dist/tools/upgrade/brainCategory/previewChange/index.js +61 -0
  814. package/dist/tools/upgrade/brainCategory/shared/buildChangeOffer/buildLauncherOffer/index.d.ts +20 -0
  815. package/dist/tools/upgrade/brainCategory/shared/buildChangeOffer/buildLauncherOffer/index.js +54 -0
  816. package/dist/tools/upgrade/brainCategory/shared/buildChangeOffer/buildLauncherOffer/rewriteLauncherArgs/index.d.ts +19 -0
  817. package/dist/tools/upgrade/brainCategory/shared/buildChangeOffer/buildLauncherOffer/rewriteLauncherArgs/index.js +61 -0
  818. package/dist/tools/upgrade/brainCategory/shared/buildChangeOffer/buildLauncherOffer/rewriteLauncherArgs/locateArgLines/index.d.ts +11 -0
  819. package/dist/tools/upgrade/brainCategory/shared/buildChangeOffer/buildLauncherOffer/rewriteLauncherArgs/locateArgLines/index.js +49 -0
  820. package/dist/tools/upgrade/brainCategory/shared/buildChangeOffer/buildLauncherOffer/rewriteLauncherArgs/renderArgLine/index.d.ts +6 -0
  821. package/dist/tools/upgrade/brainCategory/shared/buildChangeOffer/buildLauncherOffer/rewriteLauncherArgs/renderArgLine/index.js +8 -0
  822. package/dist/tools/upgrade/brainCategory/shared/buildChangeOffer/buildLauncherOffer/rewriteLauncherCommand/index.d.ts +13 -0
  823. package/dist/tools/upgrade/brainCategory/shared/buildChangeOffer/buildLauncherOffer/rewriteLauncherCommand/index.js +27 -0
  824. package/dist/tools/upgrade/brainCategory/shared/buildChangeOffer/buildSectionOffer/index.d.ts +19 -0
  825. package/dist/tools/upgrade/brainCategory/shared/buildChangeOffer/buildSectionOffer/index.js +58 -0
  826. package/dist/tools/upgrade/brainCategory/shared/buildChangeOffer/index.d.ts +13 -0
  827. package/dist/tools/upgrade/brainCategory/shared/buildChangeOffer/index.js +19 -0
  828. package/dist/tools/upgrade/brainCategory/shared/changedSinceDiff/index.d.ts +3 -0
  829. package/dist/tools/upgrade/brainCategory/shared/changedSinceDiff/index.js +4 -0
  830. package/dist/tools/upgrade/brainCategory/shared/detectLineEnding/index.d.ts +6 -0
  831. package/dist/tools/upgrade/brainCategory/shared/detectLineEnding/index.js +9 -0
  832. package/dist/tools/upgrade/brainCategory/shared/hashBytes/index.d.ts +7 -0
  833. package/dist/tools/upgrade/brainCategory/shared/hashBytes/index.js +10 -0
  834. package/dist/tools/upgrade/brainCategory/shared/invalidResultInstructions/index.d.ts +5 -0
  835. package/dist/tools/upgrade/brainCategory/shared/invalidResultInstructions/index.js +7 -0
  836. package/dist/tools/upgrade/brainCategory/shared/locateFrontmatter/index.d.ts +19 -0
  837. package/dist/tools/upgrade/brainCategory/shared/locateFrontmatter/index.js +27 -0
  838. package/dist/tools/upgrade/brainCategory/shared/locateSection/index.d.ts +16 -0
  839. package/dist/tools/upgrade/brainCategory/shared/locateSection/index.js +19 -0
  840. package/dist/tools/upgrade/brainCategory/shared/readBrainConfig/index.d.ts +12 -0
  841. package/dist/tools/upgrade/brainCategory/shared/readBrainConfig/index.js +22 -0
  842. package/dist/tools/upgrade/brainCategory/shared/readChangeBefore/index.d.ts +13 -0
  843. package/dist/tools/upgrade/brainCategory/shared/readChangeBefore/index.js +17 -0
  844. package/dist/tools/upgrade/brainCategory/shared/refuseUnusableConfig/index.d.ts +13 -0
  845. package/dist/tools/upgrade/brainCategory/shared/refuseUnusableConfig/index.js +30 -0
  846. package/dist/tools/upgrade/brainCategory/shared/toLineEnding/index.d.ts +9 -0
  847. package/dist/tools/upgrade/brainCategory/shared/toLineEnding/index.js +8 -0
  848. package/dist/tools/upgrade/buildVersionsMeta/assertFullClone/index.d.ts +14 -0
  849. package/dist/tools/upgrade/buildVersionsMeta/assertFullClone/index.js +27 -0
  850. package/dist/tools/upgrade/buildVersionsMeta/enumerateArtifacts/index.d.ts +23 -0
  851. package/dist/tools/upgrade/buildVersionsMeta/enumerateArtifacts/index.js +62 -0
  852. package/dist/tools/upgrade/buildVersionsMeta/index.d.ts +17 -0
  853. package/dist/tools/upgrade/buildVersionsMeta/index.js +26 -0
  854. package/dist/tools/upgrade/checkBrainConfig/index.d.ts +29 -0
  855. package/dist/tools/upgrade/checkBrainConfig/index.js +67 -0
  856. package/dist/tools/upgrade/checkHooksConfig/index.d.ts +30 -0
  857. package/dist/tools/upgrade/checkHooksConfig/index.js +72 -0
  858. package/dist/tools/upgrade/checkIdeConfig/index.d.ts +24 -0
  859. package/dist/tools/upgrade/checkIdeConfig/index.js +134 -0
  860. package/dist/tools/upgrade/checkMcpConfig/index.d.ts +37 -0
  861. package/dist/tools/upgrade/checkMcpConfig/index.js +172 -0
  862. package/dist/tools/upgrade/checkMcpConfig/isCanonicalGlobalAideEntry/index.d.ts +10 -0
  863. package/dist/tools/upgrade/checkMcpConfig/isCanonicalGlobalAideEntry/index.js +17 -0
  864. package/dist/tools/upgrade/checkMcpConfig/isPinBehind/index.d.ts +9 -0
  865. package/dist/tools/upgrade/checkMcpConfig/isPinBehind/index.js +18 -0
  866. package/dist/tools/upgrade/checkReference/index.d.ts +12 -0
  867. package/dist/tools/upgrade/checkReference/index.js +28 -0
  868. package/dist/tools/upgrade/compareFile/index.d.ts +12 -0
  869. package/dist/tools/upgrade/compareFile/index.js +24 -0
  870. package/dist/tools/upgrade/index.d.ts +51 -0
  871. package/dist/tools/upgrade/index.js +216 -0
  872. package/dist/tools/upgrade/resolveProjectRoot/index.d.ts +7 -0
  873. package/dist/tools/upgrade/resolveProjectRoot/index.js +12 -0
  874. package/dist/tools/upgrade/shared/readAidePin/index.d.ts +9 -0
  875. package/dist/tools/upgrade/shared/readAidePin/index.js +24 -0
  876. package/dist/tools/upgrade/spliceStub/index.d.ts +13 -0
  877. package/dist/tools/upgrade/spliceStub/index.js +91 -0
  878. package/dist/tools/validate/checkAlignment/index.d.ts +15 -0
  879. package/dist/tools/validate/checkAlignment/index.js +42 -0
  880. package/dist/tools/validate/checkPlanSpec/index.d.ts +9 -0
  881. package/dist/tools/validate/checkPlanSpec/index.js +27 -0
  882. package/dist/tools/validate/index.d.ts +20 -0
  883. package/dist/tools/validate/index.js +91 -0
  884. package/dist/types/index.d.ts +1366 -0
  885. package/dist/types/index.js +1 -0
  886. package/dist/util/baseName/index.d.ts +6 -0
  887. package/dist/util/baseName/index.js +9 -0
  888. package/dist/util/buildTreeData/index.d.ts +7 -0
  889. package/dist/util/buildTreeData/index.js +51 -0
  890. package/dist/util/checkboxPattern/index.d.ts +9 -0
  891. package/dist/util/checkboxPattern/index.js +9 -0
  892. package/dist/util/classify/holdsCode/index.d.ts +6 -0
  893. package/dist/util/classify/holdsCode/index.js +31 -0
  894. package/dist/util/classify/holdsCode/isCodeFile/index.d.ts +2 -0
  895. package/dist/util/classify/holdsCode/isCodeFile/index.js +11 -0
  896. package/dist/util/classify/index.d.ts +17 -0
  897. package/dist/util/classify/index.js +163 -0
  898. package/dist/util/countCheckboxes/index.d.ts +16 -0
  899. package/dist/util/countCheckboxes/index.js +29 -0
  900. package/dist/util/describeError/index.d.ts +7 -0
  901. package/dist/util/describeError/index.js +7 -0
  902. package/dist/util/firstLine/index.d.ts +10 -0
  903. package/dist/util/firstLine/index.js +17 -0
  904. package/dist/util/isProcessRunning/index.d.ts +10 -0
  905. package/dist/util/isProcessRunning/index.js +22 -0
  906. package/dist/util/isVersionBehind/index.d.ts +6 -0
  907. package/dist/util/isVersionBehind/index.js +23 -0
  908. package/dist/util/parseBody/index.d.ts +7 -0
  909. package/dist/util/parseBody/index.js +43 -0
  910. package/dist/util/parseFrontmatter/index.d.ts +14 -0
  911. package/dist/util/parseFrontmatter/index.js +66 -0
  912. package/dist/util/readPackageVersion/index.d.ts +6 -0
  913. package/dist/util/readPackageVersion/index.js +24 -0
  914. package/dist/util/runtimePaths/create/index.d.ts +11 -0
  915. package/dist/util/runtimePaths/create/index.js +17 -0
  916. package/dist/util/runtimePaths/createRoot/index.d.ts +7 -0
  917. package/dist/util/runtimePaths/createRoot/index.js +13 -0
  918. package/dist/util/runtimePaths/isProjectKey/index.d.ts +7 -0
  919. package/dist/util/runtimePaths/isProjectKey/index.js +18 -0
  920. package/dist/util/runtimePaths/listProjectFolders/index.d.ts +10 -0
  921. package/dist/util/runtimePaths/listProjectFolders/index.js +28 -0
  922. package/dist/util/runtimePaths/moveLegacyRoot/compareFiles/index.d.ts +11 -0
  923. package/dist/util/runtimePaths/moveLegacyRoot/compareFiles/index.js +27 -0
  924. package/dist/util/runtimePaths/moveLegacyRoot/index.d.ts +13 -0
  925. package/dist/util/runtimePaths/moveLegacyRoot/index.js +85 -0
  926. package/dist/util/runtimePaths/moveLegacyRoot/moveLog/index.d.ts +15 -0
  927. package/dist/util/runtimePaths/moveLegacyRoot/moveLog/index.js +47 -0
  928. package/dist/util/runtimePaths/moveLegacyRoot/moveRecord/index.d.ts +13 -0
  929. package/dist/util/runtimePaths/moveLegacyRoot/moveRecord/index.js +29 -0
  930. package/dist/util/runtimePaths/moveLegacyRoot/publishCopy/index.d.ts +13 -0
  931. package/dist/util/runtimePaths/moveLegacyRoot/publishCopy/index.js +38 -0
  932. package/dist/util/runtimePaths/moveLegacyRoot/removeEmptyFolders/index.d.ts +8 -0
  933. package/dist/util/runtimePaths/moveLegacyRoot/removeEmptyFolders/index.js +11 -0
  934. package/dist/util/runtimePaths/moveLegacyRoot/resolveLegacyRoot/index.d.ts +9 -0
  935. package/dist/util/runtimePaths/moveLegacyRoot/resolveLegacyRoot/index.js +23 -0
  936. package/dist/util/runtimePaths/moveLegacyRoot/shared/isGone/index.d.ts +4 -0
  937. package/dist/util/runtimePaths/moveLegacyRoot/shared/isGone/index.js +9 -0
  938. package/dist/util/runtimePaths/moveLegacyRoot/shared/unlinkIfPresent/index.d.ts +4 -0
  939. package/dist/util/runtimePaths/moveLegacyRoot/shared/unlinkIfPresent/index.js +8 -0
  940. package/dist/util/runtimePaths/resolve/index.d.ts +9 -0
  941. package/dist/util/runtimePaths/resolve/index.js +31 -0
  942. package/dist/util/runtimePaths/resolve/nameProjectFolder/index.d.ts +10 -0
  943. package/dist/util/runtimePaths/resolve/nameProjectFolder/index.js +23 -0
  944. package/dist/util/runtimePaths/resolveArchivedLog/index.d.ts +9 -0
  945. package/dist/util/runtimePaths/resolveArchivedLog/index.js +19 -0
  946. package/dist/util/runtimePaths/resolveEndedMark/index.d.ts +11 -0
  947. package/dist/util/runtimePaths/resolveEndedMark/index.js +21 -0
  948. package/dist/util/runtimePaths/resolveEventLog/index.d.ts +10 -0
  949. package/dist/util/runtimePaths/resolveEventLog/index.js +20 -0
  950. package/dist/util/runtimePaths/resolvePresenceFile/index.d.ts +11 -0
  951. package/dist/util/runtimePaths/resolvePresenceFile/index.js +21 -0
  952. package/dist/util/runtimePaths/resolveRoot/index.d.ts +8 -0
  953. package/dist/util/runtimePaths/resolveRoot/index.js +13 -0
  954. package/dist/util/runtimePaths/resolveSessionLog/index.d.ts +11 -0
  955. package/dist/util/runtimePaths/resolveSessionLog/index.js +21 -0
  956. package/dist/util/runtimePaths/shared/isSessionId/index.d.ts +8 -0
  957. package/dist/util/runtimePaths/shared/isSessionId/index.js +10 -0
  958. package/dist/util/runtimePaths/shared/pickPathModule/index.d.ts +8 -0
  959. package/dist/util/runtimePaths/shared/pickPathModule/index.js +11 -0
  960. package/dist/util/runtimePaths/shared/projectKeyHash/index.d.ts +7 -0
  961. package/dist/util/runtimePaths/shared/projectKeyHash/index.js +7 -0
  962. package/dist/util/runtimePaths/shared/resolveAppDataRoot/index.d.ts +12 -0
  963. package/dist/util/runtimePaths/shared/resolveAppDataRoot/index.js +32 -0
  964. package/dist/util/runtimePaths/shared/runtimeNames/index.d.ts +20 -0
  965. package/dist/util/runtimePaths/shared/runtimeNames/index.js +20 -0
  966. package/dist/util/runtimePaths/types/index.d.ts +55 -0
  967. package/dist/util/runtimePaths/types/index.js +1 -0
  968. package/dist/util/scan/index.d.ts +12 -0
  969. package/dist/util/scan/index.js +228 -0
  970. package/dist/util/sessionQuietLimit/index.d.ts +9 -0
  971. package/dist/util/sessionQuietLimit/index.js +9 -0
  972. package/dist/util/skipDirs/index.d.ts +7 -0
  973. package/dist/util/skipDirs/index.js +15 -0
  974. package/dist/util/timeUnits/index.d.ts +15 -0
  975. package/dist/util/timeUnits/index.js +15 -0
  976. package/dist/versions.json +330 -0
  977. package/package.json +83 -5
@@ -0,0 +1,1366 @@
1
+ import type { BrainSectionContractEntry, BrainSectionField, BrainSectionMarker } from "../service/brainContract/index.js";
2
+ import type { AlignmentValue, WorkStatus } from "../tools/frontmatter/types/index.js";
3
+ import type { HookEventName } from "../service/observer/event/types/index.js";
4
+ export type { BrainSectionContractEntry, BrainSectionField, BrainSectionMarker } from "../service/brainContract/index.js";
5
+ export type { GovernedKind, GovernedField, AlignmentValue, WorkStatus } from "../tools/frontmatter/types/index.js";
6
+ export type { ObserverEventInput, ObserverEvent, SessionStartedEvent } from "../service/observer/event/shared/schema/index.js";
7
+ export type { ObserverRecord } from "../service/observer/event/shared/observerRecord/index.js";
8
+ export type { EndedMark } from "../service/observer/event/shared/endedMark/index.js";
9
+ export type { Presence } from "../service/observer/event/shared/presenceRecord/index.js";
10
+ export type { RecordOutcome, SessionLog, DeleteOutcome, ProjectLog, SessionLiveness, UnlinkedPresence, LivenessReport, RawSessionLog, HookEventName, TouchPresenceInput, TouchOutcome, EndSessionOutcome, ConversationRef, CallerConversation, MarkClosedOutcome, ReopenOutcome } from "../service/observer/event/types/index.js";
11
+ export type { BoardColumnId, ReportedLocation, BoardUnavailable, BoardTask, BoardColumn, Board, BoardResult, TaskReadResult } from "../service/observer/kanban/types/index.js";
12
+ export type { Phase, StatusInput, FileProgress, TreeFileEntry, TreeFileKind, ModuleNode, WorkFileEntry, SessionRecord, SessionSummary, RunningWork, WaitingFile, RailPhaseState, RailPhase, PipelineRail, HistoryRow, StatusPart, StatusProblem, Status } from "../service/observer/status/types/index.js";
13
+ /** The four .aide spec types: intent, research, plan, todo. */
14
+ export type AideFileType = "intent" | "research" | "todo" | "plan";
15
+ /** Parsed YAML frontmatter from an .aide file. */
16
+ export interface AideFrontmatter {
17
+ /** Module scope label (e.g. ".", "cli", "tools/discover"). */
18
+ scope?: string;
19
+ /** One-line purpose statement. Makes ancestor chains in aide_discover self-contained. */
20
+ description?: string;
21
+ /** Human-readable intent statement for this module. */
22
+ intent?: string;
23
+ /** Desired and undesired outcome lists. */
24
+ outcomes?: {
25
+ desired: string[];
26
+ undesired: string[];
27
+ };
28
+ }
29
+ /** A parsed body section split on `##` headings. */
30
+ export interface BodySection {
31
+ /** The heading text without the `## ` prefix. */
32
+ heading: string;
33
+ /** Full section content (everything between this heading and the next). */
34
+ content: string;
35
+ /** First sentence or paragraph-count summary. */
36
+ summary: string;
37
+ }
38
+ /** A discovered .aide file with metadata. */
39
+ export interface AideFile {
40
+ /** Absolute path to the file. */
41
+ path: string;
42
+ /** Path relative to the project root, POSIX-normalized. */
43
+ relativePath: string;
44
+ /** Classified type based on filename. */
45
+ type: AideFileType;
46
+ /** First ~80 chars of the first paragraph, for tree summaries. */
47
+ summary: string;
48
+ /** Frontmatter description field — one-line human-readable summary. Empty string when absent. */
49
+ description?: string;
50
+ /** Alignment from frontmatter — set only for intent specs, read under either the `alignment` key or the older `status` name. */
51
+ alignment?: AlignmentValue;
52
+ /** Work status from frontmatter — set only for plan.aide and todo.aide. */
53
+ workStatus?: WorkStatus;
54
+ /** YAML parse error message — present only when frontmatter failed to parse. */
55
+ parseError?: string;
56
+ }
57
+ /** Result of scanning a directory tree for .aide files. */
58
+ export interface ScanResult {
59
+ /** Project root that was scanned. */
60
+ root: string;
61
+ /** All discovered .aide files. */
62
+ files: AideFile[];
63
+ }
64
+ /** A validation warning found by aide_validate. */
65
+ export interface ValidationWarning {
66
+ /** Category of the warning. */
67
+ kind: "orphaned-spec" | "missing-spec" | "naming-conflict" | "broken-link" | "orphaned-research" | "missing-description" | "parse-error" | "missing-alignment" | "invalid-alignment" | "plan-without-spec";
68
+ /** Path relative to project root where the issue was found. */
69
+ path: string;
70
+ /** Human-readable description of the issue. */
71
+ message: string;
72
+ }
73
+ /** Result of validating a project's .aide files. */
74
+ export interface ValidationResult {
75
+ /** Project root that was validated. */
76
+ root: string;
77
+ /** All warnings found. */
78
+ warnings: ValidationWarning[];
79
+ }
80
+ /** Context returned alongside a read .aide file. */
81
+ export interface ReadResult {
82
+ /** Full file content. */
83
+ content: string;
84
+ /** Classified type. */
85
+ type: AideFileType;
86
+ /** Related specs in the same directory. */
87
+ siblings: AideFile[];
88
+ /** Links found in the content (relative paths, wikilinks, URLs). */
89
+ links: string[];
90
+ }
91
+ /** Supported agent frameworks for aide_init. */
92
+ export type FrameworkType = "claude" | "cursor" | "windsurf" | "copilot";
93
+ /** How an MCP server entry launches. Global runs the installed command; local runs it through npx. */
94
+ export type LaunchMode = "global" | "local";
95
+ /** Whether a package is installed globally, and the command that would install it. */
96
+ export type GlobalPackageStatus = {
97
+ name: string;
98
+ installed: boolean;
99
+ installCommand: string;
100
+ };
101
+ /**
102
+ * An npx-launched aide entry's switch to the global `aidemd-mcp` command, reported
103
+ * by aide_upgrade's mcp step. `key` is the MCP key that holds the entry (never
104
+ * renamed), `installed` whether `@aidemd-mcp/aidemd` is installed globally, and
105
+ * `installCommand` what installs it. The tool writes the switch only once the
106
+ * package is installed.
107
+ */
108
+ export type McpGlobalSwitch = GlobalPackageStatus & {
109
+ key: "aide" | "aidemd-mcp";
110
+ };
111
+ /**
112
+ * The running aide server is behind the latest published version. `installed`
113
+ * is the version actually running (a pin edited but not yet restarted still
114
+ * reports the old running version, which is accurate). `launch` names how the
115
+ * project's aide entry launches it, so the caller offers the matching remedy
116
+ * (`"global"`: update the global install; `"local"`: an npx launch, pinned or
117
+ * unpinned, whose pin moves to `latest`). `versionsBehind` and `highlights`
118
+ * come from the published release history, which the running server has never
119
+ * seen.
120
+ */
121
+ export type BehindNotice = {
122
+ /** The running server's own version, for every launch kind. */
123
+ installed: string;
124
+ /** The latest published version (the registry's `latest` dist-tag). */
125
+ latest: string;
126
+ /** How the project's aide entry launches the server. */
127
+ launch: LaunchMode;
128
+ /** Published `x.y.z` releases after `installed` up to and including `latest`; always 1 or more. */
129
+ versionsBehind: number;
130
+ /** 0 to 3 one-line highlights of what those releases added, fixed or changed; empty when the notes could not be fetched or held nothing to pick. */
131
+ highlights: string[];
132
+ };
133
+ /** The registry's latest dist-tag and every published version string, read in one request by aide_info; `latest` is always one of `versions`. */
134
+ export type PublishedVersions = {
135
+ latest: string;
136
+ versions: string[];
137
+ };
138
+ /** The Keep a Changelog subsections a version notice may draw highlights from, in no particular order (the rank lives with the picker). */
139
+ export type ReleaseNoteHeading = "Added" | "Fixed" | "Changed";
140
+ /** One top-level changelog bullet under a versioned release heading and one of the highlight subsections, `[migration]` bullets excluded; `text` is the bullet without its leading `- `. */
141
+ export type ReleaseNoteBullet = {
142
+ version: string;
143
+ heading: ReleaseNoteHeading;
144
+ text: string;
145
+ };
146
+ /** Resolved paths for a detected agent framework. */
147
+ export interface FrameworkConfig {
148
+ /** Which framework was detected (or overridden). */
149
+ framework: FrameworkType;
150
+ /** Path to the agent config file relative to project root (e.g., "CLAUDE.md"). */
151
+ configPath: string;
152
+ /** Directory for slash command files relative to project root. */
153
+ commandDir: string;
154
+ /** Path to MCP config file relative to project root. */
155
+ mcpConfigPath: string;
156
+ /**
157
+ * Directory for the host-side AIDE methodology doc directory, relative to
158
+ * the project root. The sibling helpers `writeMethodology` and
159
+ * `installMethodologyDocs` both derive the host-side doc directory location
160
+ * from this single field — the stub names the path, the installer writes into
161
+ * it, and any disagreement between the two sides would send agents to an
162
+ * empty directory. Editing this value is the one-place change for the
163
+ * host-side doc directory location across the init subtree.
164
+ */
165
+ docHubDir: string;
166
+ /** Directory for agent files relative to project root. */
167
+ agentDir: string;
168
+ /** Directory for skill files relative to project root. */
169
+ skillDir: string;
170
+ }
171
+ /**
172
+ * A single MCP server prescription returned by init and upgrade.
173
+ * Represents the key name and server entry the MCP config needs.
174
+ * The calling agent reads the existing config, merges this entry, and writes.
175
+ */
176
+ export interface McpPrescription {
177
+ /** The mcpServers key name (e.g. "aide", "brain"). */
178
+ key: string;
179
+ /**
180
+ * The server entry to merge into mcpServers. `args` is `(string | null)[]` — null
181
+ * entries at any index are the explicit unwired-slot signal forwarded verbatim from
182
+ * brain.aide via parseBrainAide + interpolateArgs. Sync refuses to write a null-bearing
183
+ * entry; the null must be filled by the user before sync runs.
184
+ */
185
+ entry: {
186
+ command: string;
187
+ args: (string | null)[];
188
+ };
189
+ }
190
+ /**
191
+ * The aide entry's npx version pin moving to a version the caller named. `from`
192
+ * is the version in the entry's package spec today, or null when the spec
193
+ * carries none (`@aidemd-mcp/aidemd` bare); it may be a non-exact tag or range
194
+ * such as `latest`. `to` is the exact `x.y.z` the caller named. Reported by
195
+ * aide_upgrade's mcp step; it never carries MCP config text.
196
+ */
197
+ export type McpPinMove = {
198
+ from: string | null;
199
+ to: string;
200
+ };
201
+ /**
202
+ * One matcher group of a Claude Code `hooks.<event>` array. `timeout` is in
203
+ * seconds. Produced by install's `mergeLocal/aideHookEntries`; consumed by
204
+ * `mergeLocal` and `stripProject` when they read and write hook entries.
205
+ */
206
+ export type HookMatcherGroup = {
207
+ matcher?: string;
208
+ hooks: {
209
+ type: "command";
210
+ command: string;
211
+ timeout?: number;
212
+ }[];
213
+ };
214
+ /**
215
+ * The three files the hooks category may touch: `.claude/settings.local.json`
216
+ * (`local`), `.claude/settings.json` (`project`) and `.gitignore` (`gitignore`).
217
+ * Consumed by `HooksFilePlan` and `HooksCategoryPlan`.
218
+ */
219
+ export type HooksSettingsFile = "local" | "project" | "gitignore";
220
+ /**
221
+ * The plan for one file of the hooks category. `filePath` is absolute. `content`
222
+ * is present only on `create` and `update` and is the whole new file. `tracked`
223
+ * is present only on the `local` entry: whether git tracks that file. Produced by
224
+ * install's `planHooks`; consumed by `installHooks` and `checkHooksConfig`.
225
+ */
226
+ export type HooksFilePlan = {
227
+ file: HooksSettingsFile;
228
+ filePath: string;
229
+ change: "create" | "update" | "none";
230
+ content?: string;
231
+ tracked?: boolean;
232
+ };
233
+ /**
234
+ * The hooks category's plan, discriminated on `state`. `no-global-install`:
235
+ * the package is not installed globally, `filePath` is the local settings file
236
+ * and nothing was read. `malformed`: every malformed settings file, local first,
237
+ * and nothing is planned. `planned`: the local file always, then the project
238
+ * file, then `.gitignore`, the last two only when they change. Produced by
239
+ * install's `shared/planHooks`, the one planner for install (`installHooks`),
240
+ * upgrade (`checkHooksConfig`) and, through upgrade, `aide_info`.
241
+ */
242
+ export type HooksCategoryPlan = {
243
+ state: "no-global-install";
244
+ filePath: string;
245
+ globalPackage: GlobalPackageStatus;
246
+ } | {
247
+ state: "malformed";
248
+ files: {
249
+ file: Exclude<HooksSettingsFile, "gitignore">;
250
+ filePath: string;
251
+ reason: string;
252
+ }[];
253
+ } | {
254
+ state: "planned";
255
+ files: HooksFilePlan[];
256
+ };
257
+ /**
258
+ * The local settings file's merge plan, discriminated on `state`. `merged` is
259
+ * the whole new file text; the events of `outdated` are those with no current
260
+ * AIDE hook. Produced by install's `mergeLocal`; consumed by `planHooks`.
261
+ */
262
+ export type LocalHooksPlan = {
263
+ state: "absent";
264
+ merged: string;
265
+ } | {
266
+ state: "complete";
267
+ } | {
268
+ state: "outdated";
269
+ events: HookEventName[];
270
+ merged: string;
271
+ } | {
272
+ state: "malformed";
273
+ reason: string;
274
+ };
275
+ /**
276
+ * The shared settings file's strip plan, discriminated on `state`. `events` is
277
+ * `string[]`, not `HookEventName[]`, because AIDE hooks are found and stripped
278
+ * under any `hooks` key the user's file holds; `stripped` is the whole new file
279
+ * text. Produced by install's `stripProject`; consumed by `planHooks`.
280
+ */
281
+ export type ProjectHooksPlan = {
282
+ state: "absent";
283
+ } | {
284
+ state: "clean";
285
+ } | {
286
+ state: "holds";
287
+ events: string[];
288
+ stripped: string;
289
+ } | {
290
+ state: "malformed";
291
+ reason: string;
292
+ };
293
+ /**
294
+ * Whether git ignores and tracks one path. Produced by `ignoreLocal/inspectGit`,
295
+ * which returns `null` (not this type) outside a work tree; consumed by
296
+ * `ignoreLocal` inside `planHooks`.
297
+ */
298
+ export type GitPathStatus = {
299
+ ignored: boolean;
300
+ tracked: boolean;
301
+ };
302
+ /**
303
+ * The `.gitignore` plan for the local settings file. `edit` is null when git
304
+ * already ignores that file; `content` is the whole new `.gitignore`. Produced
305
+ * by `ignoreLocal`; consumed by `planHooks`.
306
+ */
307
+ export type LocalIgnorePlan = {
308
+ tracked: boolean;
309
+ edit: {
310
+ change: Exclude<HooksFilePlan["change"], "none">;
311
+ content: string;
312
+ } | null;
313
+ };
314
+ /**
315
+ * A settings file parsed for the hooks planner. `hooks` is `{}` when the key is
316
+ * absent; `reason` is the message the malformed states carry. Produced by
317
+ * `planHooks/shared/parseSettings`; consumed by `mergeLocal` and `stripProject`.
318
+ */
319
+ export type ParsedHooksSettings = {
320
+ ok: true;
321
+ settings: Record<string, unknown>;
322
+ hooks: Record<string, unknown>;
323
+ } | {
324
+ ok: false;
325
+ reason: string;
326
+ };
327
+ /**
328
+ * What `aide init` still owes the user for the hooks category. `files` are the
329
+ * malformed files' paths as `src/cli/init` prints them. Produced by `src/cli/init`
330
+ * from the hooks init steps; consumed by its deferred-categories message.
331
+ */
332
+ export type HooksFollowUp = {
333
+ kind: "merge";
334
+ } | {
335
+ kind: "malformed";
336
+ files: string[];
337
+ } | {
338
+ kind: "global-install";
339
+ installCommand: GlobalPackageStatus["installCommand"];
340
+ };
341
+ /**
342
+ * The category of a single init step. The calling agent uses this
343
+ * discriminant to walk through categories with the user. `hooks` writes AIDE's
344
+ * own Claude Code hook entries to `.claude/settings.local.json`, removes AIDE's
345
+ * entries from the shared `.claude/settings.json`, and adds
346
+ * `.claude/settings.local.json` to `.gitignore` when git does not ignore it.
347
+ * `reference` installs the tool and hook reference pages under
348
+ * `.aide/reference/`, a category of its own, apart from the methodology docs.
349
+ */
350
+ export type InitCategory = "framework" | "methodology" | "reference" | "commands" | "agents" | "skills" | "mcp" | "brain" | "ide" | "readme" | "hooks";
351
+ /**
352
+ * Status of a single init step.
353
+ *
354
+ * Planning outcomes (returned by the dry-run phase before any writes):
355
+ * - `"would-create"` — target path does not exist; the tool will write it.
356
+ * - `"would-overwrite"` — target path exists but its bytes differ from
357
+ * canonical; the agent must prompt the user before the tool writes.
358
+ * - `"would-skip"` — the tool deliberately declines to act (e.g. canonical
359
+ * read failed, VS Code CLI absent, Zed JSON parse failure). Not the same
360
+ * as a file that is already at canonical bytes.
361
+ * - `"exists"` — target path exists and its bytes match canonical (or the
362
+ * step is already satisfied). Nothing to do.
363
+ *
364
+ * Execution outcomes (returned by applySteps after writes):
365
+ * - `"created"` — the tool wrote a `would-create` step to disk.
366
+ * - `"overwritten"` — the tool wrote a `would-overwrite` step to disk after
367
+ * the agent obtained user approval for the category.
368
+ */
369
+ export type InitStepStatus = "would-create" | "would-skip" | "would-overwrite" | "exists" | "created" | "overwritten";
370
+ /**
371
+ * A single step in the init plan returned by aide_init.
372
+ * For `would-create` steps, `content` carries the bytes to write (for file steps)
373
+ * or `prescription` carries the MCP entry (for MCP steps).
374
+ */
375
+ export interface InitStep {
376
+ /** Human-readable name for this step. */
377
+ name: string;
378
+ /** Planning status — what the agent should do with this step. */
379
+ status: InitStepStatus;
380
+ /** Category for grouping during agent-user conversation. */
381
+ category: InitCategory;
382
+ /** Absolute target path on disk where this step writes. */
383
+ filePath: string;
384
+ /**
385
+ * File content to write — present for `would-create` AND `would-overwrite`
386
+ * file steps; absent for `would-skip` and `exists` steps. Planning helpers
387
+ * must carry the canonical bytes for overwrites too so that `applySteps`
388
+ * can write them when the agent proceeds after user approval.
389
+ */
390
+ content?: string;
391
+ /** MCP prescription — present for `would-create` MCP steps, absent for `exists`. */
392
+ prescription?: McpPrescription;
393
+ /** True when the MCP config file exists but cannot be parsed as JSON. */
394
+ configMalformed?: boolean;
395
+ /**
396
+ * Present on every would-create aide MCP step (the entry is always the
397
+ * global command); never on `exists`. Also present on the hooks `would-skip`
398
+ * step when the package is not installed globally (`installed` false).
399
+ */
400
+ globalPackage?: GlobalPackageStatus;
401
+ /**
402
+ * CLI command the agent should execute for steps that require external
403
+ * tooling (e.g. `code --install-extension <vsixPath>` for VS Code), and for
404
+ * the session record step, where it tells the agent to call aide_scaffold
405
+ * with type "session".
406
+ * Present only on `would-create` steps (the IDE VS Code step and the
407
+ * session record step) that pass through applySteps without being written
408
+ * to disk.
409
+ * Also present on the would-create aide MCP step when `@aidemd-mcp/aidemd`
410
+ * is not installed globally: it tells the agent to run the install via Bash
411
+ * before merging the prescription, and not to merge if the install fails.
412
+ * Absent on that step when the package is installed.
413
+ * Also present on the hooks `would-skip` step when the package is not
414
+ * installed globally (install first, then apply the hooks category again),
415
+ * and on each hooks `would-skip` step for a malformed settings file (the stop
416
+ * naming the file and reason).
417
+ */
418
+ instructions?: string;
419
+ /**
420
+ * Content-free summary of the brain config. Present only on the brain config
421
+ * (brain.aide) step, on every status. Carries no section text, purposes,
422
+ * repair blocks or migration bodies.
423
+ */
424
+ brainSummary?: BrainStepSummary;
425
+ }
426
+ /**
427
+ * One contract section as the `InitStep.brainSummary` reports it. `seedPath` is
428
+ * present only on seed entries. `templateBytes` is the UTF-8 byte length of the
429
+ * latest bundled template's section (the bytes strictly between its markers).
430
+ */
431
+ export type BrainStepSection = {
432
+ marker: BrainSectionMarker;
433
+ role: "live" | "seed";
434
+ seedPath?: string;
435
+ templateBytes: number;
436
+ };
437
+ /**
438
+ * Content-free summary of the brain config carried on `InitStep.brainSummary`.
439
+ * `sections` is the contract in order. `missingSections` and `staleSections`
440
+ * name markers only. `legacyLauncher` lists the reasons the launcher is legacy,
441
+ * or `null`. `templateIntegration` is whether the launcher is the bundled
442
+ * template integration, or `null` when the file is absent or unparseable. A
443
+ * would-create step, and an unparseable file, report empty arrays and `null`s.
444
+ */
445
+ export type BrainStepSummary = {
446
+ sections: BrainStepSection[];
447
+ missingSections: BrainSectionMarker[];
448
+ staleSections: BrainSectionMarker[];
449
+ legacyLauncher: LegacyLauncherReason[] | null;
450
+ templateIntegration: boolean | null;
451
+ };
452
+ /**
453
+ * One absent brain config section plus the bytes and position needed to insert
454
+ * it. `block` is the full marker-wrapped section, byte-identical to the latest
455
+ * bundled template. `insertAfter` is the exact close-marker text the block goes
456
+ * directly after, or `null` for the start of the body. Consumed by aide_upgrade's
457
+ * brain insertion, not by the agent. Insertion semantics are defined in
458
+ * provisionBrain brief commitment #6.
459
+ */
460
+ export type BrainSectionRepair = BrainSectionContractEntry & {
461
+ block: string;
462
+ insertAfter: string | null;
463
+ };
464
+ /**
465
+ * Why a brain launcher counts as legacy. `unpinned` and `unversioned` mean the
466
+ * npx package spec carries no version; `older-pin` means it pins a version
467
+ * older than this server; `missing-auto-confirm` means the npx args lack the
468
+ * auto-confirm flag. `npx-launch` means the launcher runs the bundled brain
469
+ * package through npx at all, which is legacy because the canonical brain
470
+ * launcher is the global `mcpvault` command; it is always the first reason, and
471
+ * the others describe the pin. Produced by provisionBrain's launcher check;
472
+ * consumed by `BrainLauncherOffer`, `BrainMigrationNotice` and `UpgradeFileResult`.
473
+ */
474
+ export type LegacyLauncherReason = "npx-launch" | "unpinned" | "unversioned" | "older-pin" | "missing-auto-confirm";
475
+ /**
476
+ * A proposed launcher rewrite for a legacy brain launcher. `before` is the
477
+ * user's `mcpServerConfig` as parsed; `after` is the global replacement
478
+ * (`mcpvault` with every arg after the npx package spec), the one form a legacy
479
+ * launcher moves to. Produced by provisionBrain; consumed by aide_upgrade's brain
480
+ * preview and apply via `BrainMigration`, no longer carried on `InitStep`.
481
+ */
482
+ export type BrainLauncherOffer = {
483
+ reasons: LegacyLauncherReason[];
484
+ before: BrainAideMcpServerConfig;
485
+ after: BrainAideMcpServerConfig;
486
+ };
487
+ /**
488
+ * One stale brain config section plus its replacement. `before` and `after`
489
+ * are the bytes strictly between that section's markers: `before` is the
490
+ * user's, verbatim, and `after` is the latest bundled template's. Produced by
491
+ * provisionBrain; consumed by aide_upgrade's brain preview and apply via
492
+ * `BrainMigration`, no longer carried on `InitStep`.
493
+ */
494
+ export type BrainStaleSectionOffer = BrainSectionContractEntry & {
495
+ before: string;
496
+ after: string;
497
+ };
498
+ /**
499
+ * Everything aide_init offers to migrate in an existing brain config: stale
500
+ * sections and a legacy launcher. Produced by provisionBrain and consumed by
501
+ * aide_upgrade's brain preview and apply; no longer carried on `InitStep`. Each
502
+ * change is applied only after the user says yes to it.
503
+ */
504
+ export type BrainMigration = {
505
+ staleSections: BrainStaleSectionOffer[];
506
+ legacyLauncher: BrainLauncherOffer | null;
507
+ };
508
+ /**
509
+ * Content-free summary of a `BrainMigration`: marker names and launcher
510
+ * reasons only, never section or launcher bytes. Produced by buildBrainState's
511
+ * callers; consumed by aide_info (`InfoResult.brainMigration`), which stays
512
+ * small, and mirrored by aide_upgrade's brain result.
513
+ */
514
+ export type BrainMigrationNotice = {
515
+ staleSections: BrainSectionMarker[];
516
+ legacyLauncher: LegacyLauncherReason[] | null;
517
+ };
518
+ /** What a brain change touches, or what a template read selects: one contract section, or the launcher. */
519
+ export type BrainChangeTarget = BrainSectionMarker | "launcher";
520
+ /**
521
+ * Result of aide_upgrade's `category: "brain"`, discriminated on `outcome`.
522
+ * `beforeHash` is the lowercase hex SHA-256 of `before` as UTF-8, so the agent
523
+ * never computes a hash.
524
+ */
525
+ export type BrainCategoryResult =
526
+ /** Missing contract sections were inserted into brain.aide; lists their markers. */
527
+ {
528
+ outcome: "inserted";
529
+ inserted: BrainSectionMarker[];
530
+ }
531
+ /** Inserted seed sections need adapting to this brain; `instructions` says how. */
532
+ | {
533
+ outcome: "adapt";
534
+ adapt: BrainSectionMarker[];
535
+ instructions: string;
536
+ }
537
+ /** One previewed change: `before` is the exact text hashed into `beforeHash`, `after` the replacement. */
538
+ | {
539
+ outcome: "change";
540
+ target: BrainChangeTarget;
541
+ before: string;
542
+ after: string;
543
+ beforeHash: string;
544
+ }
545
+ /** The target section is absent from the file; `template` is the bundled section to insert. */
546
+ | {
547
+ outcome: "missing";
548
+ target: BrainSectionMarker;
549
+ template: string;
550
+ instructions: string;
551
+ }
552
+ /** The hash-guarded change was written to brain.aide. */
553
+ | {
554
+ outcome: "applied";
555
+ target: BrainChangeTarget;
556
+ }
557
+ /** The request was refused; `instructions` says why and what to do. */
558
+ | {
559
+ outcome: "refused";
560
+ instructions: string;
561
+ };
562
+ /**
563
+ * Internal to aide_upgrade's brain category. `before` is the exact text hashed
564
+ * into `beforeHash`; `after` is in the file's line ending; `text` is the whole
565
+ * file with the change spliced in (not yet validated or written).
566
+ */
567
+ export type BrainChangeOffer = {
568
+ kind: "offer";
569
+ target: BrainChangeTarget;
570
+ before: string;
571
+ after: string;
572
+ text: string;
573
+ } | {
574
+ kind: "refused";
575
+ instructions: string;
576
+ };
577
+ /**
578
+ * One recorded outdated version of a bundled template section: the fingerprint
579
+ * of its normalized text and the release it was seen in. A section is stale
580
+ * when its fingerprint matches one of these and is not the current template's.
581
+ * Consumed by provisionBrain's staleness check.
582
+ */
583
+ export type OutdatedSectionVersion = {
584
+ fingerprint: string;
585
+ seenIn: string;
586
+ };
587
+ /**
588
+ * Where the npx package spec sits in an npx launcher's args. Both
589
+ * `argsStart` and `specIndex` are absolute indexes into the launcher's `args`;
590
+ * produced by `readNpxPackageSpec` (src/service/install/shared) and consumed by
591
+ * provisionBrain's legacy-launcher check and aide_upgrade's aide pin move.
592
+ */
593
+ export type NpxPackageSpec = {
594
+ argsStart: number;
595
+ specIndex: number;
596
+ packageName: string;
597
+ version: string | null;
598
+ autoConfirm: boolean;
599
+ };
600
+ /**
601
+ * A discovered brain root candidate returned by resolveBrainHints.
602
+ * The agent presents these as suggestions and asks the user to confirm
603
+ * or provide a different path.
604
+ */
605
+ export interface BrainHint {
606
+ /** How this path was discovered. */
607
+ source: "env" | "sibling" | "conventional";
608
+ /** Absolute path to the candidate brain root location. */
609
+ path: string;
610
+ }
611
+ /**
612
+ * The structured JSON result returned by aide_init.
613
+ * No prose, no formatting — the agent interprets this and drives the conversation.
614
+ */
615
+ export interface InitResult {
616
+ /** The detected (or overridden) framework. */
617
+ framework: FrameworkType;
618
+ /** All init steps the agent should present and apply. */
619
+ steps: InitStep[];
620
+ /** Discovered brain root candidates for the brain interview. */
621
+ brainHints: BrainHint[];
622
+ }
623
+ /**
624
+ * Per-category group names for upgrade results.
625
+ * The agent presents results grouped by category and lets the user confirm
626
+ * or decline each category independently. `hooks` writes AIDE's own Claude Code
627
+ * hook entries to `.claude/settings.local.json`, removes AIDE's entries from the
628
+ * shared `.claude/settings.json`, and adds `.claude/settings.local.json` to
629
+ * `.gitignore` when git does not ignore it. `reference` upgrades the tool and
630
+ * hook reference pages under `.aide/reference/`, a category of its own, apart
631
+ * from the methodology docs.
632
+ */
633
+ export type UpgradeCategory = "pointer-stub" | "methodology-docs" | "version-metadata" | "reference" | "commands" | "agents" | "skills" | "mcp" | "ide" | "readme" | "brain" | "hooks";
634
+ /**
635
+ * Comparison status for a single file in an upgrade run.
636
+ * `"matches"`, `"differs"`, `"missing"`, and `"malformed"` are comparison
637
+ * outcomes returned by the dry-run phase. `"updated"`, `"created"`, and
638
+ * `"unchanged"` are execution outcomes returned by applyFiles after the tool
639
+ * has written (or confirmed) files during a category call — parallel to
640
+ * init's `"created"` status. `"unchanged"` means the file already matched
641
+ * canonical and no write was needed. `"malformed"` marks a config file that
642
+ * cannot be parsed: the MCP config, the IDE config, the brain config, or a
643
+ * hooks settings file (`.claude/settings.local.json` or `.claude/settings.json`,
644
+ * which then stops the whole hooks category).
645
+ */
646
+ export type UpgradeFileStatus = "matches" | "differs" | "missing" | "malformed" | "updated" | "created" | "unchanged";
647
+ /**
648
+ * Result of comparing a single file against its canonical version.
649
+ * For `differs` and `missing` statuses, `canonicalContent` carries the bytes
650
+ * the agent should write. For `mcp` category files, `prescription` carries
651
+ * the server entry to merge, `globalPackage` reports the global install beside
652
+ * it, and `globalSwitch` reports an npx entry's switch to the global command.
653
+ * A `hooks` result can carry `globalPackage`, `instructions` and `tip` (see the
654
+ * fields).
655
+ */
656
+ export interface UpgradeFileResult {
657
+ /** Human-readable label for this file (e.g. filename or display name). */
658
+ name: string;
659
+ /** Absolute path on disk where this file lives (or would be written). */
660
+ filePath: string;
661
+ /** Comparison outcome. */
662
+ status: UpgradeFileStatus;
663
+ /** Category this file belongs to — used for grouping. */
664
+ category: UpgradeCategory;
665
+ /**
666
+ * Full canonical content to write — present for `differs` and `missing`,
667
+ * absent for `matches` and `malformed`. Stripped from the response after
668
+ * applyFiles writes the content to disk.
669
+ */
670
+ canonicalContent?: string;
671
+ /**
672
+ * MCP prescription — present for `mcp` category `differs` and `missing`
673
+ * results. The agent merges this entry into the existing config.
674
+ */
675
+ prescription?: McpPrescription;
676
+ /**
677
+ * Present only on the `mcp` result when the caller named a target version
678
+ * and the project's local aide entry is pinned older than it, unpinned, or
679
+ * pinned to a non-exact version. On a detection call it is the proposed move
680
+ * (status `differs`); on the mcp category call the tool writes it itself
681
+ * (status `updated`), or leaves the file untouched and sets `instructions`
682
+ * when it cannot. Never present together with `prescription`.
683
+ */
684
+ pinMove?: McpPinMove;
685
+ /**
686
+ * Present only on the `mcp` result when the aide entry launches through npx
687
+ * and no target version was named. On detection it has status `differs`; after
688
+ * a successful mcp category call the status is `updated`; on a refused call it
689
+ * is still `differs` with `instructions`. Never present together with
690
+ * `prescription` or `pinMove`.
691
+ */
692
+ globalSwitch?: McpGlobalSwitch;
693
+ /**
694
+ * Present only on the `mcp` result beside a `prescription` for a missing
695
+ * config or absent aide entry, so the agent installs the package before
696
+ * merging the entry. When `installed` is false the same result carries the
697
+ * install-first `instructions`. Also present on the `hooks` local result when
698
+ * the package is not installed globally (`installed` false, status `missing`,
699
+ * no `canonicalContent`), with the install-first `instructions`.
700
+ */
701
+ globalPackage?: GlobalPackageStatus;
702
+ /**
703
+ * An informational note on a file result. It is neither drift nor a
704
+ * prescription, and it never changes the summary counts. Set on the `hooks`
705
+ * local result when git tracks `.claude/settings.local.json`.
706
+ */
707
+ tip?: string;
708
+ /**
709
+ * What the agent must do or know next, set by whichever step produced it:
710
+ * - the IDE VS Code install command (e.g. `code --install-extension
711
+ * <vsixPath>`), for a step that passes through applyFiles without being
712
+ * written to disk;
713
+ * - the reason a pin move was refused (an unlocatable pin, or an npx entry
714
+ * under the `aidemd-mcp` key with a target version);
715
+ * - the reason a switch to the global command was refused;
716
+ * - on the mcp `missing` result, or the absent-entry `differs` result, the
717
+ * instruction to install the package first when it is not installed
718
+ * globally;
719
+ * - on the hooks local result, the instruction to install the package
720
+ * globally first, when it is not installed;
721
+ * - on each `malformed` hooks result, the stop naming the file and the parse
722
+ * reason.
723
+ */
724
+ instructions?: string;
725
+ /**
726
+ * Marker names of the required sections absent from the brain config, in
727
+ * contract order. Present only on the brain category file result when the
728
+ * config is behind.
729
+ */
730
+ missingSections?: BrainSectionMarker[];
731
+ /**
732
+ * Marker names of the sections whose bytes match an outdated template
733
+ * version. Present only on the brain category file result. Names only,
734
+ * never section bytes.
735
+ */
736
+ staleSections?: BrainSectionMarker[];
737
+ /**
738
+ * Reasons the brain launcher is legacy. Present only on the brain category
739
+ * file result. Reasons only, never launcher bytes.
740
+ */
741
+ legacyLauncher?: LegacyLauncherReason[];
742
+ }
743
+ /**
744
+ * Per-category grouping of upgrade file results with a computed summary.
745
+ * The agent uses the summary to skip all-matching categories and only present
746
+ * drifted ones to the user.
747
+ */
748
+ export interface UpgradeCategoryResult {
749
+ /** The category these results belong to. */
750
+ category: UpgradeCategory;
751
+ /** All file results in this category. */
752
+ files: UpgradeFileResult[];
753
+ /** Counts for quick agent decision-making. */
754
+ summary: {
755
+ total: number;
756
+ differs: number;
757
+ missing: number;
758
+ matches: number;
759
+ /** Present after applyFiles — number of files updated (were differs). */
760
+ updated?: number;
761
+ /** Present after applyFiles — number of files created (were missing). */
762
+ created?: number;
763
+ /** Present after applyFiles — number of files already current (were matches). */
764
+ unchanged?: number;
765
+ };
766
+ }
767
+ /**
768
+ * Structured JSON result returned by aide_upgrade.
769
+ * No prose, no formatting — the agent interprets this and drives the
770
+ * per-category confirmation flow.
771
+ */
772
+ export interface UpgradeResult {
773
+ /** The detected (or overridden) framework. */
774
+ framework: FrameworkType;
775
+ /** All category results, in canonical order. */
776
+ categories: UpgradeCategoryResult[];
777
+ }
778
+ /** A node in the hierarchical TUI tree. */
779
+ export type TreeNode = {
780
+ kind: "dir";
781
+ path: string;
782
+ children: TreeNode[];
783
+ } | {
784
+ kind: "file";
785
+ file: AideFile;
786
+ };
787
+ /**
788
+ * The canonical MCP-server entry shape consumed by the shared `writeMcpEntry` helper.
789
+ * Represents a single server entry under `mcpServers[<key>]` in `.mcp.json`.
790
+ * Also used by `buildBrainState` when comparing the parsed `brain.aide` expected
791
+ * entry against the actual entry in the host's `.mcp.json`.
792
+ */
793
+ export type McpServerEntry = {
794
+ command: string;
795
+ /**
796
+ * Args typed `(string | null)[]` to match the broadened parser contract.
797
+ * Null entries are unwired-slot signals forwarded verbatim from brain.aide;
798
+ * sync refuses to write null-bearing entries.
799
+ */
800
+ args: (string | null)[];
801
+ };
802
+ /**
803
+ * Why a present `brain.aide` falls short of the contract. This is the
804
+ * "present but falls short" detail and never means absence: an absent file is
805
+ * `no-brain-aide`, not a fault.
806
+ *
807
+ * - `missing-sections` - every present marker pair is sound but one or more
808
+ * whole required pairs are absent. `sections` is non-empty, in contract order.
809
+ * - `malformed` - the frontmatter or body is unusable; `reason` names the
810
+ * exact field, parse error or violating marker.
811
+ */
812
+ export type BrainAideFault = {
813
+ kind: "missing-sections";
814
+ sections: BrainSectionMarker[];
815
+ } | {
816
+ kind: "malformed";
817
+ reason: string;
818
+ };
819
+ /**
820
+ * Precondition state of the host's brain, returned as a five-state tagged
821
+ * union so the orchestrator can branch on each case and compose targeted
822
+ * remediation prose. `buildBrainState` is the single source of this value;
823
+ * both `aide_brain` and `aide_info` consume the same plain-data shape without
824
+ * re-deriving detection logic.
825
+ *
826
+ * Discriminant invariants:
827
+ *
828
+ * - `ok` - `.aide/config/brain.aide` parsed successfully and the host's `.mcp.json`
829
+ * `mcpServers.brain` entry matches the parsed/interpolated `mcpServerConfig`.
830
+ * Carries `name` (the user-declared descriptive label from brain.aide -
831
+ * descriptive only, never dispatched on by any code) and `hints`.
832
+ *
833
+ * - `no-brain-aide` - the file is absent (ENOENT), and only that. A present file
834
+ * that cannot be read is `brain-aide-invalid`, never this status. There is
835
+ * nothing to read a label from. Carries only `hints` - no `name`.
836
+ * Remediation: `/aide:brain config`.
837
+ *
838
+ * - `brain-aide-invalid` - the file is present but falls short of the contract:
839
+ * missing sections, malformed frontmatter, malformed body, or unreadable. Carries the
840
+ * `fault` detail and `hints` - no `name`. Remediation: missing sections are
841
+ * inserted with `aide_upgrade` `category: "brain"`; a malformed file is fixed by hand.
842
+ *
843
+ * - `no-mcp-entry` - brain.aide parsed successfully, but the host's `.mcp.json`
844
+ * cannot be read (ENOENT or any I/O failure), cannot be parsed as JSON, or has
845
+ * no `mcpServers.brain` key. Carries `name` (from the parsed brain.aide) and
846
+ * `hints`. Remediation: run sync with the launcher the project's `aide` MCP entry uses.
847
+ *
848
+ * - `mcp-drift` - brain.aide parsed, `.mcp.json` has a `brain` entry, but the
849
+ * entry's `command` or `args` differ from the parsed/interpolated
850
+ * `mcpServerConfig`. Drift is detected by structural comparison (string equality
851
+ * on `command`; element-by-element equality on `args`). Carries `name` and
852
+ * `hints`. Remediation: run sync with the launcher the project's `aide` MCP entry uses.
853
+ *
854
+ * `hints` is populated unconditionally on every state - the orchestrator may
855
+ * surface candidate brain root locations on `no-brain-aide` (fresh project) just as
856
+ * much as on `mcp-drift`. No state carries `rootPath`, `connector`, `entryFile`,
857
+ * `tools`, or `backend` - those fields are retired. Path validity is the
858
+ * launcher's problem at MCP server startup.
859
+ */
860
+ export type BrainState = {
861
+ status: "ok";
862
+ /** User-declared descriptive label from brain.aide (e.g. `"obsidian"`). Descriptive only - no code branches on this value. */
863
+ name: string;
864
+ /** Candidate brain root locations for orchestrator remediation suggestions. */
865
+ hints: BrainHint[];
866
+ } | {
867
+ status: "no-brain-aide";
868
+ /** Candidate brain root locations for orchestrator remediation suggestions. */
869
+ hints: BrainHint[];
870
+ } | {
871
+ status: "brain-aide-invalid";
872
+ /** What the present file is missing or what makes it malformed. */
873
+ fault: BrainAideFault;
874
+ /** Candidate brain root locations for orchestrator remediation suggestions. */
875
+ hints: BrainHint[];
876
+ } | {
877
+ status: "no-mcp-entry";
878
+ /** User-declared descriptive label from brain.aide. Carried so the orchestrator can name the wired brain in remediation prose. */
879
+ name: string;
880
+ /** Candidate brain root locations for orchestrator remediation suggestions. */
881
+ hints: BrainHint[];
882
+ } | {
883
+ status: "mcp-drift";
884
+ /** User-declared descriptive label from brain.aide. Carried so the orchestrator can name the wired brain in remediation prose. */
885
+ name: string;
886
+ /** Candidate brain root locations for orchestrator remediation suggestions. */
887
+ hints: BrainHint[];
888
+ };
889
+ /**
890
+ * The structured JSON result returned by `aide_brain` — the runtime brain
891
+ * entry-point tool.
892
+ *
893
+ * - `status` mirrors `BrainState["status"]` exactly, so an agent that already
894
+ * saw boot-time brain state from `aide_info` does not learn new terms.
895
+ * - `instructions` is always non-empty. On `"ok"`, it is the requested section's
896
+ * text. On a remediation branch it is prose composed by the server directing
897
+ * the agent to surface a wiring prompt to the user. A readable non-ok config
898
+ * can still return a section. A response with `status: "ok"` and empty
899
+ * `instructions` is a forbidden state.
900
+ * - `found` says what `instructions` carries.
901
+ * - `purpose` is the requested section's one-line purpose from the published
902
+ * `brainContract`; present only when `found` is true, absent on every
903
+ * remediation branch.
904
+ */
905
+ export type BrainToolResult = {
906
+ status: BrainState["status"];
907
+ instructions: string;
908
+ /**
909
+ * True only when `instructions` is the requested section's verbatim bytes;
910
+ * false on every remediation branch. Never derived from `status`.
911
+ */
912
+ found: boolean;
913
+ /**
914
+ * The requested section's one-line purpose, read from the published
915
+ * `brainContract` entry for that marker (never from the user's brain.aide).
916
+ * Present only when `found` is true; the key is absent on every remediation
917
+ * branch.
918
+ */
919
+ purpose?: string;
920
+ };
921
+ /**
922
+ * Result of an `aide_brain` template read. Produced by the template mode of
923
+ * `aide_brain`; consumed by the agent and the `aide-brain-author` skill as the
924
+ * worked example for one contract section or the launcher. Carries no `status`
925
+ * and no `found`: the answer does not depend on the host's config.
926
+ */
927
+ export type BrainTemplateResult = {
928
+ /** The bundled template's verbatim bytes for one contract section (strictly between its markers) or for the launcher (the frontmatter region). */
929
+ template: string;
930
+ /** That section's contract purpose, or the launcher purpose. */
931
+ purpose: string;
932
+ };
933
+ /**
934
+ * One section in an `aide_brain` contract listing. Produced by the contract
935
+ * mode of `aide_brain`; consumed by the agent and the `aide-brain-author`
936
+ * skill. Carries no `field`, no `seedPath` and no text.
937
+ */
938
+ export type BrainContractSection = {
939
+ marker: BrainSectionMarker;
940
+ role: BrainSectionContractEntry["role"];
941
+ purpose: BrainSectionContractEntry["purpose"];
942
+ };
943
+ /**
944
+ * Result of an `aide_brain` contract listing. Produced by the contract mode of
945
+ * `aide_brain`; consumed by the agent and the `aide-brain-author` skill.
946
+ */
947
+ export type BrainContractListing = {
948
+ /** Every contract section, in contract order. */
949
+ sections: BrainContractSection[];
950
+ };
951
+ /**
952
+ * What the structural check found at a draft path. Produced by the draft
953
+ * validation mode of `aide_brain`; consumed by the agent and the
954
+ * `aide-brain-author` skill. The fault arm reuses the host check's
955
+ * `BrainAideFault` vocabulary unchanged.
956
+ */
957
+ export type BrainDraftFinding = {
958
+ kind: "valid";
959
+ } | {
960
+ kind: "absent";
961
+ } | BrainAideFault;
962
+ /**
963
+ * Result of an `aide_brain` draft validation, discriminated on `outcome` (the
964
+ * discriminant `BrainCategoryResult` already uses). `fault` is carried only on
965
+ * `invalid`, so a found flag can never disagree with the text.
966
+ *
967
+ * - `valid` - the draft passes the structural check.
968
+ * - `invalid` - the draft is present but falls short; `fault` says how.
969
+ * - `absent` - nothing exists at the draft path.
970
+ * - `refused` - the path is outside the project; nothing was read.
971
+ */
972
+ export type BrainDraftResult = {
973
+ outcome: "valid";
974
+ instructions: string;
975
+ } | {
976
+ outcome: "invalid";
977
+ fault: BrainAideFault;
978
+ instructions: string;
979
+ } | {
980
+ outcome: "absent";
981
+ instructions: string;
982
+ } | {
983
+ outcome: "refused";
984
+ instructions: string;
985
+ };
986
+ /**
987
+ * Result returned by aide_info — the passive boot-time reporter.
988
+ *
989
+ * Returns three independent top-level fields, each covering a distinct concern:
990
+ * - `serverVersion` + `outdated`: staleness of installed AIDE artifacts against
991
+ * the canonical manifest shipped with this npm package. Soft notification —
992
+ * the pipeline can run even when artifacts are stale.
993
+ * - `brain`: precondition state of the host's brain MCP setup. Hard
994
+ * gate — the orchestrator halts and directs the user to run `/aide` when
995
+ * `status` is anything other than `"ok"`; the inline-recovery flow detects
996
+ * the broken state and prompts the user to resolve it.
997
+ * - `brainMigration`: whether the brain config carries stale sections or a
998
+ * legacy launcher. Soft notice, independent of `brain`, never a gate.
999
+ *
1000
+ * The fields are structurally independent: the orchestrator reads each
1001
+ * field in isolation and applies a different policy to each.
1002
+ */
1003
+ export interface InfoResult {
1004
+ /** The npm package version of the installed aide MCP server. */
1005
+ serverVersion: string;
1006
+ /**
1007
+ * Artifact keys whose sourceCommit differs between local and canonical,
1008
+ * plus `hooks` when the project's Claude Code hooks are missing or differ
1009
+ * from what the running version installs (judged as the upgrade judges them).
1010
+ */
1011
+ outdated: string[];
1012
+ /**
1013
+ * A soft notice, independent of `outdated`. It is null when not applicable
1014
+ * or unknown.
1015
+ */
1016
+ behind: BehindNotice | null;
1017
+ /** Precondition state of the host's brain. */
1018
+ brain: BrainState;
1019
+ /**
1020
+ * A soft notice, independent of `brain`, and never a gate. It names the stale
1021
+ * sections and legacy launcher reasons in the brain config and carries no
1022
+ * section or launcher bytes. It is null when nothing is stale or the config
1023
+ * cannot be checked.
1024
+ */
1025
+ brainMigration: BrainMigrationNotice | null;
1026
+ }
1027
+ /** A single symbol match returned by aide_inspect. */
1028
+ export interface InspectHit {
1029
+ /** Symbol name as declared in source. */
1030
+ name: string;
1031
+ /** Symbol kind — one of "function", "method", "arrow", "class", "interface", "type-alias". */
1032
+ kind: string;
1033
+ /** Path relative to project root, POSIX-normalized. */
1034
+ file: string;
1035
+ /** 1-based line number where the symbol is declared. */
1036
+ line: number;
1037
+ /**
1038
+ * Full declaration text truncated before the body — no curly braces from
1039
+ * function/class bodies. Type aliases include the full text up to the `=`
1040
+ * assignment.
1041
+ */
1042
+ signature: string;
1043
+ /** Parsed JSDoc block, or null when no JSDoc is present. */
1044
+ jsdoc: {
1045
+ /** Text before any `@` tag. */
1046
+ description: string;
1047
+ /** Each `@tag text` pair extracted from the JSDoc block. */
1048
+ tags: Array<{
1049
+ tag: string;
1050
+ text: string;
1051
+ }>;
1052
+ } | null;
1053
+ }
1054
+ /** Result returned by aide_inspect — an array because a name may match in multiple files. */
1055
+ export type InspectResult = {
1056
+ hits: InspectHit[];
1057
+ };
1058
+ /**
1059
+ * The three pipeline ephemerals aide_cleanup may remove; nothing else is ever
1060
+ * a removal target. session.aide is deliberately not a member — it is the
1061
+ * project-wide session log and survives every cleanup call.
1062
+ */
1063
+ export type CleanupEphemeral = "plan.aide" | "todo.aide" | "brief.aide";
1064
+ /**
1065
+ * One unchecked item: the file it sits in, its 1-based line number, and the
1066
+ * item text after the checkbox marker, trimmed.
1067
+ */
1068
+ export type OpenCheckbox = {
1069
+ file: CleanupEphemeral;
1070
+ line: number;
1071
+ text: string;
1072
+ };
1073
+ /**
1074
+ * Why aide_cleanup refused to touch a module. A typed union rather than a
1075
+ * string so a refusal can never omit the unchecked items it must name.
1076
+ */
1077
+ export type CleanupRefusal =
1078
+ /** The named path resolves outside the project root (via `..`, an absolute path, or a symlink or junction). */
1079
+ {
1080
+ kind: "outside-root";
1081
+ }
1082
+ /** Nothing exists at the named path. */
1083
+ | {
1084
+ kind: "missing";
1085
+ }
1086
+ /** The named path is a file or other non-directory. */
1087
+ | {
1088
+ kind: "not-a-directory";
1089
+ }
1090
+ /** An ephemeral name exists but is not a regular file (directory, symlink). */
1091
+ | {
1092
+ kind: "not-a-file";
1093
+ file: CleanupEphemeral;
1094
+ }
1095
+ /** The folder holds none of plan.aide, todo.aide or brief.aide, so there is nothing to remove. */
1096
+ | {
1097
+ kind: "no-ephemerals";
1098
+ }
1099
+ /**
1100
+ * brief.aide is present with no plan.aide; a brief is removed only together
1101
+ * with its plan, whatever the brief records. `items`
1102
+ * lists any unchecked todo.aide items in line order and is empty when there
1103
+ * is no todo.aide or it is fully checked.
1104
+ */
1105
+ | {
1106
+ kind: "brief-without-plan";
1107
+ items: OpenCheckbox[];
1108
+ }
1109
+ /** With no plan.aide, the only file present is a todo.aide with no checkboxes and no recorded status, so nothing shows its cycle closed. */
1110
+ | {
1111
+ kind: "todo-without-checkboxes";
1112
+ }
1113
+ /** plan.aide exists with no checkbox and no recorded status, so completion cannot be verified. */
1114
+ | {
1115
+ kind: "plan-without-checkboxes";
1116
+ }
1117
+ /**
1118
+ * At least one of plan.aide, todo.aide, brief.aide records proposed or approved, so the
1119
+ * work is not closed. `files` names each such file with its recorded status;
1120
+ * `items` lists the open plan and todo items, plan first.
1121
+ */
1122
+ | {
1123
+ kind: "open-status";
1124
+ files: {
1125
+ file: CleanupEphemeral;
1126
+ status: string;
1127
+ }[];
1128
+ items: OpenCheckbox[];
1129
+ }
1130
+ /** A plan, todo or brief records completed while checkbox items are still open. `items` is non-empty. */
1131
+ | {
1132
+ kind: "completed-with-open-items";
1133
+ items: OpenCheckbox[];
1134
+ }
1135
+ /** A file's recorded status is not a value of the lifecycle; `detail` says what it holds. */
1136
+ | {
1137
+ kind: "invalid-status";
1138
+ file: CleanupEphemeral;
1139
+ detail: string;
1140
+ }
1141
+ /** At least one unchecked item. `items` is non-empty: plan.aide items first, then todo.aide items, each in line order. */
1142
+ | {
1143
+ kind: "unchecked-items";
1144
+ items: OpenCheckbox[];
1145
+ };
1146
+ /**
1147
+ * Result returned by aide_cleanup. Every variant carries `module`, the module
1148
+ * path as displayed to the caller: POSIX-separated and relative to the root
1149
+ * (`"."` for the root itself). For `outside-root` it is the caller's input verbatim.
1150
+ */
1151
+ export type CleanupResult =
1152
+ /** Real call succeeded. `files` lists what was removed, in removal order. */
1153
+ {
1154
+ kind: "removed";
1155
+ module: string;
1156
+ files: CleanupEphemeral[];
1157
+ }
1158
+ /** Dry run. `files` is exactly what the real call would remove against the same state. */
1159
+ | {
1160
+ kind: "would-remove";
1161
+ module: string;
1162
+ files: CleanupEphemeral[];
1163
+ }
1164
+ /** Preconditions failed. Nothing was touched. */
1165
+ | {
1166
+ kind: "refused";
1167
+ module: string;
1168
+ refusal: CleanupRefusal;
1169
+ }
1170
+ /** A removal failed partway: names what is gone, what is left, and the underlying error message. */
1171
+ | {
1172
+ kind: "incomplete";
1173
+ module: string;
1174
+ removed: CleanupEphemeral[];
1175
+ remaining: CleanupEphemeral[];
1176
+ error: string;
1177
+ };
1178
+ /**
1179
+ * The `mcpServerConfig` block parsed from `brain.aide` frontmatter. Kept as a
1180
+ * separate type from `McpServerEntry` because `args` is `(string | null)[]` at
1181
+ * parse time — every element is either a fully-formed argument string OR YAML
1182
+ * null. A null at any index is the explicit unwired-slot signal, replacing the
1183
+ * retired literal-sentinel design (no `<BRAIN_PATH>`, `<API_TOKEN>`, magic
1184
+ * UUIDs, or other string sentinels are recognized at any layer). The parser
1185
+ * preserves null entries verbatim at their original indexes; downstream
1186
+ * consumers branch on null structurally per their own contracts: sync refuses
1187
+ * to proceed when any arg is null, `buildBrainState` maps any null entry to
1188
+ * the `no-mcp-entry` semantic, and `interpolateArgs` passes null through
1189
+ * unchanged at its original index. Callers must run `interpolateArgs` before
1190
+ * writing the entry to `.mcp.json` — the post-interpolation shape that sync
1191
+ * writes is `McpServerEntry`, which carries `args: string[]` and only ever
1192
+ * holds fully-resolved values. Consumed by `parseBrainAide` (parsing and
1193
+ * validation) and `interpolateArgs` (substitution).
1194
+ */
1195
+ export type BrainAideMcpServerConfig = {
1196
+ command: string;
1197
+ args: (string | null)[];
1198
+ };
1199
+ /**
1200
+ * The two-field parsed frontmatter of a `brain.aide` file. Format reference:
1201
+ * `.aide/docs/brain-aide.md`. Validated by `parseBrainAide`; a missing or
1202
+ * wrong-typed field, or the presence of any deprecated field (`connector`,
1203
+ * `rootPath`, `entryFile`, `tools`), produces a `malformed-frontmatter` result
1204
+ * rather than a partial config.
1205
+ *
1206
+ * `name` is descriptive metadata — a user-supplied label that surfaces in
1207
+ * `aide_info` output. It is never branched on by any package code; different
1208
+ * brains may share names without affecting behavior.
1209
+ *
1210
+ * `mcpServerConfig.args` is `(string | null)[]` — every element is either a
1211
+ * fully-formed argument string OR YAML null. A null at any index is the
1212
+ * explicit unwired-slot signal; the parser preserves null entries verbatim at
1213
+ * their original indexes through to consumers. Downstream consumers
1214
+ * (`cli/sync`'s null-refusal, `buildBrainState`'s null-detection,
1215
+ * `interpolateArgs`'s null-passthrough) branch on null structurally.
1216
+ *
1217
+ * Consumed by `buildBrainState`, the brain tool, `provisionBrain`, and
1218
+ * `cli/sync`.
1219
+ */
1220
+ export type BrainAideConfig = {
1221
+ /** User-supplied descriptive label for the brain; never dispatched on by the package. */
1222
+ name: string;
1223
+ /**
1224
+ * MCP server configuration, with args typed `(string | null)[]`. String elements
1225
+ * may contain `${name}` placeholders resolved by `interpolateArgs`; null elements
1226
+ * are unwired-slot signals that pass through unchanged at their original index.
1227
+ */
1228
+ mcpServerConfig: BrainAideMcpServerConfig;
1229
+ };
1230
+ /**
1231
+ * The brain config's optional board location as `parseBrainAide` read it from the
1232
+ * frontmatter (observer brief commitment 112), consumed by the observer's board reader.
1233
+ */
1234
+ export type BrainKanbanField = {
1235
+ /** The `kanban` field is present and well-formed. */
1236
+ state: "declared";
1237
+ /** The board's source kind; only the brain's kanban folder is supported. */
1238
+ source: "folder";
1239
+ /** Absolute path of the brain's kanban folder, or YAML null while unwired (the typed unwired-slot signal, never a string sentinel). */
1240
+ path: string | null;
1241
+ } | {
1242
+ /** The `kanban` field is present but faulty. */
1243
+ state: "malformed";
1244
+ /** The faulty key. */
1245
+ field: "kanban" | "kanban.source" | "kanban.path";
1246
+ /** What is wrong, in words that follow the field name. */
1247
+ fault: string;
1248
+ };
1249
+ /**
1250
+ * Tagged-result union returned by `parseBrainAide` and `parseBrainAideFromString`.
1251
+ * The discriminant is `kind`. Consumers narrow on `kind` to handle each outcome.
1252
+ * The required sections, their order and their marker names come from
1253
+ * `brainContract` (`src/service/brainContract`); this type derives from it and
1254
+ * never restates the list.
1255
+ *
1256
+ * - `"ok"` - the file was found, frontmatter parsed cleanly, all required fields
1257
+ * validated, and the body carried every contract section in order. `name` and
1258
+ * `mcpServerConfig` are the flattened frontmatter fields sitting as siblings of
1259
+ * the section fields. Each section field carries the verbatim bytes between its
1260
+ * opening marker and matching closing marker, with no substitution. Bytes
1261
+ * outside any marker pair are silently ignored. The optional `kanban` field
1262
+ * (`BrainKanbanField`) carries the frontmatter's board location when present.
1263
+ *
1264
+ * - `"missing"` - `.aide/config/brain.aide` does not exist at the given root
1265
+ * (ENOENT only).
1266
+ *
1267
+ * - `"unreadable"` - the file exists but could not be read (EACCES, EISDIR, any
1268
+ * non-ENOENT I/O failure). `reason` names the read error. Consumers treat it as
1269
+ * a fault, never as absence.
1270
+ *
1271
+ * - `"malformed-frontmatter"` - the file exists but its YAML frontmatter could
1272
+ * not be parsed, a required field is absent or wrong-typed, or a deprecated
1273
+ * field is present. `reason` names the exact field or parse error.
1274
+ *
1275
+ * - `"malformed-body"` - frontmatter is valid but a present marker pair is
1276
+ * structurally unsound: unknown or mistyped marker token, unmatched opening or
1277
+ * closing marker (a half-present pair), wrong section order, or nested
1278
+ * markers. `reason` names the violating marker. Wholly absent pairs are not
1279
+ * this kind; they are `"missing-sections"`.
1280
+ *
1281
+ * - `"missing-sections"` - every present marker pair is structurally sound and
1282
+ * one or more whole pairs are absent. `sections` is non-empty and in contract
1283
+ * order. The present sections' bytes are carried verbatim in `present`
1284
+ * (absent ones are left out of the record), and `name` and `mcpServerConfig`
1285
+ * are carried exactly as on `"ok"`, so an old-shape file can still be checked
1286
+ * for stale sections and a legacy launcher. The optional `kanban` field is
1287
+ * carried exactly as on `"ok"`.
1288
+ */
1289
+ export type ParseBrainAideResult = ({
1290
+ kind: "ok";
1291
+ /** User-supplied descriptive label from brain.aide frontmatter; never dispatched on by the package. */
1292
+ name: string;
1293
+ /** MCP server configuration from brain.aide frontmatter, with args that may contain `${name}` placeholders. */
1294
+ mcpServerConfig: BrainAideMcpServerConfig;
1295
+ /** The frontmatter's optional board location; the key is absent when the frontmatter has no `kanban` field. A malformed field is reported here and never changes `kind`. */
1296
+ kanban?: BrainKanbanField;
1297
+ } & Record<BrainSectionField, string>) | {
1298
+ kind: "missing";
1299
+ } | {
1300
+ kind: "unreadable";
1301
+ reason: string;
1302
+ } | {
1303
+ kind: "malformed-frontmatter";
1304
+ reason: string;
1305
+ } | {
1306
+ kind: "malformed-body";
1307
+ reason: string;
1308
+ } | {
1309
+ kind: "missing-sections";
1310
+ sections: BrainSectionMarker[];
1311
+ /** User-supplied descriptive label from brain.aide frontmatter; never dispatched on by the package. */
1312
+ name: string;
1313
+ /** MCP server configuration from brain.aide frontmatter, carried exactly as on `"ok"`. */
1314
+ mcpServerConfig: BrainAideMcpServerConfig;
1315
+ /** The frontmatter's optional board location; the key is absent when the frontmatter has no `kanban` field. A malformed field is reported here and never changes `kind`. */
1316
+ kanban?: BrainKanbanField;
1317
+ /** Verbatim bytes between the markers of every section that is present; absent sections are left out. */
1318
+ present: Partial<Record<BrainSectionField, string>>;
1319
+ };
1320
+ /**
1321
+ * One marker token located in the brain.aide body by the parser's scan.
1322
+ * Consumed only by `src/service/parseBrainAide/extractMarkerSections`.
1323
+ */
1324
+ export type LocatedMarker = {
1325
+ /** Whether the token is an opening or a closing marker. */
1326
+ tokenKind: "open" | "close";
1327
+ /** The contract marker name the token belongs to. */
1328
+ marker: BrainSectionMarker;
1329
+ /** The token text exactly as written in the body. */
1330
+ text: string;
1331
+ /** Character index of the token in the body. */
1332
+ index: number;
1333
+ };
1334
+ /**
1335
+ * Outcome of the marker walk over the brain.aide body: every section's bytes,
1336
+ * a structural violation, or the whole pairs that are absent. Consumed only by
1337
+ * `src/service/parseBrainAide/extractMarkerSections`.
1338
+ */
1339
+ export type SectionExtraction = ({
1340
+ kind: "ok";
1341
+ } & Record<BrainSectionField, string>) | {
1342
+ kind: "malformed-body";
1343
+ reason: string;
1344
+ } | {
1345
+ kind: "missing-sections";
1346
+ sections: BrainSectionMarker[];
1347
+ /** Verbatim bytes between the markers of every section that is present; absent sections are left out. */
1348
+ present: Partial<Record<BrainSectionField, string>>;
1349
+ };
1350
+ /** One `args` item of a brain.aide `mcpServerConfig` located in the frontmatter region: its whole source line and its parsed value. */
1351
+ export type ArgLine = {
1352
+ start: number;
1353
+ end: number;
1354
+ value: string | null;
1355
+ };
1356
+ /** The aide entry's package-spec argument located in the raw MCP config text: `start` and `end` are the offsets of the whole JSON string token, quotes included, and `value` is its decoded string. Produced and consumed inside aide_upgrade's pin move. */
1357
+ export type PinToken = {
1358
+ start: number;
1359
+ end: number;
1360
+ value: string;
1361
+ };
1362
+ /** The byte offsets of one JSON value (a whole string token including quotes, or an array from `[` through `]`) in the raw MCP config text. Produced and consumed inside aide_upgrade's switch to the global command. */
1363
+ export type TokenRange = {
1364
+ start: number;
1365
+ end: number;
1366
+ };