@lovelybunch/api 1.0.76-alpha.10 → 1.0.76-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/dist/lib/git.d.ts +3 -0
  2. package/dist/lib/git.js +35 -0
  3. package/dist/routes/api/v1/ai/route.js +56 -149
  4. package/dist/routes/api/v1/git/index.js +27 -1
  5. package/dist/routes/api/v1/jobs/[id]/route.d.ts +12 -18
  6. package/dist/routes/api/v1/jobs/[id]/route.js +3 -3
  7. package/dist/routes/api/v1/jobs/route.d.ts +19 -19
  8. package/dist/routes/api/v1/jobs/route.js +17 -2
  9. package/dist/routes/api/v1/mcp/index.js +27 -19
  10. package/dist/routes/api/v1/resources/generate/route.js +10 -3
  11. package/dist/routes/api/v1/slack/route.d.ts +6 -6
  12. package/package.json +4 -4
  13. package/static/assets/{ActivityPage-B3rsYt_4.js → ActivityPage-BJJTUKh9.js} +1 -1
  14. package/static/assets/{AgentsContextEditPage-4D7qO4S-.js → AgentsContextEditPage-DdBAbiaZ.js} +1 -1
  15. package/static/assets/{AgentsContextPage-NmvLRo0k.js → AgentsContextPage-C49ImhHO.js} +1 -1
  16. package/static/assets/{ApiKeysSettingsPage-BGj5p9zw.js → ApiKeysSettingsPage-CYl8BKyY.js} +1 -1
  17. package/static/assets/{ArchitectureEditPage-DI2jNmc9.js → ArchitectureEditPage-Bj3Bg_pV.js} +1 -1
  18. package/static/assets/{ArchitecturePage-DiIuThUM.js → ArchitecturePage-B4REANhO.js} +1 -1
  19. package/static/assets/{AuthSettingsPage-DWuwxAS0.js → AuthSettingsPage-CvobAtkW.js} +1 -1
  20. package/static/assets/{CallbackPage-BCmkYhEr.js → CallbackPage-Cg68HItO.js} +1 -1
  21. package/static/assets/{CodePage-BZhIkymg.js → CodePage-BgIQAm3x.js} +1 -1
  22. package/static/assets/{CollapsibleSection-BJzLVd-x.js → CollapsibleSection-B80EDHZL.js} +1 -1
  23. package/static/assets/{DashboardPage-DtwE553F.js → DashboardPage-KtwwIk4u.js} +1 -1
  24. package/static/assets/{GitPage-qG7VYL9b.js → GitPage-U50MBUc2.js} +1 -1
  25. package/static/assets/{GitSettingsPage-C8Bgpj-X.js → GitSettingsPage-CVJFc5Cz.js} +1 -1
  26. package/static/assets/{IdentityPage-Cf8Ruu-g.js → IdentityPage-B_prxEfP.js} +1 -1
  27. package/static/assets/{ImplementationStepsEditor-BXIRT7o1.js → ImplementationStepsEditor-7737WSoi.js} +1 -1
  28. package/static/assets/{IntegrationsSettingsPage-th56kUgi.js → IntegrationsSettingsPage-CzmVKesF.js} +1 -1
  29. package/static/assets/JobDetailPage-61LKyh2y.js +1 -0
  30. package/static/assets/{KnowledgeDetailPage-BklEOfs0.js → KnowledgeDetailPage-DF8VINWX.js} +1 -1
  31. package/static/assets/{KnowledgeEditPage-BGqzVqHi.js → KnowledgeEditPage-BPqv8dm5.js} +1 -1
  32. package/static/assets/{KnowledgePage-Dmm7vzAj.js → KnowledgePage-DK2ZmTOW.js} +1 -1
  33. package/static/assets/{LoginPage-PDafaEnq.js → LoginPage-BJoMiSzz.js} +1 -1
  34. package/static/assets/MailInboxPage-D7kppimo.js +1 -0
  35. package/static/assets/MailProcessingModal-CiU2tPrl.js +1 -0
  36. package/static/assets/MailReadPage-C6Uk8fuE.js +1 -0
  37. package/static/assets/{MailSentPage-CjBrbezf.js → MailSentPage-BC08nLUD.js} +1 -1
  38. package/static/assets/{McpSettingsPage-DxE-4YPc.js → McpSettingsPage-CdNU_m5E.js} +1 -1
  39. package/static/assets/{MemoryEditPage-BlQ5EN1w.js → MemoryEditPage-CrMnRGDo.js} +1 -1
  40. package/static/assets/{MemoryPage-B8fsgW7z.js → MemoryPage-BXzS3NzY.js} +1 -1
  41. package/static/assets/{NewKnowledgePage-CuH201xQ.js → NewKnowledgePage-Ia0GhoF_.js} +1 -1
  42. package/static/assets/{NewSkillPage-BdX7eNoi.js → NewSkillPage-B-lKmYIT.js} +1 -1
  43. package/static/assets/{NewTaskPage-D9W2Yi0r.js → NewTaskPage-B9sYSebW.js} +1 -1
  44. package/static/assets/{NotFoundPage-D9tmTVho.js → NotFoundPage-CFh8ZpUq.js} +1 -1
  45. package/static/assets/{NotificationsSettingsPage-B4lBxS8D.js → NotificationsSettingsPage-CkW0hhZp.js} +1 -1
  46. package/static/assets/{ProjectEditPage-DdqUI91K.js → ProjectEditPage-CERVEYfa.js} +1 -1
  47. package/static/assets/{ProjectPage-DB7ugw8l.js → ProjectPage-smlgt2WA.js} +1 -1
  48. package/static/assets/{PromptsSettingsPage-DFXoKUjj.js → PromptsSettingsPage-rmH7tCbI.js} +1 -1
  49. package/static/assets/{ResourceDetailPage-CWc4YIMc.js → ResourceDetailPage-JYYH_eYN.js} +1 -1
  50. package/static/assets/ResourcesPage-Bxo0L-YJ.js +41 -0
  51. package/static/assets/{RoleEditPage-B20UAC2r.js → RoleEditPage-DUxyu-Pf.js} +1 -1
  52. package/static/assets/{RolePage-C5Jf7wxY.js → RolePage-Bxtbnhzq.js} +1 -1
  53. package/static/assets/{RulesSettingsPage-91WP1FQf.js → RulesSettingsPage-Bq85g3dZ.js} +1 -1
  54. package/static/assets/RunDetailPage-Bmr-OpEH.js +1 -0
  55. package/static/assets/SchedulePage-DVFrtK_u.js +4 -0
  56. package/static/assets/{SkillDetailPage-Cpxz_wmk.js → SkillDetailPage-DLVeAMHh.js} +1 -1
  57. package/static/assets/{SkillEditPage-Cz7VRg0r.js → SkillEditPage-L8qO7aXB.js} +1 -1
  58. package/static/assets/{SkillsPage-Bxmsi6Xd.js → SkillsPage-Dbk0ZdCj.js} +1 -1
  59. package/static/assets/{SkillsSettingsPage-Cysx53Au.js → SkillsSettingsPage-D1LF96aM.js} +1 -1
  60. package/static/assets/{SourceInput-D59F7hff.js → SourceInput-s6cvxCld.js} +1 -1
  61. package/static/assets/{TagInput-BH6wDXWJ.js → TagInput-B6t8mWa1.js} +1 -1
  62. package/static/assets/{TaskDetailPage-5ktdWaTr.js → TaskDetailPage-CFKiBp4N.js} +1 -1
  63. package/static/assets/{TaskEditPage-CIZWp_s4.js → TaskEditPage-CU1Nh5Wt.js} +1 -1
  64. package/static/assets/{TasksPage-BNXDm-Er.js → TasksPage-ChyoBFb1.js} +1 -1
  65. package/static/assets/{TeamEditPage-C10siqme.js → TeamEditPage-BiH1cvW_.js} +1 -1
  66. package/static/assets/{TeamPage-CXpZVAfy.js → TeamPage-CZgCevCv.js} +1 -1
  67. package/static/assets/{TerminalPage-DJ-Tu_hG.js → TerminalPage-CnMHrceg.js} +1 -1
  68. package/static/assets/{TerminalSessionPage-BLryJlkL.js → TerminalSessionPage-CWRmxO5F.js} +1 -1
  69. package/static/assets/{UserPreferencesPage-BvAcv5tt.js → UserPreferencesPage-DBAMcnVw.js} +1 -1
  70. package/static/assets/{UserSettingsPage-NQfoOvHf.js → UserSettingsPage-DaJ5ULZ6.js} +1 -1
  71. package/static/assets/{UtilitiesPage-NnBCWVn8.js → UtilitiesPage-DK2tA2dg.js} +1 -1
  72. package/static/assets/{alert-CMfexl-V.js → alert-BLA1YxSF.js} +1 -1
  73. package/static/assets/{arrow-down-7VoAlw8h.js → arrow-down-BS_gkmFX.js} +1 -1
  74. package/static/assets/{arrow-left-CkQCXG-O.js → arrow-left-BMmwy6t5.js} +1 -1
  75. package/static/assets/{arrow-up-Bozm6eto.js → arrow-up-DEdQz7h4.js} +1 -1
  76. package/static/assets/{arrow-up-down-BgZelEPF.js → arrow-up-down-BfLyyRID.js} +1 -1
  77. package/static/assets/{badge-CKqDVhJv.js → badge-DXtacKLi.js} +1 -1
  78. package/static/assets/{browser-modal-CIOZi1Jw.js → browser-modal-C-EJH5-l.js} +1 -1
  79. package/static/assets/{card-jBf8qQSy.js → card-T1Zl_t-O.js} +1 -1
  80. package/static/assets/{chevron-left-D1qHCYRd.js → chevron-left-CHIuYPig.js} +1 -1
  81. package/static/assets/{chevron-up-CcwaoTsZ.js → chevron-up-C1j8XcMS.js} +1 -1
  82. package/static/assets/{chevrons-up-BtlNQbrw.js → chevrons-up-CJo8Mkrm.js} +1 -1
  83. package/static/assets/{circle-alert-DqK0nUqF.js → circle-alert-C-TQDAZH.js} +1 -1
  84. package/static/assets/{circle-check-qo4cPVA1.js → circle-check-D4Eo7NeP.js} +1 -1
  85. package/static/assets/{circle-check-big-DDQIqE0G.js → circle-check-big-Dw0wgLkY.js} +1 -1
  86. package/static/assets/{circle-play-CQ-UItmT.js → circle-play-XYouMl6A.js} +1 -1
  87. package/static/assets/{circle-x-Bd57ohC5.js → circle-x-i-p09ZTc.js} +1 -1
  88. package/static/assets/{clipboard-JQLlAwqS.js → clipboard-CAJMRUqv.js} +1 -1
  89. package/static/assets/{clock-DTp411N-.js → clock-t6EXtqFH.js} +1 -1
  90. package/static/assets/{code-Bi-U-NxE.js → code-CQveJCBf.js} +1 -1
  91. package/static/assets/{download-DNaE6rtO.js → download-gURwTJ4j.js} +1 -1
  92. package/static/assets/{external-link-DRsIhdWR.js → external-link-B6lRGdDG.js} +1 -1
  93. package/static/assets/{eye-jqpFU8Rl.js → eye-BmQvWYqM.js} +1 -1
  94. package/static/assets/{folder-git-2-ixHmuqNj.js → folder-git-2-Y7dQhpIc.js} +1 -1
  95. package/static/assets/{globe-BZEWER4V.js → globe-DZ1sD-ad.js} +1 -1
  96. package/static/assets/index-6zt5f3rT.js +502 -0
  97. package/static/assets/{index-BGKQ2Csq.js → index-B-EQGkgp.js} +1 -1
  98. package/static/assets/{index-CtWTFIFI.js → index-BDAqiMeO.js} +1 -1
  99. package/static/assets/{index-2_Tb936f.js → index-BKsuLLw3.js} +1 -1
  100. package/static/assets/{index-BD47WGC6.js → index-BQ6h7obM.js} +1 -1
  101. package/static/assets/index-BcCuKdbf.css +1 -0
  102. package/static/assets/{index-htJaaOEZ.js → index-C7-vaKc0.js} +1 -1
  103. package/static/assets/{index-M-XcYp88.js → index-CEVCklYW.js} +1 -1
  104. package/static/assets/{index-B8B_4B2l.js → index-CdbMr7EO.js} +1 -1
  105. package/static/assets/{index-DHAvHhw0.js → index-Cop1vyXt.js} +1 -1
  106. package/static/assets/{index-CK5AHHmM.js → index-Ct1TqN9g.js} +1 -1
  107. package/static/assets/{index-D-5sddKG.js → index-CvaJ85WT.js} +1 -1
  108. package/static/assets/{index-BLjvGp1F.js → index-DHyZkKDt.js} +1 -1
  109. package/static/assets/{index-C3ao8yMv.js → index-DeFIoxHB.js} +1 -1
  110. package/static/assets/{index-CoeRBZRl.js → index-DiWum-Qk.js} +1 -1
  111. package/static/assets/{index-DffngCzC.js → index-DkcxAJRd.js} +1 -1
  112. package/static/assets/{index-UDlexUv4.js → index-JMlWoOlR.js} +1 -1
  113. package/static/assets/{index-Bft1WzL9.js → index-d2atEU4g.js} +1 -1
  114. package/static/assets/{index-CdmUQF6-.js → index-p7Qpxih7.js} +1 -1
  115. package/static/assets/{index-CiS46Fde.js → index-q465oP8l.js} +1 -1
  116. package/static/assets/{info-Na9GqbtC.js → info-gGFJAYNn.js} +1 -1
  117. package/static/assets/{label-CHVVHrlr.js → label-CSt-eWXG.js} +1 -1
  118. package/static/assets/{markdown-editor-CT9CPLw5.js → markdown-editor-C6ZusrL3.js} +3 -3
  119. package/static/assets/{message-square-B5NR6hzj.js → message-square-B-XWYk3x.js} +1 -1
  120. package/static/assets/{paperclip-SI0kWfGf.js → paperclip-Drtxq0HD.js} +1 -1
  121. package/static/assets/{pause-DKI9nsrI.js → pause-fdtoI1yQ.js} +1 -1
  122. package/static/assets/{play-BTA0gBuh.js → play-BjJrEDlO.js} +1 -1
  123. package/static/assets/{radio-group-BO2__pxZ.js → radio-group-CLFgSQkD.js} +1 -1
  124. package/static/assets/{refresh-cw-DLJpfa8_.js → refresh-cw-DF2wDnWT.js} +1 -1
  125. package/static/assets/{search-SRuczbr5.js → search-CYS9xEgy.js} +1 -1
  126. package/static/assets/{select-D8HyxWyg.js → select-C7W_IjpH.js} +1 -1
  127. package/static/assets/{switch-Ck0OeSLk.js → switch-CeUexKh7.js} +1 -1
  128. package/static/assets/{tabs-CmFe8eVW.js → tabs-CqVmSyiJ.js} +1 -1
  129. package/static/assets/{tag-BTjGQC_2.js → tag-Mob815Ck.js} +1 -1
  130. package/static/assets/{terminal-preview-BkQIuk__.js → terminal-preview-Byv2z2nW.js} +1 -1
  131. package/static/assets/triangle-alert-DW7a6_v9.js +6 -0
  132. package/static/assets/{use-terminal-CrqBojgD.js → use-terminal-CQe1dgj2.js} +1 -1
  133. package/static/assets/{video-BlwRNgSo.js → video-Ovebr1Iq.js} +1 -1
  134. package/static/index.html +2 -2
  135. package/static/assets/JobDetailPage-ZyEcbPAe.js +0 -1
  136. package/static/assets/MailInboxPage-M5_2gGkB.js +0 -1
  137. package/static/assets/MailProcessingModal-C4PotIFc.js +0 -6
  138. package/static/assets/MailReadPage-D32FUx5o.js +0 -1
  139. package/static/assets/ResourcesPage-BK-EXoIA.js +0 -41
  140. package/static/assets/SchedulePage-BijprHGn.js +0 -4
  141. package/static/assets/index-BWhM9fZn.js +0 -502
  142. package/static/assets/index-oRAlpULD.css +0 -1
