@gokulvenkatareddy/cortex 0.1.7

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 (299) hide show
  1. package/README.md +1295 -0
  2. package/apps/octogent/.github/workflows/ci.yml +40 -0
  3. package/apps/octogent/.shims/claude +4 -0
  4. package/apps/octogent/AGENTS.md +71 -0
  5. package/apps/octogent/CONTRIBUTING.md +72 -0
  6. package/apps/octogent/LICENSE +21 -0
  7. package/apps/octogent/README.md +184 -0
  8. package/apps/octogent/apps/api/AGENTS.md +32 -0
  9. package/apps/octogent/apps/api/package.json +19 -0
  10. package/apps/octogent/apps/api/src/agentStateDetection.ts +181 -0
  11. package/apps/octogent/apps/api/src/claudeSessionScanner.ts +235 -0
  12. package/apps/octogent/apps/api/src/claudeSkills.ts +182 -0
  13. package/apps/octogent/apps/api/src/claudeUsage.ts +922 -0
  14. package/apps/octogent/apps/api/src/cli.ts +595 -0
  15. package/apps/octogent/apps/api/src/codeIntelStore.ts +46 -0
  16. package/apps/octogent/apps/api/src/codexUsage.ts +278 -0
  17. package/apps/octogent/apps/api/src/createApiServer/codeIntelRoutes.ts +60 -0
  18. package/apps/octogent/apps/api/src/createApiServer/conversationRoutes.ts +128 -0
  19. package/apps/octogent/apps/api/src/createApiServer/deckRoutes.ts +873 -0
  20. package/apps/octogent/apps/api/src/createApiServer/gitParsers.ts +140 -0
  21. package/apps/octogent/apps/api/src/createApiServer/gitRoutes.ts +214 -0
  22. package/apps/octogent/apps/api/src/createApiServer/miscRoutes.ts +316 -0
  23. package/apps/octogent/apps/api/src/createApiServer/monitorParsers.ts +137 -0
  24. package/apps/octogent/apps/api/src/createApiServer/monitorRoutes.ts +95 -0
  25. package/apps/octogent/apps/api/src/createApiServer/requestHandler.ts +311 -0
  26. package/apps/octogent/apps/api/src/createApiServer/requestParsers.ts +25 -0
  27. package/apps/octogent/apps/api/src/createApiServer/routeHelpers.ts +97 -0
  28. package/apps/octogent/apps/api/src/createApiServer/security.ts +70 -0
  29. package/apps/octogent/apps/api/src/createApiServer/terminalParsers.ts +167 -0
  30. package/apps/octogent/apps/api/src/createApiServer/terminalRoutes.ts +315 -0
  31. package/apps/octogent/apps/api/src/createApiServer/types.ts +24 -0
  32. package/apps/octogent/apps/api/src/createApiServer/uiStateParsers.ts +255 -0
  33. package/apps/octogent/apps/api/src/createApiServer/upgradeHandler.ts +38 -0
  34. package/apps/octogent/apps/api/src/createApiServer/usageRoutes.ts +84 -0
  35. package/apps/octogent/apps/api/src/createApiServer.ts +176 -0
  36. package/apps/octogent/apps/api/src/deck/readDeckTentacles.ts +595 -0
  37. package/apps/octogent/apps/api/src/githubRepoSummary.ts +397 -0
  38. package/apps/octogent/apps/api/src/logging.ts +9 -0
  39. package/apps/octogent/apps/api/src/monitor/defaults.ts +3 -0
  40. package/apps/octogent/apps/api/src/monitor/index.ts +8 -0
  41. package/apps/octogent/apps/api/src/monitor/repository.ts +303 -0
  42. package/apps/octogent/apps/api/src/monitor/service.ts +349 -0
  43. package/apps/octogent/apps/api/src/monitor/types.ts +120 -0
  44. package/apps/octogent/apps/api/src/monitor/xProvider.ts +587 -0
  45. package/apps/octogent/apps/api/src/projectPersistence.ts +377 -0
  46. package/apps/octogent/apps/api/src/prompts/index.ts +10 -0
  47. package/apps/octogent/apps/api/src/prompts/promptResolver.ts +145 -0
  48. package/apps/octogent/apps/api/src/runtimeMetadata.ts +69 -0
  49. package/apps/octogent/apps/api/src/server.ts +80 -0
  50. package/apps/octogent/apps/api/src/setupState.ts +80 -0
  51. package/apps/octogent/apps/api/src/setupStatus.ts +174 -0
  52. package/apps/octogent/apps/api/src/startupPrerequisites.ts +146 -0
  53. package/apps/octogent/apps/api/src/terminalRuntime/channelMessaging.ts +87 -0
  54. package/apps/octogent/apps/api/src/terminalRuntime/claudeTranscript.ts +279 -0
  55. package/apps/octogent/apps/api/src/terminalRuntime/constants.ts +15 -0
  56. package/apps/octogent/apps/api/src/terminalRuntime/conversations.ts +492 -0
  57. package/apps/octogent/apps/api/src/terminalRuntime/gitOperations.ts +341 -0
  58. package/apps/octogent/apps/api/src/terminalRuntime/hookProcessor.ts +405 -0
  59. package/apps/octogent/apps/api/src/terminalRuntime/protocol.ts +46 -0
  60. package/apps/octogent/apps/api/src/terminalRuntime/ptyEnvironment.ts +50 -0
  61. package/apps/octogent/apps/api/src/terminalRuntime/registry.ts +423 -0
  62. package/apps/octogent/apps/api/src/terminalRuntime/sessionRuntime.ts +671 -0
  63. package/apps/octogent/apps/api/src/terminalRuntime/systemClients.ts +432 -0
  64. package/apps/octogent/apps/api/src/terminalRuntime/types.ts +157 -0
  65. package/apps/octogent/apps/api/src/terminalRuntime/worktreeManager.ts +135 -0
  66. package/apps/octogent/apps/api/src/terminalRuntime.ts +567 -0
  67. package/apps/octogent/apps/api/src/usageUtils.ts +16 -0
  68. package/apps/octogent/apps/api/src/ws-shim.d.ts +28 -0
  69. package/apps/octogent/apps/api/tests/agentStateDetection.test.ts +67 -0
  70. package/apps/octogent/apps/api/tests/claudeUsage.test.ts +583 -0
  71. package/apps/octogent/apps/api/tests/codexUsage.test.ts +107 -0
  72. package/apps/octogent/apps/api/tests/createApiServer.test.ts +3207 -0
  73. package/apps/octogent/apps/api/tests/githubRepoSummary.test.ts +100 -0
  74. package/apps/octogent/apps/api/tests/logging.test.ts +33 -0
  75. package/apps/octogent/apps/api/tests/monitorApi.test.ts +467 -0
  76. package/apps/octogent/apps/api/tests/monitorCore.test.ts +104 -0
  77. package/apps/octogent/apps/api/tests/promptResolver.test.ts +109 -0
  78. package/apps/octogent/apps/api/tests/protocol.test.ts +14 -0
  79. package/apps/octogent/apps/api/tests/sessionRuntime.test.ts +608 -0
  80. package/apps/octogent/apps/api/tests/startupPrerequisites.test.ts +70 -0
  81. package/apps/octogent/apps/api/tests/upgradeHandler.test.ts +40 -0
  82. package/apps/octogent/apps/api/tests/xMonitorProvider.test.ts +109 -0
  83. package/apps/octogent/apps/api/tsconfig.json +7 -0
  84. package/apps/octogent/apps/api/vitest.config.ts +7 -0
  85. package/apps/octogent/apps/web/AGENTS.md +38 -0
  86. package/apps/octogent/apps/web/index.html +13 -0
  87. package/apps/octogent/apps/web/package.json +32 -0
  88. package/apps/octogent/apps/web/public/octopus-favicon.svg +26 -0
  89. package/apps/octogent/apps/web/src/App.tsx +646 -0
  90. package/apps/octogent/apps/web/src/app/canvas/types.ts +34 -0
  91. package/apps/octogent/apps/web/src/app/codeIntelAggregation.ts +278 -0
  92. package/apps/octogent/apps/web/src/app/constants.ts +28 -0
  93. package/apps/octogent/apps/web/src/app/conversationNormalizers.ts +135 -0
  94. package/apps/octogent/apps/web/src/app/formatTimestamp.ts +18 -0
  95. package/apps/octogent/apps/web/src/app/githubMetrics.ts +76 -0
  96. package/apps/octogent/apps/web/src/app/githubNormalizers.ts +91 -0
  97. package/apps/octogent/apps/web/src/app/hooks/useAgentRuntimeStates.ts +18 -0
  98. package/apps/octogent/apps/web/src/app/hooks/useBackendLivenessPolling.ts +53 -0
  99. package/apps/octogent/apps/web/src/app/hooks/useCanvasGraphData.ts +449 -0
  100. package/apps/octogent/apps/web/src/app/hooks/useCanvasTransform.ts +260 -0
  101. package/apps/octogent/apps/web/src/app/hooks/useClaudeUsagePolling.ts +40 -0
  102. package/apps/octogent/apps/web/src/app/hooks/useClickOutside.ts +30 -0
  103. package/apps/octogent/apps/web/src/app/hooks/useCodeIntelRuntime.ts +83 -0
  104. package/apps/octogent/apps/web/src/app/hooks/useCodexUsagePolling.ts +35 -0
  105. package/apps/octogent/apps/web/src/app/hooks/useConsoleKeyboardShortcuts.ts +31 -0
  106. package/apps/octogent/apps/web/src/app/hooks/useConversationsRuntime.ts +377 -0
  107. package/apps/octogent/apps/web/src/app/hooks/useForceSimulation.ts +319 -0
  108. package/apps/octogent/apps/web/src/app/hooks/useGitHubPrimaryViewModel.ts +143 -0
  109. package/apps/octogent/apps/web/src/app/hooks/useGithubSummaryPolling.ts +28 -0
  110. package/apps/octogent/apps/web/src/app/hooks/useInitialColumnsHydration.ts +64 -0
  111. package/apps/octogent/apps/web/src/app/hooks/useMonitorRuntime.ts +220 -0
  112. package/apps/octogent/apps/web/src/app/hooks/usePersistedUiState.ts +536 -0
  113. package/apps/octogent/apps/web/src/app/hooks/usePollingData.ts +79 -0
  114. package/apps/octogent/apps/web/src/app/hooks/usePromptLibrary.ts +185 -0
  115. package/apps/octogent/apps/web/src/app/hooks/useTentacleGitLifecycle.ts +530 -0
  116. package/apps/octogent/apps/web/src/app/hooks/useTerminalCompletionNotification.ts +94 -0
  117. package/apps/octogent/apps/web/src/app/hooks/useTerminalMutations.ts +266 -0
  118. package/apps/octogent/apps/web/src/app/hooks/useTerminalStateReconciliation.ts +23 -0
  119. package/apps/octogent/apps/web/src/app/hooks/useUsageHeatmapPolling.ts +43 -0
  120. package/apps/octogent/apps/web/src/app/hooks/useWorkspaceSetup.ts +80 -0
  121. package/apps/octogent/apps/web/src/app/hotkeys.ts +31 -0
  122. package/apps/octogent/apps/web/src/app/monitorNormalizers.ts +145 -0
  123. package/apps/octogent/apps/web/src/app/notificationSounds.ts +164 -0
  124. package/apps/octogent/apps/web/src/app/terminalRuntimeStateStore.ts +261 -0
  125. package/apps/octogent/apps/web/src/app/terminalState.ts +21 -0
  126. package/apps/octogent/apps/web/src/app/types.ts +42 -0
  127. package/apps/octogent/apps/web/src/app/uiStateNormalizers.ts +113 -0
  128. package/apps/octogent/apps/web/src/app/usageNormalizers.ts +58 -0
  129. package/apps/octogent/apps/web/src/components/ActiveAgentsSidebar.tsx +60 -0
  130. package/apps/octogent/apps/web/src/components/ActivityPrimaryView.tsx +21 -0
  131. package/apps/octogent/apps/web/src/components/AgentStateBadge.tsx +47 -0
  132. package/apps/octogent/apps/web/src/components/CanvasPrimaryView.tsx +1532 -0
  133. package/apps/octogent/apps/web/src/components/ClearAllConversationsDialog.tsx +33 -0
  134. package/apps/octogent/apps/web/src/components/CodeIntelArcDiagram.tsx +245 -0
  135. package/apps/octogent/apps/web/src/components/CodeIntelPrimaryView.tsx +104 -0
  136. package/apps/octogent/apps/web/src/components/CodeIntelTreemap.tsx +138 -0
  137. package/apps/octogent/apps/web/src/components/ConsolePrimaryNav.tsx +31 -0
  138. package/apps/octogent/apps/web/src/components/ConversationsPrimaryView.tsx +243 -0
  139. package/apps/octogent/apps/web/src/components/DeckPrimaryView.tsx +613 -0
  140. package/apps/octogent/apps/web/src/components/DeleteTentacleDialog.tsx +91 -0
  141. package/apps/octogent/apps/web/src/components/EmptyOctopus.tsx +715 -0
  142. package/apps/octogent/apps/web/src/components/GitHubPrimaryView.tsx +494 -0
  143. package/apps/octogent/apps/web/src/components/MonitorPrimaryView.tsx +475 -0
  144. package/apps/octogent/apps/web/src/components/PrimaryViewRouter.tsx +99 -0
  145. package/apps/octogent/apps/web/src/components/PromptsPrimaryView.tsx +243 -0
  146. package/apps/octogent/apps/web/src/components/RuntimeStatusStrip.tsx +273 -0
  147. package/apps/octogent/apps/web/src/components/SettingsPrimaryView.tsx +92 -0
  148. package/apps/octogent/apps/web/src/components/SidebarActionPanel.tsx +124 -0
  149. package/apps/octogent/apps/web/src/components/SidebarConversationsList.tsx +279 -0
  150. package/apps/octogent/apps/web/src/components/SidebarPromptsList.tsx +116 -0
  151. package/apps/octogent/apps/web/src/components/TelemetryTape.tsx +106 -0
  152. package/apps/octogent/apps/web/src/components/TentacleGitActionsDialog.tsx +341 -0
  153. package/apps/octogent/apps/web/src/components/Terminal.tsx +524 -0
  154. package/apps/octogent/apps/web/src/components/TerminalPromptPicker.tsx +140 -0
  155. package/apps/octogent/apps/web/src/components/UsageHeatmap.tsx +702 -0
  156. package/apps/octogent/apps/web/src/components/canvas/CanvasTentaclePanel.tsx +485 -0
  157. package/apps/octogent/apps/web/src/components/canvas/CanvasTerminalColumn.tsx +89 -0
  158. package/apps/octogent/apps/web/src/components/canvas/DeleteAllTerminalsDialog.tsx +221 -0
  159. package/apps/octogent/apps/web/src/components/canvas/OctopusNode.tsx +307 -0
  160. package/apps/octogent/apps/web/src/components/canvas/SessionNode.tsx +185 -0
  161. package/apps/octogent/apps/web/src/components/deck/ActionCards.tsx +118 -0
  162. package/apps/octogent/apps/web/src/components/deck/AddTentacleForm.tsx +269 -0
  163. package/apps/octogent/apps/web/src/components/deck/DeckBottomActions.tsx +56 -0
  164. package/apps/octogent/apps/web/src/components/deck/TentaclePod.tsx +334 -0
  165. package/apps/octogent/apps/web/src/components/deck/WorkspaceSetupCard.tsx +105 -0
  166. package/apps/octogent/apps/web/src/components/deck/octopusVisuals.ts +72 -0
  167. package/apps/octogent/apps/web/src/components/terminalReplay.ts +62 -0
  168. package/apps/octogent/apps/web/src/components/terminalWheel.ts +54 -0
  169. package/apps/octogent/apps/web/src/components/ui/ActionButton.tsx +34 -0
  170. package/apps/octogent/apps/web/src/components/ui/ConfirmationDialog.tsx +86 -0
  171. package/apps/octogent/apps/web/src/components/ui/MarkdownContent.tsx +43 -0
  172. package/apps/octogent/apps/web/src/components/ui/SettingsToggle.tsx +34 -0
  173. package/apps/octogent/apps/web/src/components/ui/StatusBadge.tsx +24 -0
  174. package/apps/octogent/apps/web/src/main.tsx +17 -0
  175. package/apps/octogent/apps/web/src/runtime/HttpTerminalSnapshotReader.ts +87 -0
  176. package/apps/octogent/apps/web/src/runtime/runtimeEndpoints.ts +412 -0
  177. package/apps/octogent/apps/web/src/styles/chrome-and-buttons.css +272 -0
  178. package/apps/octogent/apps/web/src/styles/console-canvas-activity.css +358 -0
  179. package/apps/octogent/apps/web/src/styles/console-canvas-canvas.css +1843 -0
  180. package/apps/octogent/apps/web/src/styles/console-canvas-code-intel.css +227 -0
  181. package/apps/octogent/apps/web/src/styles/console-canvas-conversations.css +705 -0
  182. package/apps/octogent/apps/web/src/styles/console-canvas-deck.css +1524 -0
  183. package/apps/octogent/apps/web/src/styles/console-canvas-github.css +541 -0
  184. package/apps/octogent/apps/web/src/styles/console-canvas-monitor.css +595 -0
  185. package/apps/octogent/apps/web/src/styles/console-canvas-pixpack.css +81 -0
  186. package/apps/octogent/apps/web/src/styles/console-canvas-prompts.css +474 -0
  187. package/apps/octogent/apps/web/src/styles/console-canvas-settings.css +207 -0
  188. package/apps/octogent/apps/web/src/styles/console-chrome-status-nav.css +441 -0
  189. package/apps/octogent/apps/web/src/styles/console-overrides-telemetry.css +320 -0
  190. package/apps/octogent/apps/web/src/styles/console-theme-tokens.css +25 -0
  191. package/apps/octogent/apps/web/src/styles/cortex-theme.css +412 -0
  192. package/apps/octogent/apps/web/src/styles/foundation.css +100 -0
  193. package/apps/octogent/apps/web/src/styles/sidebar-and-scrollbars.css +447 -0
  194. package/apps/octogent/apps/web/src/styles/terminal-and-status.css +356 -0
  195. package/apps/octogent/apps/web/src/styles.css +25 -0
  196. package/apps/octogent/apps/web/src/types/ws.d.ts +23 -0
  197. package/apps/octogent/apps/web/tests/CanvasPrimaryView.test.tsx +347 -0
  198. package/apps/octogent/apps/web/tests/HttpTerminalSnapshotReader.test.tsx +54 -0
  199. package/apps/octogent/apps/web/tests/RuntimeStatusStrip.test.tsx +70 -0
  200. package/apps/octogent/apps/web/tests/Terminal.test.tsx +87 -0
  201. package/apps/octogent/apps/web/tests/add-tentacle-form.test.tsx +48 -0
  202. package/apps/octogent/apps/web/tests/app-github-runtime.test.tsx +162 -0
  203. package/apps/octogent/apps/web/tests/app-monitor-runtime.test.tsx +657 -0
  204. package/apps/octogent/apps/web/tests/app-shell-navigation.test.tsx +109 -0
  205. package/apps/octogent/apps/web/tests/app-swarm-refresh.test.tsx +268 -0
  206. package/apps/octogent/apps/web/tests/app-ui-state-persistence.test.tsx +116 -0
  207. package/apps/octogent/apps/web/tests/app-workspace-setup.test.tsx +217 -0
  208. package/apps/octogent/apps/web/tests/canvas-tentacle-panel.test.tsx +195 -0
  209. package/apps/octogent/apps/web/tests/delete-all-terminals-dialog.test.tsx +76 -0
  210. package/apps/octogent/apps/web/tests/githubMetrics.test.tsx +52 -0
  211. package/apps/octogent/apps/web/tests/hotkeys.test.tsx +44 -0
  212. package/apps/octogent/apps/web/tests/runtimeEndpoints.test.tsx +240 -0
  213. package/apps/octogent/apps/web/tests/setup.ts +39 -0
  214. package/apps/octogent/apps/web/tests/tentacle-pod.test.tsx +62 -0
  215. package/apps/octogent/apps/web/tests/terminalReplay.test.ts +71 -0
  216. package/apps/octogent/apps/web/tests/terminalState.test.tsx +49 -0
  217. package/apps/octogent/apps/web/tests/terminalWheel.test.tsx +51 -0
  218. package/apps/octogent/apps/web/tests/test-utils/appTestHarness.ts +48 -0
  219. package/apps/octogent/apps/web/tests/uiPrimitives.test.tsx +31 -0
  220. package/apps/octogent/apps/web/tests/useAgentRuntimeStates.test.tsx +47 -0
  221. package/apps/octogent/apps/web/tsconfig.json +8 -0
  222. package/apps/octogent/apps/web/vite.api.bundle.config.mts +32 -0
  223. package/apps/octogent/apps/web/vite.config.ts +22 -0
  224. package/apps/octogent/bin/octogent +3 -0
  225. package/apps/octogent/biome.json +21 -0
  226. package/apps/octogent/docs/concepts/mental-model.md +79 -0
  227. package/apps/octogent/docs/concepts/runtime-and-api.md +60 -0
  228. package/apps/octogent/docs/concepts/tentacles.md +85 -0
  229. package/apps/octogent/docs/getting-started/installation.md +54 -0
  230. package/apps/octogent/docs/getting-started/quickstart.md +79 -0
  231. package/apps/octogent/docs/guides/inter-agent-messaging.md +43 -0
  232. package/apps/octogent/docs/guides/orchestrating-child-agents.md +49 -0
  233. package/apps/octogent/docs/guides/working-with-todos.md +56 -0
  234. package/apps/octogent/docs/index.md +40 -0
  235. package/apps/octogent/docs/reference/api.md +103 -0
  236. package/apps/octogent/docs/reference/cli.md +71 -0
  237. package/apps/octogent/docs/reference/experimental-features.md +28 -0
  238. package/apps/octogent/docs/reference/filesystem-layout.md +62 -0
  239. package/apps/octogent/docs/reference/troubleshooting.md +49 -0
  240. package/apps/octogent/package.json +35 -0
  241. package/apps/octogent/packages/core/AGENTS.md +31 -0
  242. package/apps/octogent/packages/core/package.json +12 -0
  243. package/apps/octogent/packages/core/src/adapters/InMemoryTerminalSnapshotReader.ts +10 -0
  244. package/apps/octogent/packages/core/src/application/buildTerminalList.ts +13 -0
  245. package/apps/octogent/packages/core/src/domain/agentRuntime.ts +18 -0
  246. package/apps/octogent/packages/core/src/domain/channel.ts +8 -0
  247. package/apps/octogent/packages/core/src/domain/completionSound.ts +14 -0
  248. package/apps/octogent/packages/core/src/domain/conversation.ts +48 -0
  249. package/apps/octogent/packages/core/src/domain/deck.ts +33 -0
  250. package/apps/octogent/packages/core/src/domain/git.ts +32 -0
  251. package/apps/octogent/packages/core/src/domain/monitor.ts +62 -0
  252. package/apps/octogent/packages/core/src/domain/setup.ts +27 -0
  253. package/apps/octogent/packages/core/src/domain/terminal.ts +17 -0
  254. package/apps/octogent/packages/core/src/domain/uiState.ts +22 -0
  255. package/apps/octogent/packages/core/src/domain/usage.ts +60 -0
  256. package/apps/octogent/packages/core/src/index.ts +15 -0
  257. package/apps/octogent/packages/core/src/ports/TerminalSnapshotReader.ts +5 -0
  258. package/apps/octogent/packages/core/src/util/typeCoercion.ts +20 -0
  259. package/apps/octogent/packages/core/tests/buildTerminalList.test.ts +75 -0
  260. package/apps/octogent/packages/core/tsconfig.json +7 -0
  261. package/apps/octogent/packages/core/tsconfig.tsbuildinfo +1 -0
  262. package/apps/octogent/packages/core/vitest.config.ts +7 -0
  263. package/apps/octogent/pnpm-lock.yaml +3212 -0
  264. package/apps/octogent/pnpm-workspace.yaml +3 -0
  265. package/apps/octogent/prompts/meta-prompt-generator.md +223 -0
  266. package/apps/octogent/prompts/octoboss-clean-contexts.md +30 -0
  267. package/apps/octogent/prompts/octoboss-reorganize-tentacles.md +29 -0
  268. package/apps/octogent/prompts/octoboss-reorganize-todos.md +27 -0
  269. package/apps/octogent/prompts/sandbox-init.md +3 -0
  270. package/apps/octogent/prompts/swarm-parent.md +83 -0
  271. package/apps/octogent/prompts/swarm-worker.md +50 -0
  272. package/apps/octogent/prompts/tentacle-context-init.md +1 -0
  273. package/apps/octogent/prompts/tentacle-planner.md +110 -0
  274. package/apps/octogent/prompts/tentacle-reorganize-todos.md +20 -0
  275. package/apps/octogent/prompts/tentacle-update-tentacle.md +18 -0
  276. package/apps/octogent/scripts/build-package.mjs +23 -0
  277. package/apps/octogent/scripts/dev.mjs +158 -0
  278. package/apps/octogent/scripts/smoke-public-install.mjs +271 -0
  279. package/apps/octogent/static/images/octogent-header.png +0 -0
  280. package/apps/octogent/static/images/preview_1.jpg +0 -0
  281. package/apps/octogent/static/images/preview_2.jpg +0 -0
  282. package/apps/octogent/static/images/preview_3.jpg +0 -0
  283. package/apps/octogent/static/images/preview_4.jpg +0 -0
  284. package/apps/octogent/static/images/preview_5.jpg +0 -0
  285. package/apps/octogent/static/images/preview_6.jpg +0 -0
  286. package/apps/octogent/tsconfig.base.json +16 -0
  287. package/bin/AGI +3 -0
  288. package/bin/AGI-install-app +71 -0
  289. package/bin/AGI-ui +16 -0
  290. package/bin/AGI-voice +15 -0
  291. package/bin/AGI-web +16 -0
  292. package/bin/cortex +109 -0
  293. package/bin/cortex-octogent +99 -0
  294. package/bin/import-specifier.mjs +13 -0
  295. package/bin/import-specifier.test.mjs +13 -0
  296. package/bin/octo +150 -0
  297. package/dist/cli.mjs +555650 -0
  298. package/package.json +157 -0
  299. package/scripts/setup-wizard.ts +390 -0
