@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.
- package/dist/assets/mascot-ansi.d.ts +8 -0
- package/dist/assets/mascot-ansi.d.ts.map +1 -0
- package/dist/assets/mascot-ansi.js +15 -0
- package/dist/assets/mascot-ansi.js.map +1 -0
- package/dist/cli.d.ts +15 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +53 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/client-helper.d.ts +14 -0
- package/dist/commands/client-helper.d.ts.map +1 -0
- package/dist/commands/client-helper.js +38 -0
- package/dist/commands/client-helper.js.map +1 -0
- package/dist/commands/dashboard.d.ts +8 -0
- package/dist/commands/dashboard.d.ts.map +1 -0
- package/dist/commands/dashboard.js +159 -0
- package/dist/commands/dashboard.js.map +1 -0
- package/dist/commands/index.d.ts +6 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +6 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/list.d.ts +5 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +13 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/search.d.ts +13 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +79 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/setup.d.ts +8 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +32 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/status.d.ts +5 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +27 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/components/ActiveSessionsView.d.ts +18 -0
- package/dist/components/ActiveSessionsView.d.ts.map +1 -0
- package/dist/components/ActiveSessionsView.js +68 -0
- package/dist/components/ActiveSessionsView.js.map +1 -0
- package/dist/components/AddContextConfirmView.d.ts +21 -0
- package/dist/components/AddContextConfirmView.d.ts.map +1 -0
- package/dist/components/AddContextConfirmView.js +44 -0
- package/dist/components/AddContextConfirmView.js.map +1 -0
- package/dist/components/App.d.ts +11 -0
- package/dist/components/App.d.ts.map +1 -0
- package/dist/components/App.js +292 -0
- package/dist/components/App.js.map +1 -0
- package/dist/components/ArchiveBrowserView.d.ts +40 -0
- package/dist/components/ArchiveBrowserView.d.ts.map +1 -0
- package/dist/components/ArchiveBrowserView.js +161 -0
- package/dist/components/ArchiveBrowserView.js.map +1 -0
- package/dist/components/ArchiveInitProgressView.d.ts +16 -0
- package/dist/components/ArchiveInitProgressView.d.ts.map +1 -0
- package/dist/components/ArchiveInitProgressView.js +72 -0
- package/dist/components/ArchiveInitProgressView.js.map +1 -0
- package/dist/components/AutoCompactToggle.d.ts +16 -0
- package/dist/components/AutoCompactToggle.d.ts.map +1 -0
- package/dist/components/AutoCompactToggle.js +12 -0
- package/dist/components/AutoCompactToggle.js.map +1 -0
- package/dist/components/BottomControls.d.ts +12 -0
- package/dist/components/BottomControls.d.ts.map +1 -0
- package/dist/components/BottomControls.js +11 -0
- package/dist/components/BottomControls.js.map +1 -0
- package/dist/components/CompactHeader.d.ts +21 -0
- package/dist/components/CompactHeader.d.ts.map +1 -0
- package/dist/components/CompactHeader.js +63 -0
- package/dist/components/CompactHeader.js.map +1 -0
- package/dist/components/CompactPanel.d.ts +22 -0
- package/dist/components/CompactPanel.d.ts.map +1 -0
- package/dist/components/CompactPanel.js +31 -0
- package/dist/components/CompactPanel.js.map +1 -0
- package/dist/components/ContentBox.d.ts +14 -0
- package/dist/components/ContentBox.d.ts.map +1 -0
- package/dist/components/ContentBox.js +24 -0
- package/dist/components/ContentBox.js.map +1 -0
- package/dist/components/ContextProgress.d.ts +14 -0
- package/dist/components/ContextProgress.d.ts.map +1 -0
- package/dist/components/ContextProgress.js +36 -0
- package/dist/components/ContextProgress.js.map +1 -0
- package/dist/components/Dashboard.d.ts +46 -0
- package/dist/components/Dashboard.d.ts.map +1 -0
- package/dist/components/Dashboard.js +67 -0
- package/dist/components/Dashboard.js.map +1 -0
- package/dist/components/FilterSelectionView.d.ts +15 -0
- package/dist/components/FilterSelectionView.d.ts.map +1 -0
- package/dist/components/FilterSelectionView.js +27 -0
- package/dist/components/FilterSelectionView.js.map +1 -0
- package/dist/components/GoogleDocsBrowserView.d.ts +20 -0
- package/dist/components/GoogleDocsBrowserView.d.ts.map +1 -0
- package/dist/components/GoogleDocsBrowserView.js +72 -0
- package/dist/components/GoogleDocsBrowserView.js.map +1 -0
- package/dist/components/HandoffBrowserView.d.ts +20 -0
- package/dist/components/HandoffBrowserView.d.ts.map +1 -0
- package/dist/components/HandoffBrowserView.js +66 -0
- package/dist/components/HandoffBrowserView.js.map +1 -0
- package/dist/components/Header.d.ts +14 -0
- package/dist/components/Header.d.ts.map +1 -0
- package/dist/components/Header.js +16 -0
- package/dist/components/Header.js.map +1 -0
- package/dist/components/HorizontalMenu.d.ts +24 -0
- package/dist/components/HorizontalMenu.d.ts.map +1 -0
- package/dist/components/HorizontalMenu.js +20 -0
- package/dist/components/HorizontalMenu.js.map +1 -0
- package/dist/components/ImageMascot.d.ts +8 -0
- package/dist/components/ImageMascot.d.ts.map +1 -0
- package/dist/components/ImageMascot.js +7 -0
- package/dist/components/ImageMascot.js.map +1 -0
- package/dist/components/LLMWorkingView.d.ts +19 -0
- package/dist/components/LLMWorkingView.d.ts.map +1 -0
- package/dist/components/LLMWorkingView.js +72 -0
- package/dist/components/LLMWorkingView.js.map +1 -0
- package/dist/components/LoadContextView.d.ts +22 -0
- package/dist/components/LoadContextView.d.ts.map +1 -0
- package/dist/components/LoadContextView.js +83 -0
- package/dist/components/LoadContextView.js.map +1 -0
- package/dist/components/MainMenuView.d.ts +20 -0
- package/dist/components/MainMenuView.d.ts.map +1 -0
- package/dist/components/MainMenuView.js +49 -0
- package/dist/components/MainMenuView.js.map +1 -0
- package/dist/components/Mascot.d.ts +24 -0
- package/dist/components/Mascot.d.ts.map +1 -0
- package/dist/components/Mascot.js +32 -0
- package/dist/components/Mascot.js.map +1 -0
- package/dist/components/Menu.d.ts +22 -0
- package/dist/components/Menu.d.ts.map +1 -0
- package/dist/components/Menu.js +28 -0
- package/dist/components/Menu.js.map +1 -0
- package/dist/components/NotionBrowserView.d.ts +21 -0
- package/dist/components/NotionBrowserView.d.ts.map +1 -0
- package/dist/components/NotionBrowserView.js +75 -0
- package/dist/components/NotionBrowserView.js.map +1 -0
- package/dist/components/ObsidianBrowserView.d.ts +21 -0
- package/dist/components/ObsidianBrowserView.d.ts.map +1 -0
- package/dist/components/ObsidianBrowserView.js +74 -0
- package/dist/components/ObsidianBrowserView.js.map +1 -0
- package/dist/components/ObsidianConfigView.d.ts +19 -0
- package/dist/components/ObsidianConfigView.d.ts.map +1 -0
- package/dist/components/ObsidianConfigView.js +45 -0
- package/dist/components/ObsidianConfigView.js.map +1 -0
- package/dist/components/PlaceholderView.d.ts +15 -0
- package/dist/components/PlaceholderView.d.ts.map +1 -0
- package/dist/components/PlaceholderView.js +20 -0
- package/dist/components/PlaceholderView.js.map +1 -0
- package/dist/components/PlanViewerView.d.ts +26 -0
- package/dist/components/PlanViewerView.d.ts.map +1 -0
- package/dist/components/PlanViewerView.js +170 -0
- package/dist/components/PlanViewerView.js.map +1 -0
- package/dist/components/ProgressBar.d.ts +24 -0
- package/dist/components/ProgressBar.d.ts.map +1 -0
- package/dist/components/ProgressBar.js +23 -0
- package/dist/components/ProgressBar.js.map +1 -0
- package/dist/components/ProjectDashboardView.d.ts +38 -0
- package/dist/components/ProjectDashboardView.d.ts.map +1 -0
- package/dist/components/ProjectDashboardView.js +129 -0
- package/dist/components/ProjectDashboardView.js.map +1 -0
- package/dist/components/SaveContextView.d.ts +32 -0
- package/dist/components/SaveContextView.d.ts.map +1 -0
- package/dist/components/SaveContextView.js +41 -0
- package/dist/components/SaveContextView.js.map +1 -0
- package/dist/components/SessionDetails.d.ts +14 -0
- package/dist/components/SessionDetails.d.ts.map +1 -0
- package/dist/components/SessionDetails.js +87 -0
- package/dist/components/SessionDetails.js.map +1 -0
- package/dist/components/SessionsExperimentView.d.ts +35 -0
- package/dist/components/SessionsExperimentView.d.ts.map +1 -0
- package/dist/components/SessionsExperimentView.js +347 -0
- package/dist/components/SessionsExperimentView.js.map +1 -0
- package/dist/components/SessionsList.d.ts +20 -0
- package/dist/components/SessionsList.d.ts.map +1 -0
- package/dist/components/SessionsList.js +75 -0
- package/dist/components/SessionsList.js.map +1 -0
- package/dist/components/SettingsView.d.ts +48 -0
- package/dist/components/SettingsView.d.ts.map +1 -0
- package/dist/components/SettingsView.js +156 -0
- package/dist/components/SettingsView.js.map +1 -0
- package/dist/components/SourceSelectionView.d.ts +26 -0
- package/dist/components/SourceSelectionView.d.ts.map +1 -0
- package/dist/components/SourceSelectionView.js +109 -0
- package/dist/components/SourceSelectionView.js.map +1 -0
- package/dist/components/VerticalMenu.d.ts +18 -0
- package/dist/components/VerticalMenu.d.ts.map +1 -0
- package/dist/components/VerticalMenu.js +15 -0
- package/dist/components/VerticalMenu.js.map +1 -0
- package/dist/components/ascii-art/index.d.ts +6 -0
- package/dist/components/ascii-art/index.d.ts.map +1 -0
- package/dist/components/ascii-art/index.js +6 -0
- package/dist/components/ascii-art/index.js.map +1 -0
- package/dist/components/ascii-art/progress.d.ts +53 -0
- package/dist/components/ascii-art/progress.d.ts.map +1 -0
- package/dist/components/ascii-art/progress.js +102 -0
- package/dist/components/ascii-art/progress.js.map +1 -0
- package/dist/components/ascii-art/scene.d.ts +34 -0
- package/dist/components/ascii-art/scene.d.ts.map +1 -0
- package/dist/components/ascii-art/scene.js +72 -0
- package/dist/components/ascii-art/scene.js.map +1 -0
- package/dist/components/index.d.ts +27 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +25 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/layout/HorizontalLayout.d.ts +19 -0
- package/dist/components/layout/HorizontalLayout.d.ts.map +1 -0
- package/dist/components/layout/HorizontalLayout.js +62 -0
- package/dist/components/layout/HorizontalLayout.js.map +1 -0
- package/dist/components/layout/VerticalLayout.d.ts +16 -0
- package/dist/components/layout/VerticalLayout.d.ts.map +1 -0
- package/dist/components/layout/VerticalLayout.js +32 -0
- package/dist/components/layout/VerticalLayout.js.map +1 -0
- package/dist/components/layout/index.d.ts +6 -0
- package/dist/components/layout/index.d.ts.map +1 -0
- package/dist/components/layout/index.js +4 -0
- package/dist/components/layout/index.js.map +1 -0
- package/dist/components/layout/theme.d.ts +20 -0
- package/dist/components/layout/theme.d.ts.map +1 -0
- package/dist/components/layout/theme.js +23 -0
- package/dist/components/layout/theme.js.map +1 -0
- package/dist/components/setup/DoneStep.d.ts +7 -0
- package/dist/components/setup/DoneStep.d.ts.map +1 -0
- package/dist/components/setup/DoneStep.js +31 -0
- package/dist/components/setup/DoneStep.js.map +1 -0
- package/dist/components/setup/InstallingStep.d.ts +11 -0
- package/dist/components/setup/InstallingStep.d.ts.map +1 -0
- package/dist/components/setup/InstallingStep.js +27 -0
- package/dist/components/setup/InstallingStep.js.map +1 -0
- package/dist/components/setup/OptionsStep.d.ts +9 -0
- package/dist/components/setup/OptionsStep.d.ts.map +1 -0
- package/dist/components/setup/OptionsStep.js +39 -0
- package/dist/components/setup/OptionsStep.js.map +1 -0
- package/dist/components/setup/PrerequisitesStep.d.ts +7 -0
- package/dist/components/setup/PrerequisitesStep.d.ts.map +1 -0
- package/dist/components/setup/PrerequisitesStep.js +31 -0
- package/dist/components/setup/PrerequisitesStep.js.map +1 -0
- package/dist/components/setup/SetupFrame.d.ts +17 -0
- package/dist/components/setup/SetupFrame.d.ts.map +1 -0
- package/dist/components/setup/SetupFrame.js +33 -0
- package/dist/components/setup/SetupFrame.js.map +1 -0
- package/dist/components/setup/SetupWizard.d.ts +9 -0
- package/dist/components/setup/SetupWizard.d.ts.map +1 -0
- package/dist/components/setup/SetupWizard.js +149 -0
- package/dist/components/setup/SetupWizard.js.map +1 -0
- package/dist/components/setup/Spinner.d.ts +10 -0
- package/dist/components/setup/Spinner.d.ts.map +1 -0
- package/dist/components/setup/Spinner.js +20 -0
- package/dist/components/setup/Spinner.js.map +1 -0
- package/dist/components/setup/SyncStep.d.ts +11 -0
- package/dist/components/setup/SyncStep.d.ts.map +1 -0
- package/dist/components/setup/SyncStep.js +47 -0
- package/dist/components/setup/SyncStep.js.map +1 -0
- package/dist/components/setup/VerificationStep.d.ts +7 -0
- package/dist/components/setup/VerificationStep.d.ts.map +1 -0
- package/dist/components/setup/VerificationStep.js +27 -0
- package/dist/components/setup/VerificationStep.js.map +1 -0
- package/dist/components/setup/WelcomeStep.d.ts +6 -0
- package/dist/components/setup/WelcomeStep.d.ts.map +1 -0
- package/dist/components/setup/WelcomeStep.js +17 -0
- package/dist/components/setup/WelcomeStep.js.map +1 -0
- package/dist/components/shared/ProgressLine.d.ts +10 -0
- package/dist/components/shared/ProgressLine.d.ts.map +1 -0
- package/dist/components/shared/ProgressLine.js +18 -0
- package/dist/components/shared/ProgressLine.js.map +1 -0
- package/dist/components/shared/ProjectLine.d.ts +10 -0
- package/dist/components/shared/ProjectLine.d.ts.map +1 -0
- package/dist/components/shared/ProjectLine.js +19 -0
- package/dist/components/shared/ProjectLine.js.map +1 -0
- package/dist/components/shared/ScanningIndicator.d.ts +9 -0
- package/dist/components/shared/ScanningIndicator.d.ts.map +1 -0
- package/dist/components/shared/ScanningIndicator.js +22 -0
- package/dist/components/shared/ScanningIndicator.js.map +1 -0
- package/dist/components/shared/StatusLine.d.ts +13 -0
- package/dist/components/shared/StatusLine.d.ts.map +1 -0
- package/dist/components/shared/StatusLine.js +24 -0
- package/dist/components/shared/StatusLine.js.map +1 -0
- package/dist/components/shared/StatusLine.test.d.ts +8 -0
- package/dist/components/shared/StatusLine.test.d.ts.map +1 -0
- package/dist/components/shared/StatusLine.test.js +50 -0
- package/dist/components/shared/StatusLine.test.js.map +1 -0
- package/dist/components/shared/index.d.ts +4 -0
- package/dist/components/shared/index.d.ts.map +1 -0
- package/dist/components/shared/index.js +4 -0
- package/dist/components/shared/index.js.map +1 -0
- package/dist/handoff/catalog.test.d.ts +5 -0
- package/dist/handoff/catalog.test.d.ts.map +1 -0
- package/dist/handoff/catalog.test.js +172 -0
- package/dist/handoff/catalog.test.js.map +1 -0
- package/dist/handoff/subagents.test.d.ts +8 -0
- package/dist/handoff/subagents.test.d.ts.map +1 -0
- package/dist/handoff/subagents.test.js +139 -0
- package/dist/handoff/subagents.test.js.map +1 -0
- package/dist/hooks/useAddContextFlow.d.ts +29 -0
- package/dist/hooks/useAddContextFlow.d.ts.map +1 -0
- package/dist/hooks/useAddContextFlow.js +83 -0
- package/dist/hooks/useAddContextFlow.js.map +1 -0
- package/dist/hooks/useArchiveBrowser.d.ts +37 -0
- package/dist/hooks/useArchiveBrowser.d.ts.map +1 -0
- package/dist/hooks/useArchiveBrowser.js +175 -0
- package/dist/hooks/useArchiveBrowser.js.map +1 -0
- package/dist/hooks/useClaudeToken.d.ts +29 -0
- package/dist/hooks/useClaudeToken.d.ts.map +1 -0
- package/dist/hooks/useClaudeToken.js +166 -0
- package/dist/hooks/useClaudeToken.js.map +1 -0
- package/dist/hooks/useGoogleDocsBrowser.d.ts +29 -0
- package/dist/hooks/useGoogleDocsBrowser.d.ts.map +1 -0
- package/dist/hooks/useGoogleDocsBrowser.js +146 -0
- package/dist/hooks/useGoogleDocsBrowser.js.map +1 -0
- package/dist/hooks/useHandoffBrowser.d.ts +27 -0
- package/dist/hooks/useHandoffBrowser.d.ts.map +1 -0
- package/dist/hooks/useHandoffBrowser.js +92 -0
- package/dist/hooks/useHandoffBrowser.js.map +1 -0
- package/dist/hooks/useJacquesClient.d.ts +69 -0
- package/dist/hooks/useJacquesClient.d.ts.map +1 -0
- package/dist/hooks/useJacquesClient.js +248 -0
- package/dist/hooks/useJacquesClient.js.map +1 -0
- package/dist/hooks/useLlmWorking.d.ts +30 -0
- package/dist/hooks/useLlmWorking.d.ts.map +1 -0
- package/dist/hooks/useLlmWorking.js +127 -0
- package/dist/hooks/useLlmWorking.js.map +1 -0
- package/dist/hooks/useLoadContext.d.ts +27 -0
- package/dist/hooks/useLoadContext.d.ts.map +1 -0
- package/dist/hooks/useLoadContext.js +102 -0
- package/dist/hooks/useLoadContext.js.map +1 -0
- package/dist/hooks/useNotification.d.ts +36 -0
- package/dist/hooks/useNotification.d.ts.map +1 -0
- package/dist/hooks/useNotification.js +89 -0
- package/dist/hooks/useNotification.js.map +1 -0
- package/dist/hooks/useNotification.test.d.ts +9 -0
- package/dist/hooks/useNotification.test.d.ts.map +1 -0
- package/dist/hooks/useNotification.test.js +144 -0
- package/dist/hooks/useNotification.test.js.map +1 -0
- package/dist/hooks/useNotionBrowser.d.ts +30 -0
- package/dist/hooks/useNotionBrowser.d.ts.map +1 -0
- package/dist/hooks/useNotionBrowser.js +154 -0
- package/dist/hooks/useNotionBrowser.js.map +1 -0
- package/dist/hooks/useObsidianBrowser.d.ts +42 -0
- package/dist/hooks/useObsidianBrowser.d.ts.map +1 -0
- package/dist/hooks/useObsidianBrowser.js +63 -0
- package/dist/hooks/useObsidianBrowser.js.map +1 -0
- package/dist/hooks/useObsidianConfig.d.ts +28 -0
- package/dist/hooks/useObsidianConfig.d.ts.map +1 -0
- package/dist/hooks/useObsidianConfig.js +119 -0
- package/dist/hooks/useObsidianConfig.js.map +1 -0
- package/dist/hooks/useObsidianFileBrowser.d.ts +29 -0
- package/dist/hooks/useObsidianFileBrowser.d.ts.map +1 -0
- package/dist/hooks/useObsidianFileBrowser.js +114 -0
- package/dist/hooks/useObsidianFileBrowser.js.map +1 -0
- package/dist/hooks/useProjectDashboard.d.ts +38 -0
- package/dist/hooks/useProjectDashboard.d.ts.map +1 -0
- package/dist/hooks/useProjectDashboard.js +224 -0
- package/dist/hooks/useProjectDashboard.js.map +1 -0
- package/dist/hooks/useProjectSelector.d.ts +17 -0
- package/dist/hooks/useProjectSelector.d.ts.map +1 -0
- package/dist/hooks/useProjectSelector.js +43 -0
- package/dist/hooks/useProjectSelector.js.map +1 -0
- package/dist/hooks/useProjectSelector.test.d.ts +7 -0
- package/dist/hooks/useProjectSelector.test.d.ts.map +1 -0
- package/dist/hooks/useProjectSelector.test.js +117 -0
- package/dist/hooks/useProjectSelector.test.js.map +1 -0
- package/dist/hooks/useSaveFlow.d.ts +30 -0
- package/dist/hooks/useSaveFlow.d.ts.map +1 -0
- package/dist/hooks/useSaveFlow.js +195 -0
- package/dist/hooks/useSaveFlow.js.map +1 -0
- package/dist/hooks/useSessions.test.d.ts +7 -0
- package/dist/hooks/useSessions.test.d.ts.map +1 -0
- package/dist/hooks/useSessions.test.js +153 -0
- package/dist/hooks/useSessions.test.js.map +1 -0
- package/dist/hooks/useSessionsExperiment.d.ts +97 -0
- package/dist/hooks/useSessionsExperiment.d.ts.map +1 -0
- package/dist/hooks/useSessionsExperiment.js +321 -0
- package/dist/hooks/useSessionsExperiment.js.map +1 -0
- package/dist/hooks/useSettings.d.ts +47 -0
- package/dist/hooks/useSettings.d.ts.map +1 -0
- package/dist/hooks/useSettings.js +245 -0
- package/dist/hooks/useSettings.js.map +1 -0
- package/dist/hooks/useSetupWizard.d.ts +35 -0
- package/dist/hooks/useSetupWizard.d.ts.map +1 -0
- package/dist/hooks/useSetupWizard.js +438 -0
- package/dist/hooks/useSetupWizard.js.map +1 -0
- package/dist/hooks/useUsageLimits.d.ts +24 -0
- package/dist/hooks/useUsageLimits.d.ts.map +1 -0
- package/dist/hooks/useUsageLimits.js +58 -0
- package/dist/hooks/useUsageLimits.js.map +1 -0
- package/dist/hooks/useUsageLimits.test.d.ts +7 -0
- package/dist/hooks/useUsageLimits.test.d.ts.map +1 -0
- package/dist/hooks/useUsageLimits.test.js +136 -0
- package/dist/hooks/useUsageLimits.test.js.map +1 -0
- package/dist/hooks/useWorktrees.d.ts +28 -0
- package/dist/hooks/useWorktrees.d.ts.map +1 -0
- package/dist/hooks/useWorktrees.js +57 -0
- package/dist/hooks/useWorktrees.js.map +1 -0
- package/dist/hooks/useWorktrees.test.d.ts +7 -0
- package/dist/hooks/useWorktrees.test.d.ts.map +1 -0
- package/dist/hooks/useWorktrees.test.js +119 -0
- package/dist/hooks/useWorktrees.test.js.map +1 -0
- package/dist/templates/compact-prompt.d.ts +16 -0
- package/dist/templates/compact-prompt.d.ts.map +1 -0
- package/dist/templates/compact-prompt.js +47 -0
- package/dist/templates/compact-prompt.js.map +1 -0
- package/dist/templates/context-skill.d.ts +8 -0
- package/dist/templates/context-skill.d.ts.map +1 -0
- package/dist/templates/context-skill.js +42 -0
- package/dist/templates/context-skill.js.map +1 -0
- package/dist/types.d.ts +127 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/activity.d.ts +17 -0
- package/dist/utils/activity.d.ts.map +1 -0
- package/dist/utils/activity.js +78 -0
- package/dist/utils/activity.js.map +1 -0
- package/dist/utils/bottom-controls.d.ts +24 -0
- package/dist/utils/bottom-controls.d.ts.map +1 -0
- package/dist/utils/bottom-controls.js +29 -0
- package/dist/utils/bottom-controls.js.map +1 -0
- package/dist/utils/clipboard.d.ts +2 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +20 -0
- package/dist/utils/clipboard.js.map +1 -0
- package/dist/utils/constants.d.ts +6 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/constants.js +6 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/format.d.ts +17 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/format.js +31 -0
- package/dist/utils/format.js.map +1 -0
- package/dist/utils/session-mode.d.ts +14 -0
- package/dist/utils/session-mode.d.ts.map +1 -0
- package/dist/utils/session-mode.js +29 -0
- package/dist/utils/session-mode.js.map +1 -0
- package/dist/utils/session-mode.test.d.ts +7 -0
- package/dist/utils/session-mode.test.d.ts.map +1 -0
- package/dist/utils/session-mode.test.js +102 -0
- package/dist/utils/session-mode.test.js.map +1 -0
- package/dist/utils/sessions-items-builder.d.ts +29 -0
- package/dist/utils/sessions-items-builder.d.ts.map +1 -0
- package/dist/utils/sessions-items-builder.js +394 -0
- package/dist/utils/sessions-items-builder.js.map +1 -0
- package/dist/utils/settings.d.ts +100 -0
- package/dist/utils/settings.d.ts.map +1 -0
- package/dist/utils/settings.js +206 -0
- package/dist/utils/settings.js.map +1 -0
- package/dist/websocket-client.d.ts +70 -0
- package/dist/websocket-client.d.ts.map +1 -0
- package/dist/websocket-client.js +188 -0
- package/dist/websocket-client.js.map +1 -0
- package/hooks/adapters/__init__.py +17 -0
- package/hooks/adapters/__pycache__/__init__.cpython-311.pyc +0 -0
- package/hooks/adapters/__pycache__/__init__.cpython-313.pyc +0 -0
- package/hooks/adapters/__pycache__/__init__.cpython-314.pyc +0 -0
- package/hooks/adapters/__pycache__/base.cpython-311.pyc +0 -0
- package/hooks/adapters/__pycache__/base.cpython-313.pyc +0 -0
- package/hooks/adapters/__pycache__/base.cpython-314.pyc +0 -0
- package/hooks/adapters/__pycache__/calibration.cpython-311.pyc +0 -0
- package/hooks/adapters/__pycache__/calibration.cpython-313.pyc +0 -0
- package/hooks/adapters/__pycache__/calibration.cpython-314.pyc +0 -0
- package/hooks/adapters/__pycache__/claude_code.cpython-311.pyc +0 -0
- package/hooks/adapters/__pycache__/claude_code.cpython-313.pyc +0 -0
- package/hooks/adapters/__pycache__/claude_code.cpython-314.pyc +0 -0
- package/hooks/adapters/__pycache__/cursor.cpython-311.pyc +0 -0
- package/hooks/adapters/__pycache__/cursor.cpython-313.pyc +0 -0
- package/hooks/adapters/__pycache__/cursor.cpython-314.pyc +0 -0
- package/hooks/adapters/__pycache__/skills.cpython-311.pyc +0 -0
- package/hooks/adapters/__pycache__/skills.cpython-313.pyc +0 -0
- package/hooks/adapters/__pycache__/skills.cpython-314.pyc +0 -0
- package/hooks/adapters/__pycache__/test_adapters.cpython-311-pytest-9.0.2.pyc +0 -0
- package/hooks/adapters/__pycache__/test_adapters.cpython-313.pyc +0 -0
- package/hooks/adapters/__pycache__/test_calibration.cpython-311-pytest-9.0.2.pyc +0 -0
- package/hooks/adapters/__pycache__/test_skills.cpython-311-pytest-9.0.2.pyc +0 -0
- package/hooks/adapters/__pycache__/test_tokenizer.cpython-311-pytest-9.0.2.pyc +0 -0
- package/hooks/adapters/__pycache__/tokenizer.cpython-311.pyc +0 -0
- package/hooks/adapters/__pycache__/tokenizer.cpython-313.pyc +0 -0
- package/hooks/adapters/__pycache__/tokenizer.cpython-314.pyc +0 -0
- package/hooks/adapters/base.py +459 -0
- package/hooks/adapters/calibration.py +236 -0
- package/hooks/adapters/claude_code.py +316 -0
- package/hooks/adapters/context_parser.py +288 -0
- package/hooks/adapters/cursor.py +258 -0
- package/hooks/adapters/skills.py +160 -0
- package/hooks/adapters/template.py +281 -0
- package/hooks/adapters/test_adapters.py +516 -0
- package/hooks/adapters/test_calibration.py +235 -0
- package/hooks/adapters/test_skills.py +162 -0
- package/hooks/adapters/test_tokenizer.py +158 -0
- package/hooks/adapters/tokenizer.py +192 -0
- package/hooks/claude-code/pre-tool-use.py +36 -0
- package/hooks/claude-code/register-session.py +35 -0
- package/hooks/claude-code/report-activity.py +32 -0
- package/hooks/claude-code/session-idle.py +32 -0
- package/hooks/claude-code/statusline.sh +91 -0
- package/hooks/claude-code/unregister-session.py +32 -0
- package/hooks/cursor/README.md +61 -0
- package/hooks/cursor/after-agent-response.py +97 -0
- package/hooks/cursor/hooks.json.template +30 -0
- package/hooks/cursor/post-tool-use.py +32 -0
- package/hooks/cursor/pre-compact.py +61 -0
- package/hooks/cursor/session-end.py +32 -0
- package/hooks/cursor/session-start.py +66 -0
- package/hooks/git-detect.sh +47 -0
- package/hooks/install.py +441 -0
- package/hooks/jacques-register-session.py +286 -0
- package/hooks/jacques-report-activity.py +145 -0
- package/hooks/jacques-session-idle.py +57 -0
- package/hooks/jacques-unregister-session.py +57 -0
- package/hooks/requirements.txt +9 -0
- package/hooks/statusline.py +457 -0
- package/hooks/statusline.sh +212 -0
- package/package.json +63 -0
- package/skills/jacques-continue/SKILL.md +87 -0
- package/skills/jacques-handoff/SKILL.md +147 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useProjectDashboard Hook
|
|
3
|
+
*
|
|
4
|
+
* Manages the project dashboard view: stats, sessions, plans,
|
|
5
|
+
* section navigation, and the plan viewer sub-view.
|
|
6
|
+
* Extracted from App.tsx.
|
|
7
|
+
*/
|
|
8
|
+
import { useState, useCallback, useRef } from "react";
|
|
9
|
+
import { aggregateProjectStatistics, buildProjectSessionList, getProjectPlans, readLocalPlanContent, computePlanProgress, computePlanProgressSummary, } from "@jacques-ai/core";
|
|
10
|
+
import { VISIBLE_SESSIONS, VISIBLE_PLANS } from "../components/ProjectDashboardView.js";
|
|
11
|
+
import { PLAN_VIEWER_VISIBLE_LINES } from "../components/PlanViewerView.js";
|
|
12
|
+
export function useProjectDashboard({ setCurrentView, showNotification, returnToMain, }) {
|
|
13
|
+
// Project dashboard state
|
|
14
|
+
const [projectDashboardStats, setProjectDashboardStats] = useState(null);
|
|
15
|
+
const [projectDashboardSessions, setProjectDashboardSessions] = useState([]);
|
|
16
|
+
const [projectDashboardPlans, setProjectDashboardPlans] = useState([]);
|
|
17
|
+
const [projectDashboardSection, setProjectDashboardSection] = useState("sessions");
|
|
18
|
+
const [projectDashboardSelectedIndex, setProjectDashboardSelectedIndex] = useState(0);
|
|
19
|
+
const [projectDashboardScrollOffset, setProjectDashboardScrollOffset] = useState(0);
|
|
20
|
+
const [projectDashboardLoading, setProjectDashboardLoading] = useState(false);
|
|
21
|
+
// Plan viewer state
|
|
22
|
+
const [planViewerPlan, setPlanViewerPlan] = useState(null);
|
|
23
|
+
const [planViewerContent, setPlanViewerContent] = useState("");
|
|
24
|
+
const [planViewerScrollOffset, setPlanViewerScrollOffset] = useState(0);
|
|
25
|
+
// Plan progress state
|
|
26
|
+
const [planProgressMap, setPlanProgressMap] = useState(new Map());
|
|
27
|
+
const [planViewerProgress, setPlanViewerProgress] = useState(null);
|
|
28
|
+
const [planViewerProgressLoading, setPlanViewerProgressLoading] = useState(false);
|
|
29
|
+
// Store cwd from open() for use in plan viewer enter handler
|
|
30
|
+
const cwdRef = useRef("");
|
|
31
|
+
// Open project dashboard - load stats, sessions, plans, compute progress
|
|
32
|
+
const open = useCallback((cwd, sessions, focusedSessionId) => {
|
|
33
|
+
// Store cwd for later use in plan viewer
|
|
34
|
+
cwdRef.current = cwd;
|
|
35
|
+
// Initialize dashboard state
|
|
36
|
+
setProjectDashboardLoading(true);
|
|
37
|
+
setProjectDashboardSection("sessions");
|
|
38
|
+
setProjectDashboardSelectedIndex(0);
|
|
39
|
+
setProjectDashboardScrollOffset(0);
|
|
40
|
+
setCurrentView("project-dashboard");
|
|
41
|
+
// Load dashboard data
|
|
42
|
+
Promise.all([
|
|
43
|
+
aggregateProjectStatistics(cwd, sessions),
|
|
44
|
+
buildProjectSessionList(cwd, sessions, focusedSessionId),
|
|
45
|
+
getProjectPlans(cwd),
|
|
46
|
+
]).then(async ([stats, sessionList, plans]) => {
|
|
47
|
+
setProjectDashboardStats(stats);
|
|
48
|
+
setProjectDashboardSessions(sessionList);
|
|
49
|
+
setProjectDashboardPlans(plans);
|
|
50
|
+
setProjectDashboardLoading(false);
|
|
51
|
+
// Compute plan progress asynchronously (don't block dashboard load)
|
|
52
|
+
setPlanProgressMap(new Map()); // Reset progress map
|
|
53
|
+
for (const plan of plans) {
|
|
54
|
+
try {
|
|
55
|
+
const content = await readLocalPlanContent(cwd, plan);
|
|
56
|
+
if (content) {
|
|
57
|
+
const summary = await computePlanProgressSummary(plan, content, cwd);
|
|
58
|
+
setPlanProgressMap((prev) => {
|
|
59
|
+
const next = new Map(prev);
|
|
60
|
+
next.set(plan.id, summary);
|
|
61
|
+
return next;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
// Skip failed progress computation for individual plans
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}).catch((err) => {
|
|
70
|
+
showNotification(`Failed to load dashboard: ${err instanceof Error ? err.message : String(err)}`);
|
|
71
|
+
setProjectDashboardLoading(false);
|
|
72
|
+
});
|
|
73
|
+
}, [setCurrentView, showNotification]);
|
|
74
|
+
// Handle keyboard input for project-dashboard and plan-viewer views
|
|
75
|
+
const handleInput = useCallback((input, key, view) => {
|
|
76
|
+
if (view === "project-dashboard") {
|
|
77
|
+
// Project dashboard view
|
|
78
|
+
if (key.escape) {
|
|
79
|
+
returnToMain();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
// Tab to switch between sessions and plans
|
|
83
|
+
if (key.tab) {
|
|
84
|
+
setProjectDashboardSection((prev) => prev === "sessions" ? "plans" : "sessions");
|
|
85
|
+
setProjectDashboardSelectedIndex(0);
|
|
86
|
+
setProjectDashboardScrollOffset(0);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
// Arrow key navigation
|
|
90
|
+
if (key.upArrow) {
|
|
91
|
+
const items = projectDashboardSection === "sessions"
|
|
92
|
+
? projectDashboardSessions
|
|
93
|
+
: projectDashboardPlans;
|
|
94
|
+
const visibleCount = projectDashboardSection === "sessions"
|
|
95
|
+
? VISIBLE_SESSIONS
|
|
96
|
+
: VISIBLE_PLANS;
|
|
97
|
+
const newIndex = Math.max(0, projectDashboardSelectedIndex - 1);
|
|
98
|
+
setProjectDashboardSelectedIndex(newIndex);
|
|
99
|
+
// Adjust scroll if needed
|
|
100
|
+
if (newIndex < projectDashboardScrollOffset) {
|
|
101
|
+
setProjectDashboardScrollOffset(newIndex);
|
|
102
|
+
}
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (key.downArrow) {
|
|
106
|
+
const items = projectDashboardSection === "sessions"
|
|
107
|
+
? projectDashboardSessions
|
|
108
|
+
: projectDashboardPlans;
|
|
109
|
+
const visibleCount = projectDashboardSection === "sessions"
|
|
110
|
+
? VISIBLE_SESSIONS
|
|
111
|
+
: VISIBLE_PLANS;
|
|
112
|
+
const newIndex = Math.min(items.length - 1, projectDashboardSelectedIndex + 1);
|
|
113
|
+
setProjectDashboardSelectedIndex(newIndex);
|
|
114
|
+
// Adjust scroll if needed
|
|
115
|
+
if (newIndex >= projectDashboardScrollOffset + visibleCount) {
|
|
116
|
+
setProjectDashboardScrollOffset(newIndex - visibleCount + 1);
|
|
117
|
+
}
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
// Enter to view plan content (only in plans section)
|
|
121
|
+
if (key.return && projectDashboardSection === "plans" && projectDashboardPlans.length > 0) {
|
|
122
|
+
const selectedPlan = projectDashboardPlans[projectDashboardSelectedIndex];
|
|
123
|
+
if (selectedPlan) {
|
|
124
|
+
const cwd = cwdRef.current;
|
|
125
|
+
setPlanViewerPlan(selectedPlan);
|
|
126
|
+
setPlanViewerScrollOffset(0);
|
|
127
|
+
setPlanViewerProgress(null);
|
|
128
|
+
setPlanViewerProgressLoading(true);
|
|
129
|
+
setCurrentView("plan-viewer");
|
|
130
|
+
// Load plan content and compute progress
|
|
131
|
+
readLocalPlanContent(cwd, selectedPlan).then(async (content) => {
|
|
132
|
+
const planContent = content || "Failed to load plan content";
|
|
133
|
+
setPlanViewerContent(planContent);
|
|
134
|
+
// Compute full progress for detailed view
|
|
135
|
+
if (content) {
|
|
136
|
+
try {
|
|
137
|
+
const progress = await computePlanProgress(selectedPlan, content, cwd);
|
|
138
|
+
setPlanViewerProgress(progress);
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
// Progress computation failed - that's okay
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
setPlanViewerProgressLoading(false);
|
|
145
|
+
}).catch(() => {
|
|
146
|
+
setPlanViewerContent("Failed to load plan content");
|
|
147
|
+
setPlanViewerProgressLoading(false);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else if (view === "plan-viewer") {
|
|
154
|
+
// Plan viewer - scrolling and exit
|
|
155
|
+
if (key.escape) {
|
|
156
|
+
setCurrentView("project-dashboard");
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
// Scroll content
|
|
160
|
+
if (key.upArrow) {
|
|
161
|
+
setPlanViewerScrollOffset((prev) => Math.max(0, prev - 1));
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (key.downArrow) {
|
|
165
|
+
setPlanViewerScrollOffset((prev) => prev + 1);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
// Page up/down
|
|
169
|
+
if (key.pageUp) {
|
|
170
|
+
setPlanViewerScrollOffset((prev) => Math.max(0, prev - PLAN_VIEWER_VISIBLE_LINES));
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (key.pageDown) {
|
|
174
|
+
setPlanViewerScrollOffset((prev) => prev + PLAN_VIEWER_VISIBLE_LINES);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}, [
|
|
179
|
+
projectDashboardSection,
|
|
180
|
+
projectDashboardSessions,
|
|
181
|
+
projectDashboardPlans,
|
|
182
|
+
projectDashboardSelectedIndex,
|
|
183
|
+
projectDashboardScrollOffset,
|
|
184
|
+
returnToMain,
|
|
185
|
+
setCurrentView,
|
|
186
|
+
]);
|
|
187
|
+
// Reset all state
|
|
188
|
+
const reset = useCallback(() => {
|
|
189
|
+
setProjectDashboardStats(null);
|
|
190
|
+
setProjectDashboardSessions([]);
|
|
191
|
+
setProjectDashboardPlans([]);
|
|
192
|
+
setProjectDashboardSection("sessions");
|
|
193
|
+
setProjectDashboardSelectedIndex(0);
|
|
194
|
+
setProjectDashboardScrollOffset(0);
|
|
195
|
+
setProjectDashboardLoading(false);
|
|
196
|
+
setPlanProgressMap(new Map());
|
|
197
|
+
setPlanViewerPlan(null);
|
|
198
|
+
setPlanViewerContent("");
|
|
199
|
+
setPlanViewerScrollOffset(0);
|
|
200
|
+
setPlanViewerProgress(null);
|
|
201
|
+
setPlanViewerProgressLoading(false);
|
|
202
|
+
}, []);
|
|
203
|
+
return {
|
|
204
|
+
state: {
|
|
205
|
+
stats: projectDashboardStats,
|
|
206
|
+
dashboardSessions: projectDashboardSessions,
|
|
207
|
+
plans: projectDashboardPlans,
|
|
208
|
+
section: projectDashboardSection,
|
|
209
|
+
selectedIndex: projectDashboardSelectedIndex,
|
|
210
|
+
scrollOffset: projectDashboardScrollOffset,
|
|
211
|
+
loading: projectDashboardLoading,
|
|
212
|
+
planProgressMap,
|
|
213
|
+
planViewerPlan,
|
|
214
|
+
planViewerContent,
|
|
215
|
+
planViewerScrollOffset,
|
|
216
|
+
planViewerProgress,
|
|
217
|
+
planViewerProgressLoading,
|
|
218
|
+
},
|
|
219
|
+
open,
|
|
220
|
+
handleInput,
|
|
221
|
+
reset,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=useProjectDashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProjectDashboard.js","sourceRoot":"","sources":["../../src/hooks/useProjectDashboard.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAS1B,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AA+B5E,MAAM,UAAU,mBAAmB,CAAC,EAClC,cAAc,EACd,gBAAgB,EAChB,YAAY,GACc;IAC1B,0BAA0B;IAC1B,MAAM,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,GAAG,QAAQ,CAA2B,IAAI,CAAC,CAAC;IACnG,MAAM,CAAC,wBAAwB,EAAE,2BAA2B,CAAC,GAA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AAE,qBAAqB;YAC5B,iBAAiB,EAAE,wBAAwB;YAC3C,KAAK,EAAE,qBAAqB;YAC5B,OAAO,EAAE,uBAAuB;YAChC,aAAa,EAAE,6BAA6B;YAC5C,YAAY,EAAE,4BAA4B;YAC1C,OAAO,EAAE,uBAAuB;YAChC,eAAe;YACf,cAAc;YACd,iBAAiB;YACjB,sBAAsB;YACtB,kBAAkB;YAClB,yBAAyB;SAC1B;QACD,IAAI;QACJ,WAAW;QACX,KAAK;KACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useProjectSelector Hook
|
|
3
|
+
*
|
|
4
|
+
* Fetches discovered projects from the server API and manages
|
|
5
|
+
* the selected project for scoping views.
|
|
6
|
+
*/
|
|
7
|
+
import type { DiscoveredProject } from "@jacques-ai/core";
|
|
8
|
+
export type { DiscoveredProject };
|
|
9
|
+
export interface UseProjectSelectorReturn {
|
|
10
|
+
projects: DiscoveredProject[];
|
|
11
|
+
selectedProject: string | null;
|
|
12
|
+
init: () => void;
|
|
13
|
+
reset: () => void;
|
|
14
|
+
setSelectedProject: (name: string | null) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function useProjectSelector(): UseProjectSelectorReturn;
|
|
17
|
+
//# sourceMappingURL=useProjectSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProjectSelector.d.ts","sourceRoot":"","sources":["../../src/hooks/useProjectSelector.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAElC,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACnD;AAID,wBAAgB,kBAAkB,IAAI,wBAAwB,CAoC7D"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useProjectSelector Hook
|
|
3
|
+
*
|
|
4
|
+
* Fetches discovered projects from the server API and manages
|
|
5
|
+
* the selected project for scoping views.
|
|
6
|
+
*/
|
|
7
|
+
import { useState, useCallback } from "react";
|
|
8
|
+
const API_BASE = "http://localhost:4243";
|
|
9
|
+
export function useProjectSelector() {
|
|
10
|
+
const [projects, setProjects] = useState([]);
|
|
11
|
+
const [selectedProject, setSelectedProject] = useState(null);
|
|
12
|
+
const fetchProjects = useCallback(() => {
|
|
13
|
+
fetch(`${API_BASE}/api/projects`)
|
|
14
|
+
.then((res) => {
|
|
15
|
+
if (!res.ok)
|
|
16
|
+
throw new Error(`HTTP ${res.status}`);
|
|
17
|
+
return res.json();
|
|
18
|
+
})
|
|
19
|
+
.then((raw) => {
|
|
20
|
+
const data = raw;
|
|
21
|
+
const list = data.projects || [];
|
|
22
|
+
list.sort((a, b) => b.sessionCount - a.sessionCount || a.name.localeCompare(b.name));
|
|
23
|
+
setProjects(list);
|
|
24
|
+
})
|
|
25
|
+
.catch(() => {
|
|
26
|
+
// Silently fail — projects will be empty
|
|
27
|
+
});
|
|
28
|
+
}, []);
|
|
29
|
+
const init = useCallback(() => {
|
|
30
|
+
fetchProjects();
|
|
31
|
+
}, [fetchProjects]);
|
|
32
|
+
const reset = useCallback(() => {
|
|
33
|
+
// No-op — keep projects and selectedProject across view transitions
|
|
34
|
+
}, []);
|
|
35
|
+
return {
|
|
36
|
+
projects,
|
|
37
|
+
selectedProject,
|
|
38
|
+
init,
|
|
39
|
+
reset,
|
|
40
|
+
setSelectedProject,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=useProjectSelector.js.map
|
|
@@ -0,0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WAAW,CAAC,GAAG,EAAE;QAC5B,aAAa,EAAE,CAAC;IAClB,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;QAC7B,oEAAoE;IACtE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,QAAQ;QACR,eAAe;QACf,IAAI;QACJ,KAAK;QACL,kBAAkB;KACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProjectSelector.test.d.ts","sourceRoot":"","sources":["../../src/hooks/useProjectSelector.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useProjectSelector Tests
|
|
3
|
+
*
|
|
4
|
+
* Tests project sorting, selection logic, and scroll behavior.
|
|
5
|
+
*/
|
|
6
|
+
import { describe, it, expect } from "@jest/globals";
|
|
7
|
+
function makeProject(overrides = {}) {
|
|
8
|
+
return {
|
|
9
|
+
name: "test-project",
|
|
10
|
+
gitRepoRoot: null,
|
|
11
|
+
isGitProject: false,
|
|
12
|
+
projectPaths: [],
|
|
13
|
+
encodedPaths: [],
|
|
14
|
+
sessionCount: 0,
|
|
15
|
+
lastActivity: null,
|
|
16
|
+
...overrides,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
describe("project sorting", () => {
|
|
20
|
+
it("sorts by session count descending", () => {
|
|
21
|
+
const projects = [
|
|
22
|
+
makeProject({ name: "a", sessionCount: 1 }),
|
|
23
|
+
makeProject({ name: "b", sessionCount: 5 }),
|
|
24
|
+
makeProject({ name: "c", sessionCount: 3 }),
|
|
25
|
+
];
|
|
26
|
+
projects.sort((a, b) => b.sessionCount - a.sessionCount || a.name.localeCompare(b.name));
|
|
27
|
+
expect(projects[0].name).toBe("b");
|
|
28
|
+
expect(projects[1].name).toBe("c");
|
|
29
|
+
expect(projects[2].name).toBe("a");
|
|
30
|
+
});
|
|
31
|
+
it("breaks ties alphabetically by name", () => {
|
|
32
|
+
const projects = [
|
|
33
|
+
makeProject({ name: "zebra", sessionCount: 2 }),
|
|
34
|
+
makeProject({ name: "alpha", sessionCount: 2 }),
|
|
35
|
+
makeProject({ name: "mango", sessionCount: 2 }),
|
|
36
|
+
];
|
|
37
|
+
projects.sort((a, b) => b.sessionCount - a.sessionCount || a.name.localeCompare(b.name));
|
|
38
|
+
expect(projects[0].name).toBe("alpha");
|
|
39
|
+
expect(projects[1].name).toBe("mango");
|
|
40
|
+
expect(projects[2].name).toBe("zebra");
|
|
41
|
+
});
|
|
42
|
+
it("handles empty project list", () => {
|
|
43
|
+
const projects = [];
|
|
44
|
+
projects.sort((a, b) => b.sessionCount - a.sessionCount || a.name.localeCompare(b.name));
|
|
45
|
+
expect(projects).toHaveLength(0);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
describe("project data mapping from API", () => {
|
|
49
|
+
it("maps API response to DiscoveredProject", () => {
|
|
50
|
+
const raw = {
|
|
51
|
+
name: "my-project",
|
|
52
|
+
gitRepoRoot: "/home/user/my-project",
|
|
53
|
+
isGitProject: true,
|
|
54
|
+
projectPaths: ["/home/user/my-project", "/home/user/my-project-feature"],
|
|
55
|
+
encodedPaths: ["-home-user-my-project", "-home-user-my-project-feature"],
|
|
56
|
+
sessionCount: 3,
|
|
57
|
+
lastActivity: "2026-02-09T12:00:00Z",
|
|
58
|
+
};
|
|
59
|
+
const project = raw;
|
|
60
|
+
expect(project.name).toBe("my-project");
|
|
61
|
+
expect(project.sessionCount).toBe(3);
|
|
62
|
+
expect(project.projectPaths).toHaveLength(2);
|
|
63
|
+
expect(project.isGitProject).toBe(true);
|
|
64
|
+
expect(project.gitRepoRoot).toBe("/home/user/my-project");
|
|
65
|
+
});
|
|
66
|
+
it("handles non-git project without gitRepoRoot", () => {
|
|
67
|
+
const project = makeProject({
|
|
68
|
+
name: "standalone",
|
|
69
|
+
gitRepoRoot: null,
|
|
70
|
+
isGitProject: false,
|
|
71
|
+
});
|
|
72
|
+
expect(project.gitRepoRoot).toBeNull();
|
|
73
|
+
expect(project.isGitProject).toBe(false);
|
|
74
|
+
});
|
|
75
|
+
it("defaults sessionCount to 0 when missing", () => {
|
|
76
|
+
const project = makeProject({ name: "test" });
|
|
77
|
+
expect(project.sessionCount).toBe(0);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
describe("scroll navigation logic", () => {
|
|
81
|
+
const VISIBLE_HEIGHT = 7;
|
|
82
|
+
it("clamps selectedIndex to valid range on up arrow", () => {
|
|
83
|
+
const prev = 0;
|
|
84
|
+
const next = Math.max(0, prev - 1);
|
|
85
|
+
expect(next).toBe(0);
|
|
86
|
+
});
|
|
87
|
+
it("clamps selectedIndex to valid range on down arrow", () => {
|
|
88
|
+
const listLength = 3;
|
|
89
|
+
const prev = 2;
|
|
90
|
+
const next = Math.min(listLength - 1, prev + 1);
|
|
91
|
+
expect(next).toBe(2);
|
|
92
|
+
});
|
|
93
|
+
it("scrolls up when selection goes above scrollOffset", () => {
|
|
94
|
+
let scrollOffset = 3;
|
|
95
|
+
const next = 2;
|
|
96
|
+
if (next < scrollOffset)
|
|
97
|
+
scrollOffset = next;
|
|
98
|
+
expect(scrollOffset).toBe(2);
|
|
99
|
+
});
|
|
100
|
+
it("scrolls down when selection goes below visible area", () => {
|
|
101
|
+
let scrollOffset = 0;
|
|
102
|
+
const next = 8;
|
|
103
|
+
if (next >= scrollOffset + VISIBLE_HEIGHT) {
|
|
104
|
+
scrollOffset = next - VISIBLE_HEIGHT + 1;
|
|
105
|
+
}
|
|
106
|
+
expect(scrollOffset).toBe(2);
|
|
107
|
+
});
|
|
108
|
+
it("does not scroll when selection is within visible area", () => {
|
|
109
|
+
let scrollOffset = 0;
|
|
110
|
+
const next = 3;
|
|
111
|
+
if (next >= scrollOffset + VISIBLE_HEIGHT) {
|
|
112
|
+
scrollOffset = next - VISIBLE_HEIGHT + 1;
|
|
113
|
+
}
|
|
114
|
+
expect(scrollOffset).toBe(0);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
//# sourceMappingURL=useProjectSelector.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProjectSelector.test.js","sourceRoot":"","sources":["../../src/hooks/useProjectSelector.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAGrD,SAAS,WAAW,CAAC,YAAwC,EAAE;IAC7D,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,IAAI;QACjB,YAAY,EAAE,KAAK;QACnB,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,CAAC;QACf,YAAY,EAAE,IAAI;QAClB,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,QAAQ,GAAG;YACf,WAAW,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;YAC3C,WAAW,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;YAC3C,WAAW,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;SAC5C,CAAC;QAEF,QAAQ,CAAC,IAAI,CACX,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAC1E,CAAC;QAEF,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC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AY,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC7D,IAAI,YAAY,GAAG,CAAC,CAAC;QACrB,MAAM,IAAI,GAAG,CAAC,CAAC;QACf,IAAI,IAAI,IAAI,YAAY,GAAG,cAAc,EAAE,CAAC;YAC1C,YAAY,GAAG,IAAI,GAAG,cAAc,GAAG,CAAC,CAAC;QAC3C,CAAC;QACD,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAC/D,IAAI,YAAY,GAAG,CAAC,CAAC;QACrB,MAAM,IAAI,GAAG,CAAC,CAAC;QACf,IAAI,IAAI,IAAI,YAAY,GAAG,cAAc,EAAE,CAAC;YAC1C,YAAY,GAAG,IAAI,GAAG,cAAc,GAAG,CAAC,CAAC;QAC3C,CAAC;QACD,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useSaveFlow Hook
|
|
3
|
+
*
|
|
4
|
+
* Manages the save context flow: session detection, JSONL parsing,
|
|
5
|
+
* preview generation, label input, and archive saving.
|
|
6
|
+
* Extracted from App.tsx.
|
|
7
|
+
*/
|
|
8
|
+
import type { Key } from "ink";
|
|
9
|
+
import type { Session } from "@jacques-ai/core";
|
|
10
|
+
import type { SavePreviewData, SaveSuccessData } from "../components/SaveContextView.js";
|
|
11
|
+
export interface UseSaveFlowParams {
|
|
12
|
+
focusedSession: Session | undefined;
|
|
13
|
+
showNotification: (msg: string, duration?: number) => void;
|
|
14
|
+
returnToMain: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface UseSaveFlowState {
|
|
17
|
+
preview: SavePreviewData | null;
|
|
18
|
+
label: string;
|
|
19
|
+
error: string | null;
|
|
20
|
+
success: SaveSuccessData | null;
|
|
21
|
+
scrollOffset: number;
|
|
22
|
+
}
|
|
23
|
+
export interface UseSaveFlowReturn {
|
|
24
|
+
state: UseSaveFlowState;
|
|
25
|
+
start: () => Promise<void>;
|
|
26
|
+
handleInput: (input: string, key: Key) => void;
|
|
27
|
+
reset: () => void;
|
|
28
|
+
}
|
|
29
|
+
export declare function useSaveFlow({ focusedSession, showNotification, returnToMain, }: UseSaveFlowParams): UseSaveFlowReturn;
|
|
30
|
+
//# sourceMappingURL=useSaveFlow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSaveFlow.d.ts","sourceRoot":"","sources":["../../src/hooks/useSaveFlow.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAY/B,OAAO,KAAK,EAA4B,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAE1C,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/C,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,wBAAgB,WAAW,CAAC,EAC1B,cAAc,EACd,gBAAgB,EAChB,YAAY,GACb,EAAE,iBAAiB,GAAG,iBAAiB,CA6NvC"}
|