@@ -58,12 +58,27 @@ export function normalizeSchedule(schedule) {
58
58
  export function normalizeStatus(status) {
59
59
  return status === 'active' ? 'active' : 'paused';
60
60
  }
61
+ export function toRunMeta(run) {
62
+ return {
63
+ id: run.id,
64
+ jobId: run.jobId,
65
+ trigger: run.trigger,
66
+ status: run.status,
67
+ startedAt: run.startedAt,
68
+ finishedAt: run.finishedAt,
69
+ error: run.error,
70
+ };
71
+ }
72
+ export function withLightweightRuns(job) {
73
+ const { runs, ...rest } = job;
74
+ return { ...rest, runs: runs.map(toRunMeta) };
75
+ }
61
76
  export async function GET(c) {
62
77
  try {
63
78
  const jobs = await store.listJobs();
64
79
  return c.json({
65
80
  success: true,
66
- data: jobs
81
+ data: jobs.map(withLightweightRuns)
67
82
  });
68
83
  }
69
84
  catch (error) {
@@ -131,7 +146,7 @@ export async function POST(c) {
131
146
  const created = await store.getJob(job.id);
132
147
  return c.json({
133
148
  success: true,
134
- data: created ?? job
149
+ data: withLightweightRuns(created ?? job)
135
150
  }, 201);
136
151
  }
137
152
  catch (error) {
@@ -3,7 +3,7 @@ import { promises as fs } from 'fs';
3
3
  import path from 'path';
4
4
  import { ZodError } from 'zod';
5
5
  import { listTasks, getTask, createTask, updateTask, deleteTask, getContext, updateContext, appendContext, replaceContextSection, listKnowledge, getKnowledge, createKnowledge, updateKnowledge, listEvents, } from '@lovelybunch/core';
6
- import { tasksFullTool, knowledgeTool, normalizeKnowledgeMetadata, eventsTool, projectContextTool, architectureContextTool, roleContextTool, resourcesTool, listConnectorsTool, connectorRequestTool, resolveConnectorUrl } from '@lovelybunch/mcp';
6
+ import { tasksFullTool, knowledgeTool, normalizeKnowledgeMetadata, eventsTool, roleContextTool, agentsContextTool, teamContextTool, memoryContextTool, resourcesTool, listConnectorsTool, connectorRequestTool, resolveConnectorUrl } from '@lovelybunch/mcp';
7
7
  import { FileStorageAdapter } from '../../../../lib/storage/file-storage.js';
8
8
  import { homedir } from 'os';
9
9
  import { readFileSync, existsSync } from 'fs';
@@ -104,14 +104,15 @@ app.get('/', async (c) => {
104
104
  }
105
105
  const names = Object.keys(externalServers);
106
106
  // Add built-in tools (include full JSON schema for parameters)
107
- // Note: tasks now supports full CRUD, knowledge/project/architecture are read+write, events is read-only
107
+ // Note: tasks now supports full CRUD, knowledge/context tools are read+write, events is read-only
108
108
  const builtInTools = {
109
109
  tasks: tasksFullTool,
110
110
  knowledge_documents: knowledgeTool,
111
111
  activity_events: eventsTool,
112
- project_context: projectContextTool,
113
- architecture_context: architectureContextTool,
114
112
  role_context: roleContextTool,
113
+ agents_context: agentsContextTool,
114
+ team_context: teamContextTool,
115
+ memory_context: memoryContextTool,
115
116
  resources: resourcesTool,
116
117
  list_connectors: listConnectorsTool,
117
118
  connector_request: connectorRequestTool
@@ -134,15 +135,16 @@ app.get('/', async (c) => {
134
135
  */
135
136
  app.get('/schema', async (c) => {
136
137
  try {
137
- // Note: tasks now supports full CRUD, knowledge/project/architecture are read+write, events is read-only
138
+ // Note: tasks now supports full CRUD, knowledge/context tools are read+write, events is read-only
138
139
  const schema = {
139
140
  tools: {
140
141
  tasks: tasksFullTool,
141
142
  knowledge_documents: knowledgeTool,
142
143
  activity_events: eventsTool,
143
- project_context: projectContextTool,
144
- architecture_context: architectureContextTool,
145
144
  role_context: roleContextTool,
145
+ agents_context: agentsContextTool,
146
+ team_context: teamContextTool,
147
+ memory_context: memoryContextTool,
146
148
  resources: resourcesTool,
147
149
  list_connectors: listConnectorsTool,
148
150
  connector_request: connectorRequestTool
@@ -174,15 +176,18 @@ app.post('/execute', async (c) => {
174
176
  if (tool === 'activity_events') {
175
177
  return await executeEventsTool(c, args);
176
178
  }
177
- if (tool === 'project_context') {
178
- return await executeProjectContextTool(c, args);
179
- }
180
- if (tool === 'architecture_context') {
181
- return await executeArchitectureContextTool(c, args);
182
- }
183
179
  if (tool === 'role_context') {
184
180
  return await executeRoleContextTool(c, args);
185
181
  }
182
+ if (tool === 'agents_context') {
183
+ return await executeAgentsContextTool(c, args);
184
+ }
185
+ if (tool === 'team_context') {
186
+ return await executeTeamContextTool(c, args);
187
+ }
188
+ if (tool === 'memory_context') {
189
+ return await executeMemoryContextTool(c, args);
190
+ }
186
191
  if (tool === 'resources') {
187
192
  return await executeResourcesTool(c, args);
188
193
  }
@@ -482,15 +487,18 @@ async function executeContextTool(c, contextType, args) {
482
487
  }
483
488
  }
484
489
  // Wrapper functions for each context type (maintain API compatibility)
485
- async function executeProjectContextTool(c, args) {
486
- return executeContextTool(c, 'project', args);
487
- }
488
- async function executeArchitectureContextTool(c, args) {
489
- return executeContextTool(c, 'architecture', args);
490
- }
491
490
  async function executeRoleContextTool(c, args) {
492
491
  return executeContextTool(c, 'role', args);
493
492
  }
493
+ async function executeAgentsContextTool(c, args) {
494
+ return executeContextTool(c, 'agents', args);
495
+ }
496
+ async function executeTeamContextTool(c, args) {
497
+ return executeContextTool(c, 'team', args);
498
+ }
499
+ async function executeMemoryContextTool(c, args) {
500
+ return executeContextTool(c, 'memory', args);
501
+ }
494
502
  // Resources tool executor — proxies to the resource API endpoints on the same server
495
503
  async function executeResourcesTool(c, args) {
496
504
  const { operation, query, type_filter, resource_id, prompt, model, aspect_ratio, text, voice, duration, resolution, url, tags, description } = args;
@@ -70,6 +70,7 @@ const THUMBNAILS_DIR = path.join(RESOURCES_DIR, 'thumbnails');
70
70
  // Model ID mapping from frontend values to Replicate model identifiers
71
71
  const MODEL_ID_MAP = {
72
72
  'nano-banana-pro': 'google/nano-banana-pro',
73
+ 'nano-banana-2': 'google/nano-banana-2',
73
74
  'flux-2-dev': 'black-forest-labs/flux-2-dev',
74
75
  'flux-2-pro': 'black-forest-labs/flux-2-pro',
75
76
  'gpt-image-1.5': 'openai/gpt-image-1.5',
@@ -135,7 +136,7 @@ export async function POST(c) {
135
136
  }, 400);
136
137
  }
137
138
  const body = await c.req.json();
138
- const { prompt, model = 'nano-banana-pro', dimensions, resolution, output_format = 'png', output_quality, quality, go_fast, safety_tolerance, background, image_input,
139
+ const { prompt, model = 'nano-banana-2', dimensions, resolution, output_format = 'png', output_quality, quality, go_fast, safety_tolerance, background, image_input,
139
140
  // Legacy
140
141
  inspiration } = body;
141
142
  if (!prompt) {
@@ -215,7 +216,7 @@ export async function POST(c) {
215
216
  }
216
217
  }
217
218
  // Map model selector value to Replicate model ID
218
- const replicateModelId = MODEL_ID_MAP[model] || MODEL_ID_MAP['nano-banana-pro'];
219
+ const replicateModelId = MODEL_ID_MAP[model] || MODEL_ID_MAP['nano-banana-2'];
219
220
  // Build model-specific input payload
220
221
  const input = {
221
222
  prompt: fullPrompt,
@@ -233,7 +234,13 @@ export async function POST(c) {
233
234
  }
234
235
  // Model-specific parameters
235
236
  if (model === 'nano-banana-pro' || model === 'Nano Banana Pro') {
236
- // Nano Banana Pro specific settings
237
+ input.resolution = resolution || '2K';
238
+ input.safety_filter_level = 'block_only_high';
239
+ if (imageInputArray.length > 0) {
240
+ input.image_input = imageInputArray;
241
+ }
242
+ }
243
+ else if (model === 'nano-banana-2') {
237
244
  input.resolution = resolution || '2K';
238
245
  input.safety_filter_level = 'block_only_high';
239
246
  if (imageInputArray.length > 0) {
@@ -7,9 +7,6 @@ export declare function getConfig(c: Context): Promise<(Response & import("hono"
7
7
  success: true;
8
8
  data: {
9
9
  enabled: boolean;
10
- channelId: string;
11
- channelName: string;
12
- siteUrl: string;
13
10
  notifications: {
14
11
  proposals: {
15
12
  created: boolean;
@@ -24,6 +21,9 @@ export declare function getConfig(c: Context): Promise<(Response & import("hono"
24
21
  merge: boolean;
25
22
  };
26
23
  };
24
+ channelId: string;
25
+ channelName: string;
26
+ siteUrl: string;
27
27
  hasBotToken: boolean;
28
28
  hasSigningSecret: boolean;
29
29
  };
@@ -39,9 +39,6 @@ export declare function updateConfig(c: Context): Promise<(Response & import("ho
39
39
  success: true;
40
40
  data: {
41
41
  enabled: boolean;
42
- channelId: string;
43
- channelName: string;
44
- siteUrl: string;
45
42
  notifications: {
46
43
  proposals: {
47
44
  created: boolean;
@@ -56,6 +53,9 @@ export declare function updateConfig(c: Context): Promise<(Response & import("ho
56
53
  merge: boolean;
57
54
  };
58
55
  };
56
+ channelId: string;
57
+ channelName: string;
58
+ siteUrl: string;
59
59
  hasBotToken: boolean;
60
60
  hasSigningSecret: boolean;
61
61
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovelybunch/api",
3
- "version": "1.0.76-alpha.10",
3
+ "version": "1.0.76-alpha.12",
4
4
  "type": "module",
5
5
  "main": "dist/server-with-static.js",
6
6
  "exports": {
@@ -37,9 +37,9 @@
37
37
  "@ai-sdk/anthropic": "^3.0.41",
38
38
  "@hono/node-server": "^1.13.7",
39
39
  "@hono/node-ws": "^1.0.6",
40
- "@lovelybunch/core": "^1.0.76-alpha.10",
41
- "@lovelybunch/mcp": "^1.0.76-alpha.10",
42
- "@lovelybunch/types": "^1.0.76-alpha.10",
40
+ "@lovelybunch/core": "^1.0.76-alpha.12",
41
+ "@lovelybunch/mcp": "^1.0.76-alpha.12",
42
+ "@lovelybunch/types": "^1.0.76-alpha.12",
43
43
  "adm-zip": "^0.5.16",
44
44
  "ai": "^6.0.79",
45
45
  "bcryptjs": "^2.4.3",
@@ -1 +1 @@
1
- import{r as a,A as p,j as e,v,bL as y,B as N,n as w,C as b}from"./index-BWhM9fZn.js";import{C as c,a as d,b as k,c as C}from"./card-jBf8qQSy.js";import{B as m}from"./badge-CKqDVhJv.js";import{R as E}from"./refresh-cw-DLJpfa8_.js";const A=5e3;function $(){const[n,o]=a.useState([]),[i,x]=a.useState(!0),[h,u]=a.useState(new Set),l=a.useCallback(async()=>{x(!0);try{const s=await fetch(`${p}/api/v1/events?limit=${A}`);if(!s.ok)throw new Error("Failed to load events");const t=await s.json();o(Array.isArray(t.items)?[...t.items].reverse():[])}catch(s){console.error("Failed to load events:",s),o([])}finally{x(!1)}},[]),g=a.useCallback(s=>{u(t=>{const r=new Set(t);return r.has(s)?r.delete(s):r.add(s),r})},[]);a.useEffect(()=>{l()},[l]);const f=s=>{if(!s)return"Unknown time";try{return new Date(s).toLocaleString()}catch{return s}},j=s=>{switch(s?.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 i?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(c,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(v,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading events..."})]})})})]}):n.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(c,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(y,{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",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Activity"}),e.jsxs("p",{className:"text-muted-foreground",children:["View system activity and events (",n.length," events)"]})]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>void l(),disabled:i,children:[e.jsx(E,{className:`h-4 w-4 mr-2 ${i?"animate-spin":""}`}),"Refresh"]})]}),e.jsx("div",{className:"space-y-3",children:n.map(s=>{const t=h.has(s.seq);return e.jsxs(c,{className:"transition-colors",children:[e.jsx(k,{className:"py-3 cursor-pointer hover:bg-muted/30",onClick:()=>g(s.seq),children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-2 flex-1 min-w-0",children:[t?e.jsx(w,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}):e.jsx(b,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}),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(C,{className:"text-sm font-medium",children:["#",s.seq]}),s.kind&&e.jsx(m,{variant:"outline",className:"text-xs",children:s.kind}),s.level&&e.jsx(m,{className:`text-xs ${j(s.level)}`,children:s.level})]}),s.message&&e.jsx("p",{className:`text-sm text-muted-foreground ${t?"":"truncate"}`,children:s.message})]})]}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:f(s.ts)})]})}),t&&e.jsx(d,{className:"pt-0 pb-4",children:e.jsx("pre",{className:"text-xs bg-muted p-3 rounded-md overflow-x-auto",children:JSON.stringify(s,null,2)})})]},s.seq)})})]})}export{$ as default};
1
+ import{r as a,A as p,j as e,v,bL as y,B as N,n as w,C as b}from"./index-6zt5f3rT.js";import{C as c,a as d,b as k,c as C}from"./card-T1Zl_t-O.js";import{B as m}from"./badge-DXtacKLi.js";import{R as E}from"./refresh-cw-DF2wDnWT.js";const A=5e3;function $(){const[n,o]=a.useState([]),[i,x]=a.useState(!0),[h,u]=a.useState(new Set),l=a.useCallback(async()=>{x(!0);try{const s=await fetch(`${p}/api/v1/events?limit=${A}`);if(!s.ok)throw new Error("Failed to load events");const t=await s.json();o(Array.isArray(t.items)?[...t.items].reverse():[])}catch(s){console.error("Failed to load events:",s),o([])}finally{x(!1)}},[]),g=a.useCallback(s=>{u(t=>{const r=new Set(t);return r.has(s)?r.delete(s):r.add(s),r})},[]);a.useEffect(()=>{l()},[l]);const f=s=>{if(!s)return"Unknown time";try{return new Date(s).toLocaleString()}catch{return s}},j=s=>{switch(s?.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 i?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(c,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(v,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading events..."})]})})})]}):n.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(c,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(y,{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",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Activity"}),e.jsxs("p",{className:"text-muted-foreground",children:["View system activity and events (",n.length," events)"]})]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>void l(),disabled:i,children:[e.jsx(E,{className:`h-4 w-4 mr-2 ${i?"animate-spin":""}`}),"Refresh"]})]}),e.jsx("div",{className:"space-y-3",children:n.map(s=>{const t=h.has(s.seq);return e.jsxs(c,{className:"transition-colors",children:[e.jsx(k,{className:"py-3 cursor-pointer hover:bg-muted/30",onClick:()=>g(s.seq),children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-2 flex-1 min-w-0",children:[t?e.jsx(w,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}):e.jsx(b,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}),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(C,{className:"text-sm font-medium",children:["#",s.seq]}),s.kind&&e.jsx(m,{variant:"outline",className:"text-xs",children:s.kind}),s.level&&e.jsx(m,{className:`text-xs ${j(s.level)}`,children:s.level})]}),s.message&&e.jsx("p",{className:`text-sm text-muted-foreground ${t?"":"truncate"}`,children:s.message})]})]}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:f(s.ts)})]})}),t&&e.jsx(d,{className:"pt-0 pb-4",children:e.jsx("pre",{className:"text-xs bg-muted p-3 rounded-md overflow-x-auto",children:JSON.stringify(s,null,2)})})]},s.seq)})})]})}export{$ as default};
@@ -1,4 +1,4 @@
1
- import{u as p,a as j,r as n,A as l,j as e,B as h,L as v,a1 as N}from"./index-BWhM9fZn.js";import{C as m,a as x,b as C,c as S}from"./card-jBf8qQSy.js";import{M as w}from"./markdown-editor-CT9CPLw5.js";import{A as y}from"./arrow-left-CkQCXG-O.js";import{C as A}from"./circle-check-big-DDQIqE0G.js";import"./index-CdmUQF6-.js";function F(){const f=p(),{toast:t}=j(),[a,i]=n.useState(""),[g,r]=n.useState(!0),[o,c]=n.useState(!1);n.useEffect(()=>{fetch(`${l}/api/v1/context/agents`).then(s=>s.json()).then(s=>{s.success&&i(s.document.content.trim()),r(!1)}).catch(s=>{console.error("Failed to load context:",s),t({title:"Error",description:"Failed to load agents definition",variant:"destructive"}),r(!1)})},[t]);const u=async()=>{c(!0);try{const d=await(await fetch(`${l}/api/v1/context/agents`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:a,metadata:{}})})).json();if(d.success)t({title:"Success",description:"Agents definition saved successfully",action:e.jsx(A,{className:"h-4 w-4"})}),f("/context/agents");else throw new Error(d.error||"Failed to save")}catch(s){console.error("Save error:",s),t({title:"Error",description:"Failed to save agents definition",variant:"destructive"})}finally{c(!1)}};return g?e.jsx("div",{className:"space-y-6",children:e.jsx(m,{children:e.jsx(x,{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 Agents Definition"}),e.jsx("p",{className:"text-muted-foreground text-sm hidden sm:block",children:"Define agents, their capabilities, and configurations"})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(h,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(v,{to:"/context/agents",className:"text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(y,{className:"w-4 h-4"})})}),e.jsxs(h,{onClick:u,disabled:o,size:"sm",children:[e.jsx(N,{className:"w-4 h-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:o?"Saving...":"Save"})]})]})]}),e.jsxs(m,{children:[e.jsx(C,{children:e.jsx(S,{children:"Agents Documentation"})}),e.jsx(x,{children:e.jsx(w,{value:a,onChange:s=>i(s||""),placeholder:`Write your agents definition in markdown...
1
+ import{u as p,a as j,r as n,A as l,j as e,B as h,L as v,a1 as N}from"./index-6zt5f3rT.js";import{C as m,a as x,b as C,c as S}from"./card-T1Zl_t-O.js";import{M as w}from"./markdown-editor-C6ZusrL3.js";import{A as y}from"./arrow-left-BMmwy6t5.js";import{C as A}from"./circle-check-big-Dw0wgLkY.js";import"./index-p7Qpxih7.js";function F(){const f=p(),{toast:t}=j(),[a,i]=n.useState(""),[g,r]=n.useState(!0),[o,c]=n.useState(!1);n.useEffect(()=>{fetch(`${l}/api/v1/context/agents`).then(s=>s.json()).then(s=>{s.success&&i(s.document.content.trim()),r(!1)}).catch(s=>{console.error("Failed to load context:",s),t({title:"Error",description:"Failed to load agents definition",variant:"destructive"}),r(!1)})},[t]);const u=async()=>{c(!0);try{const d=await(await fetch(`${l}/api/v1/context/agents`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:a,metadata:{}})})).json();if(d.success)t({title:"Success",description:"Agents definition saved successfully",action:e.jsx(A,{className:"h-4 w-4"})}),f("/context/agents");else throw new Error(d.error||"Failed to save")}catch(s){console.error("Save error:",s),t({title:"Error",description:"Failed to save agents definition",variant:"destructive"})}finally{c(!1)}};return g?e.jsx("div",{className:"space-y-6",children:e.jsx(m,{children:e.jsx(x,{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 Agents Definition"}),e.jsx("p",{className:"text-muted-foreground text-sm hidden sm:block",children:"Define agents, their capabilities, and configurations"})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(h,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(v,{to:"/context/agents",className:"text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(y,{className:"w-4 h-4"})})}),e.jsxs(h,{onClick:u,disabled:o,size:"sm",children:[e.jsx(N,{className:"w-4 h-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:o?"Saving...":"Save"})]})]})]}),e.jsxs(m,{children:[e.jsx(C,{children:e.jsx(S,{children:"Agents Documentation"})}),e.jsx(x,{children:e.jsx(w,{value:a,onChange:s=>i(s||""),placeholder:`Write your agents definition in markdown...
2
2
 
3
3
  ## Agent Definitions
4
4
 
@@ -1 +1 @@
1
- import{a as g,r as t,A as N,j as e,v,aw as C,B as a,L as d,_ as l,M as w,av as y,ar as E}from"./index-BWhM9fZn.js";import{C as i,a as c,b}from"./card-jBf8qQSy.js";import{c as A}from"./clipboard-B9ndUJKl.js";function D(){const{toast:r}=g(),[o,m]=t.useState(null),[x,h]=t.useState(!0),[u,n]=t.useState(!1);t.useEffect(()=>{fetch(`${N}/api/v1/context/agents`).then(s=>{if(s.ok)return s.json();throw new Error("Not found")}).then(s=>{s.success?(m(s.document),n(!0)):n(!1)}).catch(()=>{n(!1)}).finally(()=>{h(!1)})},[]);const p=async()=>{const s=".nut/context/agents.md";try{await A(s),r({title:"Copied!",description:`Path ${s} copied to clipboard`})}catch(f){console.error("Failed to copy path:",f),r({title:"Error",description:"Failed to copy path to clipboard",variant:"destructive"})}},j=()=>{const s=new CustomEvent("discuss-in-chat",{detail:{type:"context",id:"agents-md",filename:"agents.md",name:"agents.md",path:".nut/context/agents.md"}});window.dispatchEvent(s)};return x?e.jsx("div",{className:"space-y-6",children:e.jsx(i,{children:e.jsx(c,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(v,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading agents definition..."})]})})})}):!u||!o?e.jsx("div",{className:"space-y-6",children:e.jsx(i,{children:e.jsx(c,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(C,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No Agents Definition Found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Agents definition will appear here once created."}),e.jsx(a,{className:"mt-4",asChild:!0,children:e.jsxs(d,{to:"/context/agents/edit",children:[e.jsx(l,{className:"h-4 w-4 mr-2"}),"Create Agents Definition"]})})]})})})}):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:"Agents"}),e.jsx("p",{className:"text-muted-foreground",children:"Agent definitions and configurations"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(a,{variant:"outline",size:"sm",onClick:j,children:[e.jsx(w,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Discuss"})]}),e.jsxs(a,{variant:"outline",size:"sm",onClick:p,children:[e.jsx(y,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Copy Path"})]}),e.jsx(a,{size:"sm",asChild:!0,children:e.jsxs(d,{to:"/context/agents/edit",children:[e.jsx(l,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Edit"})]})})]})]}),e.jsxs(i,{children:[e.jsx(b,{className:"pb-0"}),e.jsx(c,{children:e.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:e.jsx(E,{children:o.content||"No content available"})})})]})]})}export{D as default};
1
+ import{a as g,r as t,A as N,j as e,v,aw as C,B as a,L as d,_ as l,M as w,av as y,ar as E}from"./index-6zt5f3rT.js";import{C as i,a as c,b}from"./card-T1Zl_t-O.js";import{c as A}from"./clipboard-B9ndUJKl.js";function D(){const{toast:r}=g(),[o,m]=t.useState(null),[x,h]=t.useState(!0),[u,n]=t.useState(!1);t.useEffect(()=>{fetch(`${N}/api/v1/context/agents`).then(s=>{if(s.ok)return s.json();throw new Error("Not found")}).then(s=>{s.success?(m(s.document),n(!0)):n(!1)}).catch(()=>{n(!1)}).finally(()=>{h(!1)})},[]);const p=async()=>{const s=".nut/context/agents.md";try{await A(s),r({title:"Copied!",description:`Path ${s} copied to clipboard`})}catch(f){console.error("Failed to copy path:",f),r({title:"Error",description:"Failed to copy path to clipboard",variant:"destructive"})}},j=()=>{const s=new CustomEvent("discuss-in-chat",{detail:{type:"context",id:"agents-md",filename:"agents.md",name:"agents.md",path:".nut/context/agents.md"}});window.dispatchEvent(s)};return x?e.jsx("div",{className:"space-y-6",children:e.jsx(i,{children:e.jsx(c,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(v,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading agents definition..."})]})})})}):!u||!o?e.jsx("div",{className:"space-y-6",children:e.jsx(i,{children:e.jsx(c,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(C,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No Agents Definition Found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Agents definition will appear here once created."}),e.jsx(a,{className:"mt-4",asChild:!0,children:e.jsxs(d,{to:"/context/agents/edit",children:[e.jsx(l,{className:"h-4 w-4 mr-2"}),"Create Agents Definition"]})})]})})})}):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:"Agents"}),e.jsx("p",{className:"text-muted-foreground",children:"Agent definitions and configurations"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(a,{variant:"outline",size:"sm",onClick:j,children:[e.jsx(w,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Discuss"})]}),e.jsxs(a,{variant:"outline",size:"sm",onClick:p,children:[e.jsx(y,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Copy Path"})]}),e.jsx(a,{size:"sm",asChild:!0,children:e.jsxs(d,{to:"/context/agents/edit",children:[e.jsx(l,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Edit"})]})})]})]}),e.jsxs(i,{children:[e.jsx(b,{className:"pb-0"}),e.jsx(c,{children:e.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:e.jsx(E,{children:o.content||"No content available"})})})]})]})}export{D as default};
@@ -1,2 +1,2 @@
1
- import{t as z,r as t,bE as y,j as e,B as a,P as R,bF as X,H as J,D as j,b as g,d as v,f,g as A,I as F,Y as N,af as W,w as i}from"./index-BWhM9fZn.js";import{C as G,b as Q,c as V,d as Z,a as _}from"./card-jBf8qQSy.js";import{L as w}from"./label-CHVVHrlr.js";import{B as ee}from"./badge-CKqDVhJv.js";import{A as I,a as C}from"./alert-CMfexl-V.js";import{I as L}from"./info-Na9GqbtC.js";import{C as se}from"./circle-alert-DqK0nUqF.js";function oe(){const{authEnabled:n}=z(),[P,k]=t.useState([]),[b,K]=t.useState(!0),[O,l]=t.useState(!1),[M,d]=t.useState(!1),[x,D]=t.useState(""),[h,E]=t.useState("never"),[c,S]=t.useState(null),[m,o]=t.useState(null);t.useEffect(()=>{p()},[]);const p=async()=>{K(!0);try{const s=await y("/api/v1/api-keys");s.success&&k(s.data?.apiKeys||[])}catch(s){console.error("Failed to load API keys:",s),k([])}finally{K(!1)}},U=async()=>{if(!x.trim()){i({title:"Error",description:"Please provide a name for the API key",variant:"destructive"});return}try{const s={name:x,scopes:["*"]};h!=="never"&&(s.expiresIn=h);const r=await y("/api/v1/api-keys",{method:"POST",body:JSON.stringify(s)});r.success&&(S(r.data),l(!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(),o(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"}),Y=s=>s?new Date(s)<new Date:!1,$=typeof window<"u"?window.location.origin:"http://localhost:3000",q=c?`curl -H "X-API-Key: ${c.key}" \\
1
+ import{t as z,r as t,bE as y,j as e,B as a,P as R,bF as X,H as J,D as j,b as g,d as v,f,g as A,I as F,Y as N,af as W,w as i}from"./index-6zt5f3rT.js";import{C as G,b as Q,c as V,d as Z,a as _}from"./card-T1Zl_t-O.js";import{L as w}from"./label-CSt-eWXG.js";import{B as ee}from"./badge-DXtacKLi.js";import{A as I,a as C}from"./alert-BLA1YxSF.js";import{I as L}from"./info-gGFJAYNn.js";import{C as se}from"./circle-alert-C-TQDAZH.js";function oe(){const{authEnabled:n}=z(),[P,k]=t.useState([]),[b,K]=t.useState(!0),[O,l]=t.useState(!1),[M,d]=t.useState(!1),[x,D]=t.useState(""),[h,E]=t.useState("never"),[c,S]=t.useState(null),[m,o]=t.useState(null);t.useEffect(()=>{p()},[]);const p=async()=>{K(!0);try{const s=await y("/api/v1/api-keys");s.success&&k(s.data?.apiKeys||[])}catch(s){console.error("Failed to load API keys:",s),k([])}finally{K(!1)}},U=async()=>{if(!x.trim()){i({title:"Error",description:"Please provide a name for the API key",variant:"destructive"});return}try{const s={name:x,scopes:["*"]};h!=="never"&&(s.expiresIn=h);const r=await y("/api/v1/api-keys",{method:"POST",body:JSON.stringify(s)});r.success&&(S(r.data),l(!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(),o(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"}),Y=s=>s?new Date(s)<new Date:!1,$=typeof window<"u"?window.location.origin:"http://localhost:3000",q=c?`curl -H "X-API-Key: ${c.key}" \\
2
2
  + ${$}/api/v1/tasks`:"",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(G,{children:[e.jsx(Q,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Active API Keys"}),e.jsx(Z,{children:"API keys you've created for programmatic access"})]}),e.jsxs(a,{onClick:()=>l(!0),disabled:!n,children:[e.jsx(R,{className:"mr-2 h-4 w-4"}),"Create API Key"]})]})}),e.jsx(_,{children:P.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:P.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}),Y(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:()=>o(s.id),children:e.jsx(J,{className:"h-4 w-4 text-destructive"})})]},s.id))})})]}),e.jsx(j,{open:O,onOpenChange:l,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:x,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:h,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:()=>l(!1),children:"Cancel"}),e.jsx(a,{onClick:U,disabled:!n,children:"Create API Key"})]})]})}),e.jsx(j,{open:M,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(se,{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(W,{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:q})})]})]}),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&&o(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:()=>o(null),children:"Cancel"}),e.jsx(a,{variant:"destructive",onClick:()=>m&&B(m),children:"Delete API Key"})]})]})})]})}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{u as L,a as A,r as o,A as N,j as e,B as w,L as D,a1 as M,I as c}from"./index-BWhM9fZn.js";import{C as u,a as p,b as C,c as b}from"./card-jBf8qQSy.js";import{L as n}from"./label-CHVVHrlr.js";import{M as I}from"./markdown-editor-CT9CPLw5.js";import{A as T}from"./arrow-left-CkQCXG-O.js";import{C as B}from"./circle-check-big-DDQIqE0G.js";import"./index-CdmUQF6-.js";function H(){const S=L(),{toast:i}=A(),[s,g]=o.useState({stack:{runtime:"",framework:"",language:"",database:"",deployment:"",repository:""}}),[x,j]=o.useState(""),[F,v]=o.useState(!0),[y,f]=o.useState(!1);o.useEffect(()=>{fetch(`${N}/api/v1/context/architecture`).then(t=>t.json()).then(t=>{if(t.success){const a=t.document,d={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||""}};g(d),j(a.content.trim())}v(!1)}).catch(t=>{console.error("Failed to load context:",t),i({title:"Error",description:"Failed to load architecture documentation",variant:"destructive"}),v(!1)})},[i]);const E=async()=>{f(!0);try{const a=await(await fetch(`${N}/api/v1/context/architecture`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:x,metadata:{stack:s.stack}})})).json();if(a.success)i({title:"Success",description:"Architecture documentation saved successfully",action:e.jsx(B,{className:"h-4 w-4"})}),S("/context/architecture");else throw new Error(a.error||"Failed to save context")}catch(t){console.error("Save error:",t),i({title:"Error",description:"Failed to save architecture documentation",variant:"destructive"})}finally{f(!1)}},r=(t,a)=>{g(d=>{const k={...d},l=t.split(".");let m=k;for(let h=0;h<l.length-1;h++)m=m[l[h]];return m[l[l.length-1]]=a,k})};return F?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(w,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(D,{to:"/context/architecture",className:"text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(T,{className:"w-4 h-4"})})}),e.jsxs(w,{onClick:E,disabled:y,size:"sm",children:[e.jsx(M,{className:"w-4 h-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:y?"Saving...":"Save"})]})]})]}),e.jsxs(u,{children:[e.jsx(C,{children:e.jsx(b,{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(n,{htmlFor:"runtime",children:"Runtime"}),e.jsx(c,{id:"runtime",value:s.stack.runtime,onChange:t=>r("stack.runtime",t.target.value),placeholder:"node|python|go|etc"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"framework",children:"Framework"}),e.jsx(c,{id:"framework",value:s.stack.framework,onChange:t=>r("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(n,{htmlFor:"language",children:"Language"}),e.jsx(c,{id:"language",value:s.stack.language,onChange:t=>r("stack.language",t.target.value),placeholder:"typescript|javascript|python|go|etc"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"database",children:"Database"}),e.jsx(c,{id:"database",value:s.stack.database,onChange:t=>r("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(n,{htmlFor:"deployment",children:"Deployment"}),e.jsx(c,{id:"deployment",value:s.stack.deployment,onChange:t=>r("stack.deployment",t.target.value),placeholder:"docker|kubernetes|vercel|aws|etc"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"repository",children:"Repository"}),e.jsx(c,{id:"repository",value:s.stack.repository,onChange:t=>r("stack.repository",t.target.value),placeholder:"https://github.com/yourorg/yourproject"})]})]})]})]}),e.jsxs(u,{children:[e.jsx(C,{children:e.jsx(b,{children:"Architecture Documentation"})}),e.jsx(p,{children:e.jsx(I,{value:x,onChange:t=>j(t||""),placeholder:`Write your architecture documentation in markdown...
1
+ import{u as L,a as A,r as o,A as N,j as e,B as w,L as D,a1 as M,I as c}from"./index-6zt5f3rT.js";import{C as u,a as p,b as C,c as b}from"./card-T1Zl_t-O.js";import{L as n}from"./label-CSt-eWXG.js";import{M as I}from"./markdown-editor-C6ZusrL3.js";import{A as T}from"./arrow-left-BMmwy6t5.js";import{C as B}from"./circle-check-big-Dw0wgLkY.js";import"./index-p7Qpxih7.js";function H(){const S=L(),{toast:i}=A(),[s,g]=o.useState({stack:{runtime:"",framework:"",language:"",database:"",deployment:"",repository:""}}),[x,j]=o.useState(""),[F,v]=o.useState(!0),[y,f]=o.useState(!1);o.useEffect(()=>{fetch(`${N}/api/v1/context/architecture`).then(t=>t.json()).then(t=>{if(t.success){const a=t.document,d={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||""}};g(d),j(a.content.trim())}v(!1)}).catch(t=>{console.error("Failed to load context:",t),i({title:"Error",description:"Failed to load architecture documentation",variant:"destructive"}),v(!1)})},[i]);const E=async()=>{f(!0);try{const a=await(await fetch(`${N}/api/v1/context/architecture`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:x,metadata:{stack:s.stack}})})).json();if(a.success)i({title:"Success",description:"Architecture documentation saved successfully",action:e.jsx(B,{className:"h-4 w-4"})}),S("/context/architecture");else throw new Error(a.error||"Failed to save context")}catch(t){console.error("Save error:",t),i({title:"Error",description:"Failed to save architecture documentation",variant:"destructive"})}finally{f(!1)}},r=(t,a)=>{g(d=>{const k={...d},l=t.split(".");let m=k;for(let h=0;h<l.length-1;h++)m=m[l[h]];return m[l[l.length-1]]=a,k})};return F?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(w,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(D,{to:"/context/architecture",className:"text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(T,{className:"w-4 h-4"})})}),e.jsxs(w,{onClick:E,disabled:y,size:"sm",children:[e.jsx(M,{className:"w-4 h-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:y?"Saving...":"Save"})]})]})]}),e.jsxs(u,{children:[e.jsx(C,{children:e.jsx(b,{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(n,{htmlFor:"runtime",children:"Runtime"}),e.jsx(c,{id:"runtime",value:s.stack.runtime,onChange:t=>r("stack.runtime",t.target.value),placeholder:"node|python|go|etc"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"framework",children:"Framework"}),e.jsx(c,{id:"framework",value:s.stack.framework,onChange:t=>r("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(n,{htmlFor:"language",children:"Language"}),e.jsx(c,{id:"language",value:s.stack.language,onChange:t=>r("stack.language",t.target.value),placeholder:"typescript|javascript|python|go|etc"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"database",children:"Database"}),e.jsx(c,{id:"database",value:s.stack.database,onChange:t=>r("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(n,{htmlFor:"deployment",children:"Deployment"}),e.jsx(c,{id:"deployment",value:s.stack.deployment,onChange:t=>r("stack.deployment",t.target.value),placeholder:"docker|kubernetes|vercel|aws|etc"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"repository",children:"Repository"}),e.jsx(c,{id:"repository",value:s.stack.repository,onChange:t=>r("stack.repository",t.target.value),placeholder:"https://github.com/yourorg/yourproject"})]})]})]})]}),e.jsxs(u,{children:[e.jsx(C,{children:e.jsx(b,{children:"Architecture Documentation"})}),e.jsx(p,{children:e.jsx(I,{value:x,onChange:t=>j(t||""),placeholder:`Write your architecture documentation in markdown...
2
2
 
3
3
  ## System Design
4
4
 
@@ -1 +1 @@
1
- import{a as v,r as a,A as g,j as e,v as k,F as y,B as l,M as w,av as C,L as b,_ as E,ar as A}from"./index-BWhM9fZn.js";import{C as c,a as r,b as o,c as m}from"./card-jBf8qQSy.js";import{c as D}from"./clipboard-B9ndUJKl.js";function S(){const{toast:d}=v(),[n,h]=a.useState(null),[x,u]=a.useState(!0),[p,i]=a.useState(!1);a.useEffect(()=>{fetch(`${g}/api/v1/context/architecture`).then(t=>{if(t.ok)return t.json();throw new Error("Not found")}).then(t=>{t.success?(h(t.document),i(!0)):i(!1)}).catch(()=>{i(!1)}).finally(()=>{u(!1)})},[]);const j=async()=>{const t=".nut/context/architecture.md";try{await D(t),d({title:"Copied!",description:`Path ${t} copied to clipboard`})}catch(N){console.error("Failed to copy path:",N),d({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(x)return e.jsx("div",{className:"space-y-6",children:e.jsx(c,{children:e.jsx(r,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(k,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading architecture documentation..."})]})})})});if(!p||!n)return e.jsx("div",{className:"space-y-6",children:e.jsx(c,{children:e.jsx(r,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(y,{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=n.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(w,{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:j,children:[e.jsx(C,{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(b,{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.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:e.jsxs(c,{children:[e.jsx(o,{className:"pb-3",children:e.jsx(m,{className:"text-lg font-semibold",children:"Technology Stack"})}),e.jsx(r,{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(c,{children:[e.jsx(o,{children:e.jsx(m,{className:"text-lg font-semibold",children:"Architecture Documentation"})}),e.jsx(r,{children:e.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:e.jsx(A,{children:n.content||"No content available"})})})]})]})}export{S as default};
1
+ import{a as v,r as a,A as g,j as e,v as k,F as y,B as l,M as w,av as C,L as b,_ as E,ar as A}from"./index-6zt5f3rT.js";import{C as c,a as r,b as o,c as m}from"./card-T1Zl_t-O.js";import{c as D}from"./clipboard-B9ndUJKl.js";function S(){const{toast:d}=v(),[n,h]=a.useState(null),[x,u]=a.useState(!0),[p,i]=a.useState(!1);a.useEffect(()=>{fetch(`${g}/api/v1/context/architecture`).then(t=>{if(t.ok)return t.json();throw new Error("Not found")}).then(t=>{t.success?(h(t.document),i(!0)):i(!1)}).catch(()=>{i(!1)}).finally(()=>{u(!1)})},[]);const j=async()=>{const t=".nut/context/architecture.md";try{await D(t),d({title:"Copied!",description:`Path ${t} copied to clipboard`})}catch(N){console.error("Failed to copy path:",N),d({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(x)return e.jsx("div",{className:"space-y-6",children:e.jsx(c,{children:e.jsx(r,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(k,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading architecture documentation..."})]})})})});if(!p||!n)return e.jsx("div",{className:"space-y-6",children:e.jsx(c,{children:e.jsx(r,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(y,{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=n.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(w,{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:j,children:[e.jsx(C,{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(b,{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.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:e.jsxs(c,{children:[e.jsx(o,{className:"pb-3",children:e.jsx(m,{className:"text-lg font-semibold",children:"Technology Stack"})}),e.jsx(r,{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(c,{children:[e.jsx(o,{children:e.jsx(m,{className:"text-lg font-semibold",children:"Architecture Documentation"})}),e.jsx(r,{children:e.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:e.jsx(A,{children:n.content||"No content available"})})})]})]})}export{S as default};
@@ -1,4 +1,4 @@
1
- import{c as Y,t as le,r as n,bE as c,j as e,bD as O,i as ce,D as I,W as M,B as l,b as V,d as $,f as H,g as J,I as j,Y as z,z as oe,E as de,H as he,J as ue,N as xe,O as me,Q as ge,R as je,U as pe,V as ve,w as r}from"./index-BWhM9fZn.js";import{C as p,b as v,c as w,d as f,a as y}from"./card-jBf8qQSy.js";import{L as o}from"./label-CHVVHrlr.js";import{S as _,a as W,b as q,c as B,d as a}from"./select-D8HyxWyg.js";import{S as U}from"./switch-Ck0OeSLk.js";import{B as k}from"./badge-CKqDVhJv.js";import{C as we}from"./circle-alert-DqK0nUqF.js";import"./index-CdmUQF6-.js";import"./chevron-up-CcwaoTsZ.js";/**
1
+ import{c as Y,t as le,r as n,bE as c,j as e,bD as O,i as ce,D as I,W as M,B as l,b as V,d as $,f as H,g as J,I as j,Y as z,z as oe,E as de,H as he,J as ue,N as xe,O as me,Q as ge,R as je,U as pe,V as ve,w as r}from"./index-6zt5f3rT.js";import{C as p,b as v,c as w,d as f,a as y}from"./card-T1Zl_t-O.js";import{L as o}from"./label-CSt-eWXG.js";import{S as _,a as W,b as q,c as B,d as a}from"./select-C7W_IjpH.js";import{S as U}from"./switch-CeUexKh7.js";import{B as k}from"./badge-DXtacKLi.js";import{C as we}from"./circle-alert-C-TQDAZH.js";import"./index-p7Qpxih7.js";import"./chevron-up-C1j8XcMS.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as m,j as e,v as x,A as f}from"./index-BWhM9fZn.js";import{C as w}from"./circle-check-qo4cPVA1.js";import{C as b}from"./circle-x-Bd57ohC5.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 y=()=>{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{y as default};
1
+ import{r as m,j as e,v as x,A as f}from"./index-6zt5f3rT.js";import{C as w}from"./circle-check-D4Eo7NeP.js";import{C as b}from"./circle-x-i-p09ZTc.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 y=()=>{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{y as default};
@@ -1,2 +1,2 @@
1
- import{u as ce,a as de,r as i,j as e,B as r,T as oe,n as M,X as me,F as xe,_ as he,D as ue,b as fe,d as pe,f as je,k as ge,a5 as B,a6 as R,a7 as H,a8 as L,a9 as O,aa as _,a4 as ve,o as Ne,A as T}from"./index-BWhM9fZn.js";import{C as g,b as ye,a as G,c as we}from"./card-jBf8qQSy.js";import{B as U}from"./badge-CKqDVhJv.js";import{u as Se}from"./use-terminal-CrqBojgD.js";import{T as Ce}from"./terminal-preview-BkQIuk__.js";import{S as be,a as ke,b as Ae,c as De,d as w}from"./select-D8HyxWyg.js";import{b as Me,e as Te,d as Ie,c as $e,a as Ee}from"./pipeline-builders-Bkf0wt_O.js";import{R as Pe}from"./refresh-cw-DLJpfa8_.js";import{C as ze,a as Fe}from"./chevrons-up-BtlNQbrw.js";import{P as Be}from"./play-BTA0gBuh.js";import{C as Re}from"./code-Bi-U-NxE.js";import{C as He}from"./chevron-up-CcwaoTsZ.js";import"./xterm-DTxiCjtJ.js";import"./index-CdmUQF6-.js";const Le=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 ss(){const c=ce(),{sessions:x,loading:b,error:I,refreshSessions:S,createSession:V,destroySession:K}=Se(),{toast:v}=de(),[$,W]=i.useState([]),[q,X]=i.useState(!0),[j,k]=i.useState(()=>({})),[A,N]=i.useState(!1),[f,J]=i.useState("claude"),[E,Q]=i.useState(""),[D,P]=i.useState(!1),[h,Y]=i.useState([]),[p,y]=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/tasks`);if(t.ok){const a=await t.json(),n=a.data||a;W(Array.isArray(n)?n:[])}}catch(t){console.error("Error loading tasks:",t)}finally{X(!1)}})()},[]),i.useEffect(()=>{S()},[S]),i.useEffect(()=>{if(!A)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),y(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/skills`);if(t.ok){const a=await t.json(),d=(Array.isArray(a?.documents)?a.documents:[]).map(l=>({id:l.id,name:l?.metadata?.name||l.id,mcpServers:Le(l?.metadata?.metadata?.mcpServers)}));se(d),C(l=>l.filter(F=>d.some(le=>le.id===F)))}}catch(t){console.error("Failed to load skills",t)}})()},[A]),i.useEffect(()=>{o.length!==0&&y(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.mcpServers.forEach(l=>{(!a||a.has(l))&&t.add(l)})}),Array.from(t)})},[o,u,h]);const m=i.useMemo(()=>x.filter(s=>s.taskId?.startsWith("cp-")||s.taskId?.startsWith("ag-")).sort((s,t)=>new Date(t.lastActivity).getTime()-new Date(s.lastActivity).getTime()),[x]);i.useEffect(()=>{k(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==="ready").sort((s,t)=>new Date(t.metadata.createdAt).getTime()-new Date(s.metadata.createdAt).getTime()).slice(0,3),[$]),ae=()=>{const s=m.every(a=>j[a.id]),t={};m.forEach(a=>{t[a.id]=!s}),k(t)},ie=m.length>0&&m.every(s=>j[s.id]),ne=async s=>{await K(s)?(v({title:"Session closed",description:s}),setTimeout(()=>S(),100)):v({title:"Failed to close session",description:s,variant:"destructive"})},re=async()=>{P(!0);try{const s=`session-${Date.now()}`,t={taskId:s,contextType:"change-task",cliAgent:f,mcpServersMap:Z,selectedMcpServers:p,skills:u,selectedSkillIds:o,automationEnabled:!1,customInstruction:E.trim(),includeDefaultInstructions:!1};let a="";f==="claude"?a=Me(t):f==="gemini"?a=Te(t):f==="codex"?a=Ie(t):f==="droid"?a=$e(t):f==="kiro"&&(a=Ee(t)),await V(s,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{P(!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:"Agents"}),e.jsx("p",{className:"text-muted-foreground hidden sm:block",children:"Manage agents and their active sessions"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(r,{variant:"outline",size:"sm",onClick:()=>S(),disabled:b,children:[e.jsx(Pe,{className:`h-4 w-4 sm:mr-2 ${b?"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(ze,{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(Fe,{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"}),b?e.jsx("div",{className:"space-y-2",children:[...Array(2)].map((s,t)=>e.jsx(g,{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(g,{className:"p-8",children:e.jsxs("div",{className:"flex flex-col items-center justify-center text-center space-y-3",children:[e.jsx(Re,{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("/tasks"),className:"text-primary hover:underline font-medium",children:"New Task"})]})]})]})}):e.jsx("div",{className:"space-y-2",children:m.slice(0,10).map(s=>e.jsxs(g,{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(oe,{className:"h-4 w-4 shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-medium text-sm",children:s.taskId}),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:()=>{k(t=>({...t,[s.id]:!t[s.id]}))},"aria-label":j[s.id]?"Hide preview":"Show preview",title:j[s.id]?"Hide preview":"Show preview",children:j[s.id]?e.jsx(He,{className:"h-4 w-4"}):e.jsx(M,{className:"h-4 w-4"})}),e.jsx(r,{size:"sm",variant:"outline",onClick:()=>c(`/terminal/${s.taskId}`),children:"Open"}),e.jsx(r,{size:"icon",variant:"destructive",onClick:()=>ne(s.id),title:"Close session","aria-label":"Close session",children:e.jsx(me,{className:"h-4 w-4"})})]})]}),j[s.id]&&e.jsx("div",{className:"mt-2 w-full p-2 cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>c(`/terminal/${s.taskId}`),title:"Click to open full terminal session",children:e.jsx(Ce,{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"}),q?e.jsx("div",{className:"space-y-3",children:[...Array(3)].map((s,t)=>e.jsx(g,{children:e.jsx(ye,{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(g,{children:e.jsx(G,{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 tasks found"})})}):e.jsx("div",{className:"space-y-2",children:z.map(s=>e.jsx(g,{className:"hover:shadow-md transition-all cursor-pointer hover:border-primary/50",onClick:()=>c(`/terminal/${s.id}`),children:e.jsx(G,{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(we,{className:"text-base leading-tight",children:s.title||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(`
1
+ import{u as ce,a as de,r as i,j as e,B as r,T as oe,n as M,X as me,F as xe,_ as he,D as ue,b as fe,d as pe,f as je,k as ge,a5 as B,a6 as R,a7 as H,a8 as L,a9 as O,aa as _,a4 as ve,o as Ne,A as T}from"./index-6zt5f3rT.js";import{C as g,b as ye,a as G,c as we}from"./card-T1Zl_t-O.js";import{B as U}from"./badge-DXtacKLi.js";import{u as Se}from"./use-terminal-CQe1dgj2.js";import{T as Ce}from"./terminal-preview-Byv2z2nW.js";import{S as be,a as ke,b as Ae,c as De,d as w}from"./select-C7W_IjpH.js";import{b as Me,e as Te,d as Ie,c as $e,a as Ee}from"./pipeline-builders-Bkf0wt_O.js";import{R as Pe}from"./refresh-cw-DF2wDnWT.js";import{C as ze,a as Fe}from"./chevrons-up-CJo8Mkrm.js";import{P as Be}from"./play-BjJrEDlO.js";import{C as Re}from"./code-CQveJCBf.js";import{C as He}from"./chevron-up-C1j8XcMS.js";import"./xterm-DTxiCjtJ.js";import"./index-p7Qpxih7.js";const Le=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 ss(){const c=ce(),{sessions:x,loading:b,error:I,refreshSessions:S,createSession:V,destroySession:K}=Se(),{toast:v}=de(),[$,W]=i.useState([]),[q,X]=i.useState(!0),[j,k]=i.useState(()=>({})),[A,N]=i.useState(!1),[f,J]=i.useState("claude"),[E,Q]=i.useState(""),[D,P]=i.useState(!1),[h,Y]=i.useState([]),[p,y]=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/tasks`);if(t.ok){const a=await t.json(),n=a.data||a;W(Array.isArray(n)?n:[])}}catch(t){console.error("Error loading tasks:",t)}finally{X(!1)}})()},[]),i.useEffect(()=>{S()},[S]),i.useEffect(()=>{if(!A)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),y(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/skills`);if(t.ok){const a=await t.json(),d=(Array.isArray(a?.documents)?a.documents:[]).map(l=>({id:l.id,name:l?.metadata?.name||l.id,mcpServers:Le(l?.metadata?.metadata?.mcpServers)}));se(d),C(l=>l.filter(F=>d.some(le=>le.id===F)))}}catch(t){console.error("Failed to load skills",t)}})()},[A]),i.useEffect(()=>{o.length!==0&&y(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.mcpServers.forEach(l=>{(!a||a.has(l))&&t.add(l)})}),Array.from(t)})},[o,u,h]);const m=i.useMemo(()=>x.filter(s=>s.taskId?.startsWith("cp-")||s.taskId?.startsWith("ag-")).sort((s,t)=>new Date(t.lastActivity).getTime()-new Date(s.lastActivity).getTime()),[x]);i.useEffect(()=>{k(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==="ready").sort((s,t)=>new Date(t.metadata.createdAt).getTime()-new Date(s.metadata.createdAt).getTime()).slice(0,3),[$]),ae=()=>{const s=m.every(a=>j[a.id]),t={};m.forEach(a=>{t[a.id]=!s}),k(t)},ie=m.length>0&&m.every(s=>j[s.id]),ne=async s=>{await K(s)?(v({title:"Session closed",description:s}),setTimeout(()=>S(),100)):v({title:"Failed to close session",description:s,variant:"destructive"})},re=async()=>{P(!0);try{const s=`session-${Date.now()}`,t={taskId:s,contextType:"change-task",cliAgent:f,mcpServersMap:Z,selectedMcpServers:p,skills:u,selectedSkillIds:o,automationEnabled:!1,customInstruction:E.trim(),includeDefaultInstructions:!1};let a="";f==="claude"?a=Me(t):f==="gemini"?a=Te(t):f==="codex"?a=Ie(t):f==="droid"?a=$e(t):f==="kiro"&&(a=Ee(t)),await V(s,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{P(!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:"Agents"}),e.jsx("p",{className:"text-muted-foreground hidden sm:block",children:"Manage agents and their active sessions"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(r,{variant:"outline",size:"sm",onClick:()=>S(),disabled:b,children:[e.jsx(Pe,{className:`h-4 w-4 sm:mr-2 ${b?"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(ze,{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(Fe,{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"}),b?e.jsx("div",{className:"space-y-2",children:[...Array(2)].map((s,t)=>e.jsx(g,{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(g,{className:"p-8",children:e.jsxs("div",{className:"flex flex-col items-center justify-center text-center space-y-3",children:[e.jsx(Re,{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("/tasks"),className:"text-primary hover:underline font-medium",children:"New Task"})]})]})]})}):e.jsx("div",{className:"space-y-2",children:m.slice(0,10).map(s=>e.jsxs(g,{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(oe,{className:"h-4 w-4 shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-medium text-sm",children:s.taskId}),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:()=>{k(t=>({...t,[s.id]:!t[s.id]}))},"aria-label":j[s.id]?"Hide preview":"Show preview",title:j[s.id]?"Hide preview":"Show preview",children:j[s.id]?e.jsx(He,{className:"h-4 w-4"}):e.jsx(M,{className:"h-4 w-4"})}),e.jsx(r,{size:"sm",variant:"outline",onClick:()=>c(`/terminal/${s.taskId}`),children:"Open"}),e.jsx(r,{size:"icon",variant:"destructive",onClick:()=>ne(s.id),title:"Close session","aria-label":"Close session",children:e.jsx(me,{className:"h-4 w-4"})})]})]}),j[s.id]&&e.jsx("div",{className:"mt-2 w-full p-2 cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>c(`/terminal/${s.taskId}`),title:"Click to open full terminal session",children:e.jsx(Ce,{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"}),q?e.jsx("div",{className:"space-y-3",children:[...Array(3)].map((s,t)=>e.jsx(g,{children:e.jsx(ye,{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(g,{children:e.jsx(G,{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 tasks found"})})}):e.jsx("div",{className:"space-y-2",children:z.map(s=>e.jsx(g,{className:"hover:shadow-md transition-all cursor-pointer hover:border-primary/50",onClick:()=>c(`/terminal/${s.id}`),children:e.jsx(G,{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(we,{className:"text-base leading-tight",children:s.title||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
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(`/tasks/${s.id}`),className:"h-7 px-2 text-xs",children:[e.jsx(xe,{className:"h-3 w-3 mr-1"})," View"]}),e.jsxs(r,{variant:"ghost",size:"sm",onClick:()=>c(`/tasks/${s.id}/edit`),className:"h-7 px-2 text-xs",children:[e.jsx(he,{className:"h-3 w-3 mr-1"})," Edit"]})]})]})]})})})},s.id))})]}),e.jsx(ue,{open:A,onOpenChange:N,children:e.jsxs(fe,{className:"max-w-lg",children:[e.jsxs(pe,{children:[e.jsx(je,{children:"Start Agent"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Start an interactive 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:"Agent"}),e.jsxs(be,{value:f,onValueChange:s=>J(s),children:[e.jsx(ke,{className:"w-full",children:e.jsx(Ae,{placeholder:"Select coding agent"})}),e.jsxs(De,{children:[e.jsx(w,{value:"claude",children:"Claude Code"}),e.jsx(w,{value:"gemini",children:"Google Gemini"}),e.jsx(w,{value:"codex",children:"OpenAI Codex"}),e.jsx(w,{value:"droid",children:"Factory Droid"}),e.jsx(w,{value:"kiro",children:"Kiro"})]})]})]}),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(ge,{className:"h-4 w-4"}),"Skills"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[o.length," of ",u.length," selected"]})]}),e.jsxs(B,{children:[e.jsx(R,{asChild:!0,children:e.jsxs(r,{variant:"outline",className:"w-full justify-between",children:[o.length===0?"Select skills...":o.length===u.length?"All skills selected":`${o.length} skill${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 Skills"}),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 skills found"}):u.map(s=>e.jsx(_,{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.mcpServers.length>0&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["MCP servers: ",s.mcpServers.join(", ")]}),s.mcpServers.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(ve,{className:"h-4 w-4"}),"MCP Servers"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[p.length," of ",h.length," selected"]})]}),e.jsxs(B,{children:[e.jsx(R,{asChild:!0,children:e.jsxs(r,{variant:"outline",className:"w-full justify-between",children:[p.length===0?"Select MCP servers...":p.length===h.length?"All servers selected":`${p.length} server${p.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(),y(h)},children:"All"}),e.jsx(r,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:s=>{s.preventDefault(),y([])},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(_,{checked:p.includes(s),onCheckedChange:t=>{y(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(Ne,{value:E,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:re,disabled:D,children:D?"Starting...":"Start Session"})]})]})]})})]})}export{ss as default};
@@ -1 +1 @@
1
- import{r as x,j as e,e as a,n as m}from"./index-BWhM9fZn.js";function u({title:n,description:t,icon:r,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:[r,e.jsxs("div",{children:[e.jsx("p",{className:"font-medium leading-tight",children:n}),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};
1
+ import{r as x,j as e,e as a,n as m}from"./index-6zt5f3rT.js";function u({title:n,description:t,icon:r,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:[r,e.jsxs("div",{children:[e.jsx("p",{className:"font-medium leading-tight",children:n}),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};
@@ -1,4 +1,4 @@
1
- import{c as b,u as Re,a as Le,r as l,j as e,D as De,b as Ie,d as te,e as f,f as ae,g as ne,S as re,B as d,C as le,I as B,h as G,i as Pe,G as _e,F as qe,k as ue,Z as We,l as ze,m as Fe,T as ce,n as Ve,o as Be,L as v,P as Ee,M as Ke,K as A,p as g,q as $e,A as Ge}from"./index-BWhM9fZn.js";import{C as h,a as u,b as R,c as L,d as ie}from"./card-jBf8qQSy.js";import{B as He}from"./badge-CKqDVhJv.js";import{g as Oe}from"./status-utils-PwF3DXLL.js";import{L as Ye}from"./label-CHVVHrlr.js";import{S as oe,a as de,b as me,c as xe,d as E}from"./select-D8HyxWyg.js";import{u as Qe}from"./use-terminal-CrqBojgD.js";import{T as Ue}from"./terminal-preview-BkQIuk__.js";import{C as Ze}from"./circle-check-qo4cPVA1.js";import{C as Je}from"./chevron-left-D1qHCYRd.js";import{S as Xe}from"./search-SRuczbr5.js";import{G as es}from"./globe-BZEWER4V.js";import{C as ss}from"./code-Bi-U-NxE.js";import{F as ts}from"./folder-git-2-ixHmuqNj.js";import{E as as}from"./external-link-DRsIhdWR.js";import{P as ns}from"./play-BTA0gBuh.js";import{C as rs}from"./clock-DTp411N-.js";import{C as ls}from"./circle-check-big-DDQIqE0G.js";import"./index-CdmUQF6-.js";import"./chevron-up-CcwaoTsZ.js";import"./xterm-DTxiCjtJ.js";/**
1
+ import{c as b,u as Re,a as Le,r as l,j as e,D as De,b as Ie,d as te,e as f,f as ae,g as ne,S as re,B as d,C as le,I as B,h as G,i as Pe,G as _e,F as qe,k as ue,Z as We,l as ze,m as Fe,T as ce,n as Ve,o as Be,L as v,P as Ee,M as Ke,K as A,p as g,q as $e,A as Ge}from"./index-6zt5f3rT.js";import{C as h,a as u,b as R,c as L,d as ie}from"./card-T1Zl_t-O.js";import{B as He}from"./badge-DXtacKLi.js";import{g as Oe}from"./status-utils-PwF3DXLL.js";import{L as Ye}from"./label-CSt-eWXG.js";import{S as oe,a as de,b as me,c as xe,d as E}from"./select-C7W_IjpH.js";import{u as Qe}from"./use-terminal-CQe1dgj2.js";import{T as Ue}from"./terminal-preview-Byv2z2nW.js";import{C as Ze}from"./circle-check-D4Eo7NeP.js";import{C as Je}from"./chevron-left-CHIuYPig.js";import{S as Xe}from"./search-CYS9xEgy.js";import{G as es}from"./globe-DZ1sD-ad.js";import{C as ss}from"./code-CQveJCBf.js";import{F as ts}from"./folder-git-2-Y7dQhpIc.js";import{E as as}from"./external-link-B6lRGdDG.js";import{P as ns}from"./play-BjJrEDlO.js";import{C as rs}from"./clock-t6EXtqFH.js";import{C as ls}from"./circle-check-big-Dw0wgLkY.js";import"./index-p7Qpxih7.js";import"./chevron-up-C1j8XcMS.js";import"./xterm-DTxiCjtJ.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as le,A as l,bI as ws,r as n,a as vs,ad as ys,j as e,L as ee,l as $e,B as o,G as D,ab as Ns,X as Cs,I as k,n as Me,H as Be,D as se,b as te,d as ae,f as re,g as ne,bF as ks,Y as Oe}from"./index-BWhM9fZn.js";import{C as ie}from"./card-jBf8qQSy.js";import{L as Re}from"./label-CHVVHrlr.js";import{T as Ss,a as Ps,b as Ge,c as We}from"./tabs-CmFe8eVW.js";import{C as Ts}from"./circle-check-qo4cPVA1.js";import{C as As}from"./circle-x-Bd57ohC5.js";import{A as Ds}from"./arrow-down-7VoAlw8h.js";import{A as Es}from"./arrow-up-Bozm6eto.js";import{R as ze}from"./refresh-cw-DLJpfa8_.js";import{C as ce}from"./circle-alert-DqK0nUqF.js";import{C as Ie}from"./chevron-up-CcwaoTsZ.js";import{F as oe}from"./folder-git-2-ixHmuqNj.js";/**
1
+ import{c as le,A as l,bI as ws,r as n,a as vs,ad as ys,j as e,L as ee,l as $e,B as o,G as D,ab as Ns,X as Cs,I as k,n as Me,H as Be,D as se,b as te,d as ae,f as re,g as ne,bF as ks,Y as Oe}from"./index-6zt5f3rT.js";import{C as ie}from"./card-T1Zl_t-O.js";import{L as Re}from"./label-CSt-eWXG.js";import{T as Ss,a as Ps,b as Ge,c as We}from"./tabs-CqVmSyiJ.js";import{C as Ts}from"./circle-check-D4Eo7NeP.js";import{C as As}from"./circle-x-i-p09ZTc.js";import{A as Ds}from"./arrow-down-BS_gkmFX.js";import{A as Es}from"./arrow-up-DEdQz7h4.js";import{R as ze}from"./refresh-cw-DF2wDnWT.js";import{C as ce}from"./circle-alert-C-TQDAZH.js";import{C as Ie}from"./chevron-up-C1j8XcMS.js";import{F as oe}from"./folder-git-2-Y7dQhpIc.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as He,r,a as Te,A as u,j as e,bD as he,B as o,H as Fe,v as De,bF as ze,I as U,D as W,b as B,d as q,f as J,g as K,Y}from"./index-BWhM9fZn.js";import{C as xe,b as pe,c as ge,d as fe,a as be}from"./card-jBf8qQSy.js";import{L as f}from"./label-CHVVHrlr.js";import{R as Me,a as je}from"./radio-group-BO2__pxZ.js";import{R as A}from"./refresh-cw-DLJpfa8_.js";import{E as ve}from"./external-link-DRsIhdWR.js";import{C as Oe}from"./circle-check-qo4cPVA1.js";import{C as Ie}from"./circle-x-Bd57ohC5.js";/**
1
+ import{c as He,r,a as Te,A as u,j as e,bD as he,B as o,H as Fe,v as De,bF as ze,I as U,D as W,b as B,d as q,f as J,g as K,Y}from"./index-6zt5f3rT.js";import{C as xe,b as pe,c as ge,d as fe,a as be}from"./card-T1Zl_t-O.js";import{L as f}from"./label-CSt-eWXG.js";import{R as Me,a as je}from"./radio-group-CLFgSQkD.js";import{R as A}from"./refresh-cw-DF2wDnWT.js";import{E as ve}from"./external-link-B6lRGdDG.js";import{C as Oe}from"./circle-check-D4Eo7NeP.js";import{C as Ie}from"./circle-x-i-p09ZTc.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as ge,a as ve,r as u,j as e,v as se,B as x,a1 as fe,a0 as Ne,bB as be,i as Ce,Z as Te,bC as Se,I as c,o as O,ab as ae,P as E,bD as ne,H as we,A as ie}from"./index-BWhM9fZn.js";import{C as y,b as j,c as g,d as v,a as f,e as Ae}from"./card-jBf8qQSy.js";import{L as o}from"./label-CHVVHrlr.js";import{B as re}from"./badge-CKqDVhJv.js";import{S as ke,a as Ie,b as Oe,c as Fe,d as Pe}from"./select-D8HyxWyg.js";import{A as Ee,a as Me}from"./alert-CMfexl-V.js";import{T as De,a as Le,b as T,c as S}from"./tabs-CmFe8eVW.js";import{E as Ue}from"./eye-jqpFU8Rl.js";import{C as _e,a as Re}from"./clipboard-JQLlAwqS.js";import"./index-CdmUQF6-.js";import"./chevron-up-CcwaoTsZ.js";/**
1
+ import{c as ge,a as ve,r as u,j as e,v as se,B as x,a1 as fe,a0 as Ne,bB as be,i as Ce,Z as Te,bC as Se,I as c,o as O,ab as ae,P as E,bD as ne,H as we,A as ie}from"./index-6zt5f3rT.js";import{C as y,b as j,c as g,d as v,a as f,e as Ae}from"./card-T1Zl_t-O.js";import{L as o}from"./label-CSt-eWXG.js";import{B as re}from"./badge-DXtacKLi.js";import{S as ke,a as Ie,b as Oe,c as Fe,d as Pe}from"./select-C7W_IjpH.js";import{A as Ee,a as Me}from"./alert-BLA1YxSF.js";import{T as De,a as Le,b as T,c as S}from"./tabs-CqVmSyiJ.js";import{E as Ue}from"./eye-BmQvWYqM.js";import{C as _e,a as Re}from"./clipboard-CAJMRUqv.js";import"./index-p7Qpxih7.js";import"./chevron-up-C1j8XcMS.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as u,j as e,e as p,B as c,H as x,I as j,P as v}from"./index-BWhM9fZn.js";import{L as r}from"./label-CHVVHrlr.js";import{S,a as y,b,c as f,d as k}from"./select-D8HyxWyg.js";/**
1
+ import{c as u,j as e,e as p,B as c,H as x,I as j,P as v}from"./index-6zt5f3rT.js";import{L as r}from"./label-CSt-eWXG.js";import{S,a as y,b,c as f,d as k}from"./select-C7W_IjpH.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.