@@ -0,0 +1,217 @@
1
+ import { cleanup, fireEvent, render, screen, waitFor, within } from "@testing-library/react";
2
+ import { afterEach, describe, expect, it, vi } from "vitest";
3
+
4
+ import type { WorkspaceSetupSnapshot } from "@octogent/core";
5
+
6
+ import { App } from "../src/App";
7
+ import { jsonResponse, notFoundResponse, resetAppTestHarness } from "./test-utils/appTestHarness";
8
+
9
+ const buildSetupSnapshot = (
10
+ overrides: Partial<WorkspaceSetupSnapshot> = {},
11
+ ): WorkspaceSetupSnapshot => ({
12
+ isFirstRun: true,
13
+ shouldShowSetupCard: true,
14
+ hasAnyTentacles: false,
15
+ tentacleCount: 0,
16
+ steps: [
17
+ {
18
+ id: "initialize-workspace",
19
+ title: "Initialize workspace",
20
+ description: "Create Octogent project files and runtime directories.",
21
+ complete: false,
22
+ required: true,
23
+ actionLabel: "Initialize workspace",
24
+ statusText: "Create .octogent project files before continuing.",
25
+ guidance: "Workspace initialization failed. Run the Octogent initializer in this repository.",
26
+ command: "octogent init",
27
+ },
28
+ {
29
+ id: "ensure-gitignore",
30
+ title: "Ignore .octogent",
31
+ description: "Add .octogent to .gitignore, or create .gitignore when it is missing.",
32
+ complete: false,
33
+ required: true,
34
+ actionLabel: "Update .gitignore",
35
+ statusText: "Add .octogent to .gitignore before creating tentacles.",
36
+ guidance:
37
+ "Git ignore entry is missing. Create or update .gitignore with the Octogent workspace path.",
38
+ command: "printf '.octogent\\n' >> .gitignore",
39
+ },
40
+ {
41
+ id: "check-claude",
42
+ title: "Check Claude Code",
43
+ description: "Verify the default Claude Code workflow is available on this machine.",
44
+ complete: true,
45
+ required: false,
46
+ actionLabel: "Check Claude Code",
47
+ statusText: "Claude Code is available.",
48
+ guidance: null,
49
+ command: null,
50
+ },
51
+ {
52
+ id: "check-git",
53
+ title: "Check Git",
54
+ description: "Verify Git is available for worktree-backed tentacles.",
55
+ complete: true,
56
+ required: false,
57
+ actionLabel: "Check Git",
58
+ statusText: "Git is available.",
59
+ guidance: null,
60
+ command: null,
61
+ },
62
+ {
63
+ id: "check-curl",
64
+ title: "Check curl",
65
+ description: "Verify curl is available for Claude hook callbacks.",
66
+ complete: true,
67
+ required: false,
68
+ actionLabel: "Check curl",
69
+ statusText: "curl is available.",
70
+ guidance: null,
71
+ command: null,
72
+ },
73
+ {
74
+ id: "create-tentacles",
75
+ title: "Create tentacles",
76
+ description: "Create at least one tentacle before launching a coding agent.",
77
+ complete: false,
78
+ required: true,
79
+ actionLabel: null,
80
+ statusText: "Create your first tentacle to continue.",
81
+ guidance: "Use the planner or manual creation to add at least one tentacle.",
82
+ command: null,
83
+ },
84
+ ],
85
+ ...overrides,
86
+ });
87
+
88
+ const mockAppRequests = (
89
+ resolveSetup: () => WorkspaceSetupSnapshot,
90
+ options: {
91
+ onEnsureGitignoreStep?: () => WorkspaceSetupSnapshot;
92
+ } = {},
93
+ ) => {
94
+ return vi.spyOn(globalThis, "fetch").mockImplementation(async (input, init) => {
95
+ const url = String(input);
96
+ const method = init?.method ?? "GET";
97
+
98
+ if (url.endsWith("/api/terminal-snapshots") && method === "GET") {
99
+ return jsonResponse([]);
100
+ }
101
+
102
+ if (url.endsWith("/api/deck/tentacles") && method === "GET") {
103
+ return jsonResponse([]);
104
+ }
105
+
106
+ if (url.endsWith("/api/setup") && method === "GET") {
107
+ return jsonResponse(resolveSetup());
108
+ }
109
+
110
+ if (url.endsWith("/api/setup/steps/ensure-gitignore") && method === "POST") {
111
+ return jsonResponse(
112
+ options.onEnsureGitignoreStep ? options.onEnsureGitignoreStep() : resolveSetup(),
113
+ );
114
+ }
115
+
116
+ if (url.endsWith("/api/codex/usage") && method === "GET") {
117
+ return jsonResponse({
118
+ status: "unavailable",
119
+ source: "none",
120
+ fetchedAt: "2026-02-27T12:00:00.000Z",
121
+ });
122
+ }
123
+
124
+ if (url.endsWith("/api/claude/usage") && method === "GET") {
125
+ return jsonResponse({
126
+ status: "unavailable",
127
+ source: "none",
128
+ fetchedAt: "2026-02-27T12:00:00.000Z",
129
+ });
130
+ }
131
+
132
+ if (url.endsWith("/api/github/summary") && method === "GET") {
133
+ return jsonResponse({
134
+ status: "unavailable",
135
+ source: "none",
136
+ fetchedAt: "2026-02-27T12:00:00.000Z",
137
+ commitsPerDay: [],
138
+ });
139
+ }
140
+
141
+ if (url.includes("/api/analytics/usage-heatmap") && method === "GET") {
142
+ return jsonResponse({
143
+ days: [],
144
+ projects: [],
145
+ models: [],
146
+ });
147
+ }
148
+
149
+ if (url.endsWith("/api/ui-state") && method === "GET") {
150
+ return jsonResponse({});
151
+ }
152
+
153
+ if (url.endsWith("/api/ui-state") && method === "PATCH") {
154
+ return jsonResponse({});
155
+ }
156
+
157
+ return notFoundResponse();
158
+ });
159
+ };
160
+
161
+ describe("App workspace setup", () => {
162
+ afterEach(() => {
163
+ cleanup();
164
+ resetAppTestHarness();
165
+ });
166
+
167
+ it("shows the setup card inside the normal Agents view on a fresh workspace", async () => {
168
+ const currentSetup = buildSetupSnapshot();
169
+ mockAppRequests(() => currentSetup);
170
+
171
+ render(<App />);
172
+
173
+ expect(await screen.findByLabelText("Workspace setup")).toBeInTheDocument();
174
+ expect(screen.getByRole("navigation", { name: "Primary navigation" })).toBeInTheDocument();
175
+ expect(screen.getByLabelText("Main content canvas")).toBeInTheDocument();
176
+ expect(screen.getByLabelText("Canvas graph view")).toBeInTheDocument();
177
+ expect(screen.getByLabelText("Runtime status strip")).toBeInTheDocument();
178
+ expect(
179
+ screen.getByRole("button", {
180
+ name: "[1] Agents",
181
+ }),
182
+ ).toHaveAttribute("aria-current", "page");
183
+ });
184
+
185
+ it("only marks a setup step complete after the refreshed server snapshot says it is done", async () => {
186
+ let currentSetup = buildSetupSnapshot();
187
+ mockAppRequests(() => currentSetup, {
188
+ onEnsureGitignoreStep: () => {
189
+ currentSetup = buildSetupSnapshot({
190
+ steps: buildSetupSnapshot().steps.map((step) =>
191
+ step.id === "ensure-gitignore"
192
+ ? {
193
+ ...step,
194
+ complete: true,
195
+ statusText: ".gitignore covers .octogent.",
196
+ guidance: null,
197
+ command: null,
198
+ }
199
+ : step,
200
+ ),
201
+ });
202
+ return currentSetup;
203
+ },
204
+ });
205
+
206
+ render(<App />);
207
+
208
+ const setupCard = await screen.findByLabelText("Workspace setup");
209
+ fireEvent.click(within(setupCard).getByRole("button", { name: "Update .gitignore" }));
210
+
211
+ await waitFor(() => {
212
+ const gitignoreStep = screen.getByText("Ignore .octogent").closest(".workspace-setup-step");
213
+ expect(gitignoreStep).not.toBeNull();
214
+ expect(within(gitignoreStep as HTMLElement).getByText("Done")).toBeInTheDocument();
215
+ });
216
+ });
217
+ });
@@ -0,0 +1,195 @@
1
+ import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";
2
+ import { afterEach, describe, expect, it, vi } from "vitest";
3
+
4
+ import { CanvasTentaclePanel } from "../src/components/canvas/CanvasTentaclePanel";
5
+
6
+ const tentacle = {
7
+ tentacleId: "docs-knowledge",
8
+ displayName: "Docs & Knowledge",
9
+ description: "Keep docs aligned with the product.",
10
+ status: "active" as const,
11
+ color: "#ff6b2b",
12
+ octopus: {
13
+ animation: null,
14
+ expression: null,
15
+ accessory: null,
16
+ hairColor: null,
17
+ },
18
+ scope: { paths: [], tags: [] },
19
+ vaultFiles: ["todo.md"],
20
+ todoTotal: 2,
21
+ todoDone: 0,
22
+ todoItems: [
23
+ { text: "Audit docs", done: false },
24
+ { text: "Consolidate principles", done: false },
25
+ ],
26
+ suggestedSkills: ["docs-writer", "release-helper"],
27
+ };
28
+
29
+ describe("CanvasTentaclePanel actions", () => {
30
+ afterEach(() => {
31
+ cleanup();
32
+ vi.restoreAllMocks();
33
+ });
34
+
35
+ it("offers worktree and normal swarm options", async () => {
36
+ const onSpawnSwarm = vi.fn();
37
+
38
+ render(
39
+ <CanvasTentaclePanel
40
+ node={{
41
+ id: "docs-knowledge",
42
+ type: "tentacle",
43
+ x: 0,
44
+ y: 0,
45
+ vx: 0,
46
+ vy: 0,
47
+ pinned: false,
48
+ radius: 48,
49
+ tentacleId: "docs-knowledge",
50
+ label: "Docs & Knowledge",
51
+ color: "#ff6b2b",
52
+ }}
53
+ tentacle={tentacle}
54
+ sessions={[]}
55
+ onClose={() => {}}
56
+ onSpawnSwarm={onSpawnSwarm}
57
+ />,
58
+ );
59
+
60
+ const worktreeButton = await screen.findByRole("button", {
61
+ name: /spawn swarm \(worktrees\)/i,
62
+ });
63
+ const normalButton = await screen.findByRole("button", {
64
+ name: /spawn swarm \(normal\)/i,
65
+ });
66
+
67
+ fireEvent.click(worktreeButton);
68
+ fireEvent.click(normalButton);
69
+
70
+ expect(onSpawnSwarm).toHaveBeenNthCalledWith(1, "docs-knowledge", "worktree");
71
+ expect(onSpawnSwarm).toHaveBeenNthCalledWith(2, "docs-knowledge", "shared");
72
+ });
73
+
74
+ it("spawns a dedicated agent for an individual todo item", async () => {
75
+ const onSolveTodoItem = vi.fn();
76
+
77
+ vi.spyOn(globalThis, "fetch").mockImplementation(async (input, init) => {
78
+ const url = String(input);
79
+
80
+ if (url.endsWith("/api/deck/tentacles/docs-knowledge/todo/solve")) {
81
+ expect(init?.method).toBe("POST");
82
+ expect(init?.body).toBe(JSON.stringify({ itemIndex: 0 }));
83
+ return new Response(JSON.stringify({ terminalId: "docs-knowledge-todo-0" }), {
84
+ status: 201,
85
+ headers: { "Content-Type": "application/json" },
86
+ });
87
+ }
88
+
89
+ return new Response("not-found", { status: 404 });
90
+ });
91
+
92
+ render(
93
+ <CanvasTentaclePanel
94
+ node={{
95
+ id: "docs-knowledge",
96
+ type: "tentacle",
97
+ x: 0,
98
+ y: 0,
99
+ vx: 0,
100
+ vy: 0,
101
+ pinned: false,
102
+ radius: 48,
103
+ tentacleId: "docs-knowledge",
104
+ label: "Docs & Knowledge",
105
+ color: "#ff6b2b",
106
+ }}
107
+ tentacle={tentacle}
108
+ sessions={[]}
109
+ onClose={() => {}}
110
+ onSolveTodoItem={onSolveTodoItem}
111
+ />,
112
+ );
113
+
114
+ const solveButtons = await screen.findAllByRole("button", {
115
+ name: /spawn agent for todo item/i,
116
+ });
117
+
118
+ fireEvent.click(solveButtons[0] as HTMLElement);
119
+
120
+ await waitFor(() => {
121
+ expect(onSolveTodoItem).toHaveBeenCalledWith("docs-knowledge", 0);
122
+ });
123
+ });
124
+
125
+ it("refreshes centralized tentacle data after mutating todo items", async () => {
126
+ const onRefreshTentacleData = vi.fn().mockResolvedValue(undefined);
127
+
128
+ vi.spyOn(globalThis, "fetch").mockImplementation(async (input, init) => {
129
+ const url = String(input);
130
+
131
+ if (url.endsWith("/api/deck/tentacles/docs-knowledge/todo/toggle")) {
132
+ expect(init?.method).toBe("PATCH");
133
+ expect(init?.body).toBe(JSON.stringify({ itemIndex: 0, done: true }));
134
+ return new Response(null, { status: 200 });
135
+ }
136
+
137
+ return new Response("not-found", { status: 404 });
138
+ });
139
+
140
+ render(
141
+ <CanvasTentaclePanel
142
+ node={{
143
+ id: "docs-knowledge",
144
+ type: "tentacle",
145
+ x: 0,
146
+ y: 0,
147
+ vx: 0,
148
+ vy: 0,
149
+ pinned: false,
150
+ radius: 48,
151
+ tentacleId: "docs-knowledge",
152
+ label: "Docs & Knowledge",
153
+ color: "#ff6b2b",
154
+ }}
155
+ tentacle={tentacle}
156
+ sessions={[]}
157
+ onClose={() => {}}
158
+ onRefreshTentacleData={onRefreshTentacleData}
159
+ />,
160
+ );
161
+
162
+ fireEvent.click((await screen.findAllByRole("checkbox"))[0] as HTMLElement);
163
+
164
+ await waitFor(() => {
165
+ expect(onRefreshTentacleData).toHaveBeenCalledTimes(1);
166
+ });
167
+ });
168
+
169
+ it("shows suggested skills in the tentacle detail panel", async () => {
170
+ render(
171
+ <CanvasTentaclePanel
172
+ node={{
173
+ id: "docs-knowledge",
174
+ type: "tentacle",
175
+ x: 0,
176
+ y: 0,
177
+ vx: 0,
178
+ vy: 0,
179
+ pinned: false,
180
+ radius: 48,
181
+ tentacleId: "docs-knowledge",
182
+ label: "Docs & Knowledge",
183
+ color: "#ff6b2b",
184
+ }}
185
+ tentacle={tentacle}
186
+ sessions={[]}
187
+ onClose={() => {}}
188
+ />,
189
+ );
190
+
191
+ expect(screen.getByText("Suggested Skills")).toBeInTheDocument();
192
+ expect(screen.getByText("docs-writer")).toBeInTheDocument();
193
+ expect(screen.getByText("release-helper")).toBeInTheDocument();
194
+ });
195
+ });
@@ -0,0 +1,76 @@
1
+ import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";
2
+ import { afterEach, describe, expect, it, vi } from "vitest";
3
+
4
+ import { DeleteAllTerminalsDialog } from "../src/components/canvas/DeleteAllTerminalsDialog";
5
+
6
+ describe("DeleteAllTerminalsDialog", () => {
7
+ afterEach(() => {
8
+ cleanup();
9
+ vi.restoreAllMocks();
10
+ });
11
+
12
+ it("surfaces partial failures after refreshing the parent state", async () => {
13
+ const onDeleted = vi.fn();
14
+
15
+ vi.spyOn(globalThis, "fetch").mockImplementation(async (input, init) => {
16
+ const url = String(input);
17
+ const method = init?.method ?? "GET";
18
+
19
+ if (url.endsWith("/api/terminals/terminal-a") && method === "DELETE") {
20
+ return new Response(JSON.stringify({ error: "Terminal is busy." }), {
21
+ status: 409,
22
+ headers: { "Content-Type": "application/json" },
23
+ });
24
+ }
25
+
26
+ if (url.endsWith("/api/conversations/session-1") && method === "DELETE") {
27
+ return new Response(null, { status: 204 });
28
+ }
29
+
30
+ return new Response("not-found", { status: 404 });
31
+ });
32
+
33
+ render(
34
+ <DeleteAllTerminalsDialog
35
+ columns={[
36
+ {
37
+ terminalId: "terminal-a",
38
+ label: "terminal-a",
39
+ state: "live",
40
+ tentacleId: "tentacle-a",
41
+ tentacleName: "Tentacle A",
42
+ createdAt: "2026-02-24T10:00:00.000Z",
43
+ },
44
+ ]}
45
+ nodes={[
46
+ {
47
+ id: "i:session-1",
48
+ type: "inactive-session",
49
+ x: 0,
50
+ y: 0,
51
+ vx: 0,
52
+ vy: 0,
53
+ pinned: false,
54
+ radius: 12,
55
+ tentacleId: "tentacle-a",
56
+ label: "session-1",
57
+ color: "#ff6b2b",
58
+ sessionId: "session-1",
59
+ },
60
+ ]}
61
+ onCancel={vi.fn()}
62
+ onDeleted={onDeleted}
63
+ />,
64
+ );
65
+
66
+ fireEvent.click(screen.getByRole("button", { name: "Confirm delete all terminals" }));
67
+
68
+ await waitFor(() => {
69
+ expect(onDeleted).toHaveBeenCalledWith({ hadFailures: true });
70
+ });
71
+
72
+ expect(screen.getByRole("alert")).toHaveTextContent(
73
+ "Failed to delete 1 item: Tentacle A: Terminal is busy.",
74
+ );
75
+ });
76
+ });
@@ -0,0 +1,52 @@
1
+ import { describe, expect, it } from "vitest";
2
+
3
+ import { buildGitHubCommitSeries } from "../src/app/githubMetrics";
4
+ import type { GitHubRepoSummarySnapshot } from "../src/app/types";
5
+
6
+ const createSummary = (
7
+ commitsPerDay: Array<{ date: string; count: number }>,
8
+ ): GitHubRepoSummarySnapshot => ({
9
+ status: "ok",
10
+ fetchedAt: "2026-03-01T00:00:00.000Z",
11
+ source: "gh-cli",
12
+ repo: "hesamsheikh/octogent",
13
+ stargazerCount: 0,
14
+ openIssueCount: 0,
15
+ openPullRequestCount: 0,
16
+ commitsPerDay,
17
+ });
18
+
19
+ describe("github metrics", () => {
20
+ it("trims leading zero-count days before the first commit", () => {
21
+ const series = buildGitHubCommitSeries(
22
+ createSummary([
23
+ { date: "2026-02-21", count: 0 },
24
+ { date: "2026-02-22", count: 0 },
25
+ { date: "2026-02-23", count: 0 },
26
+ { date: "2026-02-24", count: 2 },
27
+ { date: "2026-02-25", count: 1 },
28
+ ]),
29
+ );
30
+
31
+ expect(series).toEqual([
32
+ { date: "2026-02-24", count: 2 },
33
+ { date: "2026-02-25", count: 1 },
34
+ ]);
35
+ });
36
+
37
+ it("keeps the input range when no commits exist yet", () => {
38
+ const series = buildGitHubCommitSeries(
39
+ createSummary([
40
+ { date: "2026-02-21", count: 0 },
41
+ { date: "2026-02-22", count: 0 },
42
+ { date: "2026-02-23", count: 0 },
43
+ ]),
44
+ );
45
+
46
+ expect(series).toEqual([
47
+ { date: "2026-02-21", count: 0 },
48
+ { date: "2026-02-22", count: 0 },
49
+ { date: "2026-02-23", count: 0 },
50
+ ]);
51
+ });
52
+ });
@@ -0,0 +1,44 @@
1
+ import { describe, expect, it } from "vitest";
2
+
3
+ import {
4
+ isEditableEventTarget,
5
+ normalizeTickerQueryInput,
6
+ parsePrimaryNavKey,
7
+ } from "../src/app/hotkeys";
8
+
9
+ describe("hotkeys helpers", () => {
10
+ it("parses primary nav keys from 1 to 5", () => {
11
+ expect(parsePrimaryNavKey("1")).toBe(1);
12
+ expect(parsePrimaryNavKey("2")).toBe(2);
13
+ expect(parsePrimaryNavKey("3")).toBe(3);
14
+ expect(parsePrimaryNavKey("5")).toBe(5);
15
+ });
16
+
17
+ it("returns null for unsupported nav keys", () => {
18
+ expect(parsePrimaryNavKey("0")).toBeNull();
19
+ expect(parsePrimaryNavKey("10")).toBeNull();
20
+ expect(parsePrimaryNavKey("x")).toBeNull();
21
+ expect(parsePrimaryNavKey("/")).toBeNull();
22
+ });
23
+
24
+ it("detects editable element targets", () => {
25
+ const input = document.createElement("input");
26
+ const textarea = document.createElement("textarea");
27
+ const select = document.createElement("select");
28
+ const div = document.createElement("div");
29
+ const contentEditableDiv = document.createElement("div");
30
+ contentEditableDiv.contentEditable = "true";
31
+
32
+ expect(isEditableEventTarget(input)).toBe(true);
33
+ expect(isEditableEventTarget(textarea)).toBe(true);
34
+ expect(isEditableEventTarget(select)).toBe(true);
35
+ expect(isEditableEventTarget(contentEditableDiv)).toBe(true);
36
+ expect(isEditableEventTarget(div)).toBe(false);
37
+ expect(isEditableEventTarget(null)).toBe(false);
38
+ });
39
+
40
+ it("normalizes ticker input to uppercase with allowed symbols and max length", () => {
41
+ expect(normalizeTickerQueryInput("main branch? #1")).toBe("MAINBRANCH1");
42
+ expect(normalizeTickerQueryInput("abc.def/ghi-jkl_mno12345")).toBe("ABC.DEF/GHI-JKL_");
43
+ });
44
+ });