kanbaii 0.1.2 → 0.2.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.
- package/dashboard/404.html +1 -1
- package/dashboard/_next/static/chunks/23-74779bf2fc2560e3.js +1 -0
- package/dashboard/_next/static/chunks/app/layout-c4919caf1b2a656c.js +1 -0
- package/dashboard/_next/static/chunks/app/page-0cbaeeff2545315a.js +1 -0
- package/dashboard/_next/static/css/7669ae094c660f9a.css +1 -0
- package/dashboard/index.html +1 -1
- package/dashboard/index.txt +3 -3
- package/dist/cli/banner.d.ts +0 -1
- package/dist/cli/banner.js +0 -1
- package/dist/cli/doctor.d.ts +0 -1
- package/dist/cli/doctor.js +0 -1
- package/dist/cli/index.d.ts +0 -1
- package/dist/cli/index.js +0 -1
- package/dist/server/engines/claudeRunner.d.ts +0 -1
- package/dist/server/engines/claudeRunner.js +9 -3
- package/dist/server/engines/coordinator.d.ts +0 -1
- package/dist/server/engines/coordinator.js +0 -1
- package/dist/server/engines/coordinatorPrompt.d.ts +0 -1
- package/dist/server/engines/coordinatorPrompt.js +2 -2
- package/dist/server/engines/dependencyResolver.d.ts +0 -1
- package/dist/server/engines/dependencyResolver.js +0 -1
- package/dist/server/engines/planner.d.ts +0 -1
- package/dist/server/engines/planner.js +0 -1
- package/dist/server/engines/plannerStore.d.ts +0 -1
- package/dist/server/engines/plannerStore.js +0 -1
- package/dist/server/engines/ralph.d.ts +0 -1
- package/dist/server/engines/ralph.js +0 -1
- package/dist/server/engines/runStore.d.ts +0 -1
- package/dist/server/engines/runStore.js +0 -1
- package/dist/server/engines/taskRouter.d.ts +0 -1
- package/dist/server/engines/taskRouter.js +3 -3
- package/dist/server/engines/teams.d.ts +0 -1
- package/dist/server/engines/teams.js +0 -1
- package/dist/server/engines/workerPool.d.ts +0 -1
- package/dist/server/engines/workerPool.js +16 -1
- package/dist/server/index.d.ts +0 -1
- package/dist/server/index.js +72 -8
- package/dist/server/lib/authMiddleware.d.ts +0 -1
- package/dist/server/lib/authMiddleware.js +0 -1
- package/dist/server/lib/fileWatcher.d.ts +0 -1
- package/dist/server/lib/fileWatcher.js +0 -1
- package/dist/server/lib/generateId.d.ts +0 -1
- package/dist/server/lib/generateId.js +0 -1
- package/dist/server/lib/promptSanitizer.d.ts +5 -0
- package/dist/server/lib/promptSanitizer.js +23 -0
- package/dist/server/lib/rateLimiter.d.ts +4 -0
- package/dist/server/lib/rateLimiter.js +33 -0
- package/dist/server/lib/requestLogger.d.ts +2 -0
- package/dist/server/lib/requestLogger.js +23 -0
- package/dist/server/lib/safePath.d.ts +5 -0
- package/dist/server/lib/safePath.js +24 -0
- package/dist/server/lib/schemas.d.ts +0 -1
- package/dist/server/lib/schemas.js +0 -1
- package/dist/server/lib/secretsEncryption.d.ts +3 -0
- package/dist/server/lib/secretsEncryption.js +38 -0
- package/dist/server/lib/typedEmit.d.ts +0 -1
- package/dist/server/lib/typedEmit.js +0 -1
- package/dist/server/routes/agents.d.ts +0 -1
- package/dist/server/routes/agents.js +0 -1
- package/dist/server/routes/auth.d.ts +0 -1
- package/dist/server/routes/auth.js +0 -1
- package/dist/server/routes/costs.d.ts +0 -1
- package/dist/server/routes/costs.js +0 -1
- package/dist/server/routes/escalation.d.ts +0 -1
- package/dist/server/routes/escalation.js +0 -1
- package/dist/server/routes/generate.d.ts +0 -1
- package/dist/server/routes/generate.js +1 -3
- package/dist/server/routes/mcp.d.ts +0 -1
- package/dist/server/routes/mcp.js +0 -1
- package/dist/server/routes/planner.d.ts +0 -1
- package/dist/server/routes/planner.js +0 -1
- package/dist/server/routes/plugins.d.ts +0 -1
- package/dist/server/routes/plugins.js +0 -1
- package/dist/server/routes/projects.d.ts +0 -1
- package/dist/server/routes/projects.js +0 -1
- package/dist/server/routes/ralph.d.ts +0 -1
- package/dist/server/routes/ralph.js +0 -1
- package/dist/server/routes/scheduler.d.ts +0 -1
- package/dist/server/routes/scheduler.js +0 -1
- package/dist/server/routes/settings.d.ts +0 -1
- package/dist/server/routes/settings.js +0 -1
- package/dist/server/routes/skills.d.ts +0 -1
- package/dist/server/routes/skills.js +0 -1
- package/dist/server/routes/soul.d.ts +0 -1
- package/dist/server/routes/soul.js +0 -1
- package/dist/server/routes/system.d.ts +0 -1
- package/dist/server/routes/system.js +15 -12
- package/dist/server/routes/tasks.d.ts +0 -1
- package/dist/server/routes/tasks.js +0 -1
- package/dist/server/routes/teams.d.ts +0 -1
- package/dist/server/routes/teams.js +0 -1
- package/dist/server/routes/terminal.d.ts +0 -1
- package/dist/server/routes/terminal.js +0 -1
- package/dist/server/routes/voice.d.ts +0 -1
- package/dist/server/routes/voice.js +0 -1
- package/dist/server/routes/workItems.d.ts +0 -1
- package/dist/server/routes/workItems.js +11 -1
- package/dist/server/services/agentRegistry.d.ts +0 -1
- package/dist/server/services/agentRegistry.js +0 -1
- package/dist/server/services/authService.d.ts +0 -1
- package/dist/server/services/authService.js +9 -2
- package/dist/server/services/claudeUsage.d.ts +0 -1
- package/dist/server/services/claudeUsage.js +32 -7
- package/dist/server/services/costTracker.d.ts +0 -1
- package/dist/server/services/costTracker.js +0 -1
- package/dist/server/services/escalationService.d.ts +0 -1
- package/dist/server/services/escalationService.js +5 -2
- package/dist/server/services/mcpConfig.d.ts +0 -1
- package/dist/server/services/mcpConfig.js +1 -2
- package/dist/server/services/pluginLoader.d.ts +0 -1
- package/dist/server/services/pluginLoader.js +19 -1
- package/dist/server/services/projectStore.d.ts +0 -1
- package/dist/server/services/projectStore.js +2 -2
- package/dist/server/services/schedulerService.d.ts +0 -1
- package/dist/server/services/schedulerService.js +0 -1
- package/dist/server/services/settingsService.d.ts +0 -1
- package/dist/server/services/settingsService.js +34 -3
- package/dist/server/services/skillsRegistry.d.ts +0 -1
- package/dist/server/services/skillsRegistry.js +0 -1
- package/dist/server/services/soulStore.d.ts +0 -1
- package/dist/server/services/soulStore.js +0 -1
- package/dist/server/services/telegramService.d.ts +0 -1
- package/dist/server/services/telegramService.js +0 -1
- package/dist/server/services/terminalManager.d.ts +0 -1
- package/dist/server/services/terminalManager.js +3 -2
- package/dist/server/services/workItemStore.d.ts +10 -4
- package/dist/server/services/workItemStore.js +57 -20
- package/dist/shared/types.d.ts +1 -1
- package/dist/shared/types.js +0 -1
- package/package.json +15 -4
- package/dashboard/_next/static/chunks/722-5d5f6d00bb07f427.js +0 -1
- package/dashboard/_next/static/chunks/app/layout-f76af5203e5cab0e.js +0 -1
- package/dashboard/_next/static/chunks/app/page-e5035f252913cddb.js +0 -1
- package/dashboard/_next/static/css/1a1fb46093561e14.css +0 -1
- package/dist/cli/banner.d.ts.map +0 -1
- package/dist/cli/banner.js.map +0 -1
- package/dist/cli/doctor.d.ts.map +0 -1
- package/dist/cli/doctor.js.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/server/__tests__/api.test.d.ts +0 -2
- package/dist/server/__tests__/api.test.d.ts.map +0 -1
- package/dist/server/__tests__/api.test.js +0 -279
- package/dist/server/__tests__/api.test.js.map +0 -1
- package/dist/server/__tests__/projectStore.test.d.ts +0 -2
- package/dist/server/__tests__/projectStore.test.d.ts.map +0 -1
- package/dist/server/__tests__/projectStore.test.js +0 -153
- package/dist/server/__tests__/projectStore.test.js.map +0 -1
- package/dist/server/__tests__/setup.d.ts +0 -2
- package/dist/server/__tests__/setup.d.ts.map +0 -1
- package/dist/server/__tests__/setup.js +0 -14
- package/dist/server/__tests__/setup.js.map +0 -1
- package/dist/server/__tests__/workItemStore.test.d.ts +0 -2
- package/dist/server/__tests__/workItemStore.test.d.ts.map +0 -1
- package/dist/server/__tests__/workItemStore.test.js +0 -323
- package/dist/server/__tests__/workItemStore.test.js.map +0 -1
- package/dist/server/engines/claudeRunner.d.ts.map +0 -1
- package/dist/server/engines/claudeRunner.js.map +0 -1
- package/dist/server/engines/coordinator.d.ts.map +0 -1
- package/dist/server/engines/coordinator.js.map +0 -1
- package/dist/server/engines/coordinatorPrompt.d.ts.map +0 -1
- package/dist/server/engines/coordinatorPrompt.js.map +0 -1
- package/dist/server/engines/dependencyResolver.d.ts.map +0 -1
- package/dist/server/engines/dependencyResolver.js.map +0 -1
- package/dist/server/engines/planner.d.ts.map +0 -1
- package/dist/server/engines/planner.js.map +0 -1
- package/dist/server/engines/plannerStore.d.ts.map +0 -1
- package/dist/server/engines/plannerStore.js.map +0 -1
- package/dist/server/engines/ralph.d.ts.map +0 -1
- package/dist/server/engines/ralph.js.map +0 -1
- package/dist/server/engines/runStore.d.ts.map +0 -1
- package/dist/server/engines/runStore.js.map +0 -1
- package/dist/server/engines/taskRouter.d.ts.map +0 -1
- package/dist/server/engines/taskRouter.js.map +0 -1
- package/dist/server/engines/teams.d.ts.map +0 -1
- package/dist/server/engines/teams.js.map +0 -1
- package/dist/server/engines/workerPool.d.ts.map +0 -1
- package/dist/server/engines/workerPool.js.map +0 -1
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/index.js.map +0 -1
- package/dist/server/lib/authMiddleware.d.ts.map +0 -1
- package/dist/server/lib/authMiddleware.js.map +0 -1
- package/dist/server/lib/fileWatcher.d.ts.map +0 -1
- package/dist/server/lib/fileWatcher.js.map +0 -1
- package/dist/server/lib/generateId.d.ts.map +0 -1
- package/dist/server/lib/generateId.js.map +0 -1
- package/dist/server/lib/schemas.d.ts.map +0 -1
- package/dist/server/lib/schemas.js.map +0 -1
- package/dist/server/lib/typedEmit.d.ts.map +0 -1
- package/dist/server/lib/typedEmit.js.map +0 -1
- package/dist/server/routes/agents.d.ts.map +0 -1
- package/dist/server/routes/agents.js.map +0 -1
- package/dist/server/routes/auth.d.ts.map +0 -1
- package/dist/server/routes/auth.js.map +0 -1
- package/dist/server/routes/costs.d.ts.map +0 -1
- package/dist/server/routes/costs.js.map +0 -1
- package/dist/server/routes/escalation.d.ts.map +0 -1
- package/dist/server/routes/escalation.js.map +0 -1
- package/dist/server/routes/generate.d.ts.map +0 -1
- package/dist/server/routes/generate.js.map +0 -1
- package/dist/server/routes/mcp.d.ts.map +0 -1
- package/dist/server/routes/mcp.js.map +0 -1
- package/dist/server/routes/planner.d.ts.map +0 -1
- package/dist/server/routes/planner.js.map +0 -1
- package/dist/server/routes/plugins.d.ts.map +0 -1
- package/dist/server/routes/plugins.js.map +0 -1
- package/dist/server/routes/projects.d.ts.map +0 -1
- package/dist/server/routes/projects.js.map +0 -1
- package/dist/server/routes/ralph.d.ts.map +0 -1
- package/dist/server/routes/ralph.js.map +0 -1
- package/dist/server/routes/scheduler.d.ts.map +0 -1
- package/dist/server/routes/scheduler.js.map +0 -1
- package/dist/server/routes/settings.d.ts.map +0 -1
- package/dist/server/routes/settings.js.map +0 -1
- package/dist/server/routes/skills.d.ts.map +0 -1
- package/dist/server/routes/skills.js.map +0 -1
- package/dist/server/routes/soul.d.ts.map +0 -1
- package/dist/server/routes/soul.js.map +0 -1
- package/dist/server/routes/system.d.ts.map +0 -1
- package/dist/server/routes/system.js.map +0 -1
- package/dist/server/routes/tasks.d.ts.map +0 -1
- package/dist/server/routes/tasks.js.map +0 -1
- package/dist/server/routes/teams.d.ts.map +0 -1
- package/dist/server/routes/teams.js.map +0 -1
- package/dist/server/routes/terminal.d.ts.map +0 -1
- package/dist/server/routes/terminal.js.map +0 -1
- package/dist/server/routes/voice.d.ts.map +0 -1
- package/dist/server/routes/voice.js.map +0 -1
- package/dist/server/routes/workItems.d.ts.map +0 -1
- package/dist/server/routes/workItems.js.map +0 -1
- package/dist/server/services/agentRegistry.d.ts.map +0 -1
- package/dist/server/services/agentRegistry.js.map +0 -1
- package/dist/server/services/authService.d.ts.map +0 -1
- package/dist/server/services/authService.js.map +0 -1
- package/dist/server/services/claudeUsage.d.ts.map +0 -1
- package/dist/server/services/claudeUsage.js.map +0 -1
- package/dist/server/services/costTracker.d.ts.map +0 -1
- package/dist/server/services/costTracker.js.map +0 -1
- package/dist/server/services/escalationService.d.ts.map +0 -1
- package/dist/server/services/escalationService.js.map +0 -1
- package/dist/server/services/mcpConfig.d.ts.map +0 -1
- package/dist/server/services/mcpConfig.js.map +0 -1
- package/dist/server/services/pluginLoader.d.ts.map +0 -1
- package/dist/server/services/pluginLoader.js.map +0 -1
- package/dist/server/services/projectStore.d.ts.map +0 -1
- package/dist/server/services/projectStore.js.map +0 -1
- package/dist/server/services/schedulerService.d.ts.map +0 -1
- package/dist/server/services/schedulerService.js.map +0 -1
- package/dist/server/services/settingsService.d.ts.map +0 -1
- package/dist/server/services/settingsService.js.map +0 -1
- package/dist/server/services/skillsRegistry.d.ts.map +0 -1
- package/dist/server/services/skillsRegistry.js.map +0 -1
- package/dist/server/services/soulStore.d.ts.map +0 -1
- package/dist/server/services/soulStore.js.map +0 -1
- package/dist/server/services/telegramService.d.ts.map +0 -1
- package/dist/server/services/telegramService.js.map +0 -1
- package/dist/server/services/terminalManager.d.ts.map +0 -1
- package/dist/server/services/terminalManager.js.map +0 -1
- package/dist/server/services/workItemStore.d.ts.map +0 -1
- package/dist/server/services/workItemStore.js.map +0 -1
- package/dist/shared/types.d.ts.map +0 -1
- package/dist/shared/types.js.map +0 -1
- /package/dashboard/_next/static/{WZgWWvl5DWIMdBOLDHyIK → U_eLKLn69LJkGH6AtpAhH}/_buildManifest.js +0 -0
- /package/dashboard/_next/static/{WZgWWvl5DWIMdBOLDHyIK → U_eLKLn69LJkGH6AtpAhH}/_ssgManifest.js +0 -0
package/dashboard/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/
|
|
1
|
+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/7669ae094c660f9a.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-5c1d03322d6ecf76.js"/><script src="/_next/static/chunks/fd9d1056-1f1f859026f5f0fa.js" async=""></script><script src="/_next/static/chunks/117-93de0183f63af83e.js" async=""></script><script src="/_next/static/chunks/main-app-8162cbdbe21bd040.js" async=""></script><script src="/_next/static/chunks/947-6596e9d0905e814e.js" async=""></script><script src="/_next/static/chunks/23-74779bf2fc2560e3.js" async=""></script><script src="/_next/static/chunks/app/layout-c4919caf1b2a656c.js" async=""></script><meta name="robots" content="noindex"/><meta name="theme-color" content="#6366f1"/><title>KANBAII</title><meta name="description" content="Structure for your ideas. AI to move them forward."/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.svg" type="image/svg+xml"/><link rel="icon" href="/favicon-16x16.svg" sizes="16x16" type="image/svg+xml"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><script src="/_next/static/chunks/webpack-5c1d03322d6ecf76.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/7669ae094c660f9a.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[2846,[],\"\"]\n4:I[4707,[],\"\"]\n5:I[6423,[],\"\"]\n6:I[792,[\"947\",\"static/chunks/947-6596e9d0905e814e.js\",\"23\",\"static/chunks/23-74779bf2fc2560e3.js\",\"185\",\"static/chunks/app/layout-c4919caf1b2a656c.js\"],\"AppShell\"]\nc:I[1060,[],\"\"]\n7:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n8:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n9:{\"display\":\"inline-block\"}\na:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nd:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"U_eLKLn69LJkGH6AtpAhH\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/7669ae094c660f9a.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$8\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$9\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$a\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$Lb\"],\"globalErrorComponent\":\"$c\",\"missingSlots\":\"$Wd\"}]\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"name\":\"theme-color\",\"content\":\"#6366f1\"}],[\"$\",\"meta\",\"2\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"3\",{\"children\":\"KANBAII\"}],[\"$\",\"meta\",\"4\",{\"name\":\"description\",\"content\":\"Structure for your ideas. AI to move them forward.\"}],[\"$\",\"link\",\"5\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"link\",\"6\",{\"rel\":\"icon\",\"href\":\"/favicon.svg\",\"type\":\"image/svg+xml\"}],[\"$\",\"link\",\"7\",{\"rel\":\"icon\",\"href\":\"/favicon-16x16.svg\",\"sizes\":\"16x16\",\"type\":\"image/svg+xml\"}]]\n3:null\n"])</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[23],{1171:function(t,e,a){a.d(e,{N:function(){return n}});var o=a(2265);function n(t,e){let a=(0,o.useRef)(null);return{overlayProps:{onMouseDown:(0,o.useCallback)(t=>{a.current=t.target},[]),onClick:(0,o.useCallback)(o=>{null!=e&&e.disabled||(a.current===o.currentTarget&&o.target===o.currentTarget&&t(),a.current=null)},[t,null==e?void 0:e.disabled])}}}},9116:function(t,e,a){a.d(e,{h:function(){return r}});let o=a(257).env.NEXT_PUBLIC_API_URL||"http://localhost:5555";async function n(t,e){let a=await fetch("".concat(o).concat(t),{headers:{"Content-Type":"application/json"},...e}),n=await a.json();if(!a.ok||!n.ok)throw Error(n.error||"API error: ".concat(a.status));return n.data}let r={listProjects:()=>n("/api/projects"),getProject:t=>n("/api/projects/".concat(t)),createProject:t=>n("/api/projects",{method:"POST",body:JSON.stringify(t)}),updateProject:(t,e)=>n("/api/projects/".concat(t),{method:"PATCH",body:JSON.stringify(e)}),deleteProject:t=>n("/api/projects/".concat(t),{method:"DELETE"}),listWorkItems:t=>n("/api/projects/".concat(t,"/work-items")),getWorkItem:(t,e)=>n("/api/projects/".concat(t,"/work-items/").concat(e)),createWorkItem:(t,e)=>n("/api/projects/".concat(t,"/work-items"),{method:"POST",body:JSON.stringify(e)}),updateWorkItem:(t,e,a)=>n("/api/projects/".concat(t,"/work-items/").concat(e),{method:"PATCH",body:JSON.stringify(a)}),deleteWorkItem:(t,e)=>n("/api/projects/".concat(t,"/work-items/").concat(e),{method:"DELETE"}),createTask:(t,e,a)=>n("/api/projects/".concat(t,"/work-items/").concat(e,"/tasks"),{method:"POST",body:JSON.stringify(a)}),updateTask:(t,e,a,o)=>n("/api/projects/".concat(t,"/work-items/").concat(e,"/tasks/").concat(a),{method:"PATCH",body:JSON.stringify(o)}),moveTask:(t,e,a,o)=>n("/api/projects/".concat(t,"/work-items/").concat(e,"/tasks/").concat(a,"/move"),{method:"POST",body:JSON.stringify(o)}),deleteTask:(t,e,a)=>n("/api/projects/".concat(t,"/work-items/").concat(e,"/tasks/").concat(a),{method:"DELETE"})}},6766:function(t,e,a){a.d(e,{h:function(){return l},l:function(){return s}});var o=a(8680);let n=a(257).env.NEXT_PUBLIC_API_URL||"http://localhost:5555",r=null;function l(){return r||(r=(0,o.io)(n,{transports:["websocket","polling"],autoConnect:!0,reconnection:!0,reconnectionDelay:1e3,reconnectionAttempts:10})),r}function s(){r&&(r.disconnect(),r=null)}},2569:function(t,e,a){a.d(e,{q:function(){return i}});var o=a(3011),n=a(257);let r={status:"idle",runId:null,projectSlug:null,workItemSlug:null,currentTaskId:null,currentTaskTitle:null,inputNeeded:null,stats:{total:0,completed:0,failed:0,skipped:0,startedAt:null},output:[]},l={active:!1,projectSlug:null,workers:[],metrics:null,logs:[],workerLogs:{},inputNeeded:null,coordinatorThinking:[],coordinatorToolCalls:[],coordinatorStatus:"idle"},s={active:!1,projectSlug:null,messages:[],discoveredItems:[],escalation:null,escalationMessageId:null},c=n.env.NEXT_PUBLIC_API_URL||"http://localhost:5555",i=(0,o.U)((t,e)=>({ralph:{...r},setRalphState:e=>t(t=>({ralph:{...t.ralph,...e}})),appendRalphOutput:e=>t(t=>({ralph:{...t.ralph,output:[...t.ralph.output.slice(-500),e]}})),resetRalph:()=>t({ralph:{...r}}),onRalphStarted:e=>t({ralph:{status:"running",runId:null,projectSlug:e.projectSlug,workItemSlug:null,currentTaskId:null,currentTaskTitle:null,inputNeeded:null,stats:{total:e.total,completed:0,failed:0,skipped:0,startedAt:new Date().toISOString()},output:[]}}),onRalphProgress:e=>t(t=>{var a,o;return{ralph:{...t.ralph,status:"running",currentTaskId:(null===(a=e.currentTask)||void 0===a?void 0:a.id)||null,currentTaskTitle:(null===(o=e.currentTask)||void 0===o?void 0:o.title)||null,stats:{...t.ralph.stats,total:e.total}}}}),onRalphOutput:t=>{e().appendRalphOutput(t.message)},onRalphCompleted:()=>t(t=>({ralph:{...t.ralph,status:"idle",currentTaskId:null,currentTaskTitle:null}})),onRalphError:t=>{t.message&&e().appendRalphOutput("ERROR: ".concat(t.message))},onRalphInputNeeded:e=>t(t=>({ralph:{...t.ralph,inputNeeded:e}})),clearRalphInput:()=>t(t=>({ralph:{...t.ralph,inputNeeded:null}})),teams:{...l},onTeamsStarted:e=>t({teams:{...l,active:!0,projectSlug:e.projectSlug,logs:["Teams started: ".concat(e.workItemSlugs.length," work items, ").concat(e.maxWorkers," workers")]}}),onTeamsWorkerAssigned:e=>t(t=>{let a={id:e.workerId,taskId:e.taskId,taskTitle:e.taskTitle,agentName:e.agentName,workItemSlug:e.workItemSlug,status:"running"};return{teams:{...t.teams,workers:[...t.teams.workers,a],logs:[...t.teams.logs,"".concat(e.agentName||"Worker"," → ").concat(e.taskTitle)]}}}),onTeamsWorkerCompleted:e=>t(t=>{let a=t.teams.workers.map(t=>t.id===e.workerId?{...t,status:e.status}:t);return{teams:{...t.teams,workers:a,logs:[...t.teams.logs,"".concat("completed"===e.status?"✓":"✗"," Task ").concat(e.taskId)]}}}),onTeamsMetrics:e=>t(t=>({teams:{...t.teams,metrics:e}})),onTeamsOutput:e=>t(t=>{let a=e.workerId?"[".concat(e.workerId.slice(-4),"] "):"",o={...t.teams.workerLogs};if(e.workerId&&"coordinator"!==e.workerId){let t=o[e.workerId]||[];o[e.workerId]=[...t.slice(-1e3),e.message]}return{teams:{...t.teams,logs:[...t.teams.logs.slice(-500),"".concat(a).concat(e.message)],workerLogs:o}}}),onTeamsStopped:e=>t(t=>({teams:{...t.teams,active:!1,inputNeeded:null,logs:[...t.teams.logs,"\n--- ".concat(e.message," ---")]}})),onTeamsInputNeeded:e=>t(t=>({teams:{...t.teams,inputNeeded:e}})),clearTeamsInput:()=>t(t=>({teams:{...t.teams,inputNeeded:null}})),resetTeams:()=>t({teams:{...l}}),onCoordinatorThinking:e=>t(t=>({teams:{...t.teams,coordinatorThinking:[...t.teams.coordinatorThinking.slice(-200),e.text],coordinatorStatus:"thinking"}})),onCoordinatorToolCall:e=>t(t=>{var a;return{teams:{...t.teams,coordinatorToolCalls:[...t.teams.coordinatorToolCalls.slice(-30),{tool:e.tool,input:e.input,timestamp:new Date().toISOString()}],coordinatorStatus:"calling-tool",logs:[...t.teams.logs,"\uD83D\uDD27 ".concat(e.tool).concat((null===(a=e.input)||void 0===a?void 0:a.taskId)?" → ".concat(e.input.taskId):"")]}}}),onCoordinatorCompleted:e=>t(t=>({teams:{...t.teams,active:!1,coordinatorStatus:"idle",logs:[...t.teams.logs,"\n--- ".concat(e.message," ---")]}})),terminal:{status:"idle",output:[],projectSlug:null},appendTerminalOutput:e=>t(t=>({terminal:{...t.terminal,output:[...t.terminal.output.slice(-500),e]}})),setTerminalStatus:e=>t(t=>({terminal:{...t.terminal,status:e}})),resetTerminal:()=>t({terminal:{status:"idle",output:[],projectSlug:null}}),escalation:null,onEscalationCreated:e=>t({escalation:e}),onEscalationResponded:()=>t({escalation:null}),onEscalationTimeout:()=>t({escalation:null}),planner:{...s},onPlannerStarted:e=>t({planner:{...s,active:!0,projectSlug:e.projectSlug}}),onPlannerMessage:e=>t(t=>({planner:{...t.planner,messages:[...t.planner.messages.slice(-200),{id:e.id,role:e.role,content:e.content,timestamp:new Date().toISOString()}]}})),onPlannerItemDiscovered:e=>t(t=>({planner:{...t.planner,discoveredItems:[...t.planner.discoveredItems,{id:e.id,title:e.title,category:e.category,status:"identified",plan:null,tasks:[],approvedAs:null}]}})),onPlannerItemUpdated:e=>t(t=>({planner:{...t.planner,discoveredItems:t.planner.discoveredItems.map(t=>{var a,o;return t.id===e.id?{...t,status:e.status,plan:null!==(a=e.plan)&&void 0!==a?a:t.plan,tasks:null!==(o=e.tasks)&&void 0!==o?o:t.tasks}:t})}})),onPlannerEscalation:e=>t(t=>({planner:{...t.planner,escalation:{id:e.id,source:"planner",taskId:e.taskId,taskTitle:e.taskTitle,question:e.question,options:e.options,timeoutMs:e.timeoutMs},escalationMessageId:e.messageId||null}})),onPlannerEscalationResponded:e=>t(t=>({planner:{...t.planner,escalation:null,escalationMessageId:null,messages:t.planner.messages.map(a=>a.id===t.planner.escalationMessageId?{...a,respondedWith:e}:a)}})),onPlannerItemApproved:e=>t(t=>({planner:{...t.planner,discoveredItems:t.planner.discoveredItems.map(t=>t.id===e.id?{...t,approvedAs:e.workItemSlug}:t)}})),onPlannerStopped:()=>t(t=>({planner:{...t.planner,active:!1,escalation:null,escalationMessageId:null}})),isSystemBusy:()=>{let t=e();return"running"===t.ralph.status||"paused"===t.ralph.status||t.teams.active||"running"===t.terminal.status||t.planner.active},rehydrate:async()=>{try{var e;let[a,o,n]=await Promise.all([fetch("".concat(c,"/api/ralph/state")).then(t=>t.json()).catch(()=>null),fetch("".concat(c,"/api/teams/state")).then(t=>t.json()).catch(()=>null),fetch("".concat(c,"/api/planner/state")).then(t=>t.json()).catch(()=>null)]);if((null==a?void 0:a.ok)&&a.data){let e=a.data;t(t=>({ralph:{...t.ralph,status:"stopping"===e.status?"idle":e.status,runId:e.runId,projectSlug:e.projectSlug,workItemSlug:e.workItemSlug,currentTaskId:e.currentTaskId,currentTaskTitle:e.currentTaskTitle,stats:e.stats}}))}(null==o?void 0:o.ok)&&o.data&&t(t=>({teams:{...t.teams,active:o.data.active}})),(null==n?void 0:n.ok)&&(null===(e=n.data)||void 0===e?void 0:e.active)&&t(t=>({planner:{...t.planner,active:!0,projectSlug:n.data.projectSlug,messages:n.data.messages||[],discoveredItems:n.data.discoveredItems||[]}}))}catch(t){}}}))},9747:function(t,e,a){a.d(e,{i:function(){return r}});var o=a(3011),n=a(9116);let r=(0,o.U)((t,e)=>({projects:[],activeSlug:null,loading:!1,error:null,setActiveSlug:e=>t({activeSlug:e}),fetchProjects:async()=>{t({loading:!0,error:null});try{let e=await n.h.listProjects();t({projects:e,loading:!1})}catch(e){t({error:e.message,loading:!1})}},createProject:async e=>{let a=await n.h.createProject(e);return t(t=>t.projects.some(t=>t.id===a.id)?{}:{projects:[a,...t.projects]}),a},updateProject:async(e,a)=>{let o=await n.h.updateProject(e,a);t(t=>({projects:t.projects.map(t=>t.slug===e?o:t)}))},deleteProject:async e=>{await n.h.deleteProject(e),t(t=>({projects:t.projects.filter(t=>t.slug!==e),activeSlug:t.activeSlug===e?null:t.activeSlug}))},onProjectUpdated:e=>{t(t=>t.projects.some(t=>t.id===e.id)?{projects:t.projects.map(t=>t.id===e.id?e:t)}:{projects:[e,...t.projects]})},onProjectDeleted:e=>{t(t=>({projects:t.projects.filter(t=>t.slug!==e),activeSlug:t.activeSlug===e?null:t.activeSlug}))}}))},9449:function(t,e,a){a.d(e,{U:function(){return s}});var o=a(3011),n=a(2569);let r=new Map;function l(t,e){let a=n.q.getState();t&&r.set(t,{terminal:{...a.terminal},ralph:{...a.ralph},teams:{...a.teams}});let o=r.get(e);o?n.q.setState({terminal:o.terminal,ralph:o.ralph,teams:o.teams}):(a.resetTerminal(),a.resetRalph(),a.resetTeams())}let s=(0,o.U)((t,e)=>({projectSlug:null,workItemSlug:null,view:"work-items",goToProject:a=>{let o=e().projectSlug;o!==a&&l(o,a),t({projectSlug:a,workItemSlug:null,view:"work-items"})},goToWorkItem:(a,o)=>{let n=e().projectSlug;n!==a&&l(n,a),t({projectSlug:a,workItemSlug:o,view:"board"})},goBack:()=>{e().workItemSlug?t({workItemSlug:null,view:"work-items"}):t({projectSlug:null,view:"work-items"})},goHome:()=>t({projectSlug:null,workItemSlug:null,view:"work-items"}),setView:e=>t({view:e})}))},9405:function(t,e,a){a.d(e,{E:function(){return r}});var o=a(3011);let n=0,r=(0,o.U)(t=>({toasts:[],addToast:function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",o="toast-".concat(++n);t(t=>({toasts:[...t.toasts,{id:o,message:e,type:a}]})),setTimeout(()=>{t(t=>({toasts:t.toasts.filter(t=>t.id!==o)}))},3e3)},removeToast:e=>{t(t=>({toasts:t.toasts.filter(t=>t.id!==e)}))}}))},15:function(t,e,a){a.d(e,{o:function(){return r}});var o=a(3011),n=a(9116);let r=(0,o.U)((t,e)=>({workItems:[],projectSlug:null,loading:!1,error:null,fetchWorkItems:async e=>{t({loading:!0,error:null,projectSlug:e});try{let a=await n.h.listWorkItems(e);t({workItems:a,loading:!1})}catch(e){t({error:e.message,loading:!1})}},createWorkItem:async(e,a)=>{let o=await n.h.createWorkItem(e,a);return t(t=>({workItems:[o,...t.workItems]})),o},updateWorkItem:async(e,a,o)=>{let r=await n.h.updateWorkItem(e,a,o);t(t=>({workItems:t.workItems.map(t=>t.id===r.id||t.slug===a?r:t)}))},deleteWorkItem:async(e,a)=>{await n.h.deleteWorkItem(e,a),t(t=>({workItems:t.workItems.filter(t=>t.slug!==a&&t.id!==a)}))},onWorkItemUpdated:(a,o)=>{e().projectSlug===a&&t(t=>t.workItems.some(t=>t.id===o.id)?{workItems:t.workItems.map(t=>t.id===o.id?o:t)}:{workItems:[o,...t.workItems]})},onWorkItemDeleted:(a,o)=>{e().projectSlug===a&&t(t=>({workItems:t.workItems.filter(t=>t.id!==o&&t.slug!==o)}))},clear:()=>t({workItems:[],projectSlug:null,loading:!1,error:null})}))}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{9889:function(e,t,s){Promise.resolve().then(s.t.bind(s,7960,23)),Promise.resolve().then(s.bind(s,792))},792:function(e,t,s){"use strict";s.d(t,{AppShell:function(){return ev}});var a=s(7437),n=s(2265);let r=(0,n.createContext)(void 0);function o(e){let{children:t}=e,[s,o]=(0,n.useState)("dark"),[l,i]=(0,n.useState)(!1);return((0,n.useEffect)(()=>{let e=localStorage.getItem("kanbaii-theme");"light"===e||"dark"===e?o(e):o("dark"),i(!0)},[]),(0,n.useEffect)(()=>{l&&(document.documentElement.setAttribute("data-theme",s),localStorage.setItem("kanbaii-theme",s))},[s,l]),l)?(0,a.jsx)(r.Provider,{value:{theme:s,toggleTheme:()=>{o(e=>"dark"===e?"light":"dark")}},children:t}):null}function l(){let e=(0,n.useContext)(r);if(!e)throw Error("useTheme must be used within ThemeProvider");return e}var i=s(2829);let c=(0,i.Z)("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);var d=s(9397);let x=(0,i.Z)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),u=(0,i.Z)("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);var p=s(8930);let m=(0,i.Z)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);var h=s(8728),f=s(9747),b=s(9449),g=s(2569),v=s(9405),j=s(1347);function y(){let{theme:e,toggleTheme:t}=l();return(0,a.jsxs)("button",{className:"relative w-12 h-[26px] rounded-[13px] border border-border bg-surface cursor-pointer p-0 transition-all duration-250 ease-out-expo overflow-hidden shrink-0 hover:border-accent hover:bg-surface-hover hover:shadow-[0_0_8px_var(--accent-glow)]",onClick:t,title:"Switch to ".concat("dark"===e?"light":"dark"," theme"),children:[(0,a.jsx)(j.E.div,{className:"absolute top-0.5 left-0.5 w-5 h-5 rounded-[10px] bg-accent shadow-[0_2px_6px_rgba(0,0,0,0.3)] flex items-center justify-center",initial:!1,animate:{x:"dark"===e?0:22},transition:{type:"spring",stiffness:300,damping:30},children:"dark"===e?(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}):(0,a.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"5"}),(0,a.jsx)("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),(0,a.jsx)("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),(0,a.jsx)("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),(0,a.jsx)("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),(0,a.jsx)("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),(0,a.jsx)("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),(0,a.jsx)("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),(0,a.jsx)("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]})}),(0,a.jsxs)("div",{className:"absolute inset-0 flex items-center justify-between px-1.5 pointer-events-none",children:[(0,a.jsx)("div",{className:"ml-0.5 transition-opacity duration-250 ease-out-expo ".concat("dark"===e?"opacity-30":"opacity-0"),children:(0,a.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-muted)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})}),(0,a.jsx)("div",{className:"mr-0.5 transition-opacity duration-250 ease-out-expo ".concat("light"===e?"opacity-30":"opacity-0"),children:(0,a.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-muted)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"5"}),(0,a.jsx)("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),(0,a.jsx)("line",{x1:"12",y1:"21",x2:"12",y2:"23"})]})})]})]})}var k=s(2489),N=s(1171);let w=["#6366f1","#ef4444","#f59e0b","#22c55e","#3b82f6","#8b5cf6","#ec4899","#14b8a6"];function C(e){let{onClose:t}=e,s=(0,b.U)(e=>e.goToProject),r=(0,f.i)(e=>e.createProject),[o,l]=(0,n.useState)(""),[i,c]=(0,n.useState)(""),[d,x]=(0,n.useState)(""),[u,p]=(0,n.useState)(w[0]),[m,h]=(0,n.useState)(!1),{overlayProps:g}=(0,N.N)(t,{disabled:m}),v=async e=>{if(e.preventDefault(),o.trim()){h(!0);try{let e=await r({title:o.trim(),description:i.trim()||void 0,color:u,workingDir:d.trim()||void 0});t(),s(e.slug)}catch(e){h(!1)}}};return(0,a.jsx)("div",{className:"glass-overlay",...g,children:(0,a.jsxs)("div",{className:"modal-box w-[440px] max-w-[92%] p-7",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-7",children:[(0,a.jsx)("span",{className:"text-h2 font-semibold tracking-tight",children:"New Project"}),(0,a.jsx)("button",{className:"btn-icon",onClick:t,children:(0,a.jsx)(k.Z,{size:16})})]}),(0,a.jsxs)("form",{className:"flex flex-col gap-5",onSubmit:v,children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("label",{className:"text-[10px] font-semibold text-text-muted uppercase tracking-widest mb-2 font-mono",children:"Title"}),(0,a.jsx)("input",{value:o,onChange:e=>l(e.target.value),placeholder:"Project name...",autoFocus:!0})]}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("label",{className:"text-[10px] font-semibold text-text-muted uppercase tracking-widest mb-2 font-mono",children:"Description (optional)"}),(0,a.jsx)("input",{value:i,onChange:e=>c(e.target.value),placeholder:"Brief description..."})]}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("label",{className:"text-[10px] font-semibold text-text-muted uppercase tracking-widest mb-2 font-mono",children:"Working Directory"}),(0,a.jsx)("input",{value:d,onChange:e=>x(e.target.value),placeholder:"C:\\Users\\...\\my-project"})]}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("label",{className:"text-[10px] font-semibold text-text-muted uppercase tracking-widest mb-2 font-mono",children:"Color"}),(0,a.jsx)("div",{className:"flex gap-2",children:w.map(e=>(0,a.jsx)("button",{type:"button",className:"w-6 h-6 rounded-full border-2 cursor-pointer transition-all duration-150 ease-out-expo\n ".concat(u===e?"border-text shadow-[0_0_8px_currentColor]":"border-transparent shadow-[0_0_0_0_transparent]","\n hover:scale-[1.2] hover:shadow-[0_0_12px_currentColor]"),style:{background:e},onClick:()=>p(e)},e))})]}),(0,a.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,a.jsx)("button",{type:"button",className:"btn-ghost",onClick:t,children:"Cancel"}),(0,a.jsx)("button",{type:"submit",className:"btn-primary",disabled:!o.trim()||m,children:m?"Creating...":"Create"})]})]})]})})}let S=s(257).env.NEXT_PUBLIC_API_URL||"http://localhost:5555",T=[{key:"general",label:"General"},{key:"ralph",label:"Ralph"},{key:"scheduler",label:"Scheduler"},{key:"terminal",label:"Terminal"},{key:"auth",label:"Auth"},{key:"integrations",label:"Integrations"}];function E(e){let{onClose:t}=e,s=(0,v.E)(e=>e.addToast),[r,o]=(0,n.useState)("general"),[l,i]=(0,n.useState)(null),[c,d]=(0,n.useState)(!1),{overlayProps:x}=(0,N.N)(t),u=(0,n.useCallback)(async()=>{try{let e=await fetch("".concat(S,"/api/settings")),t=await e.json();t.ok&&i(t.data)}catch(e){}},[]);(0,n.useEffect)(()=>{u()},[u]);let p=async(e,t)=>{d(!0);try{await fetch("".concat(S,"/api/settings/").concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),s("Settings saved","success"),u()}catch(e){s("Failed to save","error")}d(!1)};return l?(0,a.jsx)("div",{className:"glass-overlay",...x,children:(0,a.jsxs)("div",{className:"modal-box max-w-[680px] w-[95%] max-h-[80vh] flex flex-col",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-6 pt-5 pb-4 shrink-0",children:[(0,a.jsxs)("div",{className:"text-h2 font-semibold tracking-tight flex items-center gap-2",children:[(0,a.jsx)(h.Z,{size:16})," Settings"]}),(0,a.jsx)("button",{className:"btn-icon",onClick:t,children:(0,a.jsx)(k.Z,{size:16})})]}),(0,a.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,a.jsx)("div",{className:"w-40 shrink-0 border-r border-border p-2 flex flex-col gap-0.5 bg-bg-subtle",children:T.map(e=>(0,a.jsx)("button",{className:"px-3 py-2 text-xs font-medium text-text-muted rounded-sm text-left transition-all duration-150 ease-out-expo hover:text-text-secondary hover:bg-surface-hover ".concat(r===e.key?"text-text bg-accent-muted":""),onClick:()=>o(e.key),children:e.label},e.key))}),(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:["general"===r&&(0,a.jsxs)(z,{title:"General",onSave:e=>p("general",e),saving:c,children:[(0,a.jsx)(P,{label:"Default Model",type:"select",value:l.general.defaultModel,options:["haiku","sonnet","opus"],field:"defaultModel"}),(0,a.jsx)(P,{label:"Timezone",value:l.general.timezone,field:"timezone"}),(0,a.jsx)(P,{label:"Port",type:"number",value:l.general.port,field:"port"})]}),"ralph"===r&&(0,a.jsxs)(z,{title:"Ralph",onSave:e=>p("ralph",e),saving:c,children:[(0,a.jsx)(P,{label:"Max Iterations",type:"number",value:l.ralph.maxIterations,field:"maxIterations"}),(0,a.jsx)(P,{label:"Circuit Breaker (max errors)",type:"number",value:l.ralph.circuitBreaker,field:"circuitBreaker"}),(0,a.jsx)(P,{label:"Task Filter",type:"select",value:l.ralph.taskFilter,options:["todo-only","all"],field:"taskFilter"})]}),"scheduler"===r&&(0,a.jsxs)(z,{title:"Scheduler",onSave:e=>p("scheduler",e),saving:c,children:[(0,a.jsx)(P,{label:"Enabled",type:"toggle",value:l.scheduler.enabled,field:"enabled"}),(0,a.jsx)(P,{label:"Max Concurrent",type:"number",value:l.scheduler.maxConcurrent,field:"maxConcurrent"}),(0,a.jsx)(P,{label:"Timeout (ms)",type:"number",value:l.scheduler.timeout,field:"timeout"}),(0,a.jsx)(P,{label:"Stale Threshold (min)",type:"number",value:l.scheduler.staleThreshold,field:"staleThreshold"})]}),"terminal"===r&&(0,a.jsxs)(z,{title:"Terminal",onSave:e=>p("terminal",e),saving:c,children:[(0,a.jsx)(P,{label:"Inactivity Warn (min)",type:"number",value:l.terminal.inactivityWarn,field:"inactivityWarn"}),(0,a.jsx)(P,{label:"Inactivity Kill (min)",type:"number",value:l.terminal.inactivityKill,field:"inactivityKill"}),(0,a.jsx)(P,{label:"Max Timeout (min)",type:"number",value:l.terminal.maxTimeout,field:"maxTimeout"})]}),"auth"===r&&(0,a.jsxs)(z,{title:"Authentication",onSave:e=>p("auth",e),saving:c,children:[(0,a.jsx)(P,{label:"Enabled",type:"toggle",value:l.auth.enabled,field:"enabled"}),(0,a.jsx)(P,{label:"Secret Key",value:l.auth.secret,field:"secret",placeholder:"auto-generated if empty"}),(0,a.jsx)(P,{label:"Token Expiry",value:l.auth.tokenExpiry,field:"tokenExpiry",placeholder:"24h"})]}),"integrations"===r&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(z,{title:"Telegram",onSave:e=>p("integrations",{telegram:e}),saving:c,children:[(0,a.jsx)(P,{label:"Enabled",type:"toggle",value:l.integrations.telegram.enabled,field:"enabled"}),(0,a.jsx)(P,{label:"Bot Token",value:l.integrations.telegram.botToken,field:"botToken",placeholder:"123456:ABC-DEF..."}),(0,a.jsx)(P,{label:"Chat ID",value:l.integrations.telegram.chatId,field:"chatId",placeholder:"-100123456789"})]}),(0,a.jsxs)(z,{title:"Voice Input",onSave:e=>p("integrations",{voice:e}),saving:c,children:[(0,a.jsx)(P,{label:"Enabled",type:"toggle",value:l.integrations.voice.enabled,field:"enabled"}),(0,a.jsx)(P,{label:"OpenAI API Key",value:l.integrations.voice.openaiApiKey||"",field:"openaiApiKey",placeholder:"sk-... (for Whisper fallback)"})]})]})]})]})]})}):null}function z(e){let{title:t,children:s,onSave:r,saving:o}=e,[l,i]=(0,n.useState)({});(0,n.useEffect)(()=>{let e={};n.Children.forEach(s,t=>{var s;(null==t?void 0:null===(s=t.props)||void 0===s?void 0:s.field)&&(e[t.props.field]=t.props.value)}),i(e)},[s]);let c=(e,t)=>{i(s=>({...s,[e]:t}))};return(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-body font-semibold text-text tracking-tight",children:t}),(0,a.jsx)("button",{className:"btn-primary",onClick:()=>r(l),disabled:o,children:o?"Saving...":"Save"})]}),(0,a.jsx)("div",{className:"flex flex-col gap-3",children:n.Children.map(s,e=>{var t,s;return(null==e?void 0:null===(t=e.props)||void 0===t?void 0:t.field)?n.cloneElement(e,{value:null!==(s=l[e.props.field])&&void 0!==s?s:e.props.value,onChange:t=>c(e.props.field,t)}):e})})]})}function P(e){let{label:t,value:s,field:n,type:r,options:o,placeholder:l,onChange:i}=e;return"toggle"===r?(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-text-secondary min-w-[140px] shrink-0",children:t}),(0,a.jsx)("button",{className:"px-3 py-1 text-data font-semibold rounded-xs font-mono border transition-all duration-150 ease-out-expo tracking-wide ".concat(s?"text-success border-success-dim bg-success-dim":"text-text-muted border-border"),onClick:()=>null==i?void 0:i(!s),children:s?"ON":"OFF"})]}):"select"===r&&o?(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-text-secondary min-w-[140px] shrink-0",children:t}),(0,a.jsx)("div",{className:"flex gap-1",children:o.map(e=>(0,a.jsx)("button",{className:"px-2.5 py-1 text-data font-medium rounded-full border font-mono transition-all duration-150 ease-out-expo ".concat(s===e?"border-accent-dim text-accent bg-accent-muted":"border-border text-text-muted hover:border-border-light hover:text-text-secondary"),onClick:()=>null==i?void 0:i(e),children:e},e))})]}):(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-text-secondary min-w-[140px] shrink-0",children:t}),(0,a.jsx)("input",{type:r||"text",value:null!=s?s:"",onChange:e=>null==i?void 0:i("number"===r?Number(e.target.value):e.target.value),placeholder:l,className:"flex-1 max-w-[200px] text-right font-mono text-xs"})]})}let M=(0,i.Z)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);var _=s(1239),I=s(1723);let A=s(257).env.NEXT_PUBLIC_API_URL||"http://localhost:5555";function R(e){return e<.01?"$".concat(e.toFixed(4)):"$".concat(e.toFixed(2))}function Z(e){var t;let{projectSlug:s}=e,r=(0,v.E)(e=>e.addToast),[o,l]=(0,n.useState)(null),[i,c]=(0,n.useState)([]),[d,x]=(0,n.useState)("30d"),[u,h]=(0,n.useState)(s?"project":"global"),f=(0,n.useCallback)(async()=>{let e="project"===u&&s?s:void 0,t="7d"===d?7:"30d"===d?30:void 0,[a,n]=await Promise.all([fetch("".concat(A,"/api/costs/summary").concat(e?"?projectSlug=".concat(e):"")).then(e=>e.json()).catch(()=>({data:null})),fetch("".concat(A,"/api/costs/executions?limit=50").concat(e?"&projectSlug=".concat(e):"").concat(t?"&days=".concat(t):"")).then(e=>e.json()).catch(()=>({data:[]}))]);l(a.data||null),c(n.data||[])},[s,u,d]);(0,n.useEffect)(()=>{f()},[f]);let b=async()=>{let e="project"===u&&s?"?projectSlug=".concat(s):"";await fetch("".concat(A,"/api/costs/clear").concat(e),{method:"DELETE"}),r("Execution history cleared","info"),f()},g={opus:"#a855f7",sonnet:"#6366f1",haiku:"#22c55e"};return(0,a.jsxs)("div",{className:"flex flex-col h-full overflow-y-auto gap-5 p-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[(0,a.jsxs)("div",{className:"text-h2 font-semibold tracking-tight flex items-center gap-2",children:[(0,a.jsx)(m,{size:18})," Costs & Analytics"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[s&&(0,a.jsxs)("div",{className:"flex border border-border rounded-sm overflow-hidden",children:[(0,a.jsx)("button",{className:"px-2.5 py-1 text-xxs font-semibold font-mono tracking-wide uppercase text-text-muted transition-all duration-150 ease-out-expo hover:text-text-secondary hover:bg-surface-hover ".concat("project"===u?"text-accent bg-accent-muted":""),onClick:()=>h("project"),children:"Project"}),(0,a.jsx)("button",{className:"px-2.5 py-1 text-xxs font-semibold font-mono tracking-wide uppercase text-text-muted transition-all duration-150 ease-out-expo hover:text-text-secondary hover:bg-surface-hover ".concat("global"===u?"text-accent bg-accent-muted":""),onClick:()=>h("global"),children:"Global"})]}),(0,a.jsx)("div",{className:"flex border border-border rounded-sm overflow-hidden",children:["7d","30d","all"].map(e=>(0,a.jsx)("button",{className:"px-2.5 py-1 text-xxs font-semibold font-mono tracking-wide uppercase text-text-muted transition-all duration-150 ease-out-expo hover:text-text-secondary hover:bg-surface-hover ".concat(d===e?"text-accent bg-accent-muted":""),onClick:()=>x(e),children:e},e))})]})]}),o&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-cols-4 gap-2 max-md:grid-cols-2",children:[(0,a.jsxs)("div",{className:"p-4 border border-border rounded-md bg-card text-center relative overflow-hidden",children:[(0,a.jsx)("div",{className:"text-accent mb-1.5 flex justify-center",children:(0,a.jsx)(M,{size:14})}),(0,a.jsx)("div",{className:"text-h1 font-bold text-text font-mono tracking-tight",children:R(o.todayCost)}),(0,a.jsx)("div",{className:"text-xxs font-semibold text-text-muted uppercase tracking-widest font-mono mt-1",children:"Today"})]}),(0,a.jsxs)("div",{className:"p-4 border border-border rounded-md bg-card text-center relative overflow-hidden",children:[(0,a.jsx)("div",{className:"text-accent mb-1.5 flex justify-center",children:(0,a.jsx)(M,{size:14})}),(0,a.jsx)("div",{className:"text-h1 font-bold text-text font-mono tracking-tight",children:R(o.monthlyCost)}),(0,a.jsx)("div",{className:"text-xxs font-semibold text-text-muted uppercase tracking-widest font-mono mt-1",children:"This Month"})]}),(0,a.jsxs)("div",{className:"p-4 border border-border rounded-md bg-card text-center relative overflow-hidden",children:[(0,a.jsx)("div",{className:"text-accent mb-1.5 flex justify-center",children:(0,a.jsx)(_.Z,{size:14})}),(0,a.jsx)("div",{className:"text-h1 font-bold text-text font-mono tracking-tight",children:(t=o.monthlyTokens)>=1e6?"".concat((t/1e6).toFixed(1),"M"):t>=1e3?"".concat((t/1e3).toFixed(0),"K"):"".concat(t)}),(0,a.jsx)("div",{className:"text-xxs font-semibold text-text-muted uppercase tracking-widest font-mono mt-1",children:"Tokens (Month)"})]}),(0,a.jsxs)("div",{className:"p-4 border border-border rounded-md bg-card text-center relative overflow-hidden",children:[(0,a.jsx)("div",{className:"text-accent mb-1.5 flex justify-center",children:(0,a.jsx)(I.Z,{size:14})}),(0,a.jsx)("div",{className:"text-h1 font-bold text-text font-mono tracking-tight",children:o.monthlyExecutions}),(0,a.jsx)("div",{className:"text-xxs font-semibold text-text-muted uppercase tracking-widest font-mono mt-1",children:"Executions (Month)"})]})]}),Object.keys(o.byModel).length>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"text-data font-semibold text-text-muted uppercase tracking-widest font-mono",children:"Model Breakdown"}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:Object.entries(o.byModel).map(e=>{let[t,s]=e;return(0,a.jsxs)("div",{className:"flex items-center gap-2.5 px-3 py-2.5 border border-border rounded-sm bg-card",children:[(0,a.jsx)("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:g[t]||"#6366f1"}}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text",children:t}),(0,a.jsxs)("span",{className:"text-data text-text-muted font-mono ml-2",children:[s.count," runs — ",R(s.cost)]})]}),(0,a.jsx)("div",{className:"w-20 h-1 rounded-full overflow-hidden",style:{background:"rgba(148, 163, 242, 0.06)"},children:(0,a.jsx)("div",{className:"h-full rounded-full transition-[width] duration-500 ease-out-expo",style:{width:"".concat(o.totalExecutions>0?s.count/o.totalExecutions*100:0,"%"),background:g[t]||"#6366f1"}})})]},t)})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("div",{className:"text-data font-semibold text-text-muted uppercase tracking-widest font-mono",children:"Recent Executions"}),(0,a.jsxs)("button",{className:"inline-flex items-center gap-[3px] text-xxs text-text-muted px-2 py-[3px] rounded-xs font-mono border border-border transition-all duration-120 ease-out-expo hover:text-danger hover:border-danger-dim",onClick:b,children:[(0,a.jsx)(p.Z,{size:10})," Clear"]})]}),0===i.length?(0,a.jsx)("div",{className:"text-text-muted text-label text-center py-8 font-mono opacity-50",children:"No executions recorded yet"}):(0,a.jsxs)("div",{className:"border border-border rounded-md overflow-hidden bg-card",children:[(0,a.jsxs)("div",{className:"grid grid-cols-[1fr_70px_70px_60px_40px] px-3.5 py-2 text-xxs font-semibold text-text-muted uppercase tracking-wide font-mono border-b border-border bg-bg-subtle",children:[(0,a.jsx)("span",{children:"Task"}),(0,a.jsx)("span",{children:"Model"}),(0,a.jsx)("span",{children:"Duration"}),(0,a.jsx)("span",{children:"Cost"}),(0,a.jsx)("span",{children:"Status"})]}),i.map(e=>{var t;return(0,a.jsxs)("div",{className:"grid grid-cols-[1fr_70px_70px_60px_40px] px-3.5 py-2 text-label border-b border-b-[rgba(148,163,242,0.03)] last:border-b-0 transition-colors duration-120 ease-out-expo hover:bg-surface-hover",children:[(0,a.jsx)("span",{className:"text-text overflow-hidden text-ellipsis whitespace-nowrap",children:e.taskTitle||e.projectSlug}),(0,a.jsx)("span",{className:"font-mono text-data font-semibold",style:{color:g[e.model]||"#6366f1"},children:e.model}),(0,a.jsx)("span",{className:"text-text-muted font-mono text-data",children:(t=e.duration)<1e3?"".concat(t,"ms"):"".concat((t/1e3).toFixed(1),"s")}),(0,a.jsx)("span",{className:"text-text-secondary font-mono text-data font-medium",children:R(e.costUsd)}),(0,a.jsx)("span",{className:"text-center ".concat("success"===e.status?"text-success":"text-danger"),children:"success"===e.status?"✓":"✗"})]},e.id)})]})]})]})}var D=s(7168),L=s(4401),F=s(6766);let q=s(257).env.NEXT_PUBLIC_API_URL||"http://localhost:5555",U="kanbaii-claude-usage";function B(e){return e>=80?"#ef4444":e>=60?"#f59e0b":"#6366f1"}function O(){try{var e;let t=sessionStorage.getItem(U);if(!t)return null;let s=JSON.parse(t);if((null==s?void 0:null===(e=s.entries)||void 0===e?void 0:e.length)>0&&Date.now()-new Date(s.timestamp).getTime()<3e5)return s}catch(e){}return null}function K(e){let{isExpanded:t}=e,[s,r]=(0,n.useState)(O),[o,l]=(0,n.useState)(!1),i=(0,n.useRef)(!0),c=(0,n.useCallback)(e=>{if(i.current){r(e),l(!1);try{sessionStorage.setItem(U,JSON.stringify(e))}catch(e){}}},[]),d=(0,n.useCallback)(async()=>{try{var e;let t=await fetch("".concat(q,"/api/costs/claude-usage")),s=await t.json(),a=(null==s?void 0:s.data)||s;if((null==a?void 0:null===(e=a.entries)||void 0===e?void 0:e.length)>0)return c(a),!0}catch(e){}return!1},[c]);(0,n.useEffect)(()=>{i.current=!0;let e=null,t=null,a=null,n=()=>{t=setInterval(async()=>{await d()&&t&&(clearInterval(t),t=null)},3e3),a=setTimeout(()=>{t&&(clearInterval(t),t=null),i.current&&!s&&l(!0)},3e4)};return e=setInterval(d,6e4),d().then(e=>{e||n()}),()=>{i.current=!1,e&&clearInterval(e),t&&clearInterval(t),a&&clearTimeout(a)}},[]),(0,n.useEffect)(()=>{let e=(0,F.h)(),t=e=>{var t;(null==e?void 0:null===(t=e.entries)||void 0===t?void 0:t.length)>0&&c(e)};return e.on("claude-usage",t),e.on("connect",()=>{d()}),()=>{e.off("claude-usage",t)}},[c,d]);let x=s?Math.max(...s.entries.map(e=>e.percent),0):0;return t?s?(0,a.jsxs)("div",{className:"px-3 py-2 flex flex-col gap-1.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 mb-0.5",children:[(0,a.jsx)(L.Z,{size:10,className:"text-text-muted opacity-50"}),(0,a.jsx)("span",{className:"text-[8px] font-semibold text-text-muted uppercase tracking-[0.1em] font-mono opacity-60",children:"Rate Limits"})]}),s.entries.map((e,t)=>{var s;let n=B(e.percent),r=(s=e.percent)>=80?"rgba(239,68,68,0.3)":s>=60?"rgba(245,158,11,0.2)":"rgba(99,102,241,0.15)";return(0,a.jsxs)("div",{className:"flex flex-col gap-[3px]",children:[(0,a.jsxs)("div",{className:"flex justify-between items-baseline",children:[(0,a.jsx)("span",{className:"text-[9px] text-text-muted truncate max-w-[110px] font-mono",children:e.label}),(0,a.jsxs)("span",{className:"text-[10px] font-bold font-mono tabular-nums ".concat(e.percent>=80?"animate-breathe":""),style:{color:n},children:[e.percent,"%"]})]}),(0,a.jsx)("div",{className:"w-full h-[3px] rounded-full overflow-hidden",style:{background:"rgba(148,163,242,0.06)"},children:(0,a.jsx)("div",{className:"h-full rounded-full transition-[width] duration-700 ease-out",style:{width:"".concat(Math.min(e.percent,100),"%"),background:n,boxShadow:e.percent>40?"0 0 6px ".concat(r):"none"}})}),e.resetsAt&&(0,a.jsxs)("span",{className:"text-[7px] text-text-muted font-mono opacity-40",children:["Resets ",e.resetsAt]})]},t)})]}):o?(0,a.jsxs)("div",{className:"px-3 py-2 flex items-center justify-center gap-2",children:[(0,a.jsx)("span",{className:"text-[8px] text-text-muted font-mono opacity-40",children:"Unavailable"}),(0,a.jsxs)("button",{className:"text-[8px] text-accent font-mono opacity-60 hover:opacity-100 transition-opacity flex items-center gap-1",onClick:()=>{l(!1),d()},children:[(0,a.jsx)(D.Z,{size:8})," Retry"]})]}):(0,a.jsxs)("div",{className:"px-3 py-2 flex items-center justify-center gap-2",children:[(0,a.jsx)("div",{className:"w-2.5 h-2.5 border border-text-muted/20 border-t-accent/50 rounded-full animate-spin"}),(0,a.jsx)("span",{className:"text-[8px] text-text-muted font-mono opacity-40",children:"Loading usage..."})]}):s?(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1 py-1",title:s.entries.map(e=>"".concat(e.label,": ").concat(e.percent,"%")).join("\n"),children:[(0,a.jsx)("div",{className:"w-[5px] h-5 rounded-full overflow-hidden flex flex-col-reverse",style:{background:"rgba(148, 163, 242, 0.06)"},children:(0,a.jsx)("div",{className:"w-full rounded-full transition-[height] duration-500",style:{height:"".concat(Math.min(x,100),"%"),background:B(x)}})}),(0,a.jsxs)("span",{className:"text-[7px] text-text-muted font-mono opacity-50",children:[x,"%"]})]}):null}let W=s(257).env.NEXT_PUBLIC_API_URL||"http://localhost:5555";function G(){let{projects:e,fetchProjects:t,setActiveSlug:s,deleteProject:r,updateProject:o}=(0,f.i)(),{projectSlug:l,goToProject:i,goHome:j}=(0,b.U)(),k=(0,g.q)(e=>e.ralph),N=(0,g.q)(e=>e.teams),w=(0,v.E)(e=>e.addToast),[S,T]=(0,n.useState)(!1),[z,P]=(0,n.useState)(!1),[M,_]=(0,n.useState)(!1),[I,A]=(0,n.useState)(null),[R,D]=(0,n.useState)(null),[L,F]=(0,n.useState)(null),[q,U]=(0,n.useState)(!0),[B,O]=(0,n.useState)(!1),G=(0,n.useRef)(null),V=q||B,J=(0,g.q)(e=>e.terminal.status),X=(0,g.q)(e=>e.planner.active),$="running"===k.status||"paused"===k.status||N.active||"running"===J||X;(0,n.useEffect)(()=>{t()},[t]),(0,n.useEffect)(()=>{if(!L)return;let e=()=>F(null),t=setTimeout(()=>document.addEventListener("click",e),0);return()=>{clearTimeout(t),document.removeEventListener("click",e)}},[L]);let Q=e=>{s(e.slug),i(e.slug)},Y=async(e,t)=>{e.stopPropagation(),F(null);try{await o(t.slug,{status:"archived"}),l===t.slug&&j(),w("".concat(t.title," archived"),"success")}catch(e){w("Failed to archive","error")}},ee=async(e,t)=>{if(e.stopPropagation(),R!==t.slug){D(t.slug),setTimeout(()=>D(null),3e3);return}F(null);try{await r(t.slug),l===t.slug&&j(),w("".concat(t.title," deleted"),"success"),D(null)}catch(e){w("Failed to delete","error")}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("aside",{className:"flex-shrink-0 border-r border-border bg-bg-subtle flex flex-col overflow-hidden relative z-10\n transition-all duration-300 ease-out-expo ".concat(V?"w-sidebar":"w-sidebar-collapsed"),onMouseEnter:()=>{G.current&&clearTimeout(G.current),O(!0)},onMouseLeave:()=>{G.current=setTimeout(()=>O(!1),200)},children:[(0,a.jsxs)("div",{className:"flex items-center flex-shrink-0 min-h-[48px]\n ".concat(V?"px-3 pt-3.5 pb-2.5 justify-between":"px-0 pt-3.5 pb-[18px] justify-center"),children:[(0,a.jsxs)("div",{className:"flex items-center ".concat(V?"gap-2.5":"gap-0"),children:[(0,a.jsx)("div",{className:"rounded-sm flex items-center justify-center flex-shrink-0 overflow-hidden relative\n transition-all duration-400\n ".concat(V?"w-[26px] h-[26px]":"w-7 h-7","\n ").concat($?"bg-gradient-to-br from-emerald-800 to-emerald-500 shadow-[0_0_10px_rgba(16,185,129,0.3),0_0_20px_rgba(16,185,129,0.1)] border border-emerald-500/35 animate-breathe":"bg-gradient-to-br from-indigo-800 to-indigo-400 shadow-[0_0_8px_rgba(99,102,241,0.15),inset_0_0_6px_rgba(99,102,241,0.06)] border border-indigo-500/12"),children:(0,a.jsxs)("svg",{width:V?26:28,height:V?26:28,viewBox:"0 0 32 32",className:"block",children:[(0,a.jsxs)("defs",{children:[(0,a.jsxs)("linearGradient",{id:"kc1",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:$?"#d1fae5":"#e0e7ff"}),(0,a.jsx)("stop",{offset:"100%",stopColor:$?"#a7f3d0":"#c7d2fe"})]}),(0,a.jsxs)("linearGradient",{id:"kc2",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:$?"#f0fdf4":"#f5f3ff"}),(0,a.jsx)("stop",{offset:"100%",stopColor:$?"#d1fae5":"#e0e7ff"})]}),(0,a.jsxs)("filter",{id:"kglow",children:[(0,a.jsx)("feGaussianBlur",{stdDeviation:"1.5",result:"b"}),(0,a.jsxs)("feMerge",{children:[(0,a.jsx)("feMergeNode",{in:"b"}),(0,a.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})]}),(0,a.jsxs)("g",{filter:"url(#kglow)",children:[(0,a.jsx)("rect",{x:"7",y:"10",width:"4.5",height:"12",fill:"url(#kc1)",rx:"1.5"}),(0,a.jsx)("rect",{x:"13.75",y:"7.5",width:"4.5",height:"17",fill:"url(#kc2)",rx:"1.5"}),(0,a.jsx)("rect",{x:"20.5",y:"11",width:"4.5",height:"10",fill:"url(#kc1)",rx:"1.5"})]})]})}),V&&(0,a.jsx)("span",{className:"text-[17px] font-light tracking-[0.15em] uppercase text-gradient opacity-90",children:"KANBAII"})]}),V&&(0,a.jsx)("button",{className:"w-[26px] h-[26px] flex items-center justify-center rounded-md transition-all duration-200\n ".concat(q?"text-accent bg-accent-muted":"text-text-muted bg-transparent opacity-50 hover:opacity-100 hover:bg-surface hover:text-text"),onClick:()=>U(!q),title:q?"Unpin sidebar":"Pin sidebar",children:(0,a.jsx)(c,{size:13,fill:q?"currentColor":"none",className:"transition-transform duration-300 ".concat(q?"rotate-0":"-rotate-45")})})]}),(0,a.jsx)("div",{className:"h-px flex-shrink-0 opacity-50 ".concat(V?"mx-3 my-[2px_12px_6px]":"mx-2.5 my-[2px_10px_6px]"),style:{background:"linear-gradient(90deg, transparent 10%, var(--border-glow) 50%, transparent 90%)",margin:V?"2px 12px 6px":"2px 10px 6px"}}),(0,a.jsx)("div",{className:"flex-shrink-0 px-2 py-1",children:(0,a.jsxs)("button",{className:"w-full rounded-sm border border-dashed border-border-light bg-transparent text-text-muted text-xs font-medium\n flex items-center gap-2 cursor-pointer transition-all duration-200 ease-out-expo\n hover:bg-accent-muted hover:border-accent/25 hover:text-accent\n ".concat(V?"py-2 px-2.5 justify-start":"py-2 px-0 justify-center"),onClick:()=>T(!0),children:[(0,a.jsx)(d.Z,{size:14}),V&&"New Project"]})}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto overflow-x-hidden px-2 py-1 pb-4",children:0===e.length?(0,a.jsx)("div",{className:"text-center text-text-muted text-body py-8 px-3 transition-opacity duration-150 ".concat(V?"opacity-100":"opacity-0"),children:"No projects yet"}):e.map(e=>{let t=l===e.slug,s=k.projectSlug===e.slug&&("running"===k.status||"paused"===k.status),n=N.active&&N.projectSlug===e.slug,r=X&&g.q.getState().planner.projectSlug===e.slug,o=s||n||r,i=function(e){let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:{r:99,g:102,b:241}}(e.color);return(0,a.jsxs)("div",{className:"relative mb-0.5 group",children:[(0,a.jsxs)("button",{className:"w-full rounded-sm text-left flex items-center transition-all duration-200 cursor-pointer\n ".concat(V?"py-3 px-3.5 justify-start gap-3":"py-2.5 px-0 justify-center gap-0","\n ").concat(t?"bg-surface border border-border":"bg-transparent border border-transparent hover:bg-surface"),onClick:()=>Q(e),children:[(0,a.jsx)("div",{className:"rounded-full flex-shrink-0 transition-all duration-400\n ".concat(V?"w-2.5 h-2.5":"w-3 h-3","\n ").concat(o?"!bg-emerald-500 animate-dot-pulse":""),style:{"--dot-r":i.r,"--dot-g":i.g,"--dot-b":i.b,...o?{}:{background:e.color,boxShadow:t?"0 0 8px ".concat(e.color,"50"):"none"}}}),V&&(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"text-sm font-medium whitespace-nowrap overflow-hidden text-ellipsis tracking-tight\n ".concat(t?"text-text":"text-text-secondary"),children:e.title}),e.workingDir?(0,a.jsxs)("div",{className:"text-label flex items-center gap-1 mt-0.5 whitespace-nowrap overflow-hidden text-ellipsis text-text-muted",children:[(0,a.jsx)(x,{size:10}),e.workingDir.split(/[/\\]/).slice(-2).join("/")]}):(0,a.jsxs)("button",{className:"text-label flex items-center gap-1 mt-0.5 text-warning hover:text-accent transition-colors duration-150",onClick:t=>{t.stopPropagation(),A({slug:e.slug,current:""})},title:"Click to set project folder",children:[(0,a.jsx)(x,{size:10})," Set folder"]})]})]}),V&&(0,a.jsx)("div",{className:"absolute right-2 top-1/2 -translate-y-1/2",children:(0,a.jsx)("button",{className:"w-[22px] h-[22px] flex items-center justify-center rounded-sm text-text-muted bg-transparent transition-all duration-150 opacity-0 group-hover:opacity-100 hover:bg-surface hover:text-text-secondary",onClick:t=>{t.stopPropagation(),F(L===e.slug?null:e.slug),D(null)},children:(0,a.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:[(0,a.jsx)("circle",{cx:"12",cy:"5",r:"2"}),(0,a.jsx)("circle",{cx:"12",cy:"12",r:"2"}),(0,a.jsx)("circle",{cx:"12",cy:"19",r:"2"})]})})}),L===e.slug&&V&&(0,a.jsxs)("div",{className:"absolute right-1 top-full mt-0.5 min-w-[160px] bg-glass backdrop-blur-[12px] backdrop-saturate-[160%] border border-glass-border rounded-md shadow-elevated z-[100] py-1 overflow-hidden animate-filter-in",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("button",{className:"w-full py-2 px-3 flex items-center gap-2 bg-transparent text-text-secondary text-xs text-left transition-colors duration-100 hover:bg-surface-hover",onClick:t=>{t.stopPropagation(),F(null),A({slug:e.slug,current:e.workingDir||""})},children:[(0,a.jsx)(x,{size:14})," ",e.workingDir?"Change Folder":"Set Folder"]}),e.workingDir&&(0,a.jsxs)("button",{className:"w-full py-2 px-3 flex items-center gap-2 bg-transparent text-text-secondary text-xs text-left transition-colors duration-100 hover:bg-surface-hover",onClick:t=>{t.stopPropagation(),F(null),fetch("".concat(W,"/api/system/open-folder"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e.workingDir})}).catch(()=>w("Failed to open folder","error"))},children:[(0,a.jsx)(x,{size:14})," Open Folder"]}),(0,a.jsxs)("button",{className:"w-full py-2 px-3 flex items-center gap-2 bg-transparent text-text-secondary text-xs text-left transition-colors duration-100 hover:bg-surface-hover",onClick:t=>Y(t,e),children:[(0,a.jsx)(u,{size:14})," Archive"]}),(0,a.jsxs)("button",{className:"w-full py-2 px-3 flex items-center gap-2 text-xs text-left transition-colors duration-100\n ".concat(R===e.slug?"text-danger bg-danger-dim":"text-danger bg-transparent hover:bg-danger-dim"),onClick:t=>{t.stopPropagation(),R===e.slug?(F(null),ee(t,e)):(D(e.slug),setTimeout(()=>D(null),3e3))},children:[(0,a.jsx)(p.Z,{size:14})," ",R===e.slug?"Confirm Delete?":"Move to Trash"]})]})]},e.id)})}),(0,a.jsx)("div",{className:"border-t border-[rgba(148,163,242,0.03)] flex-shrink-0",children:(0,a.jsx)(K,{isExpanded:V})}),(0,a.jsxs)("div",{className:"border-t border-[rgba(148,163,242,0.03)] flex-shrink-0 flex items-center\n ".concat(V?"px-3 py-2.5 flex-row gap-1 justify-center":"px-0 py-3 flex-col gap-3 justify-center"),children:[(0,a.jsx)("button",{className:"inline-flex items-center justify-center w-7 h-7 rounded-sm text-text-muted transition-all duration-150 hover:text-accent hover:bg-accent-muted",onClick:()=>_(!0),title:"Costs & Analytics",children:(0,a.jsx)(m,{size:14})}),(0,a.jsx)("button",{className:"inline-flex items-center justify-center w-7 h-7 rounded-sm text-text-muted transition-all duration-150 hover:text-text-secondary hover:bg-surface-hover",onClick:()=>P(!0),title:"Settings",children:(0,a.jsx)(h.Z,{size:14})}),(0,a.jsx)(y,{}),V&&(0,a.jsx)("span",{className:"text-data text-text-muted opacity-30 font-mono ml-auto",children:"H"})]})]}),S&&(0,a.jsx)(C,{onClose:()=>T(!1)}),I&&(0,a.jsx)(H,{currentPath:I.current,onSave:async e=>{try{await o(I.slug,{workingDir:e}),w("Folder linked","success")}catch(e){w("Failed to set folder","error")}A(null)},onClose:()=>A(null)}),z&&(0,a.jsx)(E,{onClose:()=>P(!1)}),M&&(0,a.jsx)("div",{className:"fixed inset-0 z-[200] bg-overlay backdrop-blur-[16px] backdrop-saturate-[180%] flex items-center justify-center animate-overlay-in",onClick:()=>_(!1),children:(0,a.jsxs)("div",{className:"bg-modal border border-glass-border rounded-lg shadow-modal max-w-[800px] w-[95%] max-h-[85vh] overflow-hidden animate-spring-pop",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border",children:[(0,a.jsxs)("span",{className:"text-h2 font-semibold flex items-center gap-2",children:[(0,a.jsx)(m,{size:16})," Costs & Analytics"]}),(0,a.jsx)("button",{className:"btn-icon",onClick:()=>_(!1),children:(0,a.jsx)("span",{className:"text-text-muted",children:"\xd7"})})]}),(0,a.jsx)("div",{className:"overflow-y-auto max-h-[calc(85vh-52px)]",children:(0,a.jsx)(Z,{projectSlug:l||void 0})})]})})]})}function H(e){let{currentPath:t,onSave:s,onClose:r}=e,[o,l]=(0,n.useState)(t),i=(0,n.useRef)(null);return(0,n.useEffect)(()=>{var e,t;null===(e=i.current)||void 0===e||e.focus(),null===(t=i.current)||void 0===t||t.select()},[]),(0,a.jsx)("div",{className:"fixed inset-0 z-[200] bg-overlay backdrop-blur-[16px] backdrop-saturate-[180%] flex items-center justify-center animate-overlay-in",onClick:r,children:(0,a.jsxs)("div",{className:"bg-modal border border-glass-border rounded-lg shadow-modal max-w-[440px] w-[92%] animate-spring-pop relative overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("div",{className:"absolute top-0 left-[15%] right-[15%] h-px pointer-events-none",style:{background:"linear-gradient(90deg, transparent, rgba(129, 140, 248, 0.2), transparent)"}}),(0,a.jsxs)("div",{className:"px-6 pt-5 pb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)(x,{size:16,className:"text-accent"}),(0,a.jsx)("span",{className:"text-h2 font-semibold tracking-tight",children:t?"Change Folder":"Link Project Folder"})]}),(0,a.jsx)("p",{className:"text-label text-text-muted leading-relaxed",children:"Set the local directory where this project's code lives. Ralph and the terminal will use this path."})]}),(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),o.trim()&&s(o.trim())},className:"px-6 pb-5 flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)("label",{className:"text-data font-semibold text-text-muted uppercase tracking-widest font-mono",children:"Folder Path"}),(0,a.jsx)("input",{ref:i,value:o,onChange:e=>l(e.target.value),placeholder:"C:\\Users\\marti\\projects\\my-app",className:"w-full font-mono text-xs",spellCheck:!1})]}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)("button",{type:"button",className:"btn-ghost",onClick:r,children:"Cancel"}),(0,a.jsxs)("button",{type:"submit",className:"btn-primary",disabled:!o.trim(),children:[(0,a.jsx)(x,{size:12})," ",t?"Update":"Link Folder"]})]})]})]})})}var V=s(401);let J=(0,i.Z)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),X=(0,i.Z)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),$={success:{accent:"border-l-success",iconColor:"text-success",icon:(0,a.jsx)(V.Z,{size:14})},error:{accent:"border-l-danger",iconColor:"text-danger",icon:(0,a.jsx)(J,{size:14})},info:{accent:"border-l-accent",iconColor:"text-accent",icon:(0,a.jsx)(X,{size:14})}};function Q(){let{toasts:e,removeToast:t}=(0,v.E)();return 0===e.length?null:(0,a.jsx)("div",{className:"fixed bottom-4 right-4 flex flex-col gap-1.5 z-[400] pointer-events-none",children:e.map((s,n)=>{let r=$[s.type]||$.info,o=n<e.length-1;return(0,a.jsxs)("div",{className:"bg-glass backdrop-blur-[16px] backdrop-saturate-[160%] border border-glass-border rounded-md\n px-3.5 py-2.5 text-xs font-medium text-text shadow-elevated\n flex items-center gap-2.5 animate-toast-in pointer-events-auto min-w-[220px]\n relative overflow-hidden border-l-2 ".concat(r.accent,"\n transition-all duration-200 ease-out-expo\n ").concat(o?"scale-[0.97] opacity-80":""),children:[(0,a.jsx)("div",{className:"absolute top-0 left-[15%] right-[15%] h-px bg-gradient-to-r from-transparent via-white/[0.04] to-transparent pointer-events-none"}),(0,a.jsx)("span",{className:"flex flex-shrink-0 ".concat(r.iconColor),children:r.icon}),(0,a.jsx)("span",{className:"flex-1",children:s.message}),(0,a.jsx)("button",{className:"text-text-muted p-0.5 flex rounded-xs transition-all duration-120 ease-out-expo hover:text-text hover:bg-surface-hover",onClick:()=>t(s.id),children:(0,a.jsx)(k.Z,{size:12})})]},s.id)})})}let Y=[{title:"Navigation",shortcuts:[{keys:["↑","↓"],desc:"Previous / next project"},{keys:["B"],desc:"Board view"},{keys:["C"],desc:"Console / Terminal"},{keys:["R"],desc:"Ralph / Agents"},{keys:["S"],desc:"Soul"}]},{title:"Actions",shortcuts:[{keys:["N"],desc:"New task"},{keys:["Ctrl","F"],desc:"Toggle filter bar"}]},{title:"General",shortcuts:[{keys:["H"],desc:"Show this help"},{keys:["Esc"],desc:"Close modal / go back"}]}];function ee(e){let{onClose:t}=e,{overlayProps:s}=(0,N.N)(t);return(0,a.jsx)("div",{className:"glass-overlay",...s,children:(0,a.jsxs)("div",{className:"modal-box w-[400px] max-w-[90%] p-7",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,a.jsx)("span",{className:"text-h2 font-semibold tracking-tight",children:"Keyboard Shortcuts"}),(0,a.jsx)("button",{className:"btn-icon",onClick:t,children:(0,a.jsx)(k.Z,{size:16})})]}),(0,a.jsx)("div",{className:"flex flex-col gap-[22px]",children:Y.map(e=>(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)("div",{className:"text-xxs font-semibold text-text-muted uppercase tracking-widest font-mono mb-1",children:e.title}),e.shortcuts.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between py-1",children:[(0,a.jsx)("div",{className:"flex items-center gap-[3px]",children:e.keys.map((t,s)=>(0,a.jsxs)("span",{children:[(0,a.jsx)("kbd",{className:"inline-flex items-center justify-center min-w-[24px] h-6 px-[7px] bg-[rgba(148,163,242,0.04)] border border-[rgba(148,163,242,0.08)] border-b-2 border-b-[rgba(148,163,242,0.1)] rounded-[5px] text-[10px] font-semibold text-text font-mono",children:t}),s<e.keys.length-1&&(0,a.jsx)("span",{className:"text-xxs text-text-muted opacity-50",children:"+"})]},s))}),(0,a.jsx)("span",{className:"text-xs text-text-secondary",children:e.desc})]},e.desc))]},e.title))})]})})}let et=(0,i.Z)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),es=(0,i.Z)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]),ea=(0,i.Z)("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);var en=s(3468),er=s(2222),eo=s(221),el=s(5805),ei=s(2208),ec=s(3247),ed=s(15);function ex(e){let{onClose:t,onShowCreateProject:s,onShowCreateWorkItem:r,onShowHelp:o}=e,[i,c]=(0,n.useState)(""),[u,p]=(0,n.useState)(0),m=(0,n.useRef)(null),h=(0,n.useRef)(null),g=(0,f.i)(e=>e.projects),v=(0,ed.o)(e=>e.workItems),{goToProject:j,goToWorkItem:y,setView:k,projectSlug:N,workItemSlug:w}=(0,b.U)(),{theme:C,toggleTheme:S}=l(),T=(0,n.useMemo)(()=>{let e=[];return e.push({id:"create-project",label:"Create Project",section:"Actions",icon:(0,a.jsx)(d.Z,{size:14}),action:()=>{t(),null==s||s()}}),N&&e.push({id:"create-wi",label:"Create Work Item",section:"Actions",icon:(0,a.jsx)(d.Z,{size:14}),action:()=>{t(),null==r||r()}}),e.push({id:"toggle-theme",label:"Switch to ".concat("dark"===C?"Light":"Dark"," mode"),section:"Actions",icon:"dark"===C?(0,a.jsx)(et,{size:14}):(0,a.jsx)(es,{size:14}),action:()=>{S(),t()}}),e.push({id:"keyboard-shortcuts",label:"Keyboard Shortcuts",section:"Actions",icon:(0,a.jsx)(ea,{size:14}),shortcut:"H",action:()=>{t(),null==o||o()}}),N&&(w?[{key:"board",label:"Go to Board",icon:(0,a.jsx)(en.Z,{size:14}),shortcut:"B"},{key:"ralph",label:"Go to Ralph",icon:(0,a.jsx)(er.Z,{size:14}),shortcut:"R"}]:[{key:"work-items",label:"Go to Work Items",icon:(0,a.jsx)(en.Z,{size:14}),shortcut:"W"},{key:"console",label:"Go to Console",icon:(0,a.jsx)(eo.Z,{size:14}),shortcut:"C"},{key:"teams",label:"Go to Teams",icon:(0,a.jsx)(el.Z,{size:14}),shortcut:"T"},{key:"soul",label:"Go to Soul",icon:(0,a.jsx)(ei.Z,{size:14}),shortcut:"S"}]).forEach(s=>{e.push({id:"nav-".concat(s.key),label:s.label,section:"Navigation",icon:s.icon,shortcut:s.shortcut,action:()=>{k(s.key),t()}})}),g.forEach(s=>{e.push({id:"project-".concat(s.slug),label:s.title,section:"Projects",icon:(0,a.jsx)(x,{size:14}),action:()=>{j(s.slug),t()}})}),N&&v.forEach(s=>{e.push({id:"wi-".concat(s.slug),label:s.title,section:"Work Items",icon:(0,a.jsx)(_.Z,{size:14}),action:()=>{y(N,s.slug),t()}})}),e},[g,v,N,C,t,s,r,o,j,y,k,S]),E=(0,n.useMemo)(()=>{if(!i.trim())return T;let e=i.toLowerCase();return T.filter(t=>t.label.toLowerCase().includes(e)||t.section.toLowerCase().includes(e))},[T,i]);(0,n.useEffect)(()=>{p(0)},[E.length]),(0,n.useEffect)(()=>{var e;null===(e=m.current)||void 0===e||e.focus()},[]);let z=(0,n.useCallback)(e=>{"ArrowDown"===e.key?(e.preventDefault(),p(e=>Math.min(e+1,E.length-1))):"ArrowUp"===e.key?(e.preventDefault(),p(e=>Math.max(e-1,0))):"Enter"===e.key&&E[u]?(e.preventDefault(),E[u].action()):"Escape"===e.key&&t()},[E,u,t]);(0,n.useEffect)(()=>{var e;let t=null===(e=h.current)||void 0===e?void 0:e.querySelector('[data-selected="true"]');null==t||t.scrollIntoView({block:"nearest"})},[u]);let P=(0,n.useMemo)(()=>{let e=new Map;return E.forEach(t=>{let s=e.get(t.section)||[];s.push(t),e.set(t.section,s)}),e},[E]),M=-1;return(0,a.jsx)("div",{className:"fixed inset-0 z-[500] flex items-start justify-center pt-[20vh] animate-overlay-in",style:{background:"rgba(0,0,0,0.5)",backdropFilter:"blur(8px)"},onClick:t,children:(0,a.jsxs)("div",{className:"w-full max-w-[520px] bg-modal rounded-xl overflow-hidden shadow-modal animate-spring-pop border border-glass-border relative",onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("div",{className:"absolute top-0 left-[15%] right-[15%] h-px bg-gradient-to-r from-transparent via-[rgba(129,140,248,0.2)] to-transparent pointer-events-none z-10"}),(0,a.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border",children:[(0,a.jsx)(ec.Z,{size:16,className:"text-text-muted flex-shrink-0"}),(0,a.jsx)("input",{ref:m,type:"text",value:i,onChange:e=>c(e.target.value),onKeyDown:z,placeholder:"Type a command or search...",className:"flex-1 bg-transparent border-none outline-none text-body text-text placeholder:text-text-muted p-0 shadow-none"}),(0,a.jsx)("kbd",{className:"text-data font-mono text-text-muted bg-surface px-1.5 py-0.5 rounded border border-border",children:"ESC"})]}),(0,a.jsx)("div",{ref:h,className:"max-h-[320px] overflow-y-auto py-1",children:0===E.length?(0,a.jsx)("div",{className:"px-4 py-8 text-center text-text-muted text-xs",children:"No results found"}):Array.from(P.entries()).map(e=>{let[t,s]=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"px-4 pt-2 pb-1 text-xxs font-semibold text-text-muted uppercase tracking-[0.08em]",children:t}),s.map(e=>{let t=++M===u,s=M;return(0,a.jsxs)("button",{"data-selected":t,className:"w-full flex items-center gap-3 px-4 py-2 text-xs text-left transition-colors duration-75\n ".concat(t?"bg-accent-muted text-text":"text-text-secondary hover:bg-surface-hover hover:text-text"),onClick:e.action,onMouseEnter:()=>p(s),children:[(0,a.jsx)("span",{className:"flex-shrink-0 ".concat(t?"text-accent":"text-text-muted"),children:e.icon}),(0,a.jsx)("span",{className:"flex-1 truncate",children:e.label}),e.shortcut&&(0,a.jsx)("kbd",{className:"text-data font-mono text-text-muted bg-surface px-1.5 py-0.5 rounded border border-border",children:e.shortcut})]},e.id)})]},t)})})]})})}var eu=s(4822);let ep=(0,i.Z)("skip-forward",[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]]);var em=s(1094),eh=s(4743);let ef=s(257).env.NEXT_PUBLIC_API_URL||"http://localhost:5555";function eb(){let e=(0,g.q)(e=>e.escalation),t=(0,v.E)(e=>e.addToast),[s,r]=(0,n.useState)(""),[o,l]=(0,n.useState)(!1),i=(0,n.useRef)(null);if((0,n.useEffect)(()=>{e&&(r(""),setTimeout(()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.focus()},100),"undefined"!=typeof Notification&&("granted"===Notification.permission?new Notification("KANBAII — ".concat("ralph"===e.source?"Ralph":"Teams"," needs input"),{body:e.question.slice(0,120),icon:"/favicon.svg"}):"denied"!==Notification.permission&&Notification.requestPermission()))},[e]),!e||"planner"===e.source)return null;let c=async a=>{let n=a||s.trim();if(n&&!o){l(!0);try{await fetch("".concat(ef,"/api/escalation/respond"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id,response:n})}),t("Response sent to Claude","success")}catch(e){t("Failed to send response","error")}l(!1)}},d="ralph"===e.source,x=d?eu.Z:el.Z,u=d?"Ralph":"Teams",p=function(e){try{let t=JSON.parse(e);if(t.questions&&Array.isArray(t.questions)&&t.questions.length>0){let s=t.questions[0];return{question:s.question||s.header||e,options:(s.options||[]).map(e=>({label:"string"==typeof e?e:e.label||e.text||"",description:e.description}))}}if(t.question)return{question:t.question,options:(t.options||[]).map(e=>({label:"string"==typeof e?e:e.label||""}))}}catch(e){}return{question:e,options:[]}}(e.question),m=p.question,h=p.options.length>0?p.options:e.options;return(0,a.jsx)("div",{className:"fixed inset-0 z-[300] flex items-center justify-center animate-overlay-in",style:{background:"rgba(3, 3, 8, 0.85)",backdropFilter:"blur(20px) saturate(180%)"},children:(0,a.jsxs)("div",{className:"max-w-[520px] w-[94%] animate-spring-pop relative",children:[(0,a.jsx)("div",{className:"absolute -inset-px rounded-lg animate-breathe",style:{background:d?"linear-gradient(135deg, rgba(99,102,241,0.3), rgba(129,140,248,0.1), rgba(99,102,241,0.3))":"linear-gradient(135deg, rgba(16,185,129,0.3), rgba(52,211,153,0.1), rgba(16,185,129,0.3))"}}),(0,a.jsxs)("div",{className:"relative bg-modal border border-glass-border rounded-lg shadow-modal overflow-hidden",children:[(0,a.jsx)("div",{className:"absolute top-0 left-[10%] right-[10%] h-px pointer-events-none",style:{background:d?"linear-gradient(90deg, transparent, rgba(99,102,241,0.4), transparent)":"linear-gradient(90deg, transparent, rgba(52,211,153,0.4), transparent)"}}),(0,a.jsxs)("div",{className:"flex items-center gap-3 px-6 pt-5 pb-3",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-full flex items-center justify-center animate-breathe\n ".concat(d?"bg-accent-muted border border-accent/20":"bg-success-dim border border-success/20"),children:(0,a.jsx)(x,{size:16,className:d?"text-accent":"text-success"})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"text-sm font-semibold text-text tracking-tight",children:[u," needs your input"]}),e.taskTitle&&(0,a.jsxs)("div",{className:"text-xxs text-text-muted font-mono mt-0.5",children:["Task: ",e.taskTitle]})]})]}),(0,a.jsx)("div",{className:"mx-6 mb-4 p-3 bg-bg border border-border rounded-md shadow-inset",children:(0,a.jsx)("div",{className:"text-sm text-text leading-relaxed",children:m})}),h.length>0&&(0,a.jsx)("div",{className:"mx-6 mb-3 flex flex-col gap-1.5",children:h.map((e,t)=>(0,a.jsxs)("button",{className:"flex flex-col gap-0.5 px-3 py-2.5 text-left rounded-sm border border-border transition-all duration-150 hover:border-accent hover:bg-accent-muted group",onClick:()=>c("string"==typeof e?e:e.label),disabled:o,children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text group-hover:text-accent transition-colors",children:"string"==typeof e?e:e.label}),"string"!=typeof e&&e.description&&(0,a.jsx)("span",{className:"text-xxs text-text-muted leading-snug",children:e.description})]},t))}),(0,a.jsxs)("div",{className:"px-6 pb-5",children:[(0,a.jsx)("textarea",{ref:i,value:s,onChange:e=>r(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),c())},placeholder:"Type your response... (Enter to send)",rows:2,className:"w-full resize-none text-xs",disabled:o}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-3",children:[(0,a.jsxs)("button",{className:"inline-flex items-center gap-1.5 text-xxs text-text-muted font-mono px-3 py-1.5 rounded-sm border border-border transition-all duration-150 hover:text-text-secondary hover:bg-surface-hover",onClick:()=>c("yes"),disabled:o,children:[(0,a.jsx)(ep,{size:11})," Skip (yes)"]}),(0,a.jsxs)("button",{className:"inline-flex items-center gap-1.5 text-xxs text-danger font-mono px-3 py-1.5 rounded-sm border border-danger/20 transition-all duration-150 hover:bg-danger-dim",onClick:async()=>{await fetch(d?"".concat(ef,"/api/ralph/stop"):"".concat(ef,"/api/teams/stop"),{method:"POST"}),c("STOP"),t("".concat(u," stopped"),"info")},disabled:o,children:[(0,a.jsx)(em.Z,{size:11})," Stop ",u]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)("button",{className:"inline-flex items-center gap-1.5 px-4 py-1.5 text-white text-xs font-semibold rounded-sm\n bg-gradient-to-br ".concat(d?"from-indigo-600 to-indigo-400":"from-emerald-600 to-emerald-400","\n relative overflow-hidden\n before:absolute before:inset-0 before:bg-gradient-to-b before:from-white/15 before:to-transparent before:pointer-events-none\n transition-all duration-150 hover:shadow-glow-accent hover:-translate-y-px disabled:opacity-40"),onClick:()=>c(),disabled:!s.trim()||o,children:[o?(0,a.jsx)("span",{className:"inline-block w-3 h-3 border-2 border-white/20 border-t-white rounded-full animate-spin"}):(0,a.jsx)(eh.Z,{size:12}),"Send"]})]})]})]})]})})}function eg(e){let{children:t}=e;!function(){let e=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(e.current)return;e.current=!0;let t=(0,F.h)(),s=g.q.getState,a=f.i.getState,n=ed.o.getState;return t.on("project:updated",e=>{let{project:t}=e;return a().onProjectUpdated(t)}),t.on("project:deleted",e=>{let{slug:t}=e;return a().onProjectDeleted(t)}),t.on("workItem:updated",e=>{let{projectSlug:t,workItem:s}=e;return n().onWorkItemUpdated(t,s)}),t.on("workItem:deleted",e=>{let{projectSlug:t,workItemId:s}=e;return n().onWorkItemDeleted(t,s)}),t.on("ralph:started",e=>s().onRalphStarted(e)),t.on("ralph:progress",e=>s().onRalphProgress(e)),t.on("ralph:output",e=>s().onRalphOutput(e)),t.on("ralph:completed",e=>s().onRalphCompleted(e)),t.on("ralph:error",e=>s().onRalphError(e)),t.on("ralph:input-needed",e=>s().onRalphInputNeeded(e)),t.on("live:started",e=>s().onTeamsStarted(e)),t.on("live:worker-assigned",e=>s().onTeamsWorkerAssigned(e)),t.on("live:worker-completed",e=>s().onTeamsWorkerCompleted(e)),t.on("live:metrics",e=>s().onTeamsMetrics(e)),t.on("live:output",e=>s().onTeamsOutput(e)),t.on("live:stopped",e=>s().onTeamsStopped(e)),t.on("teams:input-needed",e=>s().onTeamsInputNeeded(e)),t.on("coordinator:thinking",e=>s().onCoordinatorThinking(e)),t.on("coordinator:tool_call",e=>s().onCoordinatorToolCall(e)),t.on("coordinator:completed",e=>s().onCoordinatorCompleted(e)),t.on("escalation:created",e=>{if("planner"===e.source){s().onPlannerEscalation({id:e.id,source:"planner",taskId:e.taskId||"planner",taskTitle:e.taskTitle||"AI Planner",question:e.question,options:e.options||[],timeoutMs:e.timeoutMs||18e5});return}s().onEscalationCreated(e)}),t.on("escalation:responded",e=>{s().planner.escalation?s().onPlannerEscalationResponded((null==e?void 0:e.response)||"responded"):s().onEscalationResponded()}),t.on("escalation:timeout",()=>{s().planner.escalation?s().onPlannerEscalationResponded("(timed out)"):s().onEscalationTimeout()}),t.on("planner:started",e=>s().onPlannerStarted(e)),t.on("planner:message",e=>s().onPlannerMessage(e)),t.on("planner:item-discovered",e=>s().onPlannerItemDiscovered(e)),t.on("planner:item-updated",e=>s().onPlannerItemUpdated(e)),t.on("planner:escalation",e=>s().onPlannerEscalation(e)),t.on("planner:item-approved",e=>s().onPlannerItemApproved(e)),t.on("planner:stopped",()=>s().onPlannerStopped()),t.on("terminal:output",e=>{let t=b.U.getState().projectSlug;e.projectSlug&&e.projectSlug!==t||(s().appendTerminalOutput(e.text),s().setTerminalStatus("running"))}),t.on("terminal:closed",e=>{let t=b.U.getState().projectSlug;null!=e&&e.projectSlug&&e.projectSlug!==t||s().setTerminalStatus("idle")}),t.on("terminal:error",e=>{let t=b.U.getState().projectSlug;null!=e&&e.projectSlug&&e.projectSlug!==t||(s().appendTerminalOutput("ERROR: ".concat(e.message)),s().setTerminalStatus("error"))}),s().rehydrate(),t.on("connect",()=>s().rehydrate()),()=>{(0,F.l)(),e.current=!1}},[])}();let[s,r]=(0,n.useState)(!1),[o,l]=(0,n.useState)(!1),i=(0,n.useCallback)(()=>r(e=>!e),[]),c=(0,n.useCallback)(()=>r(!1),[]),d=(0,n.useCallback)(()=>l(e=>!e),[]),x=(0,n.useCallback)(()=>l(!1),[]);return!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{projectSlug:t,workItemSlug:s,setView:a,goToProject:r}=(0,b.U)(),o=(0,f.i)(e=>e.projects);(0,n.useEffect)(()=>{let n=n=>{var l,i,c,d,x;let u=n.target.tagName;if("INPUT"!==u&&"TEXTAREA"!==u&&"SELECT"!==u&&!n.target.isContentEditable){if((n.ctrlKey||n.metaKey)&&"k"===n.key){n.preventDefault(),null===(l=e.onToggleCommandPalette)||void 0===l||l.call(e);return}if((n.ctrlKey||n.metaKey)&&"f"===n.key){n.preventDefault(),null===(i=e.onToggleFilter)||void 0===i||i.call(e);return}if(!n.ctrlKey&&!n.metaKey&&!n.altKey)switch(n.key.toLowerCase()){case"w":t&&!s&&a("work-items");break;case"c":t&&!s&&a("console");break;case"t":t&&!s&&a("teams");break;case"s":t&&!s&&a("soul");break;case"b":s&&a("board");break;case"r":s&&a("ralph");break;case"n":null===(c=e.onNewTask)||void 0===c||c.call(e);break;case"h":null===(d=e.onToggleHelp)||void 0===d||d.call(e);break;case"escape":null===(x=e.onEscape)||void 0===x||x.call(e);break;case"arrowup":{n.preventDefault();let e=o.findIndex(e=>e.slug===t);e>0&&r(o[e-1].slug);break}case"arrowdown":{n.preventDefault();let e=o.findIndex(e=>e.slug===t);e<o.length-1&&r(o[e+1].slug)}}}};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t,s,o,a,r,e])}({onToggleHelp:i,onToggleCommandPalette:d,onEscape:()=>{o?x():c()}}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex h-screen w-screen overflow-hidden",children:[(0,a.jsx)(G,{}),(0,a.jsx)("div",{className:"w-px flex-shrink-0 bg-gradient-to-b from-transparent via-border-glow to-transparent"}),(0,a.jsx)("main",{className:"flex-1 overflow-hidden flex flex-col surface-gradient",children:t})]}),(0,a.jsx)(Q,{}),(0,a.jsx)(eb,{}),s&&(0,a.jsx)(ee,{onClose:c}),o&&(0,a.jsx)(ex,{onClose:x,onShowHelp:()=>{x(),i()}})]})}function ev(e){let{children:t}=e;return(0,a.jsx)(o,{children:(0,a.jsx)(eg,{children:t})})}},7960:function(){}},function(e){e.O(0,[587,947,23,971,117,744],function(){return e(e.s=9889)}),_N_E=e.O()}]);
|