@jacques-ai/cli 0.0.7-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (508) hide show
  1. package/dist/assets/mascot-ansi.d.ts +8 -0
  2. package/dist/assets/mascot-ansi.d.ts.map +1 -0
  3. package/dist/assets/mascot-ansi.js +15 -0
  4. package/dist/assets/mascot-ansi.js.map +1 -0
  5. package/dist/cli.d.ts +15 -0
  6. package/dist/cli.d.ts.map +1 -0
  7. package/dist/cli.js +53 -0
  8. package/dist/cli.js.map +1 -0
  9. package/dist/commands/client-helper.d.ts +14 -0
  10. package/dist/commands/client-helper.d.ts.map +1 -0
  11. package/dist/commands/client-helper.js +38 -0
  12. package/dist/commands/client-helper.js.map +1 -0
  13. package/dist/commands/dashboard.d.ts +8 -0
  14. package/dist/commands/dashboard.d.ts.map +1 -0
  15. package/dist/commands/dashboard.js +159 -0
  16. package/dist/commands/dashboard.js.map +1 -0
  17. package/dist/commands/index.d.ts +6 -0
  18. package/dist/commands/index.d.ts.map +1 -0
  19. package/dist/commands/index.js +6 -0
  20. package/dist/commands/index.js.map +1 -0
  21. package/dist/commands/list.d.ts +5 -0
  22. package/dist/commands/list.d.ts.map +1 -0
  23. package/dist/commands/list.js +13 -0
  24. package/dist/commands/list.js.map +1 -0
  25. package/dist/commands/search.d.ts +13 -0
  26. package/dist/commands/search.d.ts.map +1 -0
  27. package/dist/commands/search.js +79 -0
  28. package/dist/commands/search.js.map +1 -0
  29. package/dist/commands/setup.d.ts +8 -0
  30. package/dist/commands/setup.d.ts.map +1 -0
  31. package/dist/commands/setup.js +32 -0
  32. package/dist/commands/setup.js.map +1 -0
  33. package/dist/commands/status.d.ts +5 -0
  34. package/dist/commands/status.d.ts.map +1 -0
  35. package/dist/commands/status.js +27 -0
  36. package/dist/commands/status.js.map +1 -0
  37. package/dist/components/ActiveSessionsView.d.ts +18 -0
  38. package/dist/components/ActiveSessionsView.d.ts.map +1 -0
  39. package/dist/components/ActiveSessionsView.js +68 -0
  40. package/dist/components/ActiveSessionsView.js.map +1 -0
  41. package/dist/components/AddContextConfirmView.d.ts +21 -0
  42. package/dist/components/AddContextConfirmView.d.ts.map +1 -0
  43. package/dist/components/AddContextConfirmView.js +44 -0
  44. package/dist/components/AddContextConfirmView.js.map +1 -0
  45. package/dist/components/App.d.ts +11 -0
  46. package/dist/components/App.d.ts.map +1 -0
  47. package/dist/components/App.js +292 -0
  48. package/dist/components/App.js.map +1 -0
  49. package/dist/components/ArchiveBrowserView.d.ts +40 -0
  50. package/dist/components/ArchiveBrowserView.d.ts.map +1 -0
  51. package/dist/components/ArchiveBrowserView.js +161 -0
  52. package/dist/components/ArchiveBrowserView.js.map +1 -0
  53. package/dist/components/ArchiveInitProgressView.d.ts +16 -0
  54. package/dist/components/ArchiveInitProgressView.d.ts.map +1 -0
  55. package/dist/components/ArchiveInitProgressView.js +72 -0
  56. package/dist/components/ArchiveInitProgressView.js.map +1 -0
  57. package/dist/components/AutoCompactToggle.d.ts +16 -0
  58. package/dist/components/AutoCompactToggle.d.ts.map +1 -0
  59. package/dist/components/AutoCompactToggle.js +12 -0
  60. package/dist/components/AutoCompactToggle.js.map +1 -0
  61. package/dist/components/BottomControls.d.ts +12 -0
  62. package/dist/components/BottomControls.d.ts.map +1 -0
  63. package/dist/components/BottomControls.js +11 -0
  64. package/dist/components/BottomControls.js.map +1 -0
  65. package/dist/components/CompactHeader.d.ts +21 -0
  66. package/dist/components/CompactHeader.d.ts.map +1 -0
  67. package/dist/components/CompactHeader.js +63 -0
  68. package/dist/components/CompactHeader.js.map +1 -0
  69. package/dist/components/CompactPanel.d.ts +22 -0
  70. package/dist/components/CompactPanel.d.ts.map +1 -0
  71. package/dist/components/CompactPanel.js +31 -0
  72. package/dist/components/CompactPanel.js.map +1 -0
  73. package/dist/components/ContentBox.d.ts +14 -0
  74. package/dist/components/ContentBox.d.ts.map +1 -0
  75. package/dist/components/ContentBox.js +24 -0
  76. package/dist/components/ContentBox.js.map +1 -0
  77. package/dist/components/ContextProgress.d.ts +14 -0
  78. package/dist/components/ContextProgress.d.ts.map +1 -0
  79. package/dist/components/ContextProgress.js +36 -0
  80. package/dist/components/ContextProgress.js.map +1 -0
  81. package/dist/components/Dashboard.d.ts +46 -0
  82. package/dist/components/Dashboard.d.ts.map +1 -0
  83. package/dist/components/Dashboard.js +67 -0
  84. package/dist/components/Dashboard.js.map +1 -0
  85. package/dist/components/FilterSelectionView.d.ts +15 -0
  86. package/dist/components/FilterSelectionView.d.ts.map +1 -0
  87. package/dist/components/FilterSelectionView.js +27 -0
  88. package/dist/components/FilterSelectionView.js.map +1 -0
  89. package/dist/components/GoogleDocsBrowserView.d.ts +20 -0
  90. package/dist/components/GoogleDocsBrowserView.d.ts.map +1 -0
  91. package/dist/components/GoogleDocsBrowserView.js +72 -0
  92. package/dist/components/GoogleDocsBrowserView.js.map +1 -0
  93. package/dist/components/HandoffBrowserView.d.ts +20 -0
  94. package/dist/components/HandoffBrowserView.d.ts.map +1 -0
  95. package/dist/components/HandoffBrowserView.js +66 -0
  96. package/dist/components/HandoffBrowserView.js.map +1 -0
  97. package/dist/components/Header.d.ts +14 -0
  98. package/dist/components/Header.d.ts.map +1 -0
  99. package/dist/components/Header.js +16 -0
  100. package/dist/components/Header.js.map +1 -0
  101. package/dist/components/HorizontalMenu.d.ts +24 -0
  102. package/dist/components/HorizontalMenu.d.ts.map +1 -0
  103. package/dist/components/HorizontalMenu.js +20 -0
  104. package/dist/components/HorizontalMenu.js.map +1 -0
  105. package/dist/components/ImageMascot.d.ts +8 -0
  106. package/dist/components/ImageMascot.d.ts.map +1 -0
  107. package/dist/components/ImageMascot.js +7 -0
  108. package/dist/components/ImageMascot.js.map +1 -0
  109. package/dist/components/LLMWorkingView.d.ts +19 -0
  110. package/dist/components/LLMWorkingView.d.ts.map +1 -0
  111. package/dist/components/LLMWorkingView.js +72 -0
  112. package/dist/components/LLMWorkingView.js.map +1 -0
  113. package/dist/components/LoadContextView.d.ts +22 -0
  114. package/dist/components/LoadContextView.d.ts.map +1 -0
  115. package/dist/components/LoadContextView.js +83 -0
  116. package/dist/components/LoadContextView.js.map +1 -0
  117. package/dist/components/MainMenuView.d.ts +20 -0
  118. package/dist/components/MainMenuView.d.ts.map +1 -0
  119. package/dist/components/MainMenuView.js +49 -0
  120. package/dist/components/MainMenuView.js.map +1 -0
  121. package/dist/components/Mascot.d.ts +24 -0
  122. package/dist/components/Mascot.d.ts.map +1 -0
  123. package/dist/components/Mascot.js +32 -0
  124. package/dist/components/Mascot.js.map +1 -0
  125. package/dist/components/Menu.d.ts +22 -0
  126. package/dist/components/Menu.d.ts.map +1 -0
  127. package/dist/components/Menu.js +28 -0
  128. package/dist/components/Menu.js.map +1 -0
  129. package/dist/components/NotionBrowserView.d.ts +21 -0
  130. package/dist/components/NotionBrowserView.d.ts.map +1 -0
  131. package/dist/components/NotionBrowserView.js +75 -0
  132. package/dist/components/NotionBrowserView.js.map +1 -0
  133. package/dist/components/ObsidianBrowserView.d.ts +21 -0
  134. package/dist/components/ObsidianBrowserView.d.ts.map +1 -0
  135. package/dist/components/ObsidianBrowserView.js +74 -0
  136. package/dist/components/ObsidianBrowserView.js.map +1 -0
  137. package/dist/components/ObsidianConfigView.d.ts +19 -0
  138. package/dist/components/ObsidianConfigView.d.ts.map +1 -0
  139. package/dist/components/ObsidianConfigView.js +45 -0
  140. package/dist/components/ObsidianConfigView.js.map +1 -0
  141. package/dist/components/PlaceholderView.d.ts +15 -0
  142. package/dist/components/PlaceholderView.d.ts.map +1 -0
  143. package/dist/components/PlaceholderView.js +20 -0
  144. package/dist/components/PlaceholderView.js.map +1 -0
  145. package/dist/components/PlanViewerView.d.ts +26 -0
  146. package/dist/components/PlanViewerView.d.ts.map +1 -0
  147. package/dist/components/PlanViewerView.js +170 -0
  148. package/dist/components/PlanViewerView.js.map +1 -0
  149. package/dist/components/ProgressBar.d.ts +24 -0
  150. package/dist/components/ProgressBar.d.ts.map +1 -0
  151. package/dist/components/ProgressBar.js +23 -0
  152. package/dist/components/ProgressBar.js.map +1 -0
  153. package/dist/components/ProjectDashboardView.d.ts +38 -0
  154. package/dist/components/ProjectDashboardView.d.ts.map +1 -0
  155. package/dist/components/ProjectDashboardView.js +129 -0
  156. package/dist/components/ProjectDashboardView.js.map +1 -0
  157. package/dist/components/SaveContextView.d.ts +32 -0
  158. package/dist/components/SaveContextView.d.ts.map +1 -0
  159. package/dist/components/SaveContextView.js +41 -0
  160. package/dist/components/SaveContextView.js.map +1 -0
  161. package/dist/components/SessionDetails.d.ts +14 -0
  162. package/dist/components/SessionDetails.d.ts.map +1 -0
  163. package/dist/components/SessionDetails.js +87 -0
  164. package/dist/components/SessionDetails.js.map +1 -0
  165. package/dist/components/SessionsExperimentView.d.ts +35 -0
  166. package/dist/components/SessionsExperimentView.d.ts.map +1 -0
  167. package/dist/components/SessionsExperimentView.js +347 -0
  168. package/dist/components/SessionsExperimentView.js.map +1 -0
  169. package/dist/components/SessionsList.d.ts +20 -0
  170. package/dist/components/SessionsList.d.ts.map +1 -0
  171. package/dist/components/SessionsList.js +75 -0
  172. package/dist/components/SessionsList.js.map +1 -0
  173. package/dist/components/SettingsView.d.ts +48 -0
  174. package/dist/components/SettingsView.d.ts.map +1 -0
  175. package/dist/components/SettingsView.js +156 -0
  176. package/dist/components/SettingsView.js.map +1 -0
  177. package/dist/components/SourceSelectionView.d.ts +26 -0
  178. package/dist/components/SourceSelectionView.d.ts.map +1 -0
  179. package/dist/components/SourceSelectionView.js +109 -0
  180. package/dist/components/SourceSelectionView.js.map +1 -0
  181. package/dist/components/VerticalMenu.d.ts +18 -0
  182. package/dist/components/VerticalMenu.d.ts.map +1 -0
  183. package/dist/components/VerticalMenu.js +15 -0
  184. package/dist/components/VerticalMenu.js.map +1 -0
  185. package/dist/components/ascii-art/index.d.ts +6 -0
  186. package/dist/components/ascii-art/index.d.ts.map +1 -0
  187. package/dist/components/ascii-art/index.js +6 -0
  188. package/dist/components/ascii-art/index.js.map +1 -0
  189. package/dist/components/ascii-art/progress.d.ts +53 -0
  190. package/dist/components/ascii-art/progress.d.ts.map +1 -0
  191. package/dist/components/ascii-art/progress.js +102 -0
  192. package/dist/components/ascii-art/progress.js.map +1 -0
  193. package/dist/components/ascii-art/scene.d.ts +34 -0
  194. package/dist/components/ascii-art/scene.d.ts.map +1 -0
  195. package/dist/components/ascii-art/scene.js +72 -0
  196. package/dist/components/ascii-art/scene.js.map +1 -0
  197. package/dist/components/index.d.ts +27 -0
  198. package/dist/components/index.d.ts.map +1 -0
  199. package/dist/components/index.js +25 -0
  200. package/dist/components/index.js.map +1 -0
  201. package/dist/components/layout/HorizontalLayout.d.ts +19 -0
  202. package/dist/components/layout/HorizontalLayout.d.ts.map +1 -0
  203. package/dist/components/layout/HorizontalLayout.js +62 -0
  204. package/dist/components/layout/HorizontalLayout.js.map +1 -0
  205. package/dist/components/layout/VerticalLayout.d.ts +16 -0
  206. package/dist/components/layout/VerticalLayout.d.ts.map +1 -0
  207. package/dist/components/layout/VerticalLayout.js +32 -0
  208. package/dist/components/layout/VerticalLayout.js.map +1 -0
  209. package/dist/components/layout/index.d.ts +6 -0
  210. package/dist/components/layout/index.d.ts.map +1 -0
  211. package/dist/components/layout/index.js +4 -0
  212. package/dist/components/layout/index.js.map +1 -0
  213. package/dist/components/layout/theme.d.ts +20 -0
  214. package/dist/components/layout/theme.d.ts.map +1 -0
  215. package/dist/components/layout/theme.js +23 -0
  216. package/dist/components/layout/theme.js.map +1 -0
  217. package/dist/components/setup/DoneStep.d.ts +7 -0
  218. package/dist/components/setup/DoneStep.d.ts.map +1 -0
  219. package/dist/components/setup/DoneStep.js +31 -0
  220. package/dist/components/setup/DoneStep.js.map +1 -0
  221. package/dist/components/setup/InstallingStep.d.ts +11 -0
  222. package/dist/components/setup/InstallingStep.d.ts.map +1 -0
  223. package/dist/components/setup/InstallingStep.js +27 -0
  224. package/dist/components/setup/InstallingStep.js.map +1 -0
  225. package/dist/components/setup/OptionsStep.d.ts +9 -0
  226. package/dist/components/setup/OptionsStep.d.ts.map +1 -0
  227. package/dist/components/setup/OptionsStep.js +39 -0
  228. package/dist/components/setup/OptionsStep.js.map +1 -0
  229. package/dist/components/setup/PrerequisitesStep.d.ts +7 -0
  230. package/dist/components/setup/PrerequisitesStep.d.ts.map +1 -0
  231. package/dist/components/setup/PrerequisitesStep.js +31 -0
  232. package/dist/components/setup/PrerequisitesStep.js.map +1 -0
  233. package/dist/components/setup/SetupFrame.d.ts +17 -0
  234. package/dist/components/setup/SetupFrame.d.ts.map +1 -0
  235. package/dist/components/setup/SetupFrame.js +33 -0
  236. package/dist/components/setup/SetupFrame.js.map +1 -0
  237. package/dist/components/setup/SetupWizard.d.ts +9 -0
  238. package/dist/components/setup/SetupWizard.d.ts.map +1 -0
  239. package/dist/components/setup/SetupWizard.js +149 -0
  240. package/dist/components/setup/SetupWizard.js.map +1 -0
  241. package/dist/components/setup/Spinner.d.ts +10 -0
  242. package/dist/components/setup/Spinner.d.ts.map +1 -0
  243. package/dist/components/setup/Spinner.js +20 -0
  244. package/dist/components/setup/Spinner.js.map +1 -0
  245. package/dist/components/setup/SyncStep.d.ts +11 -0
  246. package/dist/components/setup/SyncStep.d.ts.map +1 -0
  247. package/dist/components/setup/SyncStep.js +47 -0
  248. package/dist/components/setup/SyncStep.js.map +1 -0
  249. package/dist/components/setup/VerificationStep.d.ts +7 -0
  250. package/dist/components/setup/VerificationStep.d.ts.map +1 -0
  251. package/dist/components/setup/VerificationStep.js +27 -0
  252. package/dist/components/setup/VerificationStep.js.map +1 -0
  253. package/dist/components/setup/WelcomeStep.d.ts +6 -0
  254. package/dist/components/setup/WelcomeStep.d.ts.map +1 -0
  255. package/dist/components/setup/WelcomeStep.js +17 -0
  256. package/dist/components/setup/WelcomeStep.js.map +1 -0
  257. package/dist/components/shared/ProgressLine.d.ts +10 -0
  258. package/dist/components/shared/ProgressLine.d.ts.map +1 -0
  259. package/dist/components/shared/ProgressLine.js +18 -0
  260. package/dist/components/shared/ProgressLine.js.map +1 -0
  261. package/dist/components/shared/ProjectLine.d.ts +10 -0
  262. package/dist/components/shared/ProjectLine.d.ts.map +1 -0
  263. package/dist/components/shared/ProjectLine.js +19 -0
  264. package/dist/components/shared/ProjectLine.js.map +1 -0
  265. package/dist/components/shared/ScanningIndicator.d.ts +9 -0
  266. package/dist/components/shared/ScanningIndicator.d.ts.map +1 -0
  267. package/dist/components/shared/ScanningIndicator.js +22 -0
  268. package/dist/components/shared/ScanningIndicator.js.map +1 -0
  269. package/dist/components/shared/StatusLine.d.ts +13 -0
  270. package/dist/components/shared/StatusLine.d.ts.map +1 -0
  271. package/dist/components/shared/StatusLine.js +24 -0
  272. package/dist/components/shared/StatusLine.js.map +1 -0
  273. package/dist/components/shared/StatusLine.test.d.ts +8 -0
  274. package/dist/components/shared/StatusLine.test.d.ts.map +1 -0
  275. package/dist/components/shared/StatusLine.test.js +50 -0
  276. package/dist/components/shared/StatusLine.test.js.map +1 -0
  277. package/dist/components/shared/index.d.ts +4 -0
  278. package/dist/components/shared/index.d.ts.map +1 -0
  279. package/dist/components/shared/index.js +4 -0
  280. package/dist/components/shared/index.js.map +1 -0
  281. package/dist/handoff/catalog.test.d.ts +5 -0
  282. package/dist/handoff/catalog.test.d.ts.map +1 -0
  283. package/dist/handoff/catalog.test.js +172 -0
  284. package/dist/handoff/catalog.test.js.map +1 -0
  285. package/dist/handoff/subagents.test.d.ts +8 -0
  286. package/dist/handoff/subagents.test.d.ts.map +1 -0
  287. package/dist/handoff/subagents.test.js +139 -0
  288. package/dist/handoff/subagents.test.js.map +1 -0
  289. package/dist/hooks/useAddContextFlow.d.ts +29 -0
  290. package/dist/hooks/useAddContextFlow.d.ts.map +1 -0
  291. package/dist/hooks/useAddContextFlow.js +83 -0
  292. package/dist/hooks/useAddContextFlow.js.map +1 -0
  293. package/dist/hooks/useArchiveBrowser.d.ts +37 -0
  294. package/dist/hooks/useArchiveBrowser.d.ts.map +1 -0
  295. package/dist/hooks/useArchiveBrowser.js +175 -0
  296. package/dist/hooks/useArchiveBrowser.js.map +1 -0
  297. package/dist/hooks/useClaudeToken.d.ts +29 -0
  298. package/dist/hooks/useClaudeToken.d.ts.map +1 -0
  299. package/dist/hooks/useClaudeToken.js +166 -0
  300. package/dist/hooks/useClaudeToken.js.map +1 -0
  301. package/dist/hooks/useGoogleDocsBrowser.d.ts +29 -0
  302. package/dist/hooks/useGoogleDocsBrowser.d.ts.map +1 -0
  303. package/dist/hooks/useGoogleDocsBrowser.js +146 -0
  304. package/dist/hooks/useGoogleDocsBrowser.js.map +1 -0
  305. package/dist/hooks/useHandoffBrowser.d.ts +27 -0
  306. package/dist/hooks/useHandoffBrowser.d.ts.map +1 -0
  307. package/dist/hooks/useHandoffBrowser.js +92 -0
  308. package/dist/hooks/useHandoffBrowser.js.map +1 -0
  309. package/dist/hooks/useJacquesClient.d.ts +69 -0
  310. package/dist/hooks/useJacquesClient.d.ts.map +1 -0
  311. package/dist/hooks/useJacquesClient.js +248 -0
  312. package/dist/hooks/useJacquesClient.js.map +1 -0
  313. package/dist/hooks/useLlmWorking.d.ts +30 -0
  314. package/dist/hooks/useLlmWorking.d.ts.map +1 -0
  315. package/dist/hooks/useLlmWorking.js +127 -0
  316. package/dist/hooks/useLlmWorking.js.map +1 -0
  317. package/dist/hooks/useLoadContext.d.ts +27 -0
  318. package/dist/hooks/useLoadContext.d.ts.map +1 -0
  319. package/dist/hooks/useLoadContext.js +102 -0
  320. package/dist/hooks/useLoadContext.js.map +1 -0
  321. package/dist/hooks/useNotification.d.ts +36 -0
  322. package/dist/hooks/useNotification.d.ts.map +1 -0
  323. package/dist/hooks/useNotification.js +89 -0
  324. package/dist/hooks/useNotification.js.map +1 -0
  325. package/dist/hooks/useNotification.test.d.ts +9 -0
  326. package/dist/hooks/useNotification.test.d.ts.map +1 -0
  327. package/dist/hooks/useNotification.test.js +144 -0
  328. package/dist/hooks/useNotification.test.js.map +1 -0
  329. package/dist/hooks/useNotionBrowser.d.ts +30 -0
  330. package/dist/hooks/useNotionBrowser.d.ts.map +1 -0
  331. package/dist/hooks/useNotionBrowser.js +154 -0
  332. package/dist/hooks/useNotionBrowser.js.map +1 -0
  333. package/dist/hooks/useObsidianBrowser.d.ts +42 -0
  334. package/dist/hooks/useObsidianBrowser.d.ts.map +1 -0
  335. package/dist/hooks/useObsidianBrowser.js +63 -0
  336. package/dist/hooks/useObsidianBrowser.js.map +1 -0
  337. package/dist/hooks/useObsidianConfig.d.ts +28 -0
  338. package/dist/hooks/useObsidianConfig.d.ts.map +1 -0
  339. package/dist/hooks/useObsidianConfig.js +119 -0
  340. package/dist/hooks/useObsidianConfig.js.map +1 -0
  341. package/dist/hooks/useObsidianFileBrowser.d.ts +29 -0
  342. package/dist/hooks/useObsidianFileBrowser.d.ts.map +1 -0
  343. package/dist/hooks/useObsidianFileBrowser.js +114 -0
  344. package/dist/hooks/useObsidianFileBrowser.js.map +1 -0
  345. package/dist/hooks/useProjectDashboard.d.ts +38 -0
  346. package/dist/hooks/useProjectDashboard.d.ts.map +1 -0
  347. package/dist/hooks/useProjectDashboard.js +224 -0
  348. package/dist/hooks/useProjectDashboard.js.map +1 -0
  349. package/dist/hooks/useProjectSelector.d.ts +17 -0
  350. package/dist/hooks/useProjectSelector.d.ts.map +1 -0
  351. package/dist/hooks/useProjectSelector.js +43 -0
  352. package/dist/hooks/useProjectSelector.js.map +1 -0
  353. package/dist/hooks/useProjectSelector.test.d.ts +7 -0
  354. package/dist/hooks/useProjectSelector.test.d.ts.map +1 -0
  355. package/dist/hooks/useProjectSelector.test.js +117 -0
  356. package/dist/hooks/useProjectSelector.test.js.map +1 -0
  357. package/dist/hooks/useSaveFlow.d.ts +30 -0
  358. package/dist/hooks/useSaveFlow.d.ts.map +1 -0
  359. package/dist/hooks/useSaveFlow.js +195 -0
  360. package/dist/hooks/useSaveFlow.js.map +1 -0
  361. package/dist/hooks/useSessions.test.d.ts +7 -0
  362. package/dist/hooks/useSessions.test.d.ts.map +1 -0
  363. package/dist/hooks/useSessions.test.js +153 -0
  364. package/dist/hooks/useSessions.test.js.map +1 -0
  365. package/dist/hooks/useSessionsExperiment.d.ts +97 -0
  366. package/dist/hooks/useSessionsExperiment.d.ts.map +1 -0
  367. package/dist/hooks/useSessionsExperiment.js +321 -0
  368. package/dist/hooks/useSessionsExperiment.js.map +1 -0
  369. package/dist/hooks/useSettings.d.ts +47 -0
  370. package/dist/hooks/useSettings.d.ts.map +1 -0
  371. package/dist/hooks/useSettings.js +245 -0
  372. package/dist/hooks/useSettings.js.map +1 -0
  373. package/dist/hooks/useSetupWizard.d.ts +35 -0
  374. package/dist/hooks/useSetupWizard.d.ts.map +1 -0
  375. package/dist/hooks/useSetupWizard.js +438 -0
  376. package/dist/hooks/useSetupWizard.js.map +1 -0
  377. package/dist/hooks/useUsageLimits.d.ts +24 -0
  378. package/dist/hooks/useUsageLimits.d.ts.map +1 -0
  379. package/dist/hooks/useUsageLimits.js +58 -0
  380. package/dist/hooks/useUsageLimits.js.map +1 -0
  381. package/dist/hooks/useUsageLimits.test.d.ts +7 -0
  382. package/dist/hooks/useUsageLimits.test.d.ts.map +1 -0
  383. package/dist/hooks/useUsageLimits.test.js +136 -0
  384. package/dist/hooks/useUsageLimits.test.js.map +1 -0
  385. package/dist/hooks/useWorktrees.d.ts +28 -0
  386. package/dist/hooks/useWorktrees.d.ts.map +1 -0
  387. package/dist/hooks/useWorktrees.js +57 -0
  388. package/dist/hooks/useWorktrees.js.map +1 -0
  389. package/dist/hooks/useWorktrees.test.d.ts +7 -0
  390. package/dist/hooks/useWorktrees.test.d.ts.map +1 -0
  391. package/dist/hooks/useWorktrees.test.js +119 -0
  392. package/dist/hooks/useWorktrees.test.js.map +1 -0
  393. package/dist/templates/compact-prompt.d.ts +16 -0
  394. package/dist/templates/compact-prompt.d.ts.map +1 -0
  395. package/dist/templates/compact-prompt.js +47 -0
  396. package/dist/templates/compact-prompt.js.map +1 -0
  397. package/dist/templates/context-skill.d.ts +8 -0
  398. package/dist/templates/context-skill.d.ts.map +1 -0
  399. package/dist/templates/context-skill.js +42 -0
  400. package/dist/templates/context-skill.js.map +1 -0
  401. package/dist/types.d.ts +127 -0
  402. package/dist/types.d.ts.map +1 -0
  403. package/dist/types.js +8 -0
  404. package/dist/types.js.map +1 -0
  405. package/dist/utils/activity.d.ts +17 -0
  406. package/dist/utils/activity.d.ts.map +1 -0
  407. package/dist/utils/activity.js +78 -0
  408. package/dist/utils/activity.js.map +1 -0
  409. package/dist/utils/bottom-controls.d.ts +24 -0
  410. package/dist/utils/bottom-controls.d.ts.map +1 -0
  411. package/dist/utils/bottom-controls.js +29 -0
  412. package/dist/utils/bottom-controls.js.map +1 -0
  413. package/dist/utils/clipboard.d.ts +2 -0
  414. package/dist/utils/clipboard.d.ts.map +1 -0
  415. package/dist/utils/clipboard.js +20 -0
  416. package/dist/utils/clipboard.js.map +1 -0
  417. package/dist/utils/constants.d.ts +6 -0
  418. package/dist/utils/constants.d.ts.map +1 -0
  419. package/dist/utils/constants.js +6 -0
  420. package/dist/utils/constants.js.map +1 -0
  421. package/dist/utils/format.d.ts +17 -0
  422. package/dist/utils/format.d.ts.map +1 -0
  423. package/dist/utils/format.js +31 -0
  424. package/dist/utils/format.js.map +1 -0
  425. package/dist/utils/session-mode.d.ts +14 -0
  426. package/dist/utils/session-mode.d.ts.map +1 -0
  427. package/dist/utils/session-mode.js +29 -0
  428. package/dist/utils/session-mode.js.map +1 -0
  429. package/dist/utils/session-mode.test.d.ts +7 -0
  430. package/dist/utils/session-mode.test.d.ts.map +1 -0
  431. package/dist/utils/session-mode.test.js +102 -0
  432. package/dist/utils/session-mode.test.js.map +1 -0
  433. package/dist/utils/sessions-items-builder.d.ts +29 -0
  434. package/dist/utils/sessions-items-builder.d.ts.map +1 -0
  435. package/dist/utils/sessions-items-builder.js +394 -0
  436. package/dist/utils/sessions-items-builder.js.map +1 -0
  437. package/dist/utils/settings.d.ts +100 -0
  438. package/dist/utils/settings.d.ts.map +1 -0
  439. package/dist/utils/settings.js +206 -0
  440. package/dist/utils/settings.js.map +1 -0
  441. package/dist/websocket-client.d.ts +70 -0
  442. package/dist/websocket-client.d.ts.map +1 -0
  443. package/dist/websocket-client.js +188 -0
  444. package/dist/websocket-client.js.map +1 -0
  445. package/hooks/adapters/__init__.py +17 -0
  446. package/hooks/adapters/__pycache__/__init__.cpython-311.pyc +0 -0
  447. package/hooks/adapters/__pycache__/__init__.cpython-313.pyc +0 -0
  448. package/hooks/adapters/__pycache__/__init__.cpython-314.pyc +0 -0
  449. package/hooks/adapters/__pycache__/base.cpython-311.pyc +0 -0
  450. package/hooks/adapters/__pycache__/base.cpython-313.pyc +0 -0
  451. package/hooks/adapters/__pycache__/base.cpython-314.pyc +0 -0
  452. package/hooks/adapters/__pycache__/calibration.cpython-311.pyc +0 -0
  453. package/hooks/adapters/__pycache__/calibration.cpython-313.pyc +0 -0
  454. package/hooks/adapters/__pycache__/calibration.cpython-314.pyc +0 -0
  455. package/hooks/adapters/__pycache__/claude_code.cpython-311.pyc +0 -0
  456. package/hooks/adapters/__pycache__/claude_code.cpython-313.pyc +0 -0
  457. package/hooks/adapters/__pycache__/claude_code.cpython-314.pyc +0 -0
  458. package/hooks/adapters/__pycache__/cursor.cpython-311.pyc +0 -0
  459. package/hooks/adapters/__pycache__/cursor.cpython-313.pyc +0 -0
  460. package/hooks/adapters/__pycache__/cursor.cpython-314.pyc +0 -0
  461. package/hooks/adapters/__pycache__/skills.cpython-311.pyc +0 -0
  462. package/hooks/adapters/__pycache__/skills.cpython-313.pyc +0 -0
  463. package/hooks/adapters/__pycache__/skills.cpython-314.pyc +0 -0
  464. package/hooks/adapters/__pycache__/test_adapters.cpython-311-pytest-9.0.2.pyc +0 -0
  465. package/hooks/adapters/__pycache__/test_adapters.cpython-313.pyc +0 -0
  466. package/hooks/adapters/__pycache__/test_calibration.cpython-311-pytest-9.0.2.pyc +0 -0
  467. package/hooks/adapters/__pycache__/test_skills.cpython-311-pytest-9.0.2.pyc +0 -0
  468. package/hooks/adapters/__pycache__/test_tokenizer.cpython-311-pytest-9.0.2.pyc +0 -0
  469. package/hooks/adapters/__pycache__/tokenizer.cpython-311.pyc +0 -0
  470. package/hooks/adapters/__pycache__/tokenizer.cpython-313.pyc +0 -0
  471. package/hooks/adapters/__pycache__/tokenizer.cpython-314.pyc +0 -0
  472. package/hooks/adapters/base.py +459 -0
  473. package/hooks/adapters/calibration.py +236 -0
  474. package/hooks/adapters/claude_code.py +316 -0
  475. package/hooks/adapters/context_parser.py +288 -0
  476. package/hooks/adapters/cursor.py +258 -0
  477. package/hooks/adapters/skills.py +160 -0
  478. package/hooks/adapters/template.py +281 -0
  479. package/hooks/adapters/test_adapters.py +516 -0
  480. package/hooks/adapters/test_calibration.py +235 -0
  481. package/hooks/adapters/test_skills.py +162 -0
  482. package/hooks/adapters/test_tokenizer.py +158 -0
  483. package/hooks/adapters/tokenizer.py +192 -0
  484. package/hooks/claude-code/pre-tool-use.py +36 -0
  485. package/hooks/claude-code/register-session.py +35 -0
  486. package/hooks/claude-code/report-activity.py +32 -0
  487. package/hooks/claude-code/session-idle.py +32 -0
  488. package/hooks/claude-code/statusline.sh +91 -0
  489. package/hooks/claude-code/unregister-session.py +32 -0
  490. package/hooks/cursor/README.md +61 -0
  491. package/hooks/cursor/after-agent-response.py +97 -0
  492. package/hooks/cursor/hooks.json.template +30 -0
  493. package/hooks/cursor/post-tool-use.py +32 -0
  494. package/hooks/cursor/pre-compact.py +61 -0
  495. package/hooks/cursor/session-end.py +32 -0
  496. package/hooks/cursor/session-start.py +66 -0
  497. package/hooks/git-detect.sh +47 -0
  498. package/hooks/install.py +441 -0
  499. package/hooks/jacques-register-session.py +286 -0
  500. package/hooks/jacques-report-activity.py +145 -0
  501. package/hooks/jacques-session-idle.py +57 -0
  502. package/hooks/jacques-unregister-session.py +57 -0
  503. package/hooks/requirements.txt +9 -0
  504. package/hooks/statusline.py +457 -0
  505. package/hooks/statusline.sh +212 -0
  506. package/package.json +63 -0
  507. package/skills/jacques-continue/SKILL.md +87 -0
  508. package/skills/jacques-handoff/SKILL.md +147 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusLine.js","sourceRoot":"","sources":["../../../src/components/shared/StatusLine.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGpE,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAC/C,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,IAAI,OAAO,CAAC,MAAM,KAAK,UAAU;QAAE,OAAO,SAAS,CAAC;IACpF,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,UAAU,CAAC;IACpD,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM;QAAE,OAAO,MAAM,CAAC;IAC7C,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EACzB,OAAO,GAGR;IACC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,MAAC,IAAI,IAAC,KAAK,EAAE,UAAU,aAAG,QAAQ,0BAA0B,CAAC;IACtE,CAAC;IAED,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACxE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAC9E,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,UAAU,IAAI,QAAQ,CAAC;IAExE,OAAO,CACL,MAAC,IAAI,IAAC,IAAI,EAAC,cAAc,aACvB,MAAC,IAAI,IAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,aAAG,QAAQ,CAAC,IAAI,OAAG,QAAQ,CAAC,KAAK,IAAQ,EACpE,KAAC,IAAI,IAAC,KAAK,EAAE,UAAU,YAAG,UAAU,GAAQ,EAC5C,KAAC,IAAI,IAAC,KAAK,EAAE,SAAS,YAAG,SAAS,GAAQ,EAC1C,KAAC,IAAI,IAAC,KAAK,EAAE,UAAU,YAAG,UAAU,GAAQ,EAC5C,KAAC,IAAI,IAAC,KAAK,EAAE,UAAU,YAAG,QAAQ,GAAQ,IACrC,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * StatusLine Pure Function Tests
