@lovelybunch/api 1.0.71 → 1.0.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/auth/auth-manager.d.ts.map +1 -0
- package/dist/lib/auth/auth-manager.js.map +1 -0
- package/dist/lib/gait-path.d.ts.map +1 -0
- package/dist/lib/gait-path.js.map +1 -0
- package/dist/lib/git-settings.d.ts.map +1 -0
- package/dist/lib/git-settings.js.map +1 -0
- package/dist/lib/git.d.ts.map +1 -0
- package/dist/lib/git.js.map +1 -0
- package/dist/lib/jobs/global-job-scheduler.d.ts.map +1 -0
- package/dist/lib/jobs/global-job-scheduler.js.map +1 -0
- package/dist/lib/jobs/job-runner.d.ts.map +1 -0
- package/dist/lib/jobs/job-runner.js.map +1 -0
- package/dist/lib/jobs/job-scheduler.d.ts.map +1 -0
- package/dist/lib/jobs/job-scheduler.js.map +1 -0
- package/dist/lib/jobs/job-store.d.ts.map +1 -0
- package/dist/lib/jobs/job-store.js.map +1 -0
- package/dist/lib/project-paths.d.ts.map +1 -0
- package/dist/lib/project-paths.js.map +1 -0
- package/dist/lib/storage/file-storage.d.ts.map +1 -0
- package/dist/lib/storage/file-storage.js.map +1 -0
- package/dist/lib/symlinks/symlink-manager.d.ts.map +1 -0
- package/dist/lib/symlinks/symlink-manager.js.map +1 -0
- package/dist/lib/symlinks/types.d.ts.map +1 -0
- package/dist/lib/symlinks/types.js.map +1 -0
- package/dist/lib/terminal/context-helper.d.ts +1 -1
- package/dist/lib/terminal/context-helper.d.ts.map +1 -0
- package/dist/lib/terminal/context-helper.js +4 -16
- package/dist/lib/terminal/context-helper.js.map +1 -0
- package/dist/lib/terminal/global-manager.d.ts.map +1 -0
- package/dist/lib/terminal/global-manager.js.map +1 -0
- package/dist/lib/terminal/shell-utils.d.ts.map +1 -0
- package/dist/lib/terminal/shell-utils.js.map +1 -0
- package/dist/lib/terminal/terminal-manager.d.ts.map +1 -0
- package/dist/lib/terminal/terminal-manager.js.map +1 -0
- package/dist/lib/user-preferences.d.ts.map +1 -0
- package/dist/lib/user-preferences.js.map +1 -0
- package/dist/middleware/auth.d.ts.map +1 -0
- package/dist/middleware/auth.js.map +1 -0
- package/dist/routes/api/v1/agents/[id]/index.d.ts.map +1 -0
- package/dist/routes/api/v1/agents/[id]/index.js.map +1 -0
- package/dist/routes/api/v1/agents/[id]/route.d.ts.map +1 -0
- package/dist/routes/api/v1/agents/[id]/route.js.map +1 -0
- package/dist/routes/api/v1/agents/index.d.ts.map +1 -0
- package/dist/routes/api/v1/agents/index.js.map +1 -0
- package/dist/routes/api/v1/agents/route.d.ts.map +1 -0
- package/dist/routes/api/v1/agents/route.js.map +1 -0
- package/dist/routes/api/v1/ai/index.d.ts.map +1 -0
- package/dist/routes/api/v1/ai/index.js.map +1 -0
- package/dist/routes/api/v1/ai/route.d.ts.map +1 -0
- package/dist/routes/api/v1/ai/route.js +134 -33
- package/dist/routes/api/v1/ai/route.js.map +1 -0
- package/dist/routes/api/v1/ai/tools.js +157 -34
- package/dist/routes/api/v1/api-keys/index.d.ts.map +1 -0
- package/dist/routes/api/v1/api-keys/index.js.map +1 -0
- package/dist/routes/api/v1/api-keys/route.d.ts.map +1 -0
- package/dist/routes/api/v1/api-keys/route.js.map +1 -0
- package/dist/routes/api/v1/auth/index.d.ts.map +1 -0
- package/dist/routes/api/v1/auth/index.js.map +1 -0
- package/dist/routes/api/v1/auth/route.d.ts.map +1 -0
- package/dist/routes/api/v1/auth/route.js.map +1 -0
- package/dist/routes/api/v1/auth-settings/index.d.ts.map +1 -0
- package/dist/routes/api/v1/auth-settings/index.js.map +1 -0
- package/dist/routes/api/v1/auth-settings/route.d.ts.map +1 -0
- package/dist/routes/api/v1/auth-settings/route.js.map +1 -0
- package/dist/routes/api/v1/chats/[id]/index.d.ts.map +1 -0
- package/dist/routes/api/v1/chats/[id]/index.js.map +1 -0
- package/dist/routes/api/v1/chats/[id]/route.d.ts.map +1 -0
- package/dist/routes/api/v1/chats/[id]/route.js.map +1 -0
- package/dist/routes/api/v1/chats/index.d.ts.map +1 -0
- package/dist/routes/api/v1/chats/index.js.map +1 -0
- package/dist/routes/api/v1/chats/route.d.ts.map +1 -0
- package/dist/routes/api/v1/chats/route.js.map +1 -0
- package/dist/routes/api/v1/config/index.d.ts.map +1 -0
- package/dist/routes/api/v1/config/index.js.map +1 -0
- package/dist/routes/api/v1/config/route.d.ts.map +1 -0
- package/dist/routes/api/v1/config/route.js.map +1 -0
- package/dist/routes/api/v1/context/architecture/route.d.ts.map +1 -0
- package/dist/routes/api/v1/context/architecture/route.js.map +1 -0
- package/dist/routes/api/v1/context/index.d.ts.map +1 -0
- package/dist/routes/api/v1/context/index.js +2 -0
- package/dist/routes/api/v1/context/index.js.map +1 -0
- package/dist/routes/api/v1/context/knowledge/[filename]/index.d.ts.map +1 -0
- package/dist/routes/api/v1/context/knowledge/[filename]/index.js.map +1 -0
- package/dist/routes/api/v1/context/knowledge/[filename]/route.d.ts.map +1 -0
- package/dist/routes/api/v1/context/knowledge/[filename]/route.js.map +1 -0
- package/dist/routes/api/v1/context/knowledge/index.d.ts.map +1 -0
- package/dist/routes/api/v1/context/knowledge/index.js.map +1 -0
- package/dist/routes/api/v1/context/knowledge/route.d.ts.map +1 -0
- package/dist/routes/api/v1/context/knowledge/route.js.map +1 -0
- package/dist/routes/api/v1/context/project/route.d.ts.map +1 -0
- package/dist/routes/api/v1/context/project/route.js.map +1 -0
- package/dist/routes/api/v1/context/role/route.d.ts +3 -0
- package/dist/routes/api/v1/context/role/route.js +198 -0
- package/dist/routes/api/v1/events/status/route.d.ts +1 -1
- package/dist/routes/api/v1/git/index.d.ts.map +1 -0
- package/dist/routes/api/v1/git/index.js.map +1 -0
- package/dist/routes/api/v1/jobs/[id]/route.d.ts.map +1 -0
- package/dist/routes/api/v1/jobs/[id]/route.js.map +1 -0
- package/dist/routes/api/v1/jobs/[id]/run/route.d.ts +2 -2
- package/dist/routes/api/v1/jobs/[id]/run/route.d.ts.map +1 -0
- package/dist/routes/api/v1/jobs/[id]/run/route.js.map +1 -0
- package/dist/routes/api/v1/jobs/[id]/runs/[runId]/route.d.ts +2 -2
- package/dist/routes/api/v1/jobs/index.d.ts.map +1 -0
- package/dist/routes/api/v1/jobs/index.js.map +1 -0
- package/dist/routes/api/v1/jobs/route.d.ts.map +1 -0
- package/dist/routes/api/v1/jobs/route.js.map +1 -0
- package/dist/routes/api/v1/jobs/status/route.d.ts +1 -1
- package/dist/routes/api/v1/jobs/status/route.d.ts.map +1 -0
- package/dist/routes/api/v1/jobs/status/route.js.map +1 -0
- package/dist/routes/api/v1/mcp/index.d.ts.map +1 -0
- package/dist/routes/api/v1/mcp/index.js +116 -3
- package/dist/routes/api/v1/mcp/index.js.map +1 -0
- package/dist/routes/api/v1/mcp/route.d.ts.map +1 -0
- package/dist/routes/api/v1/mcp/route.js.map +1 -0
- package/dist/routes/api/v1/proposals/[id]/route.d.ts +8 -8
- package/dist/routes/api/v1/proposals/[id]/route.d.ts.map +1 -0
- package/dist/routes/api/v1/proposals/[id]/route.js.map +1 -0
- package/dist/routes/api/v1/proposals/index.d.ts.map +1 -0
- package/dist/routes/api/v1/proposals/index.js.map +1 -0
- package/dist/routes/api/v1/proposals/route.d.ts.map +1 -0
- package/dist/routes/api/v1/proposals/route.js.map +1 -0
- package/dist/routes/api/v1/resources/[id]/index.d.ts.map +1 -0
- package/dist/routes/api/v1/resources/[id]/index.js.map +1 -0
- package/dist/routes/api/v1/resources/[id]/route.js.map +1 -0
- package/dist/routes/api/v1/resources/[id]/thumbnail/index.d.ts.map +1 -0
- package/dist/routes/api/v1/resources/[id]/thumbnail/index.js.map +1 -0
- package/dist/routes/api/v1/resources/[id]/thumbnail/route.js.map +1 -0
- package/dist/routes/api/v1/resources/generate/route.js +24 -3
- package/dist/routes/api/v1/resources/index.d.ts.map +1 -0
- package/dist/routes/api/v1/resources/index.js.map +1 -0
- package/dist/routes/api/v1/resources/route.d.ts.map +1 -0
- package/dist/routes/api/v1/resources/route.js.map +1 -0
- package/dist/routes/api/v1/symlinks/index.d.ts.map +1 -0
- package/dist/routes/api/v1/symlinks/index.js.map +1 -0
- package/dist/routes/api/v1/symlinks/route.d.ts.map +1 -0
- package/dist/routes/api/v1/symlinks/route.js.map +1 -0
- package/dist/routes/api/v1/terminal/[proposalId]/create/index.d.ts.map +1 -0
- package/dist/routes/api/v1/terminal/[proposalId]/create/index.js.map +1 -0
- package/dist/routes/api/v1/terminal/[proposalId]/create/route.d.ts.map +1 -0
- package/dist/routes/api/v1/terminal/[proposalId]/create/route.js.map +1 -0
- package/dist/routes/api/v1/terminal/[proposalId]/destroy/index.d.ts.map +1 -0
- package/dist/routes/api/v1/terminal/[proposalId]/destroy/index.js.map +1 -0
- package/dist/routes/api/v1/terminal/[proposalId]/destroy/route.d.ts.map +1 -0
- package/dist/routes/api/v1/terminal/[proposalId]/destroy/route.js.map +1 -0
- package/dist/routes/api/v1/terminal/[proposalId]/resize/index.d.ts.map +1 -0
- package/dist/routes/api/v1/terminal/[proposalId]/resize/index.js.map +1 -0
- package/dist/routes/api/v1/terminal/[proposalId]/resize/route.d.ts.map +1 -0
- package/dist/routes/api/v1/terminal/[proposalId]/resize/route.js.map +1 -0
- package/dist/routes/api/v1/terminal/sessions/index.d.ts.map +1 -0
- package/dist/routes/api/v1/terminal/sessions/index.js.map +1 -0
- package/dist/routes/api/v1/terminal/sessions/route.d.ts.map +1 -0
- package/dist/routes/api/v1/terminal/sessions/route.js.map +1 -0
- package/dist/routes/api/v1/user/index.d.ts.map +1 -0
- package/dist/routes/api/v1/user/index.js.map +1 -0
- package/dist/routes/api/v1/user/settings/index.d.ts.map +1 -0
- package/dist/routes/api/v1/user/settings/index.js.map +1 -0
- package/dist/routes/api/v1/user/settings/route.d.ts.map +1 -0
- package/dist/routes/api/v1/user/settings/route.js.map +1 -0
- package/dist/server-with-static.d.ts.map +1 -0
- package/dist/server-with-static.js.map +1 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js.map +1 -0
- package/package.json +4 -4
- package/static/assets/ActivityPage-qJKqmwv7.js +1 -0
- package/static/assets/{AgentDetailPage-CZ2tz-Ol.js → AgentDetailPage-Dww8h17d.js} +1 -1
- package/static/assets/AgentEditPage-K6I9kvCf.js +1 -0
- package/static/assets/AgentsPage-nnMzCmw9.js +3 -0
- package/static/assets/AgentsSettingsPage-Dnkw87_8.js +6 -0
- package/static/assets/{ApiKeysSettingsPage-C7Xlzj-X.js → ApiKeysSettingsPage-DY0vNNSR.js} +3 -3
- package/static/assets/{ArchitectureEditPage-B9nVQn0B.js → ArchitectureEditPage-wx1LBCGC.js} +1 -1
- package/static/assets/ArchitecturePage-C4bkskmN.js +1 -0
- package/static/assets/{AuthSettingsPage-CaeV2cQ4.js → AuthSettingsPage-AXU_vx8p.js} +2 -2
- package/static/assets/{CallbackPage-DmeStBSx.js → CallbackPage-B6CJkdJu.js} +1 -1
- package/static/assets/CodePage-DGxzOKzh.js +2 -0
- package/static/assets/{CollapsibleSection-Cb80fCCb.js → CollapsibleSection-DgGytfeZ.js} +1 -1
- package/static/assets/DashboardPage-3PlgC6UV.js +41 -0
- package/static/assets/{GitPage-D2aJfzTq.js → GitPage-vBLrGiwG.js} +3 -3
- package/static/assets/{GitSettingsPage-Bz17VWrK.js → GitSettingsPage-D22W0fXd.js} +2 -2
- package/static/assets/{IdentityPage-O7o2b4JB.js → IdentityPage-B8xDJx3W.js} +3 -3
- package/static/assets/{ImplementationStepsEditor-BkJjQBc-.js → ImplementationStepsEditor-BY7wwwdO.js} +2 -2
- package/static/assets/IntegrationsSettingsPage-CSr-dlmL.js +1 -0
- package/static/assets/JobDetailPage-BUHRLYvQ.js +1 -0
- package/static/assets/KnowledgeDetailPage-8q-MYEOA.js +1 -0
- package/static/assets/{KnowledgeEditPage-DgyPoIJv.js → KnowledgeEditPage-Di63BhFz.js} +1 -1
- package/static/assets/{KnowledgePage-Ck_FeruK.js → KnowledgePage-BuEcOdou.js} +2 -2
- package/static/assets/{LoginPage-IqcnIlMj.js → LoginPage-CBRJBmlC.js} +1 -1
- package/static/assets/McpSettingsPage-gariusH3.js +1 -0
- package/static/assets/NewAgentPage-DDkFaqIq.js +1 -0
- package/static/assets/{NewKnowledgePage-xBm9PTKB.js → NewKnowledgePage-BqMSsS53.js} +2 -2
- package/static/assets/NewProposalPage-C77pO28o.js +90 -0
- package/static/assets/{ProjectEditPage-BlA-908F.js → ProjectEditPage-Dp5M7aXW.js} +1 -1
- package/static/assets/ProjectPage-BBL0XITa.js +1 -0
- package/static/assets/{PromptsSettingsPage-BvU01T7L.js → PromptsSettingsPage-DOcni_gq.js} +1 -1
- package/static/assets/ProposalDetailPage-5b6lLZRq.js +1 -0
- package/static/assets/ProposalEditPage-lm9wiiHa.js +1 -0
- package/static/assets/{ProposalsPage-erDBdH7Z.js → ProposalsPage-Dcms-16A.js} +2 -2
- package/static/assets/ResourcesPage-BGugJIYF.js +71 -0
- package/static/assets/RoleEditPage-DI1lGRK2.js +13 -0
- package/static/assets/RolePage-B1kmmDDF.js +1 -0
- package/static/assets/{RulesSettingsPage-DurFFm98.js → RulesSettingsPage-Br_c4fhl.js} +1 -1
- package/static/assets/SchedulePage-DMBddFXL.js +4 -0
- package/static/assets/SourceInput-BuPLoJuZ.js +1 -0
- package/static/assets/{TagInput-2_jYxO52.js → TagInput-CkZQYmnO.js} +1 -1
- package/static/assets/TerminalPage-CYqTT1pK.js +1 -0
- package/static/assets/{TerminalSessionPage-BjvQegW1.js → TerminalSessionPage-a9QWo08R.js} +4 -4
- package/static/assets/UserPreferencesPage-IVxOVtNk.js +1 -0
- package/static/assets/{UserSettingsPage-DhOu8xZ3.js → UserSettingsPage-Dsop4_yN.js} +1 -1
- package/static/assets/{UtilitiesPage-olcchfEX.js → UtilitiesPage-CZCmnyTp.js} +1 -1
- package/static/assets/{alert-bP1PxakB.js → alert-nipAjehb.js} +1 -1
- package/static/assets/{arrow-down-BoBPr1Sn.js → arrow-down-DQTEjf4E.js} +1 -1
- package/static/assets/{arrow-left-orDiJ2Pw.js → arrow-left-BgRi6mQL.js} +1 -1
- package/static/assets/{arrow-up-CCloQpeV.js → arrow-up-jLj_KhSo.js} +1 -1
- package/static/assets/{badge-D7styiB7.js → badge-CqnJU-OF.js} +1 -1
- package/static/assets/{browser-modal-n0MeSpgA.js → browser-modal-DBBFKngy.js} +2 -2
- package/static/assets/{calendar-w3geg78-.js → calendar-CA_W4UKa.js} +1 -1
- package/static/assets/{card-pzUJtmwJ.js → card-DdTVdbjN.js} +1 -1
- package/static/assets/{chevron-left-B6nXpDLi.js → chevron-left-CM04t09S.js} +1 -1
- package/static/assets/chevrons-up-DgSgy4LT.js +11 -0
- package/static/assets/{circle-alert-BcFpY-ZU.js → circle-alert-UErAnUQ-.js} +1 -1
- package/static/assets/{circle-check-HRharHjy.js → circle-check-2oo3aeGx.js} +1 -1
- package/static/assets/{circle-check-big-B2CFEks4.js → circle-check-big-CQsXU9Fx.js} +1 -1
- package/static/assets/{circle-play-CfrNAC9J.js → circle-play-BHGmBl9H.js} +1 -1
- package/static/assets/{circle-x-CNn7_0Ew.js → circle-x-DoAXluPx.js} +1 -1
- package/static/assets/{clipboard-LaXihY2m.js → clipboard-NaRSfq4S.js} +1 -1
- package/static/assets/{clock-By2Dd4u0.js → clock-C1lOY_Qr.js} +1 -1
- package/static/assets/{download--HiFU7TR.js → download-Co1Xt7Td.js} +1 -1
- package/static/assets/droid-Caom7ttu.js +4 -0
- package/static/assets/{eye-DorygWtP.js → eye-54QpT_B-.js} +1 -1
- package/static/assets/{folder-git-2-B8bjLoxc.js → folder-git-2-x65JY04J.js} +1 -1
- package/static/assets/index-BhlZ_D1Y.css +2 -0
- package/static/assets/index-VBSAUXJg.js +468 -0
- package/static/assets/{label-CTlQtJaU.js → label-C6P6J-NS.js} +1 -1
- package/static/assets/{markdown-editor-BOcltq2r.js → markdown-editor-CgzPMMiE.js} +1 -1
- package/static/assets/{pause-D33aM-oa.js → pause-CU8WFOyJ.js} +1 -1
- package/static/assets/{play-B6IdXHPj.js → play-nlXIUG-M.js} +1 -1
- package/static/assets/{plus-DhYjijTS.js → plus-nBUooJPr.js} +1 -1
- package/static/assets/{radio-group-B-Rc5x_L.js → radio-group-CQVEYWSk.js} +1 -1
- package/static/assets/{refresh-cw-BuuX9h4Z.js → refresh-cw-ChsHXM-C.js} +1 -1
- package/static/assets/{search-BiMN-o92.js → search-ygMlQfjH.js} +1 -1
- package/static/assets/{switch-vSV_roZ2.js → switch-BcjQDy93.js} +1 -1
- package/static/assets/{tabs-ChuwGq16.js → tabs-B2pmN66L.js} +1 -1
- package/static/assets/{tag-DERlGH35.js → tag-BEI3zSmE.js} +1 -1
- package/static/assets/terminal-preview-_bKoIC7R.js +1 -0
- package/static/assets/{use-terminal-qzkum-B5.js → use-terminal-DKszJuOd.js} +1 -1
- package/static/assets/{zap-DwFz_ltU.js → zap-w4hozPoR.js} +1 -1
- package/static/index.html +2 -2
- package/dist/lib/mcp-client.d.ts +0 -39
- package/dist/lib/mcp-client.js +0 -131
- package/static/assets/AgentEditPage-BiAoWU1z.js +0 -1
- package/static/assets/AgentsPage-D_HMA-40.js +0 -3
- package/static/assets/AgentsSettingsPage-C5ZsOVSL.js +0 -6
- package/static/assets/ArchitecturePage-CChIC6Qa.js +0 -1
- package/static/assets/CodePage-BtKkipWC.js +0 -2
- package/static/assets/DashboardPage-DdApq_B-.js +0 -11
- package/static/assets/IntegrationsSettingsPage-brFTXUBL.js +0 -1
- package/static/assets/KnowledgeDetailPage-e5OpRrZ2.js +0 -1
- package/static/assets/McpSettingsPage-KJBLTelP.js +0 -1
- package/static/assets/NewAgentPage-DLIvDpeZ.js +0 -1
- package/static/assets/NewProposalPage-BlocVyGv.js +0 -90
- package/static/assets/ProjectPage-Dj-tc-ZE.js +0 -1
- package/static/assets/ProposalDetailPage-_8Wn6NJt.js +0 -1
- package/static/assets/ProposalEditPage-BbbWkAuu.js +0 -1
- package/static/assets/ResourcesPage-B1uF-EA-.js +0 -71
- package/static/assets/SchedulePage-BAnM4Lu5.js +0 -4
- package/static/assets/SourceInput-7lTShZ6_.js +0 -1
- package/static/assets/TerminalPage-CRVEtFXr.js +0 -1
- package/static/assets/UserPreferencesPage-C5ueVUwG.js +0 -1
- package/static/assets/droid-C6RWH9f4.js +0 -4
- package/static/assets/index-B5SwW-PH.css +0 -2
- package/static/assets/index-BfJaT17z.js +0 -458
- package/static/assets/terminal-preview-BFedy4-J.js +0 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAA;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAC1E,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAEnC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACjD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;AAE1C,4DAA4D;AAC5D,YAAY,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,eAAe,CAAC,EAAE,CAAC,CAAA;AAEhE,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;AAEtB,2BAA2B;AAC3B,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC;IAChB,MAAM,EAAE,CAAC,uBAAuB,EAAE,uBAAuB,EAAE,uBAAuB,CAAC,EAAE,+BAA+B;IACpH,WAAW,EAAE,IAAI;CAClB,CAAC,CAAC,CAAA;AAEH,sDAAsD;AACtD,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAC,CAAA;AAEtC,6CAA6C;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;AAEjC,2BAA2B;AAC3B,MAAM,EAAE,eAAe,EAAE,gBAAgB,EAAE,GAAG,mBAAmB,CAAC,EAAE,GAAG,EAAE,CAAC,CAAA;AAE1E,wCAAwC;AACxC,GAAG,CAAC,GAAG,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC1D,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE;QAClB,MAAM,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QAC1C,OAAO,CAAC,GAAG,CAAC,6CAA6C,SAAS,EAAE,CAAC,CAAA;QAErE,MAAM,eAAe,GAAG,wBAAwB,EAAE,CAAA;QAClD,+CAA+C;QAC/C,MAAM,KAAK,GAAG,EAAE,CAAC,GAAG,CAAA;QACpB,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAA;YAC5C,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAA;YACjC,OAAM;QACR,CAAC;QAED,MAAM,OAAO,GAAG,eAAe,CAAC,eAAe,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QAEjE,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,0CAA0C,SAAS,EAAE,CAAC,CAAA;YACpE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAA;QACrC,CAAC;IACH,CAAC;IACD,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE;QACrB,mDAAmD;IACrD,CAAC;IACD,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE;QACnB,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAA;IAC5C,CAAC;IACD,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE;QACnB,OAAO,CAAC,KAAK,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAA;IACxC,CAAC;CACF,CAAC,CAAC,CAAC,CAAA;AAEJ,oEAAoE;AACpE,GAAG,CAAC,GAAG,CAAC,iCAAiC,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAClE,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE;QAClB,MAAM,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QAC1C,MAAM,eAAe,GAAG,wBAAwB,EAAE,CAAA;QAClD,MAAM,KAAK,GAAG,EAAE,CAAC,GAAG,CAAA;QACpB,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,IAAI,CAAC;gBAAC,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAA;YAAC,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;YAClD,OAAM;QACR,CAAC;QACD,MAAM,OAAO,GAAG,eAAe,CAAC,sBAAsB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QACxE,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,IAAI,CAAC;gBAAC,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAA;YAAC,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;QACtD,CAAC;IACH,CAAC;CACF,CAAC,CAAC,CAAC,CAAA;AAEJ,iCAAiC;AACjC,OAAO,IAAI,MAAM,+BAA+B,CAAA;AAChD,OAAO,YAAY,MAAM,wCAAwC,CAAA;AACjE,OAAO,OAAO,MAAM,mCAAmC,CAAA;AACvD,OAAO,SAAS,MAAM,oCAAoC,CAAA;AAC1D,OAAO,gBAAgB,MAAM,4CAA4C,CAAA;AACzE,OAAO,cAAc,MAAM,uDAAuD,CAAA;AAClF,OAAO,eAAe,MAAM,wDAAwD,CAAA;AACpF,OAAO,cAAc,MAAM,uDAAuD,CAAA;AAClF,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAC5C,OAAO,KAAK,MAAM,gCAAgC,CAAA;AAClD,OAAO,SAAS,MAAM,qCAAqC,CAAA;AAC3D,OAAO,SAAS,MAAM,oCAAoC,CAAA;AAC1D,OAAO,aAAa,MAAM,yCAAyC,CAAA;AACnE,OAAO,kBAAkB,MAAM,mDAAmD,CAAA;AAClF,OAAO,OAAO,MAAM,kCAAkC,CAAA;AACtD,OAAO,MAAM,MAAM,iCAAiC,CAAA;AACpD,OAAO,IAAI,MAAM,+BAA+B,CAAA;AAChD,OAAO,MAAM,MAAM,iCAAiC,CAAA;AACpD,OAAO,UAAU,MAAM,sCAAsC,CAAA;AAC7D,OAAO,GAAG,MAAM,8BAA8B,CAAA;AAC9C,OAAO,GAAG,MAAM,8BAA8B,CAAA;AAC9C,OAAO,QAAQ,MAAM,mCAAmC,CAAA;AACxD,OAAO,IAAI,MAAM,+BAA+B,CAAA;AAEhD,sBAAsB;AACtB,GAAG,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;AAC/B,GAAG,CAAC,KAAK,CAAC,uBAAuB,EAAE,YAAY,CAAC,CAAA;AAChD,GAAG,CAAC,KAAK,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAA;AACtC,GAAG,CAAC,KAAK,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAA;AACzC,GAAG,CAAC,KAAK,CAAC,2BAA2B,EAAE,gBAAgB,CAAC,CAAA;AACxD,GAAG,CAAC,KAAK,CAAC,qCAAqC,EAAE,cAAc,CAAC,CAAA;AAChE,GAAG,CAAC,KAAK,CAAC,sCAAsC,EAAE,eAAe,CAAC,CAAA;AAClE,GAAG,CAAC,KAAK,CAAC,qCAAqC,EAAE,cAAc,CAAC,CAAA;AAChE,GAAG,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,CAAC,CAAA;AAC3B,GAAG,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAA;AACjC,GAAG,CAAC,KAAK,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAA;AACzC,GAAG,CAAC,KAAK,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAA;AACzC,GAAG,CAAC,KAAK,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAA;AACjD,GAAG,CAAC,KAAK,CAAC,iCAAiC,EAAE,kBAAkB,CAAC,CAAA;AAChE,GAAG,CAAC,KAAK,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAA;AACrC,GAAG,CAAC,KAAK,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;AACnC,GAAG,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;AAC/B,GAAG,CAAC,KAAK,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;AACnC,GAAG,CAAC,KAAK,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAA;AAC3C,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,GAAG,CAAC,CAAA;AAC7B,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,GAAG,CAAC,CAAA;AAC7B,GAAG,CAAC,KAAK,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAA;AACvC,GAAG,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;AAE/B,wBAAwB;AACxB,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;IACvB,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AACtE,CAAC,CAAC,CAAA;AAEF,eAAe;AACf,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAEjE,OAAO,CAAC,GAAG,CAAC,2BAA2B,IAAI,KAAK,CAAC,CAAA;AAEjD,MAAM,MAAM,GAAG,KAAK,CAAC;IACnB,KAAK,EAAE,GAAG,CAAC,KAAK;IAChB,IAAI;CACL,CAAC,CAAA;AAEF,2BAA2B;AAC3B,eAAe,CAAC,MAAM,CAAC,CAAA;AAEvB,OAAO,CAAC,GAAG,CAAC,yCAAyC,IAAI,EAAE,CAAC,CAAA;AAC5D,OAAO,CAAC,GAAG,CAAC,4CAA4C,IAAI,yBAAyB,CAAC,CAAA;AACtF,OAAO,CAAC,GAAG,CAAC,oDAAoD,IAAI,iCAAiC,CAAC,CAAA;AAEtG,iCAAiC;AACjC,qBAAqB,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovelybunch/api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.72",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/server-with-static.js",
|
|
6
6
|
"exports": {
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@hono/node-server": "^1.13.7",
|
|
38
38
|
"@hono/node-ws": "^1.0.6",
|
|
39
|
-
"@lovelybunch/core": "^1.0.
|
|
40
|
-
"@lovelybunch/mcp": "^1.0.
|
|
41
|
-
"@lovelybunch/types": "^1.0.
|
|
39
|
+
"@lovelybunch/core": "^1.0.72",
|
|
40
|
+
"@lovelybunch/mcp": "^1.0.72",
|
|
41
|
+
"@lovelybunch/types": "^1.0.72",
|
|
42
42
|
"arctic": "^1.9.2",
|
|
43
43
|
"bcrypt": "^5.1.1",
|
|
44
44
|
"cookie": "^0.6.0",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,A as h,j as e,J as g,bi as j}from"./index-VBSAUXJg.js";import{C as a,a as d,b as y,c as f}from"./card-DdTVdbjN.js";import{B as o}from"./badge-CqnJU-OF.js";function w(){const[r,i]=s.useState([]),[x,l]=s.useState(!0),n=s.useCallback(async()=>{l(!0);try{const t=await fetch(`${h}/api/v1/events`);if(!t.ok)throw new Error("Failed to load events");const c=await t.json();i(Array.isArray(c.items)?[...c.items].reverse():[])}catch(t){console.error("Failed to load events:",t),i([])}finally{l(!1)}},[]);s.useEffect(()=>{n()},[n]);const m=t=>{if(!t)return"Unknown time";try{return new Date(t).toLocaleString()}catch{return t}},u=t=>{switch(t?.toLowerCase()){case"error":return"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200";case"warn":case"warning":return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200";case"info":return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";case"debug":return"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200";default:return"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200"}};return x?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Activity"}),e.jsx("p",{className:"text-muted-foreground",children:"View system activity and events"})]}),e.jsx(a,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(g,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading events..."})]})})})]}):r.length===0?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Activity"}),e.jsx("p",{className:"text-muted-foreground",children:"View system activity and events"})]}),e.jsx(a,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(j,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No Events Found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Activity events will appear here as they occur."})]})})})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Activity"}),e.jsx("p",{className:"text-muted-foreground",children:"View system activity and events"})]}),e.jsx("div",{className:"space-y-3",children:r.map(t=>e.jsx(a,{className:"hover:bg-muted/30 transition-colors",children:e.jsx(y,{className:"py-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"space-y-1 flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs(f,{className:"text-sm font-medium",children:["#",t.seq]}),t.kind&&e.jsx(o,{variant:"outline",className:"text-xs",children:t.kind}),t.level&&e.jsx(o,{className:`text-xs ${u(t.level)}`,children:t.level})]}),t.message&&e.jsx("p",{className:"text-sm text-muted-foreground truncate",children:t.message})]}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:m(t.ts)})]})})},t.seq))})]})}export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Q as A,u as E,r as h,j as e,B as i,L as d,R as k,W as B,p as S,A as N}from"./index-VBSAUXJg.js";import{C as l,b as o,a as m,c as f,d as z}from"./card-DdTVdbjN.js";import{B as v}from"./badge-CqnJU-OF.js";import{A as u}from"./arrow-left-BgRi6mQL.js";const D=t=>t?Array.isArray(t)?t.filter(r=>typeof r=="string").map(r=>r.trim()).filter(Boolean):typeof t=="string"?t.split(",").map(r=>r.trim()).filter(Boolean):[]:[],c={blue:{bg:"#dbeafe",border:"#2563eb",text:"#1e40af"},green:{bg:"#dcfce7",border:"#16a34a",text:"#166534"},red:{bg:"#fee2e2",border:"#dc2626",text:"#991b1b"},emerald:{bg:"#d1fae5",border:"#10b981",text:"#047857"},purple:{bg:"#f3e8ff",border:"#9333ea",text:"#6b21a8"},orange:{bg:"#fed7aa",border:"#ea580c",text:"#9a3412"},yellow:{bg:"#fef9c3",border:"#eab308",text:"#854d0e"},teal:{bg:"#ccfbf1",border:"#14b8a6",text:"#0f766e"},indigo:{bg:"#e0e7ff",border:"#6366f1",text:"#4338ca"},pink:{bg:"#fce7f3",border:"#ec4899",text:"#9f1239"},cyan:{bg:"#cffafe",border:"#06b6d4",text:"#155e75"},slate:{bg:"#f1f5f9",border:"#475569",text:"#334155"},gray:{bg:"#f3f4f6",border:"#6b7280",text:"#374151"}};function F(){const t=A(),r=E(),[s,y]=h.useState(null),[w,j]=h.useState(!0),[p,x]=h.useState(null);h.useEffect(()=>{async function a(){try{j(!0);const g=await(await fetch(`${N}/api/v1/agents/${t.id}`)).json();g.success?y(g.document):x(g.error||"Failed to fetch agent")}catch(n){x(n instanceof Error?n.message:"Unknown error")}finally{j(!1)}}t.id&&a()},[t.id]);const C=async()=>{if(!(!s||!confirm("Are you sure you want to delete this agent?")))try{const n=await(await fetch(`${N}/api/v1/agents/${s.filename.replace(".md","")}`,{method:"DELETE"})).json();n.success?r("/agents"):x(n.error?.message||"Failed to delete agent")}catch(a){x(a instanceof Error?a.message:"Unknown error")}};if(w)return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-8 bg-muted rounded w-64 animate-pulse"}),e.jsx("div",{className:"h-4 bg-muted rounded w-32 animate-pulse mt-2"})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(i,{variant:"ghost",size:"sm",asChild:!0,className:"px-2 hover:bg-transparent",children:e.jsx(d,{to:"/agents",className:"flex items-center text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(u,{className:"h-4 w-4"})})})})]}),e.jsx(l,{children:e.jsxs(o,{children:[e.jsx("div",{className:"h-6 bg-muted rounded w-48 animate-pulse"}),e.jsx("div",{className:"h-4 bg-muted rounded w-64 animate-pulse"})]})})]});if(p||!s)return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Agent Not Found"}),e.jsx("p",{className:"text-muted-foreground",children:"The requested agent could not be found"})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(i,{variant:"ghost",size:"sm",asChild:!0,className:"px-2 hover:bg-transparent",children:e.jsx(d,{to:"/agents",className:"flex items-center text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(u,{className:"h-4 w-4"})})})})]}),e.jsx(l,{children:e.jsx(m,{className:"pt-6",children:e.jsx("div",{className:"text-center",children:e.jsx("p",{className:"text-destructive",children:p||"Agent not found"})})})})]});const b=D(s.metadata.tools);return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"space-y-1",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight",children:s.metadata.name}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(i,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(d,{to:"/agents",className:"flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(u,{className:"h-4 w-4"})})}),e.jsx(i,{variant:"outline",size:"sm",asChild:!0,children:e.jsxs(d,{to:`/agents/${s.filename.replace(".md","")}/edit`,children:[e.jsx(k,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Edit"})]})}),e.jsxs(i,{variant:"destructive",size:"sm",onClick:C,children:[e.jsx(B,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Delete"})]})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(l,{children:[e.jsx(o,{children:e.jsx(f,{children:"Description"})}),e.jsx(m,{children:e.jsx("p",{children:s.metadata.description})})]}),s.content&&e.jsxs(l,{children:[e.jsxs(o,{children:[e.jsx(f,{children:"Instructions"}),e.jsx(z,{children:"System prompt and behavior instructions for this agent"})]}),e.jsx(m,{children:e.jsx("pre",{className:"whitespace-pre-wrap text-sm bg-muted p-4 rounded-md",children:s.content})})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(l,{children:[e.jsx(o,{children:e.jsx(f,{children:"Actions"})}),e.jsx(m,{className:"space-y-2",children:e.jsx(i,{variant:"default",className:"w-full justify-start",asChild:!0,children:e.jsxs(d,{to:`/terminal/ag-${s.filename.replace(".md","")}`,children:[e.jsx(S,{className:"h-4 w-4 mr-2"}),"Start Agent"]})})})]}),e.jsxs(l,{children:[e.jsx(o,{children:e.jsx(f,{children:"Information"})}),e.jsxs(m,{className:"space-y-2",children:[s.metadata.color&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium mb-2",children:"Color"}),e.jsx(v,{variant:"outline",className:"capitalize border-2",style:{backgroundColor:c[s.metadata.color]?.bg||c.blue.bg,color:c[s.metadata.color]?.text||c.blue.text,borderColor:c[s.metadata.color]?.border||c.blue.border},children:s.metadata.color})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Tools"}),b.length>0?e.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:b.map(a=>e.jsx(v,{variant:"secondary",children:a},a))}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No specific tools configured - inherits all tools"})]})]})]})]})]})]})}export{F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Q as X,u as Y,a as Z,r as n,j as e,B as m,L as v,p as O,I as D,w as ee,ah as te,A as y}from"./index-VBSAUXJg.js";import{C as N,a as C,b as se,c as ae}from"./card-DdTVdbjN.js";import{L as l}from"./label-C6P6J-NS.js";import{B as re}from"./badge-CqnJU-OF.js";import{c as ne}from"./clipboard-B9ndUJKl.js";import{A as z}from"./arrow-left-BgRi6mQL.js";import{C as oe,a as ie}from"./clipboard-NaRSfq4S.js";function xe(){const{id:i}=X(),U=Y(),{toast:w}=Z(),[q,S]=n.useState(!0),[o,A]=n.useState(!1),[d,c]=n.useState(null),[R,_]=n.useState(""),[u,E]=n.useState(""),[g,F]=n.useState(""),[f,P]=n.useState("blue"),[x,k]=n.useState([]),[h,$]=n.useState(""),[L,p]=n.useState([]),[H,M]=n.useState(!0),[J,T]=n.useState(!1),Q=["blue","green","red","emerald","purple","orange","yellow","teal","indigo","pink","cyan","slate","gray"],G={blue:{bg:"#3b82f6",border:"#1e40af",text:"#ffffff"},green:{bg:"#22c55e",border:"#15803d",text:"#ffffff"},red:{bg:"#ef4444",border:"#b91c1c",text:"#ffffff"},emerald:{bg:"#10b981",border:"#047857",text:"#ffffff"},purple:{bg:"#a855f7",border:"#7e22ce",text:"#ffffff"},orange:{bg:"#f97316",border:"#c2410c",text:"#ffffff"},yellow:{bg:"#eab308",border:"#a16207",text:"#ffffff"},teal:{bg:"#14b8a6",border:"#0f766e",text:"#ffffff"},indigo:{bg:"#6366f1",border:"#4338ca",text:"#ffffff"},pink:{bg:"#ec4899",border:"#be185d",text:"#ffffff"},cyan:{bg:"#06b6d4",border:"#0e7490",text:"#ffffff"},slate:{bg:"#64748b",border:"#475569",text:"#ffffff"},gray:{bg:"#6b7280",border:"#4b5563",text:"#ffffff"}},K=t=>{if(!t)return[];if(Array.isArray(t)){const a=t.filter(s=>typeof s=="string").map(s=>s.trim()).filter(Boolean);return Array.from(new Set(a))}return typeof t=="string"?Array.from(new Set(t.split(",").map(a=>a.trim()).filter(Boolean))):[]};n.useEffect(()=>{async function t(){try{S(!0);const s=await(await fetch(`${y}/api/v1/agents/${i}`)).json();if(!s.success)throw new Error(s.error||"Failed to load agent");const r=s.document;_(r.filename),E(r.metadata.name||""),F(r.metadata.description||""),P(r.metadata.color||"blue"),$(r.content||""),k(K(r.metadata.tools))}catch(a){const s=a instanceof Error?a.message:"Failed to load agent";c(s)}finally{S(!1)}}i&&t()},[i]),n.useEffect(()=>{let t=!0;return(async()=>{M(!0);try{const s=await fetch(`${y}/api/v1/mcp`);if(!s.ok)throw new Error("Failed to fetch MCP servers");const r=await s.json();if(!r?.success||!Array.isArray(r.servers)){t&&p([]);return}const B=r.mcpServers&&typeof r.mcpServers=="object"?r.mcpServers:{},b=r.servers.map(I=>{const j=B[I]??{};return{name:I,enabled:j?.enabled!==!1,description:typeof j?.description=="string"?j.description:void 0}});t&&p(b)}catch(s){console.error("Failed to load MCP servers",s),t&&p([])}finally{t&&M(!1)}})(),()=>{t=!1}},[]);const V=async()=>{const t=".nut/config.json";try{await ne(t),T(!0),w({title:"Copied!",description:`${t} copied to clipboard`}),setTimeout(()=>T(!1),2e3)}catch(a){console.error("Failed to copy config path:",a),w({title:"Error",description:"Failed to copy to clipboard",variant:"destructive"})}},W=async t=>{if(t.preventDefault(),!u.trim()||!g.trim()||!h.trim()){c("Name, description, and agent instructions are required");return}try{A(!0),c(null);const a={name:u.trim(),description:g.trim(),content:h.trim(),metadata:{color:f,tools:x.length?x:void 0}},r=await(await fetch(`${y}/api/v1/agents/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).json();if(!r.success)throw new Error(r.error||"Failed to update agent");const b=r.document.filename.replace(/\.md$/,"");U(`/agents/${b}`)}catch(a){const s=a instanceof Error?a.message:"Failed to update agent";c(s)}finally{A(!1)}};return q?e.jsx("div",{className:"space-y-6",children:e.jsx(N,{children:e.jsx(C,{className:"pt-6",children:"Loading agent..."})})}):d?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Edit Agent"}),e.jsx("p",{className:"text-muted-foreground",children:"Unable to load agent"})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(m,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(v,{to:`/agents/${i}`,className:"flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(z,{className:"h-4 w-4"})})})})]}),e.jsx(N,{children:e.jsx(C,{className:"pt-6",children:e.jsx("div",{className:"text-destructive",children:d})})})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Edit Agent"}),e.jsxs("p",{className:"text-muted-foreground",children:["File: ",R]})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(m,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(v,{to:`/agents/${i}`,className:"flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(z,{className:"h-4 w-4"})})})})]}),e.jsxs(N,{children:[e.jsx(se,{children:e.jsxs(ae,{className:"flex items-center gap-2",children:[e.jsx(O,{className:"h-5 w-5"}),"Agent Configuration"]})}),e.jsx(C,{children:e.jsxs("form",{onSubmit:W,className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{htmlFor:"name",children:"Name *"}),e.jsx(D,{id:"name",value:u,onChange:t=>E(t.target.value),disabled:o})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{htmlFor:"description",children:"Description *"}),e.jsx(D,{id:"description",value:g,onChange:t=>F(t.target.value),disabled:o})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{children:"Color"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Q.map(t=>{const a=G[t];return e.jsx("button",{type:"button",onClick:()=>P(t),disabled:o,className:`w-10 h-10 rounded-md border-2 transition-all ${f===t?"ring-2 ring-offset-2 shadow-md":"hover:scale-110 hover:shadow-sm"}`,style:{backgroundColor:a.bg,borderColor:f===t?a.border:"hsl(var(--border))",...f===t&&{"--tw-ring-color":a.border}},title:t,children:e.jsx("span",{className:"sr-only",children:t})},t)})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{htmlFor:"content",children:"Agent Instructions *"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["System prompt or instructions for this agent's behavior."," ","Insert ",e.jsx("code",{className:"text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:".nut/config.json"})," ",e.jsx("button",{type:"button",onClick:V,className:"inline-flex items-center align-middle text-muted-foreground hover:text-foreground transition-colors",title:"Copy .nut/config.json to clipboard",children:J?e.jsx(oe,{className:"h-3.5 w-3.5 ml-0.5"}):e.jsx(ie,{className:"h-3.5 w-3.5 ml-0.5"})})," ","if you want the agent to be able to access its name, role, or email address."]}),e.jsx(ee,{id:"content",value:h,onChange:t=>$(t.target.value),rows:8,disabled:o,required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{children:"Tools (Optional)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose which MCP servers this agent should be able to use. Leave empty to inherit all available servers."}),e.jsx("div",{className:"space-y-2",children:H?e.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading MCP servers…"}):L.length===0?e.jsx("div",{className:"text-sm text-muted-foreground border border-dashed rounded-md p-3",children:"No MCP servers configured yet. Configure servers in Settings → MCP."}):L.map(t=>e.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-transparent bg-muted/30 px-3 py-2 hover:border-muted transition-colors",children:[e.jsx(te,{checked:x.includes(t.name),onCheckedChange:a=>{k(s=>a===!0?s.includes(t.name)?s:[...s,t.name]:s.filter(r=>r!==t.name))},disabled:o||!t.enabled}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("span",{className:"text-sm font-medium",children:[t.name,!t.enabled&&e.jsx(re,{variant:"secondary",className:"ml-2 text-xs",children:"Disabled"})]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t.enabled?t.description||"Enabled MCP server":"Enable this server in Settings to allow agents to use it"})]})]},t.name))})]}),d&&e.jsx("div",{className:"text-sm text-destructive bg-destructive/10 p-3 rounded-md",children:d}),e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsx(m,{type:"button",variant:"outline",asChild:!0,disabled:o,children:e.jsx(v,{to:`/agents/${i}`,children:"Cancel"})}),e.jsx(m,{type:"submit",disabled:o,children:o?"Saving...":"Save Changes"})]})]})})]})]})}export{xe as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{j as e,S as I,a3 as L,r as x,a as O,A as R,J as M,B as b,L as v,p as E,al as $,am as _}from"./index-VBSAUXJg.js";import{C as N,a as w,b as D,c as U}from"./card-DdTVdbjN.js";import{B as y}from"./badge-CqnJU-OF.js";import{c as H}from"./clipboard-B9ndUJKl.js";import{R as J,L as F}from"./browser-modal-DBBFKngy.js";import{R as Y,f as G}from"./registry-ANRa5WBi.js";import{P as T}from"./plus-nBUooJPr.js";import{T as K}from"./tag-BEI3zSmE.js";import"./search-ygMlQfjH.js";const V=["color","tools","createdAt","updatedAt","version","focusAreas","contextPreferences","tags"];function P(s){if(s){if(Array.isArray(s)){const r=s.map(o=>{if(typeof o=="string")return o.trim();if(typeof o=="number")return`${o}`}).filter(o=>typeof o=="string"&&o.length>0);return r.length>0?r:void 0}if(typeof s=="string"){const r=s.split(",").map(o=>o.trim()).filter(o=>o.length>0);return r.length>0?r:void 0}}}function q(s,r){const o=[];if(s.content&&typeof s.content=="object")for(const n of Object.values(s.content))typeof n=="string"&&n.trim().length>0&&o.push(n.trim());const i=[];return i.push(`# ${r}`),s.description?.trim()&&i.push(s.description.trim()),[...i,...o].join(`
|
|
2
|
+
|
|
3
|
+
`).trim()}function z(s,r){const o=s.name||r.name,i=r.description||s.description||"",a={registryId:s.id,registryEndpoint:s.endpoint,registrySource:Y,author:s.author};for(const n of V){const d=r[n];if(d!==void 0)if(n==="tools"||n==="focusAreas"||n==="contextPreferences"||n==="tags"){const f=P(d);f&&(a[n]=f)}else a[n]=d}!a.version&&s.version&&(a.version=s.version),a.color||(a.color="blue"),!a.tags&&s.tags&&(a.tags=P(s.tags));for(const[n,d]of Object.entries(a))d==null&&delete a[n];return{name:o,description:i,content:q(r,o),metadata:Object.keys(a).length>0?a:void 0}}function B({open:s,onOpenChange:r,onImport:o}){return e.jsx(J,{open:s,onOpenChange:r,categoryId:"agents",title:"Coconut Registry – Agents",confirmLabel:"Import Agent",getDetail:i=>G(i.endpoint),renderPreview:(i,a)=>{if(!a)return e.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:"Select an agent to preview"});const n=z(i,a),d=n.metadata??{},f=typeof d.version=="string"?d.version:void 0,u=Array.isArray(i.tags)?i.tags:[],j=Array.isArray(d.tools)?d.tools.filter(c=>typeof c=="string"):[],p=Array.isArray(d.focusAreas)?d.focusAreas.filter(c=>typeof c=="string"):[];return e.jsx("div",{className:"h-full min-h-0 overflow-hidden rounded-md border",children:e.jsx(I,{className:"h-full",children:e.jsxs("div",{className:"space-y-6 p-4",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:i.name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.description})]}),f&&e.jsxs(y,{variant:"outline",children:["v",f]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Registry ID: ",e.jsx("span",{className:"font-mono",children:i.id})]}),u.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:u.map(c=>e.jsx(y,{variant:"secondary",children:c},c))}),j.length>0&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[e.jsx("span",{className:"font-medium",children:"Tools:"}),j.map(c=>e.jsx(y,{variant:"outline",children:c},c))]}),p.length>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm font-medium",children:"Focus Areas"}),e.jsx("ul",{className:"list-disc pl-5 text-sm text-muted-foreground",children:p.map(c=>e.jsx("li",{children:c},c))})]})]}),e.jsx(L,{className:"[&_.prose]:max-w-none",children:n.content})]})})})},onConfirm:async(i,a)=>{const n=z(i,a);await o({summary:i,detail:a,payload:n})}})}const Q=s=>s?Array.isArray(s)?s.filter(r=>typeof r=="string").map(r=>r.trim()).filter(Boolean):typeof s=="string"?s.split(",").map(r=>r.trim()).filter(Boolean):[]:[],g={blue:{bg:"#dbeafe",border:"#2563eb",text:"#1e40af"},green:{bg:"#dcfce7",border:"#16a34a",text:"#166534"},red:{bg:"#fee2e2",border:"#dc2626",text:"#991b1b"},emerald:{bg:"#d1fae5",border:"#10b981",text:"#047857"},purple:{bg:"#f3e8ff",border:"#9333ea",text:"#6b21a8"},orange:{bg:"#fed7aa",border:"#ea580c",text:"#9a3412"},yellow:{bg:"#fef9c3",border:"#eab308",text:"#854d0e"},teal:{bg:"#ccfbf1",border:"#14b8a6",text:"#0f766e"},indigo:{bg:"#e0e7ff",border:"#6366f1",text:"#4338ca"},pink:{bg:"#fce7f3",border:"#ec4899",text:"#9f1239"},cyan:{bg:"#cffafe",border:"#06b6d4",text:"#155e75"},slate:{bg:"#f1f5f9",border:"#475569",text:"#334155"},gray:{bg:"#f3f4f6",border:"#6b7280",text:"#374151"}};function ie(){const[s,r]=x.useState([]),[o,i]=x.useState(!0),[a,n]=x.useState({}),[d,f]=x.useState(!1),[u,j]=x.useState(!1),{toast:p}=O(),c=x.useCallback(async()=>{i(!0);try{const t=await fetch(`${R}/api/v1/agents`);if(!t.ok)throw new Error("Failed to load agents");const m=await t.json();r(Array.isArray(m.documents)?m.documents:[])}catch(t){console.error("Failed to load agents:",t),r([])}finally{i(!1)}},[]);x.useEffect(()=>{c()},[c]);const A=async t=>{const m=`.nut/agents/${t}`;try{await H(m),n(l=>({...l,[t]:!0})),setTimeout(()=>{n(l=>({...l,[t]:!1}))},2e3),p({title:"Path copied!",description:`Copied ${m} to clipboard`})}catch(l){console.error("Failed to copy path:",l),p({title:"Failed to copy",description:"Unable to copy path to clipboard",variant:"destructive"})}},C=x.useCallback(async({payload:t})=>{let m=!1;j(!0);try{const l=await fetch(`${R}/api/v1/agents`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t.name,description:t.description,content:t.content,metadata:t.metadata})});let h=null;try{h=await l.json()}catch(k){console.error("Failed to parse registry import response:",k)}if(!(l.ok&&h?.success)){const S=(typeof h?.error=="string"?h.error:h?.error?.message)||l.statusText||"Failed to import agent from registry";throw p({title:"Failed to import agent",description:S,variant:"destructive"}),m=!0,new Error(S)}p({title:"Agent imported",description:`${t.name} is now available in Coconut`}),await c()}catch(l){if(!m){const h=l instanceof Error&&l.message?l.message:"Failed to import agent from registry";p({title:"Failed to import agent",description:h,variant:"destructive"})}throw l}finally{j(!1)}},[c,p]);return o?e.jsx("div",{className:"space-y-6",children:e.jsx(N,{children:e.jsx(w,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(M,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading skills..."})]})})})}):s.length===0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Skills"}),e.jsx("p",{className:"text-muted-foreground",children:"Manage skills for your agents"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>f(!0),disabled:u,children:[e.jsx(F,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Registry"})]}),e.jsx(b,{size:"sm",asChild:!0,children:e.jsxs(v,{to:"/agents/new",children:[e.jsx(T,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Create New"})]})})]})]}),e.jsx(N,{children:e.jsx(w,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(E,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No Skills Found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Specialized skills help you automate your development and business workflows."})]})})})]}),e.jsx(B,{open:d,onOpenChange:f,onImport:C})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Skills"}),e.jsx("p",{className:"text-muted-foreground",children:"Manage skills for your agents"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>f(!0),disabled:u,children:[e.jsx(F,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Registry"})]}),e.jsx(b,{size:"sm",asChild:!0,children:e.jsxs(v,{to:"/agents/new",children:[e.jsx(T,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Create New"})]})})]})]}),e.jsx("div",{className:"grid gap-4",children:s.map(t=>{const m=Q(t.metadata.tools);return e.jsx(v,{to:`/agents/${t.filename.replace(".md","")}`,className:"block",children:e.jsxs(N,{className:"group hover:shadow-md hover:bg-muted/30 transition-all cursor-pointer",children:[e.jsx(D,{children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"space-y-1 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"text-lg",children:t.title}),e.jsx(b,{variant:"ghost",size:"sm",onClick:l=>{l.preventDefault(),A(t.filename)},className:"h-6 w-6 p-0 hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Copy file path to clipboard",children:a[t.filename]?e.jsx($,{className:"w-3 h-3 text-green-600"}):e.jsx(_,{className:"w-3 h-3"})})]}),e.jsxs("div",{className:"text-xs text-muted-foreground font-mono bg-muted/50 px-2 py-1 rounded inline-block cursor-pointer hover:bg-muted/70 transition-colors",onClick:l=>{l.preventDefault(),A(t.filename)},title:"Click to copy file path to clipboard",children:[".nut/agents/",t.filename]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(K,{className:"w-3 h-3"}),t.metadata.color||"blue"]}),m.length>0&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(E,{className:"w-3 h-3"}),m.join(", ")]})]})]}),t.metadata.color&&e.jsx(y,{variant:"outline",className:"capitalize border-2",style:{backgroundColor:g[t.metadata.color]?.bg||g.blue.bg,color:g[t.metadata.color]?.text||g.blue.text,borderColor:g[t.metadata.color]?.border||g.blue.border},children:t.metadata.color})]})}),e.jsx(w,{children:e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:t.metadata.description})})})})]})},t.filename)})})]}),e.jsx(B,{open:d,onOpenChange:f,onImport:C})]})}export{ie as default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as b,j as e,a7 as w,B as t,s as C,W as A,I as r,h as l,i as c,k as d,l as o,m as i}from"./index-VBSAUXJg.js";import{C as x,b as m,c as u,d as h,a as j}from"./card-DdTVdbjN.js";import{L as a}from"./label-C6P6J-NS.js";import{B as n}from"./badge-CqnJU-OF.js";import{P as S}from"./plus-nBUooJPr.js";import{P as p}from"./pause-CU8WFOyJ.js";import{P as R}from"./play-nlXIUG-M.js";import{Z as k}from"./zap-w4hozPoR.js";/**
|
|
2
|
+
* @license lucide-react v0.542.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const T=[["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"}]],P=b("chart-column",T);function G(){const g=[{id:"1",name:"Code Review Agent",description:"Automatically reviews pull requests and provides feedback",type:"Code Review",status:"active",model:"claude-3.5-sonnet",lastRun:"5 minutes ago",runsToday:23,successRate:"94%"},{id:"2",name:"Documentation Agent",description:"Generates and updates code documentation automatically",type:"Documentation",status:"paused",model:"gpt-4",lastRun:"2 hours ago",runsToday:8,successRate:"98%"},{id:"3",name:"Bug Hunter Agent",description:"Scans code for potential bugs and security vulnerabilities",type:"Quality Assurance",status:"active",model:"gemini-pro",lastRun:"15 minutes ago",runsToday:12,successRate:"87%"},{id:"4",name:"Performance Monitor",description:"Monitors application performance and suggests optimizations",type:"Performance",status:"inactive",model:"claude-3-haiku",lastRun:"1 day ago",runsToday:0,successRate:"91%"}],v=["Code Review","Documentation","Quality Assurance","Performance","Security","Refactoring","Testing","Architecture"],f=["claude-3.5-sonnet","claude-3-haiku","gpt-4","gpt-3.5-turbo","gemini-pro","gemini-flash"],y=s=>{switch(s){case"active":return e.jsx(k,{className:"h-4 w-4 text-green-500"});case"paused":return e.jsx(p,{className:"h-4 w-4 text-yellow-500"});case"inactive":return e.jsx("div",{className:"h-4 w-4 rounded-full bg-gray-300"});default:return e.jsx("div",{className:"h-4 w-4 rounded-full bg-gray-300"})}},N=s=>{switch(s){case"active":return e.jsx(n,{className:"bg-green-100 text-green-800",children:"Active"});case"paused":return e.jsx(n,{className:"bg-yellow-100 text-yellow-800",children:"Paused"});case"inactive":return e.jsx(n,{variant:"secondary",children:"Inactive"});default:return e.jsx(n,{variant:"secondary",children:"Unknown"})}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Agents Management"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure and manage AI agents that automate various development tasks."})]}),e.jsx(w,{}),e.jsxs(x,{children:[e.jsx(m,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(u,{children:"Active Agents"}),e.jsx(h,{children:"Monitor and control your AI agents across different workflows."})]}),e.jsxs(t,{size:"sm",children:[e.jsx(S,{className:"h-4 w-4 mr-2"}),"Create Agent"]})]})}),e.jsx(j,{children:e.jsx("div",{className:"space-y-4",children:g.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[y(s.status),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("h4",{className:"font-medium",children:s.name}),N(s.status),e.jsx(n,{variant:"outline",children:s.type}),e.jsx(n,{variant:"outline",children:s.model})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:s.description}),e.jsxs("div",{className:"flex items-center space-x-4 mt-2",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Last run: ",s.lastRun]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Runs today: ",s.runsToday]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Success rate: ",s.successRate]})]})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(t,{variant:"outline",size:"sm",children:e.jsx(P,{className:"h-4 w-4"})}),s.status==="active"?e.jsx(t,{variant:"outline",size:"sm",children:e.jsx(p,{className:"h-4 w-4"})}):e.jsx(t,{variant:"outline",size:"sm",children:e.jsx(R,{className:"h-4 w-4"})}),e.jsx(t,{variant:"outline",size:"sm",children:e.jsx(C,{className:"h-4 w-4"})}),e.jsx(t,{variant:"outline",size:"sm",children:e.jsx(A,{className:"h-4 w-4"})})]})]},s.id))})})]}),e.jsxs(x,{children:[e.jsxs(m,{children:[e.jsx(u,{children:"Create New Skill"}),e.jsx(h,{children:"Configure a new skill for your agents."})]}),e.jsxs(j,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(a,{htmlFor:"agentName",children:"Agent Name"}),e.jsx(r,{id:"agentName",placeholder:"Enter agent name"})]}),e.jsxs("div",{children:[e.jsx(a,{htmlFor:"agentType",children:"Agent Type"}),e.jsxs(l,{children:[e.jsx(c,{children:e.jsx(d,{placeholder:"Select agent type"})}),e.jsx(o,{children:v.map(s=>e.jsx(i,{value:s.toLowerCase(),children:s},s))})]})]})]}),e.jsxs("div",{children:[e.jsx(a,{htmlFor:"agentDescription",children:"Description"}),e.jsx(r,{id:"agentDescription",placeholder:"What does this agent do?"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(a,{htmlFor:"aiModel",children:"AI Model"}),e.jsxs(l,{children:[e.jsx(c,{children:e.jsx(d,{placeholder:"Select AI model"})}),e.jsx(o,{children:f.map(s=>e.jsx(i,{value:s,children:s},s))})]})]}),e.jsxs("div",{children:[e.jsx(a,{htmlFor:"systemPrompt",children:"System Prompt"}),e.jsxs(l,{children:[e.jsx(c,{children:e.jsx(d,{placeholder:"Select system prompt"})}),e.jsxs(o,{children:[e.jsx(i,{value:"code-review",children:"Code Review Assistant"}),e.jsx(i,{value:"documentation",children:"Documentation Generator"}),e.jsx(i,{value:"bug-analysis",children:"Bug Analysis Expert"}),e.jsx(i,{value:"architecture",children:"Architecture Advisor"})]})]})]})]}),e.jsxs("div",{children:[e.jsx(a,{htmlFor:"triggers",children:"Triggers"}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:["Pull Request","Commit","File Change","Schedule","Manual"].map(s=>e.jsxs("label",{className:"flex items-center space-x-2",children:[e.jsx("input",{type:"checkbox",className:"rounded"}),e.jsx("span",{className:"text-sm",children:s})]},s))})]}),e.jsxs("div",{children:[e.jsx(a,{htmlFor:"configuration",children:"Agent Configuration (JSON)"}),e.jsx("textarea",{id:"configuration",className:"w-full min-h-[120px] p-3 border rounded-md font-mono text-sm",placeholder:'{"maxTokens": 4000, "temperature": 0.3, "timeout": 30}'})]}),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(t,{variant:"outline",children:"Test Configuration"}),e.jsx(t,{variant:"outline",children:"Save as Draft"}),e.jsx(t,{children:"Create & Activate"})]})]})]}),e.jsxs(x,{children:[e.jsxs(m,{children:[e.jsx(u,{children:"Global Agent Settings"}),e.jsx(h,{children:"Configure global settings that apply to all agents."})]}),e.jsxs(j,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(a,{htmlFor:"maxConcurrent",children:"Max Concurrent Agents"}),e.jsx(r,{id:"maxConcurrent",type:"number",placeholder:"5"})]}),e.jsxs("div",{children:[e.jsx(a,{htmlFor:"defaultTimeout",children:"Default Timeout (seconds)"}),e.jsx(r,{id:"defaultTimeout",type:"number",placeholder:"30"})]})]}),e.jsxs("div",{children:[e.jsx(a,{htmlFor:"retryPolicy",children:"Retry Policy"}),e.jsxs(l,{children:[e.jsx(c,{children:e.jsx(d,{placeholder:"Select retry policy"})}),e.jsxs(o,{children:[e.jsx(i,{value:"none",children:"No Retries"}),e.jsx(i,{value:"exponential",children:"Exponential Backoff"}),e.jsx(i,{value:"linear",children:"Linear Retry"}),e.jsx(i,{value:"custom",children:"Custom Policy"})]})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("input",{type:"checkbox",id:"enableLogging",className:"rounded"}),e.jsx(a,{htmlFor:"enableLogging",children:"Enable detailed logging"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("input",{type:"checkbox",id:"enableMetrics",className:"rounded"}),e.jsx(a,{htmlFor:"enableMetrics",children:"Collect performance metrics"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("input",{type:"checkbox",id:"enableNotifications",className:"rounded"}),e.jsx(a,{htmlFor:"enableNotifications",children:"Send failure notifications"})]}),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(t,{variant:"outline",children:"Reset to Defaults"}),e.jsx(t,{children:"Save Settings"})]})]})]})]})}export{G as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{c as R,
|
|
1
|
+
import{c as R,H as W,r as t,b5 as y,j as e,B as a,b6 as X,W as Y,D as j,b as g,d as v,f,g as A,I as F,a6 as N,am as _,N as i}from"./index-VBSAUXJg.js";import{C as J,b as G,c as Q,d as V,a as Z}from"./card-DdTVdbjN.js";import{L as w}from"./label-C6P6J-NS.js";import{B as ee}from"./badge-CqnJU-OF.js";import{A as I,a as C}from"./alert-nipAjehb.js";import{P as se}from"./plus-nBUooJPr.js";import{C as te}from"./circle-alert-UErAnUQ-.js";/**
|
|
2
2
|
* @license lucide-react v0.542.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const ae=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],L=R("info",ae);function he(){const{authEnabled:n}=
|
|
7
|
-
+ ${q}/api/v1/proposals`:"",T=n?null:e.jsxs(I,{children:[e.jsx(L,{className:"h-4 w-4"}),e.jsxs(C,{children:["Authentication is currently disabled. API keys will only be required once you enable authentication in the ",e.jsx("a",{href:"/settings/authentication",className:"underline",children:"Authentication settings"}),"."]})]});return!n&&b?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"API Keys"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage API keys for programmatic access"})]}),T]}):b?e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"API Keys"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"API Keys"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage API keys for programmatic access to your Coconut instance"})]}),T,n&&e.jsxs(I,{children:[e.jsx(L,{className:"h-4 w-4"}),e.jsxs(C,{children:["API keys provide programmatic access to your Coconut instance. Use them in CI/CD pipelines or automation scripts by including the key in the ",e.jsx("code",{className:"bg-muted px-1 py-0.5 rounded",children:"X-API-Key"})," header."]})]}),e.jsxs(
|
|
6
|
+
*/const ae=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],L=R("info",ae);function he(){const{authEnabled:n}=W(),[k,P]=t.useState([]),[b,K]=t.useState(!0),[M,o]=t.useState(!1),[O,d]=t.useState(!1),[h,D]=t.useState(""),[x,E]=t.useState("never"),[c,S]=t.useState(null),[m,l]=t.useState(null);t.useEffect(()=>{p()},[]);const p=async()=>{K(!0);try{const s=await y("/api/v1/api-keys");s.success&&P(s.data?.apiKeys||[])}catch(s){console.error("Failed to load API keys:",s),P([])}finally{K(!1)}},U=async()=>{if(!h.trim()){i({title:"Error",description:"Please provide a name for the API key",variant:"destructive"});return}try{const s={name:h,scopes:["*"]};x!=="never"&&(s.expiresIn=x);const r=await y("/api/v1/api-keys",{method:"POST",body:JSON.stringify(s)});r.success&&(S(r.data),o(!1),d(!0),D(""),E("never"),await p(),i({title:"API Key Created",description:"Make sure to copy your API key now. You won't be able to see it again!"}))}catch(s){console.error("Failed to create API key:",s),i({title:"Error",description:"Failed to create API key",variant:"destructive"})}},B=async s=>{try{(await y(`/api/v1/api-keys/${s}`,{method:"DELETE"})).success&&(await p(),l(null),i({title:"API Key Deleted",description:"The API key has been permanently deleted"}))}catch(r){console.error("Failed to delete API key:",r),i({title:"Error",description:"Failed to delete API key",variant:"destructive"})}},H=async s=>{try{await navigator.clipboard.writeText(s),i({title:"Copied",description:"API key copied to clipboard"})}catch{i({title:"Error",description:"Failed to copy to clipboard",variant:"destructive"})}},u=s=>new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),$=s=>s?new Date(s)<new Date:!1,q=typeof window<"u"?window.location.origin:"http://localhost:3000",z=c?`curl -H "X-API-Key: ${c.key}" \\
|
|
7
|
+
+ ${q}/api/v1/proposals`:"",T=n?null:e.jsxs(I,{children:[e.jsx(L,{className:"h-4 w-4"}),e.jsxs(C,{children:["Authentication is currently disabled. API keys will only be required once you enable authentication in the ",e.jsx("a",{href:"/settings/authentication",className:"underline",children:"Authentication settings"}),"."]})]});return!n&&b?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"API Keys"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage API keys for programmatic access"})]}),T]}):b?e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"API Keys"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"API Keys"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage API keys for programmatic access to your Coconut instance"})]}),T,n&&e.jsxs(I,{children:[e.jsx(L,{className:"h-4 w-4"}),e.jsxs(C,{children:["API keys provide programmatic access to your Coconut instance. Use them in CI/CD pipelines or automation scripts by including the key in the ",e.jsx("code",{className:"bg-muted px-1 py-0.5 rounded",children:"X-API-Key"})," header."]})]}),e.jsxs(J,{children:[e.jsx(G,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(Q,{children:"Active API Keys"}),e.jsx(V,{children:"API keys you've created for programmatic access"})]}),e.jsxs(a,{onClick:()=>o(!0),disabled:!n,children:[e.jsx(se,{className:"mr-2 h-4 w-4"}),"Create API Key"]})]})}),e.jsx(Z,{children:k.length===0?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(X,{className:"h-12 w-12 mx-auto mb-4 opacity-20"}),e.jsx("p",{children:"No API keys yet"}),e.jsx("p",{className:"text-sm",children:"Create an API key to get started with programmatic access"})]}):e.jsx("div",{className:"space-y-4",children:k.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("p",{className:"font-medium",children:s.name}),$(s.expiresAt)&&e.jsx(ee,{variant:"destructive",children:"Expired"})]}),e.jsx("p",{className:"text-sm text-muted-foreground font-mono",children:s.keyPreview}),e.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs text-muted-foreground",children:[e.jsxs("span",{children:["Created: ",u(s.createdAt)]}),s.expiresAt&&e.jsxs("span",{children:["Expires: ",u(s.expiresAt)]}),s.lastUsedAt&&e.jsxs("span",{children:["Last used: ",u(s.lastUsedAt)]})]})]}),e.jsx(a,{variant:"ghost",size:"icon",onClick:()=>l(s.id),children:e.jsx(Y,{className:"h-4 w-4 text-destructive"})})]},s.id))})})]}),e.jsx(j,{open:M,onOpenChange:o,children:e.jsxs(g,{children:[e.jsxs(v,{children:[e.jsx(f,{children:"Create API Key"}),e.jsx(A,{children:"Create a new API key for programmatic access. The key will only be shown once."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{htmlFor:"keyName",children:"Name"}),e.jsx(F,{id:"keyName",placeholder:"CI/CD Pipeline",value:h,onChange:s=>D(s.target.value)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"A descriptive name to identify this API key"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{htmlFor:"keyExpiry",children:"Expiration"}),e.jsxs("select",{id:"keyExpiry",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm",value:x,onChange:s=>E(s.target.value),children:[e.jsx("option",{value:"never",children:"Never"}),e.jsx("option",{value:"30d",children:"30 days"}),e.jsx("option",{value:"90d",children:"90 days"}),e.jsx("option",{value:"1y",children:"1 year"})]})]})]}),e.jsxs(N,{children:[e.jsx(a,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),e.jsx(a,{onClick:U,disabled:!n,children:"Create API Key"})]})]})}),e.jsx(j,{open:O,onOpenChange:d,children:e.jsxs(g,{className:"sm:max-w-[600px]",children:[e.jsxs(v,{children:[e.jsx(f,{children:"API Key Created"}),e.jsx(A,{children:"Make sure to copy your API key now. You won't be able to see it again!"})]}),e.jsxs(I,{variant:"destructive",className:"my-4",children:[e.jsx(te,{className:"h-4 w-4"}),e.jsx(C,{children:"This is the only time you will see this key. Store it securely."})]}),c&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{children:"API Key"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(F,{readOnly:!0,value:c.key,className:"font-mono text-sm"}),e.jsx(a,{variant:"outline",size:"icon",onClick:()=>H(c.key),children:e.jsx(_,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.jsx("p",{className:"mb-2",children:"Usage example:"}),e.jsx("pre",{className:"bg-muted p-3 rounded-md whitespace-pre-wrap break-words",children:e.jsx("code",{className:"font-mono text-xs",children:z})})]})]}),e.jsx(N,{children:e.jsx(a,{onClick:()=>{d(!1),S(null)},children:"I've Saved My Key"})})]})}),e.jsx(j,{open:!!m,onOpenChange:s=>!s&&l(null),children:e.jsxs(g,{children:[e.jsxs(v,{children:[e.jsx(f,{children:"Delete API Key"}),e.jsx(A,{children:"Are you sure you want to delete this API key? This action cannot be undone and any scripts using this key will stop working."})]}),e.jsxs(N,{children:[e.jsx(a,{variant:"outline",onClick:()=>l(null),children:"Cancel"}),e.jsx(a,{variant:"destructive",onClick:()=>m&&B(m),children:"Delete API Key"})]})]})})]})}export{he as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as D,
|
|
1
|
+
import{u as D,a as M,r as l,A as b,j as e,B as S,L as I,a8 as _,I as d,w as B}from"./index-VBSAUXJg.js";import{C as u,a as p,b as j,c as v}from"./card-DdTVdbjN.js";import{L as o}from"./label-C6P6J-NS.js";import{M as P}from"./markdown-editor-CgzPMMiE.js";import{A as R}from"./arrow-left-BgRi6mQL.js";import{C as $}from"./circle-check-big-CQsXU9Fx.js";function Q(){const F=D(),{toast:h}=M(),[n,x]=l.useState({stack:{runtime:"",framework:"",language:"",database:"",deployment:"",repository:""},commands:{}}),[y,f]=l.useState(""),[E,k]=l.useState(""),[L,N]=l.useState(!0),[C,w]=l.useState(!1);l.useEffect(()=>{fetch(`${b}/api/v1/context/architecture`).then(t=>t.json()).then(t=>{if(t.success){const a=t.document,m={stack:{runtime:a.metadata.stack?.runtime||"",framework:a.metadata.stack?.framework||"",language:a.metadata.stack?.language||"",database:a.metadata.stack?.database||"",deployment:a.metadata.stack?.deployment||"",repository:a.metadata.stack?.repository||""},commands:a.metadata.commands||{}};x(m);const s=Object.entries(m.commands).map(([r,c])=>`${r}: ${c}`).join(`
|
|
2
2
|
`);k(s),f(a.content.trim())}N(!1)}).catch(t=>{console.error("Failed to load context:",t),h({title:"Error",description:"Failed to load architecture documentation",variant:"destructive"}),N(!1)})},[h]);const A=async()=>{w(!0);try{const a=await(await fetch(`${b}/api/v1/context/architecture`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y,metadata:{stack:n.stack,commands:n.commands}})})).json();if(a.success)h({title:"Success",description:"Architecture documentation saved successfully",action:e.jsx($,{className:"h-4 w-4"})}),F("/context/architecture");else throw new Error(a.error||"Failed to save context")}catch(t){console.error("Save error:",t),h({title:"Error",description:"Failed to save architecture documentation",variant:"destructive"})}finally{w(!1)}},i=(t,a)=>{x(m=>{const s={...m},r=t.split(".");let c=s;for(let g=0;g<r.length-1;g++)c=c[r[g]];return c[r[r.length-1]]=a,s})},T=t=>{k(t);const a={};t.split(`
|
|
3
3
|
`).filter(s=>s.trim()).forEach(s=>{const[r,...c]=s.split(":");r&&c.length>0&&(a[r.trim()]=c.join(":").trim())}),x(s=>({...s,commands:a}))};return L?e.jsx("div",{className:"space-y-6",children:e.jsx(u,{children:e.jsx(p,{className:"pt-6",children:e.jsx("div",{className:"text-center",children:e.jsx("p",{children:"Loading..."})})})})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight",children:"Edit Architecture"}),e.jsx("p",{className:"text-muted-foreground text-sm hidden sm:block",children:"Edit technical architecture and supporting metadata"})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(S,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(I,{to:"/context/architecture",className:"text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(R,{className:"w-4 h-4"})})}),e.jsxs(S,{onClick:A,disabled:C,size:"sm",children:[e.jsx(_,{className:"w-4 h-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:C?"Saving...":"Save"})]})]})]}),e.jsxs(u,{children:[e.jsx(j,{children:e.jsx(v,{children:"Technology Stack"})}),e.jsxs(p,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"runtime",children:"Runtime"}),e.jsx(d,{id:"runtime",value:n.stack.runtime,onChange:t=>i("stack.runtime",t.target.value),placeholder:"node|python|go|etc"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"framework",children:"Framework"}),e.jsx(d,{id:"framework",value:n.stack.framework,onChange:t=>i("stack.framework",t.target.value),placeholder:"express|fastify|django|gin|etc"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"language",children:"Language"}),e.jsx(d,{id:"language",value:n.stack.language,onChange:t=>i("stack.language",t.target.value),placeholder:"typescript|javascript|python|go|etc"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"database",children:"Database"}),e.jsx(d,{id:"database",value:n.stack.database,onChange:t=>i("stack.database",t.target.value),placeholder:"postgresql|mysql|mongodb|sqlite|etc"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"deployment",children:"Deployment"}),e.jsx(d,{id:"deployment",value:n.stack.deployment,onChange:t=>i("stack.deployment",t.target.value),placeholder:"docker|kubernetes|vercel|aws|etc"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"repository",children:"Repository"}),e.jsx(d,{id:"repository",value:n.stack.repository,onChange:t=>i("stack.repository",t.target.value),placeholder:"https://github.com/yourorg/yourproject"})]})]})]})]}),e.jsxs(u,{children:[e.jsx(j,{children:e.jsx(v,{children:"Quick Commands"})}),e.jsx(p,{className:"space-y-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"commands",children:"Commands (format: command_name: command_to_run)"}),e.jsx(B,{id:"commands",value:E,onChange:t=>T(t.target.value),placeholder:`install: npm install
|
|
4
4
|
dev: npm run dev
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as g,r as n,A as v,j as e,J as y,F as k,B as l,M as b,aB as w,L as C,R as E,ay as A}from"./index-VBSAUXJg.js";import{C as a,a as c,b as o,c as m}from"./card-DdTVdbjN.js";import{c as D}from"./clipboard-B9ndUJKl.js";function S(){const{toast:h}=g(),[r,x]=n.useState(null),[u,p]=n.useState(!0),[j,i]=n.useState(!1);n.useEffect(()=>{fetch(`${v}/api/v1/context/architecture`).then(t=>{if(t.ok)return t.json();throw new Error("Not found")}).then(t=>{t.success?(x(t.document),i(!0)):i(!1)}).catch(()=>{i(!1)}).finally(()=>{p(!1)})},[]);const N=async()=>{const t=".nut/context/architecture.md";try{await D(t),h({title:"Copied!",description:`Path ${t} copied to clipboard`})}catch(d){console.error("Failed to copy path:",d),h({title:"Error",description:"Failed to copy path to clipboard",variant:"destructive"})}},f=()=>{const t=new CustomEvent("discuss-in-chat",{detail:{type:"context",id:"architecture-md",filename:"architecture.md",name:"architecture.md",path:".nut/context/architecture.md"}});window.dispatchEvent(t)};if(u)return e.jsx("div",{className:"space-y-6",children:e.jsx(a,{children:e.jsx(c,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(y,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading architecture documentation..."})]})})})});if(!j||!r)return e.jsx("div",{className:"space-y-6",children:e.jsx(a,{children:e.jsx(c,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(k,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No Architecture Documentation Found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Architecture documentation will appear here once created."})]})})})});const s=r.metadata;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Technical Architecture"}),e.jsx("p",{className:"text-muted-foreground",children:"System design, components, and technical patterns"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(l,{variant:"outline",size:"sm",onClick:f,children:[e.jsx(b,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Discuss"})]}),e.jsxs(l,{variant:"outline",size:"sm",onClick:N,children:[e.jsx(w,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Copy Path"})]}),e.jsx(l,{size:"sm",asChild:!0,children:e.jsxs(C,{to:"/context/architecture/edit",children:[e.jsx(E,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Edit"})]})})]})]}),s&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs(a,{children:[e.jsx(o,{className:"pb-3",children:e.jsx(m,{className:"text-lg font-semibold",children:"Technology Stack"})}),e.jsx(c,{className:"space-y-3",children:s.stack&&e.jsxs("div",{className:"space-y-1 text-sm",children:[s.stack.runtime&&e.jsxs("div",{children:["Runtime: ",s.stack.runtime]}),s.stack.framework&&e.jsxs("div",{children:["Framework: ",s.stack.framework]}),s.stack.language&&e.jsxs("div",{children:["Language: ",s.stack.language]}),s.stack.database&&e.jsxs("div",{children:["Database: ",s.stack.database]}),s.stack.deployment&&e.jsxs("div",{children:["Deployment: ",s.stack.deployment]}),s.stack.repository&&e.jsxs("div",{children:["Repository:"," ",e.jsx("a",{href:s.stack.repository,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:s.stack.repository})]})]})})]}),e.jsxs(a,{children:[e.jsx(o,{className:"pb-3",children:e.jsx(m,{className:"text-lg font-semibold",children:"Quick Commands"})}),e.jsx(c,{className:"space-y-3",children:s.commands&&e.jsxs("div",{className:"space-y-1",children:[Object.entries(s.commands).slice(0,5).map(([t,d])=>e.jsxs("div",{className:"text-sm",children:[e.jsxs("span",{className:"font-medium capitalize",children:[t,": "]}),e.jsx("code",{className:"bg-muted px-2 py-1 rounded text-xs",children:d})]},t)),Object.entries(s.commands).length>5&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["+ ",Object.entries(s.commands).length-5," more commands"]})]})})]})]}),e.jsxs(a,{children:[e.jsx(o,{children:e.jsx(m,{className:"text-lg font-semibold",children:"Architecture Documentation"})}),e.jsx(c,{children:e.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:e.jsx(A,{children:r.content||"No content available"})})})]})]})}export{S as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Y,
|
|
1
|
+
import{c as Y,H as le,r as n,b5 as c,j as e,a7 as I,o as ce,D as O,a5 as $,B as l,b as M,d as V,f as H,g as _,I as j,h as J,i as z,k as W,l as q,m as a,a6 as B,U as oe,V as de,W as he,Y as ue,Z as xe,_ as me,$ as ge,a0 as je,a1 as pe,a2 as ve,N as r}from"./index-VBSAUXJg.js";import{C as p,b as v,c as w,d as f,a as y}from"./card-DdTVdbjN.js";import{L as o}from"./label-C6P6J-NS.js";import{S as U}from"./switch-BcjQDy93.js";import{B as k}from"./badge-CqnJU-OF.js";import{C as we}from"./circle-alert-UErAnUQ-.js";/**
|
|
2
2
|
* @license lucide-react v0.542.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -8,4 +8,4 @@ import{c as Y,m as le,r as n,b5 as c,j as e,a1 as O,b4 as ce,D as I,_ as M,B as
|
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const Ne=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],Se=Y("user-plus",Ne);function Fe(){const{user:N,authEnabled:K,checkAuthStatus:Q}=le(),[i,d]=n.useState(null),[G,F]=n.useState(!0),[S,P]=n.useState(!1),[X,C]=n.useState(!1),[b,D]=n.useState(""),[A,R]=n.useState(""),[T,L]=n.useState("viewer"),[E,u]=n.useState(null),[x,m]=n.useState(""),Z=!K||N?.role==="admin";n.useEffect(()=>{h()},[]);const h=async()=>{try{F(!0);const s=await c("/api/v1/auth-settings");s.success?d(s.data):d(null)}catch(s){console.error("Failed to load auth settings:",s),d(null)}finally{F(!1)}},ee=async()=>{if(!i)return;const s=!i.enabled;try{const t=await c("/api/v1/auth-settings",{method:"PUT",body:JSON.stringify({enabled:s})});if(t.success)d({...i,enabled:s}),await Q(),r({title:"Success",description:`Authentication ${s?"enabled":"disabled"}`});else throw new Error(t.error||"Failed to toggle auth")}catch(t){r({title:"Error",description:t.message||"Failed to toggle authentication",variant:"destructive"})}},se=async()=>{if(!i)return;const s=!i.allowRegistration;try{const t=await c("/api/v1/auth-settings",{method:"PUT",body:JSON.stringify({allowRegistration:s})});if(t.success)d({...i,allowRegistration:s}),r({title:"Success",description:`Self-registration ${s?"enabled":"disabled"}`});else throw new Error(t.error||"Failed to update setting")}catch(t){r({title:"Error",description:t.message||"Failed to update setting",variant:"destructive"})}},te=async()=>{if(!b||!A){r({title:"Error",description:"Please provide email and name",variant:"destructive"});return}try{const s=await c("/api/v1/auth-settings/users",{method:"POST",body:JSON.stringify({email:b,name:A,role:T})});if(s.success)await h(),C(!1),D(""),R(""),L("viewer"),r({title:"Success",description:"User added to whitelist"});else throw new Error(s.error||"Failed to add user")}catch(s){r({title:"Error",description:s.message||"Failed to add user",variant:"destructive"})}},ie=async s=>{try{const t=await c(`/api/v1/auth-settings/users/${s}`,{method:"DELETE"});if(t.success)await h(),r({title:"Success",description:"User removed from whitelist"});else throw new Error(t.error||"Failed to remove user")}catch(t){r({title:"Error",description:t.message||"Failed to remove user",variant:"destructive"})}},re=async(s,t)=>{try{const g=await c(`/api/v1/auth-settings/users/${s}`,{method:"PUT",body:JSON.stringify({role:t})});if(g.success)await h(),r({title:"Success",description:"User role updated"});else throw new Error(g.error||"Failed to update role")}catch(g){r({title:"Error",description:g.message||"Failed to update role",variant:"destructive"})}},ae=async()=>{if(!(!E||!x)){if(x.length<8){r({title:"Error",description:"Password must be at least 8 characters",variant:"destructive"});return}try{const s=await c(`/api/v1/auth-settings/users/${E}/reset-password`,{method:"POST",body:JSON.stringify({newPassword:x})});if(s.success)u(null),m(""),r({title:"Success",description:"Password reset successfully"});else throw new Error(s.error||"Failed to reset password")}catch(s){r({title:"Error",description:s.message||"Failed to reset password",variant:"destructive"})}}},ne=async()=>{if(i)try{P(!0);const s=await c("/api/v1/auth-settings",{method:"PUT",body:JSON.stringify({session:i.session})});if(s.success)r({title:"Success",description:"Session settings updated"});else throw new Error(s.error||"Failed to update settings")}catch(s){r({title:"Error",description:s.message||"Failed to update settings",variant:"destructive"})}finally{P(!1)}};return G?e.jsx("div",{children:"Loading..."}):i?Z?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Authentication"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage authentication settings and user access."})]}),e.jsx(O,{}),e.jsxs(p,{children:[e.jsxs(v,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{className:"h-5 w-5"}),e.jsx(w,{children:"Authentication Status"})]}),e.jsx(f,{children:"Control whether authentication is required to access Coconut."})]}),e.jsxs(y,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"auth-enabled",children:"Require Authentication"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"When enabled, users must log in to access Coconut"})]}),e.jsx(U,{id:"auth-enabled",checked:i.enabled,onCheckedChange:ee})]}),i.enabled&&e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"allow-registration",children:"Allow Self-Registration"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Whitelisted users can create their own accounts"})]}),e.jsx(U,{id:"allow-registration",checked:i.allowRegistration,onCheckedChange:se})]})]})]}),e.jsxs(p,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(w,{children:"Whitelisted Users"}),e.jsx(f,{children:"Manage users who can access this Coconut instance."})]}),e.jsxs(I,{open:X,onOpenChange:C,children:[e.jsx(M,{asChild:!0,children:e.jsxs(l,{size:"sm",children:[e.jsx(Se,{className:"h-4 w-4 mr-2"}),"Add User"]})}),e.jsxs($,{children:[e.jsxs(V,{children:[e.jsx(_,{children:"Add User to Whitelist"}),e.jsx(z,{children:"Add a user's email to allow them to register and access Coconut."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"new-email",children:"Email"}),e.jsx(j,{id:"new-email",type:"email",value:b,onChange:s=>D(s.target.value),placeholder:"user@example.com"})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"new-name",children:"Name"}),e.jsx(j,{id:"new-name",value:A,onChange:s=>R(s.target.value),placeholder:"User Name"})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"new-role",children:"Role"}),e.jsxs(H,{value:T,onValueChange:s=>L(s),children:[e.jsx(J,{children:e.jsx(W,{})}),e.jsxs(q,{children:[e.jsx(a,{value:"viewer",children:"Viewer"}),e.jsx(a,{value:"engineer",children:"Engineer"}),e.jsx(a,{value:"designer",children:"Designer"}),e.jsx(a,{value:"product_manager",children:"Product Manager"}),e.jsx(a,{value:"manager",children:"Manager"}),e.jsx(a,{value:"admin",children:"Admin"})]})]})]})]}),e.jsxs(B,{children:[e.jsx(l,{variant:"outline",onClick:()=>C(!1),children:"Cancel"}),e.jsx(l,{onClick:te,children:"Add User"})]})]})]})]})}),e.jsx(y,{children:e.jsx("div",{className:"space-y-4",children:i.providers.local.users.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[e.jsxs("div",{className:"space-y-1 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-medium",children:s.name}),s.registered?e.jsx(k,{variant:"default",className:"text-xs",children:"Registered"}):e.jsx(k,{variant:"secondary",className:"text-xs",children:"Pending"}),s.id===N?.id&&e.jsx(k,{variant:"outline",className:"text-xs",children:"You"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.email}),s.lastLoginAt&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Last login: ",new Date(s.lastLoginAt).toLocaleString()]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(H,{value:s.role,onValueChange:t=>re(s.id,t),children:[e.jsx(J,{className:"w-40",children:e.jsx(W,{})}),e.jsxs(q,{children:[e.jsx(a,{value:"viewer",children:"Viewer"}),e.jsx(a,{value:"engineer",children:"Engineer"}),e.jsx(a,{value:"designer",children:"Designer"}),e.jsx(a,{value:"product_manager",children:"Product Manager"}),e.jsx(a,{value:"manager",children:"Manager"}),e.jsx(a,{value:"admin",children:"Admin"})]})]}),e.jsxs(I,{open:E===s.id,onOpenChange:t=>{t||(u(null),m(""))},children:[e.jsx(M,{asChild:!0,children:e.jsx(l,{size:"sm",variant:"outline",onClick:()=>u(s.id),children:e.jsx(ye,{className:"h-4 w-4"})})}),e.jsxs($,{children:[e.jsxs(V,{children:[e.jsx(_,{children:"Reset Password"}),e.jsxs(z,{children:["Set a new password for ",s.name]})]}),e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{children:[e.jsx(o,{htmlFor:"reset-password",children:"New Password"}),e.jsx(j,{id:"reset-password",type:"password",value:x,onChange:t=>m(t.target.value),placeholder:"At least 8 characters",minLength:8})]})}),e.jsxs(B,{children:[e.jsx(l,{variant:"outline",onClick:()=>{u(null),m("")},children:"Cancel"}),e.jsx(l,{onClick:ae,children:"Reset Password"})]})]})]}),s.id!==N?.id&&e.jsxs(oe,{children:[e.jsx(de,{asChild:!0,children:e.jsx(l,{size:"sm",variant:"destructive",children:e.jsx(he,{className:"h-4 w-4"})})}),e.jsxs(ue,{children:[e.jsxs(xe,{children:[e.jsx(me,{children:"Remove User"}),e.jsxs(ge,{children:["Are you sure you want to remove ",s.name," from the whitelist? They will no longer be able to access Coconut."]})]}),e.jsxs(je,{children:[e.jsx(pe,{children:"Cancel"}),e.jsx(ve,{onClick:()=>ie(s.id),children:"Remove"})]})]})]})]})]},s.id))})})]}),e.jsxs(p,{children:[e.jsxs(v,{children:[e.jsx(w,{children:"Session Settings"}),e.jsx(f,{children:"Configure session behavior and security."})]}),e.jsxs(y,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"session-expiry",children:"Session Expiry"}),e.jsx(j,{id:"session-expiry",value:i.session.expiresIn,onChange:s=>d({...i,session:{...i.session,expiresIn:s.target.value}}),placeholder:"7d"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Format: 30s, 15m, 24h, 7d"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"secure-cookies",children:"Secure Cookies (HTTPS only)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable in production with HTTPS"})]}),e.jsx(U,{id:"secure-cookies",checked:i.session.secure||!1,onCheckedChange:s=>d({...i,session:{...i.session,secure:s}})})]})]})]}),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(l,{variant:"outline",onClick:h,disabled:S,children:"Cancel"}),e.jsx(l,{onClick:ne,disabled:S,children:S?"Saving...":"Save Session Settings"})]})]}):e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Authentication"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"You don't have permission to manage authentication settings."})]})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Authentication"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Secure your Coconut instance with authentication."})]}),e.jsx(O,{}),e.jsxs(p,{children:[e.jsxs(v,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(we,{className:"h-5 w-5 text-muted-foreground"}),e.jsx(w,{children:"Authentication Not Configured"})]}),e.jsx(f,{children:"Authentication has not been initialized. Use the CLI to set up authentication."})]}),e.jsxs(y,{children:[e.jsx("div",{className:"bg-muted p-4 rounded-md",children:e.jsxs("code",{className:"text-sm",children:["$ nut auth init",e.jsx("br",{}),"$ nut auth toggle"]})}),e.jsx("p",{className:"text-sm text-muted-foreground mt-4",children:"This will create an admin user and enable authentication for your Coconut instance."})]})]})]})}export{Fe as default};
|
|
11
|
+
*/const Ne=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],Se=Y("user-plus",Ne);function Fe(){const{user:N,authEnabled:K,checkAuthStatus:Z}=le(),[i,d]=n.useState(null),[G,F]=n.useState(!0),[S,D]=n.useState(!1),[Q,C]=n.useState(!1),[b,P]=n.useState(""),[A,R]=n.useState(""),[T,L]=n.useState("viewer"),[E,u]=n.useState(null),[x,m]=n.useState(""),X=!K||N?.role==="admin";n.useEffect(()=>{h()},[]);const h=async()=>{try{F(!0);const s=await c("/api/v1/auth-settings");s.success?d(s.data):d(null)}catch(s){console.error("Failed to load auth settings:",s),d(null)}finally{F(!1)}},ee=async()=>{if(!i)return;const s=!i.enabled;try{const t=await c("/api/v1/auth-settings",{method:"PUT",body:JSON.stringify({enabled:s})});if(t.success)d({...i,enabled:s}),await Z(),r({title:"Success",description:`Authentication ${s?"enabled":"disabled"}`});else throw new Error(t.error||"Failed to toggle auth")}catch(t){r({title:"Error",description:t.message||"Failed to toggle authentication",variant:"destructive"})}},se=async()=>{if(!i)return;const s=!i.allowRegistration;try{const t=await c("/api/v1/auth-settings",{method:"PUT",body:JSON.stringify({allowRegistration:s})});if(t.success)d({...i,allowRegistration:s}),r({title:"Success",description:`Self-registration ${s?"enabled":"disabled"}`});else throw new Error(t.error||"Failed to update setting")}catch(t){r({title:"Error",description:t.message||"Failed to update setting",variant:"destructive"})}},te=async()=>{if(!b||!A){r({title:"Error",description:"Please provide email and name",variant:"destructive"});return}try{const s=await c("/api/v1/auth-settings/users",{method:"POST",body:JSON.stringify({email:b,name:A,role:T})});if(s.success)await h(),C(!1),P(""),R(""),L("viewer"),r({title:"Success",description:"User added to whitelist"});else throw new Error(s.error||"Failed to add user")}catch(s){r({title:"Error",description:s.message||"Failed to add user",variant:"destructive"})}},ie=async s=>{try{const t=await c(`/api/v1/auth-settings/users/${s}`,{method:"DELETE"});if(t.success)await h(),r({title:"Success",description:"User removed from whitelist"});else throw new Error(t.error||"Failed to remove user")}catch(t){r({title:"Error",description:t.message||"Failed to remove user",variant:"destructive"})}},re=async(s,t)=>{try{const g=await c(`/api/v1/auth-settings/users/${s}`,{method:"PUT",body:JSON.stringify({role:t})});if(g.success)await h(),r({title:"Success",description:"User role updated"});else throw new Error(g.error||"Failed to update role")}catch(g){r({title:"Error",description:g.message||"Failed to update role",variant:"destructive"})}},ae=async()=>{if(!(!E||!x)){if(x.length<8){r({title:"Error",description:"Password must be at least 8 characters",variant:"destructive"});return}try{const s=await c(`/api/v1/auth-settings/users/${E}/reset-password`,{method:"POST",body:JSON.stringify({newPassword:x})});if(s.success)u(null),m(""),r({title:"Success",description:"Password reset successfully"});else throw new Error(s.error||"Failed to reset password")}catch(s){r({title:"Error",description:s.message||"Failed to reset password",variant:"destructive"})}}},ne=async()=>{if(i)try{D(!0);const s=await c("/api/v1/auth-settings",{method:"PUT",body:JSON.stringify({session:i.session})});if(s.success)r({title:"Success",description:"Session settings updated"});else throw new Error(s.error||"Failed to update settings")}catch(s){r({title:"Error",description:s.message||"Failed to update settings",variant:"destructive"})}finally{D(!1)}};return G?e.jsx("div",{children:"Loading..."}):i?X?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Authentication"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage authentication settings and user access."})]}),e.jsx(I,{}),e.jsxs(p,{children:[e.jsxs(v,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{className:"h-5 w-5"}),e.jsx(w,{children:"Authentication Status"})]}),e.jsx(f,{children:"Control whether authentication is required to access Coconut."})]}),e.jsxs(y,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"auth-enabled",children:"Require Authentication"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"When enabled, users must log in to access Coconut"})]}),e.jsx(U,{id:"auth-enabled",checked:i.enabled,onCheckedChange:ee})]}),i.enabled&&e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"allow-registration",children:"Allow Self-Registration"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Whitelisted users can create their own accounts"})]}),e.jsx(U,{id:"allow-registration",checked:i.allowRegistration,onCheckedChange:se})]})]})]}),e.jsxs(p,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(w,{children:"Whitelisted Users"}),e.jsx(f,{children:"Manage users who can access this Coconut instance."})]}),e.jsxs(O,{open:Q,onOpenChange:C,children:[e.jsx($,{asChild:!0,children:e.jsxs(l,{size:"sm",children:[e.jsx(Se,{className:"h-4 w-4 mr-2"}),"Add User"]})}),e.jsxs(M,{children:[e.jsxs(V,{children:[e.jsx(H,{children:"Add User to Whitelist"}),e.jsx(_,{children:"Add a user's email to allow them to register and access Coconut."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"new-email",children:"Email"}),e.jsx(j,{id:"new-email",type:"email",value:b,onChange:s=>P(s.target.value),placeholder:"user@example.com"})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"new-name",children:"Name"}),e.jsx(j,{id:"new-name",value:A,onChange:s=>R(s.target.value),placeholder:"User Name"})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"new-role",children:"Role"}),e.jsxs(J,{value:T,onValueChange:s=>L(s),children:[e.jsx(z,{children:e.jsx(W,{})}),e.jsxs(q,{children:[e.jsx(a,{value:"viewer",children:"Viewer"}),e.jsx(a,{value:"engineer",children:"Engineer"}),e.jsx(a,{value:"designer",children:"Designer"}),e.jsx(a,{value:"product_manager",children:"Product Manager"}),e.jsx(a,{value:"manager",children:"Manager"}),e.jsx(a,{value:"admin",children:"Admin"})]})]})]})]}),e.jsxs(B,{children:[e.jsx(l,{variant:"outline",onClick:()=>C(!1),children:"Cancel"}),e.jsx(l,{onClick:te,children:"Add User"})]})]})]})]})}),e.jsx(y,{children:e.jsx("div",{className:"space-y-4",children:i.providers.local.users.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[e.jsxs("div",{className:"space-y-1 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-medium",children:s.name}),s.registered?e.jsx(k,{variant:"default",className:"text-xs",children:"Registered"}):e.jsx(k,{variant:"secondary",className:"text-xs",children:"Pending"}),s.id===N?.id&&e.jsx(k,{variant:"outline",className:"text-xs",children:"You"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.email}),s.lastLoginAt&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Last login: ",new Date(s.lastLoginAt).toLocaleString()]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(J,{value:s.role,onValueChange:t=>re(s.id,t),children:[e.jsx(z,{className:"w-40",children:e.jsx(W,{})}),e.jsxs(q,{children:[e.jsx(a,{value:"viewer",children:"Viewer"}),e.jsx(a,{value:"engineer",children:"Engineer"}),e.jsx(a,{value:"designer",children:"Designer"}),e.jsx(a,{value:"product_manager",children:"Product Manager"}),e.jsx(a,{value:"manager",children:"Manager"}),e.jsx(a,{value:"admin",children:"Admin"})]})]}),e.jsxs(O,{open:E===s.id,onOpenChange:t=>{t||(u(null),m(""))},children:[e.jsx($,{asChild:!0,children:e.jsx(l,{size:"sm",variant:"outline",onClick:()=>u(s.id),children:e.jsx(ye,{className:"h-4 w-4"})})}),e.jsxs(M,{children:[e.jsxs(V,{children:[e.jsx(H,{children:"Reset Password"}),e.jsxs(_,{children:["Set a new password for ",s.name]})]}),e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{children:[e.jsx(o,{htmlFor:"reset-password",children:"New Password"}),e.jsx(j,{id:"reset-password",type:"password",value:x,onChange:t=>m(t.target.value),placeholder:"At least 8 characters",minLength:8})]})}),e.jsxs(B,{children:[e.jsx(l,{variant:"outline",onClick:()=>{u(null),m("")},children:"Cancel"}),e.jsx(l,{onClick:ae,children:"Reset Password"})]})]})]}),s.id!==N?.id&&e.jsxs(oe,{children:[e.jsx(de,{asChild:!0,children:e.jsx(l,{size:"sm",variant:"destructive",children:e.jsx(he,{className:"h-4 w-4"})})}),e.jsxs(ue,{children:[e.jsxs(xe,{children:[e.jsx(me,{children:"Remove User"}),e.jsxs(ge,{children:["Are you sure you want to remove ",s.name," from the whitelist? They will no longer be able to access Coconut."]})]}),e.jsxs(je,{children:[e.jsx(pe,{children:"Cancel"}),e.jsx(ve,{onClick:()=>ie(s.id),children:"Remove"})]})]})]})]})]},s.id))})})]}),e.jsxs(p,{children:[e.jsxs(v,{children:[e.jsx(w,{children:"Session Settings"}),e.jsx(f,{children:"Configure session behavior and security."})]}),e.jsxs(y,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"session-expiry",children:"Session Expiry"}),e.jsx(j,{id:"session-expiry",value:i.session.expiresIn,onChange:s=>d({...i,session:{...i.session,expiresIn:s.target.value}}),placeholder:"7d"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Format: 30s, 15m, 24h, 7d"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"secure-cookies",children:"Secure Cookies (HTTPS only)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable in production with HTTPS"})]}),e.jsx(U,{id:"secure-cookies",checked:i.session.secure||!1,onCheckedChange:s=>d({...i,session:{...i.session,secure:s}})})]})]})]}),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(l,{variant:"outline",onClick:h,disabled:S,children:"Cancel"}),e.jsx(l,{onClick:ne,disabled:S,children:S?"Saving...":"Save Session Settings"})]})]}):e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Authentication"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"You don't have permission to manage authentication settings."})]})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Authentication"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Secure your Coconut instance with authentication."})]}),e.jsx(I,{}),e.jsxs(p,{children:[e.jsxs(v,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(we,{className:"h-5 w-5 text-muted-foreground"}),e.jsx(w,{children:"Authentication Not Configured"})]}),e.jsx(f,{children:"Authentication has not been initialized. Use the CLI to set up authentication."})]}),e.jsxs(y,{children:[e.jsx("div",{className:"bg-muted p-4 rounded-md",children:e.jsxs("code",{className:"text-sm",children:["$ nut auth init",e.jsx("br",{}),"$ nut auth toggle"]})}),e.jsx("p",{className:"text-sm text-muted-foreground mt-4",children:"This will create an admin user and enable authentication for your Coconut instance."})]})]})]})}export{Fe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as m,j as e,
|
|
1
|
+
import{r as m,j as e,J as x,A as f}from"./index-VBSAUXJg.js";import{C as w}from"./circle-check-2oo3aeGx.js";import{C as b}from"./circle-x-DoAXluPx.js";const r="coconut/github-auth-state";function j(s){try{window.opener&&window.opener.postMessage({type:"github-auth",...s},window.location.origin)}catch{}}const v=()=>{const[s,d]=m.useState("pending"),[h,p]=m.useState("Authorizing GitHub…");return m.useEffect(()=>{const a=new URLSearchParams(window.location.search),u=a.get("error"),l=a.get("token"),n=a.get("expires_at")||a.get("expiresAt"),c=a.get("state"),o=t=>{j(t),d(t.success?"success":"error"),p(t.message),setTimeout(()=>{try{window.close()}catch{}},1200)};if(u){localStorage.removeItem(r),o({success:!1,message:decodeURIComponent(u)});return}if(!l||!n||!c){localStorage.removeItem(r),o({success:!1,message:"Missing authorization parameters. Please try again."});return}const g=localStorage.getItem(r);if(!g||g!==c){localStorage.removeItem(r),o({success:!1,message:"Authorization state mismatch. Please start again."});return}(async()=>{try{const t=await fetch(`${f}/api/v1/git/providers/github/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:l,expiresAt:n,state:c})}),i=await t.json();if(!t.ok||!i.success)throw new Error(i?.error?.message||"Failed to store GitHub token");localStorage.removeItem(r),o({success:!0,message:"GitHub connected successfully!",expiresAt:i.data?.expiresAt||n})}catch(t){localStorage.removeItem(r),o({success:!1,message:t?.message||"Failed to store GitHub token. Please try again."})}})()},[]),e.jsx("div",{className:"flex h-screen items-center justify-center bg-background px-6",children:e.jsxs("div",{className:"max-w-sm rounded-lg border bg-card p-6 text-center shadow-sm",children:[e.jsxs("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:[s==="pending"&&e.jsx(x,{className:"h-6 w-6 animate-spin text-muted-foreground"}),s==="success"&&e.jsx(w,{className:"h-6 w-6 text-green-600"}),s==="error"&&e.jsx(b,{className:"h-6 w-6 text-red-600"})]}),e.jsx("h1",{className:"text-lg font-semibold",children:"GitHub Authorization"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:h}),s!=="pending"&&e.jsx("p",{className:"mt-4 text-xs text-muted-foreground",children:"You can close this window and return to Coconut."})]})})};export{v as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{u as ce,a as de,r as i,j as e,B as r,q as oe,T as me,P as xe,v as M,X as he,F as ue,R as fe,D as ge,b as je,d as pe,f as ve,h as Ne,i as we,k as ye,l as Ce,m as b,p as be,aa as R,ab as B,ac as H,ad as L,ae as O,ai as G,x as Se,w as Ae,A as T}from"./index-VBSAUXJg.js";import{C as p,b as ke,a as _,c as De}from"./card-DdTVdbjN.js";import{B as U}from"./badge-CqnJU-OF.js";import{u as Me}from"./use-terminal-DKszJuOd.js";import{T as Te}from"./terminal-preview-_bKoIC7R.js";import{b as Ie,d as $e,c as Pe,a as Ee}from"./droid-Caom7ttu.js";import{R as ze}from"./refresh-cw-ChsHXM-C.js";import{C as Fe,a as Re}from"./chevrons-up-DgSgy4LT.js";import{P as Be}from"./play-nlXIUG-M.js";import"./xterm-DTxiCjtJ.js";const He=c=>c?Array.isArray(c)?c.filter(x=>typeof x=="string").map(x=>x.trim()).filter(Boolean):typeof c=="string"?c.split(",").map(x=>x.trim()).filter(Boolean):[]:[];function Ke(){const c=ce(),{sessions:x,loading:S,error:I,refreshSessions:y,createSession:V,destroySession:q}=Me(),{toast:v}=de(),[$,W]=i.useState([]),[X,J]=i.useState(!0),[g,A]=i.useState(()=>({})),[k,N]=i.useState(!1),[j,K]=i.useState("claude"),[P,Q]=i.useState(""),[D,E]=i.useState(!1),[h,Y]=i.useState([]),[f,w]=i.useState([]),[Z,ee]=i.useState({}),[u,se]=i.useState([]),[o,C]=i.useState([]),te=s=>{const t=Date.now(),a=new Date(s).getTime(),n=Math.max(0,Math.floor((t-a)/1e3));if(n<60)return`${n}s ago`;const d=Math.floor(n/60);if(d<60)return`${d}m ago`;const l=Math.floor(d/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`};i.useEffect(()=>{(async()=>{try{const t=await fetch(`${T}/api/v1/proposals`);if(t.ok){const a=await t.json(),n=a.data||a;W(Array.isArray(n)?n:[])}}catch(t){console.error("Error loading proposals:",t)}finally{J(!1)}})()},[]),i.useEffect(()=>{y()},[y]),i.useEffect(()=>{if(!k)return;(async()=>{try{const t=await fetch(`${T}/api/v1/mcp`);if(t.ok){const a=await t.json();a?.success&&Array.isArray(a.servers)&&(Y(a.servers),w(n=>n.filter(d=>a.servers.includes(d))),a.mcpServers&&typeof a.mcpServers=="object"&&ee(a.mcpServers))}}catch(t){console.error("Failed to load MCP servers",t)}try{const t=await fetch(`${T}/api/v1/agents`);if(t.ok){const a=await t.json(),d=(Array.isArray(a?.documents)?a.documents:[]).map(l=>({id:l.filename,name:l?.metadata?.name||l.title||l.filename,tools:He(l?.metadata?.tools)}));se(d),C(l=>l.filter(F=>d.some(re=>re.id===F)))}}catch(t){console.error("Failed to load agents",t)}})()},[k]),i.useEffect(()=>{o.length!==0&&w(s=>{const t=new Set(s),a=h.length>0?new Set(h):void 0;return o.forEach(n=>{const d=u.find(l=>l.id===n);d&&d.tools.forEach(l=>{(!a||a.has(l))&&t.add(l)})}),Array.from(t)})},[o,u,h]);const m=i.useMemo(()=>x.filter(s=>s.proposalId?.startsWith("cp-")||s.proposalId?.startsWith("ag-")).sort((s,t)=>new Date(t.lastActivity).getTime()-new Date(s.lastActivity).getTime()),[x]);i.useEffect(()=>{A(s=>{const t={...s};return m.forEach(a=>{a.id in t||(t[a.id]=!0)}),t})},[m]);const z=i.useMemo(()=>$.filter(s=>s.status==="draft"||s.status==="approved").sort((s,t)=>new Date(t.metadata.createdAt).getTime()-new Date(s.metadata.createdAt).getTime()).slice(0,3),[$]),ae=()=>{const s=m.every(a=>g[a.id]),t={};m.forEach(a=>{t[a.id]=!s}),A(t)},ie=m.length>0&&m.every(s=>g[s.id]),ne=async s=>{await q(s)?(v({title:"Session closed",description:s}),setTimeout(()=>y(),100)):v({title:"Failed to close session",description:s,variant:"destructive"})},le=async()=>{E(!0);try{const s=`cp-${Date.now()}`,t={proposalId:s,contextType:"change-proposal",cliAgent:j,mcpServersMap:Z,selectedMcpServers:f,agents:u,selectedAgentIds:o,automationEnabled:!1,customInstruction:P.trim(),includeDefaultInstructions:!1};let a="";j==="claude"?a=Ie(t):j==="gemini"?a=$e(t):j==="codex"?a=Pe(t):j==="droid"&&(a=Ee(t)),await V(s,!1,a)?(v({title:"Coding session started",description:`Session ${s} created`}),N(!1),c(`/terminal/${s}`)):v({title:"Failed to start session",description:"Could not create terminal session",variant:"destructive"})}catch(s){console.error("Error starting coding session:",s),v({title:"Error",description:"Failed to start coding session",variant:"destructive"})}finally{E(!1)}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Code"}),e.jsx("p",{className:"text-muted-foreground hidden sm:block",children:"Terminal sessions and coding agents"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(r,{variant:"outline",size:"sm",onClick:()=>y(),disabled:S,children:[e.jsx(ze,{className:`h-4 w-4 sm:mr-2 ${S?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"})]}),m.length>0&&e.jsx(r,{variant:"outline",size:"sm",onClick:ae,children:ie?e.jsxs(e.Fragment,{children:[e.jsx(Fe,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Hide All"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Re,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Show All"})]})}),e.jsxs(r,{size:"sm",onClick:()=>N(!0),children:[e.jsx(Be,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Interactive Session"})]})]})]}),I&&e.jsx("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:e.jsx("div",{className:"text-red-600",children:I})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Sessions"}),S?e.jsx("div",{className:"space-y-2",children:[...Array(2)].map((s,t)=>e.jsx(p,{className:"p-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-4 w-4 rounded bg-muted animate-pulse"}),e.jsxs("div",{children:[e.jsx("div",{className:"h-4 w-40 bg-muted rounded animate-pulse mb-2"}),e.jsx("div",{className:"h-3 w-24 bg-muted rounded animate-pulse"})]})]}),e.jsx("div",{className:"h-6 w-20 bg-muted rounded animate-pulse"})]})},t))}):m.length===0?e.jsx(p,{className:"p-8",children:e.jsxs("div",{className:"flex flex-col items-center justify-center text-center space-y-3",children:[e.jsx(oe,{className:"h-12 w-12 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg mb-2",children:"No active sessions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Get started by launching an"," ",e.jsx("button",{onClick:()=>N(!0),className:"text-primary hover:underline font-medium",children:"Interactive Session"})," ","or working on a"," ",e.jsx("button",{onClick:()=>c("/proposals"),className:"text-primary hover:underline font-medium",children:"Change Proposal"})]})]})]})}):e.jsx("div",{className:"space-y-2",children:m.slice(0,10).map(s=>e.jsxs(p,{className:"p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(me,{className:"h-4 w-4 shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-medium text-sm",children:s.proposalId}),e.jsxs("div",{className:"text-xs text-gray-500",children:["Session ",s.id.split("-").slice(-1)[0].substring(0,8)," • Last activity ",te(s.lastActivity)]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("div",{className:`flex items-center gap-1 ${s.connected?"text-green-600":"text-gray-400"}`,title:s.connected?"Connected":"Disconnected",children:e.jsx("div",{className:`w-2 h-2 rounded-full ${s.connected?"bg-green-500":"bg-gray-400"}`})}),e.jsx(r,{size:"sm",variant:"outline",onClick:()=>{A(t=>({...t,[s.id]:!t[s.id]}))},"aria-label":g[s.id]?"Hide preview":"Show preview",title:g[s.id]?"Hide preview":"Show preview",children:g[s.id]?e.jsx(xe,{className:"h-4 w-4"}):e.jsx(M,{className:"h-4 w-4"})}),e.jsx(r,{size:"sm",variant:"outline",onClick:()=>c(`/terminal/${s.proposalId}`),children:"Open"}),e.jsx(r,{size:"icon",variant:"destructive",onClick:()=>ne(s.id),title:"Close session","aria-label":"Close session",children:e.jsx(he,{className:"h-4 w-4"})})]})]}),g[s.id]&&e.jsx("div",{className:"mt-2 w-full p-2 cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>c(`/terminal/${s.proposalId}`),title:"Click to open full terminal session",children:e.jsx(Te,{sessionId:s.id,heightPx:160,maxScrollback:200})})]},s.id))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"New Tasks"}),X?e.jsx("div",{className:"space-y-3",children:[...Array(3)].map((s,t)=>e.jsx(p,{children:e.jsx(ke,{className:"py-3",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 bg-muted rounded w-2/3 animate-pulse"}),e.jsx("div",{className:"h-3 bg-muted rounded w-1/3 animate-pulse"})]}),e.jsx("div",{className:"h-5 bg-muted rounded w-16 animate-pulse"})]})})},t))}):z.length===0?e.jsx(p,{children:e.jsx(_,{className:"flex items-center justify-center py-6",children:e.jsx("div",{className:"text-center text-sm text-gray-500",children:"No draft or approved proposals found"})})}):e.jsx("div",{className:"space-y-2",children:z.map(s=>e.jsx(p,{className:"hover:shadow-md transition-all cursor-pointer hover:border-primary/50",onClick:()=>c(`/terminal/${s.id}`),children:e.jsx(_,{className:"py-4",children:e.jsx("div",{className:"flex justify-between items-start gap-4",children:e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx(De,{className:"text-base leading-tight",children:s.intent}),e.jsxs("div",{className:"flex gap-1 ml-3 flex-shrink-0",children:[s.priority&&e.jsx(U,{variant:s.priority==="high"||s.priority==="critical"?"destructive":s.priority==="medium"?"secondary":"outline",className:"text-xs",children:s.priority}),e.jsx(U,{variant:"default",className:"text-xs",children:s.status})]})]}),s.content&&e.jsxs("div",{className:"text-sm text-muted-foreground leading-relaxed",children:[s.content.split(`
|
|
2
|
+
`).slice(0,2).join(" ").substring(0,150),s.content.length>150?"...":""]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.id," • by ",s.author.name," • ",new Date(s.metadata.createdAt).toLocaleDateString()]}),e.jsxs("div",{className:"flex gap-2",onClick:t=>t.stopPropagation(),children:[e.jsxs(r,{variant:"ghost",size:"sm",onClick:()=>c(`/proposals/${s.id}`),className:"h-7 px-2 text-xs",children:[e.jsx(ue,{className:"h-3 w-3 mr-1"})," View"]}),e.jsxs(r,{variant:"ghost",size:"sm",onClick:()=>c(`/proposals/${s.id}/edit`),className:"h-7 px-2 text-xs",children:[e.jsx(fe,{className:"h-3 w-3 mr-1"})," Edit"]})]})]})]})})})},s.id))})]}),e.jsx(ge,{open:k,onOpenChange:N,children:e.jsxs(je,{className:"max-w-lg",children:[e.jsxs(pe,{children:[e.jsx(ve,{children:"Start Coding Agent"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Start an interactive coding session"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Coding Agent"}),e.jsxs(Ne,{value:j,onValueChange:s=>K(s),children:[e.jsx(we,{className:"w-full",children:e.jsx(ye,{placeholder:"Select coding agent"})}),e.jsxs(Ce,{children:[e.jsx(b,{value:"claude",children:"Claude Code"}),e.jsx(b,{value:"gemini",children:"Google Gemini"}),e.jsx(b,{value:"codex",children:"OpenAI Codex"}),e.jsx(b,{value:"droid",children:"Factory Droid"})]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(be,{className:"h-4 w-4"}),"Custom Agents"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[o.length," of ",u.length," selected"]})]}),e.jsxs(R,{children:[e.jsx(B,{asChild:!0,children:e.jsxs(r,{variant:"outline",className:"w-full justify-between",children:[o.length===0?"Select agents...":o.length===u.length?"All agents selected":`${o.length} agent${o.length!==1?"s":""} selected`,e.jsx(M,{className:"h-4 w-4 opacity-50"})]})}),e.jsxs(H,{className:"w-full min-w-[--radix-dropdown-menu-trigger-width]",children:[e.jsxs(L,{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Available Agents"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(r,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:s=>{s.preventDefault(),C(u.map(t=>t.id))},children:"All"}),e.jsx(r,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:s=>{s.preventDefault(),C([])},children:"None"})]})]}),e.jsx(O,{}),u.length===0?e.jsx("div",{className:"px-2 py-1.5 text-sm text-gray-500",children:"No agents found"}):u.map(s=>e.jsx(G,{checked:o.includes(s.id),onCheckedChange:t=>{C(a=>t?a.includes(s.id)?a:[...a,s.id]:a.filter(n=>n!==s.id))},children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:s.name}),s.tools.length>0&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["MCP servers: ",s.tools.join(", ")]}),s.tools.length===0&&e.jsx("span",{className:"text-xs text-muted-foreground",children:"Inherits available MCP servers"})]})},s.id))]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(Se,{className:"h-4 w-4"}),"MCP Servers"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[f.length," of ",h.length," selected"]})]}),e.jsxs(R,{children:[e.jsx(B,{asChild:!0,children:e.jsxs(r,{variant:"outline",className:"w-full justify-between",children:[f.length===0?"Select MCP servers...":f.length===h.length?"All servers selected":`${f.length} server${f.length!==1?"s":""} selected`,e.jsx(M,{className:"h-4 w-4 opacity-50"})]})}),e.jsxs(H,{className:"w-full min-w-[--radix-dropdown-menu-trigger-width]",children:[e.jsxs(L,{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Available Servers"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(r,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:s=>{s.preventDefault(),w(h)},children:"All"}),e.jsx(r,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:s=>{s.preventDefault(),w([])},children:"None"})]})]}),e.jsx(O,{}),h.length===0?e.jsx("div",{className:"px-2 py-1.5 text-sm text-gray-500",children:"No MCP servers found"}):h.map(s=>e.jsx(G,{checked:f.includes(s),onCheckedChange:t=>{w(a=>t?a.includes(s)?a:[...a,s]:a.filter(n=>n!==s))},children:s},s))]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Additional Instructions (optional)"}),e.jsx(Ae,{value:P,onChange:s=>Q(s.target.value),placeholder:"Add any custom instructions for the coding agent...",rows:4,className:"resize-none"})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(r,{variant:"outline",onClick:()=>N(!1),disabled:D,children:"Cancel"}),e.jsx(r,{onClick:le,disabled:D,children:D?"Starting...":"Start Session"})]})]})]})})]})}export{Ke as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as x,j as e,
|
|
1
|
+
import{r as x,j as e,e as a,v as m}from"./index-VBSAUXJg.js";function u({title:r,description:t,icon:n,defaultOpen:o=!1,children:i,className:l}){const[s,d]=x.useState(o);return e.jsxs("div",{className:a("rounded-lg border bg-card text-card-foreground",l),children:[e.jsxs("button",{type:"button",onClick:()=>d(c=>!c),className:"flex w-full items-center justify-between gap-4 px-4 py-3 text-left","aria-expanded":s,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[n,e.jsxs("div",{children:[e.jsx("p",{className:"font-medium leading-tight",children:r}),t&&e.jsx("p",{className:"text-sm text-muted-foreground leading-snug",children:t})]})]}),e.jsx(m,{className:a("h-4 w-4 shrink-0 transition-transform duration-200",s?"rotate-180":"rotate-0")})]}),s&&e.jsx("div",{className:"border-t px-4 py-4",children:i})]})}export{u as C};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import{c as N,u as Le,a as De,r as n,j as e,D as Ie,b as _e,d as se,e as f,f as te,g as ae,S as re,B as o,C as ne,I as B,h as le,i as oe,k as ce,l as ie,m as E,n as G,o as ze,G as We,F as ue,p as pe,q as fe,s as qe,t as z,T as de,E as Fe,v as Be,w as Ee,L as j,x as Ve,K as me,y as _,M as $e,A as Ge}from"./index-VBSAUXJg.js";import{C as x,a as h,b as A,c as T,d as xe}from"./card-DdTVdbjN.js";import{B as Ke}from"./badge-CqnJU-OF.js";import{L as He}from"./label-C6P6J-NS.js";import{u as Oe}from"./use-terminal-DKszJuOd.js";import{T as Ue}from"./terminal-preview-_bKoIC7R.js";import{C as Ye}from"./circle-check-2oo3aeGx.js";import{C as Qe}from"./chevron-left-CM04t09S.js";import{S as Ze}from"./search-ygMlQfjH.js";import{Z as Je}from"./zap-w4hozPoR.js";import{C as Xe}from"./calendar-CA_W4UKa.js";import{F as es}from"./folder-git-2-x65JY04J.js";import{P as ss}from"./play-nlXIUG-M.js";import{C as ts}from"./clock-C1lOY_Qr.js";import{C as as}from"./circle-check-big-CQsXU9Fx.js";import{P as rs}from"./plus-nBUooJPr.js";import"./xterm-DTxiCjtJ.js";/**
|
|
2
|
+
* @license lucide-react v0.542.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const ns=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],ls=N("chart-line",ns);/**
|
|
7
|
+
* @license lucide-react v0.542.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const os=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],cs=N("database",os);/**
|
|
12
|
+
* @license lucide-react v0.542.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const is=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M12 18v-4",key:"q1q25u"}],["path",{d:"M16 18v-6",key:"15y0np"}]],ds=N("file-chart-column-increasing",is);/**
|
|
17
|
+
* @license lucide-react v0.542.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const ms=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],xs=N("globe",ms);/**
|
|
22
|
+
* @license lucide-react v0.542.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const hs=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],us=N("palette",hs);/**
|
|
27
|
+
* @license lucide-react v0.542.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const ps=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],fs=N("rocket",ps);/**
|
|
32
|
+
* @license lucide-react v0.542.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/const js=[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2",key:"125lnx"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]],gs=N("test-tube",js);/**
|
|
37
|
+
* @license lucide-react v0.542.0 - ISC
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the ISC license.
|
|
40
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const ys=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],vs=N("wand-sparkles",ys),Ns={Rocket:fs,FolderGit2:es,FileBarChart:ds,FilePlus2:z,Calendar:Xe,Sparkles:G,Settings:qe,Zap:Je,Code:fe,Bot:pe,FileText:ue,GitBranch:We,ChartLine:ls,Shield:ze,Database:cs,TestTube:gs,Palette:us,Globe:xs},bs={blue:{bg:"bg-gradient-to-br from-blue-500/30 to-blue-600/15",icon:"text-blue-400",border:"border-blue-500/40 hover:border-blue-500/60"},purple:{bg:"bg-gradient-to-br from-purple-500/30 to-purple-600/15",icon:"text-purple-400",border:"border-purple-500/40 hover:border-purple-500/60"},green:{bg:"bg-gradient-to-br from-emerald-500/30 to-emerald-600/15",icon:"text-emerald-400",border:"border-emerald-500/40 hover:border-emerald-500/60"},orange:{bg:"bg-gradient-to-br from-orange-500/30 to-orange-600/15",icon:"text-orange-400",border:"border-orange-500/40 hover:border-orange-500/60"},pink:{bg:"bg-gradient-to-br from-pink-500/30 to-pink-600/15",icon:"text-pink-400",border:"border-pink-500/40 hover:border-pink-500/60"}},he={setup:"Setup",analysis:"Analysis",automation:"Automation",coding:"Coding"};function V(c){return Ns[c]||G}function $(c){return bs[c||"blue"]}function ws(c,v){let d=c.replace(/\{\{#if (\w+)\}\}(.*?)\{\{\/if\}\}/g,(C,g,S)=>v[g]?.trim()?S.replace(/\{\{(\w+)\}\}/g,(b,t)=>v[t]||""):"");return d=d.replace(/\{\{(\w+)\}\}/g,(C,g)=>v[g]||""),d}function ks({open:c,onOpenChange:v,workflows:d}){const C=Le(),{loading:g,createSession:S,destroySession:P}=Oe(),{toast:b}=De(),[t,u]=n.useState(null),[m,y]=n.useState(0),[i,R]=n.useState(""),[r,w]=n.useState("all"),[p,M]=n.useState({}),[K,H]=n.useState(!1),[L,O]=n.useState(null),[je,U]=n.useState(null),[W,ge]=n.useState(!1),Y=n.useMemo(()=>{const s=new Set(d.map(a=>a.category));return Array.from(s)},[d]),k=n.useMemo(()=>d.filter(s=>{const a=i===""||s.title.toLowerCase().includes(i.toLowerCase())||s.description.toLowerCase().includes(i.toLowerCase()),l=r==="all"||s.category===r;return a&&l}),[d,i,r]),Q=n.useMemo(()=>i||r!=="all"?[]:d.filter(s=>s.featured),[d,i,r]),Z=n.useMemo(()=>i||r!=="all"?k:k.filter(s=>!s.featured),[k,i,r]),J=s=>{u(s),y(0);const a={};s.params?.forEach(l=>{l.defaultValue&&(a[l.id]=l.defaultValue)}),M(a)},ye=()=>{m>0?y(m-1):(u(null),M({}))},ve=()=>{t&&m<t.steps.length-1&&y(m+1)},D=()=>{u(null),y(0),R(""),w("all"),M({}),O(null),U(null),v(!1)},I=(s,a)=>{M(l=>({...l,[s]:a}))},q=n.useMemo(()=>t?.params?t.params.filter(s=>s.required).every(s=>p[s.id]?.trim()):!0,[t,p]),F=n.useMemo(()=>t?.command?ws(t.command,p):"",[t,p]),Ne=async()=>{if(!F)return;const s=`wizard-${Date.now()}`;H(!0);try{const a=await S(s,!1,F);a?(b({title:"Session started",description:s}),O(a),U(s)):b({title:"Failed to start",description:"See error above",variant:"destructive"})}finally{H(!1)}},be=s=>{const a=V(s.icon),l=$(s.color);return e.jsx(x,{className:f("cursor-pointer transition-all duration-200 hover:scale-[1.02]",l.bg,l.border),onClick:()=>J(s),children:e.jsxs(h,{className:"p-4 flex flex-col items-center text-center h-full",children:[e.jsx("div",{className:f("w-12 h-12 rounded-xl flex items-center justify-center mb-3","bg-background/50 backdrop-blur-sm"),children:e.jsx(a,{className:f("h-6 w-6",l.icon)})}),e.jsx("h3",{className:"text-sm font-semibold line-clamp-2",children:s.title})]})},s.id)},we=s=>{const a=V(s.icon),l=$(s.color);return e.jsx(x,{className:"cursor-pointer hover:bg-accent hover:border-accent-foreground/20 transition-colors",onClick:()=>J(s),children:e.jsx(h,{className:"p-4",children:e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:f("flex-shrink-0 w-10 h-10 rounded-lg flex items-center justify-center",l.bg),children:e.jsx(a,{className:f("h-5 w-5",l.icon)})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-sm font-semibold truncate",children:s.title}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description})]}),e.jsx(ne,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"})]})})},s.id)},ke=()=>e.jsxs("div",{className:"flex h-[600px]",children:[e.jsxs("div",{className:"w-56 border-r pr-4 flex flex-col space-y-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Ze,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(B,{placeholder:"Search workflows...",value:i,onChange:s=>R(s.target.value),className:"pl-9"})]}),e.jsxs(le,{value:r,onValueChange:w,children:[e.jsx(oe,{children:e.jsx(ce,{placeholder:"All categories"})}),e.jsxs(ie,{children:[e.jsx(E,{value:"all",children:"All categories"}),Y.map(s=>e.jsx(E,{value:s,children:he[s]||s},s))]})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2 px-1",children:"Categories"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("button",{onClick:()=>w("all"),className:f("w-full text-left px-3 py-2 text-sm rounded-md transition-colors",r==="all"?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:"All Workflows"}),Y.map(s=>e.jsx("button",{onClick:()=>w(s),className:f("w-full text-left px-3 py-2 text-sm rounded-md transition-colors",r===s?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:he[s]||s},s))]})]})]}),e.jsxs("div",{className:"flex-1 pl-4",children:[e.jsxs(se,{className:"mb-4",children:[e.jsx(te,{className:"text-2xl",children:"Getting Started"}),e.jsx(ae,{children:"Choose a workflow to get started with Coconut. We'll guide you through each step."})]}),e.jsx(re,{className:"h-[500px] pr-4",children:e.jsxs("div",{className:"space-y-6",children:[Q.length>0&&e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-semibold text-muted-foreground mb-3 flex items-center",children:[e.jsx(G,{className:"h-4 w-4 mr-2"}),"Featured"]}),e.jsx("div",{className:"grid grid-cols-3 gap-3 p-1",children:Q.map(be)})]}),(Z.length>0||i||r!=="all")&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-muted-foreground mb-3",children:i||r!=="all"?`Results (${k.length})`:"All Workflows"}),e.jsx("div",{className:"space-y-2",children:k.length>0?(i||r!=="all"?k:Z).map(we):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:e.jsx("p",{children:"No workflows found matching your search."})})})]})]})})]})]}),Ce=s=>e.jsx("div",{className:"space-y-4",children:s.content&&e.jsxs("div",{className:"space-y-4",children:[s.content.text&&e.jsx(x,{children:e.jsx(h,{className:"p-4",children:e.jsx("p",{className:"text-sm leading-relaxed",children:s.content.text})})}),s.content.image&&e.jsx(x,{children:e.jsx(h,{className:"p-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("img",{src:s.content.image.src,alt:s.content.image.alt,className:"w-full rounded-md border"}),s.content.image.caption&&e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:s.content.image.caption})]})})}),s.content.video&&e.jsx(x,{children:e.jsx(h,{className:"p-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"relative rounded-md overflow-hidden border bg-muted",children:e.jsx("video",{src:s.content.video.src,poster:s.content.video.poster,controls:!0,className:"w-full",children:"Your browser does not support the video tag."})}),s.content.video.caption&&e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:s.content.video.caption})]})})})]})}),Se=()=>t?.params?e.jsx("div",{className:"space-y-4",children:t.params.map(s=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs(He,{htmlFor:s.id,children:[s.label,s.required&&e.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),s.type==="text"&&e.jsx(B,{id:s.id,placeholder:s.placeholder,value:p[s.id]||"",onChange:a=>I(s.id,a.target.value)}),s.type==="textarea"&&e.jsx(Ee,{id:s.id,placeholder:s.placeholder,value:p[s.id]||"",onChange:a=>I(s.id,a.target.value),rows:4}),s.type==="number"&&e.jsx(B,{id:s.id,type:"number",placeholder:s.placeholder,value:p[s.id]||"",onChange:a=>I(s.id,a.target.value)}),s.type==="select"&&s.options&&e.jsxs(le,{value:p[s.id]||"",onValueChange:a=>I(s.id,a),children:[e.jsx(oe,{children:e.jsx(ce,{placeholder:s.placeholder||"Select..."})}),e.jsx(ie,{children:s.options.map(a=>e.jsx(E,{value:a.value,children:a.label},a.value))})]})]},s.id))}):null,Me=()=>t?.command?L?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(de,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("h4",{className:"text-sm font-semibold",children:"Terminal Output"})]}),e.jsx(Ue,{sessionId:L,heightPx:220,maxScrollback:500})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(o,{onClick:()=>{D(),C(`/terminal/${je}`)},variant:"secondary",className:"flex-1",children:[e.jsx(Fe,{className:"h-4 w-4 mr-2"}),"Open in Terminal"]}),e.jsx(o,{onClick:async()=>{L&&await P(L),D()},className:"flex-1 bg-green-600 hover:bg-green-700",children:"Done"})]})]}):e.jsxs("div",{className:"space-y-6",children:[t.params&&t.params.length>0&&e.jsx(x,{children:e.jsxs(h,{className:"p-4",children:[e.jsx("h4",{className:"text-sm font-semibold mb-3",children:"Configuration"}),e.jsx("div",{className:"space-y-2",children:t.params.map(s=>e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:[s.label,":"]}),e.jsx("span",{className:"font-medium truncate ml-2 max-w-[200px]",children:p[s.id]||e.jsx("span",{className:"text-muted-foreground italic",children:"Not set"})})]},s.id))})]})}),e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs(o,{onClick:Ne,disabled:g||K||!q,className:"flex-1",children:[e.jsx(ss,{className:"h-4 w-4 mr-2"}),K?"Starting...":"Run"]})}),!q&&e.jsx("p",{className:"text-sm text-destructive text-center",children:"Please fill in all required fields before running."}),e.jsx(x,{children:e.jsxs(h,{className:"p-4",children:[e.jsxs("button",{type:"button",onClick:()=>ge(!W),className:"flex items-center justify-between w-full text-left",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(de,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("h4",{className:"text-sm font-semibold",children:"Command"})]}),e.jsx(Be,{className:f("h-4 w-4 text-muted-foreground transition-transform",W&&"rotate-180")})]}),W&&e.jsx("div",{className:"bg-muted rounded-md p-3 overflow-x-auto mt-3",children:e.jsx("code",{className:"text-xs font-mono whitespace-pre-wrap break-all",children:F})})]})})]}):null,Ae=()=>{if(!t)return null;const s=t.steps[m],a=s.type||"info",l=m===t.steps.length-1,Te=V(t.icon),X=$(t.color),Pe=()=>{switch(a){case"params":return Se();case"confirm":return Me();case"info":default:return Ce(s)}},Re=l&&!t.command&&a==="info";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(se,{children:[e.jsxs("div",{className:"flex items-center space-x-3 mb-2",children:[e.jsx("div",{className:f("flex-shrink-0 w-10 h-10 rounded-lg flex items-center justify-center",X.bg),children:e.jsx(Te,{className:f("h-5 w-5",X.icon)})}),e.jsxs("div",{className:"flex-1",children:[e.jsx(te,{className:"text-xl",children:t.title}),e.jsxs(ae,{children:["Step ",m+1," of ",t.steps.length]})]})]}),e.jsx("div",{className:"flex items-center space-x-2 pt-2",children:t.steps.map((As,ee)=>e.jsx("div",{className:f("h-1.5 flex-1 rounded-full transition-colors",ee<=m?"bg-primary":"bg-muted")},ee))})]}),e.jsx(re,{className:"h-[450px] pr-4",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-2",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.description})]}),Pe(),Re&&e.jsx(x,{className:"bg-primary/5 border-primary/20",children:e.jsxs(h,{className:"p-4 flex items-center space-x-3",children:[e.jsx(Ye,{className:"h-5 w-5 text-primary flex-shrink-0"}),e.jsx("p",{className:"text-sm font-medium",children:`You've completed this workflow! Click "Finish" to close this wizard.`})]})})]})}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t",children:[e.jsx(o,{variant:"ghost",onClick:D,children:"Cancel"}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs(o,{variant:"outline",onClick:ye,children:[e.jsx(Qe,{className:"mr-2 h-4 w-4"}),m===0?"Back to Workflows":"Previous"]}),a!=="confirm"&&(l?e.jsx(o,{onClick:D,children:"Finish"}):e.jsxs(o,{onClick:ve,disabled:a==="params"&&!q,children:["Next",e.jsx(ne,{className:"ml-2 h-4 w-4"})]}))]})]})]})};return e.jsx(Ie,{open:c,onOpenChange:v,children:e.jsx(_e,{className:"max-w-4xl max-h-[90vh]",children:t?Ae():ke()})})}const Cs=[{id:"new-project",title:"Start Building a New Website",description:"Scaffold a ready-to-go Vite + React + TypeScript project with Tailwind CSS",icon:"Rocket",category:"setup",featured:!0,color:"blue",command:"npx -y http://registry.coconut.dev/utils/coconut-vite-starter-1.0.0.tgz",steps:[{type:"info",title:"Start Building a New Website",description:"Get up and running with a modern web stack in seconds",content:{text:"This wizard scaffolds a ready-to-go Vite + React + TypeScript project with Tailwind CSS and React Router. Perfect for quick experiments, agent-driven prototypes, or Coconut sandboxes. You'll have a fully configured development environment with hot reloading, routing, and styling out of the box."}},{type:"confirm",title:"Create Your Project",description:"Run the scaffolding command to set up your new website"}]},{id:"company-sentiment-analysis",title:"Daily Company Sentiment Analysis",description:"Monitor a company's online presence with automated daily sentiment analysis",icon:"ChartLine",category:"automation",featured:!0,color:"orange",command:'npx -y http://registry.coconut.dev/utils/coconut-research-sentiment-analysis-1.0.2.tgz --company "{{company}}" --url "{{url}}"{{#if socialPlatforms}} --social-platforms "{{socialPlatforms}}"{{/if}}{{#if keywords}} --keywords "{{keywords}}"{{/if}}',params:[{id:"company",label:"Company Name",type:"text",placeholder:"e.g., Acme Corp",required:!0},{id:"url",label:"Company Website URL",type:"text",placeholder:"e.g., https://acme.com",required:!0},{id:"socialPlatforms",label:"Social Platforms (optional)",type:"text",placeholder:"e.g., twitter,linkedin,reddit",required:!1},{id:"keywords",label:"Keywords to Track (optional)",type:"text",placeholder:"e.g., product launch,customer feedback",required:!1}],steps:[{type:"info",title:"Daily Company Sentiment Analysis",description:"Learn how automated sentiment monitoring works",content:{text:"This wizard creates a scheduled job that monitors a company's online presence daily (Monday–Friday). It uses web scraping to gather sentiment data and generates comprehensive reports including overall sentiment score, key themes, notable mentions, and trend analysis over time."}},{type:"params",title:"Configure Analysis",description:"Enter the company details and optional filters"},{type:"confirm",title:"Review and Create Job",description:"Confirm your settings and create the sentiment analysis job"}]}],Ss={workflows:Cs},Ms=Ss.workflows;function Hs(){const[c,v]=n.useState({total:0,inReview:0,approved:0}),[d,C]=n.useState([]),[g,S]=n.useState(!0),[P,b]=n.useState(!1);return n.useEffect(()=>{const t=u=>{(u.metaKey||u.ctrlKey)&&u.key==="k"&&(u.preventDefault(),b(!0))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[]),n.useEffect(()=>{(async()=>{try{const m=await(await fetch(`${Ge}/api/v1/proposals`)).json();if(m.success&&m.data){const y=m.data,i={total:y.length,inReview:y.filter(r=>r.status==="in-review").length,approved:y.filter(r=>r.status==="approved"||r.status==="code-complete").length},R=y.sort((r,w)=>{const p=new Date(r.metadata?.updatedAt||r.metadata?.createdAt||0);return new Date(w.metadata?.updatedAt||w.metadata?.createdAt||0).getTime()-p.getTime()}).slice(0,5);v(i),C(R)}}catch(u){console.error("Failed to fetch task stats:",u)}finally{S(!1)}})()},[]),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Home"}),e.jsx("p",{className:"text-muted-foreground",children:"Manage change tasks, brainstorm, and take quick actions."})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[e.jsx(j,{to:"/proposals",children:e.jsxs(x,{className:"hover:bg-accent hover:border-accent-foreground/20 transition-colors cursor-pointer",children:[e.jsxs(A,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"All Tasks"}),e.jsx(z,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(h,{children:[e.jsx("div",{className:"text-2xl font-bold",children:g?"...":c.total}),e.jsx("p",{className:"text-xs text-muted-foreground",children:c.total===0?"No tasks yet":`${c.total} task${c.total!==1?"s":""}`})]})]})}),e.jsx(j,{to:"/proposals?status=in-review",children:e.jsxs(x,{className:"hover:bg-accent hover:border-accent-foreground/20 transition-colors cursor-pointer",children:[e.jsxs(A,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"In Review"}),e.jsx(ts,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(h,{children:[e.jsx("div",{className:"text-2xl font-bold",children:g?"...":c.inReview}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Awaiting approval"})]})]})}),e.jsx(j,{to:"/proposals?status=approved",children:e.jsxs(x,{className:"hover:bg-accent hover:border-accent-foreground/20 transition-colors cursor-pointer",children:[e.jsxs(A,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"Approved / Code Complete"}),e.jsx(as,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(h,{children:[e.jsx("div",{className:"text-2xl font-bold",children:g?"...":c.approved}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Ready to implement"})]})]})})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs(x,{children:[e.jsxs(A,{children:[e.jsx(T,{children:"Recent Tasks"}),e.jsx(xe,{children:"Recently created or updated tasks"})]}),e.jsx(h,{children:g?e.jsx("div",{className:"space-y-3",children:[1,2,3].map(t=>e.jsxs("div",{className:"animate-pulse",children:[e.jsx("div",{className:"h-4 bg-muted rounded w-3/4"}),e.jsx("div",{className:"h-3 bg-muted rounded w-1/2 mt-2"})]},t))}):d.length>0?e.jsxs("div",{className:"space-y-4 overflow-hidden",children:[d.map(t=>e.jsx(j,{to:`/proposals/${t.id}`,className:"block",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 p-3 rounded-lg border hover:bg-accent hover:border-accent-foreground/20 transition-colors cursor-pointer",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx(Ke,{variant:t.status==="approved"||t.status==="code-complete"?"default":t.status==="in-review"?"secondary":t.status==="draft"?"outline":"destructive",children:t.status})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h4",{className:"text-sm font-medium line-clamp-2 sm:truncate",children:t.intent}),e.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:[t.author.name," • ",new Date(t.metadata?.updatedAt||t.metadata?.createdAt||"").toLocaleDateString()]})]})]})},t.id)),e.jsx("div",{className:"pt-2",children:e.jsx(o,{variant:"outline",size:"sm",asChild:!0,className:"w-full",children:e.jsx(j,{to:"/proposals",children:"View All Tasks"})})})]}):e.jsxs("div",{className:"text-center py-6",children:[e.jsx(z,{className:"mx-auto h-12 w-12 text-muted-foreground/50"}),e.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No tasks yet"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Create your first task to get started."}),e.jsx(o,{asChild:!0,className:"mt-4",children:e.jsxs(j,{to:"/proposals/new",children:[e.jsx(rs,{className:"mr-2 h-4 w-4"}),"New Task"]})})]})})]}),e.jsxs(x,{className:"flex flex-col",children:[e.jsxs(A,{children:[e.jsx(T,{children:"Quick Actions"}),e.jsx(xe,{children:"Common tasks and operations"})]}),e.jsx(h,{className:"flex flex-col flex-1",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{asChild:!0,variant:"default",className:"w-full justify-start",children:e.jsxs(j,{to:"/proposals/new",children:[e.jsx(z,{className:"mr-2 h-4 w-4"}),"New Task"]})}),e.jsx(o,{asChild:!0,variant:"outline",className:"w-full justify-start",children:e.jsxs(j,{to:"/context/project/edit",children:[e.jsx(ue,{className:"mr-2 h-4 w-4"}),"Update Project Overview"]})}),e.jsx(o,{asChild:!0,variant:"outline",className:"w-full justify-start",children:e.jsxs(j,{to:"/context/architecture/edit",children:[e.jsx(Ve,{className:"mr-2 h-4 w-4"}),"Update Technical Architecture"]})}),e.jsx(o,{asChild:!0,variant:"outline",className:"w-full justify-start",children:e.jsxs(j,{to:"/agents/new",children:[e.jsx(pe,{className:"mr-2 h-4 w-4"}),"Create New Agent"]})}),e.jsx(o,{asChild:!0,variant:"outline",className:"w-full justify-start",children:e.jsxs(j,{to:"/code",children:[e.jsx(fe,{className:"mr-2 h-4 w-4"}),"Start Coding Agent"]})}),e.jsxs(o,{variant:"outline",className:"w-full justify-between",onClick:()=>b(!0),children:[e.jsxs("span",{className:"flex items-center",children:[e.jsx(vs,{className:"mr-2 h-4 w-4"}),"Launch Wizard"]}),e.jsxs(me,{children:[e.jsx(_,{children:"⌘"}),e.jsx(_,{children:"K"})]})]}),e.jsxs(o,{variant:"outline",className:"w-full justify-between",onClick:()=>window.dispatchEvent(new CustomEvent("open-assistant-expanded")),children:[e.jsxs("span",{className:"flex items-center",children:[e.jsx($e,{className:"mr-2 h-4 w-4"}),"Chat with Assistant"]}),e.jsxs(me,{children:[e.jsx(_,{children:"⌘"}),e.jsx(_,{children:"L"})]})]})]})})]})]}),e.jsx(ks,{open:P,onOpenChange:b,workflows:Ms})]})}export{Hs as default};
|