@bountyporte/ai-studio 0.0.0-stage → 0.25.0

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 (408) hide show
  1. package/INSTALL.md +231 -0
  2. package/LICENSE +21 -0
  3. package/Makefile +239 -0
  4. package/README.md +436 -2
  5. package/backend/.python-version +1 -0
  6. package/backend/Makefile +21 -0
  7. package/backend/README.md +401 -0
  8. package/backend/app/__init__.py +0 -0
  9. package/backend/app/api/__init__.py +0 -0
  10. package/backend/app/api/middleware.py +196 -0
  11. package/backend/app/api/routes/__init__.py +0 -0
  12. package/backend/app/api/routes/agent_control.py +347 -0
  13. package/backend/app/api/routes/events.py +164 -0
  14. package/backend/app/api/routes/floors.py +24 -0
  15. package/backend/app/api/routes/hooks.py +225 -0
  16. package/backend/app/api/routes/integrations.py +319 -0
  17. package/backend/app/api/routes/missions.py +604 -0
  18. package/backend/app/api/routes/permissions.py +32 -0
  19. package/backend/app/api/routes/preferences.py +155 -0
  20. package/backend/app/api/routes/search.py +134 -0
  21. package/backend/app/api/routes/sessions.py +787 -0
  22. package/backend/app/api/routes/team_templates.py +93 -0
  23. package/backend/app/api/routes/websockets.py +230 -0
  24. package/backend/app/api/routes/workspaces.py +896 -0
  25. package/backend/app/api/websocket.py +73 -0
  26. package/backend/app/config.py +223 -0
  27. package/backend/app/core/__init__.py +0 -0
  28. package/backend/app/core/agent_roster.py +89 -0
  29. package/backend/app/core/base_poller.py +140 -0
  30. package/backend/app/core/beads_poller.py +239 -0
  31. package/backend/app/core/broadcast_service.py +145 -0
  32. package/backend/app/core/connection_manager.py +263 -0
  33. package/backend/app/core/constants.py +6 -0
  34. package/backend/app/core/event_processor.py +1374 -0
  35. package/backend/app/core/exclusions.py +75 -0
  36. package/backend/app/core/floor_config.py +204 -0
  37. package/backend/app/core/handlers/__init__.py +65 -0
  38. package/backend/app/core/handlers/agent_handler.py +386 -0
  39. package/backend/app/core/handlers/conversation_handler.py +168 -0
  40. package/backend/app/core/handlers/session_handler.py +131 -0
  41. package/backend/app/core/handlers/team_handler.py +61 -0
  42. package/backend/app/core/handlers/tool_handler.py +65 -0
  43. package/backend/app/core/health.py +124 -0
  44. package/backend/app/core/jsonl_parser.py +213 -0
  45. package/backend/app/core/logging.py +91 -0
  46. package/backend/app/core/office_layout.py +65 -0
  47. package/backend/app/core/path_utils.py +65 -0
  48. package/backend/app/core/product_mapper.py +149 -0
  49. package/backend/app/core/quotes.py +121 -0
  50. package/backend/app/core/redaction.py +92 -0
  51. package/backend/app/core/room_orchestrator.py +347 -0
  52. package/backend/app/core/scheduled_tasks.py +20 -0
  53. package/backend/app/core/state_machine.py +844 -0
  54. package/backend/app/core/state_sync.py +188 -0
  55. package/backend/app/core/summary_service.py +612 -0
  56. package/backend/app/core/task_file_poller.py +300 -0
  57. package/backend/app/core/task_persistence.py +145 -0
  58. package/backend/app/core/token_tracker.py +346 -0
  59. package/backend/app/core/tool_labels.py +45 -0
  60. package/backend/app/core/transcript_poller.py +366 -0
  61. package/backend/app/core/whiteboard_tracker.py +269 -0
  62. package/backend/app/db/__init__.py +0 -0
  63. package/backend/app/db/database.py +176 -0
  64. package/backend/app/db/migrate.py +95 -0
  65. package/backend/app/db/models.py +406 -0
  66. package/backend/app/main.py +419 -0
  67. package/backend/app/models/__init__.py +0 -0
  68. package/backend/app/models/agents.py +135 -0
  69. package/backend/app/models/common.py +58 -0
  70. package/backend/app/models/events.py +397 -0
  71. package/backend/app/models/git.py +70 -0
  72. package/backend/app/models/overview.py +59 -0
  73. package/backend/app/models/sessions.py +160 -0
  74. package/backend/app/models/timeline.py +41 -0
  75. package/backend/app/models/ui.py +10 -0
  76. package/backend/app/services/agent_chat.py +127 -0
  77. package/backend/app/services/agent_control.py +877 -0
  78. package/backend/app/services/background.py +30 -0
  79. package/backend/app/services/chief_questions.py +271 -0
  80. package/backend/app/services/control_activity.py +117 -0
  81. package/backend/app/services/control_diagnostics.py +280 -0
  82. package/backend/app/services/control_errors.py +86 -0
  83. package/backend/app/services/git_service.py +432 -0
  84. package/backend/app/services/history_cleanup.py +122 -0
  85. package/backend/app/services/integrations.py +268 -0
  86. package/backend/app/services/mission_delivery.py +276 -0
  87. package/backend/app/services/mission_history.py +32 -0
  88. package/backend/app/services/mission_plans.py +1049 -0
  89. package/backend/app/services/mission_queue.py +343 -0
  90. package/backend/app/services/mission_signals.py +124 -0
  91. package/backend/app/services/permissions.py +129 -0
  92. package/backend/app/services/project_agents.py +177 -0
  93. package/backend/app/services/session_project.py +28 -0
  94. package/backend/app/services/task_checks.py +214 -0
  95. package/backend/app/services/task_reviews.py +503 -0
  96. package/backend/app/services/task_worktrees.py +457 -0
  97. package/backend/app/services/usage.py +318 -0
  98. package/backend/app/services/workspace_native.py +67 -0
  99. package/backend/app/services/workspace_standup.py +104 -0
  100. package/backend/app/services/workspaces.py +510 -0
  101. package/backend/pyproject.toml +95 -0
  102. package/backend/uv.lock +1246 -0
  103. package/distribution/cli.mjs +132 -0
  104. package/distribution/verify-package.mjs +15 -0
  105. package/docs/DISTRIBUTION.md +124 -0
  106. package/docs/SERVICE.md +51 -0
  107. package/doctor.sh +12 -0
  108. package/frontend/Makefile +41 -0
  109. package/frontend/README.md +296 -0
  110. package/frontend/bun.lock +1389 -0
  111. package/frontend/next-env.d.ts +7 -0
  112. package/frontend/next.config.ts +28 -0
  113. package/frontend/package-lock.json +10468 -0
  114. package/frontend/package.json +89 -0
  115. package/frontend/postcss.config.mjs +7 -0
  116. package/frontend/public/file.svg +1 -0
  117. package/frontend/public/globe.svg +1 -0
  118. package/frontend/public/next.svg +1 -0
  119. package/frontend/public/sprites/boss-rug.png +0 -0
  120. package/frontend/public/sprites/chair.png +0 -0
  121. package/frontend/public/sprites/coffee-machine.png +0 -0
  122. package/frontend/public/sprites/coffee-mug.png +0 -0
  123. package/frontend/public/sprites/desk-lamp.png +0 -0
  124. package/frontend/public/sprites/desk.png +0 -0
  125. package/frontend/public/sprites/elevator_door.png +0 -0
  126. package/frontend/public/sprites/elevator_frame.png +0 -0
  127. package/frontend/public/sprites/employee-of-month.png +0 -0
  128. package/frontend/public/sprites/floor-tile.png +0 -0
  129. package/frontend/public/sprites/headset_small.png +0 -0
  130. package/frontend/public/sprites/keyboard_back.png +0 -0
  131. package/frontend/public/sprites/magic-8-ball.png +0 -0
  132. package/frontend/public/sprites/monitor_back.png +0 -0
  133. package/frontend/public/sprites/old-printer.png +0 -0
  134. package/frontend/public/sprites/pen-holder.png +0 -0
  135. package/frontend/public/sprites/phone.png +0 -0
  136. package/frontend/public/sprites/plant.png +0 -0
  137. package/frontend/public/sprites/rubber-duck.png +0 -0
  138. package/frontend/public/sprites/rubiks-cube.png +0 -0
  139. package/frontend/public/sprites/stapler.png +0 -0
  140. package/frontend/public/sprites/sunglasses.png +0 -0
  141. package/frontend/public/sprites/thermos.png +0 -0
  142. package/frontend/public/sprites/wall-outlet.png +0 -0
  143. package/frontend/public/sprites/watercooler.png +0 -0
  144. package/frontend/public/vercel.svg +1 -0
  145. package/frontend/public/window.svg +1 -0
  146. package/frontend/src/app/character-lab/CharacterLab.tsx +217 -0
  147. package/frontend/src/app/character-lab/page.tsx +8 -0
  148. package/frontend/src/app/favicon.ico +0 -0
  149. package/frontend/src/app/globals.css +501 -0
  150. package/frontend/src/app/layout.tsx +44 -0
  151. package/frontend/src/app/page.tsx +662 -0
  152. package/frontend/src/app/sprite-debug/page.tsx +89 -0
  153. package/frontend/src/app/studio-benchmark/StudioBenchmark.tsx +141 -0
  154. package/frontend/src/app/studio-benchmark/page.tsx +12 -0
  155. package/frontend/src/app/studio-preview/page.tsx +270 -0
  156. package/frontend/src/app/studio-preview/preview.module.css +439 -0
  157. package/frontend/src/components/attention/AgentPopup.tsx +137 -0
  158. package/frontend/src/components/attention/AttentionToasts.tsx +130 -0
  159. package/frontend/src/components/attention/CommandBar.tsx +251 -0
  160. package/frontend/src/components/debug/sprite-debug/components/BuilderPanel.tsx +386 -0
  161. package/frontend/src/components/debug/sprite-debug/components/CellPalette.tsx +169 -0
  162. package/frontend/src/components/debug/sprite-debug/components/GridOverlay.tsx +234 -0
  163. package/frontend/src/components/debug/sprite-debug/components/NumberInput.tsx +49 -0
  164. package/frontend/src/components/debug/sprite-debug/components/OutputPreview.tsx +267 -0
  165. package/frontend/src/components/debug/sprite-debug/components/PreviewPanel.tsx +447 -0
  166. package/frontend/src/components/debug/sprite-debug/components/index.ts +12 -0
  167. package/frontend/src/components/debug/sprite-debug/hooks/useSpriteBuilder.ts +260 -0
  168. package/frontend/src/components/debug/sprite-debug/index.ts +9 -0
  169. package/frontend/src/components/debug/sprite-debug/lib/gridCalculations.ts +336 -0
  170. package/frontend/src/components/debug/sprite-debug/lib/imageProcessing.ts +568 -0
  171. package/frontend/src/components/debug/sprite-debug/lib/types.ts +229 -0
  172. package/frontend/src/components/game/EventDetailModal.tsx +209 -0
  173. package/frontend/src/components/layout/AccessBanner.tsx +71 -0
  174. package/frontend/src/components/layout/AgentControl.tsx +338 -0
  175. package/frontend/src/components/layout/ConversationHistory.tsx +713 -0
  176. package/frontend/src/components/layout/DirectoryPicker.tsx +192 -0
  177. package/frontend/src/components/layout/EventLog.tsx +112 -0
  178. package/frontend/src/components/layout/GitStatusPanel.tsx +214 -0
  179. package/frontend/src/components/layout/HeaderControls.tsx +143 -0
  180. package/frontend/src/components/layout/HeaderMoreMenu.tsx +138 -0
  181. package/frontend/src/components/layout/MobileAgentActivity.tsx +113 -0
  182. package/frontend/src/components/layout/MobileDrawer.tsx +127 -0
  183. package/frontend/src/components/layout/NewSession.tsx +173 -0
  184. package/frontend/src/components/layout/RightSidebar.tsx +128 -0
  185. package/frontend/src/components/layout/SessionSidebar.tsx +493 -0
  186. package/frontend/src/components/layout/StatusToast.tsx +49 -0
  187. package/frontend/src/components/layout/conversation.module.css +390 -0
  188. package/frontend/src/components/layout/mentions.ts +61 -0
  189. package/frontend/src/components/layout/relay.ts +72 -0
  190. package/frontend/src/components/layout/useMentions.tsx +140 -0
  191. package/frontend/src/components/mission/ChiefConversation.tsx +127 -0
  192. package/frontend/src/components/mission/CommandPalette.tsx +501 -0
  193. package/frontend/src/components/mission/ContextView.tsx +61 -0
  194. package/frontend/src/components/mission/DiagnosticBadges.tsx +65 -0
  195. package/frontend/src/components/mission/ExcludedProjects.tsx +139 -0
  196. package/frontend/src/components/mission/Inspector.tsx +823 -0
  197. package/frontend/src/components/mission/MissionDelivery.tsx +251 -0
  198. package/frontend/src/components/mission/MissionGraph.tsx +560 -0
  199. package/frontend/src/components/mission/MissionHistory.tsx +140 -0
  200. package/frontend/src/components/mission/MissionNotifications.tsx +192 -0
  201. package/frontend/src/components/mission/MissionPlanEditor.tsx +580 -0
  202. package/frontend/src/components/mission/MissionQueuePanel.tsx +215 -0
  203. package/frontend/src/components/mission/MissionsPanel.tsx +832 -0
  204. package/frontend/src/components/mission/Orb.tsx +94 -0
  205. package/frontend/src/components/mission/OverviewBoard.tsx +325 -0
  206. package/frontend/src/components/mission/PermissionPrompts.tsx +179 -0
  207. package/frontend/src/components/mission/PlanCost.tsx +121 -0
  208. package/frontend/src/components/mission/RoleAgents.tsx +164 -0
  209. package/frontend/src/components/mission/SessionList.tsx +425 -0
  210. package/frontend/src/components/mission/SessionOriginBadge.tsx +49 -0
  211. package/frontend/src/components/mission/SessionScope.tsx +43 -0
  212. package/frontend/src/components/mission/TaskReview.tsx +558 -0
  213. package/frontend/src/components/mission/TeamGraph.tsx +318 -0
  214. package/frontend/src/components/mission/TeamList.tsx +231 -0
  215. package/frontend/src/components/mission/TeamOverview.tsx +230 -0
  216. package/frontend/src/components/mission/TeamResult.tsx +81 -0
  217. package/frontend/src/components/mission/TeamTemplates.tsx +190 -0
  218. package/frontend/src/components/mission/TeamTimeline.tsx +306 -0
  219. package/frontend/src/components/mission/TeamTrail.tsx +48 -0
  220. package/frontend/src/components/mission/TimelineView.tsx +574 -0
  221. package/frontend/src/components/mission/TopBar.tsx +377 -0
  222. package/frontend/src/components/mission/WorkspaceContracts.tsx +153 -0
  223. package/frontend/src/components/mission/WorkspaceEditForm.tsx +355 -0
  224. package/frontend/src/components/mission/WorkspaceMissionCard.tsx +203 -0
  225. package/frontend/src/components/mission/WorkspacePanel.tsx +702 -0
  226. package/frontend/src/components/mission/WorkspaceProjectCards.tsx +103 -0
  227. package/frontend/src/components/mission/WorkspaceStandup.tsx +172 -0
  228. package/frontend/src/components/mission/WorkspaceWizard.tsx +450 -0
  229. package/frontend/src/components/mission/agentContext.ts +123 -0
  230. package/frontend/src/components/mission/agentState.ts +49 -0
  231. package/frontend/src/components/mission/roleCatalog.ts +48 -0
  232. package/frontend/src/components/mission/team.ts +222 -0
  233. package/frontend/src/components/mission/timelineModel.ts +123 -0
  234. package/frontend/src/components/mission/workspacePrompts.ts +47 -0
  235. package/frontend/src/components/mission/workspaceTarget.ts +32 -0
  236. package/frontend/src/components/overlay/Modal.tsx +90 -0
  237. package/frontend/src/components/overlay/SettingsModal.tsx +518 -0
  238. package/frontend/src/components/settings/BuildingTab.tsx +428 -0
  239. package/frontend/src/components/settings/ConnectionsTab.tsx +269 -0
  240. package/frontend/src/components/shell/ContextSwitcher.tsx +213 -0
  241. package/frontend/src/components/shell/HealthIndicator.tsx +186 -0
  242. package/frontend/src/components/shell/StatusBar.tsx +101 -0
  243. package/frontend/src/components/shell/StripRack.tsx +292 -0
  244. package/frontend/src/components/shell/health.ts +70 -0
  245. package/frontend/src/components/studio/BenchmarkProbe.tsx +93 -0
  246. package/frontend/src/components/studio/Character.tsx +1098 -0
  247. package/frontend/src/components/studio/DeskReveal.tsx +43 -0
  248. package/frontend/src/components/studio/LightStudio.tsx +604 -0
  249. package/frontend/src/components/studio/Room.tsx +784 -0
  250. package/frontend/src/components/studio/StudioActivity.tsx +222 -0
  251. package/frontend/src/components/studio/StudioAvatar.tsx +80 -0
  252. package/frontend/src/components/studio/StudioCamera.tsx +55 -0
  253. package/frontend/src/components/studio/StudioDisplayMenu.tsx +109 -0
  254. package/frontend/src/components/studio/StudioLabels.tsx +216 -0
  255. package/frontend/src/components/studio/StudioLighting.tsx +102 -0
  256. package/frontend/src/components/studio/StudioNavigation.tsx +17 -0
  257. package/frontend/src/components/studio/StudioScene.tsx +740 -0
  258. package/frontend/src/components/studio/StudioTeamHUD.tsx +285 -0
  259. package/frontend/src/components/studio/StudioView.tsx +68 -0
  260. package/frontend/src/components/studio/StudioWorkspace.tsx +142 -0
  261. package/frontend/src/components/studio/TeamSignals.tsx +99 -0
  262. package/frontend/src/components/studio/characterActing.ts +222 -0
  263. package/frontend/src/components/studio/light.module.css +554 -0
  264. package/frontend/src/components/studio/live.module.css +94 -0
  265. package/frontend/src/components/studio/studioBenchmark.ts +46 -0
  266. package/frontend/src/components/studio/studioDemo.ts +45 -0
  267. package/frontend/src/components/studio/studioFade.ts +31 -0
  268. package/frontend/src/components/studio/studioLayout.ts +481 -0
  269. package/frontend/src/components/studio/studioQuality.ts +11 -0
  270. package/frontend/src/components/studio/studioReference.ts +22 -0
  271. package/frontend/src/components/studio/team.module.css +362 -0
  272. package/frontend/src/components/studio/teamActing.ts +95 -0
  273. package/frontend/src/components/studio/textures.ts +621 -0
  274. package/frontend/src/components/studio/workspace.module.css +201 -0
  275. package/frontend/src/components/studio/workspaceOffice.ts +74 -0
  276. package/frontend/src/components/tour/NarratorBar.tsx +61 -0
  277. package/frontend/src/components/tour/PointerRing.tsx +90 -0
  278. package/frontend/src/components/tour/SpotlightDim.tsx +112 -0
  279. package/frontend/src/components/tour/TourOverlay.tsx +116 -0
  280. package/frontend/src/constants/positions.ts +66 -0
  281. package/frontend/src/constants/quotes.ts +249 -0
  282. package/frontend/src/hooks/useAppContext.ts +28 -0
  283. package/frontend/src/hooks/useAttentionNotifier.ts +124 -0
  284. package/frontend/src/hooks/useControlStates.ts +63 -0
  285. package/frontend/src/hooks/useDragResize.ts +93 -0
  286. package/frontend/src/hooks/useFloorConfig.ts +49 -0
  287. package/frontend/src/hooks/useFocusTrap.ts +57 -0
  288. package/frontend/src/hooks/useMainAgentName.ts +8 -0
  289. package/frontend/src/hooks/useMissionSignal.ts +116 -0
  290. package/frontend/src/hooks/useMissionView.ts +50 -0
  291. package/frontend/src/hooks/useNow.ts +12 -0
  292. package/frontend/src/hooks/useOverviewWebSocket.ts +148 -0
  293. package/frontend/src/hooks/useReducedMotion.ts +22 -0
  294. package/frontend/src/hooks/useSessionSwitch.ts +204 -0
  295. package/frontend/src/hooks/useSessionUsage.ts +86 -0
  296. package/frontend/src/hooks/useSessions.ts +259 -0
  297. package/frontend/src/hooks/useStudioMission.ts +53 -0
  298. package/frontend/src/hooks/useTaskCues.ts +38 -0
  299. package/frontend/src/hooks/useTeamPlan.ts +138 -0
  300. package/frontend/src/hooks/useTheme.ts +78 -0
  301. package/frontend/src/hooks/useTranslation.ts +13 -0
  302. package/frontend/src/hooks/useWebSocketEvents.ts +318 -0
  303. package/frontend/src/hooks/useWorkspaceList.ts +46 -0
  304. package/frontend/src/hooks/useWorkspaceOffice.ts +165 -0
  305. package/frontend/src/i18n/en.ts +1337 -0
  306. package/frontend/src/i18n/es.ts +1352 -0
  307. package/frontend/src/i18n/fr.ts +1357 -0
  308. package/frontend/src/i18n/index.ts +95 -0
  309. package/frontend/src/i18n/pt-BR.ts +1344 -0
  310. package/frontend/src/machines/agentMachine.ts +443 -0
  311. package/frontend/src/machines/agentMachineCommon.ts +426 -0
  312. package/frontend/src/machines/agentMachineService.ts +667 -0
  313. package/frontend/src/machines/positionHelpers.ts +100 -0
  314. package/frontend/src/machines/queueManager.ts +193 -0
  315. package/frontend/src/stores/attentionStore.ts +249 -0
  316. package/frontend/src/stores/chatDraftStore.ts +15 -0
  317. package/frontend/src/stores/gameStore.ts +457 -0
  318. package/frontend/src/stores/navigationStore.ts +170 -0
  319. package/frontend/src/stores/overviewStore.ts +77 -0
  320. package/frontend/src/stores/preferencesStore.ts +277 -0
  321. package/frontend/src/stores/recordingStore.ts +52 -0
  322. package/frontend/src/stores/rosterStore.ts +39 -0
  323. package/frontend/src/stores/slices/agentSlice.ts +182 -0
  324. package/frontend/src/stores/slices/bossSlice.ts +50 -0
  325. package/frontend/src/stores/slices/bubbleSlice.ts +211 -0
  326. package/frontend/src/stores/slices/debugSlice.ts +129 -0
  327. package/frontend/src/stores/slices/officeSlice.ts +145 -0
  328. package/frontend/src/stores/slices/queueSlice.ts +153 -0
  329. package/frontend/src/stores/slices/replaySlice.ts +43 -0
  330. package/frontend/src/stores/slices/reservationSlice.ts +112 -0
  331. package/frontend/src/stores/slices/shared.ts +23 -0
  332. package/frontend/src/stores/slices/types.ts +135 -0
  333. package/frontend/src/stores/slices/whiteboardSlice.ts +61 -0
  334. package/frontend/src/stores/timelineStore.ts +137 -0
  335. package/frontend/src/stores/tourStore.ts +253 -0
  336. package/frontend/src/stores/workspaceStore.ts +77 -0
  337. package/frontend/src/systems/agentCollision.ts +259 -0
  338. package/frontend/src/systems/animationSystem.ts +489 -0
  339. package/frontend/src/systems/astar.ts +317 -0
  340. package/frontend/src/systems/navigationGrid.ts +463 -0
  341. package/frontend/src/systems/pathSmoothing.ts +337 -0
  342. package/frontend/src/systems/pathfinding.ts +118 -0
  343. package/frontend/src/systems/queuePositions.ts +242 -0
  344. package/frontend/src/systems/stateReconciler.ts +289 -0
  345. package/frontend/src/systems/stateSync.ts +71 -0
  346. package/frontend/src/systems/toastFilter.ts +71 -0
  347. package/frontend/src/systems/typingTracker.ts +80 -0
  348. package/frontend/src/systems/webSocketController.ts +149 -0
  349. package/frontend/src/types/generated.ts +1260 -0
  350. package/frontend/src/types/index.ts +154 -0
  351. package/frontend/src/types/navigation.ts +37 -0
  352. package/frontend/src/types/pixi-react.d.ts +11 -0
  353. package/frontend/src/utils/api.ts +122 -0
  354. package/frontend/src/utils/conversationSelection.ts +14 -0
  355. package/frontend/src/utils/cron.ts +90 -0
  356. package/frontend/src/utils/diffLines.ts +43 -0
  357. package/frontend/src/utils/event-type-styles.ts +81 -0
  358. package/frontend/src/utils/eventText.ts +134 -0
  359. package/frontend/src/utils/historyCleanup.ts +57 -0
  360. package/frontend/src/utils/legacyStorage.ts +15 -0
  361. package/frontend/src/utils/missionNotifications.ts +118 -0
  362. package/frontend/src/utils/runDiagnostics.ts +127 -0
  363. package/frontend/src/utils/sessionVisibility.ts +62 -0
  364. package/frontend/src/utils/teamTemplates.ts +228 -0
  365. package/frontend/src/utils/themeScript.ts +10 -0
  366. package/frontend/src/utils/time.ts +46 -0
  367. package/frontend/tsconfig.json +35 -0
  368. package/hooks/Makefile +18 -0
  369. package/hooks/README.md +295 -0
  370. package/hooks/install.sh +140 -0
  371. package/hooks/manage_hooks.py +345 -0
  372. package/hooks/pyproject.toml +50 -0
  373. package/hooks/src/ai_studio_hooks/__init__.py +0 -0
  374. package/hooks/src/ai_studio_hooks/codex.py +532 -0
  375. package/hooks/src/ai_studio_hooks/config.py +151 -0
  376. package/hooks/src/ai_studio_hooks/debug_logger.py +127 -0
  377. package/hooks/src/ai_studio_hooks/event_mapper.py +476 -0
  378. package/hooks/src/ai_studio_hooks/main.py +198 -0
  379. package/hooks/src/ai_studio_hooks/py.typed +0 -0
  380. package/hooks/uv.lock +154 -0
  381. package/install.ps1 +86 -0
  382. package/install.sh +225 -0
  383. package/integrations/.agents/plugins/marketplace.json +20 -0
  384. package/integrations/.claude-plugin/marketplace.json +14 -0
  385. package/integrations/plugins/ai-studio/.claude-plugin/plugin.json +8 -0
  386. package/integrations/plugins/ai-studio/.codex-plugin/plugin.json +12 -0
  387. package/integrations/plugins/ai-studio/.mcp.json +10 -0
  388. package/integrations/plugins/ai-studio/LICENSE +21 -0
  389. package/integrations/plugins/ai-studio/README.md +23 -0
  390. package/integrations/plugins/ai-studio/codex.mcp.json +10 -0
  391. package/integrations/plugins/ai-studio/mcp.json +12 -0
  392. package/integrations/plugins/ai-studio/plugin.json +19 -0
  393. package/integrations/plugins/ai-studio/server/mcp.mjs +143 -0
  394. package/integrations/plugins/ai-studio/server/paths.mjs +24 -0
  395. package/integrations/plugins/ai-studio/skills/studio/SKILL.md +34 -0
  396. package/opencode-plugin/Makefile +26 -0
  397. package/opencode-plugin/README.md +106 -0
  398. package/opencode-plugin/install.sh +64 -0
  399. package/opencode-plugin/package.json +43 -0
  400. package/opencode-plugin/src/index.ts +775 -0
  401. package/opencode-plugin/src/sessionTracker.ts +209 -0
  402. package/opencode-plugin/tsconfig.json +28 -0
  403. package/package.json +69 -4
  404. package/pyproject.toml +97 -0
  405. package/scripts/ai-studio +199 -0
  406. package/scripts/doctor.py +418 -0
  407. package/start.ps1 +6 -0
  408. package/start.sh +69 -0