3
+ *
4
+ * Tests getSessionStatus logic.
5
+ * (getSessionMode tests moved to utils/session-mode.test.ts)
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=StatusLine.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusLine.test.d.ts","sourceRoot":"","sources":["../../../src/components/shared/StatusLine.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * StatusLine Pure Function Tests
3
+ *
4
+ * Tests getSessionStatus logic.
5
+ * (getSessionMode tests moved to utils/session-mode.test.ts)
6
+ */
7
+ import { describe, it, expect } from "@jest/globals";
8
+ import { getSessionStatus } from "./StatusLine.js";
9
+ function makeSession(overrides = {}) {
10
+ return {
11
+ session_id: "test-123",
12
+ session_title: null,
13
+ transcript_path: null,
14
+ cwd: "/tmp/test",
15
+ project: "test-project",
16
+ model: null,
17
+ workspace: null,
18
+ terminal: null,
19
+ terminal_key: "test-key",
20
+ status: "idle",
21
+ last_activity: Date.now(),
22
+ registered_at: Date.now(),
23
+ context_metrics: null,
24
+ autocompact: null,
25
+ ...overrides,
26
+ };
27
+ }
28
+ describe("getSessionStatus", () => {
29
+ it("returns 'working' for status 'working'", () => {
30
+ const session = makeSession({ status: "working" });
31
+ expect(getSessionStatus(session)).toBe("working");
32
+ });
33
+ it("returns 'working' for status 'tool_use'", () => {
34
+ const session = makeSession({ status: "tool_use" });
35
+ expect(getSessionStatus(session)).toBe("working");
36
+ });
37
+ it("returns 'awaiting' for status 'waiting'", () => {
38
+ const session = makeSession({ status: "waiting" });
39
+ expect(getSessionStatus(session)).toBe("awaiting");
40
+ });
41
+ it("returns 'idle' for status 'idle'", () => {
42
+ const session = makeSession({ status: "idle" });
43
+ expect(getSessionStatus(session)).toBe("idle");
44
+ });
45
+ it("returns 'active' for unrecognized status", () => {
46
+ const session = makeSession({ status: "active" });
47
+ expect(getSessionStatus(session)).toBe("active");
48
+ });
49
+ });
50
+ //# sourceMappingURL=StatusLine.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusLine.test.js","sourceRoot":"","sources":["../../../src/components/shared/StatusLine.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGnD,SAAS,WAAW,CAAC,YAA8B,EAAE;IACnD,OAAO;QACL,UAAU,EAAE,UAAU;QACtB,aAAa,EAAE,IAAI;QACnB,eAAe,EAAE,IAAI;QACrB,GAAG,EAAE,WAAW;QAChB,OAAO,EAAE,cAAc;QACvB,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI;QACd,YAAY,EAAE,UAAU;QACxB,MAAM,EAAE,MAAM;QACd,aAAa,EAAE,IAAI,CAAC,GAAG,EAAE;QACzB,aAAa,EAAE,IAAI,CAAC,GAAG,EAAE;QACzB,eAAe,EAAE,IAAI;QACrB,WAAW,EAAE,IAAI;QACjB,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,OAAO,GAAG,WAAW,CAAC,EAAE,MAAM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=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { ProgressLine } from "./ProgressLine.js";
2
+ export { ProjectLine } from "./ProjectLine.js";
3
+ export { StatusLine } from "./StatusLine.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Handoff Catalog Tests
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=catalog.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.test.d.ts","sourceRoot":"","sources":["../../src/handoff/catalog.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Handoff Catalog Tests
3
+ */
4
+ import { describe, it, expect, beforeEach, afterEach } from "@jest/globals";
5
+ import { join } from "path";
6
+ import { promises as fs } from "fs";
7
+ import { tmpdir } from "os";
8
+ import { getHandoffsDir, parseTimestampFromFilename, generateHandoffFilename, formatHandoffDate, estimateHandoffTokens, formatTokenEstimate, listHandoffs, getHandoffContent, hasHandoffs, getLatestHandoff, ensureHandoffsDir, } from "@jacques-ai/core";
9
+ describe("HandoffCatalog", () => {
10
+ let testDir;
11
+ beforeEach(async () => {
12
+ // Create a unique temp directory for each test
13
+ testDir = join(tmpdir(), `jacques-test-${Date.now()}-${Math.random().toString(36).slice(2)}`);
14
+ await fs.mkdir(testDir, { recursive: true });
15
+ });
16
+ afterEach(async () => {
17
+ // Clean up temp directory
18
+ try {
19
+ await fs.rm(testDir, { recursive: true, force: true });
20
+ }
21
+ catch {
22
+ // Ignore cleanup errors
23
+ }
24
+ });
25
+ describe("getHandoffsDir", () => {
26
+ it("should return correct path", () => {
27
+ const result = getHandoffsDir("/my/project");
28
+ expect(result).toBe(join("/my/project", ".jacques", "handoffs"));
29
+ });
30
+ });
31
+ describe("parseTimestampFromFilename", () => {
32
+ it("should parse valid timestamp", () => {
33
+ const result = parseTimestampFromFilename("2026-01-31T14-30-00-handoff.md");
34
+ expect(result.getFullYear()).toBe(2026);
35
+ expect(result.getMonth()).toBe(0); // January
36
+ expect(result.getDate()).toBe(31);
37
+ expect(result.getHours()).toBe(14);
38
+ expect(result.getMinutes()).toBe(30);
39
+ expect(result.getSeconds()).toBe(0);
40
+ });
41
+ it("should return current date for invalid filename", () => {
42
+ const before = new Date();
43
+ const result = parseTimestampFromFilename("invalid.md");
44
+ const after = new Date();
45
+ expect(result.getTime()).toBeGreaterThanOrEqual(before.getTime());
46
+ expect(result.getTime()).toBeLessThanOrEqual(after.getTime());
47
+ });
48
+ });
49
+ describe("generateHandoffFilename", () => {
50
+ it("should generate valid filename format", () => {
51
+ const result = generateHandoffFilename();
52
+ expect(result).toMatch(/^\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}-handoff\.md$/);
53
+ });
54
+ it("should not contain colons", () => {
55
+ const result = generateHandoffFilename();
56
+ expect(result).not.toContain(":");
57
+ });
58
+ });
59
+ describe("formatHandoffDate", () => {
60
+ it("should format date for display", () => {
61
+ const date = new Date("2026-01-31T14:30:00");
62
+ const result = formatHandoffDate(date);
63
+ // Format depends on locale, but should contain the date components
64
+ expect(result).toContain("2026");
65
+ expect(result).toContain("01");
66
+ expect(result).toContain("31");
67
+ });
68
+ });
69
+ describe("estimateTokens", () => {
70
+ it("should estimate tokens from content length", () => {
71
+ const content = "a".repeat(450); // 450 chars / 4.5 = 100 tokens
72
+ const result = estimateHandoffTokens(content);
73
+ expect(result).toBe(100);
74
+ });
75
+ it("should round up", () => {
76
+ const content = "a".repeat(10); // 10 chars / 4.5 = 2.22... → 3
77
+ const result = estimateHandoffTokens(content);
78
+ expect(result).toBe(3);
79
+ });
80
+ });
81
+ describe("formatTokenEstimate", () => {
82
+ it("should format small numbers", () => {
83
+ expect(formatTokenEstimate(500)).toBe("500");
84
+ });
85
+ it("should format thousands with k suffix", () => {
86
+ expect(formatTokenEstimate(1000)).toBe("1.0k");
87
+ expect(formatTokenEstimate(2500)).toBe("2.5k");
88
+ });
89
+ });
90
+ describe("listHandoffs", () => {
91
+ it("should return empty catalog when directory does not exist", async () => {
92
+ const result = await listHandoffs(testDir);
93
+ expect(result.directory).toBe(getHandoffsDir(testDir));
94
+ expect(result.entries).toEqual([]);
95
+ });
96
+ it("should list handoff files sorted by timestamp (newest first)", async () => {
97
+ // Create handoffs directory and files
98
+ const handoffsDir = getHandoffsDir(testDir);
99
+ await fs.mkdir(handoffsDir, { recursive: true });
100
+ await fs.writeFile(join(handoffsDir, "2026-01-30T10-00-00-handoff.md"), "a".repeat(900) // ~200 tokens
101
+ );
102
+ await fs.writeFile(join(handoffsDir, "2026-01-31T14-30-00-handoff.md"), "b".repeat(1800) // ~400 tokens
103
+ );
104
+ await fs.writeFile(join(handoffsDir, "2026-01-30T16-45-00-handoff.md"), "c".repeat(450) // ~100 tokens
105
+ );
106
+ // Create a non-handoff file that should be filtered out
107
+ await fs.writeFile(join(handoffsDir, "other.txt"), "ignored");
108
+ const result = await listHandoffs(testDir);
109
+ expect(result.entries).toHaveLength(3);
110
+ // Should be sorted newest first
111
+ expect(result.entries[0].filename).toBe("2026-01-31T14-30-00-handoff.md");
112
+ expect(result.entries[1].filename).toBe("2026-01-30T16-45-00-handoff.md");
113
+ expect(result.entries[2].filename).toBe("2026-01-30T10-00-00-handoff.md");
114
+ });
115
+ it("should include token estimates", async () => {
116
+ const handoffsDir = getHandoffsDir(testDir);
117
+ await fs.mkdir(handoffsDir, { recursive: true });
118
+ await fs.writeFile(join(handoffsDir, "2026-01-31T14-30-00-handoff.md"), "a".repeat(900) // 900 / 4.5 = 200 tokens
119
+ );
120
+ const result = await listHandoffs(testDir);
121
+ expect(result.entries[0].tokenEstimate).toBe(200);
122
+ });
123
+ });
124
+ describe("getHandoffContent", () => {
125
+ it("should read file content", async () => {
126
+ const handoffsDir = getHandoffsDir(testDir);
127
+ await fs.mkdir(handoffsDir, { recursive: true });
128
+ const expectedContent = "# Session Handoff\n\nContent here";
129
+ const filePath = join(handoffsDir, "test-handoff.md");
130
+ await fs.writeFile(filePath, expectedContent);
131
+ const result = await getHandoffContent(filePath);
132
+ expect(result).toBe(expectedContent);
133
+ });
134
+ });
135
+ describe("hasHandoffs", () => {
136
+ it("should return false when no handoffs exist", async () => {
137
+ const result = await hasHandoffs(testDir);
138
+ expect(result).toBe(false);
139
+ });
140
+ it("should return true when handoffs exist", async () => {
141
+ const handoffsDir = getHandoffsDir(testDir);
142
+ await fs.mkdir(handoffsDir, { recursive: true });
143
+ await fs.writeFile(join(handoffsDir, "2026-01-31T14-30-00-handoff.md"), "content");
144
+ const result = await hasHandoffs(testDir);
145
+ expect(result).toBe(true);
146
+ });
147
+ });
148
+ describe("getLatestHandoff", () => {
149
+ it("should return null when no handoffs exist", async () => {
150
+ const result = await getLatestHandoff(testDir);
151
+ expect(result).toBeNull();
152
+ });
153
+ it("should return most recent handoff", async () => {
154
+ const handoffsDir = getHandoffsDir(testDir);
155
+ await fs.mkdir(handoffsDir, { recursive: true });
156
+ await fs.writeFile(join(handoffsDir, "2026-01-30T10-00-00-handoff.md"), "older");
157
+ await fs.writeFile(join(handoffsDir, "2026-01-31T14-30-00-handoff.md"), "newer");
158
+ const result = await getLatestHandoff(testDir);
159
+ expect(result?.filename).toBe("2026-01-31T14-30-00-handoff.md");
160
+ });
161
+ });
162
+ describe("ensureHandoffsDir", () => {
163
+ it("should create directory recursively", async () => {
164
+ const result = await ensureHandoffsDir(testDir);
165
+ expect(result).toBe(getHandoffsDir(testDir));
166
+ // Verify directory was created
167
+ const stats = await fs.stat(result);
168
+ expect(stats.isDirectory()).toBe(true);
169
+ });
170
+ });
171
+ });
172
+ //# sourceMappingURL=catalog.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.test.js","sourceRoot":"","sources":["../../src/handoff/catalog.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC5B,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAE1B,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAI,OAAe,CAAC;IAEpB,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,+CAA+C;QAC/C,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,gBAAgB,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC9F,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH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CAAC,CAAC,QAAQ,EAAE,CAAC;QAC5B,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mCAAmC,EAAE,KAAK,IAAI,EAAE;YACjD,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;YAC5C,MAAM,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACjD,MAAM,EAAE,CAAC,SAAS,CAChB,IAAI,CAAC,WAAW,EAAE,gCAAgC,CAAC,EACnD,OAAO,CACR,CAAC;YACF,MAAM,EAAE,CAAC,SAAS,CAChB,IAAI,CAAC,WAAW,EAAE,gCAAgC,CAAC,EACnD,OAAO,CACR,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC;YAE/C,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;QACjC,EAAE,CAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;YACnD,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,OAAO,CAAC,CAAC;YAEhD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;YAE7C,+BAA+B;YAC/B,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACpC,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Handoff Subagent Integration Tests
3
+ *
4
+ * Verifies that all required subagent files exist and have valid structure.
5
+ * These tests are skipped if the agents directory doesn't exist (e.g., fresh checkout).
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=subagents.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subagents.test.d.ts","sourceRoot":"","sources":["../../src/handoff/subagents.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,139 @@
1
+ /**
2
+ * Handoff Subagent Integration Tests
3
+ *
4
+ * Verifies that all required subagent files exist and have valid structure.
5
+ * These tests are skipped if the agents directory doesn't exist (e.g., fresh checkout).
6
+ */
7
+ import { describe, it, expect, beforeAll } from "@jest/globals";
8
+ import { promises as fs } from "fs";
9
+ import { join } from "path";
10
+ import { homedir } from "os";
11
+ const AGENTS_DIR = join(homedir(), ".claude", "agents");
12
+ const REQUIRED_AGENTS = [
13
+ "handoff-orchestrator",
14
+ "handoff-task-focus",
15
+ "handoff-progress",
16
+ "handoff-decisions",
17
+ "handoff-blockers",
18
+ "handoff-next-steps",
19
+ "handoff-warnings",
20
+ ];
21
+ const EXTRACTOR_AGENTS = REQUIRED_AGENTS.filter(a => a !== "handoff-orchestrator");
22
+ // Check if agents are installed
23
+ let agentsInstalled = false;
24
+ beforeAll(async () => {
25
+ const orchestratorPath = join(AGENTS_DIR, "handoff-orchestrator.md");
26
+ agentsInstalled = await fs.stat(orchestratorPath).then(() => true).catch(() => false);
27
+ });
28
+ const describeIfAgentsInstalled = () => agentsInstalled ? describe : describe.skip;
29
+ describe("Handoff Subagents", () => {
30
+ describe("subagent files", () => {
31
+ it.each(REQUIRED_AGENTS)("should have %s.md file", async (agentName) => {
32
+ if (!agentsInstalled) {
33
+ console.log(`Skipping: agents not installed at ${AGENTS_DIR}`);
34
+ return;
35
+ }
36
+ const filePath = join(AGENTS_DIR, `${agentName}.md`);
37
+ const exists = await fs.stat(filePath).then(() => true).catch(() => false);
38
+ expect(exists).toBe(true);
39
+ });
40
+ });
41
+ describe("subagent structure", () => {
42
+ it.each(REQUIRED_AGENTS)("%s should have valid YAML frontmatter", async (agentName) => {
43
+ if (!agentsInstalled)
44
+ return;
45
+ const filePath = join(AGENTS_DIR, `${agentName}.md`);
46
+ const content = await fs.readFile(filePath, "utf-8");
47
+ // Check frontmatter exists
48
+ expect(content).toMatch(/^---\n/);
49
+ expect(content).toMatch(/\n---\n/);
50
+ // Check required fields
51
+ expect(content).toContain(`name: ${agentName}`);
52
+ expect(content).toContain("description:");
53
+ });
54
+ it("orchestrator should have Task tool", async () => {
55
+ if (!agentsInstalled)
56
+ return;
57
+ const content = await fs.readFile(join(AGENTS_DIR, "handoff-orchestrator.md"), "utf-8");
58
+ expect(content).toContain("tools:");
59
+ expect(content).toMatch(/Task/);
60
+ });
61
+ it("orchestrator should have Write tool for saving handoff", async () => {
62
+ if (!agentsInstalled)
63
+ return;
64
+ const content = await fs.readFile(join(AGENTS_DIR, "handoff-orchestrator.md"), "utf-8");
65
+ expect(content).toMatch(/Write/);
66
+ });
67
+ it.each(EXTRACTOR_AGENTS)("%s should use haiku model", async (agentName) => {
68
+ if (!agentsInstalled)
69
+ return;
70
+ const content = await fs.readFile(join(AGENTS_DIR, `${agentName}.md`), "utf-8");
71
+ expect(content).toContain("model: haiku");
72
+ });
73
+ it.each(EXTRACTOR_AGENTS)("%s should have token budget guidance", async (agentName) => {
74
+ if (!agentsInstalled)
75
+ return;
76
+ const content = await fs.readFile(join(AGENTS_DIR, `${agentName}.md`), "utf-8");
77
+ // Each extractor should mention max tokens in output format
78
+ expect(content).toMatch(/max \d+ tokens|Output Format/i);
79
+ });
80
+ });
81
+ describe("orchestrator content", () => {
82
+ it("should reference all extractor agents", async () => {
83
+ if (!agentsInstalled)
84
+ return;
85
+ const content = await fs.readFile(join(AGENTS_DIR, "handoff-orchestrator.md"), "utf-8");
86
+ for (const extractor of EXTRACTOR_AGENTS) {
87
+ expect(content).toContain(extractor);
88
+ }
89
+ });
90
+ it("should specify output location", async () => {
91
+ if (!agentsInstalled)
92
+ return;
93
+ const content = await fs.readFile(join(AGENTS_DIR, "handoff-orchestrator.md"), "utf-8");
94
+ expect(content).toContain(".jacques/handoffs/");
95
+ });
96
+ it("should describe output format", async () => {
97
+ if (!agentsInstalled)
98
+ return;
99
+ const content = await fs.readFile(join(AGENTS_DIR, "handoff-orchestrator.md"), "utf-8");
100
+ expect(content).toContain("# Session Handoff");
101
+ expect(content).toContain("## Current Task");
102
+ expect(content).toContain("## Progress Made");
103
+ expect(content).toContain("## Next Steps");
104
+ });
105
+ });
106
+ describe("extractor outputs", () => {
107
+ it("handoff-task-focus should extract goal and approach", async () => {
108
+ if (!agentsInstalled)
109
+ return;
110
+ const content = await fs.readFile(join(AGENTS_DIR, "handoff-task-focus.md"), "utf-8");
111
+ expect(content).toContain("Working on");
112
+ expect(content).toContain("Goal");
113
+ expect(content).toContain("Approach");
114
+ });
115
+ it("handoff-progress should categorize by status", async () => {
116
+ if (!agentsInstalled)
117
+ return;
118
+ const content = await fs.readFile(join(AGENTS_DIR, "handoff-progress.md"), "utf-8");
119
+ expect(content).toContain("Completed");
120
+ expect(content).toContain("In Progress");
121
+ expect(content).toContain("Blocked");
122
+ });
123
+ it("handoff-decisions should use table format", async () => {
124
+ if (!agentsInstalled)
125
+ return;
126
+ const content = await fs.readFile(join(AGENTS_DIR, "handoff-decisions.md"), "utf-8");
127
+ expect(content).toContain("Decision");
128
+ expect(content).toContain("Reasoning");
129
+ });
130
+ it("handoff-next-steps should prioritize actions", async () => {
131
+ if (!agentsInstalled)
132
+ return;
133
+ const content = await fs.readFile(join(AGENTS_DIR, "handoff-next-steps.md"), "utf-8");
134
+ expect(content).toContain("Immediate");
135
+ expect(content).toContain("Short-term");
136
+ });
137
+ });
138
+ });
139
+ //# sourceMappingURL=subagents.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subagents.test.js","sourceRoot":"","sources":["../../src/handoff/subagents.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,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MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;YAC5D,IAAI,CAAC,eAAe;gBAAE,OAAO;YAC7B,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAC/B,IAAI,CAAC,UAAU,EAAE,uBAAuB,CAAC,EACzC,OAAO,CACR,CAAC;YACF,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;YACvC,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * useAddContextFlow Hook
3
+ *
4
+ * Manages the add-context confirmation dialog: description input, submit, success/error states.
5
+ */
6
+ import type { Key } from "ink";
7
+ import type { DashboardView } from "../components/Dashboard.js";
8
+ import type { ObsidianFile, Session } from "@jacques-ai/core";
9
+ export interface UseAddContextFlowParams {
10
+ setCurrentView: (view: DashboardView) => void;
11
+ focusedSession: Session | undefined;
12
+ }
13
+ export interface UseAddContextFlowState {
14
+ selectedFile: ObsidianFile | null;
15
+ contextDescription: string;
16
+ contextSuccess: {
17
+ name: string;
18
+ path: string;
19
+ } | null;
20
+ contextError: string | null;
21
+ }
22
+ export interface UseAddContextFlowReturn {
23
+ state: UseAddContextFlowState;
24
+ startConfirm: (file: ObsidianFile) => void;
25
+ handleInput: (input: string, key: Key) => void;
26
+ reset: () => void;
27
+ }
28
+ export declare function useAddContextFlow({ setCurrentView, focusedSession, }: UseAddContextFlowParams): UseAddContextFlowReturn;
29
+ //# sourceMappingURL=useAddContextFlow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAddContextFlow.d.ts","sourceRoot":"","sources":["../../src/hooks/useAddContextFlow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE9D,MAAM,WAAW,uBAAuB;IACtC,cAAc,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,cAAc,EAAE,OAAO,GAAG,SAAS,CAAC;CACrC;AAED,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACtD,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,sBAAsB,CAAC;IAC9B,YAAY,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC3C,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/C,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,cAAc,EACd,cAAc,GACf,EAAE,uBAAuB,GAAG,uBAAuB,CAiFnD"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * useAddContextFlow Hook
3
+ *
4
+ * Manages the add-context confirmation dialog: description input, submit, success/error states.
5
+ */
6
+ import { useState, useCallback } from "react";
7
+ import { addContext } from "@jacques-ai/core";
8
+ export function useAddContextFlow({ setCurrentView, focusedSession, }) {
9
+ const [selectedFile, setSelectedFile] = useState(null);
10
+ const [description, setDescription] = useState("");
11
+ const [success, setSuccess] = useState(null);
12
+ const [error, setError] = useState(null);
13
+ const handleConfirm = useCallback(async () => {
14
+ if (!selectedFile || !focusedSession)
15
+ return;
16
+ const cwd = focusedSession.workspace?.project_dir || focusedSession.cwd;
17
+ try {
18
+ const result = await addContext({
19
+ cwd,
20
+ sourceFile: selectedFile.path,
21
+ name: selectedFile.name,
22
+ source: "obsidian",
23
+ description: description || undefined,
24
+ });
25
+ setSuccess({ name: result.name, path: result.path });
26
+ }
27
+ catch (err) {
28
+ setError(`Failed to add context: ${err instanceof Error ? err.message : String(err)}`);
29
+ }
30
+ }, [selectedFile, focusedSession, description]);
31
+ const startConfirm = useCallback((file) => {
32
+ setSelectedFile(file);
33
+ setDescription("");
34
+ setSuccess(null);
35
+ setError(null);
36
+ setCurrentView("add-context-confirm");
37
+ }, [setCurrentView]);
38
+ const handleInput = useCallback((input, key) => {
39
+ if (success) {
40
+ setCurrentView("main");
41
+ return;
42
+ }
43
+ if (key.escape) {
44
+ setCurrentView("obsidian-browser");
45
+ setSelectedFile(null);
46
+ setDescription("");
47
+ setError(null);
48
+ return;
49
+ }
50
+ if (key.return && selectedFile && !error) {
51
+ handleConfirm();
52
+ return;
53
+ }
54
+ if (!error) {
55
+ if (key.backspace || key.delete) {
56
+ setDescription((prev) => prev.slice(0, -1));
57
+ return;
58
+ }
59
+ if (input && input.length === 1) {
60
+ setDescription((prev) => prev + input);
61
+ return;
62
+ }
63
+ }
64
+ }, [success, selectedFile, error, handleConfirm, setCurrentView]);
65
+ const reset = useCallback(() => {
66
+ setSelectedFile(null);
67
+ setDescription("");
68
+ setSuccess(null);
69
+ setError(null);
70
+ }, []);
71
+ return {
72
+ state: {
73
+ selectedFile,
74
+ contextDescription: description,
75
+ contextSuccess: success,
76
+ contextError: error,
77
+ },
78
+ startConfirm,
79
+ handleInput,
80
+ reset,
81
+ };
82
+ }
83
+ //# sourceMappingURL=useAddContextFlow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAddContextFlow.js","sourceRoot":"","sources":["../../src/hooks/useAddContextFlow.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AAC,IAAI,GAAG,KAAK,CAAC,CAAC;gBACvC,OAAO;YACT,CAAC;QACH,CAAC;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;IAElE,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;QAC7B,eAAe,CAAC,IAAI,CAAC,CAAC;QACtB,cAAc,CAAC,EAAE,CAAC,CAAC;QACnB,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,KAAK,EAAE;YACL,YAAY;YACZ,kBAAkB,EAAE,WAAW;YAC/B,cAAc,EAAE,OAAO;YACvB,YAAY,EAAE,KAAK;SACpB;QACD,YAAY;QACZ,WAAW;QACX,KAAK;KACN,CAAC;AACJ,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * useArchiveBrowser Hook
3
+ *
4
+ * Manages archive browser state: listing manifests by project,
5
+ * expand/collapse navigation, archive initialization with progress.
6
+ */
7
+ import type { Key } from "ink";
8
+ import type { DashboardView } from "../components/Dashboard.js";
9
+ import type { ConversationManifest, ArchiveProgress, ArchiveInitResult } from "@jacques-ai/core";
10
+ import type { ArchiveListItem } from "../components/ArchiveBrowserView.js";
11
+ export interface UseArchiveBrowserParams {
12
+ setCurrentView: (view: DashboardView) => void;
13
+ showNotification: (msg: string, duration?: number) => void;
14
+ onStatsReload: () => void;
15
+ }
16
+ export interface UseArchiveBrowserState {
17
+ items: ArchiveListItem[];
18
+ selectedIndex: number;
19
+ scrollOffset: number;
20
+ loading: boolean;
21
+ error: string | null;
22
+ initProgress: ArchiveProgress | null;
23
+ initResult: ArchiveInitResult | null;
24
+ manifestsByProject: Map<string, ConversationManifest[]>;
25
+ }
26
+ export interface UseArchiveBrowserReturn {
27
+ state: UseArchiveBrowserState;
28
+ loadBrowser: () => Promise<void>;
29
+ toggleProject: (projectId: string) => void;
30
+ initializeArchive: (options?: {
31
+ force?: boolean;
32
+ }) => Promise<void>;
33
+ handleInput: (input: string, key: Key, view: "archive-browser" | "archive-initializing") => void;
34
+ reset: () => void;
35
+ }
36
+ export declare function useArchiveBrowser({ setCurrentView, showNotification, onStatsReload, }: UseArchiveBrowserParams): UseArchiveBrowserReturn;
37
+ //# sourceMappingURL=useArchiveBrowser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useArchiveBrowser.d.ts","sourceRoot":"","sources":["../../src/hooks/useArchiveBrowser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAQhE,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAK1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE3E,MAAM,WAAW,uBAAuB;IACtC,cAAc,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,YAAY,EAAE,eAAe,GAAG,IAAI,CAAC;IACrC,UAAU,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACrC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAC;CACzD;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