sage-agent-internal 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. sage_agent_internal-0.1.1/.copier-answers.yml +14 -0
  2. sage_agent_internal-0.1.1/.gitignore +130 -0
  3. sage_agent_internal-0.1.1/.keep +0 -0
  4. sage_agent_internal-0.1.1/.prettierignore +6 -0
  5. sage_agent_internal-0.1.1/.vscode/settings.json +8 -0
  6. sage_agent_internal-0.1.1/.yarnrc.yml +1 -0
  7. sage_agent_internal-0.1.1/CHANGELOG.md +5 -0
  8. sage_agent_internal-0.1.1/CLAUDE.md +167 -0
  9. sage_agent_internal-0.1.1/LICENSE +29 -0
  10. sage_agent_internal-0.1.1/PKG-INFO +207 -0
  11. sage_agent_internal-0.1.1/README.md +153 -0
  12. sage_agent_internal-0.1.1/RELEASE.md +80 -0
  13. sage_agent_internal-0.1.1/__tests__/sage_agent.spec.ts +9 -0
  14. sage_agent_internal-0.1.1/babel.config.js +26 -0
  15. sage_agent_internal-0.1.1/cli-chat-tool/index.ts +341 -0
  16. sage_agent_internal-0.1.1/cli-chat-tool/package-lock.json +923 -0
  17. sage_agent_internal-0.1.1/cli-chat-tool/package.json +16 -0
  18. sage_agent_internal-0.1.1/cli-chat-tool/tsconfig.json +23 -0
  19. sage_agent_internal-0.1.1/cli-chat-tool/yarn.lock +610 -0
  20. sage_agent_internal-0.1.1/create_test_data.py +247 -0
  21. sage_agent_internal-0.1.1/install.json +5 -0
  22. sage_agent_internal-0.1.1/jest.config.js +28 -0
  23. sage_agent_internal-0.1.1/package-lock.json +12123 -0
  24. sage_agent_internal-0.1.1/package.json +225 -0
  25. sage_agent_internal-0.1.1/pyproject.toml +78 -0
  26. sage_agent_internal-0.1.1/schema/plugin.json +101 -0
  27. sage_agent_internal-0.1.1/setup.py +1 -0
  28. sage_agent_internal-0.1.1/signalpilot_ai_internal/__init__.py +16 -0
  29. sage_agent_internal-0.1.1/signalpilot_ai_internal/_version.py +4 -0
  30. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/package.json +230 -0
  31. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/schemas/signalpilot-ai-internal/package.json.orig +225 -0
  32. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/schemas/signalpilot-ai-internal/plugin.json +101 -0
  33. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/122.e2dadf63dc64d7b5f1ee.js +1 -0
  34. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/220.328403b5545f268b95c6.js +1 -0
  35. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/262.726e1da31a50868cb297.js +1 -0
  36. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/280.f2680e1e92550ea26ae6.js +2 -0
  37. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/280.f2680e1e92550ea26ae6.js.LICENSE.txt +1 -0
  38. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/353.72484b768a04f89bd3dd.js +1 -0
  39. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/363.7f144efc73650d68fc04.js +1 -0
  40. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/364.dbec4c2dc12e7b050dcc.js +1 -0
  41. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/439.37e271d7a80336daabe2.js +1 -0
  42. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/481.73c7a9290b7d35a8b9c1.js +1 -0
  43. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/553.b4042a795c91d9ff71ef.js +2 -0
  44. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/553.b4042a795c91d9ff71ef.js.LICENSE.txt +15 -0
  45. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/635.9720593ee20b768da3ca.js +1 -0
  46. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/713.8e6edc9a965bdd578ca7.js +1 -0
  47. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/742.91e7b516c8699eea3373.js +1 -0
  48. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/785.6ef3dc20a14720d3a5e4.js +1 -0
  49. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/839.5eeda0e252c5b94b5fa6.js +1 -0
  50. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/888.34054db17bcf6e87ec95.js +1 -0
  51. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/remoteEntry.b2e5af7a27bf7bd2f9ed.js +1 -0
  52. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/style.js +4 -0
  53. sage_agent_internal-0.1.1/signalpilot_ai_internal/labextension/static/third-party-licenses.json +298 -0
  54. sage_agent_internal-0.1.1/src/AppState.ts +1151 -0
  55. sage_agent_internal-0.1.1/src/BackendTools/DatabaseTools.ts +611 -0
  56. sage_agent_internal-0.1.1/src/BackendTools/FilesystemTools.ts +523 -0
  57. sage_agent_internal-0.1.1/src/BackendTools/WebTools.ts +244 -0
  58. sage_agent_internal-0.1.1/src/BackendTools/index.ts +3 -0
  59. sage_agent_internal-0.1.1/src/BackendTools/tickers.json +50297 -0
  60. sage_agent_internal-0.1.1/src/CellTrackingService.ts +172 -0
  61. sage_agent_internal-0.1.1/src/Chat/ActionHistory.ts +155 -0
  62. sage_agent_internal-0.1.1/src/Chat/ChatContextMenu/ChatContextLoaders.ts +319 -0
  63. sage_agent_internal-0.1.1/src/Chat/ChatContextMenu/ChatContextMenu.ts +1168 -0
  64. sage_agent_internal-0.1.1/src/Chat/ChatContextMenu/ChatContextMenuLogic.ts +527 -0
  65. sage_agent_internal-0.1.1/src/Chat/ChatContextMenu/ChatContextMenuUtils.ts +416 -0
  66. sage_agent_internal-0.1.1/src/Chat/ChatContextMenu/ContextCacheService.ts +310 -0
  67. sage_agent_internal-0.1.1/src/Chat/ChatContextMenu/ContextCellHighlighter.ts +1475 -0
  68. sage_agent_internal-0.1.1/src/Chat/ChatContextMenu/DataLoaderService.ts +684 -0
  69. sage_agent_internal-0.1.1/src/Chat/ChatContextMenu/KernelExecutionListener.ts +265 -0
  70. sage_agent_internal-0.1.1/src/Chat/ChatContextMenu/icons.ts +51 -0
  71. sage_agent_internal-0.1.1/src/Chat/ChatHistoryManager.ts +794 -0
  72. sage_agent_internal-0.1.1/src/Chat/ChatInputManager.ts +1210 -0
  73. sage_agent_internal-0.1.1/src/Chat/ChatMessages.ts +2493 -0
  74. sage_agent_internal-0.1.1/src/Chat/ChatUIHelper.ts +115 -0
  75. sage_agent_internal-0.1.1/src/Chat/ConversationService.ts +979 -0
  76. sage_agent_internal-0.1.1/src/Chat/ConversationServiceUtils.ts +1658 -0
  77. sage_agent_internal-0.1.1/src/Chat/RichTextChatInput.ts +348 -0
  78. sage_agent_internal-0.1.1/src/CodebaseManager.ts +437 -0
  79. sage_agent_internal-0.1.1/src/Components/ChatboxContext.ts +295 -0
  80. sage_agent_internal-0.1.1/src/Components/CheckpointRestorationModal.ts +424 -0
  81. sage_agent_internal-0.1.1/src/Components/CodeConfirmationDialog.ts +223 -0
  82. sage_agent_internal-0.1.1/src/Components/DiffApprovalDialog.ts +991 -0
  83. sage_agent_internal-0.1.1/src/Components/DiffNavigationContent.tsx +89 -0
  84. sage_agent_internal-0.1.1/src/Components/DiffNavigationWidget.tsx +449 -0
  85. sage_agent_internal-0.1.1/src/Components/InlineCompletionWidget.tsx +249 -0
  86. sage_agent_internal-0.1.1/src/Components/LLMStateDisplay/DiffItem.tsx +253 -0
  87. sage_agent_internal-0.1.1/src/Components/LLMStateDisplay/LLMStateContent.tsx +341 -0
  88. sage_agent_internal-0.1.1/src/Components/LLMStateDisplay/LLMStateDisplay.tsx +258 -0
  89. sage_agent_internal-0.1.1/src/Components/LLMStateDisplay/icons.ts +25 -0
  90. sage_agent_internal-0.1.1/src/Components/LLMStateDisplay/index.ts +4 -0
  91. sage_agent_internal-0.1.1/src/Components/LLMStateDisplay/types.ts +37 -0
  92. sage_agent_internal-0.1.1/src/Components/MoreOptionsDisplay.tsx +287 -0
  93. sage_agent_internal-0.1.1/src/Components/NewChatDisplayWidget.ts +80 -0
  94. sage_agent_internal-0.1.1/src/Components/PlanStateDisplay.tsx +624 -0
  95. sage_agent_internal-0.1.1/src/Components/RejectionFeedbackDialog.ts +52 -0
  96. sage_agent_internal-0.1.1/src/Components/Settings/SettingsWidget.tsx +742 -0
  97. sage_agent_internal-0.1.1/src/Components/SnippetCreationWidget/SnippetCreationContent.tsx +108 -0
  98. sage_agent_internal-0.1.1/src/Components/SnippetCreationWidget/SnippetCreationWidget.tsx +373 -0
  99. sage_agent_internal-0.1.1/src/Components/SnippetCreationWidget/SnippetForm.tsx +68 -0
  100. sage_agent_internal-0.1.1/src/Components/SnippetCreationWidget/SnippetFormModal.tsx +95 -0
  101. sage_agent_internal-0.1.1/src/Components/SnippetCreationWidget/SnippetList.tsx +288 -0
  102. sage_agent_internal-0.1.1/src/Components/SnippetCreationWidget/index.ts +6 -0
  103. sage_agent_internal-0.1.1/src/Components/SnippetCreationWidget/types.ts +67 -0
  104. sage_agent_internal-0.1.1/src/Components/UpdateBanner/UpdateBannerWidget.tsx +437 -0
  105. sage_agent_internal-0.1.1/src/Components/chatbox.ts +1252 -0
  106. sage_agent_internal-0.1.1/src/Components/icons.ts +91 -0
  107. sage_agent_internal-0.1.1/src/Config/ConfigService.ts +168 -0
  108. sage_agent_internal-0.1.1/src/Config/models.json +64 -0
  109. sage_agent_internal-0.1.1/src/Config/optional_env.json +3 -0
  110. sage_agent_internal-0.1.1/src/Config/prompts/claude_system_prompt.md +55 -0
  111. sage_agent_internal-0.1.1/src/Config/prompts/claude_system_prompt_ask_mode.md +78 -0
  112. sage_agent_internal-0.1.1/src/Config/prompts/claude_system_prompt_edit_full_cell.md +22 -0
  113. sage_agent_internal-0.1.1/src/Config/prompts/claude_system_prompt_edit_selection.md +41 -0
  114. sage_agent_internal-0.1.1/src/Config/prompts/claude_system_prompt_fast_mode.md +31 -0
  115. sage_agent_internal-0.1.1/src/Config/prompts/plan_generation_prompt.md +56 -0
  116. sage_agent_internal-0.1.1/src/Config/tools.json +313 -0
  117. sage_agent_internal-0.1.1/src/Notebook/InlineDiffService.ts +460 -0
  118. sage_agent_internal-0.1.1/src/Notebook/NotebookCellTools.ts +1347 -0
  119. sage_agent_internal-0.1.1/src/Notebook/NotebookChatContainer.ts +130 -0
  120. sage_agent_internal-0.1.1/src/Notebook/NotebookContextManager.ts +272 -0
  121. sage_agent_internal-0.1.1/src/Notebook/NotebookDiffManager.ts +877 -0
  122. sage_agent_internal-0.1.1/src/Notebook/NotebookDiffTools.ts +562 -0
  123. sage_agent_internal-0.1.1/src/Notebook/NotebookStateService.ts +152 -0
  124. sage_agent_internal-0.1.1/src/Notebook/NotebookTools.ts +622 -0
  125. sage_agent_internal-0.1.1/src/Notebook/WaitingUserReplyBoxManager.ts +277 -0
  126. sage_agent_internal-0.1.1/src/NotebookSettingsContainer.ts +35 -0
  127. sage_agent_internal-0.1.1/src/Services/AnthropicMessageCreator.ts +278 -0
  128. sage_agent_internal-0.1.1/src/Services/AnthropicService.ts +934 -0
  129. sage_agent_internal-0.1.1/src/Services/AnthropicStreamHandler.ts +408 -0
  130. sage_agent_internal-0.1.1/src/Services/CheckpointManager.ts +374 -0
  131. sage_agent_internal-0.1.1/src/Services/CompletionManager.ts +500 -0
  132. sage_agent_internal-0.1.1/src/Services/ContextService.ts +98 -0
  133. sage_agent_internal-0.1.1/src/Services/DatabaseMetadataCache.ts +590 -0
  134. sage_agent_internal-0.1.1/src/Services/DiffStateService.ts +522 -0
  135. sage_agent_internal-0.1.1/src/Services/IChatService.ts +129 -0
  136. sage_agent_internal-0.1.1/src/Services/NotebookCellStateService.ts +576 -0
  137. sage_agent_internal-0.1.1/src/Services/ServiceFactory.ts +43 -0
  138. sage_agent_internal-0.1.1/src/Services/ServiceUtils.ts +368 -0
  139. sage_agent_internal-0.1.1/src/Services/TabCompletionService.ts +158 -0
  140. sage_agent_internal-0.1.1/src/Services/ToolService.ts +759 -0
  141. sage_agent_internal-0.1.1/src/ThreadManager.ts +481 -0
  142. sage_agent_internal-0.1.1/src/TrackingIDUtility.ts +174 -0
  143. sage_agent_internal-0.1.1/src/activateSage.ts +965 -0
  144. sage_agent_internal-0.1.1/src/commands.ts +623 -0
  145. sage_agent_internal-0.1.1/src/eval_commands.ts +183 -0
  146. sage_agent_internal-0.1.1/src/globalWidgets.ts +36 -0
  147. sage_agent_internal-0.1.1/src/index.ts +15 -0
  148. sage_agent_internal-0.1.1/src/plugin.ts +124 -0
  149. sage_agent_internal-0.1.1/src/types/json.d.ts +14 -0
  150. sage_agent_internal-0.1.1/src/types.ts +104 -0
  151. sage_agent_internal-0.1.1/src/utils/VariableExtractor.ts +147 -0
  152. sage_agent_internal-0.1.1/src/utils/caching.ts +207 -0
  153. sage_agent_internal-0.1.1/src/utils/contextTagUtils.ts +208 -0
  154. sage_agent_internal-0.1.1/src/utils/kernelPreview.ts +917 -0
  155. sage_agent_internal-0.1.1/src/utils/kernelUtils.ts +194 -0
  156. sage_agent_internal-0.1.1/src/utils/stateDBCaching.ts +155 -0
  157. sage_agent_internal-0.1.1/src/utils/tokenUtils.ts +91 -0
  158. sage_agent_internal-0.1.1/src/utils/toolDisplay.ts +145 -0
  159. sage_agent_internal-0.1.1/src/utils.ts +3 -0
  160. sage_agent_internal-0.1.1/style/base.css +2080 -0
  161. sage_agent_internal-0.1.1/style/chat-container.css +59 -0
  162. sage_agent_internal-0.1.1/style/chat-mention-dropdown.css +242 -0
  163. sage_agent_internal-0.1.1/style/code-mirror-merge.css +23 -0
  164. sage_agent_internal-0.1.1/style/codebase-manager.css +169 -0
  165. sage_agent_internal-0.1.1/style/diff-approval.css +201 -0
  166. sage_agent_internal-0.1.1/style/diff-edit-mode.css +57 -0
  167. sage_agent_internal-0.1.1/style/diff-mode.css +25 -0
  168. sage_agent_internal-0.1.1/style/diff-navigation.css +178 -0
  169. sage_agent_internal-0.1.1/style/floating-bottom-widget.css +191 -0
  170. sage_agent_internal-0.1.1/style/fonts.css +30 -0
  171. sage_agent_internal-0.1.1/style/icons/chat_input/agent-mode-shiny.svg +29 -0
  172. sage_agent_internal-0.1.1/style/icons/chat_input/agent-mode.svg +3 -0
  173. sage_agent_internal-0.1.1/style/icons/chat_input/approve.svg +3 -0
  174. sage_agent_internal-0.1.1/style/icons/chat_input/arrow-down.svg +1 -0
  175. sage_agent_internal-0.1.1/style/icons/chat_input/arrow-up.svg +1 -0
  176. sage_agent_internal-0.1.1/style/icons/chat_input/ask-mode.svg +3 -0
  177. sage_agent_internal-0.1.1/style/icons/chat_input/check.svg +3 -0
  178. sage_agent_internal-0.1.1/style/icons/chat_input/dashed-circle.svg +9 -0
  179. sage_agent_internal-0.1.1/style/icons/chat_input/hands-on-mode.svg +3 -0
  180. sage_agent_internal-0.1.1/style/icons/chat_input/open.svg +3 -0
  181. sage_agent_internal-0.1.1/style/icons/chat_input/reapply.svg +1 -0
  182. sage_agent_internal-0.1.1/style/icons/chat_input/reject.svg +3 -0
  183. sage_agent_internal-0.1.1/style/icons/chat_input/run.svg +4 -0
  184. sage_agent_internal-0.1.1/style/icons/chat_input/search.svg +4 -0
  185. sage_agent_internal-0.1.1/style/icons/chat_input/send.svg +3 -0
  186. sage_agent_internal-0.1.1/style/icons/chat_input/stop.svg +3 -0
  187. sage_agent_internal-0.1.1/style/icons/context_menu/cell.svg +3 -0
  188. sage_agent_internal-0.1.1/style/icons/context_menu/data.svg +10 -0
  189. sage_agent_internal-0.1.1/style/icons/context_menu/insert.svg +8 -0
  190. sage_agent_internal-0.1.1/style/icons/context_menu/search.svg +3 -0
  191. sage_agent_internal-0.1.1/style/icons/context_menu/snippets.svg +3 -0
  192. sage_agent_internal-0.1.1/style/icons/context_menu/variable.svg +3 -0
  193. sage_agent_internal-0.1.1/style/icons/state_display/menu-close.svg +3 -0
  194. sage_agent_internal-0.1.1/style/icons/state_display/menu-icon.svg +3 -0
  195. sage_agent_internal-0.1.1/style/icons/state_display/run_cell.svg +4 -0
  196. sage_agent_internal-0.1.1/style/icons/state_display/warning.svg +1 -0
  197. sage_agent_internal-0.1.1/style/index.css +24 -0
  198. sage_agent_internal-0.1.1/style/index.js +19 -0
  199. sage_agent_internal-0.1.1/style/inline-diff-approval.css +291 -0
  200. sage_agent_internal-0.1.1/style/left-side-menu.css +211 -0
  201. sage_agent_internal-0.1.1/style/llm-state-display.css +466 -0
  202. sage_agent_internal-0.1.1/style/minus-icon.css +31 -0
  203. sage_agent_internal-0.1.1/style/modal.css +283 -0
  204. sage_agent_internal-0.1.1/style/mode-selector-dropdown.css +305 -0
  205. sage_agent_internal-0.1.1/style/more-options.css +73 -0
  206. sage_agent_internal-0.1.1/style/new-chat-display.css +99 -0
  207. sage_agent_internal-0.1.1/style/plan-state-display.css +369 -0
  208. sage_agent_internal-0.1.1/style/settings-widget.css +242 -0
  209. sage_agent_internal-0.1.1/style/snippet-creation.css +887 -0
  210. sage_agent_internal-0.1.1/style/style.css +0 -0
  211. sage_agent_internal-0.1.1/style/tab-completion.css +23 -0
  212. sage_agent_internal-0.1.1/style/update-banner.css +180 -0
  213. sage_agent_internal-0.1.1/templates/rule.example.md +21 -0
  214. sage_agent_internal-0.1.1/tsconfig.json +25 -0
  215. sage_agent_internal-0.1.1/tsconfig.test.json +3 -0
  216. sage_agent_internal-0.1.1/ui-tests/README.md +22 -0
  217. sage_agent_internal-0.1.1/ui-tests/jupyter_server_test_config.py +12 -0
  218. sage_agent_internal-0.1.1/ui-tests/package.json +22 -0
  219. sage_agent_internal-0.1.1/ui-tests/playwright.config.js +30 -0
  220. sage_agent_internal-0.1.1/ui-tests/setup-tests.bat +38 -0
  221. sage_agent_internal-0.1.1/ui-tests/setup-tests.sh +36 -0
  222. sage_agent_internal-0.1.1/ui-tests/slack-test-README.md +44 -0
  223. sage_agent_internal-0.1.1/ui-tests/test_slack.py +245 -0
  224. sage_agent_internal-0.1.1/ui-tests/tests/README_SAGE_LLM_TESTS.md +133 -0
  225. sage_agent_internal-0.1.1/ui-tests/tests/SAGE_LLM_TESTING_PLAN.md +238 -0
  226. sage_agent_internal-0.1.1/ui-tests/tests/config-example.ts +64 -0
  227. sage_agent_internal-0.1.1/ui-tests/tests/sage_agent.spec.ts +55 -0
  228. sage_agent_internal-0.1.1/ui-tests/tests/sage_diff_interactions.spec.ts +571 -0
  229. sage_agent_internal-0.1.1/ui-tests/tests/sage_llm_test.spec.ts +814 -0
  230. sage_agent_internal-0.1.1/ui-tests/yarn.lock +5159 -0
  231. sage_agent_internal-0.1.1/yarn.lock +11526 -0