package/INSTALL.md ADDED
@@ -0,0 +1,231 @@
1
+ # Installer AI Studio
2
+
3
+ Ce guide installe AI Studio sur **macOS**, **Linux (Debian ou Ubuntu, y compris
4
+ une machine virtuelle)** ou **Windows**. Un script fait tout automatiquement ;
5
+ la partie « Installation manuelle » détaille les mêmes étapes si tu préfères
6
+ les faire toi-même.
7
+
8
+ ## À savoir avant de commencer
9
+
10
+ AI Studio doit être installé **sur la même machine que Claude Code (et Codex)** :
11
+
12
+ - Claude Code envoie ses événements à AI Studio uniquement en local
13
+ (`localhost`), c'est ce qui fait apparaître les agents dans l'interface ;
14
+ - les missions, workspaces et agents lancent `claude` et `codex` sur la machine
15
+ du serveur, dans tes dossiers de projets.
16
+
17
+ Donc : installe AI Studio là où tu développes. Pour une machine virtuelle,
18
+ installe AI Studio, Claude Code et tes projets **dans la VM**.
19
+
20
+ ## Lanceur npm et plugins Claude Code / Codex
21
+
22
+ Le paquet npm et les deux formats de plugin sont inclus. Une version publiée
23
+ s’installe avec `npx @bountyporte/ai-studio install`. Pour tester une version
24
+ avant publication, utilise son archive `.tgz`.
25
+ Le [guide de distribution](docs/DISTRIBUTION.md) détaille la commande, Windows/WSL,
26
+ la connexion des plugins et les vérifications restant à faire avant publication.
27
+
28
+ ## Installation automatique
29
+
30
+ ### macOS, Debian, Ubuntu (et VM Debian 12)
31
+
32
+ Récupère le projet, puis lance le script d'installation depuis son dossier :
33
+
34
+ ```bash
35
+ git clone https://github.com/badrtairlbahrepro/AI-STUDIO.git
36
+ ```
37
+ ```bash
38
+ cd AI-STUDIO && ./install.sh --start
39
+ ```
40
+
41
+ Le script installe ce qui manque et garde ce qui est déjà là. Tu peux le
42
+ relancer sans risque. Sous Linux, il demande ton mot de passe (`sudo`) pour
43
+ les paquets système. Avec `--start`, le serveur démarre ensuite dans ce
44
+ terminal ; `Ctrl+C` l’arrête. Sans cette option, lance `./start.sh` après
45
+ l’installation.
46
+
47
+ | Option | Effet |
48
+ |---|---|
49
+ | `--with-codex` | installe aussi Codex |
50
+ | `--start` | installe puis lance le serveur dans ce terminal (ou utilise le service avec `--service`) |
51
+ | `--service` | démarre AI Studio automatiquement à l'ouverture de session |
52
+ | `--no-claude` | n'installe pas Claude Code (déjà installé autrement) |
53
+ | `--no-hooks` | ne connecte pas Claude Code à AI Studio |
54
+
55
+ Exemple : `./install.sh --with-codex --service`
56
+
57
+ ### Windows
58
+
59
+ AI Studio tourne sous Windows grâce à **WSL 2** (le Linux intégré à Windows) avec
60
+ Debian ; l'interface s'ouvre dans ton navigateur Windows habituel.
61
+
62
+ 1. Récupère le projet (avec Git pour Windows, GitHub Desktop, ou en
63
+ téléchargeant le ZIP depuis GitHub puis en le décompressant).
64
+ 2. Dans le dossier du projet : clic droit sur **`install.ps1`** →
65
+ **Exécuter avec PowerShell**. Ou, dans PowerShell :
66
+ ```powershell
67
+ powershell -ExecutionPolicy Bypass -File .\install.ps1
68
+ ```
69
+ Options : `-WithCodex`, `-Service`, `-Start` (installe puis lance).
70
+ 3. **Première fois seulement** : si WSL n'était pas installé, le script
71
+ l'installe, puis te demande de redémarrer Windows, d'ouvrir l'application
72
+ **Debian** une fois pour créer ton utilisateur Linux, et de relancer
73
+ `install.ps1`.
74
+
75
+ Le script copie le projet dans Debian (`~/AI-STUDIO`) et y lance `install.sh`.
76
+
77
+ ## Lancer AI Studio
78
+
79
+ | Système | Commande |
80
+ |---|---|
81
+ | macOS, Linux | `./start.sh` dans le dossier du projet |
82
+ | Windows | double-clic sur **`start.ps1`** |
83
+
84
+ L'interface s'ouvre sur **http://localhost:8000**, déjà autorisée. `Ctrl+C`
85
+ (ou fermer la fenêtre) arrête AI Studio. Après une mise à jour du code :
86
+ `./start.sh --rebuild`.
87
+
88
+ Avec l'option `--service`, AI Studio démarre tout seul : il suffit d'ouvrir
89
+ http://localhost:8000.
90
+
91
+ ## Première ouverture (une seule fois)
92
+
93
+ 1. Connecte Claude Code : lance `claude` dans un terminal et suis la connexion.
94
+ Pour Codex : `codex login`.
95
+ 2. Dans AI Studio, ouvre **Réglages → Connexions** et autorise Claude et/ou
96
+ Codex ainsi que **les dossiers de tes projets**. Sans cela, les workspaces
97
+ et les agents ne peuvent pas y travailler.
98
+ 3. Si Claude Code était ouvert pendant l'installation, redémarre-le pour qu'il
99
+ envoie ses événements à AI Studio.
100
+
101
+ ## Diagnostic : `doctor`
102
+
103
+ Depuis le dossier du projet :
104
+
105
+ ```bash
106
+ ./doctor.sh
107
+ # Équivalents : scripts/ai-studio doctor ou make doctor
108
+ ./doctor.sh --json
109
+ ./doctor.sh --offline
110
+ ./doctor.sh --url http://127.0.0.1:8050
111
+ ```
112
+
113
+ Sous Windows : `wsl -d Debian -- bash -lc 'cd ~/AI-STUDIO && ./doctor.sh'`.
114
+
115
+ Le diagnostic vérifie les outils, la version de Node, l’environnement backend,
116
+ l’interface compilée, les onze hooks Claude Code, les fichiers Codex, le serveur,
117
+ la pause d’enregistrement et le périmètre des connexions. Il propose quoi corriger
118
+ si une session manque. Il ne modifie aucun fichier, ne lance pas d’agent, n’envoie
119
+ pas d’événement de test et n’affiche ni clé ni contenu de conversation. Les appels
120
+ réseau se limitent aux adresses localhost explicites, sans suivre les redirections.
121
+ L’état de connexion des CLI n’est pas testé.
122
+
123
+ `ERROR` indique un problème bloquant (code de sortie 1). `WARNING` peut simplement
124
+ indiquer qu’un fournisseur facultatif est désactivé ou qu’aucune interface statique
125
+ n’a été compilée en mode développement (code 0 s’il n’y a pas d’erreur).
126
+
127
+ Ces commandes s’utilisent depuis une copie du dépôt ; aucun paquet `npx` ou
128
+ plugin n’est publié par cette installation.
129
+
130
+ ## « Accès refusé »
131
+
132
+ Certaines actions (missions, workspaces, effacer l'historique) demandent une
133
+ clé. Elle est créée au premier lancement, conservée dans `backend/.launch-key`
134
+ et transmise automatiquement par `start.sh` à l'ouverture du navigateur.
135
+
136
+ Si un bandeau « Accès refusé » apparaît, colle dans son champ le contenu de :
137
+
138
+ ```bash
139
+ cat backend/.launch-key
140
+ ```
141
+
142
+ Supprime ce fichier pour changer de clé (au prochain démarrage).
143
+
144
+ ## Machine virtuelle
145
+
146
+ - **Tu utilises la VM avec son propre bureau** (fenêtre de VirtualBox, VMware,
147
+ UTM…) : rien de particulier, ouvre http://localhost:8000 dans le navigateur
148
+ de la VM.
149
+ - **La VM n'a pas de bureau, ou tu veux ouvrir l'interface depuis ton
150
+ ordinateur principal** : par sécurité, AI Studio n'accepte que les connexions
151
+ locales à la VM. Crée un tunnel depuis ton ordinateur principal, puis ouvre
152
+ http://localhost:8000 sur celui-ci :
153
+ ```bash
154
+ ssh -L 8000:127.0.0.1:8000 utilisateur@adresse-de-la-vm
155
+ ```
156
+ Le tunnel fait croire à AI Studio que la connexion est locale, sans l'exposer
157
+ sur le réseau. Colle la clé (`cat backend/.launch-key` dans la VM) si
158
+ l'accès est refusé.
159
+
160
+ Ressources conseillées pour la VM : 2 processeurs, 4 Go de mémoire, 15 Go de
161
+ disque.
162
+
163
+ ## Mettre à jour
164
+
165
+ ```bash
166
+ git pull && ./install.sh && ./start.sh --rebuild
167
+ ```
168
+
169
+ Sous Windows, relance `install.ps1` (il met à jour la copie dans Debian), puis
170
+ `start.ps1`. Avec le service : `systemctl --user restart ai-studio` (Linux) ou
171
+ `scripts/ai-studio update` (macOS).
172
+
173
+ ## Installation manuelle
174
+
175
+ Ce que fait `install.sh`, étape par étape :
176
+
177
+ | Prérequis | Version | Installation |
178
+ |---|---|---|
179
+ | git, curl, make | — | macOS : `xcode-select --install` · Debian : `sudo apt install git curl make build-essential python3` |
180
+ | Node.js | 20.9 ou plus (22 conseillé) | macOS : `brew install node@22` ou https://nodejs.org · Debian 12 fournit Node 18, trop ancien : utilise NodeSource (`curl -fsSL https://deb.nodesource.com/setup_22.x \| sudo -E bash -` puis `sudo apt install nodejs`) |
181
+ | uv | dernière | `curl -LsSf https://astral.sh/uv/install.sh \| sh` (il télécharge Python 3.13 tout seul) |
182
+ | Claude Code | dernière | `curl -fsSL https://claude.ai/install.sh \| bash` |
183
+ | Codex (facultatif) | dernière | `npm install -g @openai/codex` |
184
+
185
+ Puis, dans le dossier du projet :
186
+
187
+ 1. `make install` — dépendances du serveur, de l'interface et des hooks ;
188
+ 2. `cd hooks && ./install.sh` — connecte Claude Code à AI Studio (sous Linux,
189
+ ajoute `--strip-prefixes "-home-$USER-"` pour des noms de projets courts) ;
190
+ 3. `make build-static` — construit l'interface, servie par le serveur ;
191
+ 4. `./start.sh` — lance le tout sur http://localhost:8000.
192
+
193
+ ## Désinstaller
194
+
195
+ 1. `cd hooks && ./uninstall.sh` — déconnecte Claude Code ;
196
+ 2. si le service est installé : `systemctl --user disable --now ai-studio` puis
197
+ `rm ~/.config/systemd/user/ai-studio.service` (Linux), ou
198
+ `scripts/ai-studio uninstall` (macOS) ;
199
+ 3. supprime le dossier du projet (il contient aussi l'historique,
200
+ `backend/visualizer.db`).
201
+
202
+ ## Dépannage
203
+
204
+ | Problème | Solution |
205
+ |---|---|
206
+ | « Le port 8000 est déjà utilisé » | AI Studio tourne déjà (service ?) : ouvre http://localhost:8000. Sinon, trouve le programme qui l'occupe : `lsof -i :8000`. |
207
+ | Aucun agent n'apparaît pendant que Claude Code travaille | Redémarre Claude Code ; vérifie que `hooks/install.sh` a bien été lancé ; journal des hooks : `~/.claude/ai-studio-hooks.log` (avec `AI_STUDIO_DEBUG=1`). |
208
+ | `uv` ou `claude` introuvable juste après l'installation | Ouvre un nouveau terminal (ils sont installés dans `~/.local/bin`). |
209
+ | Node trop ancien | Installe Node 22 (voir le tableau des prérequis) puis relance `./install.sh`. |
210
+ | Les agents ne peuvent pas travailler dans un dossier | Réglages → Connexions : autorise le fournisseur et le dossier. |
211
+
212
+ ## Affichage sur une VM peu puissante
213
+
214
+ Dans la vue **Studio**, le **Studio léger** est sélectionné par défaut. Ses
215
+ robots et cartes colorés utilisent HTML/CSS, sans canevas WebGL, rendu 3D ni
216
+ animation continue. Le bouton **Studio 3D** conserve l'affichage original ; le
217
+ choix est mémorisé dans chaque navigateur.
218
+
219
+ Clique sur le chef ou un agent pour retrouver sa conversation et ses commandes.
220
+ Les missions, plans, workspaces, activités et fichiers restent accessibles dans
221
+ les panneaux habituels. Les cartes montrent les états, activités, dépendances et
222
+ fichiers rapportés disponibles. La démo est locale et ne lance aucun agent.
223
+ Les mouvements de caméra et les effets de lumière concernent uniquement la 3D.
224
+ Les performances réelles dépendent aussi du navigateur et des ressources de la VM.
225
+
226
+ Le chef possède son propre poste de commandement doré, séparé des postes de
227
+ l'équipe. Les robots montrent une bulle d'activité, un clavier et des expressions
228
+ liées à leur état. Lecture, frappe, attente, réussite et erreur déclenchent des
229
+ effets courts (sans boucle infinie). La préférence système de réduction des
230
+ animations est respectée. Les dépendances en attente sont aussi indiquées dans
231
+ les cartes du workspace lorsqu'elles appartiennent au plan courant.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Paul Robello
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/Makefile ADDED
@@ -0,0 +1,239 @@
1
+ .PHONY: install install-all dev backend frontend simulate checkall lint fmt test typecheck gen-types \
2
+ hooks-install hooks-uninstall hooks-reinstall hooks-status hooks-logs hooks-logs-follow hooks-logs-clear \
3
+ hooks-debug-on hooks-debug-off clean clean-db clean-all \
4
+ opencode-install opencode-uninstall opencode-reinstall opencode-build \
5
+ dev-tmux dev-tmux-kill dev-tmux-backend dev-tmux-frontend \
6
+ build-static frontend-build-static \
7
+ docker-build docker-up docker-down docker-logs docker-shell docker-config \
8
+ pre-commit pre-commit-update depsupdate depsshow uv-lock uv-sync setup resetup remove-venv \
9
+ bump-version version-check help
10
+
11
+ # Detect package manager: prefer bun if available, otherwise use npm
12
+ PKG_MGR := $(shell command -v bun >/dev/null 2>&1 && echo "bun" || echo "npm")
13
+ PKG_INSTALL := $(shell command -v bun >/dev/null 2>&1 && echo "bun install" || echo "npm install")
14
+
15
+ install: # Install all component dependencies
16
+ cd backend && uv sync
17
+ cd frontend && $(PKG_INSTALL)
18
+ cd hooks && uv sync
19
+ cd opencode-plugin && $(PKG_INSTALL)
20
+
21
+ install-all: install hooks-install opencode-install # Install everything including hooks and plugins
22
+ @echo "All components installed including hooks and OpenCode plugin"
23
+
24
+ dev: # Start backend and frontend in parallel
25
+ @make -j 2 backend frontend
26
+
27
+ backend: # Start backend dev server
28
+ make -C backend dev
29
+
30
+ frontend: # Start frontend dev server
31
+ make -C frontend dev
32
+
33
+ # Build static frontend and copy to backend for serving
34
+ build-static frontend-build-static:
35
+ make -C frontend build-static
36
+ @echo "Frontend built and copied to backend/static"
37
+ @echo "Start backend with 'make backend' to serve at http://localhost:8000"
38
+
39
+ simulate: # Run event simulation
40
+ uv run python scripts/simulate_events.py
41
+
42
+ test-agent: # Run single agent test
43
+ uv run python scripts/test_single_agent.py
44
+
45
+ lint: # Run lint on all components
46
+ make -C backend lint
47
+ make -C frontend lint
48
+ make -C hooks lint
49
+ make -C opencode-plugin lint
50
+ cd backend && uv run ruff check ../scripts
51
+
52
+ fmt: # Reformat code
53
+ make -C backend fmt
54
+ make -C frontend fmt
55
+ make -C hooks fmt
56
+
57
+ test: # Run all tests
58
+ npm test
59
+ make -C backend test
60
+ make -C frontend test
61
+ make -C hooks test
62
+ make -C opencode-plugin test
63
+
64
+ typecheck: # Run static type checks
65
+ make -C backend typecheck
66
+ make -C frontend typecheck
67
+ make -C hooks typecheck
68
+ make -C opencode-plugin typecheck
69
+
70
+ .PHONY: doctor
71
+ doctor:
72
+ ./doctor.sh
73
+
74
+ checkall: fmt lint typecheck test # Run all checks including tests
75
+
76
+ gen-types: # Regenerate TypeScript types from Pydantic models
77
+ cd backend && uv run python ../scripts/gen_types.py
78
+
79
+ # Hook management targets
80
+ hooks-install:
81
+ cd hooks && ./install.sh
82
+
83
+ hooks-uninstall:
84
+ cd hooks && ./uninstall.sh
85
+
86
+ hooks-reinstall: hooks-uninstall hooks-install
87
+ @echo "Hooks reinstalled"
88
+
89
+ hooks-status:
90
+ @echo "=== Installed Claude Code Hooks ==="
91
+ @cat ~/.claude/settings.json 2>/dev/null | python3 -c "import sys,json; d=json.load(sys.stdin).get('hooks',{}); [print(f' {k}: {len(v)} hook(s)') for k,v in d.items()]" 2>/dev/null || echo " No hooks configured"
92
+ @echo ""
93
+ @echo "=== Hook Config ==="
94
+ @cat ~/.claude/ai-studio-config.env 2>/dev/null || echo " No config file found"
95
+
96
+ hooks-logs:
97
+ @echo "=== Recent Hook Logs ==="
98
+ @tail -100 ~/.claude/ai-studio-hooks.log 2>/dev/null || echo " No log file found"
99
+
100
+ hooks-logs-follow:
101
+ @tail -f ~/.claude/ai-studio-hooks.log
102
+
103
+ hooks-logs-clear:
104
+ @rm -f ~/.claude/ai-studio-hooks.log
105
+ @echo "Hook logs cleared"
106
+
107
+ hooks-debug-on:
108
+ @sed -i '' 's/AI_STUDIO_DEBUG=0/AI_STUDIO_DEBUG=1/' ~/.claude/ai-studio-config.env 2>/dev/null || true
109
+ @grep -q "AI_STUDIO_DEBUG" ~/.claude/ai-studio-config.env || echo "AI_STUDIO_DEBUG=1" >> ~/.claude/ai-studio-config.env
110
+ @echo "Hook debug logging enabled"
111
+
112
+ hooks-debug-off:
113
+ @sed -i '' 's/AI_STUDIO_DEBUG=1/AI_STUDIO_DEBUG=0/' ~/.claude/ai-studio-config.env 2>/dev/null || true
114
+ @echo "Hook debug logging disabled"
115
+
116
+ # OpenCode plugin management targets
117
+ opencode-install:
118
+ cd opencode-plugin && ./install.sh
119
+
120
+ opencode-uninstall:
121
+ cd opencode-plugin && ./uninstall.sh
122
+
123
+ opencode-reinstall: opencode-uninstall opencode-install
124
+ @echo "OpenCode plugin reinstalled"
125
+
126
+ opencode-build:
127
+ cd opencode-plugin && $(PKG_INSTALL) && $(PKG_MGR) run build
128
+
129
+ # tmux-based dev targets for better monitoring
130
+ TMUX_SESSION=ai-studio-dev
131
+
132
+ dev-tmux:
133
+ @if tmux has-session -t $(TMUX_SESSION) 2>/dev/null; then \
134
+ echo "Session $(TMUX_SESSION) already exists. Use 'make dev-tmux-kill' first or attach with 'tmux attach -t $(TMUX_SESSION)'"; \
135
+ else \
136
+ tmux new-session -d -s $(TMUX_SESSION) -n backend; \
137
+ tmux send-keys -t $(TMUX_SESSION):backend "cd $(CURDIR)/backend && make dev" Enter; \
138
+ tmux new-window -t $(TMUX_SESSION) -n frontend; \
139
+ tmux send-keys -t $(TMUX_SESSION):frontend "cd $(CURDIR)/frontend && make dev" Enter; \
140
+ tmux select-window -t $(TMUX_SESSION):backend; \
141
+ echo "Started tmux session '$(TMUX_SESSION)' with backend and frontend windows"; \
142
+ echo "Attach with: tmux attach -t $(TMUX_SESSION)"; \
143
+ fi
144
+
145
+ dev-tmux-kill:
146
+ @tmux kill-session -t $(TMUX_SESSION) 2>/dev/null && echo "Killed tmux session $(TMUX_SESSION)" || echo "No session to kill"
147
+
148
+ dev-tmux-backend:
149
+ @tmux send-keys -t $(TMUX_SESSION):backend C-c 2>/dev/null || true
150
+ @sleep 1
151
+ @tmux send-keys -t $(TMUX_SESSION):backend "make dev" Enter 2>/dev/null || echo "Session not found"
152
+
153
+ dev-tmux-frontend:
154
+ @tmux send-keys -t $(TMUX_SESSION):frontend C-c 2>/dev/null || true
155
+ @sleep 1
156
+ @tmux send-keys -t $(TMUX_SESSION):frontend "make dev" Enter 2>/dev/null || echo "Session not found"
157
+
158
+ # Cleanup targets
159
+ clean-db: # Remove SQLite database
160
+ rm -f backend/visualizer.db
161
+ @echo "Database removed"
162
+
163
+ clean: # Remove build artifacts
164
+ rm -rf frontend/.next
165
+ rm -rf opencode-plugin/dist
166
+
167
+ clean-all: clean clean-db hooks-logs-clear # Remove everything
168
+ @echo "All build artifacts and data cleaned"
169
+
170
+ # Docker targets
171
+ docker-build:
172
+ docker compose build
173
+
174
+ docker-up:
175
+ docker compose up -d
176
+ @echo "AI Studio running at http://localhost:8050"
177
+
178
+ # Point the host hooks/plugin at the Docker-published port. Idempotent: the
179
+ # grep guard keeps it from appending a second line on re-runs.
180
+ docker-config:
181
+ @mkdir -p $(HOME)/.claude
182
+ @grep -q 'AI_STUDIO_API_URL' $(HOME)/.claude/ai-studio-config.env 2>/dev/null \
183
+ && echo "ai-studio-config.env already sets AI_STUDIO_API_URL" \
184
+ || (printf 'AI_STUDIO_API_URL=http://localhost:8050/api/v1/events\n' >> $(HOME)/.claude/ai-studio-config.env \
185
+ && echo "Wrote AI_STUDIO_API_URL=http://localhost:8050/api/v1/events to ~/.claude/ai-studio-config.env")
186
+
187
+ docker-down:
188
+ docker compose down
189
+
190
+ docker-logs:
191
+ docker compose logs -f
192
+
193
+ docker-shell:
194
+ docker compose exec ai-studio /bin/bash
195
+
196
+ # Dependency management
197
+ uv-lock: # Lock dependencies
198
+ cd backend && uv lock
199
+ cd hooks && uv lock
200
+
201
+ uv-sync: # Sync dependencies
202
+ cd backend && uv sync
203
+ cd hooks && uv sync
204
+
205
+ setup: uv-sync install # First-time setup
206
+
207
+ resetup: remove-venv setup # Recreate virtual environments from scratch
208
+
209
+ remove-venv: # Remove virtual environments
210
+ rm -rf backend/.venv hooks/.venv
211
+
212
+ depsupdate: # Update all dependencies
213
+ cd backend && uv sync -U
214
+ cd hooks && uv sync -U
215
+ cd frontend && $(PKG_MGR) update
216
+
217
+ depsshow: # Show dependency tree
218
+ cd backend && uv tree
219
+
220
+ # Version management (ARC-021 / QA-010): rewrite or verify all version locations.
221
+ bump-version: # Bump version everywhere: make bump-version VERSION=x.y.z
222
+ ifndef VERSION
223
+ $(error VERSION is required: make bump-version VERSION=x.y.z)
224
+ endif
225
+ uv run --no-project python scripts/bump_version.py $(VERSION)
226
+
227
+ version-check: # Verify all version locations agree (CI-friendly)
228
+ uv run --no-project python scripts/bump_version.py --check
229
+
230
+ # Pre-commit
231
+ pre-commit: # Run pre-commit on all files
232
+ pre-commit run --all-files
233
+
234
+ pre-commit-update: # Update pre-commit hooks
235
+ pre-commit autoupdate
236
+
237
+ # Help
238
+ help: # Display this help
239
+ @grep -Eh "^[a-z][-a-z]+:.+# " $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.+# "}; {printf "%-20s %s\n", $$1, $$2}'