@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,192 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
tokenizer.py - Token Estimation Module for Jacques
|
|
4
|
+
|
|
5
|
+
Uses tiktoken's cl100k_base encoding to estimate token counts.
|
|
6
|
+
This encoding is used by OpenAI models and is reasonably close (~90%)
|
|
7
|
+
to Claude's actual tokenizer.
|
|
8
|
+
|
|
9
|
+
Provides:
|
|
10
|
+
- Token count estimation from text
|
|
11
|
+
- Model context window lookup
|
|
12
|
+
- Context percentage calculation
|
|
13
|
+
"""
|
|
14
|
+
import sys
|
|
15
|
+
|
|
16
|
+
# Cache encoder instance for performance
|
|
17
|
+
_encoder = None
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def get_encoder():
|
|
21
|
+
"""
|
|
22
|
+
Get cached tiktoken encoder.
|
|
23
|
+
|
|
24
|
+
Uses cl100k_base encoding which is closest to Claude's tokenizer.
|
|
25
|
+
Encoder is cached for performance (~150k tokens/sec).
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
tiktoken.Encoding instance, or None if tiktoken not installed.
|
|
29
|
+
"""
|
|
30
|
+
global _encoder
|
|
31
|
+
if _encoder is None:
|
|
32
|
+
try:
|
|
33
|
+
import tiktoken
|
|
34
|
+
_encoder = tiktoken.get_encoding("cl100k_base")
|
|
35
|
+
except ImportError:
|
|
36
|
+
print("[jacques:tokenizer] tiktoken not installed. Run: pip install tiktoken", file=sys.stderr)
|
|
37
|
+
return None
|
|
38
|
+
return _encoder
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def estimate_tokens(text: str) -> int:
|
|
42
|
+
"""
|
|
43
|
+
Estimate token count for given text.
|
|
44
|
+
|
|
45
|
+
Args:
|
|
46
|
+
text: Text to tokenize
|
|
47
|
+
|
|
48
|
+
Returns:
|
|
49
|
+
Estimated token count, or character-based fallback if tiktoken unavailable.
|
|
50
|
+
"""
|
|
51
|
+
if not text:
|
|
52
|
+
return 0
|
|
53
|
+
|
|
54
|
+
encoder = get_encoder()
|
|
55
|
+
if encoder:
|
|
56
|
+
return len(encoder.encode(text))
|
|
57
|
+
|
|
58
|
+
# Fallback: rough estimate of ~4 characters per token
|
|
59
|
+
return len(text) // 4
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# Model context windows (in tokens)
|
|
63
|
+
# Source: Official documentation + Cursor UI observations
|
|
64
|
+
MODEL_CONTEXT_WINDOWS = {
|
|
65
|
+
# Claude models (Cursor uses 176k for Claude in agent mode)
|
|
66
|
+
"claude-4.5-opus": 176_000, # Cursor-specific limit
|
|
67
|
+
"claude-4.5-sonnet": 176_000,
|
|
68
|
+
"claude-4-opus": 176_000,
|
|
69
|
+
"claude-4-sonnet": 176_000,
|
|
70
|
+
"claude-3.5-sonnet": 176_000,
|
|
71
|
+
"claude-3-opus": 176_000,
|
|
72
|
+
"claude-3-sonnet": 176_000,
|
|
73
|
+
"claude-3-haiku": 176_000,
|
|
74
|
+
|
|
75
|
+
# OpenAI models
|
|
76
|
+
"gpt-4o": 128_000,
|
|
77
|
+
"gpt-4-turbo": 128_000,
|
|
78
|
+
"gpt-4": 8_192,
|
|
79
|
+
"gpt-3.5-turbo": 16_385,
|
|
80
|
+
|
|
81
|
+
# Google models
|
|
82
|
+
"gemini-2.5-pro": 1_000_000,
|
|
83
|
+
"gemini-2.5-flash": 1_000_000,
|
|
84
|
+
"gemini-1.5-pro": 2_000_000,
|
|
85
|
+
"gemini-1.5-flash": 1_000_000,
|
|
86
|
+
|
|
87
|
+
# Default for unknown models (use Cursor's typical limit)
|
|
88
|
+
"default": 176_000,
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def get_context_window(model: str) -> int:
|
|
93
|
+
"""
|
|
94
|
+
Get context window size for a model.
|
|
95
|
+
|
|
96
|
+
Args:
|
|
97
|
+
model: Model name/identifier
|
|
98
|
+
|
|
99
|
+
Returns:
|
|
100
|
+
Context window size in tokens.
|
|
101
|
+
"""
|
|
102
|
+
if not model:
|
|
103
|
+
return MODEL_CONTEXT_WINDOWS["default"]
|
|
104
|
+
|
|
105
|
+
model_lower = model.lower()
|
|
106
|
+
|
|
107
|
+
# Try exact match first
|
|
108
|
+
if model_lower in MODEL_CONTEXT_WINDOWS:
|
|
109
|
+
return MODEL_CONTEXT_WINDOWS[model_lower]
|
|
110
|
+
|
|
111
|
+
# Try partial match
|
|
112
|
+
for key, window in MODEL_CONTEXT_WINDOWS.items():
|
|
113
|
+
if key != "default" and key in model_lower:
|
|
114
|
+
return window
|
|
115
|
+
|
|
116
|
+
return MODEL_CONTEXT_WINDOWS["default"]
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def calculate_context_percentage(tokens: int, context_window: int) -> float:
|
|
120
|
+
"""
|
|
121
|
+
Calculate context usage percentage.
|
|
122
|
+
|
|
123
|
+
Args:
|
|
124
|
+
tokens: Current token count
|
|
125
|
+
context_window: Maximum context window size
|
|
126
|
+
|
|
127
|
+
Returns:
|
|
128
|
+
Percentage of context used (0.0 to 100.0).
|
|
129
|
+
"""
|
|
130
|
+
if context_window <= 0:
|
|
131
|
+
return 0.0
|
|
132
|
+
|
|
133
|
+
percentage = (tokens / context_window) * 100
|
|
134
|
+
return min(percentage, 100.0) # Cap at 100%
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def calculate_context_metrics(tokens: int, model: str) -> dict:
|
|
138
|
+
"""
|
|
139
|
+
Calculate full context metrics for a given token count.
|
|
140
|
+
|
|
141
|
+
Args:
|
|
142
|
+
tokens: Estimated token count
|
|
143
|
+
model: Model name for context window lookup
|
|
144
|
+
|
|
145
|
+
Returns:
|
|
146
|
+
Dict with used_percentage, remaining_percentage, context_window_size.
|
|
147
|
+
"""
|
|
148
|
+
context_window = get_context_window(model)
|
|
149
|
+
used_percentage = calculate_context_percentage(tokens, context_window)
|
|
150
|
+
|
|
151
|
+
return {
|
|
152
|
+
"used_percentage": round(used_percentage, 1),
|
|
153
|
+
"remaining_percentage": round(100 - used_percentage, 1),
|
|
154
|
+
"context_window_size": context_window,
|
|
155
|
+
"estimated_tokens": tokens,
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
# Thinking multipliers for extended thinking models
|
|
160
|
+
# These models have internal "thinking" that's NOT in the transcript
|
|
161
|
+
# but IS counted in the context. Empirically observed: ~4-6x for high-thinking.
|
|
162
|
+
THINKING_MULTIPLIERS = {
|
|
163
|
+
"high-thinking": 5.0, # Based on observed calibration factor of 5.68
|
|
164
|
+
"thinking": 3.0, # Regular thinking models
|
|
165
|
+
"max": 2.0, # Max mode may include more reasoning
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def get_thinking_multiplier(model: str) -> float:
|
|
170
|
+
"""
|
|
171
|
+
Get thinking multiplier for models with extended thinking.
|
|
172
|
+
|
|
173
|
+
Extended thinking models have internal reasoning that doesn't
|
|
174
|
+
appear in the transcript but IS counted in Cursor's context.
|
|
175
|
+
|
|
176
|
+
Args:
|
|
177
|
+
model: Model name/identifier
|
|
178
|
+
|
|
179
|
+
Returns:
|
|
180
|
+
Multiplier to apply to transcript tokens (1.0 for non-thinking models).
|
|
181
|
+
"""
|
|
182
|
+
if not model:
|
|
183
|
+
return 1.0
|
|
184
|
+
|
|
185
|
+
model_lower = model.lower()
|
|
186
|
+
|
|
187
|
+
# Check for thinking mode indicators
|
|
188
|
+
for mode, multiplier in THINKING_MULTIPLIERS.items():
|
|
189
|
+
if mode in model_lower:
|
|
190
|
+
return multiplier
|
|
191
|
+
|
|
192
|
+
return 1.0
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
pre-tool-use.py - Report pre-tool-use to Jacques
|
|
4
|
+
|
|
5
|
+
Called on PreToolUse hook.
|
|
6
|
+
Sends tool name to server so it can detect when Claude is waiting
|
|
7
|
+
for user approval (edit acceptance, command approval, etc.).
|
|
8
|
+
"""
|
|
9
|
+
import sys
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
# Add parent directory to path for adapter imports
|
|
13
|
+
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
14
|
+
|
|
15
|
+
from adapters.claude_code import ClaudeCodeAdapter
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def main():
|
|
19
|
+
adapter = ClaudeCodeAdapter()
|
|
20
|
+
|
|
21
|
+
# Parse input from stdin
|
|
22
|
+
input_data = adapter.parse_input()
|
|
23
|
+
if not input_data:
|
|
24
|
+
sys.exit(0)
|
|
25
|
+
|
|
26
|
+
# Log for debugging (verify permission_mode presence)
|
|
27
|
+
adapter.log_debug(input_data, 'PreToolUse')
|
|
28
|
+
|
|
29
|
+
# Build and send pre_tool_use payload (no fallback - transient event)
|
|
30
|
+
payload = adapter.build_pre_tool_use_payload(input_data)
|
|
31
|
+
if payload:
|
|
32
|
+
adapter.send_event(payload, use_fallback=False)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
if __name__ == '__main__':
|
|
36
|
+
main()
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
register-session.py - Register Claude Code session with Jacques
|
|
4
|
+
|
|
5
|
+
Called on SessionStart hook.
|
|
6
|
+
Registers new Claude Code session with the Jacques server.
|
|
7
|
+
"""
|
|
8
|
+
import sys
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
# Add parent directory to path for adapter imports
|
|
12
|
+
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
13
|
+
|
|
14
|
+
from adapters.claude_code import ClaudeCodeAdapter
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def main():
|
|
18
|
+
adapter = ClaudeCodeAdapter()
|
|
19
|
+
|
|
20
|
+
# Parse input from stdin
|
|
21
|
+
input_data = adapter.parse_input()
|
|
22
|
+
if not input_data:
|
|
23
|
+
sys.exit(0)
|
|
24
|
+
|
|
25
|
+
# Debug logging (remove after debugging complete)
|
|
26
|
+
adapter.log_debug(input_data, 'SessionStart')
|
|
27
|
+
|
|
28
|
+
# Build and send session_start payload
|
|
29
|
+
payload = adapter.build_session_start_payload(input_data)
|
|
30
|
+
if payload:
|
|
31
|
+
adapter.send_event(payload, use_fallback=True)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
if __name__ == '__main__':
|
|
35
|
+
main()
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
report-activity.py - Report Claude Code activity to Jacques
|
|
4
|
+
|
|
5
|
+
Called on PostToolUse hook.
|
|
6
|
+
Updates session activity timestamp and refreshes session title.
|
|
7
|
+
"""
|
|
8
|
+
import sys
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
# Add parent directory to path for adapter imports
|
|
12
|
+
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
13
|
+
|
|
14
|
+
from adapters.claude_code import ClaudeCodeAdapter
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def main():
|
|
18
|
+
adapter = ClaudeCodeAdapter()
|
|
19
|
+
|
|
20
|
+
# Parse input from stdin
|
|
21
|
+
input_data = adapter.parse_input()
|
|
22
|
+
if not input_data:
|
|
23
|
+
sys.exit(0)
|
|
24
|
+
|
|
25
|
+
# Build and send activity payload (no fallback for activity events)
|
|
26
|
+
payload = adapter.build_activity_payload(input_data)
|
|
27
|
+
if payload:
|
|
28
|
+
adapter.send_event(payload, use_fallback=False)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
if __name__ == '__main__':
|
|
32
|
+
main()
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
session-idle.py - Mark Claude Code session as idle
|
|
4
|
+
|
|
5
|
+
Called on Stop hook.
|
|
6
|
+
Marks session as idle (waiting for user input).
|
|
7
|
+
"""
|
|
8
|
+
import sys
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
# Add parent directory to path for adapter imports
|
|
12
|
+
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
13
|
+
|
|
14
|
+
from adapters.claude_code import ClaudeCodeAdapter
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def main():
|
|
18
|
+
adapter = ClaudeCodeAdapter()
|
|
19
|
+
|
|
20
|
+
# Parse input from stdin
|
|
21
|
+
input_data = adapter.parse_input()
|
|
22
|
+
if not input_data:
|
|
23
|
+
sys.exit(0)
|
|
24
|
+
|
|
25
|
+
# Build and send idle payload
|
|
26
|
+
payload = adapter.build_idle_payload(input_data)
|
|
27
|
+
if payload:
|
|
28
|
+
adapter.send_event(payload, use_fallback=False)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
if __name__ == '__main__':
|
|
32
|
+
main()
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# Jacques statusLine Script
|
|
4
|
+
#
|
|
5
|
+
# Receives JSON from Claude Code's statusLine feature via stdin.
|
|
6
|
+
# Extracts session_id and context_window data.
|
|
7
|
+
# Sends context update to Jacques server via Unix socket.
|
|
8
|
+
# Displays abbreviated status for Claude Code's status bar.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
# DEBUG: Log that the script started (helps debug Cursor issues)
|
|
12
|
+
echo "$(date '+%Y-%m-%d %H:%M:%S') SCRIPT_START" >> /tmp/jacques-statusline-debug.log
|
|
13
|
+
|
|
14
|
+
# Read all input from stdin
|
|
15
|
+
input=$(cat)
|
|
16
|
+
|
|
17
|
+
# Exit if no input
|
|
18
|
+
if [ -z "$input" ]; then
|
|
19
|
+
exit 0
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# DEBUG: Log the raw JSON input to help diagnose field path issues
|
|
23
|
+
# Remove this line after debugging is complete
|
|
24
|
+
echo "$(date '+%Y-%m-%d %H:%M:%S') $input" >> /tmp/jacques-statusline-debug.log
|
|
25
|
+
|
|
26
|
+
# Extract key fields using jq
|
|
27
|
+
# Note: Claude Code sends null for percentages at session start, we need to handle this
|
|
28
|
+
session_id=$(echo "$input" | jq -r '.session_id // empty')
|
|
29
|
+
|
|
30
|
+
# Handle null values explicitly - jq outputs "null" string for null values even with // fallback in some cases
|
|
31
|
+
used_pct_raw=$(echo "$input" | jq -r '.context_window.used_percentage')
|
|
32
|
+
remaining_pct_raw=$(echo "$input" | jq -r '.context_window.remaining_percentage')
|
|
33
|
+
|
|
34
|
+
# Convert null/empty to 0 for used_percentage
|
|
35
|
+
if [ "$used_pct_raw" = "null" ] || [ -z "$used_pct_raw" ]; then
|
|
36
|
+
used_pct=0
|
|
37
|
+
else
|
|
38
|
+
used_pct=$used_pct_raw
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# Convert null/empty to 100 for remaining_percentage
|
|
42
|
+
if [ "$remaining_pct_raw" = "null" ] || [ -z "$remaining_pct_raw" ]; then
|
|
43
|
+
remaining_pct=100
|
|
44
|
+
else
|
|
45
|
+
remaining_pct=$remaining_pct_raw
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
ctx_size=$(echo "$input" | jq -r '.context_window.context_window_size // 0')
|
|
49
|
+
total_input=$(echo "$input" | jq -r '.context_window.total_input_tokens // 0')
|
|
50
|
+
total_output=$(echo "$input" | jq -r '.context_window.total_output_tokens // 0')
|
|
51
|
+
model=$(echo "$input" | jq -r '.model.id // "unknown"')
|
|
52
|
+
model_display=$(echo "$input" | jq -r '.model.display_name // "Unknown"')
|
|
53
|
+
cwd=$(echo "$input" | jq -r '.workspace.current_dir // .cwd // ""')
|
|
54
|
+
project_dir=$(echo "$input" | jq -r '.workspace.project_dir // ""')
|
|
55
|
+
|
|
56
|
+
# Only proceed if we have a session_id
|
|
57
|
+
if [ -z "$session_id" ]; then
|
|
58
|
+
# No session_id, just show basic status
|
|
59
|
+
printf "ctx:?%%"
|
|
60
|
+
exit 0
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
# Send to Jacques server (if socket exists and server is running)
|
|
64
|
+
if [ -S /tmp/jacques.sock ]; then
|
|
65
|
+
# Build JSON payload
|
|
66
|
+
timestamp=$(( $(date +%s) * 1000 ))
|
|
67
|
+
payload=$(cat <<EOF
|
|
68
|
+
{"event":"context_update","session_id":"$session_id","used_percentage":$used_pct,"remaining_percentage":$remaining_pct,"context_window_size":$ctx_size,"total_input_tokens":$total_input,"total_output_tokens":$total_output,"model":"$model","model_display_name":"$model_display","cwd":"$cwd","project_dir":"$project_dir","timestamp":$timestamp}
|
|
69
|
+
EOF
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
# Send to socket (non-blocking, ignore errors)
|
|
73
|
+
echo "$payload" | nc -U /tmp/jacques.sock 2>/dev/null &
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
# Display abbreviated status in Claude Code status bar
|
|
77
|
+
# Format: [Model] ctx:XX%
|
|
78
|
+
# Round percentage for display
|
|
79
|
+
used_int=${used_pct%.*}
|
|
80
|
+
if [ -z "$used_int" ]; then
|
|
81
|
+
used_int="0"
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
# Add warning indicator if context is high
|
|
85
|
+
if [ "$used_int" -ge 80 ]; then
|
|
86
|
+
printf "[%s] ctx:%s%% ⚠️" "$model_display" "$used_int"
|
|
87
|
+
elif [ "$used_int" -ge 60 ]; then
|
|
88
|
+
printf "[%s] ctx:%s%%" "$model_display" "$used_int"
|
|
89
|
+
else
|
|
90
|
+
printf "[%s] ctx:%s%%" "$model_display" "$used_int"
|
|
91
|
+
fi
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
unregister-session.py - Unregister Claude Code session from Jacques
|
|
4
|
+
|
|
5
|
+
Called on SessionEnd hook.
|
|
6
|
+
Removes session from Jacques server.
|
|
7
|
+
"""
|
|
8
|
+
import sys
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
# Add parent directory to path for adapter imports
|
|
12
|
+
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
13
|
+
|
|
14
|
+
from adapters.claude_code import ClaudeCodeAdapter
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def main():
|
|
18
|
+
adapter = ClaudeCodeAdapter()
|
|
19
|
+
|
|
20
|
+
# Parse input from stdin
|
|
21
|
+
input_data = adapter.parse_input()
|
|
22
|
+
if not input_data:
|
|
23
|
+
sys.exit(0)
|
|
24
|
+
|
|
25
|
+
# Build and send session_end payload
|
|
26
|
+
payload = adapter.build_session_end_payload(input_data)
|
|
27
|
+
if payload:
|
|
28
|
+
adapter.send_event(payload, use_fallback=False)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
if __name__ == '__main__':
|
|
32
|
+
main()
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Cursor Hooks for Jacques
|
|
2
|
+
|
|
3
|
+
This directory contains hooks for integrating Cursor Native AI with Jacques.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Option 1: Automatic (Recommended)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
cd /path/to/jacques-context-manager
|
|
11
|
+
python3 hooks/install.py --source cursor
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### Option 2: Manual
|
|
15
|
+
|
|
16
|
+
1. Copy the hooks to `~/.jacques/hooks/cursor/`:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
mkdir -p ~/.jacques/hooks/cursor
|
|
20
|
+
cp hooks/cursor/*.py ~/.jacques/hooks/cursor/
|
|
21
|
+
cp -r hooks/adapters ~/.jacques/hooks/
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
2. Copy `hooks.json.template` to your project's `.cursor/hooks.json`:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
cp hooks/cursor/hooks.json.template /path/to/your/project/.cursor/hooks.json
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Or for global configuration, copy to Cursor's config directory.
|
|
31
|
+
|
|
32
|
+
## Hooks
|
|
33
|
+
|
|
34
|
+
| Hook | Event | Description |
|
|
35
|
+
| ------------ | ---------------- | ----------------------------------------- |
|
|
36
|
+
| sessionStart | `session_start` | Registers new Cursor session with Jacques |
|
|
37
|
+
| sessionEnd | `session_end` | Unregisters Cursor session from Jacques |
|
|
38
|
+
| postToolUse | `activity` | Reports tool usage activity |
|
|
39
|
+
| preCompact | `context_update` | **Key hook!** Provides context metrics |
|
|
40
|
+
|
|
41
|
+
## Context Metrics
|
|
42
|
+
|
|
43
|
+
The `preCompact` hook is special - it provides context window usage metrics,
|
|
44
|
+
allowing Jacques to display context percentage for Cursor sessions just like
|
|
45
|
+
Claude Code CLI sessions.
|
|
46
|
+
|
|
47
|
+
Expected fields from Cursor's preCompact event:
|
|
48
|
+
|
|
49
|
+
- `context_usage_percent`: Percentage of context used (0-100)
|
|
50
|
+
- `context_tokens`: Current token count
|
|
51
|
+
- `context_window_size`: Maximum context window size
|
|
52
|
+
|
|
53
|
+
## Debugging
|
|
54
|
+
|
|
55
|
+
Check the debug log for hook input data:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
tail -f /tmp/jacques-hook-debug.log
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
This helps understand what data Cursor is sending to hooks.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
after-agent-response.py - Estimate context usage after each AI response
|
|
4
|
+
|
|
5
|
+
Called on Cursor's afterAgentResponse hook.
|
|
6
|
+
Reads the transcript file to estimate current token usage.
|
|
7
|
+
|
|
8
|
+
This hook fires after EVERY AI response, allowing us to show
|
|
9
|
+
real-time context estimates instead of waiting for preCompact.
|
|
10
|
+
|
|
11
|
+
Flow:
|
|
12
|
+
1. Parse input (contains transcript_path)
|
|
13
|
+
2. Read transcript file content
|
|
14
|
+
3. Estimate tokens using tiktoken
|
|
15
|
+
4. Add skill overhead (not in transcript but always in context)
|
|
16
|
+
5. Apply calibration factor if available
|
|
17
|
+
6. Send context_update with estimated percentage
|
|
18
|
+
"""
|
|
19
|
+
import sys
|
|
20
|
+
from pathlib import Path
|
|
21
|
+
|
|
22
|
+
# Add parent directory to path for adapter imports
|
|
23
|
+
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
24
|
+
|
|
25
|
+
from adapters.cursor import CursorAdapter
|
|
26
|
+
from adapters import tokenizer, calibration, skills
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def main():
|
|
30
|
+
adapter = CursorAdapter()
|
|
31
|
+
|
|
32
|
+
# Parse input from stdin
|
|
33
|
+
input_data = adapter.parse_input()
|
|
34
|
+
if not input_data:
|
|
35
|
+
sys.exit(0)
|
|
36
|
+
|
|
37
|
+
# Debug logging
|
|
38
|
+
adapter.log_debug(input_data, 'afterAgentResponse')
|
|
39
|
+
|
|
40
|
+
# Get transcript path
|
|
41
|
+
transcript_path = input_data.get('transcript_path')
|
|
42
|
+
if not transcript_path:
|
|
43
|
+
# No transcript available - can't estimate
|
|
44
|
+
# Stay silent rather than guessing
|
|
45
|
+
sys.exit(0)
|
|
46
|
+
|
|
47
|
+
transcript_file = Path(transcript_path)
|
|
48
|
+
if not transcript_file.exists():
|
|
49
|
+
sys.exit(0)
|
|
50
|
+
|
|
51
|
+
# Read transcript content
|
|
52
|
+
try:
|
|
53
|
+
content = transcript_file.read_text(encoding='utf-8')
|
|
54
|
+
except Exception as e:
|
|
55
|
+
print(f"[jacques:after-agent-response] Error reading transcript: {e}", file=sys.stderr)
|
|
56
|
+
sys.exit(0)
|
|
57
|
+
|
|
58
|
+
if not content:
|
|
59
|
+
sys.exit(0)
|
|
60
|
+
|
|
61
|
+
# Estimate tokens from transcript
|
|
62
|
+
transcript_tokens = tokenizer.estimate_tokens(content)
|
|
63
|
+
|
|
64
|
+
# Get model info
|
|
65
|
+
model = adapter.get_model(input_data)
|
|
66
|
+
|
|
67
|
+
# Apply thinking multiplier for extended thinking models
|
|
68
|
+
# Thinking blocks are NOT in transcript but ARE in context
|
|
69
|
+
thinking_multiplier = tokenizer.get_thinking_multiplier(model)
|
|
70
|
+
adjusted_transcript_tokens = int(transcript_tokens * thinking_multiplier)
|
|
71
|
+
|
|
72
|
+
# Add skill overhead (always in context but not in transcript)
|
|
73
|
+
initial_estimate = skills.get_initial_context_estimate(model)
|
|
74
|
+
skill_overhead = initial_estimate['total_initial_tokens']
|
|
75
|
+
|
|
76
|
+
# Total = adjusted transcript + skills + system prompts
|
|
77
|
+
total_tokens = adjusted_transcript_tokens + skill_overhead
|
|
78
|
+
|
|
79
|
+
# Get session ID for calibration
|
|
80
|
+
session_id = input_data.get('conversation_id')
|
|
81
|
+
|
|
82
|
+
if session_id:
|
|
83
|
+
# Apply calibration factor if available (further refinement)
|
|
84
|
+
factor = calibration.get_factor(session_id)
|
|
85
|
+
total_tokens = int(total_tokens * factor)
|
|
86
|
+
|
|
87
|
+
# Store this estimate for future calibration
|
|
88
|
+
calibration.set_last_estimate(session_id, total_tokens)
|
|
89
|
+
|
|
90
|
+
# Build and send context estimate payload
|
|
91
|
+
payload = adapter.build_context_estimate_payload(input_data, total_tokens, model)
|
|
92
|
+
if payload:
|
|
93
|
+
adapter.send_event(payload, use_fallback=False)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
if __name__ == '__main__':
|
|
97
|
+
main()
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"hooks": {
|
|
4
|
+
"sessionStart": [
|
|
5
|
+
{
|
|
6
|
+
"command": "python3 ~/.jacques/hooks/cursor/session-start.py"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"sessionEnd": [
|
|
10
|
+
{
|
|
11
|
+
"command": "python3 ~/.jacques/hooks/cursor/session-end.py"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"postToolUse": [
|
|
15
|
+
{
|
|
16
|
+
"command": "python3 ~/.jacques/hooks/cursor/post-tool-use.py"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"preCompact": [
|
|
20
|
+
{
|
|
21
|
+
"command": "python3 ~/.jacques/hooks/cursor/pre-compact.py"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"afterAgentResponse": [
|
|
25
|
+
{
|
|
26
|
+
"command": "python3 ~/.jacques/hooks/cursor/after-agent-response.py"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
post-tool-use.py - Report Cursor activity to Jacques
|
|
4
|
+
|
|
5
|
+
Called on Cursor's postToolUse hook.
|
|
6
|
+
Updates session activity timestamp.
|
|
7
|
+
"""
|
|
8
|
+
import sys
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
# Add parent directory to path for adapter imports
|
|
12
|
+
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
13
|
+
|
|
14
|
+
from adapters.cursor import CursorAdapter
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def main():
|
|
18
|
+
adapter = CursorAdapter()
|
|
19
|
+
|
|
20
|
+
# Parse input from stdin
|
|
21
|
+
input_data = adapter.parse_input()
|
|
22
|
+
if not input_data:
|
|
23
|
+
sys.exit(0)
|
|
24
|
+
|
|
25
|
+
# Build and send activity payload (no fallback for activity events)
|
|
26
|
+
payload = adapter.build_activity_payload(input_data)
|
|
27
|
+
if payload:
|
|
28
|
+
adapter.send_event(payload, use_fallback=False)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
if __name__ == '__main__':
|
|
32
|
+
main()
|