@@ -0,0 +1,14 @@
1
+ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2
+ _commit: v4.3.8
3
+ _src_path: https://github.com/jupyterlab/extension-template
4
+ author_email: danielschaffield@gmail.com
5
+ author_name: Daniel Schaffield
6
+ has_binder: true
7
+ has_settings: true
8
+ kind: frontend
9
+ labextension_name: signalpilot-ai-internal
10
+ project_short_description: Sage Agent - Your Jupyter Notebook Assistant
11
+ python_name: signalpilot_ai_internal
12
+ repository: https://github.com/AlpineX-Labs/jupyter-signalpilot-ai-internal
13
+ test: true
14
+
@@ -0,0 +1,130 @@
1
+ *.bundle.*
2
+ lib/
3
+ node_modules/
4
+ *.log
5
+ .eslintcache
6
+ .stylelintcache
7
+ *.egg-info/
8
+ .ipynb_checkpoints
9
+ *.tsbuildinfo
10
+ signalpilot_ai_internal/labextension
11
+ # Version file is handled by hatchling
12
+ signalpilot_ai_internal/_version.py
13
+
14
+ # Integration tests
15
+ ui-tests/test-results/
16
+ ui-tests/playwright-report/
17
+
18
+ # Created by https://www.gitignore.io/api/python
19
+ # Edit at https://www.gitignore.io/?templates=python
20
+
21
+ ### Python ###
22
+ # Byte-compiled / optimized / DLL files
23
+ __pycache__/
24
+ *.py[cod]
25
+ *$py.class
26
+
27
+ # C extensions
28
+ *.so
29
+
30
+ # Distribution / packaging
31
+ .Python
32
+ build/
33
+ develop-eggs/
34
+ dist/
35
+ downloads/
36
+ eggs/
37
+ .eggs/
38
+ lib/
39
+ lib64/
40
+ parts/
41
+ sdist/
42
+ var/
43
+ wheels/
44
+ pip-wheel-metadata/
45
+ share/python-wheels/
46
+ .installed.cfg
47
+ *.egg
48
+ MANIFEST
49
+
50
+ # PyInstaller
51
+ # Usually these files are written by a python script from a template
52
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
53
+ *.manifest
54
+ *.spec
55
+
56
+ # Installer logs
57
+ pip-log.txt
58
+ pip-delete-this-directory.txt
59
+
60
+ # Unit test / coverage reports
61
+ htmlcov/
62
+ .tox/
63
+ .nox/
64
+ .coverage
65
+ .coverage.*
66
+ .cache
67
+ nosetests.xml
68
+ coverage/
69
+ coverage.xml
70
+ *.cover
71
+ .hypothesis/
72
+ .pytest_cache/
73
+
74
+ # Translations
75
+ *.mo
76
+ *.pot
77
+
78
+ # Scrapy stuff:
79
+ .scrapy
80
+
81
+ # Sphinx documentation
82
+ docs/_build/
83
+
84
+ # PyBuilder
85
+ target/
86
+
87
+ # pyenv
88
+ .python-version
89
+
90
+ # celery beat schedule file
91
+ celerybeat-schedule
92
+
93
+ # SageMath parsed files
94
+ *.sage.py
95
+
96
+ # Spyder project settings
97
+ .spyderproject
98
+ .spyproject
99
+
100
+ # Rope project settings
101
+ .ropeproject
102
+
103
+ # Mr Developer
104
+ .mr.developer.cfg
105
+ .project
106
+ .pydevproject
107
+
108
+ # mkdocs documentation
109
+ /site
110
+
111
+ # mypy
112
+ .mypy_cache/
113
+ .dmypy.json
114
+ dmypy.json
115
+
116
+ # Pyre type checker
117
+ .pyre/
118
+
119
+ # End of https://www.gitignore.io/api/python
120
+
121
+ # OSX files
122
+ .DS_Store
123
+
124
+ # Yarn cache
125
+ .yarn/
126
+
127
+ *.ipynb
128
+
129
+ .env
130
+ /ui-tests/test-results.json
File without changes
@@ -0,0 +1,6 @@
1
+ node_modules
2
+ **/node_modules
3
+ **/lib
4
+ **/package.json
5
+ !/package.json
6
+ signalpilot_ai_internal
@@ -0,0 +1,8 @@
1
+ {
2
+ "github.copilot.enable": {
3
+ "*": true,
4
+ "plaintext": false,
5
+ "markdown": true,
6
+ "scminput": false
7
+ }
8
+ }
@@ -0,0 +1 @@
1
+ nodeLinker: node-modules
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ <!-- <START NEW CHANGELOG ENTRY> -->
4
+
5
+ <!-- <END NEW CHANGELOG ENTRY> -->
@@ -0,0 +1,167 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Repository Overview
6
+
7
+ Sage Agent is a JupyterLab extension that provides AI-powered assistance for data analysis and notebook development. It integrates LLM capabilities directly into Jupyter notebooks with chat interface, code generation, and notebook manipulation tools.
8
+
9
+ ## Development Commands
10
+
11
+ ### Build and Development
12
+ - `jlpm build` - Build the extension for development (includes source maps)
13
+ - `jlpm build:prod` - Build for production (optimized, no source maps)
14
+ - `jlpm watch` - Watch source files and rebuild automatically
15
+ - `jlpm watch:src` - Watch TypeScript source files only
16
+ - `jlpm watch:labextension` - Watch labextension files only
17
+
18
+ ### Development Setup
19
+ - `pip install -e "."` - Install package in development mode
20
+ - `jupyter labextension develop . --overwrite` - Link development version with JupyterLab
21
+ - `jupyter lab` - Run JupyterLab with the extension
22
+
23
+ ### Testing and Quality
24
+ - `jlpm test` - Run Jest tests with coverage
25
+ - `jlpm lint` - Run all linters (stylelint, prettier, eslint) with fixes
26
+ - `jlpm lint:check` - Check code quality without fixes
27
+ - `jlpm eslint` - Run ESLint with fixes
28
+ - `jlpm prettier` - Format code with Prettier
29
+
30
+ ### Clean Commands
31
+ - `jlpm clean` - Clean compiled TypeScript files
32
+ - `jlpm clean:all` - Clean all generated files (lib, labextension, cache)
33
+
34
+ ## Architecture Overview
35
+
36
+ ### Core Architecture Pattern
37
+ The extension follows a centralized state management pattern using **AppStateService** as the single source of truth for all application state. This service manages:
38
+
39
+ - Core services (ToolService, NotebookTracker, etc.)
40
+ - UI containers (ChatContainer, SettingsContainer)
41
+ - Notebook state and tracking
42
+ - Configuration and settings
43
+
44
+ ### Key Architectural Components
45
+
46
+ **Plugin System (src/plugin.ts:46-750)**
47
+ - Main JupyterLab plugin entry point
48
+ - Initializes all services in dependency order
49
+ - Sets up event handlers for notebook changes
50
+ - Registers commands and UI components
51
+
52
+ **State Management (src/AppState.ts)**
53
+ - Centralized state using RxJS BehaviorSubject
54
+ - Event-driven architecture for notebook changes
55
+ - Service initialization and dependency injection
56
+ - Settings and configuration management
57
+
58
+ **Chat System (src/Chat/)**
59
+ - ConversationService: Manages chat interactions with LLMs
60
+ - ChatInputManager: Handles user input and context
61
+ - ActionHistory: Tracks user actions for context
62
+ - RichTextChatInput: Advanced input component with markdown support
63
+
64
+ **Notebook Management (src/Notebook/)**
65
+ - NotebookTools: Core notebook manipulation utilities
66
+ - NotebookDiffManager: Handles code diff display and approval
67
+ - NotebookContextManager: Manages cell context for chat
68
+ - InlineDiffService: Provides inline diff visualization
69
+
70
+ **Services (src/Services/)**
71
+ - ToolService: Orchestrates all notebook tools and operations
72
+ - AnthropicService: Handles Claude API integration
73
+ - ConfigService: Manages extension configuration
74
+ - DatabaseMetadataCache: Caches database metadata for tools
75
+
76
+ ### Tool System Architecture
77
+
78
+ The extension provides structured tools for LLM interaction defined in `src/Config/tools.json`:
79
+
80
+ **Notebook Tools:**
81
+ - `notebook-edit_plan` - Manages notebook planning workflow
82
+ - `notebook-read_cells` - Reads specific notebook cells
83
+ - `notebook-add_cell` - Creates new cells with tracking
84
+ - `notebook-edit_cell` - Modifies existing cell content
85
+ - `notebook-run_cell` - Executes code cells
86
+ - `notebook-remove_cells` - Deletes specified cells
87
+ - `notebook-wait_user_reply` - UI component for user interaction
88
+
89
+ **Data Tools:**
90
+ - `filesystem-read_dataset` - Reads dataset files from data directory
91
+ - `web-search_dataset` - Searches ticker/financial data with fuzzy matching
92
+
93
+ ### Configuration System
94
+
95
+ **Model Configuration (src/Config/models.json)**
96
+ - Different models for different interaction modes
97
+ - Tool blacklists per model to optimize performance
98
+ - Supports Claude Sonnet 4 and Haiku models
99
+
100
+ **Prompt System (src/Config/prompts/)**
101
+ - Specialized system prompts for different modes
102
+ - `claude_system_prompt.md` - Main data science assistant prompt
103
+ - Mode-specific prompts for ask, edit, and fast modes
104
+
105
+ ## Important Development Patterns
106
+
107
+ ### Service Initialization Order
108
+ 1. Core services (ToolService, NotebookTracker, NotebookTools)
109
+ 2. Managers (PlanStateDisplay, WaitingUserReplyBoxManager)
110
+ 3. Additional services (ActionHistory, CellTrackingService)
111
+ 4. UI containers (ChatContainer, SettingsContainer)
112
+
113
+ ### Notebook Unique ID System
114
+ - Each notebook gets a unique `sage_ai.unique_id` in metadata
115
+ - Used for tracking chat histories and state across renames
116
+ - Fallback to path-based tracking for compatibility
117
+
118
+ ### Context Management
119
+ - Cells can be added/removed from chat context
120
+ - Visual highlighting shows which cells are in context
121
+ - Context preserved across notebook operations
122
+
123
+ ### Diff Approval Workflow
124
+ - Code changes shown as diffs before execution
125
+ - User approval required for cell modifications
126
+ - Inline diff visualization with syntax highlighting
127
+
128
+ ## Key File Locations
129
+
130
+ ### Source Structure
131
+ - `src/plugin.ts` - Main plugin entry point and initialization
132
+ - `src/AppState.ts` - Centralized state management
133
+ - `src/Config/` - Configuration files (tools, models, prompts)
134
+ - `src/Services/` - Core business logic services
135
+ - `src/Notebook/` - Notebook-specific functionality
136
+ - `src/Chat/` - Chat interface and conversation management
137
+ - `src/Components/` - Reusable UI components
138
+
139
+ ### Build Outputs
140
+ - `lib/` - Compiled TypeScript output
141
+ - `signalpilot_ai_internal/labextension/` - JupyterLab extension package
142
+ - `style/` - CSS stylesheets and icons
143
+
144
+ ## Testing Strategy
145
+
146
+ - Jest for unit tests (`__tests__/` and `ui-tests/`)
147
+ - Playwright for integration tests
148
+ - Test configuration in `jest.config.js`
149
+ - Coverage reporting enabled
150
+
151
+ ## Extension Development Notes
152
+
153
+ ### JupyterLab Integration
154
+ - Requires JupyterLab >= 4.0.0
155
+ - Uses JupyterLab's plugin system for initialization
156
+ - Integrates with notebook tracker and command palette
157
+ - Supports JupyterLab theming system
158
+
159
+ ### Database Integration
160
+ - PGLite integration for local database operations
161
+ - Database URL management through kernel environment
162
+ - Metadata caching for performance optimization
163
+
164
+ ### Theme Support
165
+ - Automatic dark theme application on first load
166
+ - Diff visualization adapts to JupyterLab theme
167
+ - CSS custom properties for theme consistency
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2025, Daniel Schaffield
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,207 @@
1
+ Metadata-Version: 2.4
2
+ Name: sage_agent_internal
3
+ Version: 0.1.1
4
+ Summary: Sage Agent - Your Jupyter Notebook Assistant
5
+ Project-URL: Homepage, https://sagebook.ai/
6
+ Author-email: Daniel Schaffield <danielschaffield@gmail.com>
7
+ License: BSD 3-Clause License
8
+
9
+ Copyright (c) 2025, Daniel Schaffield
10
+ All rights reserved.
11
+
12
+ Redistribution and use in source and binary forms, with or without
13
+ modification, are permitted provided that the following conditions are met:
14
+
15
+ 1. Redistributions of source code must retain the above copyright notice, this
16
+ list of conditions and the following disclaimer.
17
+
18
+ 2. Redistributions in binary form must reproduce the above copyright notice,
19
+ this list of conditions and the following disclaimer in the documentation
20
+ and/or other materials provided with the distribution.
21
+
22
+ 3. Neither the name of the copyright holder nor the names of its
23
+ contributors may be used to endorse or promote products derived from
24
+ this software without specific prior written permission.
25
+
26
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
30
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
34
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
+ License-File: LICENSE
37
+ Keywords: jupyter,jupyterlab,jupyterlab-extension
38
+ Classifier: Framework :: Jupyter
39
+ Classifier: Framework :: Jupyter :: JupyterLab
40
+ Classifier: Framework :: Jupyter :: JupyterLab :: 4
41
+ Classifier: Framework :: Jupyter :: JupyterLab :: Extensions
42
+ Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
43
+ Classifier: License :: OSI Approved :: BSD License
44
+ Classifier: Programming Language :: Python
45
+ Classifier: Programming Language :: Python :: 3
46
+ Classifier: Programming Language :: Python :: 3.6
47
+ Classifier: Programming Language :: Python :: 3.9
48
+ Classifier: Programming Language :: Python :: 3.10
49
+ Classifier: Programming Language :: Python :: 3.11
50
+ Classifier: Programming Language :: Python :: 3.12
51
+ Classifier: Programming Language :: Python :: 3.13
52
+ Requires-Python: >=3.6
53
+ Description-Content-Type: text/markdown
54
+
55
+ # **Sage Agent — The AI-Powered Assistant for Jupyter Notebooks**
56
+
57
+ ![Logo](https://i.imgur.com/JdA8ilQ.png)
58
+
59
+ ---
60
+
61
+ ## **What is Sage Agent?**
62
+
63
+ **Sage is an AI-native notebook assistant that supercharges your existing Jupyter workflows.**
64
+
65
+ Built by leading AI and quant researchers from YC, Harvard, MIT, and Goldman Sachs, Sage brings real-time, context-aware assistance directly into JupyterLab.
66
+
67
+ Use natural language to clean data, write analysis code, debug errors, explore dataframes, and build models—faster and with fewer mistakes.
68
+
69
+ **No hallucinated code. No context switching. Just faster insights.**
70
+
71
+ ---
72
+
73
+ ## **Why Use Sage Agent in Jupyter?**
74
+
75
+ Whether you’re a quant, data scientist, or analyst living in notebooks, Sage helps you:
76
+
77
+ ✅ Clean and transform messy data in seconds
78
+
79
+ ✅ Visualize trends, rollups, and anomalies from a prompt
80
+
81
+ ✅ Connect your custom databases in one click and easily explore from notebooks
82
+
83
+ ✅ Generate *runnable* Python or SQL that fits your current cell + variable context
84
+
85
+ ✅ Auto-detect schema changes and debug downstream errors
86
+
87
+ ✅ Stay private: run entirely *local-first* or in your own secure VPC
88
+
89
+ ✅ Extend JupyterLab without changing how you work
90
+
91
+ ---
92
+
93
+ ## **Perfect For:**
94
+
95
+ - Data scientists cleaning huge CSVs
96
+ - Quant researchers testing ML pipelines
97
+ - Product and analytics teams tired of building dashboards and flaky notebooks
98
+ - Anyone tired of LLM tools that break their code
99
+
100
+ ---
101
+
102
+ ## **Installation**
103
+
104
+ ### **📦 Requirements**
105
+
106
+ - JupyterLab >= 4.0.0
107
+ - NodeJS (for development)
108
+
109
+ ### **🧠 Install Sage Agent:**
110
+
111
+ ```
112
+ pip install jupyterlab signalpilot_ai_internal
113
+ ```
114
+
115
+ ### **❌ Uninstall:**
116
+
117
+ ```
118
+ pip uninstall signalpilot_ai_internal
119
+ ```
120
+
121
+ ---
122
+
123
+ ## **How to Get Started**
124
+
125
+ To unlock full functionality, you’ll need Sage API credentials.
126
+
127
+ 👉 [**Request your API key**](https://sagebook.ai/#contact) or email us at [contact@sagebook.ai](mailto:contact@sagebook.ai)
128
+
129
+ ---
130
+
131
+ ## **Why Sage**
132
+
133
+ - ✅ Context-aware code gen: understands variables, dataframes, imports, and prior cells
134
+ - ✅ AI that *fixes* schema issues and silent join bugs
135
+ - ✅ Inline review + diffs before you run any code
136
+ - ✅ Visualizations via natural language (matplotlib, plotly, seaborn supported)
137
+ - ✅ BYO LLM: Anthropic, OpenAI, vLLM, Ollama, or HF endpoints
138
+ - ✅ Built to run in air-gapped / enterprise environments
139
+
140
+ ---
141
+
142
+ ## **Local Development Instructions**
143
+
144
+ To contribute or develop locally:
145
+
146
+ ```
147
+ # Clone the repo and enter the directory
148
+ git clone https://github.com/sagebook/signalpilot_ai_internal.git
149
+ cd signalpilot_ai_internal
150
+
151
+ # Install in editable mode
152
+ pip install -e "."
153
+
154
+ # Link extension to JupyterLab
155
+ jupyter labextension develop . --overwrite
156
+
157
+ # Rebuild on changes
158
+ jlpm build
159
+ ```
160
+
161
+ For auto-rebuild while editing:
162
+
163
+ ```
164
+ # Watch source
165
+ jlpm watch
166
+
167
+ # Run JupyterLab in parallel
168
+ jupyter lab
169
+ ```
170
+
171
+ ---
172
+
173
+ ## **Uninstall in Dev Mode**
174
+
175
+ ```
176
+ pip uninstall signalpilot_ai_internal
177
+ # Then manually remove labextension symlink from JupyterLab extensions dir.
178
+ ```
179
+
180
+ ---
181
+
182
+ ## **Want to See Sage in Action?**
183
+
184
+ 🎥 Try the demo notebook or explore at [https://sagebook.ai](https://sagebook.ai/)
185
+
186
+ ---
187
+
188
+ **Built for teams working with sensitive data:**
189
+
190
+ - Zero data retention by default
191
+ - Optional BYO keys for Claude, OpenAI, or local models
192
+ - Notebook-specific controls for what the model can “see”
193
+ - Fine-grained telemetry settings
194
+
195
+ ---
196
+
197
+ ## **Contact**
198
+
199
+ Questions? Ideas?
200
+
201
+ Email: [fahim@sagebook.ai](mailto:fahim@sagebook.ai)
202
+
203
+ Website: [https://sagebook.ai](https://sagebook.ai/)
204
+
205
+ ---
206
+
207
+ AI Jupyter Notebook, JupyterLab Extension, Jupyter Assistant, Data Science Assistant, Jupyter LLM, AI code generation, dataframe cleaning, Jupyter AI, Sagebook, Sage Agent, AI for dataframes, Jupyter SQL assistant, notebook extension