@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,235 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
test_calibration.py - Unit tests for calibration module
|
|
4
|
+
|
|
5
|
+
Run with:
|
|
6
|
+
python3 hooks/adapters/test_calibration.py
|
|
7
|
+
"""
|
|
8
|
+
import sys
|
|
9
|
+
import os
|
|
10
|
+
import tempfile
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
# Add parent directory to path for imports
|
|
14
|
+
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
15
|
+
|
|
16
|
+
from adapters import calibration
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def setup_test_calibration():
|
|
20
|
+
"""Reset calibration state for testing."""
|
|
21
|
+
# Reset in-memory cache
|
|
22
|
+
calibration._calibration_cache = None
|
|
23
|
+
calibration._cache_loaded = False
|
|
24
|
+
|
|
25
|
+
# Use temporary file for tests
|
|
26
|
+
calibration.CALIBRATION_PATH = Path(tempfile.mktemp(suffix='.json'))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def teardown_test_calibration():
|
|
30
|
+
"""Clean up test calibration file."""
|
|
31
|
+
if calibration.CALIBRATION_PATH.exists():
|
|
32
|
+
os.unlink(calibration.CALIBRATION_PATH)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def test_get_factor_default():
|
|
36
|
+
"""Test that default factor is 1.0."""
|
|
37
|
+
setup_test_calibration()
|
|
38
|
+
try:
|
|
39
|
+
factor = calibration.get_factor('new-session')
|
|
40
|
+
assert factor == 1.0
|
|
41
|
+
finally:
|
|
42
|
+
teardown_test_calibration()
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def test_set_and_get_factor():
|
|
46
|
+
"""Test setting and getting a correction factor."""
|
|
47
|
+
setup_test_calibration()
|
|
48
|
+
try:
|
|
49
|
+
calibration.set_factor('test-session', 1.15)
|
|
50
|
+
factor = calibration.get_factor('test-session')
|
|
51
|
+
assert factor == 1.15
|
|
52
|
+
finally:
|
|
53
|
+
teardown_test_calibration()
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def test_factor_clamping_high():
|
|
57
|
+
"""Test that factor is clamped to maximum 2.0."""
|
|
58
|
+
setup_test_calibration()
|
|
59
|
+
try:
|
|
60
|
+
calibration.set_factor('test-session', 3.0)
|
|
61
|
+
factor = calibration.get_factor('test-session')
|
|
62
|
+
assert factor == 2.0
|
|
63
|
+
finally:
|
|
64
|
+
teardown_test_calibration()
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def test_factor_clamping_low():
|
|
68
|
+
"""Test that factor is clamped to minimum 0.5."""
|
|
69
|
+
setup_test_calibration()
|
|
70
|
+
try:
|
|
71
|
+
calibration.set_factor('test-session', 0.2)
|
|
72
|
+
factor = calibration.get_factor('test-session')
|
|
73
|
+
assert factor == 0.5
|
|
74
|
+
finally:
|
|
75
|
+
teardown_test_calibration()
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def test_set_and_get_last_estimate():
|
|
79
|
+
"""Test storing and retrieving last estimate."""
|
|
80
|
+
setup_test_calibration()
|
|
81
|
+
try:
|
|
82
|
+
calibration.set_last_estimate('test-session', 50000)
|
|
83
|
+
estimate = calibration.get_last_estimate('test-session')
|
|
84
|
+
assert estimate == 50000
|
|
85
|
+
finally:
|
|
86
|
+
teardown_test_calibration()
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def test_get_last_estimate_missing():
|
|
90
|
+
"""Test that missing estimate returns None."""
|
|
91
|
+
setup_test_calibration()
|
|
92
|
+
try:
|
|
93
|
+
estimate = calibration.get_last_estimate('nonexistent-session')
|
|
94
|
+
assert estimate is None
|
|
95
|
+
finally:
|
|
96
|
+
teardown_test_calibration()
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def test_calibrate_from_actual():
|
|
100
|
+
"""Test calibration from actual token count."""
|
|
101
|
+
setup_test_calibration()
|
|
102
|
+
try:
|
|
103
|
+
# Store an estimate
|
|
104
|
+
calibration.set_last_estimate('test-session', 10000)
|
|
105
|
+
|
|
106
|
+
# Calibrate with actual (10% higher)
|
|
107
|
+
factor = calibration.calibrate_from_actual('test-session', 11000)
|
|
108
|
+
|
|
109
|
+
assert factor == 1.1
|
|
110
|
+
|
|
111
|
+
# Verify factor is stored
|
|
112
|
+
stored_factor = calibration.get_factor('test-session')
|
|
113
|
+
assert stored_factor == 1.1
|
|
114
|
+
finally:
|
|
115
|
+
teardown_test_calibration()
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def test_calibrate_no_estimate():
|
|
119
|
+
"""Test that calibration returns None when no estimate available."""
|
|
120
|
+
setup_test_calibration()
|
|
121
|
+
try:
|
|
122
|
+
factor = calibration.calibrate_from_actual('new-session', 50000)
|
|
123
|
+
assert factor is None
|
|
124
|
+
finally:
|
|
125
|
+
teardown_test_calibration()
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def test_clear_session():
|
|
129
|
+
"""Test clearing session calibration data."""
|
|
130
|
+
setup_test_calibration()
|
|
131
|
+
try:
|
|
132
|
+
# Set some data
|
|
133
|
+
calibration.set_factor('test-session', 1.2)
|
|
134
|
+
calibration.set_last_estimate('test-session', 50000)
|
|
135
|
+
|
|
136
|
+
# Verify data is set
|
|
137
|
+
assert calibration.get_last_estimate('test-session') == 50000
|
|
138
|
+
assert calibration.get_factor('test-session') == 1.2
|
|
139
|
+
|
|
140
|
+
# Clear session
|
|
141
|
+
calibration.clear_session('test-session')
|
|
142
|
+
|
|
143
|
+
# Session-specific data should be gone
|
|
144
|
+
estimate = calibration.get_last_estimate('test-session')
|
|
145
|
+
assert estimate is None, "Estimate should be cleared"
|
|
146
|
+
|
|
147
|
+
# get_factor falls back to global_factor (which is 1.2 from when it was set)
|
|
148
|
+
# This is expected behavior - global factor persists as a fallback
|
|
149
|
+
factor = calibration.get_factor('test-session')
|
|
150
|
+
assert factor >= 0.5 and factor <= 2.0, "Factor should be in valid range"
|
|
151
|
+
finally:
|
|
152
|
+
teardown_test_calibration()
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def test_persistence():
|
|
156
|
+
"""Test that calibration data persists across loads."""
|
|
157
|
+
setup_test_calibration()
|
|
158
|
+
try:
|
|
159
|
+
# Set data
|
|
160
|
+
calibration.set_factor('test-session', 1.25)
|
|
161
|
+
|
|
162
|
+
# Reset cache to force reload
|
|
163
|
+
calibration._calibration_cache = None
|
|
164
|
+
calibration._cache_loaded = False
|
|
165
|
+
|
|
166
|
+
# Should load from file
|
|
167
|
+
factor = calibration.get_factor('test-session')
|
|
168
|
+
assert factor == 1.25
|
|
169
|
+
finally:
|
|
170
|
+
teardown_test_calibration()
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
def test_get_calibration_stats():
|
|
174
|
+
"""Test getting calibration statistics."""
|
|
175
|
+
setup_test_calibration()
|
|
176
|
+
try:
|
|
177
|
+
# Add some sessions
|
|
178
|
+
calibration.set_factor('session-1', 1.1)
|
|
179
|
+
calibration.set_factor('session-2', 1.2)
|
|
180
|
+
calibration.set_last_estimate('session-3', 50000) # No factor
|
|
181
|
+
|
|
182
|
+
stats = calibration.get_calibration_stats()
|
|
183
|
+
|
|
184
|
+
assert stats['session_count'] == 3
|
|
185
|
+
assert stats['calibrated_sessions'] == 2 # Only 2 have factors
|
|
186
|
+
assert 1.0 <= stats['global_factor'] <= 1.5 # Should be average
|
|
187
|
+
finally:
|
|
188
|
+
teardown_test_calibration()
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
def run_tests():
|
|
192
|
+
"""Run all tests without pytest."""
|
|
193
|
+
import traceback
|
|
194
|
+
|
|
195
|
+
tests = [
|
|
196
|
+
test_get_factor_default,
|
|
197
|
+
test_set_and_get_factor,
|
|
198
|
+
test_factor_clamping_high,
|
|
199
|
+
test_factor_clamping_low,
|
|
200
|
+
test_set_and_get_last_estimate,
|
|
201
|
+
test_get_last_estimate_missing,
|
|
202
|
+
test_calibrate_from_actual,
|
|
203
|
+
test_calibrate_no_estimate,
|
|
204
|
+
test_clear_session,
|
|
205
|
+
test_persistence,
|
|
206
|
+
test_get_calibration_stats,
|
|
207
|
+
]
|
|
208
|
+
|
|
209
|
+
passed = 0
|
|
210
|
+
failed = 0
|
|
211
|
+
|
|
212
|
+
print("=" * 60)
|
|
213
|
+
print("Running Calibration Tests")
|
|
214
|
+
print("=" * 60)
|
|
215
|
+
|
|
216
|
+
for test in tests:
|
|
217
|
+
try:
|
|
218
|
+
test()
|
|
219
|
+
print(f" ✓ {test.__name__}")
|
|
220
|
+
passed += 1
|
|
221
|
+
except AssertionError as e:
|
|
222
|
+
print(f" ✗ {test.__name__}: {e}")
|
|
223
|
+
failed += 1
|
|
224
|
+
except Exception as e:
|
|
225
|
+
print(f" ✗ {test.__name__}: {type(e).__name__}: {e}")
|
|
226
|
+
traceback.print_exc()
|
|
227
|
+
failed += 1
|
|
228
|
+
|
|
229
|
+
print(f"\nResults: {passed}/{passed + failed} passed, {failed} failed")
|
|
230
|
+
return failed == 0
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
if __name__ == '__main__':
|
|
234
|
+
success = run_tests()
|
|
235
|
+
sys.exit(0 if success else 1)
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
test_skills.py - Unit tests for skills detection module
|
|
4
|
+
|
|
5
|
+
Run with:
|
|
6
|
+
python3 hooks/adapters/test_skills.py
|
|
7
|
+
"""
|
|
8
|
+
import sys
|
|
9
|
+
import tempfile
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
# Add parent directory to path for imports
|
|
13
|
+
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
14
|
+
|
|
15
|
+
from adapters import skills
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def test_find_skill_files():
|
|
19
|
+
"""Test that skill files can be found."""
|
|
20
|
+
skill_files = skills.find_skill_files()
|
|
21
|
+
|
|
22
|
+
# Should find some skills (user has skills installed)
|
|
23
|
+
assert isinstance(skill_files, list)
|
|
24
|
+
# All should be Path objects
|
|
25
|
+
for f in skill_files:
|
|
26
|
+
assert isinstance(f, Path)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def test_estimate_skill_tokens():
|
|
30
|
+
"""Test skill token estimation."""
|
|
31
|
+
skills.clear_cache()
|
|
32
|
+
skill_count, estimated_tokens = skills.estimate_skill_tokens()
|
|
33
|
+
|
|
34
|
+
assert isinstance(skill_count, int)
|
|
35
|
+
assert isinstance(estimated_tokens, int)
|
|
36
|
+
assert skill_count >= 0
|
|
37
|
+
assert estimated_tokens >= 0
|
|
38
|
+
|
|
39
|
+
# If skills are found, tokens should be positive
|
|
40
|
+
if skill_count > 0:
|
|
41
|
+
assert estimated_tokens > 0
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def test_estimate_skill_tokens_caching():
|
|
45
|
+
"""Test that skill estimation is cached."""
|
|
46
|
+
skills.clear_cache()
|
|
47
|
+
|
|
48
|
+
# First call
|
|
49
|
+
count1, tokens1 = skills.estimate_skill_tokens()
|
|
50
|
+
|
|
51
|
+
# Second call should return same values (cached)
|
|
52
|
+
count2, tokens2 = skills.estimate_skill_tokens()
|
|
53
|
+
|
|
54
|
+
assert count1 == count2
|
|
55
|
+
assert tokens1 == tokens2
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def test_get_initial_context_estimate():
|
|
59
|
+
"""Test initial context estimate calculation."""
|
|
60
|
+
skills.clear_cache()
|
|
61
|
+
estimate = skills.get_initial_context_estimate('claude-4.5-sonnet')
|
|
62
|
+
|
|
63
|
+
# Should have all required fields
|
|
64
|
+
assert 'skill_count' in estimate
|
|
65
|
+
assert 'skill_tokens' in estimate
|
|
66
|
+
assert 'system_prompt_tokens' in estimate
|
|
67
|
+
assert 'total_initial_tokens' in estimate
|
|
68
|
+
assert 'used_percentage' in estimate
|
|
69
|
+
assert 'remaining_percentage' in estimate
|
|
70
|
+
assert 'context_window_size' in estimate
|
|
71
|
+
|
|
72
|
+
# Context window should be 176k for Claude in Cursor
|
|
73
|
+
assert estimate['context_window_size'] == 176_000
|
|
74
|
+
|
|
75
|
+
# Percentages should add to 100
|
|
76
|
+
assert round(estimate['used_percentage'] + estimate['remaining_percentage'], 1) == 100.0
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def test_get_initial_context_estimate_different_models():
|
|
80
|
+
"""Test initial estimate with different model context windows."""
|
|
81
|
+
skills.clear_cache()
|
|
82
|
+
|
|
83
|
+
claude_estimate = skills.get_initial_context_estimate('claude-4.5-sonnet')
|
|
84
|
+
gpt_estimate = skills.get_initial_context_estimate('gpt-4o')
|
|
85
|
+
|
|
86
|
+
# Same skill count
|
|
87
|
+
assert claude_estimate['skill_count'] == gpt_estimate['skill_count']
|
|
88
|
+
|
|
89
|
+
# Different context windows (Claude in Cursor uses 176k)
|
|
90
|
+
assert claude_estimate['context_window_size'] == 176_000
|
|
91
|
+
assert gpt_estimate['context_window_size'] == 128_000
|
|
92
|
+
|
|
93
|
+
# GPT should have higher percentage (smaller window)
|
|
94
|
+
assert gpt_estimate['used_percentage'] > claude_estimate['used_percentage']
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def test_get_skills_summary():
|
|
98
|
+
"""Test skills summary string generation."""
|
|
99
|
+
skills.clear_cache()
|
|
100
|
+
summary = skills.get_skills_summary()
|
|
101
|
+
|
|
102
|
+
assert isinstance(summary, str)
|
|
103
|
+
assert 'skills' in summary.lower()
|
|
104
|
+
assert 'tokens' in summary.lower()
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def test_clear_cache():
|
|
108
|
+
"""Test cache clearing."""
|
|
109
|
+
skills.clear_cache()
|
|
110
|
+
|
|
111
|
+
# Get initial values
|
|
112
|
+
count1, tokens1 = skills.estimate_skill_tokens()
|
|
113
|
+
|
|
114
|
+
# Clear and get again (should recompute, same values)
|
|
115
|
+
skills.clear_cache()
|
|
116
|
+
count2, tokens2 = skills.estimate_skill_tokens()
|
|
117
|
+
|
|
118
|
+
assert count1 == count2
|
|
119
|
+
assert tokens1 == tokens2
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def run_tests():
|
|
123
|
+
"""Run all tests without pytest."""
|
|
124
|
+
import traceback
|
|
125
|
+
|
|
126
|
+
tests = [
|
|
127
|
+
test_find_skill_files,
|
|
128
|
+
test_estimate_skill_tokens,
|
|
129
|
+
test_estimate_skill_tokens_caching,
|
|
130
|
+
test_get_initial_context_estimate,
|
|
131
|
+
test_get_initial_context_estimate_different_models,
|
|
132
|
+
test_get_skills_summary,
|
|
133
|
+
test_clear_cache,
|
|
134
|
+
]
|
|
135
|
+
|
|
136
|
+
passed = 0
|
|
137
|
+
failed = 0
|
|
138
|
+
|
|
139
|
+
print("=" * 60)
|
|
140
|
+
print("Running Skills Detection Tests")
|
|
141
|
+
print("=" * 60)
|
|
142
|
+
|
|
143
|
+
for test in tests:
|
|
144
|
+
try:
|
|
145
|
+
test()
|
|
146
|
+
print(f" ✓ {test.__name__}")
|
|
147
|
+
passed += 1
|
|
148
|
+
except AssertionError as e:
|
|
149
|
+
print(f" ✗ {test.__name__}: {e}")
|
|
150
|
+
failed += 1
|
|
151
|
+
except Exception as e:
|
|
152
|
+
print(f" ✗ {test.__name__}: {type(e).__name__}: {e}")
|
|
153
|
+
traceback.print_exc()
|
|
154
|
+
failed += 1
|
|
155
|
+
|
|
156
|
+
print(f"\nResults: {passed}/{passed + failed} passed, {failed} failed")
|
|
157
|
+
return failed == 0
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
if __name__ == '__main__':
|
|
161
|
+
success = run_tests()
|
|
162
|
+
sys.exit(0 if success else 1)
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
test_tokenizer.py - Unit tests for tokenizer module
|
|
4
|
+
|
|
5
|
+
Run with:
|
|
6
|
+
python3 hooks/adapters/test_tokenizer.py
|
|
7
|
+
"""
|
|
8
|
+
import sys
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
# Add parent directory to path for imports
|
|
12
|
+
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
13
|
+
|
|
14
|
+
from adapters import tokenizer
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def test_estimate_tokens_empty_string():
|
|
18
|
+
"""Test that empty string returns 0 tokens."""
|
|
19
|
+
assert tokenizer.estimate_tokens('') == 0
|
|
20
|
+
assert tokenizer.estimate_tokens(None) == 0
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def test_estimate_tokens_basic():
|
|
24
|
+
"""Test basic token estimation."""
|
|
25
|
+
# A simple sentence should return some tokens
|
|
26
|
+
text = "Hello, this is a test."
|
|
27
|
+
tokens = tokenizer.estimate_tokens(text)
|
|
28
|
+
assert tokens > 0
|
|
29
|
+
assert tokens < 100 # Should be reasonable
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def test_estimate_tokens_longer_text():
|
|
33
|
+
"""Test that longer text produces more tokens."""
|
|
34
|
+
short_text = "Hello"
|
|
35
|
+
long_text = "Hello " * 100
|
|
36
|
+
|
|
37
|
+
short_tokens = tokenizer.estimate_tokens(short_text)
|
|
38
|
+
long_tokens = tokenizer.estimate_tokens(long_text)
|
|
39
|
+
|
|
40
|
+
assert long_tokens > short_tokens
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def test_get_context_window_claude():
|
|
44
|
+
"""Test context window lookup for Claude models (Cursor uses 176k)."""
|
|
45
|
+
assert tokenizer.get_context_window('claude-4.5-sonnet') == 176_000
|
|
46
|
+
assert tokenizer.get_context_window('claude-3-opus') == 176_000
|
|
47
|
+
assert tokenizer.get_context_window('claude-3.5-sonnet') == 176_000
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def test_get_context_window_gpt():
|
|
51
|
+
"""Test context window lookup for GPT models."""
|
|
52
|
+
assert tokenizer.get_context_window('gpt-4o') == 128_000
|
|
53
|
+
assert tokenizer.get_context_window('gpt-4') == 8_192
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def test_get_context_window_gemini():
|
|
57
|
+
"""Test context window lookup for Gemini models."""
|
|
58
|
+
assert tokenizer.get_context_window('gemini-2.5-pro') == 1_000_000
|
|
59
|
+
assert tokenizer.get_context_window('gemini-1.5-pro') == 2_000_000
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def test_get_context_window_unknown():
|
|
63
|
+
"""Test context window lookup for unknown models uses default (176k for Cursor)."""
|
|
64
|
+
assert tokenizer.get_context_window('unknown-model') == 176_000
|
|
65
|
+
assert tokenizer.get_context_window('') == 176_000
|
|
66
|
+
assert tokenizer.get_context_window(None) == 176_000
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def test_get_context_window_partial_match():
|
|
70
|
+
"""Test context window lookup with partial model names."""
|
|
71
|
+
# Should match based on partial string
|
|
72
|
+
assert tokenizer.get_context_window('my-claude-4.5-sonnet-tuned') == 176_000
|
|
73
|
+
assert tokenizer.get_context_window('fine-tuned-gpt-4o') == 128_000
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def test_calculate_context_percentage():
|
|
77
|
+
"""Test context percentage calculation."""
|
|
78
|
+
assert tokenizer.calculate_context_percentage(50_000, 200_000) == 25.0
|
|
79
|
+
assert tokenizer.calculate_context_percentage(100_000, 200_000) == 50.0
|
|
80
|
+
assert tokenizer.calculate_context_percentage(200_000, 200_000) == 100.0
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def test_calculate_context_percentage_over_100():
|
|
84
|
+
"""Test that percentage is capped at 100%."""
|
|
85
|
+
assert tokenizer.calculate_context_percentage(250_000, 200_000) == 100.0
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def test_calculate_context_percentage_zero_window():
|
|
89
|
+
"""Test that zero window returns 0%."""
|
|
90
|
+
assert tokenizer.calculate_context_percentage(50_000, 0) == 0.0
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def test_calculate_context_metrics():
|
|
94
|
+
"""Test full context metrics calculation."""
|
|
95
|
+
metrics = tokenizer.calculate_context_metrics(44_000, 'claude-4.5-sonnet')
|
|
96
|
+
|
|
97
|
+
# 44,000 / 176,000 = 25%
|
|
98
|
+
assert metrics['used_percentage'] == 25.0
|
|
99
|
+
assert metrics['remaining_percentage'] == 75.0
|
|
100
|
+
assert metrics['context_window_size'] == 176_000
|
|
101
|
+
assert metrics['estimated_tokens'] == 44_000
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def test_calculate_context_metrics_different_model():
|
|
105
|
+
"""Test context metrics with different model."""
|
|
106
|
+
metrics = tokenizer.calculate_context_metrics(64_000, 'gpt-4o')
|
|
107
|
+
|
|
108
|
+
assert metrics['used_percentage'] == 50.0
|
|
109
|
+
assert metrics['context_window_size'] == 128_000
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def run_tests():
|
|
113
|
+
"""Run all tests without pytest."""
|
|
114
|
+
import traceback
|
|
115
|
+
|
|
116
|
+
tests = [
|
|
117
|
+
test_estimate_tokens_empty_string,
|
|
118
|
+
test_estimate_tokens_basic,
|
|
119
|
+
test_estimate_tokens_longer_text,
|
|
120
|
+
test_get_context_window_claude,
|
|
121
|
+
test_get_context_window_gpt,
|
|
122
|
+
test_get_context_window_gemini,
|
|
123
|
+
test_get_context_window_unknown,
|
|
124
|
+
test_get_context_window_partial_match,
|
|
125
|
+
test_calculate_context_percentage,
|
|
126
|
+
test_calculate_context_percentage_over_100,
|
|
127
|
+
test_calculate_context_percentage_zero_window,
|
|
128
|
+
test_calculate_context_metrics,
|
|
129
|
+
test_calculate_context_metrics_different_model,
|
|
130
|
+
]
|
|
131
|
+
|
|
132
|
+
passed = 0
|
|
133
|
+
failed = 0
|
|
134
|
+
|
|
135
|
+
print("=" * 60)
|
|
136
|
+
print("Running Tokenizer Tests")
|
|
137
|
+
print("=" * 60)
|
|
138
|
+
|
|
139
|
+
for test in tests:
|
|
140
|
+
try:
|
|
141
|
+
test()
|
|
142
|
+
print(f" ✓ {test.__name__}")
|
|
143
|
+
passed += 1
|
|
144
|
+
except AssertionError as e:
|
|
145
|
+
print(f" ✗ {test.__name__}: {e}")
|
|
146
|
+
failed += 1
|
|
147
|
+
except Exception as e:
|
|
148
|
+
print(f" ✗ {test.__name__}: {type(e).__name__}: {e}")
|
|
149
|
+
traceback.print_exc()
|
|
150
|
+
failed += 1
|
|
151
|
+
|
|
152
|
+
print(f"\nResults: {passed}/{passed + failed} passed, {failed} failed")
|
|
153
|
+
return failed == 0
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
if __name__ == '__main__':
|
|
157
|
+
success = run_tests()
|
|
158
|
+
sys.exit(0 if success else 1)
|